yusheng 1 жил өмнө
parent
commit
f42bb8f601

+ 26 - 1
src/views/bpm/handleTask/components/inquiryManage/addDialog.vue

@@ -84,6 +84,9 @@
     <inquiryManageList
       ref="inquiryManageRef"
       @changeInquiryManageList="changeInquiryManageList"
+      @supplierSelect="supplierSelect"
+      @supplierManageChange="supplierManageChange"
+
     ></inquiryManageList>
     <supplierManageDialog
       ref="supplierManageDialogRef"
@@ -97,6 +100,9 @@
       style="margin-top: 15px"
       :obj="item"
       :isUpdate="isUpdate"
+      @deliveryDateChange="deliveryDateChange"
+
+      @setIsInquiry="setIsInquiry"
     ></inquiryTable>
   </div>
 </template>
@@ -233,7 +239,23 @@
           // });
         }
       },
+      deliveryDateChange(fn) {
+        let data = this.$refs.inventoryTable.getTableValue() || [];
+        fn(data);
+      },
 
+      setIsInquiry() {
+        let supplierList = [];
+
+        this.$nextTick(() => {
+          this.supplierList.forEach((item) => {
+            supplierList.push(
+              this.$refs['inquiryTable' + item.supplierId][0].getTableValue()
+            );
+          });
+          this.$refs.inventoryTable.setIsInquiry(supplierList)
+        });
+      },
       //获取计划详情
       async getplanData(id, type) {
         this.loading = true;
@@ -249,7 +271,7 @@
             item.supplierList = supplierObj[item.productId] || []
             if(item.supplierList.length === 1){
               item.supplierIds = [item.supplierList[0].id]
-              this.supplierSelect(item)
+              // this.supplierSelect(item)
             }
           });
           this.$set(this.form, 'acceptUnpack', data.acceptUnpack);
@@ -323,6 +345,8 @@
         this.supplierList = this.supplierList.filter(
           (item) => item.supplierId != supplierId
         );
+        this.setIsInquiry()
+
       },
 
       //选择产品
@@ -399,6 +423,7 @@
           item['resultList'] = copyObj(this.$refs.inventoryTable.selection)
           item['resultList'].forEach((val) => {
             val['remark'] = '';
+            item['deliveryDate'] = val.expectReceiveDate;
             val.supplierName = item.name;
           });
 

+ 527 - 476
src/views/bpm/handleTask/components/inquiryManage/inquiryTable.vue

@@ -1,6 +1,5 @@
 <template>
   <el-form :model="form" ref="form">
-
     <ele-pro-table
       ref="table"
       :needPage="false"
@@ -15,19 +14,20 @@
       <!-- 表头工具栏 -->
 
       <template v-slot:toolbar>
-        <el-row
-          type="flex"
-          justify="end"
-          align="middle"
-        >
+        <el-row type="flex" justify="end" align="middle">
           <el-popconfirm
             class="ele-action"
             title="确定要删除吗?"
             @confirm="removeSupplier"
-            v-if="status!=='Detail'"
+            v-if="status !== 'Detail'"
           >
             <template v-slot:reference>
-              <el-link type="danger" title="删除供应商" :underline="false" icon="el-icon-delete">
+              <el-link
+                type="danger"
+                title="删除供应商"
+                :underline="false"
+                icon="el-icon-delete"
+              >
                 删除
               </el-link>
             </template>
@@ -44,10 +44,10 @@
         <el-form-item
           prop="preferentialPrice"
           :rules="{
-                    required: true,
-                    message: '请输入优惠价',
-                    trigger: 'blur'
-                  }"
+            required: true,
+            message: '请输入优惠价',
+            trigger: 'blur'
+          }"
         >
           <el-input
             v-model="form.preferentialPrice"
@@ -59,10 +59,11 @@
         <el-form-item
           prop="settlementMode"
           :rules="{
-                    required: true,
-                    message: '请输入优惠价',
-                    trigger: 'change'
-                  }">
+            required: true,
+            message: '请输入优惠价',
+            trigger: 'change'
+          }"
+        >
           <DictSelection
             dictName="结算方式"
             clearable
