suiwei 2 years ago
commit d4fb66b4aa

@ -568,5 +568,10 @@ export default {
HeaderText: '备注',
supplierCode: '供应商编码',
supplierName: '供应商名称',
PickingVn: '拣配-越南',
HandoverVn: '交接-越南',
detail: '详情',
pcNo:'批次号',
stoPcPleaseInput: '请输入批次号',
},
};

@ -570,5 +570,11 @@ export default {
spSo: 'Spare So',
supplierCode: 'supplier code',
supplierName: 'supplier',
PickingVn: 'Picking-Vn',
HandoverVn: 'Handover-Vn',
detail: 'Detail',
pcNo:'Batch No',
stoPcPleaseInput: 'Please input batch No',
},
};

@ -567,5 +567,8 @@ export default {
HeaderText: 'Примечания',
supplierCode: 'Код поставщика',
supplierName: 'Название поставщика',
detail: 'Detail',
pcNo:'Batch No',
stoPcPleaseInput: 'Please input batch No',
},
};

@ -482,6 +482,22 @@
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/handover/picking-vn/index",//
"style": {
"navigationBarTitleText": "拣配",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/handover/aggregating-vn/index",//
"style": {
"navigationBarTitleText": "汇总查询",
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/raw/handover/picking/index",
"style": {
@ -1322,6 +1338,14 @@
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/product/stoOutbound/detail",
"style": {
"navigationBarTitleText": "成品STO出库",//stosto
"navigationStyle": "custom", //
"navigationBarTextStyle": "white" // white-black-
}
},
{
"path": "pages/demo/index",
"style": {

@ -0,0 +1,37 @@
/**
*
*/
import vm from '@/main';
export const headers = [
{
label: vm.$t('message.product_BarCode'),
key: 'barcode',
width: 400,
},
{
label: vm.$t('message.pcNo'),
key: 'pcNo',
width: 400,
},
{
label: vm.$t('message.po_MaterielNo'),
key: 'matCode',
width: 300,
},
{
label: vm.$t('message.po_MaterielDes'),
key: 'matDesc',
width: 400,
},
{
label: vm.$t('message.stoOrderNo'),
key: 'stoNo',
width: 300,
},
{
label: vm.$t('message.stoLine'),
key: 'stoItem',
width: 300,
},
];

@ -0,0 +1,130 @@
<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.Pi_QueryResults') }}</view>
<view class="right"></view>
</view>
<view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" @onCheck='onCheck' show-left-and-right-border :headers="headers" :contents="model.stoBarcodeList" enable-check='single' :show-vert-border="false"></wyb-table>
</view>
<view class="bottom-bar">
<u-row class="button-bar">
<u-col :span="12">
<u-button type="error" @click="Delete">{{ $t('message.product_Delete') }}</u-button>
</u-col>
</u-row>
</view>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import model from './model';
import { headers } from './config';
import { session } from '@/store/modules/session';
@Component
export default class RawReceiptDetail extends BasePage {
model = model;
headers = headers;
seleteData={}
onCheck(data){
this.seleteData=data.data;
}
async Delete(){
console.log("2222ss",this.seleteData)
console.log("1111ss",this.seleteData[0].lineData.barcode)
const barcode = this.seleteData[0].lineData.barcode;
const stoNo = this.seleteData[0].lineData.stoNo;
const stoItem = this.seleteData[0].lineData.stoItem;
if (!this.seleteData) {
this.customToast(this.$t('message.stoPleaseInput') as any);
return;
}
const SunmitList = {
loginName: session.loginName,
factoryCode: session.factoryCode,
stoNo: stoNo,
stoItem: stoItem,
barcode: barcode,
};
await this.model.deleteBarcode(SunmitList);
if (this.model.DeleteCode == 1) {
let index = this.model.stoBarcodeList.findIndex(val=>val.barcode==barcode);
this.model.stoBarcodeList.splice(index,1);
this.seleteData=[];
uni.showToast({
title: this.$t('message.success') as string,
image: '/static/icons/icon-51.png',
});
this.seleteData={};
}
// await this.model.QueryStoDetail
}
}
</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: 162rpx;
.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;
padding-bottom: 2px;
}
.form {
background-color: #fff;
padding: 40rpx;
border-radius: 10rpx;
}
.bottom-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 99;
background: #ffffff;
box-shadow: 0 1rpx 20rpx 0 rgba(128, 128, 128, 0.2);
padding: 20rpx;
}
}
</style>

@ -58,7 +58,7 @@
<!-- 车牌弹窗输入 -->
<view>
<u-modal v-model="showMsg" :title="title" confirmText="confirm" cancelText="cancel" showCancelButton @confirm="Confirm" @cancel="emptyMsg">
<u-modal v-model="showMsg" :title="title" confirmText="confirm" cancelText="cancel" showCancelButton @confirm="ConfirmDo" @cancel="emptyMsg">
<!-- 运输公司 -->
<u-form-item label="Company" borderBottom labelWidth="160">
<u-input v-model="company" placeholder="transportation company"></u-input>
@ -70,6 +70,18 @@
</u-modal>
</view>
<!-- 批次取消弹窗输入 -->
<view>
<u-modal ref="uModal" v-model="showCancel" :title="title" confirmText="confirm" :async-close="true" cancelText="cancel" showCancelButton @confirm="CancelDo" @cancel="emptyMsg">
<!-- 运输公司 -->
<u-form-item label="Batch No" borderBottom labelWidth="160">
<jPicker sureColor="#ff0000" style="width: 260rpx" @bindpicker="SelectPcLine" showKey="pcNo" valKey="pcNo" :val="pcNo" class="search" :options="model.stoPcList" />
<!-- <u-input v-model="pcNo" placeholder="Batch No"></u-input> -->
</u-form-item>
</u-modal>
</view>
<u-toast ref="uToast" />
<!-- 出库库位 -->
<!-- <view class="material">
<view class="material-right">
@ -81,14 +93,20 @@
<!-- 底部按钮 -->
<view class="bottom-bar">
<u-row class="button-bar">
<u-col :span="6">
<u-col :span="3">
<u-button type="primary" @click="Detail">{{ $t('message.detail') }}</u-button>
</u-col>
<u-col :span="3">
<u-button type="primary" @click="Confirm">{{ $t('message.confirm') }}</u-button>
</u-col>
<!-- <u-col :span="4">
<u-button type="primary" @click="Submit">{{ $t('message.Posting') }}</u-button>
</u-col> -->
<u-col :span="6">
<u-button type="error" @click="uni.navigateBack({})">{{ $t('message.po_Return') }}</u-button>
<u-col :span="3">
<u-button type="primary" @click="uni.navigateBack({})">{{ $t('message.po_Return') }}</u-button>
</u-col>
<u-col :span="3">
<u-button type="error" @click="Cancel">{{ $t('message.Cancel') }}</u-button>
</u-col>
</u-row>
</view>
@ -124,8 +142,10 @@ export default class dnReceiptDom extends BasePage {
ItemIndex: any = '';
carNo: any = '';
company: any = '';
pcNo: any = '';
showVehicle = false;
showMsg = false;
showCancel = false;
title = 'Please Enter Msg';
async query() {
@ -133,6 +153,8 @@ export default class dnReceiptDom extends BasePage {
this.company = '';
this.showVehicle = false;
this.showMsg = false;
this.pcNo = '';
this.showCancel = false;
if (!this.stoNo) {
this.customToast(this.$t('message.stoPleaseInput') as any);
return;
@ -154,6 +176,9 @@ export default class dnReceiptDom extends BasePage {
this.ItemIndex = index;
}
});
}
async SelectPcLine(e: any) {
this.pcNo = e.pickerName;
}
//num: any = '';
//SunmitList: any = [];
@ -162,6 +187,7 @@ export default class dnReceiptDom extends BasePage {
this.company = '';
this.showVehicle = false;
this.showMsg = false;
this.showCancel = false;
//
if (!this.stoNo) {
this.customToast(this.$t('message.stoPleaseInput') as any);
@ -191,15 +217,35 @@ export default class dnReceiptDom extends BasePage {
this.barcode = '';
}
}
//
/**
* 详情
*/
async Detail() {
const params = {
factoryCode: session.factoryCode,
loginName: session.loginName,
stoNo: this.stoNo,
};
await this.model.QueryStoDetail(params);
uni.setStorageSync('factory', JSON.stringify(params) as any);
this.toPage(this.page.product.stoOutbound.datile);
}
//
async Confirm() {
if (!this.stoNo) {
this.customToast(this.$t('message.stoPleaseInput') as any);
return;
}
this.showVehicle = true;
this.showMsg = true;
}
//
async ConfirmDo() {
if (!this.stoNo) {
this.customToast(this.$t('message.stoPleaseInput') as any);
return;
}
if (this.carNo == '' || this.company == '') {
this.showVehicle = true;
this.showMsg = true;
return;
}
@ -227,6 +273,62 @@ export default class dnReceiptDom extends BasePage {
this.emptyMsg();
}
}
//
async Cancel() {
console.log("11111111");
if (!this.stoNo) {
//this.customToast(this.$t('message.stoPleaseInput') as any);
return;
}
const SunmitList = {
loginName: session.loginName,
factoryCode: session.factoryCode,
stoNo: this.stoNo,
};
await this.model.QueryPcList(SunmitList);
this.showCancel = true;
}
//
async CancelDo() {
let uModal:any = this.$refs.uModal;
if (!this.pcNo) {
uModal.clearLoading();
let uToast:any = this.$refs.uToast;
uToast.show({
title:this.$t('message.stoPcPleaseInput'),
type: 'warning',
})
// this.customToast(this.$t('message.stoPcPleaseInput') as any);
return;
}
const SunmitList = {
loginName: session.loginName,
factoryCode: session.factoryCode,
stoNo: this.stoNo,
pcNo: this.pcNo.pcNo,
};
this.model.stoCancel(SunmitList);
console.log(this.model.SubCode ,'asd9ass')
if (this.model.CancelCode == 1) {
uni.showToast({
title: this.$t('message.success') as string,
image: '/static/icons/icon-51.png',
});
this.pcNo = '';
//
this.empty();
this.showCancel=false;
} else {
this.pcNo = '';
uModal.clearLoading();
//
// this.emptyMsg();
}
}
//
async Submit() {
if (!this.stoNo) {
@ -260,6 +362,8 @@ export default class dnReceiptDom extends BasePage {
this.company = '';
this.showVehicle = false;
this.showMsg = false;
this.pcNo = '';
this.showCancel=false;
//this.SunmitList = [];
this.model.stoNoList.length = 0;
}
@ -267,6 +371,9 @@ export default class dnReceiptDom extends BasePage {
this.carNo = '';
this.company = '';
this.showMsg = false;
this.pcNo = '';
this.showCancel=false;
console.log("ccccccan");
}
}
</script>

@ -1,13 +1,4 @@
/*
* @Author: zhou lei
* @Date: 2022-10-10 15:40:04
* @LastEditTime: 2022-10-12 11:35:25
* @LastEditors: zhou lei
* @Description:
* @FilePath: \hgwms-factory-app\src\pages\product\STO-Outbound\model.ts
* :910592680@qq.com 18669792120
*/
import { getModule, Module, MutationAction, VuexModule } from 'vuex-module-decorators';
import { getModule,Action, Module, MutationAction, VuexModule } from 'vuex-module-decorators';
import store from '@/store';
import http from '@/utils/request';
import { url } from '@/utils/url';
@ -22,6 +13,8 @@ export class ReceiptModule extends VuexModule {
//越南 STO出库 扫描DN单号
stoNoList: any = [];
stoItemList: any = [];
stoPcList: any = [];
stoBarcodeList: any = [];
res: any = '';
@MutationAction
async QuerySto(stoNo: any) {
@ -85,6 +78,42 @@ export class ReceiptModule extends VuexModule {
const SubCode = res.code;
return { SubCode };
}
//查询sto未过账的批次集合
@MutationAction
async QueryPcList(content: any) {
const res: any = await http.post(url.outbound.stoOutbound.pcListQuery, content);
const stoPcList = res.data;
return {stoPcList};
}
//越南 批次取消
CancelCode: any = '';
@MutationAction
async stoCancel(list: any) {
const res: any = await http.post(url.outbound.stoOutbound.stoCancel, list);
const CancelCode = res.code;
return { CancelCode };
}
//越南 条码删除
DeleteCode: any = '';
@MutationAction
async deleteBarcode(list: any) {
const res: any = await http.post(url.outbound.stoOutbound.stoDelete, list);
const DeleteCode = res.code;
return { DeleteCode };
}
//查询sto扫描条码明细
@MutationAction
async QueryStoDetail(content: any) {
const res: any = await http.post(url.outbound.stoOutbound.stoDetailQuery, content);
const stoBarcodeList = res.data;
return {stoBarcodeList};
}
}
export default getModule(ReceiptModule);

@ -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>

@ -0,0 +1,541 @@
<template>
<view class="page-picking-order">
<view class="header">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
</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.proOrderResultList" :show-vert-border="false" @onCheck="handleRow"> </wyb-table>
</view>
<!-- 列表展示数据 -->
<view class="Exhibition">
<view class="Exhibition-left">
<view class="Exhibition-left-title">{{ $t('message.Pi_Station') }}:</view>
<view class="Exhibition-left-data">{{ some.sendSpot }}</view>
</view>
<view class="Exhibition-right">
<view class="Exhibition-right-title">{{ $t('message.Pi_PickedQuantity') }}:</view>
<view class="Exhibition-right-data">{{ some.totalMoAmount }}</view>
</view>
</view>
<!-- 添加库位 -->
<view class="library">
<view class="library-left">
<view>{{ $t('message.CommissionedLocation') }}:</view>
<jPicker sureColor="#ff0000" style="width: 400rpx" @bindpicker="LocationChoice" showKey="value" valKey="value" :val="wlCode.value" class="search" :options="Location" />
</view>
<view class="library-right">
<view class="library-right-title">{{ $t('message.CommissionedThisNumber') }}:</view>
<u-input v-model="qty" type="number" :border="border" :placeholder="$t('message.Summary_PleaseInputNumber')" class="input" />
<view class="add">
<u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button>
</view>
</view>
</view>
<!-- 添加 -->
<!-- <view class="add">
<u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button>
</view> -->
<!-- 表格 -->
<u-table class="library-table">
<u-tr class="u-tr">
<u-th class="u-th">{{ $t('message.product_Location') }}</u-th>
<u-th class="u-th">{{ $t('message.product_Number') }}</u-th>
<u-th class="u-th">{{ $t('message.operation') }}</u-th>
</u-tr>
<u-tr class="u-tr" v-for="(item, index) in LocationList" :key="index">
<u-td class="u-td">{{ item.wlCode }}</u-td>
<u-td class="u-td">{{ item.qty }}</u-td>
<u-td class="u-td">
<!-- <div class="u-td" @click="deleteItem(index)">
{{ $t('message.product_Delete') }}
</div> -->
<u-button type="error" size="small" style="font-size: 20px" @click="deleteItem(index)">{{ $t('message.product_Delete') }}</u-button>
</u-td>
</u-tr>
</u-table>
<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="bill">{{ $t('message.detailed') }}</u-button>
</u-col>
<u-col :span="4">
<u-button type="success" @click="onSubmit">
{{ $t('message.po_Submit') }}
</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, 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';
@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 = '';
LOCKProOrderResultListParams: any = '';
border = true;
//
LocationList: any = [];
//
Location: any = [];
someIndex = 0;
some: any = {};
qty: any = '';
/**
* 表单数据
*/
form: any = {
// locationCode: null,
amount: null,
};
/**
* 表单校验
*/
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;
}
async handleRow({ data }: any) {
console.log('data[0]', data[0]);
if (!this.model.proOrderResultList[data[0].index].sendSpot) {
uni.showModal({
content: this.$t('message.SAPLocation') as any,
success: (res) => {
if (res.confirm) {
this.model.proOrderResultList[data[0].index].checked = false;
}
},
});
return;
}
this.someIndex = data[0].index;
this.some = data[0].lineData;
this.model.proOrderResultList[this.someIndex].wlList = [];
this.model.proOrderResultList[this.someIndex].currentAmount = 0;
this.LocationList = [];
this.qty = '';
await this.model.queryItemLoc({
workArea: session.workareaCode,
loginName: session.loginName,
sendSpot: null,
materialCode: this.some.materialCode,
factoryCode: session.factoryCode,
});
this.Location = [];
if (this.model.LocList.length == 0) {
uni.showModal({
content: this.$t('message.selected') as any,
showCancel: false,
confirmText: this.$t('message.workArea_Confirm') as any,
});
} else {
this.Location = this.model.LocList;
console.log('this.Location', this.Location);
this.wlCode = this.Location[0];
}
}
Add() {
if (this.qty == '' || this.wlCode == '') {
this.customToast(this.$t('message.Commission_tips2') as any);
return;
}
if (parseFloat(this.qty) <= 0) {
this.customToast(this.$t('message.Commission_tips3') as any);
return;
}
if (JSON.stringify(this.some) == '{}') {
this.customToast(this.$t('message.Commission_tips6') as any);
return;
}
let isTrue = true;
if (this.LocationList.length != 0) {
this.LocationList.forEach((item: any) => {
if (this.wlCode.sendSpot != item.Code || this.wlCode.label === item.wlCode) {
this.customToast(this.$t('message.Commission_tips7') as any);
return (isTrue = false);
}
});
}
if (isTrue == true) {
if (parseFloat(this.qty) + parseFloat(this.some.totalMoAmount) > parseFloat(this.some.amount)) {
uni.showModal({
title: 'Tip',
content: this.$t('message.Pi_tip11') as string,
confirmText: this.$t('message.workArea_Confirm') as string,
cancelText: this.$t('message.Cancel') as string,
showCancel: true,
success: (res) => {
if (res.confirm) {
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.qty = this.qty;
this.model.proOrderResultList[this.someIndex].wlList.push(TEM);
this.model.proOrderResultList[this.someIndex].currentAmount += parseFloat(this.qty);
this.qty = '';
}
},
});
} else {
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.qty = this.qty;
this.model.proOrderResultList[this.someIndex].wlList.push(TEM);
this.model.proOrderResultList[this.someIndex].currentAmount += parseFloat(this.qty);
this.qty = '';
}
}
}
deleteItem(index: any) {
this.LocationList.splice(index, 1);
this.model.proOrderResultList[this.someIndex].wlList.splice(index, 1);
this.business();
}
business() {
let num = 0;
this.LocationList.forEach((item: any) => {
num += parseFloat(item.qty);
});
this.model.proOrderResultList[this.someIndex].currentAmount = num;
}
async onReady() {
await this.onAggregate();
// await this.GetLocation();
}
async bill() {
if (this.some == {} || this.some.prdOrder == null) {
this.customToast(this.$t('message.Commission_tips6') as any);
return;
}
let person = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__') as any);
let content = {
loginName: person.session.user.loginName,
prdOrder: this.some.prdOrder,
};
await this.model.querydetaildlist(content);
this.redirectTo(this.page.raw.handover.picking.Local);
}
/**
* 提交
*/
async onSubmit() {
const dataList: any = [];
this.model.proOrderResultList.forEach((item: any) => {
if (item.checked == true) {
dataList.push(item);
}
});
if (dataList.length == 0) {
this.customToast(this.$t('message.Warehouse_Tip6') as any);
return;
}
await this.model.saveProOrderResultUpload(dataList);
if (this.model.code == '1') {
uni.showToast({
//icon: 'success',
title: this.$t('message.Warehouse_Tip9') as any,
duration: 2000,
image: '/static/icons/icon-51.png',
});
// this.GetLocation();
setTimeout(() => {
this.onAggregate();
}, 2000);
}
}
async onAggregate() {
await this.model.queryProOrder(this.model.formParams);
await this.model.queryProOrderResult(this.model.NEWparams);
if (this.model.proOrderResultList.length == 0) {
this.some = {};
this.LocationList = [];
this.wlCode = '';
return;
}
this.LOCKProOrderResultListParams = this.model.proOrderResultList;
await this.model.lockProOrderResult(this.model.proOrderResultList);
this.some = {};
this.LocationList = [];
this.wlCode = '';
}
async GetLocation() {
this.Location = [];
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);
});
}
beforeDestroy() {
this.unlock();
}
onHide() {
this.unlock();
}
async unlock() {
await this.model.unlockProOrderResult(this.LOCKProOrderResultListParams);
}
}
</script>
<style lang="scss" scoped>
.page-picking-order {
background: #f2f2f2 linear-gradient(0deg, #eee7e7 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: 200rpx;
// display: flex;
display: block;
.library-left {
width: 100%;
height: 100rpx;
padding-left: 36rpx;
// display: flex;
// view {
// width: 230rpx;
// line-height: 100rpx;
// text-align: center;
// }
}
.library-right {
width: 100%;
height: 100rpx;
padding-left: 36rpx;
display: flex;
.library-right-title {
width: 120rpx;
height: 100%;
line-height: 100rpx;
}
.input {
width: 200rpx;
height: 70rpx;
margin-top: 15rpx;
margin-left: 4rpx;
}
.add {
width: 200rpx;
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,526 @@
<template>
<view class="page-picking-order">
<view class="header">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
</view>
<view class="title">{{ $t('message.Pi_SummaryPicking') }}</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.aggregateList" :show-vert-border="false" @onCheck="handleRow"></wyb-table>
</view>
<!-- 展示详细信息 -->
<view class="Exhibition">
<view class="Exhibition-left">
<view class="Exhibition-left-title">{{ $t('message.Pi_Station') }}:</view>
<view class="Exhibition-left-data">{{ some.sendSpot }}</view>
</view>
<view class="Exhibition-right">
<view class="Exhibition-right-title">{{ $t('message.Pi_PickedQuantity') }}:</view>
<view class="Exhibition-right-data">{{ some.totalMoAmount }}</view>
</view>
</view>
<!-- 添加库位 -->
<view class="library">
<view class="library-left">
<view>{{ $t('message.CommissionedLocation') }}:</view>
<jPicker sureColor="#ff0000" style="width: 400rpx" @bindpicker="LocationChoice" showKey="value" valKey="value" :val="wlCode.value" class="search" :options="Location" />
</view>
<view class="library-right">
<view class="library-right-title">{{ $t('message.CommissionedThisNumber') }}:</view>
<u-input v-model="qty" type="number" :border="border" :placeholder="$t('message.Summary_PleaseInputNumber')" class="input" />
<view class="add">
<u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button>
</view>
</view>
</view>
<!-- 添加 -->
<!-- <view class="add">
<u-button type="primary" @click="Add">{{ $t('message.product_add') }}</u-button>
</view> -->
<!-- 表格 -->
<u-table class="library-table">
<u-tr class="u-tr">
<u-th class="u-th">{{ $t('message.product_Location') }}</u-th>
<u-th class="u-th">{{ $t('message.product_Number') }}</u-th>
<u-th class="u-th">{{ $t('message.operation') }}</u-th>
</u-tr>
<u-tr class="u-tr" v-for="(item, index) in LocationList" :key="index">
<u-td class="u-td">{{ item.wlCode }}</u-td>
<u-td class="u-td">{{ item.qty }}</u-td>
<u-td class="u-td">
<u-button type="error" size="small" style="font-size: 20px" @click="deleteItem(index)">{{ $t('message.product_Delete') }}</u-button>
</u-td>
</u-tr>
</u-table>
<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="bill">{{ $t('message.detailed') }}</u-button>
</u-col>
<u-col :span="4">
<u-button type="success" @click="onSubmit">
{{ $t('message.po_Submit') }}
</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, Ref } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import model from './model';
import { summaryHeaders } from './config';
import { session } from '@/store/modules/session';
import { VForm, VFormRules } from 'vue/types/form';
import jPicker from '@/components/J-Picker/jPicker.vue';
@Component({
components: {
jPicker,
},
})
export default class RawReceiptDetail extends BasePage {
@Ref('form') readonly $form!: VForm;
@Ref('submitForm') readonly $submitForm!: VForm;
submitForm = {
receiver: '',
receiverName: '',
password: '',
};
model = model;
type = 'text';
wlCode: any = '';
border = true;
//
LocationList: any = [];
//
Location: any = [];
unLockParams: any = '';
someIndex = 0;
some: any = {};
qty: any = '';
//
form: any = {
// locationCode: null,
amount: null,
};
/**
* 表单校验
*/
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 = summaryHeaders;
//
LocationChoice(e: any) {
console.log('e>>>>>>>>>>>>>>>>>>>>>>>>', e);
this.wlCode = e.pickerName;
}
//
async handleRow({ data }: any) {
if (!this.model.aggregateList[data[0].index].sendSpot) {
uni.showModal({
content: this.$t('message.SAPLocation') as any,
confirmText: this.$t('message.workArea_Confirm') as string,
cancelText: this.$t('message.Cancel') as string,
success: (res) => {
if (res.confirm) {
this.model.aggregateList[data[0].index].checked = false;
}
},
});
return;
}
this.someIndex = data[0].index;
this.some = data[0].lineData;
this.model.aggregateList[this.someIndex].wlList = [];
this.model.aggregateList[this.someIndex].currentAmount = 0;
this.LocationList = [];
this.qty = '';
await this.model.queryItemLoc({
workArea: session.workareaCode,
loginName: session.loginName,
sendSpot: null,
materialCode: this.some.materialCode,
factoryCode: session.factoryCode,
});
this.Location = [];
if (this.model.LocList.length == 0) {
uni.showModal({
content: this.$t('message.selected') as any,
showCancel: false,
confirmText: this.$t('message.workArea_Confirm') as any,
});
} else {
this.Location = this.model.LocList;
console.log('this.Location', this.Location);
this.wlCode = this.Location[0];
}
}
Add() {
if (this.qty == '' || this.wlCode == '') {
this.customToast(this.$t('message.Commission_tips2') as any);
return;
}
if (parseFloat(this.qty) <= 0) {
this.customToast(this.$t('message.Commission_tips3') as any);
return;
}
if (JSON.stringify(this.some) == '{}') {
this.customToast(this.$t('message.Commission_tips6') as any);
return;
}
let isTrue = true;
if (this.LocationList.length != 0) {
this.LocationList.forEach((item: any) => {
if (this.wlCode.sendSpot != item.Code) {
this.customToast(this.$t('message.Commission_tips7') as any);
return (isTrue = false);
}
});
}
if (isTrue == true) {
if (parseFloat(this.qty) + parseFloat(this.some.totalMoAmount) > parseFloat(this.some.amount)) {
uni.showModal({
title: 'Tip',
content: this.$t('message.Pi_tip11') as string,
confirmText: this.$t('message.workArea_Confirm') as string,
cancelText: this.$t('message.Cancel') as string,
showCancel: true,
success: (res) => {
if (res.confirm) {
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.qty = this.qty;
this.model.aggregateList[this.someIndex].wlList.push(TEM);
this.model.aggregateList[this.someIndex].currentAmount += parseFloat(this.qty);
this.qty = '';
}
},
});
} else {
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.qty = this.qty;
this.model.aggregateList[this.someIndex].wlList.push(TEM);
this.model.aggregateList[this.someIndex].currentAmount += parseFloat(this.qty);
this.qty = '';
}
}
}
//
deleteItem(index: any) {
this.LocationList.splice(index, 1);
this.model.aggregateList[this.someIndex].wlList.splice(index, 1);
this.business();
}
//
business() {
let num = 0;
this.LocationList.forEach((item: any) => {
num += parseFloat(item.qty);
});
this.model.aggregateList[this.someIndex].currentAmount = num;
}
async onReady() {
await this.onAggregate();
// await this.GetLocation();
}
async bill() {
this.redirectTo(this.page.raw.handover.picking.SummaryLocal);
}
//
async onSubmit() {
const includeOrderOutIdList = this.model.proOrderResultList.map((_: any) => _.orderOutId);
const dataList: any = [];
this.model.aggregateList.forEach((item: any) => {
if (item.checked == true) {
dataList.push(item);
}
});
if (dataList.length == 0) {
this.customToast(this.$t('message.Warehouse_Tip6') as any);
return;
}
const params = {
factoryCode: session.factoryCode,
loginName: session.loginName,
dataList,
includeOrderOutIdList,
};
await this.model.saveAggregateUpload(params);
if (this.model.code == '1') {
uni.showToast({
duration: 2000,
title: this.$t('message.Warehouse_Tip9') as string,
image: '/static/icons/icon-51.png',
});
setTimeout(() => {
this.onAggregate();
}, 2000);
}
}
async onAggregate() {
await this.model.queryProOrder(this.model.formParams);
await this.model.queryProOrderResult(this.model.NEWparams);
const orderOutIdList = this.model.proOrderResultList.map((_: any) => _.orderOutId);
const params = {
factoryCode: session.factoryCode,
loginName: session.loginName,
orderOutIdList,
};
this.unLockParams = params;
await this.model.queryAggregateList(params);
this.some = {};
this.LocationList = [];
this.wlCode = '';
}
async GetLocation() {
this.Location = [];
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);
});
}
beforeDestroy() {
this.unlock();
}
onHide() {
this.unlock();
}
async unlock() {
await this.model.unlockAggregateResult(this.unLockParams);
}
}
</script>
<style lang="scss" scoped>
.page-picking-order {
background: #f2f2f2 linear-gradient(0deg, #eee7e7 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: left;
line-height: 100rpx;
}
.Exhibition-right-data {
width: 50%;
height: 100%;
text-align: center;
line-height: 100rpx;
}
}
}
.library {
width: 100%;
height: 200rpx;
// display: flex;
display: block;
.library-left {
width: 100%;
height: 100rpx;
padding-left: 36rpx;
// display: flex;
// view {
// width: 230rpx;
// line-height: 100rpx;
// text-align: center;
// }
}
.library-right {
width: 100%;
height: 100rpx;
padding-left: 36rpx;
display: flex;
.library-right-title {
width: 120rpx;
height: 100%;
line-height: 100rpx;
}
.input {
width: 200rpx;
height: 70rpx;
margin-top: 15rpx;
margin-left: 4rpx;
}
.add {
width: 200rpx;
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,74 @@
<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.Pi_QueryResults') }}</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.detailedList" :show-vert-border="false"></wyb-table>
</view>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import { Headers } from './config';
import model from './model';
@Component
export default class RawReceiptDetail extends BasePage {
model = model;
headers = Headers;
}
</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: 162rpx;
.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;
}
}
</style>

@ -0,0 +1,114 @@
<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.Pi_QueryResults') }}</view>
<view class="right"></view>
</view>
<u-form class="form" ref="form" style="padding-left: 30px" label-width="180rpx">
<u-form-item :label="$t('message.Pi_OrderNo')">
<u-input v-model="prdOrder" placeholder="" class="Transfer" />
<u-button type="primary" style="height: 60rpx; margin-left: 20rpx" @click="generate">{{ $t('message.Query') }}</u-button>
</u-form-item>
</u-form>
<view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border :headers="headers" :contents="detailedList" :show-vert-border="false"></wyb-table>
</view>
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import { Headers } from './config';
import model from './model';
@Component
export default class RawReceiptDetail extends BasePage {
model = model;
headers = Headers;
prdOrder: any = '';
detailedList: any = [];
onShow() {
model.detailedList = [];
}
async generate() {
if (this.prdOrder == '') {
this.customToast(this.$t('message._tips6') as any);
return;
}
let person = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__') as any);
let content = {
loginName: person.session.user.loginName,
prdOrder: this.prdOrder,
};
await this.model.querydetaildlist(content);
this.detailedList = this.model.detailedList;
}
}
</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: 162rpx;
.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;
}
}
.form {
background-color: #fff;
// padding: 40rpx;
border-radius: 10rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
.u-form-item {
// padding: 30rpx 0;
line-height: 35rpx;
.Transfer {
width: 180rpx;
height: 64rpx;
background: rgb(242, 242, 242);
border-radius: 110rpx;
}
}
}
.table-wrapper {
background-color: #fff;
}
.form {
background-color: #fff;
// padding: 40rpx;
border-radius: 10rpx;
}
}
</style>

