overseamom-512 feat 虚拟交接新增手持页面

master
mabaoyan 2 years ago
parent b02dcb276c
commit a4b8db8df8

@ -592,5 +592,6 @@ export default {
boxnoscan: '请输入箱码',
matscan: '请输入物料条码',
bosnum: '顺序/数量',
virtualHandoverVn: '虚拟交接-越南',
},
};

@ -594,5 +594,6 @@ export default {
boxnoscan: 'Please enter the box code',
matscan: 'Please enter the material barcode',
bosnum: 'Box No/All',
virtualHandoverVn: 'Virtual handover-Vn',
},
};

@ -585,5 +585,6 @@ export default {
boxnoscan: 'Введите код ящика',
matscan: 'Введите штрих-код, пожалуйста',
bosnum: 'Порядок/количество',
virtualHandoverVn: 'Virtual handover-Vn',
},
};

@ -858,6 +858,30 @@
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/handover/virtual-Vn/index",
"style": {
"navigationBarTitleText": "虚拟单交接",//
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/handover/virtual-Vn/result",
"style": {
"navigationBarTitleText": "虚拟单明细",//
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/handover/virtual-Vn/summary",
"style": {
"navigationBarTitleText": "虚拟单交接-确认",//
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/login/login/index",
"style": {

@ -0,0 +1,186 @@
/**
*
*/
import vm from '@/main';
export const headers = [
{
label: vm.$t('message.Pi_OrderNo'),
key: 'prdOrder',
width: 250,
},
{
label: vm.$t('message.po_DemandQuantity'),
key: 'amount',
width: 255,
},
{
label: vm.$t('message.Pi_materielNo'),
key: 'materialCode',
width: 250,
},
{
label: vm.$t('message.CommissionedMaterielDesc'),
key: 'materialDesc',
width: 300,
},
];
/**
*
*/
export const resultHeaders = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 220,
},
{
label: vm.$t('message.po_DemandQuantity'),
key: 'amount',
},
{
label: vm.$t('message.Pi_CumulativePickingQuantity'),
key: 'totalMoAmount',
width: 300,
},
{
label: vm.$t('message.Pi_HandoverQuantity'),
key: 'totalHvAmount',
},
{
label: vm.$t('message.Pi_Station'),
key: 'sendSpot',
},
{
label: vm.$t('message.po_MaterielDes'),
key: 'materialDesc',
width: 350,
},
{
label: 'MRP',
key: 'mrpCode',
},
{
label: vm.$t('message.Pi_unit'),
key: 'unit',
},
{
label: vm.$t('message.Pi_OrderNo'),
key: 'prdOrder',
},
{
label: vm.$t('message.Pi_FinishedProductModel'),
key: 'proType',
},
{
label: vm.$t('message.po_Location'),
key: 'wkposCode',
},
];
/**
*
*/
export const summaryHeaders = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 220,
},
{
label: vm.$t('message.po_DemandQuantity'),
key: 'amount',
},
{
label: vm.$t('message.Summary_QuantityOfThisHandover'),
key: 'hvAmount',
width: 300,
},
{
label: vm.$t('message.Pi_CumulativePickingQuantity'),
key: 'totalMoAmount',
width: 300,
},
{
label: vm.$t('message.Pi_HandoverQuantity'),
key: 'totalHvAmount',
},
{
label: vm.$t('message.Pi_Station'),
key: 'sendSpot',
},
{
label: vm.$t('message.po_MaterielDes'),
key: 'materialDesc',
width: 350,
},
{
label: vm.$t('message.Pi_unit'),
key: 'unit',
},
{
label: vm.$t('message.po_Location'),
key: 'wkposCode',
},
{
label: vm.$t('message.inventory'),
key: 'virtualAmount',
},
];
/**
*
*/
export const orderHeaders = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 220,
},
{
label: vm.$t('message.po_DemandQuantity'),
key: 'amount',
},
{
label: vm.$t('message.Summary_QuantityOfThisHandover'),
key: 'hvAmount',
},
{
label: vm.$t('message.Pi_CumulativePickingQuantity'),
key: 'totalMoAmount',
width: 300,
},
{
label: vm.$t('message.Pi_HandoverQuantity'),
key: 'totalHvAmount',
},
{
label: vm.$t('message.Pi_Station'),
key: 'sendSpot',
},
{
label: vm.$t('message.po_MaterielDes'),
key: 'materialDesc',
width: 350,
},
{
label: vm.$t('message.Pi_unit'),
key: 'unit',
},
{
label: 'MRP',
key: 'mrpCode',
},
{
label: vm.$t('message.Pi_OrderNo'),
key: 'prdOrder',
},
{
label: vm.$t('message.Pi_FinishedProductModel'),
key: 'proType',
},
{
label: vm.$t('message.po_Location'),
key: 'wkposCode',
},
];

