cosmoim-852 fix 新增俄罗斯交接界面

master
guoshuang 3 years ago
parent 5e827cf959
commit ef716f655c

@ -1351,6 +1351,62 @@
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/handover/RUS-aggregating/index",
"style": {
"navigationBarTitleText": "汇总查询",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/handover/RUS-aggregating/result",
"style": {
"navigationBarTitleText": "汇总交接",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/handover/RUS-aggregating/summary",
"style": {
"navigationBarTitleText": "汇总交接",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/handover/RUS-aggregating/order",
"style": {
"navigationBarTitleText": "按单交接",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/handover/RUS-virtual/index",
"style": {
"navigationBarTitleText": "虚拟单交接",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/handover/RUS-virtual/result",
"style": {
"navigationBarTitleText": "虚拟单明细",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/handover/RUS-virtual/summary",
"style": {
"navigationBarTitleText": "虚拟单交接-确认",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
}
],
"globalStyle": {

@ -171,7 +171,7 @@ export default class LoginPage extends BasePage {
console.log('......', server.serverAddress);
if (server.serverAddress.includes('https://eurmom.haier.net')) {
//
this.Version = '1.1.17';
this.Version = '1.1.18';
} else {
this.Version = '1.0.46';
}

@ -0,0 +1,221 @@
/**
*
*/
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,
},
{
label: vm.$t('message.Summary_ProductionDate'),
key: 'requireDate', //生产日期
width: 300,
},
{
label: vm.$t('message.product_FGCode'),
key: 'prodCode', //成品编码
},
{
label: vm.$t('message.Pi_FinishedProductModel'),
key: 'prodDesc', //成品型号
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',
},
{
label: vm.$t('message.product_FGCode'),
key: 'prodCode', //成品编码
},
{
label: vm.$t('message.Pi_FinishedProductModel'),
key: 'prodDesc', //成品型号
width: 300,
},
];
/**
*
*/
export const summaryHeaders = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 220,
},
{
label: vm.$t('message.Summary_QuantityOfThisHandover'),
key: 'hvAmount',
},
// {
// 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.po_DemandQuantity'),
key: 'amount',
},
{
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.Summary_FinishedProductMaterialNumber'),
key: 'prdMaterialCode',
},
{
label: vm.$t('message.po_Location'),
key: 'wkposCode',
},
];
/**
*
*/
export const orderHeaders = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 220,
},
{
label: vm.$t('message.Summary_QuantityOfThisHandover'),
key: 'hvAmount',
},
// {
// 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.po_DemandQuantity'),
key: 'amount',
},
{
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.po_Location'),
key: 'wkposCode',
},
{
label: vm.$t('message.product_FGCode'),
key: 'prodCode', //成品编码
},
{
label: vm.$t('message.Pi_FinishedProductModel'),
key: 'prodDesc', //成品型号
width: 300,
},
];

