/*
|
* @Description: 工单流程卡Store
|
* @Author: Ben Lin
|
* @version:
|
* @Date: 2024-06-18 15:09:47
|
* @LastEditors: Ben Lin
|
* @LastEditTime: 2024-10-23 22:52:45
|
*/
|
import { defineStore } from 'pinia';
|
import { store } from '@/store';
|
import { GetWoPickList } from '/@/api/tigerapi/mes/wo';
|
import { ActionToJson } from '/@/utils/is';
|
import { WoFlowCardPrintJson } from '/@/api/tigerapi/model/mesModel';
|
|
interface WoFlowcardState {
|
curPrintInfo: WoFlowCardPrintJson[];
|
curOrderNo: string;
|
curCPInfo: any[];
|
}
|
|
export const useWoFlowcardStore = defineStore({
|
id: 'app-WoFlowcard',
|
state: (): WoFlowcardState => ({
|
curPrintInfo: [],
|
curOrderNo: '',
|
curCPInfo: [],
|
}),
|
getters: {
|
getCurPrintInfo(state): any[] {
|
return state.curPrintInfo;
|
},
|
getCurOrderNo(state): string {
|
return state.curOrderNo;
|
},
|
getCurCPInfo(state): any[] {
|
return state.curCPInfo;
|
},
|
},
|
actions: {
|
setCurPrintInfo(val: any[]) {
|
this.curPrintInfo = val;
|
},
|
setCurOrderNo(val: string) {
|
this.curOrderNo = val;
|
},
|
resetState() {
|
this.curPrintInfo = [];
|
this.curOrderNo = '';
|
this.curCPInfo = [];
|
},
|
/**
|
* @description: 获取工单备料信息
|
* @param {string} tid
|
* @return {*}
|
*/
|
async getWoPickList(code: string) {
|
this.setCurOrderNo(code);
|
const d = ActionToJson(await GetWoPickList(code));
|
this.setCurPrintInfo(d.Data);
|
},
|
async resetFunc(name, f, ByOrg: boolean) {
|
|
},
|
},
|
});
|
|
// Need to be used outside the setup
|
export function useQueryWithOut() {
|
return useWoFlowcardStore(store);
|
}
|