|
@@ -64,6 +64,9 @@
|
|
<dict-tag :options="statusOptions" :value="scope.row.status"/>
|
|
<dict-tag :options="statusOptions" :value="scope.row.status"/>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
+ <el-table-column prop="red" label="红包配额" width="200" v-if="this.isResource"></el-table-column>
|
|
|
|
+ <el-table-column prop="traffic" label="流量配额" width="200" v-if="this.isResource"></el-table-column>
|
|
|
|
+ <el-table-column prop="pad" label="坐席配额" width="200" v-if="this.isResource"></el-table-column>
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="200">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
@@ -78,6 +81,14 @@
|
|
@click="handleUpdate(scope.row)"
|
|
@click="handleUpdate(scope.row)"
|
|
v-hasPermi="['system:dept:edit']"
|
|
v-hasPermi="['system:dept:edit']"
|
|
>修改</el-button>
|
|
>修改</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-edit"
|
|
|
|
+ @click="handleUpdateResource(scope.row)"
|
|
|
|
+ v-hasPermi="['system:dept:resource']"
|
|
|
|
+ v-if="scope.row.deptId !== 1"
|
|
|
|
+ >资源配置</el-button>
|
|
<el-button
|
|
<el-button
|
|
size="mini"
|
|
size="mini"
|
|
type="text"
|
|
type="text"
|
|
@@ -96,6 +107,90 @@
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
|
|
+ <!-- 资源配置对话框 -->
|
|
|
|
+ <el-dialog title="部门资源配置" :visible.sync="openResource" width="600px" append-to-body>
|
|
|
|
+ <el-form ref="resourceForm" :model="resourceForm" :rules="resourceRules" label-width="80px">
|
|
|
|
+ <el-form-item label="部门名称">
|
|
|
|
+ <el-input v-model="this.targetDeptName" disabled/>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-row :gutter="10">
|
|
|
|
+ <el-col :span="8">
|
|
|
|
+ <el-form-item label="红包配额" prop="red" >
|
|
|
|
+ <el-input-number v-model="resourceForm.red" controls-position="right" disabled/>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="8">
|
|
|
|
+ <el-form-item label="充值配额" prop="pad" >
|
|
|
|
+ <el-input-number v-model="resourceForm.redCharge" controls-position="right" :min=0 />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="8">
|
|
|
|
+ <!-- 有效时间 时间选择器-->
|
|
|
|
+ <el-form-item label="有效时间" prop="redEffectiveTime" >
|
|
|
|
+ <el-date-picker
|
|
|
|
+ v-model="resourceForm.redEffectiveTime"
|
|
|
|
+ type="date"
|
|
|
|
+ placeholder="选择日期"
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
+ style="width: 100%;"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row :gutter="10">
|
|
|
|
+ <el-col :span="8">
|
|
|
|
+ <el-form-item label="流量配额" prop="traffic" >
|
|
|
|
+ <el-input-number v-model="resourceForm.traffic" controls-position="right" disabled/>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="8">
|
|
|
|
+ <el-form-item label="充值配额" prop="trafficCharge" >
|
|
|
|
+ <el-input-number v-model="resourceForm.trafficCharge" controls-position="right" :min=0 />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="8">
|
|
|
|
+ <!-- 有效时间 时间选择器-->
|
|
|
|
+ <el-form-item label="有效时间" prop="trafficEffectiveTime" >
|
|
|
|
+ <el-date-picker
|
|
|
|
+ v-model="resourceForm.trafficEffectiveTime"
|
|
|
|
+ type="date"
|
|
|
|
+ placeholder="选择日期"
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
+ style="width: 100%;"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row :gutter="10">
|
|
|
|
+ <el-col :span="8">
|
|
|
|
+ <el-form-item label="坐席配额" prop="pad" >
|
|
|
|
+ <el-input-number v-model="resourceForm.pad" controls-position="right" disabled/>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="8">
|
|
|
|
+ <el-form-item label="充值配额" prop="padCharge" >
|
|
|
|
+ <el-input-number v-model="resourceForm.padCharge" controls-position="right" :min=0 />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="8">
|
|
|
|
+ <!-- 有效时间 时间选择器-->
|
|
|
|
+ <el-form-item label="有效时间" prop="padEffectiveTime" >
|
|
|
|
+ <el-date-picker
|
|
|
|
+ v-model="resourceForm.padEffectiveTime"
|
|
|
|
+ type="date"
|
|
|
|
+ placeholder="选择日期"
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
+ style="width: 100%;"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </el-form>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button type="primary" @click="submitResourceForm">确 定</el-button>
|
|
|
|
+ <el-button @click="cancelResource">取 消</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
|
|
<!-- 添加或修改部门对话框 -->
|
|
<!-- 添加或修改部门对话框 -->
|
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
|
@@ -156,6 +251,7 @@
|
|
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept";
|
|
import { listDept, getDept, delDept, addDept, updateDept, listDeptExcludeChild } from "@/api/system/dept";
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
+import { addOrEditDeptResource, getDeptResource } from '@/api/system/resourceManagement'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "Dept",
|
|
name: "Dept",
|
|
@@ -174,6 +270,10 @@ export default {
|
|
title: "",
|
|
title: "",
|
|
// 是否显示弹出层
|
|
// 是否显示弹出层
|
|
open: false,
|
|
open: false,
|
|
|
|
+ // 是否显示资源弹出层
|
|
|
|
+ openResource: false,
|
|
|
|
+ // 操作的部门名称
|
|
|
|
+ targetDeptName: "",
|
|
// 是否展开,默认全部展开
|
|
// 是否展开,默认全部展开
|
|
isExpandAll: true,
|
|
isExpandAll: true,
|
|
// 重新渲染表格状态
|
|
// 重新渲染表格状态
|
|
@@ -189,6 +289,8 @@ export default {
|
|
},
|
|
},
|
|
// 表单参数
|
|
// 表单参数
|
|
form: {},
|
|
form: {},
|
|
|
|
+ // 资源配置参数
|
|
|
|
+ resourceForm: {},
|
|
// 表单校验
|
|
// 表单校验
|
|
rules: {
|
|
rules: {
|
|
parentId: [
|
|
parentId: [
|
|
@@ -214,6 +316,18 @@ export default {
|
|
trigger: "blur"
|
|
trigger: "blur"
|
|
}
|
|
}
|
|
]
|
|
]
|
|
|
|
+ },
|
|
|
|
+ // 资源表单参数
|
|
|
|
+ resourceRules: {
|
|
|
|
+ red: [
|
|
|
|
+ { required: true, message: "红包配额不能为空", trigger: "blur" }
|
|
|
|
+ ],
|
|
|
|
+ traffic: [
|
|
|
|
+ { required: true, message: "流量配额不能为空", trigger: "blur" }
|
|
|
|
+ ],
|
|
|
|
+ pad: [
|
|
|
|
+ { required: true, message: "坐席配额不能为空", trigger: "blur" }
|
|
|
|
+ ]
|
|
}
|
|
}
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -223,6 +337,11 @@ export default {
|
|
this.statusOptions = response.data;
|
|
this.statusOptions = response.data;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ computed: {
|
|
|
|
+ isResource() {
|
|
|
|
+ return this.$store.state.user.medicalMallConfig?.isResource === '1' || false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
/** 查询部门列表 */
|
|
/** 查询部门列表 */
|
|
getList() {
|
|
getList() {
|
|
@@ -248,6 +367,11 @@ export default {
|
|
this.open = false;
|
|
this.open = false;
|
|
this.reset();
|
|
this.reset();
|
|
},
|
|
},
|
|
|
|
+ // 资源配置取消按钮
|
|
|
|
+ cancelResource() {
|
|
|
|
+ this.openResource = false;
|
|
|
|
+ this.resetResource();
|
|
|
|
+ },
|
|
// 表单重置
|
|
// 表单重置
|
|
reset() {
|
|
reset() {
|
|
this.form = {
|
|
this.form = {
|
|
@@ -262,6 +386,22 @@ export default {
|
|
};
|
|
};
|
|
this.resetForm("form");
|
|
this.resetForm("form");
|
|
},
|
|
},
|
|
|
|
+ // 表单重置
|
|
|
|
+ resetResource() {
|
|
|
|
+ this.resourceForm = {
|
|
|
|
+ id: undefined,
|
|
|
|
+ red: undefined,
|
|
|
|
+ redCharge: undefined,
|
|
|
|
+ redEffectiveTime: undefined,
|
|
|
|
+ pad: undefined,
|
|
|
|
+ padCharge: undefined,
|
|
|
|
+ padEffectiveTime: undefined,
|
|
|
|
+ traffic: undefined,
|
|
|
|
+ trafficCharge: undefined,
|
|
|
|
+ trafficEffectiveTime: undefined
|
|
|
|
+ };
|
|
|
|
+ this.resetForm("resourceForm");
|
|
|
|
+ },
|
|
/** 搜索按钮操作 */
|
|
/** 搜索按钮操作 */
|
|
handleQuery() {
|
|
handleQuery() {
|
|
this.getList();
|
|
this.getList();
|
|
@@ -303,6 +443,14 @@ export default {
|
|
this.deptOptions = this.handleTree(response.data, "deptId");
|
|
this.deptOptions = this.handleTree(response.data, "deptId");
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ /** 修改按钮操作 */
|
|
|
|
+ handleUpdateResource(row) {
|
|
|
|
+ this.resetResource();
|
|
|
|
+ getDeptResource(row.deptId).then(response => {
|
|
|
|
+ this.resourceForm = response.data;
|
|
|
|
+ this.openResource = true;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
/** 提交按钮 */
|
|
/** 提交按钮 */
|
|
submitForm: function() {
|
|
submitForm: function() {
|
|
this.$refs["form"].validate(valid => {
|
|
this.$refs["form"].validate(valid => {
|
|
@@ -323,6 +471,22 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ /** 资源配置提交*/
|
|
|
|
+ submitResourceForm: function() {
|
|
|
|
+ this.$refs["resourceForm"].validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ addOrEditDeptResource(this.resourceForm).then(response => {
|
|
|
|
+ if(response.code === 200 && response.data === true){
|
|
|
|
+ this.msgSuccess("修改成功");
|
|
|
|
+ this.openResource = false;
|
|
|
|
+ this.getList();
|
|
|
|
+ }else{
|
|
|
|
+ this.msgError(response.msg);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
/** 删除按钮操作 */
|
|
/** 删除按钮操作 */
|
|
handleDelete(row) {
|
|
handleDelete(row) {
|
|
this.$confirm('是否确认删除名称为"' + row.deptName + '"的数据项?', "警告", {
|
|
this.$confirm('是否确认删除名称为"' + row.deptName + '"的数据项?', "警告", {
|