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

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

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

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

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

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

Loading…
Cancel
Save