cosmoim-852 fix 俄罗斯新增退货功能&&备件入库功能优化

master
hou 3 years ago
parent a726f886d0
commit d863a9e1d3

@ -490,7 +490,7 @@ export default {
returner: 'The returner must be equal to the login',
Inbound: 'Spare Inbound',
InboundDetail: 'Inbound Detail',
orderNum: 'Order Num',
orderNum: 'Num',
totalNum: 'total Num',
Operation: 'Operation',
StorageTime: 'Storage Time',

@ -147,7 +147,11 @@ export default class returningDom extends BasePage {
this.customToast(this.$t('message.barcode') as string);
return;
}
await this.model.searchBarcode(this.Barcode);
let params = {
productCode: this.materieCode.value,
barcode: this.Barcode,
};
await this.model.searchBarcode(params);
this.Container = this.model.ContainerCode;
let arr = {
label: this.Container.locCode,

@ -110,11 +110,12 @@ export class ReturningModule extends VuexModule {
return res;
}
@MutationAction
async searchBarcode(barcode: any) {
async searchBarcode(params: any) {
const res: any = await http.post(url.auth.query.barcode, {
factoryCode: session.factoryCode,
loginName: session.loginName,
barcode,
barcode: params.barcode,
productCode: params.productCode,
});
const ContainerCode = res.data;
return { ContainerCode };

@ -229,6 +229,7 @@ export default class RawReceiptDetail extends BasePage {
async query() {
if (this.form.documentNo == '') {
this.customToast(this.$t('message.Commission_tips1') as string);
return;
}
if (this.sapSupplyIdList.length != 0) {
await this.lock();
@ -300,7 +301,11 @@ export default class RawReceiptDetail extends BasePage {
this.customToast(this.$t('message.AppendMateriel5') as string);
return;
}
await this.model.searchBarcode(this.Barcode);
let params = {
productCode: this.some.materialCode,
barcode: this.Barcode,
};
await this.model.searchBarcode(params);
this.Container = this.model.ContainerCode;
let arr = {
label: this.Container.locCode,

@ -211,11 +211,12 @@ export class FeedingModule extends VuexModule {
}
//俄罗斯补料扫描容器码
@MutationAction
async searchBarcode(barcode: any) {
async searchBarcode(params: any) {
const res: any = await http.post(url.auth.query.barcode, {
factoryCode: session.factoryCode,
loginName: session.loginName,
barcode,
barcode: params.barcode,
productCode: params.productCode,
});
const ContainerCode = res.data;
return { ContainerCode };

@ -14,22 +14,24 @@
</u-form-item>
</u-form>
<view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="headers" :contents="model.detailedList" :show-vert-border="false"></wyb-table>
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="detailHeaders" :contents="model.detailedList" :show-vert-border="false"></wyb-table>
</view>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import { headers } from './config';
import { detailHeaders } from './config';
import model from './model';
import { session } from '@/store/modules/session';
@Component
export default class RawReceiptDetail extends BasePage {
model = model;
headers = headers;
detailHeaders = detailHeaders;
poNo: any = '';
onLoad() {
this.model.detailedList.length = 0;
}
async generate() {
if (this.poNo == '') {
this.customToast(this.$t('message._tips6') as any);
@ -42,9 +44,6 @@ export default class RawReceiptDetail extends BasePage {
};
await this.model.querydetaildlist(content);
}
// go() {
// this.toPage(this.page.raw.ingoods.dnReturnGoods.location);
// }
}
</script>
<style lang="scss" scoped>

@ -35,7 +35,7 @@
<!-- 应退数量 -->
<view class="material">
<view class="material-right">
<view class="material-right-title" style="width: 260rpx">{{ $t('message.returneds') }}:</view>
<view class="material-right-title" style="width: 88px">{{ $t('message.returneds') }}:</view>
<view class="material-right-code" style="overflow: hidden">{{ some.poAmount }}</view>
</view>
</view>
@ -79,6 +79,13 @@
<u-input :placeholder="$t('message.po_PleaseInput')" v-model="qty" type="number" :border="border" class="input" />
</view>
</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>
@ -120,7 +127,6 @@
import { Component, Ref } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import model from './model';
import { session } from '@/store/modules/session';
import { VForm, VFormRules } from 'vue/types/form';
import jPicker from '@/components/J-Picker/jPicker.vue';
import { headers } from './config';
@ -140,60 +146,68 @@ export default class RawReceiptDetail extends BasePage {
receiverName: '',
password: '',
};
/**
* 页面Module
*/
Barcode: any = '';
model = model;
materialList: any = [];
type = 'text';
wlCode: any = '';
wl: any = {};
border = true;
//
LocationList: any = [];
//
Location: any = [];
some: any = {};
someIndex: any = 0;
qty: any = '';
/**
* 表单数据
*/
form: any = {
// locationCode: null,
amount: null,
};
Container: any = {};
rules: VFormRules<any> = {
amount: [{ required: true, message: this.$t('message.Pi_tip1') as string }],
};
locationCodeSelect = false;
headers = headers;
//
async onReady() {
await this.GetLocation();
this.wlCode = this.Location[0];
}
//
async GetLocation() {
let content = {
loginName: session.loginName,
factoryCode: session.factoryCode,
workArea: session.workareaCode,
};
let res: any = await this.model.queryByFactory(content);
res.forEach((item: any) => {
let pickerName: any = {};
pickerName.label = item.locationCode;
pickerName.value = item.locationCode + '(' + item.sendSpot + ')';
pickerName.sendSpot = item.sendSpot;
this.Location.push(pickerName);
});
this.wlCode = this.Location[0];
}
//
onUpload() {
uni.navigateBack({ delta: 1 });
}
async searchBarcode() {
if (this.Barcode == '') {
this.customToast(this.$t('message.barcode') as string);
return;
}
if (this.materialList.length == 0) {
this.customToast(this.$t('message.AppendMateriel5') as string);
return;
}
let params = {
productCode: this.some.materialCode,
barcode: this.Barcode,
};
await this.model.searchBarcode(params);
this.Container = this.model.ContainerCode;
let arr = {
label: this.Container.locCode,
value: this.Container.locCode + '(' + this.Container.sendSpot + ')',
sendSpot: this.Container.sendSpot,
};
this.Location.push(arr);
this.wlCode = this.Location[0];
let num = 0;
if (this.LocationList.length != 0) {
this.LocationList.forEach((item: any) => {
if (item.barcode == this.Container.barcode) {
num += parseFloat(item.qty);
}
});
}
if (this.Container.cpRef4 == null) {
this.qty = parseFloat(this.Container.qty) - num;
} else {
this.qty = parseFloat(this.Container.qty) - parseFloat(this.Container.cpRef4) - num;
}
}
//
async query() {
if (!this.form.documentNo) {
@ -213,23 +227,18 @@ export default class RawReceiptDetail extends BasePage {
});
this.wl = this.materialList[0];
this.some = this.model.dnReturnList[0];
this.qty = this.model.dnReturnList[0].poAmount;
console.log('this.some', this.some);
}
});
}
//
materialChoice(e: any) {
console.log('e', e);
this.model.dnReturnList.forEach((item: any, index: any) => {
if (item.poLine == e.pickerName.Line && item.materialCode == e.pickerName.label && item.poNo == e.pickerName.poNo) {
this.some = item;
this.someIndex = index;
console.log(item);
}
});
this.qty = this.some.poAmount;
console.log('this.some', this.some);
console.log('this.someIndex', this.someIndex);
}
//
LocationChoice(e: any) {
@ -241,6 +250,10 @@ export default class RawReceiptDetail extends BasePage {
this.customToast(this.$t('message.Commission_tips2') as any);
return;
}
if (this.Barcode == '' || !this.Container.barcode) {
this.customToast(this.$t('message.scanningContainer') as any);
return;
}
if (parseFloat(this.qty) <= 0) {
this.customToast(this.$t('message.Commission_tips3') as any);
return;
@ -258,6 +271,25 @@ export default class RawReceiptDetail extends BasePage {
this.customToast(this.$t('message.dn_Tip2') as any);
return;
}
let codenum = 0;
if (this.LocationList.length != 0) {
this.LocationList.forEach((item: any) => {
if (item.barcode == this.Container.barcode) {
codenum += parseFloat(item.nowAmount);
}
});
}
if (this.Container.cpRef4 == null) {
if (this.qty > this.Container.qty - codenum) {
this.customToast(this.$t('message.AppendMateriel3') as any);
return;
}
} else {
if (this.qty > this.Container.qty - codenum - parseFloat(this.Container.cpRef4)) {
this.customToast(this.$t('message.AppendMateriel3') as any);
return;
}
}
let arr = {
poNo: this.some.poNo,
poLine: this.some.poLine,
@ -266,9 +298,9 @@ export default class RawReceiptDetail extends BasePage {
factoryCode: this.session.factoryCode,
wlCode: this.wlCode.label,
nowAmount: this.qty,
barcode: this.Container.barcode,
};
this.model.dnReturnList[this.someIndex].receiptAmount += parseFloat(this.qty);
console.log('this.model.dnReturnList', this.model.dnReturnList);
this.LocationList.push(arr);
this.qty = '';
}
@ -296,19 +328,11 @@ export default class RawReceiptDetail extends BasePage {
}
//
appoint() {
this.toPage(this.page.raw.ingoods.dnReturnGoods.Local);
this.toPage(this.page.raw.ingoods.RUSdnReturnGoods.Local);
}
//
async onSubmit() {
let isTrue = true;
// this.model.dnReturnList.forEach((item: any) => {
// if (item.receiptAmount != null || item.receiptAmount != 0) {
// if (item.receiptAmount != item.poAmount) {
// this.customToast(this.$t('message.materials') as any);
// return (isTrue = false);
// }
// }
// });
if (isTrue) {
await this.model.submit(this.LocationList).then(() => {
if (this.model.code == '1') {
@ -320,8 +344,9 @@ export default class RawReceiptDetail extends BasePage {
this.Location = [];
this.wl = {};
this.wlCode = '';
this.Barcode = '';
this.Container = {};
this.query();
this.GetLocation();
}
});
}
@ -416,7 +441,7 @@ export default class RawReceiptDetail extends BasePage {
height: 100%;
display: flex;
.material-right-title {
width: 160rpx;
width: 88px;
height: 100%;
line-height: 100rpx;
}
@ -506,11 +531,13 @@ export default class RawReceiptDetail extends BasePage {
.add {
width: 100%;
height: 100rpx;
position: relative;
position: absolute;
top: 514px;
left: 0;
button {
position: absolute;
top: 10rpx;
right: 20rpx;
top: 3rpx;
right: 35rpx;
}
}
}

@ -23,29 +23,31 @@ export const headers = [
key: 'nowAmount', //数量
width: 156,
},
// {
// label: vm.$t("message.po_MaterielDes"),
// key: "materialDesc",//物料描述
// width: 350,
// },
// {
// label: vm.$t("message.returned"),
// key: "poAmount",//应退货数量
// },
// {
// label: vm.$t("message.quantity"),
// key: "receiptAmount",//累计退货数量
// },
// {
// label: vm.$t("message.po_Supplier"),
// key: "supplyCode",//供应商
// },
// {
// label: vm.$t("message.po_OrderType"),
// key: "poType",//订单类型
// },
// {
// label: vm.$t("message.po_Location"),
// key: "wlCode",//库存地点
// },
{
label: vm.$t('message.Container'),
key: 'barcode', //容器码
width: 700,
},
];
export const detailHeaders = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode', //物料号
width: 204,
},
{
label: vm.$t('message.Line'),
key: 'poLine', //行项目
width: 156,
},
{
label: vm.$t('message.CommissionedLocation'),
key: 'wlCode', //库位
width: 156,
},
{
label: vm.$t('message.product_Number'),
key: 'amount', //数量
width: 156,
},
];

@ -34,6 +34,8 @@ export class ReceiptModule extends VuexModule {
dnNo = '';
dnReturnList = [];
code: any = '';
// 容器码
ContainerCode: any = '';
/**
*
*/
@ -212,7 +214,7 @@ export class ReceiptModule extends VuexModule {
}
@MutationAction
async submit(content: any) {
const res: any = await http.post('/wmspda/material/poReturn/materialComplete', content);
const res: any = await http.post('/wmspda/material/poReturn/materialCompleteTwo', content);
const code = res.code;
return { code };
}
@ -222,6 +224,18 @@ export class ReceiptModule extends VuexModule {
const detailedList = res.data;
return { detailedList };
}
//俄罗斯扫描容器码
@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,
});
const ContainerCode = res.data;
return { ContainerCode };
}
}
export default getModule(ReceiptModule);

@ -135,6 +135,7 @@ export default class RawReceiptDetail extends BasePage {
async query() {
if (this.form.documentNo == '') {
this.customToast(this.$t('message.Commission_tips1') as string);
return;
}
await this.model.queryBlDetailList(this.form.documentNo);
this.some = this.model.blDetailList;

@ -30,6 +30,9 @@ export default class RawReceiptDetail extends BasePage {
model = model;
headers = headers;
poNo: any = '';
onLoad() {
this.model.detailedList.length = 0;
}
async generate() {
if (this.poNo == '') {
this.customToast(this.$t('message._tips6') as any);
@ -42,9 +45,6 @@ export default class RawReceiptDetail extends BasePage {
};
await this.model.querydetaildlist(content);
}
// go() {
// this.toPage(this.page.raw.ingoods.dnReturnGoods.location);
// }
}
</script>
<style lang="scss" scoped>

@ -20,7 +20,7 @@ export const headers = [
},
{
label: vm.$t('message.product_Number'),
key: 'nowAmount', //数量
key: 'amount', //数量
width: 156,
},
// {

Loading…
Cancel
Save