From 7f6fa7d8b4efe045ecb50e9ec22a811255214e5f Mon Sep 17 00:00:00 2001
From: chenhaozhe <cgz@hz-kingdee.com>
Date: 星期六, 11 十月 2025 15:32:56 +0800
Subject: [PATCH] 修改 生产领料校验,采购入库校验 提交相关 异步请求修改为同步+锁
---
utils/common.js | 38 +
pages/caigourukujiaoyan/form.vue | 981 ++++++++++++++++++++++-----------
pages/shengchanlingliao/form.vue | 695 ++++++++++++++++-------
3 files changed, 1,175 insertions(+), 539 deletions(-)
diff --git a/pages/caigourukujiaoyan/form.vue b/pages/caigourukujiaoyan/form.vue
index b98cfcb..dfe29ec 100644
--- a/pages/caigourukujiaoyan/form.vue
+++ b/pages/caigourukujiaoyan/form.vue
@@ -312,57 +312,113 @@
})
},
//鎵弿鍗曟嵁鍙锋潯鐮�
- GetMeesageByBillNo(e) {
- if(this.hform.HBillNo==""||this.hform.HBillNo==undefined){
- return
- }
- uni.request({
- url: this.serverUrl + '/WEBSController/get_BillBarCode_BillCheck_Json',
- data: {
- HBillNo: this.hform.HBillNo,
- HBillType: this.hform.HBillType,
- HMaker: this.hform.HMaker,
- HStockOrgID: this.hform.HStockOrgID
- },
- success: (res) => {
- if (res.data.count == 1) {
- CommonUtils.playSound(1);
- var data = res.data.data
- console.log('鍗曟嵁淇℃伅: ', data)
- this.hform.HInterID = data.hInterIDField
- this.hform.HBillNo = data.hBillNoField
- this.showHBillNo = false
- //鏉$爜鏍稿鏍囪
- if (data.hSourceBarCodeFlagField) {
- this.hform.HSourceBarCodeCtl = "Y"
- this.hform.chkHBarflag = true
- this.hform.HBarflag = data
- }
- this.tabs = 2
- this.DisBillEntryList();
- this.refreshHBarCodeFocus()
- } else {
- CommonUtils.playSound(0);
- this.refreshHBillNoFocus()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
-
- // this.hform.HBillNo = ''
- }
- },
- fail: (res) => {
- CommonUtils.playSound(0);
+ async GetMeesageByBillNo(e) {
+ if (this.hform.HBillNo == "" || this.hform.HBillNo == undefined) {
+ return
+ }
+
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/get_BillBarCode_BillCheck_Json',
+ data: {
+ HBillNo: this.hform.HBillNo,
+ HBillType: this.hform.HBillType,
+ HMaker: this.hform.HMaker,
+ HStockOrgID: this.hform.HStockOrgID
+ },
+ })
+
+ if (!res) {
+ // 瑙﹀彂璇锋眰閿侊紝涓嶈繑鍥炰换浣曞��
+ return
+ }
+
+ let {
+ data,
+ Message,
+ count
+ } = res.data
+ if (count == 1) {
+ CommonUtils.playSound(1)
+ console.log(data)
+ this.hform.HInterID = data.hInterIDField
+ this.hform.HBillNo = data.hBillNoField
+ this.showHBillNo = false
+ //鏉$爜鏍稿鏍囪
+ if (data.hSourceBarCodeFlagField) {
+ this.hform.HSourceBarCodeCtl = "Y"
+ this.hform.chkHBarflag = true
+ this.hform.HBarflag = data
+ }
+ this.tabs = 2
+ this.DisBillEntryList();
+ this.refreshHBarCodeFocus()
+ } else {
+ CommonUtils.playSound(0)
this.refreshHBillNoFocus()
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
- },
+ uni.showToast({
+ title: Message,
+ icon: 'none'
+ })
+ this.hform.HBillNo = ''
+ }
+
+ } catch (e) {
+ CommonUtils.playSound(0)
+ this.refreshHBillNoFocus()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/get_BillBarCode_BillCheck_Json',
+ // data: {
+ // HBillNo: this.hform.HBillNo,
+ // HBillType: this.hform.HBillType,
+ // HMaker: this.hform.HMaker,
+ // HStockOrgID: this.hform.HStockOrgID
+ // },
+ // success: (res) => {
+ // if (res.data.count == 1) {
+ // CommonUtils.playSound(1);
+ // var data = res.data.data
+ // console.log('鍗曟嵁淇℃伅: ', data)
+ // this.hform.HInterID = data.hInterIDField
+ // this.hform.HBillNo = data.hBillNoField
+ // this.showHBillNo = false
+ // //鏉$爜鏍稿鏍囪
+ // if (data.hSourceBarCodeFlagField) {
+ // this.hform.HSourceBarCodeCtl = "Y"
+ // this.hform.chkHBarflag = true
+ // this.hform.HBarflag = data
+ // }
+ // this.tabs = 2
+ // this.DisBillEntryList();
+ // this.refreshHBarCodeFocus()
+ // } else {
+ // CommonUtils.playSound(0);
+ // this.refreshHBillNoFocus()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ //
+ // // this.hform.HBillNo = ''
+ // }
+ // },
+ // fail: (res) => {
+ // CommonUtils.playSound(0);
+ // this.refreshHBillNoFocus()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
+ },
//鍩虹浠撳簱璧勬枡
getHBaseList() {
uni.request({
@@ -449,202 +505,377 @@
}
}
},
- getCode(HBarCode) {
- console.log(HBarCode);
- if(HBarCode==undefined||HBarCode==""){
- return
- }
- //浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
- if (!this.hform.HWHName) {
- this.hform.HWHID = 0
- }
- if (!this.hform.HStockPlaceName) {
- this.hform.HStockPlaceID = 0
- }
- var sOldBarCode = HBarCode
- var HDeleteFlag = sOldBarCode.substring(0, 1);
- var sBarCode = sOldBarCode.slice(1);
-
- var sHWHID = this.hform.HWHID
- var sHSPID = this.hform.HStockPlaceID
- var sHQty = this.hform.HQty
- var sSourceBillNo = this.hform.HSourceBillNo
- var sSourceBillType = this.hform.HMainSourceBillType
- var HSourceFlag = this.hform.HSourceBillNo == '' ? false : true
- console.log(this.hform.HSourceBillNo, HSourceFlag)
- if (HDeleteFlag == "*") {
- if (sBarCode == "") {
- uni.showToast({
- title: '璇疯緭鍏ヨ鍒犻櫎鐨勬潯鐮�',
- icon: 'none'
- })
- } else {
- uni.request({
- url: this.serverUrl + '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
- data: {
- HInterID: this.hform.HInterID,
- HBillType: this.hform.HBillType,
- HBarCode: sBarCode
- },
- success: (res) => {
- console.log('鍒犻櫎鏉$爜', res.data);
- this.hform.HBarCode = ''
- if (res.data.count == 1) {
- this.hform.HQty = ''
- this.DisBillEntryList()
- } else {
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
- }
- } else {
- var sBarCode = this.hform.HBarCode
- if (sHQty == "") {
- sHQty = 0;
- }
- console.log("鍗曟嵁淇℃伅: ", this.hform)
- uni.request({
- url: this.serverUrl + '/WEBSController/get_CheckTypeByBarCode_BillCheck_Json',
- data: {
- sBarCode: sBarCode,
- HBillID: this.hform.HInterID || 0,
- HBillType: this.hform.HBillType,
- HBillNo: this.hform.HBillNo,
- HMaker: this.hform.HMaker,
- HWhID: sHWHID,
- HSPID: sHSPID,
- HQty: sHQty,
- // HRedBlueFlag: this.hform.HRedBlueFlag,
- // SourceFlag: HSourceFlag,
- // HSourceBillNo: sSourceBillNo,
- // HSourceBillType: sSourceBillType,
- HStockOrgID: this.hform.HStockOrgID,
- // HScanStyle: "",
- // HCustom1: "",
- // HCustom2: ""
- },
- success: (res) => {
- console.log('鎵爜杩斿洖', res.data);
- // this.hform.HBarCode = ''
- if (res.data.count == 1) {
- CommonUtils.playSound(1);
- var data = res.data.data
- if (data.hBarTypeField == '浠撳簱鏉$爜') {
- this.hform.HWHName = data.hWhNameField
- this.hform.HWHID = data.hWhIDField
- this.hform.HStockPlaceName = ''
- this.hform.HStockPlaceID = 0
- // if (data.hSPFlagField == 0) {
- // this.showHStockPlaceName = false
- // } else {
- // this.showHStockPlaceName = true
- // }
- } else if (data.hBarTypeField == '浠撲綅鏉$爜') {
- this.hform.HWHName = data.hWhNameField
- this.hform.HWHID = data.hWhIDField
- this.hform.HStockPlaceName = data.hSPNameField
- this.hform.HStockPlaceID = data.hSPIDField
- } else if (data.hBarTypeField == '閮ㄩ棬鏉$爜') {
- this.hform.HDeptName = data.hDeptNameField
- this.hform.HDeptID = data.hDeptIDField
- this.tabs = 1
- } else if (data.hBarTypeField == '婧愬崟鏉$爜') {
- this.hform.HSupName = data.hSupNameField
- this.hform.HSupID = data.hSupIDField
- if (data.hDeptIDField != 0) {
- this.hform.HDeptID = data.hDeptIDField
- this.hform.HDeptName = data.hDeptNameField
- }
- this.hform.HSourceBillNo = data.hSourceBillNoField
- //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
- if (data.hSourceBillTypeField == "1103") {
- this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
- this.hform.HMainSourceBillType = 1103
- this.showHMainSourceBillType = false
- } else if (data.hSourceBillTypeField == "1102") {
- this.HMainSourceBillType = '閲囪喘璁㈠崟'
- this.hform.HMainSourceBillType = 1102
- this.showHMainSourceBillType = false
- } else {
- this.HMainSourceBillType = '鎵嬪伐褰曞叆'
- this.hform.HMainSourceBillType = -1
- this.showHMainSourceBillType = false
- }
- if (data.hMulSourceFlagField == 0) {
- this.showHSourceBillNo = false
- }
- //渚涘簲鍟嗕笉鍙紪杈�
- this.showHSupName = false
- this.tabs = 2
- } else { //鐗╂枡鏉$爜
- this.tabs = 2
- if (!this.hform.HSourceBillNo) {
- this.hform.HSupName = data.hSupNameField
- this.hform.HSupID = data.hSupIDField
- this.hform.HSourceBillNo = data.hSourceBillNoField
- if (data.hDeptIDField != 0) {
- this.hform.HDeptID = data.hDeptIDField
- this.hform.HDeptName = data.hDeptNameField
- }
- console.log(data)
- //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- if (data.hSourceBillTypeField == "1103") {
- this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
- this.hform.HMainSourceBillType = 1103
- this.showHMainSourceBillType = false
- } else if (data.hSourceBillTypeField == "1102") {
- this.HMainSourceBillType = '閲囪喘璁㈠崟'
- this.hform.HMainSourceBillType = 1102
- this.showHMainSourceBillType = false
- } else {
- this.HMainSourceBillType = '鎵嬪伐褰曞叆'
- this.hform.HMainSourceBillType = -1
- this.showHMainSourceBillType = false
- }
- if (data.hMulSourceFlagField == 0) {
- this.showHSourceBillNo = false
- }
- //渚涘簲鍟嗕笉鍙紪杈�
- this.showHSupName = false
- }
- }
- //鏄剧ず琛ㄤ綋鏄庣粏
- this.DisBillEntryList()
- //娓呯┖鏁伴噺
- this.hform.HQty = ''
- } else {
- CommonUtils.playSound(0);
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- }
-
- this.refreshHBarCodeFocus()
- },
- fail: (res) => {
- CommonUtils.playSound(0);
- console.log(res);
- this.refreshHBarCodeFocus()
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
- }
+ //鎵潯鐮佸鐞�
+ async getCode(HBarCode) {
+ if (HBarCode == undefined || HBarCode == "") {
+ return
+ }
+ //浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
+ if (!this.hform.HWHName) {
+ this.hform.HWHID = 0
+ }
+ if (!this.hform.HStockPlaceName) {
+ this.hform.HStockPlaceID = 0
+ }
+ var sOldBarCode = HBarCode
+ var HDeleteFlag = sOldBarCode.substring(0, 1);
+ var sBarCode = sOldBarCode.slice(1);
+
+ var sHWHID = this.hform.HWHID
+ var sHSPID = this.hform.HStockPlaceID
+ var sHQty = this.hform.HQty
+ var sSourceBillNo = this.hform.HSourceBillNo
+ var sSourceBillType = this.hform.HMainSourceBillType
+ var HSourceFlag = this.hform.HSourceBillNo == '' ? false : true
+ console.log(this.hform.HSourceBillNo, HSourceFlag)
+ if (HDeleteFlag == "*") {
+ if (sBarCode == "") {
+ uni.showToast({
+ title: '璇疯緭鍏ヨ鍒犻櫎鐨勬潯鐮�',
+ icon: 'none'
+ })
+ } else {
+ try {
+
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBarCode: sBarCode
+ },
+ })
+
+ if (!res) {
+ // 璇锋眰琚攣瀹氾紝閫�鍑哄綋鍓嶈姹�
+ return
+ }
+
+ console.log('鍒犻櫎鏉$爜', res.data);
+ this.hform.HBarCode = ''
+ if (res.data.count == 1) {
+ this.hform.HQty = ''
+ this.DisBillEntryList()
+ } else {
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+
+ } catch (e) {
+ CommonUtils.playSound(0)
+ this.refreshHBillNoFocus()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl +
+ // '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ // data: {
+ // HInterID: this.hform.HInterID,
+ // HBillType: this.hform.HBillType,
+ // HBarCode: sBarCode
+ // },
+ // success: (res) => {
+ // console.log('鍒犻櫎鏉$爜', res.data);
+ // this.hform.HBarCode = ''
+ // if (res.data.count == 1) {
+ // this.hform.HQty = ''
+ // this.DisBillEntryList()
+ // } else {
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
+ }
+ } else {
+ var sBarCode = this.hform.HBarCode
+ if (sHQty == "") {
+ sHQty = 0;
+ }
+
+ try {
+
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/get_CheckTypeByBarCode_BillCheck_Json',
+ data: {
+ sBarCode: sBarCode,
+ HBillID: this.hform.HInterID || 0,
+ HBillType: this.hform.HBillType,
+ HBillNo: this.hform.HBillNo,
+ HMaker: this.hform.HMaker,
+ HWhID: sHWHID,
+ HSPID: sHSPID,
+ HQty: sHQty,
+ // HRedBlueFlag: this.hform.HRedBlueFlag,
+ // SourceFlag: HSourceFlag,
+ // HSourceBillNo: sSourceBillNo,
+ // HSourceBillType: sSourceBillType,
+ HStockOrgID: this.hform.HStockOrgID,
+ // HScanStyle: "",
+ // HCustom1: "",
+ // HCustom2: ""
+ },
+ })
+
+ if (!res) {
+ return
+ }
+
+ console.log('鎵爜杩斿洖', res.data);
+ this.hform.HBarCode = ''
+ if (res.data.count == 1) {
+ CommonUtils.playSound(1);
+ var data = res.data.data
+ if (data.hBarTypeField == '浠撳簱鏉$爜') {
+ this.hform.HWHName = data.hWhNameField
+ this.hform.HWHID = data.hWhIDField
+ this.hform.HStockPlaceName = ''
+ this.hform.HStockPlaceID = 0
+ if (data.hSPFlagField == 0) {
+ this.showHStockPlaceName = false
+ } else {
+ this.showHStockPlaceName = true
+ }
+ } else if (data.hBarTypeField == '浠撲綅鏉$爜') {
+ this.hform.HWHName = data.hWhNameField
+ this.hform.HWHID = data.hWhIDField
+ this.hform.HStockPlaceName = data.hSPNameField
+ this.hform.HStockPlaceID = data.hSPIDField
+ } else if (data.hBarTypeField == '閮ㄩ棬鏉$爜') {
+ this.hform.HDeptName = data.hDeptNameField
+ this.hform.HDeptID = data.hDeptIDField
+ this.tabs = 1
+ } else if (data.hBarTypeField == '婧愬崟鏉$爜') {
+ this.hform.HSupName = data.hSupNameField
+ this.hform.HSupID = data.hSupIDField
+ if (data.hDeptIDField != 0) {
+ this.hform.HDeptID = data.hDeptIDField
+ this.hform.HDeptName = data.hDeptNameField
+ }
+ this.hform.HSourceBillNo = data.hSourceBillNoField
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ if (data.hSourceBillTypeField == "1103") {
+ this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+ this.hform.HMainSourceBillType = 1103
+ this.showHMainSourceBillType = false
+ } else if (data.hSourceBillTypeField == "1102") {
+ this.HMainSourceBillType = '閲囪喘璁㈠崟'
+ this.hform.HMainSourceBillType = 1102
+ this.showHMainSourceBillType = false
+ } else {
+ this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+ this.hform.HMainSourceBillType = -1
+ this.showHMainSourceBillType = false
+ }
+ if (data.hMulSourceFlagField == 0) {
+ this.showHSourceBillNo = false
+ }
+ //渚涘簲鍟嗕笉鍙紪杈�
+ this.showHSupName = false
+ this.tabs = 2
+ } else { //鐗╂枡鏉$爜
+ this.tabs = 2
+ console.log('data', data)
+ if (!this.hform.HSourceBillNo) {
+ this.hform.HSupName = data.hSupNameField
+ this.hform.HSupID = data.hSupIDField
+ this.hform.HSourceBillNo = data.hSourceBillNoField
+ if (data.hDeptIDField != 0) {
+ this.hform.HDeptID = data.hDeptIDField
+ this.hform.HDeptName = data.hDeptNameField
+ }
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ if (data.hSourceBillTypeField == "1103") {
+ this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+ this.hform.HMainSourceBillType = 1103
+ this.showHMainSourceBillType = false
+ } else if (data.hSourceBillTypeField == "1102") {
+ this.HMainSourceBillType = '閲囪喘璁㈠崟'
+ this.hform.HMainSourceBillType = 1102
+ this.showHMainSourceBillType = false
+ } else {
+ this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+ this.hform.HMainSourceBillType = -1
+ this.showHMainSourceBillType = false
+ }
+ if (data.hMulSourceFlagField == 0) {
+ this.showHSourceBillNo = false
+ }
+ //渚涘簲鍟嗕笉鍙紪杈�
+ this.showHSupName = false
+ }
+ }
+ //鏄剧ず琛ㄤ綋鏄庣粏
+ this.DisBillEntryList()
+ //娓呯┖鏁伴噺
+ this.hform.HQty = ''
+ } else {
+ CommonUtils.playSound(0);
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+
+ this.refreshHBarCodeFocus()
+
+ } catch (e) {
+ CommonUtils.playSound(0)
+ this.refreshHBillNoFocus()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/get_CheckTypeByBarCode_BillCheck_Json',
+ // data: {
+ // sBarCode: sBarCode,
+ // HBillID: this.hform.HInterID || 0,
+ // HBillType: this.hform.HBillType,
+ // HBillNo: this.hform.HBillNo,
+ // HMaker: this.hform.HMaker,
+ // HWhID: sHWHID,
+ // HSPID: sHSPID,
+ // HQty: sHQty,
+ // // HRedBlueFlag: this.hform.HRedBlueFlag,
+ // // SourceFlag: HSourceFlag,
+ // // HSourceBillNo: sSourceBillNo,
+ // // HSourceBillType: sSourceBillType,
+ // HStockOrgID: this.hform.HStockOrgID,
+ // // HScanStyle: "",
+ // // HCustom1: "",
+ // // HCustom2: ""
+ // },
+ // success: (res) => {
+ // console.log('鎵爜杩斿洖', res.data);
+ // this.hform.HBarCode = ''
+ // if (res.data.count == 1) {
+ // CommonUtils.playSound(1);
+ // var data = res.data.data
+ // if (data.hBarTypeField == '浠撳簱鏉$爜') {
+ // this.hform.HWHName = data.hWhNameField
+ // this.hform.HWHID = data.hWhIDField
+ // this.hform.HStockPlaceName = ''
+ // this.hform.HStockPlaceID = 0
+ // if (data.hSPFlagField == 0) {
+ // this.showHStockPlaceName = false
+ // } else {
+ // this.showHStockPlaceName = true
+ // }
+ // } else if (data.hBarTypeField == '浠撲綅鏉$爜') {
+ // this.hform.HWHName = data.hWhNameField
+ // this.hform.HWHID = data.hWhIDField
+ // this.hform.HStockPlaceName = data.hSPNameField
+ // this.hform.HStockPlaceID = data.hSPIDField
+ // } else if (data.hBarTypeField == '閮ㄩ棬鏉$爜') {
+ // this.hform.HDeptName = data.hDeptNameField
+ // this.hform.HDeptID = data.hDeptIDField
+ // this.tabs = 1
+ // } else if (data.hBarTypeField == '婧愬崟鏉$爜') {
+ // this.hform.HSupName = data.hSupNameField
+ // this.hform.HSupID = data.hSupIDField
+ // if (data.hDeptIDField != 0) {
+ // this.hform.HDeptID = data.hDeptIDField
+ // this.hform.HDeptName = data.hDeptNameField
+ // }
+ // this.hform.HSourceBillNo = data.hSourceBillNoField
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ // if (data.hSourceBillTypeField == "1103") {
+ // this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+ // this.hform.HMainSourceBillType = 1103
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "1102") {
+ // this.HMainSourceBillType = '閲囪喘璁㈠崟'
+ // this.hform.HMainSourceBillType = 1102
+ // this.showHMainSourceBillType = false
+ // } else {
+ // this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+ // this.hform.HMainSourceBillType = -1
+ // this.showHMainSourceBillType = false
+ // }
+ // if (data.hMulSourceFlagField == 0) {
+ // this.showHSourceBillNo = false
+ // }
+ // //渚涘簲鍟嗕笉鍙紪杈�
+ // this.showHSupName = false
+ // this.tabs = 2
+ // } else { //鐗╂枡鏉$爜
+ // this.tabs = 2
+ // console.log('data', data)
+ // if (!this.hform.HSourceBillNo) {
+ // this.hform.HSupName = data.hSupNameField
+ // this.hform.HSupID = data.hSupIDField
+ // this.hform.HSourceBillNo = data.hSourceBillNoField
+ // if (data.hDeptIDField != 0) {
+ // this.hform.HDeptID = data.hDeptIDField
+ // this.hform.HDeptName = data.hDeptNameField
+ // }
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // if (data.hSourceBillTypeField == "1103") {
+ // this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+ // this.hform.HMainSourceBillType = 1103
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "1102") {
+ // this.HMainSourceBillType = '閲囪喘璁㈠崟'
+ // this.hform.HMainSourceBillType = 1102
+ // this.showHMainSourceBillType = false
+ // } else {
+ // this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+ // this.hform.HMainSourceBillType = -1
+ // this.showHMainSourceBillType = false
+ // }
+ // if (data.hMulSourceFlagField == 0) {
+ // this.showHSourceBillNo = false
+ // }
+ // //渚涘簲鍟嗕笉鍙紪杈�
+ // this.showHSupName = false
+ // }
+ // }
+ // //鏄剧ず琛ㄤ綋鏄庣粏
+ // this.DisBillEntryList()
+ // //娓呯┖鏁伴噺
+ // this.hform.HQty = ''
+ // } else {
+ // CommonUtils.playSound(0);
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ //
+ // this.refreshHBarCodeFocus()
+ // },
+ // fail: (res) => {
+ // CommonUtils.playSound(0);
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ //
+ // this.refreshHBarCodeFocus()
+ // },
+ // });
+ }
},
//鐗╂枡淇℃伅
DisBillEntryList() {
@@ -736,91 +967,179 @@
}
});
},
- submit() {
- if (this.hform.HInterID == 0 || !this.hform.HInterID) {
- uni.showToast({
- title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忓崟鎹潯鐮侊紒',
- icon: 'none'
- })
- } else if (!this.hform.HBillNo) {
- uni.showToast({
- title: '鍗曟嵁鍙疯幏鍙栧け璐ワ紝閿欒鐨勫崟鎹彿锛�',
- icon: 'none'
- })
- } else if (!this.Materlist || this.Materlist.length == 0) {
- uni.showToast({
- title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忔潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
- icon: 'none'
- })
- } else {
- var s = 0;
- for (var i = 0; i < this.Materlist.length; i++) {
- if (this.Materlist[i].鏁伴噺 > 0) {
- s = 1;
- }
- }
- if (s == 0) {
- uni.showToast({
- title: '娌℃湁鎵弿鐗╂枡鏉$爜锛岃鍏堟壂鎻忕墿鏂欐潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
- icon: 'none'
- })
- } else {
- uni.showLoading({
- title: '璇风◢鍊�'
- })
- var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SavePOStockInBill_BillCheck_Json',
- method: 'POST',
- dataType: "json",
- data: {
- oMain: sMainStr
- },
- success: (res) => {
- console.log(1, res);
- uni.hideLoading()
- if (res.data.count == 1) {
- uni.showModal({
- title: '鎻愮ず',
- content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
- success: (res) => {
- if (res.confirm) {
- console.log('鐢ㄦ埛鐐瑰嚮纭畾');
- uni.redirectTo({
- url: '/pages/caigourukujiaoyan/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- setTimeout(() => {
- uni.navigateBack();
- }, 50)
- }
- }
- });
- } else {
- // uni.showToast({
- // title: res.data.Message,
- // icon: 'none'
- // })
-
- uni.showModal({
- title: '娓╅Θ鎻愮ず',
- content: res.data.Message,
- showCancel: false
- })
- }
- },
- fail: (res) => {
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
- }
- }
- },
+ async submit() {
+ if (this.hform.HInterID == 0 || !this.hform.HInterID) {
+ uni.showToast({
+ title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忓崟鎹潯鐮侊紒',
+ icon: 'none'
+ })
+ } else if (!this.hform.HBillNo) {
+ uni.showToast({
+ title: '鍗曟嵁鍙疯幏鍙栧け璐ワ紝閿欒鐨勫崟鎹彿锛�',
+ icon: 'none'
+ })
+ } else if (!this.Materlist || this.Materlist.length == 0) {
+ uni.showToast({
+ title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忔潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
+ icon: 'none'
+ })
+ } else {
+ var s = 0;
+ for (var i = 0; i < this.Materlist.length; i++) {
+ if (this.Materlist[i].鏁伴噺 > 0) {
+ s = 1;
+ }
+ }
+ // if (s == 0) {
+ // uni.showToast({
+ // title: '娌℃湁鎵弿鐗╂枡鏉$爜锛岃鍏堟壂鎻忕墿鏂欐潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
+ // icon: 'none'
+ // })
+ // } else
+ {
+ uni.showLoading({
+ title: '璇风◢鍊�'
+ })
+ var sMainStr = JSON.stringify(this.hform);
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SavePOStockInBill_BillCheck_Json',
+ method: 'POST',
+ data: {
+ oMain: sMainStr
+ },
+ })
+
+ if(!res) {
+ return
+ }
+
+ console.log(1, res);
+ uni.hideLoading()
+ if (res.data.count == 1) {
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: '/pages/caigourukujiaoyan/form?OperationType=1'
+ })
+ } else if (res.cancel) {
+ console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ setTimeout(() => {
+ uni.navigateBack();
+ }, 50)
+ }
+ }
+ });
+ } else {
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+
+ } catch (e) {
+ CommonUtils.playSound(0)
+ this.refreshHBillNoFocus()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+ icon: 'none'
+ })
+ }
+
+
+
+ }
+ }
+ },
+ // submit() {
+ // if (this.hform.HInterID == 0 || !this.hform.HInterID) {
+ // uni.showToast({
+ // title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忓崟鎹潯鐮侊紒',
+ // icon: 'none'
+ // })
+ // } else if (!this.hform.HBillNo) {
+ // uni.showToast({
+ // title: '鍗曟嵁鍙疯幏鍙栧け璐ワ紝閿欒鐨勫崟鎹彿锛�',
+ // icon: 'none'
+ // })
+ // } else if (!this.Materlist || this.Materlist.length == 0) {
+ // uni.showToast({
+ // title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忔潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
+ // icon: 'none'
+ // })
+ // } else {
+ // var s = 0;
+ // for (var i = 0; i < this.Materlist.length; i++) {
+ // if (this.Materlist[i].鏁伴噺 > 0) {
+ // s = 1;
+ // }
+ // }
+ // if (s == 0) {
+ // uni.showToast({
+ // title: '娌℃湁鎵弿鐗╂枡鏉$爜锛岃鍏堟壂鎻忕墿鏂欐潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
+ // icon: 'none'
+ // })
+ // } else {
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
+ // var sMainStr = JSON.stringify(this.hform);
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/set_SavePOStockInBill_BillCheck_Json',
+ // method: 'POST',
+ // dataType: "json",
+ // data: {
+ // oMain: sMainStr
+ // },
+ // success: (res) => {
+ // console.log(1, res);
+ // uni.hideLoading()
+ // if (res.data.count == 1) {
+ // uni.showModal({
+ // title: '鎻愮ず',
+ // content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
+ // success: (res) => {
+ // if (res.confirm) {
+ // console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ // uni.redirectTo({
+ // url: '/pages/caigourukujiaoyan/form?OperationType=1'
+ // })
+ // } else if (res.cancel) {
+ // console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ // setTimeout(() => {
+ // uni.navigateBack();
+ // }, 50)
+ // }
+ // }
+ // });
+ // } else {
+ // // uni.showToast({
+ // // title: res.data.Message,
+ // // icon: 'none'
+ // // })
+ //
+ // uni.showModal({
+ // title: '娓╅Θ鎻愮ず',
+ // content: res.data.Message,
+ // showCancel: false
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
+ // }
+ // }
+ // },
goBack() {
uni.showModal({
diff --git a/pages/shengchanlingliao/form.vue b/pages/shengchanlingliao/form.vue
index 34f2d26..22b41ce 100644
--- a/pages/shengchanlingliao/form.vue
+++ b/pages/shengchanlingliao/form.vue
@@ -5,7 +5,7 @@
<view class="title">鏉$爜:</view>
<view class="right" style="width: 380rpx;">
<input v-model="hform.HBarCode" :focus="HBarCodeFocus" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜"
- @blur="getCode(hform.HBarCode)" />
+ @blur="getCode(hform.HBarCode)" />
</view>
<uni-icons type="scan"
style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
@@ -46,7 +46,7 @@
<view class="title">鍗曟嵁鍙�:</view>
<view class="right" style="width: 380rpx;">
<input name="HBillNo" :focus="HBillNoFocus" v-model="hform.HBillNo" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜"
- @blur="GetMeesageByBillNo()" />
+ @blur="GetMeesageByBillNo()" />
</view>
<uni-icons type="scan"
style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
@@ -393,55 +393,110 @@
})
},
//鎵弿鍗曟嵁鍙锋潯鐮�
- GetMeesageByBillNo(e) {
+ async GetMeesageByBillNo(e) {
if (this.hform.HBillNo == "" || this.hform.HBillNo == undefined) {
return
}
- uni.request({
- url: this.serverUrl + '/WEBSController/get_BillBarCode_BillCheck_Json',
- data: {
- HBillNo: this.hform.HBillNo,
- HBillType: this.hform.HBillType,
- HMaker: this.hform.HMaker,
- HStockOrgID: this.hform.HStockOrgID
- },
- success: (res) => {
- if (res.data.count == 1) {
- this.playSound(1)
- var data = res.data.data
- console.log(data)
- this.hform.HInterID = data.hInterIDField
- this.hform.HBillNo = data.hBillNoField
- this.showHBillNo = false
- //鏉$爜鏍稿鏍囪
- if (data.hSourceBarCodeFlagField) {
- this.hform.HSourceBarCodeCtl = "Y"
- this.hform.chkHBarflag = true
- this.hform.HBarflag = data
- }
- this.tabs = 2
- this.DisBillEntryList();
- this.refreshHBarCodeFocus()
- } else {
- this.playSound(0)
- this.refreshHBillNoFocus()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- this.hform.HBillNo = ''
+
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/get_BillBarCode_BillCheck_Json',
+ data: {
+ HBillNo: this.hform.HBillNo,
+ HBillType: this.hform.HBillType,
+ HMaker: this.hform.HMaker,
+ HStockOrgID: this.hform.HStockOrgID
+ },
+ })
+
+ if (!res) {
+ // 瑙﹀彂璇锋眰閿侊紝涓嶈繑鍥炰换浣曞��
+ return
+ }
+
+ let {
+ data,
+ Message,
+ count
+ } = res.data
+ if (count == 1) {
+ this.playSound(1)
+ console.log(data)
+ this.hform.HInterID = data.hInterIDField
+ this.hform.HBillNo = data.hBillNoField
+ this.showHBillNo = false
+ //鏉$爜鏍稿鏍囪
+ if (data.hSourceBarCodeFlagField) {
+ this.hform.HSourceBarCodeCtl = "Y"
+ this.hform.chkHBarflag = true
+ this.hform.HBarflag = data
}
- },
- fail: (res) => {
- console.log(res);
+ this.tabs = 2
+ this.DisBillEntryList();
+ this.refreshHBarCodeFocus()
+ } else {
this.playSound(0)
this.refreshHBillNoFocus()
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: Message,
icon: 'none'
})
- },
- });
+ this.hform.HBillNo = ''
+ }
+
+ } catch (e) {
+ this.playSound(0)
+ this.refreshHBillNoFocus()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+ icon: 'none'
+ })
+ }
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/get_BillBarCode_BillCheck_Json',
+ // data: {
+ // HBillNo: this.hform.HBillNo,
+ // HBillType: this.hform.HBillType,
+ // HMaker: this.hform.HMaker,
+ // HStockOrgID: this.hform.HStockOrgID
+ // },
+ // success: (res) => {
+ // if (res.data.count == 1) {
+ // this.playSound(1)
+ // var data = res.data.data
+ // console.log(data)
+ // this.hform.HInterID = data.hInterIDField
+ // this.hform.HBillNo = data.hBillNoField
+ // this.showHBillNo = false
+ // //鏉$爜鏍稿鏍囪
+ // if (data.hSourceBarCodeFlagField) {
+ // this.hform.HSourceBarCodeCtl = "Y"
+ // this.hform.chkHBarflag = true
+ // this.hform.HBarflag = data
+ // }
+ // this.tabs = 2
+ // this.DisBillEntryList();
+ // this.refreshHBarCodeFocus()
+ // } else {
+ // this.playSound(0)
+ // this.refreshHBillNoFocus()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // this.hform.HBillNo = ''
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // this.playSound(0)
+ // this.refreshHBillNoFocus()
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
},
//鍩虹浠撳簱璧勬枡
getHBaseList() {
@@ -528,7 +583,7 @@
}
},
//鎵潯鐮佸鐞�
- getCode(HBarCode) {
+ async getCode(HBarCode) {
if (HBarCode == undefined || HBarCode == "") {
return
}
@@ -557,95 +612,172 @@
icon: 'none'
})
} else {
- uni.request({
- url: this.serverUrl +
- '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
- data: {
- HInterID: this.hform.HInterID,
- HBillType: this.hform.HBillType,
- HBarCode: sBarCode
- },
- success: (res) => {
- console.log('鍒犻櫎鏉$爜', res.data);
- this.hform.HBarCode = ''
- if (res.data.count == 1) {
- this.hform.HQty = ''
- this.DisBillEntryList()
- } else {
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- console.log(res);
+ try {
+
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBarCode: sBarCode
+ },
+ })
+
+ if (!res) {
+ // 璇锋眰琚攣瀹氾紝閫�鍑哄綋鍓嶈姹�
+ return
+ }
+
+ console.log('鍒犻櫎鏉$爜', res.data);
+ this.hform.HBarCode = ''
+ if (res.data.count == 1) {
+ this.hform.HQty = ''
+ this.DisBillEntryList()
+ } else {
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
- },
- });
+ }
+
+ } catch (e) {
+ this.playSound(0)
+ this.refreshHBillNoFocus()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl +
+ // '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ // data: {
+ // HInterID: this.hform.HInterID,
+ // HBillType: this.hform.HBillType,
+ // HBarCode: sBarCode
+ // },
+ // success: (res) => {
+ // console.log('鍒犻櫎鏉$爜', res.data);
+ // this.hform.HBarCode = ''
+ // if (res.data.count == 1) {
+ // this.hform.HQty = ''
+ // this.DisBillEntryList()
+ // } else {
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
} else {
var sBarCode = this.hform.HBarCode
if (sHQty == "") {
sHQty = 0;
}
- uni.request({
- url: this.serverUrl + '/WEBSController/get_CheckTypeByBarCode_BillCheck_Json',
- data: {
- sBarCode: sBarCode,
- HBillID: this.hform.HInterID || 0,
- HBillType: this.hform.HBillType,
- HBillNo: this.hform.HBillNo,
- HMaker: this.hform.HMaker,
- HWhID: sHWHID,
- HSPID: sHSPID,
- HQty: sHQty,
- // HRedBlueFlag: this.hform.HRedBlueFlag,
- // SourceFlag: HSourceFlag,
- // HSourceBillNo: sSourceBillNo,
- // HSourceBillType: sSourceBillType,
- HStockOrgID: this.hform.HStockOrgID,
- // HScanStyle: "",
- // HCustom1: "",
- // HCustom2: ""
- },
- success: (res) => {
- console.log('鎵爜杩斿洖', res.data);
- this.hform.HBarCode = ''
- if (res.data.count == 1) {
- CommonUtils.playSound(1);
- var data = res.data.data
- if (data.hBarTypeField == '浠撳簱鏉$爜') {
- this.hform.HWHName = data.hWhNameField
- this.hform.HWHID = data.hWhIDField
- this.hform.HStockPlaceName = ''
- this.hform.HStockPlaceID = 0
- if (data.hSPFlagField == 0) {
- this.showHStockPlaceName = false
- } else {
- this.showHStockPlaceName = true
- }
- } else if (data.hBarTypeField == '浠撲綅鏉$爜') {
- this.hform.HWHName = data.hWhNameField
- this.hform.HWHID = data.hWhIDField
- this.hform.HStockPlaceName = data.hSPNameField
- this.hform.HStockPlaceID = data.hSPIDField
- } else if (data.hBarTypeField == '閮ㄩ棬鏉$爜') {
- this.hform.HDeptName = data.hDeptNameField
+
+ try {
+
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/get_CheckTypeByBarCode_BillCheck_Json',
+ data: {
+ sBarCode: sBarCode,
+ HBillID: this.hform.HInterID || 0,
+ HBillType: this.hform.HBillType,
+ HBillNo: this.hform.HBillNo,
+ HMaker: this.hform.HMaker,
+ HWhID: sHWHID,
+ HSPID: sHSPID,
+ HQty: sHQty,
+ // HRedBlueFlag: this.hform.HRedBlueFlag,
+ // SourceFlag: HSourceFlag,
+ // HSourceBillNo: sSourceBillNo,
+ // HSourceBillType: sSourceBillType,
+ HStockOrgID: this.hform.HStockOrgID,
+ // HScanStyle: "",
+ // HCustom1: "",
+ // HCustom2: ""
+ },
+ })
+
+ if (!res) {
+ return
+ }
+
+ console.log('鎵爜杩斿洖', res.data);
+ this.hform.HBarCode = ''
+ if (res.data.count == 1) {
+ CommonUtils.playSound(1);
+ var data = res.data.data
+ if (data.hBarTypeField == '浠撳簱鏉$爜') {
+ this.hform.HWHName = data.hWhNameField
+ this.hform.HWHID = data.hWhIDField
+ this.hform.HStockPlaceName = ''
+ this.hform.HStockPlaceID = 0
+ if (data.hSPFlagField == 0) {
+ this.showHStockPlaceName = false
+ } else {
+ this.showHStockPlaceName = true
+ }
+ } else if (data.hBarTypeField == '浠撲綅鏉$爜') {
+ this.hform.HWHName = data.hWhNameField
+ this.hform.HWHID = data.hWhIDField
+ this.hform.HStockPlaceName = data.hSPNameField
+ this.hform.HStockPlaceID = data.hSPIDField
+ } else if (data.hBarTypeField == '閮ㄩ棬鏉$爜') {
+ this.hform.HDeptName = data.hDeptNameField
+ this.hform.HDeptID = data.hDeptIDField
+ this.tabs = 1
+ } else if (data.hBarTypeField == '婧愬崟鏉$爜') {
+ this.hform.HSupName = data.hSupNameField
+ this.hform.HSupID = data.hSupIDField
+ if (data.hDeptIDField != 0) {
this.hform.HDeptID = data.hDeptIDField
- this.tabs = 1
- } else if (data.hBarTypeField == '婧愬崟鏉$爜') {
+ this.hform.HDeptName = data.hDeptNameField
+ }
+ this.hform.HSourceBillNo = data.hSourceBillNoField
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ if (data.hSourceBillTypeField == "1103") {
+ this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+ this.hform.HMainSourceBillType = 1103
+ this.showHMainSourceBillType = false
+ } else if (data.hSourceBillTypeField == "1102") {
+ this.HMainSourceBillType = '閲囪喘璁㈠崟'
+ this.hform.HMainSourceBillType = 1102
+ this.showHMainSourceBillType = false
+ } else {
+ this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+ this.hform.HMainSourceBillType = -1
+ this.showHMainSourceBillType = false
+ }
+ if (data.hMulSourceFlagField == 0) {
+ this.showHSourceBillNo = false
+ }
+ //渚涘簲鍟嗕笉鍙紪杈�
+ this.showHSupName = false
+ this.tabs = 2
+ } else { //鐗╂枡鏉$爜
+ this.tabs = 2
+ console.log('data', data)
+ if (!this.hform.HSourceBillNo) {
this.hform.HSupName = data.hSupNameField
this.hform.HSupID = data.hSupIDField
+ this.hform.HSourceBillNo = data.hSourceBillNoField
if (data.hDeptIDField != 0) {
this.hform.HDeptID = data.hDeptIDField
this.hform.HDeptName = data.hDeptNameField
}
- this.hform.HSourceBillNo = data.hSourceBillNoField
//鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
if (data.hSourceBillTypeField == "1103") {
this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
this.hform.HMainSourceBillType = 1103
@@ -664,65 +796,162 @@
}
//渚涘簲鍟嗕笉鍙紪杈�
this.showHSupName = false
- this.tabs = 2
- } else { //鐗╂枡鏉$爜
- this.tabs = 2
- console.log('data', data)
- if (!this.hform.HSourceBillNo) {
- this.hform.HSupName = data.hSupNameField
- this.hform.HSupID = data.hSupIDField
- this.hform.HSourceBillNo = data.hSourceBillNoField
- if (data.hDeptIDField != 0) {
- this.hform.HDeptID = data.hDeptIDField
- this.hform.HDeptName = data.hDeptNameField
- }
- //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- if (data.hSourceBillTypeField == "1103") {
- this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
- this.hform.HMainSourceBillType = 1103
- this.showHMainSourceBillType = false
- } else if (data.hSourceBillTypeField == "1102") {
- this.HMainSourceBillType = '閲囪喘璁㈠崟'
- this.hform.HMainSourceBillType = 1102
- this.showHMainSourceBillType = false
- } else {
- this.HMainSourceBillType = '鎵嬪伐褰曞叆'
- this.hform.HMainSourceBillType = -1
- this.showHMainSourceBillType = false
- }
- if (data.hMulSourceFlagField == 0) {
- this.showHSourceBillNo = false
- }
- //渚涘簲鍟嗕笉鍙紪杈�
- this.showHSupName = false
- }
}
- //鏄剧ず琛ㄤ綋鏄庣粏
- this.DisBillEntryList()
- //娓呯┖鏁伴噺
- this.hform.HQty = ''
- } else {
- CommonUtils.playSound(0);
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
}
-
- this.refreshHBarCodeFocus()
- },
- fail: (res) => {
- CommonUtils.playSound(0);
- console.log(res);
+ //鏄剧ず琛ㄤ綋鏄庣粏
+ this.DisBillEntryList()
+ //娓呯┖鏁伴噺
+ this.hform.HQty = ''
+ } else {
+ CommonUtils.playSound(0);
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
+ }
- this.refreshHBarCodeFocus()
- },
- });
+ this.refreshHBarCodeFocus()
+
+ } catch (e) {
+ this.playSound(0)
+ this.refreshHBillNoFocus()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/get_CheckTypeByBarCode_BillCheck_Json',
+ // data: {
+ // sBarCode: sBarCode,
+ // HBillID: this.hform.HInterID || 0,
+ // HBillType: this.hform.HBillType,
+ // HBillNo: this.hform.HBillNo,
+ // HMaker: this.hform.HMaker,
+ // HWhID: sHWHID,
+ // HSPID: sHSPID,
+ // HQty: sHQty,
+ // // HRedBlueFlag: this.hform.HRedBlueFlag,
+ // // SourceFlag: HSourceFlag,
+ // // HSourceBillNo: sSourceBillNo,
+ // // HSourceBillType: sSourceBillType,
+ // HStockOrgID: this.hform.HStockOrgID,
+ // // HScanStyle: "",
+ // // HCustom1: "",
+ // // HCustom2: ""
+ // },
+ // success: (res) => {
+ // console.log('鎵爜杩斿洖', res.data);
+ // this.hform.HBarCode = ''
+ // if (res.data.count == 1) {
+ // CommonUtils.playSound(1);
+ // var data = res.data.data
+ // if (data.hBarTypeField == '浠撳簱鏉$爜') {
+ // this.hform.HWHName = data.hWhNameField
+ // this.hform.HWHID = data.hWhIDField
+ // this.hform.HStockPlaceName = ''
+ // this.hform.HStockPlaceID = 0
+ // if (data.hSPFlagField == 0) {
+ // this.showHStockPlaceName = false
+ // } else {
+ // this.showHStockPlaceName = true
+ // }
+ // } else if (data.hBarTypeField == '浠撲綅鏉$爜') {
+ // this.hform.HWHName = data.hWhNameField
+ // this.hform.HWHID = data.hWhIDField
+ // this.hform.HStockPlaceName = data.hSPNameField
+ // this.hform.HStockPlaceID = data.hSPIDField
+ // } else if (data.hBarTypeField == '閮ㄩ棬鏉$爜') {
+ // this.hform.HDeptName = data.hDeptNameField
+ // this.hform.HDeptID = data.hDeptIDField
+ // this.tabs = 1
+ // } else if (data.hBarTypeField == '婧愬崟鏉$爜') {
+ // this.hform.HSupName = data.hSupNameField
+ // this.hform.HSupID = data.hSupIDField
+ // if (data.hDeptIDField != 0) {
+ // this.hform.HDeptID = data.hDeptIDField
+ // this.hform.HDeptName = data.hDeptNameField
+ // }
+ // this.hform.HSourceBillNo = data.hSourceBillNoField
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ // if (data.hSourceBillTypeField == "1103") {
+ // this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+ // this.hform.HMainSourceBillType = 1103
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "1102") {
+ // this.HMainSourceBillType = '閲囪喘璁㈠崟'
+ // this.hform.HMainSourceBillType = 1102
+ // this.showHMainSourceBillType = false
+ // } else {
+ // this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+ // this.hform.HMainSourceBillType = -1
+ // this.showHMainSourceBillType = false
+ // }
+ // if (data.hMulSourceFlagField == 0) {
+ // this.showHSourceBillNo = false
+ // }
+ // //渚涘簲鍟嗕笉鍙紪杈�
+ // this.showHSupName = false
+ // this.tabs = 2
+ // } else { //鐗╂枡鏉$爜
+ // this.tabs = 2
+ // console.log('data', data)
+ // if (!this.hform.HSourceBillNo) {
+ // this.hform.HSupName = data.hSupNameField
+ // this.hform.HSupID = data.hSupIDField
+ // this.hform.HSourceBillNo = data.hSourceBillNoField
+ // if (data.hDeptIDField != 0) {
+ // this.hform.HDeptID = data.hDeptIDField
+ // this.hform.HDeptName = data.hDeptNameField
+ // }
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // if (data.hSourceBillTypeField == "1103") {
+ // this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+ // this.hform.HMainSourceBillType = 1103
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "1102") {
+ // this.HMainSourceBillType = '閲囪喘璁㈠崟'
+ // this.hform.HMainSourceBillType = 1102
+ // this.showHMainSourceBillType = false
+ // } else {
+ // this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+ // this.hform.HMainSourceBillType = -1
+ // this.showHMainSourceBillType = false
+ // }
+ // if (data.hMulSourceFlagField == 0) {
+ // this.showHSourceBillNo = false
+ // }
+ // //渚涘簲鍟嗕笉鍙紪杈�
+ // this.showHSupName = false
+ // }
+ // }
+ // //鏄剧ず琛ㄤ綋鏄庣粏
+ // this.DisBillEntryList()
+ // //娓呯┖鏁伴噺
+ // this.hform.HQty = ''
+ // } else {
+ // CommonUtils.playSound(0);
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ //
+ // this.refreshHBarCodeFocus()
+ // },
+ // fail: (res) => {
+ // CommonUtils.playSound(0);
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ //
+ // this.refreshHBarCodeFocus()
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -821,7 +1050,7 @@
url: '/pages/shengchanlingliao/form?OperationType=1'
})
},
- submit() {
+ async submit() {
if (this.hform.HInterID == 0 || !this.hform.HInterID) {
uni.showToast({
title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忓崟鎹潯鐮侊紒',
@@ -855,49 +1084,99 @@
title: '璇风◢鍊�'
})
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SaveMateOutBill_BillCheck_Json',
- method: 'POST',
- dataType: "json",
- data: {
- oMain: sMainStr
- },
- success: (res) => {
- console.log(1, res);
- uni.hideLoading()
- if (res.data.count == 1) {
- uni.showModal({
- title: '鎻愮ず',
- content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
- success: (res) => {
- if (res.confirm) {
- console.log('鐢ㄦ埛鐐瑰嚮纭畾');
- uni.redirectTo({
- url: '/pages/shengchanlingliao/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- setTimeout(() => {
- uni.navigateBack();
- }, 50)
- }
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SaveMateOutBill_BillCheck_Json',
+ method: 'POST',
+ data: {
+ oMain: sMainStr
+ },
+ })
+
+ if(!res) {
+ return
+ }
+
+ console.log(1, res);
+ uni.hideLoading()
+ if (res.data.count == 1) {
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: '/pages/shengchanlingliao/form?OperationType=1'
+ })
+ } else if (res.cancel) {
+ console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ setTimeout(() => {
+ uni.navigateBack();
+ }, 50)
}
- });
- } else {
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- console.log(res);
+ }
+ });
+ } else {
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
- },
- });
+ }
+
+ } catch (e) {
+ this.playSound(0)
+ this.refreshHBillNoFocus()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+ icon: 'none'
+ })
+ }
+
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/set_SaveMateOutBill_BillCheck_Json',
+ // method: 'POST',
+ // dataType: "json",
+ // data: {
+ // oMain: sMainStr
+ // },
+ // success: (res) => {
+ // console.log(1, res);
+ // uni.hideLoading()
+ // if (res.data.count == 1) {
+ // uni.showModal({
+ // title: '鎻愮ず',
+ // content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
+ // success: (res) => {
+ // if (res.confirm) {
+ // console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ // uni.redirectTo({
+ // url: '/pages/shengchanlingliao/form?OperationType=1'
+ // })
+ // } else if (res.cancel) {
+ // console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ // setTimeout(() => {
+ // uni.navigateBack();
+ // }, 50)
+ // }
+ // }
+ // });
+ // } else {
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
}
},
diff --git a/utils/common.js b/utils/common.js
index 1f3191b..b70b133 100644
--- a/utils/common.js
+++ b/utils/common.js
@@ -1,9 +1,11 @@
class commonUtils {
serverUrl
audioContext // 鍏ㄥ眬闊抽瀹炰緥
+ requestLock // 璇锋眰鎺у埗閿�(鍚屾)
constructor() {
this.serverUrl = uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API/';
this.audioContext = null;
+ this.requestLock = false
}
setServerUrl(url) {
@@ -303,6 +305,42 @@
})
}
+ // 鍚屾鎵ц璇锋眰 (閰嶅悎await鎴栬�卼hen)
+ async doRequest2Sync({
+ url,
+ data,
+ method,
+ }) {
+ if(this.requestLock){
+ console.warn("璇ヨ姹傝閿佸畾锛屽凡閫�鍑鸿姹�!")
+ return
+ }
+
+ this.requestLock = true
+ return new Promise((resolve, reject) => {
+ // that = that || this;
+ let errorTip = null;
+ uni.showLoading({
+ title: '鍔犺浇涓�...'
+ })
+ uni.request({
+ method: method || "GET",
+ url: this.serverUrl + url,
+ data: data || "",
+ success: (res) => {
+ resolve(res)
+ },
+ fail: (err) => {
+ reject(err)
+ },
+ complete: () => {
+ // 閲婃斁璇锋眰閿�
+ this.requestLock = false
+ uni.hideLoading()
+ }
+ })
+ })
+ }
stringToBoolean(str) {
// 蹇界暐澶у皬鍐欑殑杞崲
return str?.toLowerCase() === "true";
--
Gitblit v1.9.1