Jelajahi Sumber

修改码单管理的修改和补码逻辑

lph 1 tahun lalu
induk
melakukan
db14871b3e

+ 20 - 5
zkqy-ui/src/views/orderMange/codeListManage/index.vue

@@ -692,7 +692,7 @@
                 class="ml10"
                 type="primary"
                 size="mini"
-                :disabled="!currentRow.lotNum || isDisabled"
+                :disabled="!currentRow.lotNum || isDisabled || printAuto"
                 @click="addProductHandler"
                 >添加
               </el-button>
@@ -953,6 +953,10 @@ export default {
         console.log(event);
         const weight = JSON.parse(event.data).weight;
         this.nowWeight = weight;
+        if (!this.printAuto) {
+          // 手动打印直接退出
+          return;
+        }
         if (weight != 0) {
           //有效重量
           // if (this.nowWeight != weight) {
@@ -1046,7 +1050,6 @@ export default {
         remark,
         productId,
       };
-      // this.newPrintHandler(newData);
       this.getOrderData(newData);
     },
     // 校验是否可以新增
@@ -1109,8 +1112,17 @@ export default {
       try {
         let res = await AutoPrinting(payload);
         console.log(res);
+        if (res.code == 200 && res.status == "success") {
+          this.$message.success(res.msg);
+          if (this.excuteType == 1) {
+            this.tableData.push(printRow);
+          }
+        } else {
+          this.$message.error(res.msg);
+        }
       } catch (error) {
         console.log(error);
+        this.$message.error(error);
       }
     },
 
@@ -1178,7 +1190,9 @@ export default {
           try {
             let { sumBoxNum, sumCanisterNum, sumSuttle, sumGrossWeight } =
               this.count;
-            let rowData = JSON.parse(JSON.stringify(newData));
+            let rowData = newData.machineTool
+              ? JSON.parse(JSON.stringify(newData))
+              : this.tableData[0];
             console.log(rowData);
             this.printTableData = [rowData];
             let payLoad = {
@@ -1198,8 +1212,8 @@ export default {
               payLoad.id = rowData.id;
             }
             let tempApiFun = productCodeList;
-            if (this.excuteType == 3) {
-              //补码
+            if (this.excuteType == 3 || this.excuteType == 2) {
+              //补码||修改
               this.printConfirmHandler(this.tableData[0].id);
               return;
             }
@@ -1586,6 +1600,7 @@ export default {
       const id = row.id || this.ids;
       getPrintData(id).then(async (response) => {
         this.excuteType = 3; //补码
+        this.printAuto = false;
         this.form = response.data;
         this.tableData = [response.data] || [];
         await this.getAllBatchData(); //获取所有产品数据

+ 6 - 1
zkqy-ui/src/views/orderMange/index.vue

@@ -274,7 +274,12 @@
         </div>
       </el-dialog>
       <!-- 添加或修改销售出库单:- 过磅记录生成数据对话框 -->
-      <el-dialog :title="title" :visible.sync="open" append-to-body>
+      <el-dialog
+        :title="title"
+        width="1100px"
+        :visible.sync="open"
+        append-to-body
+      >
         <!-- <iframe
         :src="iframeUrl"
         width="100%"