cosmoim-852 fix 重写俄罗斯本地DN收货

master
hou 3 years ago
parent c11071f502
commit e832ea8ba3

@ -402,6 +402,22 @@
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/ingoods/RUS-dnReceipt/dnReceiving",
"style": {
"navigationBarTitleText": "俄罗斯DN收货",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/ingoods/RUS-dnReceipt/Local-details",
"style": {
"navigationBarTitleText": "本地DN收货明细",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/ingoods/dnReceipt/idetailed",
"style": {

@ -0,0 +1,696 @@
<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.dn_ReceivingGoods') }}</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'" />
</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="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.detailed') }}</u-button>
</u-col>
<u-col :span="4">
<u-button type="primary" @click="Submit">{{ $t('message.po_Submit') }}</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 { headers } 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 = headers;
type = 'text';
//
DNReceivingList: any = [];
border = true;
//
receiptAmount: any = '';
//
Location: LocationDetail[] = [];
//
LocationList: any = [];
//
wl: any = {
value: null,
};
//
poNo: any = null;
//
requestAmount: number = null;
//
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.queryByFactoryCodeAndWorkAreaCode(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.queryByFactoryCodeAndWorkAreaCode(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.ImportQueryOrderInfo(this.form.documentNo);
if (model.code == '1') {
if (this.model.orderInInfoList.length == 0) {
this.empty();
return;
}
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));
// poNo
this.materialList = this.materialList.filter((item: any) => {
if (item.poNo == e.pickerName.value) {
item.label = item.materialCode;
item.value = item.materialCode;
return true;
}
});
//
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;
}
//
Add() {
// const count = this.totalLocation(this.LocationList);
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;
this.DNReceivingList[this.everyIndex].wllist.forEach((item: any) => {
if (item.wlCode == this.wl.label && item.materialCode == this.every.materialCode) {
this.customToast(this.$t('message.repeatedly') as any);
return (isTrue = false);
}
});
if (isTrue == true) {
this.LocationList.push({
...this.every,
receiptAmount: this.receiptAmount,
wlCode: this.wl.label,
});
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 = [];
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 = [];
}
debounce(fun: any, time: any) {
let timer: any;
return function () {
clearTimeout(timer);
let args = arguments;
timer = setTimeout(() => {
fun.apply(this, args);
}, time);
};
}
async onSubmit() {
if (this.LocationList.length === 0) {
this.customToast(this.$t('message.Commission_tips5') as any);
return null;
}
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.ImportInfo,
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 = '';
}
},
});
}
}
Submit() {
this.debounce(this.onSubmit(), 1000);
}
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.querydetaildlist(content);
this.toPage(this.page.raw.ingoods.dnReceipt.Local);
}
}
</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;
}
}
}
// .library {
// width: 100%;
// height: 100rpx;
// display: flex;
// .library-left {
// width: 50%;
// height: 100%;
// display: flex;
// view {
// width: 100rpx;
// line-height: 100rpx;
// }
// .search {
// padding-left: 30px;
// }
// }
// .library-right {
// width: 50%;
// height: 100%;
// display: flex;
// .library-right-title {
// width: 120rpx;
// height: 100%;
// 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;
}
}
}
.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,229 @@
<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.ImportPO') }}</view>
<view class="right"></view>
</view>
<view class="content">
<view class="single">
<view class="single-left">
<view>{{ $t('message.container') }}</view>
<u-search :placeholder="$t('message.Commission_tips1')" v-model.trim="containerCode" @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="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>
<view class="WPM-total">{{ $t('message.WPM') }} {{ total }} {{ $t('message.WPMtotal') }}</view>
<uni-segmented-control :current="current" :values="items" @click-item="onClickItem" styleType="button" activeColor="#007aff"></uni-segmented-control>
<view v-show="current === 0">
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="ImportPOReceiveListHeaders" :contents="model.ImportPOReceiveList" :show-vert-border="false"></wyb-table>
</view>
<view v-show="current === 1">
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="containerListHeaders" :contents="model.containerList" :show-vert-border="false"></wyb-table>
</view>
</view>
<view class="bottom-bar">
<u-row class="button-bar">
<u-col :span="6">
<u-button type="primary" @click="Submit">{{ $t('message.po_Submit') }}</u-button>
</u-col>
<u-col :span="6">
<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 { ImportPOReceiveListHeaders, containerListHeaders } from './config';
@Component({
components: {
jPicker,
},
})
export default class dnReceiptDom extends BasePage {
model = model;
ImportPOReceiveListHeaders = ImportPOReceiveListHeaders;
containerListHeaders = containerListHeaders;
total = 0;
async onShow() {
await this.queryLoction();
}
onReady() {
this.model.empty();
}
Location: any = [];
wl: any = '';
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.queryByFactoryCodeAndWorkAreaCode(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];
}
LocationChoice(e: any) {
this.wl = e.pickerName;
}
containerCode: any = '';
async query() {
if (!this.containerCode) {
this.customToast(this.$t('message.Commission_tips1') as any);
return;
}
await this.model.ImportPOReceive(this.containerCode);
if (this.model.code == '1') {
uni.showToast({
title: this.$t('message.successful') as any,
duration: 2000,
image: '/static/icons/icon-51.png',
});
}
}
current = 0;
items = [this.$t('message.POPlan'), this.$t('message.WPMInformation')];
onClickItem(e: any): void {
if (this.current != e.currentIndex) {
this.current = e.currentIndex;
}
}
async Submit(): Promise<void> {
if (!this.containerCode) {
this.customToast(this.$t('message.Commission_tips1') as any);
return;
}
let params = {
wlCode: this.wl.label,
containerCode: this.containerCode,
list: this.model.containerList,
};
await this.model.containerListSubmit(params);
if (this.model.code == '1') {
uni.showToast({
title: this.$t('message.success') as any,
duration: 2000,
image: '/static/icons/icon-51.png',
});
this.model.empty();
this.containerCode = '';
}
}
}
</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: 0;
left: 0;
right: 0;
z-index: 99;
display: flex;
height: 124rpx;
line-height: 124rpx;
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: 124rpx;
height: 124rpx;
}
}
.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;
}
}
}
.WPM-total {
width: 100%;
padding-top: 10px;
padding-bottom: 10px;
}
}
.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,83 @@
<!--
* @Author: zhou lei
* @Date: 2021-12-14 09:59:02
* @LastEditTime: 2021-12-15 14:45:16
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/pages/raw/ingoods/dnReceipt/Local-details.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,97 @@
<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">收货明细</view>
<view class="right"></view>
</view>
<view class="content">
<!-- 表格 -->
<u-table class="library-table">
<u-tr class="u-tr">
<u-th class="u-th">{{ $t('message.product_Location') }}</u-th>
<u-th class="u-th">{{ $t('message.product_Number') }}</u-th>
<u-th class="u-th">{{ $t('message.operation') }}</u-th>
</u-tr>
<u-tr class="u-tr" v-for="(item, index) in LocationList" :key="index">
<u-td class="u-td">{{ item.value.value }}</u-td>
<u-td class="u-td">{{ item.num }}</u-td>
<u-td class="u-td">
<div class="u-td" @click="deleteItem(index)">
{{ $t('message.product_Delete') }}
</div>
</u-td>
</u-tr>
</u-table>
</view>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import model from './model';
@Component
export default class dnReceiptDom extends BasePage {
model = model;
form: any = {
documentNo: '',
};
list: any = [];
wlCode = '';
value = '';
type = 'text';
border = true;
LocationList = [
{
value: {
value: '',
},
num: 0,
},
];
bookTypeChange(e: any) {
console.log(e);
}
deleteItem(index: any) {
console.log(index);
}
}
</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;
}
}
}
</style>

