瀏覽代碼

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-eom into dev

liujt 7 月之前
父節點
當前提交
184e60562c

+ 45 - 13
src/BIZComponents/inventoryTable.vue

@@ -107,7 +107,7 @@
           }"
         >
           <el-input
-            :disabled="!!row.productCode"
+            :disabled="!!row.productId && row.productId != 0"
             v-model="row.productName"
             placeholder="请输入"
             style="width: 60%; margin-right: 10px"
@@ -162,7 +162,13 @@
 
       <template v-slot:productCode="scope">
         <el-form-item :prop="'datasource.' + scope.$index + '.productCode'">
-          <el-input v-model="scope.row.productCode" :disabled="true"></el-input>
+          <el-input
+            v-model="scope.row.productCode"
+            :disabled="
+              quoteType != 2 ||
+              (!!scope.row.productId && scope.row.productId != 0)
+            "
+          ></el-input>
         </el-form-item>
       </template>
       <template v-slot:productCategoryName="scope">
@@ -189,7 +195,7 @@
         <el-form-item :prop="'datasource.' + scope.$index + '.productBrand'">
           <el-input
             v-model="scope.row.productBrand"
-            :disabled="!!scope.row.productCode"
+            :disabled="!!scope.row.productId && scope.row.productId != 0"
           ></el-input>
         </el-form-item>
       </template>
@@ -198,7 +204,7 @@
         <el-form-item :prop="'datasource.' + scope.$index + '.modelType'">
           <el-input
             v-model="scope.row.modelType"
-            :disabled="!!scope.row.productCode"
+            :disabled="!!scope.row.productId && scope.row.productId != 0"
           ></el-input>
         </el-form-item>
       </template>
@@ -206,7 +212,7 @@
         <el-form-item :prop="'datasource.' + scope.$index + '.specification'">
           <el-input
             v-model="scope.row.specification"
-            :disabled="!!scope.row.productCode"
+            :disabled="!!scope.row.productId && scope.row.productId != 0"
           ></el-input>
         </el-form-item>
       </template>
@@ -245,7 +251,7 @@
           </div>
         </div>
       </template>
-      <template v-slot:measuringUnit="scope">
+      <!-- <template v-slot:measuringUnit="scope">
         <el-form-item :prop="'datasource.' + scope.$index + '.measuringUnit'">
           <el-input
             v-model="scope.row.measuringUnit"
@@ -253,7 +259,7 @@
             placeholder="请输入"
           ></el-input>
         </el-form-item>
-      </template>
+      </template> -->
       <template v-slot:remark="scope">
         <el-form-item :prop="'datasource.' + scope.$index + '.remark'">
           <el-input
@@ -397,7 +403,7 @@
         <el-form-item
           v-if="scope.row.arrivalWay == 1 || !scope.row.arrivalWay"
           :rules="{
-            required: isDate == 1 ? true : false,
+            required: isDate == 1 && quoteType != 2 ? true : false,
             message:
               contractBookType == 1 ? '请选择客户期望交期' : '请选择交付日期',
             trigger: 'change'
@@ -464,7 +470,15 @@
             placeholder="请输入"
           >
             <template slot="append">
-              {{ scope.row.weightUnit }}
+              <span v-if="!!scope.row.productId && scope.row.productId != 0">
+                {{ scope.row.weightUnit }}
+              </span>
+              <el-input
+                v-else
+                v-model="scope.row.weightUnit"
+                placeholder="单位"
+                style="width: 80px; padding: 0"
+              ></el-input>
             </template>
           </el-input>
         </el-form-item>
@@ -520,7 +534,6 @@
             disabled
           ></el-input>
           <el-button
-            v-if="scope.row.productCode"
             size="small"
             type="primary"
             @click.native="handleTaskinstance(scope.row, scope.$index)"
@@ -632,6 +645,7 @@
               <el-select
                 v-model="scope.row[countObj.unitIdKey]"
                 style="width: 80px"
+                v-if="!!scope.row.productId && scope.row.productId != 0"
               >
                 <el-option
                   :label="item.conversionUnit"
@@ -641,6 +655,12 @@
                   :key="index"
                 ></el-option>
               </el-select>
+              <el-input
+                v-else
+                v-model="scope.row.measuringUnit"
+                placeholder="单位"
+                style="width: 80px; padding: 0"
+              ></el-input>
             </template>
           </el-input>
         </el-form-item>
@@ -792,8 +812,15 @@
         </el-form-item>
       </template>
       <template v-slot:productionRequirements="{ row, $index }">
-        <el-form-item :prop="'datasource.' + $index + '.productionRequirements'">
-          <el-input v-model="row.productionRequirements" placeholder="请输入" type="textarea"> </el-input>
+        <el-form-item
+          :prop="'datasource.' + $index + '.productionRequirements'"
+        >
+          <el-input
+            v-model="row.productionRequirements"
+            placeholder="请输入"
+            type="textarea"
+          >
+          </el-input>
         </el-form-item>
       </template>
       <!-- 操作列 -->