@ -0,0 +1,287 @@
/**
*
*/
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_factory'),
key: 'sapFactoryCode',
},
{
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: 'prdMaterialDesc',
// width: 300,
// },
{
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.po_DemandQuantity'),
key: 'amount',
},
{
label: vm.$t('message.shortage'),
key: 'differences',
},
{
label: vm.$t('message.Pi_CurrentPickingQuantity'),
key: 'currentAmount',
width: 300,
},
{
label: vm.$t('message.Pi_PickedQuantity'),
key: 'totalMoAmount',
},
{
label: vm.$t('message.Pi_QuantityHandedOver'),
key: 'totalHvAmount',
},
{
label: vm.$t('message.po_Location'),
// key: 'currentWkposCode',
key: 'wkposCode',
},
{
label: vm.$t('message.po_MaterielDes'),
key: 'materialDesc',
width: 350,
},
{
label: vm.$t('message.Pi_unit'),
key: 'unit',
},
{
label: vm.$t('message.target'),
key: 'sendSpot',
// width: 300,
},
// {
// label: '工位',
// key: 'sendSpot',
// },
// {
// label: '工厂',
// key: 'sapFactoryCode',
// },
];
/**
*
*/
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.shortage'),
key: 'differences',
},
{
label: vm.$t('message.Pi_CurrentPickingQuantity'),
key: 'currentAmount',
width: 300,
},
{
label: vm.$t('message.Pi_PickedQuantity'),
key: 'totalMoAmount',
},
{
label: vm.$t('message.Pi_QuantityHandedOver'),
key: 'totalHvAmount',
},
{
label: vm.$t('message.target'),
// key: 'currentWkposCode',
//key: 'wkposCode',
key: 'sendSpot',
},
{
label: vm.$t('message.po_MaterielDes'),
key: 'materialDesc',
width: 350,
},
{
label: vm.$t('message.Pi_unit'),
key: 'unit',
},
{
label: vm.$t('message.Pi_FinishedProductModel'),
key: 'prdMaterialDesc',
width: 300,
},
{
label: vm.$t('message.Pi_factory'),
key: 'sapFactoryCode',
},
{
label: vm.$t('message.Pi_Station'),
//key: 'sendSpot',
key: 'wkposCode',
},
{
label: vm.$t('message.Pi_OrderNo'),
key: 'prdOrder',
},
{
label: vm.$t('message.product_FGCode'),
key: 'prodCode', //成品编码
},
{
label: vm.$t('message.Pi_FinishedProductModel'),
key: 'prodDesc', //成品型号
width: 300,
},
];
export const Headers = [
{
label: vm.$t('message.po_MaterielNo'),
key: 'materialCode',
width: 220,
},
{
label: vm.$t('message.po_DemandQuantity'),
key: 'amount',
},
{
label: vm.$t('message.Pi_CurrentPickingQuantity'),
key: 'operatorAmount', //本次拣配数量
width: 300,
},
{
label: vm.$t('message.po_Location'),
// key: 'currentWkposCode',
key: 'originLocation',
},
{
label: vm.$t('message.po_MaterielDes'),
key: 'materialDesc',
width: 350,
},
{
label: vm.$t('message.Pi_unit'),
key: 'unit',
},
{
label: vm.$t('message.Pi_factory'),
key: 'sapFactoryCode',
},
{
label: vm.$t('message.Pi_Station'),
key: 'sendSpot',
},
{
label: vm.$t('message.Pi_OrderNo'),
key: 'prdOrder',
},
{
label: vm.$t('message.CommissionedLocation'),
key: 'wlCode',
},
];

