dn收货部分提交

master
guoshuang 4 years ago
parent 264ca4b88c
commit 903bbd680c

@ -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()" />
</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="wlCode" 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="wlCode" 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="Cumulative" :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="wlCode" 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="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 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,34 @@ import model from "./model";
export default class dnReceiptDom extends BasePage {
model = model;
form: any = {
documentNo: "",
documentNo: '',
};
material: any = {};
poList: any = [];
materialList: any = [];
every: any = "";
value = "";
type = "text";
every: any = '';
value = '';
type = 'text';
border = true;
//
Cumulative: any = 0;
//
sendSpotList: any = [];
//
receiptAmount: any = "";
receiptAmount: any = '';
//
Location: any = [];
//
LocationList: any = [];
//
wlCode: any = "";
wlCode: any = '';
//
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,33 +150,44 @@ 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;
}
// 1.
// 2.poNo
// 3.poNo
await this.model.queryOrderInInfo(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 temp = {};
let arr = [];
arr = this.poList.reduce(function (item, next) {
temp[next.poNo] ? '' : (temp[next.poNo] = true && item.push(next));
return item;
}, []);
console.log('arr>>>', arr);
arr.forEach((item: any) => {
item.label = item.poNo;
item.value = item.poNo;
});
this.poList = arr;
}
//
poListChoice(e: any) {
console.log('选择采购单后触发的回调事件::', 'poListChoice:::', e);
this.material.forEach((item: any) => {
if (item.poNo == e.pickerName.value) {
let pickerName: any = {};
@ -268,29 +208,29 @@ export default class dnReceiptDom extends BasePage {
}
//
LocationChoice(e: any) {
console.log("e>>>>>>>>>>>>>>>>>>>>>>>>", e);
console.log('e>>>>>>>>>>>>>>>>>>>>>>>>', e);
this.wlCode = e.pickerName;
}
//
Add() {
if (this.receiptAmount == "" || this.wlCode == "") {
if (this.receiptAmount == '' || this.wlCode == '') {
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) {
uni.showToast({
icon: "none",
title: this.$t("message.Commission_tips4") as any,
icon: 'none',
title: this.$t('message.Commission_tips4') as any,
});
return;
}
@ -304,8 +244,8 @@ export default class dnReceiptDom extends BasePage {
}
if (isTrue != true) {
uni.showToast({
icon: "none",
title: this.$t("message._tips5") as any,
icon: 'none',
title: this.$t('message._tips5') as any,
});
return;
}
@ -315,50 +255,48 @@ export default class dnReceiptDom extends BasePage {
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);
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 = "";
console.log('表格数据', this.LocationList);
console.log('要上传的数据', this.every);
this.receiptAmount = '';
isTrue = true;
this.business();
}
deleteItem(index: any) {
this.LocationList.splice(index, 1);
this.every.wllist.splice(index, 1);
console.log("表格数据", this.LocationList);
console.log("要上传的数据", this.every);
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,
icon: 'none',
title: this.$t('message.Commission_tips5') as any,
});
}
this.upload.push(this.every);
await this.model.submitOrderInEnter(this.upload);
this.LocationList = [];
this.wlCode = "";
this.receiptAmount = "";
this.wlCode = '';
this.receiptAmount = '';
this.Cumulative = 0;
this.every = "";
this.every = '';
this.materialList = [];
}
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,
@ -374,14 +312,13 @@ export default class dnReceiptDom extends BasePage {
});
this.Cumulative = num;
this.every.receiptAmount = num;
console.log("this.every", this.every);
console.log('this.every', this.every);
}
}
</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%;

