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.

243 lines
6.8 KiB
Vue

<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="back" />
</view>
<view class="title">{{ $t('message.raw_Inventory') }}</view>
<view class="right"></view>
</view>
<u-form class="form" ref="form" :model="productItem" label-width="180rpx">
<!-- 单号 -->
<u-form-item :required="true" :label="$t('message.InventoryOrderNo')" prop="pddNo">
<u-search :placeholder="$t('message.InventoryPleaseScan')" v-model.trim="pddNo" @search="rawMaterialInventoryCheckRaw" :show-action="false"></u-search>
<view class="single-right">
<u-button type="primary" @click="rawMaterialInventoryCheckRaw">{{ $t('message.Query') }}</u-button>
</view>
</u-form-item>
<!-- 已扫总数 -->
<u-form-item :label="$t('message.Total_scanned')" prop="spQty">
<u-input v-model="allNum" placeholder=" " :disabled="true" type="number" />
</u-form-item>
<!-- 库位 -->
<u-form-item :label="$t('message.CommissionedLocation')" prop="spQty">
<u-input v-model="productItem.locCode" placeholder=" " :disabled="true" type="text" />
</u-form-item>
<!-- 物料号 -->
<u-form-item :label="$t('message.po_MaterielNo')" prop="productDescZh">
<jPicker sureColor="#ff0000" style="width: 230rpx" @bindpicker="onchange" showKey="value" valKey="value" :val="wl.value" class="search" :options="model.InventoryItemList" />
</u-form-item>
<!-- 物料名 -->
<u-form-item :label="$t('message.InventoryMateriel')" prop="productDescZh">
<u-input v-model="productItem.productDescZh" placeholder=" " :disabled="true" type="text" />
</u-form-item>
<!-- 物料已扫 -->
<u-form-item :label="$t('message.product_Swept')" prop="productDescZh">
<u-input v-model="productItem.spQty" placeholder=" " :disabled="true" type="number" />
</u-form-item>
<!-- 数量 -->
<u-form-item :label="$t('message.dn_Number')" prop="spQty">
<u-input v-model="spQty" :placeholder="$t('message.PleaseQuantity')" type="number" />
</u-form-item>
</u-form>
<view class="bottom-bar">
<u-row class="button-bar">
<u-col :span="4">
<u-button type="primary" @click="checkRawCreateInfo">{{ $t('message.workArea_Confirm') }}</u-button>
</u-col>
<u-col :span="4">
<u-button type="primary" @click="checkRawOrderComplete">{{ $t('message.InventoryFinish') }}</u-button>
</u-col>
<u-col :span="4">
<u-button type="error" @click="back">{{ $t('message.po_Return') }}</u-button>
</u-col>
</u-row>
</view>
</view>
</template>
<script lang="ts">
import { Component, Ref } from 'vue-property-decorator';
import { BasePage } from '@/components/base/page';
import { VForm } from 'vue/types/form';
import model from './model';
import jPicker from '@/components/J-Picker/jPicker.vue';
@Component({
components: {
jPicker,
},
})
export default class rawMaterialInventory extends BasePage {
@Ref('form') readonly $form!: VForm;
model = model;
index() {
this.toPage(this.page.raw.index);
}
pddNo: any = '';
spQty: any = '';
productItem: any = {};
allNum = 0;
originWlSelect = false;
wl: any = {};
// 页面初始化
onReady() {
this.empty();
}
empty() {
this.model.orderInInfo.carNo = '';
this.model.orderInInfo.bookingTime = '';
this.model.orderInInfo.supplyCode = '';
this.model.orderInInfo.poType = '';
this.model.orderInInfo.location = '';
this.spQty = '';
this.productItem = {};
this.allNum = 0;
}
//单号查询
async rawMaterialInventoryCheckRaw() {
if (!this.pddNo) {
uni.showToast({
icon: 'none',
title: this.$t('message.Commission_tips1') as any,
});
return;
}
await this.model.rawMaterialInventoryCheckRaw(this.pddNo);
if (this.model.InventoryList.length != 0) {
this.allNum = 0;
this.model.InventoryList.forEach((item: any) => {
this.allNum += parseFloat(item.spQty);
});
this.productItem = this.model.InventoryList[0];
this.wl = this.model.InventoryItemList[0];
}
}
//选择其中一条物料
onchange(e: any) {
this.model.InventoryList.forEach((item: any) => {
if (item.productCode == e.pickerName.label) {
this.productItem = item;
}
});
}
//点击确定
async checkRawCreateInfo() {
if (!this.spQty) {
uni.showToast({
icon: 'none',
title: this.$t('message.Summary_PleaseInputNumber') as any,
});
return;
}
if (!this.pddNo) {
uni.showToast({
icon: 'none',
title: this.$t('message.Commission_tips1') as any,
});
return;
}
let params = {
factoryCode: this.session.factoryCode,
loginName: this.session.loginName,
pddNo: this.pddNo,
productCode: this.productItem.productCode,
productDescZh: this.productItem.productDescZh,
spQty: this.spQty,
};
await model.checkRawProductComplete(params);
if (this.model.code == '1') {
this.empty();
await this.rawMaterialInventoryCheckRaw();
}
}
//点击完成
async checkRawOrderComplete() {
await model.checkRawOrderComplete(this.pddNo);
if (this.model.code == '1') {
uni.showToast({ title: this.$t('message.Warehouse_Tip9') as any });
this.empty();
this.pddNo = '';
}
}
//返回
back() {
uni.navigateBack({ delta: 1 });
}
}
</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: 36rpx;
left: 0;
right: 0;
z-index: 99;
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;
}
}
.single-right {
button {
//margin-top: 15rpx;
width: 110rpx;
height: 70rpx;
}
}
.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>