服务包配置和用户添加科室

This commit is contained in:
闫晓茹 2024-03-05 17:26:23 +08:00
parent b8d5456e62
commit f61b11cea4
3 changed files with 383 additions and 72 deletions

View File

@ -18,6 +18,15 @@ export function selectUserAgencyleft(query) {
}) })
} }
export function selectUserDepartment(query) {
return request({
url: '/system/user/selectUserDepartment',
method: 'get',
params: query
})
}
export function selectUserAgency(userName) { export function selectUserAgency(userName) {
return request({ return request({
url: `/system/user/selectUserBelongAgency?userName=${userName}`, url: `/system/user/selectUserBelongAgency?userName=${userName}`,
@ -25,6 +34,14 @@ export function selectUserAgency(userName) {
}) })
} }
export function getBelongDepartment(userName) {
return request({
url: `/system/user/getBelongDepartment?userName=${userName}`,
method: 'get',
})
}
// /system/user/selectUserAgency 这个是右边的接口,传值不变 // /system/user/selectUserAgency 这个是右边的接口,传值不变
// 查询用户详细 // 查询用户详细
export function getUser(userId) { export function getUser(userId) {
@ -46,8 +63,15 @@ export function addUser(data) {
// 修改用户 // 修改用户
export function updateUser(data) { export function updateUser(data) {
return request({ return request({
url: '/system/user', url: '/system/user/editAgency',
method: 'put', method: 'post',
data: data
})
}
export function editDepartment(data) {
return request({
url: '/system/user/editDepartment',
method: 'post',
data: data data: data
}) })
} }

View File

@ -225,8 +225,9 @@
label="服务频次" label="服务频次"
align="center" align="center"
prop="serviceWayFrequencyList" prop="serviceWayFrequencyList"
:key="keyTable"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<!-- <div <!-- <div
v-for="(itemx, index) in scope.row.serviceWayFrequencyList" v-for="(itemx, index) in scope.row.serviceWayFrequencyList"
:key="index" :key="index"
@ -235,9 +236,9 @@
<el-select <el-select
size="mini" size="mini"
@click="getSuppliers()" @click="getSuppliers()"
@change="blurInputs(scope.row.serviceFrequencyText)" @change="blurInputs()"
v-model="scope.row.serviceFrequencyText" v-model="scope.row.valuePlusMax"
clearable clearable
placeholder="请选择" placeholder="请选择"
> >
@ -251,27 +252,21 @@
</el-select> </el-select>
</div> </div>
<div v-if="scope.row.serviceWayFrequencyList[0].serviceFrequencyType == 'DIGIT'"> <div v-if="scope.row.serviceWayFrequencyList[0].serviceFrequencyType == 'DIGIT'">
<!-- itemx.serviceFrequencyStart +
'~' +
itemx.serviceFrequencyEnd
-->
<!-- 对吗我看看 -->
<el-select <el-select
size="mini" size="mini"
@click="getSuppliers()" @click="getSuppliers()"
@change="blurInput(scope.row.serviceFrequencyText)" @change="blurInputs(scope.row.valuePlusMax)"
v-model="scope.row.serviceFrequencyText" v-model="scope.row.valuePlusMax"
clearable clearable
placeholder="请选择" placeholder="请选择"
> >
<!-- @change="blurInput(itemx)" -->
<!-- 你看一下 整理一下代码 label里面就是展示的值 value是选中的 因为你这的value是拼接的 所以上面的v-mode里面存的就是拼劲明白了我自己改改 --> <!-- label里面就是展示的值 value是选中的 value是拼接的 这里处理一下为null的情况 为null咋显示呀以后应该不会有null 是必填的 那就先不用管了好-->
<el-option <el-option
v-for="item in scope.row.serviceWayFrequencyList" v-for="item in scope.row.serviceWayFrequencyList"
:key="item.id" :key="item.id"
:label=" JSON.parse(item.serviceFrequencyStart) + :label="JSON.parse(item.serviceFrequencyStart) +
'~' + '~' +
JSON.parse(item.serviceFrequencyEnd)" JSON.parse(item.serviceFrequencyEnd)"
:value=" :value="
@ -454,7 +449,6 @@ export default {
list: [], list: [],
serviceFrequencyStart: "", serviceFrequencyStart: "",
serviceFrequencyEnd: "", serviceFrequencyEnd: "",
serviceFrequencyText: "",
serviceFrequencyType: "", serviceFrequencyType: "",
// disabled: "", // disabled: "",
titles: "", titles: "",
@ -512,6 +506,12 @@ export default {
serviceFrequencyType: [ serviceFrequencyType: [
{ required: true, message: "请选中服务频次", trigger: "blur" }, { required: true, message: "请选中服务频次", trigger: "blur" },
], ],
// serviceFrequencyStart:[
// { required: true, message: "", trigger: "blur" },
// ],
// serviceFrequencyEnd:[
// { required: true, message: "", trigger: "blur" },
// ],
}, },
itemname: null, itemname: null,
querydepartmen: { querydepartmen: {
@ -521,6 +521,8 @@ export default {
disabledb: false, disabledb: false,
disableda: false, disableda: false,
valuePlus:'', valuePlus:'',
serviceFrequencyText:'',
keyTable:'',
}; };
}, },
watch: { watch: {
@ -538,11 +540,13 @@ export default {
console.log(e); console.log(e);
}, },
blurInput(val) { blurInput(val) {
console.log(val, "555"); // this.servicewaycontentList.serviceFrequencyText=val
}, },
blurInputs(val) { blurInputs() {
console.log(val, "666"); this.keyTable = Math.random()
this.form.id = val; // console.log(val, "666");
// this.form.id = val;
}, },
textlist(e) { textlist(e) {
if (e == true) { if (e == true) {
@ -631,10 +635,31 @@ export default {
this.loading = true; this.loading = true;
listServicewaycontent(this.queryParams).then((response) => { listServicewaycontent(this.queryParams).then((response) => {
this.servicewaycontentList = response.rows; this.servicewaycontentList = response.rows;
// this.serviceFrequencyText= this.servicewaycontentList[0].serviceFrequencyText
console.log(this.servicewaycontentList,'****')
// if(e.serviceWayFrequencyList[0].serviceFrequencyType == 'TEXT'){
this.servicewaycontentList.forEach((e) => { this.servicewaycontentList.forEach((e) => {
this.serviceFrequencyType = e.serviceFrequencyType; e.valuePlusMax = e.serviceWayFrequencyList[0].id
}); });
// }
// if(e.serviceWayFrequencyList[0].serviceFrequencyType == 'DIGIT'){
// e.serviceFrequencyText = JSON.parse(e.serviceWayFrequencyList[0].serviceFrequencyStart) +
// '~' +
// JSON.parse(e.serviceWayFrequencyList[0].serviceFrequencyEnd)
// }
// e.serviceWayFrequencyList[0].forEach(el=>{
// console.log(el)
// // this.serviceFrequencyText = el.serviceFrequencyText;
// })
// this.serviceFrequencyText= this.servicewaycontentList[0].serviceFrequencyText
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
@ -692,20 +717,12 @@ export default {
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset();
console.log(row,'99999'); console.log(row,'99999');
this.reset();
// const id = row.id // const id = row.id
getServicewaycontent(row.valuePlusMax).then((response) => {
// --------------
if(!this.form.id){
row.serviceWayFrequencyList.forEach((e) => {
this.form.id = e.id;
});
}
getServicewaycontent(this.form.id).then((response) => {
this.form = response.data; this.form = response.data;
this.form.id = response.data.serviceFrequencyId; // this.form.id = response.data.serviceFrequencyId;
// ---------- // ----------
if (response.data.serviceFrequencyType == "DIGIT") { if (response.data.serviceFrequencyType == "DIGIT") {

View File

@ -254,11 +254,19 @@
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-mobile"
@click="handleinnerVisibleshow(scope.row)" @click="handleinnerVisibleshow(scope.row)"
v-hasPermi="['system:user:edit']" v-hasPermi="['system:user:edit']"
>设置机构</el-button >设置机构</el-button
> >
<el-button
size="mini"
type="text"
icon="el-icon-star-on"
@click="handleinnerVisibleshowdep(scope.row)"
v-hasPermi="['system:user:edit']"
>设置科室</el-button
>
<el-button <el-button
size="mini" size="mini"
@ -559,10 +567,9 @@
ref="multipleTable" ref="multipleTable"
:data="tableData1" :data="tableData1"
height="300" height="300"
tooltip-effect="dark" tooltip-effect="dark"
style="width: 100%" style="width: 100%"
@selection-change="handleSelectionChangen" @selection-change="handleSelectionChangenleft"
class="el-table-dialog" class="el-table-dialog"
row-key="id" row-key="id"
> >
@ -661,7 +668,146 @@
:data="datalist"> :data="datalist">
</el-transfer> --> </el-transfer> -->
</el-dialog> </el-dialog>
<!-- 设置科室 -->
<el-dialog
:title="title"
:visible.sync="innerVisibleshowdep"
width="1200px"
>
<el-row :gutter="20">
<el-col :span="10">
<div class="table-title">
<span v-if="departmentNum">可设置科室:{{ departmentNum }}</span>
<span v-else>可设置科室:0条</span>
</div>
<div style="margin-top: 3%">
<el-form
ref="queryForm"
:model="formmatdep"
:rules="rules"
label-width="80px"
:inline="true"
>
<el-form-item
label="科室名称"
prop="departmentName"
label-width="120"
>
<el-input
v-model="formmatdep.departmentName"
placeholder="请输入科室名称"
clearable
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="infodep"
>搜索</el-button
>
<el-button
icon="el-icon-refresh"
size="mini"
@click="addresetQuerylistdep"
>重置</el-button
>
</el-form-item>
</el-form>
</div>
<!-- 穿梭框左边 -->
<el-table
ref="multipleTabledep"
:data="tableDatadep1"
height="300"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChangendep"
class="el-table-dialog"
row-key="id"
>
<el-table-column type="selection" width="55" align="center">
</el-table-column>
<!-- <el-table-column type="index" label="序号" align="center">
</el-table-column> -->
<el-table-column label="机构名称" align="center">
<template slot-scope="{ row }">
<span>{{ row.departmentName }}</span>
</template>
</el-table-column>
<el-table-column label="机构编码" align="center">
<template slot-scope="{ row }">
<span>{{ row.departmentCode }}</span>
</template>
</el-table-column>
</el-table>
<pagination
:total="totalagdep"
:page.sync="formmatdep.pageNum"
:limit.sync="formmatdep.pageSize"
@pagination="infodep"
/>
</el-col>
<el-col :span="4" class="el-btn-dialog">
<el-button
@click="leftcontentdep"
type="primary"
:disabled="nowSelectRightDatadep.length ? false : true"
icon="el-icon-arrow-left"
style="margin-left: 0; margin-top: 10px"
></el-button>
<el-button
@click="rightcontentdep()"
type="primary"
:disabled="nowSelectDatadep.length ? false : true"
icon="el-icon-arrow-right"
></el-button>
</el-col>
<el-col :span="10">
<div class="table-title">
<span v-if="departmentNums != ''"
>已设置科室:{{ departmentNums }}</span
>
<span v-else>已设置科室:0条</span>
</div>
<!-- 穿梭框右边 -->
<div style="margin-top: 5%">
<el-table
ref="multipleTablesdep"
:data="tableDatadep2"
max-height="300"
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChangenrightdep"
row-key="id"
class="el-table-dialog"
>
<el-table-column
type="selection"
width="55"
align="center"
></el-table-column>
<!-- <el-table-column type="index" label="序号" align="center">
</el-table-column> -->
<el-table-column label="机构名称" align="center" width="110">
<template slot-scope="{ row }">
<span>{{ row.departmentName }}</span>
</template>
</el-table-column>
<el-table-column label="机构编码" align="center">
<template slot-scope="{ row }">
<span>{{ row.departmentCode }}</span>
</template>
</el-table-column>
</el-table>
</div>
</el-col>
</el-row>
</el-dialog>
<!-- 用户导入对话框 --> <!-- 用户导入对话框 -->
<el-dialog <el-dialog
:title="upload.title" :title="upload.title"
@ -713,10 +859,13 @@ import {
delUser, delUser,
addUser, addUser,
updateUser, updateUser,
editDepartment,
resetUserPwd, resetUserPwd,
selectUserAgency, selectUserAgency,
changeUserStatus, changeUserStatus,
selectUserAgencyleft, selectUserAgencyleft,
selectUserDepartment,
getBelongDepartment,
} from "@/api/system/user"; } from "@/api/system/user";
import { getToken } from "@/utils/auth"; import { getToken } from "@/utils/auth";
import { treeselect } from "@/api/system/dept"; import { treeselect } from "@/api/system/dept";
@ -733,18 +882,33 @@ export default {
formmat: { formmat: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
agencyName: '', agencyName: "",
userId: '', userId: "",
},
formmatdep: {
pageNum: 1,
pageSize: 10,
departmentName: "",
userId: "",
}, },
totalag2: 0, totalag2: 0,
totalagdep: 0,
agencyNum: "", agencyNum: "",
belongAgencyNum: "", belongAgencyNum: "",
departmentNum: "",
departmentNums: "",
tableDatadep1: [],
tableDatadep2: [],
tableData1: [], tableData1: [],
tableData2: [], tableData2: [],
nowSelectDatadep: [], //
nowSelectRightDatadep: [], //
nowSelectRightData: [],
nowSelectData: [], // nowSelectData: [], //
nowSelectRightData: [], //
innerVisibleshow: false, innerVisibleshow: false,
innerVisibleshowdep: false,
// //
loading: true, loading: true,
// //
@ -811,6 +975,16 @@ export default {
agencyId: "", agencyId: "",
userName: "", userName: "",
}, },
formlistdep: {
userId: "",
departmentId: "",
userName: "",
},
formlistdeps: {
userId: "",
departmentId: "",
userName: "",
},
formlists: { formlists: {
userId: "", userId: "",
agencyId: "", agencyId: "",
@ -882,29 +1056,54 @@ export default {
}); });
}, },
methods: { methods: {
// // //
handleSelectionChangen(selection) { handleSelectionChangendep(selection) {
// console.log(selection, "56"); if (selection.length > 1) {
// this.abc=selection this.$refs.multipleTabledep.clearselection(); //
// console.log(data,"9"); this.$refs.multipleTabledep.toggleRowSelection(selection.pop()); //
// this.selection=[]
if (selection.length >1) {
this.$refs.multipleTable.clearSelection(); //
this.$refs.multipleTable.toggleRowSelection(selection.pop()); //
} }
this.nowSelectDatadep = selection;
this.formlistdep.departmentId = selection[0].departmentId;
console.log(this.formlistdep, " this.formlistdep");
},
// //
handleSelectionChangenrightdep(selection) {
console.log(selection, "56888");
if (selection.length > 1) {
this.$refs.multipleTablesdep.clearselection(); //
this.$refs.multipleTablesdep.toggleRowSelection(selection.pop()); //
}
this.nowSelectRightDatadep = selection;
// this.nowSelectData=[]
},
addresetQuerylist() {
this.formmat.agencyName = "";
this.info();
},
addresetQuerylistdep() {
this.formmatdep.departmentName = "";
this.infodep();
},
//
handleSelectionChangenleft(selection) {
this.$nextTick(() => {
console.log(
this.$refs.multipleTable.clearSelection,
"555555555888888888"
);
if (selection.length > 1) {
this.$refs.multipleTable.clearSelection(); //
this.$refs.multipleTable.toggleRowSelection(selection.pop()); //
}
});
this.nowSelectData = selection; this.nowSelectData = selection;
// if( this.formlist.agencyId){
this.formlist.agencyId = selection[0].agencyId; this.formlist.agencyId = selection[0].agencyId;
// this.nowSelectRightData=[]
// this.formlist.agencyCode = selection[0].agencyCode;
// console.log(this.formlist.agencyId, "99999999");
// console.log(selection, "7474");
// }
}, },
// //
handleSelectionChangenright(selection) { handleSelectionChangenright(selection) {
console.log(selection, "56888"); console.log(selection, "56888");
@ -919,10 +1118,37 @@ export default {
this.formmat.agencyName = ""; this.formmat.agencyName = "";
this.info(); this.info();
}, },
// //
rightcontentdep() {
// console.log("78798",this.abc);
console.log(this.tableDatadep2, "85");
if (this.tableDatadep2.length == 1) {
this.$message.error("只能选择一个科室");
} else {
editDepartment(this.formlistdep).then((response) => {
if (response.code == 200) {
this.infodep();
this.infodep2();
}
});
}
},
//
leftcontentdep() {
console.log(this.formlistdeps, "4578");
this.formlistdeps.departmentId = "";
editDepartment(this.formlistdeps).then((response) => {
if (response.code == 200) {
console.log(response.code);
this.infodep();
this.infodep2();
}
});
},
//
rightcontent() { rightcontent() {
// console.log("78798",this.abc); // console.log("78798",this.abc);
console.log(this.tableData2,'85') console.log(this.tableData2, "85");
if (this.tableData2.length == 1) { if (this.tableData2.length == 1) {
this.$message.error("只能选择一个机构"); this.$message.error("只能选择一个机构");
} else { } else {
@ -934,12 +1160,13 @@ export default {
}); });
} }
}, },
// //
leftcontent() { leftcontent() {
console.log(this.formlists,'4578') console.log(this.formlists, "4578");
updateUser(this.formlists).then((response) => { updateUser(this.formlists).then((response) => {
if (response.code == 200) { if (response.code == 200) {
console.log(response.code) console.log(response.code);
this.info(); this.info();
this.info2(); this.info2();
} }
@ -1039,6 +1266,7 @@ export default {
}, },
// //
handleSelectionChange(selection) { handleSelectionChange(selection) {
console.log(selection);
this.ids = selection.map((item) => item.userId); this.ids = selection.map((item) => item.userId);
this.single = selection.length != 1; this.single = selection.length != 1;
this.multiple = !selection.length; this.multiple = !selection.length;
@ -1068,25 +1296,42 @@ export default {
this.form.password = this.initPassword; this.form.password = this.initPassword;
}); });
}, },
infodep() {
console.log(this.formmatdep);
selectUserDepartment(this.formmatdep).then((res) => {
this.tableDatadep1 = res.rows;
if (res.rows.length > 0) {
this.departmentNum = res.rows[0].departmentNum;
} else {
this.departmentNum = 0;
}
this.totalagdep = res.total;
});
},
//
info() { info() {
console.log(this.formmat); console.log(this.formmat);
selectUserAgencyleft(this.formmat).then((res) => { selectUserAgencyleft(this.formmat).then((res) => {
// console.log(res)
// if(res.rows){
// this.tableData1 = res.rows;
// }else{
// this.tableData1 =[]
// }
this.tableData1 = res.rows; this.tableData1 = res.rows;
if (res.rows.length > 0) { if (res.rows.length > 0) {
this.agencyNum = res.rows[0].agencyNum; this.agencyNum = res.rows[0].agencyNum;
}else{ } else {
this.agencyNum=0 this.agencyNum = 0;
} }
this.totalag = res.total; this.totalag = res.total;
}); });
}, },
infodep2() {
getBelongDepartment(this.userName).then((res) => {
this.tableDatadep2 = res.rows;
if (res.rows.length > 0) {
this.departmentNums = res.rows[0].departmentNum;
} else {
this.departmentNums = 0;
}
});
},
info2() { info2() {
selectUserAgency(this.userName).then((res) => { selectUserAgency(this.userName).then((res) => {
// console.log(res,"/////////"); // console.log(res,"/////////");
@ -1094,9 +1339,8 @@ export default {
this.tableData2 = res.rows; this.tableData2 = res.rows;
if (res.rows.length > 0) { if (res.rows.length > 0) {
this.belongAgencyNum = res.rows[0].agencyNum; this.belongAgencyNum = res.rows[0].agencyNum;
}else{ } else {
this.belongAgencyNum=0 this.belongAgencyNum = 0;
} }
}); });
}, },
@ -1122,6 +1366,32 @@ export default {
// this.belongAgencyNum = res.data.belongAgencyNum; // this.belongAgencyNum = res.data.belongAgencyNum;
// }); // });
}, },
handleinnerVisibleshowdep(row) {
this.reset();
console.log(row);
this.title = "设置科室";
selectUserAgency(row.userName).then((res) => {
this.tableData2 = res.rows;
// console.log(this.tableData2,'55899999')
if (this.tableData2.length < 1) {
this.$message.error("当前无科室,请先设置机构");
} else {
this.innerVisibleshowdep = true;
this.userName = row.userName;
this.formlistdep.userId = row.userId;
this.formlistdep.userName = row.userName;
console.log(this.formlistdep, "this.formlistdep");
this.formlistdeps.userId = row.userId;
this.formlistdeps.userName = row.userName;
this.formmatdep.userName = row.userName;
// console.log(this.formmat.userId, "898");
this.infodep();
this.infodep2();
}
});
},
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset(); this.reset();