From db3cb0b57fdec1a8ba13ed811e12b25dad0cddb2 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期六, 11 十月 2025 15:45:23 +0800
Subject: [PATCH] Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev
---
pages/zutuosaoma/form.vue | 45
utils/common.js | 228 +++-
pages/caigourukujiaoyan/form.vue | 981 +++++++++++++++-------
pages/chaituosaoma/form.vue | 12
manifest.json | 1
pages.json | 7
pages/index/tab2.vue | 6
pages/tiaomaguanli/table.vue | 7
pages/zutuosaoma/table.vue | 507 +++++++++++
.hbuilderx/launch.json | 2
pages/caigoutuiliao/form.vue | 23
pages/shengchanlingliao/form.vue | 695 +++++++++++----
12 files changed, 1,868 insertions(+), 646 deletions(-)
diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json
index 4dd14cd..d7abf73 100644
--- a/.hbuilderx/launch.json
+++ b/.hbuilderx/launch.json
@@ -25,7 +25,7 @@
"localRepoPath" : "D:/WorkBench/ZY_APP_Dev/STUWMS/unpackage/debug",
"openVueDevtools" : true,
"packageName" : "com.shebeiguanli.www",
- "playground" : "standard",
+ "playground" : "custom",
"type" : "uni-app:app-android"
}
]
diff --git a/manifest.json b/manifest.json
index e363efb..3772692 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,6 +2,7 @@
"name" : "鏅轰簯LMES",
"appid" : "__UNI__B002F49",
"description" : "",
+
"versionName" : "1.0.97",
"versionCode" : 197,
"transformPx" : false,
diff --git a/pages.json b/pages.json
index 340b1cb..b97e612 100644
--- a/pages.json
+++ b/pages.json
@@ -815,6 +815,13 @@
}
},
{
+ "path" : "pages/zutuosaoma/table",
+ "style" :
+ {
+ "navigationBarTitleText" : "缁勬墭鎵爜缂撳瓨"
+ }
+ },
+ {
"path" : "pages/chaituosaoma/form",
"style" :
{
diff --git a/pages/caigourukujiaoyan/form.vue b/pages/caigourukujiaoyan/form.vue
index b98cfcb..dfe29ec 100644
--- a/pages/caigourukujiaoyan/form.vue
+++ b/pages/caigourukujiaoyan/form.vue
@@ -312,57 +312,113 @@
})
},
//鎵弿鍗曟嵁鍙锋潯鐮�
- GetMeesageByBillNo(e) {
- if(this.hform.HBillNo==""||this.hform.HBillNo==undefined){
- return
- }
- uni.request({
- url: this.serverUrl + '/WEBSController/get_BillBarCode_BillCheck_Json',
- data: {
- HBillNo: this.hform.HBillNo,
- HBillType: this.hform.HBillType,
- HMaker: this.hform.HMaker,
- HStockOrgID: this.hform.HStockOrgID
- },
- success: (res) => {
- if (res.data.count == 1) {
- CommonUtils.playSound(1);
- var data = res.data.data
- console.log('鍗曟嵁淇℃伅: ', data)
- this.hform.HInterID = data.hInterIDField
- this.hform.HBillNo = data.hBillNoField
- this.showHBillNo = false
- //鏉$爜鏍稿鏍囪
- if (data.hSourceBarCodeFlagField) {
- this.hform.HSourceBarCodeCtl = "Y"
- this.hform.chkHBarflag = true
- this.hform.HBarflag = data
- }
- this.tabs = 2
- this.DisBillEntryList();
- this.refreshHBarCodeFocus()
- } else {
- CommonUtils.playSound(0);
- this.refreshHBillNoFocus()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
-
- // this.hform.HBillNo = ''
- }
- },
- fail: (res) => {
- CommonUtils.playSound(0);
+ async GetMeesageByBillNo(e) {
+ if (this.hform.HBillNo == "" || this.hform.HBillNo == undefined) {
+ return
+ }
+
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/get_BillBarCode_BillCheck_Json',
+ data: {
+ HBillNo: this.hform.HBillNo,
+ HBillType: this.hform.HBillType,
+ HMaker: this.hform.HMaker,
+ HStockOrgID: this.hform.HStockOrgID
+ },
+ })
+
+ if (!res) {
+ // 瑙﹀彂璇锋眰閿侊紝涓嶈繑鍥炰换浣曞��
+ return
+ }
+
+ let {
+ data,
+ Message,
+ count
+ } = res.data
+ if (count == 1) {
+ CommonUtils.playSound(1)
+ console.log(data)
+ this.hform.HInterID = data.hInterIDField
+ this.hform.HBillNo = data.hBillNoField
+ this.showHBillNo = false
+ //鏉$爜鏍稿鏍囪
+ if (data.hSourceBarCodeFlagField) {
+ this.hform.HSourceBarCodeCtl = "Y"
+ this.hform.chkHBarflag = true
+ this.hform.HBarflag = data
+ }
+ this.tabs = 2
+ this.DisBillEntryList();
+ this.refreshHBarCodeFocus()
+ } else {
+ CommonUtils.playSound(0)
this.refreshHBillNoFocus()
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
- },
+ uni.showToast({
+ title: Message,
+ icon: 'none'
+ })
+ this.hform.HBillNo = ''
+ }
+
+ } catch (e) {
+ CommonUtils.playSound(0)
+ this.refreshHBillNoFocus()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/get_BillBarCode_BillCheck_Json',
+ // data: {
+ // HBillNo: this.hform.HBillNo,
+ // HBillType: this.hform.HBillType,
+ // HMaker: this.hform.HMaker,
+ // HStockOrgID: this.hform.HStockOrgID
+ // },
+ // success: (res) => {
+ // if (res.data.count == 1) {
+ // CommonUtils.playSound(1);
+ // var data = res.data.data
+ // console.log('鍗曟嵁淇℃伅: ', data)
+ // this.hform.HInterID = data.hInterIDField
+ // this.hform.HBillNo = data.hBillNoField
+ // this.showHBillNo = false
+ // //鏉$爜鏍稿鏍囪
+ // if (data.hSourceBarCodeFlagField) {
+ // this.hform.HSourceBarCodeCtl = "Y"
+ // this.hform.chkHBarflag = true
+ // this.hform.HBarflag = data
+ // }
+ // this.tabs = 2
+ // this.DisBillEntryList();
+ // this.refreshHBarCodeFocus()
+ // } else {
+ // CommonUtils.playSound(0);
+ // this.refreshHBillNoFocus()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ //
+ // // this.hform.HBillNo = ''
+ // }
+ // },
+ // fail: (res) => {
+ // CommonUtils.playSound(0);
+ // this.refreshHBillNoFocus()
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
+ },
//鍩虹浠撳簱璧勬枡
getHBaseList() {
uni.request({
@@ -449,202 +505,377 @@
}
}
},
- getCode(HBarCode) {
- console.log(HBarCode);
- if(HBarCode==undefined||HBarCode==""){
- return
- }
- //浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
- if (!this.hform.HWHName) {
- this.hform.HWHID = 0
- }
- if (!this.hform.HStockPlaceName) {
- this.hform.HStockPlaceID = 0
- }
- var sOldBarCode = HBarCode
- var HDeleteFlag = sOldBarCode.substring(0, 1);
- var sBarCode = sOldBarCode.slice(1);
-
- var sHWHID = this.hform.HWHID
- var sHSPID = this.hform.HStockPlaceID
- var sHQty = this.hform.HQty
- var sSourceBillNo = this.hform.HSourceBillNo
- var sSourceBillType = this.hform.HMainSourceBillType
- var HSourceFlag = this.hform.HSourceBillNo == '' ? false : true
- console.log(this.hform.HSourceBillNo, HSourceFlag)
- if (HDeleteFlag == "*") {
- if (sBarCode == "") {
- uni.showToast({
- title: '璇疯緭鍏ヨ鍒犻櫎鐨勬潯鐮�',
- icon: 'none'
- })
- } else {
- uni.request({
- url: this.serverUrl + '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
- data: {
- HInterID: this.hform.HInterID,
- HBillType: this.hform.HBillType,
- HBarCode: sBarCode
- },
- success: (res) => {
- console.log('鍒犻櫎鏉$爜', res.data);
- this.hform.HBarCode = ''
- if (res.data.count == 1) {
- this.hform.HQty = ''
- this.DisBillEntryList()
- } else {
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
- }
- } else {
- var sBarCode = this.hform.HBarCode
- if (sHQty == "") {
- sHQty = 0;
- }
- console.log("鍗曟嵁淇℃伅: ", this.hform)
- uni.request({
- url: this.serverUrl + '/WEBSController/get_CheckTypeByBarCode_BillCheck_Json',
- data: {
- sBarCode: sBarCode,
- HBillID: this.hform.HInterID || 0,
- HBillType: this.hform.HBillType,
- HBillNo: this.hform.HBillNo,
- HMaker: this.hform.HMaker,
- HWhID: sHWHID,
- HSPID: sHSPID,
- HQty: sHQty,
- // HRedBlueFlag: this.hform.HRedBlueFlag,
- // SourceFlag: HSourceFlag,
- // HSourceBillNo: sSourceBillNo,
- // HSourceBillType: sSourceBillType,
- HStockOrgID: this.hform.HStockOrgID,
- // HScanStyle: "",
- // HCustom1: "",
- // HCustom2: ""
- },
- success: (res) => {
- console.log('鎵爜杩斿洖', res.data);
- // this.hform.HBarCode = ''
- if (res.data.count == 1) {
- CommonUtils.playSound(1);
- var data = res.data.data
- if (data.hBarTypeField == '浠撳簱鏉$爜') {
- this.hform.HWHName = data.hWhNameField
- this.hform.HWHID = data.hWhIDField
- this.hform.HStockPlaceName = ''
- this.hform.HStockPlaceID = 0
- // if (data.hSPFlagField == 0) {
- // this.showHStockPlaceName = false
- // } else {
- // this.showHStockPlaceName = true
- // }
- } else if (data.hBarTypeField == '浠撲綅鏉$爜') {
- this.hform.HWHName = data.hWhNameField
- this.hform.HWHID = data.hWhIDField
- this.hform.HStockPlaceName = data.hSPNameField
- this.hform.HStockPlaceID = data.hSPIDField
- } else if (data.hBarTypeField == '閮ㄩ棬鏉$爜') {
- this.hform.HDeptName = data.hDeptNameField
- this.hform.HDeptID = data.hDeptIDField
- this.tabs = 1
- } else if (data.hBarTypeField == '婧愬崟鏉$爜') {
- this.hform.HSupName = data.hSupNameField
- this.hform.HSupID = data.hSupIDField
- if (data.hDeptIDField != 0) {
- this.hform.HDeptID = data.hDeptIDField
- this.hform.HDeptName = data.hDeptNameField
- }
- this.hform.HSourceBillNo = data.hSourceBillNoField
- //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
- if (data.hSourceBillTypeField == "1103") {
- this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
- this.hform.HMainSourceBillType = 1103
- this.showHMainSourceBillType = false
- } else if (data.hSourceBillTypeField == "1102") {
- this.HMainSourceBillType = '閲囪喘璁㈠崟'
- this.hform.HMainSourceBillType = 1102
- this.showHMainSourceBillType = false
- } else {
- this.HMainSourceBillType = '鎵嬪伐褰曞叆'
- this.hform.HMainSourceBillType = -1
- this.showHMainSourceBillType = false
- }
- if (data.hMulSourceFlagField == 0) {
- this.showHSourceBillNo = false
- }
- //渚涘簲鍟嗕笉鍙紪杈�
- this.showHSupName = false
- this.tabs = 2
- } else { //鐗╂枡鏉$爜
- this.tabs = 2
- if (!this.hform.HSourceBillNo) {
- this.hform.HSupName = data.hSupNameField
- this.hform.HSupID = data.hSupIDField
- this.hform.HSourceBillNo = data.hSourceBillNoField
- if (data.hDeptIDField != 0) {
- this.hform.HDeptID = data.hDeptIDField
- this.hform.HDeptName = data.hDeptNameField
- }
- console.log(data)
- //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- if (data.hSourceBillTypeField == "1103") {
- this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
- this.hform.HMainSourceBillType = 1103
- this.showHMainSourceBillType = false
- } else if (data.hSourceBillTypeField == "1102") {
- this.HMainSourceBillType = '閲囪喘璁㈠崟'
- this.hform.HMainSourceBillType = 1102
- this.showHMainSourceBillType = false
- } else {
- this.HMainSourceBillType = '鎵嬪伐褰曞叆'
- this.hform.HMainSourceBillType = -1
- this.showHMainSourceBillType = false
- }
- if (data.hMulSourceFlagField == 0) {
- this.showHSourceBillNo = false
- }
- //渚涘簲鍟嗕笉鍙紪杈�
- this.showHSupName = false
- }
- }
- //鏄剧ず琛ㄤ綋鏄庣粏
- this.DisBillEntryList()
- //娓呯┖鏁伴噺
- this.hform.HQty = ''
- } else {
- CommonUtils.playSound(0);
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- }
-
- this.refreshHBarCodeFocus()
- },
- fail: (res) => {
- CommonUtils.playSound(0);
- console.log(res);
- this.refreshHBarCodeFocus()
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
- }
+ //鎵潯鐮佸鐞�
+ async getCode(HBarCode) {
+ if (HBarCode == undefined || HBarCode == "") {
+ return
+ }
+ //浠撳簱銆佷粨浣嶆枃鏈涓虹┖鏃讹紝娓呯┖瀵瑰簲ID
+ if (!this.hform.HWHName) {
+ this.hform.HWHID = 0
+ }
+ if (!this.hform.HStockPlaceName) {
+ this.hform.HStockPlaceID = 0
+ }
+ var sOldBarCode = HBarCode
+ var HDeleteFlag = sOldBarCode.substring(0, 1);
+ var sBarCode = sOldBarCode.slice(1);
+
+ var sHWHID = this.hform.HWHID
+ var sHSPID = this.hform.HStockPlaceID
+ var sHQty = this.hform.HQty
+ var sSourceBillNo = this.hform.HSourceBillNo
+ var sSourceBillType = this.hform.HMainSourceBillType
+ var HSourceFlag = this.hform.HSourceBillNo == '' ? false : true
+ console.log(this.hform.HSourceBillNo, HSourceFlag)
+ if (HDeleteFlag == "*") {
+ if (sBarCode == "") {
+ uni.showToast({
+ title: '璇疯緭鍏ヨ鍒犻櫎鐨勬潯鐮�',
+ icon: 'none'
+ })
+ } else {
+ try {
+
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBarCode: sBarCode
+ },
+ })
+
+ if (!res) {
+ // 璇锋眰琚攣瀹氾紝閫�鍑哄綋鍓嶈姹�
+ return
+ }
+
+ console.log('鍒犻櫎鏉$爜', res.data);
+ this.hform.HBarCode = ''
+ if (res.data.count == 1) {
+ this.hform.HQty = ''
+ this.DisBillEntryList()
+ } else {
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+
+ } catch (e) {
+ CommonUtils.playSound(0)
+ this.refreshHBillNoFocus()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl +
+ // '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ // data: {
+ // HInterID: this.hform.HInterID,
+ // HBillType: this.hform.HBillType,
+ // HBarCode: sBarCode
+ // },
+ // success: (res) => {
+ // console.log('鍒犻櫎鏉$爜', res.data);
+ // this.hform.HBarCode = ''
+ // if (res.data.count == 1) {
+ // this.hform.HQty = ''
+ // this.DisBillEntryList()
+ // } else {
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
+ }
+ } else {
+ var sBarCode = this.hform.HBarCode
+ if (sHQty == "") {
+ sHQty = 0;
+ }
+
+ try {
+
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/get_CheckTypeByBarCode_BillCheck_Json',
+ data: {
+ sBarCode: sBarCode,
+ HBillID: this.hform.HInterID || 0,
+ HBillType: this.hform.HBillType,
+ HBillNo: this.hform.HBillNo,
+ HMaker: this.hform.HMaker,
+ HWhID: sHWHID,
+ HSPID: sHSPID,
+ HQty: sHQty,
+ // HRedBlueFlag: this.hform.HRedBlueFlag,
+ // SourceFlag: HSourceFlag,
+ // HSourceBillNo: sSourceBillNo,
+ // HSourceBillType: sSourceBillType,
+ HStockOrgID: this.hform.HStockOrgID,
+ // HScanStyle: "",
+ // HCustom1: "",
+ // HCustom2: ""
+ },
+ })
+
+ if (!res) {
+ return
+ }
+
+ console.log('鎵爜杩斿洖', res.data);
+ this.hform.HBarCode = ''
+ if (res.data.count == 1) {
+ CommonUtils.playSound(1);
+ var data = res.data.data
+ if (data.hBarTypeField == '浠撳簱鏉$爜') {
+ this.hform.HWHName = data.hWhNameField
+ this.hform.HWHID = data.hWhIDField
+ this.hform.HStockPlaceName = ''
+ this.hform.HStockPlaceID = 0
+ if (data.hSPFlagField == 0) {
+ this.showHStockPlaceName = false
+ } else {
+ this.showHStockPlaceName = true
+ }
+ } else if (data.hBarTypeField == '浠撲綅鏉$爜') {
+ this.hform.HWHName = data.hWhNameField
+ this.hform.HWHID = data.hWhIDField
+ this.hform.HStockPlaceName = data.hSPNameField
+ this.hform.HStockPlaceID = data.hSPIDField
+ } else if (data.hBarTypeField == '閮ㄩ棬鏉$爜') {
+ this.hform.HDeptName = data.hDeptNameField
+ this.hform.HDeptID = data.hDeptIDField
+ this.tabs = 1
+ } else if (data.hBarTypeField == '婧愬崟鏉$爜') {
+ this.hform.HSupName = data.hSupNameField
+ this.hform.HSupID = data.hSupIDField
+ if (data.hDeptIDField != 0) {
+ this.hform.HDeptID = data.hDeptIDField
+ this.hform.HDeptName = data.hDeptNameField
+ }
+ this.hform.HSourceBillNo = data.hSourceBillNoField
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ if (data.hSourceBillTypeField == "1103") {
+ this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+ this.hform.HMainSourceBillType = 1103
+ this.showHMainSourceBillType = false
+ } else if (data.hSourceBillTypeField == "1102") {
+ this.HMainSourceBillType = '閲囪喘璁㈠崟'
+ this.hform.HMainSourceBillType = 1102
+ this.showHMainSourceBillType = false
+ } else {
+ this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+ this.hform.HMainSourceBillType = -1
+ this.showHMainSourceBillType = false
+ }
+ if (data.hMulSourceFlagField == 0) {
+ this.showHSourceBillNo = false
+ }
+ //渚涘簲鍟嗕笉鍙紪杈�
+ this.showHSupName = false
+ this.tabs = 2
+ } else { //鐗╂枡鏉$爜
+ this.tabs = 2
+ console.log('data', data)
+ if (!this.hform.HSourceBillNo) {
+ this.hform.HSupName = data.hSupNameField
+ this.hform.HSupID = data.hSupIDField
+ this.hform.HSourceBillNo = data.hSourceBillNoField
+ if (data.hDeptIDField != 0) {
+ this.hform.HDeptID = data.hDeptIDField
+ this.hform.HDeptName = data.hDeptNameField
+ }
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ if (data.hSourceBillTypeField == "1103") {
+ this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+ this.hform.HMainSourceBillType = 1103
+ this.showHMainSourceBillType = false
+ } else if (data.hSourceBillTypeField == "1102") {
+ this.HMainSourceBillType = '閲囪喘璁㈠崟'
+ this.hform.HMainSourceBillType = 1102
+ this.showHMainSourceBillType = false
+ } else {
+ this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+ this.hform.HMainSourceBillType = -1
+ this.showHMainSourceBillType = false
+ }
+ if (data.hMulSourceFlagField == 0) {
+ this.showHSourceBillNo = false
+ }
+ //渚涘簲鍟嗕笉鍙紪杈�
+ this.showHSupName = false
+ }
+ }
+ //鏄剧ず琛ㄤ綋鏄庣粏
+ this.DisBillEntryList()
+ //娓呯┖鏁伴噺
+ this.hform.HQty = ''
+ } else {
+ CommonUtils.playSound(0);
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+
+ this.refreshHBarCodeFocus()
+
+ } catch (e) {
+ CommonUtils.playSound(0)
+ this.refreshHBillNoFocus()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/get_CheckTypeByBarCode_BillCheck_Json',
+ // data: {
+ // sBarCode: sBarCode,
+ // HBillID: this.hform.HInterID || 0,
+ // HBillType: this.hform.HBillType,
+ // HBillNo: this.hform.HBillNo,
+ // HMaker: this.hform.HMaker,
+ // HWhID: sHWHID,
+ // HSPID: sHSPID,
+ // HQty: sHQty,
+ // // HRedBlueFlag: this.hform.HRedBlueFlag,
+ // // SourceFlag: HSourceFlag,
+ // // HSourceBillNo: sSourceBillNo,
+ // // HSourceBillType: sSourceBillType,
+ // HStockOrgID: this.hform.HStockOrgID,
+ // // HScanStyle: "",
+ // // HCustom1: "",
+ // // HCustom2: ""
+ // },
+ // success: (res) => {
+ // console.log('鎵爜杩斿洖', res.data);
+ // this.hform.HBarCode = ''
+ // if (res.data.count == 1) {
+ // CommonUtils.playSound(1);
+ // var data = res.data.data
+ // if (data.hBarTypeField == '浠撳簱鏉$爜') {
+ // this.hform.HWHName = data.hWhNameField
+ // this.hform.HWHID = data.hWhIDField
+ // this.hform.HStockPlaceName = ''
+ // this.hform.HStockPlaceID = 0
+ // if (data.hSPFlagField == 0) {
+ // this.showHStockPlaceName = false
+ // } else {
+ // this.showHStockPlaceName = true
+ // }
+ // } else if (data.hBarTypeField == '浠撲綅鏉$爜') {
+ // this.hform.HWHName = data.hWhNameField
+ // this.hform.HWHID = data.hWhIDField
+ // this.hform.HStockPlaceName = data.hSPNameField
+ // this.hform.HStockPlaceID = data.hSPIDField
+ // } else if (data.hBarTypeField == '閮ㄩ棬鏉$爜') {
+ // this.hform.HDeptName = data.hDeptNameField
+ // this.hform.HDeptID = data.hDeptIDField
+ // this.tabs = 1
+ // } else if (data.hBarTypeField == '婧愬崟鏉$爜') {
+ // this.hform.HSupName = data.hSupNameField
+ // this.hform.HSupID = data.hSupIDField
+ // if (data.hDeptIDField != 0) {
+ // this.hform.HDeptID = data.hDeptIDField
+ // this.hform.HDeptName = data.hDeptNameField
+ // }
+ // this.hform.HSourceBillNo = data.hSourceBillNoField
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ // if (data.hSourceBillTypeField == "1103") {
+ // this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+ // this.hform.HMainSourceBillType = 1103
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "1102") {
+ // this.HMainSourceBillType = '閲囪喘璁㈠崟'
+ // this.hform.HMainSourceBillType = 1102
+ // this.showHMainSourceBillType = false
+ // } else {
+ // this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+ // this.hform.HMainSourceBillType = -1
+ // this.showHMainSourceBillType = false
+ // }
+ // if (data.hMulSourceFlagField == 0) {
+ // this.showHSourceBillNo = false
+ // }
+ // //渚涘簲鍟嗕笉鍙紪杈�
+ // this.showHSupName = false
+ // this.tabs = 2
+ // } else { //鐗╂枡鏉$爜
+ // this.tabs = 2
+ // console.log('data', data)
+ // if (!this.hform.HSourceBillNo) {
+ // this.hform.HSupName = data.hSupNameField
+ // this.hform.HSupID = data.hSupIDField
+ // this.hform.HSourceBillNo = data.hSourceBillNoField
+ // if (data.hDeptIDField != 0) {
+ // this.hform.HDeptID = data.hDeptIDField
+ // this.hform.HDeptName = data.hDeptNameField
+ // }
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // if (data.hSourceBillTypeField == "1103") {
+ // this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+ // this.hform.HMainSourceBillType = 1103
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "1102") {
+ // this.HMainSourceBillType = '閲囪喘璁㈠崟'
+ // this.hform.HMainSourceBillType = 1102
+ // this.showHMainSourceBillType = false
+ // } else {
+ // this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+ // this.hform.HMainSourceBillType = -1
+ // this.showHMainSourceBillType = false
+ // }
+ // if (data.hMulSourceFlagField == 0) {
+ // this.showHSourceBillNo = false
+ // }
+ // //渚涘簲鍟嗕笉鍙紪杈�
+ // this.showHSupName = false
+ // }
+ // }
+ // //鏄剧ず琛ㄤ綋鏄庣粏
+ // this.DisBillEntryList()
+ // //娓呯┖鏁伴噺
+ // this.hform.HQty = ''
+ // } else {
+ // CommonUtils.playSound(0);
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ //
+ // this.refreshHBarCodeFocus()
+ // },
+ // fail: (res) => {
+ // CommonUtils.playSound(0);
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ //
+ // this.refreshHBarCodeFocus()
+ // },
+ // });
+ }
},
//鐗╂枡淇℃伅
DisBillEntryList() {
@@ -736,91 +967,179 @@
}
});
},
- submit() {
- if (this.hform.HInterID == 0 || !this.hform.HInterID) {
- uni.showToast({
- title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忓崟鎹潯鐮侊紒',
- icon: 'none'
- })
- } else if (!this.hform.HBillNo) {
- uni.showToast({
- title: '鍗曟嵁鍙疯幏鍙栧け璐ワ紝閿欒鐨勫崟鎹彿锛�',
- icon: 'none'
- })
- } else if (!this.Materlist || this.Materlist.length == 0) {
- uni.showToast({
- title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忔潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
- icon: 'none'
- })
- } else {
- var s = 0;
- for (var i = 0; i < this.Materlist.length; i++) {
- if (this.Materlist[i].鏁伴噺 > 0) {
- s = 1;
- }
- }
- if (s == 0) {
- uni.showToast({
- title: '娌℃湁鎵弿鐗╂枡鏉$爜锛岃鍏堟壂鎻忕墿鏂欐潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
- icon: 'none'
- })
- } else {
- uni.showLoading({
- title: '璇风◢鍊�'
- })
- var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SavePOStockInBill_BillCheck_Json',
- method: 'POST',
- dataType: "json",
- data: {
- oMain: sMainStr
- },
- success: (res) => {
- console.log(1, res);
- uni.hideLoading()
- if (res.data.count == 1) {
- uni.showModal({
- title: '鎻愮ず',
- content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
- success: (res) => {
- if (res.confirm) {
- console.log('鐢ㄦ埛鐐瑰嚮纭畾');
- uni.redirectTo({
- url: '/pages/caigourukujiaoyan/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- setTimeout(() => {
- uni.navigateBack();
- }, 50)
- }
- }
- });
- } else {
- // uni.showToast({
- // title: res.data.Message,
- // icon: 'none'
- // })
-
- uni.showModal({
- title: '娓╅Θ鎻愮ず',
- content: res.data.Message,
- showCancel: false
- })
- }
- },
- fail: (res) => {
- console.log(res);
- uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
- icon: 'none'
- })
- },
- });
- }
- }
- },
+ async submit() {
+ if (this.hform.HInterID == 0 || !this.hform.HInterID) {
+ uni.showToast({
+ title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忓崟鎹潯鐮侊紒',
+ icon: 'none'
+ })
+ } else if (!this.hform.HBillNo) {
+ uni.showToast({
+ title: '鍗曟嵁鍙疯幏鍙栧け璐ワ紝閿欒鐨勫崟鎹彿锛�',
+ icon: 'none'
+ })
+ } else if (!this.Materlist || this.Materlist.length == 0) {
+ uni.showToast({
+ title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忔潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
+ icon: 'none'
+ })
+ } else {
+ var s = 0;
+ for (var i = 0; i < this.Materlist.length; i++) {
+ if (this.Materlist[i].鏁伴噺 > 0) {
+ s = 1;
+ }
+ }
+ // if (s == 0) {
+ // uni.showToast({
+ // title: '娌℃湁鎵弿鐗╂枡鏉$爜锛岃鍏堟壂鎻忕墿鏂欐潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
+ // icon: 'none'
+ // })
+ // } else
+ {
+ uni.showLoading({
+ title: '璇风◢鍊�'
+ })
+ var sMainStr = JSON.stringify(this.hform);
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SavePOStockInBill_BillCheck_Json',
+ method: 'POST',
+ data: {
+ oMain: sMainStr
+ },
+ })
+
+ if(!res) {
+ return
+ }
+
+ console.log(1, res);
+ uni.hideLoading()
+ if (res.data.count == 1) {
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: '/pages/caigourukujiaoyan/form?OperationType=1'
+ })
+ } else if (res.cancel) {
+ console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ setTimeout(() => {
+ uni.navigateBack();
+ }, 50)
+ }
+ }
+ });
+ } else {
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+
+ } catch (e) {
+ CommonUtils.playSound(0)
+ this.refreshHBillNoFocus()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+ icon: 'none'
+ })
+ }
+
+
+
+ }
+ }
+ },
+ // submit() {
+ // if (this.hform.HInterID == 0 || !this.hform.HInterID) {
+ // uni.showToast({
+ // title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忓崟鎹潯鐮侊紒',
+ // icon: 'none'
+ // })
+ // } else if (!this.hform.HBillNo) {
+ // uni.showToast({
+ // title: '鍗曟嵁鍙疯幏鍙栧け璐ワ紝閿欒鐨勫崟鎹彿锛�',
+ // icon: 'none'
+ // })
+ // } else if (!this.Materlist || this.Materlist.length == 0) {
+ // uni.showToast({
+ // title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忔潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
+ // icon: 'none'
+ // })
+ // } else {
+ // var s = 0;
+ // for (var i = 0; i < this.Materlist.length; i++) {
+ // if (this.Materlist[i].鏁伴噺 > 0) {
+ // s = 1;
+ // }
+ // }
+ // if (s == 0) {
+ // uni.showToast({
+ // title: '娌℃湁鎵弿鐗╂枡鏉$爜锛岃鍏堟壂鎻忕墿鏂欐潯鐮侊紝纭鏃犺鍚庡啀鎻愪氦锛�',
+ // icon: 'none'
+ // })
+ // } else {
+ // uni.showLoading({
+ // title: '璇风◢鍊�'
+ // })
+ // var sMainStr = JSON.stringify(this.hform);
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/set_SavePOStockInBill_BillCheck_Json',
+ // method: 'POST',
+ // dataType: "json",
+ // data: {
+ // oMain: sMainStr
+ // },
+ // success: (res) => {
+ // console.log(1, res);
+ // uni.hideLoading()
+ // if (res.data.count == 1) {
+ // uni.showModal({
+ // title: '鎻愮ず',
+ // content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
+ // success: (res) => {
+ // if (res.confirm) {
+ // console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ // uni.redirectTo({
+ // url: '/pages/caigourukujiaoyan/form?OperationType=1'
+ // })
+ // } else if (res.cancel) {
+ // console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ // setTimeout(() => {
+ // uni.navigateBack();
+ // }, 50)
+ // }
+ // }
+ // });
+ // } else {
+ // // uni.showToast({
+ // // title: res.data.Message,
+ // // icon: 'none'
+ // // })
+ //
+ // uni.showModal({
+ // title: '娓╅Θ鎻愮ず',
+ // content: res.data.Message,
+ // showCancel: false
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
+ // }
+ // }
+ // },
goBack() {
uni.showModal({
diff --git a/pages/caigoutuiliao/form.vue b/pages/caigoutuiliao/form.vue
index 4661135..2689f62 100644
--- a/pages/caigoutuiliao/form.vue
+++ b/pages/caigoutuiliao/form.vue
@@ -244,7 +244,9 @@
<button class="btn-c" size="mini" @tap="goBack">閫�鍑�</button>
</view>
</view>
- <BillListPopupVue ref="billList" :HBillType="hform.HBillType" :HSourceBillType="hform.HMainSourceBillType"
+ <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>
<BarCodePopupVue ref="barcodePopup"></BarCodePopupVue>
</view>
@@ -262,11 +264,14 @@
} from '../../utils/userRelationManager';
import BillListPopupVue from '../../components/BillListPopup/BillListPopup.vue';
import BarCodePopupVue from "../../components/BarCodePopup/BarCodePopup.vue";
+ import BillSelectPopupXiaoWeiVue from '../../components/BillSelectPopupXiaoWei/BillSelectPopupXiaoWei.vue';
export default {
components: {
BillListPopupVue,
- BarCodePopupVue
+ BarCodePopupVue,
+ BillSelectPopupXiaoWeiVue
},
+
data() {
return {
HSourceBillNoFocus: false,
@@ -355,6 +360,20 @@
}
},
computed: {
+ enableModule: {
+ get() {
+ if (this.hform.HMainSourceBillType == 1201 &&
+ /灏忓崼|鏅轰簯/.test(uni.getStorageSync('Organization'))
+ ) {
+
+ return 1
+ } else {
+ return 2
+ }
+ }
+
+ // 鍏朵粬鏉′欢
+ },
HStockPlaceNameListComputed: {
get() {
// 鍔ㄦ�佽绠楀搴斾粨搴撶殑浠撲綅
diff --git a/pages/chaituosaoma/form.vue b/pages/chaituosaoma/form.vue
index a7aa793..71e5cac 100644
--- a/pages/chaituosaoma/form.vue
+++ b/pages/chaituosaoma/form.vue
@@ -2,7 +2,7 @@
<view class="form">
<view class="form-base-info">
<view class="form-item">
- <view class="title">绠辨潯鐮�</view>
+ <view class="title">鎵樻潯鐮�</view>
<view class="right">
<input type="text" :focus="HBarCodePackFocus" v-model="HBarCode_Pack" @confirm="GetMeesageByBarCode_Pack(HBarCode_Pack)" />
</view>
@@ -80,7 +80,7 @@
</view>
</view>
<view class="bottom-btn" id="bottom-btn">
- <button :class="EnableSubmit?'btn-a':'btn-c'" :disabled="!EnableSubmit" size="mini" @tap="cmdSubmit">鎷嗙</button>
+ <button :class="EnableSubmit?'btn-a':'btn-c'" :disabled="!EnableSubmit" size="mini" @tap="cmdSubmit">鎷嗘墭</button>
<view style="flex: 1;"></view>
<!-- <button class="btn-d" size="mini" @tap="cmdDelete">鍒犻櫎</button> -->
<button class="btn-c" size="mini" @tap="cmdExit">閫�鍑�</button>
@@ -195,10 +195,10 @@
GetMeesageByBarCode_Pack(HBarCode_Pack) {
// 鑾峰彇鎵樻潯鐮佸搴旂殑鏁版嵁
CommonUtils.doRequest2({
- url: '/WEBSController/Get_PackBarCode_UnPackUnionBill_Json',
+ url: '/WEBSController/Get_PackBarCode_DeletePackUnionBill_Json',
data: {
-
- HBillSubType: this.HBillSubType,
+ HMaker: this.hform.HMaker,
+ HStockOrgID: this.hform.HStockOrgID,
HBarCode_Pack: HBarCode_Pack
},
resFunction: (res) => {
@@ -465,7 +465,7 @@
}
this.EnableSubmit = false
CommonUtils.doRequest2({
- url: '/WEBSController/set_SaveUnPackUnionBill_Json',
+ url: '/WEBSController/GetDeletePackUnionBill_Json',
data: {
"HInterID": this.hform.HInterID,
"HBillNo": this.hform.HBillNo,
diff --git a/pages/index/tab2.vue b/pages/index/tab2.vue
index d1f6d2d..ad9cd80 100644
--- a/pages/index/tab2.vue
+++ b/pages/index/tab2.vue
@@ -244,6 +244,12 @@
url: `/pages/shengchantuiliao/table`,
id: 33,
hidden: false,
+ },{
+ img: '../../static/icon/icon8.png',
+ text: '缁勮劚鍗曟殏瀛樺垪琛�',
+ url: `/pages/zutuosaoma/table`,
+ id: 34,
+ hidden: false,
}
// {
// img: '../../static/icon/icon8.png',
diff --git a/pages/shengchanlingliao/form.vue b/pages/shengchanlingliao/form.vue
index 34f2d26..22b41ce 100644
--- a/pages/shengchanlingliao/form.vue
+++ b/pages/shengchanlingliao/form.vue
@@ -5,7 +5,7 @@
<view class="title">鏉$爜:</view>
<view class="right" style="width: 380rpx;">
<input v-model="hform.HBarCode" :focus="HBarCodeFocus" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜"
- @blur="getCode(hform.HBarCode)" />
+ @blur="getCode(hform.HBarCode)" />
</view>
<uni-icons type="scan"
style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
@@ -46,7 +46,7 @@
<view class="title">鍗曟嵁鍙�:</view>
<view class="right" style="width: 380rpx;">
<input name="HBillNo" :focus="HBillNoFocus" v-model="hform.HBillNo" placeholder="璇锋壂鎻�(鎴栬緭鍏�)鏉$爜"
- @blur="GetMeesageByBillNo()" />
+ @blur="GetMeesageByBillNo()" />
</view>
<uni-icons type="scan"
style="margin-left: 10rpx;background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;"
@@ -393,55 +393,110 @@
})
},
//鎵弿鍗曟嵁鍙锋潯鐮�
- GetMeesageByBillNo(e) {
+ async GetMeesageByBillNo(e) {
if (this.hform.HBillNo == "" || this.hform.HBillNo == undefined) {
return
}
- uni.request({
- url: this.serverUrl + '/WEBSController/get_BillBarCode_BillCheck_Json',
- data: {
- HBillNo: this.hform.HBillNo,
- HBillType: this.hform.HBillType,
- HMaker: this.hform.HMaker,
- HStockOrgID: this.hform.HStockOrgID
- },
- success: (res) => {
- if (res.data.count == 1) {
- this.playSound(1)
- var data = res.data.data
- console.log(data)
- this.hform.HInterID = data.hInterIDField
- this.hform.HBillNo = data.hBillNoField
- this.showHBillNo = false
- //鏉$爜鏍稿鏍囪
- if (data.hSourceBarCodeFlagField) {
- this.hform.HSourceBarCodeCtl = "Y"
- this.hform.chkHBarflag = true
- this.hform.HBarflag = data
- }
- this.tabs = 2
- this.DisBillEntryList();
- this.refreshHBarCodeFocus()
- } else {
- this.playSound(0)
- this.refreshHBillNoFocus()
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- this.hform.HBillNo = ''
+
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/get_BillBarCode_BillCheck_Json',
+ data: {
+ HBillNo: this.hform.HBillNo,
+ HBillType: this.hform.HBillType,
+ HMaker: this.hform.HMaker,
+ HStockOrgID: this.hform.HStockOrgID
+ },
+ })
+
+ if (!res) {
+ // 瑙﹀彂璇锋眰閿侊紝涓嶈繑鍥炰换浣曞��
+ return
+ }
+
+ let {
+ data,
+ Message,
+ count
+ } = res.data
+ if (count == 1) {
+ this.playSound(1)
+ console.log(data)
+ this.hform.HInterID = data.hInterIDField
+ this.hform.HBillNo = data.hBillNoField
+ this.showHBillNo = false
+ //鏉$爜鏍稿鏍囪
+ if (data.hSourceBarCodeFlagField) {
+ this.hform.HSourceBarCodeCtl = "Y"
+ this.hform.chkHBarflag = true
+ this.hform.HBarflag = data
}
- },
- fail: (res) => {
- console.log(res);
+ this.tabs = 2
+ this.DisBillEntryList();
+ this.refreshHBarCodeFocus()
+ } else {
this.playSound(0)
this.refreshHBillNoFocus()
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: Message,
icon: 'none'
})
- },
- });
+ this.hform.HBillNo = ''
+ }
+
+ } catch (e) {
+ this.playSound(0)
+ this.refreshHBillNoFocus()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+ icon: 'none'
+ })
+ }
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/get_BillBarCode_BillCheck_Json',
+ // data: {
+ // HBillNo: this.hform.HBillNo,
+ // HBillType: this.hform.HBillType,
+ // HMaker: this.hform.HMaker,
+ // HStockOrgID: this.hform.HStockOrgID
+ // },
+ // success: (res) => {
+ // if (res.data.count == 1) {
+ // this.playSound(1)
+ // var data = res.data.data
+ // console.log(data)
+ // this.hform.HInterID = data.hInterIDField
+ // this.hform.HBillNo = data.hBillNoField
+ // this.showHBillNo = false
+ // //鏉$爜鏍稿鏍囪
+ // if (data.hSourceBarCodeFlagField) {
+ // this.hform.HSourceBarCodeCtl = "Y"
+ // this.hform.chkHBarflag = true
+ // this.hform.HBarflag = data
+ // }
+ // this.tabs = 2
+ // this.DisBillEntryList();
+ // this.refreshHBarCodeFocus()
+ // } else {
+ // this.playSound(0)
+ // this.refreshHBillNoFocus()
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // this.hform.HBillNo = ''
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // this.playSound(0)
+ // this.refreshHBillNoFocus()
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
},
//鍩虹浠撳簱璧勬枡
getHBaseList() {
@@ -528,7 +583,7 @@
}
},
//鎵潯鐮佸鐞�
- getCode(HBarCode) {
+ async getCode(HBarCode) {
if (HBarCode == undefined || HBarCode == "") {
return
}
@@ -557,95 +612,172 @@
icon: 'none'
})
} else {
- uni.request({
- url: this.serverUrl +
- '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
- data: {
- HInterID: this.hform.HInterID,
- HBillType: this.hform.HBillType,
- HBarCode: sBarCode
- },
- success: (res) => {
- console.log('鍒犻櫎鏉$爜', res.data);
- this.hform.HBarCode = ''
- if (res.data.count == 1) {
- this.hform.HQty = ''
- this.DisBillEntryList()
- } else {
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- console.log(res);
+ try {
+
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ data: {
+ HInterID: this.hform.HInterID,
+ HBillType: this.hform.HBillType,
+ HBarCode: sBarCode
+ },
+ })
+
+ if (!res) {
+ // 璇锋眰琚攣瀹氾紝閫�鍑哄綋鍓嶈姹�
+ return
+ }
+
+ console.log('鍒犻櫎鏉$爜', res.data);
+ this.hform.HBarCode = ''
+ if (res.data.count == 1) {
+ this.hform.HQty = ''
+ this.DisBillEntryList()
+ } else {
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
- },
- });
+ }
+
+ } catch (e) {
+ this.playSound(0)
+ this.refreshHBillNoFocus()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl +
+ // '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json',
+ // data: {
+ // HInterID: this.hform.HInterID,
+ // HBillType: this.hform.HBillType,
+ // HBarCode: sBarCode
+ // },
+ // success: (res) => {
+ // console.log('鍒犻櫎鏉$爜', res.data);
+ // this.hform.HBarCode = ''
+ // if (res.data.count == 1) {
+ // this.hform.HQty = ''
+ // this.DisBillEntryList()
+ // } else {
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
} else {
var sBarCode = this.hform.HBarCode
if (sHQty == "") {
sHQty = 0;
}
- uni.request({
- url: this.serverUrl + '/WEBSController/get_CheckTypeByBarCode_BillCheck_Json',
- data: {
- sBarCode: sBarCode,
- HBillID: this.hform.HInterID || 0,
- HBillType: this.hform.HBillType,
- HBillNo: this.hform.HBillNo,
- HMaker: this.hform.HMaker,
- HWhID: sHWHID,
- HSPID: sHSPID,
- HQty: sHQty,
- // HRedBlueFlag: this.hform.HRedBlueFlag,
- // SourceFlag: HSourceFlag,
- // HSourceBillNo: sSourceBillNo,
- // HSourceBillType: sSourceBillType,
- HStockOrgID: this.hform.HStockOrgID,
- // HScanStyle: "",
- // HCustom1: "",
- // HCustom2: ""
- },
- success: (res) => {
- console.log('鎵爜杩斿洖', res.data);
- this.hform.HBarCode = ''
- if (res.data.count == 1) {
- CommonUtils.playSound(1);
- var data = res.data.data
- if (data.hBarTypeField == '浠撳簱鏉$爜') {
- this.hform.HWHName = data.hWhNameField
- this.hform.HWHID = data.hWhIDField
- this.hform.HStockPlaceName = ''
- this.hform.HStockPlaceID = 0
- if (data.hSPFlagField == 0) {
- this.showHStockPlaceName = false
- } else {
- this.showHStockPlaceName = true
- }
- } else if (data.hBarTypeField == '浠撲綅鏉$爜') {
- this.hform.HWHName = data.hWhNameField
- this.hform.HWHID = data.hWhIDField
- this.hform.HStockPlaceName = data.hSPNameField
- this.hform.HStockPlaceID = data.hSPIDField
- } else if (data.hBarTypeField == '閮ㄩ棬鏉$爜') {
- this.hform.HDeptName = data.hDeptNameField
+
+ try {
+
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/get_CheckTypeByBarCode_BillCheck_Json',
+ data: {
+ sBarCode: sBarCode,
+ HBillID: this.hform.HInterID || 0,
+ HBillType: this.hform.HBillType,
+ HBillNo: this.hform.HBillNo,
+ HMaker: this.hform.HMaker,
+ HWhID: sHWHID,
+ HSPID: sHSPID,
+ HQty: sHQty,
+ // HRedBlueFlag: this.hform.HRedBlueFlag,
+ // SourceFlag: HSourceFlag,
+ // HSourceBillNo: sSourceBillNo,
+ // HSourceBillType: sSourceBillType,
+ HStockOrgID: this.hform.HStockOrgID,
+ // HScanStyle: "",
+ // HCustom1: "",
+ // HCustom2: ""
+ },
+ })
+
+ if (!res) {
+ return
+ }
+
+ console.log('鎵爜杩斿洖', res.data);
+ this.hform.HBarCode = ''
+ if (res.data.count == 1) {
+ CommonUtils.playSound(1);
+ var data = res.data.data
+ if (data.hBarTypeField == '浠撳簱鏉$爜') {
+ this.hform.HWHName = data.hWhNameField
+ this.hform.HWHID = data.hWhIDField
+ this.hform.HStockPlaceName = ''
+ this.hform.HStockPlaceID = 0
+ if (data.hSPFlagField == 0) {
+ this.showHStockPlaceName = false
+ } else {
+ this.showHStockPlaceName = true
+ }
+ } else if (data.hBarTypeField == '浠撲綅鏉$爜') {
+ this.hform.HWHName = data.hWhNameField
+ this.hform.HWHID = data.hWhIDField
+ this.hform.HStockPlaceName = data.hSPNameField
+ this.hform.HStockPlaceID = data.hSPIDField
+ } else if (data.hBarTypeField == '閮ㄩ棬鏉$爜') {
+ this.hform.HDeptName = data.hDeptNameField
+ this.hform.HDeptID = data.hDeptIDField
+ this.tabs = 1
+ } else if (data.hBarTypeField == '婧愬崟鏉$爜') {
+ this.hform.HSupName = data.hSupNameField
+ this.hform.HSupID = data.hSupIDField
+ if (data.hDeptIDField != 0) {
this.hform.HDeptID = data.hDeptIDField
- this.tabs = 1
- } else if (data.hBarTypeField == '婧愬崟鏉$爜') {
+ this.hform.HDeptName = data.hDeptNameField
+ }
+ this.hform.HSourceBillNo = data.hSourceBillNoField
+ //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ if (data.hSourceBillTypeField == "1103") {
+ this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+ this.hform.HMainSourceBillType = 1103
+ this.showHMainSourceBillType = false
+ } else if (data.hSourceBillTypeField == "1102") {
+ this.HMainSourceBillType = '閲囪喘璁㈠崟'
+ this.hform.HMainSourceBillType = 1102
+ this.showHMainSourceBillType = false
+ } else {
+ this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+ this.hform.HMainSourceBillType = -1
+ this.showHMainSourceBillType = false
+ }
+ if (data.hMulSourceFlagField == 0) {
+ this.showHSourceBillNo = false
+ }
+ //渚涘簲鍟嗕笉鍙紪杈�
+ this.showHSupName = false
+ this.tabs = 2
+ } else { //鐗╂枡鏉$爜
+ this.tabs = 2
+ console.log('data', data)
+ if (!this.hform.HSourceBillNo) {
this.hform.HSupName = data.hSupNameField
this.hform.HSupID = data.hSupIDField
+ this.hform.HSourceBillNo = data.hSourceBillNoField
if (data.hDeptIDField != 0) {
this.hform.HDeptID = data.hDeptIDField
this.hform.HDeptName = data.hDeptNameField
}
- this.hform.HSourceBillNo = data.hSourceBillNoField
//鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ this.hform.HMainSourceBillType = data.hSourceBillTypeField
if (data.hSourceBillTypeField == "1103") {
this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
this.hform.HMainSourceBillType = 1103
@@ -664,65 +796,162 @@
}
//渚涘簲鍟嗕笉鍙紪杈�
this.showHSupName = false
- this.tabs = 2
- } else { //鐗╂枡鏉$爜
- this.tabs = 2
- console.log('data', data)
- if (!this.hform.HSourceBillNo) {
- this.hform.HSupName = data.hSupNameField
- this.hform.HSupID = data.hSupIDField
- this.hform.HSourceBillNo = data.hSourceBillNoField
- if (data.hDeptIDField != 0) {
- this.hform.HDeptID = data.hDeptIDField
- this.hform.HDeptName = data.hDeptNameField
- }
- //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
- this.hform.HMainSourceBillType = data.hSourceBillTypeField
- if (data.hSourceBillTypeField == "1103") {
- this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
- this.hform.HMainSourceBillType = 1103
- this.showHMainSourceBillType = false
- } else if (data.hSourceBillTypeField == "1102") {
- this.HMainSourceBillType = '閲囪喘璁㈠崟'
- this.hform.HMainSourceBillType = 1102
- this.showHMainSourceBillType = false
- } else {
- this.HMainSourceBillType = '鎵嬪伐褰曞叆'
- this.hform.HMainSourceBillType = -1
- this.showHMainSourceBillType = false
- }
- if (data.hMulSourceFlagField == 0) {
- this.showHSourceBillNo = false
- }
- //渚涘簲鍟嗕笉鍙紪杈�
- this.showHSupName = false
- }
}
- //鏄剧ず琛ㄤ綋鏄庣粏
- this.DisBillEntryList()
- //娓呯┖鏁伴噺
- this.hform.HQty = ''
- } else {
- CommonUtils.playSound(0);
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
}
-
- this.refreshHBarCodeFocus()
- },
- fail: (res) => {
- CommonUtils.playSound(0);
- console.log(res);
+ //鏄剧ず琛ㄤ綋鏄庣粏
+ this.DisBillEntryList()
+ //娓呯┖鏁伴噺
+ this.hform.HQty = ''
+ } else {
+ CommonUtils.playSound(0);
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
+ }
- this.refreshHBarCodeFocus()
- },
- });
+ this.refreshHBarCodeFocus()
+
+ } catch (e) {
+ this.playSound(0)
+ this.refreshHBillNoFocus()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+ icon: 'none'
+ })
+ }
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/get_CheckTypeByBarCode_BillCheck_Json',
+ // data: {
+ // sBarCode: sBarCode,
+ // HBillID: this.hform.HInterID || 0,
+ // HBillType: this.hform.HBillType,
+ // HBillNo: this.hform.HBillNo,
+ // HMaker: this.hform.HMaker,
+ // HWhID: sHWHID,
+ // HSPID: sHSPID,
+ // HQty: sHQty,
+ // // HRedBlueFlag: this.hform.HRedBlueFlag,
+ // // SourceFlag: HSourceFlag,
+ // // HSourceBillNo: sSourceBillNo,
+ // // HSourceBillType: sSourceBillType,
+ // HStockOrgID: this.hform.HStockOrgID,
+ // // HScanStyle: "",
+ // // HCustom1: "",
+ // // HCustom2: ""
+ // },
+ // success: (res) => {
+ // console.log('鎵爜杩斿洖', res.data);
+ // this.hform.HBarCode = ''
+ // if (res.data.count == 1) {
+ // CommonUtils.playSound(1);
+ // var data = res.data.data
+ // if (data.hBarTypeField == '浠撳簱鏉$爜') {
+ // this.hform.HWHName = data.hWhNameField
+ // this.hform.HWHID = data.hWhIDField
+ // this.hform.HStockPlaceName = ''
+ // this.hform.HStockPlaceID = 0
+ // if (data.hSPFlagField == 0) {
+ // this.showHStockPlaceName = false
+ // } else {
+ // this.showHStockPlaceName = true
+ // }
+ // } else if (data.hBarTypeField == '浠撲綅鏉$爜') {
+ // this.hform.HWHName = data.hWhNameField
+ // this.hform.HWHID = data.hWhIDField
+ // this.hform.HStockPlaceName = data.hSPNameField
+ // this.hform.HStockPlaceID = data.hSPIDField
+ // } else if (data.hBarTypeField == '閮ㄩ棬鏉$爜') {
+ // this.hform.HDeptName = data.hDeptNameField
+ // this.hform.HDeptID = data.hDeptIDField
+ // this.tabs = 1
+ // } else if (data.hBarTypeField == '婧愬崟鏉$爜') {
+ // this.hform.HSupName = data.hSupNameField
+ // this.hform.HSupID = data.hSupIDField
+ // if (data.hDeptIDField != 0) {
+ // this.hform.HDeptID = data.hDeptIDField
+ // this.hform.HDeptName = data.hDeptNameField
+ // }
+ // this.hform.HSourceBillNo = data.hSourceBillNoField
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ // if (data.hSourceBillTypeField == "1103") {
+ // this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+ // this.hform.HMainSourceBillType = 1103
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "1102") {
+ // this.HMainSourceBillType = '閲囪喘璁㈠崟'
+ // this.hform.HMainSourceBillType = 1102
+ // this.showHMainSourceBillType = false
+ // } else {
+ // this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+ // this.hform.HMainSourceBillType = -1
+ // this.showHMainSourceBillType = false
+ // }
+ // if (data.hMulSourceFlagField == 0) {
+ // this.showHSourceBillNo = false
+ // }
+ // //渚涘簲鍟嗕笉鍙紪杈�
+ // this.showHSupName = false
+ // this.tabs = 2
+ // } else { //鐗╂枡鏉$爜
+ // this.tabs = 2
+ // console.log('data', data)
+ // if (!this.hform.HSourceBillNo) {
+ // this.hform.HSupName = data.hSupNameField
+ // this.hform.HSupID = data.hSupIDField
+ // this.hform.HSourceBillNo = data.hSourceBillNoField
+ // if (data.hDeptIDField != 0) {
+ // this.hform.HDeptID = data.hDeptIDField
+ // this.hform.HDeptName = data.hDeptNameField
+ // }
+ // //鑾峰彇婧愬崟绫诲瀷銆佹簮鍗曞崟鍙�
+ // this.hform.HMainSourceBillType = data.hSourceBillTypeField
+ // if (data.hSourceBillTypeField == "1103") {
+ // this.HMainSourceBillType = '鏀舵枡閫氱煡鍗�'
+ // this.hform.HMainSourceBillType = 1103
+ // this.showHMainSourceBillType = false
+ // } else if (data.hSourceBillTypeField == "1102") {
+ // this.HMainSourceBillType = '閲囪喘璁㈠崟'
+ // this.hform.HMainSourceBillType = 1102
+ // this.showHMainSourceBillType = false
+ // } else {
+ // this.HMainSourceBillType = '鎵嬪伐褰曞叆'
+ // this.hform.HMainSourceBillType = -1
+ // this.showHMainSourceBillType = false
+ // }
+ // if (data.hMulSourceFlagField == 0) {
+ // this.showHSourceBillNo = false
+ // }
+ // //渚涘簲鍟嗕笉鍙紪杈�
+ // this.showHSupName = false
+ // }
+ // }
+ // //鏄剧ず琛ㄤ綋鏄庣粏
+ // this.DisBillEntryList()
+ // //娓呯┖鏁伴噺
+ // this.hform.HQty = ''
+ // } else {
+ // CommonUtils.playSound(0);
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ //
+ // this.refreshHBarCodeFocus()
+ // },
+ // fail: (res) => {
+ // CommonUtils.playSound(0);
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ //
+ // this.refreshHBarCodeFocus()
+ // },
+ // });
}
},
//鐗╂枡淇℃伅
@@ -821,7 +1050,7 @@
url: '/pages/shengchanlingliao/form?OperationType=1'
})
},
- submit() {
+ async submit() {
if (this.hform.HInterID == 0 || !this.hform.HInterID) {
uni.showToast({
title: '娌℃湁鎵爜淇℃伅锛岃鍏堟壂鎻忓崟鎹潯鐮侊紒',
@@ -855,49 +1084,99 @@
title: '璇风◢鍊�'
})
var sMainStr = JSON.stringify(this.hform);
- uni.request({
- url: this.serverUrl + '/WEBSController/set_SaveMateOutBill_BillCheck_Json',
- method: 'POST',
- dataType: "json",
- data: {
- oMain: sMainStr
- },
- success: (res) => {
- console.log(1, res);
- uni.hideLoading()
- if (res.data.count == 1) {
- uni.showModal({
- title: '鎻愮ず',
- content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
- success: (res) => {
- if (res.confirm) {
- console.log('鐢ㄦ埛鐐瑰嚮纭畾');
- uni.redirectTo({
- url: '/pages/shengchanlingliao/form?OperationType=1'
- })
- } else if (res.cancel) {
- console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
- setTimeout(() => {
- uni.navigateBack();
- }, 50)
- }
+ try {
+ let res = await CommonUtils.doRequest2Sync({
+ url: '/WEBSController/set_SaveMateOutBill_BillCheck_Json',
+ method: 'POST',
+ data: {
+ oMain: sMainStr
+ },
+ })
+
+ if(!res) {
+ return
+ }
+
+ console.log(1, res);
+ uni.hideLoading()
+ if (res.data.count == 1) {
+ uni.showModal({
+ title: '鎻愮ず',
+ content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.redirectTo({
+ url: '/pages/shengchanlingliao/form?OperationType=1'
+ })
+ } else if (res.cancel) {
+ console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ setTimeout(() => {
+ uni.navigateBack();
+ }, 50)
}
- });
- } else {
- uni.showToast({
- title: res.data.Message,
- icon: 'none'
- })
- }
- },
- fail: (res) => {
- console.log(res);
+ }
+ });
+ } else {
uni.showToast({
- title: '鎺ュ彛璇锋眰澶辫触',
+ title: res.data.Message,
icon: 'none'
})
- },
- });
+ }
+
+ } catch (e) {
+ this.playSound(0)
+ this.refreshHBillNoFocus()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触: ' + e,
+ icon: 'none'
+ })
+ }
+
+
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/set_SaveMateOutBill_BillCheck_Json',
+ // method: 'POST',
+ // dataType: "json",
+ // data: {
+ // oMain: sMainStr
+ // },
+ // success: (res) => {
+ // console.log(1, res);
+ // uni.hideLoading()
+ // if (res.data.count == 1) {
+ // uni.showModal({
+ // title: '鎻愮ず',
+ // content: res.data.Message + '銆傛槸鍚︾户缁柊澧烇紵(鐐瑰嚮鍙栨秷杩斿洖涓婄骇椤甸潰)',
+ // success: (res) => {
+ // if (res.confirm) {
+ // console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ // uni.redirectTo({
+ // url: '/pages/shengchanlingliao/form?OperationType=1'
+ // })
+ // } else if (res.cancel) {
+ // console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ // setTimeout(() => {
+ // uni.navigateBack();
+ // }, 50)
+ // }
+ // }
+ // });
+ // } else {
+ // uni.showToast({
+ // title: res.data.Message,
+ // icon: 'none'
+ // })
+ // }
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // uni.showToast({
+ // title: '鎺ュ彛璇锋眰澶辫触',
+ // icon: 'none'
+ // })
+ // },
+ // });
}
}
},
diff --git a/pages/tiaomaguanli/table.vue b/pages/tiaomaguanli/table.vue
index 19cbe10..bc6d403 100644
--- a/pages/tiaomaguanli/table.vue
+++ b/pages/tiaomaguanli/table.vue
@@ -146,6 +146,13 @@
console.log('鎵爜杩斿洖', res.data.data);
this.HBarCode = ''
if (res.data.count == 1) {
+ if(res.data.data.length < 1) {
+ this.playSound(0)
+ return uni.showToast({
+ title: '璇ュ崟鎹彿瀵瑰簲鐨勫崟鎹笉瀛樺湪!',
+ icon: 'none'
+ })
+ }
this.playSound(1)
var data = res.data.data
this.baseInfo = {
diff --git a/pages/zutuosaoma/form.vue b/pages/zutuosaoma/form.vue
index 75c0471..be0f767 100644
--- a/pages/zutuosaoma/form.vue
+++ b/pages/zutuosaoma/form.vue
@@ -80,6 +80,14 @@
</view>
</view>
</view>
+ <view class="bill-info">
+ <checkbox-group @change="checkboxGroupChangeHandler">
+ <view class="form-item" style="justify-content: right;">
+ <view class="title">璐ㄩ噺瀹℃壒</view>
+ <checkbox value="qualityApproval"></checkbox>
+ </view>
+ </checkbox-group>
+ </view>
</view>
<view class="bottom-btn" id="bottom-btn">
<button :class="EnableSubmit?'btn-a':'btn-c'" :disabled="!EnableSubmit" size="mini" @tap="cmdSubmit">鎻愪氦</button>
@@ -173,6 +181,8 @@
HInterID: '',
HStockOrgName: uni.getStorageSync("Organization"),
HStockOrgID: uni.getStorageSync("OrganizationID"),
+
+ HQualityApproval: false,
},
// 鍒嗛〉妯″潡鍏冩暟鎹�
paginationMeta: {
@@ -181,6 +191,14 @@
}
},
methods: {
+ checkboxGroupChangeHandler(e) {
+ let checkBoxValues = Array.from(e.detail.value)
+ if(checkBoxValues.findIndex(elem => elem == 'qualityApproval') != -1) {
+ this.hform.HQualityApproval = true
+ }else {
+ this.hform.HQualityApproval = false
+ }
+ },
onTableRowClickHandler(row, index) {
console.log('row: ',row);
if(!this.listData[index].checked){
@@ -210,13 +228,14 @@
GetMeesageByBarCode_Pack(HBarCode_Pack) {
// 鑾峰彇鎵樻潯鐮佸搴旂殑鏁版嵁
CommonUtils.doRequest2({
- url: '/WEBSController/Get_PackBarCode_PackUnionBill_New_Json',
+ url: '/WEBSController/Get_PackBarCode_PackUnionBill_Json',
data: {
- HInterID: this.hform.HInterID,
+ HInterID: this.hform.HInterID || 0,
HBillNo: this.hform.HBillNo,
HBillType: this.HBillType,
- HBillSubType: this.HBillSubType,
- HBarCode_Pack: HBarCode_Pack
+ HBarCode_Pack: HBarCode_Pack,
+ HMaker: getUserInfo()['Czymc'],
+ HStockOrgID: uni.getStorageSync('OrganizationID')
},
resFunction: (res) => {
let {
@@ -253,7 +272,7 @@
})
},
GetMeesageByBarCode(HBarCode) {
- // 鑾峰彇鍖呮潯鐮佸搴旂殑鏁版嵁
+ // 鑾峰彇寰呯粍鎵樻潯鐮佸搴旂殑鏁版嵁
let HBarCode_Pack = this.HBarCode_Pack
let sOldBarCode = this.HBarCode
let HDeleteFlag = sOldBarCode.substring(0, 1)
@@ -261,7 +280,7 @@
if (!HBarCode_Pack) {
return uni.showToast({
icon: 'none',
- title: '鎵樻潯鐮佷负绌猴紝璇峰厛鎵弿鎵樻潯鐮�',
+ title: '鎵樻潯鐮佷笉鑳戒负绌猴紝璇峰厛鎵弿鎵樻潯鐮侊紒',
})
}
@@ -269,7 +288,7 @@
if (!sBarCode) {
return uni.showToast({
icon: 'none',
- title: '璇锋壂鎻忚鍒犻櫎鐨勭鏉$爜',
+ title: '璇锋壂鎻忚鍒犻櫎鐨勬潯鐮�',
})
} else {
this.HBarCodeFocusRefresh()
@@ -304,19 +323,17 @@
if (!sBarCode) {
return uni.showToast({
icon: 'none',
- title: '绠辨潯鐮佷笉鑳戒负绌猴紝璇锋壂鎻忕鏉$爜',
+ title: '鏉$爜涓嶈兘涓虹┖锛岃鎵弿鏉$爜锛�',
})
}
CommonUtils.doRequest2({
- url: '/WEBSController/Get_BarCode_PackUnionBill_New_Json',
+ url: '/WEBSController/Get_BarCode_PackUnionBill_Json',
data: {
"HInterID": this.hform.HInterID,
"HBarCode": sBarCode,
"HBillType": this.HBillType,
"HBillNo": this.hform.HBillNo,
- "HBillSubType": this.HBillSubType,
"HBarCode_Pack": HBarCode_Pack,
- "HMaterNumber_Pack": this.HMaterNumber_Pack,
"HMaker": this.hform.HMaker,
"HStockOrgID": this.hform.HStockOrgID
},
@@ -565,14 +582,14 @@
// 1涓� 瑁呯 2涓� 缁勬墭
this.BarCodeType = e.BarCodeType || 1
this.OperationType = e.OperationType || 1
- this.HBarCode_Pack_Temp = e.CommonUtils || ""
+ this.HBarCode_Pack = e.HBarCode_Pack_Temp || ""
if (this.OperationType == 1) {
this.getMaxNo()
} else if (this.OperationType == 2) {
- this.GetMeesageByBarCode_Pack()
+ this.GetMeesageByBarCode_Pack(this.HBarCode_Pack)
this.DisBillEntryList()
- this.tabs = 1
+ this.tabs = 0
}
diff --git a/pages/zutuosaoma/table.vue b/pages/zutuosaoma/table.vue
index f62f9e6..93586ec 100644
--- a/pages/zutuosaoma/table.vue
+++ b/pages/zutuosaoma/table.vue
@@ -1,28 +1,517 @@
<template>
- <view>
-
+ <view class="content">
+ <view class="tabs">
+ <view :class="tabs == 0 ? 'on':''" @tap="changeTab(0)">缂撳瓨鍒楄〃</view>
+ </view>
+
+ <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
+
+ <view class="form" v-if="tabs == 0">
+ <view class="buttons" @tap="add">
+ <uni-icons type="plus" style="margin-right: 10rpx;" size="22"></uni-icons>鏂板
+ </view>
+ </view>
+
+ <view style="width: 100%;height: 16rpx;background-color: #e5e5e5;"></view>
+
+ <view class="list" v-for="(item,index) in showList" :key="index" v-if="tabs==0">
+ <uni-card :title="item.鍒跺崟鏃ユ湡.substr(0,10)" :extra="item.鍗曟嵁鍙�" style="margin: 10px;"
+ @tap="showDetail = showDetail==index?-1:index">
+ <view class="card-detail">
+ <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.鍒跺崟鏃ユ湡.split('T')[0] }}
+ </view>
+ <view class="detail" v-if="item.缁勭粐">
+ <text>缁勭粐锛�</text>{{item.缁勭粐}}
+ </view>
+ </view>
+
+ <view class="more">
+ <view class="part" style="border-right: 1px solid #eee;color: #3a78ff;" @tap.stop="edit(item)">
+ <uni-icons type="compose" style="color: #3a78ff;margin-right: 10rpx;" size="18"></uni-icons>缂栬緫
+ </view>
+ <view class="part" style="color: #da0000;" @tap.stop="del(item)">
+ <uni-icons type="trash" style="color: #da0000;margin-right: 10rpx;" size="18"></uni-icons>鍒犻櫎
+ </view>
+ </view>
+ </uni-card>
+ </view>
+ <view class="list" v-for="(item,index) in showList" :key="index" v-if="tabs==1">
+ <uni-card :title="item.鏃ユ湡" :extra="item.鍗曟嵁鍙�" style="margin: 10px;"
+ @tap="showDetail = showDetail==index?-1:index">
+ <view class="card-detail">
+ <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" v-if="item.婧愬崟鍗曞彿">
+ <text>婧愬崟鍗曞彿锛�</text>{{item.婧愬崟鍗曞彿}}
+ </view>
+ <view class="detail" v-if="item.鐗╂枡浠g爜">
+ <text>鐗╂枡浠g爜锛�</text>{{item.鐗╂枡浠g爜}}
+ </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>
+
+ <view class="more">
+ <view class="part" style="color: #3a78ff;width: 100%;" @tap.stop="qrCodeDisplay(item)">
+ <uni-icons type="scan" style="color: #3a78ff;margin-right: 10rpx;" size="18"></uni-icons>鏄剧ず浜岀淮鐮�
+ </view>
+ <view class="part" style="color: #d98d00;width: 100%;" @tap.stop="revoke(item)">
+ <uni-icons type="undo" style="color: #d98d00;margin-right: 10rpx;" size="18"></uni-icons>鎾ら攢
+ </view>
+ </view>
+ </uni-card>
+ </view>
+
+ <view class="over" v-if="!listData || listData.length == 0">鏆傛棤鏁版嵁</view>
+ <view class="over" v-if="listData.length != 0 && listData.length != showList.length">鍔犺浇涓�...</view>
+ <view class="over" v-if="listData.length != 0 && listData.length == showList.length">宸插埌搴�</view>
+ <BarCodePopupVue ref="barcodePopup"></BarCodePopupVue>
</view>
</template>
<script>
+ import dayjs from "dayjs";
import {
getUserInfo
} from "@/utils/auth.js";
- import {
- CommonUtils
- } from "@/utils/common.js"
+ import BarCodePopupVue from "../../components/BarCodePopup/BarCodePopup.vue";
export default {
data() {
return {
-
+ userInfo: getUserInfo(),
+ serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
+ tabs: 0,
+ urls: '/WEBSController/GetKf_PonderationBillMain_TempList_New_Json',
+ MvarReportTitle: '鐢熶骇棰嗘枡鍗曠紦瀛樺垪琛�',
+ hform: {
+ HBillNo: '',
+ HSourceBillNo: '',
+ HBillType: 3783,
+ HMaker: uni.getStorageSync('HUserName'),
+ HStockOrgID: uni.getStorageSync('OrganizationID'),
+ },
+ sWhere: '',
+ listData: [],
+ showList: [],
+ showDetail: -1,
+
+ page: 1,
}
},
+ components: {
+ BarCodePopupVue
+ },
+ onShow() {
+ //鐢ㄦ埛妯″潡鏉冮檺鍒ゆ柇
+ this.CheckModRight()
+ this.changeTab(0)
+ console.log(this.userInfo, uni.getStorageSync('HUserName'))
+ },
+ onReachBottom: function() {
+ this.page++
+ setTimeout(() => {
+ this.showList = this.showList.concat(this.getPage(this.page, this.listData))
+ }, 100)
+ },
+ onPullDownRefresh: function() {
+ this.clear()
+ setTimeout(() => {
+ uni.stopPullDownRefresh();
+ }, 1000);
+ },
methods: {
-
+ async qrCodeDisplay(item) {
+ this.$refs.barcodePopup.setCodeInfo(item.HBillNo)
+ await this.$nextTick()
+ this.$refs.barcodePopup.open()
+ },
+ CheckModRight() {
+ uni.request({
+ url: this.serverUrl + '/WEBSController/CheckModRight_Json',
+ data: {
+ ModRightName: 'CE_PackUnion',
+ HUserName: uni.getStorageSync('HUserName')
+ },
+ success: (res) => {
+ if (res.data.count == 1) {} else {
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ },
+ fail: (res) => {
+ console.log(res);
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触',
+ icon: 'none'
+ })
+ },
+ });
+ },
+ getPage(page, list) {
+ let sindex = (parseInt(page) - 1) * 20
+ let eindex = parseInt(page) * 20
+ let newList = list.slice(sindex, eindex)
+ return newList
+ },
+ changeTab(e) {
+ this.tabs = e
+ this.page = 1
+ this.showList = []
+
+ if (this.tabs == 0) {
+ this.urls = '/WEBSController/GetSc_PackUnionBill_TempList_Json'
+ }
+ // if(this.tabs == 1){
+ // this.urls = '/WEBSController/GetKf_ICStockBillQueryList_User_Json'
+ // }
+ this.getList()
+ },
+ getList() {
+ uni.showLoading({
+ title: '鍔犺浇涓�...'
+ })
+ uni.request({
+ url: this.serverUrl + this.urls,
+ data: this.hform,
+ success: (res) => {
+ console.log(1, res);
+ if (res.data.count == 1) {
+ this.listData = res.data.data
+ this.showList = this.getPage(this.page, this.listData)
+ setTimeout(() => {
+ uni.hideLoading()
+ }, 1000)
+ } else {
+ uni.hideLoading()
+ this.listData = []
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ }
+ },
+ fail: (res) => {
+ console.log(res);
+ uni.hideLoading()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触',
+ icon: 'none'
+ })
+ },
+ });
+ },
+ search() {
+ this.sWhere = ''
+ this.listData = []
+ this.page = 1
+ this.showList = []
+
+ console.log(this.hform)
+ // if (this.hform.HBillNo) {
+ // this.sWhere += " and 鍗曟嵁鍙� like '%" + this.hform.HBillNo + "%'";
+ // }
+ // if (this.hform.HSourceBillNo) {
+ // this.sWhere += " and 璁惧绫诲瀷 like '%" + this.hform.HSourceBillNo + "%'";
+ // }
+ this.getList()
+ },
+ clear() {
+ this.listData = []
+ this.page = 1
+ this.showList = []
+
+ this.sWhere = ''
+ this.hform = {
+ HBillNo: '',
+ HSourceBillNo: '',
+ HBillType: 3783,
+ HMaker: uni.getStorageSync('HUserName'),
+ HStockOrgID: uni.getStorageSync('OrganizationID'),
+ }
+ this.getList()
+ },
+ add() {
+ uni.navigateTo({
+ url: './form?OperationType=1'
+ })
+ },
+ //缂栬緫
+ edit(item) {
+ console.log(item)
+ // uni.request({
+ // url: this.serverUrl + '/WEBSController/TempList_Modify_Json',
+ // data:{ "HInterID": item.HInterID, "HBillNo": item.鍗曟嵁鍙�, "HBillType": this.hform.HBillType },
+ // success: (res) => {
+ // console.log(1,res);
+ // if(res.data.count == 1){
+ uni.navigateTo({
+ url: './form?OperationType=2&HBarCode_Pack_Temp=' + item["HBarCode_Pack"],
+ })
+ // }else{
+ // uni.showToast({
+ // title:res.data.Message,
+ // icon:'none'
+ // })
+ // }
+
+ // },
+ // fail: (res) => {
+ // console.log(res);
+ // uni.hideLoading()
+ // uni.showToast({
+ // title:'鎺ュ彛璇锋眰澶辫触',
+ // icon:'none'
+ // })
+ // },
+ // })
+ },
+ //鍒犻櫎
+ del(item) {
+ // console.log(item.hmainid,uni.getStorageSync('HUserName'))
+ uni.showModal({
+ title: '鎻愮ず',
+ content: '纭瑕佸垹闄よ褰曪紵鍒犻櫎鍚庝笉鑳芥仮澶�',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.request({
+ url: this.serverUrl +
+ '/WEBSController/DeleteTemp_PackUnionBill_Json',
+ data: {
+ HInterID: item.HInterID,
+ // HBillNo: item.鍗曟嵁鍙�,
+ // HBillType: this.hform.HBillType,
+ // HMaker: uni.getStorageSync('HUserName'),
+ // MvarReportTitle: this.MvarReportTitle,
+ },
+ success: (res) => {
+ console.log(1, res);
+ if (res.data.count == 1) {
+ this.clear()
+ }
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ },
+ fail: (res) => {
+ console.log(res);
+ uni.hideLoading()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触',
+ icon: 'none'
+ })
+ },
+ });
+ } else if (res.cancel) {
+ console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ }
+ }
+ });
+ },
+ //鎾ら攢
+ revoke(item) {
+ // console.log(item.hmainid,uni.getStorageSync('HUserName'))
+ uni.showModal({
+ title: '鎻愮ず',
+ content: '鏄惁纭鎾ら攢',
+ success: (res) => {
+ if (res.confirm) {
+ console.log('鐢ㄦ埛鐐瑰嚮纭畾');
+ uni.request({
+ url: this.serverUrl +
+ '/WEBSController/set_DeleteICStockBillAndWMS_Json',
+ data: {
+ HInterID: item.HInterID,
+ HBillNo: item.鍗曟嵁鍙�,
+ HBillType: this.hform.HBillType,
+ HMaker: uni.getStorageSync('HUserName'),
+ MvarReportTitle: this.MvarReportTitle,
+ },
+ success: (res) => {
+ console.log(1, res);
+ if (res.data.count == 1) {
+ this.clear()
+ }
+ uni.showToast({
+ title: res.data.Message,
+ icon: 'none'
+ })
+ },
+ fail: (res) => {
+ console.log(res);
+ uni.hideLoading()
+ uni.showToast({
+ title: '鎺ュ彛璇锋眰澶辫触',
+ icon: 'none'
+ })
+ },
+ });
+ } else if (res.cancel) {
+ console.log('鐢ㄦ埛鐐瑰嚮鍙栨秷');
+ }
+ }
+ });
+ },
}
}
</script>
-<style>
+<style lang="scss" scoped>
+ .form {
+ width: 640rpx;
+ margin: 20rpx auto;
+ margin-top: 90rpx;
+ }
-</style>
+ .tabs {
+ width: 100%;
+ position: fixed;
+ left: 0;
+ z-index: 9;
+ display: flex;
+ background-color: #e5e5e5;
+
+ view {
+ width: 50%;
+ font-size: 30rpx;
+ color: #333;
+ text-align: center;
+ padding: 16rpx 0;
+ }
+
+ .on {
+ color: #3a78ff;
+ font-weight: bold;
+ border-bottom: 3px solid #3a78ff;
+ }
+ }
+
+ .buttons {
+ width: 100%;
+ display: flex;
+ justify-content: center;
+ margin-top: 20rpx;
+
+ button {
+ border-radius: 50rpx;
+ width: 180rpx;
+ height: 66rpx;
+ line-height: 66rpx;
+ font-size: 28rpx;
+ }
+
+ .btn-a {
+ background-color: #acacac;
+ color: #fff;
+ }
+
+ .btn-b {
+ background-color: #41a863;
+ color: #fff;
+ }
+
+ .btn-c {
+ background-color: #3a78ff;
+ color: #fff;
+ }
+ }
+
+ .form-item {
+ display: flex;
+ align-items: center;
+ font-size: 28rpx;
+ padding: 6rpx 0;
+
+ .title {
+ width: 180rpx;
+
+ text {
+ color: red;
+ font-weight: bold;
+ }
+ }
+
+ .right {
+ width: 450rpx;
+ border-radius: 22rpx;
+ border: 1px solid #acacac;
+ }
+
+ .righton {
+ width: 450rpx;
+ border-radius: 22rpx;
+ border: 1px solid #e4e4e4;
+ background-color: #e4e4e4;
+ }
+
+ input {
+ width: 100%;
+ padding: 8rpx 20rpx;
+ font-size: 30rpx;
+ }
+ }
+
+ .list {
+ width: 100%;
+
+ .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;
+
+ text {
+ color: #999;
+ font-size: 26rpx;
+ }
+ }
+ }
+
+ .more {
+ color: #888;
+ font-size: 26rpx;
+ display: flex;
+ border-top: 1px solid #eee;
+ padding-top: 20rpx;
+
+ .part {
+ width: 50%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+ }
+ }
+</style>
\ No newline at end of file
diff --git a/utils/common.js b/utils/common.js
index 47488ec..b70b133 100644
--- a/utils/common.js
+++ b/utils/common.js
@@ -1,19 +1,22 @@
class commonUtils {
serverUrl
-
+ audioContext // 鍏ㄥ眬闊抽瀹炰緥
+ requestLock // 璇锋眰鎺у埗閿�(鍚屾)
constructor() {
this.serverUrl = uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API/';
+ this.audioContext = null;
+ this.requestLock = false
}
setServerUrl(url) {
this.serverUrl = url
}
-
+
getServerUrl() {
return this.serverUrl
}
-
-
+
+
// 闃叉姈鍑芥暟
debounce(func, delay, immediate = false) {
@@ -245,60 +248,103 @@
}
})
}
-
- doRequest2({url, data, resFunction, errFunction,method, that}){
- that = that || this;
- let errorTip = null;
- uni.showLoading({
- title: '鍔犺浇涓�...'
- })
- uni.request({
- method: method || "GET",
- url: this.serverUrl + url,
- data: data || "",
- success: (res) => {
- if (typeof resFunction === 'function') {
- resFunction.call(that, res)
- } else if (typeof errFunction === 'undefined' || errFunction === null) {
- return
- } else {
- throw new TypeError("璁块棶鎴愬姛鍥炶皟鍑芥暟绫诲瀷涓嶄负鍑芥暟鎴栬�呯┖!")
- }
- },
- fail: (err) => {
- console.error(err)
- errorTip = () => {
- uni.showToast({
- icon: "none",
- title: err.errMsg || err.data.message || "鎺ュ彛寮傚父!",
- duration: 2000
- })
- }
- if (typeof errFunction === 'function') {
- errFunction.call(that, err)
- } else if (typeof errFunction === 'undefined' || errFunction === null) {
- return
- } else {
- throw new TypeError("璁块棶澶辫触鍥炶皟鍑芥暟绫诲瀷涓嶄负鍑芥暟鎴栬�呯┖!")
- }
-
- },
- complete: () => {
-
- setTimeout(() => {
- uni.hideLoading()
- if (errorTip != null) {
- errorTip()
- }
- }, 1000)
- }
- })
- }
-
- stringToBoolean(str) {
- // 蹇界暐澶у皬鍐欑殑杞崲
- return str?.toLowerCase() === "true";
- }
+
+ doRequest2({
+ url,
+ data,
+ resFunction,
+ errFunction,
+ method,
+ that
+ }) {
+ that = that || this;
+ let errorTip = null;
+ uni.showLoading({
+ title: '鍔犺浇涓�...'
+ })
+ uni.request({
+ method: method || "GET",
+ url: this.serverUrl + url,
+ data: data || "",
+ success: (res) => {
+ if (typeof resFunction === 'function') {
+ resFunction.call(that, res)
+ } else if (typeof errFunction === 'undefined' || errFunction === null) {
+ return
+ } else {
+ throw new TypeError("璁块棶鎴愬姛鍥炶皟鍑芥暟绫诲瀷涓嶄负鍑芥暟鎴栬�呯┖!")
+ }
+ },
+ fail: (err) => {
+ console.error(err)
+ errorTip = () => {
+ uni.showToast({
+ icon: "none",
+ title: err.errMsg || err.data.message || "鎺ュ彛寮傚父!",
+ duration: 2000
+ })
+ }
+ if (typeof errFunction === 'function') {
+ errFunction.call(that, err)
+ } else if (typeof errFunction === 'undefined' || errFunction === null) {
+ return
+ } else {
+ throw new TypeError("璁块棶澶辫触鍥炶皟鍑芥暟绫诲瀷涓嶄负鍑芥暟鎴栬�呯┖!")
+ }
+
+ },
+ complete: () => {
+
+ setTimeout(() => {
+ uni.hideLoading()
+ if (errorTip != null) {
+ errorTip()
+ }
+ }, 1000)
+ }
+ })
+ }
+
+ // 鍚屾鎵ц璇锋眰 (閰嶅悎await鎴栬�卼hen)
+ async doRequest2Sync({
+ url,
+ data,
+ method,
+ }) {
+ if(this.requestLock){
+ console.warn("璇ヨ姹傝閿佸畾锛屽凡閫�鍑鸿姹�!")
+ return
+ }
+
+ this.requestLock = true
+ return new Promise((resolve, reject) => {
+ // that = that || this;
+ let errorTip = null;
+ uni.showLoading({
+ title: '鍔犺浇涓�...'
+ })
+ uni.request({
+ method: method || "GET",
+ url: this.serverUrl + url,
+ data: data || "",
+ success: (res) => {
+ resolve(res)
+ },
+ fail: (err) => {
+ reject(err)
+ },
+ complete: () => {
+ // 閲婃斁璇锋眰閿�
+ this.requestLock = false
+ uni.hideLoading()
+ }
+ })
+ })
+ }
+ stringToBoolean(str) {
+ // 蹇界暐澶у皬鍐欑殑杞崲
+ return str?.toLowerCase() === "true";
+ }
// uni-app 鎾斁闊抽灏佽
playSound(e) {
@@ -309,25 +355,57 @@
innerAudioContext.src = '/static/jingbao.wav';
}
innerAudioContext.play(); // 鎾斁闊抽
-
- innerAudioContext.onPlay(() => {
- console.log('寮�濮嬫挱鏀�');
- });
- innerAudioContext.onError((res) => {
- console.log(res.errMsg);
- console.log(res.errCode);
- });
- innerAudioContext.onPause(function(){
- console.log('鎾斁鍑虹幇閿欒锛岄攢姣�');
- innerAudioContext.destroy();
- })
+
+ innerAudioContext.onPlay(() => {
+ console.log('寮�濮嬫挱鏀�');
+ });
+ innerAudioContext.onError((res) => {
+ console.log(res.errMsg);
+ console.log(res.errCode);
+ });
+ innerAudioContext.onPause(function() {
+ console.log('鎾斁鍑虹幇閿欒锛岄攢姣�');
+ innerAudioContext.destroy();
+ })
}
-
+ // playSound(e) {
+ // // 鍏ㄥ眬缁存姢涓�涓煶棰戝疄渚嬶紝闃叉缂撳瓨婧㈠嚭
+ // if (this.audioContext) {
+ // this.audioContext.destroy();
+ // }
+ // this.audioContext = uni.createInnerAudioContext();
+ // if (e == 1) {
+ // this.audioContext.src = '/static/success.wav';
+ // } else {
+ // this.audioContext.src = '/static/jingbao.wav';
+ // }
+ // this.audioContext.play(); // 鎾斁闊抽
+ //
+ // // 鎾斁缁撴潫鍚庨攢姣佸疄渚�
+ // this.audioContext.onEnded(() => {
+ // this.audioContext.destroy();
+ // this.audioContext = null;
+ // });
+ //
+ // // 閿欒澶勭悊
+ // this.audioContext.onError((err) => {
+ // uni.showToast({
+ // icon: 'none',
+ // title: `闊抽鎾斁閿欒: ${err}`
+ // })
+ //
+ // this.audioContext.destroy();
+ // this.audioContext = null;
+ // });
+ // }
+
+
+
replaceWithFunction(str, handler) {
- return str.replace(/\{(.+?)\}/g, (match, key) => {
- // 璋冪敤澶勭悊鍑芥暟锛屼紶鍏ュ尮閰嶅埌鐨勯敭
- return handler(key, match);
- });
+ return str.replace(/\{(.+?)\}/g, (match, key) => {
+ // 璋冪敤澶勭悊鍑芥暟锛屼紶鍏ュ尮閰嶅埌鐨勯敭
+ return handler(key, match);
+ });
}
}
--
Gitblit v1.9.1