From 6acdfc2c867d8fde898a4cc67bdefa2b97f03e3e Mon Sep 17 00:00:00 2001
From: 南骏 池 <chiffly@163.com>
Date: 星期三, 09 七月 2025 10:58:54 +0800
Subject: [PATCH] 1.条码入库前拆分优化 2.其他入库优化
---
H5/Js/PurchaseReturn.js | 124 +++++++++++++++++++++++++++++++----------
1 files changed, 93 insertions(+), 31 deletions(-)
diff --git a/H5/Js/PurchaseReturn.js b/H5/Js/PurchaseReturn.js
index d836ded..cf35b11 100644
--- a/H5/Js/PurchaseReturn.js
+++ b/H5/Js/PurchaseReturn.js
@@ -27,6 +27,12 @@
messageId: 0,
show: false,
+
+ scanInfo: { barcodeNum: "", splitNum: "", barcode: "" },
+ ip: "",
+ port: "",
+ oldBarInfo: [],
+ cfBarInfo: [],
}
},
mounted() {
@@ -55,12 +61,14 @@
that.show = true;
}
else {
+ that.$playSound('error');
that.$toast.fail(json.message);
}
that.isLoading = false;
})
.catch(function (error) {
that.isLoading = false;
+ that.$playSound('error');
that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
console.log(error);
});
@@ -78,12 +86,14 @@
that.itemOutNoList = json.data.tbBillList;
}
else {
+ that.$playSound('error');
that.$toast.fail(json.message);
}
that.isLoading = false;
})
.catch(function (error) {
that.isLoading = false;
+ that.$playSound('error');
that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
console.log(error);
});
@@ -104,33 +114,6 @@
this.getItem();
- //var that = this;
-
- //that.isLoading = true;
- //that.AxiosHttp("post", 'MesInvItemOuts/GetPage', {
- // billNo: this.scanFormData.itemOutNo,
- // pageIndex: 1,
- // limit: 1,
- //}, false)
- // .then(function (res) {
- // var json = res;
- // if (json.status == 0) {
- // that.formData = json.data.tbBillList[0];
- // that.formData.billTypeName = "鍑哄簱鍗�";
-
- // that.getScanBarcode();
- // }
- // else {
- // that.$toast.fail(json.message);
- // }
- // that.isLoading = false;
- // })
- // .catch(function (error) {
- // that.isLoading = false;
- // that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
- // console.log(error);
- // });
-
},
getItem() {
var that = this;
@@ -138,10 +121,10 @@
let itemOut = this.itemOutNoList.filter(it => it.billNo == that.scanFormData.itemOutNo);
- this.invItemOutId = itemOut[0].id;
+ //this.invItemOutId = itemOut[0].id;
that.AxiosHttp("post", 'MesCgthSq/GetSumItem', {
- id: that.invItemOutId,
+ //id: that.invItemOutId,
billNo: that.scanFormData.itemOutNo,
barcode: that.scanFormData.barcode,
}, false)
@@ -152,6 +135,7 @@
that.$refs.barcode.focus();
}
else {
+ that.$playSound('error');
that.$toast.fail(json.message);
that.ItemDetail = [];
}
@@ -159,6 +143,7 @@
})
.catch(function (error) {
that.isLoading = false;
+ that.$playSound('error');
that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
that.ItemDetail = [];
});
@@ -189,21 +174,98 @@
that.getItem();
that.$refs.barcode.focus();
that.scanFormData.barcode = null;
+ that.$playSound('success');
+ that.$notify({ type: 'success', message: json.message });
+ }
+ else if (json.status == 2) {
+ that.$refs.splitNum.focus();
+ that.scanInfo.splitNum = json.data.tbBillList.splitNum;
+ that.scanFormData.quantity = json.data.tbBillList.barcodeNum;
}
else {
+ that.$playSound('error');
that.$toast.fail(json.message);
that.$refs.barcode.focus();
that.scanFormData.barcode = null;
}
- that.$notify({ type: 'success', message: json.message });
that.isLoading = false;
})
.catch(function (error) {
that.isLoading = false;
+ that.$playSound('error');
that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
console.log(error);
that.$refs.barcode.focus();
});
- }
+ },
+ getChaiFen() {
+ //this.isPrinterPopupVisible = true; // 鏄剧ず寮圭獥
+
+ if (this.isLoading) {
+ return;
+ }
+
+ var that = this;
+ if (that.scanFormData.itemOutNo.length <= 0) {
+ that.$playSound('error');
+ that.$toast.fail("鐢宠鍗曞彿涓嶈兘涓虹┖锛�");
+ return;
+ }
+ if (that.scanInfo.splitNum * 1 <= 0) {
+ that.$playSound('error');
+ that.$toast.fail("鎷嗗垎鏁伴噺涓嶈兘涓虹┖锛�");
+ return;
+ }
+ if (that.scanFormData.barcode.length * 1 <= 0) {
+ that.$playSound('error');
+ that.$toast.fail("鐗╂枡鏉$爜涓嶈兘涓虹┖锛�");
+ return;
+ }
+ //that.ip = "";
+ //that.prot = "";
+ //that.getPrintInfo();
+
+ //if (that.ip.length <= 0 || that.prot.length <= 0) {
+ // alert(that.ip);
+ // alert(that.prot);
+ // return;
+ //}
+
+ that.isLoading = true;
+ that.AxiosHttp("post", 'MesCgthSq/ScanCodeCF', {
+ billNo: that.scanFormData.itemOutNo,
+ userName: that.userInfo.loginAccount,
+ barcode: that.scanFormData.barcode,
+ Num: that.scanInfo.splitNum,
+ }, false)
+ .then(function (res) {
+ var json = res;
+ if (json.status == 0) {
+ // that.modeInfo = json.data.tbBillList;
+ that.scanInfo.splitNum = null;
+ that.scanFormData.quantity = null;
+ that.scanFormData.barcode = null;
+ that.$notify({ type: 'success', message: json.message });
+ that.$playSound('success');
+ that.getItem();
+ //that.sendMessage(json.data.tbBillList);
+ that.sendPrintMessage(json.data.tbBillList);
+
+ that.$refs.barcode.focus();
+
+ }
+ else {
+ that.$playSound('error');
+ that.$toast.fail(json.message);
+ }
+ that.isLoading = false;
+ })
+ .catch(function (error) {
+ that.isLoading = false;
+
+ that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
+ that.$playSound('error');
+ });
+ },
}
})
\ No newline at end of file
--
Gitblit v1.9.3