@@ -77,10 +78,10 @@
         <el-form-item
           prop="deliveryDate"
           :rules="{
-                    required: true,
-                    message: '请选择交货日期',
-                    trigger: 'change'
-                  }"
+            required: true,
+            message: '请选择交货日期',
+            trigger: 'change'
+          }"
         >
           <el-date-picker
             style="width: 100%"
@@ -107,31 +108,33 @@
       </template>
       <template v-slot:files="{ row, $index }">
         <el-form-item prop="files">
-          <fileMain v-model="form.files" :type="status=='Detail'?'view':''" ></fileMain>
-<!--          <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>-->
+          <fileMain
+            v-model="form.files"
+            :type="status == 'Detail' ? 'view' : ''"
+          ></fileMain>
+          <!--          <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>
       </template>
 
-
       <template v-slot:isWinner="{ row, $index }">
         <el-form-item
           style="margin-bottom: 20px"
@@ -259,8 +262,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">
@@ -334,474 +337,522 @@
   </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 {getFile} from "@/api/system/file";
-import fileMain from "@/components/addDoc/index.vue";
-// 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'
-
-  },
-  {
-    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"
-  },
+  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 fileMain from '@/components/addDoc/index.vue';
+  // 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'
+    },
+    {
+      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: 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"
-  },
+    {
+      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: {
-    fileMain,
-    fileUpload
-    // headList
-  },
-  props: {
-    obj: {},
-    status: {
-      default: 'edit'
+    // {
+    //   width: 130,
+    //   prop: 'brand',
+    //   label: '品牌',
+    //   slot: 'brand'
+    // },
+    {
+      minWidth: 80,
+      prop: 'deliveryDays',
+      label: '交期(天)',
+      slot: 'deliveryDays',
+      align: 'center'
     },
-    radio: {
-      default: ''
+    {
+      minWidth: 100,
+      prop: 'guaranteePeriod',
+      label: '质保期',
+      slot: 'guaranteePeriod',
+      align: 'center'
     },
-    isUpdate: {
-      default: false
+    {
+      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
     }
-  },
-  data() {
-    const defaultForm = {
-      key: null,
-      endTime: '',
-      isFirst: 0,
-      name: ''
-    };
-
-    return {
-      numberReg,
-      defaultForm,
-      radio1: '',
-      form: {
-        resultList: [
-          {
-            supplierProductCode: '',
-            deliveryDays: '',
-            guaranteePeriod: '',
-            guaranteePeriodUnitCode: '',
-            guaranteePeriodUnitName: '',
-            measuringUnit: '',
-            modelType: '',
-            productCode: '',
-            isWinner: '',
-            remark: '',
-            singlePrice: '',
-            specification: '',
-            supplierProductName: '',
-            technicalAnswerName: '',
-            technicalParams: '',
-            totalCount: '',
-            totalPrice: ''
-          }
-        ]
+  ];
+  export default {
+    mixins: [dictMixins],
+    components: {
+      fileMain,
+      fileUpload
+      // headList
+    },
+    props: {
+      obj: {},
+      status: {
+        default: 'edit'
       },
-      dataList: [],
-      spanArr: [],
-
-      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
-        };
+      radio: {
+        default: ''
+      },
+      isUpdate: {
+        default: false
       }
+    },
+    data() {
+      const defaultForm = {
+        key: null,
+        endTime: '',
+        isFirst: 0,
+        name: ''
+      };
+
       return {
-        rowspan: 1,
-        colspan: 1
+        numberReg,
+        defaultForm,
+        radio1: '',
+        form: {
+          resultList: [
+            {
+              supplierProductCode: '',
+              deliveryDays: '',
+              guaranteePeriod: '',
+              guaranteePeriodUnitCode: '',
+              guaranteePeriodUnitName: '',
+              measuringUnit: '',
+              modelType: '',
+              productCode: '',
+              isWinner: '',
+              remark: '',
+              singlePrice: '',
+              specification: '',
+              supplierProductName: '',
+              technicalAnswerName: '',
+              technicalParams: '',
+              totalCount: '',
+              totalPrice: ''
+            }
+          ]
+        },
+        dataList: [],
+        spanArr: [],
+
+        columns: [...defaultColumns]
       };
     },
-    getSpanArr() {
-      let pos = 0;
-      this.spanArr = [];
-      this.form.resultList.forEach((item, index) => {
-        item.guaranteePeriodUnitCode=Number(item.guaranteePeriodUnitCode)
-        // console.log(item.guaranteePeriodUnitCode,'item.guaranteePeriodUnitCode')
-        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 => {
+    computed: {},
+    watch: {
+      radio(n, v) {
+        this.radio1 = n;
+      }
+    },
+
+    created() {
+      this.obj.resultList.forEach((item) => {
+        this.obj['deliveryDate'] =
+          this.obj.deliveryDate || item.expectReceiveDate;
+      });
+      this.form = copyObj(this.obj);
+      console.log(this.obj);
+      this.radio1 = this.radio;
+      this.getSpanArr();
+      this.setDeliveryDays();
+      this.setIsInquiry();
+    },
+    methods: {
+      //计算交期
+      setDeliveryDays() {
+        this.form.resultList.forEach((item) => {
+          let day =
+            this.form.deliveryDate &&
+            (new Date(this.form.deliveryDate).getTime() -
+              new Date().getTime()) /
+              1000 /
+              60 /
+              60 /
+              24;
+
+          item.deliveryDays = Math.ceil(day) || 1;
+        });
+        this.$forceUpdate();
+      },
+      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
+        };
+      },
+      getSpanArr() {
+        let pos = 0;
+        this.spanArr = [];
+        this.form.resultList.forEach((item, index) => {
+          item.guaranteePeriodUnitCode = Number(item.guaranteePeriodUnitCode);
+          // console.log(item.guaranteePeriodUnitCode,'item.guaranteePeriodUnitCode')
+          if (index === 0) {
+            let obj = {};
+            this.columns.forEach((col) => {
               if (col.isMerge) {
-                obj[col.prop] = 1
+                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 });
+            // }
           }
-          // 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 });
-          // }
+        });
+      },
+      setIsInquiry() {
+        this.$emit('setIsInquiry');
+      },
+      deliveryDateChange(row) {
+        this.$emit('deliveryDateChange', (data) => {
+          let is = false;
 
+          if (data.length > 0) {
+            data.forEach((item) => {
+              if (
+                new Date(this.form.deliveryDate).getTime() >
+                new Date(item.expectReceiveDate).getTime()
+              ) {
+                is = true;
+              }
+            });
+          }
+          if (is) {
+            this.$message.error('交货日期大于到货日期');
+          }
+        });
+        this.setDeliveryDays();
+      },
+      downloadFile(file) {
+        getFile({ objectName: file.storePath }, file.name);
+      },
+      //
+      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));
         }
-      });
-    },
-    downloadFile(file) {
-      getFile({objectName: file.storePath}, file.name);
-    },
-    //
-    changeGetPrice(row) {
-      if (row.singlePrice && row.totalCount) {
-        let num = 0
+      },
+      //计算销售金额
+      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 || 0;
         });
-        this.form.preferentialPrice = parseFloat(num.toFixed(2));
-      }
-    },
-    //计算销售金额
-    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 || 0;
-      });
-      this.form.totalPrice = parseFloat(num.toFixed(2));
-      // this.form.preferentialPrice = parseFloat(num.toFixed(2));
-      // console.log(this.form.resultList,'dasdasd')
-    },
-    // 返回列表数据
-    getTableValue() {
-      return this.form;
-    },
-    chaengMode(data) {
-      this.form.settlementModeName = data.dictValue;
-    },
-    chaengUnitCode(data) {
-      this.form.settlementModeName = data.dictValue;
-    },
-    //修改回显
-    putTableValue(data) {
-      this.form.resultList = copyObj(data);
-    },
+        this.form.totalPrice = parseFloat(num.toFixed(2));
+        // this.form.preferentialPrice = parseFloat(num.toFixed(2));
+        // console.log(this.form.resultList,'dasdasd')
+      },
+      // 返回列表数据
+      getTableValue() {
+        return this.form;
+      },
+      chaengMode(data) {
+        this.form.settlementModeName = data.dictValue;
+      },
+      chaengUnitCode(data) {
+        this.form.settlementModeName = data.dictValue;
+      },
+      //修改回显
+      putTableValue(data) {
+        this.form.resultList = copyObj(data);
+        this.setDeliveryDays();
+        this.setIsInquiry();
+        
+      },
 
