소스 검색

修改查询逻辑

lex 2 년 전
부모
커밋
406aa56dc4

+ 6 - 6
src/views/baseRulesClassSetting/practiceRules.vue

@@ -1,13 +1,13 @@
 <template>
   <div>
     <!-- <h2>折扣设置</h2> -->
-    <div v-if="(tableList.length > 0 || pageInfo.page > 1) && contextFlag">
+    <div v-if="contextFlag">
       <save-form
         :inline="true"
         @submit="search"
         @reset="onReSet"
         ref="searchForm"
-        :saveKey="'practiceRules'"
+        :saveKey="'/baseRulesClassSetting/practiceRules'"
         :model="searchForm"
       >
         <el-form-item prop="organId">
@@ -83,7 +83,7 @@
           </el-table-column>
         </el-table>
         <pagination
-          :saveKey="'musicCourseFee'"
+          :saveKey="'/baseRulesClassSetting/practiceRules'"
           sync
           :total.sync="pageInfo.total"
           :page.sync="pageInfo.page"
@@ -98,7 +98,7 @@
       title="网管课收费设置"
       btnTitle="新建网管课收费设置"
       :context="context"
-      v-if="!(tableList.length > 0 || pageInfo.page > 1) && contextFlag"
+      v-if="!contextFlag"
     />
     <el-dialog
       :title="activeRow ? '修改' : '新建'"
@@ -220,7 +220,7 @@ export default {
       activeRow: null,
       context:
         "可根据不同分部设置不同的网管课课时和加油包课时总价,设置完成后,所选分部学员可在学生端APP以此价格自行购买网管课课程。加油包是由8节网管组成的课程组,用于为乐团训练中跟不上进度的学员单独辅导,每个学员仅有一次购买加油包的机会,且只可在后台为学员创建,设置单价时建议酌情优惠。",
-      contextFlag: false
+      contextFlag: true
     };
   },
   mounted() {
@@ -258,10 +258,10 @@ export default {
         page: this.pageInfo.page,
         organId: this.searchForm.organId
       }).then(res => {
-        this.contextFlag = true;
         let result = res.data;
         this.tableList = result.rows;
         this.pageInfo.total = result.total;
+        this.contextFlag = this.tableList.length > 0 ? true : false;
         // }
       });
     },

+ 8 - 8
src/views/categroyManager/specialSetup/chargesList.vue

@@ -2,12 +2,12 @@
   <div>
     <!-- 收费标准不改 -->
     <!-- <h2>收费类型设置</h2> -->
-    <div v-if="(dataList.length > 0 || pageInfo.page > 1) && contextFlag">
+    <div v-if="contextFlag">
       <save-form
         :inline="true"
         @submit="search"
         @reset="onReSet"
-        :saveKey="'chargesList'"
+        save-key="/baseRulesClassSetting/chargesList"
         :model="searchForm"
       >
         <el-form-item>
@@ -112,10 +112,10 @@
           </el-table-column>
         </el-table>
         <pagination
-          :saveKey="'chargesList'"
           sync
           :total.sync="pageInfo.total"
           :page.sync="pageInfo.page"
+          :saveKey="'/baseRulesClassSetting/chargesList'"
           :limit.sync="pageInfo.limit"
           :page-sizes="pageInfo.page_size"
           @pagination="getList"
@@ -127,7 +127,7 @@
       title="乐团收费标准"
       btnTitle="新建乐团收费标准"
       :context="context"
-      v-if="!(dataList.length > 0 || pageInfo.page > 1) && contextFlag"
+      v-if="!contextFlag"
     />
     <el-dialog
       :title="formTitle[formActionTitle]"
@@ -198,13 +198,11 @@ export default {
       },
       context:
         "此处用于设置乐团训练的标准课程组合包,可根据不同分部不同的乐团模式创建不同的课程组合包及组合包的标准价格,创建完成后,在设置乐团报名、续费时可直接选择收费标准快速创建乐团课程缴费。",
