Browse Source

企业添加修改

master
李胜楠 12 months ago
parent
commit
c958d6d486
  1. 28
      src/views/wms/basicDataManage/factoryModeling/enterprise/index.vue

28
src/views/wms/basicDataManage/factoryModeling/enterprise/index.vue

@ -40,7 +40,7 @@
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
@success="formsSuccess"
:rules="EnterpriseRules"
:formAllSchemas="Enterprise.allSchemas"
:apiUpdate="EnterpriseApi.updateEnterprise"
@ -148,6 +148,32 @@ const openForm =async (type: string, row?: number) => {
basicFormRef.value.open(type, row)
}
// form
const formsSuccess = async (formType,data) => {
console.log(data);
var isHave =Enterprise.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 EnterpriseApi.createEnterprise(data)
message.success(t('common.createSuccess'))
} else {
await EnterpriseApi.updateEnterprise(data)
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
getList()
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {

Loading…
Cancel
Save