yusheng 1 год назад
Родитель
Сommit
fedbbf6ff0

+ 67 - 0
src/BIZComponents/inventoryTableDetails.vue

@@ -9,6 +9,41 @@
       cache-key="systemRoleTable17"
       class="time-form"
     >
+    <template v-slot:technicalDrawings="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.technicalDrawings'"
+        >
+          <fileMain
+            v-model="scope.row.technicalDrawings"
+            type="view"
+          ></fileMain>
+        </el-form-item>
+      </template>
+      <template v-slot:customerReqFiles="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.customerReqFiles'"
+        >
+          <fileMain v-model="scope.row.customerReqFiles" type="view"></fileMain>
+        </el-form-item>
+      </template>
+      <template v-slot:industryArtFiles="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '.industryArtFiles'"
+        >
+          <fileMain v-model="scope.row.industryArtFiles" type="view"></fileMain>
+        </el-form-item>
+      </template>
+      <template v-slot:otherFiles="scope">
+        <el-form-item
+          style="margin-bottom: 20px"
+          :prop="'datasource.' + scope.$index + '. otherFiles'"
+        >
+          <fileMain v-model="scope.row.otherFiles" type="view"></fileMain>
+        </el-form-item>
+      </template>
       <!-- 表头工具栏 -->
       <template v-slot:toolbar>
         <div class="headbox">
@@ -446,7 +481,38 @@
         });
         return comitDatasource;
       },
+      setDeliveryDays() {
+        console.log(this.form.datasource,'this.form.datasource')
+        this.form.datasource.forEach((item, i) => {
+          let guaranteePeriodUnitName = this.guaranteePeriodUnit(
+            item.guaranteePeriodUnitCode
+          );
 
+          this.$set(
+            this.form.datasource[i],
+            'guaranteePeriodDeadline',
+            guaranteePeriodUnitName != 'second'
+              ? this.setDay(item.guaranteePeriod, guaranteePeriodUnitName)
+              : ''
+          );
+          // }
+        });
+      },
+      guaranteePeriodUnit(code) {
+        return code == 3
+          ? 'day'
+          : code == 4
+          ? 'month'
+          : code == 5
+          ? 'year'
+          : 'second';
+      },
+      setDay(addDay, dateType = 'day') {
+        console.log(addDay)
+        return dayjs(this.contractStartDate || new Date())
+          .add(addDay, dateType)
+          .format('YYYY-MM-DD');
+      },
       //修改回显
       async putTableValue(data) {
         console.log(data, 'data');
@@ -464,6 +530,7 @@
               data.discountTotalPrice ||
               data?.contractVO?.discountTotalPrice;
           }
+          this.setDeliveryDays()
           // this.supplierObj = await this.getSupplierObj(
           //   productList,
           //   'productId'

+ 2 - 2
src/views/financialManage/invoiceManage/components/purchasingAccountTable.vue

@@ -8,8 +8,8 @@
             <span>采购订单:</span>
             <span>{{ item.orderNo }}</span>
             <el-divider direction="vertical"></el-divider>
-            <span>计价方式:</span>
-            <span> {{ item.pricingWay == 1 ? '按数量计费' : '按重量计费' }}</span>
+            <!-- <span>计价方式:</span>
+            <span> {{ item.pricingWay == 1 ? '按数量计费' : '按重量计费' }}</span> -->
             <el-divider direction="vertical"></el-divider>
             <span>总金额:</span>
             <span>{{item.amountTotalPrice}}</span>

+ 2 - 2
src/views/financialManage/invoiceManage/components/saleAccountTable.vue

@@ -9,8 +9,8 @@
             <span>{{ item.orderNo }}</span>
             <el-divider direction="vertical"></el-divider>
             <span>计价方式:</span>
-            <span> {{ item.pricingWay == 1 ? '按数量计费' : '按重量计费' }}</span>
-            <el-divider direction="vertical"></el-divider>
+            <!-- <span> {{ item.pricingWay == 1 ? '按数量计费' : '按重量计费' }}</span>
+            <el-divider direction="vertical"></el-divider> -->
             <span>总金额:</span>
             <span>{{ item.amountTotalPrice }}</span>
             <el-divider direction="vertical"></el-divider>

