cosmoim-852 fix 新增俄罗斯海外PO收货页面&&其他优化

master
hou 3 years ago
parent 6681e5d000
commit ae0879f2f8

@ -15,7 +15,7 @@
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
"editor.defaultFormatter": "johnsoncodehk.volar"
"editor.defaultFormatter": "octref.vetur"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"

@ -0,0 +1,131 @@
<template>
<view :class="[styleType === 'text' ? 'segmented-control--text' : 'segmented-control--button']" :style="{ borderColor: styleType === 'text' ? '' : activeColor }" class="segmented-control">
<view v-for="(item, index) in values" :class="[styleType === 'text' ? '' : 'segmented-control__item--button', index === currentIndex && styleType === 'button' ? 'segmented-control__item--button--active' : '', index === 0 && styleType === 'button' ? 'segmented-control__item--button--first' : '', index === values.length - 1 && styleType === 'button' ? 'segmented-control__item--button--last' : '']" :key="index" :style="{ backgroundColor: index === currentIndex && styleType === 'button' ? activeColor : '', borderColor: (index === currentIndex && styleType === 'text') || styleType === 'button' ? activeColor : 'transparent' }" class="segmented-control__item" @click="_onClick(index)">
<view>
<text :style="{ color: index === currentIndex ? (styleType === 'text' ? activeColor : '#fff') : styleType === 'text' ? '#000' : activeColor }" class="segmented-control__text" :class="styleType === 'text' && index === currentIndex ? 'segmented-control__item--text' : ''">{{ item }}</text>
</view>
</view>
</view>
</template>
<script>
/**
* SegmentedControl 分段器
* @description 用作不同视图的显示
* @tutorial https://ext.dcloud.net.cn/plugin?id=54
* @property {Number} current 当前选中的tab索引值从0计数
* @property {String} styleType = [button|text] 分段器样式类型
* @value button 按钮类型
* @value text 文字类型
* @property {String} activeColor 选中的标签背景色与边框颜色
* @property {Array} values 选项数组
* @event {Function} clickItem 组件触发点击事件时触发e={currentIndex}
*/
export default {
name: 'UniSegmentedControl',
emits: ['clickItem'],
props: {
current: {
type: Number,
default: 0,
},
values: {
type: Array,
default() {
return [];
},
},
activeColor: {
type: String,
default: '#2979FF',
},
styleType: {
type: String,
default: 'button',
},
},
data() {
return {
currentIndex: 0,
};
},
watch: {
current(val) {
if (val !== this.currentIndex) {
this.currentIndex = val;
}
},
},
created() {
this.currentIndex = this.current;
},
methods: {
_onClick(index) {
if (this.currentIndex !== index) {
this.currentIndex = index;
this.$emit('click-item', {
currentIndex: index,
});
}
},
},
};
</script>
<style lang="scss" scoped>
.segmented-control {
/* #ifndef APP-NVUE */
display: flex;
box-sizing: border-box;
/* #endif */
flex-direction: row;
height: 36px;
overflow: hidden;
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
.segmented-control__item {
/* #ifndef APP-NVUE */
display: inline-flex;
box-sizing: border-box;
/* #endif */
position: relative;
flex: 1;
justify-content: center;
align-items: center;
}
.segmented-control__item--button {
border-style: solid;
border-top-width: 1px;
border-bottom-width: 1px;
border-right-width: 1px;
border-left-width: 0;
}
.segmented-control__item--button--first {
border-left-width: 1px;
border-top-left-radius: 5px;
border-bottom-left-radius: 5px;
}
.segmented-control__item--button--last {
border-top-right-radius: 5px;
border-bottom-right-radius: 5px;
}
.segmented-control__item--text {
border-bottom-style: solid;
border-bottom-width: 2px;
padding: 6px 0;
}
.segmented-control__text {
font-size: 14px;
line-height: 20px;
text-align: center;
}
</style>

@ -474,5 +474,13 @@ export default {
AppendMateriel4: '请选择正确的库位',
AppendMateriel5: '请先选择一个物料',
demandQuantity: '总数量大于需求数量',
//俄罗斯海外PO
ImportPO: 'PO海外收货',
container: '集装箱号',
WPM: 'WPM共',
WPMtotal: '个容器',
POPlan: 'PO计划',
WPMInformation: 'WPM信息',
Container: '容器码',
},
};

