|
@@ -0,0 +1,244 @@
|
|
|
+<template>
|
|
|
+ <div class='m-container'>
|
|
|
+ <!-- <h2>折扣设置</h2> -->
|
|
|
+ <div class="m-core">
|
|
|
+ <el-form :inline="true"
|
|
|
+ :model="searchForm">
|
|
|
+ <el-form-item>
|
|
|
+ <el-select placeholder="请选择分部"
|
|
|
+ v-model="searchForm.organId"
|
|
|
+ clearable>
|
|
|
+ <el-option v-for="(item,index) in organList"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ :key="index"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-select placeholder="课程类型"
|
|
|
+ v-model="searchForm.courseScheduleType"
|
|
|
+ clearable
|
|
|
+ filterable>
|
|
|
+ <el-option v-for="(item,index) in musicCourseType"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ :key="index"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="danger"
|
|
|
+ @click="search">搜索</el-button>
|
|
|
+ <el-button @click="onReSet"
|
|
|
+ type="primary">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div class='newBand'
|
|
|
+ v-permission="'chargeType/upSet'"
|
|
|
+ @click="newVisiable = true">添加</div>
|
|
|
+ <!-- 列表 -->
|
|
|
+ <div class="tableWrap">
|
|
|
+ <el-table :data='tableList'
|
|
|
+ :header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
+ <el-table-column align='center'
|
|
|
+ prop="chargeTypeId"
|
|
|
+ label="分部">
|
|
|
+ <template slot-scope="scope">{{ typesListById[scope.row.chargeTypeId] }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align='center'
|
|
|
+ prop="chargeTypeId"
|
|
|
+ label="课程类型">
|
|
|
+ <template slot-scope="scope">{{ typesListById[scope.row.chargeTypeId] }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align='center'
|
|
|
+ prop="subjectId"
|
|
|
+ label="缴费形态">
|
|
|
+ <template slot-scope="scope">{{ subjectListById[scope.row.subjectId] }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align='center'
|
|
|
+ prop="goodsDiscountRate"
|
|
|
+ label="缴费金额">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align='center'
|
|
|
+ label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button @click="openTypes('update', scope.row)"
|
|
|
+ v-permission="'chargeType/upSet'"
|
|
|
+ type="text">修改</el-button>
|
|
|
+ <el-button @click="onTypesDel(scope.row)"
|
|
|
+ v-permission="'chargeType/del'"
|
|
|
+ type="text">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <pagination :total="pageInfo.total"
|
|
|
+ :page.sync="pageInfo.page"
|
|
|
+ :limit.sync="pageInfo.limit"
|
|
|
+ :page-sizes="pageInfo.page_size"
|
|
|
+ @pagination="getList" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-dialog title="新建"
|
|
|
+ :visible.sync="newVisiable"
|
|
|
+ width="500px">
|
|
|
+ <el-form :model="createForm"
|
|
|
+ class="createForm"
|
|
|
+ ref="ruleForm">
|
|
|
+ <el-form-item label="所属分部"
|
|
|
+ prop="chargeTypeId"
|
|
|
+ :label-width="formLabelWidth">
|
|
|
+ <el-select placeholder="请选择分部"
|
|
|
+ v-model="createForm.organId"
|
|
|
+ clearable>
|
|
|
+ <el-option v-for="(item,index) in organList"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ :key="index"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="收费类型"
|
|
|
+ prop="chargeTypeId"
|
|
|
+ :label-width="formLabelWidth">
|
|
|
+ <el-select v-model.trim="createForm.chargeTypeId"
|
|
|
+ filterable
|
|
|
+ placeholder="请选择收费类型"
|
|
|
+ clearable>
|
|
|
+ <el-option v-for="item in musicCourseType"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <div v-for="(item,index) in dataList"
|
|
|
+ :key="index">
|
|
|
+ <el-form-item :label="`${item.name}每分钟费用`"
|
|
|
+ :label-width="formLabelWidth">
|
|
|
+ <el-input v-model="createForm[item.name]">
|
|
|
+ <template slot="append">元</template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer"
|
|
|
+ class="dialog-footer">
|
|
|
+ <el-button @click="newVisiable = false">取 消</el-button>
|
|
|
+ <el-button type="primary">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import pagination from '@/components/Pagination/index'
|
|
|
+import { getEmployeeOrgan } from "@/api/buildTeam";
|
|
|
+import { chargeTypeList, getOrganizationCourseUnitPriceSettings } from '@/api/specialSetting'
|
|
|
+import createDiscount from './modals/create-discount'
|
|
|
+import { musicCourseType } from '@/utils/searchArray'
|
|
|
+export default {
|
|
|
+ name: 'typesManager',
|
|
|
+ components: { pagination, createDiscount },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ musicCourseType,
|
|
|
+ newVisiable: false,
|
|
|
+ tableList: [],
|
|
|
+ dataList: [],
|
|
|
+ organList: [],
|
|
|
+ searchForm: {
|
|
|
+ organId: null,
|
|
|
+ courseScheduleType: null
|
|
|
+ },
|
|
|
+ createForm: {
|
|
|
+ organId: null,
|
|
|
+ courseScheduleType: null,
|
|
|
+ },
|
|
|
+ pageInfo: {
|
|
|
+ // 分页规则
|
|
|
+ limit: 10, // 限制显示条数
|
|
|
+ page: 1, // 当前页
|
|
|
+ total: 0, // 总条数
|
|
|
+ page_size: [10, 20, 40, 50] // 选择限制显示条数
|
|
|
+ },
|
|
|
+ formLabelWidth: '120px'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted () {
|
|
|
+ chargeTypeList({
|
|
|
+ rows: 99999,
|
|
|
+ page: 1
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.dataList = res.data.rows
|
|
|
+ this.dataList.forEach(item => {
|
|
|
+ this.$set(this.createForm, item.name, null)
|
|
|
+ })
|
|
|
+ console.log('111')
|
|
|
+ console.log(this.createForm)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ getEmployeeOrgan().then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.organList = res.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ search () { },
|
|
|
+ onReSet () { },
|
|
|
+
|
|
|
+ async onTypesDel (row) {
|
|
|
+ try {
|
|
|
+ await this.$confirm('是否删除此条数据?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ delChargeTypeSubjectMapper({ id: row.id }).then(res => {
|
|
|
+ this.messageTips('删除', res)
|
|
|
+ })
|
|
|
+ } catch (error) { }
|
|
|
+ },
|
|
|
+
|
|
|
+ getList () {
|
|
|
+ getOrganizationCourseUnitPriceSettings({
|
|
|
+ rows: this.pageInfo.limit,
|
|
|
+ page: this.pageInfo.page
|
|
|
+ }).then(res => {
|
|
|
+ let result = res.data
|
|
|
+ this.tableList = result.rows
|
|
|
+ this.pageInfo.total = result.total
|
|
|
+ // }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ },
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.el-button--primary {
|
|
|
+ background: #14928a;
|
|
|
+ border-color: #14928a;
|
|
|
+ color: #fff;
|
|
|
+ &:hover,
|
|
|
+ &:active,
|
|
|
+ &:focus {
|
|
|
+ background: #14928a;
|
|
|
+ border-color: #14928a;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+}
|
|
|
+/deep/.el-date-editor.el-input {
|
|
|
+ width: 100% !important;
|
|
|
+}
|
|
|
+.el-select {
|
|
|
+ width: 100% !important;
|
|
|
+}
|
|
|
+.createForm {
|
|
|
+ /deep/.el-input {
|
|
|
+ width: 340px !important;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|