- 新增 PurchaseOrderList、PurchaseOrderAuditList、PurchaseOrderApprovalList 三个列表组件 - 在 purchase/index.ts 中导出新增的三个组件 - 更新 purchaseOrder 常量配置,增加审核与审批相关的状态列表和映射 - 修改 PageList 组件从 globalStore 获取 loading 状态 - 调整部分页面路径配置 - 新增发票上传相关页面及功能实现 - 优化部分组件导入和状态管理逻辑
50 lines
1.4 KiB
TypeScript
50 lines
1.4 KiB
TypeScript
import { ActionType, PurchaseOrderAuditList } from "@/components";
|
|
import { useShareAppMessage } from "@tarojs/taro";
|
|
import { useRef, useState } from "react";
|
|
import hocAuth from "@/hocs/auth";
|
|
import { CommonComponent } from "@/types/typings";
|
|
import purchaseOrder from "@/constant/purchaseOrder";
|
|
|
|
export default hocAuth(function Page(props: CommonComponent) {
|
|
const { shareOptions } = props;
|
|
|
|
const [auditState, setAuditState] = useState<
|
|
BusinessAPI.PurchaseOrderPageQry["auditState"]
|
|
>("PENDING_QUOTE_APPROVAL");
|
|
|
|
const actionRef = useRef<ActionType>();
|
|
|
|
useShareAppMessage((res) => {
|
|
console.log("useShareAppMessage1", res, shareOptions);
|
|
// 如果是按钮触发的转发,使用默认配置
|
|
if (res.from === "button") {
|
|
return shareOptions;
|
|
}
|
|
// 页面转发使用设置的配置
|
|
return {};
|
|
});
|
|
|
|
return (
|
|
<PurchaseOrderAuditList
|
|
actionRef={actionRef}
|
|
toolbar={{
|
|
tabs: {
|
|
activeKey: "state",
|
|
defaultActiveKey: auditState!,
|
|
items: purchaseOrder.auditStateList,
|
|
onChange: (item) => {
|
|
setAuditState(
|
|
item as BusinessAPI.PurchaseOrderPageQry["auditState"],
|
|
);
|
|
actionRef.current?.reload();
|
|
},
|
|
},
|
|
}}
|
|
params={{
|
|
state: "WAITING_AUDIT",
|
|
auditState: auditState,
|
|
}}
|
|
/>
|
|
);
|
|
});
|