@ -479,5 +479,13 @@ export default {
AppendMateriel4: 'Please select the correct location',
AppendMateriel5: 'Please select a material first',
demandQuantity: 'The total quantity is greater than the demand quantity',
//俄罗斯海外PO
ImportPO: 'Import PO Receive',
container: 'code',
WPM: 'WPM',
WPMtotal: 'container',
POPlan: 'PO-Plan',
WPMInformation: 'WPM-Information',
Container: 'Container Code',
},
};

@ -810,6 +810,14 @@
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/ingoods/dnReceipt/ImportPOReceive",
"style": {
"navigationBarTitleText": "海外PO收货",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/demo/index",
"style": {

@ -291,14 +291,11 @@ export default class RawReceiptDetail extends BasePage {
};
await this.model.saveAggregateUpload(params);
if (this.model.code == '1') {
//this.customToast(this.$t('message.Warehouse_Tip9') as any);
uni.showToast({
//icon: 'success',
duration: 2000,
title: this.$t('message.Warehouse_Tip9') as string,
image: '/static/icons/icon-51.png',
});
// this.GetLocation();
setTimeout(() => {
this.onAggregate();
}, 2000);
@ -307,12 +304,6 @@ export default class RawReceiptDetail extends BasePage {
async onAggregate() {
await this.model.queryProOrder(this.model.formParams);
await this.model.queryProOrderResult(this.model.NEWparams);
// if (this.model.proOrderResultList.length == 0) {
// this.some = {};
// this.LocationList = [];
// this.wlCode = '';
// return;
// }
const orderOutIdList = this.model.proOrderResultList.map((_: any) => _.orderOutId);
const params = {
factoryCode: session.factoryCode,

@ -0,0 +1,229 @@
<template>
<view class="page-raw-receipt">
<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.ImportPO') }}</view>
<view class="right"></view>
</view>
<view class="content">
<view class="single">
<view class="single-left">
<view>{{ $t('message.container') }}</view>
<u-search :placeholder="$t('message.Commission_tips1')" v-model.trim="containerCode" @search="query" :show-action="false"></u-search>
</view>
<view class="single-right">
<u-button type="primary" @click="query">{{ $t('message.Query') }}</u-button>
</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="wl.value" class="search" :options="Location" />
</view>
</view>
<view class="WPM-total">{{ $t('message.WPM') }} {{ total }} {{ $t('message.WPMtotal') }}</view>
<uni-segmented-control :current="current" :values="items" @click-item="onClickItem" styleType="button" activeColor="#007aff"></uni-segmented-control>
<view v-show="current === 0">
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="ImportPOReceiveListHeaders" :contents="model.ImportPOReceiveList" :show-vert-border="false"></wyb-table>
</view>
<view v-show="current === 1">
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="containerListHeaders" :contents="model.containerList" :show-vert-border="false"></wyb-table>
</view>
</view>
<view class="bottom-bar">
<u-row class="button-bar">
<u-col :span="6">
<u-button type="primary" @click="Submit">{{ $t('message.po_Submit') }}</u-button>
</u-col>
<u-col :span="6">
<u-button type="error" @click="uni.navigateBack({})">{{ $t('message.po_Return') }}</u-button>
</u-col>
</u-row>
</view>
</view>
</template>
<script lang="ts">
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 model from './model';
import LocationDetail from './model.location';
import { ImportPOReceiveListHeaders, containerListHeaders } from './config';
@Component({
components: {
jPicker,
},
})
export default class dnReceiptDom extends BasePage {
model = model;
ImportPOReceiveListHeaders = ImportPOReceiveListHeaders;
containerListHeaders = containerListHeaders;
total = 0;
async onShow() {
await this.queryLoction();
}
onReady() {
this.model.empty();
}
Location: any = [];
wl: any = '';
async queryLoction() {
this.Location = [];
let sendSpot = JSON.parse(uni.getStorageSync('sendSpot') as any);
let content = {
loginName: session.loginName,
sendSpot: sendSpot,
factoryCode: session.factoryCode,
workArea: session.workareaCode,
};
let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content);
res.forEach((item: LocationDetail) => {
let pickerName: any = {};
pickerName.label = item.locationCode;
pickerName.value = item.locationCode + '(' + item.sendSpot + ')';
pickerName.sendSpot = item.sendSpot;
this.Location.push(pickerName);
});
this.wl = this.Location[0];
}
LocationChoice(e: any) {
this.wl = e.pickerName;
}
containerCode: any = '';
async query() {
if (!this.containerCode) {
this.customToast(this.$t('message.Commission_tips1') as any);
return;
}
await this.model.ImportPOReceive(this.containerCode);
if (this.model.code == '1') {
uni.showToast({
title: this.$t('message.successful') as any,
duration: 2000,
image: '/static/icons/icon-51.png',
});
}
}
current = 0;
items = [this.$t('message.POPlan'), this.$t('message.WPMInformation')];
onClickItem(e: any) {
if (this.current != e.currentIndex) {
this.current = e.currentIndex;
}
}
async Submit() {
if (!this.containerCode) {
this.customToast(this.$t('message.Commission_tips1') as any);
return;
}
let params = {
wlCode: this.wl.label,
containerCode: this.containerCode,
list: this.model.containerList,
};
await this.model.containerListSubmit(params);
if (this.model.code == '1') {
uni.showToast({
title: this.$t('message.success') as any,
duration: 2000,
image: '/static/icons/icon-51.png',
});
this.model.empty();
this.containerCode = '';
}
}
}
</script>
<style lang="scss" scoped>
.page-raw-receipt {
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background-size: 100% 600rpx;
padding: 118rpx 30rpx 162rpx;
min-height: 100%;
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 99;
display: flex;
height: 124rpx;
line-height: 124rpx;
color: #fff;
font-size: 34rpx;
font-weight: 500;
text-align: center;
.title {
flex: 3;
}
.left,
.right {
flex: 1;
}
.icon {
display: flex;
justify-content: center;
align-items: center;
width: 124rpx;
height: 124rpx;
}
}
.content {
width: 100%;
background: white;
border-radius: 15rpx;
padding: 10rpx;
.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;
}
}
}
.WPM-total {
width: 100%;
padding-top: 10px;
padding-bottom: 10px;
}
}
.bottom-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 99;
background: #ffffff;
box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx;
}
}
</style>