-      contextFlag: false,
+      contextFlag: true,
       courseViewTypeList
     };
   },
   async mounted() {
-    this.getList();
-
     // 收费类型
     // getType({
     //   rows: 9999,
@@ -244,6 +242,8 @@ export default {
         this.branchById = branchById;
       }
     });
+
+    this.getList();
   },
   methods: {
     numeral,
@@ -297,9 +297,9 @@ export default {
         ...this.searchForm
       }).then(res => {
         if (res.code == 200) {
-          this.contextFlag = true;
           this.dataList = res.data.rows;
           this.pageInfo.total = res.data.total;
+          this.contextFlag = this.dataList.length > 0 ? true : false;
         }
       });
     },

+ 26 - 20
src/views/categroyManager/specialSetup/courseTimerSetting.vue

@@ -1,14 +1,14 @@
 <template>
   <div>
-    <div  v-if="(tableList.length>0 || pageInfo.page>1)&&contextFlag">
+    <div v-if="contextFlag">
       <save-form
         :inline="true"
         class="searchForm"
         ref="searchForm"
         @submit="search"
         @reset="reset"
-        :saveKey="'courseTimerSetting'"
-        :model.sync="searchForm"
+        :saveKey="'/baseRulesClassSetting/courseTimerSetting'"
+        :model="searchForm"
       >
         <el-form-item :rules="[]">
           <el-select
@@ -96,17 +96,23 @@
           </el-table-column>
         </el-table>
         <pagination
-          :saveKey="'courseTimerSetting'"
           sync
           :total.sync="pageInfo.total"
           :page.sync="pageInfo.page"
+          :saveKey="'/baseRulesClassSetting/courseTimerSetting'"
           :limit.sync="pageInfo.limit"
           :page-sizes="pageInfo.page_size"
           @pagination="getList"
         />
       </div>
     </div>
-      <emptyPage @submit="openJob('create')" title='乐团课时长设置' btnTitle='新建乐团课时长设置' :context='context'  v-if="!(tableList.length>0 || pageInfo.page>1)&&contextFlag" />
+    <emptyPage
+      @submit="openJob('create')"
+      title="乐团课时长设置"
+      btnTitle="新建乐团课时长设置"
+      :context="context"
+      v-if="!contextFlag"
+    />
 
     <el-dialog
       :title="isAdd ? '新增课时时长' : '修改课时时长'"
@@ -134,16 +140,16 @@ import pagination from "@/components/Pagination/index";
 import { musicCourseType } from "@/utils/searchArray";
 import {
   getOrganizationCourseDurationSettings,
-  delOrganizationCourseDurationSettings,
+  delOrganizationCourseDurationSettings
 } from "@/api/specialSetting";
 import courseTimeForm from "./modals/courseTimeForm";
-import emptyPage from '@/components/emptyPage'
+import emptyPage from "@/components/emptyPage";
 const initSearch = {
   courseScheduleType: null,
-  organId: null,
+  organId: null
 };
 export default {
-  components: { pagination, courseTimeForm,emptyPage },
+  components: { pagination, courseTimeForm, emptyPage },
   data() {
     return {
       tableList: [],
@@ -152,15 +158,16 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
-        page_size: [10, 20, 40, 50], // 选择限制显示条数
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
       },
       searchForm: { ...initSearch },
       courseType: musicCourseType,
       isAdd: true,
       courseVisible: false,
       activeRow: null,
-      context:'创建分部后,可根据各分部的实际情况在本界面添加各类型乐团课程的单课时时长,添加完成后,各分部乐团在排课时可选择此处设置的单课时时长进行排课,同一种课程类型可设置多种单课时时长,帮助进行乐团课时时长的规范管理。',
-      contextFlag:false
+      context:
+        "创建分部后,可根据各分部的实际情况在本界面添加各类型乐团课程的单课时时长,添加完成后,各分部乐团在排课时可选择此处设置的单课时时长进行排课,同一种课程类型可设置多种单课时时长,帮助进行乐团课时时长的规范管理。",
+      contextFlag: true
     };
   },
   mounted() {
@@ -173,11 +180,11 @@ export default {
         const res = await getOrganizationCourseDurationSettings({
           ...this.searchForm,
           page: this.pageInfo.page,
-          rows: this.pageInfo.limit,
+          rows: this.pageInfo.limit
         });
-        this.contextFlag = true
         this.pageInfo.total = res.data.total;
         this.tableList = res.data.rows;
+        this.contextFlag = this.tableList.length > 0 ? true : false;
       } catch (e) {}
     },
     search() {
@@ -212,19 +219,18 @@ export default {
       this.$confirm("是否删除?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
+        type: "warning"
       }).then(async () => {
         try {
           const res = await delOrganizationCourseDurationSettings({
-            id: row.id,
+            id: row.id
           });
           this.$message.success("删除成功");
           this.getList();
         } catch {}
       });
-    },
-  },
+    }
+  }
 };
 </script>