@ -0,0 +1,356 @@
<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.product_Location') }}</view>
<view class="right"></view>
</view>
<div class="content">
<div class="content-item">
<div class="item-left">{{ $t('message.po_MaterielNo') }}</div>
<div class="item-right">{{ material.materialCode }}</div>
</div>
<div class="content-item">
<div class="item-left">{{ $t('message.po_MaterielDes') }}</div>
<div class="item-right">{{ material.materialDesc }}</div>
</div>
<div class="content-item">
<div class="item-left">{{ $t('message.po_DemandQuantity') }}</div>
<div class="item-right">{{ material.amount }}</div>
</div>
<div class="content-item">
<div class="item-left">{{ $t('message.po_ActualQuantity') }}</div>
<div class="item-right">{{ material.currentAmount }}</div>
</div>
<div class="content-item">
<div class="item-left">{{ $t('message.po_Location') }}</div>
<div class="item-right">{{ material.location }}</div>
</div>
</div>
<div class="library">
<div class="title">{{ $t('message.product_Location') }}:</div>
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="wlCode" class="search" :options="list" />
</div>
<div class="library-num">
<div class="title">{{ $t('message.dn_Number') }}:</div>
<input type="text" placeholder="请输入数量" v-model="number" />
<u-button type="primary" size="medium" class="confirm" @click="confirm">{{ $t('message.product_add') }}</u-button>
</div>
<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.value.value }}</u-td>
<u-td class="u-td">{{ item.num }}</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-row class="bottom-info">
<u-button type="primary" class="main" @click="Reservoir">{{ $t('message.product_Confirm') }}</u-button>
<u-col :span="2" v-if="factoryCode == '6662'"> { {$t('message.product_Location')}} </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 { headers } from './config';
import jPicker from '@/components/J-Picker/jPicker.vue';
import { session } from '@/store/modules/session';
import combox from '@/components/J-Picker/jPicker.vue';
// @Component
@Component({
components: {
jPicker,
combox,
},
})
export default class RawReceiptDetail extends BasePage {
model = model;
factoryCode = session.factoryCode;
locationCode = '';
number = '';
wlCode: any = '';
material: any = {};
list: any = [];
LocationList: any = [];
documentNo: any = '';
headers = headers;
async onReady() {
let content = {
loginName: session.loginName,
sendSpot: null,
factoryCode: session.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.list.push(pickerName);
});
let ant: any = uni.getStorageSync('mater');
this.material = JSON.parse(ant);
console.log('this.material', this.material);
this.number = this.material.amount;
uni.removeStorageSync('mater');
if ('wlList' in this.material) {
this.material.wlList.forEach((item: any) => {
let arr: any = {
value: item.wlCode,
};
let obj: any = {
value: arr,
num: item.qty,
};
this.LocationList.push(obj as never);
});
}
}
confirm() {
if (this.wlCode == '' || this.number == '') {
uni.showToast({
icon: 'none',
title: '请输入正确的库位和数量',
});
return;
}
if (parseFloat(this.number) <= 0) {
uni.showToast({
icon: 'none',
title: '请输入正确的库位和数量',
});
return;
}
if (this.LocationList.length != 0) {
this.LocationList.forEach((item: any) => {
if (item.value.sendSpot != this.wlCode.sendSpot) {
uni.showToast({
icon: 'none',
title: '请重新选择库位',
});
return;
}
});
let num = 0;
this.LocationList.forEach((item: any) => {
num += parseFloat(item.num);
});
num += parseFloat(this.number);
if (num > parseFloat(this.material.amount)) {
uni.showToast({
icon: 'none',
title: '实际数量不能大于需求数量',
});
return;
}
let arr: any = {
value: this.wlCode,
num: this.number,
};
this.LocationList.push(arr as never);
this.material.currentAmount = num;
this.number = '';
return;
}
if (this.LocationList.length == 0) {
if (this.number > this.material.amount) {
uni.showToast({
icon: 'none',
title: '实际数量不能大于需求数量',
});
return;
}
let arr: any = {
value: this.wlCode,
num: this.number,
};
this.LocationList.push(arr as never);
this.material.currentAmount = this.number;
this.number = '';
return;
}
}
deleteItem(index: any) {
this.LocationList.splice(index, 1);
}
bookTypeChange(e: any) {
this.wlCode = e.pickerName;
}
Reservoir() {
let wlList: Array<string> = [];
let currentAmount = 0;
this.LocationList.forEach((item: any) => {
let objString = JSON.stringify(this.material);
let TEM = JSON.parse(objString);
TEM.wlCode = item.value.label;
TEM.qty = item.num;
wlList.push(TEM);
let pras = parseInt(item.num);
currentAmount += pras;
});
this.material.wlList = wlList;
this.material.currentAmount = currentAmount;
uni.setStorageSync('material', JSON.stringify(this.material));
this.redirectTo(this.page.raw.handover.picking.order);
}
}
</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;
.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;
}
}
.content {
width: 100%;
height: 500rpx;
.content-item {
width: 100%;
height: 100rpx;
display: flex;
text-align: center;
line-height: 100rpx;
background-color: white;
.item-left {
width: 30%;
}
.item-right {
width: 70%;
}
}
}
.library {
height: 60rpx;
position: relative;
padding-bottom: 10rpx;
.search {
position: absolute;
width: 80%;
right: 38rpx;
top: 15rpx;
height: 60rpx;
background-color: white;
}
.title {
width: 20%;
height: 100%;
text-align: left;
position: absolute;
line-height: 50rpx;
top: 15rpx;
left: 0;
}
}
.library-num {
position: relative;
margin-top: 15rpx;
.title {
width: 100rpx;
height: 100%;
line-height: 50rpx;
}
input {
display: block;
width: 40%;
padding: 10rpx;
position: absolute;
left: 100rpx;
top: 0;
background-color: white;
}
.confirm {
position: absolute;
top: 0;
right: 20rpx;
margin-left: 30rpx;
}
}
.library-table {
margin-top: 30rpx;
}
.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 {
margin: 5px;
border-radius: 5px;
padding: 0 10px;
.main {
margin-right: 0;
}
}
}
}
</style>

