Browse Source

子表新增编辑校验

master
陈薪名 1 year ago
parent
commit
661944e573
  1. 9
      src/components/Detail/src/Detail.vue
  2. 13
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue

9
src/components/Detail/src/Detail.vue

@ -175,9 +175,9 @@ const props = defineProps({
required: false, required: false,
default: null default: null
}, },
// //
Echo: { detailValidate: {
type: Array, type: Function,
required: false, required: false,
default: null default: null
} }
@ -410,6 +410,9 @@ const openForm = async (type: string, row?: number) => {
// form // form
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
try { try {
// detailValidate
const rs = await props.detailValidate?props.detailValidate(data):true
if (!rs) return
if (formType === 'create') { if (formType === 'create') {
await props.apiCreate(data) await props.apiCreate(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))

13
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue

@ -67,8 +67,8 @@
:apiUpdate="PurchasePlanDetailApi.updatePurchasePlanDetail" :apiUpdate="PurchasePlanDetailApi.updatePurchasePlanDetail"
:apiPage="PurchasePlanDetailApi.getPurchasePlanDetailPage" :apiPage="PurchasePlanDetailApi.getPurchasePlanDetailPage"
:apiDelete="PurchasePlanDetailApi.deletePurchasePlanDetail" :apiDelete="PurchasePlanDetailApi.deletePurchasePlanDetail"
:Echo="Echo"
@searchTableSuccessDetail="searchTableSuccessDetail" @searchTableSuccessDetail="searchTableSuccessDetail"
:detailValidate="detailValidate"
/> />
<!-- 导入 --> <!-- 导入 -->
@ -126,10 +126,6 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
}) })
} }
//
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom']
const Echo = []
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: PurchasePlanMainApi.getPurchasePlanMainPage // getListApi: PurchasePlanMainApi.getPurchasePlanMainPage //
}) })
@ -299,6 +295,13 @@ const submitForm = async (formType, data) => {
} }
} }
//
const detailValidate = (data) => {
console.log(300, data)
message.warning('错了吧,')
return false
}
/** 导入 */ /** 导入 */
const importFormRef = ref() const importFormRef = ref()
const handleImport = () => { const handleImport = () => {

Loading…
Cancel
Save