import { getModule, Module, MutationAction, VuexModule } from 'vuex-module-decorators';
import store from '@/store';
import http from '@/utils/request';
import { url } from '@/utils/url';
@Module({
  namespaced: true,
  dynamic: true,
  store,
  name: 'page.equipment.SparepartsInto',
})
export class SparepartsInto extends VuexModule {
  rowdata: any = [];
  orderNoItemList: any = [];
  @MutationAction
  async queryOrderNo(orderNo: any) {
    const result: any = await http.post(url.lanjuequipment.product.SparepartsInto.querySpareDetailBySpareCode, { materialCode: orderNo });
    const orderNoItemList = result.data;
    return { orderNoItemList };
  }
  getsparePartsInOutList: any = [];
  SubmitCode: any = '';
  @MutationAction
  // 点检：spotInspection
  // 巡检：inspection
  // 保养：maintenance
  async sparePartsInOutStorage(query: any) {
    const result: any = await http.post(
      url.lanjuequipment.product.SparepartsInto.sparePartsInOutStorage,
      query,
      //loginName: session.loginName,
    );
    const SubmitCode: [] = result;
    return { SubmitCode };
  }
}

export default getModule(SparepartsInto);