@ -102,3 +102,68 @@ export const headers = [
// key: 'mrpCode',
// },
];
export const ImportPOReceiveListHeaders = [
{
label: vm.$t('message.po_OddNumbers'),
key: 'poNo', //po单号
width: 350,
},
{
label: vm.$t('message.Line'),
key: 'poLine', //行项目
// width: 350,
},
{
label: vm.$t('message.Pi_materielNo'),
key: 'materialCode', //物料号
width: 350,
},
{
label: vm.$t('message.CommissionedMaterielDesc'),
key: 'materialDesc', //物料描述
width: 450,
},
{
label: vm.$t('message.po_DemandQuantity'),
key: 'poAmount', //需求数量
},
{
label: vm.$t('message.Pi_unit'),
key: 'unit', //单位
},
];
export const containerListHeaders = [
{
label: vm.$t('message.Container'),
key: 'palletCode', //容器码
width: 300,
},
{
label: vm.$t('message.po_OddNumbers'),
key: 'poNo', //po单号
width: 350,
},
{
label: vm.$t('message.Line'),
key: 'poLine', //行项目
// width: 350,
},
{
label: vm.$t('message.Pi_materielNo'),
key: 'materialCode', //物料号
width: 350,
},
{
label: vm.$t('message.CommissionedMaterielDesc'),
key: 'materialDesc', //物料描述
width: 450,
},
{
label: vm.$t('message.po_DemandQuantity'),
key: 'poAmount', //需求数量
},
{
label: vm.$t('message.Pi_unit'),
key: 'unit', //单位
},
];