@ -0,0 +1,174 @@
/**
*
*/
import vm from '@/main';
export const headers = [
{
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',
},
{
label: vm.$t('message.Container'),
key: 'palletCode', //容器码
width: 700,
},
// {
// label: vm.$t('message.po_RemainingQuantity'),
// key: 'splitAmount',
// },
// {
// label: vm.$t('message.po_Location'),
// key: 'location',
// },
// {
// label: '物料详情',
// key: 'materialDesc',
// },
// {
// label: '收货数量',
// key: 'receiptAmount',
// },
// {
// label: '发货数量',
// key: 'requestAmount',
// },
// {
// label: '过账信息',
// key: 'accountingMessage',
// },
// {
// label: '应',
// key: 'y',
// },
// {
// label: '过账状态',
// key: 'accountingStatus',
// },
// {
// label: '采购订单号',
// key: 'poNo',
// },
// {
// label: '行号',
// key: 'poLine',
// },
// {
// label: '单位',
// key: 'dw',
// },
// {
// label: 'sap库存地点',
// key: 'kw',
// },
// {
// label: 'ID',
// key: 'rawOrderInId',
// },
// {
// label: '工厂',
// key: 'factoryCodeSap',
// },
// {
// label: '质检状态',
// key: 'qualityStatus',
// },
// {
// label: '供应商',
// key: 'supplyCode',
// },
// {
// label: '采购组',
// key: 'buyerGroup',
// },
// {
// label: '工位',
// key: 'sendSpot',
// },
// {
// label: 'mrp',
// key: 'mrpCode',
// },
];
export const ImportPOReceiveListHeaders = [
{
label: vm.$t('message.po_OddNumbers'),
key: 'poNo', //po单号
width: 350,
},
{
label: vm.$t('message.Line'),
key: 'poLine', //行项目
// width: 350,
},
{
label: vm.$t('message.Pi_materielNo'),
key: 'materialCode', //物料号
width: 350,
},
{
label: vm.$t('message.CommissionedMaterielDesc'),
key: 'materialDesc', //物料描述
width: 450,
},
{
label: vm.$t('message.po_DemandQuantity'),
key: 'poAmount', //需求数量
},
{
label: vm.$t('message.Pi_unit'),
key: 'unit', //单位
},
];
export const containerListHeaders = [
{
label: vm.$t('message.Container'),
key: 'palletCode', //容器码
width: 300,
},
{
label: vm.$t('message.po_OddNumbers'),
key: 'poNo', //po单号
width: 350,
},
{
label: vm.$t('message.Line'),
key: 'poLine', //行项目
// width: 350,
},
{
label: vm.$t('message.Pi_materielNo'),
key: 'materialCode', //物料号
width: 350,
},
{
label: vm.$t('message.CommissionedMaterielDesc'),
key: 'materialDesc', //物料描述
width: 450,
},
{
label: vm.$t('message.po_DemandQuantity'),
key: 'poAmount', //需求数量
},
{
label: vm.$t('message.Pi_unit'),
key: 'unit', //单位
},
];

