修改 DN收货相关

master
guoshuang 4 years ago
parent 48a10261d7
commit a6f4e24496

@ -51,7 +51,7 @@
<u-form-item :label="$t('message.product_Swept')" label-width="80rpx"> <u-form-item :label="$t('message.product_Swept')" label-width="80rpx">
<u-input <u-input
:disabled="true" :disabled="true"
v-model="form.originWl.spQty" v-model="aaa"
placeholder="" placeholder=""
/> />
</u-form-item> </u-form-item>
@ -62,7 +62,7 @@
label-width="80rpx" label-width="80rpx"
> >
<u-input <u-input
v-model="form.originWl.ypQty" v-model="bbb"
:placeholder="$t('message.po_PleaseInput')" :placeholder="$t('message.po_PleaseInput')"
/> />
</u-form-item> </u-form-item>
@ -127,7 +127,8 @@ export default class productCheckReceipt extends BasePage {
* 页面Module * 页面Module
*/ */
model = model; model = model;
aaa: number = null;
bbb: number = null;
/** /**
* 表单数据 * 表单数据
*/ */
@ -139,6 +140,8 @@ export default class productCheckReceipt extends BasePage {
}; };
productCode: any = ""; // productCode: any = ""; //
productDescZh: any = ""; // productDescZh: any = ""; //
// aaa: any = "";
// bbb: any = "";
originWlSelect = false; originWlSelect = false;
aimWlSelect = false; aimWlSelect = false;
cboPlaceSelect = false; cboPlaceSelect = false;
@ -153,13 +156,18 @@ export default class productCheckReceipt extends BasePage {
this.$form.setRules(this.rules); this.$form.setRules(this.rules);
} }
onchange(e: any) { onchange(e: any) {
console.log("e", e);
this.model.WlListaa.forEach((item: any) => { this.model.WlListaa.forEach((item: any) => {
if (item.locCode == e[0].value) { if (item.locCode == e[0].value) {
this.form.originWl = item; this.form.originWl = item;
// aaa += item.spQty;
this.aaa += item.spQty;
this.bbb += item.ypQty;
return; return;
} }
}); });
console.log(this.form.originWl); console.log("this.form.originwl",this.form.originWl);
} }
async scanCode(e: any) { async scanCode(e: any) {
if (!this.form.pddNo) { if (!this.form.pddNo) {
@ -184,9 +192,9 @@ export default class productCheckReceipt extends BasePage {
}; };
await this.model.toScanCode(list); await this.model.toScanCode(list);
if (this.model.records.code == "1") { if (this.model.records.code == "1") {
this.form.originWl.spQty += 1; this.aaa += 1;
this.productCode = model.productCode; this.productCode = this.model.productCode;
this.productDescZh = model.productDescZh; this.productDescZh = this.model.productDescZh;
} }
} }
onSubmit() { onSubmit() {
@ -238,7 +246,7 @@ export default class productCheckReceipt extends BasePage {
snFlag: this.form.originWl.snFlag, snFlag: this.form.originWl.snFlag,
pdMode: this.form.originWl.pdMode, pdMode: this.form.originWl.pdMode,
sn: this.form.code, sn: this.form.code,
spQty: this.form.originWl.spQty, spQty: this.aaa,
}; };
console.log("orderlist", list); console.log("orderlist", list);
await this.model.onTakeoutConfirm(list); await this.model.onTakeoutConfirm(list);

@ -144,7 +144,7 @@
}}</u-button> }}</u-button>
</u-col> </u-col>
<u-col :span="4"> <u-col :span="4">
<u-button type="error" @click="back">{{ <u-button type="error" @click="uni.navigateBack()">{{
$t("message.po_Return") $t("message.po_Return")
}}</u-button> }}</u-button>
</u-col> </u-col>

