Przeglądaj źródła

feat: 受托收货单产品列表重构,优化MBOM数据处理逻辑,移除冗余

yusheng 9 miesięcy temu
rodzic
commit
467f9517c1

+ 22 - 23
src/views/saleManage/saleOrder/entrustedReceive/components/addOrEditDialog.vue

@@ -37,16 +37,6 @@
         </el-col>
       </el-row>
       <el-row :gutter="20">
-        <!-- <el-col :span="12">
-          <el-form-item
-            label="计价方式"
-          >
-            <el-select v-model="form.pricingWay" disabled style="width: 100%">
-              <el-option label="按数量计费" :value="1"></el-option>
-              <el-option label="按重量计费" :value="2"></el-option>
-            </el-select>
-          </el-form-item>
-        </el-col> -->
         <el-col :span="12">
           <el-form-item label="客户联系人" prop="linkName">
             <el-input clearable v-model="form.linkName" placeholder="请输入" />
@@ -88,12 +78,6 @@
         <el-col :span="12">
           <el-form-item prop="files" label="附件">
             <fileMain v-model="row.files"></fileMain>
-            <!--            <fileUpload-->
-            <!--              v-model="form.files"-->
-            <!--              module="main"-->
-            <!--              :showLib="false"-->
-            <!--              :limit="10"-->
-            <!--            />-->
           </el-form-item>
         </el-col>
       </el-row>
@@ -116,7 +100,6 @@
         v-click-once
         >提交</el-button
       >
-
       <el-button @click="cancel">返回</el-button>
     </div>
     <!--  采购订单  -->
@@ -286,12 +269,26 @@
               productList,
               pricingWay
             } = data;
+            let mbomCategoryList = [];
             if (productList && productList.length > 0) {
-              productList.forEach(async (v) => {
-                v.orderTotalCount = v.orderTotalCount || v.totalCount;
-                v.batchNo = await getCode('lot_number_code');
+              productList.forEach((v) => {
+                let arr = v.saleOrderProductBomList.map((item) => {
+                  item.productCategoryId = item.categoryLevelPathIdParent;
+                  item.productCode = item.categoryCode;
+                  item.productId = item.categoryId;
+                  item.productName = item.categoryName;
+                  item.bomCode = item.bomCode;
+                  return item;
+                });
+                mbomCategoryList.push(...arr);
+                // v.orderTotalCount = v.orderTotalCount || v.totalCount;
+                // v.batchNo = await getCode('lot_number_code');
               });
+              // mbomCategoryList.forEach(async (v) => {
+              //   v.batchNo = await getCode('lot_number_code');
+              // });
             }
+            console.log(mbomCategoryList,'mbomCategoryList')
             this.form = Object.assign({}, this.form, {
               contactId: partaId,
               contactName: partaName,
@@ -299,12 +296,14 @@
               linkPhone: partaTel,
               orderNo,
               orderId: id,
-              productList,
+              productList: mbomCategoryList,
               pricingWay
             });
-            this.form = await this.getTotalCountHistory(this.form);
+            // this.form = await this.getTotalCountHistory(this.form);
             this.$refs.inventoryTableref &&
-              this.$refs.inventoryTableref.putTableValue(this.form.productList);
+              this.$refs.inventoryTableref.putTableValue(
+                this.form.productList
+              );
           });
         }
       },

+ 36 - 36
src/views/saleManage/saleOrder/entrustedReceive/components/detailDialog.vue

@@ -179,13 +179,13 @@
             slot: 'productCode',
             align: 'center'
           },
-          {
-            minWidth: 100,
-            prop: 'productCategoryName',
-            label: '类型',
-            slot: 'productCategoryName',
-            align: 'center'
-          },
+          // {
+          //   minWidth: 100,
+          //   prop: 'productCategoryName',
+          //   label: '类型',
+          //   slot: 'productCategoryName',
+          //   align: 'center'
+          // },
           {
             width: 160,
             prop: 'productBrand',
@@ -237,28 +237,28 @@
             slot: 'warehouseName',
             align: 'center'
           },
