|
|
|
@ -1,16 +1,9 @@
|
|
|
|
|
import {
|
|
|
|
|
Action,
|
|
|
|
|
getModule,
|
|
|
|
|
Module,
|
|
|
|
|
Mutation,
|
|
|
|
|
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 httpjson from "@/utils/location";
|
|
|
|
|
import { Action, getModule, Module, Mutation, 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 httpjson from '@/utils/location';
|
|
|
|
|
|
|
|
|
|
class OrderInInfo {
|
|
|
|
|
checked?: boolean;
|
|
|
|
@ -29,12 +22,13 @@ class OrderInInfo {
|
|
|
|
|
namespaced: true,
|
|
|
|
|
dynamic: true,
|
|
|
|
|
store,
|
|
|
|
|
name: "raw.ingoods.dnReceipt",
|
|
|
|
|
name: 'raw.ingoods.dnReceipt',
|
|
|
|
|
})
|
|
|
|
|
export class ReceiptModule extends VuexModule {
|
|
|
|
|
// 是否有
|
|
|
|
|
isState = true;
|
|
|
|
|
sendSpot = "";
|
|
|
|
|
sendSpot = '';
|
|
|
|
|
code: any = '';
|
|
|
|
|
/**
|
|
|
|
|
* sap库存地点列表
|
|
|
|
|
*/
|
|
|
|
@ -42,7 +36,7 @@ export class ReceiptModule extends VuexModule {
|
|
|
|
|
/**
|
|
|
|
|
* 隐藏看单号
|
|
|
|
|
*/
|
|
|
|
|
dnNo = "";
|
|
|
|
|
dnNo = '';
|
|
|
|
|
/**
|
|
|
|
|
* 看单号查询结果
|
|
|
|
|
*/
|
|
|
|
@ -55,6 +49,8 @@ export class ReceiptModule extends VuexModule {
|
|
|
|
|
* 看单明细未通过明细
|
|
|
|
|
*/
|
|
|
|
|
orderInInfoListEx: OrderInInfo[] = [];
|
|
|
|
|
InventoryList: any = [];
|
|
|
|
|
InventoryItemList: any = [];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 库位列表
|
|
|
|
@ -129,7 +125,7 @@ export class ReceiptModule extends VuexModule {
|
|
|
|
|
loginName: session.loginName,
|
|
|
|
|
userDefined3: 1,
|
|
|
|
|
});
|
|
|
|
|
console.log("result", result);
|
|
|
|
|
console.log('result', result);
|
|
|
|
|
const cboPlaceList = result.data.records.map((_: any) => ({
|
|
|
|
|
label: _.sendSpot,
|
|
|
|
|
value: _.sendSpot,
|
|
|
|
@ -150,16 +146,12 @@ export class ReceiptModule extends VuexModule {
|
|
|
|
|
loginName: session.loginName,
|
|
|
|
|
});
|
|
|
|
|
const orderInInfo = list[0] || {};
|
|
|
|
|
const orderInInfoList = list.filter(
|
|
|
|
|
(_: OrderInInfo) => _.userDefined10 === "1"
|
|
|
|
|
);
|
|
|
|
|
const orderInInfoListEx = list.filter(
|
|
|
|
|
(_: OrderInInfo) => _.userDefined10 === "0"
|
|
|
|
|
);
|
|
|
|
|
const orderInInfoList = list.filter((_: OrderInInfo) => _.userDefined10 === '1');
|
|
|
|
|
const orderInInfoListEx = list.filter((_: OrderInInfo) => _.userDefined10 === '0');
|
|
|
|
|
// orderInInfoList.forEach((item: any) => {
|
|
|
|
|
// item.receiptAmount = item.requestAmount;
|
|
|
|
|
// });
|
|
|
|
|
localStorage.setItem("sendSpot", JSON.stringify(list[0].sendSpot) as any);
|
|
|
|
|
localStorage.setItem('sendSpot', JSON.stringify(list[0].sendSpot) as any);
|
|
|
|
|
return { dnNo, orderInInfo, orderInInfoList, orderInInfoListEx };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -168,20 +160,27 @@ export class ReceiptModule extends VuexModule {
|
|
|
|
|
* 查询盘点单号
|
|
|
|
|
* @param pddNo
|
|
|
|
|
*/
|
|
|
|
|
@Action
|
|
|
|
|
@MutationAction
|
|
|
|
|
async rawMaterialInventoryCheckRaw(pddNo: string) {
|
|
|
|
|
const { msg }: any = await http.post(
|
|
|
|
|
url.material.rawMaterialInventory.checkRaw,
|
|
|
|
|
{
|
|
|
|
|
pddNo,
|
|
|
|
|
factoryCode: session.factoryCode,
|
|
|
|
|
loginName: session.loginName,
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: msg,
|
|
|
|
|
const res: any = await http.post(url.material.rawMaterialInventory.checkRaw, {
|
|
|
|
|
pddNo,
|
|
|
|
|
factoryCode: session.factoryCode,
|
|
|
|
|
loginName: session.loginName,
|
|
|
|
|
});
|
|
|
|
|
const InventoryList = res.data;
|
|
|
|
|
const InventoryItemList = [];
|
|
|
|
|
InventoryList.forEach((item: any) => {
|
|
|
|
|
let arr = {
|
|
|
|
|
value: item.productCode,
|
|
|
|
|
label: item.productCode,
|
|
|
|
|
};
|
|
|
|
|
InventoryItemList.push(arr);
|
|
|
|
|
});
|
|
|
|
|
return { InventoryList, InventoryItemList };
|
|
|
|
|
// uni.showToast({
|
|
|
|
|
// icon: "none",
|
|
|
|
|
// title: msg,
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -193,20 +192,17 @@ export class ReceiptModule extends VuexModule {
|
|
|
|
|
*/
|
|
|
|
|
@Action
|
|
|
|
|
async checkRawProductCode(form: any) {
|
|
|
|
|
const { code, msg }: any = await http.post(
|
|
|
|
|
url.material.rawMaterialInventory.productCode,
|
|
|
|
|
{
|
|
|
|
|
productCode: form.productCode,
|
|
|
|
|
pddNo: form.pddNo,
|
|
|
|
|
factoryCode: session.factoryCode,
|
|
|
|
|
loginName: session.loginName,
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
const { code, msg }: any = await http.post(url.material.rawMaterialInventory.productCode, {
|
|
|
|
|
productCode: form.productCode,
|
|
|
|
|
pddNo: form.pddNo,
|
|
|
|
|
factoryCode: session.factoryCode,
|
|
|
|
|
loginName: session.loginName,
|
|
|
|
|
});
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: msg,
|
|
|
|
|
});
|
|
|
|
|
console.log("code:::", code, msg);
|
|
|
|
|
console.log('code:::', code, msg);
|
|
|
|
|
const isState = !!+code;
|
|
|
|
|
return { isState };
|
|
|
|
|
}
|
|
|
|
@ -219,16 +215,13 @@ export class ReceiptModule extends VuexModule {
|
|
|
|
|
*/
|
|
|
|
|
@Action
|
|
|
|
|
async checkRawCreateInfo(form: any) {
|
|
|
|
|
const { msg }: any = await http.post(
|
|
|
|
|
url.material.rawMaterialInventory.createInfo,
|
|
|
|
|
{
|
|
|
|
|
...form,
|
|
|
|
|
factoryCode: session.factoryCode,
|
|
|
|
|
loginName: session.loginName,
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
const { msg }: any = await http.post(url.material.rawMaterialInventory.createInfo, {
|
|
|
|
|
...form,
|
|
|
|
|
factoryCode: session.factoryCode,
|
|
|
|
|
loginName: session.loginName,
|
|
|
|
|
});
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: msg,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -240,20 +233,15 @@ export class ReceiptModule extends VuexModule {
|
|
|
|
|
* @param {string} pddNo
|
|
|
|
|
* @memberof ReceiptModule
|
|
|
|
|
*/
|
|
|
|
|
@Action
|
|
|
|
|
@MutationAction
|
|
|
|
|
async checkRawProductComplete(form: any) {
|
|
|
|
|
const { msg }: any = await http.post(
|
|
|
|
|
url.material.rawMaterialInventory.productComplete,
|
|
|
|
|
{
|
|
|
|
|
...form,
|
|
|
|
|
factoryCode: session.factoryCode,
|
|
|
|
|
loginName: session.loginName,
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: msg,
|
|
|
|
|
const res: any = await http.post(url.material.rawMaterialInventory.productComplete, {
|
|
|
|
|
...form,
|
|
|
|
|
factoryCode: session.factoryCode,
|
|
|
|
|
loginName: session.loginName,
|
|
|
|
|
});
|
|
|
|
|
const code = res.code;
|
|
|
|
|
return { code };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -263,20 +251,15 @@ export class ReceiptModule extends VuexModule {
|
|
|
|
|
* @param {string} pddNo
|
|
|
|
|
* @memberof ReceiptModule
|
|
|
|
|
*/
|
|
|
|
|
@Action
|
|
|
|
|
@MutationAction
|
|
|
|
|
async checkRawOrderComplete(pddNo?: string | null) {
|
|
|
|
|
const { msg }: any = await http.post(
|
|
|
|
|
url.material.rawMaterialInventory.orderComplete,
|
|
|
|
|
{
|
|
|
|
|
pddNo,
|
|
|
|
|
factoryCode: session.factoryCode,
|
|
|
|
|
loginName: session.loginName,
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: msg,
|
|
|
|
|
const res: any = await http.post(url.material.rawMaterialInventory.orderComplete, {
|
|
|
|
|
pddNo,
|
|
|
|
|
factoryCode: session.factoryCode,
|
|
|
|
|
loginName: session.loginName,
|
|
|
|
|
});
|
|
|
|
|
const code = res.code;
|
|
|
|
|
return { code };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -285,7 +268,7 @@ export class ReceiptModule extends VuexModule {
|
|
|
|
|
@MutationAction
|
|
|
|
|
async submitOrderInEnter() {
|
|
|
|
|
const list = (this.state as any).orderInInfoList.map((item: any) => {
|
|
|
|
|
item.orderStatus = item.checked ? "2" : "1";
|
|
|
|
|
item.orderStatus = item.checked ? '2' : '1';
|
|
|
|
|
return item;
|
|
|
|
|
});
|
|
|
|
|
const result: any = await http.post(url.material.DNorderin.enter, {
|
|
|
|
@ -295,22 +278,19 @@ export class ReceiptModule extends VuexModule {
|
|
|
|
|
list,
|
|
|
|
|
});
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: result.msg,
|
|
|
|
|
});
|
|
|
|
|
const orderInInfoList = result.list.sort(
|
|
|
|
|
(a: any, b: any) =>
|
|
|
|
|
Number(a.accountingStatus) - Number(b.accountingStatus)
|
|
|
|
|
);
|
|
|
|
|
const orderInInfoList = result.list.sort((a: any, b: any) => Number(a.accountingStatus) - Number(b.accountingStatus));
|
|
|
|
|
return { orderInInfoList };
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 修改库位
|
|
|
|
|
*/
|
|
|
|
|
@Action({ commit: "updateCheckedOrderInInfoListKw" })
|
|
|
|
|
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
|
|
|
|
|
async changeOrderInLocation(kw: string) {
|
|
|
|
|
await http.post("/wmspda/material/orderin/enter", {
|
|
|
|
|
await http.post('/wmspda/material/orderin/enter', {
|
|
|
|
|
warehouseCode: session.warehouseCode,
|
|
|
|
|
factoryCode: session.factoryCode,
|
|
|
|
|
loginName: session.loginName,
|
|
|
|
@ -318,12 +298,9 @@ export class ReceiptModule extends VuexModule {
|
|
|
|
|
});
|
|
|
|
|
return kw;
|
|
|
|
|
}
|
|
|
|
|
@Action({ commit: "updateCheckedOrderInInfoListKw" })
|
|
|
|
|
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
|
|
|
|
|
async queryByFactoryCodeAndWorkAreaCode(content: any) {
|
|
|
|
|
let res = await http.post(
|
|
|
|
|
"/wmspda/fg/queryByFactoryCodeAndWorkAreaCode",
|
|
|
|
|
content
|
|
|
|
|
);
|
|
|
|
|
let res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content);
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|