|
|
@ -1,8 +1,8 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<Dialog title="任务转发" v-model="dialogVisible"> |
|
|
|
<Dialog title="任务转发" v-model="dialogVisible"> |
|
|
|
<el-form :model="form" label-width="auto" style="max-width: 600px"> |
|
|
|
<el-form :model="formData" label-width="auto" style="max-width: 600px"> |
|
|
|
<el-form-item label="转发用户" prop="name" style="max-width: 500px"> |
|
|
|
<el-form-item label="转发用户" prop="name" style="max-width: 500px"> |
|
|
|
<el-select v-model="form.resUserId" placeholder="请选择用户"> |
|
|
|
<el-select v-model="formData.userId" placeholder="请选择用户"> |
|
|
|
<el-option |
|
|
|
<el-option |
|
|
|
v-for="item in userList" |
|
|
|
v-for="item in userList" |
|
|
|
:key="item.id" |
|
|
|
:key="item.id" |
|
|
@ -32,7 +32,7 @@ const message = useMessage() // 消息弹窗 |
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示 |
|
|
|
const dialogVisible = ref(false) // 弹窗的是否展示 |
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
|
|
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 |
|
|
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
|
|
|
const formType = ref('') // 表单的类型:create - 新增;update - 修改 |
|
|
|
const formData = ref({ |
|
|
|
const changeForm = ref({ |
|
|
|
id: undefined, |
|
|
|
id: undefined, |
|
|
|
taskId: undefined, |
|
|
|
taskId: undefined, |
|
|
|
enterpriseId: undefined, |
|
|
|
enterpriseId: undefined, |
|
|
@ -51,7 +51,6 @@ const form = reactive({ |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
const formRef = ref() // 表单 Ref |
|
|
|
const formRef = ref() // 表单 Ref |
|
|
|
|
|
|
|
|
|
|
|
const dataValue = ref() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const userList = ref() |
|
|
|
const userList = ref() |
|
|
|
const getUserList = async () => { |
|
|
|
const getUserList = async () => { |
|
|
@ -59,39 +58,17 @@ const getUserList = async () => { |
|
|
|
userList.value = data |
|
|
|
userList.value = data |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const selectTask = async() => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const params = { |
|
|
|
|
|
|
|
'userId': form.resUserId, |
|
|
|
|
|
|
|
'taskName': taskName |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const data = await EnterpriseInspectionsApi.getListByUserIdAndTaskName(params) |
|
|
|
|
|
|
|
console.log('data==============>', data) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const formData:any = ref({ |
|
|
|
|
|
|
|
userId: undefined, |
|
|
|
|
|
|
|
inspectionsId: [] |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
/** 打开弹窗 */ |
|
|
|
/** 打开弹窗 */ |
|
|
|
const open = async (data) => { |
|
|
|
const open = async (inspectionsId) => { |
|
|
|
|
|
|
|
|
|
|
|
dialogVisible.value = true |
|
|
|
dialogVisible.value = true |
|
|
|
dataValue.value = data |
|
|
|
formData.value.inspectionsId.push(inspectionsId) |
|
|
|
|
|
|
|
|
|
|
|
getUserList() |
|
|
|
getUserList() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // 修改时,设置数据 |
|
|
|
|
|
|
|
// if (id) { |
|
|
|
|
|
|
|
// formLoading.value = true |
|
|
|
|
|
|
|
// try { |
|
|
|
|
|
|
|
// formData.value = await EnterpriseInspectionsApi.getEnterpriseInspections(id) |
|
|
|
|
|
|
|
// } finally { |
|
|
|
|
|
|
|
// formLoading.value = false |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
|
|
|
|
|
|
|
|
@ -99,18 +76,14 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 |
|
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
|
|
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调 |
|
|
|
const submitForm = async () => { |
|
|
|
const submitForm = async () => { |
|
|
|
// 校验表单 |
|
|
|
// 校验表单 |
|
|
|
await formRef.value.validate() |
|
|
|
// await formRef.value.validate() |
|
|
|
// 提交请求 |
|
|
|
// 提交请求 |
|
|
|
formLoading.value = true |
|
|
|
formLoading.value = true |
|
|
|
try { |
|
|
|
try { |
|
|
|
const data = formData.value as unknown as EnterpriseInspectionsVO |
|
|
|
|
|
|
|
if (formType.value === 'create') { |
|
|
|
await EnterpriseInspectionsApi.passOn(formData.value) |
|
|
|
await EnterpriseInspectionsApi.createEnterpriseInspections(data) |
|
|
|
message.success(t('更改成功')) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
await EnterpriseInspectionsApi.updateEnterpriseInspections(data) |
|
|
|
|
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
dialogVisible.value = false |
|
|
|
dialogVisible.value = false |
|
|
|
// 发送操作成功的事件 |
|
|
|
// 发送操作成功的事件 |
|
|
|
emit('success') |
|
|
|
emit('success') |
|
|
|