wangxy 14 órája
szülő
commit
2dbd2d06d5

+ 3 - 2
src/api/course/userWatchCourseStatistics.js

@@ -70,10 +70,11 @@ export function exportUserWatchCourseStatisticsTotal(query) {
   })
 }
 
-export function getCampList() {
+export function getCampList(params) {
   return request({
     url: '/course/trainingCamp/getCampListLikeName',
-    method: 'get'
+    method: 'get',
+    params: params
   })
 }
 export function getPeriodList(query) {

+ 3 - 3
src/views/his/statistics/courseReport.vue

@@ -231,12 +231,12 @@ export default {
     this.createTime = [formatDate(yesterday), formatDate(yesterday)];
     this.queryParams.sTime = this.createTime[0];
     this.queryParams.eTime = this.createTime[1];
-    getCampList().then(response => {
+    getCampList({"pageNum": 1, "pageSize": 100}).then(response => {
       this.camps = response.data.list
       if (this.camps != null && this.camps.length > 0) {
-        this.companyId = this.camps[0].dictValue;
+        // this.companyId = this.camps[0].dictValue;
       }
-      this.camps.push({companyId: "-1", companyName: "无"})
+      // this.camps.push({companyId: "-1", companyName: "无"})
     });
     getCompanyList().then(response => {
       this.companys = response.data;

+ 35 - 3
src/views/hisStore/storeProduct/index.vue

@@ -859,6 +859,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>
@@ -931,6 +941,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: {
@@ -1048,7 +1059,9 @@ export default {
       title: "",
       // 是否显示弹出层
       open: false,
-
+      // 小程序列表
+      appMallOptions:[],
+      appIds:[], // 选择的小程序
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -1201,6 +1214,9 @@ export default {
     getCompanyList().then(response => {
       this.companyOptions = response.data;
     });
+    // 查询小程序
+    this.getAppMallOptions();
+
     listStore(this.storeForm).then(response => {
       this.storeOptions = response.rows;
     });
@@ -1208,6 +1224,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) {
@@ -1606,6 +1627,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);
@@ -1666,9 +1688,19 @@ 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) {
-              this.msgSuccess("修改成功");
+              // 根据是否有productId判断是新增还是修改
+              if (this.form.productId) {
+                this.msgSuccess("修改成功");
+              } else {
+                this.msgSuccess("新增成功");
+              }
               this.open = false;
               this.getList();
             }