-          {
-            width: 110,
-            prop: 'orderTotalCount',
-            label: '订单总数量',
-            slot: 'orderTotalCount',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'totalCount',
-            label: '本次收货数量',
-            slot: 'totalCount',
-            headerSlot: 'headerTotalCount',
-            align: 'center'
-          },
-          {
-            width: 100,
-            prop: 'receiveTotalCount',
-            label: '已收货总数',
-            slot: 'receiveTotalCount',
-            align: 'center'
-          },
+          // {
+          //   width: 110,
+          //   prop: 'orderTotalCount',
+          //   label: '订单总数量',
+          //   slot: 'orderTotalCount',
+          //   align: 'center'
+          // },
+          // {
+          //   width: 120,
+          //   prop: 'totalCount',
+          //   label: '本次收货数量',
+          //   slot: 'totalCount',
+          //   headerSlot: 'headerTotalCount',
+          //   align: 'center'
+          // },
+          // {
+          //   width: 100,
+          //   prop: 'receiveTotalCount',
+          //   label: '已收货总数',
+          //   slot: 'receiveTotalCount',
+          //   align: 'center'
+          // },
           {
             width: 120,
             prop: 'measuringUnit',
@@ -352,13 +352,13 @@
                 : '';
             }
           },
-          {
-            width: 120,
-            prop: 'deliveryDays',
-            label: '交期(天)',
-            slot: 'deliveryDays',
-            align: 'center'
-          },
+          // {
+          //   width: 120,
+          //   prop: 'deliveryDays',
+          //   label: '交期(天)',
+          //   slot: 'deliveryDays',
+          //   align: 'center'
+          // },
           {
             width: 200,
             prop: 'guaranteePeriod',

+ 23 - 56
src/views/saleManage/saleOrder/entrustedReceive/components/inventoryTable.vue

@@ -253,10 +253,7 @@
   import dictMixins from '@/mixins/dictMixins';
   import productList from '@/BIZComponents/product-list.vue';
 
-  import {
-    getWarehouseList,
-    getWarehouseOutStock
-  } from '@/api/saleManage/saleorder';
+  import { getWarehouseList } from '@/api/saleManage/saleorder';
 
   import warehouseAll from '@/BIZComponents/warehouseAll.vue';
 
@@ -273,7 +270,7 @@
         default: true
       },
       pricingWay: [Number, String],
-      customerMark:''
+      customerMark: ''
     },
     components: {
       warehouseAll,
@@ -288,9 +285,6 @@
         startTime: '',
         workHour: '',
         technicalDrawings: []
-        // warehouseCode:"",
-        // warehouseId:'',
-        // warehouseName:'',
       };
       return {
         discountTotalPrice: 0.0,
@@ -334,13 +328,13 @@
             slot: 'productCode',
             align: 'center'
           },
-          {
-            minWidth: 150,
-            prop: 'productCategoryName',
-            label: '类型',
-            slot: 'productCategoryName',
-            align: 'center'
-          },
+          // {
+          //   minWidth: 150,
+          //   prop: 'productCategoryName',
+          //   label: '类型',
+          //   slot: 'productCategoryName',
+          //   align: 'center'
+          // },
           {
             prop: 'batchNo',
             label: '批次号',
@@ -400,20 +394,14 @@
             headerSlot: 'headerWarehouseId',
             align: 'center'
           },
+
           // {
-          //   minWidth: 80,
-          //   prop: 'warehouseNum',
-          //   label: '库存',
-          //   slot: 'warehouseNum',
+          //   width: 110,
+          //   prop: 'orderTotalCount',
+          //   label: '订单总数量',
+          //   slot: 'orderTotalCount',
           //   align: 'center'
           // },
-          {
-            width: 110,
-            prop: 'orderTotalCount',
-            label: '订单总数量',
-            slot: 'orderTotalCount',
-            align: 'center'
-          },
           {
             width: 150,
             prop: 'totalCount',
@@ -422,13 +410,13 @@
             headerSlot: 'headerTotalCount',
             align: 'center'
           },
