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;