|
|
@ -33,7 +33,7 @@ |
|
|
|
</el-button> |
|
|
|
</template> |
|
|
|
<template #action="{ row }"> |
|
|
|
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
<ButtonBase :Butttondata="butttondata(row)" @button-base-click="buttonTableClick($event,row)" /> |
|
|
|
</template> |
|
|
|
</Table> |
|
|
|
</ContentWrap> |
|
|
@ -41,7 +41,6 @@ |
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
<BasicForm |
|
|
|
ref="formRef" |
|
|
|
@success="getList" |
|
|
|
:rules="DeliverPlanMainRules" |
|
|
|
:formAllSchemas="DeliverPlanMain.allSchemas" |
|
|
|
:tableAllSchemas="DeliverPlanDetail.allSchemas" |
|
|
@ -177,29 +176,74 @@ const isShowMainButton = (row,val) => { |
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5','4'])}), // 打开 |
|
|
|
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), // 关闭 |
|
|
|
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5'])}), // 打开 |
|
|
|
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4'])}), // 关闭 |
|
|
|
defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1'])}), // 提交审批 |
|
|
|
defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2'])}), // 驳回 |
|
|
|
defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2'])}), // 审批通过 |
|
|
|
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3'])}), // 发布 |
|
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:update'}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:delete'}), // 删除 |
|
|
|
defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4'])}), // 重置 |
|
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:deliver-plan-main:update'}), // 编辑 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'mainPlanOpe') { // 打开 |
|
|
|
console.log('列表-操作按钮事件-打开') |
|
|
|
DeliverPlanMainApi.open(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanClo') { // 关闭 |
|
|
|
console.log('列表-操作按钮事件-关闭') |
|
|
|
await message.confirm('确认要关闭吗?') |
|
|
|
DeliverPlanMainApi.close(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanSub') { // 提交审批 |
|
|
|
console.log('列表-操作按钮事件-提交审批') |
|
|
|
await message.confirm('确认要提交审批吗?') |
|
|
|
DeliverPlanMainApi.submit(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanTur') { // 驳回 |
|
|
|
console.log('列表-操作按钮事件-驳回') |
|
|
|
await message.confirm('确认要驳回吗?') |
|
|
|
DeliverPlanMainApi.refies(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanApp') { // 审批通过 |
|
|
|
console.log('列表-操作按钮事件-审批通过') |
|
|
|
await message.confirm('确认要审批通过吗?') |
|
|
|
DeliverPlanMainApi.agree(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanPub') { // 发布 |
|
|
|
await message.confirm('确认要发布吗?') |
|
|
|
DeliverPlanMainApi.publish(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanRes') { // 重置 |
|
|
|
await message.confirm('确认要重置吗?') |
|
|
|
DeliverPlanMainApi.resetting(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'edit') { // 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
@ -270,6 +314,19 @@ const handleDeleteTable = (item, index) => { |
|
|
|
// 主子数据 提交 |
|
|
|
const submitForm = async (formType, data) => { |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
var isHave =DeliverPlanMain.allSchemas.formSchema.some(function (item) { |
|
|
|
return item.field === 'beginTime' || item.field === 'endTime'; |
|
|
|
}); |
|
|
|
if(isHave){ |
|
|
|
if(data.beginTime && data.endTime && data.beginTime >=data.expireTime){ |
|
|
|
message.error('结束时间要大于开始时间') |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(data.beginTime) |
|
|
|
if(!data.beginTime)data.beginTime = null; |
|
|
|
if(!data.planDate)data.planDate = null; |
|
|
|
if(!data.endTime)data.endTime = null; |
|
|
|
try { |
|
|
|
if (formType === 'create') { |
|
|
|
await DeliverPlanMainApi.createDeliverPlanMain(data) |
|
|
|