Bläddra i källkod

修改码单打印接口顺序/销售出库交互优化

lph 1 år sedan
förälder
incheckning
fa981db14d

+ 23 - 6
zkqy-ui/src/views/orderMange/codeListManage/printIndex.vue

@@ -785,7 +785,12 @@ export default {
         this.initWebSocket();
       }
     },
-    initWebSocket() {
+    async initWebSocket() {
+      // let res = await this.addIsValidate();
+      // if (!res) {
+      //   this.$message.warning("请完善表单数据");
+      //   return;
+      // }
       const getConfigValue = (label, defaultValue) => {
         let value = this.dict.type.automatic_printing.find(
           (item) => item.label === label
@@ -892,7 +897,7 @@ export default {
     },
     // 开始设置新的重量
     async setWeight(weight) {
-      console.log("设置新的重量", weight);
+      // console.log("设置新的重量", weight);
       let newData = {};
       let {
         machineTool,
@@ -1173,9 +1178,22 @@ export default {
               ? JSON.parse(JSON.stringify(newData))
               : this.tableData[0];
             console.log(rowData);
+            let timeStemp = new Date().getTime();
             this.printTableData = [rowData];
+            this.printTableData[0].id = timeStemp;
+            // 先打印
+            this.changeGrossWeight(this.printTableData[0]);
+            // 后端打印
+            // await this.newPrintHandler();
+            // 前端打印
+            codeListPrint(this.printTableData, "printDom");
+            if (this.excuteType == 1) {
+              this.tableData.push(this.printTableData[0]);
+            }
+            // 后保存数据
             let payLoad = {
               ...this.form,
+              id: timeStemp, //前端生成id
               qrCodeId: rowData.qrCodeId,
               qrCode: rowData.qrCode,
               lotNum: rowData.lotNum,
@@ -1194,7 +1212,7 @@ export default {
             let tempApiFun = productCodeList;
             if (this.excuteType == 3 || this.excuteType == 2) {
               //补码||修改
-              this.printConfirmHandler(this.tableData[0].id);
+              // this.printConfirmHandler(this.tableData[0].id);
               return;
             }
             this.changeGrossWeight(payLoad);
@@ -1207,9 +1225,8 @@ export default {
               //   return;
               // }
               // this.tableData[0].id = res.data;
-              this.printTableData[0].id = res.data;
-              console.log("printConfirmHandler");
-              this.printConfirmHandler(res.data);
+              // this.printTableData[0].id = res.data;
+              // this.printConfirmHandler(res.data);
             } else {
               console.log(res);
               this.$message.error(`${msg}箱单失败`);

+ 22 - 2
zkqy-ui/src/views/orderMange/outStock/index.vue

@@ -2,14 +2,23 @@
   <el-card shadow="always" :body-style="{ padding: '10px' }">
     <div class="app-container">
       <div class="table-area">
+        <el-button
+          type="success"
+          size="small"
+          @click="handleRefresh"
+          :icon="loading ? 'el-icon-loading' : 'el-icon-refresh'"
+          :disabled="loading"
+          >刷新</el-button
+        >
+
         <el-table
           :data="leftTableData"
           border
           stripe
-          @selection-change="handleSelectionChange"
           @cell-click="cellClick"
+          highlight-current-row
         >
-          <el-table-column type="selection" width="55" />
+          <!-- <el-table-column type="selection" width="55" /> -->
           <el-table-column type="index" label="序号" width="50" />
           <el-table-column align="center" prop="customerName" label="客户名称">
           </el-table-column>
@@ -168,6 +177,7 @@ export default {
   components: {},
   data() {
     return {
+      loading: false,
       currentIndex: "",
       form: {
         noticeNumber: "", //通知单号
@@ -203,6 +213,13 @@ export default {
   },
   computed: {},
   methods: {
+    // 刷新回调
+    async handleRefresh() {
+      this.loading = true;
+      await this.initData();
+      await this.initWarehouse();
+      this.loading = false;
+    },
     // 左侧表格点击回调
     cellClick(row, column, cell, event) {
       this.currentIndex = this.leftTableData.findIndex(
@@ -389,4 +406,7 @@ export default {
     flex: 1;
   }
 }
+::v-deep .el-table__body tr.current-row > td.el-table__cell {
+  background-color: #55e905 !important;
+}
 </style>