Sfoglia il codice sorgente

小程序下拉框

xw 7 ore fa
parent
commit
43286a5fc6
1 ha cambiato i file con 26 aggiunte e 20 eliminazioni
  1. 26 20
      src/views/hisStore/storeOrder/healthStoreList.vue

+ 26 - 20
src/views/hisStore/storeOrder/healthStoreList.vue

@@ -208,10 +208,10 @@
       <el-form-item label="小程序" prop="coursePlaySourceConfigId">
         <el-select v-model="queryParams.coursePlaySourceConfigId" placeholder="请选择所属小程序" clearable size="small">
           <el-option
-            v-for="dict in appMallOptions"
-            :key="dict.id"
-            :label="dict.name + '(' + dict.appid + ')'"
-            :value="dict.id"
+            v-for="dict in miniAppList"
+            :key="dict.appId"
+            :label="dict.appName + '(' + dict.appId + ')'"
+            :value="dict.appId"
           />
         </el-select>
       </el-form-item>
@@ -994,7 +994,7 @@ import Treeselect from '@riophae/vue-treeselect'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 import { getConfigByKey } from '@/api/system/config'
 import { listStoreProduct } from '@/api/hisStore/storeProduct'
-import {list as getAppMallOptions} from '@/api/course/coursePlaySourceConfig';
+import { getMiniProgramList } from '@/api/hisStore/storePayment'
 
 export default {
   components: { productOrder, productSelect, addUser, addUserAddress, Treeselect },
@@ -1090,7 +1090,6 @@ export default {
         { key: 'erpAccount', label: 'ERP账号', checked: false },
 
       ],
-      appMallOptions:[],
 
       importMsgOpen: false,
       importMsg: '',
@@ -1299,7 +1298,7 @@ export default {
 
     this.getList()
     this.getErpAccountList();
-    this.getAppMallOptions();
+    this.getAppList();
     this.getProduct()
   },
   methods: {
@@ -1866,10 +1865,19 @@ export default {
       this.erpPhone.open = false;
     },
 
-    // 获取小程序选项列表
-    getAppMallOptions() {
-      getAppMallOptions({pageNum:1,pageSize:100,isMall:1}).then(response => {
-        this.appMallOptions = response.rows;
+    // 获取小程序列表
+    getAppList() {
+      this.miniAppList = []
+      getMiniProgramList().then(response => {
+        const { code, data } = response
+        if (code === 200) {
+          this.miniAppList = data.map(v => {
+            return { appId: v.appid, appName: v.name }
+          })
+        }
+      }).catch(error => {
+        console.error('获取小程序列表失败:', error)
+        this.$message.error('获取小程序列表失败')
       })
     },
     // 获取已选择字段数量
@@ -2421,18 +2429,16 @@ export default {
     },
     getAppList() {
       this.miniAppList = []
-      const key = 'courseMa.config'
-      getConfigByKey(key).then(response => {
+      getMiniProgramList().then(response => {
         const { code, data } = response
         if (code === 200) {
-          let value = data?.configValue
-          if (value) {
-            const appList = JSON.parse(value)
-            this.miniAppList = appList.filter(v => v.type === '1').map(v => {
-              return { appId: v.appid, appName: v.name }
-            })
-          }
+          this.miniAppList = data.map(v => {
+            return { appId: v.appid, appName: v.name }
+          })
         }
+      }).catch(error => {
+        console.error('获取小程序列表失败:', error)
+        this.$message.error('获取小程序列表失败')
       })
     },
     // 提交发货单