Преглед на файлове

feat(库存表格): 添加选择功能并优化表格列配置

liujt преди 9 месеца
родител
ревизия
c9242ae69f

+ 19 - 5
src/BIZComponents/inventoryTableDetails.vue

@@ -8,7 +8,9 @@
       height="350"
       full-height="calc(100vh - 76px)"
       class="time-form"
+      :selection.sync="selection"
       @columns-change="handleColumnChange"
+      @selection-change="handleSelectionChange"
       :cache-key="cacheKeyUrl"
     >
       <!-- 原有插槽 -->
@@ -283,7 +285,8 @@
           discountTotalPrice: 0,
           datasource: []
         },
-        columnsVersion: 1
+        columnsVersion: 1,
+        selection: [],
       };
     },
     computed: {
@@ -316,9 +319,10 @@
           };
         }
         let selectedColumn = [{
-          width: 45,
-          type: 'selection',
-          align: 'center'
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
         }];
 
         return [
@@ -328,7 +332,13 @@
             columnKey: 'index',
             align: 'center'
           },
-          this.isSelected ? selectedColumn : [],
+          // this.isSelected ? selectedColumn : [],
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            align: 'center'
+          },
           orderColumn,
           {
             width: 280,
@@ -847,6 +857,10 @@
       this.requestDict('商品价格类型');
     },
     methods: {
+      handleSelectionChange(val) {
+        console.log(val, 'val');
+        this.$emit('selection-change', val);
+      },
       async getSupplierObj(productList, queryName) {
         try {
           let categoryIds = productList

+ 56 - 97
src/views/saleManage/saleOrder/adjustmentNote‌/components/addAdjustDialog.vue

@@ -33,7 +33,6 @@
             <el-input
               clearable
               v-model="form.orderNo"
-              @click.native="handleSaleOrderBtn"
               disabled
               placeholder="自动生成"
             />
@@ -43,13 +42,12 @@
           <el-form-item
             label="冲差类型"
             prop="type"
-            style="margin-bottom: 22px"
           >
             <DictSelection
               dictName="冲差类型"
+              disabled
               clearable
               v-model="form.type"
-              @change="handleSetReturnSourceType"
             >
             </DictSelection>
           </el-form-item>
@@ -58,12 +56,12 @@
         <el-col :span="12">
           <el-form-item
             label="冲差原因"
-            prop="entrustedReceiveCode"
+            prop="reason"
           >
             <DictSelection
               dictName="冲差原因"
               clearable
-              v-model="form.type"
+              v-model="form.reason"
               @change="handleSetReturnSourceType"
             >
             </DictSelection>
@@ -71,11 +69,12 @@
         </el-col>
 
         <el-col :span="12">
-          <el-form-item label="冲差方式" prop="totalAmount">
+          <el-form-item label="冲差方式" prop="method">
             <DictSelection
               dictName="冲差方式"
+              disabled
               clearable
-              v-model="form.type"
+              v-model="form.method"
               @change="handleSetReturnSourceType"
             >
             </DictSelection>
@@ -85,24 +84,22 @@
         <el-col :span="12">
           <el-form-item
             label="调整类型"
-            prop="redressAmount"
+            prop="adjustType"
           >
             <DictSelection
               dictName="调整类型"
               clearable
-              v-model="form.type"
-              @change="handleSetReturnSourceType"
+              v-model="form.adjustType"
             >
             </DictSelection>
           </el-form-item>
         </el-col>
         <el-col :span="12">
-          <el-form-item label="冲差范围" prop="contactName">
+          <el-form-item label="冲差范围" prop="range">
             <DictSelection
               dictName="冲差范围"
               clearable
-              v-model="form.type"
-              @change="handleSetReturnSourceType"
+              v-model="form.range"
             >
             </DictSelection>
           </el-form-item>
@@ -121,8 +118,8 @@
         </el-col>
 
         <el-col :span="12">
-          <el-form-item prop="returnFiles" label="附件">
-            <fileMain v-model="form.returnFiles"></fileMain>
+          <el-form-item prop="files" label="附件">
+            <fileMain v-model="form.files"></fileMain>
           </el-form-item>
         </el-col>
       </el-row>
@@ -131,6 +128,7 @@
         ref="inventoryTableDetailsRef"
         :isDiscountTotalPrice="true"
         :isSelected="true"
+        @selection-change="handleSelectionChange"
       ></inventoryTableDetails>
       <headerTitle
         title="冲差信息"
@@ -140,7 +138,7 @@
         :returnType="form.returnType"
         :returnSourceType="form.returnSourceType"
         :entrustedCode="form.entrustedCode"
-        ref="inventoryTableref"
+        ref="inventoryTableRef"
         :sendId="form.sendId"
         :sendNo="form.sendNo"
         :type="form.type"
@@ -191,28 +189,6 @@
       >
       <el-button @click="cancel">返回</el-button>
     </div>
-    <!--  销售发货单  -->
-    <!-- <sendListDialog
-      ref="sendListDialogRef"
-      @changeParent="changeOrder"
-      :contactData="contactData"
-      :saleOrderData="saleOrderData"
-    ></sendListDialog> -->
-    <!--  受托发货单  -->
-    <entrusted-receive-dialog
-      :entrusted-receive-dialog-flag.sync="entrustedReceiveDialogFlag"
-      :contactData="contactData"
-      :saleOrderData="saleOrderData"
-      v-if="entrustedReceiveDialogFlag"
-      @changeParent="getInfo"
-      ref="entrustedReceiveDialogRef"
-    ></entrusted-receive-dialog>
-    <!--    销售订单-->
-    <!-- <orderListDialog
-      ref="orderListDialogRef"
-      @changeParent="changeSaleOrder"
-      :contactData="contactData"
-    ></orderListDialog> -->
     <process-submit-dialog
       :isNotNeedProcess="false"
       :processSubmitDialogFlag.sync="processSubmitDialogFlag"
@@ -220,25 +196,11 @@
       ref="processSubmitDialogRef"
       @reload="reload"
     ></process-submit-dialog>
-    <!--出库详情-->
-    <!-- <outbound-details-dialog
-      v-if="outboundDetailsDialogFlag && form.returnType != 2"
-      ref="outboundDetailsDialogRef"
-      :outboundDetailsDialogFlag.sync="outboundDetailsDialogFlag"
-      @saveDate="saveDate"
-    ></outbound-details-dialog> -->
-    <!--入库详情-->
-    <!-- <outbound-details-dialog1
-      v-if="outboundDetailsDialogFlag1"
-      ref="outboundDetailsDialogRef1"
-      :outboundDetailsDialogFlag.sync="outboundDetailsDialogFlag1"
-      @saveDate="saveDate"
-    ></outbound-details-dialog1> -->
+ 
   </ele-modal>
 </template>
 
 <script>
-  import { numberReg } from 'ele-admin';
   import { acceptUnpackoptions } from '@/enum/dict';
   import fileUpload from '@/components/upload/fileUpload';
   import dictMixins from '@/mixins/dictMixins';
@@ -251,20 +213,15 @@
     UpdateReturnInformation
   } from '@/api/saleManage/returnGoods';
   import {
-    getSendSaleOrderCordList,
     getSendSaleOrderrecordDetailSplit
   } from '@/api/saleManage/saleordersendrecord';
   import inventoryTable from './inventoryTable.vue';
-  // import sendListDialog from './sendListMultipleDialog.vue';
   import { copyObj } from '@/utils/util';
-  import entrustedReceiveDialog from '@/views/saleManage/saleOrder/invoice/components/entrustedReceiveDialog.vue';
   import { getPSaleEntrustedReceiveDetailAPI } from '@/api/saleManage/entrustedReceive';
   import { getWarehouseListByIds } from '@/api/purchasingManage/returnGoods';
   import fileMain from '@/components/addDoc/index.vue';
   import processSubmitDialog from '@/BIZComponents/processSubmitDialog/processSubmitDialog.vue';
   import orderListDialog from '@/views/saleManage/saleOrder/invoice/components/orderListDialog.vue';
-  // import outboundDetailsDialog from './outboundDetailsDialog.vue';
-  import outboundDetailsDialog1 from '@/views/saleManage/saleOrder/entrustedReceive/components/outboundDetailsDialog.vue';
   import inventoryTable1 from '@/BIZComponents/inventoryTable.vue';
   import inventoryTableDetails from '@/BIZComponents/inventoryTableDetails.vue';
   import { getSendSaleOrderConfirmDetail } from '@/api/saleManage/invoiceConfirm';
@@ -279,16 +236,12 @@
       orderListDialog,
       processSubmitDialog,
       fileMain,
-      entrustedReceiveDialog,
       fileUpload,
       deptSelect,
-      // sendListDialog,
       inventoryTable,
       inventoryTable1,
       parentList,
       personSelect,
-      // outboundDetailsDialog,
-      outboundDetailsDialog1,
       inventoryTableDetails
     },
     //客户管理数据
@@ -306,11 +259,15 @@
     },
     data() {
       let formDef = {
-        id: '',
-        payAmount: 0,
-        returnFiles: [],
+        type: '1',
+        method: '1',
+        reason: '1',
+        range: '',
+        adjustType: '1',
+        files: [],
         repliedFiles: [],
         remark: '',
+        payAmount: 0,
         sendId: '',
         sendNo: '',
         orderId: '',
@@ -345,24 +302,21 @@
         activeName: 'base',
         formDef,
         form: copyObj(formDef),
+        orderForm: {},
         tableBankData: [],
         tableLinkData: [],
         // 组织机构树形结构数据
         groupTreeData: [],
         groupData: [],
         rules: {
-          returnSourceType: [
+          type: [
             { required: true, message: '请选择', trigger: 'change' }
           ],
-          sendNo: [{ required: true, message: '请选择', trigger: 'change' }],
-          payAmount: [
-            {
-              required: true,
-              pattern: numberReg,
-              message: '请输入数字',
-              trigger: 'blur'
-            }
-          ]
+          method: [{ required: true, message: '请选择', trigger: 'change' }],
+          reason: [{ required: true, message: '请选择', trigger: 'change' }],
+          range: [{ required: true, message: '请选择', trigger: 'change' }],
+          adjustType: [{ required: true, message: '请选择', trigger: 'change' }],
+          // files: [{ required: true, message: '请上传附件', trigger: 'change' }],
         },
         // 提交状态
         loading: false,
@@ -372,7 +326,8 @@
         businessId: '',
         orderId: '',
         outboundDetailsDialogFlag: false,
-        productList: []
+        productList: [],
+        adjustData: [],
       };
     },
     created() {
@@ -382,8 +337,8 @@
       totalAmount() {
         let allcountAmount = 0;
         let totalAmount =
-          (this.$refs.inventoryTableref &&
-            this.$refs.inventoryTableref.totalAmount) ||
+          (this.$refs.inventoryTableRef &&
+            this.$refs.inventoryTableRef.totalAmount) ||
           0;
         if (this.form.returnSourceType == 1) {
           if (this.form.type === '10') {
@@ -418,6 +373,13 @@
     },
 
     methods: {
+      handleSelectionChange(list) {
+        // this.form.productList = val;
+        console.log('select------list', list);
+        this.adjustData = list;
+        this.$refs.inventoryTableRef &&
+          this.$refs.inventoryTableRef.putTableValue(list);
+      },
       //删除产品
       remove(row) {
         if (this.form.productList.length === 1)
@@ -427,10 +389,7 @@
           this.form.productList.splice(index, 1);
         }
       },
-      onchangeLink() {
-        this.form.type = '';
-        this.handleSetReturnSourceType();
-      },
+    
       async contactDetail(id) {
         const { base } = await contactDetail(id);
         this.customerMark = base.serialNo;
@@ -453,8 +412,8 @@
           entrustedReceiveCode: ''
         });
         this.$nextTick(() => {
-          this.$refs.inventoryTableref &&
-            this.$refs.inventoryTableref.putTableValue([]);
+          this.$refs.inventoryTableRef &&
+            this.$refs.inventoryTableRef.putTableValue([]);
           this.$refs.inventoryTableDetailsRef &&
             this.$refs.inventoryTableDetailsRef.putTableValue([]);
         });
@@ -478,8 +437,8 @@
             entrustedReceiveId: '',
             entrustedReceiveCode: ''
           });
-          this.$refs.inventoryTableref &&
-            this.$refs.inventoryTableref.putTableValue([]);
+          this.$refs.inventoryTableRef &&
+            this.$refs.inventoryTableRef.putTableValue([]);
           return;
         }
         this.entrustedReceiveDialogFlag = true;
