cosmoim-852 fix 俄罗斯新增委外入库功能

master
hou 3 years ago
parent b5920e2d46
commit 3622c2cc5f

@ -858,6 +858,22 @@
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/commission/RUS-entrant/index",
"style": {
"navigationBarTitleText": "俄罗斯委外入库",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/commission/RUS-entrant/detail",
"style": {
"navigationBarTitleText": "俄罗斯入库明细",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/commission/goOut/index",
"style": {
@ -874,6 +890,22 @@
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/commission/RUS-Out/index",
"style": {
"navigationBarTitleText": "俄罗斯委外出库",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/commission/RUS-Out/detail",
"style": {
"navigationBarTitleText": "俄罗斯出库明细",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/product/warehouse/wholeScrap/detail",
"style": {

@ -0,0 +1,58 @@
/*
* @Author: zhou lei
* @Date: 2021-11-11 11:09:57
* @LastEditTime: 2021-12-14 10:13:18
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/pages/raw/commission/goOut/config.ts
* :910592680@qq.com 18669792120
*/
/**
*
*/
import vm from '@/main';
export const headers = [
{
label: vm.$t('message.CommissionedSingleNumber'),
key: 'poNo',
width: 200,
},
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 300,
},
{
label: vm.$t('message.CommissionedMaterielDesc'),
key: 'materialDesc',
width: 300,
},
{
label: vm.$t('message.CommissionedGoOutNumber'),
key: 'outAmount',
width: 200,
},
{
label: vm.$t('message.CommissionedLocation'),
key: 'wlCode',
width: 200,
},
];
export const detailHeader = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 301,
},
{
label: vm.$t('message.CommissionedLocation'),
key: 'wlCode',
width: 186,
},
{
label: vm.$t('message.product_Number'),
key: 'nowAmount',
width: 186,
},
];

@ -0,0 +1,74 @@
<template>
<view class="page-receipt-detail">
<view class="header">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" />
</view>
<view class="title">{{ $t('message.Pi_QueryResults') }}</view>
<view class="right"></view>
</view>
<view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="headers" :contents="model.detailedList" :show-vert-border="false"></wyb-table>
</view>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import { headers } from './config';
import model from './model';
@Component
export default class RawReceiptDetail extends BasePage {
model = model;
headers = headers;
}
</script>
<style lang="scss" scoped>
.page-receipt-detail {
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background-size: 100% 600rpx;
padding: 30rpx;
min-height: 100%;
padding-top: 118rpx;
padding-bottom: 162rpx;
.header {
position: fixed;
top: 36rpx;
left: 0;
right: 0;
display: flex;
height: 88rpx;
line-height: 88rpx;
color: #fff;
font-size: 34rpx;
font-weight: 500;
text-align: center;
.title {
flex: 3;
}
.left,
.right {
flex: 1;
}
.icon {
display: flex;
justify-content: center;
align-items: center;
width: 88rpx;
height: 88rpx;
}
}
.table-wrapper {
background-color: #fff;
}
.form {
background-color: #fff;
padding: 40rpx;
border-radius: 10rpx;
}
}
</style>

@ -0,0 +1,500 @@
<template>
<view class="page-raw-receipt">
<!-- 头部 -->
<view class="header" :style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
</view>
<view class="title">{{ $t('message.CommissionGoOut') }}</view>
<view class="right"></view>
</view>
<view class="content">
<!-- 单号 -->
<view class="single">
<view class="single-left">
<view>{{ $t('message.CommissionedSingleNumber') }}</view>
<u-search :placeholder="$t('message.InventoryPleaseScan')" v-model.trim="form.documentNo" @search="query" :show-action="false"></u-search>
</view>
<view class="single-right">
<u-button type="primary" @click="query">{{ $t('message.Query') }}</u-button>
</view>
</view>
<!-- 物料 -->
<view class="material">
<view class="material-left">
<view>{{ $t('message.CommissionedMaterielNo') }}</view>
<jPicker sureColor="#ff0000" style="width: 260rpx" @bindpicker="materialChoice" showKey="value" valKey="value" :val="every.materialCode" class="search" :options="materialList" />
</view>
</view>
<view class="material">
<view class="material-right">
<view class="material-right-title">{{ $t('message.CommissionedMaterielDesc') }}</view>
<view class="material-right-code" style="overflow: hidden">{{ every.materialDesc }}</view>
</view>
</view>
<!-- 需求数量 -->
<view class="number">
<view class="number-left">
<view class="number-left-title">{{ $t('message.CommissionedDemandData') }}</view>
<u-input v-model="every.orderAmount" placeholder=" " :type="type" :border="border" class="input" disabled style="padding: '0'; flex: 0.9" />
</view>
<view class="number-right">
<view class="number-right-title">{{ $t('message.Cumulative') }}</view>
<u-input placeholder=" " v-model="every.outAmount" :type="type" :border="border" class="input" style="padding: '0'" disabled />
</view>
</view>
<!-- 库位 -->
<view class="library">
<view class="library-left">
<view>{{ $t('message.CommissionedLocation') }}</view>
<jPicker sureColor="#ff0000" style="width: 230rpx" @bindpicker="LocationChoice" showKey="value" valKey="value" :val="wlCode.value" class="search" :options="Loc" />
</view>
<view class="library-right">
<view class="library-right-title">{{ $t('message.CommissionedThisNumber') }}</view>
<u-input :placeholder="$t('message.po_PleaseInput')" v-model="nowAmount" type="number" :border="border" class="input" />
</view>
</view>
<!-- 添加 -->
<view class="add">
<u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button>
</view>
<!-- 表格 -->
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="detailHeader" :contents="list" :show-vert-border="false" @onCellClick="deleteItem($event)"></wyb-table>
</view>
<!-- 底部按钮 -->
<view class="bottom-bar">
<u-row class="button-bar">
<u-col :span="4">
<u-button type="primary" @click="bill">{{ $t('message.CommissionedDetails') }}</u-button>
</u-col>
<!-- <u-col :span="3">
<u-button type="primary" @click="close">{{ $t('message.Closed') }}</u-button>
</u-col> -->
<u-col :span="4">
<u-button type="primary" @click="onSubmit">{{ $t('message.product_Upload') }}</u-button>
</u-col>
<u-col :span="4">
<u-button type="error" @click="uni.navigateBack()">{{ $t('message.po_Return') }}</u-button>
</u-col>
</u-row>
</view>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import jPicker from '@/components/J-Picker/jPicker.vue';
import { session } from '@/store/modules/session';
import { detailHeader } from './config';
import model from './model';
@Component({
components: {
jPicker,
},
})
export default class dnReceiptDom extends BasePage {
model = model;
detailHeader = detailHeader;
form: any = {
documentNo: '',
};
material: any = {};
materialList: any = [];
list: any = [];
every: any = '';
value = '';
type = 'text';
border = true;
nowAmount: any = '';
//
Loc: any = [];
//
wlCode: any = '';
materialIndex: any = null;
async QueryLoc() {
await this.model.queryItemLoc({
workArea: session.workareaCode,
loginName: session.loginName,
sendSpot: null,
materialCode: this.every.materialCode,
factoryCode: session.factoryCode,
});
this.Loc = [];
this.wlCode = '';
if (this.model.LocList.length == 0) {
uni.showModal({
content: this.$t('message.selected') as any,
showCancel: false,
confirmText: this.$t('message.workArea_Confirm') as any,
});
} else {
this.Loc = this.model.LocList;
this.wlCode = this.Loc[0];
}
}
empty() {
this.list = [];
this.wlCode = '';
this.nowAmount = '';
this.every = '';
this.materialList = [];
this.Loc = [];
}
async close() {
if (this.form.documentNo == '') {
this.customToast(this.$t('message.Commission_tips1') as any);
return;
}
uni.showModal({
content: this.$t('message.closing') as any,
cancelText: this.$t('message.product_Cancel') as any,
confirmText: this.$t('message.workArea_Confirm') as any,
success: async (res) => {
if (res.confirm) {
await this.model.closeCode(this.form.documentNo);
if (this.model.code == '1') {
this.customToast(this.$t('message.Warehouse_Tip9') as any);
this.empty();
this.form.documentNo == '';
}
} else if (res.cancel) {
return;
}
},
});
}
//
async query() {
this.list = [];
//this.wlCode = '';
this.nowAmount = '';
this.every = '';
if (this.form.documentNo == '') {
this.customToast(this.$t('message.Commission_tips1') as any);
return;
}
let res = await this.model.queryOutsourcing(this.form.documentNo);
this.material = res.data;
this.materialList = [];
this.material.forEach((item: any) => {
let pickerName: any = {};
pickerName.label = item.materialCode;
pickerName.value = item.materialCode;
this.materialList.push(pickerName);
});
this.every = this.material[0];
this.materialIndex = 0;
await this.QueryLoc();
}
// receiptAmount requestAmount
materialChoice(e: any) {
this.nowAmount = '';
this.material.forEach(async (item: any, index: any) => {
if (item.materialCode == e.pickerName.value) {
this.every = item;
this.materialIndex = index;
await this.QueryLoc();
return;
}
});
}
//
LocationChoice(e: any) {
this.wlCode = e.pickerName;
}
//
Add() {
if (!this.every) {
this.customToast(this.$t('message.Commission_tips6') as any);
return;
}
if (this.nowAmount == '' || this.wlCode == '') {
this.customToast(this.$t('message.Commission_tips2') as any);
return;
}
if (parseFloat(this.nowAmount) <= 0) {
this.customToast(this.$t('message.Commission_tips3') as any);
return;
}
let num: number = parseFloat(this.nowAmount) + parseFloat(this.every.outAmount);
if (num > parseFloat(this.every.orderAmount)) {
uni.showModal({
title: this.$t('message.Pi_tip') as any,
content: this.$t('message.demandQuantity') as any,
cancelText: this.$t('message.Cancel') as any,
confirmText: this.$t('message.workArea_Confirm') as any,
success: (res) => {
if (res.confirm) {
let arr = {
poNo: this.form.documentNo,
materialCode: this.every.materialCode,
loginName: this.session.loginName,
factoryCode: this.session.factoryCode,
wlCode: this.wlCode.label,
nowAmount: this.nowAmount,
};
this.list.push(arr);
this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount);
this.nowAmount = '';
} else if (res.cancel) {
return;
}
},
});
} else {
let arr = {
poNo: this.form.documentNo,
materialCode: this.every.materialCode,
loginName: this.session.loginName,
factoryCode: this.session.factoryCode,
wlCode: this.wlCode.label,
nowAmount: this.nowAmount,
};
this.list.push(arr);
this.material[this.materialIndex].outAmount += parseFloat(this.list[this.list.length - 1].nowAmount);
this.nowAmount = '';
}
}
deleteItem(e: any) {
uni.showModal({
content: this.$t('message.product_Delete') as any,
cancelText: this.$t('message.Cancel') as any,
confirmText: this.$t('message.workArea_Confirm') as any,
success: (res) => {
if (res.confirm) {
this.list.splice(e.contentIndex, 1);
let i: any;
this.material.forEach((item: any, index: any) => {
if (item.materialCode == e.lineData.materialCode) {
i = index;
}
});
this.material[i].outAmount -= parseFloat(e.lineData.nowAmount);
} else if (res.cancel) {
return;
}
},
});
}
async onSubmit() {
if (this.list == null || this.list.length == 0) {
this.customToast(this.$t('message.Commission_tips5') as any);
}
await this.model.submitOutsourcing(this.list);
this.empty();
await this.query();
}
async bill() {
if (this.form.documentNo == '') {
this.customToast(this.$t('message._tips6') as any);
return;
}
let person = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__') as any);
let content = {
loginName: person.session.user.loginName,
poNo: this.form.documentNo,
factoryCode: person.session.user.factoryCode,
};
await this.model.querydetaildlist(content);
this.toPage(this.page.raw.commission.goOut.detail);
}
}
</script>
<style lang="scss" scoped>
.page-raw-receipt {
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background-size: 100% 600rpx;
padding: 118rpx 30rpx 162rpx;
min-height: 100%;
.header {
position: fixed;
top: 36rpx;
left: 0;
right: 0;
z-index: 99;
display: flex;
height: 88rpx;
line-height: 88rpx;
color: #fff;
font-size: 34rpx;
font-weight: 500;
text-align: center;
.title {
flex: 3;
}
.left,
.right {
flex: 1;
}
.icon {
display: flex;
justify-content: center;
align-items: center;
width: 88rpx;
height: 88rpx;
}
}
.content {
width: 100%;
background: white;
border-radius: 15rpx;
padding: 10rpx;
.single {
width: 100%;
height: 100rpx;
display: flex;
.single-left {
width: 80%;
height: 100%;
display: flex;
view {
width: 130rpx;
height: 100%;
line-height: 100rpx;
}
}
.single-right {
button {
margin-top: 15rpx;
width: 150rpx;
height: 70rpx;
}
}
}
.material {
width: 100%;
height: 100rpx;
display: flex;
.material-left {
width: 100%;
height: 100%;
display: flex;
view {
width: 140rpx;
line-height: 100rpx;
}
.search {
padding-left: 9px;
}
}
}
.material {
width: 100%;
height: 100rpx;
display: flex;
.material-right {
width: 100%;
height: 100%;
display: flex;
.material-right-title {
width: 140rpx;
height: 100%;
line-height: 100rpx;
}
.material-right-code {
width: 80%;
height: 100%;
line-height: 100rpx;
text-align: left;
padding-left: 10px;
// line-height: 100rpx;
}
}
}
.number {
height: 100rpx;
display: flex;
.number-left {
width: 50%;
height: 100%;
display: flex;
.number-left-title {
width: 120rpx;
height: 100%;
line-height: 100rpx;
}
.input {
width: 200rpx;
height: 70rpx;
margin-top: 15rpx;
margin-left: 15rpx;
}
}
.number-right {
width: 50%;
height: 100%;
display: flex;
.number-right-title {
width: 120rpx;
height: 100%;
line-height: 100rpx;
text-align: center;
}
.input {
width: 200rpx;
height: 70rpx;
margin-top: 15rpx;
margin-left: 30rpx;
}
}
}
.library {
width: 100%;
height: 100rpx;
display: flex;
.library-left {
width: 50%;
height: 100%;
display: flex;
view {
width: 70rpx;
line-height: 100rpx;
}
.search {
padding-left: 1px;
text-align: center;
white-space: nowrap;
overflow: scroll;
}
}
.library-right {
width: 50%;
height: 100%;
display: flex;
.library-right-title {
width: 120rpx;
height: 100%;
line-height: 100rpx;
text-align: center;
}
.input {
width: 200rpx;
height: 70rpx;
margin-top: 15rpx;
margin-left: 30rpx;
}
}
}
.add {
width: 100%;
height: 100rpx;
position: relative;
button {
position: absolute;
top: 10rpx;
right: 20rpx;
}
}
}
.bottom-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 99;
background: #ffffff;
box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx;
}
}
</style>

@ -0,0 +1,199 @@
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.RUS-Out',
})
export class ReturningModule extends VuexModule {
/**
*
*/
returningTypeList: any[] = [];
detailedList: any;
/**
*
*/
materielList: any[] = [];
locationCodeList: any[] = [];
LocList: 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 };
}
//委外出库 关闭订单
@MutationAction
async closeCode(poNo: any) {
const res: any = await http.post(url.outbound.stoOutbound.close, {
poNo,
loginName: session.loginName,
factoryCode: session.factoryCode,
});
const code: any = res.code;
return { code };
}
//委外出库 初始化获取库位
// @Action({ commit: 'updateCheckedOrderInInfoListKw' })
@MutationAction
async queryCodeAndWorkAreaCode(content: any) {
const res: any = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content);
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', res);
const LocList = res;
console.log('LocList', LocList);
return { LocList };
}
@MutationAction
async queryItemLoc(params: any = {}) {
const res: any = await http.post(url.sortscan.save.queryWlByMat, params);
const LocList = [];
res.forEach((item: any) => {
const arr: any = {
label: item.locationCode,
value: item.locationCode + '(' + item.sendSpot + ')' + '(' + item.amount + ')',
};
LocList.push(arr);
});
return { LocList };
}
@Action
async queryOutsourcing(poNo: any) {
const res = await http.post(url.outbound.stoOutbound.outsourcingQueryOrder, {
poNo,
loginName: session.loginName,
factoryCode: session.factoryCode,
});
return res;
}
@Action
async submitOutsourcing(upload: any) {
const res = await http.post(url.outbound.stoOutbound.materialComplete, upload);
return res;
}
//查询明细
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
async querydetaildlist(content: any) {
const res: any = await http.post('/wmspda/material/outsourcing/outInfo', content);
console.log('明细》》》》》》》》》', res.list);
this.detailedList = res.data;
return res;
}
}
export default getModule(ReturningModule);

