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

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

@ -67,8 +67,8 @@
:apiUpdate="PurchasePlanDetailApi.updatePurchasePlanDetail"
:apiPage="PurchasePlanDetailApi.getPurchasePlanDetailPage"
:apiDelete="PurchasePlanDetailApi.deletePurchasePlanDetail"
:Echo="Echo"
@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({
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 handleImport = () => {

Loading…
Cancel
Save