@ -0,0 +1,326 @@
<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.Pi_PickingQuery') }}</view>
<view class="right"></view>
</view>
<u-form class="form" ref="form" :model="form" :error-type="['toast']" label-width="120rpx">
<u-row align="top">
<u-col :span="12">
<!-- MRP -->
<u-form-item :required="mrpFlag" label="MRP" prop="mrpCodeRegion">
<u-input v-model="form.mrpCodeRegion" :border="border" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
<!-- 订单号 -->
<u-form-item :label="$t('message.Pi_OrderNo')">
<u-input v-model="form.prdOrderFrom" :border="border" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
<!-- 工厂 -->
<u-form-item :required="true" :label="$t('message.Pi_factory')" prop="sapFactoryCode">
<u-input v-model="form.sapFactoryCode" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
<!-- 物料号 -->
<u-form-item :label="$t('message.Pi_materielNo')">
<u-input v-model="form.materialCodeList" :border="border" style="padding-left: 14px" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
<!-- 时间 -->
<view style="display: flex">
<u-field style="background: white; border-radius: 10rpx; padding-left: 0" v-model="form.requireDateRegion" :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">
<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 { VForm } from 'vue/types/form';
import model from './model';
import { headers } from './config';
import http from '@/utils/request';
import { url } from '@/utils/url';
import { session } from '@/store/modules/session';
@Component
export default class pickingDom extends BasePage {
/**
* 表单引用
*/
@Ref('form') readonly $form!: VForm;
@Watch('form', { immediate: true, deep: true })
onPersonChanged() {
this.isFormChange = true;
}
/**
* 页面Module
*/
model = model;
border = true;
/**
* 表头
*/
headers = headers;
startShow = false;
/**
* 表单数据
*/
form = {
mrpCodeRegion: '',
mrpCodeIncludeList: '',
mrpCodeExcludeList: '',
prdOrderFrom: '',
prdOrderTo: '',
sapFactoryCode: '',
wkposCode: '',
batchNumberList: '',
materialCodeList: '',
sendSpotList: '',
requireDateRegion: '',
};
startParams = {
year: true,
month: true,
day: true,
hour: false,
minute: false,
second: false,
};
/**
* 表单是否改变
*/
isFormChange = false;
/**
* 9a61跟9a62设置成非必填
*/
mrpFlag = true;
/**
* 选择项显示
*/
requireDateRegionSelect = false;
productDateRegionSelect = false;
/**
* 表单校验
*/
rules = {
mrpCodeRegion: [{ required: true, message: this.$t('message.Pi_InputMrp') as string }],
sapFactoryCode: [{ required: true, message: this.$t('message.Pi_InputFactory') as string }],
};
mrpRules = {
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.mrpCodeIncludeList) {
params.mrpCodeIncludeList = this.form.mrpCodeIncludeList.split(',');
} else {
delete params.mrpCodeIncludeList;
}
if (this.form.mrpCodeExcludeList) {
params.mrpCodeExcludeList = this.form.mrpCodeExcludeList.split(',');
} else {
delete params.mrpCodeExcludeList;
}
if (this.form.sendSpotList) {
params.sendSpotList = this.form.sendSpotList.split(',');
} else {
delete params.sendSpotList;
}
if (this.form.requireDateRegion) {
params.requireDateRegion = this.form.requireDateRegion.split('-').join('').toString();
} else {
delete params.sendSpotList;
}
return params;
}
// onReadyonLoad
onReady() {
if (session.factoryCode == '9A61' || session.factoryCode == '9A62') {
this.mrpFlag = false;
this.$form.setRules(this.mrpRules);
} else {
this.mrpFlag = true;
this.$form.setRules(this.rules);
}
model.clearProOrderList();
this.form.sapFactoryCode = session.factoryCode;
//this.form.requireDateRegion = this.getNowFormatDate();
}
// 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.requireDateRegion = startParams.year + '-' + startParams.month + '-' + startParams.day;
}
/**
* 确认
*/
async onOk() {
let orderOutIdList = [];
if (this.isFormChange || this.model.proOrderList.length === 0) {
const { list: proOrderList }: any = await http.post(url.sortscan.query.prdorder, this.formParams);
orderOutIdList = proOrderList.map((_: any) => _.orderOutId);
} else {
orderOutIdList = this.model.checkedProOrderList.map((_: any) => _.orderOutId);
}
if (orderOutIdList.length === 0 && this.model.proOrderList.length > 0) {
this.customToast(this.$t('message.Pi_OrderNoNotSelected') as string);
return;
} else if (orderOutIdList.length === 0) {
this.customToast(this.$t('message.Pi_NoDataFound') as string);
return;
}
const params = {
sapFactoryCode: this.form.sapFactoryCode,
factoryCode: session.factoryCode,
loginName: session.loginName,
orderOutIdList,
};
this.model.NEWparams = params;
await this.model.queryProOrderResult(params);
uni.setStorageSync('factory', JSON.stringify(params) as any);
this.toPage(this.page.raw.handover.picking.result);
}
/**
* 订单查询
*/
onQuery() {
this.$form.validate(async (valid: boolean) => {
if (!valid) return;
await this.model.queryProOrder(this.formParams);
this.model.checkAllProOrderList(true);
this.isFormChange = false;
model.mrpCodeRegion = this.form.mrpCodeRegion as any;
model.sapFactoryCode = this.form.sapFactoryCode as any;
model.formParams = 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;
}
}
.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: 30rpx 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;
}
}
</style>

