Bläddra i källkod

Merge branch 'iteration-20240829-free' into 11/24SAAS

lex-xin 10 månader sedan
förälder
incheckning
d323deb1e8

+ 9 - 0
src/views/accompaniment/api.js

@@ -56,6 +56,15 @@ export const api_sysMusicScoreState = id => {
   });
 };
 
+// 批量停用/启用
+export const api_sysMusicScoreStateList = (data) => {
+  return request({
+    url: "/api-web/sysMusicScore/stateList",
+    method: "post",
+    data
+  });
+};
+
 export const queryPageSysExam = data => {
   return request({
     url: "/api-web/sysMusicScoreAccompaniment/queryPage",

+ 75 - 14
src/views/accompaniment/index.vue

@@ -5,17 +5,10 @@
       教学伴奏
     </h2>
     <div class="m-core">
-      <el-button
-        @click="open('COMMON')"
-        type="primary"
-        v-permission="'musicSheetApplicationExtend/saveBatch'"
-        >添加曲目</el-button
-      >
       <saveform
         ref="searchForm"
         :model.sync="searchForm"
         inline
-        style="margin-top: 20px"
       >
         <el-form-item prop="search">
           <el-input
@@ -72,12 +65,23 @@
             <el-option :value="1" label="收费"></el-option>
           </el-select>
         </el-form-item>
+        <el-form-item prop="clientShowFlag">
+          <el-select
+            v-model="searchForm.clientShowFlag"
+            clearable
+            filterable
+            placeholder="请选择业务曲目状态"
+          >
+            <el-option :value="1" label="启用"></el-option>
+            <el-option :value="0" label="停用"></el-option>
+          </el-select>
+        </el-form-item>
         <el-form-item prop="showFlag">
           <el-select
             v-model="searchForm.showFlag"
             clearable
             filterable
-            placeholder="请选择状态"
+            placeholder="请选择平台曲目状态"
           >
             <el-option :value="1" label="启用"></el-option>
             <el-option :value="0" label="停用"></el-option>
@@ -123,11 +127,41 @@
         </el-form-item>
       </saveform>
 
+      <div style="margin-bottom: 20px">
+        <el-button
+          @click="open('COMMON')"
+          type="primary"
+          v-permission="'musicSheetApplicationExtend/saveBatch'"
+          >添加曲目</el-button
+        >
+
+        <el-button
+          @click="onOperation('start')"
+          type="primary"
+          :disabled="chioseList.length <=0"
+          
+          >批量启用</el-button
+        >
+        <!-- v-permission="'sysMusicScore/stateList'" -->
+
+        <el-button
+          @click="onOperation('stop')"
+          type="error"
+          :disabled="chioseList.length <=0"
+          >批量停用</el-button
+        >
+      </div>
+      
+
       <el-table
         style="width: 100%"
         :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
         :data="tableList"
+        @selection-change="handleSelectionChange"
       >
+      <!-- @select-all="handleSelectionChange"
+        @select="onTableSelect" -->
+        <el-table-column type="selection" width="55" />
         <el-table-column
           align="center"
           prop="cbsMusicSheetId"
@@ -185,7 +219,12 @@
             {{ scope.row.isConvertibleScore ? "是" : "否" }}
           </template>
         </el-table-column>
-        <el-table-column align="center" label="状态">
+        <el-table-column align="center" label="业务曲目状态">
+          <template slot-scope="scope">
+            {{ scope.row.clientShowFlag ? "启用" : "停用" }}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="平台曲目状态">
           <template slot-scope="scope">
             {{ scope.row.showFlag ? "启用" : "停用" }}
           </template>
@@ -206,7 +245,7 @@
               v-permission="'sysMusicScore/state'"
               type="text"
               @click="changeStatus(scope.row)"
-              >{{ scope.row.showFlag ? "停用" : "启用" }}</el-button
+              >{{ scope.row.clientShowFlag ? "停用" : "启用" }}</el-button
             >
             <!-- <el-button
               type="text"
@@ -218,7 +257,7 @@
             <el-button
               type="text"
               @click="edit(scope.row)"
-              :disabled="!!scope.row.showFlag"
+              :disabled="!!scope.row.clientShowFlag"
               v-permission="'sysMusicScore/update'"
               >修改</el-button
             >
@@ -306,7 +345,8 @@ import {
   api_sysMusicScoreState,
   queryTree,
   Transcod,
-  musicSheetApplicationExtendStatus
+  musicSheetApplicationExtendStatus,
+  api_sysMusicScoreStateList
 } from "./api";
 import form from "./modals/form";
 import EditMusic from "./modals/edit-music";
@@ -352,6 +392,7 @@ export default {
         categoriesId: [],
         clientType: "",
         rankType: null,
+        clientShowFlag: null,
         showFlag: null,
         scoreType: null,
         isConvertibleScore: null
@@ -374,7 +415,8 @@ export default {
         children: "sysMusicScoreCategoriesList",
         checkStrictly: true,
         expandTrigger: "hover"
-      }
+      },
+      chioseList: []
     };
   },
   computed: {
@@ -419,6 +461,9 @@ export default {
         //
       }
     },
+    handleSelectionChange(val) {
+      this.chioseList = val;
+    },
     formatParentId(id, list, ids = []) {
       for (const item of list) {
         if (item.sysMusicScoreCategoriesList) {
@@ -556,7 +601,7 @@ export default {
     },
     async changeStatus(row) {
       try {
-        let status = row.showFlag ? "停用" : "启用";
+        let status = row.clientShowFlag ? "停用" : "启用";
         await this.$confirm("是否确认" + status + "此曲目?", "提示", {
           type: "warning"
         });
@@ -611,6 +656,22 @@ export default {
         },
         "确定导出教学伴奏"
       );
+    },
+    async onOperation(type = 'start') {
+      console.log(this.chioseList, 'this.chioseList')
+      try {
+        let status = type === 'stop' ? "停用" : "启用";
+        await this.$confirm("是否确认" + status + this.chioseList.length + "条数据?", "提示", {
+          type: "warning"
+        });
+        const ids = this.chioseList.map(item => { return item.id  }).join(',')
+        await api_sysMusicScoreStateList({
+          musicSheetIds: ids,
+          state: type === 'start' ? 1 : 0
+        });
+        this.$message.success(status + "成功");
+        this.FetchList();
+      } catch (error) {}
     }
   }
 };

+ 29 - 6
src/views/accompaniment/modals/edit-extra.vue

@@ -6,7 +6,7 @@
       label-position="right"
       label-width="100px"
     >
-      <el-form-item
+      <!-- <el-form-item
         label="曲谱分类"
         prop="musicSheetCategoryId"
         :rules="[
@@ -23,7 +23,7 @@
           placeholder="请选择分类"
           :props="treeProps"
         ></el-cascader>
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item
         label="是否收费"
         prop="paymentType"
@@ -93,6 +93,27 @@
           <el-option :value="0" label="否"></el-option>
         </el-select>
       </el-form-item>
+      <el-form-item
+        label="是否启用"
+        prop="status"
+        :rules="[
+          {
+            required: true,
+            message: '请选择是否启用'
+          }
+        ]"
+      >
+        <el-select
+          v-model="form.status"
+          clearable
+          filterable
+          placeholder="请选择是否启用"
+          style="width: 100% !important"
+        >
+          <el-option :value="1" label="是"></el-option>
+          <el-option :value="0" label="否"></el-option>
+        </el-select>
+      </el-form-item>
       <!-- <el-form-item
         label="排序值"
         prop="sortNo"
@@ -139,10 +160,11 @@ export default {
         children: "sysMusicScoreCategoriesList"
       },
       form: {
-        musicSheetCategoryId: null,
+        // musicSheetCategoryId: null,
         paymentType: null,
         sortNo: null,
         scoreType: null,
+        status: null,
         isConvertibleScore: null
       }
     };