@ -0,0 +1,371 @@
<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.Summary_Query') }}</view>
<view class="right"></view>
</view>
<u-form class="form" ref="form" :model="form">
<u-row>
<u-col :span="12">
<!-- MRP -->
<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" :required="true" :label="$t('message.Pi_factory')" prop="sapFactoryCode">
<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">
<view style="display: flex">
<u-field style="background: white; border-radius: 10rpx; padding-left: 0" v-model="form.requestTime" :placeholder="$t('message.SelectTime')" :label="$t('message.NowTime')"> </u-field>
<u-picker :confirm-text="$t('message.product_Confirm')" :cancel-text="$t('message.product_Cancel')" v-model="startShow" :params="startParams" mode="time" @confirm="startConfirm"></u-picker>
<u-button @click="startShow = true" type="primary">{{ $t('message.workArea_Selelct') }}</u-button>
</view>
</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-row>
<u-row>
<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 Aggregating extends BasePage {
/**
* 表单引用
*/
@Ref('form') readonly $form!: VForm;
@Watch('form', { immediate: true, deep: true })
onPersonChanged() {
this.isFormChange = true;
}
/**
* 页面Module
*/
model = model;
border = true;
formone = {
aimWl: {} as OptionType,
};
/**
* 表头
*/
headers = headers;
startShow = false;
/**
* 表单数据
*/
form = {
mrpScope: '',
mrpContain: '',
mrpReduce: '',
orderNoStart: '',
orderNoEnd: '',
sapFactoryCode: '',
wkposCode: '',
batchNumberList: '',
materialCodeList: '',
requestTime: '',
sendSpotList: '',
};
startParams = {
year: true,
month: true,
day: true,
hour: false,
minute: false,
second: false,
};
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;
}
if (this.form.requestTime) {
params.requestTime = this.form.requestTime.split('-').join('').toString();
} else {
delete params.sendSpotList;
}
return params;
}
// onReadyonLoad
async onReady() {
this.$form.setRules(this.rules);
model.clearProOrderList();
this.form.sapFactoryCode = session.factoryCode;
//this.form.requestTime = this.getNowFormatDate();
}
async onLoad() {
this.getLoc();
}
async getLoc() {
//debugger;
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;
}
// getNowFormatDate() {
// var date = new Date();
// var seperator1 = '-';
// var year = date.getFullYear();
// var month: any = date.getMonth() + 1;
// var strDate: any = date.getDate();
// if (month >= 1 && month <= 9) {
// month = '0' + month;
// }
// if (strDate >= 0 && strDate <= 9) {
// strDate = '0' + strDate;
// }
// var currentdate = year + seperator1 + month + seperator1 + strDate;
// return currentdate;
// }
startConfirm(startParams: any) {
this.form.requestTime = startParams.year + '-' + startParams.month + '-' + startParams.day;
}
ondelete() {
this.formone.aimWl.value = '';
this.getLoc();
// this.CategoryList = [
// { lable: 'L1CA', value: 'L1CA' },
// { lable: 'L1DA', value: 'L1DA' },
// { lable: 'L1FA', value: 'L1FA' },
// ];
}
/**
* 确认
*/
onOk() {
this.$form.validate(async (valid: boolean) => {
if (!valid) return;
let orderNoList = [];
let materialList = [];
if (this.isFormChange || this.model.proOrderList.length === 0) {
await model.queryProOrder(this.formParams);
orderNoList = model.proOrderList.map((_: any) => _.prdOrder);
materialList = model.proOrderList.map((_: any) => _.materialCode);
} else {
orderNoList = this.model.checkedProOrderList.map((_: any) => _.prdOrder);
materialList = 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: materialList,
};
await this.model.queryProOrderResult(params);
this.model.param = params;
this.toPage(this.page.raw.handover.RUSaggregating.result);
});
}
/**
* 定单查询
*/
async onQuery() {
this.$form.validate(async (valid: boolean) => {
if (!valid) return;
await this.model.queryProOrder(Object.assign(this.formParams, { sendSpot: this.formone.aimWl.value }));
this.isFormChange = false;
this.model.isFormChange = this.formParams;
});
}
}
</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: 0rpx;
padding-top: 12rpx;
left: 0;
right: 0;
z-index: 99;
display: flex;
height: 100rpx;
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;
}
}
// /deep/.wyb-table-scroll-view {
// background-color: rgb(241, 241, 241);
// }
.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,328 @@
import { getModule, Module, Mutation, Action, MutationAction, VuexModule } from 'vuex-module-decorators';
import store from '@/store';
import http from '@/utils/request';
import { url } from '@/utils/url';
import { cloneDeep } from 'lodash/fp';
import vm from '@/main';
@Module({
namespaced: true,
dynamic: true,
store,
name: 'raw.handover.RUS-aggregating',
})
export class AggregatingModule extends VuexModule {
/**
*
*/
proOrderList = [];
param: any;
orderOutIdListParams: any;
SubmitCode: any = '';
/**
*
*/
proOrderResultList = [];
isFormChange: any;
CategoryList: any = [];
/**
*
*/
aggregateList: any[] = [];
/**
*
*/
orderList: any[] = [];
/**
*
*/
accessoryList: any[] = [];
lockCode: any = '';
/**
*
*/
locationList = [];
/**
*
*/
get isCheckedAll() {
return !this.proOrderList.filter((_: any) => !_.checked).length;
}
/**
*
*/
get hasChecked() {
return this.checkedProOrderList.length > 0;
}
/**
*
*/
get checkedProOrderList() {
return this.proOrderList.filter((_: any) => _.checked);
}
/**
*
*/
@Mutation
clearProOrderResultList() {
this.proOrderResultList = [];
}
/**
*
*/
@Mutation
clearProOrderList() {
this.proOrderList = [];
}
/**
* /
* @param checked
*/
@Mutation
checkAllAggregateList(checked: boolean) {
this.aggregateList.map((item: any) => {
Object.assign(item, { checked, hvAmount: (checked && item.totalMoAmount - item.totalHvAmount) || 0 });
});
}
/**
* /
* @param checked
*/
@Mutation
checkAllOrderList(checked: boolean) {
this.orderList.map((item: any) => {
Object.assign(item, { checked, hvAmount: (checked && item.totalMoAmount - item.totalHvAmount) || 0 });
});
}
/**
* -
* @param params
*/
@MutationAction
async uploadAggregateList(params: any) {
const result: any = await http.post(url.sumscan.u.hzlist, params);
const SubmitCode = result.code;
console.log('yayayyayyayayayyayyayayayyay', SubmitCode);
uni.showToast({
//icon: 'success',
title: 'success',
duration: 2000,
image: '/static/icons/icon-51.png',
});
return { SubmitCode };
}
/**
*
* @param params
*/
@Mutation
setAggregateListItemHvAmount({ index, hvAmount }: { index: number; hvAmount: number }) {
this.aggregateList[index].hvAmount = hvAmount;
// this.aggregateList.splice(index, 1, newItem);
// if (this.aggregateList[index].checked) {
// this.aggregateList[index].hvAmount = this.aggregateList[index].totalMoAmount - this.aggregateList[index].totalHvAmount;
// } else {
// this.aggregateList[index].hvAmount = 0;
// }
}
/**
*
* @param params
*/
@Mutation
setOrderListItemHvAmount({ index, hvAmount }: { index: number; hvAmount: number }) {
// this.orderList.splice(index, 1, newItem);
this.orderList[index].hvAmount = hvAmount;
}
// setOrderListItemHvAmount() {
// this.orderList
// .filter((_: any) => _.checked)
// .forEach((item: any) => {
// item.hvAmount = item.totalMoAmount - item.totalHvAmount;
// // if (params.hvAmount) {
// // item.currentAmount = params.hvAmount;
// // }
// });
// }
/**
*
* @param params
*/
@Mutation
setAccessoryListItemHvAmount({ index, hvAmount }: { index: number; hvAmount: number }) {
const original = this.accessoryList[index];
const newItem = { ...original, hvAmount };
this.accessoryList.splice(index, 1, newItem);
}
/**
*
*/
get isAggregateCheckedAll() {
return !this.aggregateList.filter((_: any) => !_.checked).length;
}
/**
*
*/
get isOrderCheckedAll() {
return !this.orderList.filter((_: any) => !_.checked).length;
}
/**
* /
* @param checked
*/
@Mutation
checkAllProOrderList(checked: boolean) {
this.proOrderList = this.proOrderList.map((item: any) => ({
...item,
checked,
}));
}
/**
*
* @param params
*/
@MutationAction
async queryProOrder(params: any) {
const { list: proOrderList }: any = await http.post(url.sumscan.query.orderno, params);
//const proOrderList = values.map((v: string) => ({ prdOrder, amount: v, materialCode: v, materialDesc: v }));
//const proOrderList = values;
//console.log(">>>>>?????proOrderList",proOrderList);
proOrderList.forEach((_: any) => (_.checked = true));
if (!proOrderList.length) {
// uni.showToast({
// icon: 'none',
// title: 'No Data Found',
// });
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.sumscan.query.ordoutlist, params);
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 queryAggregateList(params: any) {
const { list: aggregateList }: any = await http.post(url.sumscan.query.hzlist, params);
if (!aggregateList.length) {
// uni.showToast({
// icon: 'none',
// title: 'No Data Found',
// });
vm.customToast(vm.$t('message.Pi_NoDataFound') as any);
return { aggregateList };
}
console.log('aggregateList', aggregateList);
return { aggregateList };
}
/**
* -
* @param params
*/
@MutationAction
async queryOrderList(params: any) {
const { queryParams, proOrderResultList } = params;
await http.post(url.sumscan.lock.list, queryParams);
const orderList = cloneDeep<any>(proOrderResultList);
orderList.map((item: any) => {
Object.assign(item, { checked: false });
});
return { orderList };
}
@MutationAction
async lock(params: any) {
const res: any = await http.post(url.sortscan.lock.list, params);
const lockCode = res.code;
return { lockCode };
}
/**
* -
* @param params
*/
@MutationAction
async queryAccessoryList(params: any) {
const { list: accessoryList }: any = await http.post(url.sumscan.query.fllist, params);
if (!accessoryList.length) {
// uni.showToast({
// icon: 'none',
// title: 'No Data Found',
// });
vm.customToast(vm.$t('message.Pi_NoDataFound') as any);
}
return { accessoryList };
}
/**
* -
* @param params
*/
@MutationAction
async uploadOrderList(params: any) {
const result: any = await http.post(url.sumscan.u.order, params);
const SubmitCode = result.code;
console.log('yayayyayyayayayyayyayayayyay', SubmitCode);
uni.showToast({
//icon: 'success',
title: 'success',
duration: 2000,
image: '/static/icons/icon-51.png',
});
return { SubmitCode };
}
/**
* -
* @param params
*/
@Action
async uploadAccessoryList(params: any) {
return http.post(url.sumscan.u.fllist, params);
}
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
async queryByFactoryCodeAndWorkAreaCode(content: any) {
const res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content);
return res;
}
}
export default getModule(AggregatingModule);

