Browse Source

feat: 添加报审日期的校验

main
buaixuexideshitongxue 2 weeks ago
parent
commit
d266800487
  1. 21
      src/views/report/edit/controlPrice.vue

21
src/views/report/edit/controlPrice.vue

@ -358,6 +358,23 @@ const saveFun = async () => {
loading.value = false;
return true;
}
const formatDateOnly = (value) => {
if (!value) return '';
if (value instanceof Date) {
return timeFormat(value, 'yyyy-mm-dd');
}
return String(value).slice(0, 10);
}
const isInitialSubmitApplicantTimeValid = () => {
if (formData.value.project.node !== 'initial') {
return true;
}
const applicantDate = formatDateOnly(formData.value.project.applicantTime);
const today = formatDateOnly(new Date());
return applicantDate === today;
}
//
const saveUpRecessed =async ()=>{
loading.value = true;
@ -382,6 +399,10 @@ const saveUpRecessed =async ()=>{
//
const submitFun = async () => {
if (!isInitialSubmitApplicantTimeValid()) {
feedback.msgError('请检查报审日期是否为今天!');
return;
}
await saveFun()
dialog.value = true
}

Loading…
Cancel
Save