You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

602 lines
16 KiB
Vue

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<template>
<view class="page-product-receipt">
<view class="header" :style="{ backgroundColor: `rgba(250, 53, 52, ${scrollTop / 100})` }">
<view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" />
</view>
<view class="title">采购入库(PO)</view>
<view class="right"></view>
</view>
<u-form class="form" ref="form" label-width="180rpx">
<!-- 单号 -->
<view class="single">
<view class="single-left">
<view>采购单号:</view>
<u-search placeholder="请扫描" v-model="orderNo" @search="query" :show-action="false"></u-search>
</view>
<view class="single-right">
<u-button type="primary" @click="tidan">提单</u-button>
</view>
</view>
<!-- 订单 -->
<u-form-item label="物料编码">
<jPicker sureColor="#ff0000" @bindpicker="bookTypeChange" showKey="value" valKey="value" :val="aimWl.value" :options="materilistonly" />
<!-- <u-input :border="true" v-model="materialCode" placeholder="" @confirm="query" style="overflow: hidden" /> -->
</u-form-item>
<!-- 机台 -->
<!-- <u-form-item>
<view class="row">
<view>收货仓库:</view>
<view>0001-小榄物料仓</view>
</view>
<view class="row">
<view>工厂:</view>
<view>1000</view>
</view>
</u-form-item> -->
</u-form>
<view class="scroll">
<view v-for="item in list" :key="item.id" @dblclick="onFormDoubleClick(item)">
<u-form style="margin-top: 10rpx" class="form2">
<view class="list">
<view class="righttitle">
<view class="boder-icon-top zhuangtai" data-state="0">{{ item.userDefined1 == 1 ? '未入库' : '已入库' }}</view>
</view>
<view class="row-list">
<view class="list-item"> 入库单号: </view>
<view>{{ item.poNo }} </view>
</view>
<view class="row-list">
<view class="list-item"> 物料编码: </view>
<view>{{ item.materialCode }} </view>
</view>
<view class="row-list">
<view class="list-item"> 物料名称: </view>
<view>{{ item.materialDesc }} </view>
</view>
<view class="row-list">
<view class="list-item"> 托盘号: </view>
<view>{{ item.sn }} </view>
</view>
<!-- <view class="row-list">
<view class="row-list-item">
<view class="list-item"> 托盘号: </view>
<view>{{item.sn}}</view>
</view>
<view class="row-list-item">
<view class="list-item"> 批次号: </view>
<view> 12335 </view>
</view>
</view> -->
<view class="row-list">
<view class="list-item"> 工厂号: </view>
<view>{{ item.factoryCode }}</view>
</view>
<view class="row-list">
<view class="list-item"> 收货仓库: </view>
<view>{{ item.whCode }}</view>
</view>
<!-- <view class="row-list">
<view class="list-item"> 数量: </view>
<view>{{ item.amount }}</view>
</view> -->
<view class="row-list">
<view class="row-list-item">
<view class="list-item">数量: </view>
<view> {{ item.amount }}</view>
</view>
<view class="row-list-item">
<view class="list-item"> 单位: </view>
<view>{{ item.userDefined4 }}</view>
</view>
</view>
<view a:if="true" class="righttitle">
<view @click.stop="onPass(item)" class="boder-icon-rigth"> 入库 </view>
</view>
</view>
</u-form>
</view>
</view>
<view>
<u-popup v-model="show" mode="center" width="580rpx" height="260rpx">
<view class="form3">
<view class="poupitem">
<view style="line-height: 32px" class="pouptitle">库位码:</view>
<u-search placeholder="请扫描" v-model="form3.wlCode" :show-action="false"></u-search>
<!-- <u-input @click="scanwl" class="poupcontent" :clearable="false" v-model="form3.barCodewl" placeholder="" style="overflow: hidden" /> -->
</view>
<!-- <view class="poupitem">
<view class="pouptitle">数量:</view>
<u-input class="poupcontent" :clearable="false" v-model="form3.productDescZh" placeholder="" style="overflow: hidden" />
</view>
<view class="poupitem">
<view class="pouptitle">托盘号:</view>
<u-input class="poupcontent" :clearable="false" v-model="form3.productDescZh" placeholder="" style="overflow: hidden" />
</view> -->
</view>
<view class="poupbutton" style="margin-top: 10px">
<div>
<u-button style="width: 100px; height: 35px" @click="onOk" size="mini" type="primary">确定</u-button>
</div>
<div>
<u-button style="width: 100px; height: 35px" size="mini" type="error" @click="nopoup">取消</u-button>
</div>
</view>
</u-popup>
<view v-if="show" class="mask"></view>
</view>
<u-toast ref="uToast" />
</view>
</template>
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import jPicker from '@/components/J-Picker/jPicker.vue';
import model from './model';
import { session } from '@/store/modules/session';
interface OptionType {
label: string;
value: string;
}
@Component({
components: {
jPicker,
},
})
export default class PurchaseWHPO extends BasePage {
model = model;
list: any = [];
show = false;
form3: any = {};
aimWl = {} as OptionType;
materilist = [];
materilistonly = [];
// remove: any = {};
// async onReady() {
// await this.model.queryLocation();
// this.remove = this.model.WlList[0];
// }
// selectItem(e: any) {
// this.remove = e.pickerName;
// }
orderNo: any = '';
materialCode: any = '';
border = true;
height = 100;
autoHeight = true;
imgList: any = [];
imgUrlList: any = [];
isqualified = [
{
label: '',
value: '1',
},
{
label: '',
value: '0',
},
];
productCodeList: any = {};
clickitem: any = '';
//
onPass(item) {
this.clickitem = item;
this.show = true;
this.form3 = {};
}
nopoup() {
this.show = false;
this.form3.barCodewl = '';
}
//
async onOk() {
console.log(this.form3);
if (this.form3.wlCode == '' || this.form3.wlCode == undefined) {
(this.$refs.uToast as any).show({
title: '',
type: 'default',
});
return;
}
let query = this.clickitem;
// query.applyList = this.Sparepartlist;
query.wlCode = this.form3.wlCode;
await this.model.PurchaseOrderRKPda(query);
console.log(this.model.SubmitCode);
if (this.model.SubmitCode.code == 200) {
(this.$refs.uToast as any).show({
title: '',
type: 'default',
});
this.show = false;
this.query();
} else {
(this.$refs.uToast as any).show({
title: '',
type: this.model.SubmitCode.msg,
});
}
}
async onFormDoubleClick(item) {
console.log('', item);
//await this.model.OnSubmit(item.id);
// uni.navigateTo({
// url: `/pages/equipment/Upkeep/repairing?listitem=` + encodeURIComponent(JSON.stringify(item)),
// });
this.uni.navigateTo({
url: this.page.wms.PurchaseWHPODetail + '?listitem=' + encodeURIComponent(JSON.stringify(item)),
});
}
//查询货单关联采购单信息
async query() {
if (this.orderNo == '' || this.orderNo.length == 0) {
(this.$refs.uToast as any).show({
title: 'RFID',
type: 'default',
});
return;
}
this.aimWl = {} as OptionType;
let query = {
poNo: this.orderNo,
materialCode: this.aimWl.value ? this.aimWl.value : '',
factoryCode: session.FactoryCode,
};
await this.model.PurchaseOrderWarehousingPda(query);
this.materilist = model.orderNoItemList;
this.list = [];
if (this.materilist.length) {
const filteredArray = this.materilist.reduce((acc, curr) => {
// 检查是否已经存在相同的 code
if (!acc.map((item) => item.materialCode).includes(curr.materialCode)) {
acc.push({ value: curr.materialCode, lable: curr.materialCode, materialCode: curr.materialCode, materialDesc: curr.materialDesc });
}
return acc;
}, []);
this.materilistonly = filteredArray;
this.aimWl = this.materilistonly[0];
this.list.push(this.materilist[0]);
} else {
this.aimWl = {} as OptionType;
}
}
//提单按钮
async tidan() {
if (this.orderNo == '' || this.orderNo.length == 0) {
(this.$refs.uToast as any).show({
title: '请输入RFID',
type: 'default',
});
return;
}
let query = {
poNo: this.orderNo,
materialCode: this.aimWl.value ? this.aimWl.value : '',
factoryCode: session.FactoryCode,
};
await this.model.PurchaseOrderWarehousingPda(query);
this.list = model.orderNoItemList;
}
histroyItem: any = {};
barcode: any = '';
//完成送货单
scanwl() {
const self: PurchaseWHPO = this as PurchaseWHPO;
const showToast = (message: string) => {
uni.showToast({
title: message,
icon: 'none',
});
};
uni.scanCode({
onlyFromCamera: true,
success: function (res) {
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
self.form3.barCodewl = res.result;
//that.getByPoint();
},
fail: function () {
showToast('扫码不成功');
},
});
}
bookTypeChange(e: any) {
this.aimWl = e.pickerName;
this.list = [];
this.materilist.forEach((item) => {
if (e.pickerName.value == item.materialCode) {
this.list.push(item);
}
});
//
//this.queryinformation();
//this.getlist();
}
}
</script>
<style lang="scss" scoped>
.page-product-receipt {
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #f8262c 51%, #d9001b 100%) no-repeat;
background-size: 100% 600rpx;
padding: 118rpx 30rpx 162rpx;
min-height: 100%;
.header {
position: fixed;
top: 0rpx;
left: 0;
right: 0;
z-index: 99;
display: flex;
height: 120rpx;
line-height: 88rpx;
color: #fff;
font-size: 34rpx;
font-weight: 500;
text-align: center;
padding: 45rpx 0rpx 0rpx;
.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: 280rpx;
height: 64rpx;
background: rgb(242, 242, 242);
border-radius: 110rpx;
}
}
.single {
width: 100%;
height: 100rpx;
display: flex;
.single-left {
width: 80%;
height: 100%;
display: flex;
view {
width: 142rpx;
height: 100%;
line-height: 100rpx;
}
}
.single-right {
button {
margin-top: 15rpx;
width: 140rpx;
height: 70rpx;
background-color: #fa3534;
}
}
}
.row {
display: flex;
flex-direction: row;
justify-content: space-around;
flex: 1;
}
}
.scroll {
// margin-top: 120rpx;
// padding-left: 30rpx;
// padding-right: 16rpx;
// margin-bottom: 20rpx;
// overflow: scroll;
// padding-top: 20rpx;
.form2 {
background-color: #fff;
padding: 0rpx 25rpx 25rpx;
border-radius: 10rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
color: #8d8989;
.row-list {
display: flex;
flex-direction: row;
justify-content: space-between;
.row-list-item {
display: flex;
flex-direction: row;
justify-content: space-between;
width: 40%;
}
.list-item {
display: flex;
flex-direction: row;
flex: 1;
}
}
.righttitle {
display: flex;
justify-content: flex-end;
.boder-icon-rigth {
border: 1rpx solid #fa3534;
width: 130rpx;
text-align: center;
background: #fa3534;
color: #ffffff;
margin-top: 10px;
}
.zhuangtai {
background: #a7a0a04a;
width: 224rpx;
margin-right: -27rpx;
border: 2rpx solid #a7a0a04a;
border-radius: 12rpx;
text-align: center;
margin-bottom: 10rpx;
}
.zhuangtai[data-state='1'] {
color: green;
}
.zhuangtai[data-state='0'] {
color: blue;
}
}
}
}
.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 {
}
.photoList {
display: flex;
padding-top: 12rpx;
.chooseBtn {
width: 202rpx;
height: 202rpx;
background: #fafafa;
border-radius: 12rpx;
border: 2rpx dashed #e2e2e2;
display: flex;
justify-content: center;
align-items: center;
.inner {
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.desc {
font-size: 28rpx;
font-weight: 400;
color: #24252a;
line-height: 40rpx;
}
.img {
width: 50rpx;
height: 50rpx;
margin-bottom: 6rpx;
}
}
.photoBox {
width: 202rpx;
height: 202rpx;
background: #fafafa;
border-radius: 12rpx;
position: relative;
.closeBtn {
position: absolute;
top: -12rpx;
right: -12rpx;
z-index: 2;
width: 36rpx;
height: 36rpx;
.img {
width: 36rpx;
height: 36rpx;
}
}
.img {
width: 202rpx;
height: 202rpx;
border-radius: 12rpx;
}
}
.itemBox {
flex: 0 0 202rpx;
margin-right: 20rpx;
&:last-child {
margin-right: 0;
}
}
// /deep/ .remarksBox textarea {
// font-size: 24rpx;
// }
}
.form3 {
padding: 20rpx;
//border-radius: 10rpx;
//box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
.poupitem {
display: flex;
flex-direction: row;
justify-content: space-around;
margin: 20rpx;
.pouptitle {
width: 25%;
}
.poupcontent {
border: 1px solid rgba(128, 128, 128, 0.2);
}
}
}
.poupbutton {
display: flex;
justify-content: space-around;
}
.mask {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5); /* 半透明的黑色背景 */
z-index: 9999; /* 确保遮罩层在最上层 */
}
}
</style>