Przeglądaj źródła

fix:销售出库部分优化

lph 1 rok temu
rodzic
commit
5b4074ff62

+ 12 - 2
zkqy-ui/src/views/orderMange/codeListManage/index.vue

@@ -417,7 +417,7 @@
               </div>
               <div class="count-item">
                 <div class="count-title">
-                  <span>合计筒:</span>
+                  <span>合计筒:</span>
                 </div>
                 <div class="count-value">
                   <span>{{ count.sumCanisterNum }}</span>
@@ -987,6 +987,11 @@ export default {
               payLoad.id = rowData.id;
             }
             let tempApiFun = productCodeList;
+            if (this.excuteType == 3) {
+              //补码
+              this.printConfirmHandler(this.tableData[0].id);
+              return;
+            }
             let res = await tempApiFun(payLoad);
             let msg = this.isEdit ? "编辑" : "新增";
             if (res.code == 200) {
@@ -1115,7 +1120,7 @@ export default {
           } = this.currentRow;
           let directionOfTwistLabel = this.dict.type.direction_of_twist.find(
             (item) => item.value == directionOfTwist
-          ).label;
+          )?.label;
           let res = await getQrCode();
           let qrCode = "";
           if (res.code == 200) {
@@ -1383,6 +1388,7 @@ export default {
     initProductData() {
       this.batchNum = this.form.lotNum;
       this.batchNumChange();
+      console.log(this.batchTableData);
       if (this.batchTableData.length) {
         let {
           machineTool,
@@ -1406,11 +1412,15 @@ export default {
           directionOfTwist,
           productId,
         } = this.batchTableData[0];
+        let directionOfTwistLabel = this.dict.type.direction_of_twist.find(
+          (item) => item.value == directionOfTwist
+        )?.label;
         Object.assign(this.tableData[0], {
           productName, //品种
           productSpecifications, //规格
           productColor, //色号
           directionOfTwist, //捻向
+          directionOfTwistLabel,
         });
       }
     },

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

@@ -219,11 +219,16 @@ export default {
       this.$refs.form.validate(async (valid) => {
         if (valid) {
           let payLoad = { ...this.form };
+          console.log(this.form);
+          if (!this.form.id) {
+            return;
+          }
           delete payLoad.documentTypeName;
           let res = await noticeOutStorage(payLoad);
           if (res.code == 200) {
             this.$message.success("出库成功");
-            this.initData();
+            this.currentIndex = 0;
+            await this.initData();
             this.refreshHandler();
           } else {
             this.$message.error(res.msg);
@@ -289,6 +294,23 @@ export default {
     // 加载表单数据
     async initFormData() {
       let { id, customerName } = this.leftTableData[this.currentIndex];
+      console.log(this.leftTableData[this.currentIndex]);
+      if (!id) {
+        //重置表单数据
+        Object.assign(this.form, {
+          noticeNumber: "", //通知单号
+          documentType: "", //通知单类型
+          documentTypeName: "", //通知单类型  名
+          salesman: "", //销售员
+          sellingUnit: "", //售货单位
+          truckRegistration: "", //货车信息
+          dispatchNoteRemark: "", //备注
+          customerName: "", //客户名称
+          id: "",
+        });
+        console.log(this.form);
+        return;
+      }
       try {
         let res = await saleStorageDetails(id);
         console.log(res);