소스 검색

销售退货单选择仓库物品层

yusheng 1 년 전
부모
커밋
d06e8ef022

+ 1 - 1
src/BIZComponents/inventoryTableDetails.vue

@@ -633,7 +633,7 @@
             productList,
             'productId'
           );
-          this.$refs.table.reload();
+          this.$refs.table&&this.$refs.table.reload();
         }
       }
     }

+ 94 - 36
src/BIZComponents/outdetails.vue

@@ -115,10 +115,17 @@
             tooltip-effect="dark"
             :max-height="300"
             :header-cell-style="rowClass"
+            @selection-change="handleSelectionProductChange"
           >
             <el-table-column label="序号" type="index" width="50">
             </el-table-column>
-
+            <el-table-column
+              type="selection"
+              width="55"
+              align="center"
+              :selectable="selectable"
+            >
+            </el-table-column>
             <el-table-column
               minWidth="150"
               label="出库单号"
@@ -281,7 +288,12 @@
               align="center"
             >
             </el-table-column>
-            <el-table-column type="selection" width="55" align="center">
+            <el-table-column
+              type="selection"
+              :selectable="selectablePick"
+              width="55"
+              align="center"
+            >
             </el-table-column>
             <el-table-column
               label="编码"
@@ -474,9 +486,7 @@
     getInfoBySourceBizNoAPI,
     getInfoBySourceBizNoAll
   } from '@/api/wms';
