ソースを参照

提交代码

1
mo 3 年 前
コミット
205f07da07

+ 2 - 14
src/store/modules/selects.js

@@ -13,7 +13,7 @@ import {
 } from '@/api/systemManage'
 import {
   vipGroupCategory,
-  getOnlineMun
+
 } from "@/api/vipSeting"
 import {
   findTechnician
@@ -156,19 +156,7 @@ export default {
         loadings.commit_vip_group_category = vipGroupCategory()
         try {
           const res = await loadings.commit_vip_group_category
-
-          const res1 = await getOnlineMun();
-
-          let tempObj = JSON.parse(res1.data.config);
-          let studentRuleNum = tempObj.cloud_room_rule.cloud_room_up_limit - 1;
-          let arr = []
-          res.data.map(item=>{
-            if(item.studentNum <= studentRuleNum) {
-              arr.push(item)
-            }
-          });
-
-          commit('commit_vip_group_category', arr)
+          commit('commit_vip_group_category', res.data)
         } catch (error) {console.log(error)}
         loadings.commit_vip_group_category = false
       }

+ 43 - 0
src/views/baseRulesClassSetting/api.js

@@ -0,0 +1,43 @@
+import request from '@/utils/request'
+import request2 from '@/utils/request2'
+import qs from 'qs'
+let api = '/api-web'
+// 查询网管课价格
+export function getPracticePriceList(data) {
+  return request2({
+    url: api + '/practiceGroupSellPrice/list',
+    method: 'get',
+    params: data
+  })
+}
+
+// 修改网管课价格
+
+export function resetPracticePriceList(data) {
+  return request2({
+    url: api + '/practiceGroupSellPrice/update',
+    method: 'post',
+    data: data,
+    requestType:'form'
+  })
+}
+
+// 新增网管课价格
+export function addPracticePriceList(data) {
+  return request2({
+    url: api + '/practiceGroupSellPrice/add',
+    method: 'post',
+    data: data,
+    requestType:'form'
+  })
+}
+
+// 删除网管课价格
+
+export function delPracticePriceList(data) {
+  return request2({
+    url: api + '/practiceGroupSellPrice/del',
+    method: 'post',
+    data: data,
+  })
+}

+ 9 - 6
src/views/baseRulesClassSetting/index.vue

@@ -64,14 +64,14 @@
         >
           <vipChargeSeting v-if="activeIndex == '8'" />
         </el-tab-pane>
-        <!-- <el-tab-pane
-          label="网管课设置"
+        <el-tab-pane
+          label="网管课收费设置"
           lazy
           name="5"
-          v-if="permissionList.vipCourseType"
+          v-if="permissionList.practiceRules"
         >
-          <audition-setting v-if="activeIndex == '5'" />
-        </el-tab-pane> -->
+          <practiceRules v-if="activeIndex == '5'" />
+        </el-tab-pane>
       </tab-router>
     </div>
   </div>
@@ -85,6 +85,7 @@ import vipCourseType from "@/views/categroyManager/generalSettings/vipCourseType
 import discountManage from "@/views/categroyManager/specialSetup/discountManage";
 import vipChargeSeting from "@/views/categroyManager/vipChargeSeting";
 import auditionSetting from "./audition";
+import practiceRules from './practiceRules'
 import { permission } from "@/utils/directivePage";
 export default {
   components: {
@@ -95,7 +96,8 @@ export default {
     auditionSetting,
     typesManager,
     discountManage,
-    vipChargeSeting
+    vipChargeSeting,
+    practiceRules
   },
   name: "baseRulersManager",
   data() {
@@ -109,6 +111,7 @@ export default {
         typesManager: permission("/globalConfig/typesManager"),
         discountManage:permission("/specialSetup/discountManage"),
         vipChargeSeting:permission("/vipChargeSeting"),
+         practiceRules:permission("/practiceRules"),
       },
     };
   },

+ 309 - 0
src/views/baseRulesClassSetting/practiceRules.vue

@@ -0,0 +1,309 @@
+<template>
+  <div class="m-container">
+    <!-- <h2>折扣设置</h2> -->
+    <div>
+      <save-form
+        :inline="true"
+        @submit="search"
+        @reset="onReSet"
+        ref="searchForm"
+        :saveKey="'practiceRules'"
+        :model="searchForm"
+      >
+        <el-form-item prop="organId">
+          <el-select
+            placeholder="请选择分部"
+            v-model="searchForm.organId"
+            filterable
+            clearable
+          >
+            <el-option
+              v-for="(item, index) in selects.branchs"
+              :label="item.name"
+              :value="item.id"
+              :key="index"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="danger" native-type="submit">搜索</el-button>
+          <el-button native-type="reset" type="primary">重置</el-button>
+        </el-form-item>
+      </save-form>
+      <el-button
+        style="margin-bottom: 20px"
+        type="primary"
+        v-permission="'practiceGroupSellPrice/add'"
+        @click="addPrice"
+        icon="el-icon-plus"
+        >添加</el-button
+      >
+
+      <!-- 列表 -->
+      <div class="tableWrap">
+        <el-table
+          :data="tableList"
+          :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+        >
+          <el-table-column align="center" prop="organName" label="分部名称">
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="singleClassMinutesPrice"
+            label="网管课课时单价"
+          >
+            <template slot-scope="scope"
+              >{{ scope.row.singleClassMinutesPrice }}元</template
+            >
+          </el-table-column>
+          <el-table-column
+            align="center"
+            prop="comeOnPackagePrice"
+            label="加油包课时单价"
+          >
+            <template slot-scope="scope"
+              >{{ scope.row.comeOnPackagePrice }}元</template
+            >
+          </el-table-column>
+          <el-table-column align="center" label="操作">
+            <template slot-scope="scope">
+              <el-button
+                @click="openTypes(scope.row)"
+                v-permission="'practiceGroupSellPrice/update'"
+                type="text"
+                >修改</el-button
+              >
+              <el-button
+                @click="onTypesDel(scope.row)"
+                v-permission="'practiceGroupSellPrice/del'"
+                type="text"
+                >删除</el-button
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination
+          :saveKey="'musicCourseFee'"
+          sync
+          :total.sync="pageInfo.total"
+          :page.sync="pageInfo.page"
+          :limit.sync="pageInfo.limit"
+          :page-sizes="pageInfo.page_size"
+          @pagination="getList"
+        />
+      </div>
+    </div>
+    <el-dialog
+      :title="activeRow ? '修改' : '新建'"
+      destroy-on-close
+      :visible.sync="newVisiable"
+      width="600px"
+    >
+      <el-form :model="createForm" class="createForm" ref="ruleForm">
+        <el-form-item
+          label="所属分部"
+          :rules="[{ required: true, message: '所属分部', trigger: 'blur' }]"
+          prop="organId"
+          :label-width="formLabelWidth"
+        >
+          <el-select
+            placeholder="请选择分部"
+            v-model="createForm.organId"
+            filterable
+            clearable
+          >
+            <el-option
+              v-for="(item, index) in selects.branchs"
+              :label="item.name"
+              :value="item.id"
+              :key="index"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item
+          label="网管课课时单价"
+          :label-width="formLabelWidth"
+          :rules="[
+            {
+              required: true,
+              message: '请输入每分钟课程费用',
+              trigger: 'blur',
+            },
+          ]"
+          :prop="`singleClassMinutesPrice`"
+        >
+          <el-input
+            type="number"
+            min="0"
+            step="0.00000001"
+            v-model="createForm.singleClassMinutesPrice"
+          >
+            <template slot="append">每分钟费用(元)</template>
+          </el-input>
+        </el-form-item>
+        <el-form-item
+          label="加油包课时单价"
+          :label-width="formLabelWidth"
+          :rules="[
+            {
+              required: true,
+              message: '请输入每分钟课程费用',
+              trigger: 'blur',
+            },
+          ]"
+          prop="comeOnPackagePrice"
+        >
+          <el-input
+            type="number"
+            min="0"
+            step="0.00000001"
+            v-model="createForm.comeOnPackagePrice"
+          >
+            <template slot="append">每分钟费用(元)</template>
+          </el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="newVisiable = false">取 消</el-button>
+        <el-button type="primary" @click="submitInfo">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import pagination from "@/components/Pagination/index";
+import { getPracticePriceList, resetPracticePriceList,addPracticePriceList,delPracticePriceList } from "./api";
+
+export default {
+  name: "practiceRules",
+  components: { pagination },
+  data() {
+    return {
+      newVisiable: false,
+      resetVisible: false,
+      tableList: [],
+      dataList: [],
+      organList: [],
+      searchForm: {
+        organId: null,
+        courseScheduleType: null,
+      },
+      createForm: {
+        organId: null,
+        comeOnPackagePrice: null,
+        singleClassMinutesPrice: null,
+      },
+      pageInfo: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+      formLabelWidth: "120px",
+      activeRow: null,
+    };
+  },
+  mounted() {
+    // 获取分部
+    this.$store.dispatch("setBranchs");
+    this.getList();
+  },
+  methods: {
+    search() {
+      this.pageInfo.page = 1;
+      this.getList();
+    },
+    onReSet() {
+      this.$refs.searchForm.resetFields();
+      this.search();
+    },
+
+    async onTypesDel(row) {
+      try {
+        await this.$confirm("是否删除此条数据?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning",
+        });
+        delPracticePriceList({ organId: row.organId }).then((res) => {
+          this.messageTips("删除", res);
+        });
+      } catch (error) {}
+    },
+
+    getList() {
+      getPracticePriceList({
+        rows: this.pageInfo.limit,
+        page: this.pageInfo.page,
+        organId: this.searchForm.organId,
+      }).then((res) => {
+        let result = res.data;
+        this.tableList = result.rows;
+        this.pageInfo.total = result.total;
+        // }
+      });
+    },
+    submitInfo() {
+
+      this.$refs.ruleForm.validate(async (valid) => {
+        if (valid) {
+          console.log(this.createForm)
+          if (this.activeRow) {
+            try {
+              await resetPracticePriceList(this.createForm);
+              this.$message.success("修改成功");
+              this.getList();
+              this.newVisiable = false;
+            } catch (error) {}
+          } else {
+            try {
+              await addPracticePriceList(this.createForm);
+              this.$message.success("创建成功");
+              this.getList();
+              this.newVisiable = false;
+            } catch (error) {console.log(error)}
+          }
+        }
+      });
+    },
+    openTypes(row) {
+      this.activeRow = row;
+      this.createForm = {
+        ...row,
+      };
+      this.newVisiable = true;
+    },
+    addPrice() {
+      this.activeRow = null;
+      this.$set(this, "createForm", {
+        organId: null,
+        comeOnPackagePrice: null,
+        singleClassMinutesPrice: null,
+      });
+      this.newVisiable = true;
+    },
+    // resetSubmit() {
+    //   // resetOrganizationCourseUnitPrice
+    //   this.$refs.resetForm.validate(async (valid) => {
+    //     if (valid) {
+
+    //     }
+    //   });
+    // },
+  },
+};
+</script>
+<style lang="scss" scoped>
+/deep/.el-date-editor.el-input {
+  width: 100% !important;
+}
+.el-select {
+  width: 100% !important;
+}
+.createForm {
+  /deep/.el-input {
+    width: 340px !important;
+  }
+}
+</style>