@ -0,0 +1,350 @@
<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.rawMenu_virtual_Handover') }}</view>
<view class="right"></view>
</view>
<u-form class="form" ref="form" :model="form" label-width="120rpx">
<u-row>
<!-- MRP -->
<u-col :span="12">
<u-form-item :required="true" label-width="120rpx" label="MRP" prop="mrpScope">
<u-input v-model="form.mrpScope" :border="border" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
<!-- 工厂 -->
<u-col :span="12">
<u-form-item label-width="120rpx" :label="$t('message.Pi_factory')" prop="sapFactoryCode" :required="true">
<u-input v-model="form.sapFactoryCode" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
<!-- 订单号 -->
<u-col :span="6">
<u-form-item label-width="120rpx" :label="$t('message.Pi_OrderNo')">
<u-input v-model="form.orderNoStart" :border="border" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
<u-col :span="6">
<u-form-item label-width="120rpx" :label="$t('message.Summary_To')">
<u-input v-model="form.orderNoEnd" :border="border" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
<!-- 物料号 -->
<u-col :span="12">
<u-form-item label-width="120rpx" :label="$t('message.po_MaterielNo')">
<u-input v-model="form.materialCodeList" :border="border" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
<u-col :span="12">
<u-form-item :label="$t('message.target')" prop="Category">
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="formone.aimWl.value" :options="CategoryList" />
<u-button @click="ondelete" type="primary">{{ $t('message.delete') }}</u-button>
</u-form-item>
</u-col>
<!-- -->
<u-col :span="12">
<view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" enable-check="multiple" show-left-and-right-border :headers="headers" :contents="model.proOrderList" :show-vert-border="false"></wyb-table>
</view>
</u-col>
</u-row>
</u-form>
<view class="bottom-bar">
<u-row class="button-bar">
<u-col :span="6">
<u-button type="primary" @click="onQuery">{{ $t('message.Pi_order') }}</u-button>
</u-col>
<u-col :span="3">
<u-button type="success" @click="onOk">{{ $t('message.dn_Confirm') }}</u-button>
</u-col>
<u-col :span="3">
<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, Ref, Watch } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import jPicker from '@/components/J-Picker/jPicker.vue';
import { VForm } from 'vue/types/form';
import model from './model';
import { headers } from './config';
import { session } from '@/store/modules/session';
interface OptionType {
label: string;
value: string;
}
@Component({
components: {
jPicker,
},
})
export default class Virtual extends BasePage {
/**
* 表单引用
*/
@Ref('form') readonly $form!: VForm;
@Watch('form', { immediate: true, deep: true })
onPersonChanged() {
this.isFormChange = true;
}
/**
* 页面Module
*/
model = model;
border = true;
/**
* 表头
*/
headers = headers;
formone = {
aimWl: {} as OptionType,
};
/**
* 表单数据
*/
form = {
mrpScope: '',
mrpContain: '',
mrpReduce: '',
orderNoStart: '',
orderNoEnd: '',
sapFactoryCode: '',
wkposCode: '',
batchNumberList: '',
materialCodeList: '',
sendSpotList: '',
};
CategoryList = [];
// CategoryList = [
// { lable: 'L1CA', value: 'L1CA' },
// { lable: 'L1DA', value: 'L1DA' },
// { lable: 'L1FA', value: 'L1FA' },
// ];
/**
* 表单是否改变
*/
isFormChange = false;
/**
* 选择项显示
*/
requestTimeSelect = false;
productDateSelect = false;
/**
* 表单校验
*/
rules = {
mrpScope: [{ required: true, message: this.$t('message.Pi_InputMrp') as string }],
sapFactoryCode: [{ required: true, message: this.$t('message.Pi_InputFactory') as string }],
};
/**
* 生成表单参数
*/
get formParams() {
const params: any = {
...this.form,
factoryCode: session.factoryCode,
loginName: session.loginName,
};
if (this.form.batchNumberList) {
params.batchNumberList = this.form.batchNumberList.split(',');
} else {
delete params.batchNumberList;
}
if (this.form.materialCodeList) {
params.materialCodeList = this.form.materialCodeList.split(',');
} else {
delete params.materialCodeList;
}
if (this.form.mrpContain) {
params.mrpContain = this.form.mrpContain.split(',');
} else {
delete params.mrpContain;
}
if (this.form.mrpReduce) {
params.mrpReduce = this.form.mrpReduce.split(',');
} else {
delete params.mrpReduce;
}
if (this.form.sendSpotList) {
params.sendSpotList = this.form.sendSpotList.split(',');
} else {
delete params.sendSpotList;
}
return params;
}
// onReadyonLoad
async onReady() {
this.$form.setRules(this.rules);
model.clearProOrderList();
this.form.sapFactoryCode = session.factoryCode;
}
async onLoad() {
this.getLoc();
}
async onShow() {
//await this.getMRP();
}
async getMRP() {
let params = {
factoryCode: session.factoryCode,
loginName: session.loginName,
};
let res: any = await this.model.getMRP(params);
this.form.mrpScope = res.data;
}
async getLoc() {
await this.model.getSendSpotList1({
loginName: session.loginName,
factoryCode: session.factoryCode,
});
if (this.model.CategoryList.length != 0) {
this.CategoryList = [];
this.CategoryList = this.model.CategoryList;
}
}
bookTypeChange(e: any) {
console.log('///', e);
this.formone.aimWl = e.pickerName;
}
/**
* 确认
*/
onOk() {
this.$form.validate(async (valid: boolean) => {
if (!valid) return;
let orderNoList = [];
let materialCodeList = [];
if (this.isFormChange || this.model.proOrderList.length === 0) {
await model.queryProOrder(this.formParams);
orderNoList = model.proOrderList.map((_: any) => _.prdOrder);
materialCodeList = model.proOrderList.map((_: any) => _.materialCode);
} else {
orderNoList = this.model.checkedProOrderList.map((_: any) => _.prdOrder);
materialCodeList = this.model.checkedProOrderList.map((_: any) => _.materialCode);
}
if (orderNoList.length === 0 && this.model.proOrderList.length > 0) {
this.customToast(this.$t('message.Pi_OrderNoNotSelected') as string);
return;
} else if (orderNoList.length === 0) {
this.customToast(this.$t('message.Pi_NoDataFound') as string);
return;
}
const params = {
...this.formParams,
orderNoList: orderNoList,
materialCodeList: materialCodeList,
};
this.model.QueryParams(params);
await this.model.queryProOrderResult(params);
this.model.setSapFactoryCode({ sapFactoryCode: this.form.sapFactoryCode });
this.toPage(this.page.raw.handover.virtual.result);
});
}
/**
* 定单查询
*/
onQuery() {
this.$form.validate(async (valid: boolean) => {
if (!valid) return;
// await this.model.checkUserAndMrp({ mrpCodeRegion: this.form.mrpScope, loginName: session.loginName, factoryCode: session.factoryCode });
// if (this.model.mrpcode == 1) {
this.model.queryProOrder(Object.assign(this.formParams, { sendSpot: this.formone.aimWl.value }));
this.isFormChange = false;
// }
});
}
ondelete() {
this.formone.aimWl.value = '';
this.getLoc();
// this.CategoryList = [
// { lable: 'L1CA', value: 'L1CA' },
// { lable: 'L1DA', value: 'L1DA' },
// { lable: 'L1FA', value: 'L1FA' },
// ];
}
}
</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: calc(var(--status-bar-height) + 118rpx) 30rpx 162rpx;
min-height: 100%;
.header {
position: fixed;
top: 36rpx;
left: 0;
right: 0;
z-index: 99;
display: flex;
padding-top: var(--status-bar-height);
height: calc(var(--status-bar-height) + 88rpx);
line-height: 88rpx;
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: 88rpx;
height: 88rpx;
}
}
.form {
background-color: #fff;
padding: 30rpx;
border-radius: 10rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
.u-form-item {
padding: 23rpx 0;
line-height: 35rpx;
}
}
.table-wrapper {
padding: 10rpx 0;
}
.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;
}
.button-bar {
}
}
</style>

