Переглянути джерело

Merge remote-tracking branch 'origin/master'

chenguo 19 годин тому
батько
коміт
9db4e36ce1

+ 26 - 0
src/views/components/his/packageDetails.vue

@@ -60,6 +60,15 @@
             :src="img"
             :preview-src-list="[img]">
         </el-image>
+    </el-descriptions-item>
+    <el-descriptions-item label="所属小程序">
+      <el-tag
+        v-for="name in appNames"
+        :key="name"
+        style="margin-right: 4px"
+      >
+        {{ name }}
+      </el-tag>
     </el-descriptions-item>
         </el-descriptions>
             </div>
@@ -116,6 +125,7 @@
 
 <script>
 import { listPackage, getPackage, delPackage, addPackage, updatePackage, exportPackage } from "@/api/his/package";
+import {list as getAppMallOptions} from '@/api/course/coursePlaySourceConfig';
   export default {
     name: "patientdetails",
     props:["data"],
@@ -129,6 +139,7 @@ import { listPackage, getPackage, delPackage, addPackage, updatePackage, exportP
        orOptions:[],
        packageTypeOptions: [],
        diseaseTypeOptions: [],
+       appMallOptions:[],
        // 是否删除字典
        isDelOptions: [],
        packageSubTypeOptions:[],
@@ -136,6 +147,15 @@ import { listPackage, getPackage, delPackage, addPackage, updatePackage, exportP
         productJson:[],
       }
     },
+    computed: {
+      appNames() {
+        if (!this.item.appIds) return [];
+        const ids = this.item.appIds.split(',');
+        return ids
+          .map(id => this.appMallOptions.find(opt => opt.appid === id)?.name)
+          .filter(Boolean); // 过滤掉找不到的
+      }
+    },
     created() {
      this.getDicts("sys_company_status").then(response => {
        this.statusOptions = response.data;
@@ -159,9 +179,15 @@ import { listPackage, getPackage, delPackage, addPackage, updatePackage, exportP
      this.getDicts("sys_prescribe_disease_type").then(response => {
        this.diseaseTypeOptions = response.data;
      });
+     this.getAppMallOptions();
 
     },
     methods: {
+      getAppMallOptions() {
+        getAppMallOptions({pageNum:1,pageSize:100,isMall:1}).then(response => {
+          this.appMallOptions = response.rows;
+        })
+      },
       getDetails(orderId) {
           this.item=null;
           getPackage(orderId).then(response => {

+ 31 - 0
src/views/course/coursePlaySourceConfig/index.vue

@@ -137,6 +137,11 @@
           <dict-tag  :options="typesOptions" :value="scope.row.type"/>
         </template>
       </el-table-column>
+      <el-table-column label="互医/商城小程序" align="center" prop="isMall" width="80px">
+        <template slot-scope="scope">
+          <el-tag prop="isMall" v-for="(item, index) in isMallOptions" v-if="scope.row.isMall==item.dictValue">{{item.dictLabel}}</el-tag>
+        </template>
+      </el-table-column>
       <el-table-column label="创建时间" align="center" prop="createTime" />
       <el-table-column label="修改时间" align="center" prop="updateTime" />
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
@@ -200,6 +205,21 @@
             />
           </el-select>
         </el-form-item>
+        <el-form-item label="是否是互医/商城小程序" prop="isMall">
+          <el-select
+            v-model="form.isMall"
+            style="width: 220px"
+            clearable
+            size="small"
+          >
+            <el-option
+              v-for="item in isMallOptions"
+              :key="item.dictValue"
+              :label="item.dictLabel"
+              :value="item.dictValue"
+            />
+          </el-select>
+        </el-form-item>
         <el-form-item label="图标" prop="img">
           <image-upload v-model="form.img" :file-type='["png", "jpg", "jpeg"]' :limit="1"/>
         </el-form-item>
@@ -276,6 +296,16 @@ export default {
       list: [],
       total: 0,
       typesOptions: [],
+      isMallOptions:[
+        {
+          dictLabel: "是",
+          dictValue: 1
+        },
+        {
+          dictLabel: "否",
+          dictValue: 0
+        }
+      ],
       title: null,
       open: false,
       form: {},
@@ -419,6 +449,7 @@ export default {
     handleAdd() {
       this.reset()
       this.open = true
+        this.form.isMall = 0;
       this.title = "添加小程序配置"
     },
     handleUpdate(row) {

+ 36 - 15
src/views/course/videoResource/index.vue

@@ -332,7 +332,7 @@
       </el-form>
       <div slot="footer" class="dialog-footer">
         <el-button @click="cancel">取消</el-button>
-        <el-button type="primary" @click="submitForm" :disabled="isUploading">
+        <el-button type="primary" @click="submitForm" :loading="add" :disabled="isUploading || add">
           {{ isUploading ? '上传中...' : '保存' }}
         </el-button>
       </div>
@@ -406,6 +406,11 @@
             {{ getTypeName(scope.row.typeId) }}
           </template>
         </el-table-column>
+        <el-table-column label="子分类" align="center" min-width="100">
+          <template slot-scope="scope">
+            {{ getTypeName(scope.row.typeSubId) }}
+          </template>
+        </el-table-column>
         <el-table-column label="关联项目" align="center" min-width="100">
           <template slot-scope="scope">
           <a
@@ -522,7 +527,7 @@
 
       <div class="dialog-footer">
         <el-button @click="cancelBatch">取 消</el-button>
-        <el-button type="primary" @click="submitBatchAdd">保 存</el-button>
+        <el-button type="primary" :loading="add" :disabled="add || isUploading" @click="submitBatchAdd">保 存</el-button>
       </div>
       <!-- 批量上传视频弹窗 -->
       <el-dialog
@@ -1094,9 +1099,10 @@ export default {
       this.$refs["form"].validate(valid => {
         if (valid) {
           if (this.add){
-            this.$message.warning("文件上传中,请稍后再试")
+            this.$message.warning("请勿重复提交")
             return
           }
+          this.add = true
 
           const params = Object.assign({}, this.form);
           params.projectIds = this.form.projectIds.join(',');
@@ -1107,7 +1113,7 @@ export default {
                 this.open = false;
                 this.getList();
               }
-            });
+            })
           } else {
             addVideoResource(params).then(response => {
               if (response.code === 200) {
@@ -1115,7 +1121,7 @@ export default {
                 this.open = false;
                 this.getList();
               }
-            });
+            })
           }
         }
       });
@@ -1273,7 +1279,7 @@ export default {
             this.uploadCancellationTokens.set(form.tempId, tokens);
           }
         });
-        
+
         let line_1 = `${process.env.VUE_APP_VIDEO_LINE_1}${data.urlPath}`;
         form.fileKey = data.urlPath.substring(1);
         form.videoUrl = line_1;
@@ -1310,7 +1316,7 @@ export default {
             this.uploadCancellationTokens.set(form.tempId, tokens);
           }
         });
-        
+
         form.line2 = `${process.env.VUE_APP_VIDEO_LINE_2}/${data.urlPath}`;
 
         // 更新线路2状态为成功
@@ -1355,7 +1361,7 @@ export default {
       const file = options.file;
       this.getMediaDuration(file);
       this.currentUploadProgress = { total: 0, line1: 0, line2: 0, line1Status: 'pending', line2Status: 'pending' };
-      
+
       try {
         await this.getFirstThumbnail(file, this.form);
         const [line1Result, line2Result] = await Promise.allSettled([
@@ -1414,6 +1420,7 @@ export default {
     /** 批量新增 */
     handleBatchAdd() {
       this.batchAddVisible = true;
+      this.add =false
       this.videoList = []; // 清空之前的视频列表
     },
     /** 批量修改 */
@@ -1486,12 +1493,24 @@ export default {
     },
     /** 提交批量添加 */
     submitBatchAdd() {
+      if (this.videoList.length === 0) {
+        this.$message.warning("请选择视频");
+        return;
+      }
+
       // 检查是否所有选中的视频都已上传完成
       const incompleteVideos = this.videoList.filter(item => (item.progress || 0) < 100);
       if (incompleteVideos.length > 0) {
         this.$message.warning('有未完成上传的视频,请先完成上传');
         return;
       }
+
+      if (this.add){
+        this.$message.warning("请勿重复提交")
+        return
+      }
+      this.add = true
+
       // 调用批量添加API
       const videoList = JSON.parse(JSON.stringify(this.videoList));
       videoList.forEach(item => {
@@ -1503,7 +1522,7 @@ export default {
           this.batchAddVisible = false;
           this.getList();
         }
-      });
+      })
     },
     /** 获取分类名称 */
     getTypeName(typeId) {
@@ -1564,7 +1583,7 @@ export default {
             console.error('Error cancelling COS upload:', error);
           }
         }
-        
+
         // Cancel OBS upload if exists
         if (cancellationTokens.obs) {
           try {
@@ -1574,7 +1593,7 @@ export default {
             console.error('Error cancelling OBS upload:', error);
           }
         }
-        
+
         // Remove cancellation tokens
         this.uploadCancellationTokens.delete(row.tempId);
       }
@@ -1716,6 +1735,7 @@ export default {
         return;
       }
 
+      this.isUploading = true;
       this.isProcessingBatch = true;
 
       while (this.uploadQueue.length > 0) {
@@ -1750,6 +1770,7 @@ export default {
       }
 
       this.isProcessingBatch = false;
+      this.isUploading = false;
       this.$message.success('所有视频上传队列处理完成!');
     },
 
@@ -2082,7 +2103,7 @@ export default {
             console.error('Error cancelling COS upload:', error);
           }
         }
-        
+
         // Cancel OBS upload if exists
         if (cancellationTokens.obs) {
           try {
@@ -2092,7 +2113,7 @@ export default {
             console.error('Error cancelling OBS upload:', error);
           }
         }
-        
+
         // Remove cancellation tokens
         this.uploadCancellationTokens.delete(row.tempId);
       }
@@ -2176,7 +2197,7 @@ export default {
           tokens.cos = uploadInfo.cancel;
           this.uploadCancellationTokens.set(tempVideo.tempId, tokens);
         });
-        
+
         let line_1 = `${process.env.VUE_APP_VIDEO_LINE_1}${data.urlPath}`;
         tempVideo.fileKey = data.urlPath.substring(1);
         tempVideo.videoUrl = line_1;
@@ -2202,7 +2223,7 @@ export default {
           tokens.obs = uploadInfo.cancel;
           this.uploadCancellationTokens.set(tempVideo.tempId, tokens);
         });
-        
+
         tempVideo.line2 = `${process.env.VUE_APP_VIDEO_LINE_2}/${data.urlPath}`;
         return { success: true, url: tempVideo.line2 };
       } catch (error) {

+ 39 - 5
src/views/his/package/index.vue

@@ -91,6 +91,16 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item label="所属小程序" prop="appName" >
+        <el-select v-model="queryParams.appId" placeholder="请选择" clearable>
+          <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>
@@ -538,6 +548,16 @@
                   />
           </el-select>
         </el-form-item>
+        <el-form-item label="所属小程序" prop="appId">
+          <el-select v-model="appId" 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>
@@ -620,7 +640,8 @@ import { getToken } from "@/utils/auth";
 import Material from '@/components/Material'
 import ImageUpload from '@/components/ImageUpload'
 import { Loading } from 'element-ui';
-import { getOptions } from '@/api/his/packageSolarTerm'
+import { getOptions } from '@/api/his/packageSolarTerm';
+import {list as getAppMallOptions} from '@/api/course/coursePlaySourceConfig';
 export default {
   name: "Package",
   components: { packageDetails,Editor,productAttrValueSelect,Material },
@@ -634,6 +655,7 @@ export default {
   },
   data() {
     return {
+      appId:[],
       open1: false,
       form1:{},
       finalQuality:1,
@@ -718,6 +740,7 @@ export default {
       isDelOptions: [],
       packageSubTypeOptions:[],
       solarTermOptions: [],
+      appMallOptions:[],
       photoArr:[],
       // 查询参数
       queryParams: {
@@ -807,7 +830,8 @@ export default {
       this.privateTypeOptions = response.data.privateType;
     });
     this.getTemp();
-    this.getSolarTermOptions()
+    this.getSolarTermOptions(),
+    this.getAppMallOptions();
     listStore().then(response => {
       this.storeOPtions = response.rows;
     });
@@ -824,6 +848,11 @@ export default {
         this.solarTermOptions = response.data;
       })
     },
+    getAppMallOptions() {
+      getAppMallOptions({pageNum:1,pageSize:100,isMall:1}).then(response => {
+        this.appMallOptions = response.rows;
+      })
+    },
     handleUpdateMore(row){
       this.reset1();
       this.title = "批量修改套餐状态";
@@ -1105,6 +1134,7 @@ export default {
         if(this.form.followNum!=null ){
           this.form.followNum=JSON.stringify(this.form.followNum)
         }
+        this.appId=this.form.appIds ? this.form.appIds.split(',') : [];
         setTimeout(() => {
                   if(this.form.desc==null){
                     this.$refs.myeditor.setText("");
@@ -1138,14 +1168,18 @@ export default {
             this.form.productJson=JSON.stringify(this.drugList)
           }
           this.form.describeJson = JSON.stringify(this.describeJson);
-          if (this.form.packageId != null) {
-            updatePackage(this.form).then(response => {
+          const params = {
+            ...this.form,
+            appIds: this.appId.join(',') // 数组转字符串
+          };
+          if (params.packageId != null) {
+            updatePackage(params).then(response => {
               this.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addPackage(this.form).then(response => {
+            addPackage(params).then(response => {
               this.msgSuccess("新增成功");
               this.open = false;
               this.getList();

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

@@ -1149,9 +1149,9 @@ export default {
         precautions: [
           { required: true, message: "注意事项不能为空", trigger: "blur" }
         ],
-        storeId :[
-          { required: true, message: "所属店铺不能为空", trigger: "blur"}
-        ],
+        // storeId :[
+        //   { required: true, message: "所属店铺不能为空", trigger: "blur"}
+        // ],
       }
     };
   },