Browse Source

提交测试

1
mo 3 years ago
parent
commit
0d992d56d1

+ 9 - 0
src/api/specialSetting.js

@@ -48,6 +48,15 @@ export function getParentArea (data) {
   })
 }
 
+// 查询所有子集科目
+export function subSubjectList (data) {
+  return request({
+    url: api + `/subject/search`,
+    method: 'get',
+    params: data
+  })
+}
+
 // 分页查询科目列表
 export function subjectListTree (data) {
   return request({

+ 237 - 45
src/views/categroyManager/globalSubjects.vue

@@ -1,65 +1,257 @@
+<!--  -->
 <template>
   <div class="m-container">
     <h2>
       <div class="squrt"></div>
-      声部分类设置
+      声部设置
     </h2>
+
     <div class="m-core">
-      <!-- navMenu -->
-        <!-- <tab-router
-          v-model.trim="activeIndex"
-          type="card"
-          @tab-click="handleClick"
-        >
-          <el-tab-pane
-            label="声部设置(对内)"
-            lazy
-            name="0"
-            v-if="permissionList.musicalManager"
+      <save-form
+        :inline="true"
+        :model="searchForm"
+        @submit="search"
+        @reset="onReSet"
+      >
+        <el-form-item>
+          <el-input
+            v-model.trim="searchForm.search"
+            clearable
+            @keyup.enter.native="search"
+            placeholder="请输入编号、名称"
+          ></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-select
+            v-model="searchForm.parentSubjectId"
+            placeholder="选择声部分类"
+            prop="parentSubjectId"
           >
-            <musicalManager v-if="activeIndex == 0" />
-          </el-tab-pane>
-           <el-tab-pane
-            label="声部设置(对外)"
-            lazy
-            name="1"
-            v-if="permissionList.musicalManagerOut"
-          >
-            <musicalManagerOut v-if="activeIndex == 1" />
-          </el-tab-pane>
-        </tab-router> -->
-
+            <el-option
+              v-for="item in fatherList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button native-type="submit" type="primary">搜索</el-button>
+          <el-button native-type="reset" type="danger">重置</el-button>
+        </el-form-item>
+      </save-form>
+      <auth auths="subject/upset/insert" style="margin-bottom:20px;">
+        <el-button @click="addCategory" type="primary">添加</el-button>
+      </auth>
+      <div class="tableWrap">
+        <el-table
+          style="width: 100%"
+          :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+          :data="tableList"
+        >
+          <el-table-column
+            align="center"
+            prop="id"
+            label="分类编号"
+          ></el-table-column>
+          <el-table-column
+            align="center"
+            prop="name"
+            label="分类名称"
+          ></el-table-column>
+          <el-table-column align="center" prop="name" label="操作">
+            <template slot-scope="scope">
+              <div>
+                <!-- v-permission="'subject/upset/del' -->
+                <auth auths="subject/upset/insert">
+                  <el-button
+                    type="text"
+                    @click="resetSubjectCategory(scope.row)"
+                    >修改</el-button
+                  >
+                </auth>
+                <auth auths="subject/upset/del">
+                  <el-button
+                    type="text"
+                    @click="removeSubjectCategory(scope.row)"
+                    >删除</el-button
+                  >
+                </auth>
+              </div>
+            </template>
+          </el-table-column>
+          <!-- <el-table-column align="center" prop="name" label="分类图片">
+            <template slot-scope="scope">
+              <el-image
+                v-if="scope.row.img"
+                style="width: 60px; height: 60px"
+                fit="cover"
+                :src="scope.row.img.split(',')[0]"
+                :previewSrcList="scope.row.img.split(',')"
+              >
+              </el-image>
+            </template>
+          </el-table-column> -->
+        </el-table>
+        <pagination
+          :total.sync="rules.total"
+          :page.sync="rules.page"
+          :limit.sync="rules.limit"
+          :page-sizes="rules.page_size"
+          @pagination="getList"
+        />
+      </div>
     </div>
+    <el-dialog
+      title="修改分类"
+      :visible.sync="categoryVisible"
+      width="500px"
+      v-if="categoryVisible"
+    >
+      <el-form :model="form" :inline="true" ref="form">
+        <el-form-item
+          prop="name"
+          label="分类名称"
+          :rules="{
+            required: true,
+            message: '请输入分类名称',
+            trigger: 'change,blur',
+          }"
+        >
+          <el-input v-model="form.name"></el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="categoryVisible = false">取 消</el-button>
+        <el-button type="primary" @click="submitReset">确 定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
+
 <script>
-import musicalManager from "./specialSetup/musicalManager";
-import musicalManagerOut from "./specialSetup/musicalManagerOut";
-import { permission } from "@/utils/directivePage";
+import axios from "axios";
+import { getToken } from "@/utils/auth";
+import pagination from "@/components/Pagination/index";
+import load from "@/utils/loading";
+import { subjectListTree, subjectUpset,subSubjectList } from "@/api/specialSetting";
 export default {
-  components: {
-    musicalManager,
-    musicalManagerOut
-  },
-  name: "globalConfig",
+  components: { pagination },
   data() {
     return {
-      activeIndex: "0",
-      permissionList: {
-        musicalManager: permission("/globalConfig/musicalManager"),
-        musicalManagerOut: permission("/globalConfig/musicalManagerOut")
-      }
+      searchForm: {
+        search: null,
+        parentSubjectId: null,
+      },
+      form: {
+        name: null,
+        id: null,
+      },
+      tableList: [],
+      organList: [],
+      rules: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+      categoryVisible: false,
+      fatherList: [],
     };
   },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {},
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+    // 获取分部
+
+    this.init();
+  },
   methods: {
-    handleClick(val) {
-      this.activeIndex = val.name;
-    }
-  }
+    init() {
+      this.getList();
+      this.getFatherList()
+    },
+    getFatherList() {
+      subjectListTree({
+        delFlag: "NO",
+        rows: 9999,
+        page: 1,
+      }).then((res) => {
+        if (res.code == 200) {
+          this.fatherList = res.data.rows;
+        }
+      });
+    },
+    getList() {
+      subSubjectList(this.searchForm).then(res=>{
+
+      })
+    },
+    search() {
+      this.rules.page = 1;
+      this.getList();
+    },
+    onReSet() {
+      this.$nextTick(()=>{
+        this.search()
+      })
+    },
+    resetSubjectCategory(row) {
+      this.form.name = row.name;
+      this.form.id = row.id;
+      this.categoryVisible = true;
+    },
+    removeSubjectCategory(row) {
+      this.$confirm("是否确认删除分类", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        subjectUpset({
+          delFlag: "YES",
+          id: row.id,
+        }).then((res) => {
+          this.messageTips("删除", res);
+          this.search();
+        });
+      });
+    },
+    messageTips(title, res) {
+      if (res.code == 200) {
+        this.$message.success(title + "成功");
+      } else {
+        this.$message.error(res.msg);
+      }
+    },
+    submitReset() {
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          subjectUpset({
+            parentSubjectId: 0,
+            tenantId: 1,
+            name: this.form.name,
+            id: this.form.id,
+          }).then((res) => {
+            if (res.code == 200) {
+              this.messageTips("修改", res);
+              this.categoryVisible = false;
+              this.getList();
+            }
+          });
+        }
+      });
+    },
+    addCategory() {
+      this.form.id = null;
+      this.form.name = null;
+      this.categoryVisible = true;
+    },
+  },
 };
 </script>
