You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
1.9 KiB
TypeScript

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';
import vm from '@/main';
class OrderInInfo {
checked?: boolean;
poNo?: string;
kw?: string;
userDefined10?: string;
totalqty?: string;
orderStatus?: string;
}
@Module({
namespaced: true,
dynamic: true,
store,
name: 'raw.warehouse.rowScrap',
})
export class rowScrap extends VuexModule {
cboPlaceList = [];
poNo = '';
orderInInfo: OrderInInfo = new OrderInInfo();
orderInInfoList: OrderInInfo[] = [];
code: any = '';
ContainerCode: any = '';
/**
// * 查询看单号
* @param poNo
*/
@MutationAction
async takeOrder(order3: any) {
try {
const records: any = await http.post(url.warehouse.rowTransfer.list, {
...order3,
orderType: 'BF',
page: 1,
rows: 50,
factoryCode: session.factoryCode,
loginName: session.loginName,
});
const orderInInfoList = records.data.records;
orderInInfoList.forEach((item: any) => {
item.totalqty = 0;
});
const code = records.code;
return { orderInInfoList, code };
} catch {
vm.customToast(vm.$t('message.Warehouse_Tip11') as any);
}
}
@MutationAction
async onTakeoutConfirm(list: any) {
const records: any = await http.post(url.warehouse.rowTransfer.russia, list);
const code = records.code;
return { code };
}
@MutationAction
async searchBarcode(params: any) {
const res: any = await http.post(url.auth.query.barcode, {
factoryCode: session.factoryCode,
loginName: session.loginName,
barcode: params.barcode,
productCode: params.productCode,
locCode: params.locCode,
});
const ContainerCode = res.data;
return { ContainerCode };
}
}
export default getModule(rowScrap);