@ -0,0 +1,410 @@
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 { session } from '@/store/modules/session';
import vm from '@/main';
@Module({
namespaced: true,
dynamic: true,
store,
name: 'raw.handover.picking',
})
export class PickingModule extends VuexModule {
/**
*
*/
proOrderList: any[] = [];
detailedList: any;
mrpCodeRegion: '';
sapFactoryCode: '';
formParams: '';
code = '';
orderOutIdList: any;
NEWparams: any;
LocList: any = [];
lockCode: any = '';
/**
*
*/
proOrderResultList: any[] = [];
/**
*
*/
aggregateList: 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);
}
/**
*
*/
get isAggregateCheckedAll() {
return !this.aggregateList.filter((_: any) => !_.checked).length;
}
/**
*
*/
get hasAggregateChecked() {
return this.checkedAggregateList.length > 0;
}
/**
*
*/
get checkedAggregateList() {
return this.aggregateList.filter((_: any) => _.checked);
}
/**
*
*/
get hasAggregateCurrentAmount() {
return this.aggregateList.findIndex((_: any) => _.currentAmount) > -1;
}
/**
*
*/
get aggregateUploadList() {
return this.aggregateList.map((item: any) => {
if (!item.checked) {
item.currentAmount = 0;
}
return item;
});
}
/**
*
*/
get isProOrderResultCheckedAll() {
return !this.proOrderResultList.filter((_: any) => !_.checked).length;
}
/**
*
*/
get hasProOrderResultChecked() {
return this.checkedProOrderResultList.length > 0;
}
/**
*
*/
get checkedProOrderResultList() {
return this.proOrderResultList.filter((_: any) => _.checked);
}
/**
*
*/
get hasProOrderResultCurrentAmount() {
return this.proOrderResultList.findIndex((_: any) => _.currentAmount) > -1;
}
/**
*
*/
get proOrderResultUploadList() {
return this.proOrderResultList.map((item: any) => {
if (!item.checked) {
item.currentAmount = 0;
}
return item;
});
}
/**
*
*/
@Mutation
clearState() {
this.proOrderList = [];
this.proOrderResultList = [];
this.aggregateList = [];
}
/**
*
*/
@Mutation
clearProOrderList() {
this.proOrderList = [];
}
/**
* /
* @param checked
*/
@Mutation
checkAllProOrderList(checked: boolean) {
this.proOrderList = this.proOrderList.map((item: any) => ({
...item,
checked,
}));
}
/**
* /
* @param checked
*/
@Mutation
checkAllAggregateList(checked: boolean) {
this.aggregateList = this.aggregateList.map((item: any) => ({
...item,
checked,
}));
}
/**
*
* @param params
*/
@Mutation
confirmCheckedAggregateList(params: { locationCode: string; amount: number }) {
this.aggregateList
.filter((_: any) => _.checked)
.forEach((item: any) => {
if (params.locationCode) {
item.currentWkposCode = params.locationCode;
}
if (params.amount) {
item.currentAmount = params.amount;
}
});
}
/**
* /
* @param checked
*/
@Mutation
checkAllProOrderResultList(checked: boolean) {
this.proOrderResultList = this.proOrderResultList.map((item: any) => ({
...item,
checked,
}));
}
/**
*
* @param params
*/
@Mutation
confirmCheckedProOrderResultList(params: { amount: number }) {
this.proOrderResultList
.filter((_: any) => _.checked)
.forEach((item: any) => {
// if (params.locationCode) {
// item.currentWkposCode = params.locationCode;
// }
if (params.amount) {
item.currentAmount = params.amount;
}
});
}
/**
*
* @param params
*/
@MutationAction
async queryProOrder(params: any) {
const { list: proOrderList }: any = await http.post(url.sortscan.query.prdorder, params);
if (!proOrderList.length) {
// uni.showToast({
// icon: 'none',
// title: 'No Data Found',
// });
vm.customToast(vm.$t('message.Pi_NoDataFound') as any);
}
return { proOrderList };
}
@MutationAction
async queryOrder() {
const { list: proOrderList }: any = await http.post(url.sortscan.query.prdorder, this.formParams);
if (!proOrderList.length) {
// uni.showToast({
// icon: 'none',
// title: 'No Data Found',
// });
vm.customToast(vm.$t('message.Pi_NoDataFound') as any);
}
return { proOrderList };
}
/**
*
* @param params
*/
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
async queryStockList(params: any) {
const res: any = await http.post('/material/queryOdsRawStorageNews', params);
return res;
}
/**
*
* @param params
*/
@MutationAction
async queryProOrderResult(params: any) {
const { list: proOrderResultList }: any = await http.post(url.sortscan.query.prdorderList, params);
proOrderResultList.forEach((item: any) => {
(item.loginName = params.loginName), (item.differences = parseFloat(item.amount) - parseFloat(item.totalMoAmount));
});
return { proOrderResultList };
}
/**
* -
* @param params
*/
@MutationAction
async queryAggregateList(params: any) {
const { list: aggregateList }: any = await http.post(url.sortscan.query.aggregateList, params);
if (!aggregateList.length) {
// uni.showToast({
// icon: 'none',
// title: 'No Data Found',
// });
// vm.customToast(vm.$t('message.Pi_NoDataFound') as any);
return;
}
aggregateList.forEach((item: any) => {
(item.loginName = params.loginName), (item.differences = parseFloat(item.amount) - parseFloat(item.totalMoAmount));
});
return { aggregateList };
}
/**
* url.auth.locations listvalues item string
*/
@MutationAction
async queryLocationList() {
const params = {
factoryCode: session.factoryCode,
loginName: session.loginName,
};
const { values }: any = await http.post(url.auth.locations, params);
const locationList = values.map((value: string) => ({
label: value,
value,
}));
return { locationList };
}
@MutationAction
async lock(params: any) {
const res: any = await http.post(url.sortscan.lock.list, params);
const lockCode = res.code;
return { lockCode };
}
/**
*
*/
// @Action({ commit: 'clearState' })
@MutationAction
async saveAggregateUpload(params: any) {
const res: any = await http.post(url.sortscan.save.aggregate, params);
console.log('res', res);
const code = res.code;
return { code };
}
/**
*
*/
// @Action({ commit: 'clearState' })
@MutationAction
async saveProOrderResultUpload(dataList: any[]) {
const res: any = await http.post(url.sortscan.save.order, dataList);
const code = res.code;
console.log('code', code);
return { code };
}
@MutationAction
async queryItemLoc(params: any = {}) {
const res: any = await http.post(url.sortscan.save.queryWlByMat, params);
const LocList = [];
res.forEach((item: any) => {
const arr: any = {
label: item.locationCode,
value: item.locationCode + '(' + item.sendSpot + ')' + '(' + item.amount + ')',
};
LocList.push(arr);
});
console.log('res', res);
console.log('LocList', LocList);
return { LocList };
}
/**
*
* @param list
*/
@Action
async unlockProOrderResult(list: any[]) {
try {
await http.post(url.sortscan.unlock.list, list, {
custom: { hideError: true },
} as any);
} catch {
//
}
}
@Action
async unlockAggregateResult(params: any) {
try {
await http.post(url.sortscan.unlock.aggregateList, params);
} catch {
//
}
}
/**
*
* @param list
*/
@Action
async lockProOrderResult(list: any[]) {
await http.post(url.sortscan.lock.list, list);
}
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
async queryByFactoryCodeAndWorkAreaCode(content: any) {
const res = await http.post('/wmspda/fg/queryByFactoryCodeAndWorkAreaCode', content);
return res;
}
//查询拣配明细
@Action({ commit: 'updateCheckedOrderInInfoListKw' })
async querydetaildlist(content: any) {
const res: any = await http.post('/wmspda/sortscan/getJhListSn', content);
this.detailedList = res.list;
console.log(this.detailedList);
return res;
}
}
export default getModule(PickingModule);

