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.
192 lines
4.6 KiB
TypeScript
192 lines
4.6 KiB
TypeScript
import {
|
|
Action,
|
|
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 {
|
|
stoAmount?: 0;
|
|
stoNo?: string; //STO采购单号
|
|
orderAmount?: string; //单据总数
|
|
Allocated?: string; //已分配
|
|
Unallocated?: string; //未分配
|
|
}
|
|
|
|
@Module({
|
|
namespaced: true,
|
|
dynamic: true,
|
|
store,
|
|
name: "product.outbound.stoOutbound",
|
|
})
|
|
export class ReturningModule extends VuexModule {
|
|
/**
|
|
* 月台列表
|
|
*/
|
|
returningTypeList: any[] = [];
|
|
detailedList: any;
|
|
/**
|
|
* 物料列表
|
|
*/
|
|
materielList: any[] = [];
|
|
locationCodeList: any[] = [];
|
|
//条码扫描的返回的结果
|
|
oneMaterielDetail: any = {};
|
|
/**
|
|
* 订单号查询结果
|
|
*/
|
|
orderInInfo: OrderInInfo = new OrderInInfo();
|
|
//记账按钮的code码
|
|
code = "";
|
|
/**
|
|
* 委外出库单号查询
|
|
* @param orderNo
|
|
*/
|
|
@Action
|
|
async queryOrder(form: any) {
|
|
const result = await http.post(url.material.commission.goOut.queryOrder, {
|
|
...form,
|
|
loginName: session.loginName,
|
|
factoryCode: session.factoryCode,
|
|
});
|
|
const orderInInfo = result.data.records[0] || {};
|
|
return { orderInInfo };
|
|
}
|
|
/**
|
|
* 库位
|
|
*/
|
|
// @MutationAction
|
|
// async queryByFactoryCodeAndWorkAreaCode() {
|
|
// const list: [] = await http.post(url.material.commission.goOut.queryByFactoryCodeAndWorkAreaCode, {
|
|
// factoryCode: session.factoryCode,
|
|
// whCode: session.warehouseCode,
|
|
// loginName: session.loginName,
|
|
// });
|
|
// const locationCodeList = list.map((item: any) => ({
|
|
// label: item.locationCode,
|
|
// value: item.locationCode,
|
|
// }));
|
|
// return { locationCodeList };
|
|
// }
|
|
/**
|
|
* 获取物料
|
|
*
|
|
* @returns
|
|
* @memberof ReturningModule
|
|
*/
|
|
@MutationAction
|
|
async outInfo(poNo: string) {
|
|
const list: [] = await http.post(url.material.commission.goOut.outInfo, {
|
|
factoryCode: session.factoryCode,
|
|
poNo: poNo,
|
|
loginName: session.loginName,
|
|
});
|
|
const locationCodeList = list.map((item: any) => ({
|
|
label: item.locationCode,
|
|
value: item.locationCode,
|
|
}));
|
|
return { locationCodeList };
|
|
}
|
|
|
|
/**
|
|
* 提交
|
|
*/
|
|
@Action
|
|
async materialComplete(form: any) {
|
|
const res = await http.post(
|
|
url.material.commission.goOut.materialComplete,
|
|
{
|
|
factoryCode: session.factoryCode,
|
|
loginName: session.loginName,
|
|
...form,
|
|
}
|
|
);
|
|
console.log(res, ">>>>>res");
|
|
}
|
|
|
|
/**
|
|
* 扫条码
|
|
*/
|
|
@Action
|
|
async tluSubmit(list: any[]) {
|
|
const obj = {
|
|
barcode: list[0].barCode,
|
|
loginName: session.loginName,
|
|
};
|
|
let oneMaterielDetail: any = {};
|
|
const { data }: any = await http.post(
|
|
url.outbound.stoOutbound.checkScan,
|
|
obj
|
|
);
|
|
console.log("shneme a ", data.records);
|
|
oneMaterielDetail = data.records[0];
|
|
data.records[0].materialCode = list[0].productCode;
|
|
data.records[0].materialDesc = list[0].productDescZh;
|
|
console.log("aaaaa", oneMaterielDetail);
|
|
return oneMaterielDetail;
|
|
}
|
|
/**
|
|
* 确认按钮
|
|
* @param orderNo
|
|
*/
|
|
@MutationAction
|
|
async confirm(list: any[]) {
|
|
const { code, data } = await http.post(
|
|
url.outbound.stoOutbound.Bookkeeping,
|
|
list
|
|
);
|
|
console.log("res数据", data, code);
|
|
// if (code == '1') {
|
|
// uni.showToast({ icon: 'success', title: msg });
|
|
// } else {
|
|
// uni.showToast({ icon: 'none', title: msg });
|
|
// }
|
|
const materielList: any = [];
|
|
return { code, materielList };
|
|
}
|
|
|
|
@Action({ commit: "updateCheckedOrderInInfoListKw" })
|
|
async queryByFactoryCodeAndWorkAreaCode(content: any) {
|
|
let res = await http.post(
|
|
"/wmspda/fg/queryByFactoryCodeAndWorkAreaCode",
|
|
content
|
|
);
|
|
return res;
|
|
}
|
|
|
|
@Action
|
|
async queryOutsourcing(poNo: any) {
|
|
let res = await http.post(url.outbound.stoOutbound.outsourcingQueryOrder, {
|
|
poNo,
|
|
loginName: session.loginName,
|
|
factoryCode: session.factoryCode,
|
|
});
|
|
return res;
|
|
}
|
|
|
|
@Action
|
|
async submitOutsourcing(upload: any) {
|
|
let res = await http.post(
|
|
url.outbound.stoOutbound.materialComplete,
|
|
upload
|
|
);
|
|
return res;
|
|
}
|
|
//查询明细
|
|
@Action({ commit: "updateCheckedOrderInInfoListKw" })
|
|
async querydetaildlist(content: any) {
|
|
let res: any = await http.post("/material/outsourcing/outInfo", content);
|
|
console.log("明细》》》》》》》》》", res.list);
|
|
this.detailedList = res.data;
|
|
return res;
|
|
}
|
|
}
|
|
|
|
export default getModule(ReturningModule);
|