-<style lang="scss" scoped>
-</style>
+<style lang="scss" scoped></style>

+ 2 - 2
src/views/categroyManager/specialSetup/discountManage.vue

@@ -6,7 +6,7 @@
         :inline="true"
         @submit="search"
         @reset="onReSet"
-        :saveKey="'discountManage'"
+        :saveKey="'/baseRulesClassSetting/discountManage'"
         :model="searchForm"
       >
         <el-form-item>
@@ -107,7 +107,7 @@
         </el-table>
         <pagination
           sync
-          :saveKey="'discountManage'"
+          :saveKey="'/baseRulesClassSetting/discountManage'"
           :total.sync="pageInfo.total"
           :page.sync="pageInfo.page"
           :limit.sync="pageInfo.limit"

+ 1 - 1
src/views/categroyManager/specialSetup/modals/chargesForm.vue

@@ -288,7 +288,7 @@ export default {
       }
       this.loading = true;
       try {
-        if (this.form.organId && this.form.courseViewType) {
+        if (this.form.organId && this.form.courseViewType != null) {
           this.$set(this.form, "details", [{}]);
           const res = await getOrganizationCourseUnitPriceSettings({
             courseViewType: this.form.courseViewType,

+ 6 - 6
src/views/categroyManager/specialSetup/musicCourseFee.vue

@@ -1,13 +1,13 @@
 <template>
   <div>
     <!-- <h2>折扣设置</h2> -->
-    <div v-if="(tableList.length > 0 || pageInfo.page > 1) && contextFlag">
+    <div v-if="contextFlag">
       <save-form
         :inline="true"
         @submit="search"
         @reset="onReSet"
         ref="searchForm"
-        :saveKey="'musicCourseFee'"
+        :saveKey="'/baseRulesClassSetting/musicCourseFee'"
         :model="searchForm"
       >
         <el-form-item prop="organId">
@@ -98,7 +98,7 @@
           </el-table-column>
         </el-table>
         <pagination
-          :saveKey="'musicCourseFee'"
+          :saveKey="'/baseRulesClassSetting/musicCourseFee'"
           sync
           :total.sync="pageInfo.total"
           :page.sync="pageInfo.page"
@@ -113,7 +113,7 @@
       title="乐团课价格设置"
       btnTitle="新建乐团课价格设置"
       :context="context"
-      v-if="!(tableList.length > 0 || pageInfo.page > 1) && contextFlag"
+      v-if="!contextFlag"
     />
     <el-dialog
       title="新建"
@@ -343,7 +343,7 @@ export default {
       actvieRow: null,
       context:
         "系统支持不同分部在不同的乐团模式中设置各课程类型的不同价格标准,该标准为具体课程类型每分钟的收费价格,在创建乐团课程组合包或乐团临时加课时,根据组合包中的课程时长或临时加课的课程时长计算应该向学员收费的标准费用。不以此标准价格创建学员缴费,则需要审核才可生效。",
-      contextFlag: false
+      contextFlag: true
     };
   },
   mounted() {
@@ -393,10 +393,10 @@ export default {
         organId: this.searchForm.organId,
         courseScheduleType: this.searchForm.courseScheduleType
       }).then(res => {
-        this.contextFlag = true;
         let result = res.data;
         this.tableList = result.rows;
         this.pageInfo.total = result.total;
+        this.contextFlag = this.tableList.length > 0 ? true : false;
         // }
       });
     },

+ 28 - 20
src/views/categroyManager/vipChargeSeting.vue

@@ -10,6 +10,7 @@
         class="searchForm"
         @submit="search"
         :model.sync="searchForm"
+        save-key="/baseRulesClassSetting/vipChargeSetting"
       >
         <el-form-item prop="organId">
           <el-select
@@ -42,10 +43,12 @@
             <template slot-scope="scope">
               <div>
                 <el-input
-                :disabled='scope.row.onlineDis'
+                  :disabled="scope.row.onlineDis"
                   v-model.trim="scope.row.onlineClassesUnitPrice"
                 >
-                  <template slot="append">元/节</template>
+                  <template slot="append"
+                    >元/节</template
+                  >
                 </el-input>
               </div>
             </template>
@@ -53,9 +56,11 @@
           <el-table-column prop="offlineClassesUnitPrice" label="线下课单价">
             <template slot-scope="scope">
               <div>
-                <el-input
-                  v-model.trim="scope.row.offlineClassesUnitPrice"
-                > <template slot="append">元/节</template></el-input>
+                <el-input v-model.trim="scope.row.offlineClassesUnitPrice">
+                  <template slot="append"
+                    >元/节</template
+                  ></el-input
+                >
               </div>
             </template>
           </el-table-column>
@@ -79,7 +84,11 @@
   </div>
 </template>
 <script>
-import { vipGroupCategory, defaultClassesUnitPrice ,getOnlineMun} from "@/api/vipSeting";
+import {
+  vipGroupCategory,
+  defaultClassesUnitPrice,
+  getOnlineMun
+} from "@/api/vipSeting";
 import { getEmployeeOrgan } from "@/api/buildTeam";
 import { Searchs } from "@/helpers";
 export default {
@@ -89,9 +98,9 @@ export default {
       dataList: [],
       organList: [],
       searchForm: {
-        organId: null,
+        organId: null
       },
-      studentRuleNum:0
+      studentRuleNum: 0
     };
   },
   async mounted() {
@@ -115,17 +124,17 @@ export default {
   },
   methods: {
     search() {
-      this.$refs.searchForm.validate((valid) => {
+      this.$refs.searchForm.validate(valid => {
         this.getList();
       });
     },
     getList() {
-      vipGroupCategory({ organId: this.searchForm.organId }).then((res) => {
+      vipGroupCategory({ organId: this.searchForm.organId }).then(res => {
         if (res.code == 200) {
-          this.dataList =res.data
-           this.dataList.forEach(item=>{
-            if(item.studentNum > this.studentRuleNum) {
-               item.onlineDis = true
+          this.dataList = res.data;
+          this.dataList.forEach(item => {
+            if (item.studentNum > this.studentRuleNum) {
+              item.onlineDis = true;
             }
           });
         }
@@ -136,8 +145,8 @@ export default {
         offlineClassesUnitPrice: row.offlineClassesUnitPrice,
         onlineClassesUnitPrice: row.onlineClassesUnitPrice,
         organId: this.searchForm.organId,
-        vipGroupCategoryId: row.id,
-      }).then((res) => {
+        vipGroupCategoryId: row.id
+      }).then(res => {
         if (res.code == 200) {
           // 保存成功提示=> 刷新列表
           this.$message.success("保存成功");
@@ -146,9 +155,8 @@ export default {
           this.$message.error("保存失败,请重试");
         }
       });
-    },
-  },
+    }
+  }
 };
 </script>
-<style lang="scss">
-</style>
+<style lang="scss"></style>

+ 1 - 0
src/views/resetTeaming/components/strudentPayInfo.vue

@@ -1108,6 +1108,7 @@ export default {
 }
 .demo-table-expand {
   font-size: 0;
+  padding-left: 70px;
 }
 .demo-table-expand label {
   width: 90px;