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.FGmanagement.PalletShift',
})
export class PalletShift extends VuexModule {
  SubmitCode: any = '';
  @MutationAction
  async out(params: any) {
    const result: any = await http.post(url.lanjuwms.FGmanagement.PalletShift.palletTransferConfirmation, params);
    const SubmitCode = result.code;
    return { SubmitCode };
  }
  scanquerydata: any = {};
  @MutationAction
  async scanquery(params: any) {
    const result: any = await http.post(url.lanjuwms.FGmanagement.PalletShift.palletScanning, {
      sn: params,
      factoryCode: session.FactoryCode,
    });
    const scanquerydata = result.data;
    return { scanquerydata };
  }
}

export default getModule(PalletShift);
