Browse Source

bom清单 校验 父子不能相同

master
陈薪名 12 months ago
parent
commit
9b294858a5
  1. 6
      src/views/wms/basicDataManage/itemManage/bom/index.vue

6
src/views/wms/basicDataManage/itemManage/bom/index.vue

@ -67,6 +67,7 @@ import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
//
defineOptions({ name: 'Bom' }) defineOptions({ name: 'Bom' })
const message = useMessage() // const message = useMessage() //
@ -148,6 +149,7 @@ const openForm = (type: string, row?: any) => {
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType,data) => {
var isHave =Bom.allSchemas.formSchema.some(function (item) { var isHave =Bom.allSchemas.formSchema.some(function (item) {
return item.field === 'activeTime' || item.field === 'expireTime'; return item.field === 'activeTime' || item.field === 'expireTime';
}); });
@ -159,6 +161,10 @@ const formsSuccess = async (formType,data) => {
} }
if(data.activeTime==0)data.activeTime = null; if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null; if(data.expireTime==0)data.expireTime = null;
if (data.productItemCode == data.componentItemCode) {
message.error('父物品代码和子物品代码不能相同!')
return
}
if (formType === 'create') { if (formType === 'create') {
await BomApi.createBom(data) await BomApi.createBom(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))

Loading…
Cancel
Save