@ -0,0 +1,414 @@
<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.Summary_HandoverByOrder') }}</view>
<view class="right"></view>
</view>
<view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border enable-check="multiple" :headers="headers" @onCheck="clickIndex" :contents="model.orderList" :show-vert-border="false"></wyb-table>
</view>
<view class="bottom-bar">
<view class="extra">
<!-- <u-form ref="amountForm" :model="amountForm" :error-type="['toast']">
<u-row class="bottom-info">
<u-col :span="12">
<u-form-item prop="amount" :label="$t('message.Summary_Number')" label-width="120rpx">
<u-input type="number" v-model="amountForm.amount" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
</u-row>
</u-form> -->
<u-form ref="submitForm" :model="submitForm" :error-type="['toast']">
<u-row class="bottom-info">
<u-col :span="12">
<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="warning" @click="onSelectAll">
{{ $t('message.po_SelectAll') }}
</u-button>
</u-col>
<!-- <u-col :span="4">
<u-button type="primary" @click="onOk">
{{ $t('message.dn_Confirm') }}
</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>
</view>
</view>
</template>
<script lang="ts">
import { Component, Ref } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import model from './model';
import { orderHeaders } from './config';
import { VForm, VFormRules } from 'vue/types/form';
import { auth } from '@/store/modules/auth';
import { pick } from 'lodash/fp';
import http from '@/utils/request';
import { url } from '@/utils/url';
import { session } from '@/store/modules/session';
@Component
export default class AggregatingOrder extends BasePage {
/**
* 表单引用
*/
@Ref('amountForm') readonly $amountForm!: VForm;
@Ref('submitForm') readonly $submitForm!: VForm;
/**
* 页面Module
*/
model = model;
border = true;
/**
* 表头
*/
headers = orderHeaders;
spliceItem: any;
/**
* 交接完成
*/
isHandoverFinished = true;
/**
* 更改数量表单
*/
amountForm = {
amount: '',
};
/**
* 上传表单
*/
submitForm = {
receiver: '',
receiverName: '',
password: '',
};
amountFormRules: VFormRules<any> = {
amount: [
{
required: true,
message: this.$t('message.Summary_PleaseInputNumber') as string,
},
],
};
submitFormRules: VFormRules<any> = {
receiverName: [
{
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.isHandoverFinished = false;
}
beforeDestroy() {
if (model.orderList.length > 0 && !this.isHandoverFinished) {
this.unlock();
}
}
onHide() {
if (model.orderList.length > 0 && !this.isHandoverFinished) {
this.unlock();
}
}
/**
* 全选
*/
onSelectAll() {
// console.log('this.nodel.orderList111', this.model.orderList, this.$refs.table);
const isOrderCheckedAll = !model.isOrderCheckedAll;
this.model.checkAllOrderList(isOrderCheckedAll);
}
clickIndex(e: any) {
console.log('ccccc', e.data);
// this.spliceItem = e.data[0].lineData.orderOutId;
// let num:any = parseFloat(e.data[0].lineData.totalMoAmount) - parseFloat(e.data[0].lineData.totalHvAmount)
// this.amountForm.amount = num
//
e.data.forEach((item, index) => {
//debugger;
console.log('xuanzedeindex', e.data);
console.log('hvmount', item.lineData.totalMoAmount - item.lineData.totalHvAmount);
this.model.setOrderListItemHvAmount({
index: e.data[index].index,
hvAmount: item.lineData.totalMoAmount - item.lineData.totalHvAmount,
});
});
this.model.orderList.forEach((item) => {
if (item.checked == false) {
item.hvAmount = 0;
}
});
console.log('/////////', this.model.orderList);
}
/**
* 接收人确认
*/
async onReceiverConfirm() {
console.log('this.submitForm', this.submitForm);
const userInfo = await auth.getUserInfo({
loginName: this.submitForm.receiverName,
});
this.submitForm.receiver = this.submitForm.receiverName;
this.submitForm.receiverName = userInfo.userName;
}
onSubmit() {
this.$submitForm.validate(async (valid) => {
if (valid) {
if (model.orderList.length === 0) {
this.customToast(this.$t('message.Pi_tip4') as string);
} else {
if ((this.submitForm.receiver ? this.submitForm.receiver : this.submitForm.receiverName) == session.loginName) {
this.customToast(this.$t('message.different') as string);
return;
}
// await auth.checkPassword({
// rfPwd: this.submitForm.password,
// factoryCode: session.factoryCode as string,
// // loginName: this.submitForm.receiver,
// loginName: this.submitForm.receiver ? this.submitForm.receiver : this.submitForm.receiverName,
// });
let submit = false;
let selectsta = true;
this.model.orderList.forEach((item, index) => {
if (!item.checked) {
this.model.setOrderListItemHvAmount({ index, hvAmount: 0 });
} else if (item.hvAmount == null || item.hvAmount == 0) {
submit = true;
}
if (item.checked) {
selectsta = false;
}
});
if (selectsta) {
this.customToast(this.$t('message.Pi_tip4') as string);
return;
}
if (submit) {
this.customToast(this.$t('message.Summary_PleaseInputNumber') as string);
return;
}
let List: any = [];
let isTrue = true;
this.model.orderList.forEach((item: any) => {
if (item.checked) {
List.push(item);
}
});
if (List.length == 0) {
this.customToast(this.$t('message.Pi_tip13') as string);
return;
}
List.forEach((item: any) => {
if (parseFloat(item.totalMoAmount) - parseFloat(item.totalHvAmount) != parseFloat(item.hvAmount)) {
isTrue = false;
return;
}
});
if (isTrue != true) {
this.customToast(this.$t('message.Pi_tip15') as string);
return;
}
await this.model.uploadOrderList({
operatorPass: this.submitForm.receiver ? this.submitForm.receiver : this.submitForm.receiverName,
factoryCode: session.factoryCode,
loginName: session.loginName,
orderOutIdAmountList: List.map((item: any) => ({
...pick(['materialCode', 'amount', 'totalHvAmount', 'sapFactoryCode', 'sendSpot', 'materialDesc', 'mrpCode', 'unit', 'prdOrder', 'proType', 'wkposCode', 'hvAmount', 'orderOutId'], item),
pickNum: item.totalMoAmount,
factoryCode: session.factoryCode,
})),
});
setTimeout(() => {
this.onAggregate();
}, 2000);
}
}
});
}
async onAggregate() {
this.submitForm.receiver = '';
this.submitForm.receiverName = '';
// this.submitForm.password = '';
this.amountForm.amount = '';
// await this.model.queryProOrder(this.model.isFormChange);
//
console.log('123456789yayayyayayayya', this.model.SubmitCode);
if (this.model.SubmitCode == '1') {
const ServeUrl = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__'));
this.uni.request({
url: ServeUrl.server.address + url.sumscan.query.ordoutlist,
method: 'POST',
data: this.model.param,
success: (res: any) => {
if (res.data.code != '0' && res.data.list != null) {
// this.empty();
//this.resetForm();
this.chaxun();
} else if (res.data.code == '0' && res.data.list == null) {
//this.customToast(this.$t('message.Pi_NoData') as string);
uni.showToast({
//icon: 'success',
//duration: 2000,
title: this.$t('message.Pi_NoData') as string,
icon: 'none',
});
setTimeout(() => {
this.toPage(this.page.raw.handover.RUSaggregating.index);
}, 2000);
//this.empty();
//this.form.documentNo = '';
}
},
});
}
this.$submitForm.setRules(this.submitFormRules);
}
//
async chaxun() {
await this.model.queryProOrderResult(this.model.param);
await this.model.queryOrderList({
queryParams: this.model.orderOutIdListParams,
proOrderResultList: this.model.proOrderResultList,
});
}
/**
* 解锁
*/
async unlock() {
const orderOutIdList = this.model.proOrderResultList.map((_: any) => _.orderOutId);
try {
await http.post(url.sumscan.unlock.list, {
factoryCode: session.factoryCode,
loginName: session.loginName,
orderOutIdList,
});
} 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: 118rpx;
padding-bottom: 280rpx;
.header {
position: fixed;
top: 36rpx;
left: 0;
right: 0;
display: flex;
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 {
z-index: 21;
position: fixed;
bottom: 0;
left: 0;
right: 0;
.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>

@ -0,0 +1,177 @@
<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="4">
<u-button type="primary" @click="onAggregate">
{{ $t('message.Pi_Summary') }}
</u-button>
</u-col>
<u-col :span="4">
<u-button type="success" @click="onOrder">
{{ $t('message.Pi_ByOrder') }}
</u-button>
</u-col>
<!-- <u-col :span="3">-->
<!-- <u-button type="warning"> 辅料 </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';
import { session } from '@/store/modules/session';
@Component
export default class AggregatingResult extends BasePage {
/**
* 页面Module
*/
model = model;
/**
* 表头
*/
headers = resultHeaders;
/**
* 汇总
*/
async onAggregate() {
const orderOutIdList = this.model.proOrderResultList.map((_: any) => _.orderOutId);
const params = {
factoryCode: session.factoryCode,
loginName: session.loginName,
orderOutIdList,
};
await this.model.queryAggregateList(params);
this.model.orderOutIdListParams = params;
this.toPage(this.page.raw.handover.RUSaggregating.summary);
}
/**
* 按单
*/
async onOrder() {
const orderOutIdList = await this.model.proOrderResultList.map((_: any) => _.orderOutId);
const params = {
factoryCode: session.factoryCode,
loginName: session.loginName,
orderOutIdList,
};
await this.model.queryOrderList({
queryParams: params,
proOrderResultList: this.model.proOrderResultList,
});
this.model.orderOutIdListParams = params;
this.toPage(this.page.raw.handover.RUSaggregating.order);
}
/**
* 辅料
*/
async onAccessory() {
const orderOutIdList = this.model.proOrderResultList.map((_: any) => _.orderOutId);
const params = {
factoryCode: session.factoryCode,
loginName: session.loginName,
orderOutIdList,
};
await this.model.queryAccessoryList(params);
this.toPage(this.page.raw.handover.aggregating.accessory);
}
}
</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: 118rpx;
padding-bottom: 132rpx;
.header {
position: fixed;
top: 36rpx;
left: 0;
right: 0;
display: flex;
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: 30;
.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,462 @@
<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.Summary_SummaryAndHandover') }}</view>
<view class="right"></view>
</view>
<view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border enable-check="multiple" :headers="headers" @onCheck="clickIndex" :contents="model.aggregateList" :show-vert-border="false"></wyb-table>
</view>
<view class="bottom-bar">
<view class="extra">
<!-- <u-form ref="amountForm" :model="amountForm" :error-type="['toast']">
<u-row class="bottom-info">
<u-col :span="12">
<u-form-item prop="amount" :label="$t('message.Summary_Number')" label-width="120rpx">
<u-input type="number" v-model="amountForm.amount" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
</u-row>
</u-form> -->
<u-form ref="submitForm" :model="submitForm" :error-type="['toast']">
<u-row class="bottom-info">
<u-col :span="12">
<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="warning" @click="onSelectAll">
{{ $t('message.po_SelectAll') }}
</u-button>
</u-col>
<!-- <u-col :span="4">
<u-button type="primary" @click="onOk">
{{ $t('message.dn_Confirm') }}
</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>
</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 { pick } from 'lodash/fp';
import http from '@/utils/request';
import { url } from '@/utils/url';
import { session } from '@/store/modules/session';
@Component
export default class AggregatingSummary extends BasePage {
/**
* 表单引用
*/
@Ref('amountForm') readonly $amountForm!: VForm;
@Ref('submitForm') readonly $submitForm!: VForm;
/**
* 页面Module
*/
model = model;
border = true;
/**
* 表头
*/
headers = summaryHeaders;
spliceItem: any;
/**
* 交接完成
*/
isBusinessFinished = true;
/**
* 更改数量表单
*/
amountForm = {
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
onShow() {
this.model = model;
/**this.$amountForm.setRules(this.amountFormRules);**/
this.$submitForm.setRules(this.submitFormRules);
this.isBusinessFinished = false;
}
clickIndex(e: any) {
console.log('ccccc', e);
//this.spliceItem = e.data[0].lineData.materialCode;
//
// model.setAggregateListItemHvAmount({
// index: this.model.aggregateList.findIndex((_) => _.checked),
// hvAmount: 0,
// });
e.data.forEach((item, index) => {
//debugger;
console.log('xuanzedeindex', e.data);
console.log('hvmount', item.lineData.totalMoAmount - item.lineData.totalHvAmount);
this.model.setAggregateListItemHvAmount({
index: e.data[index].index,
hvAmount: item.lineData.totalMoAmount - item.lineData.totalHvAmount,
});
});
this.model.aggregateList.forEach((item) => {
if (item.checked == false) {
item.hvAmount = 0;
}
});
console.log('/////////', this.model.aggregateList);
}
beforeDestroy() {
if (model.aggregateList.length > 0 && !this.isBusinessFinished) {
this.unlock();
}
}
onHide() {
if (model.aggregateList.length > 0 && !this.isBusinessFinished) {
this.unlock();
}
}
/**
* 全选
*/
onSelectAll() {
console.log('this.nodel.aggregateList111', this.model.aggregateList);
this.model.checkAllAggregateList(!this.model.isAggregateCheckedAll);
}
/**
* 接收人确认
*/
async onReceiverConfirm() {
const userInfo = await auth.getUserInfo({
loginName: this.submitForm.receiverName,
});
this.submitForm.receiver = this.submitForm.receiverName;
this.submitForm.receiverName = userInfo.userName;
}
/**
* 确认
*/
// onOk() {
// this.$amountForm.validate((valid) => {
// if (!valid) return;
// const firstSelection = this.model.aggregateList.find((_) => _.checked);
// if (firstSelection === undefined) {
// this.customToast(this.$t('message.Pi_tip7') as string);
// } else {
// //
// const currentPickNum = parseFloat(this.amountForm.amount);
// //
// const totalHvAmount = parseFloat(firstSelection.totalHvAmount);
// //
// const totalMoAmount = parseFloat(firstSelection.totalMoAmount);
// //=
// // if (currentPickNum != totalMoAmount) {
// // this.customToast(this.$t('message.Pi_tip12') as string);
// // return;
// // }
// //
// model.setAggregateListItemHvAmount({
// index: this.model.aggregateList.findIndex((_) => _.checked),
// //hvAmount: currentPickNum,
// hvAmount: totalMoAmount - totalHvAmount,
// });
// }
// });
// }
/**
* 上传
*/
onSubmit() {
this.$submitForm.validate(async (valid) => {
if (valid) {
if (this.model.aggregateList.length === 0) {
this.customToast(this.$t('message.Pi_tip4') as string);
} else {
if ((this.submitForm.receiver ? this.submitForm.receiver : this.submitForm.receiverName) == session.loginName) {
this.customToast(this.$t('message.different') as string);
return;
}
// await auth.checkPassword({
// rfPwd: this.submitForm.password,
// factoryCode: session.factoryCode as string,
// loginName: this.submitForm.receiverName,
// });
let submit = false;
let selectsta = true;
this.model.aggregateList.forEach((item) => {
if (!item.checked) {
return;
} else if (item.hvAmount == null || item.hvAmount == 0) {
submit = true;
}
if (item.checked) {
selectsta = false;
}
});
if (selectsta) {
this.customToast(this.$t('message.Pi_tip4') as string);
return;
}
if (submit) {
this.customToast(this.$t('message.Summary_PleaseInputNumber') as string);
return;
}
let List: any = [];
let isTrue = true;
this.model.aggregateList.forEach((item: any) => {
if (item.checked) {
List.push(item);
}
});
if (List.length == 0) {
this.customToast(this.$t('message.Pi_tip13') as string);
return;
}
//
//totalMoAmount totalHvAmount hvAmount
List.forEach((item: any) => {
if (parseFloat(item.totalMoAmount) - parseFloat(item.totalHvAmount) != parseFloat(item.hvAmount)) {
isTrue = false;
return;
}
});
if (isTrue != true) {
this.customToast(this.$t('message.Pi_tip15') as string);
return;
}
await this.model.uploadAggregateList({
operatorPass: this.submitForm.receiver ? this.submitForm.receiver : this.submitForm.receiverName,
factoryCode: session.factoryCode as string,
loginName: session.loginName as string,
dataList: List.map((item: any) => ({
...pick(['materialCode', 'sapFactoryCode', 'materialDesc', 'unit', 'prdMaterialDesc', 'wkposCode', 'mrpCode', 'sendSpot'], item),
amount: String(item.amount),
hvAmount: item.hvAmount == null ? '0' : String(item.hvAmount),
serialNo: item.serialNo == null ? '' : item.serialNo,
totalMoAmount: String(item.totalMoAmount),
totalHvAmount: String(item.totalHvAmount),
prdMaterialDesc: String(item.prdMaterialCode),
})),
includeOrderOutIdList: this.model.proOrderResultList.map((item: any) => item.orderOutId),
});
setTimeout(() => {
this.onAggregate();
}, 2000);
}
}
});
}
async onAggregate() {
/**this.amountForm.amount = '';**/
this.submitForm.receiver = '';
this.submitForm.receiverName = '';
// this.submitForm.password = '';
this.isBusinessFinished = true;
// await this.model.queryProOrder(this.model.isFormChange);
console.log('123456789yayayyayayayya', this.model.SubmitCode);
if (this.model.SubmitCode == '1') {
const ServeUrl = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__'));
this.uni.request({
url: ServeUrl.server.address + url.sumscan.query.ordoutlist,
method: 'POST',
data: this.model.param,
success: (res: any) => {
if (res.data.code != '0' && res.data.list != null) {
// this.empty();
//this.resetForm();
this.chaxun();
} else if (res.data.code == '0' && res.data.list == null) {
// this.customToast(this.$t('message.Pi_NoData') as string);
// this.toPage(this.page.raw.handover.aggregating.index);
uni.showToast({
//icon: 'success',
//duration: 2000,
title: this.$t('message.Pi_NoData') as string,
icon: 'none',
});
setTimeout(() => {
this.toPage(this.page.raw.handover.RUSaggregating.index);
}, 2000);
//this.empty();
//this.form.documentNo = '';
}
},
});
}
// model.aggregateList.forEach((item: any, index: any) => {
// if (item.materialCode == this.spliceItem) {
// model.aggregateList.splice(index, 1);
// }
// });
// model.proOrderResultList.forEach((item: any, index: any) => {
// if (item.materialCode == this.spliceItem) {
// model.proOrderResultList.splice(index, 1);
// }
// });
/**this.$amountForm.setRules(this.amountFormRules);**/
this.$submitForm.setRules(this.submitFormRules);
}
//
async chaxun() {
await this.model.queryProOrderResult(this.model.param);
await this.model.queryAggregateList(this.model.orderOutIdListParams);
}
/**
* 解锁
*/
async unlock() {
const orderOutIdList = model.proOrderResultList.map((_: any) => _.orderOutId);
try {
await http.post(url.sumscan.unlock.list, {
factoryCode: session.factoryCode,
loginName: session.loginName,
orderOutIdList,
});
} 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: 118rpx;
padding-bottom: 280rpx;
.header {
position: fixed;
top: 36rpx;
left: 0;
right: 0;
display: flex;
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: 30;
.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>

@ -67,16 +67,16 @@
</div>
<u-form ref="form2" :error-type="['toast']" style="background: rgb(255, 255, 255)">
<u-row class="bottom-info">
<u-col :span="6">
<u-col :span="12">
<u-form-item :label="$t('message.Summary_Receiver')" label-width="120rpx">
<u-input v-model="operator" :border="border" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
<u-col :span="6">
<!-- <u-col :span="6">
<u-form-item :label="$t('message.Summary_Password')">
<u-input v-model="rfPwd" :border="border" type="password" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
</u-col> -->
</u-row>
</u-form>
<u-row class="button-bar">
@ -221,7 +221,7 @@ export default class returningDom extends BasePage {
this.LocationList[this.LocationList.length - 1].barcode = this.Container.barcode;
this.LocationList[this.LocationList.length - 1].wlCode = this.wlCode.label;
this.LocationList[this.LocationList.length - 1].operator = this.operator;
this.LocationList[this.LocationList.length - 1].rfPwd = this.rfPwd;
// this.LocationList[this.LocationList.length - 1].rfPwd = this.rfPwd;
this.LocationList[this.LocationList.length - 1].loginName = this.operator;
this.LocationList[this.LocationList.length - 1].operatorPass = this.operator;
this.LocationList[this.LocationList.length - 1].wkposCode = this.wlCode.sendSpot;

@ -2,7 +2,7 @@ import { Action, getModule, Module, MutationAction, VuexModule } from 'vuex-modu
import store from '@/store';
import http from '@/utils/request';
import { url } from '@/utils/url';
import { auth } from '@/store/modules/auth';
// import { auth } from '@/store/modules/auth';
import { session } from '@/store/modules/session';
class OrderInInfo {
@ -91,11 +91,11 @@ export class ReturningModule extends VuexModule {
@Action
async tluSubmit(params: any) {
console.log(params);
await auth.checkPassword({
factoryCode: session.factoryCode as string,
loginName: params[0].operator,
rfPwd: params[0].rfPwd,
});
// await auth.checkPassword({
// factoryCode: session.factoryCode as string,
// loginName: params[0].operator,
// rfPwd: params[0].rfPwd,
// });
await http.post(url.tl.uRussia, params);
uni.showToast({
//icon: "success",

@ -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,336 @@
<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 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.RUSvirtual.result);
});
}
/**
* 定单查询
*/
onQuery() {
this.$form.validate(async (valid: boolean) => {
if (!valid) return;
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,184 @@
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.RUS-virtual',
})
export class VirtualModule extends VuexModule {
/**
* sap
*/
sapFactoryCode = '';
nextQueryParams: any = {};
CategoryList: any = [];
/**
*
*/
proOrderList = [];
/**
*
*/
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);
}
}
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.RUSvirtual.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="12">
<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>

@ -91,16 +91,16 @@
</div>
<u-form ref="form2" :model="form2" :error-type="['toast']" style="background: rgb(255, 255, 255)">
<u-row class="bottom-info">
<u-col :span="6">
<u-col :span="12">
<u-form-item prop="operatorPass" :label="$t('message.Summary_Receiver')" label-width="120rpx">
<u-input v-model="operatorName" :border="border" @confirm="onOperatorConfirm" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
<u-col :span="6">
<!-- <u-col :span="6">
<u-form-item prop="rfPwd" :label="$t('message.Summary_Password')">
<u-input v-model="form2.rfPwd" :border="border" type="password" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
</u-col> -->
</u-row>
</u-form>
<div class="container">

@ -224,11 +224,11 @@ export class FeedingModule extends VuexModule {
//俄罗斯补料提交
@Action({ commit: 'clearState' })
async saveBlDetailSubmit(params: any) {
await auth.checkPassword({
factoryCode: session.factoryCode as string,
loginName: params.operatorPass as string,
rfPwd: params.rfPwd,
});
// await auth.checkPassword({
// factoryCode: session.factoryCode as string,
// loginName: params.operatorPass as string,
// rfPwd: params.rfPwd,
// });
await http.post(url.bl.uRussia, {
factoryCode: session.factoryCode,
loginName: session.loginName,

@ -115,11 +115,23 @@ export const page = {
summary: '/pages/raw/handover/aggregating/summary',
accessory: '/pages/raw/handover/aggregating/accessory',
},
RUSaggregating: {
index: '/pages/raw/handover/RUS-aggregating/index',
result: '/pages/raw/handover/RUS-aggregating/result',
order: '/pages/raw/handover/RUS-aggregating/order',
summary: '/pages/raw/handover/RUS-aggregating/summary',
// accessory: '/pages/raw/handover/aggregating/accessory',
},
virtual: {
index: '/pages/raw/handover/virtual/index',
result: '/pages/raw/handover/virtual/result',
summary: '/pages/raw/handover/virtual/summary',
},
RUSvirtual: {
index: '/pages/raw/handover/RUS-virtual/index',
result: '/pages/raw/handover/RUS-virtual/result',
summary: '/pages/raw/handover/RUS-virtual/summary',
},
feeVirtualReplenishmentding: {
Location: '/pages/raw/handover/feeVirtualReplenishmentding/Location',
Local: '/pages/raw/handover/feeVirtualReplenishmentding/Local-details',

Loading…
Cancel
Save