guoshuang 3 years ago
commit 98fec879d5

@ -1,5 +1,15 @@
<!--
* @Author: zhou lei
* @Date: 2021-12-14 09:59:02
* @LastEditTime: 2022-01-20 11:53:51
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/App.vue
* 联系方式:910592680@qq.com 18669792120 科海达信息技术有限公司
-->
<script lang="ts">
import Vue from 'vue';
import MyMixin from './utils/mixin';
// #ifdef APP-PLUS
import checkAppUpdate from '@/plugins/app-update';
// #endif

@ -1,7 +1,17 @@
import { Component, Vue } from "vue-property-decorator";
import { page } from "@/utils/page";
import { session } from "@/store/modules/session";
import { image } from "@/utils/image";
/*
* @Author: zhou lei
* @Date: 2021-11-08 17:12:53
* @LastEditTime: 2022-01-20 11:57:05
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/components/base/page.ts
* :910592680@qq.com 18669792120
*/
import { Component, Vue } from 'vue-property-decorator';
import { page } from '@/utils/page';
import { session } from '@/store/modules/session';
import { image } from '@/utils/image';
@Component
export class BasePage extends Vue {
/**

@ -68,7 +68,7 @@ export default {
po_Supplier: '供应商',
po_OrderType: '订单类型',
po_Location: '库存地点',
SAPLocation:'所选物料没有SAP库位请重新选择',
SAPLocation: '所选物料没有SAP库位请重新选择',
po_PleaseScan: '请扫描PO单号',
po_PleaseScanMATcode: '请扫描物料条码',
PleaseScan: '请扫描',
@ -253,7 +253,7 @@ export default {
CommissionedDemandData: '需求数据',
CommissionedCumulativeData: '累计数据',
CommissionedLocation: '库位',
CommissionedThisNumber: '本次数量',
CommissionedThisNumber: '本次',
CommissionedNumber: '入库数量',
CommissionedEntrantDetails: '入库明细',
CommissionedReceiptQuantity: '收货数量',
@ -356,6 +356,7 @@ export default {
product_Tip7: '同一条码不可重复录入!',
product_Tip8: '扫码成功',
product_Tip9: '该条码未入库',
repeatedly: '请勿重复添加',
//半成品冰箱下线
product_unit1: '件/个',
@ -386,6 +387,7 @@ export default {
product_Tip5: '条码不规范',
product_Tip6: '扫描出库数量不可大于物料总数',
product_StoListDetails: 'STO单明细',
delete: '删除',
//领用借用
Warehouse_Tip1: '请输入DN单号',

@ -245,7 +245,7 @@ export default {
finishedProduct: 'Please select finished product code first',
CommissionedDemandData: 'Demand',
CommissionedCumulativeData: 'total',
CommissionedLocation: 'Location',
CommissionedLocation: 'Loc',
CommissionedThisNumber: 'quantity',
CommissionedNumber: 'Receipt quantity',
CommissionedEntrantDetails: 'Warehousing',
@ -353,6 +353,8 @@ export default {
product_FGDes: 'FG desc',
product_MaterialDes: 'MAT desc',
product_Number: 'Qty',
repeatedly: 'Do not add repeatedly',
delete: 'delete',
product_costCenter: 'Cost center',
product_Unit: 'Unit',
product_Cancel: 'Cancel',

@ -11,6 +11,7 @@
<u-image width="288rpx" height="85rpx" :src="image.global.logo1"></u-image>
<span>V1.6</span>
</view>
<u-form class="form" :model="form" ref="form" :border-bottom="false" :error-type="['toast']">
<u-form-item
class="form-item"
@ -24,7 +25,7 @@
}"
><u-input
v-model="form.username"
:placeholder="this.$t('message.PleaseInputUserName')"
:placeholder="$t('message.PleaseInputUserName')"
placeholder-style="color: rgba(255, 255, 255, 0.36)"
:custom-style="{
height: '88rpx',
@ -44,7 +45,7 @@
}"
><u-input
v-model="form.password"
:placeholder="this.$t('message.PleaseInputPassword')"
:placeholder="$t('message.PleaseInputPassword')"
type="password"
placeholder-style="color: rgba(255, 255, 255, 0.36)"
:custom-style="{
@ -77,7 +78,7 @@
</template>
<script lang="ts">
import { Component, Ref } from 'vue-property-decorator';
import { Component, Ref, Watch } from 'vue-property-decorator';
import { server } from '@/pages/login/server/model';
import Alerts from '@/components/alert/alerts.vue';
import { page } from '@/utils/page';
@ -87,10 +88,13 @@ import { VForm } from 'vue/types/form';
import { Lang } from '@/i18n';
import { url } from '@/utils/url';
import { path } from 'lodash/fp';
// mixin
import MyMixins from '@/utils/mixin';
// import { any } from 'lodash/fp';
@Component({
components: { Alerts },
mixins: [MyMixins],
})
export default class LoginPage extends BasePage {
/**
@ -108,6 +112,14 @@ export default class LoginPage extends BasePage {
return server.serverAddress;
}
//
username = '';
@Watch('username')
typeNum() {
this.$nextTick(() => {
this.username = this.username.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');
});
}
form = {
username: '',
password: '',

@ -152,7 +152,11 @@ export default class dnReceiptDom extends BasePage {
}
//
async query() {
this.empty();
this.list = [];
this.wlCode = '';
this.nowAmount = '';
this.every = '';
this.materialList = [];
if (this.form.documentNo == '') {
uni.showToast({
icon: 'none',
@ -187,6 +191,13 @@ export default class dnReceiptDom extends BasePage {
}
//
Add() {
if (!this.every) {
uni.showToast({
icon: 'none',
title: this.$t('message.Commission_tips6') as any,
});
return;
}
if (this.nowAmount == '' || this.wlCode == '') {
uni.showToast({
icon: 'none',
@ -214,10 +225,15 @@ export default class dnReceiptDom extends BasePage {
success: (res) => {
if (res.confirm) {
let arr = {
poNo: this.form.documentNo,
materialCode: this.every.materialCode,
loginName: this.session.loginName,
factoryCode: this.session.factoryCode,
wlCode: this.wlCode.label,
nowAmount: this.nowAmount,
};
this.list.push(arr);
console.log('this.list', this.list);
this.business();
} else if (res.cancel) {
return;
@ -226,15 +242,21 @@ export default class dnReceiptDom extends BasePage {
});
} else {
let arr = {
poNo: this.form.documentNo,
materialCode: this.every.materialCode,
loginName: this.session.loginName,
factoryCode: this.session.factoryCode,
wlCode: this.wlCode.label,
nowAmount: this.nowAmount,
};
this.list.push(arr);
console.log('this.list', this.list);
this.business();
}
}
deleteItem(index: any) {
this.list.splice(index, 1);
console.log('this.list', this.list);
this.business();
}
async onSubmit() {
@ -244,14 +266,14 @@ export default class dnReceiptDom extends BasePage {
title: this.$t('message.Commission_tips5') as any,
});
}
let upload = {
poNo: this.form.documentNo,
materialCode: this.every.materialCode,
loginName: session.loginName,
factoryCode: session.factoryCode,
list: this.list,
};
await this.model.submitOutsourcing(upload);
// let upload = {
// poNo: this.form.documentNo,
// materialCode: this.every.materialCode,
// loginName: session.loginName,
// factoryCode: session.factoryCode,
// list: this.list,
// };
await this.model.submitOutsourcing(this.list);
this.empty();
}
async bill() {

@ -1,14 +1,8 @@
import {
Action,
getModule,
Module,
MutationAction,
VuexModule,
} from "vuex-module-decorators";
import store from "@/store";
import http from "@/utils/request";
import { url } from "@/utils/url";
import { session } from "@/store/modules/session";
import { Action, getModule, Module, MutationAction, VuexModule } from 'vuex-module-decorators';
import store from '@/store';
import http from '@/utils/request';
import { url } from '@/utils/url';
import { session } from '@/store/modules/session';
// import vm from '@/main';
class OrderInInfo {
@ -23,7 +17,7 @@ class OrderInInfo {
namespaced: true,
dynamic: true,
store,
name: "product.outbound.stoOutbound",
name: 'product.outbound.stoOutbound',
})
export class ReturningModule extends VuexModule {
/**
@ -43,7 +37,7 @@ export class ReturningModule extends VuexModule {
*/
orderInInfo: OrderInInfo = new OrderInInfo();
//记账按钮的code码
code = "";
code = '';
/**
*
* @param orderNo
@ -99,15 +93,12 @@ export class ReturningModule extends VuexModule {
*/
@Action
async materialComplete(form: any) {
const res = await http.post(
url.material.commission.goOut.materialComplete,
{
factoryCode: session.factoryCode,
loginName: session.loginName,
...form,
}
);
console.log(res, ">>>>>res");
const res = await http.post(url.material.commission.goOut.materialComplete, {
factoryCode: session.factoryCode,
loginName: session.loginName,
...form,
});
console.log(res, '>>>>>res');
}
/**
@ -120,15 +111,12 @@ export class ReturningModule extends VuexModule {
loginName: session.loginName,
};
let oneMaterielDetail: any = {};
const { data }: any = await http.post(
url.outbound.stoOutbound.checkScan,
obj
);
console.log("shneme a ", data.records);
const { data }: any = await http.post(url.outbound.stoOutbound.checkScan, obj);
console.log('shneme a ', data.records);
oneMaterielDetail = data.records[0];
data.records[0].materialCode = list[0].productCode;
data.records[0].materialDesc = list[0].productDescZh;
console.log("aaaaa", oneMaterielDetail);
console.log('aaaaa', oneMaterielDetail);
return oneMaterielDetail;
}
/**
@ -137,11 +125,8 @@ export class ReturningModule extends VuexModule {
*/
@MutationAction
async confirm(list: any[]) {
const { code, data } = await http.post(
url.outbound.stoOutbound.Bookkeeping,
list
);
console.log("res数据", data, code);
const { code, data } = await http.post(url.outbound.stoOutbound.Bookkeeping, list);
console.log('res数据', data, code);
// if (code == '1') {
// uni.showToast({ icon: 'success', title: msg });
// } else {
@ -150,13 +135,11 @@ export class ReturningModule extends VuexModule {
const materielList: any = [];
return { code, materielList };
}
@Action({ commit: "updateCheckedOrderInInfoListKw" })
//委外出库 初始化获取库位
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
async queryByFactoryCodeAndWorkAreaCode(content: any) {
let res = await http.post(
"/wmspda/fg/queryByFactoryCodeAndWorkAreaCode",
content
);
let res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content);
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', res);
return res;
}
@ -172,20 +155,14 @@ export class ReturningModule extends VuexModule {
@Action
async submitOutsourcing(upload: any) {
let res = await http.post(
url.outbound.stoOutbound.materialComplete,
upload
);
let res = await http.post(url.outbound.stoOutbound.materialComplete, upload);
return res;
}
//查询明细
@Action({ commit: "updateCheckedOrderInInfoListKw" })
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
async querydetaildlist(content: any) {
let res: any = await http.post(
"/wmspda/material/outsourcing/outInfo",
content
);
console.log("明细》》》》》》》》》", res.list);
let res: any = await http.post('/wmspda/material/outsourcing/outInfo', content);
console.log('明细》》》》》》》》》', res.list);
this.detailedList = res.data;
return res;
}

@ -55,7 +55,7 @@
<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="wl.value" class="search" :options="newLocation" />
<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>
@ -66,21 +66,7 @@
<view class="add">
<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-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">
<u-button type="error" size="small" style="font-size: 20px" @click="deleteItem(index)">{{ $t('message.product_Delete') }}</u-button>
</u-td>
</u-tr>
</u-table>
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="headers" :contents="LocationList" :show-vert-border="false" @onCellClick="deleteItem($event)"></wyb-table>
</view>
<!-- 底部按钮 -->
<view class="bottom-bar">
@ -99,12 +85,13 @@
</view>
</template>
<script lang="ts">
import { Component, Ref } from 'vue-property-decorator';
import { Component } 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 LocationDetail from './model.location';
import { headers } from './config';
@Component({
components: {
jPicker,
@ -115,27 +102,27 @@ export default class dnReceiptDom extends BasePage {
form: any = {
documentNo: '',
};
//
material: any = [];
poList: any = [];
materialList: any = [];
//
every: any = {};
value = '';
headers = headers;
type = 'text';
//
DNReceivingList: any = [];
//
DNReceivingListIndex: any = null;
border = true;
//
//Cumulative: any = 0;
//
//sendSpotList: any = [];
//
receiptAmount: any = '';
//
Location: any = [];
//
newLocation: any = [];
//
Location: LocationDetail[] = [];
//
LocationList: any = [];
DNReceivingListIndex: any = null;
//
//
wl: any = {
value: null,
};
@ -143,13 +130,12 @@ export default class dnReceiptDom extends BasePage {
poNo: any = null;
//
requestAmount: number = null;
//
upload: any = [];
//
async onReady() {}
//
//
async initLocation() {
async initLocation(condition): Promise<LocationDetail[]> {
console.log('condition>>>>>>>>>>>>>>>>>>.', condition);
//
let list: Array<LocationDetail> = [];
let means: any = JSON.parse(localStorage.getItem('__GWMS_APP_STATE_DATA__') as any);
let sendSpot = JSON.parse(localStorage.getItem('sendSpot') as any);
let content = {
@ -159,27 +145,28 @@ export default class dnReceiptDom extends BasePage {
workArea: session.workareaCode,
};
let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content);
res.forEach((item: any) => {
console.log('res is:', res);
let pickerName: any = {};
pickerName.label = item.locationCode;
pickerName.value = item.locationCode + '(' + item.sendSpot + ')';
pickerName.sendSpot = item.sendSpot;
this.Location.push(pickerName);
console.log('>>>>>>>>>>>>>>', res);
res.forEach((item: LocationDetail) => {
if (item.sendSpot === condition.sendSpot) {
let pickerName: any = {};
pickerName.label = item.locationCode;
pickerName.value = item.locationCode + '(' + item.sendSpot + ')';
pickerName.sendSpot = item.sendSpot;
list.push(pickerName);
}
});
return list;
}
//
async query() {
if (this.form.documentNo == '') {
if (!this.form.documentNo) {
uni.showToast({
icon: 'none',
title: this.$t('message.Commission_tips1') as any,
});
return;
}
//
this.initLocation();
await this.model.ImportQueryOrderInfo(this.form.documentNo);
await this.model.ImportQueryOrderInfo(this.form.documentNo.trim());
if (model.code == '1') {
uni.showToast({
icon: 'none',
@ -189,7 +176,7 @@ export default class dnReceiptDom extends BasePage {
let list: any = localStorage.getItem('list');
localStorage.removeItem('list');
this.material = JSON.parse(list);
this.poList = [...this.material];
this.poList = [...this.material]; //
let arr = this.removeDuplicates(this.poList, 'poNo');
//
arr.forEach((item: any) => {
@ -215,7 +202,7 @@ export default class dnReceiptDom extends BasePage {
}, []);
return arr;
}
// ADD list
// ADD
totalLocation(list: []) {
const receiptAmount = list.reduce((total: number, nextItem: any): any => {
return total + +nextItem.receiptAmount;
@ -235,42 +222,23 @@ export default class dnReceiptDom extends BasePage {
return true;
}
});
// 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);
// }
// });
//
this.materialChoice({
pickerName: this.materialList.find(() => true),
});
}
// receiptAmount requestAmount every=
materialChoice(e: any) {
// receiptAmount requestAmount
async materialChoice(e: any) {
//
this.every = { ...e.pickerName };
if (this.DNReceivingListIndex == null) {
this.model.ImportDNReceivingList.push(this.every);
}
this.model.ImportDNReceivingList.forEach((item: any, index: any) => {
if (item.poLine == this.every.poLine || item.materialCode == this.every.materialCode || item.dnNo == this.every.dnNo) {
this.DNReceivingListIndex = index;
}
});
this.model.ImportDNReceivingList.forEach((item: any, index: any) => {
if (item.poLine != this.every.poLine || item.materialCode != this.every.materialCode || item.dnNo != this.every.dnNo) {
this.model.ImportDNReceivingList.push(this.every);
this.DNReceivingListIndex = index + 1;
}
});
this.newLocation = [];
this.newLocation = this.Location.filter((item: any) => item.sendSpot === this.every.sendSpot);
console.log('newLoction', this.newLocation);
//
this.Location = [];
//
this.Location = await this.initLocation(this.every);
//
this.LocationChoice({
pickerName: this.newLocation.find(() => true),
pickerName: this.Location.find(() => true),
});
}
//
@ -279,9 +247,8 @@ export default class dnReceiptDom extends BasePage {
}
//
Add() {
//count
const count = this.totalLocation(this.LocationList);
if (this.receiptAmount == '' || this.wl.value == '') {
if (this.receiptAmount == '' || !this.wl.value) {
uni.showToast({
icon: 'none',
title: this.$t('message.Commission_tips2') as any,
@ -302,48 +269,70 @@ export default class dnReceiptDom extends BasePage {
});
return;
}
// 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,
});
return;
}
//aad
this.LocationList.push({
...this.every,
wlCode: this.wl.label,
receiptAmount: this.receiptAmount,
});
this.model.ImportDNReceivingList[this.DNReceivingListIndex].wllist.push(this.LocationList);
//
this.every.wllist = [];
if (this.DNReceivingList.length == 0) {
this.DNReceivingList.push(this.every);
this.DNReceivingList[0].wllist.push(this.LocationList[this.LocationList.length - 1]);
} else {
let isTrue: any = false;
let wllistIsTrue: any = false;
this.DNReceivingList.forEach((item: any, index: any) => {
if (item.poNo == this.every.poNo || item.poLine == this.every.poLine || item.materialCode == this.every.materialCode) {
isTrue = true;
this.DNReceivingListIndex = index;
item.wllist.forEach((item: any) => {
if (item.poNo == this.LocationList.poNo || item.poLine == this.LocationList.poLine || item.materialCode == this.LocationList.materialCode || item.wlCode == this.LocationList.wlCode || item.receiptAmount == this.LocationList.receiptAmount) {
wllistIsTrue = true;
}
});
}
});
if (isTrue == false) {
this.DNReceivingList.push(this.every);
this.DNReceivingList[this.DNReceivingList.length - 1].wllist.push(this.LocationList[this.LocationList.length - 1]);
}
if (isTrue == true || wllistIsTrue == true) {
uni.showToast({
icon: 'none',
title: this.$t('message.repeatedly') as any,
});
}
if (isTrue == true || wllistIsTrue == false) {
this.DNReceivingList[this.DNReceivingListIndex].wllist.push(this.LocationList[this.LocationList.length - 1]);
}
isTrue = false;
wllistIsTrue = false;
}
this.receiptAmount = '';
//true
isTrue = true;
this.business();
}
deleteItem(indexItem: any) {
let Item: any = {};
this.model.ImportDNReceivingList.forEach((item: any) => {
if (item.poLine == this.every.poLine || item.materialCode == this.every.materialCode || item.dnNo == this.every.dnNo) {
Item = item;
}
});
Item.wllist.forEach((item: any, index: any) => {
if (item.poLine == this.LocationList[indexItem].poLine || item.materialCode == this.LocationList[indexItem].materialCode || item.dnNo == this.LocationList[indexItem].dnNo) {
Item.wllist.splice(index, 1);
}
});
//splice
this.LocationList.splice(indexItem, 1);
this.business();
// guoshuang
uni.showToast({
icon: 'none',
title: this.$t('message.success') as any,
deleteItem(e: any) {
console.log('data', e.lineData);
uni.showModal({
title: this.$t('message.delete') as any,
cancelText: this.$t('message.Cancel') as any,
confirmText: this.$t('message.workArea_Confirm') as any,
success: (res) => {
if (res.confirm) {
this.DNReceivingList.forEach((item: any) => {
if (item.poNo == e.lineData.poNo || item.poLine == e.lineData.poLine || item.materialCode == e.lineData.materialCode) {
item.wllist.forEach((item: any, index: any) => {
if (item.poNo == e.lineData.poNo || item.poLine == e.lineData.poLine || item.materialCode == e.lineData.materialCode || item.wlCode == e.lineData.wlCode || item.receiptAmount == e.lineData.receiptAmount) {
item.wllist.splice(index, 1);
}
});
}
});
this.LocationList.splice(e.contentIndex, 1);
} else if (res.cancel) {
return;
}
},
});
}
//
@ -353,7 +342,6 @@ export default class dnReceiptDom extends BasePage {
this.LocationList = [];
//
this.Location = [];
this.newLocation = [];
this.poNo = '';
this.poList = [];
//
@ -362,10 +350,14 @@ export default class dnReceiptDom extends BasePage {
};
//
this.every = {};
//
// this.material = [];
//
this.materialList = [];
//
this.receiptAmount = null;
this.DNReceivingList = [];
await this.query();
}
async onSubmit() {
@ -376,9 +368,12 @@ export default class dnReceiptDom extends BasePage {
});
return null;
}
//
this.every.wllist = this.LocationList;
await this.model.submitOrderInEnter(this.model.ImportDNReceivingList);
let obj = {
factoryCode: this.session.factoryCode,
loginName: this.session.loginName,
list: this.DNReceivingList,
};
await this.model.submitOrderInEnter(obj);
this.resetForm();
}
async bill() {
@ -395,9 +390,9 @@ export default class dnReceiptDom extends BasePage {
dnNo: this.form.documentNo,
};
await this.model.querydetaildlist(content);
this.redirectTo(this.page.raw.ingoods.dnReceipt.Local);
this.toPage(this.page.raw.ingoods.dnReceipt.Local);
}
// totalLocationtotalLocationsome
//
business() {
this.every.receiptAmount = this.totalLocation(this.LocationList);
}
@ -471,11 +466,25 @@ export default class dnReceiptDom extends BasePage {
height: 100%;
display: flex;
view {
width: 200rpx;
width: 140rpx;
line-height: 100rpx;
}
}
}
// .material {
// width: 100%;
// height: 100rpx;
// display: flex;
// .material-left {
// width: 100%;
// height: 100%;
// display: flex;
// view {
// width: 100rpx;
// line-height: 100rpx;
// }
// }
// }
.material {
width: 100%;
height: 100rpx;
@ -485,15 +494,11 @@ export default class dnReceiptDom extends BasePage {
height: 100%;
display: flex;
view {
width: 100rpx;
width: 140rpx;
line-height: 100rpx;
text-align: left;
}
}
}
.material {
width: 100%;
height: 100rpx;
display: flex;
.material-right {
width: 100%;
height: 100%;
@ -538,6 +543,7 @@ export default class dnReceiptDom extends BasePage {
.number-right-title {
width: 140rpx;
height: 100%;
text-align: center;
line-height: 100rpx;
}
.input {

@ -4,30 +4,35 @@
import vm from '@/main';
export const headers = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
label: vm.$t('message.Line'),
key: 'poLine',
},
{
label: vm.$t('message.po_MaterielDes'),
key: 'materialDesc',
label: vm.$t('message.po_OddNumbers'),
key: 'poNo',
width: 350,
},
{
label: vm.$t('message.po_DemandQuantity'),
key: 'requestAmount',
label: vm.$t('message.Pi_materielNo'),
key: 'materialCode',
width: 350,
},
{
label: vm.$t('message.po_ActualQuantity'),
label: vm.$t('message.CommissionedLocation'),
key: 'wlCode',
},
{
label: vm.$t('message.product_Number'),
key: 'receiptAmount',
},
// {
// label: vm.$t('message.po_RemainingQuantity'),
// key: 'splitAmount',
// },
{
label: vm.$t('message.po_Location'),
key: 'location',
},
// {
// label: vm.$t('message.po_Location'),
// key: 'location',
// },
// {
// label: '物料详情',
// key: 'materialDesc',

@ -66,21 +66,7 @@
<view class="add">
<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-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">
<u-button type="error" size="small" style="font-size: 20px" @click="deleteItem(index)">{{ $t('message.product_Delete') }}</u-button>
</u-td>
</u-tr>
</u-table>
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="headers" :contents="LocationList" :show-vert-border="false" @onCellClick="deleteItem($event)"></wyb-table>
</view>
<!-- 底部按钮 -->
<view class="bottom-bar">
@ -105,6 +91,7 @@ import jPicker from '@/components/J-Picker/jPicker.vue';
import { session } from '@/store/modules/session';
import model from './model';
import LocationDetail from './model.location';
import { headers } from './config';
@Component({
components: {
jPicker,
@ -122,7 +109,12 @@ export default class dnReceiptDom extends BasePage {
//
every: any = {};
value = '';
headers = headers;
type = 'text';
//
DNReceivingList: any = [];
allNum: any = 0;
//
DNReceivingListIndex: any = null;
border = true;
//
@ -139,6 +131,7 @@ export default class dnReceiptDom extends BasePage {
poNo: any = null;
//
requestAmount: number = null;
<<<<<<< HEAD
//receiptAmount = (this.receiptAmount.match(/\d+(.\d{0,2})?/) || [''])[0];
async onReady() {
this.model.DNReceivingList = [];
@ -148,6 +141,8 @@ export default class dnReceiptDom extends BasePage {
input() {
this.receiptAmount = (this.receiptAmount.match(/\d+(.\d{0,2})?/) || [''])[0];
}
=======
>>>>>>> e06fba98009bdb7923f4a67091d1f3e4224bdb07
//
//
async initLocation(condition): Promise<LocationDetail[]> {
@ -163,6 +158,7 @@ export default class dnReceiptDom extends BasePage {
workArea: session.workareaCode,
};
let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content);
console.log('>>>>>>>>>>>>>>', res);
res.forEach((item: LocationDetail) => {
if (item.sendSpot === condition.sendSpot) {
let pickerName: any = {};
@ -191,12 +187,6 @@ export default class dnReceiptDom extends BasePage {
});
}
let list: any = localStorage.getItem('list');
// if (list) {
// uni.showToast({
// icon: 'none',
// title: this.$t('message.success') as any,
// });
// }
localStorage.removeItem('list');
this.material = JSON.parse(list);
this.poList = [...this.material]; //
@ -234,6 +224,7 @@ export default class dnReceiptDom extends BasePage {
}
//
poListChoice(e: any) {
this.receiptAmount = '';
this.poNo = e.pickerName.value;
//
this.materialList = JSON.parse(JSON.stringify(this.removeDuplicates(this.material, 'materialCode')));
@ -252,23 +243,15 @@ export default class dnReceiptDom extends BasePage {
}
// receiptAmount requestAmount
async materialChoice(e: any) {
this.receiptAmount = '';
//
this.every = { ...e.pickerName };
if (this.DNReceivingListIndex == null) {
this.model.DNReceivingList.push(this.every);
}
this.model.DNReceivingList.forEach((item: any, index: any) => {
if (item.poLine == this.every.poLine || item.materialCode == this.every.materialCode || item.dnNo == this.every.dnNo) {
this.DNReceivingListIndex = index;
this.LocationList.forEach((item: any) => {
if (item.poNo == this.every.poNo || item.poLine == this.every.poLine || item.materialCode == this.every.materialCode) {
this.every.receiptAmount += parseFloat(item.receiptAmount);
}
});
this.model.DNReceivingList.forEach((item: any, index: any) => {
if (item.poLine != this.every.poLine || item.materialCode != this.every.materialCode || item.dnNo != this.every.dnNo) {
this.model.DNReceivingList.push(this.every);
this.DNReceivingListIndex = index + 1;
}
});
console.log('this.model.DNReceivingList', this.model.DNReceivingList);
this.every.wllist = [];
//
this.Location = [];
//
@ -285,7 +268,9 @@ export default class dnReceiptDom extends BasePage {
}
//
Add() {
const count = this.totalLocation(this.LocationList);
// const count = this.totalLocation(this.LocationList);
const count = parseFloat(this.every.requestAmount);
console.log('count', count);
if (this.receiptAmount == '' || !this.wl.value) {
uni.showToast({
icon: 'none',
@ -300,52 +285,108 @@ export default class dnReceiptDom extends BasePage {
});
return;
}
if (parseFloat(this.receiptAmount) > this.every.requestAmount || +this.receiptAmount + count > this.every.requestAmount) {
if (parseFloat(this.receiptAmount) > this.every.requestAmount || parseFloat(this.receiptAmount) + parseFloat(this.every.receiptAmount) > count) {
uni.showToast({
icon: 'none',
title: this.$t('message.Commission_tips4') as any,
});
console.log('2333');
console.log('parseFloat(this.every.this.receiptAmount)', this.receiptAmount + parseFloat(this.every.receiptAmount));
return;
}
// return
let isTrue = this.LocationList.some((item) => item.wlCode !== this.wl.label);
// if (isTrue) {
// uni.showToast({
// icon: 'none',
// title: this.$t('message._tips5') as any,
// });
// return;
// }
this.LocationList.push({
...this.every,
wlCode: this.wl.label,
receiptAmount: this.receiptAmount,
});
this.model.DNReceivingList[this.DNReceivingListIndex].wllist.push(this.LocationList);
if (this.DNReceivingList.length != 0) {
let isTrue: any = false;
let wllistIsTrue: any = false;
this.DNReceivingList.forEach((item: any, index: any) => {
if (item.poNo == this.every.poNo && item.poLine == this.every.poLine && item.materialCode == this.every.materialCode) {
isTrue = true;
this.DNReceivingListIndex = index;
}
});
console.log('isTrue', isTrue);
if (isTrue == true) {
this.DNReceivingList[this.DNReceivingListIndex].wllist.forEach((item: any) => {
if (item.poNo == this.LocationList[this.LocationList.length - 1].poNo && item.poLine == this.LocationList[this.LocationList.length - 1].poLine && item.materialCode == this.LocationList[this.LocationList.length - 1].materialCode && item.wlCode == this.LocationList[this.LocationList.length - 1].wlCode && item.receiptAmount == this.LocationList[this.LocationList.length - 1].receiptAmount) {
wllistIsTrue = true;
}
});
console.log('wllistIsTrue', wllistIsTrue);
}
console.log(1);
if (isTrue == false) {
this.DNReceivingList.push(this.every);
this.DNReceivingList[this.DNReceivingList.length - 1].wllist.push(this.LocationList[this.LocationList.length - 1]);
console.log('this.DNReceivingList', this.DNReceivingList);
isTrue = false;
wllistIsTrue = false;
this.receiptAmount = '';
return;
}
if (isTrue == true || wllistIsTrue == true) {
uni.showToast({
icon: 'none',
title: this.$t('message.repeatedly') as any,
});
// this.LocationList.splice(this.LocationList[this.LocationList.length - 1], 1);
this.LocationList.pop();
console.log('this.DNReceivingList', this.DNReceivingList);
isTrue = false;
wllistIsTrue = false;
this.receiptAmount = '';
return;
}
if (isTrue == true || wllistIsTrue == false) {
this.DNReceivingList[this.DNReceivingListIndex].wllist.push(this.LocationList[this.LocationList.length - 1]);
console.log('this.DNReceivingList', this.DNReceivingList);
isTrue = false;
wllistIsTrue = false;
this.receiptAmount = '';
return;
}
isTrue = false;
wllistIsTrue = false;
this.DNReceivingListIndex = null;
}
if (this.DNReceivingList.length == 0) {
this.DNReceivingList.push(this.every);
this.DNReceivingList[0].wllist.push(this.LocationList[this.LocationList.length - 1]);
console.log('this.DNReceivingList', this.DNReceivingList);
this.DNReceivingListIndex = null;
}
this.receiptAmount = '';
isTrue = true;
// this.addition();
this.business();
}
deleteItem(indexItem: any) {
let Item: any = {};
this.model.DNReceivingList.forEach((item: any) => {
if (item.poLine == this.every.poLine || item.materialCode == this.every.materialCode || item.dnNo == this.every.dnNo) {
Item = item;
}
});
Item.wllist.forEach((item: any, index: any) => {
if (item.poLine == this.LocationList[indexItem].poLine || item.materialCode == this.LocationList[indexItem].materialCode || item.dnNo == this.LocationList[indexItem].dnNo) {
Item.wllist.splice(index, 1);
}
});
this.LocationList.splice(indexItem, 1);
this.business();
// guoshuang
uni.showToast({
icon: 'none',
title: this.$t('message.success') as any,
deleteItem(e: any) {
console.log('data', e.lineData);
uni.showModal({
title: this.$t('message.delete') as any,
cancelText: this.$t('message.Cancel') as any,
confirmText: this.$t('message.workArea_Confirm') as any,
success: (res) => {
if (res.confirm) {
let DNIndex: any;
let nemIndex: any;
this.DNReceivingList.forEach((item: any, index: any) => {
if (item.poNo == e.lineData.poNo || item.poLine == e.lineData.poLine || item.materialCode == e.lineData.materialCode) {
DNIndex = index;
}
this.DNReceivingList[DNIndex].wllist.forEach((item: any, index: any) => {
if (item.poNo == e.lineData.poNo || item.poLine == e.lineData.poLine || item.materialCode == e.lineData.materialCode || item.wlCode == e.lineData.wlCode || item.receiptAmount == e.lineData.receiptAmount) {
nemIndex = index;
this.DNReceivingList[DNIndex].wllist.splice(nemIndex, 1);
}
});
});
this.LocationList.splice(e.contentIndex, 1);
} else if (res.cancel) {
return;
}
},
});
}
//
@ -370,6 +411,7 @@ export default class dnReceiptDom extends BasePage {
//
this.receiptAmount = null;
this.DNReceivingList = [];
await this.query();
}
async onSubmit() {
@ -380,33 +422,9 @@ export default class dnReceiptDom extends BasePage {
});
return null;
}
await this.model.submitOrderInEnter(this.model.DNReceivingList);
await this.model.submitOrderInEnter(this.DNReceivingList);
this.resetForm();
}
addition() {
if (this.model.DNReceivingList.length != 0) {
let whether: any = false;
let nnum: any;
this.model.DNReceivingList.forEach((item: any, index: any) => {
if (item.poLine == this.every.poLine || item.sendSpot == this.every.sendSpot || item.materialCode == this.every.materialCode) {
whether = true;
nnum = index;
return;
}
});
console.log('nnum', nnum);
if (whether == true) {
this.model.DNReceivingList[nnum].wllist.push(this.LocationList[this.LocationList.length - 1]);
} else {
this.every.wllist.push(this.LocationList[this.LocationList.length - 1]);
this.model.DNReceivingList.push(this.every);
}
}
if (this.model.DNReceivingList.length == 0) {
this.model.DNReceivingList.push(this.every);
}
console.log('this.model.DNReceivingList', this.model.DNReceivingList);
}
async bill() {
if (this.form.documentNo == '') {
uni.showToast({
@ -426,6 +444,7 @@ export default class dnReceiptDom extends BasePage {
//
business() {
this.every.receiptAmount = this.totalLocation(this.LocationList);
console.log('this.every.receiptAmount', this.every.receiptAmount);
}
}
</script>
@ -497,11 +516,25 @@ export default class dnReceiptDom extends BasePage {
height: 100%;
display: flex;
view {
width: 200rpx;
width: 140rpx;
line-height: 100rpx;
}
}
}
// .material {
// width: 100%;
// height: 100rpx;
// display: flex;
// .material-left {
// width: 100%;
// height: 100%;
// display: flex;
// view {
// width: 100rpx;
// line-height: 100rpx;
// }
// }
// }
.material {
width: 100%;
height: 100rpx;
@ -511,15 +544,11 @@ export default class dnReceiptDom extends BasePage {
height: 100%;
display: flex;
view {
width: 100rpx;
width: 140rpx;
line-height: 100rpx;
text-align: left;
}
}
}
.material {
width: 100%;
height: 100rpx;
display: flex;
.material-right {
width: 100%;
height: 100%;
@ -575,6 +604,7 @@ export default class dnReceiptDom extends BasePage {
}
}
}
<<<<<<< HEAD
// .library {
// width: 100%;
// height: 100rpx;
@ -608,6 +638,41 @@ export default class dnReceiptDom extends BasePage {
// }
// }
// }
=======
.library {
width: 100%;
height: 100rpx;
display: flex;
.library-left {
width: 50%;
height: 100%;
display: flex;
view {
width: 100rpx;
line-height: 100rpx;
}
.search {
padding-left: 20px;
}
}
.library-right {
width: 50%;
height: 100%;
display: flex;
.library-right-title {
width: 120rpx;
height: 100%;
padding-left: 4px;
line-height: 100rpx;
}
.input {
width: 200rpx;
height: 70rpx;
margin-top: 15rpx;
}
}
}
>>>>>>> e06fba98009bdb7923f4a67091d1f3e4224bdb07
.add {
width: 100%;
height: 100rpx;

@ -35,7 +35,6 @@ export class ReceiptModule extends VuexModule {
dnNo = '';
code = '';
DNdetailedList: any;
DNReceivingList: any = [];
ImportDNReceivingList: any = [];
/**
*

@ -0,0 +1,27 @@
/*
* @Author: zhou lei
* @Date: 2022-01-20 11:26:20
* @LastEditTime: 2022-01-20 17:48:10
* @LastEditors: zhou lei
* @Description:
* @FilePath: /wms_haiwai_app/src/utils/mixin.ts
* :910592680@qq.com 18669792120
*/
import Vue from 'vue';
import { Component } from 'vue-property-decorator';
@Component // 一定要用Component修饰
export default class MyMixins extends Vue {
customToast(msg: string, type = 'toast', title = '') {
if (type === 'toast') {
uni.showToast({
title: msg,
});
} else {
uni.showModal({
title: title,
content: msg,
});
}
}
}
Loading…
Cancel
Save