-<style lang="scss" scoped>
-/deep/.m-container {
-  padding: 0 10px 40px;
-}
+<style lang='scss' scoped>
 </style>
+

+ 49 - 31
src/views/categroyManager/subjectCategroyList.vue

@@ -5,6 +5,9 @@
       <div class="squrt"></div>
       声部分类管理
     </h2>
+       <auth auths="subject/upset/insert">
+    <el-button @click="addCategory" type="primary">添加</el-button>
+       </auth>
     <div class="m-core">
       <!-- <save-form
         :inline="true"
@@ -51,12 +54,17 @@
           <el-table-column align="center" prop="name" label="操作">
             <template slot-scope="scope">
               <div>
+                <!-- v-permission="'subject/upset/del' -->
+                <auth auths="subject/upset/insert">
                 <el-button type="text" @click="resetSubjectCategory(scope.row)"
                   >修改</el-button
                 >
+                </auth>
+                   <auth auths="subject/upset/del">
                 <el-button type="text" @click="removeSubjectCategory(scope.row)"
                   >删除</el-button
                 >
+                   </auth>
               </div>
             </template>
           </el-table-column>
@@ -74,7 +82,6 @@
           </el-table-column> -->
         </el-table>
         <pagination
-          sync
           :total.sync="rules.total"
           :page.sync="rules.page"
           :limit.sync="rules.limit"