@@ -150,13 +172,14 @@ export default {
   mounted() {
     console.log(this.scoreTypeList, "scoreTypeList");
     if (this.detail.id) {
-      this.form.musicSheetCategoryId = this.detail.categoriesId
-        ? this.formatParentId(this.detail.categoriesId, this.tree)
-        : [];
+      // this.form.musicSheetCategoryId = this.detail.categoriesId
+      //   ? this.formatParentId(this.detail.categoriesId, this.tree)
+      //   : [];
       this.form.paymentType = this.detail.rankIds ? "VIP" : "FREE";
       this.form.sortNo = this.detail.sortNo;
       this.form.scoreType = this.detail.scoreType;
       this.form.isConvertibleScore = this.detail.isConvertibleScore ? 1 : 0;
+      this.form.status = this.detail.clientStatus ? 1 : 0;
     }
   },
   methods: {

+ 71 - 48
src/views/accompaniment/modals/edit-music.vue

@@ -135,24 +135,11 @@
           label="可用声部"
           show-overflow-tooltip
         ></el-table-column>
-
-        <!-- <el-table-column
-          prop="composer"
-          label="音乐人"
-          show-overflow-tooltip
-        ></el-table-column> -->
-
-        <!-- <el-table-column
-          prop="musicSheetType"
-          label="多声轨渲染"
+        <el-table-column
+          prop="musicCategoryName"
+          label="曲目分类"
           show-overflow-tooltip
-        >
-          <template #default="scope">
-            <div>
-              {{ scope.row.musicSheetType === "SINGLE" ? "否" : "是" }}
-            </div>
-          </template>
-        </el-table-column> -->
+        ></el-table-column>
       </el-table>
 
       <pagination
@@ -197,6 +184,11 @@
           show-overflow-tooltip
           width="150"
         ></el-table-column>
+        <el-table-column
+          prop="musicCategoryName"
+          label="曲目分类"
+          show-overflow-tooltip
+        ></el-table-column>
 
         <!-- <el-table-column
           prop="composer"
@@ -217,7 +209,7 @@
           </template>
         </el-table-column> -->
 
-        <el-table-column prop="musicSheetCategoryId" width="180">
+        <!-- <el-table-column prop="musicSheetCategoryId" width="180">
           <template #header>
             曲谱分类
             <i
@@ -227,21 +219,6 @@
             ></i>
           </template>
           <template #default="scope">
-            <!-- <el-form-item label-width="auto" :show-message="false"> -->
-            <!-- <el-select
-              v-model="formLists[scope.$index].musicSheetCategoryId"
-              placeholder="请选择曲谱分类"
-              clearable
-              filterable
-              style="width:150px !important"
-            >
-              <el-option
-                v-for="option in tree"
-                :key="option.id"
-                :label="option.name"
-                :value="option.id"
-              ></el-option>
-            </el-select> -->
             <el-cascader
               popper-class="myCascader"
               v-model="formLists[scope.$index].musicSheetCategoryId"
@@ -252,9 +229,8 @@
               :options="tree"
               :props="treeProps"
             ></el-cascader>
-            <!-- </el-form-item> -->
           </template>
-        </el-table-column>
+        </el-table-column> -->
 
         <el-table-column prop="rankType" width="180">
           <template #header>
@@ -331,6 +307,29 @@
           </template>
         </el-table-column>
 
+        <el-table-column prop="status" width="180">
+          <template #header>
+            是否可启用
+            <i
+              class="el-icon-edit"
+              style="cursor: pointer"
+              @click="onDialogEdit('status')"
+            ></i>
+          </template>
+          <template #default="scope">
+            <el-select
+              v-model="formLists[scope.$index].status"
+              clearable
+              filterable
+              placeholder="请选择是否可启用"
+              style="width:150px !important"
+            >
+              <el-option :value="1" label="是"></el-option>
+              <el-option :value="0" label="否"></el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+
         <el-table-column prop="sortNumber" width="180">
           <template #header>
             排序
@@ -446,6 +445,18 @@
           <el-option :value="0" label="否"></el-option>
         </el-select>
       </div>
+      <div v-if="dialogType === 'status'">
+        <el-select
+          v-model="formLists[scope.$index].status"
+          clearable
+          filterable
+          placeholder="请选择是否可启用"
+          style="width:150px !important"
+        >
+          <el-option :value="1" label="是"></el-option>
+          <el-option :value="0" label="否"></el-option>
+        </el-select>
+      </div>
       <template #footer>
         <span class="dialog-footer">
           <el-button @click="dialogVisible = false"> 取消 </el-button>
@@ -626,11 +637,13 @@ export default {
             name: item.name,
             musicCover: item.musicCover,
             subjectNames: item.subjectNames,
+            musicCategoryName: item.musicCategoryName,
             composer: item.composer,
             sourceType: item.sourceType,
             musicSheetCategoryId: null,
             rankType: null,
             sortNumber: null,
+            status: null,
             isConvertibleScore: null,
             scoreType: null
           });
@@ -643,13 +656,13 @@ export default {
           const params = [];
           for (let i = 0; i < this.formLists.length; i++) {
             const item = this.formLists[i];
-            if (
-              !item.musicSheetCategoryId ||
-              item.musicSheetCategoryId.length == 0
-            ) {
-              this.$message.error("曲目标签不能为空");
-              return;
-            }
+            // if (
+            //   !item.musicSheetCategoryId ||
+            //   item.musicSheetCategoryId.length == 0
+            // ) {
+            //   this.$message.error("曲目标签不能为空");
+            //   return;
+            // }
             if (!item.rankType) {
               this.$message.error("收费方式不能为空");
               return;
@@ -666,6 +679,11 @@ export default {
               this.$message.error("是否可转谱不能为空");
               return;
             }
+            if(item.status === null || item.isConvertibleScore === undefined ||
+              item.isConvertibleScore === "") {
+              this.$message.error('是否启用不能为空')
+              return
+            }
             if (
               item.sortNumber === null ||
               item.sortNumber === undefined ||
@@ -677,12 +695,12 @@ export default {
             params.push({
               ...item,
               musicSheetId: item.id,
-              musicSheetCategoryId:
-                item.musicSheetCategoryId.length > 0
-                  ? item.musicSheetCategoryId[
-                      item.musicSheetCategoryId.length - 1
-                    ]
-                  : null,
+              // musicSheetCategoryId:
+              //   item.musicSheetCategoryId.length > 0
+              //     ? item.musicSheetCategoryId[
+              //         item.musicSheetCategoryId.length - 1
+              //       ]
+              //     : null,
               id: null
             });
           }
@@ -709,12 +727,15 @@ export default {
           this.dialogTitle = "默认谱面";
         } else if (type === "isConvertibleScore") {
           this.dialogTitle = "是否可转谱";
+        } else if(type === 'status') {
+          this.dialogTitle = '是否启用'
         }
         this.dialogForms.musicSheetCategoryId = null;
         this.dialogForms.rankType = null;
         this.dialogForms.sortNumber = null;
         this.dialogForms.scoreType = null;
         this.dialogForms.isConvertibleScore = null;
+        this.dialogForms.status = null
         this.dialogVisible = true;
         this.dialogType = type;
       } catch (e) {
@@ -734,6 +755,8 @@ export default {
           item.scoreType = this.dialogForms.scoreType;
         } else if (this.dialogType === "isConvertibleScore") {
           item.isConvertibleScore = this.dialogForms.isConvertibleScore;
+        } else if(this.dialogType === 'status') {
+          item.status = this.dialogForms.status;
         }
       });
       this.dialogVisible = false;

+ 1 - 1
src/views/categroyManager/specialSetup/branchSetting.vue

@@ -540,7 +540,7 @@ export default {
       try {
         // 不管是添加、查看、修改都传-1
         const tenantId = -1;
-        const res = await queryTree({ enable: 1, tenantId });
+        const res = await queryTree({ enable: 1, tenantId, queryType: 'TENANT' });
         const rows = res.data || [];
         rows.forEach(item => {
           let children = [];

+ 1 - 1
src/views/organManager/components/memberSetting.vue

@@ -195,7 +195,7 @@ export default {
       try {
         // 不管是添加、查看、修改都传-1
         const tenantId = -1;
-        const res = await queryTree({ enable: 1, tenantId });
+        const res = await queryTree({ enable: 1, tenantId, queryType: 'ALL' });
         const rows = res.data || [];
         rows.forEach(item => {
           let children = [];