From 69994660ec631003765b6b9792e9d5aabe766b7d Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期四, 16 十月 2025 09:51:10 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev
---
pages/qitarukujiaoyan/form.vue | 2144 ++++---
pages/zhijiediaobo/form.vue | 819 ++
pages/shengchanrukushengdan/form.vue | 676 +
pages/index/tab2.vue | 2
pages/shengchantuiliao/form.vue | 676 +
pages/xiaoshouchuku/form.vue | 673 +
pages/qitaruku_v2/form.vue | 601 +
pages/caigoutuiliao/form.vue | 673 +
pages/shengchanlingliao/form.vue | 26
pages/xiaoshoutuihuo/form.vue | 639 +
pages/shengchanruku/form.vue | 731 +
pages/weiwairuku/form.vue | 616 +
utils/common.js | 2
pages/qitachuku_v2/form.vue | 615 +
pages/qitachukujiaoyan/detail.vue | 706 +
pages/shengchanbuliaojiaoyan/form.vue | 710 +
pages/weiwailingliao/form.vue | 605 +
pages/shengchandiaobo/form.vue | 717 +
pages/weiwaibuliaojiaoyan/form.vue | 2134 ++++---
pages/caigouruku/form.vue | 626 +
pages/index/index.vue | 14
pages/shengchanbuliao/form.vue | 770 +-
pages/shengchanlingliaoshengdan/form.vue | 669 +
23 files changed, 10,326 insertions(+), 5,518 deletions(-)
diff --git a/pages/caigouruku/form.vue b/pages/caigouruku/form.vue
index dcc6b5b..fc70c5b 100644
--- a/pages/caigouruku/form.vue
+++ b/pages/caigouruku/form.vue
@@ -376,8 +376,8 @@
get() {
// 鍔ㄦ�佽绠楀搴斾粨搴撶殑浠撲綅
return this.HStockPlaceNameList
- .filter(e => e['鎵�灞炰粨搴�'] == this.hform.HWHName)
- .map(e => e['浠撲綅鍚嶇О'])
+ .filter(e => e['鎵�灞炰粨搴�'] == this.hform.HWHName)
+ .map(e => e['浠撲綅鍚嶇О'])
}
}
},
@@ -1013,7 +1013,7 @@
});
},
//鎵潯鐮佸鐞�
- getCode(HBarCode) {
+ async getCode(HBarCode) {
//浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1041,105 +1041,191 @@
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.playSound(1)
- this.hform.HQty = ''
- this.DisBillEntryList()
- } else {
- this.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBarCode: sBarCode
}
- },
- fail: (res) => {
- console.log(res);
- this.refreshBarCodeState()
+ })
+
+ if (!res) {
+ return
+ }
+
+ console.log('鍒犻櫎鏉$爜', res.data);
+ this.hform.HBarCode = ''
+ if (res.data.count == 1) {
+ this.playSound(1)
+ this.hform.HQty = ''
+ this.DisBillEntryList()
+ } else {
this.playSound(0)
+ this.refreshBarCodeState()
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
- },
- });
+ }
+ } catch (err) {
+ this.refreshBarCodeState()
+ this.playSound(0)
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
+ 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.playSound(1)
+ // this.hform.HQty = ''
+ // this.DisBillEntryList()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // this.refreshBarCodeState()
+ // this.playSound(0)
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
} else {
var sBarCode = this.hform.HBarCode
if (sHQty == "") {
sHQty = 0;
}
- uni.request({
- url: this.serverUrl + '/WEBSController/Get_BarCode_Json',
- data: {
- sBarCode: sBarCode,
- HInterID: this.hform.HInterID,
- 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) {
- this.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_BarCode_Json',
+ data: {
+ sBarCode: sBarCode,
+ HInterID: this.hform.HInterID,
+ 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) {
+ this.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
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ .hSourceBillTypeField)
+ if (index != -1) {
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ this.showHMainSourceBillType = false
+ }
+ // 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.materMeta.push(data)
+ 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
}
- this.hform.HSourceBillNo = data.hSourceBillNoField
+ console.log(data)
//鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ data
.hSourceBillTypeField)
if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ index]
this.hform.HMainSourceBillType = data.hSourceBillTypeField
this.showHMainSourceBillType = false
}
@@ -1161,75 +1247,184 @@
}
//渚涘簲鍟嗕笉鍙紪杈�
this.showHSupName = false
- this.tabs = 2
- } else { //鐗╂枡鏉$爜
- this.materMeta.push(data)
- 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
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
- .hSourceBillTypeField)
- if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- this.showHMainSourceBillType = false
- }
- // 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 = ''
- //鍏夋爣瀵瑰噯鏉$爜
- this.refreshBarCodeState()
- } else {
- this.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
}
- },
- fail: (res) => {
+ //鏄剧ず琛ㄤ綋鏄庣粏
+ this.DisBillEntryList()
+ //娓呯┖鏁伴噺
+ this.hform.HQty = ''
+ //鍏夋爣瀵瑰噯鏉$爜
+ this.refreshBarCodeState()
+ } else {
this.playSound(0)
this.refreshBarCodeState()
- console.log(res);
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
- },
- });
+ }
+
+ } catch (err) {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ console.log(res);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/Get_BarCode_Json',
+ // data: {
+ // sBarCode: sBarCode,
+ // HInterID: this.hform.HInterID,
+ // 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) {
+ // this.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
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ //
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // 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.materMeta.push(data)
+ // 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
+ //
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ // data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ // index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // 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 = ''
+ // //鍏夋爣瀵瑰噯鏉$爜
+ // this.refreshBarCodeState()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -1423,7 +1618,7 @@
url: '/pages/caigouruku/form?OperationType=1'
})
},
- submit() {
+ async submit() {
//浠撳簱銆佷粨浣嶃�佷繚绠°�侀獙鏀躲�侀儴闂ㄣ�佷緵搴斿晢鏂囨湰妗嗕负绌烘椂锛屾竻绌哄搴擨D
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1471,57 +1666,108 @@
icon: 'none'
})
} else {
- uni.showLoading({
- title: '璇风◢鍊�'
- })
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SavePOStockInBill_Json',
- method: 'POST',
- dataType: "json",
- data: {
- oMain: sMainStr
- },
- success: (res) => {
- console.log(1, res);
- uni.hideLoading()
- if (res.data.count == 1) {
- let sMain = JSON.stringify(this.materMeta) + ';' + this.hform
- .HBillType + ';' + this.hform.HSourceBillNo
- // 涓烘潯鐮佽缃嚭搴撳崟鍙峰拰鍑哄簱娆℃暟
- // await this.Set_BarCodeBill(sMain)
- uni.showModal({
- title: '鎻愮ず',
- content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
- success: (res) => {
- if (res.confirm) {
- console.log('鐢ㄦ埛鐐瑰嚮纭畾');
- uni.redirectTo({
- url: '/pages/caigouruku/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- // setTimeout(() => {
- // uni.navigateBack();
- // }, 50)
- }
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SavePOStockInBill_Json',
+ method: 'POST',
+ data: {
+ oMain: sMainStr
+ },
+ })
+
+ if (!res) {
+ return
+ }
+
+ console.log(1, res);
+ uni.hideLoading()
+ if (res.data.count == 1) {
+ // let sMain = JSON.stringify(this.materMeta) + ';' + this.hform
+ // .HBillType + ';' + this.hform.HSourceBillNo
+ // 涓烘潯鐮佽缃嚭搴撳崟鍙峰拰鍑哄簱娆℃暟
+ // await this.Set_BarCodeBill(sMain)
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: '/pages/caigouruku/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 (err) {
+ console.warn(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触:' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/set_SavePOStockInBill_Json',
+ // method: 'POST',
+ // dataType: "json",
+ // data: {
+ // oMain: sMainStr
+ // },
+ // success: (res) => {
+ // console.log(1, res);
+ // uni.hideLoading()
+ // if (res.data.count == 1) {
+ // let sMain = JSON.stringify(this.materMeta) + ';' + this.hform
+ // .HBillType + ';' + this.hform.HSourceBillNo
+ // // 涓烘潯鐮佽缃嚭搴撳崟鍙峰拰鍑哄簱娆℃暟
+ // // await this.Set_BarCodeBill(sMain)
+ // uni.showModal({
+ // title: '鎻愮ず',
+ // content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
+ // success: (res) => {
+ // if (res.confirm) {
+ // console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ // uni.redirectTo({
+ // url: '/pages/caigouruku/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/pages/caigoutuiliao/form.vue b/pages/caigoutuiliao/form.vue
index 2689f62..834ce1d 100644
--- a/pages/caigoutuiliao/form.vue
+++ b/pages/caigoutuiliao/form.vue
@@ -246,8 +246,8 @@
</view>
<BillSelectPopupXiaoWeiVue v-if="enableModule == 1" ref="billList" :HBillType="hform.HBillType"
:HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID"></BillSelectPopupXiaoWeiVue>
- <BillListPopupVue v-else-if="enableModule == 2" ref="billList" :HBillType="hform.HBillType" :HSourceBillType="hform.HMainSourceBillType"
- :HStockOrgID="hform.HStockOrgID"></BillListPopupVue>
+ <BillListPopupVue v-else-if="enableModule == 2" ref="billList" :HBillType="hform.HBillType"
+ :HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID"></BillListPopupVue>
<BarCodePopupVue ref="barcodePopup"></BarCodePopupVue>
</view>
</template>
@@ -271,7 +271,7 @@
BarCodePopupVue,
BillSelectPopupXiaoWeiVue
},
-
+
data() {
return {
HSourceBillNoFocus: false,
@@ -365,21 +365,21 @@
if (this.hform.HMainSourceBillType == 1201 &&
/灏忓崼|鏅轰簯/.test(uni.getStorageSync('Organization'))
) {
-
+
return 1
} else {
return 2
}
}
-
+
// 鍏朵粬鏉′欢
},
HStockPlaceNameListComputed: {
get() {
// 鍔ㄦ�佽绠楀搴斾粨搴撶殑浠撲綅
return this.HStockPlaceNameList
- .filter(e => e['鎵�灞炰粨搴�'] == this.hform.HWHName)
- .map(e => e['浠撲綅鍚嶇О'])
+ .filter(e => e['鎵�灞炰粨搴�'] == this.hform.HWHName)
+ .map(e => e['浠撲綅鍚嶇О'])
}
}
},
@@ -969,7 +969,7 @@
});
},
//鎵潯鐮佸鐞�
- getCode(HBarCode) {
+ async getCode(HBarCode) {
//浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -997,170 +997,26 @@
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.playSound(1)
- this.hform.HQty = ''
- CommonUtils.playSound(1)
- this.DisBillEntryList()
- } else {
- this.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBarCode: sBarCode
}
- },
- fail: (res) => {
- this.playSound(0)
- this.refreshBarCodeState()
- 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_BarCode_Json',
- data: {
- sBarCode: sBarCode,
- HInterID: this.hform.HInterID,
- 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);
+ })
+
+ if (!res) {
+ return
+ }
+
+ console.log('鍒犻櫎鏉$爜', res.data);
this.hform.HBarCode = ''
if (res.data.count == 1) {
this.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
- //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- if (data.hSourceBillTypeField == "1105") {
- this.HMainSourceBillType = '閫�鏂欓�氱煡鍗�'
- this.hform.HMainSourceBillType = 1105
- this.showHMainSourceBillType = false
- } else if (data.hSourceBillTypeField == "1102") {
- this.HMainSourceBillType = '閲囪喘璁㈠崟'
- this.hform.HMainSourceBillType = 1102
- this.showHMainSourceBillType = false
- } else if (data.hSourceBillType == 1201) {
- this.HMainSourceBillType = '閲囪喘鍏ュ簱鍗�'
- this.hform.HMainSourceBillType = 1201
- 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
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
- .hSourceBillTypeField)
- if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- this.showHMainSourceBillType = false
- }
- // 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 = ''
+ this.DisBillEntryList()
} else {
this.playSound(0)
this.refreshBarCodeState()
@@ -1169,17 +1025,348 @@
icon: 'none'
})
}
- },
- fail: (res) => {
- this.playSound(0)
+ } catch (err) {
this.refreshBarCodeState()
- console.log(res);
+ this.playSound(0)
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
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.playSound(1)
+ // this.hform.HQty = ''
+ // CommonUtils.playSound(1)
+ // this.DisBillEntryList()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // 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_BarCode_Json',
+ data: {
+ sBarCode: sBarCode,
+ HInterID: this.hform.HInterID,
+ 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) {
+ this.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
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ if (data.hSourceBillTypeField == "1105") {
+ this.HMainSourceBillType = '閫�鏂欓�氱煡鍗�'
+ this.hform.HMainSourceBillType = 1105
+ this.showHMainSourceBillType = false
+ } else if (data.hSourceBillTypeField == "1102") {
+ this.HMainSourceBillType = '閲囪喘璁㈠崟'
+ this.hform.HMainSourceBillType = 1102
+ this.showHMainSourceBillType = false
+ } else if (data.hSourceBillType == 1201) {
+ this.HMainSourceBillType = '閲囪喘鍏ュ簱鍗�'
+ this.hform.HMainSourceBillType = 1201
+ 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
+
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ data
+ .hSourceBillTypeField)
+ if (index != -1) {
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ index]
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ this.showHMainSourceBillType = false
+ }
+ // 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 {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ } catch (err) {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ console.log(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/Get_BarCode_Json',
+ // data: {
+ // sBarCode: sBarCode,
+ // HInterID: this.hform.HInterID,
+ // 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) {
+ // this.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
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // if (data.hSourceBillTypeField == "1105") {
+ // this.HMainSourceBillType = '閫�鏂欓�氱煡鍗�'
+ // this.hform.HMainSourceBillType = 1105
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "1102") {
+ // this.HMainSourceBillType = '閲囪喘璁㈠崟'
+ // this.hform.HMainSourceBillType = 1102
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillType == 1201) {
+ // this.HMainSourceBillType = '閲囪喘鍏ュ簱鍗�'
+ // this.hform.HMainSourceBillType = 1201
+ // 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
+ //
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ // data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ // index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // 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 {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -1367,7 +1554,7 @@
},
});
},
- submit() {
+ async submit() {
//浠撳簱銆佷粨浣嶃�佷繚绠°�侀獙鏀躲�侀儴闂ㄣ�佷緵搴斿晢鏂囨湰妗嗕负绌烘椂锛屾竻绌哄搴擨D
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1415,53 +1602,105 @@
icon: 'none'
})
} else {
- uni.showLoading({
- title: '璇风◢鍊�'
- })
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SavePOStockInBackBill_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/caigoutuiliao/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- // setTimeout(() => {
- // uni.navigateBack();
- // }, 50)
- }
+
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SavePOStockInBackBill_Json',
+ method: 'POST',
+ data: {
+ oMain: sMainStr
+ },
+ })
+
+ if (!res) {
+ return
+ }
+
+ console.log(1, res);
+ uni.hideLoading()
+ if (res.data.count == 1) {
+ // let sMain = JSON.stringify(this.materMeta) + ';' + this.hform
+ // .HBillType + ';' + this.hform.HSourceBillNo
+ // 涓烘潯鐮佽缃嚭搴撳崟鍙峰拰鍑哄簱娆℃暟
+ // await this.Set_BarCodeBill(sMain)
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: '/pages/caigoutuiliao/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 (err) {
+ console.warn(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触:' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/set_SavePOStockInBackBill_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/caigoutuiliao/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/pages/index/index.vue b/pages/index/index.vue
index 732476a..a33bcf1 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -220,6 +220,12 @@
hidden: false,
},
{
+ img: '../../static/icon/icon16.png',
+ text: '鍏朵粬鍏ュ簱鏍¢獙',
+ url: '/pages/qitarukujiaoyan/table',
+ id: 27,
+ },
+ {
img: '../../static/icon/icon8.png',
text: '妫�楠屾姤鍛�',
url: `/pages/InnerHtmlPage/index?src=http://172.16.72.15:8999/index.aspx?name=${getUserInfo()['HICNumber']}&pageTitle=妫�楠屾姤鍛�&pageMode=horizontal`,
@@ -239,6 +245,7 @@
id: 26,
hidden: false,
},
+
],
// itemData: [{
@@ -451,12 +458,7 @@
// url: '/pages/caigourukujiaoyan/table',
// id: 35,
// },
- // {
- // img: '../../static/icon/icon16.png',
- // text: '鍏朵粬鍏ュ簱鏍¢獙',
- // url: '/pages/qitarukujiaoyan/table',
- // id: 36,
- // },
+
// {
// img: '../../static/icon/icon16.png',
// text: '濮斿琛ユ枡鏍¢獙',
diff --git a/pages/index/tab2.vue b/pages/index/tab2.vue
index ad9cd80..917ed45 100644
--- a/pages/index/tab2.vue
+++ b/pages/index/tab2.vue
@@ -246,7 +246,7 @@
hidden: false,
},{
img: '../../static/icon/icon8.png',
- text: '缁勮劚鍗曟殏瀛樺垪琛�',
+ text: '缁勬墭鍗曟殏瀛樺垪琛�',
url: `/pages/zutuosaoma/table`,
id: 34,
hidden: false,
diff --git a/pages/qitachuku_v2/form.vue b/pages/qitachuku_v2/form.vue
index f7a40ba..05a543b 100644
--- a/pages/qitachuku_v2/form.vue
+++ b/pages/qitachuku_v2/form.vue
@@ -1081,7 +1081,7 @@
});
},
//鎵潯鐮佸鐞�
- getCode(HBarCode) {
+ async getCode(HBarCode) {
//浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1109,115 +1109,194 @@
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.playSound(1)
- this.hform.HQty = ''
- this.DisBillEntryList()
- } else {
- this.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBarCode: sBarCode
}
- },
- fail: (res) => {
+ })
+ if (!res) {
+ return
+ }
+ console.log('鍒犻櫎鏉$爜', res.data);
+ this.hform.HBarCode = ''
+ if (res.data.count == 1) {
+ this.playSound(1)
+ this.hform.HQty = ''
+ this.DisBillEntryList()
+ } else {
this.playSound(0)
this.refreshBarCodeState()
- console.log(res);
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
- },
- });
+ }
+ } catch (err) {
+ this.refreshBarCodeState()
+ this.playSound(0)
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
+ 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.playSound(1)
+ // this.hform.HQty = ''
+ // this.DisBillEntryList()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // 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_BarCode_Json',
- data: {
- sBarCode: sBarCode,
- HInterID: this.hform.HInterID,
- HBillType: this.hform.HBillType,
- HBillNo: this.hform.HBillNo,
- HMaker: this.hform.HMaker,
- HWhID: sHWHID,
- HSPID: sHSPID,
- HQty: sHQty,
- HRedBlueFlag: this.hform.HRedBlueFlag,
- // SourceFlag: HSourceFlag,
- SourceFlag: this.hform.SourceFlag,
- 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) {
- this.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_BarCode_Json',
+ data: {
+ sBarCode: sBarCode,
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBillNo: this.hform.HBillNo,
+ HMaker: this.hform.HMaker,
+ HWhID: sHWHID,
+ HSPID: sHSPID,
+ HQty: sHQty,
+ HRedBlueFlag: this.hform.HRedBlueFlag,
+ SourceFlag: this.hform.SourceFlag,
+ 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) {
+ this.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.HSourceFlag = true
+ 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.HSourceFlag = true
+ this.hform.HDeptName = data.hDeptNameField
+ }
+ this.hform.HSourceBillNo = data.hSourceBillNoField
+ this.hform.SourceFlag = true
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙� 婧愬崟绫诲瀷涓虹┖ 鍒� 鍒ゅ畾涓烘墜宸ュ綍鍏�
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField || -1
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ .hSourceBillTypeField)
+ if (index != -1) {
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ this.showHMainSourceBillType = false
+ }
+ // if (data.hSourceBillTypeField == "1242") {
+ // this.HMainSourceBillType = '鍑哄簱鐢宠鍗�'
+ // this.hform.HMainSourceBillType = 1242
+ // 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
+ this.HSourceFlag = true
+ if (!this.hform.HSourceBillNo) {
+ this.hform.SourceFlag = true
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.SourceFlag = true
- //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙� 婧愬崟绫诲瀷涓虹┖ 鍒� 鍒ゅ畾涓烘墜宸ュ綍鍏�
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙� 娌℃湁婧愬崟绫诲瀷鍒欓粯璁や负鎵嬪伐褰曞叆
this.hform.HMainSourceBillType = data.hSourceBillTypeField || -1
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ data
.hSourceBillTypeField)
if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ index]
this.hform.HMainSourceBillType = data.hSourceBillTypeField
this.showHMainSourceBillType = false
}
- // if (data.hSourceBillTypeField == "1242") {
- // this.HMainSourceBillType = '鍑哄簱鐢宠鍗�'
- // this.hform.HMainSourceBillType = 1242
+ // 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 = '鎵嬪伐褰曞叆'
@@ -1227,75 +1306,182 @@
if (data.hMulSourceFlagField == 0) {
this.showHSourceBillNo = false
}
- //瀹㈡埛涓嶅彲缂栬緫
+ //渚涘簲鍟嗕笉鍙紪杈�
this.showHSupName = false
- this.tabs = 2
- } else { //鐗╂枡鏉$爜
- this.tabs = 2
- this.HSourceFlag = true
- if (!this.hform.HSourceBillNo) {
- this.hform.SourceFlag = true
- 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 || -1
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
- .hSourceBillTypeField)
- if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- this.showHMainSourceBillType = false
- }
- // 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 = ''
- this.refreshBarCodeState()
- } else {
- this.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
}
- },
- fail: (res) => {
+ //鏄剧ず琛ㄤ綋鏄庣粏
+ this.DisBillEntryList()
+ //娓呯┖鏁伴噺
+ this.hform.HQty = ''
+ this.refreshBarCodeState()
+ } else {
this.playSound(0)
this.refreshBarCodeState()
- console.log(res);
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
- },
- });
+ }
+ } catch (err) {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ console.log(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/Get_BarCode_Json',
+ // data: {
+ // sBarCode: sBarCode,
+ // HInterID: this.hform.HInterID,
+ // HBillType: this.hform.HBillType,
+ // HBillNo: this.hform.HBillNo,
+ // HMaker: this.hform.HMaker,
+ // HWhID: sHWHID,
+ // HSPID: sHSPID,
+ // HQty: sHQty,
+ // HRedBlueFlag: this.hform.HRedBlueFlag,
+ // // SourceFlag: HSourceFlag,
+ // SourceFlag: this.hform.SourceFlag,
+ // 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) {
+ // this.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.HSourceFlag = true
+ // 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
+ // this.hform.SourceFlag = true
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙� 婧愬崟绫诲瀷涓虹┖ 鍒� 鍒ゅ畾涓烘墜宸ュ綍鍏�
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField || -1
+ //
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // if (data.hSourceBillTypeField == "1242") {
+ // // this.HMainSourceBillType = '鍑哄簱鐢宠鍗�'
+ // // this.hform.HMainSourceBillType = 1242
+ // // 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
+ // this.HSourceFlag = true
+ // if (!this.hform.HSourceBillNo) {
+ // this.hform.SourceFlag = true
+ // 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 || -1
+ //
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ // data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ // index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // 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 = ''
+ // this.refreshBarCodeState()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -1492,7 +1678,7 @@
url: '/pages/qitachuku_v2/form?OperationType=1'
})
},
- submit() {
+ async submit() {
//浠撳簱銆佷粨浣嶃�佷繚绠°�侀獙鏀躲�侀儴闂ㄣ�佸鎴锋枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1540,53 +1726,102 @@
icon: 'none'
})
} else {
- uni.showLoading({
- title: '璇风◢鍊�'
- })
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SaveOtherOutBill_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/qitachuku_v2/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- setTimeout(() => {
- uni.navigateBack();
- }, 500)
- }
+
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SaveOtherOutBill_Json',
+ method: 'POST',
+ data: {
+ oMain: sMainStr
+ },
+ })
+ if (!res) {
+ return
+ }
+ console.log(1, res);
+ uni.hideLoading()
+ if (res.data.count == 1) {
+ // let sMain = JSON.stringify(this.materMeta) + ';' + this.hform
+ // .HBillType + ';' + this.hform.HSourceBillNo
+ // 涓烘潯鐮佽缃嚭搴撳崟鍙峰拰鍑哄簱娆℃暟
+ // await this.Set_BarCodeBill(sMain)
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: '/pages/qitachuku_v2/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 (err) {
+ console.warn(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触:' + err,
+ icon: 'none'
+ })
+ }
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/set_SaveOtherOutBill_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/qitachuku_v2/form?OperationType=1'
+ // })
+ // } else if (res.cancel) {
+ // console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ // setTimeout(() => {
+ // uni.navigateBack();
+ // }, 500)
+ // }
+ // }
+ // });
+ // } else {
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
}
},
@@ -1599,7 +1834,7 @@
if (res.confirm) {
console.log('鐢ㄦ埛鐐瑰嚮纭畾');
uni.navigateBack({
- url: '/pages/shengchanlingliaoshengdan/table'
+ url: '/pages/qitachuku_v2/table'
})
} else if (res.cancel) {
console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
diff --git a/pages/qitachukujiaoyan/detail.vue b/pages/qitachukujiaoyan/detail.vue
index 50a63a3..363ff84 100644
--- a/pages/qitachukujiaoyan/detail.vue
+++ b/pages/qitachukujiaoyan/detail.vue
@@ -309,52 +309,104 @@
})
},
//鎵弿鍗曟嵁鍙锋潯鐮�
- GetMeesageByBillNo(e) {
- 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.barCodeFocus = true
- this.DisBillEntryList();
- } else {
- CommonUtils.playSound(0);
- this.refreshHBillState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- this.hform.HBillNo = ''
+ async GetMeesageByBillNo(e) {
+
+ 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
}
- },
- fail: (res) => {
- CommonUtils.playSound(0);
+ this.tabs = 2
+ this.DisBillEntryList();
+ this.refreshBarCodeState()
+ } else {
+ CommonUtils.playSound(0)
this.refreshHBillState()
- console.log(res);
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: Message,
icon: 'none'
})
- },
- });
+ this.hform.HBillNo = ''
+ }
+ } catch (e) {
+ CommonUtils.playSound(0)
+ this.refreshHBillState()
+ 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.barCodeFocus = true
+ // this.DisBillEntryList();
+ // } else {
+ // CommonUtils.playSound(0);
+ // this.refreshHBillState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // this.hform.HBillNo = ''
+ // }
+ // },
+ // fail: (res) => {
+ // CommonUtils.playSound(0);
+ // this.refreshHBillState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
},
//鍩虹浠撳簱璧勬枡
getHBaseList() {
@@ -442,7 +494,7 @@
}
}
},
- getCode(HBarCode) {
+ async getCode(HBarCode) {
//浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -468,102 +520,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) => {
- CommonUtils.playSound(1);
- console.log('鍒犻櫎鏉$爜', res.data);
- this.hform.HBarCode = ''
- if (res.data.count == 1) {
- this.hform.HQty = ''
- this.DisBillEntryList()
- CommonUtils.playSound(1)
- } else {
- CommonUtils.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- CommonUtils.playSound(0);
- this.refreshBarCodeState()
- 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) {
+ CommonUtils.playSound(0)
+ this.refreshBarCodeState()
+ 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) => {
+ // CommonUtils.playSound(1);
+ // console.log('鍒犻櫎鏉$爜', res.data);
+ // this.hform.HBarCode = ''
+ // if (res.data.count == 1) {
+ // this.hform.HQty = ''
+ // this.DisBillEntryList()
+ // CommonUtils.playSound(1)
+ // } else {
+ // CommonUtils.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // CommonUtils.playSound(0);
+ // this.refreshBarCodeState()
+ // 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
@@ -582,63 +704,160 @@
}
//渚涘簲鍟嗕笉鍙紪杈�
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);
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
}
- },
- fail: (res) => {
- CommonUtils.playSound(0);
+ //鏄剧ず琛ㄤ綋鏄庣粏
+ this.DisBillEntryList()
+ //娓呯┖鏁伴噺
+ this.hform.HQty = ''
this.refreshBarCodeState()
- console.log(res);
+ } else {
+ CommonUtils.playSound(0);
+ this.refreshHBillState()
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
- },
- });
+ }
+ } catch (e) {
+ CommonUtils.playSound(0)
+ this.refreshHBillState()
+ 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
+ // 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);
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // CommonUtils.playSound(0);
+ // this.refreshBarCodeState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -737,7 +956,7 @@
url: '/pages/qitachukujiaoyan/detail?OperationType=1'
})
},
- submit() {
+ async submit() {
if (this.hform.HInterID == 0 || !this.hform.HInterID) {
uni.showToast({
title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忓崟鎹潯鐮侊紒',
@@ -766,59 +985,106 @@
icon: 'none'
})
} else {
- uni.showLoading({
- title: '璇风◢鍊�'
- })
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SaveOtherOutBill_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/qitachukujiaoyan/detail?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);
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SaveOtherOutBill_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/qitachukujiaoyan/detail?OperationType=1'
+ })
+ } else if (res.cancel) {
+ console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ setTimeout(() => {
+ uni.navigateBack();
+ }, 50)
+ }
+ }
+ });
+ } else {
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ 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_SaveOtherOutBill_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/qitachukujiaoyan/detail?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'
+ // })
+ // },
+ // });
}
}
},
diff --git a/pages/qitaruku_v2/form.vue b/pages/qitaruku_v2/form.vue
index d8b521b..a46a8ac 100644
--- a/pages/qitaruku_v2/form.vue
+++ b/pages/qitaruku_v2/form.vue
@@ -1088,7 +1088,7 @@
});
},
//鎵潯鐮佸鐞�
- getCode(HBarCode) {
+ async getCode(HBarCode) {
//浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1115,102 +1115,177 @@
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.playSound(1)
- this.hform.HQty = ''
- this.DisBillEntryList()
- } else {
- this.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBarCode: sBarCode
}
- },
- fail: (res) => {
+ })
+ if (!res) {
+ return
+ }
+ console.log('鍒犻櫎鏉$爜', res.data);
+ this.hform.HBarCode = ''
+ if (res.data.count == 1) {
+ this.playSound(1)
+ this.hform.HQty = ''
+ this.DisBillEntryList()
+ } else {
this.playSound(0)
this.refreshBarCodeState()
- console.log(res);
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
- },
- });
+ }
+ } catch (err) {
+ this.refreshBarCodeState()
+ this.playSound(0)
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
+ 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.playSound(1)
+ // this.hform.HQty = ''
+ // this.DisBillEntryList()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // 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_BarCode_Json',
- data: {
- sBarCode: sBarCode,
- HInterID: this.hform.HInterID,
- HBillType: this.hform.HBillType,
- HBillNo: this.hform.HBillNo,
- HMaker: this.hform.HMaker,
- HWhID: sHWHID,
- HSPID: sHSPID,
- HQty: sHQty,
- HRedBlueFlag: this.hform.HRedBlueFlag,
- SourceFlag: this.hform.SourceFlag,
- 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) {
- this.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_BarCode_Json',
+ data: {
+ sBarCode: sBarCode,
+ HInterID: this.hform.HInterID,
+ 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) {
+ this.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
+ this.hform.SourceFlag = true
+ 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
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ .hSourceBillTypeField)
+ if (index != -1) {
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ this.showHMainSourceBillType = false
+ }
+ // if (data.hSourceBillTypeField == "1241") {
+ // this.HMainSourceBillType = '鍏ュ簱鐢宠鍗�'
+ // this.hform.HMainSourceBillType = 1241
+ // 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.SourceFlag = true
this.hform.HSupName = data.hSupNameField
this.hform.HSupID = data.hSupIDField
- this.hform.SourceFlag = true
+ 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
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙� 娌℃湁婧愬崟绫诲瀷鍒欓粯璁や负鎵嬪伐褰曞叆
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField || -1
let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
.hSourceBillTypeField)
@@ -1219,9 +1294,13 @@
this.hform.HMainSourceBillType = data.hSourceBillTypeField
this.showHMainSourceBillType = false
}
- // if (data.hSourceBillTypeField == "1241") {
- // this.HMainSourceBillType = '鍏ュ簱鐢宠鍗�'
- // this.hform.HMainSourceBillType = 1241
+ // 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 = '鎵嬪伐褰曞叆'
@@ -1231,74 +1310,179 @@
if (data.hMulSourceFlagField == 0) {
this.showHSourceBillNo = false
}
- //瀹㈡埛涓嶅彲缂栬緫
+ //渚涘簲鍟嗕笉鍙紪杈�
this.showHSupName = false
- this.tabs = 2
- } else { //鐗╂枡鏉$爜
- this.tabs = 2
- if (!this.hform.HSourceBillNo) {
- this.hform.SourceFlag = true
- 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 || -1
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
- .hSourceBillTypeField)
- if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- this.showHMainSourceBillType = false
- }
- // 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 = ''
- this.refreshBarCodeState()
- } else {
- this.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
}
- },
- fail: (res) => {
+ //鏄剧ず琛ㄤ綋鏄庣粏
+ this.DisBillEntryList()
+ //娓呯┖鏁伴噺
+ this.hform.HQty = ''
+ this.refreshBarCodeState()
+ } else {
this.playSound(0)
this.refreshBarCodeState()
- console.log(res);
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
- },
- });
+ }
+ } catch (err) {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ console.log(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/Get_BarCode_Json',
+ // data: {
+ // sBarCode: sBarCode,
+ // HInterID: this.hform.HInterID,
+ // HBillType: this.hform.HBillType,
+ // HBillNo: this.hform.HBillNo,
+ // HMaker: this.hform.HMaker,
+ // HWhID: sHWHID,
+ // HSPID: sHSPID,
+ // HQty: sHQty,
+ // HRedBlueFlag: this.hform.HRedBlueFlag,
+ // SourceFlag: this.hform.SourceFlag,
+ // 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) {
+ // this.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
+ // this.hform.SourceFlag = true
+ // if (data.hDeptIDField != 0) {
+ // this.hform.HDeptID = data.hDeptIDField
+ // this.hform.HDeptName = data.hDeptNameField
+ // }
+ // this.hform.HSourceBillNo = data.hSourceBillNoField
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ //
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // if (data.hSourceBillTypeField == "1241") {
+ // // this.HMainSourceBillType = '鍏ュ簱鐢宠鍗�'
+ // // this.hform.HMainSourceBillType = 1241
+ // // 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.SourceFlag = true
+ // 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 || -1
+ //
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ // data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ // index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // 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 = ''
+ // this.refreshBarCodeState()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -1493,7 +1677,7 @@
url: '/pages/qitaruku_v2/form?OperationType=1'
})
},
- submit() {
+ async submit() {
//浠撳簱銆佷粨浣嶃�佷繚绠°�侀獙鏀躲�侀儴闂ㄣ�佸鎴锋枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1541,53 +1725,102 @@
icon: 'none'
})
} else {
- uni.showLoading({
- title: '璇风◢鍊�'
- })
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SaveOtherInBill_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/qitaruku_v2/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- setTimeout(() => {
- uni.navigateBack();
- }, 500)
- }
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SaveOtherInBill_Json',
+ method: 'POST',
+ data: {
+ oMain: sMainStr
+ },
+ })
+ if (!res) {
+ return
+ }
+ console.log(1, res);
+ uni.hideLoading()
+ if (res.data.count == 1) {
+ // let sMain = JSON.stringify(this.materMeta) + ';' + this.hform
+ // .HBillType + ';' + this.hform.HSourceBillNo
+ // 涓烘潯鐮佽缃嚭搴撳崟鍙峰拰鍑哄簱娆℃暟
+ // await this.Set_BarCodeBill(sMain)
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: '/pages/qitaruku_v2/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 (err) {
+ console.warn(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触:' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/set_SaveOtherInBill_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/qitaruku_v2/form?OperationType=1'
+ // })
+ // } else if (res.cancel) {
+ // console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ // setTimeout(() => {
+ // uni.navigateBack();
+ // }, 500)
+ // }
+ // }
+ // });
+ // } else {
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
}
},
diff --git a/pages/qitarukujiaoyan/form.vue b/pages/qitarukujiaoyan/form.vue
index 5640703..7f1f775 100644
--- a/pages/qitarukujiaoyan/form.vue
+++ b/pages/qitarukujiaoyan/form.vue
@@ -1,978 +1,1262 @@
<template>
- <view>
- <view class="form">
- <view class="form-item">
- <view class="title">鏉$爜:</view>
- <view class="right">
- <input v-model="hform.HBarCode" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜" @confirm="getCode(hform.HBarCode)" />
- </view>
- <uni-icons type="scan"
- style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
- size="20" @click="toScanCode"></uni-icons>
- </view>
- <view class="form-item">
- <view class="title">鏁伴噺:</view>
- <view class="right">
- <input v-model="hform.HQty" placeholder="璇疯緭鍏ユ暟閲�" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">浠撳簱:</view>
- <view class="right">
- <uni-combox :candidates="arrayHWHName" placeholder="璇疯緭鍏�(鎴栨壂鎻�)浠撳簱" v-model="hform.HWHName"
- @input="HWHNameChange"></uni-combox>
- </view>
- </view>
- <view class="form-item">
- <view class="title">浠撲綅:</view>
- <view class="right" v-show="showHStockPlaceName">
- <uni-combox :candidates="arrayHStockPlaceName" placeholder="璇疯緭鍏�(鎴栨壂鎻�)浠撲綅"
- v-model="hform.HStockPlaceName" @input="HStockPlaceNameChange"></uni-combox>
- </view>
- <view class="righton" v-show="!showHStockPlaceName">
- <input v-model="hform.HStockPlaceName" :disabled="!showHStockPlaceName" placeholder="涓嶅彲鎿嶄綔" /></view>
- </view>
+ <view>
+ <view class="form">
+ <view class="form-item">
+ <view class="title">鏉$爜:</view>
+ <view class="right">
+ <input v-model="hform.HBarCode" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜" @confirm="getCode(hform.HBarCode)" />
+ </view>
+ <uni-icons type="scan"
+ style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
+ size="20" @click="toScanCode"></uni-icons>
+ </view>
+ <view class="form-item">
+ <view class="title">鏁伴噺:</view>
+ <view class="right">
+ <input v-model="hform.HQty" placeholder="璇疯緭鍏ユ暟閲�" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">浠撳簱:</view>
+ <view class="right">
+ <uni-combox :candidates="arrayHWHName" placeholder="璇疯緭鍏�(鎴栨壂鎻�)浠撳簱" v-model="hform.HWHName"
+ @input="HWHNameChange"></uni-combox>
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">浠撲綅:</view>
+ <view class="right" v-show="showHStockPlaceName">
+ <uni-combox :candidates="arrayHStockPlaceName" placeholder="璇疯緭鍏�(鎴栨壂鎻�)浠撲綅"
+ v-model="hform.HStockPlaceName" @input="HStockPlaceNameChange"></uni-combox>
+ </view>
+ <view class="righton" v-show="!showHStockPlaceName">
+ <input v-model="hform.HStockPlaceName" :disabled="!showHStockPlaceName" placeholder="涓嶅彲鎿嶄綔" />
+ </view>
+ </view>
- <view class="tabs">
- <!-- <view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">閫夋嫨婧愬崟</view> -->
- <view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">琛ㄥご淇℃伅</view>
- <view :class="tabs == 2 ? 'on':''" @tap="tabs = 2">鐗╂枡淇℃伅</view>
- <view :class="tabs == 3 ? 'on':''" @tap="tabs = 3">鏉$爜淇℃伅</view>
- </view>
+ <view class="tabs">
+ <!-- <view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">閫夋嫨婧愬崟</view> -->
+ <view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">琛ㄥご淇℃伅</view>
+ <view :class="tabs == 2 ? 'on':''" @tap="tabs = 2">鐗╂枡淇℃伅</view>
+ <view :class="tabs == 3 ? 'on':''" @tap="tabs = 3">鏉$爜淇℃伅</view>
+ </view>
- <view v-if="tabs == 1">
- <view class="form-item" v-show="showHBillNo">
- <view class="title">鍗曟嵁鍙�:</view>
- <view class="right" style="width: 380rpx;">
- <input name="HBillNo" v-model="hform.HBillNo" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜"
- @confirm="GetMeesageByBillNo(hform.HBarCode)" />
- </view>
- <uni-icons type="scan"
- style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
- size="20" @click="toScanBillCode"></uni-icons>
- </view>
- <view class="form-item" v-show="!showHBillNo">
- <view class="title">鍗曟嵁鍙�:</view>
- <view class="righton">
- <input name="HBillNo" disabled v-model="hform.HBillNo" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">鍗曟嵁ID:</view>
- <view class="righton">
- <input name="HInterID" disabled v-model="hform.HInterID" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">鍒跺崟浜�:</view>
- <view class="righton">
- <input name="HMaker" disabled v-model="hform.HMaker" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">缁勭粐:</view>
- <view class="righton">
- <input name="HStockOrgName" disabled v-model="hform.HStockOrgName" />
- </view>
- </view>
- <label class="checkbox" style="float: right;">
- <checkbox :checked="hform.chkHBarflag" style="transform:scale(0.8)" disabled color="#4f81fc" />鏉$爜鏍稿
- </label>
- </view>
- <view v-if="tabs == 2">
- <view class="list" v-for="(item,index) in Materlist" :key="index">
- <uni-card :title="item.鐗╂枡鍚嶇О" :extra="'鏁伴噺:'+item.鏁伴噺" style="margin: 10px;" @tap="delMater(item)">
- <view class="card-detail">
- <view class="detail">
- <text>鐗╂枡浠g爜锛�</text>{{item.鐗╂枡浠g爜}}
- </view>
- <view class="detail">
- <text>鍗曟嵁鏁伴噺锛�</text>{{item.鍗曟嵁鏁伴噺}}
- </view>
- <view class="detail" v-if="item.瑙勬牸鍨嬪彿">
- <text>瑙勬牸鍨嬪彿锛�</text>{{item.瑙勬牸鍨嬪彿}}
- </view>
- <view class="detail">
- <text>鎵规锛�</text>{{item.鎵规}}
- </view>
- <view class="detail" v-if="item.杈呭姪灞炴��">
- <text>杈呭姪灞炴�э細</text>{{item.杈呭姪灞炴�}
- </view>
- <view class="detail" v-if="item.浠撳簱">
- <text>浠撳簱锛�</text>{{item.浠撳簱}}
- </view>
- <view class="detail" v-if="item.浠撲綅">
- <text>浠撲綅锛�</text>{{item.浠撲綅}}
- </view>
- <view class="detail">
- <text>鏉$爜涓暟锛�</text>{{item.鏉$爜涓暟}}
- </view>
- </view>
- </uni-card>
- </view>
- <view class="over" v-if="Materlist.length == 0">鏆傛棤鏁版嵁</view>
- </view>
+ <view v-if="tabs == 1">
+ <view class="form-item" v-show="showHBillNo">
+ <view class="title">鍗曟嵁鍙�:</view>
+ <view class="right" style="width: 380rpx;">
+ <input name="HBillNo" v-model="hform.HBillNo" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜"
+ @confirm="GetMeesageByBillNo(hform.HBarCode)" />
+ </view>
+ <uni-icons type="scan"
+ style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
+ size="20" @click="toScanBillCode"></uni-icons>
+ </view>
+ <view class="form-item" v-show="!showHBillNo">
+ <view class="title">鍗曟嵁鍙�:</view>
+ <view class="righton">
+ <input name="HBillNo" disabled v-model="hform.HBillNo" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鍗曟嵁ID:</view>
+ <view class="righton">
+ <input name="HInterID" disabled v-model="hform.HInterID" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鍒跺崟浜�:</view>
+ <view class="righton">
+ <input name="HMaker" disabled v-model="hform.HMaker" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">缁勭粐:</view>
+ <view class="righton">
+ <input name="HStockOrgName" disabled v-model="hform.HStockOrgName" />
+ </view>
+ </view>
+ <label class="checkbox" style="float: right;">
+ <checkbox :checked="hform.chkHBarflag" style="transform:scale(0.8)" disabled color="#4f81fc" />鏉$爜鏍稿
+ </label>
+ </view>
+ <view v-if="tabs == 2">
+ <view class="list" v-for="(item,index) in Materlist" :key="index">
+ <uni-card :title="item.鐗╂枡鍚嶇О" :extra="'鏁伴噺:'+item.鏁伴噺" style="margin: 10px;" @tap="delMater(item)">
+ <view class="card-detail">
+ <view class="detail">
+ <text>鐗╂枡浠g爜锛�</text>{{item.鐗╂枡浠g爜}}
+ </view>
+ <view class="detail">
+ <text>鍗曟嵁鏁伴噺锛�</text>{{item.鍗曟嵁鏁伴噺}}
+ </view>
+ <view class="detail" v-if="item.瑙勬牸鍨嬪彿">
+ <text>瑙勬牸鍨嬪彿锛�</text>{{item.瑙勬牸鍨嬪彿}}
+ </view>
+ <view class="detail">
+ <text>鎵规锛�</text>{{item.鎵规}}
+ </view>
+ <view class="detail" v-if="item.杈呭姪灞炴��">
+ <text>杈呭姪灞炴�э細</text>{{item.杈呭姪灞炴�}
+ </view>
+ <view class="detail" v-if="item.浠撳簱">
+ <text>浠撳簱锛�</text>{{item.浠撳簱}}
+ </view>
+ <view class="detail" v-if="item.浠撲綅">
+ <text>浠撲綅锛�</text>{{item.浠撲綅}}
+ </view>
+ <view class="detail">
+ <text>鏉$爜涓暟锛�</text>{{item.鏉$爜涓暟}}
+ </view>
+ </view>
+ </uni-card>
+ </view>
+ <view class="over" v-if="Materlist.length == 0">鏆傛棤鏁版嵁</view>
+ </view>
- <view v-if="tabs == 3">
- <view class="form-item">
- <view class="title">鏉$爜:</view>
- <view class="righton">
- <input name="HBarCode_B" disabled v-model="hform.HBarCode_B" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">鐗╂枡:</view>
- <view class="righton">
- <input disabled v-model="hform.HMaterName_B" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">瑙勬牸:</view>
- <view class="righton">
- <input disabled v-model="hform.HMaterModel_B" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">鎵规:</view>
- <view class="righton">
- <input disabled v-model="hform.HBatchNo_B" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">鍗曚綅:</view>
- <view class="righton">
- <input disabled v-model="hform.HUnitName_B" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">鏁伴噺:</view>
- <view class="righton">
- <input disabled v-model="hform.HQty_B" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">瀹归噺:</view>
- <view class="righton">
- <input disabled v-model="hform.HTMQty_B" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">浠撳簱:</view>
- <view class="righton">
- <input disabled v-model="hform.HWHName_B" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">浠撲綅:</view>
- <view class="righton">
- <input disabled v-model="hform.HSPName_B" />
- </view>
- </view>
- </view>
+ <view v-if="tabs == 3">
+ <view class="form-item">
+ <view class="title">鏉$爜:</view>
+ <view class="righton">
+ <input name="HBarCode_B" disabled v-model="hform.HBarCode_B" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鐗╂枡:</view>
+ <view class="righton">
+ <input disabled v-model="hform.HMaterName_B" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">瑙勬牸:</view>
+ <view class="righton">
+ <input disabled v-model="hform.HMaterModel_B" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鎵规:</view>
+ <view class="righton">
+ <input disabled v-model="hform.HBatchNo_B" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鍗曚綅:</view>
+ <view class="righton">
+ <input disabled v-model="hform.HUnitName_B" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鏁伴噺:</view>
+ <view class="righton">
+ <input disabled v-model="hform.HQty_B" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">瀹归噺:</view>
+ <view class="righton">
+ <input disabled v-model="hform.HTMQty_B" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">浠撳簱:</view>
+ <view class="righton">
+ <input disabled v-model="hform.HWHName_B" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">浠撲綅:</view>
+ <view class="righton">
+ <input disabled v-model="hform.HSPName_B" />
+ </view>
+ </view>
+ </view>
- <view class="bottom-btn">
- <button class="btn-a" size="mini" @tap="submit">鎻愪氦</button>
- <button class="btn-c" size="mini" @tap="goBack">閫�鍑�</button>
- </view>
- </view>
- </view>
+ <view class="bottom-btn">
+ <button class="btn-a" size="mini" @tap="submit">鎻愪氦</button>
+ <button class="btn-c" size="mini" @tap="goBack">閫�鍑�</button>
+ </view>
+ </view>
+ </view>
</template>
<script>
- import getDateTime from '@/utils/getdateTime.js';
- import {
- getUserInfo
- } from "@/utils/auth.js";
- import {
- CommonUtils
- } from "@/utils/common.js"
- export default {
- data() {
- return {
- userInfo: getUserInfo(),
- serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
- HModName: 'Kf_OtherInBill_CheckList_PDA',
- ModRightName: 'CE_OtherInCheck',
- OperationType: 1,
-
- showHStockPlaceName: false,
- showHBillNo: true,
- tabs: 1,
- linterid: '',
- HBillNo: '',
+ import getDateTime from '@/utils/getdateTime.js';
+ import {
+ getUserInfo
+ } from "@/utils/auth.js";
+ import {
+ CommonUtils
+ } from "@/utils/common.js"
+ export default {
+ data() {
+ return {
+ userInfo: getUserInfo(),
+ serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
+ HModName: 'Kf_OtherInBill_CheckList_PDA',
+ ModRightName: 'CE_OtherInCheck',
+ OperationType: 1,
- arrayHWHName: [], //浠撳簱
- HWHNameList: [],
- arrayHStockPlaceName: [], //浠撲綅
- HStockPlaceNameList: [],
+ showHStockPlaceName: false,
+ showHBillNo: true,
+ tabs: 1,
+ linterid: '',
+ HBillNo: '',
- Materlist: [],
- hform: {
- HBillType: 1203,
- HBillerID: uni.getStorageSync('HBillerID'),
- HRedBlueFlag: false,
+ arrayHWHName: [], //浠撳簱
+ HWHNameList: [],
+ arrayHStockPlaceName: [], //浠撲綅
+ HStockPlaceNameList: [],
- HBarCode: '',
- HQty: '',
- HWHName: getUserInfo().HWHName,
- HWHID: getUserInfo().HWhID,
- HStockPlaceName: getUserInfo().HSPName,
- HStockPlaceID: getUserInfo().HSPID,
+ Materlist: [],
+ hform: {
+ HBillType: 1203,
+ HBillerID: uni.getStorageSync('HBillerID'),
+ HRedBlueFlag: false,
- HBillNo: '',
- HInterID: '',
- HMaker: uni.getStorageSync('HUserName'),
- HStockOrgName: uni.getStorageSync('Organization'),
- HStockOrgID: uni.getStorageSync('OrganizationID'),
- HSourceBarCodeCtl: "N", //鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
- chkHBarflag: false,
- HBarflag: 'Y',
+ HBarCode: '',
+ HQty: '',
+ HWHName: getUserInfo().HWHName,
+ HWHID: getUserInfo().HWhID,
+ HStockPlaceName: getUserInfo().HSPName,
+ HStockPlaceID: getUserInfo().HSPID,
- HBarCode_B: '',
- HMaterName_B: '',
- HMaterModel_B: '',
- HBatchNo_B: '',
- HUnitName_B: '',
- HQty_B: '',
- HTMQty_B: '',
- HWHName_B: '',
- HSPName_B: '',
- }
- }
- },
- onLoad(e) {
- console.log(e, this.userInfo)
- this.OperationType = e.OperationType
- if (e.HBillNo) {
- this.hform.HBillNo = e.HBillNo
- this.GetMeesageByBillNo(e.HBillNo)
- } else {
- // this.getNewData()
- }
- this.getHBaseList()
- },
- methods: {
- //鎵爜
- toScanCode() {
- var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
- mpaasScanModule.mpaasScan({
- 'hideAlbum': true,
- 'timeoutInterval':'10', //瓒呮椂鏃堕棿
- 'timeoutText':'鏈瘑鍒埌浜岀淮鐮�' //瓒呮椂鎻愰啋
- },(ret) => {
- console.log(ret.resp_result)
- // if(this.hform.HBarCode == '*'){
- // this.hform.HBarCode = this.hform.HBarCode + ret.resp_result
- // }else{
- // this.hform.HBarCode = ret.resp_result
- // }
- this.hform.HBarCode = ret.resp_result
- // this.GetMeesageByBillNo(this.hform.HBarCode)
- this.getCode(this.hform.HBarCode)
- })
- },
- toScanBillCode() {
- var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
- mpaasScanModule.mpaasScan({
- 'hideAlbum': true,
- 'timeoutInterval':'10', //瓒呮椂鏃堕棿
- 'timeoutText':'鏈瘑鍒埌浜岀淮鐮�' //瓒呮椂鎻愰啋
- },(ret) => {
- console.log(ret.resp_result)
- // if(this.hform.HBarCode == '*'){
- // this.hform.HBarCode = this.hform.HBarCode + ret.resp_result
- // }else{
- // this.hform.HBarCode = ret.resp_result
- // }
-
- this.hform.HBillNo = ret.resp_result
- this.GetMeesageByBillNo(this.hform.HBillNo)
- })
- },
- //鎵弿鍗曟嵁鍙锋潯鐮�
- GetMeesageByBillNo(e) {
- 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();
- } else {
- CommonUtils.playSound(0);
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- this.hform.HBillNo = ''
- }
- },
- fail: (res) => {
- CommonUtils.playSound(0);
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
- },
- //鍩虹浠撳簱璧勬枡
- getHBaseList() {
- uni.request({
- url: this.serverUrl + '/Gy_Warehouse/list',
- data: {
- sWhere: "",
- user: uni.getStorageSync('HUserName'),
- Organization: uni.getStorageSync('Organization')
- },
- success: (res) => {
- if (res.data.count == 1) {
- this.HWHNameList = res.data.data
- for (var i = 0; i < res.data.data.length; i++) {
- this.arrayHWHName[i] = res.data.data[i].浠撳簱鍚嶇О
- }
- } else {
- uni.showToast({
- title: '浠撳簱鏁版嵁璇锋眰澶辫触',
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
+ HBillNo: '',
+ HInterID: '',
+ HMaker: uni.getStorageSync('HUserName'),
+ HStockOrgName: uni.getStorageSync('Organization'),
+ HStockOrgID: uni.getStorageSync('OrganizationID'),
+ HSourceBarCodeCtl: "N", //鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+ chkHBarflag: false,
+ HBarflag: 'Y',
- uni.request({
- url: this.serverUrl + '/Gy_StockPlace/list',
- data: {
- sWhere: "",
- user: uni.getStorageSync('HUserName'),
- Organization: uni.getStorageSync('Organization')
- },
- success: (res) => {
- if (res.data.count == 1) {
- this.HStockPlaceNameList = res.data.data
- for (var i = 0; i < res.data.data.length; i++) {
- this.arrayHStockPlaceName[i] = res.data.data[i].浠撲綅鍚嶇О
- }
- } else {
- uni.showToast({
- title: '浠撲綅鏁版嵁璇锋眰澶辫触',
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
- },
- //閫夋嫨浠撳簱
- HWHNameChange(e) {
- // var name = e.split("(")
- for (var i = 0; i < this.HWHNameList.length; i++) {
- if (this.HWHNameList[i].浠撳簱鍚嶇О == e) {
- this.hform.HWHName = this.HWHNameList[i].浠撳簱鍚嶇О
- this.hform.HWHID = this.HWHNameList[i].HItemID
-
- if(this.HWHNameList[i]['鍚敤浠撲綅'] == 'Y'){
- this.showHStockPlaceName = true
- }else {
- this.hform.HStockPlaceName = ''
- this.showHStockPlaceName = false
- }
- }
- }
- },
- //閫夋嫨浠撲綅
- HStockPlaceNameChange(e) {
- for (var i = 0; i < this.HStockPlaceNameList.length; i++) {
- if (this.HStockPlaceNameList[i].浠撲綅鍚嶇О == e) {
- this.hform.HStockPlaceName = this.HStockPlaceNameList[i].浠撲綅鍚嶇О
- this.hform.HStockPlaceID = this.HStockPlaceNameList[i].HItemID
- }
- }
- },
- getCode(HBarCode) {
- //浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲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);
+ HBarCode_B: '',
+ HMaterName_B: '',
+ HMaterModel_B: '',
+ HBatchNo_B: '',
+ HUnitName_B: '',
+ HQty_B: '',
+ HTMQty_B: '',
+ HWHName_B: '',
+ HSPName_B: '',
+ }
+ }
+ },
+ onLoad(e) {
+ console.log(e, this.userInfo)
+ this.OperationType = e.OperationType
+ if (e.HBillNo) {
+ this.hform.HBillNo = e.HBillNo
+ this.GetMeesageByBillNo(e.HBillNo)
+ } else {
+ // this.getNewData()
+ }
+ this.getHBaseList()
+ },
+ methods: {
+ async refreshHBarCodeFocus() {
+ this.HBarCodeFocus = false
+ await this.$nextTick()
+ this.hform.HBarCode = ''
+ this.HBarCodeFocus = true
+ },
+ async refreshHBillNoFocus() {
+ this.HBillNoFocus = false
+ await this.$nextTick(() => {
+ this.HBillNoFocus = true
+ this.hform.HBillNo = ""
+ })
+ },
+ //鎵爜
+ toScanCode() {
+ var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
+ mpaasScanModule.mpaasScan({
+ 'hideAlbum': true,
+ 'timeoutInterval': '10', //瓒呮椂鏃堕棿
+ 'timeoutText': '鏈瘑鍒埌浜岀淮鐮�' //瓒呮椂鎻愰啋
+ }, (ret) => {
+ console.log(ret.resp_result)
+ // if(this.hform.HBarCode == '*'){
+ // this.hform.HBarCode = this.hform.HBarCode + ret.resp_result
+ // }else{
+ // this.hform.HBarCode = ret.resp_result
+ // }
+ this.hform.HBarCode = ret.resp_result
+ // this.GetMeesageByBillNo(this.hform.HBarCode)
+ this.getCode(this.hform.HBarCode)
+ })
+ },
+ toScanBillCode() {
+ var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
+ mpaasScanModule.mpaasScan({
+ 'hideAlbum': true,
+ 'timeoutInterval': '10', //瓒呮椂鏃堕棿
+ 'timeoutText': '鏈瘑鍒埌浜岀淮鐮�' //瓒呮椂鎻愰啋
+ }, (ret) => {
+ console.log(ret.resp_result)
+ // if(this.hform.HBarCode == '*'){
+ // this.hform.HBarCode = this.hform.HBarCode + ret.resp_result
+ // }else{
+ // this.hform.HBarCode = ret.resp_result
+ // }
- 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;
- }
- 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'
- })
- }
- },
- fail: (res) => {
- CommonUtils.playSound(0);
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
- }
- },
- //鐗╂枡淇℃伅
- DisBillEntryList() {
- uni.request({
- url: this.serverUrl + '/WEBSController/GetKf_PonderationBillMain_Temp_BillCheck_New_Json',
- data: {
- HInterID: this.hform.HInterID,
- HBillType: this.hform.HBillType,
- HSourceBarCodeCtl: this.hform.HSourceBarCodeCtl,
- sWhere: ''
- },
- success: (res) => {
- console.log('鐗╂枡', res.data)
- if (res.data.count == 1) {
- var data = res.data.data
- this.Materlist = data.Materlist
- if (!data.BarCodeDetailslist[0].HBarCode) {
- this.hform.HMaterName_B = ''
- this.hform.HMaterModel_B = ''
- this.hform.HBatchNo_B = ''
- this.hform.HUnitName_B = ''
- this.hform.HQty_B = ''
- this.hform.HTMQty_B = ''
- this.hform.HWHName_B = ''
- this.hform.HSPName_B = ''
- } else {
- this.hform.HBarCode_B = data.BarCodeDetailslist[0].HBarCode
- this.hform.HMaterName_B = data.BarCodeDetailslist[0].HMaterName
- this.hform.HMaterModel_B = data.BarCodeDetailslist[0].HMaterModel
- this.hform.HBatchNo_B = data.BarCodeDetailslist[0].HBatchNo
- this.hform.HUnitName_B = data.BarCodeDetailslist[0].HUnitName
- this.hform.HQty_B = data.BarCodeDetailslist[0].HQty
- this.hform.HTMQty_B = data.BarCodeDetailslist[0].HTMQty
- this.hform.HWHName_B = data.BarCodeDetailslist[0].HWHName
- this.hform.HSPName_B = data.BarCodeDetailslist[0].HSPName
- }
- } else {
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
- },
- //鍒犻櫎鐗╂枡鐮�
- delMater(item) {
- uni.showModal({
- title: '鎻愮ず',
- content: '纭瑕佸垹闄� " ' + item.鐗╂枡鍚嶇О + ' " 鎵�鏈夋壂鐮佽褰曪紵鍒犻櫎鍚庡皢涓嶅彲鎭㈠锛�',
- success: (res) => {
- if (res.confirm) {
- uni.request({
- url: this.serverUrl +
- '/WEBSController/set_DeleteBarCodeByEntryID_BillCheck_New_Json',
- data: {
- HInterID: this.hform.HInterID,
- HBillType: this.hform.HBillType,
- HSourceInterID: item.HSourceInterID,
- HSourceEntryID: item.HSourceEntryID,
- HSourceBarCodeCtl: this.hform.HSourceBarCodeCtl
- },
- success: (res) => {
- if (res.data.count == 1) {
- this.DisBillEntryList()
- } else {
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- 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_SaveOtherInBill_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/qitaruku/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- setTimeout(() => {
- uni.navigateBack();
- }, 50)
- }
- }
- });
- } else {
- // uni.showToast({
- // title: res.data.Message,
- // icon: 'none'
- // })
+ this.hform.HBillNo = ret.resp_result
+ this.GetMeesageByBillNo(this.hform.HBillNo)
+ })
+ },
+ //鎵弿鍗曟嵁鍙锋潯鐮�
+ async GetMeesageByBillNo(e) {
- uni.showModal({
- title: '娓╅Θ鎻愮ず',
- content: res.data.Message,
- showCancel: false
- })
- }
- },
- fail: (res) => {
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
- }
- }
- },
+ 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()
+ 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();
+ // } else {
+ // CommonUtils.playSound(0);
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // this.hform.HBillNo = ''
+ // }
+ // },
+ // fail: (res) => {
+ // CommonUtils.playSound(0);
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
+ },
+ //鍩虹浠撳簱璧勬枡
+ getHBaseList() {
+ uni.request({
+ url: this.serverUrl + '/Gy_Warehouse/list',
+ data: {
+ sWhere: "",
+ user: uni.getStorageSync('HUserName'),
+ Organization: uni.getStorageSync('Organization')
+ },
+ success: (res) => {
+ if (res.data.count == 1) {
+ this.HWHNameList = res.data.data
+ for (var i = 0; i < res.data.data.length; i++) {
+ this.arrayHWHName[i] = res.data.data[i].浠撳簱鍚嶇О
+ }
+ } else {
+ uni.showToast({
+ title: '浠撳簱鏁版嵁璇锋眰澶辫触',
+ icon: 'none'
+ })
+ }
+ },
+ fail: (res) => {
+ console.log(res);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触',
+ icon: 'none'
+ })
+ },
+ });
- goBack() {
- uni.showModal({
- title: '鎻愮ず',
- content: '纭瑕侀��鍑哄綋鍓嶉〉闈㈠悧锛�',
- success: (res) => {
- if (res.confirm) {
- console.log('鐢ㄦ埛鐐瑰嚮纭畾');
- uni.navigateBack({
- url: '/pages/qitaruku/table'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- }
- }
- });
- }
- }
- }
+ uni.request({
+ url: this.serverUrl + '/Gy_StockPlace/list',
+ data: {
+ sWhere: "",
+ user: uni.getStorageSync('HUserName'),
+ Organization: uni.getStorageSync('Organization')
+ },
+ success: (res) => {
+ if (res.data.count == 1) {
+ this.HStockPlaceNameList = res.data.data
+ for (var i = 0; i < res.data.data.length; i++) {
+ this.arrayHStockPlaceName[i] = res.data.data[i].浠撲綅鍚嶇О
+ }
+ } else {
+ uni.showToast({
+ title: '浠撲綅鏁版嵁璇锋眰澶辫触',
+ icon: 'none'
+ })
+ }
+ },
+ fail: (res) => {
+ console.log(res);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触',
+ icon: 'none'
+ })
+ },
+ });
+ },
+ //閫夋嫨浠撳簱
+ HWHNameChange(e) {
+ // var name = e.split("(")
+ for (var i = 0; i < this.HWHNameList.length; i++) {
+ if (this.HWHNameList[i].浠撳簱鍚嶇О == e) {
+ this.hform.HWHName = this.HWHNameList[i].浠撳簱鍚嶇О
+ this.hform.HWHID = this.HWHNameList[i].HItemID
+
+ if (this.HWHNameList[i]['鍚敤浠撲綅'] == 'Y') {
+ this.showHStockPlaceName = true
+ } else {
+ this.hform.HStockPlaceName = ''
+ this.showHStockPlaceName = false
+ }
+ }
+ }
+ },
+ //閫夋嫨浠撲綅
+ HStockPlaceNameChange(e) {
+ for (var i = 0; i < this.HStockPlaceNameList.length; i++) {
+ if (this.HStockPlaceNameList[i].浠撲綅鍚嶇О == e) {
+ this.hform.HStockPlaceName = this.HStockPlaceNameList[i].浠撲綅鍚嶇О
+ this.hform.HStockPlaceID = this.HStockPlaceNameList[i].HItemID
+ }
+ }
+ },
+ async getCode(HBarCode) {
+ //浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲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 = ''
+ this.refreshHBarCodeFocus()
+ } else {
+ CommonUtils.playSound(0);
+ this.refreshHBillNoFocus()
+ 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/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'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // CommonUtils.playSound(0);
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
+ }
+ },
+ //鐗╂枡淇℃伅
+ DisBillEntryList() {
+ uni.request({
+ url: this.serverUrl + '/WEBSController/GetKf_PonderationBillMain_Temp_BillCheck_New_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HSourceBarCodeCtl: this.hform.HSourceBarCodeCtl,
+ sWhere: ''
+ },
+ success: (res) => {
+ console.log('鐗╂枡', res.data)
+ if (res.data.count == 1) {
+ var data = res.data.data
+ this.Materlist = data.Materlist
+ if (!data.BarCodeDetailslist[0].HBarCode) {
+ this.hform.HMaterName_B = ''
+ this.hform.HMaterModel_B = ''
+ this.hform.HBatchNo_B = ''
+ this.hform.HUnitName_B = ''
+ this.hform.HQty_B = ''
+ this.hform.HTMQty_B = ''
+ this.hform.HWHName_B = ''
+ this.hform.HSPName_B = ''
+ } else {
+ this.hform.HBarCode_B = data.BarCodeDetailslist[0].HBarCode
+ this.hform.HMaterName_B = data.BarCodeDetailslist[0].HMaterName
+ this.hform.HMaterModel_B = data.BarCodeDetailslist[0].HMaterModel
+ this.hform.HBatchNo_B = data.BarCodeDetailslist[0].HBatchNo
+ this.hform.HUnitName_B = data.BarCodeDetailslist[0].HUnitName
+ this.hform.HQty_B = data.BarCodeDetailslist[0].HQty
+ this.hform.HTMQty_B = data.BarCodeDetailslist[0].HTMQty
+ this.hform.HWHName_B = data.BarCodeDetailslist[0].HWHName
+ this.hform.HSPName_B = data.BarCodeDetailslist[0].HSPName
+ }
+ } else {
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ },
+ fail: (res) => {
+ console.log(res);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触',
+ icon: 'none'
+ })
+ },
+ });
+ },
+ //鍒犻櫎鐗╂枡鐮�
+ delMater(item) {
+ uni.showModal({
+ title: '鎻愮ず',
+ content: '纭瑕佸垹闄� " ' + item.鐗╂枡鍚嶇О + ' " 鎵�鏈夋壂鐮佽褰曪紵鍒犻櫎鍚庡皢涓嶅彲鎭㈠锛�',
+ success: (res) => {
+ if (res.confirm) {
+ uni.request({
+ url: this.serverUrl +
+ '/WEBSController/set_DeleteBarCodeByEntryID_BillCheck_New_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HSourceInterID: item.HSourceInterID,
+ HSourceEntryID: item.HSourceEntryID,
+ HSourceBarCodeCtl: this.hform.HSourceBarCodeCtl
+ },
+ success: (res) => {
+ if (res.data.count == 1) {
+ this.DisBillEntryList()
+ } else {
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ },
+ 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_SaveOtherInBill_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/qitachukujiaoyan/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'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/set_SaveOtherInBill_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/qitaruku/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({
+ title: '鎻愮ず',
+ content: '纭瑕侀��鍑哄綋鍓嶉〉闈㈠悧锛�',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.navigateBack({
+ url: '/pages/qitaruku/table'
+ })
+ } else if (res.cancel) {
+ console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ }
+ }
+ });
+ }
+ }
+ }
</script>
<style lang="scss" scoped>
- .form {
- width: 668rpx;
- margin: 20rpx auto;
- padding-bottom: 240rpx;
- }
+ .form {
+ width: 668rpx;
+ margin: 20rpx auto;
+ padding-bottom: 240rpx;
+ }
- .tab_area {
- width: 100%;
- height: 50rpx;
- }
+ .tab_area {
+ width: 100%;
+ height: 50rpx;
+ }
- .other {
- margin-top: 8rpx;
- text-align: center;
- font-size: 28rpx;
- padding: 4rpx 18rpx;
- color: #1890FF;
- }
+ .other {
+ margin-top: 8rpx;
+ text-align: center;
+ font-size: 28rpx;
+ padding: 4rpx 18rpx;
+ color: #1890FF;
+ }
- .tabs {
- width: 100%;
- display: flex;
- border-bottom: 1px solid #ddd;
- margin: 20rpx 0;
+ .tabs {
+ width: 100%;
+ display: flex;
+ border-bottom: 1px solid #ddd;
+ margin: 20rpx 0;
- view {
- width: 25%;
- font-size: 30rpx;
- color: #555;
- text-align: center;
- padding: 16rpx 0;
- flex: 1;
- }
+ view {
+ width: 25%;
+ font-size: 30rpx;
+ color: #555;
+ text-align: center;
+ padding: 16rpx 0;
+ flex: 1;
+ }
- .on {
- color: #3a78ff;
- font-weight: bold;
- border-bottom: 3px solid #3a78ff;
- }
- }
+ .on {
+ color: #3a78ff;
+ font-weight: bold;
+ border-bottom: 3px solid #3a78ff;
+ }
+ }
- .form-item {
- display: flex;
- align-items: center;
- font-size: 30rpx;
- padding: 6rpx 0;
+ .form-item {
+ display: flex;
+ align-items: center;
+ font-size: 30rpx;
+ padding: 6rpx 0;
- .title {
- width: 208rpx;
+ .title {
+ width: 208rpx;
- text {
- color: red;
- font-weight: bold;
- }
- }
+ text {
+ color: red;
+ font-weight: bold;
+ }
+ }
- .right {
- flex: 1;
- border-radius: 22rpx;
- border: 1px solid #acacac;
- }
+ .right {
+ flex: 1;
+ border-radius: 22rpx;
+ border: 1px solid #acacac;
+ }
- .righton {
- width: 450rpx;
- border-radius: 22rpx;
- border: 1px solid #e4e4e4;
- background-color: #e4e4e4;
- }
+ .righton {
+ width: 450rpx;
+ border-radius: 22rpx;
+ border: 1px solid #e4e4e4;
+ background-color: #e4e4e4;
+ }
- input {
- // width: 100%;
- padding: 8rpx 20rpx;
- font-size: 30rpx;
- }
+ input {
+ // width: 100%;
+ padding: 8rpx 20rpx;
+ font-size: 30rpx;
+ }
- textarea {
- width: 98%;
- padding: 8rpx 20rpx;
- font-size: 30rpx;
- }
+ textarea {
+ width: 98%;
+ padding: 8rpx 20rpx;
+ font-size: 30rpx;
+ }
- }
+ }
- .bottom-btn {
- width: 100%;
- // height: 120rpx;
- position: fixed;
- bottom: 0;
- left: 0;
- background-color: #fff;
- box-shadow: 0 2rpx 10rpx 2rpx rgba(0, 0, 0, 0.4);
- padding: 30rpx 40rpx 40rpx 40rpx;
+ .bottom-btn {
+ width: 100%;
+ // height: 120rpx;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ background-color: #fff;
+ box-shadow: 0 2rpx 10rpx 2rpx rgba(0, 0, 0, 0.4);
+ padding: 30rpx 40rpx 40rpx 40rpx;
- button {
- border-radius: 50rpx;
- width: 180rpx;
- height: 66rpx;
- line-height: 66rpx;
- font-size: 28rpx;
- }
+ button {
+ border-radius: 50rpx;
+ width: 180rpx;
+ height: 66rpx;
+ line-height: 66rpx;
+ font-size: 28rpx;
+ }
- .btn-a {
- background-color: #3A78FF;
- color: #fff;
- }
+ .btn-a {
+ background-color: #3A78FF;
+ color: #fff;
+ }
- .btn-b {
- background-color: #41a863;
- color: #fff;
- }
+ .btn-b {
+ background-color: #41a863;
+ color: #fff;
+ }
- .btn-c {
- background-color: #acacac;
- color: #fff;
- position: absolute;
- right: 120rpx;
- }
+ .btn-c {
+ background-color: #acacac;
+ color: #fff;
+ position: absolute;
+ right: 120rpx;
+ }
- .btn-d {
- background-color: #ff8901;
- color: #fff;
- }
- }
+ .btn-d {
+ background-color: #ff8901;
+ color: #fff;
+ }
+ }
- .list {
- width: 100%;
+ .list {
+ width: 100%;
- .card-detail {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- line-height: 120%;
+ .card-detail {
+ width: 100%;
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-between;
+ line-height: 120%;
- .detail {
- // width: 50%;
- font-size: 26rpx;
- margin-bottom: 12rpx;
- color: #555;
- margin-right: 20rpx;
+ .detail {
+ // width: 50%;
+ font-size: 26rpx;
+ margin-bottom: 12rpx;
+ color: #555;
+ margin-right: 20rpx;
- text {
- color: #999;
- font-size: 26rpx;
- }
- }
- }
+ text {
+ color: #999;
+ font-size: 26rpx;
+ }
+ }
+ }
- .more {
- color: #888;
- font-size: 24rpx;
- display: flex;
- border-top: 1px solid #eee;
- padding-top: 20rpx;
+ .more {
+ color: #888;
+ font-size: 24rpx;
+ display: flex;
+ border-top: 1px solid #eee;
+ padding-top: 20rpx;
- .part {
- width: 50%;
- text-align: center;
- }
- }
- }
+ .part {
+ width: 50%;
+ text-align: center;
+ }
+ }
+ }
- .checkbox {
- color: #888;
- font-size: 28rpx;
- margin-top: 30rpx;
- float: right;
- }
+ .checkbox {
+ color: #888;
+ font-size: 28rpx;
+ margin-top: 30rpx;
+ float: right;
+ }
</style>
\ No newline at end of file
diff --git a/pages/shengchanbuliao/form.vue b/pages/shengchanbuliao/form.vue
index 9a64420..b66fafa 100644
--- a/pages/shengchanbuliao/form.vue
+++ b/pages/shengchanbuliao/form.vue
@@ -19,23 +19,24 @@
</view>
</view>
<view class="form-item">
- <view class="title">浠撳簱:</view>
- <view class="right">
- <uni-combox :candidates="arrayHWHName" placeholder="璇疯緭鍏�(鎴栨壂鎻�)浠撳簱" v-model="hform.HWHName"
- @input="HWHNameChange" @confirm="HWHNameScan"></uni-combox>
- </view>
+ <view class="title">浠撳簱:</view>
+ <view class="right">
+ <uni-combox :candidates="arrayHWHName" placeholder="璇疯緭鍏�(鎴栨壂鎻�)浠撳簱" v-model="hform.HWHName"
+ @input="HWHNameChange" @confirm="HWHNameScan"></uni-combox>
+ </view>
</view>
<view class="form-item">
- <view class="title">浠撲綅:</view>
- <view class="right" v-show="showHStockPlaceName">
- <uni-combox :candidates="HStockPlaceNameListComputed" placeholder="璇疯緭鍏�(鎴栨壂鎻�)浠撲綅"
- v-model="hform.HStockPlaceName" @input="HStockPlaceNameChange" @confirm='HStockPlaceNameScan'></uni-combox>
- </view>
- <view class="righton" v-show="!showHStockPlaceName">
- <input v-model="hform.HStockPlaceName" :disabled="!showHStockPlaceName" placeholder="涓嶅彲鎿嶄綔" />
- </view>
+ <view class="title">浠撲綅:</view>
+ <view class="right" v-show="showHStockPlaceName">
+ <uni-combox :candidates="HStockPlaceNameListComputed" placeholder="璇疯緭鍏�(鎴栨壂鎻�)浠撲綅"
+ v-model="hform.HStockPlaceName" @input="HStockPlaceNameChange"
+ @confirm='HStockPlaceNameScan'></uni-combox>
+ </view>
+ <view class="righton" v-show="!showHStockPlaceName">
+ <input v-model="hform.HStockPlaceName" :disabled="!showHStockPlaceName" placeholder="涓嶅彲鎿嶄綔" />
+ </view>
</view>
-
+
<view class="tabs">
<view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">閫夋嫨婧愬崟</view>
@@ -169,9 +170,9 @@
<view class="detail">
<text>鏁伴噺锛�</text>{{item.鏁伴噺}}
</view>
- <view class="detail" v-if="item.鍚堣鏁伴噺">
- <text>鍚堣鏁伴噺锛�</text>{{item.鍚堣鏁伴噺}}
- </view>
+ <view class="detail" v-if="item.鍚堣鏁伴噺">
+ <text>鍚堣鏁伴噺锛�</text>{{item.鍚堣鏁伴噺}}
+ </view>
<view class="detail">
<text>鏉$爜涓暟锛�</text>{{item.鏉$爜涓暟}}
</view>
@@ -181,10 +182,10 @@
<view class="detail" v-if="item.杈呭姪灞炴��">
<text>杈呭姪灞炴�э細</text>{{item.杈呭姪灞炴�}
</view>
- <view class="detail" v-if="item.娆惧彿">
- <text>娆惧彿锛�</text>{{item.娆惧彿}}
- </view>
-
+ <view class="detail" v-if="item.娆惧彿">
+ <text>娆惧彿锛�</text>{{item.娆惧彿}}
+ </view>
+
</view>
</uni-card>
</view>
@@ -299,8 +300,11 @@
} from "@/utils/auth.js";
import BillListPopupVue from '../../components/BillListPopup/BillListPopup.vue';
import BarCodePopupVue from "../../components/BarCodePopup/BarCodePopup.vue";
- import { getUserStockRelation } from '../../utils/userRelationManager';
- export default {
+ import {
+ getUserStockRelation
+ } from '../../utils/userRelationManager';
+ import { CommonUtils } from '../../utils/common';
+ export default {
data() {
return {
userInfo: getUserInfo(),
@@ -388,15 +392,16 @@
}
},
components: {
- BillListPopupVue, BarCodePopupVue
+ BillListPopupVue,
+ BarCodePopupVue
},
computed: {
HStockPlaceNameListComputed: {
get() {
// 鍔ㄦ�佽绠楀搴斾粨搴撶殑浠撲綅
return this.HStockPlaceNameList
- .filter(e => e['鎵�灞炰粨搴�'] == this.hform.HWHName)
- .map(e => e['浠撲綅鍚嶇О'])
+ .filter(e => e['鎵�灞炰粨搴�'] == this.hform.HWHName)
+ .map(e => e['浠撲綅鍚嶇О'])
}
}
},
@@ -416,8 +421,8 @@
this.getHSupList()
this.getHEmpList()
this.getHDeptList()
-
- this.getRelationStore()
+
+ this.getRelationStore()
uni.$on('BillSelectComplete', (e) => {
console.log("鎺ユ敹鍒扮殑娑堟伅: ", e.HBillNo)
@@ -425,7 +430,7 @@
this.$refs.billList.exit()
})
},
- beforeDestroy() {
+ onUnload() {
uni.$off('BillSelectComplete')
},
methods: {
@@ -433,12 +438,12 @@
// 鎵弿浠撳簱鐮�
console.log('浠撳簱鐮�: ', e);
let index = this.HWHNameList.findIndex(elem => elem['鏉$爜缂栧彿'] == e)
- if(index == -1){
+ if (index == -1) {
uni.showToast({
- icon:'none',
+ icon: 'none',
title: '鎵弿浠撳簱鏉$爜瀵瑰簲鐨勪粨搴撲笉瀛樺湪...'
})
- }else {
+ } else {
this.HWHNameChange(this.HWHNameList[index]['浠撳簱鍚嶇О'])
}
},
@@ -446,13 +451,13 @@
// 鎵弿浠撲綅鐮�
console.log('浠撲綅鐮�: ', e);
let index = this.HStockPlaceNameList.findIndex(elem => elem['鏉$爜缂栧彿'] == e)
- console.log('index: ',index);
- if(index == -1){
+ console.log('index: ', index);
+ if (index == -1) {
uni.showToast({
- icon:'none',
+ icon: 'none',
title: '鎵弿浠撲綅鏉$爜瀵瑰簲鐨勪粨浣嶄笉瀛樺湪...'
})
- }else {
+ } else {
this.HStockPlaceNameChange(this.HStockPlaceNameList[index]['浠撲綅鍚嶇О'])
}
},
@@ -461,34 +466,34 @@
this.$refs.barcodePopup.setCodeInfo(this.hform.HBillNo)
await this.$nextTick()
this.$refs.barcodePopup.open()
- }catch(err) {
+ } catch (err) {
uni.showToast({
icon: 'none',
title: err
})
}
},
- async getRelationStore() {
- let {
- data,
- count
- } = await getUserStockRelation()
- if (count == 1) {
- let WHIDList = []
-
- Array.from(data).forEach(elem => {
- WHIDList.push(elem.HItemID)
- })
-
- let sWhere = ` and HItemID in (${WHIDList.join(",")})`
- this.getHBaseList({
- sWhere: sWhere
- })
-
- } else {
- this.getHBaseList()
- }
- },
+ async getRelationStore() {
+ let {
+ data,
+ count
+ } = await getUserStockRelation()
+ if (count == 1) {
+ let WHIDList = []
+
+ Array.from(data).forEach(elem => {
+ WHIDList.push(elem.HItemID)
+ })
+
+ let sWhere = ` and HItemID in (${WHIDList.join(",")})`
+ this.getHBaseList({
+ sWhere: sWhere
+ })
+
+ } else {
+ this.getHBaseList()
+ }
+ },
async refreshHSourceBillState() {
this.HSourceBillNoFocus = false
await this.$nextTick(() => {
@@ -616,7 +621,9 @@
this.hform.HDate = e.detail.value
},
//鍩虹浠撳簱璧勬枡
- getHBaseList({sWhere=''} = {}) {
+ getHBaseList({
+ sWhere = ''
+ } = {}) {
uni.request({
url: this.serverUrl + '/Gy_Warehouse/list',
data: {
@@ -743,9 +750,9 @@
},
//閫夋嫨浠撲綅
HStockPlaceNameChange(e) {
-
+
let index = this.HStockPlaceNameList.findIndex(elem => elem['浠撲綅鍚嶇О'] == e)
-
+
if (index != -1) {
this.hform.HStockPlaceName = this.HStockPlaceNameList[index].浠撲綅鍚嶇О
this.hform.HStockPlaceID = this.HStockPlaceNameList[index].HMainID
@@ -974,7 +981,7 @@
});
},
//鎵潯鐮佸鐞�
- getCode(HBarCode) {
+ async getCode(HBarCode) {
//浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1001,162 +1008,24 @@
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.playSound(1)
- this.hform.HQty = ''
- this.DisBillEntryList()
- } else {
- this.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBarCode: sBarCode
}
- },
- fail: (res) => {
- this.playSound(0)
- this.refreshBarCodeState()
- 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_BarCode_Json',
- data: {
- sBarCode: sBarCode,
- HInterID: this.hform.HInterID,
- 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);
+ })
+ if (!res) {
+ return
+ }
+ console.log('鍒犻櫎鏉$爜', res.data);
this.hform.HBarCode = ''
if (res.data.count == 1) {
this.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
- //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- if (data.hSourceBillTypeField == "3720") {
- this.HMainSourceBillType = '鐢熶骇鐢ㄦ枡娓呭崟'
- this.hform.HMainSourceBillType = 3720
- 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
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
- .hSourceBillTypeField)
- if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- this.showHMainSourceBillType = false
- }
- // 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 = ''
- this.refreshBarCodeState()
+ this.DisBillEntryList()
} else {
this.playSound(0)
this.refreshBarCodeState()
@@ -1165,17 +1034,332 @@
icon: 'none'
})
}
- },
- fail: (res) => {
- this.playSound(0)
+ } catch (err) {
this.refreshBarCodeState()
- console.log(res);
+ this.playSound(0)
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
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.playSound(1)
+ // this.hform.HQty = ''
+ // this.DisBillEntryList()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // 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_BarCode_Json',
+ data: {
+ sBarCode: sBarCode,
+ HInterID: this.hform.HInterID,
+ 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) {
+ this.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
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ if (data.hSourceBillTypeField == "3720") {
+ this.HMainSourceBillType = '鐢熶骇鐢ㄦ枡娓呭崟'
+ this.hform.HMainSourceBillType = 3720
+ 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
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ data
+ .hSourceBillTypeField)
+ if (index != -1) {
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ index]
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ this.showHMainSourceBillType = false
+ }
+ // 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 = ''
+ this.refreshBarCodeState()
+ } else {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ } catch (err) {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ console.log(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/Get_BarCode_Json',
+ // data: {
+ // sBarCode: sBarCode,
+ // HInterID: this.hform.HInterID,
+ // 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) {
+ // this.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
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // if (data.hSourceBillTypeField == "3720") {
+ // this.HMainSourceBillType = '鐢熶骇鐢ㄦ枡娓呭崟'
+ // this.hform.HMainSourceBillType = 3720
+ // 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
+ //
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ // data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ // index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // 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 = ''
+ // this.refreshBarCodeState()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -1360,7 +1544,7 @@
url: '/pages/shengchanbuliao/form?OperationType=1'
})
},
- submit() {
+ async submit() {
//浠撳簱銆佷粨浣嶃�佷繚绠°�侀獙鏀躲�侀儴闂ㄣ�佸鎴锋枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1408,53 +1592,103 @@
icon: 'none'
})
} else {
- uni.showLoading({
- title: '璇风◢鍊�'
- })
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SaveMateReplenishOutBill_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/shengchanbuliao/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- // setTimeout(() => {
- // uni.navigateBack();
- // }, 500)
- }
+
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SaveMateReplenishOutBill_Json',
+ method: 'POST',
+ data: {
+ oMain: sMainStr
+ },
+ })
+ if (!res) {
+ return
+ }
+ console.log(1, res);
+ uni.hideLoading()
+ if (res.data.count == 1) {
+ // let sMain = JSON.stringify(this.materMeta) + ';' + this.hform
+ // .HBillType + ';' + this.hform.HSourceBillNo
+ // 涓烘潯鐮佽缃嚭搴撳崟鍙峰拰鍑哄簱娆℃暟
+ // await this.Set_BarCodeBill(sMain)
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: '/pages/shengchanbuliao/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 (err) {
+ console.warn(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触:' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/set_SaveMateReplenishOutBill_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/shengchanbuliao/form?OperationType=1'
+ // })
+ // } else if (res.cancel) {
+ // console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ // // setTimeout(() => {
+ // // uni.navigateBack();
+ // // }, 500)
+ // }
+ // }
+ // });
+ // } else {
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
}
},
@@ -1530,7 +1764,7 @@
.title {
width: 208rpx;
flex-shrink: 0;
-
+
text {
color: red;
font-weight: bold;
@@ -1544,10 +1778,10 @@
border: 1px solid #acacac;
position: relative;
display: flex;
-
- picker {
- width: 100%;
- }
+
+ picker {
+ width: 100%;
+ }
.uni-combox {
width: 100%;
diff --git a/pages/shengchanbuliaojiaoyan/form.vue b/pages/shengchanbuliaojiaoyan/form.vue
index f29fc3c..1710758 100644
--- a/pages/shengchanbuliaojiaoyan/form.vue
+++ b/pages/shengchanbuliaojiaoyan/form.vue
@@ -308,52 +308,108 @@
})
},
//鎵弿鍗曟嵁鍙锋潯鐮�
- GetMeesageByBillNo(e) {
- 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) {
- 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.BarCodeFocus = true
- CommonUtils.playSound(1)
- this.DisBillEntryList();
- } else {
- CommonUtils.playSound(0)
- this.refreshHBillState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- this.hform.HBillNo = ''
+ async GetMeesageByBillNo(e) {
+
+ 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
}
- },
- fail: (res) => {
+ this.tabs = 2
+ this.DisBillEntryList();
+ this.refreshBarCodeState()
+ } else {
CommonUtils.playSound(0)
this.refreshHBillState()
- console.log(res);
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: Message,
icon: 'none'
})
- },
- });
+ this.hform.HBillNo = ''
+ }
+
+ } catch (e) {
+ CommonUtils.playSound(0)
+ this.refreshHBillState()
+ 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) {
+ // 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.BarCodeFocus = true
+ // CommonUtils.playSound(1)
+ // this.DisBillEntryList();
+ // } else {
+ // CommonUtils.playSound(0)
+ // this.refreshHBillState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // this.hform.HBillNo = ''
+ // }
+ // },
+ // fail: (res) => {
+ // CommonUtils.playSound(0)
+ // this.refreshHBillState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
},
//鍩虹浠撳簱璧勬枡
getHBaseList() {
@@ -442,7 +498,7 @@
}
},
//鎵潯鐮佸鐞�
- getCode(HBarCode) {
+ async getCode(HBarCode) {
//浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -468,100 +524,170 @@
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()
- CommonUtils.playSound(1)
- } else {
- CommonUtils.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- console.log(res);
- this.refreshBarCodeState()
- CommonUtils.playSound(0)
+ 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) {
+ CommonUtils.playSound(0)
+ this.refreshHBillState()
+ 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()
+ // CommonUtils.playSound(1)
+ // } else {
+ // CommonUtils.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // this.refreshBarCodeState()
+ // CommonUtils.playSound(0)
+ // 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
@@ -580,63 +706,159 @@
}
//渚涘簲鍟嗕笉鍙紪杈�
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)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
}
- },
- fail: (res) => {
- CommonUtils.playSound(0)
+ //鏄剧ず琛ㄤ綋鏄庣粏
this.refreshBarCodeState()
- console.log(res);
+ this.DisBillEntryList()
+ //娓呯┖鏁伴噺
+ this.hform.HQty = ''
+ } else {
+ CommonUtils.playSound(0);
+ this.refreshHBillState()
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
- },
- });
+ }
+ } catch (e) {
+ CommonUtils.playSound(0)
+ this.refreshHBillState()
+ 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
+ // 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)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // CommonUtils.playSound(0)
+ // this.refreshBarCodeState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -734,7 +956,7 @@
url: '/pages/shengchanbuliaojiaoyan/form?OperationType=1'
})
},
- submit() {
+ async submit() {
if (this.hform.HInterID == 0 || !this.hform.HInterID) {
uni.showToast({
title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忓崟鎹潯鐮侊紒',
@@ -762,61 +984,109 @@
title: '娌℃湁鎵弿鐗╂枡鏉$爜锛岃鍏堟壂鎻忕墿鏂欐潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
icon: 'none'
})
- } else
- {
- uni.showLoading({
- title: '璇风◢鍊�'
- })
+ } else {
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SaveMateReplenishOutBill_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/shengchanbuliaojiaoyan/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- setTimeout(() => {
- uni.navigateBack();
- }, 50)
- }
- }
- });
- } else {
- // uni.showToast({
- // title: res.data.Message,
- // icon: 'none'
- // })
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SaveMateReplenishOutBill_BillCheck_Json',
+ method: 'POST',
+ data: {
+ oMain: sMainStr
+ },
+ })
- uni.showModal({
- title: '娓╅Θ鎻愮ず',
- content: res.data.Message,
- showCancel: false
- })
- }
- },
- fail: (res) => {
- console.log(res);
+ 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/shengchanbuliaojiaoyan/form?OperationType=1'
+ })
+ } else if (res.cancel) {
+ console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ setTimeout(() => {
+ uni.navigateBack();
+ }, 50)
+ }
+ }
+ });
+ } else {
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ 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_SaveMateReplenishOutBill_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/shengchanbuliaojiaoyan/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'
+ // })
+ // },
+ // });
}
}
},
diff --git a/pages/shengchandiaobo/form.vue b/pages/shengchandiaobo/form.vue
index e004653..4e94a4f 100644
--- a/pages/shengchandiaobo/form.vue
+++ b/pages/shengchandiaobo/form.vue
@@ -217,7 +217,9 @@
import {
getUserInfo
} from "@/utils/auth.js";
- import { CommonUtils } from '../../utils/common';
+ import {
+ CommonUtils
+ } from '../../utils/common';
export default {
data() {
return {
@@ -228,7 +230,7 @@
HModName: 'Kf_MoveStockBill_Check_PDA',
ModRightName: 'CE_MoveStockCheck',
OperationType: 1,
-
+
showHStockPlaceName: false,
HBillNoFocus: false,
BarCodeFocus: false,
@@ -236,7 +238,7 @@
tabs: 1,
linterid: '',
HBillNo: '',
-
+
arrayHWHName: [], //浠撳簱
HWHNameList: [],
arrayHStockPlaceName: [], //浠撲綅
@@ -441,57 +443,112 @@
})
},
//鎵弿鍗曟嵁鍙锋潯鐮�
- GetMeesageByBillNo(e) {
- 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.hform.HStockOutOrgID = data.hStockOutOrgIDField
- this.hform.HStockOutOrgName = data.hStockOutOrgNameField
- this.hform.HStockInOrgID = data.hStockInOrgIDField
- this.hform.HStockInOrgName = data.hStockInOrgNameField
- this.showHBillNo = false
- //鏉$爜鏍稿鏍囪
- if (data.hSourceBarCodeFlagField) {
- this.hform.HSourceBarCodeCtl = "Y"
- this.hform.chkHBarflag = true
- this.hform.HBarflag = data
- }
- this.tabs = 2
- this.DisBillEntryList();
- } else {
- this.playSound(0)
- this.refreshHBillNoFocus()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- this.hform.HBillNo = ''
+ async GetMeesageByBillNo(e) {
+ 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) => {
+ this.tabs = 2
+ this.DisBillEntryList();
+ this.refreshBarCodeState()
+ } else {
this.playSound(0)
this.refreshHBillNoFocus()
- console.log(res);
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.hform.HStockOutOrgID = data.hStockOutOrgIDField
+ // this.hform.HStockOutOrgName = data.hStockOutOrgNameField
+ // this.hform.HStockInOrgID = data.hStockInOrgIDField
+ // this.hform.HStockInOrgName = data.hStockInOrgNameField
+ // this.showHBillNo = false
+ // //鏉$爜鏍稿鏍囪
+ // if (data.hSourceBarCodeFlagField) {
+ // this.hform.HSourceBarCodeCtl = "Y"
+ // this.hform.chkHBarflag = true
+ // this.hform.HBarflag = data
+ // }
+ // this.tabs = 2
+ // this.DisBillEntryList();
+ // } else {
+ // this.playSound(0)
+ // this.refreshHBillNoFocus()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // this.hform.HBillNo = ''
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshHBillNoFocus()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
},
- getCode(HBarCode) {
+ async getCode(HBarCode) {
//浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -502,7 +559,7 @@
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
@@ -517,100 +574,173 @@
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()
- CommonUtils.playSound(1)
- } else {
- CommonUtils.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- console.log(res);
- this.refreshBarCodeState()
- CommonUtils.playSound(0)
+ 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()
+ // CommonUtils.playSound(1)
+ // } else {
+ // CommonUtils.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // this.refreshBarCodeState()
+ // CommonUtils.playSound(0)
+ // 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
@@ -629,63 +759,161 @@
}
//渚涘簲鍟嗕笉鍙紪杈�
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)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
}
- },
- fail: (res) => {
- CommonUtils.playSound(0)
- this.refreshBarCodeState()
- console.log(res);
+ //鏄剧ず琛ㄤ綋鏄庣粏
+ this.DisBillEntryList()
+ //娓呯┖鏁伴噺
+ this.hform.HQty = ''
+ } else {
+ CommonUtils.playSound(0);
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
- },
- });
+ }
+
+ this.refreshBarCodeState()
+
+ } 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
+ // 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)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // CommonUtils.playSound(0)
+ // this.refreshBarCodeState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -749,7 +977,7 @@
url: '/pages/shengchandiaobo/form?OperationType=1'
})
},
- submit() {
+ async submit() {
if (this.hform.HInterID == 0 || !this.hform.HInterID) {
uni.showToast({
title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忓崟鎹潯鐮侊紒',
@@ -778,53 +1006,102 @@
icon: 'none'
})
} else {
- uni.showLoading({
- title: '璇风◢鍊�'
- })
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SaveMoveStockBill_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/shengchandiaobo/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- setTimeout(() => {
- uni.navigateBack();
- }, 50)
- }
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SaveMoveStockBill_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/shengchandiaobo/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_SaveMoveStockBill_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/shengchandiaobo/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/pages/shengchanlingliao/form.vue b/pages/shengchanlingliao/form.vue
index 22b41ce..1ba1810 100644
--- a/pages/shengchanlingliao/form.vue
+++ b/pages/shengchanlingliao/form.vue
@@ -420,7 +420,7 @@
count
} = res.data
if (count == 1) {
- this.playSound(1)
+ CommonUtils.playSound(1)
console.log(data)
this.hform.HInterID = data.hInterIDField
this.hform.HBillNo = data.hBillNoField
@@ -435,7 +435,7 @@
this.DisBillEntryList();
this.refreshHBarCodeFocus()
} else {
- this.playSound(0)
+ CommonUtils.playSound(0)
this.refreshHBillNoFocus()
uni.showToast({
title: Message,
@@ -445,7 +445,7 @@
}
} catch (e) {
- this.playSound(0)
+ CommonUtils.playSound(0)
this.refreshHBillNoFocus()
uni.showToast({
title: '鎺ュ彛璇锋眰澶辫触: ' + e,
@@ -462,7 +462,7 @@
// },
// success: (res) => {
// if (res.data.count == 1) {
- // this.playSound(1)
+ // CommonUtils.playSound(1)
// var data = res.data.data
// console.log(data)
// this.hform.HInterID = data.hInterIDField
@@ -478,7 +478,7 @@
// this.DisBillEntryList();
// this.refreshHBarCodeFocus()
// } else {
- // this.playSound(0)
+ // CommonUtils.playSound(0)
// this.refreshHBillNoFocus()
// uni.showToast({
// title: res.data.Message,
@@ -489,7 +489,7 @@
// },
// fail: (res) => {
// console.log(res);
- // this.playSound(0)
+ // CommonUtils.playSound(0)
// this.refreshHBillNoFocus()
// uni.showToast({
// title: '鎺ュ彛璇锋眰澶辫触',
@@ -613,7 +613,6 @@
})
} else {
try {
-
let res = await CommonUtils.doRequest2Sync({
url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
data: {
@@ -641,7 +640,7 @@
}
} catch (e) {
- this.playSound(0)
+ CommonUtils.playSound(0)
this.refreshHBillNoFocus()
uni.showToast({
title: '鎺ュ彛璇锋眰澶辫触: ' + e,
@@ -686,7 +685,6 @@
}
try {
-
let res = await CommonUtils.doRequest2Sync({
url: '/WEBSController/get_CheckTypeByBarCode_BillCheck_Json',
data: {
@@ -813,7 +811,7 @@
this.refreshHBarCodeFocus()
} catch (e) {
- this.playSound(0)
+ CommonUtils.playSound(0)
this.refreshHBillNoFocus()
uni.showToast({
title: '鎺ュ彛璇锋眰澶辫触: ' + e,
@@ -1080,9 +1078,9 @@
// })
// } else
{
- uni.showLoading({
- title: '璇风◢鍊�'
- })
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
var sMainStr = JSON.stringify(this.hform);
try {
let res = await CommonUtils.doRequest2Sync({
@@ -1125,7 +1123,7 @@
}
} catch (e) {
- this.playSound(0)
+ CommonUtils.playSound(0)
this.refreshHBillNoFocus()
uni.showToast({
title: '鎺ュ彛璇锋眰澶辫触: ' + e,
diff --git a/pages/shengchanlingliaoshengdan/form.vue b/pages/shengchanlingliaoshengdan/form.vue
index 2b0ce3d..85d2ee3 100644
--- a/pages/shengchanlingliaoshengdan/form.vue
+++ b/pages/shengchanlingliaoshengdan/form.vue
@@ -1062,7 +1062,7 @@
},
//鎵潯鐮佸鐞�
- getCode(HBarCode) {
+ async getCode(HBarCode) {
//浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1090,175 +1090,24 @@
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.playSound(1)
- this.hform.HQty = ''
- this.DisBillEntryList()
- } else {
- this.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBarCode: sBarCode
}
- },
- fail: (res) => {
- this.playSound(0)
- this.refreshBarCodeState()
- 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_BarCode_Json',
- data: {
- sBarCode: sBarCode,
- HInterID: this.hform.HInterID,
- 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);
+ })
+ if (!res) {
+ return
+ }
+ console.log('鍒犻櫎鏉$爜', res.data);
this.hform.HBarCode = ''
if (res.data.count == 1) {
this.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
- this.hform.HSourceFlag = true
- 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 == "3720") {
- this.HMainSourceBillType = '鐢熶骇鐢ㄦ枡娓呭崟'
- this.hform.HMainSourceBillType = 3720
- this.showHMainSourceBillType = false
- } else if (data.hSourceBillTypeField == "3721") {
- this.HMainSourceBillType = '鐢熶骇澶囨枡鍗�'
- this.hform.HMainSourceBillType = 3721
- this.showHMainSourceBillType = false
- } else if (data.hSourceBillTypeField == "1214") {
- this.HMainSourceBillType = '鐢熶骇鍙戞枡閫氱煡鍗�'
- this.hform.HMainSourceBillType = 1214
- this.showHMainSourceBillType = false
- } else if (data.hSourceBillTypeField == "3720") {
- this.HMainSourceBillType = '鐢熶骇璁㈠崟'
- this.hform.HMainSourceBillType = 3720
- 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
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
- .hSourceBillTypeField)
- if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- this.showHMainSourceBillType = false
- }
- // 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 = ''
- this.refreshBarCodeState()
+ this.DisBillEntryList()
} else {
this.playSound(0)
this.refreshBarCodeState()
@@ -1267,17 +1116,358 @@
icon: 'none'
})
}
- },
- fail: (res) => {
- this.playSound(0)
+ } catch (err) {
this.refreshBarCodeState()
- console.log(res);
+ this.playSound(0)
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
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.playSound(1)
+ // this.hform.HQty = ''
+ // this.DisBillEntryList()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // 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_BarCode_Json',
+ data: {
+ sBarCode: sBarCode,
+ HInterID: this.hform.HInterID,
+ 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) {
+ this.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
+ this.hform.HSourceFlag = true
+ 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 == "3720") {
+ this.HMainSourceBillType = '鐢熶骇鐢ㄦ枡娓呭崟'
+ this.hform.HMainSourceBillType = 3720
+ this.showHMainSourceBillType = false
+ } else if (data.hSourceBillTypeField == "3721") {
+ this.HMainSourceBillType = '鐢熶骇澶囨枡鍗�'
+ this.hform.HMainSourceBillType = 3721
+ this.showHMainSourceBillType = false
+ } else if (data.hSourceBillTypeField == "1214") {
+ this.HMainSourceBillType = '鐢熶骇鍙戞枡閫氱煡鍗�'
+ this.hform.HMainSourceBillType = 1214
+ this.showHMainSourceBillType = false
+ } else if (data.hSourceBillTypeField == "3720") {
+ this.HMainSourceBillType = '鐢熶骇璁㈠崟'
+ this.hform.HMainSourceBillType = 3720
+ 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
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ data
+ .hSourceBillTypeField)
+ if (index != -1) {
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ index]
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ this.showHMainSourceBillType = false
+ }
+ // 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 = ''
+ this.refreshBarCodeState()
+ } else {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ } catch (err) {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ console.log(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/Get_BarCode_Json',
+ // data: {
+ // sBarCode: sBarCode,
+ // HInterID: this.hform.HInterID,
+ // 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) {
+ // this.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
+ // this.hform.HSourceFlag = true
+ // 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 == "3720") {
+ // this.HMainSourceBillType = '鐢熶骇鐢ㄦ枡娓呭崟'
+ // this.hform.HMainSourceBillType = 3720
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "3721") {
+ // this.HMainSourceBillType = '鐢熶骇澶囨枡鍗�'
+ // this.hform.HMainSourceBillType = 3721
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "1214") {
+ // this.HMainSourceBillType = '鐢熶骇鍙戞枡閫氱煡鍗�'
+ // this.hform.HMainSourceBillType = 1214
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "3720") {
+ // this.HMainSourceBillType = '鐢熶骇璁㈠崟'
+ // this.hform.HMainSourceBillType = 3720
+ // 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
+ //
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ // data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ // index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // 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 = ''
+ // this.refreshBarCodeState()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -1475,7 +1665,7 @@
url: '/pages/shengchanlingliaoshengdan/form?OperationType=1'
})
},
- submit() {
+ async submit() {
//浠撳簱銆佷粨浣嶃�佷繚绠°�侀獙鏀躲�侀儴闂ㄣ�佸鎴锋枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1523,53 +1713,102 @@
icon: 'none'
})
} else {
- uni.showLoading({
- title: '璇风◢鍊�'
- })
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SaveMateOutBill_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/shengchanlingliaoshengdan/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- // setTimeout(() => {
- // uni.navigateBack();
- // }, 500)
- }
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SaveMateOutBill_Json',
+ method: 'POST',
+ data: {
+ oMain: sMainStr
+ },
+ })
+ if (!res) {
+ return
+ }
+ console.log(1, res);
+ uni.hideLoading()
+ if (res.data.count == 1) {
+ // let sMain = JSON.stringify(this.materMeta) + ';' + this.hform
+ // .HBillType + ';' + this.hform.HSourceBillNo
+ // 涓烘潯鐮佽缃嚭搴撳崟鍙峰拰鍑哄簱娆℃暟
+ // await this.Set_BarCodeBill(sMain)
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: '/pages/shengchanlingliaoshengdan/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 (err) {
+ console.warn(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触:' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/set_SaveMateOutBill_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/shengchanlingliaoshengdan/form?OperationType=1'
+ // })
+ // } else if (res.cancel) {
+ // console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ // // setTimeout(() => {
+ // // uni.navigateBack();
+ // // }, 500)
+ // }
+ // }
+ // });
+ // } else {
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
}
},
diff --git a/pages/shengchanruku/form.vue b/pages/shengchanruku/form.vue
index bd1e3d1..9628208 100644
--- a/pages/shengchanruku/form.vue
+++ b/pages/shengchanruku/form.vue
@@ -34,8 +34,8 @@
<input v-model="hform.HStockPlaceName" :disabled="!showHStockPlaceName" placeholder="涓嶅彲鎿嶄綔" />
</view>
</view>
-
-
+
+
<view class="tabs">
<view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">琛ㄥご淇℃伅</view>
<view :class="tabs == 2 ? 'on':''" @tap="tabs = 2">鐗╂枡淇℃伅</view>
@@ -195,6 +195,7 @@
import {
getUserInfo
} from "@/utils/auth.js";
+ import { CommonUtils } from '../../utils/common';
export default {
data() {
return {
@@ -211,7 +212,7 @@
tabs: 1,
linterid: '',
HBillNo: '',
-
+
arrayHWHName: [], //浠撳簱
HWHNameList: [],
arrayHStockPlaceName: [], //浠撲綅
@@ -263,6 +264,19 @@
this.getHBaseList()
},
methods: {
+ async refreshHBarCodeFocus() {
+ this.HBarCodeFocus = false
+ await this.$nextTick()
+ this.hform.HBarCode = ''
+ this.HBarCodeFocus = true
+ },
+ async refreshHBillNoFocus() {
+ this.HBillNoFocus = false
+ await this.$nextTick(() => {
+ this.HBillNoFocus = true
+ this.hform.HBillNo = ""
+ })
+ },
getHBaseList() {
uni.request({
url: this.serverUrl + '/Gy_Warehouse/list',
@@ -292,7 +306,7 @@
})
},
});
-
+
uni.request({
url: this.serverUrl + '/Gy_StockPlace/list',
data: {
@@ -329,7 +343,7 @@
if (this.HWHNameList[i].浠撳簱鍚嶇О == e) {
this.hform.HWHName = this.HWHNameList[i].浠撳簱鍚嶇О
this.hform.HWHID = this.HWHNameList[i].HItemID
-
+
if (this.HWHNameList[i]['鍚敤浠撲綅'] == 'Y') {
this.showHStockPlaceName = true
} else {
@@ -404,53 +418,114 @@
})
},
//鎵弿鍗曟嵁鍙锋潯鐮�
- GetMeesageByBillNo(e) {
- 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();
- } else {
- this.playSound(0)
- this.refreshHBillState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- this.hform.HBillNo = ''
+ 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) {
+ 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) => {
+ this.tabs = 2
+ this.DisBillEntryList();
+ this.refreshHBarCodeFocus()
+ } else {
this.playSound(0)
- this.refreshHBillState()
- console.log(res);
+ 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();
+ // } else {
+ // this.playSound(0)
+ // this.refreshHBillState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // this.hform.HBillNo = ''
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshHBillState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
},
- getCode(HBarCode) {
+ async getCode(HBarCode) {
+ if (HBarCode == undefined || HBarCode == "") {
+ return
+ }
//浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -461,7 +536,7 @@
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
@@ -477,101 +552,176 @@
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()
- CommonUtils.playSound(1)
- } else {
- CommonUtils.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- CommonUtils.playSound(0)
- this.refreshBarCodeState()
- 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()
+ // CommonUtils.playSound(1)
+ // } else {
+ // CommonUtils.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // CommonUtils.playSound(0)
+ // this.refreshBarCodeState()
+ // 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
@@ -590,63 +740,160 @@
}
//渚涘簲鍟嗕笉鍙紪杈�
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)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
}
- },
- fail: (res) => {
- CommonUtils.playSound(0)
- this.refreshBarCodeState()
- console.log(res);
+ //鏄剧ず琛ㄤ綋鏄庣粏
+ this.DisBillEntryList()
+ //娓呯┖鏁伴噺
+ this.hform.HQty = ''
+ } else {
+ CommonUtils.playSound(0);
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
- },
- });
+ }
+
+ 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
+ // 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)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // CommonUtils.playSound(0)
+ // this.refreshBarCodeState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -704,7 +951,7 @@
url: '/pages/shengchanruku/form?OperationType=1'
})
},
- submit() {
+ async submit() {
if (this.hform.HInterID == 0 || !this.hform.HInterID) {
uni.showToast({
title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忓崟鎹潯鐮侊紒',
@@ -737,49 +984,99 @@
title: '璇风◢鍊�'
})
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SaveProductInBill_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/shengchanruku/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- setTimeout(() => {
- uni.navigateBack();
- }, 50)
- }
+
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SaveProductInBill_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/shengchanruku/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_SaveProductInBill_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/shengchanruku/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/pages/shengchanrukushengdan/form.vue b/pages/shengchanrukushengdan/form.vue
index d545c34..0bfea71 100644
--- a/pages/shengchanrukushengdan/form.vue
+++ b/pages/shengchanrukushengdan/form.vue
@@ -1036,7 +1036,7 @@
});
},
//鎵潯鐮佸鐞�
- getCode(HBarCode) {
+ async getCode(HBarCode) {
//浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1063,178 +1063,24 @@
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.playSound(1)
- this.hform.HQty = ''
- this.DisBillEntryList()
- } else {
- this.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBarCode: sBarCode
}
- },
- fail: (res) => {
- this.playSound(0)
- this.refreshBarCodeState()
- 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_BarCode_Json',
- data: {
- sBarCode: sBarCode,
- HInterID: this.hform.HInterID,
- 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);
+ })
+ if (!res) {
+ return
+ }
+ console.log('鍒犻櫎鏉$爜', res.data);
this.hform.HBarCode = ''
if (res.data.count == 1) {
this.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
- //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
- .hSourceBillTypeField)
- if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- this.showHMainSourceBillType = false
- }
- // if (data.hSourceBillTypeField == "3710") {
- // this.HMainSourceBillType = '鐢熶骇璁㈠崟'
- // this.hform.HMainSourceBillType = 3710
- // this.showHMainSourceBillType = false
- // } else if (data.hSourceBillTypeField == "3711") {
- // this.HMainSourceBillType = '鐢熶骇姹囨姤鍗�'
- // this.hform.HMainSourceBillType = 3711
- // this.showHMainSourceBillType = false
- // } else if (data.hSourceBillTypeField == "3714") {
- // this.HMainSourceBillType = '宸ュ簭姹囨姤鍗�'
- // this.hform.HMainSourceBillType = 3714
- // 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
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
- .hSourceBillTypeField)
- if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- this.showHMainSourceBillType = false
- }
- // 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 = ''
- this.refreshBarCodeState()
+ this.DisBillEntryList()
} else {
this.playSound(0)
this.refreshBarCodeState()
@@ -1243,17 +1089,362 @@
icon: 'none'
})
}
- },
- fail: (res) => {
- this.playSound(0)
+ } catch (err) {
this.refreshBarCodeState()
- console.log(res);
+ this.playSound(0)
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
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.playSound(1)
+ // this.hform.HQty = ''
+ // this.DisBillEntryList()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // 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_BarCode_Json',
+ data: {
+ sBarCode: sBarCode,
+ HInterID: this.hform.HInterID,
+ 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) {
+ this.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
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ .hSourceBillTypeField)
+ if (index != -1) {
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ this.showHMainSourceBillType = false
+ }
+ // if (data.hSourceBillTypeField == "3710") {
+ // this.HMainSourceBillType = '鐢熶骇璁㈠崟'
+ // this.hform.HMainSourceBillType = 3710
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "3711") {
+ // this.HMainSourceBillType = '鐢熶骇姹囨姤鍗�'
+ // this.hform.HMainSourceBillType = 3711
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "3714") {
+ // this.HMainSourceBillType = '宸ュ簭姹囨姤鍗�'
+ // this.hform.HMainSourceBillType = 3714
+ // 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
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ data
+ .hSourceBillTypeField)
+ if (index != -1) {
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ index]
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ this.showHMainSourceBillType = false
+ }
+ // 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 = ''
+ this.refreshBarCodeState()
+ } else {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ } catch (err) {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ console.log(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/Get_BarCode_Json',
+ // data: {
+ // sBarCode: sBarCode,
+ // HInterID: this.hform.HInterID,
+ // 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) {
+ // this.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
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ //
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // if (data.hSourceBillTypeField == "3710") {
+ // // this.HMainSourceBillType = '鐢熶骇璁㈠崟'
+ // // this.hform.HMainSourceBillType = 3710
+ // // this.showHMainSourceBillType = false
+ // // } else if (data.hSourceBillTypeField == "3711") {
+ // // this.HMainSourceBillType = '鐢熶骇姹囨姤鍗�'
+ // // this.hform.HMainSourceBillType = 3711
+ // // this.showHMainSourceBillType = false
+ // // } else if (data.hSourceBillTypeField == "3714") {
+ // // this.HMainSourceBillType = '宸ュ簭姹囨姤鍗�'
+ // // this.hform.HMainSourceBillType = 3714
+ // // 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
+ //
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ // data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ // index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // 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 = ''
+ // this.refreshBarCodeState()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -1456,7 +1647,7 @@
url: '/pages/shengchanrukushengdan/form?OperationType=1'
})
},
- submit() {
+ async submit() {
//浠撳簱銆佷粨浣嶃�佷繚绠°�侀獙鏀躲�侀儴闂ㄣ�佸鎴锋枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1504,53 +1695,102 @@
icon: 'none'
})
} else {
- uni.showLoading({
- title: '璇风◢鍊�'
- })
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SaveProductInBill_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/shengchanrukushengdan/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- // setTimeout(() => {
- // uni.navigateBack();
- // }, 500)
- }
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SaveProductInBill_Json',
+ method: 'POST',
+ data: {
+ oMain: sMainStr
+ },
+ })
+ if (!res) {
+ return
+ }
+ console.log(1, res);
+ uni.hideLoading()
+ if (res.data.count == 1) {
+ // let sMain = JSON.stringify(this.materMeta) + ';' + this.hform
+ // .HBillType + ';' + this.hform.HSourceBillNo
+ // 涓烘潯鐮佽缃嚭搴撳崟鍙峰拰鍑哄簱娆℃暟
+ // await this.Set_BarCodeBill(sMain)
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: '/pages/shengchanrukushengdan/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 (err) {
+ console.warn(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触:' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/set_SaveProductInBill_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/shengchanrukushengdan/form?OperationType=1'
+ // })
+ // } else if (res.cancel) {
+ // console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ // // setTimeout(() => {
+ // // uni.navigateBack();
+ // // }, 500)
+ // }
+ // }
+ // });
+ // } else {
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
}
},
diff --git a/pages/shengchantuiliao/form.vue b/pages/shengchantuiliao/form.vue
index 69b0767..6c573f2 100644
--- a/pages/shengchantuiliao/form.vue
+++ b/pages/shengchantuiliao/form.vue
@@ -1035,7 +1035,7 @@
});
},
//鎵潯鐮佸鐞�
- getCode(HBarCode) {
+ async getCode(HBarCode) {
//浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1062,178 +1062,24 @@
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.playSound(1)
- this.hform.HQty = ''
- this.DisBillEntryList()
- } else {
- this.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBarCode: sBarCode
}
- },
- fail: (res) => {
- this.playSound(0)
- this.refreshBarCodeState()
- 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_BarCode_Json',
- data: {
- sBarCode: sBarCode,
- HInterID: this.hform.HInterID,
- 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);
+ })
+ if (!res) {
+ return
+ }
+ console.log('鍒犻櫎鏉$爜', res.data);
this.hform.HBarCode = ''
if (res.data.count == 1) {
this.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
- //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
- .hSourceBillTypeField)
- if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- this.showHMainSourceBillType = false
- }
- // if (data.hSourceBillTypeField == "3710") {
- // this.HMainSourceBillType = '鐢熶骇璁㈠崟'
- // this.hform.HMainSourceBillType = 3710
- // this.showHMainSourceBillType = false
- // } else if (data.hSourceBillTypeField == "3711") {
- // this.HMainSourceBillType = '鐢熶骇姹囨姤鍗�'
- // this.hform.HMainSourceBillType = 3711
- // this.showHMainSourceBillType = false
- // } else if (data.hSourceBillTypeField == "3714") {
- // this.HMainSourceBillType = '宸ュ簭姹囨姤鍗�'
- // this.hform.HMainSourceBillType = 3714
- // 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
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
- .hSourceBillTypeField)
- if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- this.showHMainSourceBillType = false
- }
- // 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 = ''
- this.refreshBarCodeState()
+ this.DisBillEntryList()
} else {
this.playSound(0)
this.refreshBarCodeState()
@@ -1242,17 +1088,362 @@
icon: 'none'
})
}
- },
- fail: (res) => {
- this.playSound(0)
+ } catch (err) {
this.refreshBarCodeState()
- console.log(res);
+ this.playSound(0)
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
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.playSound(1)
+ // this.hform.HQty = ''
+ // this.DisBillEntryList()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // 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_BarCode_Json',
+ data: {
+ sBarCode: sBarCode,
+ HInterID: this.hform.HInterID,
+ 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) {
+ this.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
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ .hSourceBillTypeField)
+ if (index != -1) {
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ this.showHMainSourceBillType = false
+ }
+ // if (data.hSourceBillTypeField == "3710") {
+ // this.HMainSourceBillType = '鐢熶骇璁㈠崟'
+ // this.hform.HMainSourceBillType = 3710
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "3711") {
+ // this.HMainSourceBillType = '鐢熶骇姹囨姤鍗�'
+ // this.hform.HMainSourceBillType = 3711
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "3714") {
+ // this.HMainSourceBillType = '宸ュ簭姹囨姤鍗�'
+ // this.hform.HMainSourceBillType = 3714
+ // 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
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ data
+ .hSourceBillTypeField)
+ if (index != -1) {
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ index]
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ this.showHMainSourceBillType = false
+ }
+ // 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 = ''
+ this.refreshBarCodeState()
+ } else {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ } catch (err) {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ console.log(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/Get_BarCode_Json',
+ // data: {
+ // sBarCode: sBarCode,
+ // HInterID: this.hform.HInterID,
+ // 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) {
+ // this.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
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ //
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // if (data.hSourceBillTypeField == "3710") {
+ // // this.HMainSourceBillType = '鐢熶骇璁㈠崟'
+ // // this.hform.HMainSourceBillType = 3710
+ // // this.showHMainSourceBillType = false
+ // // } else if (data.hSourceBillTypeField == "3711") {
+ // // this.HMainSourceBillType = '鐢熶骇姹囨姤鍗�'
+ // // this.hform.HMainSourceBillType = 3711
+ // // this.showHMainSourceBillType = false
+ // // } else if (data.hSourceBillTypeField == "3714") {
+ // // this.HMainSourceBillType = '宸ュ簭姹囨姤鍗�'
+ // // this.hform.HMainSourceBillType = 3714
+ // // 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
+ //
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ // data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ // index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // 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 = ''
+ // this.refreshBarCodeState()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -1455,7 +1646,7 @@
url: '/pages/shengchantuiliao/form?OperationType=1'
})
},
- submit() {
+ async submit() {
//浠撳簱銆佷粨浣嶃�佷繚绠°�侀獙鏀躲�侀儴闂ㄣ�佸鎴锋枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1503,53 +1694,102 @@
icon: 'none'
})
} else {
- uni.showLoading({
- title: '璇风◢鍊�'
- })
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SaveMateOutBackBill_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/shengchantuiliao/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- // setTimeout(() => {
- // uni.navigateBack();
- // }, 500)
- }
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SaveMateOutBackBill_Json',
+ method: 'POST',
+ data: {
+ oMain: sMainStr
+ },
+ })
+ if (!res) {
+ return
+ }
+ console.log(1, res);
+ uni.hideLoading()
+ if (res.data.count == 1) {
+ // let sMain = JSON.stringify(this.materMeta) + ';' + this.hform
+ // .HBillType + ';' + this.hform.HSourceBillNo
+ // 涓烘潯鐮佽缃嚭搴撳崟鍙峰拰鍑哄簱娆℃暟
+ // await this.Set_BarCodeBill(sMain)
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: '/pages/shengchantuiliao/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 (err) {
+ console.warn(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触:' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/set_SaveMateOutBackBill_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/shengchantuiliao/form?OperationType=1'
+ // })
+ // } else if (res.cancel) {
+ // console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ // // setTimeout(() => {
+ // // uni.navigateBack();
+ // // }, 500)
+ // }
+ // }
+ // });
+ // } else {
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
}
},
diff --git a/pages/weiwaibuliaojiaoyan/form.vue b/pages/weiwaibuliaojiaoyan/form.vue
index 9859f10..17cb2e0 100644
--- a/pages/weiwaibuliaojiaoyan/form.vue
+++ b/pages/weiwaibuliaojiaoyan/form.vue
@@ -1,971 +1,1253 @@
<template>
- <view>
- <view class="form">
- <view class="form-item">
- <view class="title">鏉$爜:</view>
- <view class="right">
- <input v-model="hform.HBarCode" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜" @confirm="getCode(hform.HBarCode)" />
- </view>
- <uni-icons type="scan"
- style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
- size="20" @click="toScanCode"></uni-icons>
- </view>
- <view class="form-item">
- <view class="title">鏁伴噺:</view>
- <view class="right">
- <input v-model="hform.HQty" placeholder="璇疯緭鍏ユ暟閲�" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">浠撳簱:</view>
- <view class="right">
- <uni-combox :candidates="arrayHWHName" placeholder="璇疯緭鍏�(鎴栨壂鎻�)浠撳簱" v-model="hform.HWHName"
- @input="HWHNameChange"></uni-combox>
- </view>
- </view>
- <view class="form-item">
- <view class="title">浠撲綅:</view>
- <view class="right" v-show="showHStockPlaceName">
- <uni-combox :candidates="arrayHStockPlaceName" placeholder="璇疯緭鍏�(鎴栨壂鎻�)浠撲綅"
- v-model="hform.HStockPlaceName" @input="HStockPlaceNameChange"></uni-combox>
- </view>
- <view class="righton" v-show="!showHStockPlaceName">
- <input v-model="hform.HStockPlaceName" :disabled="!showHStockPlaceName" placeholder="涓嶅彲鎿嶄綔" /></view>
- </view>
+ <view>
+ <view class="form">
+ <view class="form-item">
+ <view class="title">鏉$爜:</view>
+ <view class="right">
+ <input v-model="hform.HBarCode" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜" @confirm="getCode(hform.HBarCode)" />
+ </view>
+ <uni-icons type="scan"
+ style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
+ size="20" @click="toScanCode"></uni-icons>
+ </view>
+ <view class="form-item">
+ <view class="title">鏁伴噺:</view>
+ <view class="right">
+ <input v-model="hform.HQty" placeholder="璇疯緭鍏ユ暟閲�" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">浠撳簱:</view>
+ <view class="right">
+ <uni-combox :candidates="arrayHWHName" placeholder="璇疯緭鍏�(鎴栨壂鎻�)浠撳簱" v-model="hform.HWHName"
+ @input="HWHNameChange"></uni-combox>
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">浠撲綅:</view>
+ <view class="right" v-show="showHStockPlaceName">
+ <uni-combox :candidates="arrayHStockPlaceName" placeholder="璇疯緭鍏�(鎴栨壂鎻�)浠撲綅"
+ v-model="hform.HStockPlaceName" @input="HStockPlaceNameChange"></uni-combox>
+ </view>
+ <view class="righton" v-show="!showHStockPlaceName">
+ <input v-model="hform.HStockPlaceName" :disabled="!showHStockPlaceName" placeholder="涓嶅彲鎿嶄綔" />
+ </view>
+ </view>
- <view class="tabs">
- <!-- <view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">閫夋嫨婧愬崟</view> -->
- <view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">琛ㄥご淇℃伅</view>
- <view :class="tabs == 2 ? 'on':''" @tap="tabs = 2">鐗╂枡淇℃伅</view>
- <view :class="tabs == 3 ? 'on':''" @tap="tabs = 3">鏉$爜淇℃伅</view>
- </view>
+ <view class="tabs">
+ <!-- <view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">閫夋嫨婧愬崟</view> -->
+ <view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">琛ㄥご淇℃伅</view>
+ <view :class="tabs == 2 ? 'on':''" @tap="tabs = 2">鐗╂枡淇℃伅</view>
+ <view :class="tabs == 3 ? 'on':''" @tap="tabs = 3">鏉$爜淇℃伅</view>
+ </view>
- <view v-if="tabs == 1">
- <view class="form-item" v-show="showHBillNo">
- <view class="title">鍗曟嵁鍙�:</view>
- <view class="right" style="width: 380rpx;">
- <input name="HBillNo" v-model="hform.HBillNo" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜"
- @confirm="GetMeesageByBillNo(hform.HBarCode)" />
- </view>
- <uni-icons type="scan"
- style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
- size="20" @click="toScanBillCode"></uni-icons>
- </view>
- <view class="form-item" v-show="!showHBillNo">
- <view class="title">鍗曟嵁鍙�:</view>
- <view class="righton">
- <input name="HBillNo" disabled v-model="hform.HBillNo" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">鍗曟嵁ID:</view>
- <view class="righton">
- <input name="HInterID" disabled v-model="hform.HInterID" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">鍒跺崟浜�:</view>
- <view class="righton">
- <input name="HMaker" disabled v-model="hform.HMaker" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">缁勭粐:</view>
- <view class="righton">
- <input name="HStockOrgName" disabled v-model="hform.HStockOrgName" />
- </view>
- </view>
- <label class="checkbox" style="float: right;">
- <checkbox :checked="hform.chkHBarflag" style="transform:scale(0.8)" disabled color="#4f81fc"/>鏉$爜鏍稿
- </label>
- </view>
- <view v-if="tabs == 2">
- <view class="list" v-for="(item,index) in Materlist" :key="index">
- <uni-card :title="item.鐗╂枡鍚嶇О" :extra="'鏁伴噺:'+item.鏁伴噺" style="margin: 10px;" @tap="delMater(item)">
- <view class="card-detail">
- <view class="detail">
- <text>鐗╂枡浠g爜锛�</text>{{item.鐗╂枡浠g爜}}
- </view>
- <view class="detail">
- <text>鍗曟嵁鏁伴噺锛�</text>{{item.鍗曟嵁鏁伴噺}}
- </view>
- <view class="detail" v-if="item.瑙勬牸鍨嬪彿">
- <text>瑙勬牸鍨嬪彿锛�</text>{{item.瑙勬牸鍨嬪彿}}
- </view>
- <view class="detail">
- <text>鎵规锛�</text>{{item.鎵规}}
- </view>
- <view class="detail" v-if="item.杈呭姪灞炴��">
- <text>杈呭姪灞炴�э細</text>{{item.杈呭姪灞炴�}
- </view>
- <view class="detail">
- <text>鏉$爜涓暟锛�</text>{{item.鏉$爜涓暟}}
- </view>
- </view>
- </uni-card>
- </view>
- <view class="over" v-if="Materlist.length == 0">鏆傛棤鏁版嵁</view>
- </view>
+ <view v-if="tabs == 1">
+ <view class="form-item" v-show="showHBillNo">
+ <view class="title">鍗曟嵁鍙�:</view>
+ <view class="right" style="width: 380rpx;">
+ <input name="HBillNo" v-model="hform.HBillNo" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜"
+ @confirm="GetMeesageByBillNo(hform.HBarCode)" />
+ </view>
+ <uni-icons type="scan"
+ style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
+ size="20" @click="toScanBillCode"></uni-icons>
+ </view>
+ <view class="form-item" v-show="!showHBillNo">
+ <view class="title">鍗曟嵁鍙�:</view>
+ <view class="righton">
+ <input name="HBillNo" disabled v-model="hform.HBillNo" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鍗曟嵁ID:</view>
+ <view class="righton">
+ <input name="HInterID" disabled v-model="hform.HInterID" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鍒跺崟浜�:</view>
+ <view class="righton">
+ <input name="HMaker" disabled v-model="hform.HMaker" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">缁勭粐:</view>
+ <view class="righton">
+ <input name="HStockOrgName" disabled v-model="hform.HStockOrgName" />
+ </view>
+ </view>
+ <label class="checkbox" style="float: right;">
+ <checkbox :checked="hform.chkHBarflag" style="transform:scale(0.8)" disabled color="#4f81fc" />鏉$爜鏍稿
+ </label>
+ </view>
+ <view v-if="tabs == 2">
+ <view class="list" v-for="(item,index) in Materlist" :key="index">
+ <uni-card :title="item.鐗╂枡鍚嶇О" :extra="'鏁伴噺:'+item.鏁伴噺" style="margin: 10px;" @tap="delMater(item)">
+ <view class="card-detail">
+ <view class="detail">
+ <text>鐗╂枡浠g爜锛�</text>{{item.鐗╂枡浠g爜}}
+ </view>
+ <view class="detail">
+ <text>鍗曟嵁鏁伴噺锛�</text>{{item.鍗曟嵁鏁伴噺}}
+ </view>
+ <view class="detail" v-if="item.瑙勬牸鍨嬪彿">
+ <text>瑙勬牸鍨嬪彿锛�</text>{{item.瑙勬牸鍨嬪彿}}
+ </view>
+ <view class="detail">
+ <text>鎵规锛�</text>{{item.鎵规}}
+ </view>
+ <view class="detail" v-if="item.杈呭姪灞炴��">
+ <text>杈呭姪灞炴�э細</text>{{item.杈呭姪灞炴�}
+ </view>
+ <view class="detail">
+ <text>鏉$爜涓暟锛�</text>{{item.鏉$爜涓暟}}
+ </view>
+ </view>
+ </uni-card>
+ </view>
+ <view class="over" v-if="Materlist.length == 0">鏆傛棤鏁版嵁</view>
+ </view>
- <view v-if="tabs == 3">
- <view class="form-item">
- <view class="title">鏉$爜:</view>
- <view class="righton">
- <input name="HBarCode_B" disabled v-model="hform.HBarCode_B" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">鐗╂枡:</view>
- <view class="righton">
- <input disabled v-model="hform.HMaterName_B" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">瑙勬牸:</view>
- <view class="righton">
- <input disabled v-model="hform.HMaterModel_B" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">鎵规:</view>
- <view class="righton">
- <input disabled v-model="hform.HBatchNo_B" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">鍗曚綅:</view>
- <view class="righton">
- <input disabled v-model="hform.HUnitName_B" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">鏁伴噺:</view>
- <view class="righton">
- <input disabled v-model="hform.HQty_B" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">瀹归噺:</view>
- <view class="righton">
- <input disabled v-model="hform.HTMQty_B" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">浠撳簱:</view>
- <view class="righton">
- <input disabled v-model="hform.HWHName_B" />
- </view>
- </view>
- <view class="form-item">
- <view class="title">浠撲綅:</view>
- <view class="righton">
- <input disabled v-model="hform.HSPName_B" />
- </view>
- </view>
- </view>
+ <view v-if="tabs == 3">
+ <view class="form-item">
+ <view class="title">鏉$爜:</view>
+ <view class="righton">
+ <input name="HBarCode_B" disabled v-model="hform.HBarCode_B" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鐗╂枡:</view>
+ <view class="righton">
+ <input disabled v-model="hform.HMaterName_B" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">瑙勬牸:</view>
+ <view class="righton">
+ <input disabled v-model="hform.HMaterModel_B" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鎵规:</view>
+ <view class="righton">
+ <input disabled v-model="hform.HBatchNo_B" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鍗曚綅:</view>
+ <view class="righton">
+ <input disabled v-model="hform.HUnitName_B" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">鏁伴噺:</view>
+ <view class="righton">
+ <input disabled v-model="hform.HQty_B" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">瀹归噺:</view>
+ <view class="righton">
+ <input disabled v-model="hform.HTMQty_B" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">浠撳簱:</view>
+ <view class="righton">
+ <input disabled v-model="hform.HWHName_B" />
+ </view>
+ </view>
+ <view class="form-item">
+ <view class="title">浠撲綅:</view>
+ <view class="righton">
+ <input disabled v-model="hform.HSPName_B" />
+ </view>
+ </view>
+ </view>
- <view class="bottom-btn">
- <button class="btn-a" size="mini" @tap="submit">鎻愪氦</button>
- <button class="btn-c" size="mini" @tap="goBack">閫�鍑�</button>
- </view>
- </view>
- </view>
+ <view class="bottom-btn">
+ <button class="btn-a" size="mini" @tap="submit">鎻愪氦</button>
+ <button class="btn-c" size="mini" @tap="goBack">閫�鍑�</button>
+ </view>
+ </view>
+ </view>
</template>
<script>
- import getDateTime from '@/utils/getdateTime.js';
- import {
- getUserInfo
- } from "@/utils/auth.js";
- import {
- CommonUtils
- } from "@/utils/common.js"
- export default {
- data() {
- return {
- userInfo: getUserInfo(),
- serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
- HModName: 'Kf_EntrustReplenishOutBill_Check_PDA',
- ModRightName: 'CE_EntrustReplenishOutCheck',
- OperationType: 1,
-
- showHStockPlaceName: false,
- showHBillNo: true,
- tabs: 1,
- linterid: '',
- HBillNo: '',
+ import getDateTime from '@/utils/getdateTime.js';
+ import {
+ getUserInfo
+ } from "@/utils/auth.js";
+ import {
+ CommonUtils
+ } from "@/utils/common.js"
+ export default {
+ data() {
+ return {
+ userInfo: getUserInfo(),
+ serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
+ HModName: 'Kf_EntrustReplenishOutBill_Check_PDA',
+ ModRightName: 'CE_EntrustReplenishOutCheck',
+ OperationType: 1,
- arrayHWHName: [], //浠撳簱
- HWHNameList: [],
- arrayHStockPlaceName: [], //浠撲綅
- HStockPlaceNameList: [],
+ showHStockPlaceName: false,
+ showHBillNo: true,
+ tabs: 1,
+ linterid: '',
+ HBillNo: '',
- Materlist: [],
- hform: {
- HBillType: 1255,
- HBillerID: uni.getStorageSync('HBillerID'),
- HRedBlueFlag: false,
+ arrayHWHName: [], //浠撳簱
+ HWHNameList: [],
+ arrayHStockPlaceName: [], //浠撲綅
+ HStockPlaceNameList: [],
- HBarCode: '',
- HQty: '',
- HWHName: getUserInfo().HWHName,
- HWHID: getUserInfo().HWhID,
- HStockPlaceName: getUserInfo().HSPName,
- HStockPlaceID: getUserInfo().HSPID,
+ Materlist: [],
+ hform: {
+ HBillType: 1255,
+ HBillerID: uni.getStorageSync('HBillerID'),
+ HRedBlueFlag: false,
- HBillNo: '',
- HInterID: '',
- HMaker: uni.getStorageSync('HUserName'),
- HStockOrgName: uni.getStorageSync('Organization'),
- HStockOrgID: uni.getStorageSync('OrganizationID'),
- HSourceBarCodeCtl: "N", //鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
- chkHBarflag: false,
- HBarflag: 'Y',
+ HBarCode: '',
+ HQty: '',
+ HWHName: getUserInfo().HWHName,
+ HWHID: getUserInfo().HWhID,
+ HStockPlaceName: getUserInfo().HSPName,
+ HStockPlaceID: getUserInfo().HSPID,
- HBarCode_B: '',
- HMaterName_B: '',
- HMaterModel_B: '',
- HBatchNo_B: '',
- HUnitName_B: '',
- HQty_B: '',
- HTMQty_B: '',
- HWHName_B: '',
- HSPName_B: '',
- }
- }
- },
- onLoad(e) {
- console.log(e, this.userInfo)
- this.OperationType = e.OperationType
- if (e.HBillNo) {
- this.hform.HBillNo = e.HBillNo
- this.GetMeesageByBillNo(e.HBillNo)
- } else {
- // this.getNewData()
- }
- this.getHBaseList()
- },
- methods: {
- //鎵爜
- toScanCode() {
- var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
- mpaasScanModule.mpaasScan({
- 'hideAlbum': true,
- 'timeoutInterval':'10', //瓒呮椂鏃堕棿
- 'timeoutText':'鏈瘑鍒埌浜岀淮鐮�' //瓒呮椂鎻愰啋
- },(ret) => {
- console.log(ret.resp_result)
- // if(this.hform.HBarCode == '*'){
- // this.hform.HBarCode = this.hform.HBarCode + ret.resp_result
- // }else{
- // this.hform.HBarCode = ret.resp_result
- // }
- this.hform.HBarCode = ret.resp_result
- // this.GetMeesageByBillNo(this.hform.HBarCode)
- this.getCode(this.hform.HBarCode)
- })
- },
- toScanBillCode() {
- var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
- mpaasScanModule.mpaasScan({
- 'hideAlbum': true,
- 'timeoutInterval':'10', //瓒呮椂鏃堕棿
- 'timeoutText':'鏈瘑鍒埌浜岀淮鐮�' //瓒呮椂鎻愰啋
- },(ret) => {
- console.log(ret.resp_result)
- // if(this.hform.HBarCode == '*'){
- // this.hform.HBarCode = this.hform.HBarCode + ret.resp_result
- // }else{
- // this.hform.HBarCode = ret.resp_result
- // }
-
- this.hform.HBillNo = ret.resp_result
- this.GetMeesageByBillNo(this.hform.HBillNo)
- })
- },
- //鎵弿鍗曟嵁鍙锋潯鐮�
- GetMeesageByBillNo(e) {
- 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();
- } else {
- CommonUtils.playSound(0);
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- this.hform.HBillNo = ''
- }
- },
- fail: (res) => {
- CommonUtils.playSound(0);
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
- },
- //鍩虹浠撳簱璧勬枡
- getHBaseList() {
- uni.request({
- url: this.serverUrl + '/Gy_Warehouse/list',
- data: {
- sWhere: "",
- user: uni.getStorageSync('HUserName'),
- Organization: uni.getStorageSync('Organization')
- },
- success: (res) => {
- if (res.data.count == 1) {
- this.HWHNameList = res.data.data
- for (var i = 0; i < res.data.data.length; i++) {
- this.arrayHWHName[i] = res.data.data[i].浠撳簱鍚嶇О
- }
- } else {
- uni.showToast({
- title: '浠撳簱鏁版嵁璇锋眰澶辫触',
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
+ HBillNo: '',
+ HInterID: '',
+ HMaker: uni.getStorageSync('HUserName'),
+ HStockOrgName: uni.getStorageSync('Organization'),
+ HStockOrgID: uni.getStorageSync('OrganizationID'),
+ HSourceBarCodeCtl: "N", //鏄惁杩涜婧愬崟瀵瑰簲鏉$爜鏍稿锛�'Y'涓烘牳瀵癸級
+ chkHBarflag: false,
+ HBarflag: 'Y',
- uni.request({
- url: this.serverUrl + '/Gy_StockPlace/list',
- data: {
- sWhere: "",
- user: uni.getStorageSync('HUserName'),
- Organization: uni.getStorageSync('Organization')
- },
- success: (res) => {
- if (res.data.count == 1) {
- this.HStockPlaceNameList = res.data.data
- for (var i = 0; i < res.data.data.length; i++) {
- this.arrayHStockPlaceName[i] = res.data.data[i].浠撲綅鍚嶇О
- }
- } else {
- uni.showToast({
- title: '浠撲綅鏁版嵁璇锋眰澶辫触',
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
- },
- //閫夋嫨浠撳簱
- HWHNameChange(e) {
- // var name = e.split("(")
- for (var i = 0; i < this.HWHNameList.length; i++) {
- if (this.HWHNameList[i].浠撳簱鍚嶇О == e) {
- this.hform.HWHName = this.HWHNameList[i].浠撳簱鍚嶇О
- this.hform.HWHID = this.HWHNameList[i].HItemID
-
- if(this.HWHNameList[i]['鍚敤浠撲綅'] == 'Y'){
- this.showHStockPlaceName = true
- }else {
- this.hform.HStockPlaceName = ''
- this.showHStockPlaceName = false
- }
- }
- }
- },
- //閫夋嫨浠撲綅
- HStockPlaceNameChange(e) {
- for (var i = 0; i < this.HStockPlaceNameList.length; i++) {
- if (this.HStockPlaceNameList[i].浠撲綅鍚嶇О == e) {
- this.hform.HStockPlaceName = this.HStockPlaceNameList[i].浠撲綅鍚嶇О
- this.hform.HStockPlaceID = this.HStockPlaceNameList[i].HItemID
- }
- }
- },
- getCode(HBarCode) {
- //浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲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);
+ HBarCode_B: '',
+ HMaterName_B: '',
+ HMaterModel_B: '',
+ HBatchNo_B: '',
+ HUnitName_B: '',
+ HQty_B: '',
+ HTMQty_B: '',
+ HWHName_B: '',
+ HSPName_B: '',
+ }
+ }
+ },
+ onLoad(e) {
+ console.log(e, this.userInfo)
+ this.OperationType = e.OperationType
+ if (e.HBillNo) {
+ this.hform.HBillNo = e.HBillNo
+ this.GetMeesageByBillNo(e.HBillNo)
+ } else {
+ // this.getNewData()
+ }
+ this.getHBaseList()
+ },
+ methods: {
+ async refreshHBarCodeFocus() {
+ this.HBarCodeFocus = false
+ await this.$nextTick()
+ this.hform.HBarCode = ''
+ this.HBarCodeFocus = true
+ },
+ async refreshHBillNoFocus() {
+ this.HBillNoFocus = false
+ await this.$nextTick(() => {
+ this.HBillNoFocus = true
+ this.hform.HBillNo = ""
+ })
+ },
+ //鎵爜
+ toScanCode() {
+ var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
+ mpaasScanModule.mpaasScan({
+ 'hideAlbum': true,
+ 'timeoutInterval': '10', //瓒呮椂鏃堕棿
+ 'timeoutText': '鏈瘑鍒埌浜岀淮鐮�' //瓒呮椂鎻愰啋
+ }, (ret) => {
+ console.log(ret.resp_result)
+ // if(this.hform.HBarCode == '*'){
+ // this.hform.HBarCode = this.hform.HBarCode + ret.resp_result
+ // }else{
+ // this.hform.HBarCode = ret.resp_result
+ // }
+ this.hform.HBarCode = ret.resp_result
+ // this.GetMeesageByBillNo(this.hform.HBarCode)
+ this.getCode(this.hform.HBarCode)
+ })
+ },
+ toScanBillCode() {
+ var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module")
+ mpaasScanModule.mpaasScan({
+ 'hideAlbum': true,
+ 'timeoutInterval': '10', //瓒呮椂鏃堕棿
+ 'timeoutText': '鏈瘑鍒埌浜岀淮鐮�' //瓒呮椂鎻愰啋
+ }, (ret) => {
+ console.log(ret.resp_result)
+ // if(this.hform.HBarCode == '*'){
+ // this.hform.HBarCode = this.hform.HBarCode + ret.resp_result
+ // }else{
+ // this.hform.HBarCode = ret.resp_result
+ // }
- 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;
- }
- 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'
- })
- }
- },
- fail: (res) => {
- CommonUtils.playSound(0);
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
- }
- },
- //鐗╂枡淇℃伅
- DisBillEntryList() {
- uni.request({
- url: this.serverUrl + '/WEBSController/GetKf_PonderationBillMain_Temp_BillCheck_New_Json',
- data: {
- HInterID: this.hform.HInterID,
- HBillType: this.hform.HBillType,
- HSourceBarCodeCtl: this.hform.HSourceBarCodeCtl,
- sWhere: ''
- },
- success: (res) => {
- console.log('鐗╂枡', res.data)
- if (res.data.count == 1) {
- var data = res.data.data
- this.Materlist = data.Materlist
- if (!data.BarCodeDetailslist[0].HBarCode) {
- this.hform.HMaterName_B = ''
- this.hform.HMaterModel_B = ''
- this.hform.HBatchNo_B = ''
- this.hform.HUnitName_B = ''
- this.hform.HQty_B = ''
- this.hform.HTMQty_B = ''
- this.hform.HWHName_B = ''
- this.hform.HSPName_B = ''
- } else {
- this.hform.HBarCode_B = data.BarCodeDetailslist[0].HBarCode
- this.hform.HMaterName_B = data.BarCodeDetailslist[0].HMaterName
- this.hform.HMaterModel_B = data.BarCodeDetailslist[0].HMaterModel
- this.hform.HBatchNo_B = data.BarCodeDetailslist[0].HBatchNo
- this.hform.HUnitName_B = data.BarCodeDetailslist[0].HUnitName
- this.hform.HQty_B = data.BarCodeDetailslist[0].HQty
- this.hform.HTMQty_B = data.BarCodeDetailslist[0].HTMQty
- this.hform.HWHName_B = data.BarCodeDetailslist[0].HWHName
- this.hform.HSPName_B = data.BarCodeDetailslist[0].HSPName
- }
- } else {
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
- },
- //鍒犻櫎鐗╂枡鐮�
- delMater(item) {
- uni.showModal({
- title: '鎻愮ず',
- content: '纭瑕佸垹闄� " ' + item.鐗╂枡鍚嶇О + ' " 鎵�鏈夋壂鐮佽褰曪紵鍒犻櫎鍚庡皢涓嶅彲鎭㈠锛�',
- success: (res) => {
- if (res.confirm) {
- uni.request({
- url: this.serverUrl +
- '/WEBSController/set_DeleteBarCodeByEntryID_BillCheck_New_Json',
- data: {
- HInterID: this.hform.HInterID,
- HBillType: this.hform.HBillType,
- HSourceInterID: item.HSourceInterID,
- HSourceEntryID: item.HSourceEntryID,
- HSourceBarCodeCtl: this.hform.HSourceBarCodeCtl
- },
- success: (res) => {
- if (res.data.count == 1) {
- this.DisBillEntryList()
- } else {
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- 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_SaveEntrustReplenishOutBill_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/weiwaibuliaojiaoyan/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- setTimeout(() => {
- uni.navigateBack();
- }, 50)
- }
- }
- });
- } else {
- // uni.showToast({
- // title: res.data.Message,
- // icon: 'none'
- // })
+ this.hform.HBillNo = ret.resp_result
+ this.GetMeesageByBillNo(this.hform.HBillNo)
+ })
+ },
+ //鎵弿鍗曟嵁鍙锋潯鐮�
+ async GetMeesageByBillNo(e) {
+ 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()
+ uni.showToast({
+ title: Message,
+ icon: 'none'
+ })
+ this.hform.HBillNo = ''
+ }
+ } catch (e) {
+ CommonUtils.playSound(0)
+ this.refreshHBillNoFocus()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+ icon: 'none'
+ })
+ }
- uni.showModal({
- title: '娓╅Θ鎻愮ず',
- content: res.data.Message,
- showCancel: false
- })
- }
- },
- fail: (res) => {
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- 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();
+ // } else {
+ // CommonUtils.playSound(0);
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // this.hform.HBillNo = ''
+ // }
+ // },
+ // fail: (res) => {
+ // CommonUtils.playSound(0);
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
+ },
+ //鍩虹浠撳簱璧勬枡
+ getHBaseList() {
+ uni.request({
+ url: this.serverUrl + '/Gy_Warehouse/list',
+ data: {
+ sWhere: "",
+ user: uni.getStorageSync('HUserName'),
+ Organization: uni.getStorageSync('Organization')
+ },
+ success: (res) => {
+ if (res.data.count == 1) {
+ this.HWHNameList = res.data.data
+ for (var i = 0; i < res.data.data.length; i++) {
+ this.arrayHWHName[i] = res.data.data[i].浠撳簱鍚嶇О
+ }
+ } else {
+ uni.showToast({
+ title: '浠撳簱鏁版嵁璇锋眰澶辫触',
+ icon: 'none'
+ })
+ }
+ },
+ fail: (res) => {
+ console.log(res);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触',
+ icon: 'none'
+ })
+ },
+ });
- goBack() {
- uni.showModal({
- title: '鎻愮ず',
- content: '纭瑕侀��鍑哄綋鍓嶉〉闈㈠悧锛�',
- success: (res) => {
- if (res.confirm) {
- console.log('鐢ㄦ埛鐐瑰嚮纭畾');
- uni.navigateBack({
- url: '/pages/weiwaibuliaojiaoyan/table'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- }
- }
- });
- }
- }
- }
+ uni.request({
+ url: this.serverUrl + '/Gy_StockPlace/list',
+ data: {
+ sWhere: "",
+ user: uni.getStorageSync('HUserName'),
+ Organization: uni.getStorageSync('Organization')
+ },
+ success: (res) => {
+ if (res.data.count == 1) {
+ this.HStockPlaceNameList = res.data.data
+ for (var i = 0; i < res.data.data.length; i++) {
+ this.arrayHStockPlaceName[i] = res.data.data[i].浠撲綅鍚嶇О
+ }
+ } else {
+ uni.showToast({
+ title: '浠撲綅鏁版嵁璇锋眰澶辫触',
+ icon: 'none'
+ })
+ }
+ },
+ fail: (res) => {
+ console.log(res);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触',
+ icon: 'none'
+ })
+ },
+ });
+ },
+ //閫夋嫨浠撳簱
+ HWHNameChange(e) {
+ // var name = e.split("(")
+ for (var i = 0; i < this.HWHNameList.length; i++) {
+ if (this.HWHNameList[i].浠撳簱鍚嶇О == e) {
+ this.hform.HWHName = this.HWHNameList[i].浠撳簱鍚嶇О
+ this.hform.HWHID = this.HWHNameList[i].HItemID
+
+ if (this.HWHNameList[i]['鍚敤浠撲綅'] == 'Y') {
+ this.showHStockPlaceName = true
+ } else {
+ this.hform.HStockPlaceName = ''
+ this.showHStockPlaceName = false
+ }
+ }
+ }
+ },
+ //閫夋嫨浠撲綅
+ HStockPlaceNameChange(e) {
+ for (var i = 0; i < this.HStockPlaceNameList.length; i++) {
+ if (this.HStockPlaceNameList[i].浠撲綅鍚嶇О == e) {
+ this.hform.HStockPlaceName = this.HStockPlaceNameList[i].浠撲綅鍚嶇О
+ this.hform.HStockPlaceID = this.HStockPlaceNameList[i].HItemID
+ }
+ }
+ },
+ async getCode(HBarCode) {
+ //浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲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 = ''
+ this.refreshHBarCodeFocus()
+ } else {
+ CommonUtils.playSound(0);
+ this.refreshHBillNoFocus()
+ 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/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'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // CommonUtils.playSound(0);
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
+ }
+ },
+ //鐗╂枡淇℃伅
+ DisBillEntryList() {
+ uni.request({
+ url: this.serverUrl + '/WEBSController/GetKf_PonderationBillMain_Temp_BillCheck_New_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HSourceBarCodeCtl: this.hform.HSourceBarCodeCtl,
+ sWhere: ''
+ },
+ success: (res) => {
+ console.log('鐗╂枡', res.data)
+ if (res.data.count == 1) {
+ var data = res.data.data
+ this.Materlist = data.Materlist
+ if (!data.BarCodeDetailslist[0].HBarCode) {
+ this.hform.HMaterName_B = ''
+ this.hform.HMaterModel_B = ''
+ this.hform.HBatchNo_B = ''
+ this.hform.HUnitName_B = ''
+ this.hform.HQty_B = ''
+ this.hform.HTMQty_B = ''
+ this.hform.HWHName_B = ''
+ this.hform.HSPName_B = ''
+ } else {
+ this.hform.HBarCode_B = data.BarCodeDetailslist[0].HBarCode
+ this.hform.HMaterName_B = data.BarCodeDetailslist[0].HMaterName
+ this.hform.HMaterModel_B = data.BarCodeDetailslist[0].HMaterModel
+ this.hform.HBatchNo_B = data.BarCodeDetailslist[0].HBatchNo
+ this.hform.HUnitName_B = data.BarCodeDetailslist[0].HUnitName
+ this.hform.HQty_B = data.BarCodeDetailslist[0].HQty
+ this.hform.HTMQty_B = data.BarCodeDetailslist[0].HTMQty
+ this.hform.HWHName_B = data.BarCodeDetailslist[0].HWHName
+ this.hform.HSPName_B = data.BarCodeDetailslist[0].HSPName
+ }
+ } else {
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ },
+ fail: (res) => {
+ console.log(res);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触',
+ icon: 'none'
+ })
+ },
+ });
+ },
+ //鍒犻櫎鐗╂枡鐮�
+ delMater(item) {
+ uni.showModal({
+ title: '鎻愮ず',
+ content: '纭瑕佸垹闄� " ' + item.鐗╂枡鍚嶇О + ' " 鎵�鏈夋壂鐮佽褰曪紵鍒犻櫎鍚庡皢涓嶅彲鎭㈠锛�',
+ success: (res) => {
+ if (res.confirm) {
+ uni.request({
+ url: this.serverUrl +
+ '/WEBSController/set_DeleteBarCodeByEntryID_BillCheck_New_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HSourceInterID: item.HSourceInterID,
+ HSourceEntryID: item.HSourceEntryID,
+ HSourceBarCodeCtl: this.hform.HSourceBarCodeCtl
+ },
+ success: (res) => {
+ if (res.data.count == 1) {
+ this.DisBillEntryList()
+ } else {
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ },
+ 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_SaveEntrustReplenishOutBill_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/weiwaibuliaojiaoyan/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'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl +
+ // '/WEBSController/set_SaveEntrustReplenishOutBill_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/weiwaibuliaojiaoyan/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({
+ title: '鎻愮ず',
+ content: '纭瑕侀��鍑哄綋鍓嶉〉闈㈠悧锛�',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.navigateBack({
+ url: '/pages/weiwaibuliaojiaoyan/table'
+ })
+ } else if (res.cancel) {
+ console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ }
+ }
+ });
+ }
+ }
+ }
</script>
<style lang="scss" scoped>
- .form {
- width: 668rpx;
- margin: 20rpx auto;
- padding-bottom: 240rpx;
- }
+ .form {
+ width: 668rpx;
+ margin: 20rpx auto;
+ padding-bottom: 240rpx;
+ }
- .tab_area {
- width: 100%;
- height: 50rpx;
- }
+ .tab_area {
+ width: 100%;
+ height: 50rpx;
+ }
- .other {
- margin-top: 8rpx;
- text-align: center;
- font-size: 28rpx;
- padding: 4rpx 18rpx;
- color: #1890FF;
- }
+ .other {
+ margin-top: 8rpx;
+ text-align: center;
+ font-size: 28rpx;
+ padding: 4rpx 18rpx;
+ color: #1890FF;
+ }
- .tabs {
- width: 100%;
- display: flex;
- border-bottom: 1px solid #ddd;
- margin: 20rpx 0;
+ .tabs {
+ width: 100%;
+ display: flex;
+ border-bottom: 1px solid #ddd;
+ margin: 20rpx 0;
- view {
- width: 25%;
- font-size: 30rpx;
- color: #555;
- text-align: center;
- padding: 16rpx 0;
- flex: 1;
- }
+ view {
+ width: 25%;
+ font-size: 30rpx;
+ color: #555;
+ text-align: center;
+ padding: 16rpx 0;
+ flex: 1;
+ }
- .on {
- color: #3a78ff;
- font-weight: bold;
- border-bottom: 3px solid #3a78ff;
- }
- }
+ .on {
+ color: #3a78ff;
+ font-weight: bold;
+ border-bottom: 3px solid #3a78ff;
+ }
+ }
- .form-item {
- display: flex;
- align-items: center;
- font-size: 30rpx;
- padding: 6rpx 0;
+ .form-item {
+ display: flex;
+ align-items: center;
+ font-size: 30rpx;
+ padding: 6rpx 0;
- .title {
- width: 208rpx;
+ .title {
+ width: 208rpx;
- text {
- color: red;
- font-weight: bold;
- }
- }
+ text {
+ color: red;
+ font-weight: bold;
+ }
+ }
- .right {
- flex: 1;
- border-radius: 22rpx;
- border: 1px solid #acacac;
- }
+ .right {
+ flex: 1;
+ border-radius: 22rpx;
+ border: 1px solid #acacac;
+ }
- .righton {
- width: 450rpx;
- border-radius: 22rpx;
- border: 1px solid #e4e4e4;
- background-color: #e4e4e4;
- }
+ .righton {
+ width: 450rpx;
+ border-radius: 22rpx;
+ border: 1px solid #e4e4e4;
+ background-color: #e4e4e4;
+ }
- input {
- // width: 100%;
- padding: 8rpx 20rpx;
- font-size: 30rpx;
- }
-
-
+ input {
+ // width: 100%;
+ padding: 8rpx 20rpx;
+ font-size: 30rpx;
+ }
- textarea {
- width: 98%;
- padding: 8rpx 20rpx;
- font-size: 30rpx;
- }
- }
- .bottom-btn {
- width: 100%;
- // height: 120rpx;
- position: fixed;
- bottom: 0;
- left: 0;
- background-color: #fff;
- box-shadow: 0 2rpx 10rpx 2rpx rgba(0, 0, 0, 0.4);
- padding: 30rpx 40rpx 40rpx 40rpx;
+ textarea {
+ width: 98%;
+ padding: 8rpx 20rpx;
+ font-size: 30rpx;
+ }
- button {
- border-radius: 50rpx;
- width: 180rpx;
- height: 66rpx;
- line-height: 66rpx;
- font-size: 28rpx;
- }
+ }
- .btn-a {
- background-color: #3A78FF;
- color: #fff;
- }
+ .bottom-btn {
+ width: 100%;
+ // height: 120rpx;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ background-color: #fff;
+ box-shadow: 0 2rpx 10rpx 2rpx rgba(0, 0, 0, 0.4);
+ padding: 30rpx 40rpx 40rpx 40rpx;
- .btn-b {
- background-color: #41a863;
- color: #fff;
- }
+ button {
+ border-radius: 50rpx;
+ width: 180rpx;
+ height: 66rpx;
+ line-height: 66rpx;
+ font-size: 28rpx;
+ }
- .btn-c {
- background-color: #acacac;
- color: #fff;
- position: absolute;
- right: 120rpx;
- }
+ .btn-a {
+ background-color: #3A78FF;
+ color: #fff;
+ }
- .btn-d {
- background-color: #ff8901;
- color: #fff;
- }
- }
+ .btn-b {
+ background-color: #41a863;
+ color: #fff;
+ }
- .list {
- width: 100%;
+ .btn-c {
+ background-color: #acacac;
+ color: #fff;
+ position: absolute;
+ right: 120rpx;
+ }
- .card-detail {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- line-height: 120%;
+ .btn-d {
+ background-color: #ff8901;
+ color: #fff;
+ }
+ }
- .detail {
- // width: 50%;
- font-size: 26rpx;
- margin-bottom: 12rpx;
- color: #555;
- margin-right: 20rpx;
+ .list {
+ width: 100%;
- text {
- color: #999;
- font-size: 26rpx;
- }
- }
- }
+ .card-detail {
+ width: 100%;
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-between;
+ line-height: 120%;
- .more {
- color: #888;
- font-size: 24rpx;
- display: flex;
- border-top: 1px solid #eee;
- padding-top: 20rpx;
+ .detail {
+ // width: 50%;
+ font-size: 26rpx;
+ margin-bottom: 12rpx;
+ color: #555;
+ margin-right: 20rpx;
- .part {
- width: 50%;
- text-align: center;
- }
- }
- }
- .checkbox{
- color: #888;
- font-size: 28rpx;
- margin-top: 30rpx;
- float: right;
- }
+ text {
+ color: #999;
+ font-size: 26rpx;
+ }
+ }
+ }
+
+ .more {
+ color: #888;
+ font-size: 24rpx;
+ display: flex;
+ border-top: 1px solid #eee;
+ padding-top: 20rpx;
+
+ .part {
+ width: 50%;
+ text-align: center;
+ }
+ }
+ }
+
+ .checkbox {
+ color: #888;
+ font-size: 28rpx;
+ margin-top: 30rpx;
+ float: right;
+ }
</style>
\ No newline at end of file
diff --git a/pages/weiwailingliao/form.vue b/pages/weiwailingliao/form.vue
index a203fd2..3ef1869 100644
--- a/pages/weiwailingliao/form.vue
+++ b/pages/weiwailingliao/form.vue
@@ -304,6 +304,7 @@
import {
getUserStockRelation
} from '../../utils/userRelationManager';
+ import { CommonUtils } from '../../utils/common';
export default {
data() {
return {
@@ -401,8 +402,8 @@
get() {
// 鍔ㄦ�佽绠楀搴斾粨搴撶殑浠撲綅
return this.HStockPlaceNameList
- .filter(e => e['鎵�灞炰粨搴�'] == this.hform.HWHName)
- .map(e => e['浠撲綅鍚嶇О'])
+ .filter(e => e['鎵�灞炰粨搴�'] == this.hform.HWHName)
+ .map(e => e['浠撲綅鍚嶇О'])
}
}
},
@@ -1017,7 +1018,7 @@
});
},
//鎵潯鐮佸鐞�
- getCode(HBarCode) {
+ async getCode(HBarCode) {
//浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1044,112 +1045,193 @@
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.playSound(1)
- this.hform.HQty = ''
- this.DisBillEntryList()
- } else {
- this.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBarCode: sBarCode
}
- },
- fail: (res) => {
+ })
+ if (!res) {
+ return
+ }
+ console.log('鍒犻櫎鏉$爜', res.data);
+ this.hform.HBarCode = ''
+ if (res.data.count == 1) {
+ this.playSound(1)
+ this.hform.HQty = ''
+ this.DisBillEntryList()
+ } else {
this.playSound(0)
this.refreshBarCodeState()
- console.log(res);
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
- },
- });
+ }
+ } catch (err) {
+ this.refreshBarCodeState()
+ this.playSound(0)
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
+ 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.playSound(1)
+ // this.hform.HQty = ''
+ // this.DisBillEntryList()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // 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_BarCode_Json',
- data: {
- sBarCode: sBarCode,
- HInterID: this.hform.HInterID,
- 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) {
- this.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_BarCode_Json',
+ data: {
+ sBarCode: sBarCode,
+ HInterID: this.hform.HInterID,
+ 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) {
+ this.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
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ .hSourceBillTypeField)
+ if (index != -1) {
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ this.showHMainSourceBillType = false
+ }
+ // if (data.hSourceBillTypeField == "1604") {
+ // this.HMainSourceBillType = '濮斿鐢ㄦ枡娓呭崟'
+ // this.hform.HMainSourceBillType = 1604
+ // 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
}
- this.hform.HSourceBillNo = data.hSourceBillNoField
+ console.log(data)
//鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
this.hform.HMainSourceBillType = data.hSourceBillTypeField
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ data
.hSourceBillTypeField)
if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ index]
this.hform.HMainSourceBillType = data.hSourceBillTypeField
this.showHMainSourceBillType = false
}
- // if (data.hSourceBillTypeField == "1604") {
- // this.HMainSourceBillType = '濮斿鐢ㄦ枡娓呭崟'
- // this.hform.HMainSourceBillType = 1604
+ // 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 = '鎵嬪伐褰曞叆'
@@ -1159,74 +1241,178 @@
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
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
- .hSourceBillTypeField)
- if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- this.showHMainSourceBillType = false
- }
- // 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 = ''
- this.refreshBarCodeState()
- } else {
- this.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
}
- },
- fail: (res) => {
+ //鏄剧ず琛ㄤ綋鏄庣粏
+ this.DisBillEntryList()
+ //娓呯┖鏁伴噺
+ this.hform.HQty = ''
+ this.refreshBarCodeState()
+ } else {
this.playSound(0)
this.refreshBarCodeState()
- console.log(res);
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
- },
- });
+ }
+ } catch (err) {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ console.log(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/Get_BarCode_Json',
+ // data: {
+ // sBarCode: sBarCode,
+ // HInterID: this.hform.HInterID,
+ // 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) {
+ // this.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
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ //
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // if (data.hSourceBillTypeField == "1604") {
+ // // this.HMainSourceBillType = '濮斿鐢ㄦ枡娓呭崟'
+ // // this.hform.HMainSourceBillType = 1604
+ // // 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
+ //
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ // data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ // index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // 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 = ''
+ // this.refreshBarCodeState()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -1421,7 +1607,7 @@
url: '/pages/weiwailingliao/form?OperationType=1'
})
},
- submit() {
+ async submit() {
//浠撳簱銆佷粨浣嶃�佷繚绠°�侀獙鏀躲�侀儴闂ㄣ�佸鎴锋枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1469,53 +1655,102 @@
icon: 'none'
})
} else {
- uni.showLoading({
- title: '璇风◢鍊�'
- })
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SaveEntrustOutBill_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/weiwailingliao/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- // setTimeout(() => {
- // uni.navigateBack();
- // }, 500)
- }
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SaveEntrustOutBill_Json',
+ method: 'POST',
+ data: {
+ oMain: sMainStr
+ },
+ })
+ if (!res) {
+ return
+ }
+ console.log(1, res);
+ uni.hideLoading()
+ if (res.data.count == 1) {
+ // let sMain = JSON.stringify(this.materMeta) + ';' + this.hform
+ // .HBillType + ';' + this.hform.HSourceBillNo
+ // 涓烘潯鐮佽缃嚭搴撳崟鍙峰拰鍑哄簱娆℃暟
+ // await this.Set_BarCodeBill(sMain)
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: '/pages/weiwailingliao/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 (err) {
+ console.warn(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触:' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/set_SaveEntrustOutBill_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/weiwailingliao/form?OperationType=1'
+ // })
+ // } else if (res.cancel) {
+ // console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ // // setTimeout(() => {
+ // // uni.navigateBack();
+ // // }, 500)
+ // }
+ // }
+ // });
+ // } else {
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
}
},
diff --git a/pages/weiwairuku/form.vue b/pages/weiwairuku/form.vue
index 92b57c8..8be46e7 100644
--- a/pages/weiwairuku/form.vue
+++ b/pages/weiwairuku/form.vue
@@ -1009,7 +1009,7 @@
});
},
//鎵潯鐮佸鐞�
- getCode(HBarCode) {
+ async getCode(HBarCode) {
//浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1036,157 +1036,24 @@
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.playSound(1)
- this.hform.HQty = ''
- this.DisBillEntryList()
- } else {
- this.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBarCode: sBarCode
}
- },
- fail: (res) => {
- this.playSound(0)
- this.refreshBarCodeState()
- 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_BarCode_Json',
- data: {
- sBarCode: sBarCode,
- HInterID: this.hform.HInterID,
- 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);
+ })
+ if (!res) {
+ return
+ }
+ console.log('鍒犻櫎鏉$爜', res.data);
this.hform.HBarCode = ''
if (res.data.count == 1) {
this.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
- //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
- .hSourceBillTypeField)
- if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- this.showHMainSourceBillType = false
- }
- // if (data.hSourceBillTypeField == "1604") {
- // this.HMainSourceBillType = '濮斿鐢ㄦ枡娓呭崟'
- // this.hform.HMainSourceBillType = 1604
- // 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
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
- .hSourceBillTypeField)
- console.log('index: ', index);
- if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- this.showHMainSourceBillType = false
- }
- if (data.hMulSourceFlagField == 0) {
- this.showHSourceBillNo = false
- }
- //渚涘簲鍟嗕笉鍙紪杈�
- this.showHSupName = false
- }
- }
- //鏄剧ず琛ㄤ綋鏄庣粏
- this.DisBillEntryList()
- //娓呯┖鏁伴噺
this.hform.HQty = ''
+ this.DisBillEntryList()
} else {
this.playSound(0)
this.refreshBarCodeState()
@@ -1195,17 +1062,323 @@
icon: 'none'
})
}
- },
- fail: (res) => {
- this.playSound(0)
+ } catch (err) {
this.refreshBarCodeState()
- console.log(res);
+ this.playSound(0)
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
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.playSound(1)
+ // this.hform.HQty = ''
+ // this.DisBillEntryList()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // 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_BarCode_Json',
+ data: {
+ sBarCode: sBarCode,
+ HInterID: this.hform.HInterID,
+ 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) {
+ this.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
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ .hSourceBillTypeField)
+ if (index != -1) {
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ this.showHMainSourceBillType = false
+ }
+ // if (data.hSourceBillTypeField == "1604") {
+ // this.HMainSourceBillType = '濮斿鐢ㄦ枡娓呭崟'
+ // this.hform.HMainSourceBillType = 1604
+ // 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
+
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ data
+ .hSourceBillTypeField)
+ console.log('index: ', index);
+ if (index != -1) {
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ index]
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ this.showHMainSourceBillType = false
+ }
+ if (data.hMulSourceFlagField == 0) {
+ this.showHSourceBillNo = false
+ }
+ //渚涘簲鍟嗕笉鍙紪杈�
+ this.showHSupName = false
+ }
+ }
+ //鏄剧ず琛ㄤ綋鏄庣粏
+ this.DisBillEntryList()
+ //娓呯┖鏁伴噺
+ this.hform.HQty = ''
+ } else {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ } catch (err) {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ console.log(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
+ icon: 'none'
+ })
+ }
+
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/Get_BarCode_Json',
+ // data: {
+ // sBarCode: sBarCode,
+ // HInterID: this.hform.HInterID,
+ // 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) {
+ // this.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
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // if (data.hSourceBillTypeField == "1604") {
+ // // this.HMainSourceBillType = '濮斿鐢ㄦ枡娓呭崟'
+ // // this.hform.HMainSourceBillType = 1604
+ // // 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
+
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ // data
+ // .hSourceBillTypeField)
+ // console.log('index: ', index);
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ // index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // if (data.hMulSourceFlagField == 0) {
+ // this.showHSourceBillNo = false
+ // }
+ // //渚涘簲鍟嗕笉鍙紪杈�
+ // this.showHSupName = false
+ // }
+ // }
+ // //鏄剧ず琛ㄤ綋鏄庣粏
+ // this.DisBillEntryList()
+ // //娓呯┖鏁伴噺
+ // this.hform.HQty = ''
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -1400,7 +1573,7 @@
url: '/pages/weiwairuku/form?OperationType=1'
})
},
- submit() {
+ async submit() {
//浠撳簱銆佷粨浣嶃�佷繚绠°�侀獙鏀躲�侀儴闂ㄣ�佸鎴锋枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1448,53 +1621,102 @@
icon: 'none'
})
} else {
- uni.showLoading({
- title: '璇风◢鍊�'
- })
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SaveEntrustInBill_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/weiwairuku/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- setTimeout(() => {
- uni.navigateBack();
- }, 500)
- }
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SaveEntrustInBill_Json',
+ method: 'POST',
+ data: {
+ oMain: sMainStr
+ },
+ })
+ if (!res) {
+ return
+ }
+ console.log(1, res);
+ uni.hideLoading()
+ if (res.data.count == 1) {
+ // let sMain = JSON.stringify(this.materMeta) + ';' + this.hform
+ // .HBillType + ';' + this.hform.HSourceBillNo
+ // 涓烘潯鐮佽缃嚭搴撳崟鍙峰拰鍑哄簱娆℃暟
+ // await this.Set_BarCodeBill(sMain)
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: '/pages/weiwairuku/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 (err) {
+ console.warn(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触:' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/set_SaveEntrustInBill_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/weiwairuku/form?OperationType=1'
+ // })
+ // } else if (res.cancel) {
+ // console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ // setTimeout(() => {
+ // uni.navigateBack();
+ // }, 500)
+ // }
+ // }
+ // });
+ // } else {
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
}
},
diff --git a/pages/xiaoshouchuku/form.vue b/pages/xiaoshouchuku/form.vue
index 971e669..24db8d6 100644
--- a/pages/xiaoshouchuku/form.vue
+++ b/pages/xiaoshouchuku/form.vue
@@ -1029,7 +1029,7 @@
});
},
//鎵潯鐮佸鐞�
- getCode(HBarCode) {
+ async getCode(HBarCode) {
//浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1057,166 +1057,24 @@
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.playSound(1)
- this.hform.HQty = ''
- this.DisBillEntryList()
- } else {
- this.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBarCode: sBarCode
}
- },
- fail: (res) => {
- this.playSound(0)
- this.refreshBarCodeState()
- 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_BarCode_Json',
- data: {
- sBarCode: sBarCode,
- HInterID: this.hform.HInterID,
- 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);
+ })
+ if (!res) {
+ return
+ }
+ console.log('鍒犻櫎鏉$爜', res.data);
this.hform.HBarCode = ''
if (res.data.count == 1) {
this.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
- //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- if (data.hSourceBillTypeField == "1402") {
- this.HMainSourceBillType = '鍙戣揣閫氱煡鍗�'
- this.hform.HMainSourceBillType = 1402
- this.showHMainSourceBillType = false
- } else if (data.hSourceBillTypeField == "1401") {
- this.HMainSourceBillType = '閿�鍞鍗�'
- this.hform.HMainSourceBillType = 1401
- 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.materMeta.push(data)
- 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 || -1
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
- .hSourceBillTypeField)
- if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- this.showHMainSourceBillType = false
- }
- // 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 = ''
+ this.DisBillEntryList()
} else {
this.playSound(0)
this.refreshBarCodeState()
@@ -1225,17 +1083,340 @@
icon: 'none'
})
}
- },
- fail: (res) => {
- this.playSound(0)
+ } catch (err) {
this.refreshBarCodeState()
- console.log(res);
+ this.playSound(0)
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
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.playSound(1)
+ // this.hform.HQty = ''
+ // this.DisBillEntryList()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // 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_BarCode_Json',
+ data: {
+ sBarCode: sBarCode,
+ HInterID: this.hform.HInterID,
+ 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) {
+ this.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
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ if (data.hSourceBillTypeField == "1402") {
+ this.HMainSourceBillType = '鍙戣揣閫氱煡鍗�'
+ this.hform.HMainSourceBillType = 1402
+ this.showHMainSourceBillType = false
+ } else if (data.hSourceBillTypeField == "1401") {
+ this.HMainSourceBillType = '閿�鍞鍗�'
+ this.hform.HMainSourceBillType = 1401
+ 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.materMeta.push(data)
+ 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 || -1
+
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ .hSourceBillTypeField)
+ if (index != -1) {
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ this.showHMainSourceBillType = false
+ }
+ // 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 {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ } catch (err) {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ console.log(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/Get_BarCode_Json',
+ // data: {
+ // sBarCode: sBarCode,
+ // HInterID: this.hform.HInterID,
+ // 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) {
+ // this.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
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // if (data.hSourceBillTypeField == "1402") {
+ // this.HMainSourceBillType = '鍙戣揣閫氱煡鍗�'
+ // this.hform.HMainSourceBillType = 1402
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "1401") {
+ // this.HMainSourceBillType = '閿�鍞鍗�'
+ // this.hform.HMainSourceBillType = 1401
+ // 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.materMeta.push(data)
+ // 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 || -1
+ //
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ // data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ // index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // 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 {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -1425,7 +1606,7 @@
url: '/pages/xiaoshouchuku/form?OperationType=1'
})
},
- submit() {
+ async submit() {
//浠撳簱銆佷粨浣嶃�佷繚绠°�侀獙鏀躲�侀儴闂ㄣ�佸鎴锋枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1473,68 +1654,128 @@
icon: 'none'
})
} else {
- uni.showLoading({
- title: '璇风◢鍊�'
- })
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SaveSellOutBill_Json',
- method: 'POST',
- dataType: "json",
- data: {
- oMain: sMainStr
- },
- success: async (res) => {
- console.log(1, res);
- uni.hideLoading()
- if (res.data.count == 1) {
- try {
- if (this.hform.HMainSourceBillType == '1402') {
- if (/鍏磋揪|鏅轰簯/.test(uni.getStorageSync('Organization'))) {
- let sMain = JSON.stringify(this.materMeta) + ';' + this
- .hform
- .HBillType + ';' + this.hform.HSourceBillNo + ';鍏磋揪'
- this.Set_BarCodeBill(sMain)
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SaveSellOutBill_Json',
+ method: 'POST',
+ data: {
+ oMain: sMainStr
+ },
+ })
+ if (!res) {
+ return
+ }
+ console.log(1, res);
+ if (res.data.count == 1) {
+ try {
+ if (this.hform.HMainSourceBillType == '1402') {
+ if (/鍏磋揪|鏅轰簯/.test(uni.getStorageSync('Organization'))) {
+ let sMain = JSON.stringify(this.materMeta) + ';' + this
+ .hform
+ .HBillType + ';' + this.hform.HSourceBillNo + ';鍏磋揪'
+ this.Set_BarCodeBill(sMain)
+ }
+ }
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: '/pages/xiaoshouchuku/form?OperationType=1'
+ })
+ } else if (res.cancel) {
+ console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ // setTimeout(() => {
+ // uni.navigateBack();
+ // }, 50)
}
}
- uni.showModal({
- title: '鎻愮ず',
- content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
- success: (res) => {
- if (res.confirm) {
- console.log('鐢ㄦ埛鐐瑰嚮纭畾');
- uni.redirectTo({
- url: '/pages/xiaoshouchuku/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- // setTimeout(() => {
- // uni.navigateBack();
- // }, 50)
- }
- }
- });
- } catch (e) {
- uni.showToast({
- title: e,
- icon: 'none'
- })
- }
- } else {
+ });
+ } catch (e) {
uni.showToast({
- title: res.data.Message,
+ title: e,
icon: 'none'
})
}
- },
- fail: (res) => {
- console.log(res);
+
+ } else {
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
- },
- });
+ }
+ } catch (err) {
+ console.warn(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触:' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/set_SaveSellOutBill_Json',
+ // method: 'POST',
+ // dataType: "json",
+ // data: {
+ // oMain: sMainStr
+ // },
+ // success: async (res) => {
+ // console.log(1, res);
+ // uni.hideLoading()
+ // if (res.data.count == 1) {
+ // try {
+ // if (this.hform.HMainSourceBillType == '1402') {
+ // if (/鍏磋揪|鏅轰簯/.test(uni.getStorageSync('Organization'))) {
+ // let sMain = JSON.stringify(this.materMeta) + ';' + this
+ // .hform
+ // .HBillType + ';' + this.hform.HSourceBillNo + ';鍏磋揪'
+ // this.Set_BarCodeBill(sMain)
+ // }
+ // }
+ // uni.showModal({
+ // title: '鎻愮ず',
+ // content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
+ // success: (res) => {
+ // if (res.confirm) {
+ // console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ // uni.redirectTo({
+ // url: '/pages/xiaoshouchuku/form?OperationType=1'
+ // })
+ // } else if (res.cancel) {
+ // console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ // // setTimeout(() => {
+ // // uni.navigateBack();
+ // // }, 50)
+ // }
+ // }
+ // });
+ // } catch (e) {
+ // uni.showToast({
+ // title: e,
+ // icon: 'none'
+ // })
+ // }
+ // } else {
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
}
},
diff --git a/pages/xiaoshoutuihuo/form.vue b/pages/xiaoshoutuihuo/form.vue
index 9be163c..6aa4167 100644
--- a/pages/xiaoshoutuihuo/form.vue
+++ b/pages/xiaoshoutuihuo/form.vue
@@ -247,6 +247,7 @@
getUserStockRelation
} from '../../utils/userRelationManager';
import BarCodePopupVue from "../../components/BarCodePopup/BarCodePopup.vue";
+ import { CommonUtils } from '../../utils/common';
export default {
components: {
BarCodePopupVue
@@ -840,7 +841,7 @@
});
},
//鎵潯鐮佸鐞�
- getCode(HBarCode) {
+ async getCode(HBarCode) {
//浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -868,165 +869,24 @@
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.playSound(1)
- this.hform.HQty = ''
- this.DisBillEntryList()
- } else {
- this.playSound(0)
- this.refreshBarCodeState()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBarCode: sBarCode
}
- },
- fail: (res) => {
- this.playSound(0)
- this.refreshBarCodeState()
- 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_BarCode_Json',
- data: {
- sBarCode: sBarCode,
- HInterID: this.hform.HInterID,
- 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);
+ })
+ if (!res) {
+ return
+ }
+ console.log('鍒犻櫎鏉$爜', res.data);
this.hform.HBarCode = ''
if (res.data.count == 1) {
this.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
- //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- if (data.hSourceBillTypeField == "1403") {
- this.HMainSourceBillType = '閫�璐ч�氱煡鍗�'
- this.hform.HMainSourceBillType = 1403
- this.showHMainSourceBillType = false
- } else if (data.hSourceBillTypeField == "1401") {
- this.HMainSourceBillType = '閿�鍞鍗�'
- this.hform.HMainSourceBillType = 1401
- 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
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
- .hSourceBillTypeField)
- if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- this.showHMainSourceBillType = false
- }
- // 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 = ''
+ this.DisBillEntryList()
} else {
this.playSound(0)
this.refreshBarCodeState()
@@ -1035,17 +895,337 @@
icon: 'none'
})
}
- },
- fail: (res) => {
- this.playSound(0)
+ } catch (err) {
this.refreshBarCodeState()
- console.log(res);
+ this.playSound(0)
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
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.playSound(1)
+ // this.hform.HQty = ''
+ // this.DisBillEntryList()
+ // } else {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // 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_BarCode_Json',
+ data: {
+ sBarCode: sBarCode,
+ HInterID: this.hform.HInterID,
+ 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) {
+ this.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
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ if (data.hSourceBillTypeField == "1403") {
+ this.HMainSourceBillType = '閫�璐ч�氱煡鍗�'
+ this.hform.HMainSourceBillType = 1403
+ this.showHMainSourceBillType = false
+ } else if (data.hSourceBillTypeField == "1401") {
+ this.HMainSourceBillType = '閿�鍞鍗�'
+ this.hform.HMainSourceBillType = 1401
+ 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
+
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ .hSourceBillTypeField)
+ if (index != -1) {
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ this.showHMainSourceBillType = false
+ }
+ // 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 {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ } catch (err) {
+ this.playSound(0)
+ this.refreshBarCodeState()
+ console.log(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
+ icon: 'none'
+ })
+ }
+
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/Get_BarCode_Json',
+ // data: {
+ // sBarCode: sBarCode,
+ // HInterID: this.hform.HInterID,
+ // 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) {
+ // this.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
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // if (data.hSourceBillTypeField == "1403") {
+ // this.HMainSourceBillType = '閫�璐ч�氱煡鍗�'
+ // this.hform.HMainSourceBillType = 1403
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "1401") {
+ // this.HMainSourceBillType = '閿�鍞鍗�'
+ // this.hform.HMainSourceBillType = 1401
+ // 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
+
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ // data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ // index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // 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 {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.refreshBarCodeState()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -1228,7 +1408,7 @@
url: '/pages/xiaoshoutuihuo/form?OperationType=1'
})
},
- submit() {
+ async submit() {
//浠撳簱銆佷粨浣嶃�佷繚绠°�侀獙鏀躲�侀儴闂ㄣ�佸鎴锋枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1276,53 +1456,102 @@
icon: 'none'
})
} else {
- uni.showLoading({
- title: '璇风◢鍊�'
- })
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SaveSellOutBackBill_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/xiaoshoutuihuo/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- // setTimeout(() => {
- // uni.navigateBack();
- // }, 50)
- }
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SaveSellOutBackBill_Json',
+ method: 'POST',
+ data: {
+ oMain: sMainStr
+ },
+ })
+ if (!res) {
+ return
+ }
+ console.log(1, res);
+ uni.hideLoading()
+ if (res.data.count == 1) {
+ // let sMain = JSON.stringify(this.materMeta) + ';' + this.hform
+ // .HBillType + ';' + this.hform.HSourceBillNo
+ // 涓烘潯鐮佽缃嚭搴撳崟鍙峰拰鍑哄簱娆℃暟
+ // await this.Set_BarCodeBill(sMain)
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: '/pages/xiaoshoutuihuo/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 (err) {
+ console.warn(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触:' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/set_SaveSellOutBackBill_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/xiaoshoutuihuo/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/pages/zhijiediaobo/form.vue b/pages/zhijiediaobo/form.vue
index 0c06df4..b68085e 100644
--- a/pages/zhijiediaobo/form.vue
+++ b/pages/zhijiediaobo/form.vue
@@ -554,30 +554,45 @@
get() {
// 鍔ㄦ�佽绠楀搴旇皟鍑轰粨搴撶殑浠撲綅
return this.HStockPlaceNameList
- .filter(e => e['鎵�灞炰粨搴�'] == this.hform.HSCWHName)
- .map(e => e['浠撲綅鍚嶇О'])
+ .filter(e => e['鎵�灞炰粨搴�'] == this.hform.HSCWHName)
+ .map(e => e['浠撲綅鍚嶇О'])
}
},
arrayHStockPlaceInNameComputed: {
get() {
// 鍔ㄦ�佽绠楀搴旇皟鍏ヤ粨搴撶殑浠撲綅
return this.HStockPlaceInNameList
- .filter(e => e['鎵�灞炰粨搴�'] == this.hform.HWHName)
- .map(e => e['浠撲綅鍚嶇О'])
+ .filter(e => e['鎵�灞炰粨搴�'] == this.hform.HWHName)
+ .map(e => e['浠撲綅鍚嶇О'])
}
}
},
methods: {
+ async refreshHSourceBillState() {
+ this.HSourceBillNoFocus = false
+ await this.$nextTick(() => {
+ this.hform.HSourceBillNo = ""
+ this.HSourceBillNoFocus = true
+
+ })
+ },
+ async refreshBarCodeState() {
+ this.barCodeFocus = false
+ await this.$nextTick(() => {
+ this.hform.HBarCode = ""
+ this.barCodeFocus = true
+ })
+ },
async HWHNameOutScan(e) {
// 鎵弿浠撳簱鐮�
console.log('浠撳簱鐮�: ', e);
let index = this.HWHNameList.findIndex(elem => elem['鏉$爜缂栧彿'] == e)
- if(index == -1){
+ if (index == -1) {
uni.showToast({
- icon:'none',
+ icon: 'none',
title: '鎵弿浠撳簱鏉$爜瀵瑰簲鐨勪粨搴撲笉瀛樺湪...'
})
- }else {
+ } else {
this.HWHNameChange(this.HWHNameList[index]['浠撳簱鍚嶇О'])
}
},
@@ -585,13 +600,13 @@
// 鎵弿浠撲綅鐮�
console.log('浠撲綅鐮�: ', e);
let index = this.HStockPlaceNameList.findIndex(elem => elem['鏉$爜缂栧彿'] == e)
- console.log('index: ',index);
- if(index == -1){
+ console.log('index: ', index);
+ if (index == -1) {
uni.showToast({
- icon:'none',
+ icon: 'none',
title: '鎵弿浠撲綅鏉$爜瀵瑰簲鐨勪粨浣嶄笉瀛樺湪...'
})
- }else {
+ } else {
this.HOutStockPlaceNameChange(this.HStockPlaceNameList[index]['浠撲綅鍚嶇О'])
}
},
@@ -599,12 +614,12 @@
// 鎵弿浠撳簱鐮�
console.log('浠撳簱鐮�: ', e);
let index = this.HWHInNameList.findIndex(elem => elem['鏉$爜缂栧彿'] == e)
- if(index == -1){
+ if (index == -1) {
uni.showToast({
- icon:'none',
+ icon: 'none',
title: '鎵弿浠撳簱鏉$爜瀵瑰簲鐨勪粨搴撲笉瀛樺湪...'
})
- }else {
+ } else {
this.HWHInNameChange(this.HWHInNameList[index]['浠撳簱鍚嶇О'])
}
},
@@ -612,13 +627,13 @@
// 鎵弿浠撲綅鐮�
console.log('浠撲綅鐮�: ', e);
let index = this.HStockPlaceInNameList.findIndex(elem => elem['鏉$爜缂栧彿'] == e)
- console.log('index: ',index);
- if(index == -1){
+ console.log('index: ', index);
+ if (index == -1) {
uni.showToast({
- icon:'none',
+ icon: 'none',
title: '鎵弿浠撲綅鏉$爜瀵瑰簲鐨勪粨浣嶄笉瀛樺湪...'
})
- }else {
+ } else {
this.HStockPlaceNameChange(this.HStockPlaceInNameList[index]['浠撲綅鍚嶇О'])
}
},
@@ -953,10 +968,10 @@
success: (res) => {
if (res.data.count == 1) {
this.HWHNameList = res.data.data
- this.HWHInNameList = res.data.data
+ this.HWHInNameList = res.data.data
for (var i = 0; i < res.data.data.length; i++) {
this.arrayHWHName[i] = res.data.data[i].浠撳簱鍚嶇О
- this.arrayHWHInName[i] = res.data.data[i].浠撳簱鍚嶇О
+ this.arrayHWHInName[i] = res.data.data[i].浠撳簱鍚嶇О
}
} else {
uni.showToast({
@@ -1094,11 +1109,11 @@
this.arrayHMainSourceBillType.push('鎵嬪伐褰曞叆')
this.arrayHMainSourceBillValue.push('-1')
- //濡傛灉鎵嬪伐褰曞叆涓嶇敤閫夋嫨婧愬崟
- if(this.arrayHMainSourceBillType[0]=='鎵嬪伐褰曞叆'){
- this.tabs=1
- }
-
+ //濡傛灉鎵嬪伐褰曞叆涓嶇敤閫夋嫨婧愬崟
+ if (this.arrayHMainSourceBillType[0] == '鎵嬪伐褰曞叆') {
+ this.tabs = 1
+ }
+
this.HMainSourceBillType = this.arrayHMainSourceBillType[0]
this.hform.HMainSourceBillType = this.arrayHMainSourceBillValue[0]
} else {
@@ -1443,7 +1458,7 @@
});
},
//鎵潯鐮佸鐞�
- getCode(HBarCode) {
+ async getCode(HBarCode) {
//浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HSCWHName) {
this.hform.HSCWHID = 0
@@ -1472,153 +1487,235 @@
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.playSound(1)
- this.hform.HQty = ''
- this.DisBillEntryList()
- } else {
- this.playSound(0)
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- this.barCodeFocus = false
- this.$nextTick(() => {
- this.barCodeFocus = true
- this.hform.HBarCode = ""
- })
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBarCode: sBarCode
}
- },
- fail: (res) => {
+ })
+ if (!res) {
+ return
+ }
+ console.log('鍒犻櫎鏉$爜', res.data);
+ this.hform.HBarCode = ''
+ if (res.data.count == 1) {
+ this.playSound(1)
+ this.hform.HQty = ''
+ this.DisBillEntryList()
+ } else {
this.playSound(0)
- this.barCodeFocus = true
- console.log(res);
+ this.refreshBarCodeState()
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
- this.barCodeFocus = false
- this.$nextTick(() => {
- this.barCodeFocus = true
- this.hform.HBarCode = ""
- })
- },
- });
+ }
+ } catch (err) {
+ this.refreshBarCodeState()
+ this.playSound(0)
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + err,
+ 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.playSound(1)
+ // this.hform.HQty = ''
+ // this.DisBillEntryList()
+ // } else {
+ // this.playSound(0)
+ //
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // this.barCodeFocus = false
+ // this.$nextTick(() => {
+ // this.barCodeFocus = true
+ // this.hform.HBarCode = ""
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.barCodeFocus = true
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // this.barCodeFocus = false
+ // this.$nextTick(() => {
+ // this.barCodeFocus = true
+ // this.hform.HBarCode = ""
+ // })
+ // },
+ // });
}
} else {
var sBarCode = this.hform.HBarCode
if (sHQty == "") {
sHQty = 0;
}
- uni.request({
- url: this.serverUrl + '/WEBSController/get_BarCode_MoveStock_New_Json',
- data: {
- sBarCode: sBarCode,
- HInterID: this.hform.HInterID,
- HBillType: this.hform.HBillType,
- HBillNo: this.hform.HBillNo,
- HMaker: this.hform.HMaker,
- HWhID: sHWHID,
- HSPID: sHSPID,
- HSCWHID: sHSCWHID,
- HSCSPID: sHOUTSPID,
- HQty: sHQty,
- // HRedBlueFlag: this.hform.HRedBlueFlag,
- SourceFlag: HSourceFlag,
- HSourceBillNo: sSourceBillNo,
- HSourceBillType: sSourceBillType,
- HStockInOrgID: this.hform.HStockOrgID,
- HStockOutOrgID: this.hform.HStockOutOrgID,
- HScanStyle: "",
- HCustom1: "",
- HCustom2: ""
- },
- success: (res) => {
- console.log('鎵爜杩斿洖', res.data);
- this.hform.HBarCode = ''
- if (res.data.count == 1) {
- this.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_BarCode_MoveStock_New_Json',
+ data: {
+ sBarCode: sBarCode,
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBillNo: this.hform.HBillNo,
+ HMaker: this.hform.HMaker,
+ HWhID: sHWHID,
+ HSPID: sHSPID,
+ HSCWHID: sHSCWHID,
+ HSCSPID: sHOUTSPID,
+ HQty: sHQty,
+ // HRedBlueFlag: this.hform.HRedBlueFlag,
+ SourceFlag: HSourceFlag,
+ HSourceBillNo: sSourceBillNo,
+ HSourceBillType: sSourceBillType,
+ HStockInOrgID: this.hform.HStockOrgID,
+ HStockOutOrgID: this.hform.HStockOutOrgID,
+ HScanStyle: "",
+ HCustom1: "",
+ HCustom2: ""
+ },
+ })
+
+ if (!res) {
+ return
+ }
+
+ console.log('鎵爜杩斿洖', res.data);
+ this.hform.HBarCode = ''
+ if (res.data.count == 1) {
+ this.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
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ .hSourceBillTypeField)
+ if (index != -1) {
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ this.showHMainSourceBillType = false
+ }
+ // if (data.hSourceBillTypeField == "1402") {
+ // this.HMainSourceBillType = '鍙戣揣閫氱煡鍗�'
+ // this.hform.HMainSourceBillType = 1402
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "1243") {
+ // this.HMainSourceBillType = '璋冩嫧鐢宠鍗�'
+ // this.hform.HMainSourceBillType = 1243
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "1214") {
+ // this.HMainSourceBillType = '鐢熶骇鍙戞枡閫氱煡鍗�'
+ // this.hform.HMainSourceBillType = 1214
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "3720") {
+ // this.HMainSourceBillType = '鐢熶骇鐢ㄦ枡娓呭崟'
+ // this.hform.HMainSourceBillType = 3720
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "1604") {
+ // this.HMainSourceBillType = '濮斿鐢ㄦ枡娓呭崟'
+ // this.hform.HMainSourceBillType = 1604
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "1214") {
+ // this.HMainSourceBillType = '鐢熶骇鍙戞枡閫氱煡鍗�'
+ // this.hform.HMainSourceBillType = 1214
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "3721") {
+ // this.HMainSourceBillType = '鐢熶骇澶囨枡鍗�'
+ // this.hform.HMainSourceBillType = 3721
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "1242") {
+ // this.HMainSourceBillType = '鍑哄簱鐢宠鍗�'
+ // this.hform.HMainSourceBillType = 1242
+ // 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
}
- this.hform.HSourceBillNo = data.hSourceBillNoField
+ console.log(data)
//鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField || -1
+ let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ data
.hSourceBillTypeField)
if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ index]
this.hform.HMainSourceBillType = data.hSourceBillTypeField
this.showHMainSourceBillType = false
}
- // if (data.hSourceBillTypeField == "1402") {
- // this.HMainSourceBillType = '鍙戣揣閫氱煡鍗�'
- // this.hform.HMainSourceBillType = 1402
+ // if (data.hSourceBillTypeField == "1103") {
+ // this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+ // this.hform.HMainSourceBillType = 1103
// this.showHMainSourceBillType = false
- // } else if (data.hSourceBillTypeField == "1243") {
- // this.HMainSourceBillType = '璋冩嫧鐢宠鍗�'
- // this.hform.HMainSourceBillType = 1243
- // this.showHMainSourceBillType = false
- // } else if (data.hSourceBillTypeField == "1214") {
- // this.HMainSourceBillType = '鐢熶骇鍙戞枡閫氱煡鍗�'
- // this.hform.HMainSourceBillType = 1214
- // this.showHMainSourceBillType = false
- // } else if (data.hSourceBillTypeField == "3720") {
- // this.HMainSourceBillType = '鐢熶骇鐢ㄦ枡娓呭崟'
- // this.hform.HMainSourceBillType = 3720
- // this.showHMainSourceBillType = false
- // } else if (data.hSourceBillTypeField == "1604") {
- // this.HMainSourceBillType = '濮斿鐢ㄦ枡娓呭崟'
- // this.hform.HMainSourceBillType = 1604
- // this.showHMainSourceBillType = false
- // } else if (data.hSourceBillTypeField == "1214") {
- // this.HMainSourceBillType = '鐢熶骇鍙戞枡閫氱煡鍗�'
- // this.hform.HMainSourceBillType = 1214
- // this.showHMainSourceBillType = false
- // } else if (data.hSourceBillTypeField == "3721") {
- // this.HMainSourceBillType = '鐢熶骇澶囨枡鍗�'
- // this.hform.HMainSourceBillType = 3721
- // this.showHMainSourceBillType = false
- // } else if (data.hSourceBillTypeField == "1242") {
- // this.HMainSourceBillType = '鍑哄簱鐢宠鍗�'
- // this.hform.HMainSourceBillType = 1242
+ // } else if (data.hSourceBillTypeField == "1102") {
+ // this.HMainSourceBillType = '閲囪喘璁㈠崟'
+ // this.hform.HMainSourceBillType = 1102
// this.showHMainSourceBillType = false
// } else {
// this.HMainSourceBillType = '鎵嬪伐褰曞叆'
@@ -1628,79 +1725,24 @@
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 || -1
-
- let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
- .hSourceBillTypeField)
- if (index != -1) {
- this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- this.showHMainSourceBillType = false
- }
- // 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 = ''
- //鍏夋爣瀵瑰噯
- this.barCodeFocus = false
- this.$nextTick(() => {
- this.barCodeFocus = true
- this.hform.HBarCode = ""
- })
- } else {
- this.playSound(0)
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- this.barCodeFocus = false
- this.$nextTick(() => {
- this.barCodeFocus = true
- this.hform.HBarCode = ""
- })
}
- },
- fail: (res) => {
+ //鏄剧ず琛ㄤ綋鏄庣粏
+ this.DisBillEntryList()
+ //娓呯┖鏁伴噺
+ this.hform.HQty = ''
+ //鍏夋爣瀵瑰噯
+ this.barCodeFocus = false
+ this.$nextTick(() => {
+ this.barCodeFocus = true
+ this.hform.HBarCode = ""
+ })
+ } else {
this.playSound(0)
- this.barCodeFocus = true
- console.log(res);
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
this.barCodeFocus = false
@@ -1708,8 +1750,215 @@
this.barCodeFocus = true
this.hform.HBarCode = ""
})
- },
- });
+ }
+
+ } catch (err) {
+ this.playSound(0)
+ this.barCodeFocus = true
+ console.log(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触:' + err,
+ icon: 'none'
+ })
+ this.barCodeFocus = false
+ this.$nextTick(() => {
+ this.barCodeFocus = true
+ this.hform.HBarCode = ""
+ })
+
+ }
+
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/get_BarCode_MoveStock_New_Json',
+ // data: {
+ // sBarCode: sBarCode,
+ // HInterID: this.hform.HInterID,
+ // HBillType: this.hform.HBillType,
+ // HBillNo: this.hform.HBillNo,
+ // HMaker: this.hform.HMaker,
+ // HWhID: sHWHID,
+ // HSPID: sHSPID,
+ // HSCWHID: sHSCWHID,
+ // HSCSPID: sHOUTSPID,
+ // HQty: sHQty,
+ // // HRedBlueFlag: this.hform.HRedBlueFlag,
+ // SourceFlag: HSourceFlag,
+ // HSourceBillNo: sSourceBillNo,
+ // HSourceBillType: sSourceBillType,
+ // HStockInOrgID: this.hform.HStockOrgID,
+ // HStockOutOrgID: this.hform.HStockOutOrgID,
+ // HScanStyle: "",
+ // HCustom1: "",
+ // HCustom2: ""
+ // },
+ // success: (res) => {
+ // console.log('鎵爜杩斿洖', res.data);
+ // this.hform.HBarCode = ''
+ // if (res.data.count == 1) {
+ // this.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
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ //
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e == data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // if (data.hSourceBillTypeField == "1402") {
+ // // this.HMainSourceBillType = '鍙戣揣閫氱煡鍗�'
+ // // this.hform.HMainSourceBillType = 1402
+ // // this.showHMainSourceBillType = false
+ // // } else if (data.hSourceBillTypeField == "1243") {
+ // // this.HMainSourceBillType = '璋冩嫧鐢宠鍗�'
+ // // this.hform.HMainSourceBillType = 1243
+ // // this.showHMainSourceBillType = false
+ // // } else if (data.hSourceBillTypeField == "1214") {
+ // // this.HMainSourceBillType = '鐢熶骇鍙戞枡閫氱煡鍗�'
+ // // this.hform.HMainSourceBillType = 1214
+ // // this.showHMainSourceBillType = false
+ // // } else if (data.hSourceBillTypeField == "3720") {
+ // // this.HMainSourceBillType = '鐢熶骇鐢ㄦ枡娓呭崟'
+ // // this.hform.HMainSourceBillType = 3720
+ // // this.showHMainSourceBillType = false
+ // // } else if (data.hSourceBillTypeField == "1604") {
+ // // this.HMainSourceBillType = '濮斿鐢ㄦ枡娓呭崟'
+ // // this.hform.HMainSourceBillType = 1604
+ // // this.showHMainSourceBillType = false
+ // // } else if (data.hSourceBillTypeField == "1214") {
+ // // this.HMainSourceBillType = '鐢熶骇鍙戞枡閫氱煡鍗�'
+ // // this.hform.HMainSourceBillType = 1214
+ // // this.showHMainSourceBillType = false
+ // // } else if (data.hSourceBillTypeField == "3721") {
+ // // this.HMainSourceBillType = '鐢熶骇澶囨枡鍗�'
+ // // this.hform.HMainSourceBillType = 3721
+ // // this.showHMainSourceBillType = false
+ // // } else if (data.hSourceBillTypeField == "1242") {
+ // // this.HMainSourceBillType = '鍑哄簱鐢宠鍗�'
+ // // this.hform.HMainSourceBillType = 1242
+ // // 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 || -1
+ //
+ // let index = this.arrayHMainSourceBillValue.findIndex(e => e ==
+ // data
+ // .hSourceBillTypeField)
+ // if (index != -1) {
+ // this.HMainSourceBillType = this.arrayHMainSourceBillType[
+ // index]
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // this.showHMainSourceBillType = false
+ // }
+ // // 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 = ''
+ // //鍏夋爣瀵瑰噯
+ // this.barCodeFocus = false
+ // this.$nextTick(() => {
+ // this.barCodeFocus = true
+ // this.hform.HBarCode = ""
+ // })
+ // } else {
+ // this.playSound(0)
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // this.barCodeFocus = false
+ // this.$nextTick(() => {
+ // this.barCodeFocus = true
+ // this.hform.HBarCode = ""
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // this.playSound(0)
+ // this.barCodeFocus = true
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // this.barCodeFocus = false
+ // this.$nextTick(() => {
+ // this.barCodeFocus = true
+ // this.hform.HBarCode = ""
+ // })
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -1947,7 +2196,7 @@
url: '/pages/zhijiediaobo/form?OperationType=1'
})
},
- submit() {
+ async submit() {
//浠撳簱銆佷粨浣嶃�佷繚绠°�侀獙鏀躲�侀儴闂ㄣ�佸鎴锋枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
if (!this.hform.HWHName) {
this.hform.HWHID = 0
@@ -1995,53 +2244,103 @@
icon: 'none'
})
} else {
- uni.showLoading({
- title: '璇风◢鍊�'
- })
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SaveMoveStockBill_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/zhijiediaobo/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- // setTimeout(() => {
- // uni.navigateBack();
- // }, 500)
- }
+
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SaveMoveStockBill_Json',
+ method: 'POST',
+ data: {
+ oMain: sMainStr
+ },
+ })
+ if (!res) {
+ return
+ }
+ console.log(1, res);
+ uni.hideLoading()
+ if (res.data.count == 1) {
+ // let sMain = JSON.stringify(this.materMeta) + ';' + this.hform
+ // .HBillType + ';' + this.hform.HSourceBillNo
+ // 涓烘潯鐮佽缃嚭搴撳崟鍙峰拰鍑哄簱娆℃暟
+ // await this.Set_BarCodeBill(sMain)
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: '/pages/zhijiediaobo/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 (err) {
+ console.warn(err);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触:' + err,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/set_SaveMoveStockBill_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/zhijiediaobo/form?OperationType=1'
+ // })
+ // } else if (res.cancel) {
+ // console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ // // setTimeout(() => {
+ // // uni.navigateBack();
+ // // }, 500)
+ // }
+ // }
+ // });
+ // } 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 b70b133..9c58bc1 100644
--- a/utils/common.js
+++ b/utils/common.js
@@ -312,7 +312,7 @@
method,
}) {
if(this.requestLock){
- console.warn("璇ヨ姹傝閿佸畾锛屽凡閫�鍑鸿姹�!")
+ console.warn("璇ヨ姹傝閿佸畾,涓嶈兘閲嶅璇锋眰!!!")
return
}
--
Gitblit v1.9.1