Sfoglia il codice sorgente

采购计划选择供应商

yusheng 11 mesi fa
parent
commit
cc8f9afafe

+ 65 - 20
src/views/purchasingManage/purchaseOrder/components/addDialog.vue

@@ -10,6 +10,8 @@
     @close="cancel"
     :maxable="true"
     :resizable="true"
+    append-to-body
+
   >
     <el-form
       ref="form"
@@ -370,18 +372,6 @@
               placeholder="请输入"
             />
           </el-form-item>
-          <!-- <el-form-item
-            label="收货地址"
-            prop="receiveAddress"
-
-          >
-            <el-input
-              clearable
-              type="textarea"
-              v-model="form.receiveAddress"
-              placeholder="请输入"
-            />
-          </el-form-item> -->
         </el-col>
         <el-col :span="12">
           <el-form-item label="优惠后总金额" prop="payAmount">
@@ -457,6 +447,31 @@
       @success="putTableValue"
       @contractSuccess="contractSuccess"
     ></planTableList>
+    <ele-modal
+      custom-class="ele-dialog-form long-dialog-form"
+      :visible.sync="supplierListShow"
+      title="选择供应商"
+      :close-on-click-modal="false"
+      width="600px"
+      append-to-body
+
+    >
+      <el-select style="width: 100%" v-model="supplierId" placeholder="请选择">
+        <el-option
+          v-for="item in supplierList"
+          :key="item.supplierId"
+          :label="item.supplierName"
+          :value="item.supplierId"
+        >
+        </el-option>
+      </el-select>
+      <div slot="footer" class="footer">
+        <el-button type="primary" @click="changeParent({ id:supplierId });supplierListShow=false"
+          >确认</el-button
+        >
+        <el-button @click="supplierListShow = false">返回</el-button>
+      </div>
+    </ele-modal>
   </ele-modal>
 </template>
 
@@ -577,6 +592,9 @@
       };
 
       return {
+        supplierListShow: false,
+        supplierList: [],
+        supplierId: '',
         orderSourceType,
         outsourceSceneList,
         requirementSourceType,
@@ -622,7 +640,7 @@
         // 是否是修改
         isUpdate: false,
         businessId: '',
-        winnerSuppleIds: '',
+        winnerSuppleIds: ''
       };
     },
     computed: {
@@ -630,9 +648,9 @@
         return this.$store.state.order.allcountAmount;
       },
       rules() {
-        let isRequired=this.isRequired
+        let isRequired = this.isRequired;
         // console.log(this.isRequired);
-        
+
         return {
           deliveryDate: [
             { required: true, message: '请选择交货日期', trigger: 'change' }
@@ -672,7 +690,11 @@
             }
           ],
           partaLinkName: [
-            { required: isRequired, message: '请选择供应商联系人', trigger: 'change' }
+            {
+              required: isRequired,
+              message: '请选择供应商联系人',
+              trigger: 'change'
+            }
           ],
           acceptUnpack: [
             { required: true, message: '请选择是否接受', trigger: 'change' }
@@ -719,7 +741,7 @@
     },
     created() {
       console.log(this);
-      
+
       this.getGroupAll();
       this.getEnterprisePage();
       this.changePersonel();
@@ -817,13 +839,36 @@
         });
         info['rawDetailList'] = info.rawList;
         info['outputDetailList'] = info.outputList;
-        if (info.productList.length > 1) {
-          this.$refs.planTableListRef.open(info);
-        } else {
+        // if (info.productList.length > 1) {
+        //   this.$refs.planTableListRef.open(info);
+        // } else {
+
+        // }
+        let supplierList = res.detailList
+          .filter((item) => item.supplierId)
+          .map((item) => {
+            return {
+              supplierId: item.supplierId,
+              supplierName: item.supplierName
+            };
+          });
+        if (supplierList) {
+          this.supplierList = Array.from(
+            new Set(supplierList.map((obj) => JSON.stringify(obj)))
+          ).map((str) => JSON.parse(str));
           this.$nextTick(() => {
             this.putTableValue(info);
           });
+          if (
+            this.supplierList.length == 1 &&
+            this.supplierList[0]?.supplierId
+          ) {
+            await this.changeParent({ id: this.supplierList[0]?.supplierId });
+          } else {
+            this.supplierListShow = true;
+          }
         }
+
         // let form = {
         //   contractVO: {
         //     ...this.form

+ 2 - 0
src/views/purchasingManage/purchaseOrder/components/detailDialog.vue

@@ -11,6 +11,8 @@
     :maxable="true"
     :resizable="true"
     :modal="modal"
+    append-to-body
+
   >
     <div class="switch">
       <div class="switch_left">

+ 3 - 1
src/views/purchasingManage/purchasePlanManage/components/addDialog.vue

@@ -450,7 +450,9 @@
                 this.form.requirementId = data[key];
               }
             }
-
+            data.detailList.forEach(item=>{
+              delete item.id
+            })
             this.$refs.inventoryTable &&
               this.$refs.inventoryTable.putTableValue(data.detailList);
             // 根据部门获取人员

+ 7 - 0
src/views/saleManage/saleOrder/components/searchTable.vue

@@ -52,6 +52,13 @@
             type: 'input',
             placeholder: ''
           },
+          {
+            label: '项目名称:',
+            value: 'projectName',
+            width: 380,
+            type: 'input',
+            placeholder: ''
+          },
           {
             label: '产品名称:',
             value: 'productName',