@ -0,0 +1,81 @@
/*
* @Author: zhou lei
* @Date: 2021-11-10 17:14:44
* @LastEditTime: 2021-12-14 10:13:56
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/pages/raw/commission/entrant/config.ts
* :910592680@qq.com 18669792120
*/
/**
*
*/
import vm from '@/main';
export const headers = [
{
label: vm.$t('message.CommissionedSingleNumber'),
key: 'poNo',
width: 200,
},
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 300,
},
{
label: vm.$t('message.CommissionedMaterielDesc'),
key: 'materialDesc',
width: 300,
},
{
label: vm.$t('message.CommissionedNumber'),
key: 'receiptAmount',
width: 200,
},
{
label: vm.$t('message.CommissionedLocation'),
key: 'sendSpot',
width: 200,
},
];
export const detailHeader = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 301,
},
{
label: vm.$t('message.CommissionedLocation'),
key: 'wlCode',
width: 186,
},
{
label: vm.$t('message.product_Number'),
key: 'nowAmount',
width: 186,
},
];
export const DNheader = [
{
label: vm.$t('message.Line'),
key: 'poLine',
},
{
label: vm.$t('message.po_OddNumbers'),
key: 'poNo',
width: 350,
},
{
label: vm.$t('message.Pi_materielNo'),
key: 'materialCode',
width: 350,
},
{
label: vm.$t('message.CommissionedLocation'),
key: 'wlCode',
},
{
label: vm.$t('message.product_Number'),
key: 'receiptAmount',
},
];

