2 Commits cd18fc5102 ... dd53390cb4

Autor SHA1 Mensagem Data
  caoliqin dd53390cb4 Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_adminUI há 1 semana atrás
  caoliqin c209cdae7e feat:商品设置所属小程序,小程序过滤展示商品 há 1 semana atrás

+ 29 - 2
src/views/hisStore/storeProduct/index.vue

@@ -869,6 +869,16 @@
             />
           </el-select>
         </el-form-item>
+        <el-form-item label="所属小程序" prop="appIds">
+          <el-select style="width: 240px" v-model="appIds" placeholder="请选择所属小程序" clearable size="small" multiple>
+            <el-option
+              v-for="dict in appMallOptions"
+              :key="dict.appid"
+              :label="dict.name + '(' + dict.appid + ')'"
+              :value="dict.appid"
+            />
+          </el-select>
+        </el-form-item>
         <el-form-item label="退货地址" prop="returnAddress">
           <el-input v-model="form.returnAddress" type="textarea" :rows="1" placeholder="请输入退货地址" />
         </el-form-item>
@@ -944,6 +954,7 @@ import Material from '@/components/Material'
 import singleImg from '@/components/Material/single'
 import { getCompanyList } from "@/api/company/company";
 import { listStore } from '@/api/hisStore/store'
+import {list as getAppMallOptions} from "@/api/course/coursePlaySourceConfig";
 export default {
   name: "HisStoreProduct",
   components: {
@@ -1061,7 +1072,9 @@ export default {
       title: "",
       // 是否显示弹出层
       open: false,
-
+      // 小程序列表
+      appMallOptions:[],
+      appIds:[], // 选择的小程序
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -1214,6 +1227,9 @@ export default {
     getCompanyList().then(response => {
       this.companyOptions = response.data;
     });
+    // 查询小程序
+    this.getAppMallOptions();
+
     listStore(this.storeForm).then(response => {
       this.storeOptions = response.rows;
     });
@@ -1221,6 +1237,11 @@ export default {
     this.getList();
   },
   methods: {
+    getAppMallOptions() {
+      getAppMallOptions({pageNum:1,pageSize:100}).then(response => {
+        this.appMallOptions = response.rows;
+      })
+    },
     getStatusText(row) {
       console.log()
       if (row.isAudit == 0) {
@@ -1622,6 +1643,7 @@ export default {
         if (response.data.companyIds != null && response.data.companyIds != undefined && response.data.companyIds.length > 0) {
           this.form.companyIds = response.data.companyIds.split(',').map(Number);
         }
+        this.appIds = this.form.appIds ? this.form.appIds.split(',') : [];
         setTimeout(() => {
           that.generate();
         }, 200);
@@ -1682,7 +1704,12 @@ export default {
           if (this.form.companyIds != null && this.form.companyIds != undefined) {
             this.form.companyIds = this.form.companyIds.join(',');
           }
-          addOrEdit(this.form).then(response => {
+          // 小程序
+          const params = {
+            ...this.form,
+            appIds: this.appIds.join(',') // 数组转字符串
+          };
+          addOrEdit(params).then(response => {
             if (response.code === 200) {
               // 根据是否有productId判断是新增还是修改
               if (this.form.productId) {

+ 13 - 1
src/views/hisStore/storeProductAudit/index.vue

@@ -644,6 +644,16 @@
             />
           </el-select>
         </el-form-item>
+        <el-form-item label="所属小程序" prop="appIds">
+          <el-select style="width: 240px" v-model="appIds" placeholder="请选择所属小程序" clearable size="small" multiple>
+<!--            <el-option-->
+<!--              v-for="dict in appMallOptions"-->
+<!--              :key="dict.appid"-->
+<!--              :label="dict.name + '(' + dict.appid + ')'"-->
+<!--              :value="dict.appid"-->
+<!--            />-->
+          </el-select>
+        </el-form-item>
         <el-form-item label="国药准字" v-if="form.productType===2" prop="prescribeCode">
           <el-input v-model="form.prescribeCode" placeholder="请输入国药准字" />
         </el-form-item>
@@ -839,7 +849,7 @@ export default {
       title: "",
       // 是否显示弹出层
       open: false,
-
+      appIds:[],
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -1341,6 +1351,8 @@ export default {
         if (response.data.companyIds != null && response.data.companyIds != undefined && response.data.companyIds.length > 0) {
           this.form.companyIds = response.data.companyIds.split(',').map(Number);
         }
+
+        this.appIds = this.form.appIds ? this.form.appIds.split(',') : [];
         setTimeout(() => {
           that.generate();
         }, 200);