|
|
@ -267,6 +267,7 @@ const butttondata = (row, $index) => { |
|
|
|
return [] |
|
|
|
} |
|
|
|
return [ |
|
|
|
defaultButtons.mainSeeDetailBtn(null), // 查看明细 |
|
|
|
defaultButtons.mainListPlanSubBtn({ |
|
|
|
hide: isShowMainButton(row, ['1']), |
|
|
|
hasPermi: 'wms:purchaseClaimRequest:sub' |
|
|
@ -296,7 +297,10 @@ const butttondata = (row, $index) => { |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { |
|
|
|
if (val == 'seeDetail') { |
|
|
|
// 查看明细 |
|
|
|
openDetail(row, '单据号', row.number) |
|
|
|
} else if (val == 'edit') { |
|
|
|
// 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'mainPlanSub') { |
|
|
@ -304,7 +308,7 @@ const buttonTableClick = async (val, row) => { |
|
|
|
handleSub(row.masterId) |
|
|
|
} else if (val == 'mainPlanApp') { |
|
|
|
// 审批通过 |
|
|
|
handleAgree(row.masterId) |
|
|
|
handleAgree(row) |
|
|
|
} else if (val == 'mainPlanTur') { |
|
|
|
// 审批驳回 |
|
|
|
handleReject(row.masterId) |
|
|
@ -361,13 +365,17 @@ const handleSub = async (masterId: number) => { |
|
|
|
} |
|
|
|
|
|
|
|
/** 审批通过按钮操作 */ |
|
|
|
const handleAgree = async (masterId: number) => { |
|
|
|
const handleAgree = async (row: any) => { |
|
|
|
if (row.isApproved==1) { |
|
|
|
message.error(t('ts.索赔金额不能为0,请修改后提交。')) |
|
|
|
return |
|
|
|
} |
|
|
|
try { |
|
|
|
// 关闭的二次确认 |
|
|
|
await message.confirm(t('ts.是否审批通过所选中数据?')) |
|
|
|
tableObject.loading = true |
|
|
|
// 发起关闭 |
|
|
|
await PurchaseClaimRequestMainApi.agreePurchaseClaimRequestMain(masterId) |
|
|
|
await PurchaseClaimRequestMainApi.agreePurchaseClaimRequestMain(row.masterId) |
|
|
|
message.success(t('ts.审批通过成功!')) |
|
|
|
tableObject.loading = false |
|
|
|
// 刷新列表 |
|
|
@ -484,6 +492,7 @@ const flag = ref(false) |
|
|
|
|
|
|
|
// 主子数据 提交 |
|
|
|
const submitForm = async (formType, submitData) => { |
|
|
|
flag.value=false |
|
|
|
let data = { ...submitData } |
|
|
|
if (data.masterId) { |
|
|
|
data.id = data.masterId |
|
|
@ -510,11 +519,11 @@ const submitForm = async (formType, submitData) => { |
|
|
|
flag.value = true |
|
|
|
return |
|
|
|
} |
|
|
|
if (obj.claimAmount == 0) { |
|
|
|
message.error(`索赔金额不能为0!`) |
|
|
|
flag.value = true |
|
|
|
return |
|
|
|
} |
|
|
|
// if (obj.claimAmount == 0) { |
|
|
|
// message.error(`索赔金额不能为0!`) |
|
|
|
// flag.value = true |
|
|
|
// return |
|
|
|
// } |
|
|
|
}) |
|
|
|
if (flag.value) { |
|
|
|
return |
|
|
@ -586,10 +595,12 @@ const submitFormDetail = async (formType, data) => { |
|
|
|
console.log(detailRef.value.formRef.dialogVisible) |
|
|
|
detailFormRef.value.dialogVisible = false |
|
|
|
detailRef.value.updateList() |
|
|
|
getList() |
|
|
|
} catch { |
|
|
|
detailFormRef.value.formLoading = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
|
onMounted(async () => { |
|
|
|
getList() |
|
|
|