@ -0,0 +1,83 @@
<!--
* @Author: zhou lei
* @Date: 2021-12-14 09:59:02
* @LastEditTime: 2021-12-14 11:26:08
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/pages/raw/commission/entrant/detail.vue
* 联系方式:910592680@qq.com 18669792120 科海达信息技术有限公司
-->
<template>
<view class="page-receipt-detail">
<view class="header">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" />
</view>
<view class="title">{{ $t('message.Pi_QueryResults') }}</view>
<view class="right"></view>
</view>
<view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="headers" :contents="model.DNdetailedList" :show-vert-border="false"></wyb-table>
</view>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import { headers } from './config';
import model from './model';
@Component
export default class RawReceiptDetail extends BasePage {
model = model;
headers = headers;
}
</script>
<style lang="scss" scoped>
.page-receipt-detail {
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background-size: 100% 600rpx;
padding: 30rpx;
min-height: 100%;
padding-top: 118rpx;
padding-bottom: 162rpx;
.header {
position: fixed;
top: 36rpx;
left: 0;
right: 0;
display: flex;
height: 88rpx;
line-height: 88rpx;
color: #fff;
font-size: 34rpx;
font-weight: 500;
text-align: center;
.title {
flex: 3;
}
.left,
.right {
flex: 1;
}
.icon {
display: flex;
justify-content: center;
align-items: center;
width: 88rpx;
height: 88rpx;
}
}
.table-wrapper {
background-color: #fff;
}
.form {
background-color: #fff;
padding: 40rpx;
border-radius: 10rpx;
}
}
</style>