@@ -86,19 +93,25 @@
     <el-dialog
       title="修改分类"
       :visible.sync="categoryVisible"
-       width="500px"
-       v-if="categoryVisible"
+      width="500px"
+      v-if="categoryVisible"
     >
       <el-form :model="form" :inline="true" ref="form">
-        <el-form-item label="分类名称" :rules="{required: true, message: '请输入分类名称', trigger: 'change,blur'}">
+        <el-form-item
+        prop="name"
+          label="分类名称"
+          :rules="{
+            required: true,
+            message: '请输入分类名称',
+            trigger: 'change,blur',
+          }"
+        >
           <el-input v-model="form.name"></el-input>
         </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button @click="categoryVisible = false">取 消</el-button>
-        <el-button type="primary" @click="submitReset"
-          >确 定</el-button
-        >
+        <el-button type="primary" @click="submitReset">确 定</el-button>
       </span>
     </el-dialog>
   </div>
@@ -109,7 +122,7 @@ import axios from "axios";
 import { getToken } from "@/utils/auth";
 import pagination from "@/components/Pagination/index";
 import load from "@/utils/loading";
-import { subjectListTree } from "@/api/specialSetting";
+import { subjectListTree,subjectUpset } from "@/api/specialSetting";
 export default {
   components: { pagination },
   data() {
@@ -117,9 +130,9 @@ export default {
       searchForm: {
         search: null,
       },
-      form:{
-        name:null,
-        id:null
+      form: {
+        name: null,
+        id: null,
       },
       tableList: [],
       organList: [],
@@ -130,7 +143,7 @@ export default {
         total: 0, // 总条数
         page_size: [10, 20, 40, 50], // 选择限制显示条数
       },
-      categoryVisible:false
+      categoryVisible: false,
     };
   },
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -153,12 +166,6 @@ export default {
         page: this.rules.page,
       }).then((res) => {
         if (res.code == 200) {
-          //   let tempArray = []
-          //   result.rows.forEach(item => {
-          //     item.inputStatus = false
-          //     tempArray.push(item)
-          //   })
-          //   this.subjectList = tempArray
           this.tableList = res.data.rows;
           this.rules.total = res.data.total;
         }
@@ -170,7 +177,7 @@ export default {
     },
     onReSet() {},
     resetSubjectCategory(row) {
-      console.log(row)
+      console.log(row);
       this.form.name = row.name;
       this.form.id = row.id;
       this.categoryVisible = true;
@@ -186,29 +193,40 @@ export default {
           id: row.id,
         }).then((res) => {
           this.messageTips("删除", res);
+          this.search()
         });
       });
     },
     messageTips(title, res) {
       if (res.code == 200) {
         this.$message.success(title + "成功");
-        this.getList();
       } else {
         this.$message.error(res.msg);
       }
     },
