|
|
@@ -738,6 +738,26 @@ const rules = reactive<FormRules>({
|
|
|
otherNptReason: [{ validator: validateOtherReason }]
|
|
|
})
|
|
|
|
|
|
+const checkFaultSituationBeforeSubmit = async () => {
|
|
|
+ if (!['ry', 'rh'].includes(companyName.value)) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+
|
|
|
+ const engineeringQuality = Number(
|
|
|
+ attrList.value.find((item) => item.name === '工程质量H')?.fillContent || 0
|
|
|
+ )
|
|
|
+ const faultSituation = attrList.value.find((item) => item.name === '故障情况')?.fillContent
|
|
|
+ const hasFaultSituation =
|
|
|
+ faultSituation !== undefined && faultSituation !== null && String(faultSituation).trim() !== ''
|
|
|
+
|
|
|
+ if (engineeringQuality > 0 && !hasFaultSituation) {
|
|
|
+ await message.alert('非生产时间中工程质量H大于0时,请填写故障情况')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+
|
|
|
+ return true
|
|
|
+}
|
|
|
+
|
|
|
const totalValidatorComputed = computed(() => {
|
|
|
if (attrList.value.some((item) => item.description === 'dailyInjectGasTime')) {
|
|
|
return rhValidateTotalTime
|
|
|
@@ -1035,6 +1055,11 @@ const getFillInfo = async () => {
|
|
|
const validations = formRef.value.map((form) => form.validate())
|
|
|
await Promise.all(validations)
|
|
|
|
|
|
+ const canSubmit = await checkFaultSituationBeforeSubmit()
|
|
|
+ if (!canSubmit) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
const company = await IotOpeationFillApi.getOrgName(route.params.id.toString().split(',')[0])
|
|
|
|
|
|
if (devName != '生产日报') {
|