瀏覽代碼

【新增】配置中心

莫绍宝 3 年之前
父節點
當前提交
d54c29d46f
共有 4 個文件被更改,包括 88 次插入27 次删除
  1. 9 0
      src/api/common.js
  2. 71 19
      src/views/setting/other.vue
  3. 4 4
      src/views/supply/apply/apply_list.vue
  4. 4 4
      src/views/supply/apply/engin_list.vue

+ 9 - 0
src/api/common.js

@@ -9,6 +9,15 @@ export function getDictList(params) {
   })
 }
 
+// 修改字典列表
+export function editDictList(params) {
+  return request({
+    url: '/common/dict/update',
+    method: 'post',
+    data: params
+  })
+}
+
 // 销售类型列表
 export function getTypeList(params) {
   return request({

+ 71 - 19
src/views/setting/other.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-radio-group v-model="formType" size="small">
+    <el-radio-group v-model="formType" size="small" @change="changeType">
       <el-radio-button label="first">订单日期设置</el-radio-button>
       <el-radio-button label="second">工程登录二次引用设置</el-radio-button>
       <el-radio-button label="third">自动预留单生成</el-radio-button>
@@ -10,27 +10,27 @@
     <div v-show="formType === 'first'">
       <div style="margin: 40px 0 30px;">
         <span>下单时间超过当天</span>
-        <el-time-picker v-model="firstForm.time" placeholder="选择时间点" size="small" style="width: 150px; margin: 0 10px;"></el-time-picker>
+        <el-time-picker v-model="firstForm.input1.dictValue" placeholder="选择时间点" size="small" format="HH:mm" style="width: 150px; margin: 0 10px;"></el-time-picker>
         <span>的订单,订单日期计为下一天的日期</span>
       </div>
-      <el-button type="primary" size="small">确 定</el-button>
+      <el-button type="primary" size="small" @click="submitForm('first')">确 定</el-button>
     </div>
 
     <div v-show="formType === 'second'">
       <div style="margin: 40px 0 30px;">
         <div>工程登录二次引用密码设置</div>
-        <div><el-input v-model="secondForm.password" placeholder="请输入密码" size="small" style="width: 150px; margin-top: 20px;"></el-input></div>
+        <div><el-input v-model="secondForm.input1.dictValue" placeholder="请输入密码" size="small" style="width: 150px; margin-top: 20px;"></el-input></div>
       </div>
-      <el-button type="primary" size="small">确 定</el-button>
+      <el-button type="primary" size="small" @click="submitForm('second')">确 定</el-button>
     </div>
 
     <div v-show="formType === 'third'">
       <div style="margin: 40px 0 30px;">
         <div>预留单自动生成时间,从订单审单后,第</div>
-        <el-input v-model="thirdForm.day" type="number" size="small" style="width: 150px; margin-top: 20px; margin-right: 10px"></el-input>
+        <el-input v-model="thirdForm.input1.dictValue" type="number" size="small" style="width: 150px; margin-top: 20px; margin-right: 10px"></el-input>
         <span>天零时起,按商家提交订单时间顺序,自动生成预留单</span>
       </div>
-      <el-button type="primary" size="small">确 定</el-button>
+      <el-button type="primary" size="small" @click="submitForm('third')">确 定</el-button>
     </div>
 
     <div v-show="formType === 'fourth'">
@@ -40,57 +40,63 @@
         <div style="margin-top: 10px">总可发货数为0,显示无货</div>
         <div style="margin-top: 10px">
           <span>总可发货数</span>
-          <el-input v-model="fourthForm.input1" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
+          <el-input v-model="fourthForm.input1.dictValue" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
           <span>到</span>
-          <el-input v-model="fourthForm.input2" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
+          <el-input v-model="fourthForm.input2.dictValue" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
           <span>,总库存显示具体数量</span>
         </div>
         <div style="margin-top: 10px">
           <span>总可发货数</span>
-          <el-input v-model="fourthForm.input3" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
+          <el-input v-model="fourthForm.input3.dictValue" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
           <span>到</span>
-          <el-input v-model="fourthForm.input4" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
+          <el-input v-model="fourthForm.input4.dictValue" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
           <span>,总库存显示有货</span>
         </div>
         <div style="margin-top: 10px">
           <span>总可发货数大于</span>
-          <el-input v-model="fourthForm.input5" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
+          <el-input v-model="fourthForm.input5.dictValue" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
           <span>,总库存显示充足</span>
         </div>
         <div style="margin-top: 30px">发货申请查询库存时:</div>
         <div style="margin-top: 10px">
           <span>可发货数大于</span>
-          <el-input v-model="fourthForm.input6" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
+          <el-input v-model="fourthForm.input6.dictValue" type="number" size="small" style="width: 100px; margin: 0 10px;"></el-input>
           <span>显示充足</span>
         </div>
       </div>
-      <el-button type="primary" size="small">确 定</el-button>
+      <el-button type="primary" size="small" @click="submitForm('fourth')">确 定</el-button>
     </div>
   </div>
 </template>
 
 <script>
+import { getDictList, editDictList } from '@/api/common'
 
 export default {
   data() {
     return {
       formType: 'first',
       firstForm: {
-        time: '',
+        input1: {},
       },
       secondForm: {
-        password: '',
+        input1: {},
       },
       thirdForm: {
-        day: '',
+        input1: {},
       },
       fourthForm: {
-
+        input1: {},
+        input2: {},
+        input3: {},
+        input4: {},
+        input5: {},
+        input6: {},
       }
     }
   },
   created() {
-    
+    this.getDetail('first');
   },
   methods: {
     // 查询按钮权限
@@ -102,6 +108,52 @@ export default {
       return true;
     },
 
+    changeType(val) {
+      this.getDetail(val);
+    },
+
+    getDetail(type) {
+      const MAP = {
+        first :'ORDER_TIME_LIMIT',
+        second :'ENGIN_TWO_PWD',
+        third :'RESERVED_DAY',
+        fourth :'STOCK_ORDER',
+      };
+      getDictList({sysDictEnum: MAP[type]}).then(res => {
+        let data = res.data.map(item => {
+          return {
+            sysDictId: item.sysDictId,
+            dictValue: item.dictValue,
+          }
+        })
+        if(type != 'fourth') {
+          this[type+'Form'].input1 = data[0];
+        }else {
+          this[type+'Form'].input1 = data[0];
+          this[type+'Form'].input2 = data[1];
+          this[type+'Form'].input3 = data[2];
+          this[type+'Form'].input4 = data[3];
+          this[type+'Form'].input5 = data[4];
+          this[type+'Form'].input6 = data[5];
+        }
+      })
+    },
+
+    submitForm(type) {
+      let list = [];
+      for(var key in this[type+'Form']) {
+        console.log(this[type+'Form'], this[type+'Form'][key].dictValue);
+        if(!this[type+'Form'][key].dictValue) {
+          return this.$errorMsg('请完善信息');
+        }
+        list.push(this[type+'Form'][key]);
+      }
+      editDictList(list).then(res => {
+        this.$successMsg('保存成功');
+        this.getDetail(type);
+      })
+    }
+
   }
 }
 </script>

+ 4 - 4
src/views/supply/apply/apply_list.vue

@@ -19,8 +19,8 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="仓库" prop="warehouse">
-                <el-input v-model="screenForm.warehouse" placeholder="请输入仓库"></el-input>
+              <el-form-item label="仓库名称" prop="warehouse">
+                <el-input v-model="screenForm.warehouse" placeholder="请输入仓库名称"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
@@ -193,7 +193,7 @@ export default {
     exParams() {
       return {
         id: this.screenForm.orderNum,
-        correspondId: this.screenForm.warehouse,
+        correspondName: this.screenForm.warehouse,
         customerNumber: this.screenForm.jxsNum,
         customerName: this.screenForm.jxsName,
         productName: this.screenForm.chName,
@@ -231,7 +231,7 @@ export default {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
         id: this.screenForm.orderNum,
-        correspondId: this.screenForm.warehouse,
+        correspondName: this.screenForm.warehouse,
         customerNumber: this.screenForm.jxsNum,
         customerName: this.screenForm.jxsName,
         productName: this.screenForm.chName,

+ 4 - 4
src/views/supply/apply/engin_list.vue

@@ -19,8 +19,8 @@
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
-              <el-form-item label="仓库" prop="warehouse">
-                <el-input v-model="screenForm.warehouse" placeholder="请输入仓库"></el-input>
+              <el-form-item label="仓库名称" prop="warehouse">
+                <el-input v-model="screenForm.warehouse" placeholder="请输入仓库名称"></el-input>
               </el-form-item>
             </el-col>
             <el-col :xs="24" :sm="12" :lg="6">
@@ -196,7 +196,7 @@ export default {
     exParams() {
       return {
         id: this.screenForm.orderNum,
-        correspondId: this.screenForm.warehouse,
+        correspondName: this.screenForm.warehouse,
         customerNumber: this.screenForm.jxsNum,
         customerName: this.screenForm.jxsName,
         productName: this.screenForm.chName,
@@ -234,7 +234,7 @@ export default {
         pageNum: this.currentPage,
         pageSize: this.pageSize,
         id: this.screenForm.orderNum,
-        correspondId: this.screenForm.warehouse,
+        correspondName: this.screenForm.warehouse,
         customerNumber: this.screenForm.jxsNum,
         customerName: this.screenForm.jxsName,
         productName: this.screenForm.chName,