Browse Source

fix: 称重打印优化

Hello小健 2 months ago
parent
commit
abbdbf0c23
2 changed files with 18 additions and 9 deletions
  1. 15 6
      pages/printer/index.vue
  2. 3 3
      unpackage/dist/cache/.vite/deps/_metadata.json

+ 15 - 6
pages/printer/index.vue

@@ -176,7 +176,7 @@
 		if (res.detail.value.length === 0) {
 			selectPrinter.value = 0;
 		} else {
-			selectPrinter.value = printers[0].value;
+			selectPrinter.value = printers.value[0].value;
 		}
 	}
 	const printConfirm = () => {
@@ -191,11 +191,11 @@
 				order_no: valiFormData.value.order_code,
 				printer_code: selectPrinter.value
 			},
-			success: (res) => {
+			success: (res:any) => {
 				subLoading.value = false;
 				console.log('打印成功', res);
 				messageType.value = 'success';
-				messageText.value = '打印成功';
+				messageText.value = res.data.msg;
 				messageRef.value.open();
 
 				const historyItem = {
@@ -254,9 +254,18 @@
 	}
 
 	const onsubmit = () => {
-		st && clearTimeout(st);
-		selectPrinter.value = sendToPeinter.value.length > 0 ? printers.value[0].value : 0;
-		printerDialog.value.open();
+		if (valiFormData.value.order_code) {
+			loading.value = true
+			st && clearTimeout(st);
+			selectPrinter.value = sendToPeinter.value.length > 0 ? printers.value[0].value : 0;
+			printerDialog.value.open();
+			loading.value = false
+		}else{
+			messageType.value = 'error';
+			messageText.value = '请填写运单号';
+			messageRef.value.open();
+		}
+	
 	};
 
 	const getHistory = () => {

+ 3 - 3
unpackage/dist/cache/.vite/deps/_metadata.json

@@ -1,8 +1,8 @@
 {
-  "hash": "dcd2c785",
-  "configHash": "942b9c46",
+  "hash": "adf7464e",
+  "configHash": "fd42d985",
   "lockfileHash": "e3b0c442",
-  "browserHash": "23c10dde",
+  "browserHash": "d1f8efbb",
   "optimized": {},
   "chunks": {}
 }