Z 1 год назад
Родитель
Сommit
e0bd5c5b52

+ 1 - 0
package.json

@@ -38,6 +38,7 @@
     "highlight.js": "9.18.5",
     "jsbarcode": "^3.11.5",
     "json-bigint": "^1.0.0",
+    "lodash": "^4.17.21",
     "mathjs": "^12.4.1",
     "nprogress": "^0.2.0",
     "tinymce": "^5.10.5",

+ 10 - 0
src/api/bpm/components/supplierManage/contact.js

@@ -183,3 +183,13 @@ export async function apply(data) {
 
 
 
+/**
+ * 通过产品查供应商
+ */
+export async function contactQueryByCategoryIdsAPI(data) {
+  const res = await request.post('/eom/contact/queryByCategoryIds', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 47 - 35
src/components/bpmnProcessDesigner/package/penal/form/ElementForm.vue

@@ -2,49 +2,61 @@
   <div class="panel-tab__content">
     <el-form size="mini" label-width="100px" @submit.native.prevent>
       <el-form-item label="节点表单路由">
-        <el-input v-model="formKey" clearable @change="updateElementFormKey" type="textarea" rows="3"/>
+        <el-input
+          v-model="formKey"
+          clearable
+          @change="updateElementFormKey"
+          type="textarea"
+          rows="3"
+        />
       </el-form-item>
     </el-form>
-    友情提示:<br/>
-    1、若需要为每个节点设置自定义表单,可以在此设置, 格式: <br/>{"pcHandle":"PC端处理路由", "pcView":"PC端查看路由", "miniHandle":"小程序端处理路由", "miniView":"小程序端查看路由"}<br/>
+    友情提示:<br />
+    1、若需要为每个节点设置自定义表单,可以在此设置, 格式:
+    <br />{"pcHandle":"PC端处理路由", "pcView":"PC端查看路由",
+    "miniHandle":"小程序端处理路由", "miniView":"小程序端查看路由"}<br />
     2、若要为整个流程设置统一表单,可以在流程模型修改页面设置业务表单,格式一致。
+    3、若要控制流程节点是否在pc端或者移动端单独审核,可以在扩展属性中设置,
+    格式:<br />在扩展属性中添加属性名为taskHandlePlatform。若值为0则双端可同时审批,若值为1则只能在pc端审批,若值为2则只能在移动端审批
   </div>
 </template>
 
 <script>
-export default {
-  name: 'ElementForm',
-  props: {
-    id: String,
-    type: String
-  },
-  inject: {
-    prefix: 'prefix',
-    width: 'width'
-  },
-  data() {
-    return {
-      formKey: ''
-    }
-  },
-  watch: {
-    id: {
-      immediate: true,
-      handler(val) {
-        val && val.length && this.$nextTick(() => this.resetFormList())
+  export default {
+    name: 'ElementForm',
+    props: {
+      id: String,
+      type: String
+    },
+    inject: {
+      prefix: 'prefix',
+      width: 'width'
+    },
+    data() {
+      return {
+        formKey: ''
+      };
+    },
+    watch: {
+      id: {
+        immediate: true,
+        handler(val) {
+          val && val.length && this.$nextTick(() => this.resetFormList());
+        }
       }
-    }
-  },
-  methods: {
-    resetFormList() {
-      this.bpmnELement = window.bpmnInstances.bpmnElement;
-      this.formKey = this.bpmnELement.businessObject.formKey;
-      // 更新元素扩展属性,避免后续报错
-      // this.updateElementExtensions()
     },
-    updateElementFormKey() {
-      window.bpmnInstances.modeling.updateProperties(this.bpmnELement, { formKey: this.formKey })
+    methods: {
+      resetFormList() {
+        this.bpmnELement = window.bpmnInstances.bpmnElement;
+        this.formKey = this.bpmnELement.businessObject.formKey;
+        // 更新元素扩展属性,避免后续报错
+        // this.updateElementExtensions()
+      },
+      updateElementFormKey() {
+        window.bpmnInstances.modeling.updateProperties(this.bpmnELement, {
+          formKey: this.formKey
+        });
+      }
     }
-  }
-}
+  };
 </script>

+ 18 - 2
src/views/bpm/handleTask/components/businessOpportunity/addOpportunityDialog.vue

@@ -62,14 +62,14 @@
             </el-input>
           </el-form-item>
         </el-col>
-        <el-col :span="8" style="height: 58px">
+        <el-col :span="8">
           <el-form-item label="预计结单日期">
             <el-date-picker
               v-model="form.expectedClosingDate"
               value-format="yyyy-MM-dd"
               placeholder="请选择"
               type="date"
-              style="width: 200px"
+              style="width: 100%"
               class="filter-item"
             ></el-date-picker>
           </el-form-item>
@@ -84,6 +84,17 @@
             </DictSelection>
           </el-form-item>
         </el-col> -->
+        <el-col :span="8">
+          <el-form-item
+            label="计价方式"
+            prop="pricingWay"
+          >
+            <el-radio-group v-model="form.pricingWay" @change="changePricingWay" :disabled="!!form.contractId">
+              <el-radio v-for="item in pricingWayList" :label="item.id">{{ item.name }}</el-radio>
+            </el-radio-group>
+          </el-form-item>
+
+        </el-col>
         <el-col :span="8" style="height: 58px">
           <el-form-item prop="files" label="附件">
             <fileUpload
@@ -113,6 +124,7 @@
       :isDeliveryDeadline="false"
       :isGuaranteePeriod="false"
       pageName="businessOpportunity"
+      :pricing-way="form.pricingWay"
     ></inventoryTable>
 
     <!-- <headerTitle title="竞品"></headerTitle>
@@ -191,6 +203,10 @@
       return {
         delDetailIds: [],
         PersonnelDetailIds: [],
+        pricingWayList: [
+          {id: 1, name: '按数量计价'},
+          {id: 2, name: '按重量计价'}
+        ],
         visible: false,
         title: '',
         row: {},

+ 33 - 7
src/views/bpm/handleTask/components/businessOpportunity/opportunityDetailDialog.vue

@@ -64,6 +64,11 @@
             </div>
           </el-form-item>
         </el-col>
+        <el-col :span="8">
+          <el-form-item label="计费方式:" prop="pricingWay">
+            {{ detailData.pricingWay == 1 ? '按数量计费' : '按重量计费' }}
+          </el-form-item>
+        </el-col>
         <el-col :span="16">
           <el-form-item label="备注:" prop="remark">
             {{ detailData.remark }}
@@ -82,6 +87,7 @@
       :isDeliveryDeadline="false"
       :isGuaranteePeriod="false"
       :isCustomerMark="false"
+      :pricingWay="detailData.pricingWay"
     ></inventoryTable>
 
     <inventoryTabledetail
@@ -90,6 +96,7 @@
       :isDeliveryDeadline="false"
       :isGuaranteePeriod="false"
       :isCustomerMark="false"
+     :pricingWay="detailData.pricingWay"
     ></inventoryTabledetail>
     <!-- <el-card
       shadow="never"
@@ -344,7 +351,6 @@
     },
     created() {
       this.getDetailData(this.businessId);
-      console.log(this.taskDefinitionKey,'11111111111111111');
     },
     methods: {
       downloadFile(file) {
@@ -355,16 +361,36 @@
         const data = await getDetail(id);
 
         this.loading = false;
-        if (data) {
-          this.detailData = data;
+        this.detailData = data;
+        console.log(this.detailData.pricingWay);
+        if (this.detailData ) {
           this.$refs.inventoryTable &&
-            this.$refs.inventoryTable.putTableValue(data);
+            this.$refs.inventoryTable.putTableValue(this.detailData);
           this.$refs.inventoryTabledetailRef &&
-            this.$refs.inventoryTabledetailRef.putTableValue(data);
+            this.$refs.inventoryTabledetailRef.putTableValue(this.detailData);
         }
       },
-      getTableValue() {
-        return this.$refs.inventoryTable.getTableValue();
+      getValidate() {
+        return Promise.all([
+          new Promise((resolve, reject) => {
+            this.$refs.inventoryTable.validateForm((valid) => {
+              if (!valid) {
+                reject(false);
+              } else {
+                resolve(true);
+              }
+            });
+          })
+        ]);
+      },
+    async getTableValue() {
+        try {
+          await this.getValidate();
+          return this.$refs.inventoryTable.getTableValue();
+        }catch (error) {
+          console.log(error);
+          return Promise.resolve([])
+        }
       }
     }
   };

+ 2 - 0
src/views/bpm/handleTask/components/businessOpportunity/submit.vue

@@ -177,6 +177,8 @@ export default {
         status === 1
       ) {
         let data = await this.getTableValue();
+        console.log(data.length);
+        if(!data.length) return this.$message.warning(`用必填项未填,请检查!`);
         if (!this.form.technicianId) {
           this.$message.warning(`请选择技术人员!`);
           return;

+ 19 - 3
src/views/bpm/handleTask/components/contractBook/inventoryTable.vue

@@ -419,6 +419,11 @@
       </template>
       <template v-slot:produceDeliveryDeadline="scope">
         <el-form-item
+          :rules="{
+            required: true,
+            message: '请选择日期',
+            trigger: 'change'
+          }"
           :prop="'datasource.' + scope.$index + '.produceDeliveryDeadline'"
         >
           <el-date-picker
@@ -757,6 +762,7 @@ export default {
           label: '生产交付交期',
           slot: 'produceDeliveryDeadline',
           show: this.contractBookType == 1 ? true : false,
+          headerSlot: 'headerCustomerExpectDeliveryDeadline',
           align: "center"
         },
 
@@ -895,9 +901,13 @@ export default {
         }
       });
       this.$refs.table.reRenderTable();
-    }
+    },
+    pricingWay(val) {
+      this.getTotalPrice()
+    },
   },
   created() {
+    console.log(this.pricingWay);
   },
   methods: {
     openVersion(index) {
@@ -1071,6 +1081,7 @@ export default {
     //获取合计
     getAllPrice(row) {
       let num = 0
+      console.log(this.pricingWay,'============');
       switch (this.pricingWay) {
         case 1: //按数量计价计算总金额
           num = Number(row.singlePrice) * Number(row.totalCount)
@@ -1122,8 +1133,12 @@ export default {
           }
         });
         this.form.datasource = productList;
-        this.allPrice = data?.contractVO?.totalPrice;
-        // this.getTotalPrice();
+       this.allPrice = data?.contractVO?.totalPrice || '';
+       if(!this.allPrice){
+         this.getTotalPrice();
+       }
+        console.log(data);
+
         this.form.discountTotalPrice = data?.contractVO?.discountTotalPrice;
         //this.discountInput(data?.contractVO?.discountTotalPrice);
       }
@@ -1243,6 +1258,7 @@ export default {
     },
 
     validateForm(callback) {
+      console.log(11111);
       //开始表单校验
       this.$refs.form.validate((valid) => {
         callback(valid);

+ 39 - 8
src/views/bpm/handleTask/components/contractBook/inventoryTabledetail.vue

@@ -77,6 +77,7 @@
 </template>
 <script>
 import {getFile} from "@/api/system/file";
+import {contactQueryByCategoryIdsAPI} from "@/api/bpm/components/supplierManage/contact";
 
 export default {
   props: {
@@ -101,13 +102,24 @@ export default {
       default: true,
       type: Boolean
     },
+    isSaleOrder: {
+      default: false,
+      type: Boolean
+    },
     contractBookType: {
       default: 1
     }
   },
   data() {
     return {
-      competAnalysisListcolumns: [
+      form: {},
+      supplierObj: {},
+      productList: []
+    };
+  },
+  computed: {
+    competAnalysisListcolumns() {
+      return  [
         {
           width: 45,
           type: 'index',
@@ -165,6 +177,18 @@ export default {
           show: this.isCustomerMark,
           align: 'center'
         },
+        {
+          minWidth: 120,
+          prop: 'entrustedEnterpriseId',
+          label: '受托企业',
+          slot: 'entrustedEnterpriseId',
+          show: this.isCustomerMark,
+          align: "center",
+
+          formatter: (row, column) => {
+            return  this.supplierObj[row.productId]?.find(item =>item.id === row.entrustedEnterpriseId)?.name || ''
+          }
+        },
         {
           width: 120,
           prop: 'totalCount',
@@ -350,23 +374,30 @@ export default {
           slot: 'remark',
           align: 'center'
         }
-      ],
-      form: {},
-      productList: []
-    };
+      ];
+    }
   },
-  computed: {},
 
   methods: {
     //修改回显
-    putTableValue(data) {
-      let productList =
+   async putTableValue(data) {
+     console.log(222222222222);
+     let productList =
         (data && (data.redressProductList || data.quoteProductList || data.productList)) || [];
       if (data) {
         this.form = data;
+        this.supplierObj = await this.getSupplierObj(productList, 'productId')
         this.productList = productList;
       }
     },
+    async getSupplierObj(productList,queryName){
+      try {
+        let categoryIds =  productList.map(item => item[queryName])
+        return await contactQueryByCategoryIdsAPI({categoryIds, isQueryEE: 1})
+      }catch (e) {
+        return Promise.resolve({});
+      }
+    } ,
     downloadFile(file) {
       getFile({objectName: file.storePath}, file.name);
     },

+ 109 - 27
src/views/bpm/handleTask/components/inquiryManage/addDialog.vue

@@ -71,15 +71,15 @@
       </el-row>
     </el-form>
     <headerTitle title="产品清单" style="margin-top: 15px"></headerTitle>
+    <el-button type="primary" @click="openSupplier">新增供应商</el-button>
     <inventoryTable
       ref="inventoryTable"
       @delList="delList"
       :acceptUnpack="form.acceptUnpack"
+      @supplierSelect="supplierSelect"
     ></inventoryTable>
 
     <headerTitle title="报价清单" style="margin-top: 15px"></headerTitle>
-    <el-button type="primary" @click="openSupplier">新增供应商</el-button>
-
     <inquiryManageList
       ref="inquiryManageRef"
       @changeInquiryManageList="changeInquiryManageList"
@@ -90,9 +90,7 @@
     ></supplierManageDialog>
     <inquiryTable
       @removeSupplier="removeSupplier"
-      @setSupplierId="setSupplierId"
       :ref="'inquiryTable' + item.supplierId"
-      :radio="form.winnerId"
       v-for="item in supplierList"
       :key="item.supplierId"
       style="margin-top: 15px"
@@ -111,7 +109,7 @@
 
   import fileUpload from '@/components/upload/fileUpload';
   import dictMixins from '@/mixins/dictMixins';
-
+  import {deepClone} from "@/utils";
   import { getplanDetail } from '@/api/bpm/components/purchasingManage/purchasePlanManage';
   import {
     getpurchaseinquiry,
@@ -121,6 +119,8 @@
   import { copyObj } from '@/utils/util';
 
   import { getFile } from '@/api/system/file';
+  import {contactQueryByCategoryIdsAPI} from "@/api/bpm/components/supplierManage/contact";
+  import {contactDetail} from "@/api/bpm/components/saleManage/contact";
 
   export default {
     mixins: [dictMixins],
@@ -146,7 +146,6 @@
         planId: '',
         detailList: '',
         resultList: [],
-        // supplierList: [],
         supplierName: '',
         files: [],
         acceptUnpack: ''
@@ -160,6 +159,7 @@
         detailList: [],
         list: [],
         delDetailIds: [],
+        supplierProducts: {},
         formDef,
 
         acceptUnpackList: [
@@ -203,11 +203,6 @@
         }
         this.$refs.supplierManageDialogRef.open();
       },
-      setSupplierId(data) {
-        this.form.winnerId = data.supplierId;
-        this.form.winnerName = data.supplierName;
-        chooseWinner(this.form);
-      },
       //获取询价详情
       async getDetailData(id, type) {
         this.loading = true;
@@ -215,6 +210,11 @@
         this.loading = false;
         if (data) {
           this.form = data;
+          this.supplierList = data.supplierList;
+          let supplierObj = await this.getSupplierObj(data.detailList,'productId');
+          data.detailList.forEach((item) => {
+            item.supplierList = supplierObj[item.productId] || []
+          });
           this.list = data.detailList;
           this.supplierList = data.supplierList;
           this.$nextTick(() => {
@@ -237,18 +237,30 @@
         let data = await getplanDetail(id);
         this.loading = false;
         if (data) {
+          let supplierObj = await this.getSupplierObj(data.detailList,'productId');
+          data.detailList.forEach((item) => {
+            if (item.arrivalWay == 2 && item.arrivalBatch.length > 0) {
+              item.expectReceiveDate =
+                item.arrivalBatch[item.arrivalBatch.length - 1].arriveDate;
+            }
+            item.supplierList = supplierObj[item.productId] || []
+            if(item.supplierList.length === 1){
+              item.supplierIds = [item.supplierList[0].id]
+              this.supplierSelect(item)
+            }
+          });
           this.$set(this.form, 'acceptUnpack', data.acceptUnpack);
           this.form.planId = data.id;
           this.form.planCode = data.planCode;
           this.form.planName = data.planName;
 
-          if (type == 'change') {
-            this.supplierList.forEach((item) => {
-              this.$refs['inquiryTable' + item.supplierId][0].putTableValue(
-                data.detailList
-              );
-            });
-          }
+          // if (type == 'change') {
+          //   this.supplierList.forEach((item) => {
+          //     this.$refs['inquiryTable' + item.supplierId][0].putTableValue(
+          //       data.detailList
+          //     );
+          //   });
+          // }
           if (type == 'init') {
             return;
           }
@@ -259,7 +271,14 @@
           });
         }
       },
-
+      async getSupplierObj(productList,queryName){
+        try {
+          let categoryIds =  productList.map(item => item[queryName])
+          return await contactQueryByCategoryIdsAPI({categoryIds})
+        }catch (e) {
+          return Promise.resolve({});
+        }
+      } ,
       getValidate() {
         let promises = [];
         this.supplierList.forEach((item) => {
@@ -298,10 +317,6 @@
         });
       },
       removeSupplier(supplierId) {
-        if(supplierId == this.form.winnerId){
-          this.form.winnerId = ''
-          this.form.winnerName = ''
-        }
         this.supplierList = this.supplierList.filter(
           (item) => item.supplierId != supplierId
         );
@@ -313,26 +328,93 @@
       },
 
       changeInquiryManageList(data) {
-        // this.form.planId = data.id;
-        // this.form.planCode = data.planCode;
         this.getplanData(data.id, 'change');
       },
+      async supplierSelect(row) {
+        let supplierIds = Object.keys(this.supplierProducts);
+        const promises = [];
+        row.supplierIds.forEach(item => {
+          if (!supplierIds.includes(item)) {
+            promises.push(contactDetail(item));
+          } else {
+            this.productSetSupplier(this.supplierProducts[item], row)
+          }
+        });
+        Promise.all(promises).then(results => {
+          results.forEach((data, index) => {
+            this.supplierProducts[data.base.id] = data;
+            this.productSetSupplier(this.supplierProducts[data.base.id], row)
+          });
+        });
+      },
+      productSetSupplier(data, row) {
+        let obj = deepClone(row);
+        obj.supplierProductName = data.productList.find(item => item.productCode == row.productCode)?.productName
+        obj.supplierProductCode = data.productList.find(item => item.productCode == row.productCode)?.productCode
+        obj.supplierName = data.base.name
+        let params = {
+          ...data.base,
+          supplierId: data.base.id,
+          supplierName: data.base.name,
+          supplierCode: data.base.code,
+          files: [],
+          preferentialPrice: '',
+          settlementMode: '',
+          settlementModeName: '',
+          taxRate: '',
+          totalPrice: '',
+          resultList: [obj],
+        }
+        let supplierIds = this.supplierList.map((item) => item.supplierId);
+        let supplierIndex = supplierIds.indexOf(data.base.id)
+        if (supplierIndex == -1) {
+          this.supplierList.push(params);
+        } else {
+          let isHave = this.supplierList[supplierIndex].resultList.some(item => item.productCode == obj.productCode)
+          if (!isHave) {
+            // putTableValue
+            //this.supplierList[supplierIndex].resultList.push(obj)
+            this.$set(this.supplierList[supplierIndex],'resultList',[ ...this.supplierList[supplierIndex].resultList,obj])
+            this.$nextTick(() => {
+              this.$refs['inquiryTable' + data.base.id][0]?.putTableValue(this.supplierList[supplierIndex].resultList)
+              this.$refs['inquiryTable' + data.base.id][0]?.getSpanArr();
+            })
+          }
+        }
+      },
       //供应商回调
       supplierManageChange(data) {
         let supplierIds = this.supplierList.map((item) => item.supplierId);
         data.forEach((item) => {
           item['files'] = [];
+          item['supplierName'] = item.name;
           item['preferentialPrice'] = '';
           item['settlementMode'] = '';
           item['settlementModeName'] = '';
           item['taxRate'] = '';
           item['totalPrice'] = '';
-          item['resultList'] = copyObj(this.list);
+          item['resultList'] = copyObj(this.$refs.inventoryTable.selection)
           item['resultList'].forEach((val) => {
             val['remark'] = '';
+            val.supplierName = item.name;
           });
-          if (!supplierIds.includes(item.supplierId)) {
+
+          let supplierIndex = supplierIds.indexOf(item.supplierId)
+          if (supplierIndex == -1) {
             this.supplierList.push(item);
+          } else {
+            item['resultList'].forEach((val) => {
+              let isHave = this.supplierList[supplierIndex].resultList.some(i => i.productCode == val.productCode)
+              console.log(isHave,supplierIndex);
+              if (!isHave) {
+
+                this.$set(this.supplierList[supplierIndex],'resultList',[ ...this.supplierList[supplierIndex].resultList,val])
+                this.$refs['inquiryTable' + item.id][0]?.putTableValue(this.supplierList[supplierIndex].resultList)
+                this.$nextTick(() => {
+                  this.$refs['inquiryTable' + item.id][0]?.getSpanArr();
+                })
+              }
+            })
           }
         });
       },

+ 589 - 463
src/views/bpm/handleTask/components/inquiryManage/inquiryTable.vue

@@ -1,42 +1,13 @@
 <template>
   <el-form :model="form" ref="form">
-    <el-row
-      type="flex"
-      justify="space-between"
-      align="middle"
-      style="margin-top: 20px; margin-bottom: 10px"
-    >
-      <el-row type="flex" align="middle">
-        <h4>供应商:{{ form.supplierName }}</h4>
-      </el-row>
-      <el-row type="flex" align="end">
-        <el-radio
-          v-model="radio1"
-          @input="changeValue"
-          :label="form.supplierId"
-          style="margin-right;: 10px"
-          :disabled="status == 'Detail'"
-          >是否中标</el-radio
-        >
-        <el-popconfirm
-          class="ele-action"
-          title="确定要删除吗?"
-          @confirm="removeSupplier"
-          :disabled="status == 'Detail'"
-        >
-          <template v-slot:reference>
-            <el-link type="danger" :underline="false" icon="el-icon-delete">
-              删除
-            </el-link>
-          </template>
-        </el-popconfirm>
-      </el-row>
-    </el-row>
+
     <ele-pro-table
       ref="table"
       :needPage="false"
       :columns="columns"
       :toolkit="[]"
+      max-height="500px"
+      :span-method="objectSpanMethod"
       :datasource="form.resultList"
       cache-key="systemRoleTable17"
       class="time-form"
@@ -44,177 +15,155 @@
       <!-- 表头工具栏 -->
 
       <template v-slot:toolbar>
-        <div class="headbox">
-          <div>
-            <el-row>
-              <!-- <el-col :span="12" style="margin-bottom: 22px">
-                <el-form-item
-                  label="供应商"
-                  prop="supplierName"
-                  label-width="120px"
-                >
-                  <el-input disabled v-model="form.supplierName"></el-input>
-                </el-form-item>
-              </el-col> -->
-              <el-col :span="12" style="margin-bottom: 22px">
-                <el-form-item
-                  prop="supplierCode"
-                  label="编码"
-                  label-width="120px"
-                >
-                  <el-input v-model="form.supplierCode" disabled></el-input>
-                </el-form-item>
-              </el-col>
-
-              <el-col :span="12" style="margin-bottom: 22px">
-                <el-form-item
-                  label-width="120px"
-                  prop="settlementMode"
-                  label="结算方式"
-                  :rules="{
-                    required: true,
-                    message: '请选择结算方式',
-                    trigger: 'blur'
-                  }"
-                >
-                  <DictSelection
-                    dictName="结算方式"
-                    clearable
-                    v-model="form.settlementMode"
-                    @itemChange="chaengMode"
-                    :disabled="status == 'Detail'"
-                  >
-                  </DictSelection>
-                </el-form-item>
-              </el-col>
-              <el-col :span="12" style="margin-bottom: 22px">
-                <el-form-item
-                  label-width="120px"
-                  prop="totalPrice"
-                  label="总价"
-                  :rules="{
+        <el-row
+          type="flex"
+          justify="end"
+          align="middle"
+        >
+          <el-popconfirm
+            class="ele-action"
+            title="确定要删除吗?"
+            @confirm="removeSupplier"
+            v-if="status!=='Detail'"
+          >
+            <template v-slot:reference>
+              <el-link type="danger" title="删除供应商" :underline="false" icon="el-icon-delete">
+                删除
+              </el-link>
+            </template>
+          </el-popconfirm>
+        </el-row>
+      </template>
+      <template v-slot:supplierName="{ row, $index }">
+        {{ form.supplierName }}
+      </template>
+      <template v-slot:supplierTotalPrice="{ row, $index }">
+        {{ form.totalPrice }}
+      </template>
+      <template v-slot:preferentialPrice="{ row, $index }">
+        <el-form-item
+          prop="preferentialPrice"
+          :rules="{
                     required: true,
+                    message: '请输入优惠价',
                     trigger: 'blur'
                   }"
-                >
-                  <el-input v-model="form.totalPrice" disabled>
-                    <template slot="suffix">元</template>
-                  </el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :span="12" style="margin-bottom: 22px">
-                <el-form-item
-                  label-width="120px"
-                  prop="preferentialPrice"
-                  style="margin-bottom: 22px"
-                  label="优惠价"
-                  :rules="{
+        >
+          <el-input
+            v-model="form.preferentialPrice"
+            :disabled="status == 'Detail'"
+          ></el-input>
+        </el-form-item>
+      </template>
+      <template v-slot:settlementMode="{ row, $index }">
+        <el-form-item
+          prop="settlementMode"
+          :rules="{
                     required: true,
                     message: '请输入优惠价',
-                    trigger: 'blur'
-                  }"
-                >
-                  <el-input
-                    v-model="form.preferentialPrice"
-                    :disabled="status == 'Detail'"
-                  ></el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :span="12" style="margin-bottom: 22px">
-                <el-form-item prop="taxRate" label="税率" label-width="120px">
-                  <el-input
-                    v-model="form.taxRate"
-                    style="width: 100%"
-                    :disabled="status == 'Detail'"
-                  >
-                    <template slot="suffix">%</template>
-                  </el-input>
-                </el-form-item>
-              </el-col>
-              <el-col :span="12" style="margin-bottom: 22px">
-                <el-form-item
-                  label-width="120px"
-                  prop="deliveryDate"
-                  label="交货日期"
-                  :rules="{
+                    trigger: 'change'
+                  }">
+          <DictSelection
+            dictName="结算方式"
+            clearable
+            v-model="form.settlementMode"
+            @itemChange="chaengMode"
+            :disabled="status == 'Detail'"
+          >
+          </DictSelection>
+        </el-form-item>
+      </template>
+      <template v-slot:deliveryDate="{ row, $index }">
+        <el-form-item
+          prop="deliveryDate"
+          :rules="{
                     required: true,
-                    message: '请选择日期',
-                    trigger: 'blur'
+                    message: '请选择交货日期',
+                    trigger: 'change'
                   }"
-                >
-                  <el-date-picker
-                    style="width: 100%"
-                    clearable
-                    type="date"
-                    :disabled="status == 'Detail'"
-                    v-model="form.deliveryDate"
-                    value-format="yyyy-MM-dd"
-                    placeholder="请选择日期"
-                  >
-                  </el-date-picker>
-                </el-form-item>
-              </el-col>
-
-              <el-col :span="12" style="margin-bottom: 22px">
-                <el-form-item label-width="120px" prop="files" label="附件">
-                  <fileUpload
-                    v-if="status != 'Detail'"
-                    v-model="form.files"
-                    module="main"
-                    :showLib="false"
-                    :limit="5"
-                  />
-                  <div
-                    v-if="
-                      form.files && form.files?.length && status == 'Detail'
-                    "
-                  >
-                    <el-link
-                      v-for="link in form.files"
-                      :key="link.id"
-                      type="primary"
-                      :underline="false"
-                      @click="downloadFile(link)"
-                    >
-                      {{ link.name }}</el-link
-                    >
-                  </div>
-                </el-form-item>
-              </el-col>
-            </el-row>
+        >
+          <el-date-picker
+            style="width: 100%"
+            clearable
+            type="date"
+            :disabled="status == 'Detail'"
+            v-model="form.deliveryDate"
+            value-format="yyyy-MM-dd"
+            placeholder="请选择日期"
+          >
+          </el-date-picker>
+        </el-form-item>
+      </template>
+      <template v-slot:taxRate="{ row, $index }">
+        <el-form-item prop="taxRate">
+          <el-input
+            v-model="form.taxRate"
+            style="width: 100%"
+            :disabled="status == 'Detail'"
+          >
+            <template slot="suffix">%</template>
+          </el-input>
+        </el-form-item>
+      </template>
+      <template v-slot:files="{ row, $index }">
+        <el-form-item prop="files">
+          <fileUpload
+            v-if="status != 'Detail'"
+            v-model="form.files"
+            module="main"
+            :showLib="false"
+            :limit="5"
+          />
+          <div
+            v-if=" form.files && form.files?.length && status == 'Detail' ">
+            <el-link
+              v-for="link in form.files"
+              :key="link.id"
+              type="primary"
+              :underline="false"
+              @click="downloadFile(link)"
+            >
+              {{ link.name }}
+            </el-link
+            >
           </div>
-        </div>
+        </el-form-item>
       </template>
-      <template v-slot:supplierProductName="{ row, $index }">
+
+
+      <template v-slot:isWinner="{ row, $index }">
         <el-form-item
           style="margin-bottom: 20px"
-          :prop="'resultList.' + $index + '.supplierProductName'"
+          :prop="'resultList.' + $index + '.isWinner'"
           :rules="{
             required: true,
             message: '请输入',
             trigger: 'change'
           }"
         >
-          <el-input
-            v-model="row.supplierProductName"
-            placeholder="请输入"
-            :disabled="status == 'Detail'"
-          ></el-input>
+          <el-select v-model="row.isWinner" :disabled="status == 'Detail'">
+            <el-option label="是" :value="1"></el-option>
+            <el-option label="否" :value="0"></el-option>
+          </el-select>
         </el-form-item>
       </template>
-      <!-- <template v-slot:productCode="scope">
+      <template v-slot:supplierProductName="{ row, $index }">
         <el-form-item
           style="margin-bottom: 20px"
-          :prop="'resultList.' + scope.$index + '.productCode'"
+          :prop="'resultList.' + $index + '.supplierProductName'"
           :rules="{
             required: true,
             message: '请输入',
             trigger: 'change'
           }"
         >
-          <el-input v-model="scope.row.productCode" disabled></el-input>
+          <el-input
+            v-model="row.supplierProductName"
+            placeholder="请输入"
+            :disabled="status == 'Detail'"
+          ></el-input>
         </el-form-item>
-      </template> -->
+      </template>
       <template v-slot:supplierProductCode="scope">
         <el-form-item
           style="margin-bottom: 20px"
@@ -279,14 +228,17 @@
           }"
         >
           <el-input
+            @blur="changeGetPrice(scope.row)"
             v-model="scope.row.singlePrice"
             :disabled="status == 'Detail'"
-          ></el-input>
+            type="number"
+          >
+            <template slot="suffix">元</template>
+          </el-input>
         </el-form-item>
       </template>
       <template v-slot:totalCount="scope">
         <el-form-item
-          style="margin-bottom: 20px"
           :prop="'resultList.' + scope.$index + '.totalCount'"
           :rules="{
             required: true,
@@ -296,6 +248,7 @@
           }"
         >
           <el-input
+            @blur="changeGetPrice(scope.row)"
             v-model="scope.row.totalCount"
             :disabled="status == 'Detail'"
             placeholder="请输入"
@@ -305,8 +258,8 @@
 
       <template v-slot:totalPrice="scope">
         <span>{{
-          totalPrice(scope.row.totalCount, scope.row.singlePrice, scope.row)
-        }}</span>
+            totalPrice(scope.row.totalCount, scope.row.singlePrice, scope.row)
+          }}</span>
       </template>
 
       <template v-slot:modelType="scope">
@@ -332,23 +285,23 @@
           ></el-input>
         </el-form-item>
       </template>
-      <template v-slot:measuringUnit="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'resultList.' + scope.$index + '.measuringUnit'"
-          :rules="{
-            required: false,
-            message: '请输入',
-            trigger: 'blur'
-          }"
-        >
-          <el-input
-            v-model="scope.row.measuringUnit"
-            placeholder="请输入"
-            :disabled="true"
-          ></el-input>
-        </el-form-item>
-      </template>
+      <!--      <template v-slot:measuringUnit="scope">-->
+      <!--        <el-form-item-->
+      <!--          style="margin-bottom: 20px"-->
+      <!--          :prop="'resultList.' + scope.$index + '.measuringUnit'"-->
+      <!--          :rules="{-->
+      <!--            required: false,-->
+      <!--            message: '请输入',-->
+      <!--            trigger: 'blur'-->
+      <!--          }"-->
+      <!--        >-->
+      <!--          <el-input-->
+      <!--            v-model="scope.row.measuringUnit"-->
+      <!--            placeholder="请输入"-->
+      <!--            :disabled="true"-->
+      <!--          ></el-input>-->
+      <!--        </el-form-item>-->
+      <!--      </template>-->
 
       <template v-slot:remark="scope">
         <el-form-item
@@ -363,7 +316,9 @@
           ></el-input>
         </el-form-item>
       </template>
-
+      <template v-slot:isRequired="{ column }">
+        <span class="is-required">{{ column.label }}</span>
+      </template>
       <!-- <template v-slot:files="scope">
         <el-form-item prop="files">
           <fileUpload
@@ -378,299 +333,470 @@
   </el-form>
 </template>
 <script>
-  import { numberReg } from 'ele-admin';
-  import dictMixins from '@/mixins/dictMixins';
-  import fileUpload from '@/components/upload/fileUpload';
-  import { copyObj } from '@/utils/util';
-  // import headList from '@/views/saleManage/businessOpportunity/components/headList.vue';
-  const defaultColumns = [
-    {
-      width: 45,
-      type: 'index',
-      columnKey: 'index',
-      align: 'center',
-      fixed: 'left'
-    },
+import {numberReg} from 'ele-admin';
+import dictMixins from '@/mixins/dictMixins';
+import fileUpload from '@/components/upload/fileUpload';
+import {copyObj} from '@/utils/util';
+import {getFile} from "@/api/system/file";
+// import headList from '@/views/saleManage/businessOpportunity/components/headList.vue';
+const defaultColumns = [
+  {
+    width: 50,
+    label: '序号',
+    type: 'index',
+    columnKey: 'index',
+    align: 'center',
+    fixed: 'left'
+  },
+  {
+    minWidth: 120,
+    prop: 'supplierName',
+    label: '供应商',
+    slot: 'supplierName',
+    align: "center",
+    showOverflowTooltip: true,
+    isMerge: true,
+    fixed: 'left'
 
-    {
-      width: 140,
-      prop: 'productCode',
-      label: '编码',
-      slot: 'productCode',
-      fixed: 'left'
-    },
-    {
-      width: 200,
-      prop: 'productName',
-      label: '产品名称',
-      slot: 'productName',
-      fixed: 'left'
-    },
-    {
-      width: 240,
-      prop: 'supplierProductCode',
-      label: '供应商产品编码',
-      slot: 'supplierProductCode'
+  },
+  {
+    minWidth: 80,
+    prop: 'supplierTotalPrice',
+    label: '总价',
+    slot: 'supplierTotalPrice',
+    align: "center",
+    showOverflowTooltip: true,
+    isMerge: true,
+    fixed: 'left'
+  },
+  {
+    minWidth: 120,
+    prop: 'preferentialPrice',
+    label: '优惠后总价',
+    slot: 'preferentialPrice',
+    headerSlot: 'isRequired',
+    align: "center",
+    showOverflowTooltip: true,
+    isMerge: true,
+    fixed: 'left'
+  },
+  {
+    minWidth: 120,
+    prop: 'settlementMode',
+    label: '结算方式',
+    slot: 'settlementMode',
+    headerSlot: 'isRequired',
+    align: "center",
+    showOverflowTooltip: true,
+    isMerge: true,
+    fixed: 'left'
+  },
+  {
+    minWidth: 160,
+    prop: 'deliveryDate',
+    label: '交货日期',
+    slot: 'deliveryDate',
+    headerSlot: 'isRequired',
+    align: "center",
+    showOverflowTooltip: true,
+    isMerge: true,
+    fixed: 'left'
+  },
+  {
+    minWidth: 100,
+    prop: 'productCode',
+    label: '编码',
+    slot: 'productCode',
+    align: "center",
+    showOverflowTooltip: true
+  },
+  {
+    minWidth: 100,
+    prop: 'productName',
+    label: '产品名称',
+    slot: 'productName',
+    align: "center",
+    showOverflowTooltip: true
+  },
+  {
+    minWidth: 100,
+    prop: 'isWinner',
+    label: '是否中标',
+    slot: 'isWinner',
+    align: "center",
+    headerSlot: 'isRequired',
+    showOverflowTooltip: true
+  },
+  {
+    minWidth: 140,
+    prop: 'supplierProductCode',
+    label: '供应商产品编码',
+    slot: 'supplierProductCode',
+    align: "center"
+  },
+  {
+    minWidth: 160,
+    prop: 'supplierProductName',
+    label: '供应商产品名称',
+    slot: 'supplierProductName',
+    headerSlot: 'isRequired',
+    align: "center"
+  },
+
+  {
+    minWidth: 90,
+    prop: 'totalCount',
+    label: '购买数量',
+    slot: 'totalCount',
+    headerSlot: 'isRequired',
+    align: "center"
+  },
+  {
+    minWidth: 80,
+    prop: 'measuringUnit',
+    label: '计量单位',
+    slot: 'measuringUnit',
+    align: "center"
+  },
+  {
+    minWidth: 120,
+    prop: 'singlePrice',
+    label: '采购单价',
+    slot: 'singlePrice',
+    headerSlot: 'isRequired',
+    align: "center"
+  },
+  {
+    minWidth: 80,
+    prop: 'totalPrice',
+    label: '采购金额',
+    slot: 'totalPrice',
+    align: "center"
+  },
+  {
+    minWidth: 120,
+    prop: 'modelType',
+    label: '型号',
+    slot: 'modelType',
+    align: "center"
+  },
+
+  {
+    minWidth: 120,
+    prop: 'specification',
+    label: '规格',
+    slot: 'specification',
+    align: "center"
+  },
+
+  // {
+  //   width: 130,
+  //   prop: 'brand',
+  //   label: '品牌',
+  //   slot: 'brand'
+  // },
+  {
+    minWidth: 80,
+    prop: 'deliveryDays',
+    label: '交期(天)',
+    slot: 'deliveryDays',
+    align: "center"
+  },
+  {
+    minWidth: 100,
+    prop: 'guaranteePeriod',
+    label: '质保期',
+    slot: 'guaranteePeriod',
+    align: "center"
+  },
+  {
+    minWidth: 120,
+    prop: 'guaranteePeriodUnitCode',
+    label: '质保期单位',
+    slot: 'guaranteePeriodUnitCode',
+    align: "center"
+  },
+  {
+    minWidth: 220,
+    prop: 'remark',
+    label: '备注',
+    slot: 'remark',
+    align: "center"
+  },
+  {
+    minWidth: 90,
+    prop: 'taxRate',
+    label: '税率',
+    slot: 'taxRate',
+    align: "center",
+    isMerge: true,
+    showOverflowTooltip: true,
+  },
+  {
+    minWidth: 220,
+    prop: 'files',
+    label: '附件',
+    slot: 'files',
+    align: "center",
+    isMerge: true,
+    showOverflowTooltip: true,
+  },
+];
+export default {
+  mixins: [dictMixins],
+  components: {
+    fileUpload
+    // headList
+  },
+  props: {
+    obj: {},
+    status: {
+      default: 'edit'
     },
-    {
-      width: 200,
-      prop: 'supplierProductName',
-      label: '供应商产品名称',
-      slot: 'supplierProductName'
+    radio: {
+      default: ''
     },
+    isUpdate: {
+      default: false
+    }
+  },
+  data() {
+    const defaultForm = {
+      key: null,
+      endTime: '',
+      isFirst: 0,
+      name: ''
+    };
 
-    {
-      width: 130,
-      prop: 'modelType',
-      label: '型号',
-      slot: 'modelType'
-    },
+    return {
+      numberReg,
+      defaultForm,
+      radio1: '',
+      form: {
+        resultList: [
+          {
+            supplierProductCode: '',
+            deliveryDays: '',
+            guaranteePeriod: '',
+            guaranteePeriodUnitCode: '',
+            guaranteePeriodUnitName: '',
+            measuringUnit: '',
+            modelType: '',
+            productCode: '',
+            isWinner: '',
+            remark: '',
+            singlePrice: '',
+            specification: '',
+            supplierProductName: '',
+            technicalAnswerName: '',
+            technicalParams: '',
+            totalCount: '',
+            totalPrice: ''
+          }
+        ]
+      },
+      dataList: [],
+      spanArr: [],
 
-    {
-      width: 120,
-      prop: 'specification',
-      label: '规格',
-      slot: 'specification'
+      columns: [...defaultColumns]
+    };
+  },
+  computed: {},
+  watch: {
+    radio(n, v) {
+      this.radio1 = n;
+    }
+  },
+
+  created() {
+    this.form = copyObj(this.obj);
+    console.log(this.obj);
+    this.radio1 = this.radio;
+    this.getSpanArr()
+    // this.dataList=copyObj(this.list)
+  },
+  methods: {
+    objectSpanMethod({row, column, rowIndex, columnIndex}) {
+      if (this.columns[columnIndex]?.isMerge) {
+        const _row = this.spanArr[rowIndex]?.supplierName || 0;
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      }
+      return {
+        rowspan: 1,
+        colspan: 1
+      };
     },
-    {
-      width: 80,
-      prop: 'totalCount',
-      label: '购买数量',
-      slot: 'totalCount'
+    getSpanArr() {
+      let pos = 0;
+      this.spanArr = [];
+      this.form.resultList.forEach((item, index) => {
+        if (index === 0) {
+          let obj = {}
+          this.columns.forEach(col => {
+            if (col.isMerge) {
+              obj[col.prop] = 1
+            }
+          });
+          this.spanArr.push(obj);
+        } else {
+          let nameSame = item.supplierName === this.form.resultList[index - 1].supplierName;
+          if (nameSame) {
+            this.spanArr[pos].supplierName += 1;
+            this.spanArr.push({
+              supplierName: 0,
+              supplierTotalPrice: 0,
+              preferentialPrice: 0,
+              settlementMode: 0,
+              taxRate: 0,
+              files: 0,
+              deliveryDate: 0
+            });
+          } else {
+            pos = index;
+            let obj = {}
+            this.columns.forEach(col => {
+              if (col.isMerge) {
+                obj[col.prop] = 1
+              }
+            });
+            this.spanArr.push(obj);
+          }
+          // let totalPriceSame = item.totalPrice === this.form.resultList[index - 1].totalPrice;
+          // if (totalPriceSame) {
+          //   this.spanArr[pos].totalPrice += 1;
+          //   this.spanArr.push({ totalPrice: 0 });
+          // } else {
+          //   pos = index;
+          //   this.spanArr.push({ totalPrice: 1 });
+          // }
+
+        }
+      });
     },
-    {
-      width: 120,
-      prop: 'singlePrice',
-      label: '销售单价(元)',
-      slot: 'singlePrice'
+    downloadFile(file) {
+      getFile({objectName: file.storePath}, file.name);
     },
-    {
-      width: 150,
-      prop: 'totalPrice',
-      label: '销售金额(元)',
-      slot: 'totalPrice'
+    //
+    changeGetPrice(row) {
+      if (row.singlePrice && row.totalCount) {
+        let num = 0
+        this.form.resultList.forEach((item) => {
+          num += item.totalPrice || 0;
+        });
+        this.form.preferentialPrice = parseFloat(num.toFixed(2));
+      }
     },
-    {
-      width: 100,
-      prop: 'measuringUnit',
-      label: '计量单位',
-      slot: 'measuringUnit'
+    //计算销售金额
+    totalPrice(a, b, row) {
+      if (!a || !b) {
+        return;
+      }
+      row.totalPrice = parseFloat((a * b).toFixed(2));
+      this.totalPriceAll();
+      return row.totalPrice;
     },
-
-
-    // {
-    //   width: 130,
-    //   prop: 'brand',
-    //   label: '品牌',
-    //   slot: 'brand'
-    // },
-    {
-      width: 80,
-      prop: 'deliveryDays',
-      label: '交期(天)',
-      slot: 'deliveryDays'
+    //计算销售总价
+    totalPriceAll() {
+      let num = 0;
+      this.form.resultList.forEach((item) => {
+        num += item.totalPrice || 0;
+      });
+      this.form.totalPrice = parseFloat(num.toFixed(2));
+      // this.form.preferentialPrice = parseFloat(num.toFixed(2));
+      // console.log(this.form.resultList,'dasdasd')
     },
-    {
-      width: 120,
-      prop: 'guaranteePeriod',
-      label: '质保期',
-      slot: 'guaranteePeriod'
+    // 返回列表数据
+    getTableValue() {
+      return this.form;
     },
-    {
-      width: 120,
-      prop: 'guaranteePeriodUnitCode',
-      label: '质保期单位',
-      slot: 'guaranteePeriodUnitCode'
+    chaengMode(data) {
+      this.form.settlementModeName = data.dictValue;
     },
-
-    {
-      width: 220,
-      prop: 'remark',
-      label: '备注',
-      slot: 'remark'
-    }
-  ];
-  export default {
-    mixins: [dictMixins],
-    components: {
-      fileUpload
-      // headList
+    chaengUnitCode(data) {
+      this.form.settlementModeName = data.dictValue;
     },
-    props: {
-      obj: {},
-      status: {
-        default: 'edit'
-      },
-      radio: {
-        default: ''
-      },
-      isUpdate: {
-        default: false
-      }
+    //修改回显
+    putTableValue(data) {
+      this.form.resultList = copyObj(data);
     },
-    data() {
-      const defaultForm = {
-        key: null,
-        endTime: '',
-        isFirst: 0,
-        name: ''
-      };
 
-      return {
-        numberReg,
-        defaultForm,
-        radio1: '',
-        form: {
-          resultList: [
-            {
-              supplierProductCode: '',
-              deliveryDays: '',
-              guaranteePeriod: '',
-              guaranteePeriodUnitCode: '',
-              guaranteePeriodUnitName: '',
-              measuringUnit: '',
-              modelType: '',
-              productCode: '',
-              remark: '',
-              singlePrice: '',
-              specification: '',
-              supplierProductName: '',
-              technicalAnswerName: '',
-              technicalParams: '',
-              totalCount: '',
-              totalPrice: ''
-            }
-          ]
-        },
-        dataList: [],
-
-        columns: [...defaultColumns]
-      };
+    remove(productCode) {
+      let index = this.form.resultList.findIndex(
+        (item) => item.productCode == productCode
+      );
+      this.form.resultList.splice(index, 1);
+      this.setSort();
     },
-    computed: {},
-    watch: {
-      radio(n, v) {
-        this.radio1 = n;
-      }
+    removeSupplier() {
+      this.$emit('removeSupplier', this.form.supplierId);
     },
-
-    created() {
-      this.form = copyObj(this.obj);
-      this.radio1 = this.radio;
-      // this.dataList=copyObj(this.list)
+    // 清空表格
+    restTable() {
+      this.form.resultList = [];
+    },
+    // 重新排序
+    setSort() {
+      this.form.resultList.forEach((n, index) => {
+        n.key = index + 1;
+      });
     },
-    methods: {
-      changeValue() {
-        this.$refs.form.validate((valid) => {
-          if (valid) {
-            this.$emit('setSupplierId', {
-              supplierName: this.form.supplierName,
-              supplierId: this.form.supplierId
-            });
-          }else{
-            this.radio1=''
-          }
-        });
-      },
-      //计算销售金额
-      totalPrice(a, b, row) {
-        if (!a || !b) {
-          return;
-        }
-        row.totalPrice = parseFloat((a * b).toFixed(2));
-        this.totalPriceAll();
-        return row.totalPrice;
-      },
-      //计算销售总价
-      totalPriceAll() {
-        let num = 0;
-        this.form.resultList.forEach((item) => {
-          num += item.totalPrice;
-        });
-        this.form.totalPrice = parseFloat(num.toFixed(2));
-        // this.form.preferentialPrice = parseFloat(num.toFixed(2));
-        // console.log(this.form.resultList,'dasdasd')
-      },
-      // 返回列表数据
-      getTableValue() {
-        console.log(this.form, 'this.form');
-        return this.form;
-      },
-      chaengMode(data) {
-        this.form.settlementModeName = data.dictValue;
-      },
-      chaengUnitCode(data) {
-        this.form.settlementModeName = data.dictValue;
-      },
-      //修改回显
-      putTableValue(data) {
-        this.form.resultList = copyObj(data);
-      },
-
-      remove(productCode) {
-        let index = this.form.resultList.findIndex(
-          (item) => item.productCode == productCode
-        );
-        this.form.resultList.splice(index, 1);
-        this.setSort();
-      },
-      removeSupplier() {
-        this.$emit('removeSupplier', this.form.supplierId);
-      },
-      // 清空表格
-      restTable() {
-        this.form.resultList = [];
-      },
-      // 重新排序
-      setSort() {
-        this.form.resultList.forEach((n, index) => {
-          n.key = index + 1;
-        });
-      },
 
-      validateForm(callback) {
-        //开始表单校验
-        this.$refs.form.validate((valid) => {
-          callback(valid);
-        });
-      }
+    validateForm(callback) {
+      //开始表单校验
+      this.$refs.form.validate((valid) => {
+        callback(valid);
+      });
     }
-  };
+  }
+};
 </script>
 <style lang="scss" scoped>
-  .headbox {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    .amount {
-      font-size: 14px;
-      font-weight: bold;
-    }
-  }
-  .time-form .el-form-item {
-    margin-bottom: 0 !important;
+.headbox {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+
+  .amount {
+    font-size: 14px;
+    font-weight: bold;
   }
+}
 
-  ::v-deep .period {
-    display: flex;
-    .borderleftnone {
-      .el-input--medium .el-input__inner {
-        border-top-right-radius: 0;
-        border-bottom-right-radius: 0;
-      }
-    }
-    .borderrightnone {
-      .el-input--medium .el-input__inner {
-        border-top-left-radius: 0;
-        border-bottom-left-radius: 0;
-      }
+.time-form .el-form-item {
+  margin-bottom: 0 !important;
+}
+
+::v-deep .period {
+  display: flex;
+
+  .borderleftnone {
+    .el-input--medium .el-input__inner {
+      border-top-right-radius: 0;
+      border-bottom-right-radius: 0;
     }
   }
 
-  ::v-deep .time-form tbody > tr:hover > td {
-    background-color: transparent !important;
-  }
-  ::v-deep .time-form .el-table tr {
-    background-color: #ffffff;
+  .borderrightnone {
+    .el-input--medium .el-input__inner {
+      border-top-left-radius: 0;
+      border-bottom-left-radius: 0;
+    }
   }
+}
+
+::v-deep .time-form tbody > tr:hover > td {
+  background-color: transparent !important;
+}
+
+::v-deep .time-form .el-table tr {
+  background-color: #ffffff;
+}
+
+::v-deep .el-upload-list--text {
+  width: 75%;
+}
 </style>

+ 471 - 382
src/views/bpm/handleTask/components/inquiryManage/inventoryTable.vue

@@ -5,145 +5,135 @@
       :needPage="false"
       :columns="columns"
       :toolkit="[]"
+      max-height="500px"
       :datasource="form.datasource"
       cache-key="systemRoleTable17"
       class="time-form"
+      :selection.sync="selection"
     >
-      <!-- 表头工具栏 -->
-      <!-- <template v-slot:toolbar>
-        <div class="headbox">
-          <el-button
-            size="small"
-            type="primary"
-            icon="el-icon-plus"
-            class="ele-btn-icon"
-            @click="handParent"
-          >
-            新增
-          </el-button>
-        </div>
-      </template> -->
-      <template v-slot:productName="{ row, $index }">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + $index + '.productName'"
-          :rules="{
-            required: true,
-            message: '请输入',
-            trigger: 'change'
-          }"
-        >
-          <el-input
-            v-model="row.productName"
-            placeholder="请输入"
-            disabled
-          ></el-input>
-        </el-form-item>
-      </template>
-      <template v-slot:productCode="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.productCode'"
-        >
-          <el-input v-model="scope.row.productCode" disabled></el-input>
-        </el-form-item>
-      </template>
-      <template v-slot:productCategoryName="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.productCategoryName'"
-        >
-          <el-input v-model="scope.row.productCategoryName" disabled></el-input>
-        </el-form-item>
-      </template>
-      <template v-slot:totalCount="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.totalCount'"
-          :rules="{
-            required: true,
-            pattern: numberReg,
-            message: '请输入数字',
-            trigger: 'blur'
-          }"
-        >
-          <el-input
-            v-model="scope.row.totalCount"
-            disabled
-            placeholder="请输入"
-          ></el-input>
-        </el-form-item>
-      </template>
+<!--      <template v-slot:productName="{ row, $index }">-->
+<!--        <el-form-item-->
+<!--          style="margin-bottom: 20px"-->
+<!--          :prop="'datasource.' + $index + '.productName'"-->
+<!--          :rules="{-->
+<!--            required: true,-->
+<!--            message: '请输入',-->
+<!--            trigger: 'change'-->
+<!--          }"-->
+<!--        >-->
+<!--          <el-input-->
+<!--            v-model="row.productName"-->
+<!--            placeholder="请输入"-->
+<!--            disabled-->
+<!--          ></el-input>-->
+<!--        </el-form-item>-->
+<!--      </template>-->
+<!--      <template v-slot:productCode="scope">-->
+<!--        <el-form-item-->
+<!--          style="margin-bottom: 20px"-->
+<!--          :prop="'datasource.' + scope.$index + '.productCode'"-->
 
-      <template v-slot:productBrand="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.productBrand'"
-        >
-          <el-input v-model="scope.row.productBrand" disabled></el-input>
-        </el-form-item>
-      </template>
+<!--        >-->
+<!--          <el-input v-model="scope.row.productCode" disabled></el-input>-->
+<!--        </el-form-item>-->
+<!--      </template>-->
+<!--      <template v-slot:productCategoryName="scope">-->
+<!--        <el-form-item-->
+<!--          style="margin-bottom: 20px"-->
+<!--          :prop="'datasource.' + scope.$index + '.productCategoryName'"-->
 
-      <template v-slot:modelType="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.modelType'"
-        >
-          <el-input v-model="scope.row.modelType" disabled></el-input>
-        </el-form-item>
-      </template>
+<!--        >-->
+<!--          <el-input v-model="scope.row.productCategoryName" disabled></el-input>-->
+<!--        </el-form-item>-->
+<!--      </template>-->
+<!--      <template v-slot:totalCount="scope">-->
+<!--        <el-form-item-->
+<!--          style="margin-bottom: 20px"-->
+<!--          :prop="'datasource.' + scope.$index + '.totalCount'"-->
+<!--          :rules="{-->
+<!--            required: true,-->
+<!--            pattern: numberReg,-->
+<!--            message: '请输入数字',-->
+<!--            trigger: 'blur'-->
+<!--          }"-->
+<!--        >-->
+<!--          <el-input-->
+<!--            v-model="scope.row.totalCount"-->
+<!--            disabled-->
+<!--            placeholder="请输入"-->
+<!--          ></el-input>-->
+<!--        </el-form-item>-->
+<!--      </template>-->
 
-      <template v-slot:specification="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.specification'"
-        >
-          <el-input v-model="scope.row.specification" disabled></el-input>
-        </el-form-item>
-      </template>
-      <template v-slot:measuringUnit="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.measuringUnit'"
-        >
-          <el-input
-            v-model="scope.row.measuringUnit"
-            placeholder="请输入"
-            disabled
-          ></el-input>
-        </el-form-item>
-      </template>
-      <template v-slot:remark="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.remark'"
-        >
-          <el-input
-            v-model="scope.row.remark"
-            disabled
-            type="textarea"
-            placeholder="请输入"
-          ></el-input>
-        </el-form-item>
-      </template>
+<!--      <template v-slot:productBrand="scope">-->
+<!--        <el-form-item-->
+<!--          style="margin-bottom: 20px"-->
+<!--          :prop="'datasource.' + scope.$index + '.productBrand'"-->
+<!--        >-->
+<!--          <el-input v-model="scope.row.productBrand" disabled></el-input>-->
+<!--        </el-form-item>-->
+<!--      </template>-->
 
-      <template v-slot:technicalParams="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.technicalParams'"
-          :rules="{
-            required: false,
-            message: '请输入',
-            trigger: 'change'
-          }"
-        >
-          <el-input
-            type="textarea"
-            v-model="scope.row.technicalParams"
-            placeholder="请输入"
-          ></el-input>
-        </el-form-item>
-      </template>
+<!--      <template v-slot:modelType="scope">-->
+<!--        <el-form-item-->
+<!--          style="margin-bottom: 20px"-->
+<!--          :prop="'datasource.' + scope.$index + '.modelType'"-->
+<!--        >-->
+<!--          <el-input v-model="scope.row.modelType" disabled></el-input>-->
+<!--        </el-form-item>-->
+<!--      </template>-->
+
+<!--      <template v-slot:specification="scope">-->
+<!--        <el-form-item-->
+<!--          style="margin-bottom: 20px"-->
+<!--          :prop="'datasource.' + scope.$index + '.specification'"-->
+<!--        >-->
+<!--          <el-input v-model="scope.row.specification" disabled></el-input>-->
+<!--        </el-form-item>-->
+<!--      </template>-->
+<!--      <template v-slot:measuringUnit="scope">-->
+<!--        <el-form-item-->
+<!--          style="margin-bottom: 20px"-->
+<!--          :prop="'datasource.' + scope.$index + '.measuringUnit'"-->
+<!--        >-->
+<!--          <el-input-->
+<!--            v-model="scope.row.measuringUnit"-->
+<!--            placeholder="请输入"-->
+<!--            disabled-->
+<!--          ></el-input>-->
+<!--        </el-form-item>-->
+<!--      </template>-->
+<!--      <template v-slot:remark="scope">-->
+<!--        <el-form-item-->
+<!--          style="margin-bottom: 20px"-->
+<!--          :prop="'datasource.' + scope.$index + '.remark'"-->
+<!--        >-->
+<!--          <el-input-->
+<!--            v-model="scope.row.remark"-->
+<!--            disabled-->
+<!--            type="textarea"-->
+<!--            placeholder="请输入"-->
+<!--          ></el-input>-->
+<!--        </el-form-item>-->
+<!--      </template>-->
+
+<!--      <template v-slot:technicalParams="scope">-->
+<!--        <el-form-item-->
+<!--          style="margin-bottom: 20px"-->
+<!--          :prop="'datasource.' + scope.$index + '.technicalParams'"-->
+<!--          :rules="{-->
+<!--            required: false,-->
+<!--            message: '请输入',-->
+<!--            trigger: 'change'-->
+<!--          }"-->
+<!--        >-->
+<!--          <el-input-->
+<!--            type="textarea"-->
+<!--            v-model="scope.row.technicalParams"-->
+<!--            placeholder="请输入"-->
+<!--          ></el-input>-->
+<!--        </el-form-item>-->
+<!--      </template>-->
       <template v-slot:files="scope">
         <el-form-item prop="files">
           <el-link
@@ -153,30 +143,38 @@
             :underline="false"
             @click="downloadFile(link)"
           >
-            {{ link.name }}</el-link
+            {{ link.name }}
+          </el-link
           >
         </el-form-item>
       </template>
-      <template v-slot:expectReceiveDate="scope">
-        <el-form-item
-          style="margin-bottom: 20px"
-          :prop="'datasource.' + scope.$index + '.expectReceiveDate'"
-          :rules="{
-            required: true,
-            message: '请选择日期',
-            trigger: 'blur'
-          }"
-        >
-          <el-date-picker
-            style="width: 100%"
-            clearable
-            v-model="scope.row.expectReceiveDate"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="请选择日期"
-            disabled
-          >
-          </el-date-picker>
+<!--      <template v-slot:expectReceiveDate="scope">-->
+<!--        <el-form-item-->
+<!--          style="margin-bottom: 20px"-->
+<!--          :prop="'datasource.' + scope.$index + '.expectReceiveDate'"-->
+<!--          :rules="{-->
+<!--            required: true,-->
+<!--            message: '请选择日期',-->
+<!--            trigger: 'blur'-->
+<!--          }"-->
+<!--        >-->
+<!--          <el-date-picker-->
+<!--            style="width: 100%"-->
+<!--            clearable-->
+<!--            v-model="scope.row.expectReceiveDate"-->
+<!--            type="date"-->
+<!--            value-format="yyyy-MM-dd"-->
+<!--            placeholder="请选择日期"-->
+<!--            disabled-->
+<!--          >-->
+<!--          </el-date-picker>-->
+<!--        </el-form-item>-->
+<!--      </template>-->
+      <template v-slot:supplierIds="scope">
+        <el-form-item prop="supplierIds">
+          <el-select v-model="scope.row['supplierIds']" clearable filterable multiple collapse-tags @change="handleSupplierSelect(scope.row)">
+            <el-option v-for="i in scope.row.supplierList" :key="i.id" :value="i.id" :label="i.name"></el-option>
+          </el-select>
         </el-form-item>
       </template>
       <!-- <template v-slot:productNameHeader="{ column, $index }">
@@ -243,261 +241,352 @@
   </el-form>
 </template>
 <script>
-  import { emailReg, phoneReg, numberReg } from 'ele-admin';
-  import dictMixins from '@/mixins/dictMixins';
-  import fileUpload from '@/components/upload/fileUpload';
-  // import headList from '@/views/saleManage/businessOpportunity/components/headList.vue';
-  const defaultColumns = [
-    {
-      width: 45,
-      type: 'index',
-      columnKey: 'index',
-      align: 'center',
-      fixed: 'left'
-    },
-    {
-      width: 150,
-      prop: 'productCategoryName',
-      label: '分类',
-      slot: 'productCategoryName'
-    },
-    {
-      width: 140,
-      prop: 'productCode',
-      label: '编码',
-      slot: 'productCode'
-    },
-    {
-      width: 240,
-      prop: 'productName',
-      label: '名称',
-      slot: 'productName',
-      headerSlot: 'productNameHeader'
-    },
-    {
-      width: 150,
-      prop: 'productBrand',
-      label: '牌号',
-      slot: 'productBrand'
+import {numberReg} from 'ele-admin';
+import dictMixins from '@/mixins/dictMixins';
+import fileUpload from '@/components/upload/fileUpload';
+import {getFile} from "@/api/system/file";
+import {getByCode} from "@/api/system/dictionary-data";
+import {getInventoryTotalAPI} from "@/api/bpm/components/wms";
+// import headList from '@/views/saleManage/businessOpportunity/components/headList.vue';
+export default {
+  mixins: [dictMixins],
+  components: {
+    fileUpload
+    // headList
+  },
+  props: {
+    acceptUnpack: {
+      default: ''
+    }
+  },
+  data() {
+    const defaultForm = {
+      key: null,
+      endTime: '',
+      isFirst: 0,
+      name: ''
+    };
+
+    return {
+      numberReg,
+      defaultForm,
+      supplierList: [],
+      selection: [],
+      // resultList:'',
+      form: {
+        datasource: []
+      },
+      dictList: {},
+      files: [],
+      rules: {},
+    };
+  },
+  computed: {
+    canHandl() {
+      return this.form.datasource.length;
     },
-    {
-      width: 80,
-      prop: 'totalCount',
-      label: '数量',
-      slot: 'totalCount'
+    columns() {
+      return [
+        {
+          width: 50,
+          label: '序号',
+          type: 'index',
+          columnKey: 'index',
+          align: 'center',
+          fixed: 'left'
+        },
+        {
+          width: 45,
+          type: 'selection',
+          columnKey: 'selection',
+          align: 'center',
+          fixed: 'left'
+        },
+        {
+          minWidth: 100,
+          prop: 'productCategoryName',
+          label: '分类',
+          slot: 'productCategoryName',
+          showOverflowTooltip: true,
+          align: "center"
+        },
+        {
+          minWidth: 100,
+          prop: 'productCode',
+          label: '编码',
+          slot: 'productCode',
+          showOverflowTooltip: true,
+          align: "center"
+        },
+        {
+          minWidth: 140,
+          prop: 'productName',
+          label: '名称',
+          slot: 'productName',
+          headerSlot: 'productNameHeader',
+          showOverflowTooltip: true,
+          align: "center"
+        },
+        {
+          minWidth: 200,
+          prop: 'supplierIds',
+          label: '供应商选择',
+          slot: 'supplierIds',
+          align: "center"
+        },
+        {
+          minWidth: 100,
+          prop: 'productBrand',
+          label: '牌号',
+          slot: 'productBrand',
+          showOverflowTooltip: true,
+          align: "center"
+        },
+        {
+          minWidth: 80,
+          prop: 'totalCount',
+          label: '数量',
+          slot: 'totalCount',
+          align: "center"
+        },
+        {
+          minWidth: 80,
+          prop: 'availableCountBase',
+          label: '库存数量',
+          slot: 'availableCountBase',
+          align: "center"
+        },
+        {
+          minWidth: 80,
+          prop: 'measuringUnit',
+          label: '单位',
+          slot: 'measuringUnit',
+          showOverflowTooltip: true,
+          align: "center"
+        },
+        {
+          minWidth: 130,
+          prop: 'modelType',
+          label: '型号',
+          slot: 'modelType',
+          showOverflowTooltip: true,
+          align: "center"
+        },
+
+        {
+          minWidth: 120,
+          prop: 'specification',
+          label: '规格',
+          slot: 'specification',
+          showOverflowTooltip: true,
+          align: "center"
+        },
+        {
+          minWidth: 120,
+          prop: 'imgCode',
+          align: 'center',
+          label: '图号/件号',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 120,
+          prop: 'produceType',
+          align: 'center',
+          label: '生产类型',
+          showOverflowTooltip: true,
+          formatter: (row, column) => {
+            return row.produceType && row.produceType.length ? row.produceType.map(item => this.getDictV('productionType', item)).join(',') : ''
+          }
+        },
+        {
+          minWidth: 120,
+          prop: 'approvalNumber',
+          align: 'center',
+          label: '批准文号',
+          showOverflowTooltip: true
+        },
+        {
+          minWidth: 120,
+          prop: 'packingSpecification',
+          align: 'center',
+          label: '包装规格',
+          showOverflowTooltip: true
+        },
+        // {
+        //   width: 130,
+        //   prop: 'brand',
+        //   label: '品牌',
+        //   slot: 'brand'
+        // },
+        {
+          minWidth: 170,
+          prop: 'expectReceiveDate',
+          label: '到货日期',
+          slot: 'expectReceiveDate',
+          align: "center"
+        },
+        {
+          minWidth: 140,
+          prop: 'files',
+          label: '附件',
+          slot: 'files',
+          align: "center"
+        },
+        {
+          minWidth: 220,
+          prop: 'remark',
+          label: '备注',
+          slot: 'remark',
+          align: "center"
+        },
+        // {
+        //   columnKey: 'action',
+        //   label: '操作',
+        //   width: 120,
+        //   align: 'center',
+        //   resizable: false,
+        //   slot: 'action',
+        //   fixed: 'right',
+        //   showOverflowTooltip: true
+        // }
+      ]
+    }
+  },
+  created() {
+    this.getDictList('productionType')
+  },
+  methods: {
+    getDictV(code, val) {
+      if (!this.dictList[code]) return '';
+      return this.dictList[code].find(item => item.value == val)?.label
     },
-    {
-      width: 100,
-      prop: 'measuringUnit',
-      label: '单位',
-      slot: 'measuringUnit'
+    async getDictList(code) {
+      let {data: res} = await getByCode(code)
+      this.dictList[code] = res.map(item => {
+        let values = Object.keys(item)
+        return {
+          value: values[0],
+          label: item[values[0]]
+        }
+      })
     },
-    {
-      width: 130,
-      prop: 'modelType',
-      label: '型号',
-      slot: 'modelType'
+    downloadFile(file) {
+      getFile({objectName: file.storePath}, file.name);
     },
+    // 返回列表数据
+    getTableValue() {
+      let comitDatasource = this.form.datasource;
+      if (comitDatasource.length === 0) return [];
+      comitDatasource.forEach((v) => {
+        v.totalPrice = (v.totalCount * v.singlePrice)?.toFixed(2) || 0;
 
-    {
-      width: 120,
-      prop: 'specification',
-      label: '规格',
-      slot: 'specification'
+        v.files = v.files || null;
+      });
+      return comitDatasource;
     },
-    // {
-    //   width: 130,
-    //   prop: 'brand',
-    //   label: '品牌',
-    //   slot: 'brand'
-    // },
-    {
-      width: 170,
-      prop: 'expectReceiveDate',
-      label: '到货日期',
-      slot: 'expectReceiveDate'
+
+    //修改回显
+    async putTableValue(data) {
+      if (data && data?.length) {
+        this.form.datasource = data;
+        let codeList = this.form.datasource.map(item => item.productCode)
+        //获取仓库库存
+        let inventoryTotalList = await getInventoryTotalAPI(codeList);
+        this.form.datasource.forEach((item,index) => {
+          let find = inventoryTotalList.find((key) => key.code == item.productCode) || {};
+          // item.availableCountBase = find.availableCountBase;
+          this.$set(this.form.datasource[index], 'availableCountBase', find.availableCountBase);
+        });
+        this.$refs.table.reload()
+      }
+
     },
-    {
-      width: 140,
-      prop: 'files',
-      label: '附件',
-      slot: 'files'
+    handleSupplierSelect(row) {
+      this.$emit('supplierSelect', row);
     },
-    {
-      width: 220,
-      prop: 'remark',
-      label: '备注',
-      slot: 'remark'
+    //选择产品
+    handParent() {
+      this.$refs.productListRef.open();
     },
-    {
-      columnKey: 'action',
-      label: '操作',
-      width: 120,
-      align: 'center',
-      resizable: false,
-      slot: 'action',
-      fixed: 'right',
-      showOverflowTooltip: true
-    }
-  ];
-  export default {
-    mixins: [dictMixins],
-    components: {
-      fileUpload
-      // headList
+    //选择产品回调
+    changeParent(obj, idx) {
+      obj['productBrand'] = obj.brandNum;
+      obj['productCode'] = obj.code;
+      obj['productName'] = obj.name;
+      obj['productCategoryName'] = obj.categoryLevelPath;
+      obj['productCategoryId'] = obj.categoryLevelId;
+      this.form.datasource.push(obj);
     },
-    props: {
-      acceptUnpack: {
-        default: ''
+    remove(i, productCode) {
+      if (!this.acceptUnpack) {
+        this.$message.warning('本采购计划不能拆单');
+        return;
       }
-    },
-    data() {
-      const defaultForm = {
-        key: null,
-        endTime: '',
-        isFirst: 0,
-        name: ''
-      };
 
-      return {
-        numberReg,
-        defaultForm,
-        supplierList: [],
-        // resultList:'',
-        form: {
-          datasource: []
-        },
+      this.form.datasource.splice(i, 1);
 
-        files: [],
-        rules: {},
-        columns: [...defaultColumns]
-      };
-    },
-    computed: {
-      canHandl() {
-        return this.form.datasource.length;
-      }
+      this.$emit('delList', productCode);
     },
-    created() {
-      // this.setColumns();
+    // 清空表格
+    restTable() {
+      this.form.datasource = [];
     },
-    methods: {
-      // 返回列表数据
-      getTableValue() {
-        let comitDatasource = this.form.datasource;
-        if (comitDatasource.length === 0) return [];
-        comitDatasource.forEach((v) => {
-          v.totalPrice = (v.totalCount * v.singlePrice)?.toFixed(2) || 0;
-
-          v.files = v.files || null;
-        });
-        return comitDatasource;
-      },
-
-      //修改回显
-      putTableValue(data) {
-        if (data && data?.length) {
-          this.form.datasource = data;
-        }
-      },
 
-      //选择产品
-      handParent() {
-        this.$refs.productListRef.open();
-      },
+    // 添加
+    handlAdd() {
+      let item = JSON.parse(JSON.stringify(this.defaultForm));
+      item.key = this.form.datasource.length + 1;
+      this.form.datasource.push(item);
+    },
 
-      handHead(row, index) {
-        let item = {
-          id: row.technicalAnswerId
-        };
-        this.$refs.headRef.open(item, index);
-      },
-      //供应商
-      setColumns(data = []) {
-        this.columns = [...defaultColumns];
-        // this.columns.push()
-        data.forEach((item, index) => {
-          this.$set(this.columns, 13 + index, item);
-        });
-        this.supplierList = data;
-      },
-      getsupplier() {
-        return this.supplierList;
-      },
-      //选择产品回调
-      changeParent(obj, idx) {
-        obj['productBrand'] = obj.brandNum;
-        obj['productCode'] = obj.code;
-        obj['productName'] = obj.name;
-        obj['productCategoryName'] = obj.categoryLevelPath;
-        obj['productCategoryId'] = obj.categoryLevelId;
-        this.form.datasource.push(obj);
-      },
-      remove(i, productCode) {
-        if (!this.acceptUnpack) {
-          this.$message.warning('本采购计划不能拆单');
-          return;
-        }
+    validateForm(callback) {
+      //开始表单校验
+      this.$refs.form.validate((valid) => {
+        callback(valid);
+      });
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.headbox {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
 
-        this.form.datasource.splice(i, 1);
+  .amount {
+    font-size: 14px;
+    font-weight: bold;
+  }
+}
 
-        this.$emit('delList', productCode);
-      },
-      // 清空表格
-      restTable() {
-        this.form.datasource = [];
-      },
+.time-form .el-form-item {
+  margin-bottom: 0 !important;
+}
 
-      // 添加
-      handlAdd() {
-        let item = JSON.parse(JSON.stringify(this.defaultForm));
-        item.key = this.form.datasource.length + 1;
-        this.form.datasource.push(item);
-      },
+::v-deep .period {
+  display: flex;
 
-      validateForm(callback) {
-        //开始表单校验
-        this.$refs.form.validate((valid) => {
-          callback(valid);
-        });
-      }
-    }
-  };
-</script>
-<style lang="scss" scoped>
-  .headbox {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    .amount {
-      font-size: 14px;
-      font-weight: bold;
+  .borderleftnone {
+    .el-input--medium .el-input__inner {
+      border-top-right-radius: 0;
+      border-bottom-right-radius: 0;
     }
   }
-  .time-form .el-form-item {
-    margin-bottom: 0 !important;
-  }
 
-  ::v-deep .period {
-    display: flex;
-    .borderleftnone {
-      .el-input--medium .el-input__inner {
-        border-top-right-radius: 0;
-        border-bottom-right-radius: 0;
-      }
-    }
-    .borderrightnone {
-      .el-input--medium .el-input__inner {
-        border-top-left-radius: 0;
-        border-bottom-left-radius: 0;
-      }
+  .borderrightnone {
+    .el-input--medium .el-input__inner {
+      border-top-left-radius: 0;
+      border-bottom-left-radius: 0;
     }
   }
+}
 
-  ::v-deep .time-form tbody > tr:hover > td {
-    background-color: transparent !important;
-  }
-  ::v-deep .time-form .el-table tr {
-    background-color: #ffffff;
-  }
+::v-deep .time-form tbody > tr:hover > td {
+  background-color: transparent !important;
+}
+
+::v-deep .time-form .el-table tr {
+  background-color: #ffffff;
+}
 </style>

+ 4 - 4
src/views/bpm/handleTask/components/inquiryManage/submit.vue

@@ -130,10 +130,10 @@
           if (!arr) {
             return;
           }
-          if (this.taskDefinitionKey === 'deptLeaderApprove' && !arr.winnerId) {
-            this.$message.error('请选择中标单位');
-            return;
-          }
+          // if (this.taskDefinitionKey === 'deptLeaderApprove' && !arr.winnerId) {
+          //   this.$message.error('请选择中标单位');
+          //   return;
+          // }
 
           let data = await UpdateInformation(arr);
           // console.log(data)

+ 26 - 31
src/views/bpm/handleTask/components/saleOrder/addDialog.vue

@@ -1,13 +1,13 @@
 <template>
   <div>
-    <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+    <el-form ref="form" :model="form" :rules="rules" label-width="120px" class="el-form-box">
       <headerTitle title="订单信息"></headerTitle>
       <el-row>
         <el-col :span="12">
           <el-form-item
             label="项目名称"
             prop="projectName"
-            style="margin-bottom: 22px"
+
           >
             <el-input
               clearable
@@ -18,7 +18,7 @@
           <el-form-item
             label="销售类型"
             prop="saleType"
-            style="margin-bottom: 22px"
+
           >
             <DictSelection
               dictName="销售类型"
@@ -32,7 +32,7 @@
           <el-form-item
             label="销售部门"
             prop="salesDeptId"
-            style="margin-bottom: 22px"
+
           >
             <ele-tree-select
               clearable
@@ -48,7 +48,7 @@
           <el-form-item
             label="订单类型"
             prop="needProduce"
-            style="margin-bottom: 22px">
+            >
             <el-radio v-model="form.needProduce" :label="1">生产性订单</el-radio>
             <el-radio v-model="form.needProduce" :label="0">贸易性订单</el-radio>
           </el-form-item>
@@ -65,7 +65,7 @@
           <el-form-item
             label="选择合同"
             prop="contractName"
-            style="margin-bottom: 22px"
+
           >
             <el-input
               clearable
@@ -78,7 +78,7 @@
           <el-form-item
             label="合同编号"
             prop="contractNumber"
-            style="margin-bottom: 22px"
+
           >
             <el-input
               disabled
@@ -88,7 +88,7 @@
           <!-- <el-form-item
             label="交货日期"
             prop="deliveryDate"
-            style="margin-bottom: 22px"
+
           >
             <el-date-picker
               v-model="form.deliveryDate"
@@ -109,7 +109,7 @@
           <el-form-item
             label="计价方式"
             prop="pricingWay"
-            style="margin-bottom: 22px">
+            >
             <el-radio-group v-model="form.pricingWay" @change="changePricingWay" :disabled="!!form.contractId">
               <el-radio v-for="item in pricingWayList" :label="item.id">{{ item.name }}</el-radio>
             </el-radio-group>
@@ -124,7 +124,6 @@
           <el-form-item
             label="客户名称"
             prop="partaName"
-            style="margin-bottom: 22px"
           >
             <el-input
               clearable
@@ -136,8 +135,7 @@
           <el-form-item
             label="客户统一社会信用代码"
             prop="partaUnifiedSocialCreditCode"
-            label-width="160px"
-            style="margin-bottom: 22px"
+            class="form_item_label"
           >
             <el-input
               clearable
@@ -147,14 +145,13 @@
           </el-form-item>
           <el-form-item
             label="客户联系人"
-            prop="partaLinkName"
-            style="margin-bottom: 22px"
-          >
+            prop="partaLinkName">
             <el-select
               v-model="form.partaLinkName"
               placeholder="请选择"
               @change="onchangeLink"
               @focus="selectFocus"
+              style="width: 100%"
             >
               <el-option
                 v-for="item in linkNameOptions"
@@ -168,7 +165,7 @@
           <el-form-item
             label="客户电话"
             prop="partaTel"
-            style="margin-bottom: 22px"
+
           >
             <el-input
               clearable
@@ -180,14 +177,14 @@
           <el-form-item
             label="客户传真"
             prop="partaFax"
-            style="margin-bottom: 22px"
+
           >
             <el-input clearable v-model="form.partaFax" placeholder="请输入"/>
           </el-form-item>
           <el-form-item
             label="	客户Email"
             prop="partaEmail"
-            style="margin-bottom: 22px"
+
           >
             <el-input
               clearable
@@ -198,7 +195,7 @@
           <el-form-item
             label="客户地址"
             prop="partaAddress"
-            style="margin-bottom: 22px"
+
           >
             <el-input
               clearable
@@ -212,7 +209,7 @@
           <el-form-item
             label="售出方名称"
             prop="partbName"
-            style="margin-bottom: 22px"
+
           >
             <!-- <el-input
                 clearable
@@ -244,9 +241,7 @@
           <el-form-item
             label="售出方统一社会信用代码"
             prop="partbUnifiedSocialCreditCode"
-            label-width="170px"
-            style="margin-bottom: 22px"
-          >
+            class="form_item_label">
             <el-input
               clearable
               v-model="form.partbUnifiedSocialCreditCode"
@@ -256,7 +251,7 @@
           <el-form-item
             label="售出方联系人"
             prop="partbLinkName"
-            style="margin-bottom: 22px"
+
           >
             <el-input
               clearable
@@ -275,7 +270,7 @@
           <el-form-item
             label="售出方Email"
             prop="partbEmail"
-            style="margin-bottom: 22px"
+
           >
             <el-input
               clearable
@@ -287,7 +282,7 @@
           <el-form-item
             label="售出方地址"
             prop="partbAddress"
-            style="margin-bottom: 22px"
+
           >
             <el-input
               clearable
@@ -307,7 +302,7 @@
           <el-form-item
             label="优惠总金额"
             prop="payAmount"
-            style="margin-bottom: 22px"
+
           >
             <el-input
               type="number"
@@ -324,7 +319,7 @@
           <el-form-item
             label="收货地址"
             prop="receiveAddress"
-            style="margin-bottom: 22px"
+
           >
             <el-input
               clearable
@@ -338,11 +333,11 @@
           <el-form-item
             label="总金额"
             prop="totalAmount"
-            style="margin-bottom: 22px"
+
           >
             {{ allcountAmount || 0 }}元
           </el-form-item>
-          <el-form-item label="备注" prop="remark" style="margin-bottom: 22px">
+          <el-form-item label="备注" prop="remark" >
             <el-input
               clearable
               type="textarea"
@@ -636,7 +631,7 @@ export default {
       this.loading = false;
       if (data) {
         this.$nextTick(() => {
-          data.saleType = +data.saleType
+          data.saleType = data.saleType+''
           this.form = data;
           this.$refs.inventoryTable &&
           this.$refs.inventoryTable.putTableValueByOrder(data)