@ -0,0 +1,711 @@
<template>
<view class="page-raw-receipt">
<!-- 头部 -->
<view class="header" :style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" />
</view>
<view class="title">{{ $t('message.CommissionEntrant') }}</view>
<view class="right"></view>
</view>
<view class="content">
<!-- 单号 -->
<view class="single">
<view class="single-left">
<view>{{ $t('message.dn_OddNumbers') }}</view>
<u-search :placeholder="$t('message.dn_PleaseScan')" v-model.trim="form.documentNo" @search="query" :show-action="false"></u-search>
</view>
<view class="single-right">
<u-button type="primary" @click="query">{{ $t('message.Query') }}</u-button>
</view>
</view>
<!-- 采购单号 -->
<view class="Purchase-title">
<view class="Purchase">
<view>{{ $t('message.Purchase') }}</view>
<jPicker sureColor="#ff0000" style="width: 260rpx" @bindpicker="poListChoice" showKey="value" valKey="value" :val="poNo" class="search" :options="poList" />
</view>
</view>
<!-- 物料 -->
<view class="material">
<view class="material-left">
<view>{{ $t('message.Materiel') }}</view>
<jPicker sureColor="#ff0000" style="width: 260rpx" @bindpicker="materialChoice" showKey="value" valKey="value" :val="every.materialCode" class="search" :options="materialList" />
</view>
</view>
<view class="material"
><view class="material-right">
<view class="material-right-title">{{ $t('message.CommissionedMaterielDesc') }}</view>
<view class="material-right-code" style="overflow: hidden">{{ every.materialDesc }}</view>
</view>
</view>
<!-- 需求数量 -->
<view class="number">
<view class="number-left">
<view class="number-left-title">{{ $t('message.DemandQuantity') }}</view>
<u-input v-model="every.requestAmount" placeholder=" " :type="type" :border="border" class="input" disabled style="padding: '0'" />
</view>
<view class="number-right">
<view class="number-right-title">{{ $t('message.Cumulative') }}</view>
<u-input v-model="every.receiptAmount" placeholder="" :type="type" :border="border" class="input" disabled style="padding: '0'" />
<!-- <u-input v-model="allNum" :placeholder="$t('message.po_PleaseInput')" :type="type" :border="border" class="input" disabled /> -->
</view>
</view>
<!-- 库位 -->
<view class="library">
<view class="library-left">
<view>{{ $t('message.CommissionedLocation') }}</view>
<jPicker sureColor="#ff0000" style="width: 230rpx" @bindpicker="LocationChoice" showKey="value" valKey="value" :val="wl.value" class="search" :options="Location" />
</view>
<view class="library-right">
<view class="library-right-title">{{ $t('message.CommissionedThisNumber') }}</view>
<u-input v-model="receiptAmount" :placeholder="$t('message.po_PleaseInput')" type="number" :border="border" class="input" />
</view>
</view>
<!-- 容器编码 -->
<view class="single">
<view class="single-left">
<view>{{ $t('message.Container') }}:</view>
<u-search :placeholder="$t('message.PleaseScan')" style="z-index: 10000" v-model="Barcode" @search="searchBarcode" :show-action="false"></u-search>
</view>
</view>
<!-- 添加 -->
<view class="add">
<u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button>
</view>
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="headers" :contents="LocationList" :show-vert-border="false" @onCellClick="deleteItem($event)"></wyb-table>
</view>
<!-- 底部按钮 -->
<view class="bottom-bar">
<u-row class="button-bar">
<u-col :span="4">
<u-button type="primary" @click="bill">{{ $t('message.CommissionedEntrantDetails') }}</u-button>
</u-col>
<u-col :span="4">
<u-button type="primary" @click="onSubmit">{{ $t('message.product_Upload') }}</u-button>
</u-col>
<u-col :span="4">
<u-button type="error" @click="uni.navigateBack({})">{{ $t('message.po_Return') }}</u-button>
</u-col>
</u-row>
</view>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import jPicker from '@/components/J-Picker/jPicker.vue';
import { session } from '@/store/modules/session';
import model from './model';
import LocationDetail from './model.location';
import { DNheader } from './config';
import { url } from '@/utils/url';
@Component({
components: {
jPicker,
},
})
export default class dnReceiptDom extends BasePage {
model = model;
form: any = {
documentNo: '',
};
//
material: any = [];
poList: any = [];
materialList: any = [];
//
every: any = {};
everyIndex: any = '';
value = '';
headers = DNheader;
type = 'text';
//
DNReceivingList: any = [];
border = true;
//
receiptAmount: any = '';
//
Location: LocationDetail[] = [];
//
LocationList: any = [];
//
wl: any = {
value: null,
};
//
poNo: any = null;
//
requestAmount: number = null;
//
Barcode: any = '';
Container: any = '';
//
async onShow() {
await this.queryLoction();
}
async queryLoction() {
this.Location = [];
let sendSpot = JSON.parse(uni.getStorageSync('sendSpot') as any);
let content = {
loginName: session.loginName,
sendSpot: sendSpot,
factoryCode: session.factoryCode,
workArea: session.workareaCode,
};
let res: any = await this.model.queryList(content);
res.forEach((item: LocationDetail) => {
let pickerName: any = {};
pickerName.label = item.locationCode;
pickerName.value = item.locationCode + '(' + item.sendSpot + ')';
pickerName.sendSpot = item.sendSpot;
this.Location.push(pickerName);
});
this.wl = this.Location[0];
}
// ````````````
async initLocation(condition): Promise<LocationDetail[]> {
console.log('condition>>>>>>>>>>>>>>>>>>.', condition);
//
let list: Array<LocationDetail> = [];
let means: any = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__') as any);
let sendSpot = JSON.parse(uni.getStorageSync('sendSpot') as any);
let content = {
loginName: means.session.user.loginName,
sendSpot: sendSpot,
factoryCode: means.session.user.factoryCode,
workArea: session.workareaCode,
};
let res: any = await this.model.queryList(content);
console.log('>>>>>>>>>>>>>>', res);
res.forEach((item: LocationDetail) => {
if (item.sendSpot === condition.sendSpot) {
let pickerName: any = {};
pickerName.label = item.locationCode;
pickerName.value = item.locationCode + '(' + item.sendSpot + ')';
pickerName.sendSpot = item.sendSpot;
list.push(pickerName);
}
});
return list;
}
//
async query() {
this.empty();
if (!this.form.documentNo) {
this.customToast(this.$t('message.Commission_tips1') as any);
return;
}
await this.model.subcDnInfo(this.form.documentNo);
if (model.code == '1') {
if (this.model.orderInInfoList.length == 0) {
this.empty();
return;
}
console.log('sssssssssssssssssssssss', this.model.dnNo);
uni.showToast({
//icon: 'success',
title: this.$t('message.successful') as any,
duration: 2000,
image: '/static/icons/icon-51.png',
});
let list: any = uni.getStorageSync('list');
uni.removeStorageSync('list');
this.material = JSON.parse(list);
this.DNReceivingList = JSON.parse(list);
this.DNReceivingList.forEach((item: any) => {
item.wllist = [];
});
this.poList = [...this.DNReceivingList]; //
let arr = this.removeDuplicates(this.poList, 'poNo');
//
arr.forEach((item: any) => {
item.label = item.poNo;
item.value = item.poNo;
});
this.poList = arr;
//
this.poListChoice({
pickerName: this.poList.find(() => true),
});
}
}
//
// list valueKey
//
removeDuplicates(list, valueKey: string) {
let temp = {};
let arr = [];
arr = list.reduce(function (item, next) {
temp[next[valueKey]] ? '' : (temp[next[valueKey]] = true && item.push(next));
return item;
}, []);
return arr;
}
// ADD
totalLocation(list: []) {
const receiptAmount = list.reduce((total: number, nextItem: any): any => {
return total + +nextItem.receiptAmount;
}, 0);
return receiptAmount;
}
//
poListChoice(e: any) {
this.receiptAmount = '';
this.poNo = e.pickerName.value;
//
// this.materialList = JSON.parse(JSON.stringify(this.removeDuplicates(this.material, 'materialCode')));
this.materialList = JSON.parse(JSON.stringify(this.material));
console.log('this.materialList??>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', this.materialList);
// poNo
this.materialList = this.materialList.filter((item: any) => {
if (item.poNo == e.pickerName.value) {
item.label = item.materialCode;
item.value = item.materialCode;
return true;
}
});
console.log('this.materialList', this.materialList);
//
this.materialChoice({
pickerName: this.materialList.find(() => true),
});
}
// receiptAmount requestAmount
async materialChoice(e: any) {
this.receiptAmount = '';
//
this.every = { ...e.pickerName };
//
console.log('this.every', this.every);
this.Location = [];
//
this.Location = await this.initLocation(this.every);
if (this.Location.length == 0) {
await this.queryLoction();
}
//
this.LocationChoice({
pickerName: this.Location.find(() => true),
});
this.DNReceivingList.forEach((item: any, index: any) => {
if (item.poNo == this.every.poNo && item.materialCode == this.every.materialCode && item.poLine == this.every.poLine) {
this.everyIndex = index;
}
});
this.every = this.DNReceivingList[this.everyIndex];
this.receiptAmount = parseFloat(this.every.requestAmount);
console.log('this.every', this.every);
}
//
LocationChoice(e: any) {
this.wl = e.pickerName;
}
//
async searchBarcode() {
if (this.Barcode == '') {
this.customToast(this.$t('message.barcode') as string);
return;
}
let params = {
productCode: this.every.materialCode,
barcode: this.Barcode,
// locCode: this.Some.originWl,
};
await this.model.searchBarcode(params);
this.Container = this.model.ContainerCode;
this.receiptAmount = this.Container.qty;
}
//
Add() {
// if (this.Container == '') {
// this.customToast(this.$t('message.scanningContainer') as any);
// return;
// }
// if (this.Container.cpRef4 == null) {
// if (parseFloat(this.receiptAmount) > this.Container.qty) {
// this.customToast(this.$t('message.AppendMateriel3') as any);
// return;
// }
// } else {
// if (parseFloat(this.receiptAmount) > this.Container.qty - parseFloat(this.Container.cpRef4)) {
// this.customToast(this.$t('message.AppendMateriel3') as any);
// return;
// }
// }
// let num: number = 0;
// if (this.LocationList.length != 0) {
// this.LocationList.forEach((item: any) => {
// if (item.palletCode == this.Container.barcode) {
// num += item.receiptAmount;
// }
// });
// }
// if (this.Container.cpRef4 == null) {
// if (parseFloat(this.receiptAmount) + num > this.Container.qty) {
// this.customToast(this.$t('message.AppendMateriel3') as any);
// return;
// }
// } else {
// if (parseFloat(this.receiptAmount) + num > this.Container.qty - parseFloat(this.Container.cpRef4)) {
// this.customToast(this.$t('message.AppendMateriel3') as any);
// return;
// }
// }
const count = parseFloat(this.every.requestAmount);
if (this.receiptAmount == '' || !this.wl.value) {
this.customToast(this.$t('message.Commission_tips2') as any);
return;
}
if (parseFloat(this.receiptAmount) <= 0) {
this.customToast(this.$t('message.Commission_tips3') as any);
return;
}
if (parseFloat(this.receiptAmount) > count || parseFloat(this.receiptAmount) + parseFloat(this.every.receiptAmount) > count) {
this.customToast(this.$t('message.Commission_tips4') as any);
return;
}
let isTrue = true;
if (isTrue == true) {
this.LocationList.push({
...this.every,
receiptAmount: this.receiptAmount,
wlCode: this.wl.label,
// palletCode: this.Container.barcode,
palletCode: this.Barcode,
});
this.DNReceivingList[this.everyIndex].wllist.push(this.LocationList[this.LocationList.length - 1]);
let num: any = 0;
this.DNReceivingList[this.everyIndex].wllist.forEach((item: any) => {
num += parseFloat(item.receiptAmount);
item.wllist = null;
});
this.DNReceivingList[this.everyIndex].receiptAmount = num;
this.receiptAmount = '';
this.every = this.DNReceivingList[this.everyIndex];
}
}
deleteItem(e: any) {
uni.showModal({
content: this.$t('message.product_Delete') as string,
cancelText: this.$t('message.Cancel') as string,
confirmText: this.$t('message.workArea_Confirm') as string,
success: (res) => {
if (res.confirm) {
this.LocationList.splice(e.contentIndex, 1);
let externalIndex = 0;
this.DNReceivingList.forEach((item: any, index: any) => {
if (item.poNo == e.lineData.poNo && item.materialCode == e.lineData.materialCode && item.poLine == e.lineData.poLine) {
externalIndex = index;
}
});
let inside = 0;
this.DNReceivingList[externalIndex].wllist.forEach((item: any, index: any) => {
if (item.receiptAmount == e.lineData.receiptAmount && item.wlCode == e.lineData.wlCode) {
inside = index;
}
});
this.DNReceivingList[externalIndex].wllist.splice(inside, 1);
let num = 0;
this.DNReceivingList[externalIndex].wllist.forEach((item: any) => {
num += parseFloat(item.receiptAmount);
});
this.DNReceivingList[externalIndex].receiptAmount = num;
} else if (res.cancel) {
return;
}
},
});
}
//
async resetForm() {
// this.form.documentNo = '';
// add table
this.LocationList = [];
//
this.Location = [];
this.poNo = '';
this.poList = [];
//
this.wl = {
value: null,
};
//
this.every = {};
//
// this.material = [];
//
this.materialList = [];
//
this.receiptAmount = null;
this.DNReceivingList = [];
this.Barcode = '';
this.Container = '';
await this.query();
}
empty() {
this.LocationList = [];
this.Location = [];
this.poNo = '';
this.poList = [];
this.wl = {
value: null,
};
this.every = {};
this.materialList = [];
this.receiptAmount = null;
this.DNReceivingList = [];
this.Barcode = '';
this.Container = '';
}
async onSubmit() {
if (this.LocationList.length === 0) {
this.customToast(this.$t('message.Commission_tips5') as any);
return null;
}
let isTrue = true;
this.DNReceivingList.forEach((item: any) => {
if (item.wllist.length != 0) {
let num = 0;
item.wllist.forEach((item: any) => {
num += parseFloat(item.receiptAmount);
});
if (num != parseFloat(item.requestAmount) && isTrue == true) {
this.customToast(this.$t('message.Pi_tip15') as any);
return (isTrue = false);
}
}
});
if (isTrue) {
await this.model.submitOrderInEnter(this.DNReceivingList);
if (this.model.SubmitCode == '1') {
const ServeUrl = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__'));
uni.request({
url: ServeUrl.server.address + url.material.DNorderin.subcDnInfo,
method: 'POST',
data: {
dnNo: this.form.documentNo,
factoryCode: session.factoryCode,
loginName: session.loginName,
},
success: (res: any) => {
console.log(res.data);
if (res.data.code != '0' && res.data.list != null) {
// this.empty();
this.resetForm();
} else if (res.data.code == '0' && res.data.list == null) {
this.empty();
this.form.documentNo = '';
}
},
});
}
}
}
async bill() {
if (this.form.documentNo == '') {
this.customToast(this.$t('message._tips6') as any);
return;
}
let person = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__') as any);
let content = {
loginName: person.session.user.loginName,
dnNo: this.form.documentNo,
};
await this.model.queryBill(content);
this.toPage(this.page.raw.commission.entrant.detail);
}
}
</script>
<style lang="scss" scoped>
.page-raw-receipt {
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background-size: 100% 600rpx;
padding: 118rpx 30rpx 162rpx;
min-height: 100%;
.header {
position: fixed;
top: 36rpx;
left: 0;
right: 0;
z-index: 99;
display: flex;
height: 88rpx;
line-height: 88rpx;
color: #fff;
font-size: 34rpx;
font-weight: 500;
text-align: center;
.title {
flex: 3;
}
.left,
.right {
flex: 1;
}
.icon {
display: flex;
justify-content: center;
align-items: center;
width: 88rpx;
height: 88rpx;
}
}
.content {
width: 100%;
background: white;
border-radius: 15rpx;
padding: 10rpx;
.single {
width: 100%;
height: 100rpx;
display: flex;
.single-left {
width: 80%;
height: 100%;
display: flex;
view {
width: 110rpx;
height: 100%;
line-height: 100rpx;
}
}
.single-right {
button {
margin-top: 15rpx;
width: 150rpx;
height: 70rpx;
}
}
}
.Purchase-title {
width: 100%;
.Purchase {
width: 60%;
height: 100%;
display: flex;
view {
width: 140rpx;
line-height: 100rpx;
}
}
}
// .material {
// width: 100%;
// height: 100rpx;
// display: flex;
// .material-left {
// width: 100%;
// height: 100%;
// display: flex;
// view {
// width: 100rpx;
// line-height: 100rpx;
// }
// }
// }
.material {
width: 100%;
height: 100rpx;
display: flex;
.material-left {
width: 100%;
height: 100%;
display: flex;
view {
width: 140rpx;
line-height: 100rpx;
text-align: left;
}
}
.material-right {
width: 100%;
height: 100%;
display: flex;
.material-right-title {
width: 140rpx;
height: 100%;
line-height: 100rpx;
}
.material-right-code {
width: 80%;
height: 100%;
line-height: 100rpx;
text-align: left;
padding-left: 10px;
}
}
}
.number {
height: 100rpx;
display: flex;
.number-left {
width: 45%;
height: 100%;
display: flex;
.number-left-title {
width: 120rpx;
height: 100%;
line-height: 100rpx;
}
.input {
width: 200rpx;
height: 70rpx;
margin-top: 15rpx;
margin-left: 15rpx;
}
}
.number-right {
width: 55%;
height: 100%;
display: flex;
.number-right-title {
width: 140rpx;
height: 100%;
//text-align: center;
line-height: 100rpx;
}
.input {
width: 200rpx;
height: 70rpx;
margin-top: 15rpx;
margin-left: 15rpx;
}
}
}
// .add {
// width: 100%;
// height: 100rpx;
// position: relative;
// button {
// position: absolute;
// top: 10rpx;
// right: 20rpx;
// }
// }
.add {
width: 100%;
height: 100rpx;
position: absolute;
top: 406px;
left: 0;
button {
position: absolute;
top: 3rpx;
right: 35rpx;
z-index: 10000;
}
}
}
.bottom-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 99;
background: #ffffff;
box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx;
}
}
</style>