+ 6 - 3
src/views/purchasingManage/inquiryManage/components/addDialog.vue

@@ -167,7 +167,6 @@
         :obj="item"
         :isUpdate="isUpdate"
         @deliveryDateChange="deliveryDateChange"
-        @setIsInquiry="setIsInquiry"
       ></inquiryTable>
       <process-submit-dialog
         api-fun-name="purchaseinquiryStatusAPI"
@@ -327,7 +326,7 @@
           this.$nextTick(() => {
             this.$refs.inventoryTable &&
               this.$refs.inventoryTable.putTableValue(data.detailList);
-              this.setIsInquiry()
+              // this.setIsInquiry()
             // this.$refs.rawDetailListRef &&
             //   this.$refs.rawDetailListRef.putTableValue(data.rawDetailList); //原料
             // this.$refs.outputDetailListRef &&
@@ -470,7 +469,7 @@
         this.supplierList = this.supplierList.filter(
           (item) => item.supplierId != supplierId
         );
-        this.setIsInquiry()
+        // this.setIsInquiry()
       },
 
       //选择产品
@@ -614,6 +613,9 @@
 
       async save(type) {
         let supplierList = [];
+        this.setIsInquiry()
+        // return
+
         this.supplierList.forEach((item) => {
           supplierList.push(
             this.$refs['inquiryTable' + item.supplierId][0].getTableValue()
@@ -648,6 +650,7 @@
           if (!this.isUpdate) {
             delete this.form.id;
           }
+
           this.form.supplierList.forEach((item) => {
             item.resultList = [
               ...item.resultList,

+ 6 - 0
src/views/purchasingManage/inquiryManage/components/detailDialog.vue

@@ -223,6 +223,12 @@
             showOverflowTooltip: true,
             align: 'center',
           },
+          {
+            width: 150,
+            prop: 'inquiryNum',
+            label: '已核价数量',
+            align: 'center'
+          },
           {
             width: 120,
             prop: 'totalWeight',

+ 1 - 0
src/views/purchasingManage/inquiryManage/components/inquiryTable.vue

@@ -705,6 +705,7 @@
         };
       },
       setIsInquiry() {
+        return
         this.$emit('setIsInquiry');
       },
       deliveryDateChange(row) {

+ 32 - 12
src/views/purchasingManage/inquiryManage/components/inventoryTable.vue

@@ -44,7 +44,6 @@
             filterable
             multiple
             collapse-tags
-        
           >
             <el-option
               v-for="i in scope.row.supplierList"
@@ -58,7 +57,7 @@
 
       <!-- 操作列 -->
 
-      <template v-slot:[item.slot]="scope" v-for="item in supplierList">
+      <!-- <template v-slot:[item.slot]="scope" v-for="item in supplierList">
         <el-form-item
           style="margin-bottom: 20px"
           :prop="'datasource.' + scope.$index + '.' + item.prop"
@@ -77,7 +76,6 @@
       </template>
       <template v-slot:[item.headerSlot]="scope" v-for="item in supplierList">
         <el-form-item style="margin-bottom: 20px">
-          <!-- <div style="display: flex"> -->
           <span>{{ item.label }}</span>
           <fileUpload
             v-model="item.files"
@@ -85,9 +83,8 @@
             :showLib="false"
             :limit="1"
           />
-          <!-- </div> -->
         </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)"
@@ -201,6 +198,7 @@
             minWidth: 100,
             label: '状态',
             fixed: 'left',
+            // sortable: true,
             formatter: (row, column) => {
               return row.isInquiry == 1
                 ? '部分核价'
@@ -245,7 +243,9 @@
             label: '供应商选择',
             slot: 'supplierIds',
             showOverflowTooltip: true,
-            align: 'center'
+            align: 'center',
+            filters: this.supplierList,
+            filterMethod: this.filterMethod
           },
           {
             minWidth: 100,
@@ -432,8 +432,8 @@
         });
       },
       setIsInquiry(list) {
-        return
-        
+        // return;
+
         this.form.datasource.forEach((productItem, index) => {
           //产品清单
           let isInquiry = 0,
@@ -444,17 +444,17 @@
               //供应商产品
               if (val.productCode == productItem.productCode) {
                 totalCountS.push(
-                  Number(val.totalCount||0) + Number(productItem.doneTotalCount||0)
+                  Number(val.totalCount || 0) +
+                    Number(productItem.doneTotalCount || 0)
                 );
               }
             });
           });
           if (totalCountS.length > 0) {
-        
             this.$set(
               this.form.datasource[index],
               'isInquiry',
-            
+
               Math.max(...totalCountS) >= productItem.totalCount ? 2 : 1
             );
           } else {
@@ -477,10 +477,17 @@
         });
         return comitDatasource;
       },
-
+      filterMethod(value, row, column) {
+        let ids = row.supplierList.map((item) => item.id);
+        if (ids.length > 0 && ids.includes(value)) {
+          return row;
+        }
+      },
       //修改回显
       async putTableValue(data) {
         if (data && data?.length) {
+          let supplierList = [],
+            supplierIds = [];
           this.form.datasource = data;
           let codeList = this.form.datasource.map((item) => item.productCode);
           //获取仓库库存
@@ -495,7 +502,20 @@
               'availableCountBase',
               find.availableCountBase
             );
+            supplierList.push(...item.supplierList);
           });
