|
@@ -2,47 +2,65 @@
|
|
|
<div class='m-container'>
|
|
|
<!-- <h2>收费类型设置</h2> -->
|
|
|
<div class="m-core">
|
|
|
- <div @click="onBranchOperation('create')" class='newBand'>添加</div>
|
|
|
+ <div @click="onBranchOperation('create')"
|
|
|
+ class='newBand'>添加</div>
|
|
|
<div class="tableWrap">
|
|
|
<el-table :data="dataList"
|
|
|
- :header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
- <el-table-column prop="price" label="收费标准" >
|
|
|
+ :header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
+ <el-table-column prop="price"
|
|
|
+ label="收费标准">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="name" label="分部名称" >
|
|
|
+ <el-table-column prop="name"
|
|
|
+ label="分部名称">
|
|
|
<template slot-scope="scope">
|
|
|
{{ scope.row.branchNames | joinArray(',') }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column align='center'
|
|
|
- label="操作">
|
|
|
+ label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button @click="onBranchOperation('update', scope.row)" type="text">修改</el-button>
|
|
|
- <el-button @click="onBranchDelete(scope.row)" type="text">删除</el-button>
|
|
|
+ <el-button @click="onBranchOperation('update', scope.row)"
|
|
|
+ type="text">修改</el-button>
|
|
|
+ <el-button @click="onBranchDelete(scope.row)"
|
|
|
+ type="text">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
|
|
|
- <el-dialog :title="formTitle[formActionTitle]" :visible.sync="branchStatus" @close="onFormClose('ruleForm')" width="500px">
|
|
|
- <el-form :model="form" :rules="rules" ref="ruleForm">
|
|
|
- <el-form-item label="收费标准" prop="price" :label-width="formLabelWidth">
|
|
|
- <el-input type="number" v-model="form.price" autocomplete="off"></el-input>
|
|
|
+ <el-dialog :title="formTitle[formActionTitle]"
|
|
|
+ :visible.sync="branchStatus"
|
|
|
+ @close="onFormClose('ruleForm')"
|
|
|
+ width="500px">
|
|
|
+ <el-form :model="form"
|
|
|
+ :rules="rules"
|
|
|
+ ref="ruleForm">
|
|
|
+ <el-form-item label="收费标准"
|
|
|
+ prop="price"
|
|
|
+ :label-width="formLabelWidth">
|
|
|
+ <el-input type="number"
|
|
|
+ v-model="form.price"
|
|
|
+ autocomplete="off"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="所选分部" prop="branchIds" :label-width="formLabelWidth">
|
|
|
- <el-select v-model="form.branchIds" multiple>
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in branchList"
|
|
|
- :key="index"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- :disabled="item.disabled">
|
|
|
+ <el-form-item label="所选分部"
|
|
|
+ prop="branchIds"
|
|
|
+ :label-width="formLabelWidth">
|
|
|
+ <el-select v-model="form.branchIds"
|
|
|
+ multiple>
|
|
|
+ <el-option v-for="(item, index) in branchList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ :disabled="item.disabled">
|
|
|
</el-option>
|
|
|
- </el-select>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
+ <span slot="footer"
|
|
|
+ class="dialog-footer">
|
|
|
<el-button @click="branchStatus = false">取 消</el-button>
|
|
|
- <el-button @click="onTypesSubmit('ruleForm')" type="primary">确 定</el-button>
|
|
|
+ <el-button @click="onTypesSubmit('ruleForm')"
|
|
|
+ type="primary">确 定</el-button>
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
@@ -78,7 +96,7 @@ export default {
|
|
|
},
|
|
|
}
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ mounted () {
|
|
|
this.getList()
|
|
|
},
|
|
|
methods: {
|
|
@@ -90,29 +108,29 @@ export default {
|
|
|
let params = JSON.parse(JSON.stringify(this.dataList))
|
|
|
let branchNames = []
|
|
|
this.branchList.forEach(item => {
|
|
|
- if(form.branchIds.includes(item.value)) {
|
|
|
+ if (form.branchIds.includes(item.value)) {
|
|
|
branchNames.push(item.label)
|
|
|
}
|
|
|
})
|
|
|
- if(this.formActionTitle == 'create') {
|
|
|
+ if (this.formActionTitle == 'create') {
|
|
|
params.push({
|
|
|
price: form.price,
|
|
|
branchIds: form.branchIds,
|
|
|
branchNames: branchNames
|
|
|
})
|
|
|
- sysConfigUpdate({
|
|
|
+ sysConfigUpdate({
|
|
|
id: this.id,
|
|
|
paranValue: JSON.stringify(params)
|
|
|
}).then(res => {
|
|
|
- if(res.code == 200) {
|
|
|
- this.$message.success('添加成功')
|
|
|
- this.branchStatus = false
|
|
|
- this.getList()
|
|
|
- }
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success('添加成功')
|
|
|
+ this.branchStatus = false
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
})
|
|
|
- } else if(this.formActionTitle == 'update') {
|
|
|
+ } else if (this.formActionTitle == 'update') {
|
|
|
let tempUpdate = params.map(item => {
|
|
|
- if(item.id == form.id) {
|
|
|
+ if (item.id == form.id) {
|
|
|
item = {
|
|
|
price: form.price,
|
|
|
branchIds: form.branchIds,
|
|
@@ -127,11 +145,11 @@ export default {
|
|
|
id: this.id,
|
|
|
paranValue: JSON.stringify(tempUpdate)
|
|
|
}).then(res => {
|
|
|
- if(res.code == 200) {
|
|
|
- this.$message.success('修改成功')
|
|
|
- this.branchStatus = false
|
|
|
- this.getList()
|
|
|
- }
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success('修改成功')
|
|
|
+ this.branchStatus = false
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
@@ -139,8 +157,8 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- onBranchDelete(row) {
|
|
|
-
|
|
|
+ onBranchDelete (row) {
|
|
|
+
|
|
|
let tempBranch = JSON.parse(JSON.stringify(this.dataList))
|
|
|
tempBranch.splice(row.id, 1)
|
|
|
|
|
@@ -152,33 +170,33 @@ export default {
|
|
|
id: this.id,
|
|
|
paranValue: JSON.stringify(temp)
|
|
|
}).then(res => {
|
|
|
- if(res.code == 200) {
|
|
|
- this.$message.success('删除成功')
|
|
|
- this.getList()
|
|
|
- }
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success('删除成功')
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
})
|
|
|
},
|
|
|
- onBranchOperation(type, row) {
|
|
|
+ onBranchOperation (type, row) {
|
|
|
this.branchStatus = true
|
|
|
this.formActionTitle = type
|
|
|
- if(type == 'update') {
|
|
|
+ if (type == 'update') {
|
|
|
this.branchList.forEach(item => {
|
|
|
- if(row.branchIds.includes(item.value)) {
|
|
|
+ if (row.branchIds.includes(item.value)) {
|
|
|
item.disabled = false
|
|
|
}
|
|
|
})
|
|
|
this.form = row
|
|
|
}
|
|
|
},
|
|
|
- async getList () {
|
|
|
+ async getList () {
|
|
|
// 获取所有分部
|
|
|
let branchList = await branchQueryPage({ rows: 9999, page: 1 })
|
|
|
- if(branchList.code == 200) {
|
|
|
+ if (branchList.code == 200) {
|
|
|
branchList = branchList.data.rows
|
|
|
}
|
|
|
// 获取对应配置
|
|
|
let sysConfig = await sysConfigList({ group: 'organ_course_fee' })
|
|
|
- if(sysConfig.code == 200) {
|
|
|
+ if (sysConfig.code == 200) {
|
|
|
this.id = sysConfig.data[0].id
|
|
|
sysConfig = sysConfig.data[0].paranValue ? JSON.parse(sysConfig.data[0].paranValue) : []
|
|
|
}
|
|
@@ -199,7 +217,7 @@ export default {
|
|
|
label: item.name,
|
|
|
value: item.id
|
|
|
}
|
|
|
- if(sysBranchIds.includes(item.id)) {
|
|
|
+ if (sysBranchIds.includes(item.id)) {
|
|
|
params.disabled = true
|
|
|
} else {
|
|
|
params.disabled = false
|
|
@@ -211,7 +229,7 @@ export default {
|
|
|
},
|
|
|
onFormClose (formName) { // 关闭弹窗重置验证
|
|
|
this.form = {
|
|
|
- price: null,
|
|
|
+ price: null,
|
|
|
branchIds: []
|
|
|
}
|
|
|
this.$refs[formName].resetFields()
|
|
@@ -220,20 +238,22 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
-.el-button--primary {
|
|
|
+/deep/.el-button--primary {
|
|
|
background: #14928a;
|
|
|
border-color: #14928a;
|
|
|
color: #fff;
|
|
|
- &:hover, &:active, &:focus {
|
|
|
+ &:hover,
|
|
|
+ &:active,
|
|
|
+ &:focus {
|
|
|
background: #14928a;
|
|
|
border-color: #14928a;
|
|
|
- color: #FFF;
|
|
|
+ color: #fff;
|
|
|
}
|
|
|
}
|
|
|
-.el-date-editor.el-input{
|
|
|
+/deep/.el-date-editor.el-input {
|
|
|
width: 100% !important;
|
|
|
}
|
|
|
-.el-select {
|
|
|
+/deep/.el-select {
|
|
|
width: 98% !important;
|
|
|
}
|
|
|
|