Browse Source

蒙牛-积分商品配置

三七 3 weeks ago
parent
commit
f9dd12465f
1 changed files with 56 additions and 3 deletions
  1. 56 3
      src/views/hisStore/integralGoods/index.vue

+ 56 - 3
src/views/hisStore/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="120px">
       <el-form-item label="商品名称" prop="goodsName">
         <el-input
           v-model="queryParams.goodsName"
@@ -30,6 +30,26 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item label="状态" prop="status">
+        <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
+          <el-option
+            v-for="dict in statusOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </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>
@@ -211,6 +231,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>
@@ -262,6 +292,7 @@ import Material from '@/components/Material';
 import Editor from '@/components/Editor/wang';
 import { getToken } from "@/utils/auth";
 import integralGoodsDetails from '../components/integralGoodsDetails';
+import { list as getAppMallOptions } from '@/api/course/coursePlaySourceConfig'
 export default {
   name: "HisIntegralGoods",
   components: {Material,Editor,integralGoodsDetails},
@@ -275,6 +306,11 @@ export default {
   },
   data() {
     return {
+
+      appIds:[], // 选择的小程序
+      // 小程序列表
+      appMallOptions:[],
+
       show:{
               open:false,
             },
@@ -325,6 +361,7 @@ export default {
         goodsName: null,
         goodsType: null,
         status: null,
+        appId: null,
         integral: null,
         createTime: null
       },
@@ -343,6 +380,10 @@ export default {
   },
   created() {
     this.getList();
+
+    // 查询小程序
+    this.getAppMallOptions();
+
     this.getDicts("sys_integral_goods_type").then(response => {
       this.goodsTypeOptions = response.data;
     });
@@ -351,6 +392,11 @@ export default {
     });
   },
   methods: {
+    getAppMallOptions() {
+      getAppMallOptions({pageNum:1,pageSize:100}).then(response => {
+        this.appMallOptions = response.rows;
+      })
+    },
         handledetails(row){
             this.show.open=true;
             setTimeout(() => {
@@ -477,15 +523,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();