@ -0,0 +1,329 @@
<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="multiple" show-left-and-right-border :headers="headers" :contents="model.proOrderResultList" :show-vert-border="false"></wyb-table>
</view>
<view class="bottom-bar">
<div class="extra">
<u-form ref="form" :model="form" :error-type="['toast']">
<u-row class="bottom-info">
<!-- <u-col :span="12"
>{{ $t('message.po_Total') }} {{ model.aggregateList.length }}
{{ $t('message.po_Records') }}</u-col
> -->
<!-- <u-col :span="6">
<u-form-item
prop="locationCode"
:label="this.$t('message.po_Location')"
label-width="120rpx"
>
<u-input
:placeholder="this.$t('message.po_PleaseInput')"
v-model="form.locationCode"
type="select"
@click="locationCodeSelect = true"
/>
<u-select
v-model="locationCodeSelect"
:list="model.locationList"
@confirm="(v) => (form.locationCode = v[0].value)"
></u-select>
</u-form-item>
</u-col> -->
<!-- <u-col :span="12">
<u-form-item prop="amount" :label="this.$t('message.dn_Number')">
<u-input
v-model="form.amount"
type="number"
:placeholder="this.$t('message.po_PleaseInput')"
/>
</u-form-item>
</u-col> -->
</u-row>
</u-form>
</div>
<div class="container">
<u-row>
<u-col :span="3">
<u-button type="primary" @click="model.checkAllProOrderResultList(!model.isProOrderResultCheckedAll)">
{{ model.isAggregateCheckedAll ? $t('message.po_noSelectAll') : $t('message.po_SelectAll') }}
</u-button>
</u-col>
<u-col :span="3">
<u-button type="primary" class="appoint" @click="appoint">{{ $t('message.Pi_distribution') }}</u-button>
</u-col>
<u-col :span="3">
<u-button type="success" @click="onSubmit">
{{ $t('message.dn_Confirm') }}
</u-button>
</u-col>
<u-col :span="3">
<u-button type="error" @click="onUpload">
{{ $t('message.po_Submit') }}
</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 { VForm, VFormRules } from 'vue/types/form';
@Component
export default class RawReceiptDetail extends BasePage {
/**
* 表单引用
*/
@Ref('form') readonly $form!: VForm;
/**
* 页面Module
*/
model = model;
/**
* 表单数据
*/
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;
// onReadyonLoad
onShow() {
this.model.queryLocationList();
this.model.proOrderResultList.forEach((item: any) => {
item.currentAmount = 0;
});
let ant: any = JSON.parse(uni.getStorageSync('material') as string);
let index: any = JSON.parse(uni.getStorageSync('index') as string);
this.model.proOrderResultList[index] = ant;
uni.removeStorageSync('material');
uni.removeStorageSync('index');
}
appoint() {
let selectStatus = model.proOrderResultList.map((item) => {
if (item.checked == true) {
return true;
} else {
return false;
}
});
let i = 0;
selectStatus.forEach((item) => {
if (item == true) {
i++;
}
});
if (i > 1) {
uni.showToast({
icon: 'none',
title: '只能选择一条物料' as string,
});
} else if (i == 0) {
uni.showToast({
icon: 'none',
title: this.$t('message.AppendMateriel5') as string,
});
} else {
let mater: number = selectStatus.indexOf(true);
uni.setStorageSync('mater', JSON.stringify(model.proOrderResultList[mater]) as string);
uni.setStorageSync('index', JSON.stringify(mater) as string);
this.toPage(this.page.raw.handover.picking.idetailed);
}
}
/**
* 上传
*/
async onUpload() {
//
if (this.model.proOrderResultUploadList.length === 0) {
uni.showToast({
icon: 'none',
title: this.$t('message.Pi_tip4') as string,
});
return;
}
//
let checkData: any = [];
this.model.proOrderResultUploadList.forEach((item: any) => {
if (item.checked === true) {
checkData.push(item);
}
});
//
if (checkData.length == 0) {
uni.showToast({
icon: 'none',
title: '请先选中要提交的数据' as string,
});
return;
}
//
checkData.forEach((item: any) => {
if (item.wlList == null || item.wlList.length == 0) {
uni.showToast({
icon: 'none',
title: '请确保所选数据都已分配库位' as string,
});
return;
}
});
await this.model.saveProOrderResultUpload(checkData);
}
/**
* 提交
*/
async onSubmit() {
if (!this.model.hasProOrderResultChecked) {
uni.showToast({
icon: 'none',
title: this.$t('message.Pi_tip7') as string,
});
return;
}
this.$form.validate((valid) => {
if (!valid) return;
const list = this.model.checkedProOrderResultList;
const needLocationCode = list.findIndex((_: any) => !_.currentWkposCode) > -1;
console.log('needLocationCode', needLocationCode);
// if (needLocationCode && !this.form.locationCode) {
// uni.showToast({ icon: 'none', title: this.$t('message.Pi_tip6') as string });
// return;
// }
const amount = Number(this.form.amount);
if (amount <= 0 || amount.toString().split('.')[1].length > 3) {
uni.showToast({
icon: 'none',
title: this.$t('message.Pi_tip2') as string,
});
return;
}
for (const item of list) {
if (amount + item.totalMoAmount > item.amount) {
uni.showToast({
icon: 'none',
title: this.$t('message.Pi_tip6') as string,
});
return;
}
}
// const locationCode = this.form.locationCode;
this.model.confirmCheckedProOrderResultList({ amount });
});
}
}
</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;
}
.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,208 @@
<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.Inventory_query') }}</view>
<view class="right"></view>
</view>
<div class="library-num">
<div class="label">
<div class="title">{{ $t('message.po_MaterielNo') }}</div>
<input type="text" placeholder="请输入" v-model="params.materialCode" />
</div>
<div class="label">
<div class="title">{{ $t('message.product_Location') }}</div>
<input type="text" placeholder="请输入" v-model="params.wlCode" />
</div>
</div>
<u-table class="library-table">
<u-tr class="u-tr">
<u-th class="u-th">{{ $t('message.po_MaterielNo') }}</u-th>
<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.product_Unit') }}</u-th>
</u-tr>
<u-tr class="u-tr" v-for="(item, index) in LocationList" :key="index">
<u-td class="u-td" style="width: 40%">{{ item.materialCode }}</u-td>
<u-td class="u-td" style="width: 20%">{{ item.wlCode }}</u-td>
<u-td class="u-td" style="width: 20%">{{ item.amount }}</u-td>
<u-td class="u-td" style="width: 20%">{{ item.userDefined1 }}</u-td>
</u-tr>
</u-table>
<view class="bottom-bar">
<div class="extra"></div>
<div class="container">
<u-row>
<u-col :span="3">
<u-button type="primary" size="medium" class="confirm" @click="confirm">{{ $t('message.Summary_Result') }}</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 { headers } from './config';
import jPicker from '@/components/J-Picker/jPicker.vue';
import combox from '@/components/J-Picker/jPicker.vue';
// @Component
@Component({
components: {
jPicker,
combox,
},
})
export default class RawReceiptDetail extends BasePage {
/**
* 页面Module
*/
model = model;
/**
* 实际数量
*/
LocationList = [];
params: any = {
wlCode: '',
materialCode: '',
};
/**
* 表头
*/
headers = headers;
onReady() {
let mater: any = JSON.parse(uni.getStorageSync('mater') as any);
this.params.materialCode = mater.materialCode;
console.log(this.params);
}
async confirm() {
let res = await this.model.queryStockList({
loginName: '6668',
});
this.LocationList = res.data.records;
console.log('LocationList>', this.LocationList);
}
}
</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;
.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;
}
}
.content {
width: 100%;
height: 500rpx;
.content-item {
width: 100%;
height: 100rpx;
display: flex;
text-align: center;
line-height: 100rpx;
background-color: white;
.item-left {
width: 30%;
}
.item-right {
width: 70%;
}
}
}
.library-num {
.label {
margin-top: 20rpx;
display: flex;
.title {
width: 100rpx;
height: 60rpx;
text-align: center;
line-height: 60rpx;
margin-left: 100rpx;
}
input {
display: block;
width: 50%;
padding: 10rpx;
background-color: white;
}
}
}
.library-table {
margin-top: 30rpx;
}
.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;
height: 60rpx;
position: relative;
.confirm {
position: absolute;
top: 15rpx;
right: 0rpx;
}
}
.extra {
margin: 5px;
border-radius: 5px;
padding: 0 10px;
}
}
}
</style>

