diff --git a/src/views/business/subpackage/apply/edit.vue b/src/views/business/subpackage/apply/edit.vue index 2eacf81..2ebb041 100644 --- a/src/views/business/subpackage/apply/edit.vue +++ b/src/views/business/subpackage/apply/edit.vue @@ -108,20 +108,17 @@ } // 获取详情信息 -const getDetail = () => { +const getDetail = async () => { const loading = ElLoading.service({ lock: true, background: 'rgba(255, 255, 255, 0.8)', }) - detail({ id: $route.params.id as string }).then((res) => { - loading.close() - detailForm.value = res.data - detailForm.value.createUserName = res.data.applicantName || user.name - list.value = res.data.sampleList.filter((item: ISampleList) => { - return item !== null - }) - }).catch(() => { - loading.close() + const res = await detail({ id: $route.params.id as string }) + loading.close() + detailForm.value = res.data + detailForm.value.createUserName = res.data.applicantName || user.name + list.value = res.data.sampleList.filter((item: ISampleList) => { + return item !== null }) } @@ -396,7 +393,7 @@ await getDict() detailForm.value.applyProcessId = query.applyProcessId as string // 流程实例 if (pageType.value !== 'add') { // 编辑、详情 - getDetail() + await getDetail() if (query.approvalStatusName !== '草稿箱') { getApprovalRecord(detailForm.value.applyProcessId) // 获取审批流程 } diff --git a/src/views/business/subpackage/apply/edit.vue b/src/views/business/subpackage/apply/edit.vue index 2eacf81..2ebb041 100644 --- a/src/views/business/subpackage/apply/edit.vue +++ b/src/views/business/subpackage/apply/edit.vue @@ -108,20 +108,17 @@ } // 获取详情信息 -const getDetail = () => { +const getDetail = async () => { const loading = ElLoading.service({ lock: true, background: 'rgba(255, 255, 255, 0.8)', }) - detail({ id: $route.params.id as string }).then((res) => { - loading.close() - detailForm.value = res.data - detailForm.value.createUserName = res.data.applicantName || user.name - list.value = res.data.sampleList.filter((item: ISampleList) => { - return item !== null - }) - }).catch(() => { - loading.close() + const res = await detail({ id: $route.params.id as string }) + loading.close() + detailForm.value = res.data + detailForm.value.createUserName = res.data.applicantName || user.name + list.value = res.data.sampleList.filter((item: ISampleList) => { + return item !== null }) } @@ -396,7 +393,7 @@ await getDict() detailForm.value.applyProcessId = query.applyProcessId as string // 流程实例 if (pageType.value !== 'add') { // 编辑、详情 - getDetail() + await getDetail() if (query.approvalStatusName !== '草稿箱') { getApprovalRecord(detailForm.value.applyProcessId) // 获取审批流程 } diff --git a/src/views/business/subpackage/approve/edit.vue b/src/views/business/subpackage/approve/edit.vue index 0360a69..d01f9d1 100644 --- a/src/views/business/subpackage/approve/edit.vue +++ b/src/views/business/subpackage/approve/edit.vue @@ -123,20 +123,19 @@ // ----------------------------------------------------------------------------------- // 获取详情 -const getInfo = () => { +const getInfo = async () => { loading.value = true - detail({ id: infoId.value }).then((res) => { - loading.value = false - dataForm.value = res.data - if (pageType.value == 'detail') { - fullAddress.value = [dataForm.value.addressCountryName, dataForm.value.addressProvinceName, dataForm.value.addressCityName, dataForm.value.addressAreaName, dataForm.value.fullAddress] - invoiceFullAddress.value = [dataForm.value.invoiceCountryName, dataForm.value.invoiceProvinceName, dataForm.value.invoiceCityName, dataForm.value.invoiceAreaName, dataForm.value.invoiceFullAddress] - } - else { - fullAddress.value = [dataForm.value.addressCountry, dataForm.value.addressProvince, dataForm.value.addressCity, dataForm.value.addressArea, dataForm.value.fullAddress] - invoiceFullAddress.value = [dataForm.value.invoiceCountry, dataForm.value.invoiceProvince, dataForm.value.invoiceCity, dataForm.value.invoiceArea, dataForm.value.invoiceFullAddress] - } - }) + const res = await detail({ id: infoId.value }) + loading.value = false + dataForm.value = res.data + if (pageType.value == 'detail') { + fullAddress.value = [dataForm.value.addressCountryName, dataForm.value.addressProvinceName, dataForm.value.addressCityName, dataForm.value.addressAreaName, dataForm.value.fullAddress] + invoiceFullAddress.value = [dataForm.value.invoiceCountryName, dataForm.value.invoiceProvinceName, dataForm.value.invoiceCityName, dataForm.value.invoiceAreaName, dataForm.value.invoiceFullAddress] + } + else { + fullAddress.value = [dataForm.value.addressCountry, dataForm.value.addressProvince, dataForm.value.addressCity, dataForm.value.addressArea, dataForm.value.fullAddress] + invoiceFullAddress.value = [dataForm.value.invoiceCountry, dataForm.value.invoiceProvince, dataForm.value.invoiceCity, dataForm.value.invoiceArea, dataForm.value.invoiceFullAddress] + } } // 公司地址变化后给对象赋值 @@ -330,12 +329,12 @@ } } // --------------------------------------------------------------------------------------- -onMounted(() => { +onMounted(async () => { approvalStatusName.value = query.approvalStatusName as string // 审批状态名字 dataForm.value.processId = query.processId as string // 流程实例id // 非添加页面获取详情 if (pageType.value !== 'add') { - getInfo() + await getInfo() if (query.approvalStatusName !== '草稿箱') { getApprovalRecord(dataForm.value.processId) // 获取审批流程 } diff --git a/src/views/business/subpackage/apply/edit.vue b/src/views/business/subpackage/apply/edit.vue index 2eacf81..2ebb041 100644 --- a/src/views/business/subpackage/apply/edit.vue +++ b/src/views/business/subpackage/apply/edit.vue @@ -108,20 +108,17 @@ } // 获取详情信息 -const getDetail = () => { +const getDetail = async () => { const loading = ElLoading.service({ lock: true, background: 'rgba(255, 255, 255, 0.8)', }) - detail({ id: $route.params.id as string }).then((res) => { - loading.close() - detailForm.value = res.data - detailForm.value.createUserName = res.data.applicantName || user.name - list.value = res.data.sampleList.filter((item: ISampleList) => { - return item !== null - }) - }).catch(() => { - loading.close() + const res = await detail({ id: $route.params.id as string }) + loading.close() + detailForm.value = res.data + detailForm.value.createUserName = res.data.applicantName || user.name + list.value = res.data.sampleList.filter((item: ISampleList) => { + return item !== null }) } @@ -396,7 +393,7 @@ await getDict() detailForm.value.applyProcessId = query.applyProcessId as string // 流程实例 if (pageType.value !== 'add') { // 编辑、详情 - getDetail() + await getDetail() if (query.approvalStatusName !== '草稿箱') { getApprovalRecord(detailForm.value.applyProcessId) // 获取审批流程 } diff --git a/src/views/business/subpackage/approve/edit.vue b/src/views/business/subpackage/approve/edit.vue index 0360a69..d01f9d1 100644 --- a/src/views/business/subpackage/approve/edit.vue +++ b/src/views/business/subpackage/approve/edit.vue @@ -123,20 +123,19 @@ // ----------------------------------------------------------------------------------- // 获取详情 -const getInfo = () => { +const getInfo = async () => { loading.value = true - detail({ id: infoId.value }).then((res) => { - loading.value = false - dataForm.value = res.data - if (pageType.value == 'detail') { - fullAddress.value = [dataForm.value.addressCountryName, dataForm.value.addressProvinceName, dataForm.value.addressCityName, dataForm.value.addressAreaName, dataForm.value.fullAddress] - invoiceFullAddress.value = [dataForm.value.invoiceCountryName, dataForm.value.invoiceProvinceName, dataForm.value.invoiceCityName, dataForm.value.invoiceAreaName, dataForm.value.invoiceFullAddress] - } - else { - fullAddress.value = [dataForm.value.addressCountry, dataForm.value.addressProvince, dataForm.value.addressCity, dataForm.value.addressArea, dataForm.value.fullAddress] - invoiceFullAddress.value = [dataForm.value.invoiceCountry, dataForm.value.invoiceProvince, dataForm.value.invoiceCity, dataForm.value.invoiceArea, dataForm.value.invoiceFullAddress] - } - }) + const res = await detail({ id: infoId.value }) + loading.value = false + dataForm.value = res.data + if (pageType.value == 'detail') { + fullAddress.value = [dataForm.value.addressCountryName, dataForm.value.addressProvinceName, dataForm.value.addressCityName, dataForm.value.addressAreaName, dataForm.value.fullAddress] + invoiceFullAddress.value = [dataForm.value.invoiceCountryName, dataForm.value.invoiceProvinceName, dataForm.value.invoiceCityName, dataForm.value.invoiceAreaName, dataForm.value.invoiceFullAddress] + } + else { + fullAddress.value = [dataForm.value.addressCountry, dataForm.value.addressProvince, dataForm.value.addressCity, dataForm.value.addressArea, dataForm.value.fullAddress] + invoiceFullAddress.value = [dataForm.value.invoiceCountry, dataForm.value.invoiceProvince, dataForm.value.invoiceCity, dataForm.value.invoiceArea, dataForm.value.invoiceFullAddress] + } } // 公司地址变化后给对象赋值 @@ -330,12 +329,12 @@ } } // --------------------------------------------------------------------------------------- -onMounted(() => { +onMounted(async () => { approvalStatusName.value = query.approvalStatusName as string // 审批状态名字 dataForm.value.processId = query.processId as string // 流程实例id // 非添加页面获取详情 if (pageType.value !== 'add') { - getInfo() + await getInfo() if (query.approvalStatusName !== '草稿箱') { getApprovalRecord(dataForm.value.processId) // 获取审批流程 } diff --git a/src/views/business/subpackage/check/edit.vue b/src/views/business/subpackage/check/edit.vue index c848463..a4462c1 100644 --- a/src/views/business/subpackage/check/edit.vue +++ b/src/views/business/subpackage/check/edit.vue @@ -81,12 +81,11 @@ } // 获取详情 -const getDetail = () => { - detail({ id: $route.params.id }).then((res) => { - detailForm.value = res.data - list.value = res.data.sampleList.filter((item: ISampleList) => { - return item !== null - }) +const getDetail = async () => { + const res = await detail({ id: $route.params.id }) + detailForm.value = res.data + list.value = res.data.sampleList.filter((item: ISampleList) => { + return item !== null }) } @@ -273,12 +272,10 @@ detailForm.value.outsourceReasonName = val[0].outsourceReasonName // 分包原因名称 } // -------------------------------------------------------------------------------------- -onMounted(() => { - console.log('00000', query.approvalStatusName) - +onMounted(async () => { detailForm.value.checkProcessId = query.checkProcessId as string // 流程实例 if (pageType.value !== 'add') { // 编辑、详情 - getDetail() + await getDetail() if (query.approvalStatusName !== '草稿箱') { getApprovalRecord(detailForm.value.checkProcessId) // 获取审批流程 } diff --git a/src/views/business/subpackage/apply/edit.vue b/src/views/business/subpackage/apply/edit.vue index 2eacf81..2ebb041 100644 --- a/src/views/business/subpackage/apply/edit.vue +++ b/src/views/business/subpackage/apply/edit.vue @@ -108,20 +108,17 @@ } // 获取详情信息 -const getDetail = () => { +const getDetail = async () => { const loading = ElLoading.service({ lock: true, background: 'rgba(255, 255, 255, 0.8)', }) - detail({ id: $route.params.id as string }).then((res) => { - loading.close() - detailForm.value = res.data - detailForm.value.createUserName = res.data.applicantName || user.name - list.value = res.data.sampleList.filter((item: ISampleList) => { - return item !== null - }) - }).catch(() => { - loading.close() + const res = await detail({ id: $route.params.id as string }) + loading.close() + detailForm.value = res.data + detailForm.value.createUserName = res.data.applicantName || user.name + list.value = res.data.sampleList.filter((item: ISampleList) => { + return item !== null }) } @@ -396,7 +393,7 @@ await getDict() detailForm.value.applyProcessId = query.applyProcessId as string // 流程实例 if (pageType.value !== 'add') { // 编辑、详情 - getDetail() + await getDetail() if (query.approvalStatusName !== '草稿箱') { getApprovalRecord(detailForm.value.applyProcessId) // 获取审批流程 } diff --git a/src/views/business/subpackage/approve/edit.vue b/src/views/business/subpackage/approve/edit.vue index 0360a69..d01f9d1 100644 --- a/src/views/business/subpackage/approve/edit.vue +++ b/src/views/business/subpackage/approve/edit.vue @@ -123,20 +123,19 @@ // ----------------------------------------------------------------------------------- // 获取详情 -const getInfo = () => { +const getInfo = async () => { loading.value = true - detail({ id: infoId.value }).then((res) => { - loading.value = false - dataForm.value = res.data - if (pageType.value == 'detail') { - fullAddress.value = [dataForm.value.addressCountryName, dataForm.value.addressProvinceName, dataForm.value.addressCityName, dataForm.value.addressAreaName, dataForm.value.fullAddress] - invoiceFullAddress.value = [dataForm.value.invoiceCountryName, dataForm.value.invoiceProvinceName, dataForm.value.invoiceCityName, dataForm.value.invoiceAreaName, dataForm.value.invoiceFullAddress] - } - else { - fullAddress.value = [dataForm.value.addressCountry, dataForm.value.addressProvince, dataForm.value.addressCity, dataForm.value.addressArea, dataForm.value.fullAddress] - invoiceFullAddress.value = [dataForm.value.invoiceCountry, dataForm.value.invoiceProvince, dataForm.value.invoiceCity, dataForm.value.invoiceArea, dataForm.value.invoiceFullAddress] - } - }) + const res = await detail({ id: infoId.value }) + loading.value = false + dataForm.value = res.data + if (pageType.value == 'detail') { + fullAddress.value = [dataForm.value.addressCountryName, dataForm.value.addressProvinceName, dataForm.value.addressCityName, dataForm.value.addressAreaName, dataForm.value.fullAddress] + invoiceFullAddress.value = [dataForm.value.invoiceCountryName, dataForm.value.invoiceProvinceName, dataForm.value.invoiceCityName, dataForm.value.invoiceAreaName, dataForm.value.invoiceFullAddress] + } + else { + fullAddress.value = [dataForm.value.addressCountry, dataForm.value.addressProvince, dataForm.value.addressCity, dataForm.value.addressArea, dataForm.value.fullAddress] + invoiceFullAddress.value = [dataForm.value.invoiceCountry, dataForm.value.invoiceProvince, dataForm.value.invoiceCity, dataForm.value.invoiceArea, dataForm.value.invoiceFullAddress] + } } // 公司地址变化后给对象赋值 @@ -330,12 +329,12 @@ } } // --------------------------------------------------------------------------------------- -onMounted(() => { +onMounted(async () => { approvalStatusName.value = query.approvalStatusName as string // 审批状态名字 dataForm.value.processId = query.processId as string // 流程实例id // 非添加页面获取详情 if (pageType.value !== 'add') { - getInfo() + await getInfo() if (query.approvalStatusName !== '草稿箱') { getApprovalRecord(dataForm.value.processId) // 获取审批流程 } diff --git a/src/views/business/subpackage/check/edit.vue b/src/views/business/subpackage/check/edit.vue index c848463..a4462c1 100644 --- a/src/views/business/subpackage/check/edit.vue +++ b/src/views/business/subpackage/check/edit.vue @@ -81,12 +81,11 @@ } // 获取详情 -const getDetail = () => { - detail({ id: $route.params.id }).then((res) => { - detailForm.value = res.data - list.value = res.data.sampleList.filter((item: ISampleList) => { - return item !== null - }) +const getDetail = async () => { + const res = await detail({ id: $route.params.id }) + detailForm.value = res.data + list.value = res.data.sampleList.filter((item: ISampleList) => { + return item !== null }) } @@ -273,12 +272,10 @@ detailForm.value.outsourceReasonName = val[0].outsourceReasonName // 分包原因名称 } // -------------------------------------------------------------------------------------- -onMounted(() => { - console.log('00000', query.approvalStatusName) - +onMounted(async () => { detailForm.value.checkProcessId = query.checkProcessId as string // 流程实例 if (pageType.value !== 'add') { // 编辑、详情 - getDetail() + await getDetail() if (query.approvalStatusName !== '草稿箱') { getApprovalRecord(detailForm.value.checkProcessId) // 获取审批流程 } diff --git a/src/views/device/borrow/editApply.vue b/src/views/device/borrow/editApply.vue index 1d156bc..7ebbeee 100644 --- a/src/views/device/borrow/editApply.vue +++ b/src/views/device/borrow/editApply.vue @@ -62,6 +62,7 @@ applyPersonName: '', // 申请人名称 time: '', // 借用时间 applyDesc: '', // 申请说明 + rejectRemark: '', // 历次驳回日志 }) const ruleFormRef = ref() as any const list = ref([])// 表格数据 @@ -318,22 +319,21 @@ } // 编辑、详情--获取详细信息 -const fetchReceiveApplyListDetail = () => { - getReceiveApplyListDetail({ id: form.value.id }).then((res) => { - form.value.applyUnit = res.data.applyUnit // 部门 - form.value.applyUnitName = res.data.applyUnitName || user.deptName // 部门名称 - form.value.applyName = res.data.applyName // 申请名称 - form.value.applyPerson = res.data.applyPerson// 申请人 - form.value.applyPersonName = res.data.applyPersonName || user.name// 申请人名称 - form.value.applyNo = res.data.applyNo// 申请编号 - form.value.time = res.data.time // 借用时间 - form.value.applyDesc = res.data.applyDesc // 申请说明 - list.value = res.data.equipmentInfoList.map((item: IdeviceList) => { - return { - ...item, - validDate: dayjs(item.validDate).format('YYYY-MM-DD'), - } - }) +const fetchReceiveApplyListDetail = async () => { + const res = await getReceiveApplyListDetail({ id: form.value.id }) + form.value.applyUnit = res.data.applyUnit // 部门 + form.value.applyUnitName = res.data.applyUnitName || user.deptName // 部门名称 + form.value.applyName = res.data.applyName // 申请名称 + form.value.applyPerson = res.data.applyPerson// 申请人 + form.value.applyPersonName = res.data.applyPersonName || user.name// 申请人名称 + form.value.applyNo = res.data.applyNo// 申请编号 + form.value.time = res.data.time // 借用时间 + form.value.applyDesc = res.data.applyDesc // 申请说明 + list.value = res.data.equipmentInfoList.map((item: IdeviceList) => { + return { + ...item, + validDate: dayjs(item.validDate).format('YYYY-MM-DD'), + } }) } @@ -409,7 +409,7 @@ } } // -------------------------------------------------------------------------------------- -onMounted(() => { +onMounted(async () => { typeValue.value = $route.query.typeValue // 类型add、edit、detail form.value.id = $route.query.id as string // id form.value.taskId = $route.query.taskId as string // 任务id @@ -427,7 +427,7 @@ form.value.time = dayjs().format('YYYY-MM-DD HH:mm:ss') // 申请时间 // 编辑、详情获取详情页信息 if (typeValue.value === 'edit' || typeValue.value === 'detail') { - fetchReceiveApplyListDetail() // 获取详细信息 + await fetchReceiveApplyListDetail() // 获取详细信息 } if (approvalStatusName.value !== '草稿箱') { getApprovalRecord(form.value.processId) // 查询审批记录 @@ -437,6 +437,19 @@ // 获取人员列表--申请人使用 fetchUserList() }) + +// 监听到驳回原因 +const giveRejectRemark = (reason: string) => { + if (form.value.rejectRemark) { + const lastIndex = form.value.rejectRemark.lastIndexOf(reason) + if (lastIndex === -1) { // 本次原因和上次最后一次原因不同才去拼接 + form.value.rejectRemark = `${form.value.rejectRemark};${reason}` + } + } + else { + form.value.rejectRemark = reason + } +}