Commit 6b45bc41 authored by 祁正's avatar 祁正

通知单管理-新增加组件

parent d8ec5b9f
...@@ -59,3 +59,12 @@ export function getPersonnelInfoByIdsInfoByIds(ids) { ...@@ -59,3 +59,12 @@ export function getPersonnelInfoByIdsInfoByIds(ids) {
method: 'get' method: 'get'
}) })
} }
// 根据id修改认证负责人
export function updateCertificationManager(data) {
return request({
url: '/control/notificationManagement/updateCertificationManager',
method: 'put',
data:data
})
}
...@@ -298,7 +298,19 @@ ...@@ -298,7 +298,19 @@
<el-row > <el-row >
<el-col :offset="1" :span="17"> <el-col :offset="1" :span="17">
<el-form-item label="批准人" prop="approvalPerson"> <el-form-item label="批准人" prop="approvalPerson">
<el-input disabled v-model="drawerQueryParams.approvalPerson"></el-input> <el-select
disabled
placement="bottom"
v-model="drawerQueryParams.approvalPerson"
placeholder="请选择批准人"
clearable
>
<el-option
v-for="dict in allUserList"
:label="dict.nickName"
:value="dict.userId"
/>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -310,7 +322,20 @@ ...@@ -310,7 +322,20 @@
<el-row > <el-row >
<el-col :offset="1" :span="17"> <el-col :offset="1" :span="17">
<el-form-item label="认证负责人" prop="certificationResponsiblePerson"> <el-form-item label="认证负责人" prop="certificationResponsiblePerson">
<el-input disabled v-model="drawerQueryParams.certificationResponsiblePerson"></el-input> <el-select
disabled
multiple
placement="bottom"
v-model="drawerQueryParams.certificationResponsiblePerson"
placeholder="请选择认证负责人"
clearable
>
<el-option
v-for="dict in allUserList"
:label="dict.nickName"
:value="dict.userId"
/>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
...@@ -369,9 +394,20 @@ ...@@ -369,9 +394,20 @@
</template> </template>
<script setup> <script setup>
import SelectRole from "@/components/SelectRole/index.vue" import SelectRole from "@/components/SelectRole/index.vue"
import {getUnitList,brandData,getALLManufacturerList,getAllModelCode,getALLUserList,insert,list,getPersonnelInfoByIdsInfoByIds} from "@/api/notificationManagement/list.js" import {
import { ref } from "vue"; brandData,
import { ElMessage } from 'element-plus' getALLManufacturerList,
getAllModelCode,
getALLUserList,
getPersonnelInfoByIdsInfoByIds,
getUnitList,
insert,
list,
updateCertificationManager
} from "@/api/notificationManagement/list.js"
import {ref} from "vue";
import {ElMessage} from 'element-plus'
const allUserList = ref([])
const personTableList = ref([]) const personTableList = ref([])
const { proxy } = getCurrentInstance(); const { proxy } = getCurrentInstance();
const { certification_body const { certification_body
...@@ -386,8 +422,8 @@ const tableList =ref([]) ...@@ -386,8 +422,8 @@ const tableList =ref([])
const modelCodeList = ref([]) const modelCodeList = ref([])
const dialogVisible = ref(false) const dialogVisible = ref(false)
const dialogTitle = ref('') const dialogTitle = ref('')
//临时打开的认证负责人 //临时打开认证负责人对话框的临时对象
const tPersonListStr = ref('') const tObj = ref({})
//人员选择数据 //人员选择数据
const userList = ref([]) const userList = ref([])
const selectRole = ref(false) //组件控制,默认关闭 const selectRole = ref(false) //组件控制,默认关闭
...@@ -441,9 +477,14 @@ const rules = ref({ ...@@ -441,9 +477,14 @@ const rules = ref({
] ]
}); });
//新增确定
function confirmClick(formRef) { function confirmClick(formRef) {
drawerQueryRef.value.validate((valid) => { drawerQueryRef.value.validate((valid) => {
if (valid) { if (valid) {
drawerQueryParams.value.certificationResponsiblePerson = drawerQueryParams.value.certificationResponsiblePerson.join(",")
console.log(drawerQueryParams.value)
insert(drawerQueryParams.value).then(res=>{ insert(drawerQueryParams.value).then(res=>{
console.log("新增结果",res) console.log("新增结果",res)
if(res.code === 200){ if(res.code === 200){
...@@ -476,13 +517,20 @@ function getDictList(v){ ...@@ -476,13 +517,20 @@ function getDictList(v){
//添加人员关闭对话框 //添加人员关闭对话框
const beforeClose = (done) => { const beforeClose = (done) => {
// 这里可以添加关闭前的确认逻辑,例如询问用户是否确认关闭
// 如果确认关闭,调用 done() 函数
done(); done();
tObj.value = {}
queryParams.value = {
pageNum: 1,
pageSize: 10
};
drawerQueryRef.value.resetFields()
getList()
}; };
function addPerson(row){ function addPerson(row){
console.log(row) console.log(row)
tObj.value.id = row.id
dialogTitle.value = '维护需求人('+row.notificationNumber+' -'+row.businessUnitName+'-'+row.vehicleModelCode+')'; dialogTitle.value = '维护需求人('+row.notificationNumber+' -'+row.businessUnitName+'-'+row.vehicleModelCode+')';
dialogVisible.value = true dialogVisible.value = true
...@@ -500,8 +548,20 @@ function getBrandDataList(){ ...@@ -500,8 +548,20 @@ function getBrandDataList(){
} }
function remove(row){ function remove(row){
console.log(row) let arr = personTableList.value.filter(item=>item.userId !== row.userId)
tObj.value.endArrStr = arr.map(item => {
return item.userId
}).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
})
}
})
} }
function onChange(){ function onChange(){
...@@ -565,14 +625,36 @@ function cancelClick(){ ...@@ -565,14 +625,36 @@ function cancelClick(){
//提交方法 //提交方法
const handleSelectionSubmit = (selectedItems) => { const handleSelectionSubmit = (selectedItems) => {
console.log('已选中的项:', selectedItems); // 处理已选择的用户 const t = toRaw(selectedItems)
console.log('已选中的项:', t); // 处理已选择的用户
if(selectType.value === 'single'){
//单选 approvalPerson
drawerQueryParams.value.approvalPerson = t[0].userId
}else{
//多选 certificationResponsiblePerson
drawerQueryParams.value.certificationResponsiblePerson = t.map(item => {
return item.userId
})
}
}; };
//获取所有人员 //获取所有人员
function getALLUserDeptList(){ function getALLUserDeptList(){
getALLUserList().then(res=>{ getALLUserList().then(res=>{
userList.value = res.data userList.value = res.data
console.log(res.data)
let list = res.data
// 提取所有用户的昵称和id
for(let i in list){
let list2 = list[i].nickName
for(let i2 in list2){
allUserList.value.push(list2[i2])
}
}
console.log("123",allUserList.value)
}) })
} }
getList() getList()
getALLUserDeptList() getALLUserDeptList()
......
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