三七 7 hodín pred
rodič
commit
d1eab8af43

+ 56 - 9
src/views/his/integralGoods/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
       <el-form-item label="商品名称" prop="goodsName">
         <el-input
           v-model="queryParams.goodsName"
@@ -30,6 +30,16 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item label="所属小程序" prop="appId">
+        <el-select style="width: 240px" v-model="queryParams.appId" placeholder="请选择所属小程序" clearable size="small">
+          <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>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -215,6 +225,16 @@
             >{{dict.dictLabel}}</el-radio>
           </el-radio-group>
         </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>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -266,6 +286,7 @@ import Material from '@/components/Material';
 import Editor from '@/components/Editor/wang';
 import { getToken } from "@/utils/auth";
 import integralGoodsDetails from '../../components/his/integralGoodsDetails';
+import { list as getAppMallOptions } from '@/api/course/coursePlaySourceConfig'
 export default {
   name: "IntegralGoods",
   components: {Material,Editor,integralGoodsDetails},
@@ -279,6 +300,11 @@ export default {
   },
   data() {
     return {
+
+      appIds:[], // 选择的小程序
+      // 小程序列表
+      appMallOptions:[],
+
       show:{
               open:false,
             },
@@ -329,6 +355,7 @@ export default {
         goodsName: null,
         goodsType: null,
         status: null,
+        appId: null,
         integral: null,
         createTime: null
       },
@@ -346,6 +373,10 @@ export default {
     };
   },
   created() {
+
+    // 查询小程序
+    this.getAppMallOptions();
+
     this.getList();
     this.getDicts("sys_integral_goods_type").then(response => {
       this.goodsTypeOptions = response.data;
@@ -355,12 +386,19 @@ export default {
     });
   },
   methods: {
-        handledetails(row){
-            this.show.open=true;
-            setTimeout(() => {
-                 this.$refs.Details.getDetails(row.goodsId);
-            }, 1);
-        },
+
+    getAppMallOptions() {
+      getAppMallOptions({pageNum:1,pageSize:100}).then(response => {
+        this.appMallOptions = response.rows;
+      })
+    },
+
+    handledetails(row){
+        this.show.open=true;
+        setTimeout(() => {
+             this.$refs.Details.getDetails(row.goodsId);
+        }, 1);
+    },
   /** 导入按钮操作 */
     handleImport() {
       this.upload.title = "导入";
@@ -465,6 +503,8 @@ export default {
          if(this.form.images!=null){
              this.photoArr=this.form.images.split(",");
            }
+        this.appIds = this.form.appIds ? this.form.appIds.split(',') : [];
+
         //修改按钮
         setTimeout(() => {
                   if(this.form.descs==null){
@@ -480,15 +520,22 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
+
+          // 小程序
+          const params = {
+            ...this.form,
+            appIds: this.appIds.join(',') // 数组转字符串
+          };
+
           if (this.form.goodsId != null) {
-            updateIntegralGoods(this.form).then(response => {
+            updateIntegralGoods(params).then(response => {
               this.msgSuccess("修改成功");
               this.open = false;
               this.reset();
               this.getList();
             });
           } else {
-            addIntegralGoods(this.form).then(response => {
+            addIntegralGoods(params).then(response => {
               this.msgSuccess("新增成功");
               this.open = false;
               this.reset();

+ 12 - 1
src/views/hisStore/storeProduct/index.vue

@@ -57,6 +57,16 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item label="所属小程序" prop="appId">
+        <el-select style="width: 240px" v-model="queryParams.appId" placeholder="请选择所属小程序" clearable size="small">
+          <el-option
+            v-for="dict in appMallOptions"
+            :key="dict.appid"
+            :label="dict.name + '(' + dict.appid + ')'"
+            :value="dict.appid"
+          />
+        </el-select>
+      </el-form-item>
       <div v-if="this.isMedicalMall">
       <el-form-item label="审核状态">
         <el-select style="width: 240px" v-model="queryParams.isAudit" placeholder="请选择审核状态" size="small" >
@@ -1109,7 +1119,8 @@ export default {
         dosage: null,
         adverseReactions: null,
         contraindications: null,
-        precautions: null
+        precautions: null,
+        appId:null
       },
       // 表单参数
       form: {},

+ 48 - 4
src/views/hisStore/storeProductCategory/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
       <el-form-item label="分类名称" prop="cateName">
         <el-input
           v-model="queryParams.cateName"
@@ -10,6 +10,16 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
+      <el-form-item label="所属小程序" prop="appId">
+        <el-select style="width: 240px" v-model="queryParams.appId" placeholder="请选择所属小程序" clearable size="small">
+          <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>
 	    <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>
@@ -85,7 +95,16 @@
         <el-form-item label="排序" prop="sort">
           <el-input-number v-model="form.sort" placeholder="请输入排序" />
         </el-form-item>
-
+        <el-form-item label="所属小程序" prop="appIds" v-if="form.pid==0">
+          <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>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
@@ -99,6 +118,7 @@ import { listStoreProductCategory, getStoreProductCategory, delStoreProductCateg
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import Material from '@/components/Material'
+import { list as getAppMallOptions } from '@/api/course/coursePlaySourceConfig'
 export default {
   name: "HisStoreProductCategory",
   components: {
@@ -125,12 +145,16 @@ export default {
       title: "",
       // 是否显示弹出层
       open: false,
+      appIds:[], // 选择的小程序
+      // 小程序列表
+      appMallOptions:[],
       // 查询参数
       queryParams: {
         pid: null,
         cateName: null,
         sort: null,
         pic: null,
+        appId:null,
         isShow: null,
         isDel: null
       },
@@ -151,9 +175,19 @@ export default {
     };
   },
   created() {
+
+    // 查询小程序
+    this.getAppMallOptions();
+
     this.getList();
   },
   methods: {
+
+    getAppMallOptions() {
+      getAppMallOptions({pageNum:1,pageSize:100}).then(response => {
+        this.appMallOptions = response.rows;
+      })
+    },
     /** 查询商品分类列表 */
     getList() {
       this.loading = true;
@@ -232,6 +266,9 @@ export default {
         if(this.form.pic){
           this.picArr=this.form.pic.split(",");
         }
+
+        this.appIds = this.form.appIds ? this.form.appIds.split(',') : [];
+
         this.form.isShow = response.data.isShow.toString();
         this.open = true;
         this.title = "修改商品分类";
@@ -241,8 +278,15 @@ export default {
     submitForm() {
       this.$refs["form"].validate(valid => {
         if (valid) {
+
+          // 小程序
+          const params = {
+            ...this.form,
+            appIds: this.appIds.join(',') // 数组转字符串
+          };
+
           if (this.form.cateId != null) {
-            updateStoreProductCategory(this.form).then(response => {
+            updateStoreProductCategory(params).then(response => {
               if (response.code === 200) {
                 this.msgSuccess("修改成功");
                 this.open = false;
@@ -250,7 +294,7 @@ export default {
               }
             });
           } else {
-            addStoreProductCategory(this.form).then(response => {
+            addStoreProductCategory(params).then(response => {
               if (response.code === 200) {
                 this.msgSuccess("新增成功");
                 this.open = false;