@ -0,0 +1,204 @@
import { Action, getModule, Module, Mutation, MutationAction, VuexModule } from 'vuex-module-decorators';
import store from '@/store';
import http from '@/utils/request';
import { url } from '@/utils/url';
import vm from '@/main';
export interface SummaryItem {
checked: any;
materialCode: string;
amount: number;
totalMoAmount: number;
totalHvAmount: number;
materialDesc: string;
unit: string;
wkposCode: string;
hvAmount: number;
prdMaterialDesc: string;
prdMaterialCode: string;
sapFactoryCode: string;
prdOrder: string;
sendSpot: string;
oriSendSpot: string;
mrpCode: string;
}
@Module({
namespaced: true,
dynamic: true,
store,
name: 'raw.handover.virtual',
})
export class VirtualModule extends VuexModule {
/**
* sap
*/
sapFactoryCode = '';
nextQueryParams: any = {};
CategoryList: any = [];
/**
*
*/
proOrderList = [];
//mrp校验
mrpcode: any = '';
/**
*
*/
proOrderResultList = [];
/**
*
*/
summaryList: SummaryItem[] = [];
/**
*
*/
get isCheckedAll() {
return !this.proOrderList.filter((_: any) => !_.checked).length;
}
/**
*
*/
get hasChecked() {
return this.checkedProOrderList.length > 0;
}
/**
*
*/
get checkedProOrderList() {
return this.proOrderList.filter((_: any) => _.checked);
}
/**
* sap
*/
@Mutation
setSapFactoryCode(params: { sapFactoryCode: string }) {
this.sapFactoryCode = params.sapFactoryCode;
}
/**
*
*/
@Mutation
clearProOrderResultList() {
this.proOrderResultList = [];
}
/**
*
*/
@MutationAction
async QueryParams(params: any) {
const nextQueryParams = params;
return { nextQueryParams };
}
/**
*
*/
@Mutation
clearProOrderList() {
this.proOrderList = [];
}
/**
*
*/
@Mutation
updateSummaryItem({ index, newItem }: { index: number; newItem: SummaryItem }) {
this.summaryList.splice(index, 1, newItem);
}
/**
*
* @param params
*/
@MutationAction
async queryProOrder(params: any) {
const { list: proOrderList }: any = await http.post(url.virtual.query.orderno, params);
//const proOrderList = list.map((v: any) => ({ prdOrder: v.prdOrder, amount: v.amount, materialCode: v.materialCode, materialDesc: v.materialDesc }));
proOrderList.forEach((_: any) => (_.checked = true));
if (!proOrderList.length) {
vm.customToast(vm.$t('message.Pi_NoDataFound') as any);
}
return { proOrderList };
}
/**
*
* @param params
*/
@MutationAction
async queryProOrderResult(params: any) {
const { list: proOrderResultList }: any = await http.post(url.virtual.query.ordoutlist, params);
proOrderResultList.forEach((item: any) => {
item.hvAmount = 0;
});
return { proOrderResultList };
}
//查询目标库位
@MutationAction
async getSendSpotList1(params: any = {}) {
const res: any = await http.post(url.sumscan.query.getSendSpotList, params);
const CategoryList = [];
res.data.forEach((item: any) => {
const arr: any = {
label: item.sendSpot,
value: item.sendSpot,
};
CategoryList.push(arr);
});
console.log('res', res);
console.log('LocList', CategoryList);
return { CategoryList };
}
/**
* -
* @param params
*/
@MutationAction
async querySummaryList(params: any) {
const { list: summaryList }: any = await http.post(url.virtual.query.hzlist, params);
return { summaryList };
}
/**
* -
*/
@Action
async checkAmount(params: { sapFactoryCode: string; loginName: string; materialCode: string; unit: string; mrpCode: string; factoryCode: string; sendSpot: string; amount: string }) {
return await http.post(url.virtual.check.amount, params);
}
/**
* -
*/
@Action
async uploadSummaryList(params: { sapFactoryCode: string; operatorPass: string; factoryCode: string; loginName: string; dataList: any[]; includeOrderOutIdList: string[] }) {
return await http.post(url.virtual.u.hzlist, params);
}
//获取MRP
@Action
async getMRP(params: any = {}) {
const res = await http.post(url.sortscan.save.queryMrpByUser, params);
// const code = res.code;
// const mrpdata = res.data;
// console.log('mrpdata', mrpdata);
return res;
}
/**
* mrp
* @param params
*/
@MutationAction
async checkUserAndMrp(params: any) {
const res: any = await http.post(url.sortscan.save.checkUserAndMrp, params);
const mrpcode = res.code;
return { mrpcode };
}
}
export default getModule(VirtualModule);

