From a145a2a4892bd9fc108d24eb2c0552866676876a Mon Sep 17 00:00:00 2001 From: glj <13935964706@163.com> Date: Tue, 16 Jul 2024 14:13:52 +0800 Subject: [PATCH] =?UTF-8?q?glj-=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../responding/component/selectUserNew.vue | 52 ++++++++++++++----- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/src/views/responseManagement/responding/component/selectUserNew.vue b/src/views/responseManagement/responding/component/selectUserNew.vue index 98e1d11..e062fc6 100644 --- a/src/views/responseManagement/responding/component/selectUserNew.vue +++ b/src/views/responseManagement/responding/component/selectUserNew.vue @@ -42,6 +42,12 @@ + + + import { ElMessage } from 'element-plus'; -import { detailByDisasterInfoId, getUserList, submitNew } from '/@/api/disasterInfo/index'; +import { detailByDisasterInfoId, getUserList, submitNew, submit } from '/@/api/disasterInfo/index'; import { getAdminPage } from '/@/api/response/administrator.js'; import { ref, reactive, onMounted } from 'vue'; import { useThemeConfig } from '/@/stores/themeConfig'; @@ -109,7 +115,7 @@ const state = reactive({ selectData: [], }); const selectRow = (row) => { - state.data = row; + state.selectData = row; }; // 打开弹窗 const openDialog = (row) => { @@ -117,6 +123,7 @@ const openDialog = (row) => { state.rowData = row; state.isShowDialog = true; getTableDataNew(); + state.selectData = []; }; const save = async () => { //选中小于1条 提示 @@ -129,16 +136,27 @@ const save = async () => { ElMessage.error('Please select only one user'); return; } - let params = { - id: state.rowData.disasterId, - adminId: state.selectData[0].userId, - adminName: state.selectData[0].userName, - allocation: 'YES', - }; - console.log(params,"paramsparamsparamsparams"); - let res = await submitNew(params).then((da) => { - ElMessage.success('success'); - }); + if (state.selectData[0].roleId == '1793193529859244033') { + let params = { + id: state.rowData.disasterId, + chiefId: state.selectData[0].userId, + chiefName: state.selectData[0].userName, + allocation: 'YES', + }; + let res = await submit(params).then((da) => { + ElMessage.success('success'); + }); + } else { + let params = { + id: state.rowData.disasterId, + adminId: state.selectData[0].userId, + adminName: state.selectData[0].userName, + allocation: 'YES', + }; + let res = await submitNew(params).then((da) => { + ElMessage.success('success'); + }); + } emit('callback'); closeDialog(); }; @@ -151,10 +169,16 @@ const getTableData = async () => { let res = await getAdminPage( state.tableData.param.pageNum, state.tableData.param.pageSize, - { name_like: state.tableData.query.name, roleId: '1123598816738675203' }, + { name_like: state.tableData.query.name }, website.value.tenantId ); - state.tableData.data = res.records; + let userData = []; + res.records.forEach((item) => { + if (item.roleId == '1123598816738675203' || item.roleId == '1793193529859244033') { + userData.push(item); + } + }); + state.tableData.data = userData; state.tableData.data.forEach((item) => { item.userId = item.id; item.userName = item.name;