@@ -548,8 +507,8 @@
         this.productList = [];
         let data = {},
           res = {};
-        this.$refs.inventoryTableref &&
-          this.$refs.inventoryTableref.putTableValue([]);
+        this.$refs.inventoryTableRef &&
+          this.$refs.inventoryTableRef.putTableValue([]);
         this.$refs.inventoryTableref1 &&
           this.$refs.inventoryTableref1.putTableValue({
             productList: []
@@ -573,8 +532,8 @@
                 item['orderNo'] = this.orderOption[0]?.orderNo;
               });
 
-              this.$refs.inventoryTableref &&
-                this.$refs.inventoryTableref.putTableValue(res.productList);
+              this.$refs.inventoryTableRef &&
+                this.$refs.inventoryTableRef.putTableValue(res.productList);
               this.$refs.inventoryTableDetailsRef &&
                 this.$refs.inventoryTableDetailsRef.putTableValue(
                   data.productList
@@ -669,8 +628,8 @@
             }
           });
         });
-        this.$refs.inventoryTableref &&
-          this.$refs.inventoryTableref.putTableValue(data);
+        this.$refs.inventoryTableRef &&
+          this.$refs.inventoryTableRef.putTableValue(data);
       },
       //发货单详情
       async getSendSaleOrderDetail(id, type) {
@@ -715,8 +674,8 @@
           this.form.entrustedCode = data?.entrustedReceiveCode;
           this.form.entrustedId = data?.entrustedReceiveId;
           this.$nextTick(() => {
-            this.$refs.inventoryTableref &&
-              this.$refs.inventoryTableref.putTableValue(data.productList);
+            this.$refs.inventoryTableRef &&
+              this.$refs.inventoryTableRef.putTableValue(data.productList);
             this.$refs.inventoryTableref1 &&
               this.$refs.inventoryTableref1.putTableValue({
                 productList: data.redressProductList
@@ -763,7 +722,7 @@
         this.loading = true;
         const data = await getSaleOrderDetail(id);
         this.loading = false;
-        this.form = data;
+        this.orderForm = data;
         // if (data.partaId) {
         //   await this.changeParent({ id: data.partaId }, true);
         // }
@@ -807,7 +766,7 @@
         ) {
           proAll.push(
             new Promise((resolve, reject) => {
-              this.$refs.inventoryTableref.validateForm((valid) => {
+              this.$refs.inventoryTableRef.validateForm((valid) => {
                 if (!valid) {
                   reject(false);
                 } else {
@@ -828,7 +787,7 @@
           if (!this.isUpdate) {
             delete this.form.id;
           }
-          let data = this.$refs.inventoryTableref.getTableValue();
+          let data = this.$refs.inventoryTableRef.getTableValue();
           let redressProductList =
             (this.$refs.inventoryTableref1 &&
               this.$refs.inventoryTableref1.getTableValue()) ||

+ 5 - 25
src/views/saleManage/saleOrder/adjustmentNote‌/components/inventoryTable.vue

@@ -77,27 +77,6 @@
         </el-form-item>
       </template>
 
-      <!--        3. 按重量 发货总重必填
-
-                   按数量 发货总重不必填
-
-                   如果选择的订单是受托:
-                   按重量 收货总重必填且可以选择
-                   按数量 收货总重不必填且可以选择
-                   如果不是收货总重置灰
-
-                   -->
-      <!--        1. 按重量 发货总重必填
-             按数量 发货总重不必填
-              如果选择的订单是受托:
-             按重量 收货总重必填且可以选择
-             按数量 收货总重不必填且可以选择
-             如果不是收货总重置灰
-               -->
-
-      <!--        2. 按重量/按数量 发货总重置灰
-                   按重量 收货总必填     -->
-      <!--   收货总重   -->
       <template v-slot:receiveTotalWeight="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -208,8 +187,9 @@
             v-model="scope.row.notaxSinglePrice"
             placeholder="请输入"
             type="number"
+            @change="changeNum(scope.row, scope.$index)"
           >
-            <template slot="append">元</template>
+            <!-- <template slot="append">元</template> -->
           </el-input>
         </el-form-item>
       </template>
@@ -472,14 +452,14 @@
             align: 'center'
           },
           {
-            width: 100,
+            width: 180,
             prop: 'notaxSinglePrice',
             label: '单价差异',
             slot: 'notaxSinglePrice',
             align: 'center'
           },
           {
-            width: 160,
+            width: 130,
             prop: 'taxRate',
             label: '税率',
             formatter: (row, column) => {
@@ -488,7 +468,7 @@
             align: 'center'
           },
           {
-            width: 180,
+            width: 130,
             prop: 'notaxSinglePrice1',
             label: '不含税单价',
             slot: 'notaxSinglePrice1',