|
|
|
@ -1,97 +1,57 @@
|
|
|
|
|
<template>
|
|
|
|
|
<view class="page-product-receipt">
|
|
|
|
|
<view
|
|
|
|
|
class="header"
|
|
|
|
|
:style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }"
|
|
|
|
|
>
|
|
|
|
|
<view class="header" :style="{ backgroundColor: `rgba(23, 83, 234, ${scrollTop / 100})` }">
|
|
|
|
|
<view class="left">
|
|
|
|
|
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
|
|
|
|
|
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack({})" />
|
|
|
|
|
</view>
|
|
|
|
|
<view class="title">{{ $t("message.Inventory") }}</view>
|
|
|
|
|
<view class="title">{{ $t('message.Inventory') }}</view>
|
|
|
|
|
<view class="right"></view>
|
|
|
|
|
</view>
|
|
|
|
|
<u-form class="form" ref="form" :model="form" label-width="180rpx">
|
|
|
|
|
<u-form-item
|
|
|
|
|
:required="true"
|
|
|
|
|
:label="$t('message.Warehouse_OrderNo')"
|
|
|
|
|
prop="pddNo"
|
|
|
|
|
>
|
|
|
|
|
<u-search
|
|
|
|
|
:placeholder="$t('message.po_PleaseInput')"
|
|
|
|
|
v-model="form.pddNo"
|
|
|
|
|
@search="model.getProductCode"
|
|
|
|
|
:show-action="false"
|
|
|
|
|
></u-search>
|
|
|
|
|
<!-- 单号 -->
|
|
|
|
|
<u-form-item :required="true" :label="$t('message.Warehouse_OrderNo')" prop="pddNo">
|
|
|
|
|
<u-search :placeholder="$t('message.po_PleaseInput')" v-model="form.pddNo" @search="model.getProductCode" :show-action="false"></u-search>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<!-- 库位 -->
|
|
|
|
|
<u-form-item :required="true" :label="$t('message.product_Location')">
|
|
|
|
|
<u-input
|
|
|
|
|
v-model="form.originWl.locCode"
|
|
|
|
|
type="select"
|
|
|
|
|
@click="originWlSelect = true"
|
|
|
|
|
:placeholder="$t('message.po_PleaseInput')"
|
|
|
|
|
/>
|
|
|
|
|
<u-select
|
|
|
|
|
:confirm-text="$t('message.product_Confirm')"
|
|
|
|
|
:cancel-text="$t('message.product_Cancel')"
|
|
|
|
|
v-model="originWlSelect"
|
|
|
|
|
:list="model.WlList"
|
|
|
|
|
@confirm="onchange"
|
|
|
|
|
></u-select>
|
|
|
|
|
<u-input v-model="form.originWl.locCode" type="select" @click="originWlSelect = true" :placeholder="$t('message.po_PleaseInput')" />
|
|
|
|
|
<u-select :confirm-text="$t('message.product_Confirm')" :cancel-text="$t('message.product_Cancel')" v-model="originWlSelect" :list="model.WlList" @confirm="onchange"></u-select>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<!-- 扫码 -->
|
|
|
|
|
<u-form-item :label="$t('message.Warehouse_ScanCode')">
|
|
|
|
|
<u-search
|
|
|
|
|
v-model="form.code"
|
|
|
|
|
:placeholder="$t('message.po_PleaseInput')"
|
|
|
|
|
@search="scanCode"
|
|
|
|
|
:show-action="false"
|
|
|
|
|
></u-search>
|
|
|
|
|
<u-search v-model="form.code" :placeholder="$t('message.po_PleaseInput')" @search="scanCode" :show-action="false"></u-search>
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<u-row>
|
|
|
|
|
<!-- 已扫 -->
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-form-item :label="$t('message.product_Swept')" label-width="80rpx">
|
|
|
|
|
<u-input
|
|
|
|
|
:disabled="true"
|
|
|
|
|
v-model="aaa"
|
|
|
|
|
placeholder=""
|
|
|
|
|
/>
|
|
|
|
|
<u-input :disabled="true" v-model="form.spQty" placeholder="" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-col>
|
|
|
|
|
<!-- 总数 -->
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-form-item
|
|
|
|
|
:label="$t('message.Warehouse_TotalNumber')"
|
|
|
|
|
label-width="80rpx"
|
|
|
|
|
>
|
|
|
|
|
<u-input
|
|
|
|
|
v-model="bbb"
|
|
|
|
|
:placeholder="$t('message.po_PleaseInput')"
|
|
|
|
|
/>
|
|
|
|
|
<u-form-item :label="$t('message.Warehouse_TotalNumber')" label-width="80rpx">
|
|
|
|
|
<u-input v-model="form.ypQty" :placeholder="$t('message.po_PleaseInput')" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-col>
|
|
|
|
|
</u-row>
|
|
|
|
|
<!-- 成品描述 -->
|
|
|
|
|
<u-form-item :label="$t('message.product_FGDes')">
|
|
|
|
|
<u-input
|
|
|
|
|
v-model="productDescZh"
|
|
|
|
|
:placeholder="$t('message.po_PleaseInput')"
|
|
|
|
|
/>
|
|
|
|
|
<u-input v-model="productDescZh" :placeholder="$t('message.po_PleaseInput')" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
<!-- 成品编码 -->
|
|
|
|
|
<u-form-item :label="$t('message.product_FGCode')">
|
|
|
|
|
<u-input
|
|
|
|
|
v-model="productCode"
|
|
|
|
|
:placeholder="$t('message.po_PleaseInput')"
|
|
|
|
|
/>
|
|
|
|
|
<u-input v-model="productCode" :placeholder="$t('message.po_PleaseInput')" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-form>
|
|
|
|
|
<!-- 底部Button -->
|
|
|
|
|
<view class="bottom-bar">
|
|
|
|
|
<u-row class="button-bar">
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-button type="primary" @click="onSubmit">{{
|
|
|
|
|
$t("message.workArea_Confirm")
|
|
|
|
|
}}</u-button>
|
|
|
|
|
<u-button type="primary" @click="onSubmit">{{ $t('message.workArea_Confirm') }}</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-button type="error" @click="uni.navigateBack()">{{
|
|
|
|
|
$t("message.po_Return")
|
|
|
|
|
}}</u-button>
|
|
|
|
|
<u-button type="error" @click="uni.navigateBack({})">{{ $t('message.po_Return') }}</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
</u-row>
|
|
|
|
|
</view>
|
|
|
|
@ -99,11 +59,11 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
import { Component, Ref } from "vue-property-decorator";
|
|
|
|
|
import { BasePage } from "@/components/base/page";
|
|
|
|
|
import { VForm, VFormRules } from "vue/types/form";
|
|
|
|
|
import model from "./model";
|
|
|
|
|
import { session } from "@/store/modules/session";
|
|
|
|
|
import { Component, Ref } from 'vue-property-decorator';
|
|
|
|
|
import { BasePage } from '@/components/base/page';
|
|
|
|
|
import { VForm, VFormRules } from 'vue/types/form';
|
|
|
|
|
import model from './model';
|
|
|
|
|
import { session } from '@/store/modules/session';
|
|
|
|
|
|
|
|
|
|
interface OptionType {
|
|
|
|
|
label: string;
|
|
|
|
@ -121,7 +81,7 @@ export default class productCheckReceipt extends BasePage {
|
|
|
|
|
/**
|
|
|
|
|
* 表单引用
|
|
|
|
|
*/
|
|
|
|
|
@Ref("form") readonly $form!: VForm;
|
|
|
|
|
@Ref('form') readonly $form!: VForm;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 页面Module
|
|
|
|
@ -134,21 +94,25 @@ export default class productCheckReceipt extends BasePage {
|
|
|
|
|
*/
|
|
|
|
|
form = {
|
|
|
|
|
originWl: {} as OptionType,
|
|
|
|
|
pddNo: "",
|
|
|
|
|
code: "",
|
|
|
|
|
pdMode: "",
|
|
|
|
|
pddNo: '',
|
|
|
|
|
code: '',
|
|
|
|
|
pdMode: '',
|
|
|
|
|
// 已扫
|
|
|
|
|
spQty: null,
|
|
|
|
|
// 总数
|
|
|
|
|
ypQty: null,
|
|
|
|
|
};
|
|
|
|
|
productCode: any = ""; //成品编码
|
|
|
|
|
productDescZh: any = ""; //成品描述
|
|
|
|
|
// aaa: any = "";
|
|
|
|
|
// bbb: any = "";
|
|
|
|
|
|
|
|
|
|
productCode: any = ''; //成品编码
|
|
|
|
|
productDescZh: any = ''; //成品描述
|
|
|
|
|
// 库位select是否显示
|
|
|
|
|
originWlSelect = false;
|
|
|
|
|
aimWlSelect = false;
|
|
|
|
|
cboPlaceSelect = false;
|
|
|
|
|
|
|
|
|
|
rules: VFormRules<any> = {
|
|
|
|
|
originWl: [
|
|
|
|
|
{ required: true, message: this.$t("message.Warehouse_Tip2") as string }, //请选择库位地点
|
|
|
|
|
{ required: true, message: this.$t('message.Warehouse_Tip2') as string }, //请选择库位地点
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
show = false;
|
|
|
|
@ -156,24 +120,31 @@ export default class productCheckReceipt extends BasePage {
|
|
|
|
|
this.$form.setRules(this.rules);
|
|
|
|
|
}
|
|
|
|
|
onchange(e: any) {
|
|
|
|
|
console.log("e", e);
|
|
|
|
|
this.model.WlListaa.forEach((item: any) => {
|
|
|
|
|
if (item.locCode == e[0].value) {
|
|
|
|
|
this.form.originWl = item;
|
|
|
|
|
// aaa += item.spQty;
|
|
|
|
|
this.aaa += item.spQty;
|
|
|
|
|
this.bbb += item.ypQty;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取选择库位的集合
|
|
|
|
|
const storeList = this.model.WlListaa.filter((item) => item.locCode === e[0].value);
|
|
|
|
|
// 获取现有的 spQty、ypQty 总数
|
|
|
|
|
const total = storeList.reduce(
|
|
|
|
|
(total, item) => {
|
|
|
|
|
return {
|
|
|
|
|
spQty: total.spQty + item.spQty,
|
|
|
|
|
ypQty: total.ypQty + item.ypQty,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
{ spQty: 0, ypQty: 0 },
|
|
|
|
|
);
|
|
|
|
|
const originWl = this.model.WlListaa.find((item) => item.locCode === e[0].value);
|
|
|
|
|
// 为form表单绑定值
|
|
|
|
|
Object.assign(this.form, {
|
|
|
|
|
originWl: originWl,
|
|
|
|
|
...total,
|
|
|
|
|
});
|
|
|
|
|
console.log("this.form.originwl",this.form.originWl);
|
|
|
|
|
}
|
|
|
|
|
// 成功查询后,已扫+1
|
|
|
|
|
async scanCode(e: any) {
|
|
|
|
|
if (!this.form.pddNo) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.Warehouse_Tip5") as string, //请扫描单号
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.Warehouse_Tip5') as string, //请扫描单号
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -191,8 +162,8 @@ export default class productCheckReceipt extends BasePage {
|
|
|
|
|
qty: 1,
|
|
|
|
|
};
|
|
|
|
|
await this.model.toScanCode(list);
|
|
|
|
|
if (this.model.records.code == "1") {
|
|
|
|
|
this.aaa += 1;
|
|
|
|
|
if (this.model.records.code == '1') {
|
|
|
|
|
this.form.spQty = this.form.spQty + 1;
|
|
|
|
|
this.productCode = this.model.productCode;
|
|
|
|
|
this.productDescZh = this.model.productDescZh;
|
|
|
|
|
}
|
|
|
|
@ -202,15 +173,15 @@ export default class productCheckReceipt extends BasePage {
|
|
|
|
|
if (!valid) return;
|
|
|
|
|
if (!this.form.pddNo) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.Warehouse_Tip5") as string, //请扫描单号
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.Warehouse_Tip5') as string, //请扫描单号
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (!this.form.originWl.productCode) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.Warehouse_Tip6") as string, //请选择物料
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.Warehouse_Tip6') as string, //请选择物料
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -218,10 +189,10 @@ export default class productCheckReceipt extends BasePage {
|
|
|
|
|
this.commit();
|
|
|
|
|
} else {
|
|
|
|
|
uni.showModal({
|
|
|
|
|
title: "Tip",
|
|
|
|
|
content: this.$t("message.Warehouse_Tip7") as string, //盘点未完成 确定继续嘛
|
|
|
|
|
confirmText: this.$t("message.workArea_Confirm") as string, //确定
|
|
|
|
|
cancelText: this.$t("message.Cancel") as string, //取消
|
|
|
|
|
title: 'Tip',
|
|
|
|
|
content: this.$t('message.Warehouse_Tip7') as string, //盘点未完成 确定继续嘛
|
|
|
|
|
confirmText: this.$t('message.workArea_Confirm') as string, //确定
|
|
|
|
|
cancelText: this.$t('message.Cancel') as string, //取消
|
|
|
|
|
showCancel: true,
|
|
|
|
|
success: (res) => {
|
|
|
|
|
if (res.confirm) {
|
|
|
|
@ -248,7 +219,6 @@ export default class productCheckReceipt extends BasePage {
|
|
|
|
|
sn: this.form.code,
|
|
|
|
|
spQty: this.aaa,
|
|
|
|
|
};
|
|
|
|
|
console.log("orderlist", list);
|
|
|
|
|
await this.model.onTakeoutConfirm(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -256,8 +226,7 @@ export default class productCheckReceipt extends BasePage {
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.page-product-receipt {
|
|
|
|
|
background: #f2f2f2
|
|
|
|
|
linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
|
|
|
|
|
background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
|
|
|
|
|
background-size: 100% 600rpx;
|
|
|
|
|
padding: 118rpx 30rpx 162rpx;
|
|
|
|
|
min-height: 100%;
|
|
|
|
|