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

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

@ -86,8 +86,8 @@
<el-col :span="6"> <el-col :span="6">
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="单据日期" prop="createTime"> <el-form-item label="单据日期" prop="orderTime">
{{formatDate(formData.createTime, 'YYYY-MM-DD')}} {{formatDate(formData.orderTime, 'YYYY-MM-DD')}}
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -620,7 +620,12 @@ const formData = ref({
operateLogs: [], operateLogs: [],
contractNo: undefined, contractNo: undefined,
active: '', active: '',
activeOpinion: '' activeOpinion: '',
isSnapshot: 0,
snapshotId: undefined,
snapshotCode: undefined,
orderTime: new Date(),
snapshotOrderTime: undefined,
}) })
const formRules = reactive({ const formRules = reactive({
businessDeptId: [{ required: true, message: '提出部门不能为空', trigger: 'blur' }], 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) const orderId = await ProjectOrderApi.operateProjectOrder(data)
message.success(t('common.operationSuccess')) message.success(t('common.operationSuccess'))
// //
@ -972,7 +999,12 @@ const resetForm = () => {
attachments: [], attachments: [],
contractNo: undefined, contractNo: undefined,
active: '', active: '',
activeOpinion: '' activeOpinion: '',
isSnapshot: 0,
snapshotId: undefined,
snapshotCode: undefined,
orderTime: new Date(),
snapshotOrderTime: undefined,
} }
formRef.value?.resetFields() formRef.value?.resetFields()
} }

Loading…
Cancel
Save