@@ -1215,7 +1242,9 @@
             label: this.contractBookType == 1 ? '客户期望交期' : '交付日期',
             slot: 'customerExpectDeliveryDeadline',
             headerSlot:
-              this.isDate == 1 ? 'headerCustomerExpectDeliveryDeadline' : '',
+              this.isDate == 1 && this.quoteType != 2
+                ? 'headerCustomerExpectDeliveryDeadline'
+                : '',
             align: 'center'
           },
 
@@ -2382,4 +2411,7 @@
     align-items: center;
     font-weight: bold;
   }
+  :deep(.el-input-group__append){
+    padding: 0;
+  }
 </style>

+ 1 - 1
src/BIZComponents/inventoryTableDetails.vue

@@ -73,7 +73,7 @@
           :prop="'datasource.' + scope.$index + '.' + countObj.countKey"
         >
           {{ scope.row[countObj.countKey]
-          }}{{ scope.row[countObj.unitKey] || '' }}
+          }}{{ scope.row[countObj.unitKey] || scope.row.measuringUnit }}
         </el-form-item>
       </template>
 

+ 57 - 29
src/views/salesServiceManagement/components/invoiceDialog.vue

@@ -125,7 +125,8 @@ import {
 } from '@/api/saleManage/saleordersendrecord';
 import { reviewStatus } from '@/enum/dict';
 import { lbjtList } from '@/enum/dict.js';
-import { getByIdSplit } from '@/api/wms';
+import { getInfoBySourceBizNoAll } from '@/api/wms';
+
 const dayjs = require('dayjs');
 
 export default {
@@ -370,7 +371,7 @@ export default {
         this.getInfo(row);
       } else {
         // 调用修改后的接口,传入id参数
-        this._getInfo(row.id);
+       this._getInfo(row.docNo);
       }
     },
     handleClose() {
@@ -405,33 +406,60 @@ export default {
       this.packingList = list;
     },
 
-    // 修改后的接口调用方法,使用getByIdSplit并传入id
-    async _getInfo(id) {
-      console.log('调用getByIdSplit接口,id:', id);
-      // 调用新接口,传入id参数
-      const res = await getByIdSplit(id);
-
-      // 处理返回数据,使其格式与第二个页面一致
-      let list = res.productList.map((el) => {
-        return {
-          categoryCode: el.productCode || el.categoryCode,
-          categoryName: el.productName || el.categoryName,
-          categoryModel: el.modelType || el.categoryModel,
-          measureQuantity: el.totalCount || el.measureQuantity,
-          barcodes: el.carCode || el.barcodes,
-          packingSpecification: el.specification || el.packingSpecification,
-          productBrand: el.brandNum || el.productBrand,
-          batchNo: el.batchNo,
-          singlePrice: el.singlePrice,
-          productCategoryName: el.productCategoryName,
-          shipmentDate: res.createTime || null,
-          guaranteePeriodDeadline: this.getTime(res.createTime)[0],
-          warrantyStatus: this.getTime(res.createTime)[1]
-        };
-      });
-
-      this.packingList = list;
-    },
+       async _getInfo(sourceBizNo) {
+        console.log('zzz');
+        const dataArray = await getInfoBySourceBizNoAll(sourceBizNo);
+        let res = {};
+        if (dataArray && dataArray.length > 0) {
+          res = JSON.parse(JSON.stringify(dataArray[0]));
+          res['outInDetailList'] = [];
+          dataArray.forEach((item) => {
+            item.outInDetailList.forEach((val) => {
+              res['outInDetailList'].push(val);
+            });
+          });
+        }
+        this.init(res);
+      },
+      init(res) {
+        this.infoData = res;
+        this.productList = res?.outInDetailList?.map(
+          (productItem, productIndex) => {
+            console.log(productItem);
+            return {
+              ...productItem,
+              outInDetailRecordRequestList:
+                productItem.outInDetailRecordRequestList.map((packingItem) => {
+                  return {
+                    ...packingItem,
+                    componentAttribute: productItem.componentAttribute,
+                    productCategoryName:packingItem.categoryLevelName,
+                    singlePrice: productItem.singlePrice,
+                    categoryName: productItem.categoryName,
+                    categoryCode: productItem.categoryCode,
+                    productBrand: productItem.brandNum,
+                    categoryModel: productItem.categoryModel,
+                    packingSpecification: productItem.specification,
+                    produceTime: packingItem.produceTime || null,
+                    shipmentDate: res.createTime || null,
+                    guaranteePeriodDeadline: this.getTime(res.createTime)[0],
+                    warrantyStatus: this.getTime(res.createTime)[1]
+                  };
+                })
+            };
+          }
+        );
+        // 获取包装维度数据
+        const arr = [];
+        for (const key in this.productList) {
+          for (const k in this.productList[key].outInDetailRecordRequestList) {
+            arr.push({
+              ...this.productList[key].outInDetailRecordRequestList[k]
+            });
+          }
+        }
+        this.packingList = arr;
+      },
 
     getTime(createTime) {
       if (!createTime) return ['', 1];