浏览代码

添加字段

lex 1 年之前
父节点
当前提交
69409c3947

+ 7 - 0
src/constant/index.js

@@ -646,3 +646,10 @@ export const suggestionType = {
   APP: "软件反馈",
   SMART_PRACTICE: "智能陪练"
 };
+
+// scoreType  默认谱面(STAVE: 五线谱; JIAN: 固定调; FIRST: 首调)
+export const scoreType = {
+  STAVE: "五线谱",
+  JIAN: "固定调",
+  FIRST: "首调"
+};

+ 3 - 1
src/utils/searchArray.js

@@ -34,7 +34,8 @@ import {
   schoolUserType,
   shareLiveType,
   courseEmnu,
-  suggestionType
+  suggestionType,
+  scoreType
 } from "../constant";
 // 课程类型
 let tenantConfig = sessionStorage.getItem("tenantConfig");
@@ -916,6 +917,7 @@ export const schoolUserTypeList = getValueForKey(schoolUserType);
 export const shareLiveTypeList = getValueForKey(shareLiveType);
 export const courseEmnuList = getValueForKey(courseEmnu);
 export const suggestionTypeList = getValueForKey(suggestionType);
+export const scoreTypeList = getValueForKey(scoreType);
 //downListType
 function getValueForKey(obj) {
   let arr = [];

+ 4 - 0
src/utils/vueFilter.js

@@ -957,6 +957,10 @@ Vue.filter("suggestionType", value => {
   return constant.suggestionType[value];
 });
 
+Vue.filter("scoreType", value => {
+  return constant.scoreType[value];
+});
+
 Vue.filter("rangeType", value => {
   let obj = {
     ALL: "全部",

+ 43 - 1
src/views/accompaniment/index.vue

@@ -83,6 +83,34 @@
             <el-option :value="0" label="停用"></el-option>
           </el-select>
         </el-form-item>
+        <el-form-item prop="scoreType">
+          <el-select
+            v-model="searchForm.scoreType"
+            clearable
+            filterable
+            clearable
+            filterable
+            placeholder="请选择默认谱面"
+          >
+            <el-option
+              v-for="(item, index) in scoreTypeList"
+              :key="index"
+              :value="item.value"
+              :label="item.label"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item prop="isConvertibleScore">
+          <el-select
+            v-model="searchForm.isConvertibleScore"
+            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>
           <el-button @click="submit" type="primary">搜索</el-button>
           <el-button @click="reset" type="danger">重置</el-button>
@@ -147,6 +175,16 @@
             {{ scope.row.rankIds ? "收费" : "免费" }}
           </template>
         </el-table-column>
+        <el-table-column align="center" label="默认谱面">
+          <template slot-scope="scope">
+            {{ scope.row.scoreType | scoreType }}
+          </template>
+        </el-table-column>
+        <el-table-column align="center" label="是否可转谱">
+          <template slot-scope="scope">
+            {{ scope.row.isConvertibleScore ? "是" : "否" }}
+          </template>
+        </el-table-column>
         <el-table-column align="center" label="状态">
           <template slot-scope="scope">
             {{ scope.row.showFlag ? "启用" : "停用" }}
@@ -279,6 +317,7 @@ import deepClone from "@/helpers/deep-clone/";
 import Tooltip from "@/components/Tooltip/index";
 import { Export } from "@/utils/downLoadFile";
 import { getSubject } from "@/api/buildTeam";
+import { scoreTypeList } from "@/utils/searchArray";
 import qs from "qs";
 import cleanDeep from "clean-deep";
 export default {
@@ -293,6 +332,7 @@ export default {
   },
   data() {
     return {
+      scoreTypeList,
       parts: [],
       selectPart: 0,
       tabName: "first",
@@ -312,7 +352,9 @@ export default {
         categoriesId: [],
         clientType: "",
         rankType: null,
-        showFlag: null
+        showFlag: null,
+        scoreType: null,
+        isConvertibleScore: null
       },
       rules: {
         // 分页规则

+ 56 - 1
src/views/accompaniment/modals/edit-extra.vue

@@ -45,6 +45,54 @@
           <el-option value="VIP" label="收费"></el-option>
         </el-select>
       </el-form-item>
+
+      <el-form-item
+        label="默认谱面"
+        prop="scoreType"
+        :rules="[
+          {
+            required: true,
+            message: '请选择默认谱面'
+          }
+        ]"
+      >
+        <el-select
+          v-model="form.scoreType"
+          clearable
+          filterable
+          placeholder="请选择默认谱面"
+          style="width: 100% !important"
+        >
+          <el-option
+            v-for="(item, index) in scoreTypeList"
+            :key="index"
+            :value="item.value"
+            :label="item.label"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item
+        label="是否可转谱"
+        prop="isConvertibleScore"
+        :rules="[
+          {
+            required: true,
+            message: '请选择是否可转谱'
+          }
+        ]"
+      >
+        <el-select
+          v-model="form.isConvertibleScore"
+          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"
@@ -77,12 +125,14 @@
   </div>
 </template>
 <script>
+import { scoreTypeList } from "@/utils/searchArray";
 import { Update } from "../api";
 export default {
   name: "edit-extra",
   props: ["detail", "tree"],
   data() {
     return {
+      scoreTypeList,
       treeProps: {
         value: "id",
         label: "name",
@@ -91,17 +141,22 @@ export default {
       form: {
         musicSheetCategoryId: null,
         paymentType: null,
-        sortNo: null
+        sortNo: null,
+        scoreType: null,
+        isConvertibleScore: null
       }
     };
   },
   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.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;
     }
   },
   methods: {

+ 103 - 2
src/views/accompaniment/modals/edit-music.vue

@@ -280,6 +280,57 @@
             <!-- </el-form-item> -->
           </template>
         </el-table-column>
+
+        <el-table-column prop="scoreType" width="180">
+          <template #header>
+            默认谱面
+            <i
+              class="el-icon-edit"
+              style="cursor: pointer"
+              @click="onDialogEdit('scoreType')"
+            ></i>
+          </template>
+          <template #default="scope">
+            <el-select
+              v-model="formLists[scope.$index].scoreType"
+              clearable
+              filterable
+              placeholder="请选择默认谱面"
+              style="width:150px !important"
+            >
+              <el-option
+                v-for="(item, index) in scoreTypeList"
+                :key="index"
+                :value="item.value"
+                :label="item.label"
+              ></el-option>
+            </el-select>
+          </template>
+        </el-table-column>
+
+        <el-table-column prop="isConvertibleScore" width="180">
+          <template #header>
+            是否可转谱
+            <i
+              class="el-icon-edit"
+              style="cursor: pointer"
+              @click="onDialogEdit('isConvertibleScore')"
+            ></i>
+          </template>
+          <template #default="scope">
+            <el-select
+              v-model="formLists[scope.$index].isConvertibleScore"
+              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>
             排序
@@ -367,6 +418,34 @@
           style="width: 100% !important"
         />
       </div>
+      <div v-if="dialogType === 'scoreType'">
+        <el-select
+          v-model="dialogForms.scoreType"
+          clearable
+          filterable
+          placeholder="请选择默认谱面"
+          style="width: 100% !important"
+        >
+          <el-option
+            v-for="(item, index) in scoreTypeList"
+            :key="index"
+            :value="item.value"
+            :label="item.label"
+          ></el-option>
+        </el-select>
+      </div>
+      <div v-if="dialogType === 'isConvertibleScore'">
+        <el-select
+          v-model="dialogForms.isConvertibleScore"
+          clearable
+          filterable
+          placeholder="请选择是否可转谱"
+          style="width: 100% !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>
@@ -384,6 +463,7 @@ import {
   api_pageByApplication,
   musicSheetApplicationExtendSaveBatch
 } from "../api";
+import { scoreTypeList } from "@/utils/searchArray";
 export default {
   name: "edit-music",
   props: ["tree"],
@@ -392,6 +472,7 @@ export default {
   },
   data() {
     return {
+      scoreTypeList,
       currentStep: 0,
       chioseIdList: [], // 选中的数据
       searchForm: {
@@ -412,7 +493,9 @@ export default {
       dialogForms: {
         musicSheetCategoryId: null,
         rankType: null,
-        sortNumber: null
+        sortNumber: null,
+        isConvertibleScore: null,
+        scoreType: null
       },
       dialogVisible: false,
       tableList: [],
@@ -547,7 +630,9 @@ export default {
             sourceType: item.sourceType,
             musicSheetCategoryId: null,
             rankType: null,
-            sortNumber: null
+            sortNumber: null,
+            isConvertibleScore: null,
+            scoreType: null
           });
         });
         this.formLists = tempList;
@@ -569,6 +654,18 @@ export default {
               this.$message.error("收费方式不能为空");
               return;
             }
+            if (!item.scoreType) {
+              this.$message.error("默认谱面不能为空");
+              return;
+            }
+            if (
+              item.isConvertibleScore === null ||
+              item.isConvertibleScore === undefined ||
+              item.isConvertibleScore === ""
+            ) {
+              this.$message.error("是否可转谱不能为空");
+              return;
+            }
             if (
               item.sortNumber === null ||
               item.sortNumber === undefined ||
@@ -627,6 +724,10 @@ export default {
           item.rankType = this.dialogForms.rankType;
         } else if (this.dialogType === "sortNumber") {
           item.sortNumber = this.dialogForms.sortNumber;
+        } else if (this.dialogType === "scoreType") {
+          item.scoreType = this.dialogForms.scoreType;
+        } else if (this.dialogType === "isConvertibleScore") {
+          item.isConvertibleScore = this.dialogForms.isConvertibleScore;
         }
       });
       this.dialogVisible = false;