瀏覽代碼

功能开关改造,新增平台配置页面

chenguo 3 周之前
父節點
當前提交
929234caa8

+ 0 - 10
src/api/hisStore/configInit.js

@@ -1,10 +0,0 @@
-import request from '@/utils/request'
-
-// 查询参数列表
-export function initMedicalMallConfig(query) {
-  return request({
-    url: '/configInit/initMedicalMallConfig',
-    method: 'get',
-    params: query
-  })
-}

+ 8 - 0
src/api/hisStore/store.js

@@ -9,6 +9,14 @@ export function listStore(query) {
   })
 }
 
+export function listStoreOptions(query) {
+  return request({
+    url: '/store/his/store/listOption',
+    method: 'get',
+    params: query
+  })
+}
+
 // 查询店铺管理详细
 export function getStore(storeId) {
   return request({

+ 30 - 1
src/views/hisStore/storeProductCategory/index.vue

@@ -10,6 +10,12 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="所属店铺" prop="storeId" v-if="medicalMallConfig.isStores">
+        <el-select v-model="queryParams.storeId" placeholder="请选择所属店铺" clearable size="small">
+          <el-option v-for="item in storeList" :key="item.storeId" :label="item.storeName" :value="item.storeId">
+          </el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item>
 	    <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -37,6 +43,7 @@
       :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
     >
       <el-table-column label="分类名称" align="left" prop="cateName" />
+      <el-table-column label="所属店铺" align="center" prop="storeId" :formatter="storeNameFormatter" v-if="medicalMallConfig.isStores"/>
       <el-table-column  label="状态" align="center" prop="isShow">
         <template slot-scope="scope">
           <div>
@@ -99,6 +106,8 @@ import { listStoreProductCategory, getStoreProductCategory, delStoreProductCateg
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import Material from '@/components/Material'
+import { listStoreOptions } from '@/api/hisStore/store'
+import { getConfigByKey } from '@/api/system/config'
 export default {
   name: "HisStoreProductCategory",
   components: {
@@ -112,6 +121,8 @@ export default {
   },
   data() {
     return {
+      storeList: {},
+      medicalMallConfig: {},
       picArr: [],
       // 遮罩层
       loading: true,
@@ -132,7 +143,8 @@ export default {
         sort: null,
         pic: null,
         isShow: null,
-        isDel: null
+        isDel: null,
+        storeId: null
       },
       // 表单参数
       form: {},
@@ -152,8 +164,25 @@ export default {
   },
   created() {
     this.getList();
+    listStoreOptions().then(response => {
+      this.storeList = response.data;
+    });
+    getConfigByKey("medicalMall.func.switch").then(response => {
+      if(response.data && response.data.configValue) {
+        this.medicalMallConfig = JSON.parse(response.data.configValue);
+      }
+    });
   },
   methods: {
+    storeNameFormatter(row){
+      if(row){
+        const option = this.storeList.find(item => item.storeId === row.storeId);
+        if(option){
+          return option.storeName
+        }
+      }
+      return row.storeId === null ? '总公司' : '未知';
+    },
     /** 查询商品分类列表 */
     getList() {
       this.loading = true;

+ 0 - 2
src/views/system/config/config.vue

@@ -2248,7 +2248,6 @@ import companyMenuConfig from './companyMenuConfig'
 import IntegralConfig from '@/views/system/config/integralConfig.vue'
 import { getCitys } from '@/api/store/city'
 import { listCompany } from '@/api/company/company'
-import { initMedicalMallConfig } from '@/api/hisStore/configInit'
 import { getStoreProductColumns } from '@/api/hisStore/storeProduct'
 import { getStoreColumns } from '@/api/hisStore/store'
 
@@ -3076,7 +3075,6 @@ export default {
       const param = { configId: this.configId, configKey: this.configKey, configValue: JSON.stringify(this.form27) }
       updateConfigByKey(param).then(response => {
         if (response.code === 200) {
-          initMedicalMallConfig();
           this.msgSuccess('修改成功')
         }
       })