@ -0,0 +1,125 @@
<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">看单明细未通过明细</view>
<view class="right"></view>
</view>
<view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" enable-check="multiple" show-left-and-right-border :headers="headers" :contents="model.orderInInfoListEx" :show-vert-border="false"></wyb-table>
</view>
<view class="bottom-bar">
<div class="extra">
<u-row class="bottom-info">
<u-col :span="3">{{ model.orderInInfoListEx.length }}</u-col>
<u-col :span="2"></u-col>
<u-col :span="4"></u-col>
<u-col :span="3"></u-col>
</u-row>
</div>
<div class="container">
<u-row>
<u-col :span="3"></u-col>
<u-col :span="3"></u-col>
<u-col :span="3"></u-col>
<u-col :span="3">
<u-button @click="uni.navigateBack()"></u-button>
</u-col>
</u-row>
</div>
</view>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import model from './model';
import { headers } from './config';
@Component
export default class RawReceiptDetailEx extends BasePage {
/**
* 页面Module
*/
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;
.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;
}
.bottom-bar {
z-index: 21;
position: fixed;
bottom: 0;
left: 0;
right: 0;
.container {
background: #ffffff;
box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx;
}
.extra {
background-color: #fff;
height: 72rpx;
line-height: 72rpx;
margin: 5px;
padding: 0 10px;
border-radius: 5px;
}
}
}
</style>

@ -0,0 +1,279 @@
<template>
<view class="page-receipt-detail">
<view class="header">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="gohome" />
</view>
<view class="title">{{ $t('message.dn_Detailed') }}</view>
<view class="right"></view>
</view>
<view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" enable-check="single" show-left-and-right-border :headers="headers" :contents="model.orderInInfoList" :show-vert-border="false"></wyb-table>
</view>
<view class="bottom-bar">
<!-- <div>
<u-button type="primary" class="appoint" size="medium" @click="appoint"
>指定库位</u-button
>
</div> -->
<div class="container">
<u-row>
<u-col :span="3">
<u-button type="warning" @click="model.checkAllOrderInInfoList(!model.isCheckedAll)">
{{ model.isCheckedAll ? this.$t('message.po_noSelectAll') : this.$t('message.po_SelectAll') }}
</u-button>
</u-col>
<u-col :span="3">
<u-button type="primary" class="appoint" @click="appoint">{{ $t('message.Pi_distribution') }}</u-button>
</u-col>
<u-col :span="3">
<u-button type="success" :loading="$wait.is('*submitOrderInEnter')" @click="onSubmit">
{{ $t('message.po_Submit') }}
</u-button>
</u-col>
<u-col :span="3">
<u-button type="error" @click="gohome">{{ $t('message.po_Return') }}</u-button>
</u-col>
</u-row>
</div>
</view>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import model from './model';
import { headers } from './config';
import jPicker from '@/components/J-Picker/jPicker.vue';
import { session } from '@/store/modules/session';
// @Component
@Component({
components: {
jPicker,
},
})
export default class RawReceiptDetail extends BasePage {
/**
* 页面Module
*/
model = model;
factoryCode = session.factoryCode;
locationCode = '';
/**
* 实际数量
*/
number = '';
/**
* 表头
*/
headers = headers;
dnNo = '';
onShow() {
this.model.queryLocation();
let ant: any = JSON.parse(uni.getStorageSync('material') as string);
let index: any = JSON.parse(uni.getStorageSync('index') as string);
this.model.orderInInfoList[index] = ant;
this.dnNo = JSON.parse(uni.getStorageSync('dnNo') as string);
uni.removeStorageSync('material');
uni.removeStorageSync('index');
}
gohome() {
this.toPage(this.page.raw.ingoods.dnReceipt.index);
uni.removeStorageSync('material');
uni.removeStorageSync('index');
uni.removeStorageSync('dnNo');
}
bookTypeChange(e: any) {
this.locationCode = e.pickerName.value;
}
/**
* 逐条修改
*/
changeNumber() {
if (!this.model.hasChecked) {
uni.showToast({
icon: 'none',
title: this.$t('message.dn_Select') as string,
});
return;
}
//
this.model.orderInInfoList.forEach((item: any) => {
if (item.checked) {
if (this.locationCode) {
item.location = this.locationCode;
}
if (this.number > item.requestAmount) {
uni.showToast({
icon: 'none',
title: this.$t('message.dn_Tip') as string,
});
return;
} else if (this.number == '') {
item.receiptAmount = item.requestAmount;
} else if (this.number < item.requestAmount) {
uni.showToast({
icon: 'none',
title: this.$t('message.dn_Tip3') as string,
});
item.receiptAmount = this.number;
} else {
item.receiptAmount = this.number;
}
}
});
}
appoint() {
let selectStatus = model.orderInInfoList.map((item) => {
if (item.checked == true) {
return true;
} else {
return false;
}
});
let i = 0;
selectStatus.forEach((item) => {
if (item == true) {
i++;
}
});
if (i > 1) {
uni.showToast({
icon: 'none',
title: '只能选择一个DN单' as string,
});
} else if (i == 0) {
uni.showToast({
icon: 'none',
title: '请选择一个DN单' as string,
});
} else {
let mater: number = selectStatus.indexOf(true);
uni.setStorageSync('mater', JSON.stringify(model.orderInInfoList[mater]) as string);
uni.setStorageSync('index', JSON.stringify(mater) as string);
this.redirectTo(this.page.raw.ingoods.dnReceipt.idetailed);
}
}
/**
* 提交
*/
async onSubmit() {
//
if (this.model.orderInInfoList.length === 0) {
uni.showToast({
icon: 'none',
title: this.$t('message.Pi_tip4') as string,
});
return;
}
//
let checkData: any = [];
this.model.orderInInfoList.forEach((item: any) => {
if (item.checked === true) {
checkData.push(item);
}
});
//
if (checkData.length == 0) {
uni.showToast({
icon: 'none',
title: '请先选中要提交的数据' as string,
});
return;
}
//
let isTrue = true;
checkData.forEach((item: any) => {
if (item.wllist == null || item.wllist.length == 0) {
uni.showToast({
icon: 'none',
title: '请确保所选数据都已分配库位' as string,
});
isTrue = false;
return;
}
});
if (isTrue == true) {
await this.model.submitOrderInEnter(checkData);
this.locationCode = '';
this.model.orderInInfo.carNo = '';
this.model.orderInInfo.bookingTime = '';
this.model.orderInInfo.supplyCode = '';
this.model.orderInInfo.poType = '';
this.model.orderInInfo.location = '';
this.model.queryOrderInInfo(this.dnNo);
await this.redirectTo(this.page.raw.ingoods.dnReceipt.detail);
}
}
}
</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;
.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;
}
.bottom-bar {
z-index: 21;
position: fixed;
bottom: 0;
left: 0;
right: 0;
.container {
background: #ffffff;
box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx;
}
.extra {
background-color: #fff;
margin: 5px;
border-radius: 5px;
padding: 0 10px;
}
}
}
</style>