-    submitReset(){
-      // this.$refs.form.
-       subjectUpset({
-        parentSubjectId: 0,
-        tenantId: 1,
-        name: this.oneTypeName
-      }).then(res => {
-        this.messageTips('添加', res)
-        if (res.code == 200) {
-          this.oneTypeName = null
+    submitReset() {
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          subjectUpset({
+            parentSubjectId: 0,
+            tenantId: 1,
+            name: this.form.name,
+            id:this.form.id
+          }).then((res) => {
+
+            if (res.code == 200) {
+                this.messageTips("修改", res);
+             this.categoryVisible = false;
+             this.getList()
+            }
+          });
         }
-      })
+      });
+    },
+    addCategory(){
+      this.form.id = null;
+      this.form.name = null;
+      this.categoryVisible = true;
     }
   },
 };

+ 45 - 21
src/views/resetTeaming/components/payInfoDetail.vue

@@ -21,6 +21,7 @@
               :rules="[
                 { required: true, message: '请选择缴费时间', trigger: 'blur' },
               ]"
+              ref="paymentDate"
             >
               <template slot="label">
                 <p style="position: relative">
@@ -58,6 +59,7 @@
                 :rules="[
                   { required: true, message: '请输入备注', trigger: 'blur' },
                 ]"
+                 ref="memo"
               >
                 <template slot="label">
                   <p style="position: relative">
@@ -316,7 +318,7 @@ export default {
         maxYearFee: null,
       },
       dialogSubjectVisible: false, // 预览
