Forráskód Böngészése

28:多个小程序、公众号关联不同的销售端

Long 1 hete
szülő
commit
8bf61ca51c
2 módosított fájl, 74 hozzáadás és 4 törlés
  1. 60 1
      src/views/his/company/index.vue
  2. 14 3
      src/views/system/config/config.vue

+ 60 - 1
src/views/his/company/index.vue

@@ -279,6 +279,36 @@
 <!--                              end: '24:00'-->
 <!--                            }"></el-time-select>-->
 <!--      </el-form-item>-->
+        <el-form-item label="公众号点播配置" prop="courseMaAppId">
+          <el-select
+            v-model="form.courseMaAppId"
+            placeholder="请选择公众号"
+            clearable
+            size="small"
+          >
+            <el-option
+              v-for="item in maAppList"
+              :key="item.appId"
+              :label="item.appName"
+              :value="item.appId"
+            />
+          </el-select>
+        </el-form-item>
+      <el-form-item label="小程序点播配置" prop="courseMiniAppId">
+        <el-select
+          v-model="form.courseMiniAppId"
+          placeholder="请选择公众号"
+          clearable
+          size="small"
+        >
+          <el-option
+            v-for="item in miniAppList"
+            :key="item.appId"
+            :label="item.appName"
+            :value="item.appId"
+          />
+        </el-select>
+      </el-form-item>
          <el-form-item label="备注" prop="remark">
           <el-input v-model="form.remark" type="textarea"  :rows="2" placeholder="请输入备注" />
         </el-form-item>
@@ -345,6 +375,7 @@ import {docList} from "@/api/his/doctor";
 import {getVoiceApiList } from "@/api/company/companyVoiceApi";
 import {getCitysArea} from "../../../api/company/company";
 import {cateList} from "@/api/his/packageCate";
+import { getConfigByKey } from '@/api/system/config'
 export default {
   name: "Company",
   data() {
@@ -403,6 +434,8 @@ export default {
       // 表单参数
       form: {
         restartTime: '13:10',
+        courseMaAppId: null,
+        courseMiniAppId: null,
       },
       // 表单校验
      rules: {
@@ -469,6 +502,8 @@ export default {
        open:false,
        title:"后台扣款"
      },
+      maAppList: [],
+      miniAppList: [],
     };
   },
   created() {
@@ -572,7 +607,9 @@ export default {
         remark: null,
         linkName: null,
         limitUserCount: null,
-        isDel: null
+        isDel: null,
+        courseMaAppId: null,
+        courseMiniAppId: null,
       };
       this.resetForm("form");
     },
@@ -613,6 +650,7 @@ export default {
     /** 新增按钮操作 */
     handleAdd() {
       this.reset();
+      this.getAppList()
       this.open = true;
 	  this.doctorIds=[]
       this.title = "添加公司";
@@ -620,6 +658,7 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
+      this.getAppList()
 	  this.doctorIds=[]
       const companyId = row.companyId || this.ids
       getCompany(companyId).then(response => {
@@ -643,6 +682,26 @@ export default {
         }
       });
     },
+    getAppList() {
+      this.maAppList = []
+      this.miniAppList = []
+      const key = "courseMa.config"
+      getConfigByKey(key).then(response => {
+        const {code,data} = response
+        if (code === 200) {
+          let value = data?.configValue
+          if (value) {
+            const appList = JSON.parse(value);
+            this.maAppList = appList.filter(v => v.type === '1').map(v => {
+              return { appId: v.appid, appName: v.name }
+            })
+            this.miniAppList = appList.filter(v => v.type === '2').map(v => {
+              return { appId: v.appid, appName: v.name }
+            })
+          }
+        }
+      })
+    },
     /** 提交按钮 */
     submitForm() {
       this.$refs["form"].validate(valid => {

+ 14 - 3
src/views/system/config/config.vue

@@ -1030,9 +1030,20 @@
        <el-tab-pane label="点播小程序配置" name="courseMa.config">
          <el-button type="primary" @click="addCourseMaConfig" style="margin-bottom: 10px">添加配置</el-button>
          <el-table  height="660" border v-loading="courseMaConfigLoading" :data="courseMaConfigList">
-           <el-table-column label="小程序名称" align="center" prop="name">
+           <el-table-column label="名称" align="center" prop="name">
              <template slot-scope="scope">
-               <el-input v-model="scope.row.name" placeholder="请输入小程序名称" :disabled="!scope.row.editing" />
+               <el-input v-model="scope.row.name" placeholder="请输入名称" :disabled="!scope.row.editing" />
+             </template>
+           </el-table-column>
+           <el-table-column label="类型" align="center" prop="type">
+             <template slot-scope="scope">
+               <el-select
+                 v-model="scope.row.type"
+                  placeholder="请选择类型"
+                 :disabled="!scope.row.editing">
+                 <el-option label="小程序" value="1"></el-option>
+                 <el-option label="公众号" value="2"></el-option>
+               </el-select>
              </template>
            </el-table-column>
            <el-table-column label="AppId" align="center" prop="appid">
@@ -1243,7 +1254,7 @@
        </el-tab-pane>
     </el-tabs>
 
-    
+
 
 
     <el-dialog :title="product.title" v-if="product.open"  :visible.sync="product.open" width="1000px" append-to-body>