@ -0,0 +1,772 @@
<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.dn_ReceivingGoods') }}</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="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="searchBarcode">{{ $t('message.Query') }}</u-button>
</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="config">
<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.detailed') }}</u-button>
</u-col>
<u-col :span="4">
<u-button type="primary" @click="Submit">{{ $t('message.po_Submit') }}</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 { headers } 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 = headers;
type = 'text';
//
DNReceivingList: any = [];
border = true;
//
receiptAmount: any = '';
//
Location: LocationDetail[] = [];
//
LocationList: any = [];
Barcode: any = '';
//
wl: any = {
value: null,
};
//
poNo: any = null;
//
requestAmount: number = null;
//
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.queryByFactoryCodeAndWorkAreaCode(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.queryByFactoryCodeAndWorkAreaCode(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.queryOrderInInfo(this.form.documentNo);
if (model.code == '1') {
if (this.model.orderInInfoList.length == 0) {
this.empty();
return;
}
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;
}
Container: any = {};
async searchBarcode() {
if (this.Barcode == '') {
this.customToast(this.$t('message.barcode') as string);
return;
}
if (this.materialList.length == 0) {
this.customToast(this.$t('message.AppendMateriel5') as string);
return;
}
let params = {
productCode: this.every.materialCode,
barcode: this.Barcode,
};
await this.model.searchBarcode(params);
this.Container = this.model.ContainerCode;
let num = 0;
if (this.LocationList.length != 0) {
this.LocationList.forEach((item: any) => {
if (item.palletCode == this.Container.barcode) {
num += parseFloat(item.receiptAmount);
}
});
}
if (this.Container.cpRef4 == null) {
this.receiptAmount = parseFloat(this.Container.qty) - num;
} else {
this.receiptAmount = parseFloat(this.Container.qty) - parseFloat(this.Container.cpRef4) - num;
}
}
//
Add() {
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 num = 0;
if (this.LocationList.length != 0) {
this.LocationList.forEach((item: any) => {
if (item.palletCode == this.Container.barcode) {
num += parseFloat(item.receiptAmount);
}
});
}
if (this.Container.cpRef4 == null) {
if (num + parseFloat(this.receiptAmount) > parseFloat(this.Container.qty)) {
this.customToast(this.$t('message.dn_Tip') as any);
return;
}
} else {
if (num + parseFloat(this.receiptAmount) > parseFloat(this.Container.qty) - parseFloat(this.Container.cpRef4)) {
this.customToast(this.$t('message.dn_Tip') as any);
return;
}
}
let isTrue = true;
this.DNReceivingList[this.everyIndex].wllist.forEach((item: any) => {
if (item.materialCode == this.every.materialCode && item.wlCode == this.wl.label) {
this.customToast(this.$t('message.repeatedly') as any);
return (isTrue = false);
}
});
if (isTrue == true) {
this.LocationList.push({
...this.every,
receiptAmount: this.receiptAmount,
wlCode: this.wl.label,
palletCode: this.Container.barcode,
});
this.DNReceivingList[this.everyIndex].wllist.push(this.LocationList[this.LocationList.length - 1]);
console.log('3 this.DNReceivingList[externalIndex].wllist', this.DNReceivingList[this.everyIndex].wllist);
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;
}
});
console.log('1 this.DNReceivingList[externalIndex].wllist', this.DNReceivingList[externalIndex].wllist);
this.DNReceivingList[externalIndex].wllist.splice(inside, 1);
console.log('2 this.DNReceivingList[externalIndex].wllist', this.DNReceivingList[externalIndex].wllist);
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 = [];
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 = [];
}
debounce(fun: any, time: any) {
let timer: any;
return function () {
clearTimeout(timer);
let args = arguments;
timer = setTimeout(() => {
fun.apply(this, args);
}, time);
};
}
async onSubmit() {
if (this.LocationList.length === 0) {
this.customToast(this.$t('message.Commission_tips5') as any);
return null;
}
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.info,
method: 'POST',
data: {
dnNo: this.form.documentNo,
factoryCode: session.factoryCode,
loginName: session.loginName,
},
success: (res: any) => {
if (res.data.code != '0' && res.data.list != null) {
this.resetForm();
} else if (res.data.code == '0' && res.data.list == null) {
this.empty();
this.form.documentNo = '';
}
},
});
}
}
Submit() {
this.debounce(this.onSubmit(), 1000);
}
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.querydetaildlist(content);
this.toPage(this.page.raw.ingoods.dnReceipt.Local);
}
}
</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;
}
}
}
// .library {
// width: 100%;
// height: 100rpx;
// display: flex;
// .library-left {
// width: 50%;
// height: 100%;
// display: flex;
// view {
// width: 100rpx;
// line-height: 100rpx;
// }
// .search {
// padding-left: 20px;
// }
// }
// .library-right {
// width: 50%;
// height: 100%;
// display: flex;
// .library-right-title {
// width: 120rpx;
// height: 100%;
// padding-left: 4px;
// line-height: 100rpx;
// }
// .input {
// width: 200rpx;
// height: 70rpx;
// margin-top: 15rpx;
// }
// }
// }
.add {
width: 100%;
height: 100rpx;
position: absolute;
top: 351px;
left: 0;
button {
position: absolute;
top: 3rpx;
right: 35rpx;
}
}
.config {
width: 100%;
height: 100rpx;
// position: absolute;
top: 420px;
left: 0;
button {
position: absolute;
top: 455px;
right: 35rpx;
}
}
}
.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,369 @@
<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.product_Location') }}</view>
<view class="right"></view>
</view>
<div class="content">
<div class="content-item">
<div class="item-left">{{ $t('message.po_MaterielNo') }}</div>
<div class="item-right">{{ this.material.materialCode }}</div>
</div>
<div class="content-item">
<div class="item-left">{{ $t('message.po_MaterielDes') }}</div>
<div class="item-right">{{ this.material.materialDesc }}</div>
</div>
<div class="content-item">
<div class="item-left">{{ $t('message.po_DemandQuantity') }}</div>
<div class="item-right">{{ this.material.requestAmount }}</div>
</div>
<div class="content-item">
<div class="item-left">{{ $t('message.po_ActualQuantity') }}</div>
<div class="item-right">{{ this.material.receiptAmount }}</div>
</div>
<div class="content-item">
<div class="item-left">{{ $t('message.po_Location') }}</div>
<div class="item-right">{{ this.material.location }}</div>
</div>
</div>
<div class="library">
<div class="title">{{ $t('message.product_Location') }}:</div>
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="wlCode" class="search" :options="list" />
</div>
<div class="library-num">
<div class="title">{{ $t('message.dn_Number') }}:</div>
<input type="text" placeholder="请输入数量" v-model="number" />
<u-button type="primary" size="medium" class="confirm" @click="confirm">{{ $t('message.product_add') }}</u-button>
</div>
<u-table class="library-table">
<u-tr class="u-tr">
<u-th class="u-th">{{ $t('message.product_Location') }}</u-th>
<u-th class="u-th">{{ $t('message.product_Number') }}</u-th>
<u-th class="u-th">{{ $t('message.operation') }}</u-th>
</u-tr>
<u-tr class="u-tr" v-for="(item, index) in LocationList" :key="index">
<u-td class="u-td">{{ item.value.value }}</u-td>
<u-td class="u-td">{{ item.num }}</u-td>
<u-td class="u-td">
<div class="u-td" @click="deleteItem(index)">
{{ $t('message.product_Delete') }}
</div>
</u-td>
</u-tr>
</u-table>
<view class="bottom-bar">
<div class="extra">
<u-row class="bottom-info">
<u-button type="primary" class="main" @click="Reservoir">{{ $t('message.product_Confirm') }}</u-button>
<u-col :span="2" v-if="factoryCode == '6662'"> { {$t('message.product_Location')}} </u-col>
</u-row>
</div>
</view>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import model from './model';
import { headers } from './config';
import jPicker from '@/components/J-Picker/jPicker.vue';
import { session } from '@/store/modules/session';
import combox from '@/components/J-Picker/jPicker.vue';
// @Component
@Component({
components: {
jPicker,
combox,
},
})
export default class RawReceiptDetail extends BasePage {
/**
* 页面Module
*/
model = model;
factoryCode = session.factoryCode;
locationCode = '';
/**
* 实际数量
*/
number = '';
wlCode: any = '';
material: any = {};
list: any = [];
LocationList: any = [];
documentNo = '';
/**
* 表头
*/
headers = headers;
async onReady() {
await this.model.queryLocation();
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.queryByFactoryCodeAndWorkAreaCode(content);
res.forEach((item: any) => {
let pickerName: any = {};
pickerName.label = item.locationCode;
pickerName.value = item.locationCode + '(' + item.sendSpot + ')';
pickerName.sendSpot = item.sendSpot;
this.list.push(pickerName);
});
let ant: any = uni.getStorageSync('mater');
this.material = JSON.parse(ant);
this.number = this.material.requestAmount;
uni.removeStorageSync('mater');
uni.removeStorageSync('sendSpot');
if ('wllist' in this.material) {
this.material.wllist.forEach((item: any) => {
let arr: any = {
value: item.wlCode,
};
let obj: any = {
value: arr,
num: item.receiptAmount,
};
this.LocationList.push(obj as never);
});
}
}
confirm() {
if (this.wlCode == '' || this.number == '') {
uni.showToast({
icon: 'none',
title: '请输入正确的库位和数量',
});
return;
}
if (parseFloat(this.number) <= 0) {
uni.showToast({
icon: 'none',
title: '请输入正确的库位和数量',
});
return;
}
if (this.LocationList.length != 0) {
this.LocationList.forEach((item: any) => {
if (item.value.sendSpot != this.wlCode.sendSpot) {
uni.showToast({
icon: 'none',
title: '请重新选择库位',
});
return;
}
});
let num = 0;
this.LocationList.forEach((item: any) => {
num += parseFloat(item.num);
});
num += parseFloat(this.number);
// if (num > parseFloat(this.material.requestAmount)) {
// uni.showToast({
// icon: "none",
// title: "",
// });
// return;
// }
let arr: any = {
value: this.wlCode,
num: this.number,
};
this.LocationList.push(arr as never);
this.material.receiptAmount = num;
this.number = '';
return;
}
if (this.LocationList.length == 0) {
// if (this.number > this.material.requestAmount) {
// uni.showToast({
// icon: "none",
// title: "",
// });
// return;
// }
let arr: any = {
value: this.wlCode,
num: this.number,
};
this.LocationList.push(arr as never);
this.material.receiptAmount = this.number;
this.number = '';
return;
}
}
deleteItem(index: any) {
this.LocationList.splice(index, 1);
}
bookTypeChange(e: any) {
this.wlCode = e.pickerName;
}
Reservoir() {
let wllist: Array<string> = [];
let requestAmountNum = 0;
this.LocationList.forEach((item: any) => {
let objString = JSON.stringify(this.material);
let TEM = JSON.parse(objString);
TEM.wlCode = item.value.label;
TEM.receiptAmount = item.num;
wllist.push(TEM);
let pras = parseInt(item.num);
requestAmountNum += pras;
});
this.material.wllist = null;
this.material.wllist = wllist;
this.material.receiptAmount = requestAmountNum;
uni.setStorageSync('material', JSON.stringify(this.material));
this.redirectTo(this.page.raw.ingoods.dnReceipt.detail);
}
}
</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;
.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;
}
}
.content {
width: 100%;
height: 500rpx;
.content-item {
width: 100%;
height: 100rpx;
display: flex;
text-align: center;
line-height: 100rpx;
background-color: white;
.item-left {
width: 30%;
}
.item-right {
width: 70%;
}
}
}
.library {
height: 60rpx;
position: relative;
padding-bottom: 10rpx;
.search {
position: absolute;
width: 80%;
right: 38rpx;
top: 15rpx;
height: 60rpx;
background-color: white;
}
.title {
width: 20%;
height: 100%;
text-align: left;
position: absolute;
line-height: 50rpx;
top: 15rpx;
left: 0;
}
}
.library-num {
position: relative;
margin-top: 15rpx;
.title {
width: 100rpx;
height: 100%;
line-height: 50rpx;
}
input {
display: block;
width: 40%;
padding: 10rpx;
position: absolute;
left: 100rpx;
top: 0;
background-color: white;
}
.confirm {
position: absolute;
top: 0;
right: 20rpx;
margin-left: 30rpx;
}
}
.library-table {
margin-top: 30rpx;
}
.table-wrapper {
background-color: #fff;
}
.form {
background-color: #fff;
padding: 40rpx;
border-radius: 10rpx;
}
.bottom-bar {
z-index: 21;
position: fixed;
bottom: 0;
left: 0;
right: 0;
.container {
background: #ffffff;
box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx;
}
.extra {
margin: 5px;
border-radius: 5px;
padding: 0 10px;
.main {
margin-right: 0;
}
}
}
}
</style>

