import { getModule, Module, MutationAction, VuexModule } from 'vuex-module-decorators'; import store from '@/store'; import http from '@/utils/request'; import { url } from '@/utils/url'; import { session } from '@/store/modules/session'; @Module({ namespaced: true, dynamic: true, store, name: 'page.raw.Materialinspection', }) export class Materialinspection extends VuexModule { WlList = []; orderNoItemList: any = []; selectList: any = []; @MutationAction async getCheckType() { const result: any = await http.get(url.lanjuquality.Materialinspection.getCheckType, { //loginName: session.loginName, params: { factoryCode: session.PoolName, }, }); const orderNoItemList = result.data; const selectList = result.data.map((item: any) => ({ label: item.checkName, value: item.orderCode, typeCode: item.typeCode, })); return { orderNoItemList, selectList }; } CheckTaskListall: any = []; @MutationAction async getCheckTaskListall(query: any) { const result: any = await http.get(url.lanjuquality.Materialinspection.getCheckTaskListall, { //loginName: session.loginName, params: query, }); const CheckTaskListall = result; return { CheckTaskListall }; } CheckTaskList: any = []; @MutationAction async getCheckTaskList(query: any) { const result: any = await http.get(url.lanjuquality.Materialinspection.getCheckTaskList, { //loginName: session.loginName, params: query, }); console.log(result, '11111'); const CheckTaskList = result.data; return { CheckTaskList }; } SubmitCode: any = ''; @MutationAction async commitCheckTaskList(params: any) { const result: any = await http.post(url.lanjuquality.Materialinspection.commitCheckTaskList, params); const SubmitCode: [] = result; return { SubmitCode }; } locList: any = []; @MutationAction async getBatchList(params: any) { const result: any = await http.post(url.lanjuquality.Materialinspection.getBatchList, params); console.log(result); const DictListoild: [] = result; const locList = DictListoild.map((item: any) => ({ label: item.batchCode, value: item.batchCode, })); return { locList }; } locList1: any = []; getDefectList: any = ''; @MutationAction async getDefectListPDA(params: any) { const result: any = await http.post(url.lanjuquality.Materialinspection.getDefectListPDA, params); console.log(result); const getDefectList: [] = result; const locList1 = getDefectList.map((item: any) => ({ label: item.defectSubclass, value: item.defectCode, })); return { locList1 }; } orderNoItemList1: any = []; selectList1: any = []; @MutationAction async getcheckLocList() { const result: any = await http.post(url.lanjuquality.Materialinspection.getcheckLocList, { factoryCode: session.PoolName, }); const orderNoItemList1 = result; console.log(result, 'wwwwwww'); const selectList1 = result.map((item: any) => ({ label: item.defectSubclass, value: item.defectCode, })); return { orderNoItemList1, selectList1 }; } orderNoItemList2: any = []; selectList2: any = []; @MutationAction async getQualitylimit() { const result: any = await http.post(url.lanjuquality.Materialinspection.getcheckLocList, { factoryCode: session.PoolName, }); const orderNoItemList2 = result; console.log(result, 'wwwwwww'); const selectList2 = result.map((item: any) => ({ label: item.defectSubclass, value: item.defectCode, })); return { orderNoItemList2, selectList2 }; } locList2: any = []; materialtypeList: any = ''; @MutationAction async getmaterialTypePDA() { const result: any = await http.get(url.lanjuquality.Materialinspection.getDictData, { //loginName: session.loginName, params: { dictType: 'material_type_oa', }, }); console.log(result); const materialtypeList: [] = result; const locList2 = materialtypeList.map((item: any) => ({ label: item.ymdTypeName, value: item.ymdType, })); return { locList2 }; } locList3: any = []; materialFromList: any = ''; @MutationAction async getmaterialFromListPDA() { const result: any = await http.get(url.lanjuquality.Materialinspection.getDictData, { //loginName: session.loginName, params: { dictType: 'material_from_oa', }, }); console.log(result); const materialFromList: [] = result; const locList3 = materialFromList.map((item: any) => ({ label: item.ymdTypeName, value: item.ymdType, })); return { locList3 }; } locList4: any = []; sampleaqlList: any = ''; @MutationAction async getsampleaqlList() { const result: any = await http.get(url.lanjuquality.Materialinspection.getDictData, { //loginName: session.loginName, params: { dictType: 'sample_aql', }, }); console.log(result); const sampleaqlList: [] = result; const locList4 = sampleaqlList.map((item: any) => ({ label: item.ymdTypeName, value: item.ymdType, })); return { locList4 }; } locList5: any = []; samplelevelList: any = ''; @MutationAction async getsamplelevelList() { const result: any = await http.get(url.lanjuquality.Materialinspection.getDictData, { //loginName: session.loginName, params: { dictType: 'sample_level', }, }); console.log(result); const samplelevelList: [] = result; const locList5 = samplelevelList.map((item: any) => ({ label: item.ymdTypeName, value: item.ymdType, })); return { locList5 }; } WeightInfoList: any = []; @MutationAction async getWeightInfo(query: any) { const result: any = await http.get(url.lanjuquality.Materialinspection.getWeightInfo, { //loginName: session.loginName, params: query, }); const WeightInfoList = result; return { WeightInfoList }; } // 自动判定 getAutoJudgeList: any = ''; @MutationAction async getAutoJudge(params: any) { const result: any = await http.post(url.lanjuquality.Materialinspection.getAutoJudge, params); const getAutoJudgeList: [] = result; return { getAutoJudgeList }; } } export default getModule(Materialinspection);