+          supplierIds = Array.from(
+            new Set(supplierList.map((item) => item.id))
+          );
+          this.supplierList = supplierIds.map((id) => {
+            let data = supplierList.find((item) => item.id == id);
+            return {
+              text: data.name,
+              value: data.id
+            };
+          });
+
+          console.log(this.supplierList, 'supplierList');
           this.$refs.table.reload();
         }
       },

+ 1 - 2
src/views/purchasingManage/purchaseOrder/outSourceSend/components/addOrEditDialog.vue

@@ -284,7 +284,6 @@
               productList,
               sourceTypeName,
               sourceType,
-              pricingWay
             } = data;
             if (productList && productList.length > 0) {
               productList.forEach((v) => {
@@ -301,7 +300,7 @@
               sourceTypeName,
               sourceType,
               productList,
-              pricingWay
+              
             });
             this.$refs.inventoryTableref &&
               this.$refs.inventoryTableref.putTableValue(productList);

+ 14 - 4
src/views/saleManage/quotation/components/addDialog.vue

@@ -281,7 +281,7 @@
 </template>
 
 <script>
-  import { emailReg, phoneReg, numberReg } from 'ele-admin';
+  import { emailReg, phoneReg, numberReg,telReg } from 'ele-admin';
   import { acceptUnpackoptions } from '@/enum/dict';
   import inventoryTable from '@/BIZComponents/inventoryTable.vue';
 
@@ -341,7 +341,7 @@
     data() {
       let formDef = {
         id: '',
-        acceptUnpack: null,
+        acceptUnpack: 1,
         askFile: [],
         contactAddress: '',
         opportunityId: '',
@@ -407,9 +407,15 @@
             { required: true, message: '请选择是否接受', trigger: 'change' }
           ],
           contactTel: [
+            // {
+            //   required: true,
+            //   pattern: phoneReg,
+            //   message: '请输入联系电话',
+            //   trigger: 'blur'
+            // },
             {
               required: true,
-              pattern: numberReg,
+              pattern: telReg,
               message: '请输入联系电话',
               trigger: 'blur'
             }
@@ -429,7 +435,7 @@
           quoteTel: [
             {
               required: true,
-              pattern: numberReg,
+              pattern: telReg,
               message: '请输入报价方联系电话',
               trigger: 'blur'
             }
@@ -589,6 +595,10 @@
         this.getBusinessList(base.name);
 
         this.$nextTick(() => {
+          if(this.form.opportunityType==1){
+            this.$refs.inventoryTable.putTableValue([])
+            this.form.opportunityId=''
+          }
           this.$refs.inventoryTable.setCustomerMark(base.serialNo);
         });
       },