@ -0,0 +1,193 @@
<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="index" />
</view>
<view class="title">{{ $t('message.dn_ReceivingGoods') }}</view>
<view class="right"></view>
</view>
<u-form class="form" ref="form" :model="form" label-width="180rpx">
<u-form-item :required="true" :label="this.$t('message.dn_OddNumbers')" prop="documentNo">
<u-search :placeholder="this.$t('message.dn_PleaseScan')" v-model.trim="form.documentNo" @search="model.queryOrderInInfo" :show-action="false"></u-search>
</u-form-item>
<u-form-item :label="this.$t('message.dn_CarNumber')">
<u-input v-model="model.orderInInfo.carNo" :placeholder="this.$t('message.po_PleaseInput')" />
</u-form-item>
<u-form-item :label="this.$t('message.dn_Time')">
<u-input v-model="model.orderInInfo.bookingTime" :placeholder="this.$t('message.po_PleaseInput')" />
</u-form-item>
<u-form-item :label="this.$t('message.po_Supplier')">
<u-input v-model="model.orderInInfo.supplyCode" :placeholder="this.$t('message.po_PleaseInput')" />
</u-form-item>
<!-- <u-form-item label="需求工段">-->
<!-- <u-input v-model="model.orderInInfo.line" />-->
<!-- </u-form-item>-->
<u-form-item :label="this.$t('message.po_OrderType')">
<u-input v-model="model.orderInInfo.poType" :placeholder="this.$t('message.po_PleaseInput')" />
</u-form-item>
<u-form-item :label="this.$t('message.po_Location')">
<u-input :disabled="true" v-model="model.orderInInfo.location" placeholder="" />
</u-form-item>
<!-- <u-form-item :label="this.$t('message.po_Location')" prop="cboPlace">-->
<!-- <u-input-->
<!-- v-model="form.cboPlace.label"-->
<!-- type="select"-->
<!-- @click="cboPlaceSelect = true"-->
<!-- :placeholder="this.$t('message.po_PleaseInput')"-->
<!-- />-->
<!-- <u-select-->
<!-- v-model="cboPlaceSelect"-->
<!-- :list="model.cboPlaceList"-->
<!-- @confirm="(v) => (form.cboPlace = v[0])"-->
<!-- ></u-select>-->
<!-- </u-form-item>-->
</u-form>
<view class="bottom-bar">
<u-row class="button-bar">
<u-col :span="6">
<u-button type="primary" @click="onSubmit">{{ $t('message.po_Continue') }}</u-button>
</u-col>
<u-col :span="6">
<u-button type="error" @click="back">{{ $t('message.po_Return') }}</u-button>
</u-col>
</u-row>
</view>
</view>
</template>
<script lang="ts">
import { Component, Ref } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import { VForm, VFormRules } from 'vue/types/form';
import model from './model';
interface OptionType {
label: string;
value: string;
}
@Component
export default class dnReceiptDom extends BasePage {
/**
* 表单引用
*/
@Ref('form') readonly $form!: VForm;
/**
* 页面Module
*/
model = model;
index() {
this.toPage(this.page.raw.index);
}
/**
* 表单数据
*/
form = {
documentNo: null,
cboPlace: {} as OptionType,
};
cboPlaceSelect = false;
rules: VFormRules<any> = {
documentNo: [{ required: true, message: this.$t('message.dn_PleaseScan') as string }],
// cboPlace: [{ required: true, message: this.$t('message.Warehouse_Tip10') as string }],
};
value = '';
show = false;
// onReadyonLoad
onReady() {
this.$form.setRules(this.rules);
this.model.queryLocation();
//
this.$form.resetFields();
this.model.orderInInfo.carNo = '';
this.model.orderInInfo.bookingTime = '';
this.model.orderInInfo.supplyCode = '';
this.model.orderInInfo.poType = '';
this.model.orderInInfo.location = '';
}
back() {
uni.navigateBack({ delta: 1 });
}
onSubmit() {
this.$form.validate((valid: boolean) => {
if (!valid) return;
// if (!this.model.hasDnInfo) {
// uni.showToast({
// icon: 'none',
// title: this.$t('message.dn_PleaseScan') as string,
// });
// return;
// }
uni.setStorageSync('dnNo', JSON.stringify(this.form.documentNo) as any);
this.toPage(this.page.raw.ingoods.dnReceipt.detail);
// this.toPage(this.page.raw.ingoods.dnReceipt.Receiving);
});
}
}
</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;
}
}
.form {
background-color: #fff;
padding: 40rpx;
border-radius: 10rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
.u-form-item {
padding: 30rpx 0;
line-height: 35rpx;
}
}
.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,303 @@
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 LocationDetail from './model.location';
class OrderInInfo {
checked?: boolean;
dnNo?: string;
kw?: string;
userDefined10?: string;
orderStatus?: string;
carNo?: string;
bookingTime?: string;
supplyCode?: string;
poType?: string;
location?: string;
SubmitCode?: string;
}
@Module({
namespaced: true,
dynamic: true,
store,
name: 'raw.ingoods.dnReceipt',
})
export class ReceiptModule extends VuexModule {
// 容器码
ContainerCode: any = '';
sendSpot = '';
/**
* sap
*/
cboPlaceList = [];
/**
*
*/
SubmitCode: any = '';
dnNo = '';
code = '';
DNdetailedList: any;
ImportDNReceivingList: any = [];
//俄罗斯PO收货返回列表
ImportPOReceiveList: any = [];
containerList: any = [];
/**
*
*/
orderInInfo: OrderInInfo = new OrderInInfo();
/**
*
*/
orderInInfoList: OrderInInfo[] = [];
/**
*
*/
orderInInfoListEx: OrderInInfo[] = [];
/**
*
*/
returningTypeList: any[] = [];
/**
*
*/
get hasDnInfo() {
return !!this.orderInInfo.dnNo;
}
/**
*
*/
get isCheckedAll() {
return !this.orderInInfoList.filter((_) => !_.checked).length;
}
/**
*
*/
get hasChecked() {
return this.orderInInfoList.filter((_) => _.checked).length > 0;
}
/**
*
* @param kw
*/
@Mutation
updateOrderInInfoListKw(kw: string) {
this.orderInInfoList = this.orderInInfoList.map((item) => {
item.kw = kw;
return item;
});
}
/**
*
* @param kw
*/
@Mutation
updateCheckedOrderInInfoListKw(kw: string) {
this.orderInInfoList = this.orderInInfoList.map((item) => {
if (item.checked) {
item.kw = kw;
}
return item;
});
}
/**
* /
*/
@Mutation
checkAllOrderInInfoList(checked: boolean) {
this.orderInInfoList = this.orderInInfoList.map((item) => {
item.checked = checked;
return item;
});
}
/**
*
*/
@MutationAction
async queryLocation() {
const result: any = await http.post(url.auth.query.location1, {
factoryCode: session.factoryCode,
loginName: session.loginName,
userDefined3: 1,
});
console.log('result', result);
const cboPlaceList = result.data.records.map((_: any) => ({
label: _.sendSpot,
value: _.sendSpot,
}));
return { cboPlaceList };
}
/**
*
* DN
* @param dnNo
*/
@MutationAction
async queryOrderInInfo(dnNo: string) {
const { list, code }: any = await http.post(url.material.DNorderin.info, {
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 };
}
//海外DN 根据单号查询物料
@MutationAction
async ImportQueryOrderInfo(dnNo: string) {
const { list, code }: any = await http.post(url.material.DNorderin.ImportInfo, {
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.enterRussia, {
dnNo: this.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 };
}
//海外DN提交
@MutationAction
async submitImportOrder(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.ImportEnter, {
dnNo: this.dnNo,
factoryCode: session.factoryCode,
loginName: session.loginName,
list,
});
uni.showToast({
icon: 'none',
title: result.msg,
});
const orderInInfoList = result.list.sort((a: any, b: any) => Number(a.accountingStatus) - Number(b.accountingStatus));
return { orderInInfoList };
}
/**
*
*/
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
async changeOrderInLocation(kw: string) {
await http.post('/wmspda/material/orderin/enter', {
warehouseCode: session.warehouseCode,
factoryCode: session.factoryCode,
loginName: session.loginName,
locationCode: kw,
});
return kw;
}
/**
*
*
* @param {*} content
* @returns
* @memberof ReceiptModule
*/
@Action({ commit: 'updateCheckedOrderInInfo' })
async queryByFactoryCodeAndWorkAreaCode(content: any) {
const res = await http.post<LocationDetail>('wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content);
return res;
}
//查询DN/海外DN收货明细
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
async querydetaildlist(content: any) {
const res: any = await http.post('/wmspda/material/getDnRecSn', content);
console.log('明细》》》》》》》》》', res.list);
this.DNdetailedList = res.list;
return res;
}
//俄罗斯 海外PO收货
@MutationAction
async ImportPOReceive(containerCode: string) {
const res: any = await http.post(url.material.DNorderin.russia, {
containerCode,
factoryCode: session.factoryCode,
loginName: session.loginName,
});
const ImportPOReceiveList = res.list;
const containerList = res.containerList;
const code = res.code;
return { ImportPOReceiveList, containerList, code };
}
//俄罗斯海外PO收货 页面初始化 清空数据
@MutationAction
async empty() {
const ImportPOReceiveList = [];
const containerList = [];
return { ImportPOReceiveList, containerList };
}
//俄罗斯海外PO收货 提交数据
@MutationAction
async containerListSubmit(params: any) {
const res: any = await http.post(url.material.DNorderin.enterrussia, {
wlCode: params.wlCode,
containerCode: params.containerCode,
factoryCode: session.factoryCode,
loginName: session.loginName,
list: params.list,
});
const code = res.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,
});
const ContainerCode = res.data;
return { ContainerCode };
}
}
export default getModule(ReceiptModule);

@ -70,6 +70,7 @@ export const url = {
dnReturnInfo: '/wmspda/material/orderin/dnReturnInfo',
queryOrder: '/wmspda/material/poReturn/queryOrder', //dn退货 单号查询
enter: '/wmspda/material/orderin/enter',
enterRussia: '/wmspda/material/orderin/enter/russia',
subcDnEnter: '/wmspda/material/orderin/subcDnEnter',
ImportEnter: '/wmspda/material/orderin/overseasDnEnter',
subcDnEnterRussia: '/wmspda/material/orderin/subcDnEnter/russia',

Loading…
Cancel
Save