2025-12-19 15:54:26 +08:00
|
|
|
import { defineStore } from "pinia";
|
2025-12-29 08:59:29 +08:00
|
|
|
import { reactive } from "vue";
|
2025-12-19 15:54:26 +08:00
|
|
|
|
2025-12-29 08:59:29 +08:00
|
|
|
export interface PwoInfo {
|
|
|
|
|
code: string;
|
|
|
|
|
id: string | number;
|
|
|
|
|
orderType: string;
|
|
|
|
|
[key: string]: any;
|
|
|
|
|
}
|
2025-12-19 15:54:26 +08:00
|
|
|
|
2025-12-29 08:59:29 +08:00
|
|
|
export const usePwoStore = defineStore("pwo", () => {
|
|
|
|
|
const pwoInfo = reactive<PwoInfo>({
|
|
|
|
|
code: "",
|
|
|
|
|
id: "",
|
|
|
|
|
orderType: "",
|
|
|
|
|
});
|
2025-12-19 15:54:26 +08:00
|
|
|
|
2025-12-29 08:59:29 +08:00
|
|
|
function setInfo(info: PwoInfo) {
|
|
|
|
|
Object.assign(pwoInfo, info);
|
2025-12-19 15:54:26 +08:00
|
|
|
}
|
|
|
|
|
|
2025-12-29 08:59:29 +08:00
|
|
|
function resetInfo() {
|
|
|
|
|
Object.assign(pwoInfo, {});
|
2025-12-19 15:54:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {
|
2025-12-29 08:59:29 +08:00
|
|
|
pwoInfo,
|
|
|
|
|
setInfo,
|
|
|
|
|
resetInfo,
|
|
|
|
|
};
|
2025-12-19 15:54:26 +08:00
|
|
|
});
|