@ -0,0 +1,142 @@
<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.Pi_QueryResults') }}</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="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 RawReceiptDetail extends BasePage {
model = model;
//
headers = resultHeaders;
index() {
this.toPage(this.page.raw.handover.picking.index);
}
//
async onOrder() {
// const list = this.model.proOrderResultList;
// await this.model.lockProOrderResult(list);
// await this.model.lock(this.model.proOrderResultList);
this.toPage(this.page.raw.handover.picking.byorder);
}
//
async onAggregate() {
// const orderOutIdList = this.model.proOrderResultList.map((_: any) => _.orderOutId);
// const params = {
// factoryCode: session.factoryCode,
// loginName: session.loginName,
// orderOutIdList,
// };
// await this.model.queryAggregateList(params);
// if (this.model.aggregateList.length === 0) {
// return;
// }
this.toPage(this.page.raw.handover.picking.bysummary);
}
}
</script>
<style lang="scss" scoped>
.page-receipt-detail {
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1b45b1 100%) no-repeat;
background-size: 100% 600rpx;
padding: 30rpx;
min-height: 100%;
padding-top: 118rpx;
padding-bottom: 162rpx;
.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;
}
}
}
</style>

@ -0,0 +1,331 @@
<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.Pi_SummaryPicking') }}</view>
<view class="right"></view>
</view>
<view class="table-wrapper">
<wyb-table class="table" ref="table" width="100%" enable-check="multiple" show-left-and-right-border :headers="headers" :contents="model.aggregateList" :show-vert-border="false"></wyb-table>
</view>
<view class="bottom-bar">
<div class="extra">
<u-form ref="form" :model="form" :error-type="['toast']">
<u-row class="bottom-info">
<!-- <u-col :span="6"
>{{ $t("message.po_Total") }} {{ model.aggregateList.length }}
{{ $t("message.po_Records") }}</u-col
> -->
<!-- <u-col :span="6">-->
<!-- <u-form-item prop="locationCode" label="库存地点" label-width="120rpx">-->
<!-- <u-input-->
<!-- v-model="form.locationCode"-->
<!-- type="select"-->
<!-- @click="locationCodeSelect = true"-->
<!-- />-->
<!-- <u-select-->
<!-- v-model="locationCodeSelect"-->
<!-- :list="model.locationList"-->
<!-- @confirm="(v) => (form.locationCode = v[0].value)"-->
<!-- ></u-select>-->
<!-- </u-form-item>-->
<!-- </u-col>-->
<!-- <u-col :span="6">
<u-form-item prop="amount" :label="this.$t('message.dn_Number')">
<u-input
v-model="form.amount"
type="number"
:placeholder="this.$t('message.po_PleaseInput')"
/>
</u-form-item>
</u-col> -->
</u-row>
</u-form>
</div>
<div class="container">
<u-row>
<u-col :span="3">
<u-button type="primary" @click="model.checkAllAggregateList(!model.isAggregateCheckedAll)">
{{ model.isAggregateCheckedAll ? this.$t('message.po_noSelectAll') : this.$t('message.po_SelectAll') }}
</u-button>
</u-col>
<u-col :span="3">
<u-button type="primary" class="appoint" @click="appoint">{{ $t('message.Pi_distribution') }}</u-button>
</u-col>
<u-col :span="3">
<u-button type="success" @click="onSubmit">
{{ $t('message.dn_Confirm') }}
</u-button>
</u-col>
<u-col :span="3">
<u-button type="error" @click="onUpload">
{{ $t('message.po_Submit') }}
</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 { summaryHeaders } from './config';
import { VForm, VFormRules } from 'vue/types/form';
import { session } from '@/store/modules/session';
@Component
export default class RawReceiptDetail extends BasePage {
/**
* 表单引用
*/
@Ref('form') readonly $form!: VForm;
/**
* 页面Module
*/
model = model;
/**
* 表单数据
*/
form: any = {
locationCode: null,
amount: null,
};
/**
* 表单校验
*/
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 = summaryHeaders;
onShow() {
this.model.queryLocationList();
this.model.aggregateList.forEach((item: any) => {
item.currentAmount = 0;
});
let ant: any = JSON.parse(uni.getStorageSync('material') as string);
let index: any = JSON.parse(uni.getStorageSync('index') as string);
this.model.aggregateList[index] = ant;
uni.removeStorageSync('material');
uni.removeStorageSync('index');
}
appoint() {
let selectStatus = model.aggregateList.map((item) => {
if (item.checked == true) {
return true;
} else {
return false;
}
});
let i = 0;
selectStatus.forEach((item) => {
if (item == true) {
i++;
}
});
if (i > 1) {
uni.showToast({
icon: 'none',
title: '只能选择一条物料' as string,
});
} else if (i == 0) {
uni.showToast({
icon: 'none',
title: '请选择一条物料' as string,
});
} else {
let mater: number = selectStatus.indexOf(true);
uni.setStorageSync('mater', JSON.stringify(model.aggregateList[mater]) as string);
uni.setStorageSync('index', JSON.stringify(mater) as string);
this.toPage(this.page.raw.handover.picking.total);
}
}
/**
* 上传
*/
async onUpload() {
//
if (this.model.aggregateList.length === 0) {
uni.showToast({
icon: 'none',
title: this.$t('message.Pi_tip4') as string,
});
return;
}
const includeOrderOutIdList = this.model.proOrderResultList.map((_: any) => _.orderOutId);
const dataList: any = [];
//
this.model.aggregateList.forEach((item: any) => {
if (item.checked === true) {
dataList.push(item);
}
});
//
if (dataList.length == 0) {
uni.showToast({
icon: 'none',
title: '请先选中要提交的数据' as string,
});
return;
}
//
let isTrue = true;
dataList.forEach((item: any) => {
if (item.wlList == null || item.wlList.length == 0) {
uni.showToast({
icon: 'none',
title: '请确保所选数据都已分配库位' as string,
});
isTrue = false;
}
});
if (isTrue == true) {
const params = {
factoryCode: session.factoryCode,
loginName: session.loginName,
dataList,
includeOrderOutIdList,
};
await this.model.saveAggregateUpload(params);
}
}
/**
* 提交
*/
async onSubmit() {
if (!this.model.hasAggregateChecked) {
uni.showToast({
icon: 'none',
title: this.$t('message.Pi_tip4') as string,
});
return;
}
this.$form.validate((valid) => {
if (!valid) return;
const list = this.model.checkedAggregateList;
// const needLocationCode = list.findIndex((_: any) => !_.currentWkposCode) > -1;
// if (needLocationCode && !this.form.locationCode) {
// uni.showToast({ icon: 'none', title: '' });
// return;
// }
const amount = Number(this.form.amount);
if (amount <= 0 || amount.toString().split('.')[1].length > 3) {
uni.showToast({
icon: 'none',
title: this.$t('message.Pi_tip2') as string,
});
return;
}
for (const item of list) {
if (amount + item.totalMoAmount > item.amount) {
uni.showToast({
icon: 'none',
title: this.$t('message.Pi_tip6') as string,
});
return;
}
}
const locationCode = this.form.locationCode;
this.model.confirmCheckedAggregateList({ amount, locationCode });
});
}
}
</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: 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;
}
.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,369 @@
<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.product_Location') }}</view>
<view class="right"></view>
</view>
<div class="content">
<div class="content-item">
<div class="item-left">{{ $t('message.po_MaterielNo') }}</div>
<div class="item-right">{{ this.material.materialCode }}</div>
</div>
<div class="content-item">
<div class="item-left">{{ $t('message.po_MaterielDes') }}</div>
<div class="item-right">{{ this.material.materialDesc }}</div>
</div>
<div class="content-item">
<div class="item-left">{{ $t('message.po_DemandQuantity') }}</div>
<div class="item-right">{{ this.material.requestAmount }}</div>
</div>
<div class="content-item">
<div class="item-left">{{ $t('message.po_ActualQuantity') }}</div>
<div class="item-right">{{ this.material.receiptAmount }}</div>
</div>
<div class="content-item">
<div class="item-left">{{ $t('message.po_Location') }}</div>
<div class="item-right">{{ this.material.location }}</div>
</div>
</div>
<div class="library">
<div class="title">{{ $t('message.product_Location') }}:</div>
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="wlCode" class="search" :options="list" />
</div>
<div class="library-num">
<div class="title">{{ $t('message.dn_Number') }}:</div>
<input type="text" placeholder="请输入数量" v-model="number" />
<u-button type="primary" size="medium" class="confirm" @click="confirm">{{ $t('message.product_add') }}</u-button>
</div>
<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.value.value }}</u-td>
<u-td class="u-td">{{ item.num }}</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-row class="bottom-info">
<u-button type="primary" class="main" @click="Reservoir">{{ $t('message.product_Confirm') }}</u-button>
<u-col :span="2" v-if="factoryCode == '6662'"> { {$t('message.product_Location')}} </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 { headers } from './config';
import jPicker from '@/components/J-Picker/jPicker.vue';
import { session } from '@/store/modules/session';
import combox from '@/components/J-Picker/jPicker.vue';
// @Component
@Component({
components: {
jPicker,
combox,
},
})
export default class RawReceiptDetail extends BasePage {
/**
* 页面Module
*/
model = model;
factoryCode = session.factoryCode;
locationCode = '';
candidates = ['库位1', '库位2', '库位3'];
/**
* 实际数量
*/
number = '';
wlCode: any = '';
material: any = {};
list: any = [];
LocationList: any = [];
documentNo = '';
/**
* 表头
*/
headers = headers;
async onReady() {
// let means: any = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__') as any);
let content = {
loginName: session.loginName,
sendSpot: null,
factoryCode: session.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.list.push(pickerName);
});
let ant: any = uni.getStorageSync('mater');
this.material = JSON.parse(ant);
console.log('this.material', this.material);
this.number = this.material.amount;
uni.removeStorageSync('mater');
if ('wlList' in this.material) {
this.material.wlList.forEach((item: any) => {
let arr: any = {
value: item.wlCode,
};
let obj: any = {
value: arr,
num: item.qty,
};
this.LocationList.push(obj as never);
});
}
}
confirm() {
if (this.wlCode == '' || this.number == '') {
uni.showToast({
icon: 'none',
title: '请输入正确的库位和数量',
});
return;
}
if (parseFloat(this.number) <= 0) {
uni.showToast({
icon: 'none',
title: '请输入正确的库位和数量',
});
return;
}
if (this.LocationList.length != 0) {
this.LocationList.forEach((item: any) => {
if (item.value.sendSpot != this.wlCode.sendSpot) {
uni.showToast({
icon: 'none',
title: '请重新选择库位',
});
return;
}
});
let num = 0;
this.LocationList.forEach((item: any) => {
num += parseFloat(item.num);
});
num += parseFloat(this.number);
// if (num > parseFloat(this.material.amount)) {
// uni.showToast({
// icon: "none",
// title: "",
// });
// return;
// }
let arr: any = {
value: this.wlCode,
num: this.number,
};
this.LocationList.push(arr as never);
this.material.currentAmount = num;
this.number = '';
return;
}
if (this.LocationList.length == 0) {
// if (this.number > this.material.amount) {
// uni.showToast({
// icon: "none",
// title: "",
// });
// return;
// }
let arr: any = {
value: this.wlCode,
num: this.number,
};
this.LocationList.push(arr as never);
this.material.currentAmount = this.number;
this.number = '';
return;
}
}
deleteItem(index: any) {
this.LocationList.splice(index, 1);
}
bookTypeChange(e: any) {
this.wlCode = e.pickerName;
}
Reservoir() {
let wlList: Array<string> = [];
let requestAmountNum = 0;
this.LocationList.forEach((item: any) => {
let objString = JSON.stringify(this.material);
let TEM = JSON.parse(objString);
TEM.wlCode = item.value.label;
TEM.qty = item.num;
wlList.push(TEM);
let pras = parseInt(item.num);
requestAmountNum += pras;
});
console.log('wlList', wlList);
this.material.wlList = null;
this.material.wlList = wlList;
this.material.receiptAmount = requestAmountNum;
uni.setStorageSync('material', JSON.stringify(this.material));
this.redirectTo(this.page.raw.handover.picking.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: 118rpx;
.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;
}
}
.content {
width: 100%;
height: 500rpx;
.content-item {
width: 100%;
height: 100rpx;
display: flex;
text-align: center;
line-height: 100rpx;
background-color: white;
.item-left {
width: 30%;
}
.item-right {
width: 70%;
}
}
}
.library {
height: 60rpx;
position: relative;
padding-bottom: 10rpx;
.search {
position: absolute;
width: 80%;
right: 38rpx;
top: 15rpx;
height: 60rpx;
background-color: white;
}
.title {
width: 20%;
height: 100%;
text-align: left;
position: absolute;
line-height: 50rpx;
top: 15rpx;
left: 0;
}
}
.library-num {
position: relative;
margin-top: 15rpx;
.title {
width: 100rpx;
height: 100%;
line-height: 50rpx;
}
input {
display: block;
width: 40%;
padding: 10rpx;
position: absolute;
left: 100rpx;
top: 0;
background-color: white;
}
.confirm {
position: absolute;
top: 0;
right: 20rpx;
margin-left: 30rpx;
}
}
.library-table {
margin-top: 30rpx;
}
.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 {
margin: 5px;
border-radius: 5px;
padding: 0 10px;
.main {
margin-right: 0;
}
}
}
}
</style>

