fix: 详情页消审状态判断并升至1.1.23
This commit is contained in:
@@ -61,12 +61,19 @@ export const STATUS_ACTION_CONFIG = {
|
|||||||
unapprove: { status: AUDIT_STATUS.PENDING, msg: '确认消审该单据?', apiKey: 'statusWait' },
|
unapprove: { status: AUDIT_STATUS.PENDING, msg: '确认消审该单据?', apiKey: 'statusWait' },
|
||||||
};
|
};
|
||||||
|
|
||||||
/** 审核 / 作废成功后播放的语音文案 */
|
/** 审核 / 消审 / 作废成功后播放的语音文案 */
|
||||||
export const STATUS_ACTION_VOICE = {
|
export const STATUS_ACTION_VOICE = {
|
||||||
approve: '审核成功',
|
approve: '审核成功',
|
||||||
|
unapprove: '消审成功',
|
||||||
void: '作废成功',
|
void: '作废成功',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** 将接口状态统一为数字,避免字符串导致按钮判断失效 */
|
||||||
|
export function toAuditStatus(status) {
|
||||||
|
const n = Number(status);
|
||||||
|
return Number.isFinite(n) ? n : DRAFT_AUDIT_STATUS;
|
||||||
|
}
|
||||||
|
|
||||||
// 出仓类型:当前后端仅提供「坯布其他出货单」一种类型的接口
|
// 出仓类型:当前后端仅提供「坯布其他出货单」一种类型的接口
|
||||||
export const BILL_TYPES = [
|
export const BILL_TYPES = [
|
||||||
{ value: 'other', label: '坯布其他出货单' },
|
{ value: 'other', label: '坯布其他出货单' },
|
||||||
@@ -127,11 +134,12 @@ export function normalizeOrder(order) {
|
|||||||
if (!order) return null;
|
if (!order) return null;
|
||||||
const normalizedItems = (order.item_data || []).map((item) => normalizeItem(item));
|
const normalizedItems = (order.item_data || []).map((item) => normalizeItem(item));
|
||||||
const itemData = groupItemData(normalizedItems);
|
const itemData = groupItemData(normalizedItems);
|
||||||
|
const auditStatus = toAuditStatus(order.audit_status);
|
||||||
return {
|
return {
|
||||||
id: order.id,
|
id: order.id,
|
||||||
order_no: order.order_no || '',
|
order_no: order.order_no || '',
|
||||||
audit_status: order.audit_status,
|
audit_status: auditStatus,
|
||||||
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[order.audit_status] || '',
|
audit_status_name: order.audit_status_name || AUDIT_STATUS_MAP[auditStatus] || '',
|
||||||
// 表头
|
// 表头
|
||||||
sale_system_id: order.sale_system_id || '',
|
sale_system_id: order.sale_system_id || '',
|
||||||
sale_system_name: order.sale_system_name || '',
|
sale_system_name: order.sale_system_name || '',
|
||||||
@@ -432,11 +440,13 @@ export function formatDisplayTime(value, format = 'YYYY-MM-DD') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function canScanAtStatus(status) {
|
export function canScanAtStatus(status) {
|
||||||
return [AUDIT_STATUS.PENDING, AUDIT_STATUS.REJECTED].includes(status);
|
const s = toAuditStatus(status);
|
||||||
|
return s === AUDIT_STATUS.PENDING || s === AUDIT_STATUS.REJECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isLockedOrderStatus(status) {
|
export function isLockedOrderStatus(status) {
|
||||||
return [AUDIT_STATUS.APPROVED, AUDIT_STATUS.VOIDED].includes(status);
|
const s = toAuditStatus(status);
|
||||||
|
return s === AUDIT_STATUS.APPROVED || s === AUDIT_STATUS.VOIDED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 分页拉取全部列表(直至末页) */
|
/** 分页拉取全部列表(直至末页) */
|
||||||
@@ -451,9 +461,14 @@ export function fetchAllOrderList(listFn, params = {}, pageSize = LIST_PAGE_SIZE
|
|||||||
return loadPage(1, []);
|
return loadPage(1, []);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 新增/编辑页底部:审核、作废 */
|
/** 新增/编辑页底部:审核、作废 / 已审核时消审 */
|
||||||
export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
||||||
if (!headerSaved || !orderId || !canScanAtStatus(status)) return [];
|
if (!headerSaved || !orderId) return [];
|
||||||
|
const s = toAuditStatus(status);
|
||||||
|
if (s === AUDIT_STATUS.APPROVED) {
|
||||||
|
return [{ label: '消审', action: 'unapprove' }];
|
||||||
|
}
|
||||||
|
if (!canScanAtStatus(s)) return [];
|
||||||
return [
|
return [
|
||||||
{ label: '审核', action: 'approve' },
|
{ label: '审核', action: 'approve' },
|
||||||
{ label: '作废', action: 'void' },
|
{ label: '作废', action: 'void' },
|
||||||
@@ -462,14 +477,15 @@ export function getFormStatusActionButtons(headerSaved, orderId, status) {
|
|||||||
|
|
||||||
/** 查看页底部:编辑、审核、作废 / 消审 */
|
/** 查看页底部:编辑、审核、作废 / 消审 */
|
||||||
export function getViewStatusActionButtons(status) {
|
export function getViewStatusActionButtons(status) {
|
||||||
if (status === AUDIT_STATUS.PENDING || status === AUDIT_STATUS.REJECTED) {
|
const s = toAuditStatus(status);
|
||||||
|
if (s === AUDIT_STATUS.PENDING || s === AUDIT_STATUS.REJECTED) {
|
||||||
return [
|
return [
|
||||||
{ label: '编辑', action: 'edit' },
|
{ label: '编辑', action: 'edit' },
|
||||||
{ label: '审核', action: 'approve' },
|
{ label: '审核', action: 'approve' },
|
||||||
{ label: '作废', action: 'void' },
|
{ label: '作废', action: 'void' },
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
if (status === AUDIT_STATUS.APPROVED) {
|
if (s === AUDIT_STATUS.APPROVED) {
|
||||||
return [{ label: '消审', action: 'unapprove' }];
|
return [{ label: '消审', action: 'unapprove' }];
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
"name" : "浩拓织厂",
|
"name" : "浩拓织厂",
|
||||||
"appid" : "__UNI__F79F300",
|
"appid" : "__UNI__F79F300",
|
||||||
"description" : "周尚-浩拓织厂",
|
"description" : "周尚-浩拓织厂",
|
||||||
"versionName" : "1.1.22",
|
"versionName" : "1.1.23",
|
||||||
"versionCode" : 122,
|
"versionCode" : 123,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"optimization" : {
|
"optimization" : {
|
||||||
|
|||||||
Reference in New Issue
Block a user