reception.uts 1.07 KB
import { reactive } from "vue";

export type ReceptionState = {
    booksList: UTSJSONObject[]
    customerInfo: null | UTSJSONObject
    customerKey: string
    receptionKey: string
    receptionStatus: string
    receptionTrack: UTSJSONObject[]
}

// 模块状态
export const receptionState = reactive({
	customerKey: "",
	customerInfo: null,
	receptionStatus: "",
	booksList: [],
	receptionKey: "",
	receptionTrack: []
} as ReceptionState);

// 模块变更方法 (Mutations)
export const setCustomerKey = (payload: string) => {
	receptionState.customerKey = payload;
};

export const setCustomerInfo = (payload: null | UTSJSONObject) => {
	receptionState.customerInfo = payload;
};

export const setReceptionStatus = (payload: string) => {
	receptionState.receptionStatus = payload;
};

export const setBookList = (payload: UTSJSONObject[]) => {
	receptionState.booksList = payload;
};

export const setReceptionKey = (payload: string) => {
	receptionState.receptionKey = payload;
};

export const setReceptionTrack = (payload: UTSJSONObject[]) => {
	receptionState.receptionTrack = payload;
};