@ -138,6 +138,8 @@ export default class dnReceiptDom extends BasePage {
async queryLoction() {
this.Location = [];
let sendSpot = JSON.parse(uni.getStorageSync('sendSpot') as any);
let data:any = this.model.orderInInfoList.find((val:any)=>val.poNo==this.poNo&&val.materialCode==this.every.materialCode);
uni.setStorageSync('sendSpot', JSON.stringify(data.sendSpot) as any);
let content = {
loginName: session.loginName,
sendSpot: sendSpot,
@ -161,6 +163,8 @@ export default class dnReceiptDom extends BasePage {
let list: Array<LocationDetail> = [];
let means: any = JSON.parse(uni.getStorageSync('__GWMS_APP_STATE_DATA__') as any);
let sendSpot = JSON.parse(uni.getStorageSync('sendSpot') as any);
let data:any = this.model.orderInInfoList.find((val:any)=>val.poNo==this.poNo&&val.materialCode==this.every.materialCode);
uni.setStorageSync('sendSpot', JSON.stringify(data.sendSpot) as any);
let content = {
loginName: means.session.user.loginName,
sendSpot: sendSpot,
@ -168,7 +172,6 @@ export default class dnReceiptDom extends BasePage {
workArea: session.workareaCode,
};
let res: any = await this.model.queryByFactoryCodeAndWorkAreaCode(content);
console.log('>>>>>>>>>>>>>>', res);
res.forEach((item: LocationDetail) => {
if (item.sendSpot === condition.sendSpot) {
let pickerName: any = {};
@ -272,6 +275,7 @@ export default class dnReceiptDom extends BasePage {
//
this.Location = await this.initLocation(this.every);
if (this.Location.length == 0) {
await this.queryLoction();
}
//

@ -34,6 +34,9 @@ export const page = {
stoOutboundDetail: '/pages/product/outbound/stoOutbound/detail',
stoBack: '/pages/product/STO-Outbound/Back',
},
stoOutbound:{
datile:'/pages/product/stoOutbound/detail',
},
SpareDeliverGoods: {
detail: '/pages/product/outbound/SpareDeliverGoods/detail',
},
@ -89,6 +92,9 @@ export const page = {
Local: '/pages/raw/handover/picking/Local-details',
SummaryLocal: '/pages/raw/handover/picking/Summary-details',
},
pickingVn: {
index: '/pages/raw/handover/picking-vn/index',
},
RUSpicking: {
index: '/pages/raw/handover/RUS-picking/index',
result: '/pages/raw/handover/RUS-picking/result',
@ -116,6 +122,9 @@ export const page = {
summary: '/pages/raw/handover/aggregating/summary',
accessory: '/pages/raw/handover/aggregating/accessory',
},
aggregatingVn: {
index: '/pages/raw/handover/aggregating-vn/index',
},
RUSaggregating: {
index: '/pages/raw/handover/RUS-aggregating/index',
result: '/pages/raw/handover/RUS-aggregating/result',

@ -186,6 +186,10 @@ export const url = {
stoScan: '/wmspda/fg/stoOutbound/scan',
stoConfirm: '/wmspda/fg/stoOutbound/confirm',
stoPost: '/wmspda/fg/stoOutbound/post',
stoDetailQuery: '/wmspda/fg/stoOutbound/queryDetail',
pcListQuery: '/wmspda/fg/stoOutbound/queryPcNoList',
stoCancel: '/wmspda/fg/stoOutbound/cancel',
stoDelete: '/wmspda/fg/stoOutbound/delete',
},
},
inbound: {

Loading…
Cancel
Save