Browse Source

子表新增编辑校验

master
陈薪名 1 year ago
parent
commit
661944e573
  1. 9
      src/components/Detail/src/Detail.vue
  2. 35
      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'))

35
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 //
})
@ -182,17 +178,17 @@ const isShowMainButton = (row,val) => {
// -
const butttondata = (row) => {
return [
defaultButtons.mainListPurchasePlanModBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_REJECTED'])}), //
defaultButtons.mainListPurchasePlanWitBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_PUBLISHED'])}), //
defaultButtons.mainListPurchasePlanRejBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_PUBLISHED'])}), //
defaultButtons.mainListPurchasePlanAccBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_PUBLISHED'])}), //
defaultButtons.mainListPurchasePlanPubBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY'])}), //
defaultButtons.mainListPurchasePlanCloBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY'])}), //
defaultButtons.mainListPurchasePlanOpeBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_CLOSED'])}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY']),hasPermi:'wms:purchase-plan-main:update'}), //
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY']),hasPermi:'wms:purchase-plan-main:delete'}), //
]
return [
defaultButtons.mainListPurchasePlanModBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_REJECTED'])}), //
defaultButtons.mainListPurchasePlanWitBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_PUBLISHED'])}), //
defaultButtons.mainListPurchasePlanRejBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_PUBLISHED'])}), //
defaultButtons.mainListPurchasePlanAccBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_PUBLISHED'])}), //
defaultButtons.mainListPurchasePlanPubBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY'])}), //
defaultButtons.mainListPurchasePlanCloBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY'])}), //
defaultButtons.mainListPurchasePlanOpeBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_CLOSED'])}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY']),hasPermi:'wms:purchase-plan-main:update'}), //
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['PLAN_PURCHASE_READY']),hasPermi:'wms:purchase-plan-main:delete'}), //
]
}
@ -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