|
|
|
|
@ -206,7 +206,7 @@
|
|
|
|
|
<dict-tag :type="DICT_TYPE.ERP_AUDIT_STATUS" :value="scope.row.status" />
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column :label="t('MoldManagement.MoldGet.operate')" align="center" fixed="right" width="220">
|
|
|
|
|
<el-table-column :label="t('MoldManagement.MoldGet.operate')" align="center" fixed="right" width="300">
|
|
|
|
|
<template #default="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
@ -220,34 +220,43 @@
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="openForm('update', scope.row.id)"
|
|
|
|
|
v-hasPermi="['erp:stock-out:update']"
|
|
|
|
|
v-if="scope.row.status === 10"
|
|
|
|
|
v-if="Number(scope.row.status) === 10"
|
|
|
|
|
>
|
|
|
|
|
{{ t('MoldManagement.MoldGet.edit') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="[0, 1].includes(Number(scope.row.status))"
|
|
|
|
|
link
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="handleUpdateStatus(scope.row.id, 10)"
|
|
|
|
|
v-hasPermi="['erp:stock-out:update-status']"
|
|
|
|
|
>
|
|
|
|
|
{{ t('MoldManagement.MoldGet.submit') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="Number(scope.row.status) === 10"
|
|
|
|
|
link
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="handleUpdateStatus(scope.row.id, 20)"
|
|
|
|
|
v-hasPermi="['erp:stock-out:update-status']"
|
|
|
|
|
v-if="scope.row.status === 10"
|
|
|
|
|
>
|
|
|
|
|
{{ t('MoldManagement.MoldGet.approve') }}
|
|
|
|
|
{{ t('MoldManagement.MoldGet.auditApprove') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<!-- <el-button
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="Number(scope.row.status) === 10"
|
|
|
|
|
link
|
|
|
|
|
type="danger"
|
|
|
|
|
@click="handleUpdateStatus(scope.row.id, 10)"
|
|
|
|
|
@click="handleUpdateStatus(scope.row.id, 1)"
|
|
|
|
|
v-hasPermi="['erp:stock-out:update-status']"
|
|
|
|
|
v-else
|
|
|
|
|
>
|
|
|
|
|
{{ t('MoldManagement.MoldGet.unapprove') }}
|
|
|
|
|
</el-button> -->
|
|
|
|
|
{{ t('MoldManagement.MoldGet.auditReject') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
link
|
|
|
|
|
type="danger"
|
|
|
|
|
@click="handleDelete([scope.row.id])"
|
|
|
|
|
v-hasPermi="['erp:stock-out:delete']"
|
|
|
|
|
v-if="scope.row.status === 10"
|
|
|
|
|
v-if="Number(scope.row.status) === 10"
|
|
|
|
|
>
|
|
|
|
|
{{ t('MoldManagement.MoldGet.delete') }}
|
|
|
|
|
</el-button>
|
|
|
|
|
@ -366,14 +375,27 @@ const handleDelete = async (ids: number[]) => {
|
|
|
|
|
} catch {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 审批/反审批操作 */
|
|
|
|
|
/** 状态更新操作 */
|
|
|
|
|
const handleUpdateStatus = async (id: number, status: number) => {
|
|
|
|
|
try {
|
|
|
|
|
// 审批的二次确认
|
|
|
|
|
await message.confirm(`确定${status === 20 ? '审批' : '反审批'}该出库单吗?`)
|
|
|
|
|
// 发起审批
|
|
|
|
|
const actionMap: Record<number, { confirm: string; success: string }> = {
|
|
|
|
|
10: {
|
|
|
|
|
confirm: t('MoldManagement.MoldGet.submitConfirm'),
|
|
|
|
|
success: t('MoldManagement.MoldGet.submitSuccess')
|
|
|
|
|
},
|
|
|
|
|
20: {
|
|
|
|
|
confirm: t('MoldManagement.MoldGet.auditApproveConfirm'),
|
|
|
|
|
success: t('MoldManagement.MoldGet.auditApproveSuccess')
|
|
|
|
|
},
|
|
|
|
|
1: {
|
|
|
|
|
confirm: t('MoldManagement.MoldGet.auditRejectConfirm'),
|
|
|
|
|
success: t('MoldManagement.MoldGet.auditRejectSuccess')
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
const action = actionMap[status]
|
|
|
|
|
await message.confirm(action.confirm)
|
|
|
|
|
await StockOutApi.updateStockOutStatus(id, status)
|
|
|
|
|
message.success(`${status === 20 ? '审批' : '反审批'}成功`)
|
|
|
|
|
message.success(action.success)
|
|
|
|
|
// 刷新列表
|
|
|
|
|
await getList()
|
|
|
|
|
} catch {}
|
|
|
|
|
|