|
@@ -15,9 +15,19 @@
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
<el-button type="primary" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
<el-button type="primary" icon="el-icon-refresh" size="mini" @click="synchrodeptJob">部门信息同步</el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-circle-plus-outline" size="mini" @click="batchChange(1)">部门充值比例绑定</el-button>
|
|
|
+ <el-button type="warning" icon="el-icon-remove-outline" size="mini" @click="batchChange(0)">部门充值比例解除</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <el-table :data="adminList" height="calc(100vh - 10vh - 120px)">
|
|
|
+ <el-table :data="adminList" @current-change="selectBrand" height="calc(100vh - 10vh - 120px)">
|
|
|
+ <el-table-column
|
|
|
+ label="选择项"
|
|
|
+ width="80">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-radio v-model="tableRadio" :label="scope.row">{{""}}</el-radio>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column type="selection" width="50" align="center" /> -->
|
|
|
<el-table-column label="id" align="center" prop="id" show-overflow-tooltip />
|
|
|
<el-table-column label="部门名称" align="center" prop="name" show-overflow-tooltip />
|
|
|
<el-table-column label="创建人" align="center" prop="createBy" show-overflow-tooltip />
|
|
@@ -27,6 +37,21 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+ <!-- 添加或修改参数配置对话框 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :before-close="cancel" :close-on-click-modal="false" >
|
|
|
+ <el-form ref="queryParams" :model="queryParams" :rules="rules" label-width="120px" >
|
|
|
+ <el-form-item label="到账比例:" prop="id">
|
|
|
+ <el-select v-model="queryParams.id" style="width: 240px" placeholder="请选择到账比例" clearable size="small" >
|
|
|
+ <el-option :label="`${item.identity}:${item.proportion}`" :value="item.id" v-for="(item, index) in radioList" :key="index" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="submitForm" v-if="!loading">确 定</el-button>
|
|
|
+ <el-button :loading="loading" type="primary" @click="submitForm" v-else>提交中...</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
<pagination
|
|
|
v-show="total>0"
|
|
|
:total="total"
|
|
@@ -38,8 +63,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { listChannel, deptJob } from "@/api/recharge/department";
|
|
|
-
|
|
|
+import { listChannel, deptJob, updataByDept } from "@/api/recharge/department";
|
|
|
+import { allRadio } from "@/api/recharge/radio";
|
|
|
+import qs from 'qs'
|
|
|
export default {
|
|
|
name: "admin",
|
|
|
data() {
|
|
@@ -74,13 +100,23 @@ export default {
|
|
|
current: 1,
|
|
|
size: 10,
|
|
|
name: undefined,
|
|
|
- aliasName: undefined,
|
|
|
+ id: undefined,
|
|
|
},
|
|
|
+ //批量到账比例处理
|
|
|
+ staffList:{},
|
|
|
+ // 到账比例
|
|
|
+ radioList:[],
|
|
|
// 表单参数
|
|
|
form: {
|
|
|
name:'',
|
|
|
- aliasName:''
|
|
|
},
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ id:[
|
|
|
+ { required: true, message: "充值比例不能为空", trigger: "change"},
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ tableRadio: {},
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -122,6 +158,74 @@ export default {
|
|
|
this.resetForm("queryForm");
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 单选框选中数据
|
|
|
+ selectBrand(row) {
|
|
|
+ this.tableRadio = row
|
|
|
+ },
|
|
|
+ /** 获取充值管理的数据用于修改赋值 */
|
|
|
+ getListczgl() {
|
|
|
+ allRadio().then(response => {
|
|
|
+ this.radioList = response.data.map(item=>{
|
|
|
+ return {
|
|
|
+ identity:item.identity,
|
|
|
+ proportion:item.proportion,
|
|
|
+ id:item.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //批量处理
|
|
|
+ batchChange(change){
|
|
|
+ if(this.tableRadio){
|
|
|
+ if(change == "1"){
|
|
|
+ this.getListczgl()
|
|
|
+ this.open = true;
|
|
|
+ this.title = "修改参数";
|
|
|
+ }else{
|
|
|
+ this.loading = true;
|
|
|
+ this.staffList.deptId = this.tableRadio.did
|
|
|
+ this.staffList.radioId = 1
|
|
|
+ this.staffList.isBinding = 0
|
|
|
+ updataByDept(this.staffList).then(response =>{
|
|
|
+ this.loading = false;
|
|
|
+ this.msgSuccess(`${this.tableRadio.name} 解绑完成`)
|
|
|
+ this.getList();
|
|
|
+ }).catch(err=>{
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.$message.error('请勾选需要处理充值到账比例部门信息')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["queryParams"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if(this.queryParams.id){
|
|
|
+ this.loading = true;
|
|
|
+
|
|
|
+ this.staffList.deptId = this.tableRadio.did
|
|
|
+ this.staffList.radioId = this.queryParams.id
|
|
|
+ this.staffList.isBinding = 1
|
|
|
+ updataByDept(this.staffList).then(response =>{
|
|
|
+ this.loading = false;
|
|
|
+ this.open = false;
|
|
|
+ this.msgSuccess(`${this.tableRadio.name} 绑定完成`)
|
|
|
+ this.getList();
|
|
|
+ this.reset()
|
|
|
+ }).catch(err=>{
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
};
|
|
|
</script>
|