-    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;
-      });
-    },
+      remove(productCode) {
+        let index = this.form.resultList.findIndex(
+          (item) => item.productCode == productCode
+        );
+        this.form.resultList.splice(index, 1);
+        this.setIsInquiry();
+        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;
+  .headbox {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
 
-  .amount {
-    font-size: 14px;
-    font-weight: bold;
+    .amount {
+      font-size: 14px;
+      font-weight: bold;
+    }
   }
-}
 
-.time-form .el-form-item {
-  margin-bottom: 0 !important;
-}
+  .time-form .el-form-item {
+    margin-bottom: 0 !important;
+  }
 
-::v-deep .period {
-  display: flex;
+  ::v-deep .period {
+    display: flex;
 
-  .borderleftnone {
-    .el-input--medium .el-input__inner {
-      border-top-right-radius: 0;
-      border-bottom-right-radius: 0;
+    .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 tbody > tr:hover > td {
+    background-color: transparent !important;
+  }
 
-::v-deep .time-form .el-table tr {
-  background-color: #ffffff;
-}
+  ::v-deep .time-form .el-table tr {
+    background-color: #ffffff;
+  }
 
-::v-deep .el-upload-list--text {
-  width: 75%;
-}
+  ::v-deep .el-upload-list--text {
+    width: 75%;
+  }
 </style>

+ 41 - 1
src/views/bpm/handleTask/components/inquiryManage/inventoryTable.vue

@@ -223,6 +223,13 @@
         </el-form-item>
       </template>
       <!-- </template> -->
+      <template v-slot:add="scope">
+        <el-form-item style="margin-bottom: 20px">
+          <el-button type="primary" @click="openSupplier(scope.row)"
+            >新增报价单</el-button
+          >
+        </el-form-item>
+      </template>
       <template v-slot:action="scope">
         <el-popconfirm
           class="ele-action"
@@ -305,6 +312,23 @@ export default {
           align: 'center',
           fixed: 'left'
         },
+        {
+            minWidth: 180,
+            slot: 'add',
+            label: '新增报价',
+            showOverflowTooltip: true,
+            fixed: 'left',
+            align: 'center'
+          },
+          {
+            minWidth: 100,
+            label: '状态',
+            fixed: 'left',
+            formatter: (row, column) => {
+              return row.isInquiry==1?'已核价':'未核价'
+            },
+            align: 'center'
+          },
         {
           minWidth: 100,
           prop: 'productCategoryName',
@@ -494,7 +518,21 @@ export default {
       });
       return comitDatasource;
     },
+    setIsInquiry(list){
+        let codeS=[]
+        list.forEach(item=>{
+          item.resultList.forEach(val=>{
+            codeS.push(val.productCode)
+          })
+          
+        }) 
+        this.form.datasource.forEach((item,index)=>{
+          this.$set(this.form.datasource[index],'isInquiry',codeS.includes(item.productCode)?1:0)
+        })
+        
+        console.log(codeS,'codeS')
 
+      },
     //修改回显
     async putTableValue(data) {
       if (data && data?.length) {
@@ -541,7 +579,9 @@ export default {
     restTable() {
       this.form.datasource = [];
     },
-
+    openSupplier(row) {
+        this.$emit('supplierSelect', row);
+      },
     // 添加
     handlAdd() {
       let item = JSON.parse(JSON.stringify(this.defaultForm));

+ 0 - 1
src/views/bpm/handleTask/components/quotation/addDialog.vue

@@ -586,7 +586,6 @@
             '结算方式',
             this.form.settlementMode
           );
-
           // if (this.form.askFile && this.form.askFile.length > 0) {
           //   this.form.askFile = this.form.askFile[0];
           // } else {