@ -0,0 +1,131 @@
<template>
<view class="page-receipt-detail">
<view class="header">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
</view>
<view class="title">{{ $t('message.Summary_Result') }}</view>
<view class="right"></view>
</view>
<view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="headers" :contents="model.proOrderResultList" :show-vert-border="false"></wyb-table>
</view>
<view class="bottom-bar">
<div class="container">
<u-row>
<u-col :span="8">
<u-button type="primary" @click="onVirtual"> {{ $t('message.dn_Confirm') }} </u-button>
</u-col>
<u-col :span="4">
<u-button type="error" @click="uni.navigateBack()">{{ $t('message.po_Return') }}</u-button>
</u-col>
</u-row>
</div>
</view>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import model from './model';
import { resultHeaders } from './config';
@Component
export default class AggregatingResult extends BasePage {
/**
* 页面Module
*/
model = model;
/**
* 表头
*/
headers = resultHeaders;
/**
* 汇总
*/
async onVirtual() {
// const orderOutIdList = this.model.proOrderResultList.map((_: any) => _.orderOutId);
// const params = {
// factoryCode: session.factoryCode,
// loginName: session.loginName,
// orderOutIdList,
// };
// await this.model.querySummaryList(params);
this.toPage(this.page.raw.handover.virtual.summary);
}
}
</script>
<style lang="scss" scoped>
.page-receipt-detail {
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background-size: 100% 600rpx;
padding: 30rpx;
min-height: 100%;
padding-top: calc(var(--status-bar-height) + 118rpx);
padding-bottom: 132rpx;
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
display: flex;
padding-top: var(--status-bar-height);
height: calc(var(--status-bar-height) + 88rpx);
line-height: 88rpx;
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: 88rpx;
height: 88rpx;
}
}
.table-wrapper {
background-color: #fff;
}
.form {
background-color: #fff;
padding: 40rpx;
border-radius: 10rpx;
}
.bottom-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 1000;
.container {
background: #ffffff;
box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx;
}
.extra {
background-color: #fff;
margin: 5px;
border-radius: 5px;
padding: 0 10px;
}
}
}
</style>

