ysy пре 1 година
родитељ
комит
d7e00bb824
3 измењених фајлова са 56 додато и 8 уклоњено
  1. 2 1
      src/enum/dict.js
  2. 52 6
      src/views/materialPlan/components/plan-edit-dialog.vue
  3. 2 1
      vue.config.js

+ 2 - 1
src/enum/dict.js

@@ -19,7 +19,8 @@ export default {
   交货状态: 'delivery_status',
   余量系数: 'margin_code',
   计量单位: 'measuring_uint',
-  开槽类型:'slotting_type'
+  开槽类型: 'slotting_type',
+  需求类型: 'requirement_source_type'
 };
 
 export const numberList = [

+ 52 - 6
src/views/materialPlan/components/plan-edit-dialog.vue

@@ -2,7 +2,7 @@
   <ele-modal
     :visible.sync="visible"
     :closed="cancel"
-    :title="`${type == 'add' ? '创建' : '编辑'}采购配料计划`"
+    :title="`${type == 'add' ? '创建' : '编辑'}配料计划`"
     custom-class="ele-dialog-form"
     :close-on-click-modal="true"
     :close-on-press-escape="false"
@@ -15,14 +15,32 @@
       class="ele-body"
       :rules="rules"
     >
-      <el-row :gutter="32">
-        <el-col :span="12">
-          <el-form-item label="配料计划名称" prop="name">
+      <el-row :gutter="24">
+        <el-col :span="8">
+          <el-form-item label="需求类型" prop="demandType">
+            <el-select
+              v-model="formData.demandType"
+              placeholder="请选择"
+              style="width: 100%"
+            >
+              <el-option
+                v-for="item in demandTypeList"
+                :key="item.dictCode"
+                :label="item.dictValue"
+                :value="item.dictCode"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
+
+        <el-col :span="8">
+          <el-form-item label="计划名称" prop="name">
             <el-input placeholder="请选择" v-model="formData.name"></el-input>
           </el-form-item>
         </el-col>
 
-        <el-col :span="12">
+        <el-col :span="8">
           <el-form-item label="备注" prop="remark">
             <el-input placeholder="备注" v-model="formData.remark"></el-input>
           </el-form-item>
@@ -261,6 +279,7 @@
   import ProductionVersion from '@/components/CreatePlan/ProductionVersion2.vue';
   import fileUpload from '@/components/upload/fileUpload';
   import timeDialog from './timeDialog';
+  import dictMixins from '@/mixins/dictMixins';
   export default {
     components: {
       saleOrderPop,
@@ -269,6 +288,7 @@
       fileUpload,
       timeDialog
     },
+    mixins: [dictMixins],
     data() {
       return {
         visible: false,
@@ -490,6 +510,13 @@
           }
         ],
         rules: {
+          demandType: [
+          {
+              required: true,
+              message: '请选择需求类型',
+              trigger: ['blur', 'change']
+            }
+          ],
           name: [
             {
               required: true,
@@ -503,13 +530,20 @@
           remark: '',
           detailRemoveIds: [],
           materialRemoveIds: []
-        }
+        },
+
+        demandTypeList: []
       };
     },
+
     methods: {
       async open(type, row) {
         this.type = type;
+
+        this.typeList();
+
         this.visible = true;
+
         if (row) {
           this.getDetail(row.id);
         } else {
@@ -519,6 +553,18 @@
         }
       },
 
+      typeList() {
+        this.requestDict('需求类型').then((res) => {
+          let _res = res || [];
+       
+          this.demandTypeList = _res.filter(
+            (f) => f.dictCode == 1 || f.dictCode == 6
+          );
+
+          console.log(  this.demandTypeList );
+        });
+      },
+
       getDetail(id) {
         getById(id).then((res) => {
           this.$set(this.formData, 'name', res.name);

+ 2 - 1
vue.config.js

@@ -32,8 +32,9 @@ module.exports = {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
         // target: 'http://192.168.1.210:86/',
-        target: 'http://192.168.1.116:18086',
+        // target: 'http://192.168.1.116:18086',
         // target: 'http://192.168.1.125:18086',
+        target: 'http://192.168.1.144:18086',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''