|
@@ -1,8 +1,14 @@
|
|
|
<template>
|
|
|
- <div class='m-container'>
|
|
|
+ <div class="m-container">
|
|
|
<!-- <h2>收费类型设置</h2> -->
|
|
|
- <div>
|
|
|
- <save-form :inline="true" @submit="search" @reset="onReSet" :saveKey="'chargesList'" :model="searchForm">
|
|
|
+ <div v-if="dataList.length > 0 || pageInfo.page > 1">
|
|
|
+ <save-form
|
|
|
+ :inline="true"
|
|
|
+ @submit="search"
|
|
|
+ @reset="onReSet"
|
|
|
+ :saveKey="'chargesList'"
|
|
|
+ :model="searchForm"
|
|
|
+ >
|
|
|
<el-form-item>
|
|
|
<el-select
|
|
|
placeholder="请选择分部"
|
|
@@ -39,28 +45,31 @@
|
|
|
<el-button type="primary" native-type="reset">重置</el-button>
|
|
|
</el-form-item>
|
|
|
</save-form>
|
|
|
- <el-button style="margin-bottom: 20px;" type="primary" v-permission="'musicGroupOrganizationCourseSettings/add'" @click="onChargeOperation('create')" icon="el-icon-plus">添加</el-button>
|
|
|
+ <el-button
|
|
|
+ style="margin-bottom: 20px"
|
|
|
+ type="primary"
|
|
|
+ v-permission="'musicGroupOrganizationCourseSettings/add'"
|
|
|
+ @click="onChargeOperation('create')"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ >添加</el-button
|
|
|
+ >
|
|
|
<div class="tableWrap">
|
|
|
- <el-table :data="dataList"
|
|
|
- :header-cell-style="{background:'#EDEEF0',color:'#444'}" >
|
|
|
- <el-table-column prop="organId"
|
|
|
- label="所属分部">
|
|
|
+ <el-table
|
|
|
+ :data="dataList"
|
|
|
+ :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
|
|
|
+ >
|
|
|
+ <el-table-column prop="organId" label="所属分部">
|
|
|
<template slot-scope="scope">
|
|
|
{{ branchById[scope.row.organId] }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="chargeTypeId"
|
|
|
- label="乐团模式">
|
|
|
+ <el-table-column prop="chargeTypeId" label="乐团模式">
|
|
|
<template slot-scope="scope">
|
|
|
{{ typesById[scope.row.chargeTypeId] }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="name"
|
|
|
- label="收费方式名称">
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="totalCurrentPrice"
|
|
|
- label="现价(元)">
|
|
|
-
|
|
|
+ <el-table-column prop="name" label="收费方式名称"> </el-table-column>
|
|
|
+ <el-table-column prop="totalCurrentPrice" label="现价(元)">
|
|
|
<template slot="header">
|
|
|
<p style="position: relative">
|
|
|
现价(元)
|
|
@@ -74,69 +83,85 @@
|
|
|
</p>
|
|
|
</template>
|
|
|
<template slot-scope="scope">
|
|
|
- {{ numeral(scope.row.totalCurrentPrice).format('0,0') }}
|
|
|
+ {{ numeral(scope.row.totalCurrentPrice).format("0,0") }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="totalOriginalPrice"
|
|
|
- label="原价(元)">
|
|
|
+ <el-table-column prop="totalOriginalPrice" label="原价(元)">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ numeral(scope.row.totalOriginalPrice).format('0,0') }}
|
|
|
+ {{ numeral(scope.row.totalOriginalPrice).format("0,0") }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="updateTime"
|
|
|
- label="修改时间">
|
|
|
+ <el-table-column prop="updateTime" label="修改时间">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align='center'
|
|
|
- label="操作">
|
|
|
+ <el-table-column align="center" label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button @click="onChargeOperation('update', scope.row)"
|
|
|
- v-permission="'musicGroupOrganizationCourseSettings/update'"
|
|
|
- type="text">修改</el-button>
|
|
|
- <el-button @click="onChargeDelete(scope.row)"
|
|
|
- v-permission="'musicGroupOrganizationCourseSettings/delSetting'"
|
|
|
- type="text">删除</el-button>
|
|
|
+ <el-button
|
|
|
+ @click="onChargeOperation('update', scope.row)"
|
|
|
+ v-permission="'musicGroupOrganizationCourseSettings/update'"
|
|
|
+ type="text"
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ @click="onChargeDelete(scope.row)"
|
|
|
+ v-permission="'musicGroupOrganizationCourseSettings/delSetting'"
|
|
|
+ type="text"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
<pagination
|
|
|
- :saveKey="'chargesList'"
|
|
|
- sync
|
|
|
- :total.sync="pageInfo.total"
|
|
|
- :page.sync="pageInfo.page"
|
|
|
- :limit.sync="pageInfo.limit"
|
|
|
- :page-sizes="pageInfo.page_size"
|
|
|
- @pagination="getList" />
|
|
|
- </div>
|
|
|
-
|
|
|
- <el-dialog :title="formTitle[formActionTitle]"
|
|
|
- :visible.sync="chargeStatus"
|
|
|
- @close="closeModal"
|
|
|
- destroy-on-close
|
|
|
- width="850px">
|
|
|
- <chargesForm
|
|
|
- v-if="chargeStatus"
|
|
|
- :typesList="typesList"
|
|
|
- :branchList.sync="branchList"
|
|
|
- :rowDetail="rowDetail"
|
|
|
- @close="closeModal"
|
|
|
- @submited="getList"
|
|
|
+ :saveKey="'chargesList'"
|
|
|
+ sync
|
|
|
+ :total.sync="pageInfo.total"
|
|
|
+ :page.sync="pageInfo.page"
|
|
|
+ :limit.sync="pageInfo.limit"
|
|
|
+ :page-sizes="pageInfo.page_size"
|
|
|
+ @pagination="getList"
|
|
|
/>
|
|
|
- </el-dialog>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <emptyPage @submit="onChargeOperation('create')" title='乐团收费标准' btnTitle='新建乐团收费标准' :context='context' v-else />
|
|
|
+ <el-dialog
|
|
|
+ :title="formTitle[formActionTitle]"
|
|
|
+ :visible.sync="chargeStatus"
|
|
|
+ @close="closeModal"
|
|
|
+ destroy-on-close
|
|
|
+ width="850px"
|
|
|
+ >
|
|
|
+ <chargesForm
|
|
|
+ v-if="chargeStatus"
|
|
|
+ :typesList="typesList"
|
|
|
+ :branchList.sync="branchList"
|
|
|
+ :rowDetail="rowDetail"
|
|
|
+ @close="closeModal"
|
|
|
+ @submited="getList"
|
|
|
+ />
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import pagination from '@/components/Pagination/index'
|
|
|
-import { chargeTypeList, chargeTypeOrganizationFeeAdd, musicGroupOrganizationCourseSettingsDel, chargeTypeOrganizationFeeUpdate, chargeTypeOrganizationFee, branchQueryPage, musicGroupOrganizationCourseSettingsQueryPage } from '@/api/specialSetting'
|
|
|
-import chargesForm from './modals/chargesForm'
|
|
|
-import numeral from 'numeral'
|
|
|
+import pagination from "@/components/Pagination/index";
|
|
|
+import {
|
|
|
+ chargeTypeList,
|
|
|
+ chargeTypeOrganizationFeeAdd,
|
|
|
+ musicGroupOrganizationCourseSettingsDel,
|
|
|
+ chargeTypeOrganizationFeeUpdate,
|
|
|
+ chargeTypeOrganizationFee,
|
|
|
+ branchQueryPage,
|
|
|
+ musicGroupOrganizationCourseSettingsQueryPage,
|
|
|
+} from "@/api/specialSetting";
|
|
|
+import chargesForm from "./modals/chargesForm";
|
|
|
+import numeral from "numeral";
|
|
|
+import emptyPage from '@/components/emptyPage'
|
|
|
export default {
|
|
|
components: {
|
|
|
pagination,
|
|
|
- chargesForm
|
|
|
+ chargesForm,
|
|
|
+ emptyPage
|
|
|
},
|
|
|
- name: 'chargesList',
|
|
|
- data () {
|
|
|
+ name: "chargesList",
|
|
|
+ data() {
|
|
|
return {
|
|
|
id: null,
|
|
|
rowDetail: null,
|
|
@@ -145,77 +170,84 @@ export default {
|
|
|
branchList: [], // 分部列表
|
|
|
typesById: {},
|
|
|
branchById: {},
|
|
|
- formActionTitle: 'create',
|
|
|
+ formActionTitle: "create",
|
|
|
formTitle: {
|
|
|
- create: '添加乐团收费标准',
|
|
|
- update: '修改乐团收费标准'
|
|
|
+ create: "添加乐团收费标准",
|
|
|
+ update: "修改乐团收费标准",
|
|
|
},
|
|
|
searchForm: {
|
|
|
organId: null,
|
|
|
chargeTypeId: null,
|
|
|
},
|
|
|
chargeStatus: false,
|
|
|
- formLabelWidth: '100px',
|
|
|
+ formLabelWidth: "100px",
|
|
|
form: {
|
|
|
chargeTypeId: null,
|
|
|
- courseFee: null
|
|
|
+ courseFee: null,
|
|
|
},
|
|
|
rules: {
|
|
|
- courseFee: [{ required: true, message: '请输入课程费用', trigger: 'blur' }],
|
|
|
- chargeTypeId: [{ required: true, message: '请选择收费类型', trigger: 'change' }],
|
|
|
- organId: [{ required: true, message: '请选择所属分部', trigger: 'change' }]
|
|
|
+ courseFee: [
|
|
|
+ { required: true, message: "请输入课程费用", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ chargeTypeId: [
|
|
|
+ { required: true, message: "请选择收费类型", trigger: "change" },
|
|
|
+ ],
|
|
|
+ organId: [
|
|
|
+ { required: true, message: "请选择所属分部", trigger: "change" },
|
|
|
+ ],
|
|
|
},
|
|
|
pageInfo: {
|
|
|
// 分页规则
|
|
|
limit: 10, // 限制显示条数
|
|
|
page: 1, // 当前页
|
|
|
total: 0, // 总条数
|
|
|
- page_size: [10, 20, 40, 50] // 选择限制显示条数
|
|
|
- }
|
|
|
- }
|
|
|
+ page_size: [10, 20, 40, 50], // 选择限制显示条数
|
|
|
+ },
|
|
|
+ context:'此处用于设置乐团训练的标准课程组合包,可根据不同分部不同的乐团模式创建不同的课程组合包及组合包的标准价格,创建完成后,在设置乐团报名、续费时可直接选择收费标准快速创建乐团课程缴费。'
|
|
|
+ };
|
|
|
},
|
|
|
- async mounted () {
|
|
|
- this.getList()
|
|
|
+ async mounted() {
|
|
|
+ this.getList();
|
|
|
|
|
|
// 收费类型
|
|
|
chargeTypeList({
|
|
|
rows: 9999,
|
|
|
- page: 1
|
|
|
- }).then(res => {
|
|
|
+ page: 1,
|
|
|
+ }).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
- const typesById = {}
|
|
|
- res.data.rows.forEach(item => {
|
|
|
- typesById[item.id] = item.name
|
|
|
+ const typesById = {};
|
|
|
+ res.data.rows.forEach((item) => {
|
|
|
+ typesById[item.id] = item.name;
|
|
|
this.typesList.push({
|
|
|
label: item.name,
|
|
|
- value: item.id
|
|
|
- })
|
|
|
- })
|
|
|
- this.typesById = typesById
|
|
|
- if( res.data.rows.length <=0){
|
|
|
- this.$bus.$emit("showguide", ['teamPayType']);
|
|
|
- return
|
|
|
+ value: item.id,
|
|
|
+ });
|
|
|
+ });
|
|
|
+ this.typesById = typesById;
|
|
|
+ if (res.data.rows.length <= 0) {
|
|
|
+ this.$bus.$emit("showguide", ["teamPayType"]);
|
|
|
+ return;
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
|
|
|
// 分部列表
|
|
|
branchQueryPage({
|
|
|
rows: 9999,
|
|
|
- page: 1
|
|
|
- }).then(res => {
|
|
|
+ page: 1,
|
|
|
+ }).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
- const branchById = {}
|
|
|
- this.branchList = res.data.rows.map(item => {
|
|
|
- branchById[item.id] = item.name
|
|
|
- return ({
|
|
|
+ const branchById = {};
|
|
|
+ this.branchList = res.data.rows.map((item) => {
|
|
|
+ branchById[item.id] = item.name;
|
|
|
+ return {
|
|
|
label: item.name,
|
|
|
- value: item.id
|
|
|
- })
|
|
|
- })
|
|
|
- this.branchById = branchById
|
|
|
+ value: item.id,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ this.branchById = branchById;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
numeral,
|
|
@@ -230,80 +262,87 @@ export default {
|
|
|
};
|
|
|
this.search();
|
|
|
},
|
|
|
- onTypesSubmit (formName) { // 添加数据
|
|
|
+ onTypesSubmit(formName) {
|
|
|
+ // 添加数据
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- if (this.formActionTitle == 'create') {
|
|
|
- if (this.form.id) { // 判断有没有Id,如果有则删除
|
|
|
- delete this.form.id
|
|
|
+ if (this.formActionTitle == "create") {
|
|
|
+ if (this.form.id) {
|
|
|
+ // 判断有没有Id,如果有则删除
|
|
|
+ delete this.form.id;
|
|
|
}
|
|
|
- chargeTypeOrganizationFeeAdd(this.form).then(res => {
|
|
|
- this.messageTips('添加', res)
|
|
|
- })
|
|
|
- } else if (this.formActionTitle == 'update') {
|
|
|
- chargeTypeOrganizationFeeUpdate(this.form).then(res => {
|
|
|
- this.messageTips('修改', res)
|
|
|
- })
|
|
|
+ chargeTypeOrganizationFeeAdd(this.form).then((res) => {
|
|
|
+ this.messageTips("添加", res);
|
|
|
+ });
|
|
|
+ } else if (this.formActionTitle == "update") {
|
|
|
+ chargeTypeOrganizationFeeUpdate(this.form).then((res) => {
|
|
|
+ this.messageTips("修改", res);
|
|
|
+ });
|
|
|
}
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
- messageTips (title, res) {
|
|
|
+ messageTips(title, res) {
|
|
|
if (res.code == 200) {
|
|
|
- this.$message.success(title + '成功')
|
|
|
- this.chargeStatus = false
|
|
|
- this.getList()
|
|
|
+ this.$message.success(title + "成功");
|
|
|
+ this.chargeStatus = false;
|
|
|
+ this.getList();
|
|
|
} else {
|
|
|
- this.$message.error(res.msg)
|
|
|
+ this.$message.error(res.msg);
|
|
|
}
|
|
|
},
|
|
|
- onChargeOperation (type, row) {
|
|
|
- this.formActionTitle = type
|
|
|
- if (type == 'update') {
|
|
|
- this.rowDetail = { ...row }
|
|
|
+ onChargeOperation(type, row) {
|
|
|
+ this.formActionTitle = type;
|
|
|
+ if (type == "update") {
|
|
|
+ this.rowDetail = { ...row };
|
|
|
} else {
|
|
|
- this.rowDetail = null
|
|
|
+ this.rowDetail = null;
|
|
|
}
|
|
|
- this.chargeStatus = true
|
|
|
+ this.chargeStatus = true;
|
|
|
},
|
|
|
- onChargeDelete (row) { // 删除
|
|
|
- this.$confirm('您确定删除该收费标准?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- musicGroupOrganizationCourseSettingsDel({ id: row.id }).then(res => {
|
|
|
- this.messageTips('删除', res)
|
|
|
+ onChargeDelete(row) {
|
|
|
+ // 删除
|
|
|
+ this.$confirm("您确定删除该收费标准?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ musicGroupOrganizationCourseSettingsDel({ id: row.id }).then(
|
|
|
+ (res) => {
|
|
|
+ this.messageTips("删除", res);
|
|
|
+ }
|
|
|
+ );
|
|
|
})
|
|
|
- }).catch(() => { })
|
|
|
-
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
|
- getList () {
|
|
|
+ getList() {
|
|
|
musicGroupOrganizationCourseSettingsQueryPage({
|
|
|
rows: this.pageInfo.limit,
|
|
|
page: this.pageInfo.page,
|
|
|
- ...this.searchForm
|
|
|
- }).then(res => {
|
|
|
+ ...this.searchForm,
|
|
|
+ }).then((res) => {
|
|
|
if (res.code == 200) {
|
|
|
- this.dataList = res.data.rows
|
|
|
- this.pageInfo.total = res.data.total
|
|
|
+ this.dataList = res.data.rows;
|
|
|
+ this.pageInfo.total = res.data.total;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
- onFormClose (formName) { // 关闭弹窗重置验证
|
|
|
+ onFormClose(formName) {
|
|
|
+ // 关闭弹窗重置验证
|
|
|
this.form = {
|
|
|
courseFee: null,
|
|
|
- chargeTypeId: null
|
|
|
- }
|
|
|
- this.$refs[formName].resetFields()
|
|
|
+ chargeTypeId: null,
|
|
|
+ };
|
|
|
+ this.$refs[formName].resetFields();
|
|
|
},
|
|
|
closeModal() {
|
|
|
- this.chargeStatus = false
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+ this.chargeStatus = false;
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
/deep/.el-date-editor.el-input {
|