|
|
|
@ -68,6 +68,10 @@ |
|
|
|
v-if="canIssuePoOrder(scope.row.status)" |
|
|
|
type="primary" |
|
|
|
@click.stop="handleIssuePoOrder(scope.row)">下达</el-link> |
|
|
|
<el-link |
|
|
|
v-if="hasRollbackStatusPermission && canRollbackStatusPoOrder(scope.row.status)" |
|
|
|
type="warning" |
|
|
|
@click.stop="handleRollbackStatus(scope.row)">回滚状态</el-link> |
|
|
|
<el-link |
|
|
|
v-if="canRollbackPoOrder(scope.row.status)" |
|
|
|
type="warning" |
|
|
|
@ -1012,6 +1016,7 @@ import { |
|
|
|
openPoDetail, |
|
|
|
issuePoDetail, |
|
|
|
rollbackPoDetail, |
|
|
|
rollbackStatusPoDetail, |
|
|
|
shipPoDetailPreview, |
|
|
|
shipPoDetail, |
|
|
|
splitPoDetail, |
|
|
|
@ -1063,6 +1068,7 @@ import { |
|
|
|
} from '@/utils/supplierChooselistHelper.js' |
|
|
|
import { searchTransportOptions } from '@/api/port/portTransit.js' |
|
|
|
import { searchPortList } from '@/api/port/portInfo.js' |
|
|
|
import { getPermissionValue } from '@/api/sys/specialSecurity.js' |
|
|
|
import ComPoOrderSearchBar from './com_poOrderSearchBar.vue' |
|
|
|
import ChooselistEam from '@/views/modules/common/Chooselist_eam.vue' |
|
|
|
import PoOrderAdvancedQuery from './com_poOrderAdvancedQuery.vue' |
|
|
|
@ -1208,6 +1214,8 @@ export default { |
|
|
|
return { |
|
|
|
// ===== 页面基础状态 ===== |
|
|
|
loading: false, |
|
|
|
// SRM0007 特殊权限:是否允许显示“回滚状态”按钮 - rqrq |
|
|
|
hasRollbackStatusPermission: false, |
|
|
|
masterRows: [], |
|
|
|
// 主页面「同步运输周期」勾选行 |
|
|
|
syncSelection: [], |
|
|
|
@ -2605,6 +2613,7 @@ export default { |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
this.updateTableHeight() |
|
|
|
this.checkRollbackStatusPermission() |
|
|
|
window.addEventListener('resize', this.onWindowResize) |
|
|
|
}, |
|
|
|
activated () { |
|
|
|
@ -3175,6 +3184,53 @@ export default { |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
|
|
|
|
// SRM0007 回滚状态按钮显隐:草稿/已下达(Confirm)状态下不显示 - rqrq |
|
|
|
canRollbackStatusPoOrder (status) { |
|
|
|
return status !== '草稿' && status !== '已下达' |
|
|
|
}, |
|
|
|
|
|
|
|
// 查询 SRM0007 特殊权限:是否允许显示“回滚状态”按钮 - rqrq |
|
|
|
checkRollbackStatusPermission () { |
|
|
|
const username = this.$store.state.user.name || '' |
|
|
|
if (!username) { |
|
|
|
this.hasRollbackStatusPermission = false |
|
|
|
return |
|
|
|
} |
|
|
|
getPermissionValue(username, 'SRM0007').then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.hasRollbackStatusPermission = String(data.value).trim() === 'Y' |
|
|
|
} else { |
|
|
|
this.hasRollbackStatusPermission = false |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
console.error('查询回滚状态权限失败:', error) |
|
|
|
this.hasRollbackStatusPermission = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 回滚状态(SRM0007):无验货申请明细时回滚为 Confirm(已下达)并清空验货过程数量,后端二次校验兑底 - rqrq |
|
|
|
handleRollbackStatus (row) { |
|
|
|
const params = buildPoDetailActionParams(row, this.$store.state.user.site) |
|
|
|
if (!params.id && !(params.orderNo && params.site && params.itemNo != null)) { |
|
|
|
this.$message.error('无法识别订单行,请刷新后重试') |
|
|
|
return |
|
|
|
} |
|
|
|
const poLabel = row.poNo ? `PO ${row.poNo}` : '该订单' |
|
|
|
const itemLabel = row.itemNo != null ? ` 行 ${row.itemNo}` : '' |
|
|
|
this.$confirm(`确定将${poLabel}${itemLabel}回滚为Confirm状态,并清空已申请验货/已验货/验货成功数量?`, '提示', { type: 'warning' }).then(() => { |
|
|
|
rollbackStatusPoDetail(params).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('回滚状态成功') |
|
|
|
this.getDataList() |
|
|
|
} else { |
|
|
|
this.$message.error((data && data.msg) || '回滚状态失败') |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
this.$message.error((err && err.message) || '回滚状态失败') |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生成发货弹窗默认模型。 |
|
|
|
* 说明:所有数量字段默认按 0 初始化,避免出现 null 导致的显示/比较异常。 |
|
|
|
|