解耦工单和作业状态
This commit is contained in:
@@ -1,28 +1,31 @@
|
||||
import { defineStore } from "pinia";
|
||||
import { ref, reactive } from "vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import { reactive } from "vue";
|
||||
|
||||
export interface PwoInfo {
|
||||
code: string;
|
||||
id: string | number;
|
||||
orderType: string;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
export const usePwoStore = defineStore("pwo", () => {
|
||||
const code = ref('');
|
||||
const currentJob = ref({});
|
||||
const pwoInfo = reactive<PwoInfo>({
|
||||
code: "",
|
||||
id: "",
|
||||
orderType: "",
|
||||
});
|
||||
|
||||
function setCode(traceOrderCode: string) {
|
||||
code.value = traceOrderCode;
|
||||
function setInfo(info: PwoInfo) {
|
||||
Object.assign(pwoInfo, info);
|
||||
}
|
||||
|
||||
function setCurrentJob(job: any) {
|
||||
currentJob.value = job;
|
||||
}
|
||||
|
||||
function getCurrentJob() {
|
||||
return currentJob.value;
|
||||
function resetInfo() {
|
||||
Object.assign(pwoInfo, {});
|
||||
}
|
||||
|
||||
return {
|
||||
code,
|
||||
currentJob,
|
||||
setCode,
|
||||
setCurrentJob,
|
||||
getCurrentJob,
|
||||
}
|
||||
pwoInfo,
|
||||
setInfo,
|
||||
resetInfo,
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user