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