【功能优化】完善订单详情校验逻辑

pull/1/head
zengchenxi 9 months ago
parent 919cfe978d
commit 4ae2692b95

@ -86,8 +86,8 @@
<el-col :span="6">
<el-row>
<el-col :span="24">
<el-form-item label="单据日期" prop="createTime">
{{formatDate(formData.createTime, 'YYYY-MM-DD')}}
<el-form-item label="单据日期" prop="orderTime">
{{formatDate(formData.orderTime, 'YYYY-MM-DD')}}
</el-form-item>
</el-col>
</el-row>
@ -620,7 +620,12 @@ const formData = ref({
operateLogs: [],
contractNo: undefined,
active: '',
activeOpinion: ''
activeOpinion: '',
isSnapshot: 0,
snapshotId: undefined,
snapshotCode: undefined,
orderTime: new Date(),
snapshotOrderTime: undefined,
})
const formRules = reactive({
businessDeptId: [{ required: true, message: '提出部门不能为空', trigger: 'blur' }],
@ -832,6 +837,28 @@ const submitForm = async (active) => {
}
}
//
if('SUBMIT_AUDIT,ALTER'.indexOf(active) > -1){
if(formData.value.hasContract){
const hasContractFile = formData.value.attachments.some((file) => {
return file.businessFileType == 'CONTRACT';
})
if(!hasContractFile){
message.error("请上传合同");
return
}
}
if(formData.value.hasTechnologyProtocol){
const hasProtocolFile = formData.value.attachments.some((file) => {
return file.businessFileType == 'TECHNOLOGY_PROTOCOL';
})
if(!hasProtocolFile){
message.error("请上传技术协议");
return
}
}
}
const orderId = await ProjectOrderApi.operateProjectOrder(data)
message.success(t('common.operationSuccess'))
//
@ -972,7 +999,12 @@ const resetForm = () => {
attachments: [],
contractNo: undefined,
active: '',
activeOpinion: ''
activeOpinion: '',
isSnapshot: 0,
snapshotId: undefined,
snapshotCode: undefined,
orderTime: new Date(),
snapshotOrderTime: undefined,
}
formRef.value?.resetFields()
}

Loading…
Cancel
Save