|
|
|
@ -26,10 +26,6 @@
|
|
|
|
|
<u-form-item :label="$t('message.po_MaterielDes')">
|
|
|
|
|
<u-input :disabled="true" v-model="Some.productDescZh" placeholder="" style="overflow: hidden" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<!-- 数量 -->
|
|
|
|
|
<u-form-item :label="$t('message.Summary_Number')">
|
|
|
|
|
<u-input v-model="Some.qty" placeholder="" type="number" disabled />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<!-- 原库位 -->
|
|
|
|
|
<u-form-item :label="$t('message.Warehouse_OriginalLocation')">
|
|
|
|
|
<u-input :disabled="true" v-model="Some.originWl" placeholder="" />
|
|
|
|
@ -38,10 +34,34 @@
|
|
|
|
|
<u-form-item :label="$t('message.product_costCenter')">
|
|
|
|
|
<u-input :disabled="true" v-model="Some.costCenter" placeholder="" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<!-- 文件号 -->
|
|
|
|
|
<!-- <u-form-item :label="$t('message.DocumentNumber')">
|
|
|
|
|
<u-input v-model="Some.fileNo" placeholder="" />
|
|
|
|
|
</u-form-item> -->
|
|
|
|
|
<view class="newly">
|
|
|
|
|
<!-- 需求数 -->
|
|
|
|
|
<u-form-item :label="$t('message.DemandQuantity')" style="width: 50%">
|
|
|
|
|
<u-input style="flex: 0.9" v-model="Some.qty" placeholder=" " :disabled="true" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<!-- 累计 -->
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-form-item :label="$t('message.Cumulative')" prop="sapFactoryCode">
|
|
|
|
|
<u-input style="flex: 0.9" :disabled="true" v-model="Some.totalqty" placeholder="" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-col>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 容器编码 -->
|
|
|
|
|
<view class="single">
|
|
|
|
|
<view class="single-left">
|
|
|
|
|
<view>{{ $t('message.Container') }}:</view>
|
|
|
|
|
<u-search :placeholder="$t('message.PleaseScan')" style="z-index: 10000" v-model="Barcode" @search="searchBarcode" :show-action="false"></u-search>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 添加 -->
|
|
|
|
|
<view class="add">
|
|
|
|
|
<u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button>
|
|
|
|
|
</view>
|
|
|
|
|
<!-- 数量 -->
|
|
|
|
|
<u-form-item :label="$t('message.product_Number')">
|
|
|
|
|
<u-input v-model="qty" placeholder="" :border="border" type="number" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="RUSdetailHeader" :contents="SubmitOrderlist" :show-vert-border="false" @onCellClick="deleteItem($event)"></wyb-table>
|
|
|
|
|
<u-row class="button-bar">
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-button type="error" @click="uni.navigateBack({})">{{ $t('message.po_Return') }}</u-button>
|
|
|
|
@ -53,8 +73,8 @@
|
|
|
|
|
</u-form>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
import { RUSdetailHeader } from './config';
|
|
|
|
|
import { Component } from 'vue-property-decorator';
|
|
|
|
|
import { BasePage } from '@/components/base/page';
|
|
|
|
|
import model from './model';
|
|
|
|
@ -66,12 +86,18 @@ import { session } from '@/store/modules/session';
|
|
|
|
|
},
|
|
|
|
|
})
|
|
|
|
|
export default class KanDanHandOver extends BasePage {
|
|
|
|
|
//单号
|
|
|
|
|
RUSdetailHeader = RUSdetailHeader;
|
|
|
|
|
order3 = '';
|
|
|
|
|
model = model;
|
|
|
|
|
wl: any = {};
|
|
|
|
|
border = true;
|
|
|
|
|
Some: any = {};
|
|
|
|
|
MaterialList: any = [];
|
|
|
|
|
Barcode: any = '';
|
|
|
|
|
qty = 0;
|
|
|
|
|
SubmitOrderlist: any = [];
|
|
|
|
|
Container: any = '';
|
|
|
|
|
SomeIndex = 0;
|
|
|
|
|
//查询单号
|
|
|
|
|
async query() {
|
|
|
|
|
if (this.order3 === '') {
|
|
|
|
@ -83,13 +109,11 @@ export default class KanDanHandOver extends BasePage {
|
|
|
|
|
});
|
|
|
|
|
if (this.model.code == '1') {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
//icon: 'success',
|
|
|
|
|
title: this.$t('message.successful') as string,
|
|
|
|
|
duration: 2000,
|
|
|
|
|
image: '/static/icons/icon-51.png',
|
|
|
|
|
});
|
|
|
|
|
this.model.orderInInfoList.forEach((item: any) => {
|
|
|
|
|
//item.fileNo = '';
|
|
|
|
|
let arr: any = {
|
|
|
|
|
label: item.productCode,
|
|
|
|
|
value: item.productCode,
|
|
|
|
@ -101,16 +125,105 @@ export default class KanDanHandOver extends BasePage {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//选择物料回调函数
|
|
|
|
|
materialChoice(e: any) {
|
|
|
|
|
this.wl = e.pickerName;
|
|
|
|
|
this.model.orderInInfoList.forEach((item: any) => {
|
|
|
|
|
this.model.orderInInfoList.forEach((item: any, index: any) => {
|
|
|
|
|
if (item.productCode == e.pickerName.value) {
|
|
|
|
|
this.Some = item;
|
|
|
|
|
this.SomeIndex = index;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
//提交
|
|
|
|
|
async searchBarcode() {
|
|
|
|
|
if (this.Barcode == '') {
|
|
|
|
|
this.customToast(this.$t('message.barcode') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let params = {
|
|
|
|
|
productCode: this.Some.productCode,
|
|
|
|
|
barcode: this.Barcode,
|
|
|
|
|
locCode: this.Some.originWl,
|
|
|
|
|
};
|
|
|
|
|
await this.model.searchBarcode(params);
|
|
|
|
|
this.Container = this.model.ContainerCode;
|
|
|
|
|
this.qty = this.Container.qty;
|
|
|
|
|
}
|
|
|
|
|
Add() {
|
|
|
|
|
if (!this.Some) {
|
|
|
|
|
this.customToast(this.$t('message.InventoryPleaseScan') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.Container == '') {
|
|
|
|
|
this.customToast(this.$t('message.scanningContainer') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.qty <= 0) {
|
|
|
|
|
this.customToast(this.$t('message.AppendMateriel2') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.Container.cpRef4 == null) {
|
|
|
|
|
if (this.qty > this.Container.qty) {
|
|
|
|
|
this.customToast(this.$t('message.AppendMateriel3') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (this.qty > this.Container.qty - this.Container.cpRef4) {
|
|
|
|
|
this.customToast(this.$t('message.AppendMateriel3') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let num = 0;
|
|
|
|
|
if (this.SubmitOrderlist.length != 0) {
|
|
|
|
|
this.SubmitOrderlist.forEach((item: any) => {
|
|
|
|
|
if (item.barCode == this.Container.barcode) {
|
|
|
|
|
num += item.qty;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (this.qty + num > this.Some.qty) {
|
|
|
|
|
this.customToast(this.$t('message.demandQuantity') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (this.Container.cpRef4 == null) {
|
|
|
|
|
if (this.qty + num > this.Container.qty) {
|
|
|
|
|
this.customToast(this.$t('message.AppendMateriel3') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (this.qty + num > this.Container.qty - this.Container.cpRef4) {
|
|
|
|
|
this.customToast(this.$t('message.AppendMateriel3') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.SubmitOrderlist.push(JSON.parse(JSON.stringify(this.Some)));
|
|
|
|
|
this.SubmitOrderlist[this.SubmitOrderlist.length - 1].type = '1';
|
|
|
|
|
this.SubmitOrderlist[this.SubmitOrderlist.length - 1].keepBy = session.loginName;
|
|
|
|
|
this.SubmitOrderlist[this.SubmitOrderlist.length - 1].orderType = '2';
|
|
|
|
|
this.SubmitOrderlist[this.SubmitOrderlist.length - 1].qty = this.qty;
|
|
|
|
|
this.SubmitOrderlist[this.SubmitOrderlist.length - 1].barCode = this.Container.barcode;
|
|
|
|
|
this.qty = 0;
|
|
|
|
|
this.Container = '';
|
|
|
|
|
this.model.orderInInfoList[this.SomeIndex].totalqty += this.qty;
|
|
|
|
|
}
|
|
|
|
|
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.model.orderInInfoList.forEach((item: any) => {
|
|
|
|
|
if (item.productCode == e.lineData.productCode) {
|
|
|
|
|
item.totalqty -= parseFloat(e.lineData.qty);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.SubmitOrderlist.splice(e.contentIndex, 1);
|
|
|
|
|
} else if (res.cancel) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
async submit() {
|
|
|
|
|
if (this.order3 === '') {
|
|
|
|
|
this.customToast(this.$t('message.Commission_tips1') as string);
|
|
|
|
@ -120,23 +233,37 @@ export default class KanDanHandOver extends BasePage {
|
|
|
|
|
this.customToast(this.$t('message.Warehouse_Tip5') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let orderlist = [];
|
|
|
|
|
this.Some.type = '1';
|
|
|
|
|
this.Some.keepBy = session.loginName;
|
|
|
|
|
this.Some.orderType = '2';
|
|
|
|
|
orderlist.push(this.Some);
|
|
|
|
|
await model.onTakeoutConfirm(orderlist);
|
|
|
|
|
if (this.SubmitOrderlist.length == 0) {
|
|
|
|
|
this.customToast(this.$t('message.Pi_NoData') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let isTrue = true;
|
|
|
|
|
this.model.orderInInfoList.forEach((item: any) => {
|
|
|
|
|
if (item.totalqty != 0) {
|
|
|
|
|
if (item.totalqty != item.qty) {
|
|
|
|
|
return (isTrue = false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (!isTrue) {
|
|
|
|
|
this.customToast(this.$t('message.Pi_tipqty') as string);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
await model.onTakeoutConfirm(this.SubmitOrderlist);
|
|
|
|
|
if (this.model.code == '1') {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
//icon: 'success',
|
|
|
|
|
title: this.$t('message.success') as string,
|
|
|
|
|
duration: 2000,
|
|
|
|
|
image: '/static/icons/icon-51.png',
|
|
|
|
|
});
|
|
|
|
|
this.Some = {};
|
|
|
|
|
//this.Some.fileNo = ' ';
|
|
|
|
|
this.wl = {};
|
|
|
|
|
this.MaterialList = [];
|
|
|
|
|
this.Barcode = '';
|
|
|
|
|
this.qty = 0;
|
|
|
|
|
this.SubmitOrderlist = [];
|
|
|
|
|
this.Container = '';
|
|
|
|
|
this.SomeIndex = 0;
|
|
|
|
|
this.query();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -184,19 +311,47 @@ export default class KanDanHandOver extends BasePage {
|
|
|
|
|
padding: 40rpx;
|
|
|
|
|
border-radius: 10rpx;
|
|
|
|
|
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
|
|
|
|
|
|
|
|
|
|
// .u-form-item {
|
|
|
|
|
// line-height: 35rpx;
|
|
|
|
|
// background-color: #f7f6fb;
|
|
|
|
|
// padding: 10rpx 30rpx;
|
|
|
|
|
// border-radius: 8rpx;
|
|
|
|
|
// &:after {
|
|
|
|
|
// border-bottom-width: 0;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
.u-form-item {
|
|
|
|
|
padding: 30rpx 0;
|
|
|
|
|
line-height: 35rpx;
|
|
|
|
|
.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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.add {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100rpx;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 478px;
|
|
|
|
|
left: 0;
|
|
|
|
|
button {
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: 3rpx;
|
|
|
|
|
right: 35rpx;
|
|
|
|
|
z-index: 10000;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.newly {
|
|
|
|
|
display: flex;
|
|
|
|
|
}
|
|
|
|
|
.single {
|
|
|
|
|
width: 100%;
|
|
|
|
|