Преглед изворни кода

采购计划和采购订单新增供应商字段

695593266@qq.com пре 10 месеци
родитељ
комит
43341f1a08

+ 9 - 0
src/api/materialPlan/index.js

@@ -183,3 +183,12 @@ export async function addUserPlan(data) {
   }
   return Promise.reject(new Error(res.data.message));
 }
+
+// 供应商列表
+export async function contactList(params) {
+  const res = await request.get(`/eom/contact/page`, { params });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 45 - 2
src/views/materialPlan/components/plan-edit-dialog.vue

@@ -191,6 +191,25 @@
                 {{ row.unit }}
               </template>
 
+              <template v-slot:supplierId="{ row }">
+                <el-select
+                  v-model="row.supplierId"
+                  size="mini"
+                  clearable
+                  class="ele-block"
+                  filterable
+                  placeholder="请选择供应商"
+                  disabled
+                >
+                  <el-option
+                    v-for="(item, index) in gysList"
+                    :key="item.id + index"
+                    :value="item.id"
+                    :label="item.name"
+                  ></el-option>
+                </el-select>
+              </template>
+
               <template v-slot:demandQuantity="{ row }">
                 <el-input
                   v-model="row.demandQuantity"
@@ -399,7 +418,8 @@
     listBomByBomVersionId,
     listBomBySalesOrderId,
     save,
-    getById
+    getById,
+    contactList
   } from '@/api/materialPlan/index';
   import ProductionVersion from '@/components/CreatePlan/ProductionVersion2.vue';
 
@@ -456,6 +476,7 @@
         ],
         expandedRowKeys: [],
         bomType: 1,
+        gysList: [],
         bomCategoryList: [],
         bomTypeList: [
           { id: '1', label: 'PBOM' },
@@ -715,6 +736,13 @@
             align: 'center',
             minWidth: 160
           },
+          {
+            label: '供应商',
+            slot: 'supplierId',
+            action: 'supplierId',
+            align: 'center',
+            minWidth: 160
+          },
           {
             label: '到货方式',
             slot: 'deliveryMethod',
@@ -776,7 +804,9 @@
       }
     },
 
-    created() {},
+    created() {
+      this.getContactList();
+    },
 
     methods: {
       async open(type, row) {
@@ -802,6 +832,19 @@
           });
         }
       },
+
+      getContactList() {
+        let param = {
+          pageNum: 1,
+          type: 2,
+          size: -1,
+          status: 1
+        };
+        contactList(param).then((res) => {
+          this.gysList = res.list;
+        });
+      },
+
       getDetail(id) {
         getById(id).then((res) => {
           this.$set(this.formData, 'demandType', res.demandType);

+ 48 - 2
src/views/materialPlan/components/producePlan.vue

@@ -344,6 +344,25 @@
                 />
               </template>
 
+              <template v-slot:supplierId="{ row }">
+                <el-select
+                  v-model="row.supplierId"
+                  size="mini"
+                  clearable
+                  class="ele-block"
+                  filterable
+                  placeholder="请选择供应商"
+                  disabled
+                >
+                  <el-option
+                    v-for="(item, index) in gysList"
+                    :key="item.id + index"
+                    :value="item.id"
+                    :label="item.name"
+                  ></el-option>
+                </el-select>
+              </template>
+
               <template v-slot:action="{ row }" v-if="type != 'detail'">
                 <el-popconfirm
                   class="ele-action"
@@ -450,7 +469,8 @@
     listBomBySalesOrderId,
     listBomByBomVersionId,
     save,
-    getById
+    getById,
+    contactList
   } from '@/api/materialPlan/index';
   import ProductionVersion from '@/components/CreatePlan/ProductionVersion2.vue';
   // import fileUpload from '@/components/addDoc/index.vue';
@@ -526,9 +546,16 @@
               trigger: ['blur', 'change']
             }
           ]
-        }
+        },
+        gysList: []
       };
     },
+
+    created() {
+      // this.getDictList('productionType');
+      // this.getZeroPartPros('zeroPartPros');
+      this.getContactList();
+    },
     computed: {
       // 表格列配置
       columns() {
@@ -777,6 +804,13 @@
             align: 'center',
             minWidth: 160
           },
+          {
+            label: '供应商',
+            slot: 'supplierId',
+            action: 'supplierId',
+            align: 'center',
+            minWidth: 160
+          },
           {
             label: '要求到货时间',
             slot: 'requireDeliveryTime',
@@ -841,6 +875,18 @@
         }
       },
 
+      getContactList() {
+        let param = {
+          pageNum: 1,
+          type: 2,
+          size: -1,
+          status: 1
+        };
+        contactList(param).then((res) => {
+          this.gysList = res.list;
+        });
+      },
+
       getDetail(id) {
         getById(id).then((res) => {
           this.$set(this.formData, 'demandType', res.demandType);

+ 2 - 2
vue.config.js

@@ -36,10 +36,10 @@ module.exports = {
         // target: 'http://192.168.1.158:18086',
         // target: 'http://192.168.158:18086',
         // target: 'http://192.168.1.251:18086',
-        // target: 'http://192.168.1.144:18086',
+        target: 'http://192.168.1.144:18086',
         // target: 'http://192.168.1.211:18086',
         // target: 'http://192.168.1.251:18186',
-        target: 'http://192.168.1.125:18086',
+        // target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.116:18086',
 
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域