-          {
-            width: 100,
-            prop: 'receiveTotalCount',
-            label: '已收货总数',
-            slot: 'receiveTotalCount',
-            align: 'center'
-          },
+          // {
+          //   width: 100,
+          //   prop: 'receiveTotalCount',
+          //   label: '已收货总数',
+          //   slot: 'receiveTotalCount',
+          //   align: 'center'
+          // },
           {
             minWidth: 100,
             prop: 'measuringUnit',
@@ -506,19 +494,6 @@
             }
           },
 
-          // {
-          //   width: 80,
-          //   prop: 'deliveryDays',
-          //   label: '交期(天)',
-          //   slot: 'deliveryDays'
-          // },
-          // {
-          //   width: 160,
-          //   prop: 'deliveryDeadline',
-          //   label: '交期截止日期',
-          //   slot: 'deliveryDeadline',
-          //   show: this.isDeliveryDeadline
-          // },
           {
             minWidth: 170,
             prop: 'customerExpectDeliveryDeadline',
@@ -649,15 +624,6 @@
           this.$set(this.form.datasource[index], 'warehouseName', data.name);
           this.$set(this.form.datasource[index], 'warehouseCode', data.code);
           this.$set(this.form.datasource[index], 'warehouseId', data.id);
-          // const warehouseOutStock = await getWarehouseOutStock({
-          //   warehouseId: data.id,
-          //   code: row.productCode
-          // });
-          // this.$set(
-          //   this.form.datasource[index],
-          //   'warehouseNum',
-          //   warehouseOutStock
-          // );
         }
       },
       warehouseAllChange(data) {
@@ -680,6 +646,7 @@
           'totalPrice',
           this.getTotalPrice(row).toFixed(2)
         );
