Browse Source

账期日历校验修改

master
李胜楠 1 year ago
parent
commit
6be9571de8
  1. 26
      src/views/wms/basicDataManage/systemSetting/accountcalendar/index.vue

26
src/views/wms/basicDataManage/systemSetting/accountcalendar/index.vue

@ -41,7 +41,7 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm <BasicForm
ref="basicFormRef" ref="basicFormRef"
@success="getList" @success="formsSuccess"
:rules="AccountcalendarRules" :rules="AccountcalendarRules"
:formAllSchemas="Accountcalendar.allSchemas" :formAllSchemas="Accountcalendar.allSchemas"
:apiUpdate="AccountcalendarApi.updateAccountcalendar" :apiUpdate="AccountcalendarApi.updateAccountcalendar"
@ -144,6 +144,30 @@ const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row) basicFormRef.value.open(type, row)
} }
// form
const formsSuccess = async (formType,data) => {
var isHave =Accountcalendar.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime';
});
if(isHave){
if(data.activeTime && data.expireTime && data.activeTime >=data.expireTime){
message.error('失效时间要大于生效时间')
return;
}
}
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await AccountcalendarApi.createAccountcalendar(data)
message.success(t('common.createSuccess'))
} else {
await AccountcalendarApi.updateAccountcalendar(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {

Loading…
Cancel
Save