cosmoim-852 fix 俄罗斯新增领用借用功能

master
hou 3 years ago
parent 4fe22d715d
commit 4e8237a968

@ -493,5 +493,6 @@ export default {
matcode: '物料编码',
Quantity: '需求数量',
scanningContainer: '请先扫描容器码',
Pi_tipqty: '请确保等于需求数量',
},
};

@ -500,5 +500,6 @@ export default {
matcode: 'Mat code',
Quantity: 'Request',
scanningContainer: 'Please scan the container code first',
Pi_tipqty: 'Please make sure it is equal to the required quantity',
},
};

@ -30,16 +30,38 @@ export const headers = [
label: vm.$t('message.product_costCenter'),
key: 'costCenter',
},
];
export const RUSdetailHeader = [
{
label: vm.$t('message.Warehouse_OrderNo'),
key: 'orderNo', //单号
width: 270,
},
{
label: vm.$t('message.po_MaterielNo'),
key: 'productCode', //物料号
width: 270,
},
{
label: vm.$t('message.po_MaterielDes'),
key: 'productDescZh', //物料描述
width: 520,
},
{
label: vm.$t('message.Container'),
key: 'barCode', //物料描述
width: 400,
},
{
label: vm.$t('message.dn_Number'),
key: 'qty', //数量
},
{
label: vm.$t('message.Warehouse_OriginalLocation'),
key: 'originWl', //原库位
},
// {
// label: '库存地点',
// key: 'wkposCode',
// },
// {
// label: '校验状态',
// key: 'checkResult',
// },
// {
// label: '看单号',
// key: 'kdOrderNo',
// label: vm.$t('message.Warehouse_TargetLocation'),
// key: 'aimWl', //目标库位
// },
];

@ -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%;

@ -12,6 +12,7 @@ class OrderInInfo {
kw?: string;
userDefined10?: string;
orderStatus?: string;
totalqty?: string;
}
@Module({
@ -21,28 +22,12 @@ class OrderInInfo {
name: 'raw.warehouse.rowCollect',
})
export class rowCollect extends VuexModule {
/**
* sap
*/
cboPlaceList = [];
/**
*
*/
poNo = '';
/**
*
*/
orderInInfo: OrderInInfo = new OrderInInfo();
/**
*
*/
orderInInfoList: OrderInInfo[] = [];
code: any = '';
/**
*
*/
// orderInInfoListEx: OrderInInfo[] = [];
ContainerCode: any = '';
/**
// * 查询看单号
* @param poNo
@ -59,21 +44,33 @@ export class rowCollect extends VuexModule {
loginName: session.loginName,
});
const orderInInfoList = records.data.records;
orderInInfoList.forEach((item: any) => {
item.totalqty = 0;
});
const code = records.code;
console.log('获取来的数据', orderInInfoList);
return { orderInInfoList, code };
} catch {
//uni.showToast({ icon: 'none', title: vm.$t('message.Warehouse_Tip11') as any });
vm.customToast(vm.$t('message.Warehouse_Tip11') as any);
}
}
@MutationAction
async onTakeoutConfirm(list: any) {
const records: any = await http.post(url.warehouse.rowTransfer.commit, list);
const records: any = await http.post(url.warehouse.rowTransfer.russia, list);
const code = records.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,
locCode: params.locCode,
});
const ContainerCode = res.data;
return { ContainerCode };
}
}
export default getModule(rowCollect);

@ -42,6 +42,18 @@
<u-form-item :label="$t('message.DocumentNumber')">
<u-input v-model="Some.fileNo" :border="border" :placeholder="$t('message.fileNumber')" />
</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">
@ -91,8 +103,9 @@ export default class KanDanHandOver extends BasePage {
MaterialList: any = [];
SubmitOrderlist: any = [];
Container: any = '';
qty = 0;
qty: any = 0;
Barcode: any = '';
SomeIndex = 0;
async query() {
if (this.order3 === '') {
this.customToast(this.$t('message.Commission_tips1') as string);
@ -122,9 +135,10 @@ 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;
}
});
}
@ -164,12 +178,12 @@ export default class KanDanHandOver extends BasePage {
return;
}
if (this.Container.cpRef4 == null) {
if (this.qty <= 0 || this.qty > this.Container.qty) {
if (parseFloat(this.qty) <= 0 || parseFloat(this.qty) > this.Container.qty) {
this.customToast(this.$t('message.AppendMateriel3') as string);
return;
}
} else {
if (this.qty <= 0 || this.qty > this.Container.qty - this.Container.cpRef4) {
if (parseFloat(this.qty) <= 0 || parseFloat(this.qty) > this.Container.qty - parseFloat(this.Container.cpRef4)) {
this.customToast(this.$t('message.AppendMateriel3') as string);
return;
}
@ -178,17 +192,24 @@ export default class KanDanHandOver extends BasePage {
if (this.SubmitOrderlist.length != 0) {
this.SubmitOrderlist.forEach((item: any) => {
if (item.barCode == this.Container.barcode) {
num += item.qty;
num += parseFloat(item.qty);
}
});
}
console.log(num);
if (parseFloat(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) {
if (parseFloat(this.qty) + num > this.Container.qty) {
console.log(1);
this.customToast(this.$t('message.AppendMateriel3') as string);
return;
}
} else {
if (this.qty + num > this.Container.qty - this.Container.cpRef4) {
if (parseFloat(this.qty) + num > this.Container.qty - parseFloat(this.Container.cpRef4)) {
console.log(2);
this.customToast(this.$t('message.AppendMateriel3') as string);
return;
}
@ -199,6 +220,7 @@ export default class KanDanHandOver extends BasePage {
this.SubmitOrderlist[this.SubmitOrderlist.length - 1].orderType = '1';
this.SubmitOrderlist[this.SubmitOrderlist.length - 1].qty = this.qty;
this.SubmitOrderlist[this.SubmitOrderlist.length - 1].barCode = this.Container.barcode;
this.model.orderInInfoList[this.SomeIndex].totalqty += parseFloat(this.qty);
this.Container = '';
this.qty = 0;
this.Barcode = '';
@ -210,6 +232,11 @@ export default class KanDanHandOver extends BasePage {
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;
@ -222,6 +249,18 @@ export default class KanDanHandOver extends BasePage {
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({
@ -299,6 +338,9 @@ export default class KanDanHandOver extends BasePage {
padding: 30rpx 0;
line-height: 35rpx;
}
.newly {
display: flex;
}
.single {
width: 100%;
height: 100rpx;
@ -325,7 +367,7 @@ export default class KanDanHandOver extends BasePage {
width: 100%;
height: 100rpx;
position: absolute;
top: 550px;
top: 620px;
left: 0;
button {
position: absolute;

@ -9,6 +9,7 @@ class OrderInInfo {
poNo?: string;
kw?: string;
userDefined10?: string;
totalqty?: string;
orderStatus?: string;
}
@Module({
@ -40,6 +41,9 @@ export class rowScrap extends VuexModule {
loginName: session.loginName,
});
const orderInInfoList = records.data.records;
orderInInfoList.forEach((item: any) => {
item.totalqty = 0;
});
const code = records.code;
return { orderInInfoList, code };
} catch {

@ -27,8 +27,8 @@
<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" />
<u-form-item :label="$t('message.dn_Number')">
<u-input v-model="Some.qty" :disabled="true" placeholder="" type="number" />
</u-form-item>
<!-- 原库位 -->
<u-form-item :label="$t('message.Warehouse_OriginalLocation')">

Loading…
Cancel
Save