diff --git a/src/views/supermarket/supermarketSpu/form.vue b/src/views/supermarket/supermarketSpu/form.vue index 7b7855e..48d9007 100644 --- a/src/views/supermarket/supermarketSpu/form.vue +++ b/src/views/supermarket/supermarketSpu/form.vue @@ -110,40 +110,40 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -156,11 +156,11 @@ - - - - - + + + + + @@ -207,9 +207,7 @@ import { useDict } from '/@/hooks/dict'; import { useMessage } from '/@/hooks/message'; import { getObj, addObj, putObj, getSupermarketCategory, getSupermarketBrand } from '/@/api/supermarket/supermarketSpu'; -import { getObj as getSupermarketUnit } from '/@/api/supermarket/supermarketUnit'; -import { getObj as getSupermarketAuxiliaryCode } from '/@/api/supermarket/supermarketAuxiliaryCode'; -import { fetchList } from '/@/api/supermarketerp/smErpSupplier'; +import { getSupplierTypeOptions } from '/@/api/supermarketerp/smErpSupplier'; import { rule } from '/@/utils/validate'; import supermarketAuxiliaryCode from './components/supermarketAuxiliaryCode/index.vue'; import supermarketUnit from './components/supermarketUnit/index.vue'; @@ -334,8 +332,8 @@ const openDialog = async (id: string) => { // 获取货商选项 if (supplierOptions.value.length <= 0) { try { - const res = await fetchList(); - supplierOptions.value = res.data.records; + const res = await getSupplierTypeOptions(); + supplierOptions.value = res.data; } catch (error) { supplierOptions.value = []; } @@ -352,6 +350,7 @@ const onSubmit = async () => { console.log(form); const valid = await dataFormRef.value.validate().catch(() => {}); + if (!valid) useMessage().warning('基础信息必填项未填写完整'); if (!form.supermarketUnitEntityList || form.supermarketUnitEntityList.length <= 0) useMessage().warning('请添加包装单位'); if (!form.supermarketAuxiliaryCodeEntityList || form.supermarketAuxiliaryCodeEntityList.length <= 0) useMessage().warning('请添加辅助条码'); if (!valid) return false;