@ -144,7 +144,7 @@
}}</u-button> }}</u-button>
</u-col> </u-col>
<u-col :span="4"> <u-col :span="4">
<u-button type="error" @click="back">{{ <u-button type="error" @click="uni.navigateBack()">{{
$t("message.po_Return") $t("message.po_Return")
}}</u-button> }}</u-button>
</u-col> </u-col>

@ -5,7 +5,7 @@
:style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }" :style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }"
> >
<view class="left"> <view class="left">
<u-icon class="icon" name="arrow-left" @click="index" /> <u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" />
</view> </view>
<view class="title">{{ $t("message.Pi_PickingQuery") }}</view> <view class="title">{{ $t("message.Pi_PickingQuery") }}</view>
<view class="right"></view> <view class="right"></view>

@ -1,144 +1,81 @@
<template> <template>
<view class="page-raw-receipt"> <view class="page-raw-receipt">
<!-- 头部 --> <!-- 头部 -->
<view <view class="header" :style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }">
class="header"
:style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }"
>
<view class="left"> <view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" /> <u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" />
</view> </view>
<view class="title">{{ $t("message.dn_ReceivingGoods") }}</view> <view class="title">{{ $t('message.dn_ReceivingGoods') }}</view>
<view class="right"></view> <view class="right"></view>
</view> </view>
<view class="content"> <view class="content">
<!-- 单号 --> <!-- 单号 -->
<view class="single"> <view class="single">
<view class="single-left"> <view class="single-left">
<view>{{ $t("message.dn_OddNumbers") }}</view> <view>{{ $t('message.dn_OddNumbers') }}</view>
<u-search <u-search :placeholder="$t('message.dn_PleaseScan')" v-model="form.documentNo" @search="query" :show-action="false"></u-search>
:placeholder="$t('message.dn_PleaseScan')"
v-model="form.documentNo"
@search="model.queryOrderInInfo"
:show-action="false"
></u-search>
</view> </view>
<view class="single-right"> <view class="single-right">
<u-button type="primary" @click="query">{{ <u-button type="primary" @click="query">{{ $t('message.Query') }}</u-button>
$t("message.Query")
}}</u-button>
</view> </view>
</view> </view>
<!-- 采购单号 --> <!-- 采购单号 -->
<view class="Purchase-title"> <view class="Purchase-title">
<view class="Purchase"> <view class="Purchase">
<view>{{ $t("message.Purchase") }}</view> <view>{{ $t('message.Purchase') }}</view>
<jPicker <jPicker sureColor="#ff0000" style="width: 260rpx" @bindpicker="poListChoice" showKey="value" valKey="value" :val="poNo" class="search" :options="poList" />
sureColor="#ff0000"
style="width: 260rpx"
@bindpicker="poListChoice"
showKey="value"
valKey="value"
:val="wlCode"
class="search"
:options="poList"
/>
</view> </view>
</view> </view>
<!-- 物料 --> <!-- 物料 -->
<view class="material"> <view class="material">
<view class="material-left"> <view class="material-left">
<view>{{ $t("message.Materiel") }}</view> <view>{{ $t('message.Materiel') }}</view>
<jPicker <jPicker sureColor="#ff0000" style="width: 260rpx" @bindpicker="materialChoice" showKey="value" valKey="value" :val="every.materialCode" class="search" :options="materialList" />
sureColor="#ff0000"
style="width: 260rpx"
@bindpicker="materialChoice"
showKey="value"
valKey="value"
:val="wlCode"
class="search"
:options="materialList"
/>
</view> </view>
<view class="material-right"> <view class="material-right">
<view class="material-right-title">{{ <view class="material-right-title">{{ $t('message.CommissionedMaterielDesc') }}</view>
$t("message.CommissionedMaterielDesc")
}}</view>
<view class="material-right-code">{{ every.materialDesc }}</view> <view class="material-right-code">{{ every.materialDesc }}</view>
</view> </view>
</view> </view>
<!-- 需求数量 --> <!-- 需求数量 -->
<view class="number"> <view class="number">
<view class="number-left"> <view class="number-left">
<view class="number-left-title">{{ <view class="number-left-title">{{ $t('message.DemandQuantity') }}</view>
$t("message.DemandQuantity") <u-input v-model="every.requestAmount" placeholder=" " :type="type" :border="border" class="input" disabled />
}}</view>
<u-input
v-model="every.requestAmount"
placeholder=" "
:type="type"
:border="border"
class="input"
disabled
/>
</view> </view>
<view class="number-right"> <view class="number-right">
<view class="number-right-title">{{ $t("message.Cumulative") }}</view> <view class="number-right-title">{{ $t('message.Cumulative') }}</view>
<u-input <u-input v-model="every.receiptAmount" :type="type" :border="border" class="input" disabled />
v-model="Cumulative"
:type="type"
:border="border"
class="input"
disabled
/>
</view> </view>
</view> </view>
<!-- 库位 --> <!-- 库位 -->
<view class="library"> <view class="library">
<view class="library-left"> <view class="library-left">
<view>{{ $t("message.CommissionedLocation") }}</view> <view>{{ $t('message.CommissionedLocation') }}</view>
<jPicker <jPicker sureColor="#ff0000" style="width: 230rpx" @bindpicker="LocationChoice" showKey="value" valKey="value" :val="wl.value" class="search" :options="Location" />
sureColor="#ff0000"
style="width: 230rpx"
@bindpicker="LocationChoice"
showKey="value"
valKey="value"
:val="wlCode"
class="search"
:options="Location"
/>
</view> </view>
<view class="library-right"> <view class="library-right">
<view class="library-right-title">{{ <view class="library-right-title">{{ $t('message.CommissionedThisNumber') }}</view>
$t("message.CommissionedThisNumber") <u-input v-model="receiptAmount" :type="type" :border="border" class="input" />
}}</view>
<u-input
v-model="receiptAmount"
:type="type"
:border="border"
class="input"
/>
</view> </view>
</view> </view>
<!-- 添加 --> <!-- 添加 -->
<view class="add"> <view class="add">
<u-button type="primary" @click="Add">{{ <u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button>
$t("message.product_add")
}}</u-button>
</view> </view>
<!-- 表格 --> <!-- 表格 -->
<u-table class="library-table"> <u-table class="library-table">
<u-tr class="u-tr"> <u-tr class="u-tr">
<u-th class="u-th">{{ $t("message.product_Location") }}</u-th> <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.product_Number') }}</u-th>
<u-th class="u-th">{{ $t("message.operation") }}</u-th> <u-th class="u-th">{{ $t('message.operation') }}</u-th>
</u-tr> </u-tr>
<u-tr class="u-tr" v-for="(item, index) in LocationList" :key="index"> <u-tr class="u-tr" v-for="(item, index) in LocationList" :key="index">
<u-td class="u-td">{{ item.wlCode }}</u-td> <u-td class="u-td">{{ item.wlCode }}</u-td>
<u-td class="u-td">{{ item.receiptAmount }}</u-td> <u-td class="u-td">{{ item.receiptAmount }}</u-td>
<u-td class="u-td"> <u-td class="u-td">
<div class="u-td" @click="deleteItem(index)"> <div class="u-td" @click="deleteItem(index)">
{{ $t("message.product_Delete") }} {{ $t('message.product_Delete') }}
</div> </div>
</u-td> </u-td>
</u-tr> </u-tr>
@ -148,31 +85,25 @@
<view class="bottom-bar"> <view class="bottom-bar">
<u-row class="button-bar"> <u-row class="button-bar">
<u-col :span="4"> <u-col :span="4">
<u-button type="primary" @click="bill">{{ <u-button type="primary" @click="bill">{{ $t('message.detailed') }}</u-button>
$t("message.detailed")
}}</u-button>
</u-col> </u-col>
<u-col :span="4"> <u-col :span="4">
<u-button type="primary" @click="onSubmit">{{ <u-button type="primary" @click="onSubmit">{{ $t('message.po_Submit') }}</u-button>
$t("message.po_Submit")
}}</u-button>
</u-col> </u-col>
<u-col :span="4"> <u-col :span="4">
<u-button type="error" @click="back">{{ <u-button type="error" @click="uni.navigateBack({})">{{ $t('message.po_Return') }}</u-button>
$t("message.po_Return")
}}</u-button>
</u-col> </u-col>
</u-row> </u-row>
</view> </view>
</view> </view>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Ref } from "vue-property-decorator"; import { Component, Ref } from 'vue-property-decorator';
import { BasePage } from "@/components/base/page"; import { BasePage } from '@/components/base/page';
import jPicker from "@/components/J-Picker/jPicker.vue"; import jPicker from '@/components/J-Picker/jPicker.vue';
import { session } from "@/store/modules/session"; import { session } from '@/store/modules/session';
import { VForm, VFormRules } from "vue/types/form"; import { VForm, VFormRules } from 'vue/types/form';
import model from "./model"; import model from './model';
@Component({ @Component({
components: { components: {
jPicker, jPicker,
@ -181,36 +112,40 @@ import model from "./model";
export default class dnReceiptDom extends BasePage { export default class dnReceiptDom extends BasePage {
model = model; model = model;
form: any = { form: any = {
documentNo: "", documentNo: '',
}; };
material: any = {}; material: any = [];
poList: any = []; poList: any = [];
materialList: any = []; materialList: any = [];
every: any = ""; every: any = {};
value = ""; value = '';
type = "text"; type = 'text';
border = true; border = true;
// //
Cumulative: any = 0; //Cumulative: any = 0;
// //
sendSpotList: any = []; //sendSpotList: any = [];
// //
receiptAmount: any = ""; receiptAmount: any = '';
// //
Location: any = []; Location: any = [];
// //
LocationList: any = []; LocationList: any = [];
// //
wlCode: any = ""; wl: any = {
value: null,
};
//
poNo: any = null;
//
requestAmount: number = null;
// //
upload: any = []; upload: any = [];
// //
async onReady() { async onReady() {
// //
let means: any = JSON.parse( let means: any = JSON.parse(localStorage.getItem('__GWMS_APP_STATE_DATA__') as any);
localStorage.getItem("__GWMS_APP_STATE_DATA__") as any let sendSpot = JSON.parse(localStorage.getItem('sendSpot') as any);
);
let sendSpot = JSON.parse(localStorage.getItem("sendSpot") as any);
let content = { let content = {
loginName: means.session.user.loginName, loginName: means.session.user.loginName,
sendSpot: sendSpot, sendSpot: sendSpot,
@ -221,144 +156,173 @@ export default class dnReceiptDom extends BasePage {
res.forEach((item: any) => { res.forEach((item: any) => {
let pickerName: any = {}; let pickerName: any = {};
pickerName.label = item.locationCode; pickerName.label = item.locationCode;
pickerName.value = item.locationCode + "(" + item.sendSpot + ")"; pickerName.value = item.locationCode + '(' + item.sendSpot + ')';
pickerName.sendSpot = item.sendSpot; pickerName.sendSpot = item.sendSpot;
this.Location.push(pickerName); this.Location.push(pickerName);
}); });
} }
// //
async query() { async query() {
if (this.form.documentNo == "") { if (this.form.documentNo == '') {
uni.showToast({ uni.showToast({
icon: "none", icon: 'none',
title: this.$t("message.Commission_tips1") as any, title: this.$t('message.Commission_tips1') as any,
}); });
return; return;
} }
await this.model.ImportQueryOrderInfo(this.form.documentNo); await this.model.ImportQueryOrderInfo(this.form.documentNo);
let list: any = localStorage.getItem("list"); let list: any = localStorage.getItem('list');
localStorage.removeItem("list"); localStorage.removeItem('list');
this.material = JSON.parse(list); this.material = JSON.parse(list);
this.material.forEach((item: any) => { this.poList = [...this.material];
let pickerName: any = {}; let arr = this.removeDuplicates(this.poList, 'poNo');
pickerName.label = item.poNo; //
pickerName.value = item.poNo; arr.forEach((item: any) => {
this.poList.push(pickerName); item.label = item.poNo;
item.value = item.poNo;
}); });
this.poList = arr;
}
//
// 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 list
totalLocation(list: []) {
const receiptAmount = list.reduce((total: number, nextItem: any): any => {
//?????? + +
return total + +nextItem.receiptAmount;
}, 0);
return receiptAmount;
} }
// //
poListChoice(e: any) { poListChoice(e: any) {
this.material.forEach((item: any) => { this.poNo = e.pickerName.value;
//???????
this.materialList = JSON.parse(JSON.stringify(this.removeDuplicates(this.material, 'materialCode')));
this.materialList.forEach((item: any) => {
if (item.poNo == e.pickerName.value) { if (item.poNo == e.pickerName.value) {
let pickerName: any = {}; item.label = item.materialCode;
pickerName.label = item.materialCode; item.value = item.materialCode;
pickerName.value = item.materialCode;
this.materialList.push(pickerName);
} }
}); });
// this.material.forEach((item: any) => {
// if (item.poNo == e.pickerName.value) {
// let pickerName: any = {};
// pickerName.label = item.materialCode;
// pickerName.value = item.materialCode;
// this.materialList.push(pickerName);
// }
// });
} }
// receiptAmount requestAmount // receiptAmount requestAmount every=
materialChoice(e: any) { materialChoice(e: any) {
this.material.forEach((item: any) => { //
if (item.materialCode == e.pickerName.value) { this.every = { ...e.pickerName };
this.every = item;
return;
}
});
} }
// //
LocationChoice(e: any) { LocationChoice(e: any) {
console.log("e>>>>>>>>>>>>>>>>>>>>>>>>", e); console.log('e>>>>>>>>>>>>>>>>>>>>>>>>', e);
this.wlCode = e.pickerName; this.wl = e.pickerName;
} }
// //
Add() { Add() {
if (this.receiptAmount == "" || this.wlCode == "") { //count
const count = this.totalLocation(this.LocationList);
if (this.receiptAmount == '' || this.wl.value == '') {
uni.showToast({ uni.showToast({
icon: "none", icon: 'none',
title: this.$t("message.Commission_tips2") as any, title: this.$t('message.Commission_tips2') as any,
}); });
return; return;
} }
if (parseFloat(this.receiptAmount) <= 0) { if (parseFloat(this.receiptAmount) <= 0) {
uni.showToast({ uni.showToast({
icon: "none", icon: 'none',
title: this.$t("message.Commission_tips3") as any, title: this.$t('message.Commission_tips3') as any,
}); });
return; return;
} }
if (parseFloat(this.receiptAmount) > this.every.requestAmount) { if (parseFloat(this.receiptAmount) > this.every.requestAmount || +this.receiptAmount + count > this.every.requestAmount) {
uni.showToast({ uni.showToast({
icon: "none", icon: 'none',
title: this.$t("message.Commission_tips4") as any, title: this.$t('message.Commission_tips4') as any,
}); });
return; return;
} }
let isTrue: boolean = true; // return
if (this.sendSpotList.length != 0) { let isTrue = this.LocationList.some((item) => item.wlCode !== this.wl.label);
this.sendSpotList.forEach((item: any) => { //add???
if (this.wlCode.sendSpot != item) { if (isTrue) {
isTrue = false;
}
});
}
if (isTrue != true) {
uni.showToast({ uni.showToast({
icon: "none", icon: 'none',
title: this.$t("message._tips5") as any, title: this.$t('message._tips5') as any,
}); });
return; return;
} }
let objString = JSON.stringify(this.every); //aad
let TEM = JSON.parse(objString); this.LocationList.push({
TEM.wllist = null; ...this.every,
TEM.receiptAmount = this.receiptAmount; wlCode: this.wl.label,
TEM.wlCode = this.wlCode.label; receiptAmount: this.receiptAmount,
this.sendSpotList.push(this.wlCode.sendSpot); });
console.log("this.sendSpotList", this.sendSpotList); //
console.log("TEM", TEM); this.receiptAmount = '';
this.LocationList.push(TEM); //true
this.every.wllist = this.LocationList;
console.log("表格数据", this.LocationList);
console.log("要上传的数据", this.every);
this.receiptAmount = "";
isTrue = true; isTrue = true;
this.business(); this.business();
} }
deleteItem(index: any) { deleteItem(index: any) {
//splice
this.LocationList.splice(index, 1); this.LocationList.splice(index, 1);
this.every.wllist.splice(index, 1);
console.log("表格数据", this.LocationList);
console.log("要上传的数据", this.every);
this.business(); this.business();
} }
async onSubmit() { //
if (this.every.wllist == null || this.every.wllist.length == 0) { resetForm() {
uni.showToast({ // add table
icon: "none",
title: this.$t("message.Commission_tips5") as any,
});
}
this.upload.push(this.every);
await this.model.submitImportOrder(this.upload);
this.LocationList = []; this.LocationList = [];
this.wlCode = ""; this.poNo = '';
this.receiptAmount = ""; //
this.Cumulative = 0; this.wl = {
this.every = ""; value: null,
};
//
this.every = {};
//
this.materialList = []; this.materialList = [];
//
this.receiptAmount = null;
}
async onSubmit() {
if (this.LocationList.length === 0) {
uni.showToast({
icon: 'none',
title: this.$t('message.Commission_tips5') as any,
});
return null;
}
//
this.every.wllist = this.LocationList;
await this.model.submitOrderInEnter([this.every]);
this.resetForm();
} }
async bill() { async bill() {
if (this.form.documentNo == "") { if (this.form.documentNo == '') {
uni.showToast({ uni.showToast({
icon: "none", icon: 'none',
title: this.$t("message._tips6") as any, title: this.$t('message._tips6') as any,
}); });
return; return;
} }
let person = JSON.parse( let person = JSON.parse(localStorage.getItem('__GWMS_APP_STATE_DATA__') as any);
localStorage.getItem("__GWMS_APP_STATE_DATA__") as any
);
let content = { let content = {
loginName: person.session.user.loginName, loginName: person.session.user.loginName,
dnNo: this.form.documentNo, dnNo: this.form.documentNo,
@ -366,22 +330,15 @@ export default class dnReceiptDom extends BasePage {
await this.model.querydetaildlist(content); await this.model.querydetaildlist(content);
this.redirectTo(this.page.raw.ingoods.dnReceipt.Local); this.redirectTo(this.page.raw.ingoods.dnReceipt.Local);
} }
// // totalLocationtotalLocationsome
business() { business() {
let num: number = 0; this.every.receiptAmount = this.totalLocation(this.LocationList);
this.LocationList.forEach((item: any) => {
num += parseFloat(item.receiptAmount);
});
this.Cumulative = num;
this.every.receiptAmount = num;
console.log("this.every", this.every);
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page-raw-receipt { .page-raw-receipt {
background: #f2f2f2 background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background-size: 100% 600rpx; background-size: 100% 600rpx;
padding: 118rpx 30rpx 162rpx; padding: 118rpx 30rpx 162rpx;
min-height: 100%; min-height: 100%;

@ -5,7 +5,7 @@
:style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }" :style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }"
> >
<view class="left"> <view class="left">
<u-icon class="icon" name="arrow-left" @click="index" /> <u-icon class="icon" name="arrow-left" @click="back" />
</view> </view>
<view class="title">{{ $t("message.raw_Inventory") }}</view> <view class="title">{{ $t("message.raw_Inventory") }}</view>
<view class="right"></view> <view class="right"></view>

Loading…
Cancel
Save