-      preViewData: {}
+      preViewData: {},
     };
   },
   mounted() {
@@ -355,14 +357,14 @@ export default {
         this.teamActive = false;
         this.leBaoDisabled = true;
         this.teamActiveDisabled = true;
-      }else{
+      } else {
       }
       await this.getCharges(); // 续费的选择缴费类型
       await this.formatCourse(); // 临时加课的类型选择以及价格
       await this.getMemberList(); // 获取会员(团练保信息)
       await this.getLeBao(); // 获取乐保
       await this.getActive(); // 获取活动
-      await this.getMemberRules()
+      await this.getMemberRules();
       if (this.$route.query.calenderId) {
         // 说明是修改  查缴项目详情
         getMusicGroupPaymentCalenderDetail({
@@ -391,7 +393,6 @@ export default {
               // 团练保
               this.member = true;
               this.$set(this.form, "memberList", [{ ...res.data.member }]);
-
             }
             if (res.data.repair) {
               this.leBao = true;
@@ -450,7 +451,6 @@ export default {
             if (itemValue) {
               this.rulesForm = itemValue;
             }
-
           }
         });
       } catch (e) {
@@ -610,7 +610,7 @@ export default {
       // this.form.eclass = this.form.eclass.filter((item) => !!item);
     },
     submitForm() {
-      this.$refs.form.validate(async (isok) => {
+      this.$refs.form.validate(async (isok,obj) => {
         if (isok) {
           // const preViewData = this.formatPreviewData()
           // this.preViewData = preViewData
@@ -634,19 +634,44 @@ export default {
               console.log(e);
             }
           }
+        } else {
+          this.$nextTick(() => {
+            this.scrollView(obj);
+          });
         }
       });
     },
+    scrollView(object) {
+
+      for (const i in object) {
+        let dom = this.$refs[i];
+        // 这里是针对遍历的情况(多个输入框),取值为数组
+        if (Object.prototype.toString.call(dom) !== "[object Object]") {
+
+          dom = dom[0];
+        }
+
+        // 第一种方法(包含动画效果)
+        dom.$el.scrollIntoView({
+          // 滚动到指定节点
+          // 值有start,center,end,nearest,当前显示在视图区域中间
+          block: "center",
+          // 值有auto、instant,smooth,缓动动画(当前是慢速的)
+          behavior: "smooth",
+        });
+        break; // 跳出循环了
+      }
+    },
 
     formatPreviewData() {
       // 格式化预览数据
-      const form = this.form
+      const form = this.form;
       // 重置小班课数据
-      let activeList = form.activeList?.length > 0 ? form.activeList : []
-      if(activeList.length > 0) {
-        activeList.forEach(active => {
-          active.categoryName = active.vipGroupCategoryNames
-        })
+      let activeList = form.activeList?.length > 0 ? form.activeList : [];
+      if (activeList.length > 0) {
+        activeList.forEach((active) => {
+          active.categoryName = active.vipGroupCategoryNames;
+        });
       }
       return {
         musicGroup: this.musicGroup,
@@ -655,7 +680,7 @@ export default {
         member: form.memberList?.length > 0 ? { ...form.memberList[0] } : null, // 团练宝
         memberPrivilegesItemList: [], // 会员基本内容
         repair: form.leBaoList?.length > 0 ? { ...form.leBaoList[0] } : null, // 乐保
-      }
+      };
     },
     fommatDate() {
       return {
@@ -684,18 +709,18 @@ export default {
   watch: {
     teamCourse(val) {
       if (!val) {
-        this.$set(this.form, "eclass",  [{}]);
+        this.$set(this.form, "eclass", [{}]);
         this.$set(this.form, "leixing", "2");
       }
     },
     member(val) {
       if (!val) {
-        this.$set(this.form, "memberList",  [{}]);
+        this.$set(this.form, "memberList", [{}]);
       }
     },
     teamActive(val) {
       if (!val) {
-        this.$set(this.form, "activeList",  [{}]);
+        this.$set(this.form, "activeList", [{}]);
       }
     },
     leBao(val) {
@@ -706,17 +731,16 @@ export default {
     async "form.musicGroupOrganizationCourseSettingId"(val) {
       // && !this.rowDetail !this.$route.query.calenderId
 
-      if (val && !this.isSetCourseSettingsId  ) {
+      if (val && !this.isSetCourseSettingsId) {
         try {
           const res = await queryByMusicGroupOrganizationCourseSettingsId({
             id: val,
           });
-          let CourseSettingDetail = res.data.map(course=>{
+          let CourseSettingDetail = res.data.map((course) => {
             return {
               ...course,
-
-            }
-          })
+            };
+          });
           this.$set(this.form, "eclass", res.data);
           // this.syncAllMoney();
         } catch (error) {}

+ 1 - 1
src/views/resetTeaming/modals/payLeBao.vue

@@ -8,7 +8,7 @@
     >
       <el-table-column
       width="170px"
-        label="会员类型"
+        label="乐保保养"
 
       >
         <template slot-scope="scope">

+ 58 - 30
src/views/resetTeaming/modals/payMember.vue

@@ -25,7 +25,6 @@
               style="width: 90% !important"
               v-model="form.memberList[scope.$index].memberRankSettingId"
               placeholder="会员类型"
-              @change="changeMember"
             >
               <el-option
                 :value="item.id"
@@ -172,7 +171,10 @@
               :precision="0"
               :min="0"
               @change="change"
-              :disabled="!form.memberList[scope.$index].period || !form.memberList[scope.$index].num"
+              :disabled="
+                !form.memberList[scope.$index].period ||
+                !form.memberList[scope.$index].num
+              "
               placeholder="请输入售价"
             />
           </el-form-item>
@@ -242,16 +244,13 @@ export default {
       boolOptionsOptions: objectToOptions(boolOptions),
       memberEnumList,
       memberPrice: {},
+      getMemberFeeFlag: true,
     };
   },
-  mounted(){
-    if(this.form?.memberList[0]?.memberRankSettingId){
-      this.changeMember(this.form.memberList[0]?.memberRankSettingId)
-    }
-  },
+  mounted() {},
   methods: {
     changeMemberperiodEnum(val) {
-      console.log(this.memberPrice)
+      console.log(this.memberPrice);
       if (val == "DAY") {
         this.$set(
           this.form.memberList[0],
@@ -318,46 +317,64 @@ export default {
     change() {},
     async changeMember(val) {
       if (val) {
-        try {
-          const res = await getMemberFee({
-            rankId: val,
-            organId: this.organId,
-          });
-          this.memberPrice = res.data;
-          if (!res.data) {
-            this.$bus.$emit("showguide", ["memberList"]);
-            return;
+        if (this.getMemberFeeFlag) {
+          this.getMemberFeeFlag = false;
+          try {
+            const res = await getMemberFee({
+              rankId: val,
+              organId: this.organId,
+            });
+            this.memberPrice = res.data;
+            this.getMemberFeeFlag = true;
+            if (!res.data) {
+              this.$bus.$emit("showguide", ["memberList"]);
+              return;
+            }
+          } catch (e) {
+            console.log(e);
+            this.getMemberFeeFlag = true;
           }
-        } catch (e) {
-          console.log(e);
         }
       }
     },
     validateMember(rule, value, callback) {
       const one = Number(value);
-      let min=0;
-      let max =0
+      let min = 0;
+      let max = 0;
 
       switch (this.form.memberList[0]?.period) {
         case "MONTH": {
-           min = Number(this.rulesForm.minMonthFee)*this.form.memberList[0].num;
-           max = Number(this.rulesForm.maxMonthFee)*this.form.memberList[0].num;
+          min =
+            Number(this.rulesForm.minMonthFee) * this.form.memberList[0].num;
+          max =
+            Number(this.rulesForm.maxMonthFee) * this.form.memberList[0].num;
           break;
         }
         case "QUARTERLY": {
-            min = Number(this.rulesForm.minQuarterlyFee)*this.form.memberList[0].num;
-           max = Number(this.rulesForm.maxQuarterlyFee)*this.form.memberList[0].num;
-           console.log(this.form.memberList[0]?.period,min,max,this.rulesForm)
+          min =
+            Number(this.rulesForm.minQuarterlyFee) *
+            this.form.memberList[0].num;
+          max =
+            Number(this.rulesForm.maxQuarterlyFee) *
+            this.form.memberList[0].num;
+          console.log(
+            this.form.memberList[0]?.period,
+            min,
+            max,
+            this.rulesForm
+          );
           break;
         }
         case "YEAR_HALF": {
-            min = Number(this.rulesForm.minHalfYearFee)*this.form.memberList[0].num;
-           max = Number(this.rulesForm.maxHalfYearFee)*this.form.memberList[0].num;
+          min =
+            Number(this.rulesForm.minHalfYearFee) * this.form.memberList[0].num;
+          max =
+            Number(this.rulesForm.maxHalfYearFee) * this.form.memberList[0].num;
           break;
         }
         case "YEAR": {
-            min = Number(this.rulesForm.minYearFee)*this.form.memberList[0].num;
-           max = Number(this.rulesForm.maxYearFee)*this.form.memberList[0].num;
+          min = Number(this.rulesForm.minYearFee) * this.form.memberList[0].num;
+          max = Number(this.rulesForm.maxYearFee) * this.form.memberList[0].num;
           break;
         }
       }
@@ -368,6 +385,17 @@ export default {
       return callback(new Error(`定价应在${min}-${max}之间`));
     },
   },
+  watch: {
+    form: {
+      deep: true,
+      handler(val) {
+        console.log(this.memberPrice);
+        if (val.memberList[0].memberRankSettingId && !this.memberPrice.id) {
+          this.changeMember(val.memberList[0].memberRankSettingId);
+        }
+      },
+    },
+  },
 };
 </script>
 <style lang="scss" scoped>

+ 1 - 0
src/views/resetTeaming/modals/payTeamCourse.vue

@@ -148,6 +148,7 @@
               message: '请输入现价',
               trigger: 'blur',
             }"
+
           >
             <!-- $listeners.moneyChange -->
             <el-input-number