@ -1017,6 +1017,11 @@
"@babel/types" "^7.3.3"
vue-template-compiler "^2.6.10"
"@dcloudio/uni-ui@^1.4.6":
version "1.4.9"
resolved "https://registry.yarnpkg.com/@dcloudio/uni-ui/-/uni-ui-1.4.9.tgz#98827252c9a0d930bc9310e8162370a582ad1c1c"
integrity sha512-S4HcIUipswVysOzet8Z6YR8B77Frz4qvSmch1Aj7ddKWsD9Y55sEdRs7mjI32iqsXNXZeZtG05bgfEusDqQGtQ==
"@dcloudio/vue-cli-plugin-hbuilderx@^2.0.0-29820201110001":
version "2.0.0-29820201110001"
resolved "https://registry.npm.taobao.org/@dcloudio/vue-cli-plugin-hbuilderx/download/@dcloudio/vue-cli-plugin-hbuilderx-2.0.0-29820201110001.tgz?cache=0&sync_timestamp=1606737855218&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40dcloudio%2Fvue-cli-plugin-hbuilderx%2Fdownload%2F%40dcloudio%2Fvue-cli-plugin-hbuilderx-2.0.0-29820201110001.tgz#51df470e7b2f04934562795043d7117cfbd5c031"
@ -2517,6 +2522,14 @@ anymatch@^3.0.3, anymatch@~3.1.1:
normalize-path "^3.0.0"
picomatch "^2.0.4"
anymatch@~3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==
dependencies:
normalize-path "^3.0.0"
picomatch "^2.0.4"
aproba@^1.1.1:
version "1.2.0"
resolved "https://registry.npm.taobao.org/aproba/download/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
@ -3369,6 +3382,21 @@ check-types@^8.0.3:
optionalDependencies:
fsevents "~2.1.2"
"chokidar@>=3.0.0 <4.0.0":
version "3.5.2"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75"
integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==
dependencies:
anymatch "~3.1.2"
braces "~3.0.2"
glob-parent "~5.1.2"
is-binary-path "~2.1.0"
is-glob "~4.0.1"
normalize-path "~3.0.0"
readdirp "~3.6.0"
optionalDependencies:
fsevents "~2.3.2"
chokidar@^2.1.8:
version "2.1.8"
resolved "https://registry.npm.taobao.org/chokidar/download/chokidar-2.1.8.tgz?cache=0&sync_timestamp=1602585354255&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchokidar%2Fdownload%2Fchokidar-2.1.8.tgz#804b3a7b6a99358c3c5c61e71d8728f041cff917"
@ -5547,6 +5575,11 @@ fsevents@~2.1.2:
resolved "https://registry.npm.taobao.org/fsevents/download/fsevents-2.1.3.tgz?cache=0&sync_timestamp=1604595212408&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffsevents%2Fdownload%2Ffsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e"
integrity sha1-+3OHA66NL5/pAMM4Nt3r7ouX8j4=
fsevents@~2.3.2:
version "2.3.2"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a"
integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==
function-bind@^1.1.1:
version "1.1.1"
resolved "https://registry.npm.taobao.org/function-bind/download/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d"
@ -5642,6 +5675,13 @@ glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0:
dependencies:
is-glob "^4.0.1"
glob-parent@~5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==
dependencies:
is-glob "^4.0.1"
glob-to-regexp@^0.3.0:
version "0.3.0"
resolved "https://registry.npm.taobao.org/glob-to-regexp/download/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab"
@ -6127,6 +6167,11 @@ immediate@~3.0.5:
resolved "https://registry.npm.taobao.org/immediate/download/immediate-3.0.6.tgz?cache=0&sync_timestamp=1591712544511&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fimmediate%2Fdownload%2Fimmediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
integrity sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=
immutable@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.0.0.tgz#b86f78de6adef3608395efb269a91462797e2c23"
integrity sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw==
import-cwd@^2.0.0:
version "2.1.0"
resolved "https://registry.npm.taobao.org/import-cwd/download/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9"
@ -9518,6 +9563,13 @@ readdirp@~3.5.0:
dependencies:
picomatch "^2.2.1"
readdirp@~3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==
dependencies:
picomatch "^2.2.1"
realpath-native@^2.0.0:
version "2.0.0"
resolved "https://registry.npm.taobao.org/realpath-native/download/realpath-native-2.0.0.tgz#7377ac429b6e1fd599dc38d08ed942d0d7beb866"
@ -9913,10 +9965,10 @@ sane@^4.0.3:
minimist "^1.1.1"
walker "~1.0.5"
sass-loader@^10.1.0:
version "10.1.0"
resolved "https://registry.npm.taobao.org/sass-loader/download/sass-loader-10.1.0.tgz#1727fcc0c32ab3eb197cda61d78adf4e9174a4b3"
integrity sha1-Fyf8wMMqs+sZfNph14rfTpF0pLM=
sass-loader@^10.1.1:
version "10.2.0"
resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-10.2.0.tgz#3d64c1590f911013b3fa48a0b22a83d5e1494716"
integrity sha512-kUceLzC1gIHz0zNJPpqRsJyisWatGYNFRmv2CKZK2/ngMJgLqxTbXwe/hJ85luyvZkgqU3VlJ33UVF2T/0g6mw==
dependencies:
klona "^2.0.4"
loader-utils "^2.0.0"
@ -9924,6 +9976,15 @@ sass-loader@^10.1.0:
schema-utils "^3.0.0"
semver "^7.3.2"
sass@^1.43.4:
version "1.45.0"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.45.0.tgz#192ede1908324bb293a3e403d1841dbcaafdd323"
integrity sha512-ONy5bjppoohtNkFJRqdz1gscXamMzN3wQy1YH9qO2FiNpgjLhpz/IPRGg0PpCjyz/pWfCOaNEaiEGCcjOFAjqw==
dependencies:
chokidar ">=3.0.0 <4.0.0"
immutable "^4.0.0"
source-map-js ">=0.6.2 <2.0.0"
sax@~1.2.4:
version "1.2.4"
resolved "https://registry.npm.taobao.org/sax/download/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
@ -10336,6 +10397,11 @@ source-list-map@^2.0.0:
resolved "https://registry.npm.taobao.org/source-list-map/download/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34"
integrity sha1-OZO9hzv8SEecyp6jpUeDXHwVSzQ=
"source-map-js@>=0.6.2 <2.0.0":
version "1.0.1"
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.1.tgz#a1741c131e3c77d048252adfa24e23b908670caf"
integrity sha512-4+TN2b3tqOCd/kaGRJ/sTYA0tR0mdXx26ipdolxcwtJVqEnqNYvlCAt1q3ypy4QMlYus+Zh34RNtYLoq2oQ4IA==
source-map-resolve@^0.5.0, source-map-resolve@^0.5.2:
version "0.5.3"
resolved "https://registry.npm.taobao.org/source-map-resolve/download/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a"

Loading…
Cancel
Save