-  import {
-    getUserDetail
-  } from '@/api/system/organization/index.js';
+  import { getUserDetail } from '@/api/system/organization/index.js';
 
   import { fieldModelAPI } from '@/api/main';
   export default {
@@ -509,7 +519,8 @@
         stepsTitle: '已完成',
         stepsStatus: 'success',
         active: 0,
-        multipleSelection: []
+        multipleSelection: [],
+        productSelection: []
       };
     },
     watch: {
@@ -572,6 +583,18 @@
       // this._getInfo();
     },
     methods: {
+      selectable(row, index) {
+        let arr = this.multipleSelection.map((item) => {
+          return item.batchNo + item.categoryId;
+        });
+        return !arr.includes(row.batchNo + row.categoryId);
+      },
+      selectablePick(row, index) {
+        let arr = this.productSelection.map((item) => {
+          return item.batchNo + item.categoryId;
+        });
+        return !arr.includes(row.batchNo + row.categoryId);
+      },
       // 获取动态表头
       getFieldModel() {
         fieldModelAPI({ fieldModel: 't_main_category' }).then((res) => {
@@ -622,7 +645,7 @@
       ...mapActions('dict', ['requestDict']),
       getSceneState: useDictLabel(outputSceneStateEnum),
       handleAssetType(r) {
-        let codes = r&&r.split(',');
+        let codes = r && r.split(',');
 
         let name = codes?.map((code) => {
           return this.codeList.find((val) => val.dictCode == code)?.dictValue;
@@ -668,8 +691,8 @@
           });
           res['bizNo'] = dataArray.map((item) => item.bizNo);
         }
-        let user=await getUserDetail(res.extInfo?.createUserId)
-        res.extInfo['deptName']=user.deptName
+        let user = await getUserDetail(res.extInfo?.createUserId);
+        res.extInfo['deptName'] = user.deptName;
         // res
         this.init(res, type);
       },
@@ -725,38 +748,73 @@
         console.log(this.materialList);
         this.pickingFetchData();
         this.materielFetchData();
-        if (type == 10) {
-          this.multipleSelection = this.showPackingList;
-          this.$emit('handleSave');
-        }
+        // if (type == 10) {
+        //   this.multipleSelection = this.showPackingList;
+        //   this.$emit('handleSave');
+        // }
       },
       handleSelectionChange(val) {
         this.multipleSelection = val;
       },
-      getValue() {
-        // console.log(this.multipleSelection,'this.multipleSelection')
-        return this.multipleSelection.map((item) => {
-          item['outInCode'] = item.bizNo;
-          item['packageId'] = item.id;
-          item['wmsOutId'] = item.outInId;
-          item['wmsOutNo'] = item.bizNo;
-          item['outboundType'] = item.outType;
-          item['outboundDetailId'] = item.id;
-          item['productName'] = item.categoryName;
-          item['productCode'] = item.categoryCode;
-          item['measuringUnit'] = item.measureUnit;
-          item['productId'] = item.categoryId;
-          item['receiveTotalWeight'] = item.weight;
-          this.productList.forEach((val) => {
-            if (item.categoryCode == val.categoryCode) {
-              item['warehouseId'] = val.warehouseId;
-              item['warehouseName'] = val.warehouseName;
-            }
-          });
+      handleSelectionProductChange(val) {
+        this.productSelection = val;
+      },
+      setMultipleSelection() {
+        return (
+          this.multipleSelection.map((item) => {
+            item['outInCode'] = item.bizNo;
+            item['packageId'] = item.id;
+            item['wmsOutId'] = item.outInId;
+            item['wmsOutNo'] = item.bizNo;
+            item['outboundType'] = item.outType;
+            item['outboundDetailId'] = item.id;
+            item['productName'] = item.categoryName;
+            item['productCode'] = item.categoryCode;
+            item['measuringUnit'] = item.measureUnit;
+            item['productId'] = item.categoryId;
+            item['receiveTotalWeight'] = item.weight;
+            item['provenance']= item['provenance']||[]
+            this.productList.forEach((val) => {
+              if (item.categoryCode == val.categoryCode) {
+                item['warehouseId'] = val.warehouseId;
+                item['warehouseName'] = val.warehouseName;
+              }
+            });
 
-          item.id = '';
-          return item;
-        });
+            item.id = '';
+            return item;
+          }) || []
+        );
+      },
+      setProductSelection() {
+        return (
+          this.productSelection.map((item) => {
+            item['outInCode'] = item.bizNo;
+            item['wmsOutId'] = item.outInId;
+            item['wmsOutNo'] = item.bizNo;
+            item['outboundType'] = item.outType;
+            // item['outboundDetailId'] = item.id;
+            item['productName'] = item.categoryName;
+            item['productCode'] = item.categoryCode;
+            item['measuringUnit'] = item.measureUnit;
+            item['productId'] = item.categoryId;
+            item['receiveTotalWeight'] = item.weight;
+            item['provenance']= item['provenance']||[]
+            // this.productList.forEach((val) => {
+            //   if (item.categoryCode == val.categoryCode) {
+            //     item['warehouseId'] = val.warehouseId;
+            //     item['warehouseName'] = val.warehouseName;
+            //   }
+            // });
+
+            item.id = '';
+            return item;
+          }) || []
+        );
+      },
+
+      getValue() {
+        return [...this.setMultipleSelection(), ...this.setProductSelection()];
       },
       download(row) {
         if (row.storePath) {

+ 3 - 3
src/views/saleManage/saleOrder/invoiceConfirm/components/addInvoiceDialog.vue

@@ -677,8 +677,8 @@
       saveDate(data) {
         data.forEach((item) => {
           item['totalCount'] = item.measureQuantity;
-          item['qmsResult'] = item.result;
-          item['qmsStatus'] = item.status;
+          // item['qmsResult'] = item.result;
+          // item['qmsStatus'] = item.status;
           item['sendProductId'] = item.categoryId;
           item['sendTotalWeight'] = item.weight;
 
@@ -686,7 +686,7 @@
             if (item.productCode == val.productCode) {
               item['singlePrice'] = val.singlePrice;
               item['clientCode'] = item.clientCode || val.customerMark;
-              item['pricingWay'] = item.pricingWay || val.pricingWay || 1;
+              item['pricingWay'] = val.pricingWay || 1;
 
               if (item.pricingWay == 1) {
                 item.totalPrice = item.singlePrice * item.measureQuantity;

+ 1 - 1
src/views/saleManage/saleOrder/invoiceConfirm/components/detailDialog.vue

@@ -89,7 +89,7 @@
         </el-row>
       </el-form>
       <el-tabs type="border-card">
-        <el-tab-pane label="收货品明细">
+        <el-tab-pane label="收货品明细">
           <ele-pro-table
             ref="table"
             :needPage="false"

+ 9 - 6
src/views/saleManage/saleOrder/returnGoods/components/addReturnGoodsDialog.vue

@@ -181,8 +181,7 @@
         v-show="['20', '40'].includes(form.type) && form.returnSourceType == 1"
         ref="inventoryTableref1"
         :customerMark="customerMark"
-        cacheKeyUrl='eos-saleManage-returnGoods-redressProductList'
-
+        cacheKeyUrl="eos-saleManage-returnGoods-redressProductList"
       ></inventoryTable1>
     </el-form>
 
@@ -594,6 +593,10 @@
               this.productList = data.productList;
               this.$refs.inventoryTableref &&
                 this.$refs.inventoryTableref.putTableValue(res.productList);
+              this.$refs.inventoryTableDetailsRef &&
+                this.$refs.inventoryTableDetailsRef.putTableValue(
+                  data.productList
+                );
               return;
             }
             if (type == 1) {
@@ -608,6 +611,7 @@
               this.$refs.inventoryTableref &&
                 this.$refs.inventoryTableref.putTableValue(data.productList);
             }
+
             this.$refs.inventoryTableDetailsRef &&
               this.$refs.inventoryTableDetailsRef.putTableValue(
                 data.productList
@@ -633,14 +637,13 @@
       saveDate(data) {
         data.forEach((item) => {
           item['totalCount'] = item.measureQuantity;
-          item['qmsResult'] = item.result;
-          item['qmsStatus'] = item.status;
+          // item['qmsResult'] = item.result;
+          // item['qmsStatus'] = item.status;
           this.productList.forEach((val) => {
             if (item.productCode == val.productCode) {
               item['singlePrice'] = val.singlePrice;
               item['clientCode'] = item.clientCode || val.customerMark;
-              item['pricingWay'] =
-                item.pricingWay || val.pricingWay || this.form.pricingWay;
+              item['pricingWay'] = val.pricingWay || 1;
             }
           });
         });