Commit dabb2d32 authored by 祁正's avatar 祁正

通知单管理-编辑新增

parent 52b626fa
...@@ -379,7 +379,7 @@ ...@@ -379,7 +379,7 @@
:before-close="beforeClose" :before-close="beforeClose"
> >
<div> <div>
<el-button type="primary" class="btn-C">添加人员</el-button> <el-button type="primary" @click="editPersonAdd" class="btn-C">添加人员</el-button>
<el-table style="margin-top: 20px" :data="personTableList"> <el-table style="margin-top: 20px" :data="personTableList">
<el-table-column type="index" width="55" align="center" label="序号"/> <el-table-column type="index" width="55" align="center" label="序号"/>
<el-table-column label="人员" align="center" prop="userName" /> <el-table-column label="人员" align="center" prop="userName" />
...@@ -426,7 +426,10 @@ const undoDialogVisible = ref(false) ...@@ -426,7 +426,10 @@ const undoDialogVisible = ref(false)
const personTableList = ref([]) const personTableList = ref([])
// 获取当前组件实例的代理对象,用于访问全局属性和方法 // 获取当前组件实例的代理对象,用于访问全局属性和方法
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const tObj = ref({}) const tObj = ref({
id:null,
endArrStr:null
})
const dialogTitle = ref('') const dialogTitle = ref('')
const dialogVisible = ref(false) const dialogVisible = ref(false)
const Prompt = ref('') const Prompt = ref('')
...@@ -479,6 +482,10 @@ const queryParams = ref({ ...@@ -479,6 +482,10 @@ const queryParams = ref({
number: "" number: ""
}); });
function editPersonAdd(){
openDialog()
}
function addNotifiction(){ function addNotifiction(){
drawer.value = true drawer.value = true
getALLModelCodeList() getALLModelCodeList()
...@@ -559,7 +566,7 @@ const beforeClose = (done) => { ...@@ -559,7 +566,7 @@ const beforeClose = (done) => {
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}; };
drawerQueryRef.value.resetFields()
getList() getList()
}; };
...@@ -605,7 +612,7 @@ function getBrandDataList(){ ...@@ -605,7 +612,7 @@ function getBrandDataList(){
brandList.value = res.rows brandList.value = res.rows
}) })
} }
//移除
function remove(row){ function remove(row){
let arr = personTableList.value.filter(item=>item.userId !== row.userId) let arr = personTableList.value.filter(item=>item.userId !== row.userId)
tObj.value.endArrStr = arr.map(item => { tObj.value.endArrStr = arr.map(item => {
...@@ -686,6 +693,28 @@ function cancelClick(){ ...@@ -686,6 +693,28 @@ function cancelClick(){
const handleSelectionSubmit = (selectedItems) => { const handleSelectionSubmit = (selectedItems) => {
const t = toRaw(selectedItems) const t = toRaw(selectedItems)
console.log('已选中的项:', t); // 处理已选择的用户 console.log('已选中的项:', t); // 处理已选择的用户
if(dialogVisible.value){
//添加人员-编辑人员对话框的时候-多选
// 简化箭头函数
const list = t.map(item => item.userId);
const yuanList = personTableList.value.map(item => item.userId);
// 去重处理
const combinedArray = [...new Set([...yuanList, ...list])];
tObj.value.endArrStr = combinedArray.join(",");
updateCertificationManager(tObj.value).then(res=>{
console.log(res)
if(res.code === 200){
ElMessage.success("添加成功")
getPersonnelInfoByIdsInfoByIds(tObj.value.endArrStr).then(res=>{
console.log(res)
personTableList.value = res.data
})
}
})
}else {
//新增的时候
if(selectType.value === 'single'){ if(selectType.value === 'single'){
//单选 approvalPerson //单选 approvalPerson
drawerQueryParams.value.approvalPerson = t[0].userId drawerQueryParams.value.approvalPerson = t[0].userId
...@@ -695,6 +724,8 @@ const handleSelectionSubmit = (selectedItems) => { ...@@ -695,6 +724,8 @@ const handleSelectionSubmit = (selectedItems) => {
return item.userId return item.userId
}) })
} }
}
}; };
//获取所有人员 //获取所有人员
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment