原材料盘点页面和多语言
parent
8a0e0952fa
commit
bf3401be34
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,99 @@
|
|||||||
|
/**
|
||||||
|
* 看单明细表格列
|
||||||
|
*/
|
||||||
|
import vm from '@/main';
|
||||||
|
export const headers = [
|
||||||
|
{
|
||||||
|
label: vm.$t('message.po_MaterielNo'),
|
||||||
|
key: 'materialCode',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: vm.$t('message.po_MaterielDes'),
|
||||||
|
key: 'materialDesc',
|
||||||
|
width: 350,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: vm.$t('message.po_DemandQuantity'),
|
||||||
|
key: 'requestAmount',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: vm.$t('message.po_ActualQuantity'),
|
||||||
|
key: 'receiptAmount',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// label: vm.$t('message.po_RemainingQuantity'),
|
||||||
|
// key: 'splitAmount',
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
label: vm.$t('message.po_Location'),
|
||||||
|
key: 'location',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// label: '物料详情',
|
||||||
|
// key: 'materialDesc',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '收货数量',
|
||||||
|
// key: 'receiptAmount',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '发货数量',
|
||||||
|
// key: 'requestAmount',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '过账信息',
|
||||||
|
// key: 'accountingMessage',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '应',
|
||||||
|
// key: 'y',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '过账状态',
|
||||||
|
// key: 'accountingStatus',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '采购订单号',
|
||||||
|
// key: 'poNo',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '行号',
|
||||||
|
// key: 'poLine',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '单位',
|
||||||
|
// key: 'dw',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: 'sap库存地点',
|
||||||
|
// key: 'kw',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: 'ID',
|
||||||
|
// key: 'rawOrderInId',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '工厂',
|
||||||
|
// key: 'factoryCodeSap',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '质检状态',
|
||||||
|
// key: 'qualityStatus',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '供应商',
|
||||||
|
// key: 'supplyCode',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '采购组',
|
||||||
|
// key: 'buyerGroup',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '工位',
|
||||||
|
// key: 'sendSpot',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: 'mrp',
|
||||||
|
// key: 'mrpCode',
|
||||||
|
// },
|
||||||
|
];
|
||||||
@ -0,0 +1,134 @@
|
|||||||
|
<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">看单明细未通过明细</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.orderInInfoListEx"
|
||||||
|
:show-vert-border="false"
|
||||||
|
></wyb-table>
|
||||||
|
</view>
|
||||||
|
<view class="bottom-bar">
|
||||||
|
<div class="extra">
|
||||||
|
<u-row class="bottom-info">
|
||||||
|
<u-col :span="3">共{{ model.orderInInfoListEx.length }}条</u-col>
|
||||||
|
<u-col :span="2"></u-col>
|
||||||
|
<u-col :span="4"></u-col>
|
||||||
|
<u-col :span="3"></u-col>
|
||||||
|
</u-row>
|
||||||
|
</div>
|
||||||
|
<div class="container">
|
||||||
|
<u-row>
|
||||||
|
<u-col :span="3"></u-col>
|
||||||
|
<u-col :span="3"></u-col>
|
||||||
|
<u-col :span="3"></u-col>
|
||||||
|
<u-col :span="3">
|
||||||
|
<u-button @click="uni.navigateBack()">返回</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';
|
||||||
|
|
||||||
|
@Component
|
||||||
|
export default class RawReceiptDetailEx extends BasePage {
|
||||||
|
/**
|
||||||
|
* 页面Module
|
||||||
|
*/
|
||||||
|
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;
|
||||||
|
|
||||||
|
.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;
|
||||||
|
height: 72rpx;
|
||||||
|
line-height: 72rpx;
|
||||||
|
margin: 5px;
|
||||||
|
padding: 0 10px;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@ -0,0 +1,317 @@
|
|||||||
|
<template>
|
||||||
|
<view class="page-receipt-detail">
|
||||||
|
<view class="header">
|
||||||
|
<view class="left">
|
||||||
|
<u-icon class="icon" name="arrow-left" @click="gohome" />
|
||||||
|
</view>
|
||||||
|
<view class="title">{{ $t("message.dn_Detailed") }}</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.orderInInfoList"
|
||||||
|
:show-vert-border="false"
|
||||||
|
></wyb-table>
|
||||||
|
</view>
|
||||||
|
<view class="bottom-bar">
|
||||||
|
<!-- <div>
|
||||||
|
<u-button type="primary" class="appoint" size="medium" @click="appoint"
|
||||||
|
>指定库位</u-button
|
||||||
|
>
|
||||||
|
</div> -->
|
||||||
|
<div class="container">
|
||||||
|
<u-row>
|
||||||
|
<u-col :span="3">
|
||||||
|
<u-button
|
||||||
|
type="warning"
|
||||||
|
@click="model.checkAllOrderInInfoList(!model.isCheckedAll)"
|
||||||
|
>
|
||||||
|
{{
|
||||||
|
model.isCheckedAll
|
||||||
|
? 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"
|
||||||
|
:loading="$wait.is('*submitOrderInEnter')"
|
||||||
|
@click="onSubmit"
|
||||||
|
>
|
||||||
|
{{ $t("message.po_Submit") }}
|
||||||
|
</u-button>
|
||||||
|
</u-col>
|
||||||
|
<u-col :span="3">
|
||||||
|
<u-button type="error" @click="gohome">{{
|
||||||
|
$t("message.po_Return")
|
||||||
|
}}</u-button>
|
||||||
|
</u-col>
|
||||||
|
</u-row>
|
||||||
|
</div>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
// inventory
|
||||||
|
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 { truncate } from "lodash";
|
||||||
|
// @Component
|
||||||
|
@Component({
|
||||||
|
components: {
|
||||||
|
jPicker,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
export default class RawReceiptDetail extends BasePage {
|
||||||
|
/**
|
||||||
|
* 页面Module
|
||||||
|
*/
|
||||||
|
model = model;
|
||||||
|
factoryCode = session.factoryCode;
|
||||||
|
locationCode = "";
|
||||||
|
/**
|
||||||
|
* 实际数量
|
||||||
|
*/
|
||||||
|
number = "";
|
||||||
|
/**
|
||||||
|
* 表头
|
||||||
|
*/
|
||||||
|
headers = headers;
|
||||||
|
dnNo = "";
|
||||||
|
onShow() {
|
||||||
|
this.model.queryLocation();
|
||||||
|
let ant: any = JSON.parse(sessionStorage.getItem("material") as string);
|
||||||
|
let index: any = JSON.parse(sessionStorage.getItem("index") as string);
|
||||||
|
this.model.orderInInfoList[index] = ant;
|
||||||
|
this.dnNo = JSON.parse(sessionStorage.getItem("dnNo") as string);
|
||||||
|
sessionStorage.removeItem("material");
|
||||||
|
sessionStorage.removeItem("index");
|
||||||
|
}
|
||||||
|
gohome() {
|
||||||
|
this.toPage(this.page.raw.ingoods.dnReceipt.index);
|
||||||
|
sessionStorage.removeItem("material");
|
||||||
|
sessionStorage.removeItem("index");
|
||||||
|
sessionStorage.removeItem("dnNo");
|
||||||
|
}
|
||||||
|
bookTypeChange(e: any) {
|
||||||
|
this.locationCode = e.pickerName.value;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 逐条修改
|
||||||
|
*/
|
||||||
|
changeNumber() {
|
||||||
|
if (!this.model.hasChecked) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: "none",
|
||||||
|
title: this.$t("message.dn_Select") as string,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//改变列表的值
|
||||||
|
this.model.orderInInfoList.forEach((item: any) => {
|
||||||
|
if (item.checked) {
|
||||||
|
if (this.locationCode) {
|
||||||
|
item.location = this.locationCode;
|
||||||
|
}
|
||||||
|
if (this.number > item.requestAmount) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: "none",
|
||||||
|
title: this.$t("message.dn_Tip") as string,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
} else if (this.number == "") {
|
||||||
|
item.receiptAmount = item.requestAmount;
|
||||||
|
} else if (this.number < item.requestAmount) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: "none",
|
||||||
|
title: this.$t("message.dn_Tip3") as string,
|
||||||
|
});
|
||||||
|
item.receiptAmount = this.number;
|
||||||
|
} else {
|
||||||
|
item.receiptAmount = this.number;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
appoint() {
|
||||||
|
let selectStatus = model.orderInInfoList.map((item) => {
|
||||||
|
if (item.checked == true) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
let i: number = 0;
|
||||||
|
selectStatus.forEach((item) => {
|
||||||
|
if (item == true) {
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (i > 1) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: "none",
|
||||||
|
title: "只能选择一个DN单" as string,
|
||||||
|
});
|
||||||
|
} else if (i == 0) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: "none",
|
||||||
|
title: "请选择一个DN单" as string,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
let mater: number = selectStatus.indexOf(true);
|
||||||
|
sessionStorage.setItem(
|
||||||
|
"mater",
|
||||||
|
JSON.stringify(model.orderInInfoList[mater]) as string
|
||||||
|
);
|
||||||
|
sessionStorage.setItem("index", JSON.stringify(mater) as string);
|
||||||
|
this.redirectTo(this.page.raw.ingoods.dnReceipt.idetailed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 提交
|
||||||
|
*/
|
||||||
|
async onSubmit() {
|
||||||
|
let selectStatus = model.orderInInfoList.map((item) => {
|
||||||
|
if (item.checked == true) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// let LocStatus = model.orderInInfoList.map((item) => {
|
||||||
|
// if (
|
||||||
|
// item.checked == true &&
|
||||||
|
// (item.location == null || item.location == "")
|
||||||
|
// ) {
|
||||||
|
// return true;
|
||||||
|
// } else {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// if (LocStatus[0]) {
|
||||||
|
// uni.showToast({
|
||||||
|
// icon: "none",
|
||||||
|
// title: this.$t("message.Warehouse_Tip2") as string,
|
||||||
|
// });
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
await this.model.submitOrderInEnter();
|
||||||
|
this.locationCode = "";
|
||||||
|
// setTimeout(() => {
|
||||||
|
// uni.navigateBack({ delta: 1 });
|
||||||
|
// }, 2000);
|
||||||
|
this.model.orderInInfo.carNo = "";
|
||||||
|
this.model.orderInInfo.bookingTime = "";
|
||||||
|
this.model.orderInInfo.supplyCode = "";
|
||||||
|
this.model.orderInInfo.poType = "";
|
||||||
|
this.model.orderInInfo.location = "";
|
||||||
|
this.model.queryOrderInInfo(this.dnNo);
|
||||||
|
// if (selectStatus[0]) {
|
||||||
|
// await this.model.submitOrderInEnter();
|
||||||
|
// this.locationCode = "";
|
||||||
|
// setTimeout(() => {
|
||||||
|
// uni.navigateBack({ delta: 1 });
|
||||||
|
// }, 2000);
|
||||||
|
// this.model.orderInInfo.carNo = "";
|
||||||
|
// this.model.orderInInfo.bookingTime = "";
|
||||||
|
// this.model.orderInInfo.supplyCode = "";
|
||||||
|
// this.model.orderInInfo.poType = "";
|
||||||
|
// this.model.orderInInfo.location = "";
|
||||||
|
// } else {
|
||||||
|
// uni.showToast({
|
||||||
|
// icon: "none",
|
||||||
|
// title: this.$t("message.product_Tip2") as string,
|
||||||
|
// });
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.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,390 @@
|
|||||||
|
<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";
|
||||||
|
import { forEach } from "lodash";
|
||||||
|
// @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() {
|
||||||
|
this.model.queryLocation();
|
||||||
|
let means: any = JSON.parse(
|
||||||
|
localStorage.getItem("__GWMS_APP_STATE_DATA__") as any
|
||||||
|
);
|
||||||
|
let user: any = session.user;
|
||||||
|
let sendSpot = JSON.parse(localStorage.getItem("sendSpot") as any);
|
||||||
|
let content = {
|
||||||
|
loginName: means.session.user.loginName,
|
||||||
|
sendSpot: sendSpot,
|
||||||
|
factoryCode: means.session.user.factoryCode,
|
||||||
|
workArea: user.list[0].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 = sessionStorage.getItem("mater");
|
||||||
|
this.material = JSON.parse(ant);
|
||||||
|
this.number = this.material.requestAmount;
|
||||||
|
sessionStorage.removeItem("mater");
|
||||||
|
if (this.material.hasOwnProperty("wllist")) {
|
||||||
|
this.material.wllist.forEach((item: any) => {
|
||||||
|
let arr: object = {
|
||||||
|
value: item.wlCode,
|
||||||
|
};
|
||||||
|
let obj: any = {
|
||||||
|
value: arr,
|
||||||
|
num: item.receiptAmount,
|
||||||
|
};
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
if (item.value.sendSpot == this.wlCode.sendSpot) {
|
||||||
|
let num: number = 0;
|
||||||
|
this.LocationList.forEach((item: any) => {
|
||||||
|
num += parseFloat(item.num);
|
||||||
|
});
|
||||||
|
num += parseFloat(this.number);
|
||||||
|
if (num > parseFloat(this.material.requestAmount)) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: "none",
|
||||||
|
title: "实际数量不能大于需求数量",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let arr: object = {
|
||||||
|
value: this.wlCode,
|
||||||
|
num: this.number,
|
||||||
|
};
|
||||||
|
this.LocationList.push(arr as never);
|
||||||
|
this.material.receiptAmount = num;
|
||||||
|
this.number = "";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (this.LocationList.length == 0) {
|
||||||
|
if (this.number > this.material.requestAmount) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: "none",
|
||||||
|
title: "实际数量不能大于需求数量",
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let arr: object = {
|
||||||
|
value: this.wlCode,
|
||||||
|
num: this.number,
|
||||||
|
};
|
||||||
|
this.LocationList.push(arr as never);
|
||||||
|
this.material.receiptAmount = 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.receiptAmount = item.num;
|
||||||
|
wllist.push(TEM);
|
||||||
|
let pras = parseInt(item.num);
|
||||||
|
requestAmountNum += pras;
|
||||||
|
});
|
||||||
|
this.material.wllist = null;
|
||||||
|
this.material.wllist = wllist;
|
||||||
|
this.material.receiptAmount = requestAmountNum;
|
||||||
|
sessionStorage.setItem("material", JSON.stringify(this.material));
|
||||||
|
this.redirectTo(this.page.raw.ingoods.dnReceipt.detail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</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,213 @@
|
|||||||
|
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 httpjson from "@/utils/location";
|
||||||
|
|
||||||
|
class OrderInInfo {
|
||||||
|
checked?: boolean;
|
||||||
|
dnNo?: string;
|
||||||
|
kw?: string;
|
||||||
|
userDefined10?: string;
|
||||||
|
orderStatus?: string;
|
||||||
|
carNo?: string;
|
||||||
|
bookingTime?: string;
|
||||||
|
supplyCode?: string;
|
||||||
|
poType?: string;
|
||||||
|
location?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Module({
|
||||||
|
namespaced: true,
|
||||||
|
dynamic: true,
|
||||||
|
store,
|
||||||
|
name: "raw.ingoods.dnReceipt",
|
||||||
|
})
|
||||||
|
export class ReceiptModule extends VuexModule {
|
||||||
|
sendSpot = "";
|
||||||
|
/**
|
||||||
|
* sap库存地点列表
|
||||||
|
*/
|
||||||
|
cboPlaceList = [];
|
||||||
|
/**
|
||||||
|
* 隐藏看单号
|
||||||
|
*/
|
||||||
|
dnNo = "";
|
||||||
|
/**
|
||||||
|
* 看单号查询结果
|
||||||
|
*/
|
||||||
|
orderInInfo: OrderInInfo = new OrderInInfo();
|
||||||
|
/**
|
||||||
|
* 看单明细
|
||||||
|
*/
|
||||||
|
orderInInfoList: OrderInInfo[] = [];
|
||||||
|
/**
|
||||||
|
* 看单明细未通过明细
|
||||||
|
*/
|
||||||
|
orderInInfoListEx: OrderInInfo[] = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 库位列表
|
||||||
|
*/
|
||||||
|
returningTypeList: any[] = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否已查询看单号
|
||||||
|
*/
|
||||||
|
get hasDnInfo() {
|
||||||
|
return !!this.orderInInfo.dnNo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否全选
|
||||||
|
*/
|
||||||
|
get isCheckedAll() {
|
||||||
|
return !this.orderInInfoList.filter((_) => !_.checked).length;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否有选择项
|
||||||
|
*/
|
||||||
|
get hasChecked() {
|
||||||
|
return this.orderInInfoList.filter((_) => _.checked).length > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新看单明细库位
|
||||||
|
* @param kw 库位
|
||||||
|
*/
|
||||||
|
@Mutation
|
||||||
|
updateOrderInInfoListKw(kw: string) {
|
||||||
|
this.orderInInfoList = this.orderInInfoList.map((item) => {
|
||||||
|
item.kw = kw;
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新选中的看单明细库位
|
||||||
|
* @param kw 库位
|
||||||
|
*/
|
||||||
|
@Mutation
|
||||||
|
updateCheckedOrderInInfoListKw(kw: string) {
|
||||||
|
this.orderInInfoList = this.orderInInfoList.map((item) => {
|
||||||
|
if (item.checked) {
|
||||||
|
item.kw = kw;
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 看单明细全选/全不选
|
||||||
|
*/
|
||||||
|
@Mutation
|
||||||
|
checkAllOrderInInfoList(checked: boolean) {
|
||||||
|
this.orderInInfoList = this.orderInInfoList.map((item) => {
|
||||||
|
item.checked = checked;
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询库位列表
|
||||||
|
*/
|
||||||
|
@MutationAction
|
||||||
|
async queryLocation() {
|
||||||
|
const result: any = await http.post(url.auth.query.location1, {
|
||||||
|
factoryCode: session.factoryCode,
|
||||||
|
loginName: session.loginName,
|
||||||
|
userDefined3: 1,
|
||||||
|
});
|
||||||
|
console.log("result", result);
|
||||||
|
const cboPlaceList = result.data.records.map((_: any) => ({
|
||||||
|
label: _.sendSpot,
|
||||||
|
value: _.sendSpot,
|
||||||
|
}));
|
||||||
|
return { cboPlaceList };
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询单号
|
||||||
|
* 查询DN单号
|
||||||
|
* @param dnNo
|
||||||
|
*/
|
||||||
|
@MutationAction
|
||||||
|
async queryOrderInInfo(dnNo: string) {
|
||||||
|
const { list }: any = await http.post(url.material.DNorderin.info, {
|
||||||
|
dnNo,
|
||||||
|
factoryCode: session.factoryCode,
|
||||||
|
loginName: session.loginName,
|
||||||
|
});
|
||||||
|
const orderInInfo = list[0] || {};
|
||||||
|
const orderInInfoList = list.filter(
|
||||||
|
(_: OrderInInfo) => _.userDefined10 === "1"
|
||||||
|
);
|
||||||
|
const orderInInfoListEx = list.filter(
|
||||||
|
(_: OrderInInfo) => _.userDefined10 === "0"
|
||||||
|
);
|
||||||
|
// orderInInfoList.forEach((item: any) => {
|
||||||
|
// item.receiptAmount = item.requestAmount;
|
||||||
|
// });
|
||||||
|
localStorage.setItem("sendSpot", JSON.stringify(list[0].sendSpot) as any);
|
||||||
|
return { dnNo, orderInInfo, orderInInfoList, orderInInfoListEx };
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交看单明细
|
||||||
|
*/
|
||||||
|
@MutationAction
|
||||||
|
async submitOrderInEnter() {
|
||||||
|
const list = (this.state as any).orderInInfoList.map((item: any) => {
|
||||||
|
item.orderStatus = item.checked ? "2" : "1";
|
||||||
|
return item;
|
||||||
|
});
|
||||||
|
const result: any = await http.post(url.material.DNorderin.enter, {
|
||||||
|
dnNo: this.dnNo,
|
||||||
|
factoryCode: session.factoryCode,
|
||||||
|
loginName: session.loginName,
|
||||||
|
list,
|
||||||
|
});
|
||||||
|
uni.showToast({
|
||||||
|
icon: "none",
|
||||||
|
title: result.msg,
|
||||||
|
});
|
||||||
|
const orderInInfoList = result.list.sort(
|
||||||
|
(a: any, b: any) =>
|
||||||
|
Number(a.accountingStatus) - Number(b.accountingStatus)
|
||||||
|
);
|
||||||
|
return { orderInInfoList };
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改库位
|
||||||
|
*/
|
||||||
|
@Action({ commit: "updateCheckedOrderInInfoListKw" })
|
||||||
|
async changeOrderInLocation(kw: string) {
|
||||||
|
await http.post("/material/orderin/enter", {
|
||||||
|
warehouseCode: session.warehouseCode,
|
||||||
|
factoryCode: session.factoryCode,
|
||||||
|
loginName: session.loginName,
|
||||||
|
locationCode: kw,
|
||||||
|
});
|
||||||
|
return kw;
|
||||||
|
}
|
||||||
|
@Action({ commit: "updateCheckedOrderInInfoListKw" })
|
||||||
|
async queryByFactoryCodeAndWorkAreaCode(content: any) {
|
||||||
|
let res = await http.post(
|
||||||
|
"/wmspda/fg/queryByFactoryCodeAndWorkAreaCode",
|
||||||
|
content
|
||||||
|
);
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default getModule(ReceiptModule);
|
||||||
Loading…
Reference in New Issue