overseamom-285 feat 修改文件夹名称

master
suiwei 2 years ago
parent 3b61abfd06
commit 22002eabe0

@ -0,0 +1,441 @@
<template>
<view class="page-picking-order">
<view class="header">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="index" />
</view>
<view class="title">{{ $t('message.Pi_ByOrderPicking') }}</view>
<view class="right"></view>
</view>
<view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" enable-check="single" show-left-and-right-border :headers="headers" :contents="model.orderList" :show-vert-border="false" @onCheck="handleRow"></wyb-table>
</view>
<!-- 列表展示数据 -->
<view class="Exhibition">
<view class="Exhibition-left">
<view class="Exhibition-left-title">工位:</view>
<view class="Exhibition-left-data">{{ some.sendSpot }}</view>
</view>
<view class="Exhibition-right">
<view class="Exhibition-right-title">已拣数量:</view>
<view class="Exhibition-right-data">{{ some.totalMoAmount }}</view>
</view>
</view>
<!-- 添加库位 -->
<view class="library">
<view class="library-left">
<view>库位:</view>
<jPicker sureColor="#ff0000" style="width: 230rpx" @bindpicker="LocationChoice" showKey="value" valKey="value" :val="wlCode" class="search" :options="Location" />
</view>
<view class="library-right">
<view class="library-right-title">本次数量</view>
<u-input v-model="qty" :type="type" :border="border" class="input" />
</view>
</view>
<!-- 添加 -->
<view class="add">
<u-button type="primary" @click="Add"></u-button>
</view>
<!-- 表格 -->
<u-table class="library-table">
<u-tr class="u-tr">
<u-th class="u-th">{{ $t('message.product_Location') }}</u-th>
<u-th class="u-th">{{ $t('message.product_Number') }}</u-th>
<u-th class="u-th">{{ $t('message.operation') }}</u-th>
</u-tr>
<u-tr class="u-tr" v-for="(item, index) in LocationList" :key="index">
<u-td class="u-td">{{ item.wlCode }}</u-td>
<u-td class="u-td">{{ item.qty }}</u-td>
<u-td class="u-td">
<div class="u-td" @click="deleteItem(index)">
{{ $t('message.product_Delete') }}
</div>
</u-td>
</u-tr>
</u-table>
<view class="bottom-bar">
<div class="extra">
<u-form ref="form" :model="form" :error-type="['toast']">
<u-row class="bottom-info"> </u-row>
</u-form>
</div>
<div class="container">
<u-row>
<u-col :span="4">
<u-button type="primary" class="appoint" @click="appoint"></u-button>
</u-col>
<u-col :span="4">
<u-button type="success" @click="onSubmit"> </u-button>
</u-col>
<u-col :span="4">
<u-button type="error" @click="onUpload"> </u-button>
</u-col>
</u-row>
</div>
</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 { session } from '@/store/modules/session';
import { VForm, VFormRules } from 'vue/types/form';
import jPicker from '@/components/J-Picker/jPicker.vue';
import { pick } from 'lodash/fp';
@Component({
components: {
jPicker,
},
})
export default class RawReceiptDetail extends BasePage {
/**
* 表单引用
*/
@Ref('form') readonly $form!: VForm;
@Ref('submitForm') readonly $submitForm!: VForm;
submitForm = {
receiver: '',
receiverName: '',
password: '',
};
/**
* 页面Module
*/
model = model;
type = 'text';
wlCode: any = '';
border = true;
//
LocationList: any = [];
//
Location: any = [];
someIndex = 0;
some: any = {};
qty: any = '';
/**
* 表单数据
*/
form: any = {
// locationCode: null,
amount: null,
};
index() {
this.toPage(this.page.raw.handover.picking.result);
}
/**
* 表单校验
*/
rules: VFormRules<any> = {
// locationCode: [{ required: true, message: '' }],
amount: [
{ required: true, message: this.$t('message.Pi_tip1') as string },
// { type: 'integer', min: 1, transform: Number, message: this.$t('message.Pi_tip2') as string },
],
};
/**
* 库存地点选择
*/
locationCodeSelect = false;
/**
* 表头
*/
headers = orderHeaders;
LocationChoice(e: any) {
console.log('e>>>>>>>>>>>>>>>>>>>>>>>>', e);
this.wlCode = e.pickerName;
}
handleRow({ data }: any) {
this.someIndex = data[0].index;
this.some = data[0].lineData;
this.model.orderList[this.someIndex].wlList = [];
this.model.orderList[this.someIndex].currentAmount = 0;
}
Add() {
if (this.qty == '' || this.wlCode == '') {
uni.showToast({
icon: 'none',
title: '请输入正确的库位和数量' as any,
});
return;
}
if (parseFloat(this.qty) <= 0) {
uni.showToast({
icon: 'none',
title: '请输入大于0的数量' as any,
});
return;
}
if (parseFloat(this.qty) > model.orderList[this.someIndex].amount) {
uni.showToast({
icon: 'none',
title: '不能大于需求数量,请重新输入' as any,
});
return;
}
let num = parseFloat(this.qty);
this.LocationList.forEach((item: any) => {
num += parseFloat(item.qty);
});
console.log(num);
if (num > this.model.orderList[this.someIndex].amount) {
uni.showToast({
icon: 'none',
title: '不能大于需求数量,请重新输入' as any,
});
return;
}
let isTrue = true;
if (this.LocationList.length != 0) {
this.LocationList.forEach((item: any) => {
if (this.wlCode.sendSpot != item.Code) {
uni.showToast({
icon: 'none',
title: '请选择正确的库位' as any,
});
return (isTrue = false);
}
});
}
if (this.some == {}) {
uni.showToast({
icon: 'none',
title: '请先选择一个物料' as any,
});
return;
}
if (isTrue == true) {
let arr = {
wlCode: this.wlCode.label,
qty: this.qty,
Code: this.wlCode.sendSpot,
};
this.LocationList.push(arr);
let objString = JSON.stringify(this.some);
let TEM = JSON.parse(objString);
TEM.wlList = null;
TEM.wlCode = this.wlCode.label;
TEM.hvAmount = this.qty;
this.model.orderList[this.someIndex].wlList.push(TEM);
this.model.orderList[this.someIndex].hvAmount += parseFloat(this.qty);
console.log('this.model.orderList', this.model.orderList[this.someIndex]);
this.qty = '';
}
}
deleteItem(index: any) {
this.LocationList.splice(index, 1);
this.model.orderList[this.someIndex].wlList.splice(index, 1);
this.business();
}
business() {
let num = 0;
this.LocationList.forEach((item: any) => {
num += parseFloat(item.qty);
});
this.model.orderList[this.someIndex].currentAmount = num;
console.log('this.model.orderList', this.model.orderList[this.someIndex]);
}
async onShow() {
//
let means: any = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__') as any);
let content = {
loginName: means.session.user.loginName,
sendSpot: null,
factoryCode: means.session.user.factoryCode,
workArea: session.workareaCode,
};
let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content);
res.forEach((item: any) => {
let pickerName: any = {};
pickerName.label = item.locationCode;
pickerName.value = item.locationCode + '(' + item.sendSpot + ')';
pickerName.sendSpot = item.sendSpot;
this.Location.push(pickerName);
});
this.model.orderList.forEach((item: any) => {
item.hvAmount = 0;
});
}
appoint() {
console.log('1');
}
/**
* 提交
*/
async onSubmit() {
await model.uploadOrderList({
operatorPass: this.submitForm.receiver,
factoryCode: session.factoryCode,
loginName: session.loginName,
orderOutIdAmountList: model.orderList.map((item) => ({
...pick(['materialCode', 'amount', 'totalHvAmount', 'sapFactoryCode', 'sendSpot', 'materialDesc', 'mrpCode', 'unit', 'prdOrder', 'proType', 'wkposCode', 'hvAmount', 'orderOutId', 'wlList'], item),
pickNum: item.totalMoAmount,
factoryCode: session.factoryCode,
})),
});
}
}
</script>
<style lang="scss" scoped>
.page-picking-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: 222rpx;
.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;
height: 500rpx;
overflow-x: auto;
}
.form {
background-color: #fff;
padding: 40rpx;
border-radius: 10rpx;
}
.Exhibition {
width: 100%;
height: 100rpx;
margin-top: 20rpx;
display: flex;
.Exhibition-left {
width: 50%;
height: 100%;
display: flex;
.Exhibition-left-title {
width: 50%;
height: 100%;
text-align: center;
line-height: 100rpx;
}
.Exhibition-left-data {
width: 50%;
height: 100%;
text-align: center;
line-height: 100rpx;
}
}
.Exhibition-right {
width: 50%;
height: 100%;
display: flex;
.Exhibition-right-title {
width: 50%;
height: 100%;
text-align: center;
line-height: 100rpx;
}
.Exhibition-right-data {
width: 50%;
height: 100%;
text-align: center;
line-height: 100rpx;
}
}
}
.library {
width: 100%;
height: 100rpx;
display: flex;
.library-left {
width: 50%;
height: 100%;
display: flex;
view {
width: 230rpx;
line-height: 100rpx;
text-align: center;
}
}
.library-right {
width: 50%;
height: 100%;
display: flex;
.library-right-title {
width: 120rpx;
height: 100%;
line-height: 100rpx;
}
.input {
width: 200rpx;
height: 70rpx;
margin-top: 15rpx;
margin-left: 15rpx;
}
}
}
.add {
width: 100%;
height: 100rpx;
position: relative;
button {
position: absolute;
top: 10rpx;
right: 20rpx;
}
}
.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,326 @@
<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">辅料交接</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" :contents="model.accessoryList" :show-vert-border="false" @onCheck="onCheck"></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="数量" label-width="120rpx">
<u-input type="number" v-model="amountForm.amount" />
</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="6">
<u-form-item prop="receiverName" label="接收人" label-width="120rpx">
<u-input v-model="submitForm.receiverName" @confirm="onReceiverConfirm" />
</u-form-item>
</u-col>
<u-col :span="6">
<u-form-item prop="password" label="口令">
<u-input type="number" v-model="submitForm.password" />
</u-form-item>
</u-col>
</u-row>
</u-form>
</view>
<view class="container">
<u-row>
<u-col :span="4">
<u-button type="warning" @click="onSelectAll"> </u-button>
</u-col>
<u-col :span="4">
<u-button type="primary" @click="onOk"> </u-button>
</u-col>
<u-col :span="4">
<u-button type="success" @click="onSubmit"> </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('table') readonly $table: any;
/**
* 表单引用
*/
@Ref('amountForm') readonly $amountForm!: VForm;
@Ref('submitForm') readonly $submitForm!: VForm;
/**
* 页面Module
*/
model = model;
/**
* 表头
*/
headers = summaryHeaders;
/**
* 交接完成
*/
isHandoverFinished = true;
/**
* 更改数量表单
*/
amountForm = {
amount: '',
};
/**
* 上传表单
*/
submitForm = {
receiver: '',
receiverName: '',
password: '',
};
amountFormRules: VFormRules<any> = {
amount: [{ required: true, message: '请输入数量!' }],
};
submitFormRules: VFormRules<any> = {
receiver: [{ required: true, message: '请输入接收人' }],
password: [{ required: true, message: '请输入口令' }],
};
// onReadyonLoad
onReady() {
this.$amountForm.setRules(this.amountFormRules);
this.$submitForm.setRules(this.submitFormRules);
this.isHandoverFinished = false;
}
beforeDestroy() {
if (model.accessoryList.length > 0 && !this.isHandoverFinished) {
this.unlock();
}
}
/**
* 处理选择行
*/
onCheck(e: any) {
e.data.forEach((line: any) => {
const { index, lineData: item } = line;
const hvAmount = item.totalMoAmount - item.totalHvAmount;
model.setAccessoryListItemHvAmount({ index, hvAmount });
});
}
/**
* 全选
*/
onSelectAll() {
this.$table.onCheckAllTap();
}
/**
* 接收人确认
*/
async onReceiverConfirm() {
const userInfo = await auth.getUserInfo({
loginName: this.submitForm.receiver,
});
this.submitForm.receiver = this.submitForm.receiverName;
this.submitForm.receiver = userInfo.userName;
}
/**
* 确认
*/
onOk() {
this.$amountForm.validate((valid) => {
if (!valid) return;
const firstSelection = this.model.accessoryList.find((_) => _.checked);
if (firstSelection === undefined) {
uni.showToast({ icon: 'none', title: '请选中要修改的行!' });
} else {
//
const currentPickNum = parseFloat(this.amountForm.amount);
//
const totalHvAmount = parseFloat(firstSelection.totalHvAmount);
//
const totalMoAmount = parseFloat(firstSelection.totalMoAmount);
if (currentPickNum + totalHvAmount - totalMoAmount > 0.000001) {
uni.showToast({ icon: 'none', title: '本次交接数量+交接数量不允许大于拣配数量!' });
} else if (currentPickNum <= 0) {
uni.showToast({ icon: 'none', title: '本次交接数量应为大于0的数' });
} else {
model.setAccessoryListItemHvAmount({
index: this.model.accessoryList.findIndex((_) => _.checked),
hvAmount: currentPickNum,
});
}
}
});
}
/**
* 上传
*/
onSubmit() {
this.$submitForm.validate(async (valid) => {
if (valid) {
if (model.accessoryList.length === 0) {
uni.showToast({ icon: 'none', title: '没有可用上传的数据!' });
} else {
await auth.checkPassword({
rfPwd: this.submitForm.password,
factoryCode: session.factoryCode as string,
loginName: this.submitForm.receiver,
});
await model.uploadAccessoryList({
operatorPass: this.submitForm.password,
factoryCode: session.factoryCode,
loginName: session.loginName,
dataList: model.accessoryList.map((item) => ({
...pick(['materialCode', 'sapFactoryCode', 'materialDesc', 'unit', 'wkposCode', 'mrpCode', 'sendSpot', 'serialNo'], item),
amount: String(item.amount),
hvAmount: String(item.hvAmount),
totalMoAmount: String(item.totalMoAmount),
totalHvAmount: String(item.totalHvAmount),
prdMaterialDesc: String(item.prdMaterialCode),
})),
includeOrderOutIdList: model.proOrderResultList.map((item: any) => item.orderOutId),
});
this.submitForm.receiver = '';
this.submitForm.receiverName = '';
this.submitForm.password = '';
// uni.navigateBack({ delta: 1 });
model.clearProOrderResultList();
setTimeout(() => {
uni.navigateBack({ delta: 1 });
}, 2000);
}
}
});
}
/**
* 解锁
*/
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) {
uni.showToast({ icon: 'none', title: '解锁失败,详情:' + 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,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,355 @@
<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 = [
{ 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();
}
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.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.aggregating.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,312 @@
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.aggregating',
})
export class AggregatingModule extends VuexModule {
/**
*
*/
proOrderList = [];
param: any;
orderOutIdListParams: any;
SubmitCode: any = '';
/**
*
*/
proOrderResultList = [];
isFormChange: 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 };
}
/**
* -
* @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="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="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.aggregating.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.aggregating.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.aggregating.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="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="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.receiver ? this.submitForm.receiver : 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.aggregating.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>
Loading…
Cancel
Save