@ -293,7 +293,6 @@ export default class dnReceiptDom extends BasePage {
}
//
Add() {
// const count = this.totalLocation(this.LocationList);
const count = parseFloat(this.every.requestAmount);
if (this.receiptAmount == '' || !this.wl.value) {
this.customToast(this.$t('message.Commission_tips2') as any);
@ -308,12 +307,6 @@ export default class dnReceiptDom extends BasePage {
return;
}
let isTrue = true;
// this.DNReceivingList[this.everyIndex].wllist.forEach((item: any) => {
// if (item.wlCode == this.wl.label && item.receiptAmount == this.receiptAmount) {
// this.customToast(this.$t('message.repeatedly') as any);
// return (isTrue = false);
// }
// });
if (isTrue == true) {
this.LocationList.push({
...this.every,

@ -38,6 +38,9 @@ export class ReceiptModule extends VuexModule {
code = '';
DNdetailedList: any;
ImportDNReceivingList: any = [];
//俄罗斯PO收货返回列表
ImportPOReceiveList: any = [];
containerList: any = [];
/**
*
*/
@ -248,6 +251,39 @@ export class ReceiptModule extends VuexModule {
this.DNdetailedList = res.list;
return res;
}
//俄罗斯 海外PO收货
@MutationAction
async ImportPOReceive(containerCode: string) {
const res: any = await http.post(url.material.DNorderin.russia, {
containerCode,
factoryCode: session.factoryCode,
loginName: session.loginName,
});
const ImportPOReceiveList = res.list;
const containerList = res.containerList;
const code = res.code;
return { ImportPOReceiveList, containerList, code };
}
//俄罗斯海外PO收货 页面初始化 清空数据
@MutationAction
async empty() {
const ImportPOReceiveList = [];
const containerList = [];
return { ImportPOReceiveList, containerList };
}
//俄罗斯海外PO收货 提交数据
@MutationAction
async containerListSubmit(params: any) {
const res: any = await http.post(url.material.DNorderin.enterrussia, {
wlCode: params.wlCode,
containerCode: params.containerCode,
factoryCode: session.factoryCode,
loginName: session.loginName,
list: params.list,
});
const code = res.code;
return { code };
}
}
export default getModule(ReceiptModule);

@ -174,14 +174,6 @@ export const page = {
},
SemiProduct: {
index: '/pages/SemiProduct/index',
// inbound: {
// index: '/pages/SemiProduct/inbound/index',
// index2: '/pages/SemiProduct/inbound/index2',
// semiFinishProductOfflineRefrigerator:
// '/pages/SemiProduct/inbound/semiFinishProductOfflineRefrigerator/index',
// semiFinishProductOnlineDoor: '/pages/SemiProduct/inbound/semiFinishProductOnlineDoor/index',
// semiFinishProductOnlineBox: '/pages/SemiProduct/inbound/semiFinishProductOnlineBox/index',
// },
outbound: {
index: '/pages/SemiProduct/outbound/index',
},

@ -71,6 +71,8 @@ export const url = {
subcDnEnter: '/wmspda/material/orderin/subcDnEnter',
ImportEnter: '/wmspda/material/orderin/overseasDnEnter',
out: '/wmspda/material/orderin/out',
russia: '/wmspda/material/orderin/poinfo/overseas/russia',
enterrussia: '/wmspda/material/orderin/enter/overseas/russia',
},
orderout: {
take: '/wmspda/material/orderout/take',

Loading…
Cancel
Save