@ -0,0 +1,411 @@
<template>
<view class="page-aggregating-order">
<view class="header">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
</view>
<view class="title">{{ $t('message.rawMenu_virtual_Handover_QR') }}</view>
<view class="right"></view>
</view>
<view class="table-wrapper">
<wyb-table class="table" ref="table" @onCellClick="Modify($event)" width="100%" show-left-and-right-border @onCheck="ClickHandover" enable-check="multiple" :headers="headers" :contents="model.proOrderResultList" :show-vert-border="false"> </wyb-table>
</view>
<view class="bottom-bar">
<view class="extra">
<u-form ref="submitForm" :model="submitForm" :error-type="['toast']">
<u-row class="bottom-info">
<u-col :span="6">
<u-form-item prop="receiverName" :label="$t('message.Summary_Receiver')" label-width="120rpx">
<u-input v-model="submitForm.receiverName" :border="border" @confirm="onReceiverConfirm" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
<u-col :span="6">
<u-form-item prop="password" :label="$t('message.Summary_Password')">
<u-input type="password" v-model="submitForm.password" :border="border" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
</u-row>
</u-form>
</view>
<view class="container">
<u-row>
<u-col :span="6">
<u-button type="primary" @click="uni.navigateBack({})">
{{ $t('message.po_Return') }}
</u-button>
</u-col>
<u-col :span="6">
<u-button type="success" @click="onSubmit">
{{ $t('message.po_Submit') }}
</u-button>
</u-col>
</u-row>
</view>
<!-- 弹窗 -->
<u-popup v-model="show" mode="center" closeable width="95%" height="15%" border-radius="14">
<view class="singles">
<view class="single-lefts">
<view>{{ $t('message.dn_Number') }}</view>
<u-search :placeholder="$t('message.Summary_PleaseInputNumber')" v-model.trim="nextNum" :show-action="false"> </u-search>
</view>
<view class="single-rights">
<u-button type="primary" @click="ModifyConfirm">{{ $t('message.product_Confirm') }}</u-button>
</view>
</view>
</u-popup>
</view>
</view>
</template>
<script lang="ts">
import { Component, Ref } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import model from './model';
import { summaryHeaders } from './config';
import { VForm, VFormRules } from 'vue/types/form';
import { auth } from '@/store/modules/auth';
import http from '@/utils/request';
import { url } from '@/utils/url';
import { session } from '@/store/modules/session';
@Component
export default class VirtualSummary extends BasePage {
/**
* 表单引用
*/
@Ref('amountForm') readonly $amountForm!: VForm;
@Ref('submitForm') readonly $submitForm!: VForm;
/**
* 页面Module
*/
model = model;
border = true;
/**
* 表头
*/
headers = summaryHeaders;
show = false;
nextNum: any = '';
itemIndex = 0;
/**
* 处理完成
*/
isBusinessFinished = true;
/**
* 更改数量表单
*/
amountForm = {
// oriSendSpot: '',
amount: '',
};
/**
* 上传表单
*/
submitForm = {
receiver: '',
receiverName: '',
password: '',
};
amountFormRules: VFormRules<any> = {
amount: [
{
required: true,
message: this.$t('message.Summary_PleaseInputNumber') as string,
},
],
};
submitFormRules: VFormRules<any> = {
receiver: [
{
required: true,
message: this.$t('message.Summary_PleaseInputReceiver') as string,
},
],
password: [
{
required: true,
message: this.$t('message.Summary_PleaseInputPassword') as string,
},
],
};
// onReadyonLoad
onReady() {
// this.$amountForm.setRules(this.amountFormRules);
// this.$submitForm.setRules(this.submitFormRules);
this.isBusinessFinished = false;
}
/**
* 接收人回车
*/
async onReceiverConfirm() {
const { userName } = await auth.getUserInfo({
loginName: this.submitForm.receiverName,
});
this.submitForm.receiver = this.submitForm.receiverName;
//console.log(this.submitForm.receiver)
this.submitForm.receiverName = userName;
}
Modify(e: any) {
this.itemIndex = e.contentIndex;
this.show = !this.show;
this.nextNum = '';
}
ModifyConfirm() {
if (this.nextNum == '') {
uni.showToast({
title: this.$t('message.Summary_PleaseInputNumber') as any,
image: '/static/icons/icon-52.png',
});
return;
}
let num: any = parseFloat(this.model.proOrderResultList[this.itemIndex].amount) - parseFloat(this.model.proOrderResultList[this.itemIndex].totalMoAmount);
if (parseFloat(this.nextNum) > num) {
uni.showToast({
title: this.$t('message.Commission_tips4') as any,
image: '/static/icons/icon-52.png',
});
return;
}
if (parseFloat(this.nextNum) > this.model.proOrderResultList[this.itemIndex].virtualAmount) {
uni.showToast({
title: this.$t('message.Cannotvirtual') as any,
image: '/static/icons/icon-52.png',
});
return;
}
this.model.proOrderResultList[this.itemIndex].hvAmount = this.nextNum;
this.show = !this.show;
}
//
ClickHandover(e: any) {
console.log(e);
this.model.proOrderResultList.forEach((item: any) => {
if (!item.checked) {
item.hvAmount = 0;
}
});
if (e.data.length != 0) {
if (e.data.length != this.model.proOrderResultList.length) {
let index = e.data[e.data.length - 1].index;
let num: any = parseFloat(this.model.proOrderResultList[index].amount) - parseFloat(this.model.proOrderResultList[index].totalMoAmount);
if (num > parseFloat(this.model.proOrderResultList[index].virtualAmount)) {
this.model.proOrderResultList[index].hvAmount = parseFloat(this.model.proOrderResultList[index].virtualAmount);
} else {
this.model.proOrderResultList[index].hvAmount = num;
}
} else {
this.model.proOrderResultList.forEach((item: any) => {
let num: any = parseFloat(item.amount) - parseFloat(item.totalMoAmount);
if (num > item.virtualAmount) {
item.hvAmount = item.virtualAmount;
} else {
item.hvAmount = num;
}
});
}
}
}
onSubmit() {
this.$submitForm.validate(async (valid) => {
if (valid) {
let qtyStase = false;
let selectsta = true;
console.log('qqq', model.proOrderResultList);
if (model.proOrderResultList.length === 0) {
this.customToast(this.$t('message.Pi_tip4') as string);
return;
} else {
model.proOrderResultList.map((item) => {
if (!item.checked) {
return;
} else if (item.hvAmount == 0 || item.hvAmount == null) {
qtyStase = true;
}
if (item.checked) {
selectsta = false;
}
});
}
if (selectsta) {
this.customToast(this.$t('message.Pi_tip4') as string);
return;
}
if (qtyStase) {
this.customToast(this.$t('message.Summary_PleaseInputNumber') as string);
return;
}
//console.log("????",this.submitForm.receiver)
//console.log("//////",this.submitForm.receiver? "true":"false");
//console.log("<<<<<<<",(this.submitForm.receiver ? this.submitForm.receiver : this.submitForm.receiverName) == session.loginName)
if ((this.submitForm.receiver ? this.submitForm.receiver : this.submitForm.receiverName) == session.loginName) {
this.customToast(this.$t('message.different') as string);
return;
}
let res = await auth.checkPassword({
rfPwd: this.submitForm.password,
factoryCode: session.factoryCode as string,
loginName: this.submitForm.receiver ? this.submitForm.receiver : this.submitForm.receiverName,
});
if (res.code != 1) {
return;
}
let list = [];
console.log('选择是否有标志', model.proOrderResultList);
model.proOrderResultList.forEach((item) => {
if (item.checked) {
list.push(item);
}
});
console.log('数据。。。', list);
await model.uploadSummaryList({
operatorPass: this.submitForm.receiver ? this.submitForm.receiver : this.submitForm.receiverName,
factoryCode: session.factoryCode as string,
loginName: session.loginName as string,
sapFactoryCode: model.sapFactoryCode,
dataList: list,
includeOrderOutIdList: model.proOrderResultList.map((item: any) => item.orderOutId),
});
await this.model.queryProOrderResult(this.model.nextQueryParams);
if (this.model.proOrderResultList.length == 0) {
uni.showToast({
title: this.$t('message.Pi_NoDataFound') as string,
});
setTimeout(() => {
uni.navigateBack({ delta: 2 });
}, 2000);
}
this.submitForm.receiverName = '';
this.submitForm.receiver = '';
this.submitForm.password = '';
this.isBusinessFinished = true;
}
});
}
async unlock() {
try {
await http.post(url.virtual.unlock.list, {
factoryCode: session.factoryCode,
loginName: session.loginName,
orderOutIdList: model.proOrderResultList.map((_: any) => _.orderOutId),
});
} catch (e) {
this.customToast((this.$t('message.Summary_Tip') as string) + e.message);
}
}
}
</script>
<style lang="scss" scoped>
.page-aggregating-order {
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background-size: 100% 600rpx;
padding: 30rpx;
min-height: 100%;
padding-top: calc(var(--status-bar-height) + 118rpx);
padding-bottom: 280rpx;
.header {
position: fixed;
top: 0;
left: 0;
right: 0;
display: flex;
padding-top: var(--status-bar-height);
height: calc(var(--status-bar-height) + 88rpx);
line-height: 88rpx;
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: 88rpx;
height: 88rpx;
}
}
.table-wrapper {
background-color: #fff;
}
.form {
background-color: #fff;
padding: 40rpx;
border-radius: 10rpx;
}
.bottom-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 1000;
.singles {
width: 100%;
height: 50px;
// height: 100px;
display: flex;
padding-top: 35px;
.single-lefts {
width: 80%;
height: 60px;
display: flex;
view {
width: 110rpx;
height: 100%;
line-height: 100rpx;
}
}
.single-rights {
button {
margin-top: 15rpx;
width: 150rpx;
height: 70rpx;
}
}
}
.container {
background: #ffffff;
box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx;
}
.extra {
background-color: #fff;
margin: 5px;
border-radius: 5px;
padding: 0 10px;
}
.bottom-info {
.u-form-item {
padding: 0;
}
}
}
}
</style>

@ -156,6 +156,11 @@ export const page = {
result: '/pages/raw/handover/virtual/result',
summary: '/pages/raw/handover/virtual/summary',
},
virtualVn: {
index: '/pages/raw/handover/virtual-Vn/index',
result: '/pages/raw/handover/virtual-Vn/result',
summary: '/pages/raw/handover/virtual-Vn/summary',
},
RUSvirtual: {
index: '/pages/raw/handover/RUS-virtual/index',
result: '/pages/raw/handover/RUS-virtual/result',

Loading…
Cancel
Save