+ 0 - 3
src/views/categroyManager/modals/baseInfo.vue

@@ -268,15 +268,12 @@
 <script>
 import { vipGroupCategory, addVipActive } from "@/api/vipSeting";
 import { getEmployeeOrgan } from "@/api/buildTeam";
-import { vipResetTypeList } from "@/utils/searchArray";
 import cleanDeep from "clean-deep";
-
 export default {
   props: ["baseForm", "isDisabled", "status"],
   name: "vipNewActive",
   data() {
     return {
-      vipResetTypeList,
       pageType: "",
       labelPosition: "right",
       vipformRules: {

+ 78 - 33
src/views/categroyManager/modals/payInfo.vue

@@ -48,6 +48,7 @@
               v-model.trim="payForm.vipGroupCategoryIdList"
               style="width: 400px !important"
               @visible-change="$forceUpdate()"
+              @change="changeCateFee"
               clearable
               :disabled="isDisabled"
             >
@@ -75,7 +76,7 @@
               v-model.trim="payForm.teachMode"
               placeholder="请选择上课模式"
               clearable
-              :disabled="isDisabled"
+              :disabled="isDisabled || unOnlinePay"
             >
               <el-option label="线上" value="0"></el-option>
               <el-option label="线下" value="1"></el-option>
@@ -97,7 +98,7 @@
               v-model.trim="payForm.allowOnlineToOffline"
               placeholder="请选择课程调整方式"
               clearable
-              :disabled="isDisabled"
+              :disabled="isDisabled || unOnlinePay"
             >
               <el-option
                 :label="item.label"
@@ -328,6 +329,34 @@
             </el-select>
           </el-form-item>
         </el-col>
+        <el-col>
+          <el-form-item
+            label="赠课形式"
+            prop="giveCategoryId"
+            v-if="
+              payForm.giveCourseType == 'VIP' && payForm.fullMinusCourseTimes
+            "
+            :rules="[
+              { required: true, message: '请选择赠课形式', trigger: 'change' },
+            ]"
+          >
+            <el-select
+              style="width: 400px !important"
+              v-model.trim="payForm.giveCategoryId"
+              @visible-change="$forceUpdate()"
+              clearable
+              @change="chageSalary"
+              :disabled="isDisabled || unOnlinePay"
+            >
+              <el-option
+                v-for="item in selects.vipGroupCategory"
+                :key="item.id"
+                :value="item.id"
+                :label="item.name"
+              ></el-option>
+            </el-select>
+          </el-form-item>
+        </el-col>
         <el-form-item
           label="赠课模式"
           prop="giveTeachMode"
@@ -341,7 +370,7 @@
             v-model.trim="payForm.giveTeachMode"
             placeholder="请选择赠课模式"
             clearable
-            :disabled="isDisabled"
+            :disabled="isDisabled || unOnlinePay"
           >
             <el-option label="线上" value="0"></el-option>
             <el-option label="线下" value="1"></el-option>
@@ -368,7 +397,7 @@
               v-model.trim="payForm.giveAllowOnlineToOffline"
               placeholder="请选择赠课调整方式"
               clearable
-              :disabled="isDisabled"
+              :disabled="isDisabled || unOnlinePay"
             >
               <el-option
                 :label="item.label"
@@ -379,34 +408,6 @@
             </el-select>
           </el-form-item>
         </el-col>
-        <el-col>
-          <el-form-item
-            label="赠课形式"
-            prop="giveCategoryId"
-            v-if="
-              payForm.giveCourseType == 'VIP' && payForm.fullMinusCourseTimes
-            "
-            :rules="[
-              { required: true, message: '请选择赠课形式', trigger: 'change' },
-            ]"
-          >
-            <el-select
-              style="width: 400px !important"
-              v-model.trim="payForm.giveCategoryId"
-              @visible-change="$forceUpdate()"
-              clearable
-              @change="chageSalary"
-              :disabled="isDisabled"
-            >
-              <el-option
-                v-for="item in selects.vipGroupCategory"
-                :key="item.id"
-                :value="item.id"
-                :label="item.name"
-              ></el-option>
-            </el-select>
-          </el-form-item>
-        </el-col>
       </el-row>
       <el-form-item
         label="赠课时长"
@@ -511,6 +512,8 @@
 </template>
 <script>
 import { vipResetTypeList, memberEnumList } from "@/utils/searchArray";
+import { getOnlineMun } from "@/api/vipSeting";
+
 const MIN_NUMBER = 1;
 const MAX_NUMBER = 999;
 export default {
@@ -526,10 +529,16 @@ export default {
       coureTimerList: [],
       vipResetTypeList,
       memberEnumList,
+      studentRuleNum: null,
+      unOnlinePay: false,
+      unOnlineFee: false,
     };
   },
   async mounted() {
-    console.log(this.activityChannel);
+    const res1 = await getOnlineMun();
+
+    let tempObj = JSON.parse(res1.data.config);
+    this.studentRuleNum = tempObj.cloud_room_rule.cloud_room_up_limit - 1;
     await this.$store.dispatch("setVipGroupCategory");
   },
   methods: {
@@ -576,6 +585,23 @@ export default {
       this.$emit("changeGiveCourseType", val);
     },
     chageSalary(val) {
+      this.selects.vipGroupCategory.forEach((item) => {
+        if (item.id == val) {
+          this.studentNum = item.studentNum;
+        }
+      });
+      if (this.studentNum > this.studentRuleNum) {
+        // 只能是线下课
+        // 上课模式 teachMode
+        // 调整方式 allowOnlineToOffline
+        this.$set(this.payForm, "giveTeachMode", "1");
+        this.$set(this.payForm, "giveAllowOnlineToOffline", "3");
+        this.unOnlinePay = true;
+      } else {
+        this.unOnlinePay = false;
+        this.$set(this.payForm, "giveTeachMode", null);
+        this.$set(this.payForm, "giveAllowOnlineToOffline", null);
+      }
       this.$emit("chageSalary");
     },
     changeFullMinus(val) {
@@ -594,6 +620,25 @@ export default {
         this.$emit("resetIsLimitNum");
       }
     },
+    changeCateFee(val) {
+      this.selects.vipGroupCategory.forEach((item) => {
+        if (item.id == val) {
+          this.studentNum = item.studentNum;
+        }
+      });
+      if (this.studentNum > this.studentRuleNum) {
+        // 只能是线下课
+        // 上课模式 teachMode
+        // 调整方式 allowOnlineToOffline
+        this.$set(this.payForm, "teachMode", "1");
+        this.$set(this.payForm, "allowOnlineToOffline", "3");
+        this.unOnlinePay = true;
+      } else {
+        this.unOnlinePay = false;
+        this.$set(this.payForm, "teachMode", null);
+        this.$set(this.payForm, "allowOnlineToOffline", null);
+      }
+    },
   },
 };
 </script>

+ 7 - 6
src/views/couponManager/couponUpdate.vue

@@ -234,9 +234,10 @@
             prop="stockCount"
             :rules="[{ required: true, message: '请输入库存总量' }]"
           >
-            <el-input v-model="form.stockCount" placeholder="请输入库存总量">
+            <el-input  :disabled='form.stockCount ==-1' v-model="form.stockCount" placeholder="请输入库存总量">
               <template slot="append">张</template>
             </el-input>
+                         <el-checkbox   v-model="form.stockCount" :true-label='-1' false-label=''	 @change="(val)=>{checkNo(val,'stockCount')}" >不限制</el-checkbox>
           </el-form-item>
         </el-col>
         <el-col style="width: 395px">
@@ -245,10 +246,10 @@
             prop="warningStockNum"
             :rules="[{ required: true, message: '请输入预警值' }]"
           >
-            <el-input :disabled='form.warningStockNum ==-1' v-model="warningStockNum" placeholder="请输入预警值">
+            <el-input :disabled='form.warningStockNum ==-1' v-model="form.warningStockNum" placeholder="请输入预警值">
               <template slot="append">张</template>
             </el-input>
-             <el-checkbox v-model="form.warningStockNum" @change="(val)=>{checkNo(val,'warningStockNum')}">不限制</el-checkbox>
+             <el-checkbox   v-model="form.warningStockNum" :true-label='-1' false-label=''	 @change="(val)=>{checkNo(val,'warningStockNum')}" >不限制</el-checkbox>
           </el-form-item>
         </el-col>
         <el-col style="width: 395px">
@@ -332,7 +333,7 @@ export default {
       activeRow: null,
       isDisabled: false,
       title: "新增优惠券",
-      warningStockNum:false,
+      warningStockNum:'',
     };
   },
   mounted() {
@@ -458,9 +459,9 @@ export default {
     },
     checkNo(val,type){
       if(val){
-        form[type] = -1
+        this.form[type] =val
       }else{
-         form[type] = null
+         this.form[type] = null
       }
     }
   },

+ 8 - 10
src/views/teacherManager/teacherOperation/components/salarySet.vue

@@ -472,16 +472,14 @@ export default {
         if (res.code == 200 && res.data.length > 0) {
           let vipData = [];
           res.data.forEach((item) => {
-            if (item.studentNum <= this.studentRuleNum) {
-              vipData.push({
-                offlineClassesSalary: null,
-                onlineClassesSalary: null,
-                vipGroupCategoryId: item.id,
-                vipGroupCategoryName: item.name,
-                userId: this.teacherId,
-                musicTheory: item.musicTheory,
-              });
-            }
+            vipData.push({
+              offlineClassesSalary: null,
+              onlineClassesSalary: null,
+              vipGroupCategoryId: item.id,
+              vipGroupCategoryName: item.name,
+              userId: this.teacherId,
+              musicTheory: item.musicTheory,
+            });
           });
           // VIP课列表
           vipGroupSalaryList({