@ -0,0 +1,107 @@
/*
* @Author: zhou lei
* @Date: 2021-12-24 12:02:31
* @LastEditTime: 2021-12-24 14:33:54
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/pages/raw/ingoods/dnReceipt/model.location.ts
* :910592680@qq.com 18669792120
*/
/**
*
* @export
* @interface LocationDetail
*/
export default interface LocationDetail {
factoryCode?: string;
cosmoType?: null;
sapFactoryCode?: null;
user?: null;
loginName?: null;
sign?: null;
page?: number;
rows?: number;
schema?: null;
lastModifiedBy?: null;
gmtCreate?: null;
createdBy?: null;
createdByName?: null;
warehouseCode?: string;
warehouseName?: null;
warehouseType?: string;
workareaCode?: null;
createdDate?: null;
createdDateStr?: null;
createdDateMax?: null;
createdDateMaxStr?: null;
createdDateMin?: null;
createdDateMinStr?: null;
lastUpdBy?: null;
lastUpdByName?: null;
lastUpdDate?: null;
lastUpdDateStr?: null;
lastUpdDateMax?: null;
lastUpdDateMin?: null;
activeFlag?: string;
userDefined1?: null;
userDefined2?: null;
userDefined3?: null;
userDefined4?: null;
userDefined5?: null;
userDefined6?: null;
userDefined7?: null;
userDefined8?: null;
userDefined9?: null;
userDefined10?: null;
remark?: null;
createBy?: null;
gmtCreateMin?: null;
gmtCreateStr?: null;
gmtCreateMax?: null;
gmtModified?: null;
gmtModifiedStr?: null;
gmtModifiedMax?: null;
gmtModifiedMin?: null;
locationId?: null;
locationCode?: string;
shelfOrder?: null;
sendSpot?: string;
sendSpotDesc1?: string;
checkOrder?: null;
pickOrder?: null;
locationUse?: null;
pickFlag?: null;
isOpenKnFlag?: null;
locationType?: null;
locationAttr?: null;
turnDemand?: null;
stockEnv?: null;
regionCode?: string;
areaCode?: string;
checkCode?: null;
workArea?: string;
port1?: null;
port2?: null;
port3?: null;
volumeLimit?: null;
weightLimit?: null;
boxLimit?: null;
qtyLimit?: null;
palletLimit?: null;
length?: null;
width?: null;
height?: null;
xcoordinate?: null;
ycoordinate?: null;
zcoordinate?: null;
xpixels?: null;
ypixels?: null;
zpixels?: null;
locRow?: null;
layerNum?: null;
locColumn?: null;
bord?: null;
productMix?: null;
batchMix?: null;
ignoreId?: null;
}