+        this.$set(this.form.datasource[index], 'discountSinglePrice', val);
         this.$set(
           this.form.datasource[index],
           'discountTotalPrice',
@@ -809,7 +776,7 @@
           this.$set(parasm, 'goodsLevel', item.goodsLevel);
           this.$set(parasm, 'batchNo', await getCode('lot_number_code'));
           this.$set(parasm, 'customerMark', this.customerMark);
-          
+
           if (item.modelKey) {
             this.$set(parasm, 'modelKey', item.modelKey.split(','));
           }

+ 7 - 8
src/views/saleManage/saleOrder/index.vue

@@ -181,7 +181,9 @@
                   @click="handleCommand('invoice', row)"
                   v-if="
                     [2].includes(row.orderStatus) &&
-                    !row.saleTypeName.includes('受托') &&
+                    ((row.saleTypeName.includes('受托') &&
+                      row.isEntrustedReceive != 0) ||
+                      row.isEntrustedReceive == 1) &&
                     row.needProduce != 2 &&
                     $hasPermission('eom:saleordersendrecord:save') &&
                     ((isTotalCount == '1' &&
@@ -199,9 +201,7 @@
                   v-if="
                     [2].includes(row.orderStatus) &&
                     row.saleTypeName.includes('受托') &&
-                    ((isTotalCount == '1' &&
-                      ![800, 1000].includes(row.progress)) ||
-                      isTotalCount == 0)
+                    row.isEntrustedReceive != 1
                   "
                 >
                   受托收货单
@@ -456,7 +456,7 @@
         loading: false, // 加载状态
         processSubmitDialogFlag: false, // 加载状态
         addOrEditDialogFlag1: false,
-        addEntrustedReceiveFlag:false,
+        addEntrustedReceiveFlag: false,
         params: {},
         tableList: [],
         current: null,
@@ -811,10 +811,9 @@
         }
         if (command === 'entrustedReceive') {
           this.addEntrustedReceiveFlag = true;
-          this.$nextTick(() => {    
-           this.$refs.addEntrustedReceiveRef.open('add', {}, row.id);
+          this.$nextTick(() => {
+            this.$refs.addEntrustedReceiveRef.open('add', {}, row.id);
           });
-         
         }
         if (command === 'returnOrder') {
           this.$refs.addReturnGoodsRef.open('add', {});

+ 22 - 4
src/views/saleManage/saleOrder/invoice/components/addInvoiceDialog.vue

@@ -134,6 +134,7 @@
           :needProduce="saleOrderValue.needProduce"
           :typeIds="saleOrderValue.typedetailIds"
           :isTotalCount="isTotalCount"
+          :oldProductList="oldProductList"
         ></inventoryTable>
       </el-tab-pane>
       <el-tab-pane label="托盘清单" name="second">
@@ -287,6 +288,7 @@
         payWayOptions: [],
         delDetailIds: [],
         carList: [],
+        oldProductList: [],
         visible: false,
         entrustedReceiveDialogFlag: false,
         processSubmitDialogFlag: false,
@@ -344,7 +346,11 @@
         this.getSaleOrderDetails(obj.map((item) => item.id));
       },
 
-      setData(res, type) {
+      async setData(res, type) {
+        let eom_saleOrder_addInvoice = await parameterGetByCode({
+          code: 'eom_saleOrder_addInvoice'
+        });
+
         let data = {
           ...res[0],
           orderIds: res.map((item) => item.id).toString(),
@@ -376,7 +382,8 @@
         };
 
         this.loading = false;
-        this.saleOrderValue = data;
+        this.saleOrderValue = JSON.parse(JSON.stringify(data));
+        this.oldProductList = JSON.parse(JSON.stringify(data.productList));
         this.partbAddress = data.partbAddress;
         if (type == 'sendInit') {
           return;
@@ -429,8 +436,19 @@
             item['tempId'] = index;
             item.id = '';
           });
-          this.$refs.inventoryTableref &&
-            this.$refs.inventoryTableref.putTableValue(productList);
+          // this.$refs.inventoryTableref &&
+          //   this.$refs.inventoryTableref.putTableValue(productList);
+          this.oldProductList = JSON.parse(JSON.stringify(productList));
+          if (eom_saleOrder_addInvoice?.value == 1) {
+            this.$refs.inventoryTableref &&
+              this.$refs.inventoryTableref.putTableValue(productList);
+          } else {
+            this.$refs.inventoryTableref &&
+              this.$refs.inventoryTableref.$refs.productListRef.open(
+                productList
+              );
+          }
+
           this.$refs.taskInfoTableRef &&
             this.$refs.taskInfoTableRef.putTableValue(trakNoteList);
           this.setAddress();

+ 67 - 85
src/views/saleManage/saleOrder/invoice/components/inventoryTable.vue

@@ -319,11 +319,10 @@
         </el-link>
       </template>
     </ele-pro-table>
-    <product-list
+    <productListNew
       ref="productListRef"
-      :orderId="orderId"
       @changeParent="changeParent"
-    ></product-list>
+    ></productListNew>
     <!--入库详情-->
     <innertboundDetailsDialog
       v-if="innerboundDetailsDialogFlag"
@@ -355,7 +354,7 @@
 <script>
   import { numberReg } from 'ele-admin';
   import dictMixins from '@/mixins/dictMixins';
-  import productList from './product-list.vue';
+  import productListNew from './product-listNew.vue';
   import {
     getWarehouseOutStock,
     getIdWarehouseList
@@ -393,6 +392,11 @@
         type: Array,
         default: () => []
       },
+      oldProductList: {
+        type: Array,
+        default: () => []
+      },
+
       isTotalCount: {
         default: 0
       }
@@ -400,7 +404,7 @@
     components: {
       // fileMain,
       innertboundDetailsDialog,
-      productList,
+      productListNew,
       stockLedgerDialog,
       selectStockLedgerDialog,
       BIZproductList
@@ -509,6 +513,7 @@
             align: 'center',
             fixed: 'left'
           },
+
           {
             width: 200,
             prop: 'productName',
@@ -802,14 +807,6 @@
             },
             showOverflowTooltip: true
           },
-          // {
-          //   width: 80,
-          //   prop: 'deliveryDays',
-          //   label: '交期(天)',
-          //   slot: 'deliveryDays',
-          //   align: 'center'
-          // },
-
           {
             width: 200,
             prop: 'guaranteePeriod',
@@ -1142,18 +1139,13 @@
       },
 
       //选择产品回调
-      async changeParent(obj, idx) {
-        obj.orderTotalCount = obj.totalCount;
-        if (this.form.datasource?.find((item) => item.id == obj.id)) {
-          return this.$message.error('选择的产品已经存在列表了');
-        }
-        obj.id = '';
-        obj['tempId'] = idx;
-        this.$set(
-          this.form.datasource,
-          this.form.datasource.length,
-          copyObj(obj)
-        );
+      async changeParent(obj) {
+        console.log(obj,'obj')
+        obj.forEach((item) => {
+          item.orderTotalCount = item.totalCount;
+          item.id = '';
+        });
+        this.putTableValue(copyObj(obj));
       },
       //选择产品回调
       changeParentBiz(obj = [], idx) {
@@ -1161,6 +1153,8 @@
           let i = idx == -1 ? index : idx;
           let row = JSON.parse(JSON.stringify(this.defaultForm));
           row.key = this.form.datasource.length + 1;
+          row['tempId'] = this.form.datasource.length + 1;
+
           let parasm = idx == -1 ? row : this.form.datasource[i];
           this.$set(parasm, 'productId', item.id);
           this.$set(parasm, 'categoryName', item.name);
@@ -1278,22 +1272,51 @@
       //修改回显
       putTableValue(data) {
         if (data) {
-          this.form.datasource = data;
-          this.form.datasource.forEach(async (item, index) => {
-            if (item.modelKey) {
-              this.$set(
-                this.form.datasource[index],
-                'modelKey',
-                item.modelKey.split(',')
-              );
-            }
-            if (item.colorKey) {
-              this.$set(
-                this.form.datasource[index],
-                'colorKey',
-                item.colorKey.split(',')
-              );
-            }
+          this.setValue(data);
+        }
+      },
+      setValue(data) {
+        let indexS = [];
+        data.forEach((item, index) => {
+          if (item.modelKey) {
+            item.modelKey = item.modelKey.toString();
+          }
+          if (item.colorKey) {
+            item.colorKey = item.colorKey.toString();
+          }
+          item.receiveTotalWeight = item.receiveTotalWeight || 0;
+
+          if (item.weightUnit == item.measuringUnit) {
+            item.sendTotalWeight = item.sendTotalWeight || item.totalCount;
+          } else {
+            item.sendTotalWeight =
+              item.sendTotalWeight ||
+              Number(item.totalCount) * Number(item.singleWeight) ||
+              0;
+          }
+
+          if (this.outsourceSendCode) {
+            item.increaseTotalWeight =
+              Number(item.receiveTotalWeight) - Number(item.sendTotalWeight);
+            item.increaseTotalWeight;
+          } else {
+            item.increaseTotalWeight =
+              item.increaseTotalWeight || item.receiveTotalWeight || 0;
+          }
+          item['sendTotalWeight'] = item.sendTotalWeigh;
+          item['increaseTotalWeight'] = item.increaseTotalWeight;
+          item['tempId'] = this.form.datasource.length;
+          indexS.push(this.form.datasource.length);
+          this.$set(
+            this.form.datasource,
+            this.form.datasource.length,
+            copyObj(item)
+          );
+
+          // this.form.datasource.push(item);
+        });
+        this.form.datasource.forEach(async (item, index) => {
+          if (indexS.includes(index)) {
             this.$set(
               this.form.datasource[index],
               'warehouseList',
@@ -1318,49 +1341,8 @@
               );
               await this.warehouseChange(index, this.form.datasource[index]);
             }
-
-            this.$set(
-              this.form.datasource[index],
-              'receiveTotalWeight',
-              item.receiveTotalWeight || 0
-            );
-            if (item.weightUnit == item.measuringUnit) {
-              item.sendTotalWeight = item.sendTotalWeight || item.totalCount;
-            } else {
-              item.sendTotalWeight =
-                item.sendTotalWeight ||
-                Number(item.totalCount) * Number(item.singleWeight) ||
-                0;
-            }
-
-            if (this.outsourceSendCode) {
-              item.increaseTotalWeight =
-                Number(item.receiveTotalWeight) - Number(item.sendTotalWeight);
-              item.increaseTotalWeight;
-            } else {
-              item.increaseTotalWeight =
-                item.increaseTotalWeight || item.receiveTotalWeight || 0;
-            }
-            this.$set(
-              this.form.datasource[index],
-              'sendTotalWeight',
-              item.sendTotalWeigh
-            );
-            this.$set(
-              this.form.datasource[index],
-              'increaseTotalWeight',
-              item.increaseTotalWeight
-            );
-            console.log(item.increaseTotalWeight);
-          });
-          //保存初始收货总重
-          this.oldReceiveTotalWeight = this.form.datasource.map((item) => {
-            return {
-              productCode: item.productCode,
-              oldReceiveTotalWeight: item.receiveTotalWeight
-            };
-          });
-        }
+          }
+        });
       },
 
       remove(i) {
@@ -1384,7 +1366,7 @@
       handlAdd() {
         if (!this.orderId && !this.orderIds)
           return this.$message.error('请先选择订单');
-        this.$refs.productListRef.open(this.form.datasource);
+        this.$refs.productListRef.open(this.oldProductList);
       },
       //库存台账
       selectStockLedgerDialogOpen(row) {

+ 265 - 0
src/views/saleManage/saleOrder/invoice/components/product-listNew.vue

@@ -0,0 +1,265 @@
+<template>
+  <el-dialog
+    title="选择产品"
+    :visible.sync="visible"
+    :close-on-click-modal="false"
+    top="5vh"
+    :close-on-press-escape="false"
+    append-to-body
+    width="70%"
+  >
+    <el-card shadow="never">
+      <ele-pro-table
+        ref="table"
+        :columns="columns"
+        :datasource="datasource"
+        row-key="id"
+        height="calc(100vh - 350px)"
+        class="dict-table"
+        :selection.sync="selection"
+      >
+      </ele-pro-table>
+    </el-card>
+
+    <div slot="footer" class="dialog-footer">
+      <el-button type="primary" size="small" @click="selected">选择</el-button>
+      <el-button size="small" @click="visible = false">关闭</el-button>
+    </div>
+  </el-dialog>
+</template>
+
+<script>
+  export default {
+    data() {
+      return {
+        visible: false,
+        datasource: [],
+        columns: [
+          {
+            width: 45,
+            type: 'selection',
+            columnKey: 'selection',
+            fixed: 'left',
+            align: 'center'
+          },
+
+          {
+            minWidth: 150,
+            prop: 'orderNo',
+            label: '订单编码',
+            align: 'center',
+            fixed: 'left'
+          },
+          {
+            width: 200,
+            prop: 'productName',
+            label: '名称',
+            slot: 'productName',
+            align: 'center'
+          },
+          {
+            width: 200,
+            prop: 'productCode',
+            label: '编码',
+            slot: 'productCode',
+            align: 'center'
+          },
+          {
+            width: 200,
+            prop: 'productCategoryName',
+            label: '类型',
+            slot: 'productCategoryName',
+            align: 'center'
+          },
+          {
+            width: 150,
+            prop: 'productBrand',
+            label: '牌号',
+            slot: 'productBrand',
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'modelType',
+            label: '型号',
+            slot: 'modelType',
+            align: 'center'
+          },
+          {
+            minWidth: 120,
+            prop: 'specification',
+            label: '规格',
+            slot: 'specification',
+            align: 'center'
+          },
+          {
+            width: 150,
+            prop: 'saleCount',
+            label: '数量',
+            slot: 'saleCount',
+            headerSlot: 'headerTotalCount',
+            align: 'center'
+          },
+          {
+            width: 150,
+            prop: 'saleUnit',
+            label: '单位',
+            slot: 'saleUnit',
+            headerSlot: 'headerTotalCount',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'packingSpecification',
+            align: 'center',
+            label: '包装规格',
+            showOverflowTooltip: true
+          },
+          {
+            width: 150,
+            prop: 'totalCount',
+            label: '计量数量',
+            slot: 'totalCount',
+            headerSlot: 'headerTotalCount',
+            align: 'center'
+          },
+          {
+            width: 120,
+            prop: 'measuringUnit',
+            label: '计量单位',
+            slot: 'measuringUnit',
+            align: 'center'
+          },
+          {
+            minWidth: 110,
+            prop: 'sendTotalCount',
+            label: '已发货数量',
+            align: 'center',
+            fixed: 'right'
+          },
+          {
+            minWidth: 110,
+            prop: 'notSendTotalCount',
+            label: '未发货数量',
+            align: 'center',
+            fixed: 'right'
+
+          },
+
+          {
+            width: 120,
+            prop: 'singleWeight',
+            label: '单重',
+            slot: 'singleWeight',
+            align: 'center'
+          },
+          {
+            width: 100,
+            prop: 'weightUnit',
+            label: '重量单位',
+            slot: 'weightUnit',
+            align: 'center'
+          },
+          {
+            width: 80,
+            prop: 'singlePrice',
+            label: '单价',
+            slot: 'singlePrice',
+            align: 'center'
+          },
+          {
+            width: 100,
+            prop: 'discountSinglePrice',
+            label: '折让单价',
+            slot: 'discountSinglePrice',
+            align: 'center',
+            formatter: (_row, _column, cellValue) => {
+              return _row.discountSinglePrice
+                ? Number(_row.discountSinglePrice).toFixed(2)
+                : '';
+            }
+          },
+          {
+            width: 80,
+            prop: 'totalPrice',
+            label: '合计',
+            slot: 'totalPrice',
+            align: 'center'
+          },
+          {
+            width: 100,
+            prop: 'discountTotalPrice',
+            label: '折让合计',
+            slot: 'discountTotalPrice',
+            align: 'center',
+            formatter: (_row, _column, cellValue) => {
+              return _row.discountTotalPrice
+                ? Number(_row.discountTotalPrice).toFixed(2)
+                : '';
+            }
+          }
+        ],
+        selection: []
+      };
+    },
+
+    watch: {},
+    methods: {
+      open(datasource) {
+        this.datasource = datasource || [];
+        this.visible = true;
+      },
+
+      selected() {
+        if (!this.selection.length) {
+          return this.$message.warning('请至少选择一条数据');
+        }
+        // let idKey =
+        //   this.type == 'receive' ? 'receiveProductId' : 'sendProductId';
+        // console.log(this.current);
+        // console.log(this.currentData);
+
+        // let index = this.currentData.findIndex(
+        //   (r) => r[idKey] == this.current.id
+        // );
+        // if (index != -1 && ['receive', 'send'].includes(this.type)) {
+        //   return this.$message.error('选择的产品已经存在列表了');
+        // }
+        this.$emit('changeParent', this.selection);
+        this.visible = false;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .tree_col {
+    border: 1px solid #eee;
+    padding: 10px 0;
+    box-sizing: border-box;
+    height: 500px;
+    overflow: auto;
+  }
+
+  .table_col {
+    padding-left: 10px;
+
+    ::v-deep .el-table th.el-table__cell {
+      background: #f2f2f2;
+    }
+  }
+
+  .pagination {
+    text-align: right;
+    padding: 10px 0;
+  }
+
+  .btns {
+    text-align: center;
+    padding: 10px 0;
+  }
+
+  .topsearch {
+    margin-bottom: 15px;
+  }
+</style>