|
|
@@ -742,9 +742,12 @@ import {
|
|
|
import {PipeAppointmentConfirmOrderApi} from "@/api/pressure2/pipeappointmentconfirmorder";
|
|
|
import { EquipPipeSchedulingApi } from "@/api/pressure2/pipescheduling";
|
|
|
import {UserQualificationsApi} from "@/api/pressure2/userQualifications";
|
|
|
-import { type CheckerItem } from '@/views/pressure2/components/CheckerSelect'
|
|
|
+import CheckerSelect, { type CheckerItem } from '@/views/pressure2/components/CheckerSelect'
|
|
|
import { useUserStoreWithOut } from '@/store/modules/user'
|
|
|
|
|
|
+import { getDept } from '@/api/system/dept'
|
|
|
+import { EquipPipeApi } from '@/api/pressure2/equippipe'
|
|
|
+
|
|
|
const { emitter } = useEmitt()
|
|
|
|
|
|
const route = useRoute()
|
|
|
@@ -949,9 +952,6 @@ const formRules = {
|
|
|
],
|
|
|
checkType: [
|
|
|
{ required: true, message: '请选择检验性质', trigger: 'blur' }
|
|
|
- ],
|
|
|
- deptId: [
|
|
|
- { required: true, message: '请选择检验部门', trigger: 'change' }
|
|
|
]
|
|
|
}
|
|
|
|
|
|
@@ -2118,6 +2118,38 @@ const handleRemove = (type: string, attach: string) => {
|
|
|
exceptionInfo.value[attach] = ''
|
|
|
}
|
|
|
|
|
|
+const fillNullOrEmptyValWithDefaultVal = (obj, key, defaultValue) => {
|
|
|
+ if(obj[key] == null) {
|
|
|
+ obj[key] = defaultValue
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(typeof obj[key] === 'string' && obj[key] === '') {
|
|
|
+ obj[key] = defaultValue
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const fillDefaultVal = async () => {
|
|
|
+ const [equipPipe, dept] = await Promise.all([
|
|
|
+ EquipPipeApi.getEquipPipe(equipList.value[0].id),
|
|
|
+ getDept(formData.value.deptId)
|
|
|
+ ])
|
|
|
+ if(equipPipe) {
|
|
|
+ fillNullOrEmptyValWithDefaultVal(formData.value, 'unitContact', equipPipe?.contact || '')
|
|
|
+ fillNullOrEmptyValWithDefaultVal(formData.value, 'unitPhone', equipPipe?.contactPhone || '')
|
|
|
+ fillNullOrEmptyValWithDefaultVal(formData.value, 'email', equipPipe?.contactEmail || '')
|
|
|
+ // fillNullOrEmptyValWithDefaultVal(formData.value, 'recipient', equipPipe?.recipient || '')
|
|
|
+ // fillNullOrEmptyValWithDefaultVal(formData.value, 'recipientPhone', equipPipe?.recipientPhone || '')
|
|
|
+ // fillNullOrEmptyValWithDefaultVal(formData.value, 'recipientEmail', equipPipe?.recipientEmail || '')
|
|
|
+ // fillNullOrEmptyValWithDefaultVal(formData.value, 'payerContactName', equipPipe?.payment || '')
|
|
|
+ // fillNullOrEmptyValWithDefaultVal(formData.value, 'payerContact', equipPipe?.paymentPhone || '')
|
|
|
+ // fillNullOrEmptyValWithDefaultVal(formData.value, 'payerMail', equipPipe?.paymentEmail || '')
|
|
|
+ }
|
|
|
+ if(dept) {
|
|
|
+ fillNullOrEmptyValWithDefaultVal(formData.value, 'deptPhone', dept?.phone || '')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
|
|
|
// 页面加载时获取详情
|
|
|
onMounted(async () => {
|
|
|
@@ -2126,6 +2158,7 @@ onMounted(async () => {
|
|
|
await handleEquipQuery()
|
|
|
// await handleGetExceptionInfo('eb9a57fe2ed98a45e1a892aef4cc13f0')
|
|
|
}
|
|
|
+ await fillDefaultVal()
|
|
|
})
|
|
|
|
|
|
const formattedCheckers = computed(() => {
|