@ -0,0 +1,301 @@
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 LocationDetail from './model.location';
// import vm from '@/main';
class OrderInInfo {
stoAmount?: 0;
stoNo?: string; //STO采购单号
dnNo?: string;
orderAmount?: string; //单据总数
Allocated?: string; //已分配
Unallocated?: string; //未分配
userDefined10: string;
SubmitCode?: string;
}
@Module({
namespaced: true,
dynamic: true,
store,
name: 'product.outbound.RUS-stoOutbound',
})
export class ReturningModule extends VuexModule {
/**
*
*/
returningTypeList: any[] = [];
detailedList: any;
SubmitCode: any = '';
/**
*
*/
materielList: any[] = [];
locationCodeList: any[] = [];
LoctionList: any[] = [];
dnNo = '';
closeCode: any = '';
DNdetailedList: any;
//条码扫描的返回的结果
oneMaterielDetail: any = {};
/**
*
*/
orderInInfo: OrderInInfo = new OrderInInfo();
orderInInfoList: OrderInInfo[] = [];
orderInInfoListEx: OrderInInfo[] = [];
//记账按钮的code码
code = '';
/**
*
* @param orderNo
*/
@Action
async queryOrder(form: any) {
const result = await http.post(url.material.commission.entrant.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 };
// }
/**
*
*/
@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');
}
/**
*
*
* @returns
* @memberof ReturningModule
*/
@MutationAction
async info(poNo: string) {
const list: [] = await http.post(url.material.commission.entrant.info, {
factoryCode: session.factoryCode,
poNo: poNo,
loginName: session.loginName,
});
const locationCodeList = list.map((item: any) => ({
label: item.locationCode,
value: item.locationCode,
}));
return { locationCodeList };
}
/**
*
*/
@MutationAction
async queryReturningTypeList() {
const list: [] = await http.post(url.outbound.stoOutbound.yuetaiType, {
factoryCode: session.factoryCode,
whCode: session.warehouseCode,
loginName: session.loginName,
});
const returningTypeList = list.map((item: any) => ({
label: item.dockName,
value: item.dockCode,
}));
return { returningTypeList };
}
/**
*
* @param orderNo
*/
@MutationAction
async queryOrderInInfo(stoNo: string) {
const result = await http.post(url.outbound.stoOutbound.info, {
stoNo,
deleteFlag: 2,
finalState: 3,
loginName: session.loginName,
});
let stoAmount = 0;
result.data.records.forEach((item: any) => {
stoAmount += item.orderAmount;
});
const materielList = result.data.records.map((item: any) => ({
label: item.materialCode,
value: item.stoItem,
...item,
}));
console.log('materielList', materielList);
if (result.data.records[0]) {
result.data.records[0].stoAmount = stoAmount;
}
const orderInInfo = result.data.records[0] || {};
return { orderInInfo, materielList };
}
@MutationAction
async subcDnInfo(dnNo: string) {
const { list, code }: any = await http.post(url.material.DNorderin.subcDnInfo, {
dnNo,
factoryCode: session.factoryCode,
loginName: session.loginName,
});
const orderInInfo = list[0] || {};
const orderInInfoList = list.filter((_: OrderInInfo) => _.userDefined10 === '1');
const orderInInfoListEx = list.filter((_: OrderInInfo) => _.userDefined10 === '0');
// orderInInfoList.forEach((item: any) => {
// item.receiptAmount = item.requestAmount;
// });
uni.setStorageSync('list', JSON.stringify(list) as any);
uni.setStorageSync('sendSpot', JSON.stringify(list[0].sendSpot) as any);
return { dnNo, orderInInfo, orderInInfoList, orderInInfoListEx, code };
}
@MutationAction
async submitOrderInEnter(list: any) {
// const list = (this.state as any).orderInInfoList.map((item: any) => {
// // item.orderStatus = item.checked ? "2" : "1";
// return item;
// });
const result: any = await http.post(url.material.DNorderin.subcDnEnterRussia, {
dnNo: this.dnNo,
// dnNo: list[0].dnNo,
factoryCode: session.factoryCode,
loginName: session.loginName,
list,
});
uni.showToast({
icon: 'none',
title: result.msg,
});
const SubmitCode = result.code;
const orderInInfoList = result.list.sort((a: any, b: any) => Number(a.accountingStatus) - Number(b.accountingStatus));
return { orderInInfoList, SubmitCode };
}
/**
*
*/
@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 };
}
@MutationAction
async queryByFactoryCodeAndWorkAreaCode(content: any) {
const res: any = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content);
const LoctionList = res;
return { LoctionList };
}
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
async queryList(content: any) {
const res = await http.post<LocationDetail>('wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content);
return res;
}
@MutationAction
async documentNoClose(poNo: any) {
const res: any = await http.post('/wmspda/material/outsourcing/into/close', {
loginName: session.loginName,
factoryCode: session.factoryCode,
poNo,
});
const closeCode = res.code;
return { closeCode };
}
@Action
async queryOutsourcing(poNo: any) {
const res = await http.post(url.outbound.stoOutbound.subcDnInfo, {
poNo,
loginName: session.loginName,
factoryCode: session.factoryCode,
});
return res;
}
@Action
async submitOutsourcing(upload: any) {
const res = await http.post(url.outbound.stoOutbound.submit, upload);
return res;
}
//查询明细
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
async querydetaildlist(content: any) {
const res: any = await http.post('/wmspda/material/outsourcing/into/info', content);
console.log('明细》》》》》》》》》', res.list);
this.detailedList = res.data;
return res;
}
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
async queryBill(content: any) {
const res: any = await http.post('/wmspda/material/getDnRecSn', content);
console.log('明细》》》》》》》》》', res.list);
this.DNdetailedList = res.list;
return res;
}
ContainerCode: any = '';
@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(ReturningModule);

@ -72,6 +72,7 @@ export const url = {
enter: '/wmspda/material/orderin/enter',
subcDnEnter: '/wmspda/material/orderin/subcDnEnter',
ImportEnter: '/wmspda/material/orderin/overseasDnEnter',
subcDnEnterRussia: '/wmspda/material/orderin/subcDnEnter/russia',
out: '/wmspda/material/orderin/out',
russia: '/wmspda/material/orderin/poinfo/overseas/russia',
enterrussia: '/wmspda/material/orderin/enter/overseas/russia',

Loading…
Cancel
Save