|
|
|
@ -4,20 +4,11 @@
|
|
|
|
|
<view class="left">
|
|
|
|
|
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
|
|
|
|
|
</view>
|
|
|
|
|
<view class="title">{{ $t("message.rawMenu_virtual_Handover_QR") }}</view>
|
|
|
|
|
<view class="title">{{ $t('message.rawMenu_virtual_Handover_QR') }}</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.summaryList"
|
|
|
|
|
:show-vert-border="false"
|
|
|
|
|
></wyb-table>
|
|
|
|
|
<wyb-table class="table" ref="table" width="100%" show-left-and-right-border enable-check="multiple" :headers="headers" :contents="model.summaryList" :show-vert-border="false"></wyb-table>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="bottom-bar">
|
|
|
|
|
<view class="extra">
|
|
|
|
@ -29,16 +20,8 @@
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-col> -->
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-form-item
|
|
|
|
|
prop="amount"
|
|
|
|
|
:label="this.$t('message.Summary_Number')"
|
|
|
|
|
label-width="120rpx"
|
|
|
|
|
>
|
|
|
|
|
<u-input
|
|
|
|
|
type="number"
|
|
|
|
|
v-model="amountForm.amount"
|
|
|
|
|
:placeholder="this.$t('message.po_PleaseInput')"
|
|
|
|
|
/>
|
|
|
|
|
<u-form-item prop="amount" :label="this.$t('message.Summary_Number')" label-width="120rpx">
|
|
|
|
|
<u-input type="number" v-model="amountForm.amount" :placeholder="this.$t('message.po_PleaseInput')" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-col>
|
|
|
|
|
</u-row>
|
|
|
|
@ -46,28 +29,13 @@
|
|
|
|
|
<u-form ref="submitForm" :model="submitForm" :error-type="['toast']">
|
|
|
|
|
<u-row class="bottom-info">
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-form-item
|
|
|
|
|
prop="receiverName"
|
|
|
|
|
:label="this.$t('message.Summary_Receiver')"
|
|
|
|
|
label-width="120rpx"
|
|
|
|
|
>
|
|
|
|
|
<u-input
|
|
|
|
|
v-model="submitForm.receiverName"
|
|
|
|
|
@confirm="onReceiverConfirm"
|
|
|
|
|
:placeholder="this.$t('message.po_PleaseInput')"
|
|
|
|
|
/>
|
|
|
|
|
<u-form-item prop="receiverName" :label="this.$t('message.Summary_Receiver')" label-width="120rpx">
|
|
|
|
|
<u-input v-model="submitForm.receiverName" @confirm="onReceiverConfirm" :placeholder="this.$t('message.po_PleaseInput')" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-form-item
|
|
|
|
|
prop="password"
|
|
|
|
|
:label="this.$t('message.Summary_Password')"
|
|
|
|
|
>
|
|
|
|
|
<u-input
|
|
|
|
|
type="password"
|
|
|
|
|
v-model="submitForm.password"
|
|
|
|
|
:placeholder="this.$t('message.po_PleaseInput')"
|
|
|
|
|
/>
|
|
|
|
|
<u-form-item prop="password" :label="this.$t('message.Summary_Password')">
|
|
|
|
|
<u-input type="password" v-model="submitForm.password" :placeholder="this.$t('message.po_PleaseInput')" />
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-col>
|
|
|
|
|
</u-row>
|
|
|
|
@ -77,12 +45,12 @@
|
|
|
|
|
<u-row>
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-button type="primary" @click="onOk">
|
|
|
|
|
{{ $t("message.dn_Confirm") }}
|
|
|
|
|
{{ $t('message.dn_Confirm') }}
|
|
|
|
|
</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-button type="success" @click="onSubmit">
|
|
|
|
|
{{ $t("message.po_Submit") }}
|
|
|
|
|
{{ $t('message.po_Submit') }}
|
|
|
|
|
</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
</u-row>
|
|
|
|
@ -92,24 +60,24 @@
|
|
|
|
|
</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";
|
|
|
|
|
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 VirtualSummary extends BasePage {
|
|
|
|
|
/**
|
|
|
|
|
* 表单引用
|
|
|
|
|
*/
|
|
|
|
|
@Ref("amountForm") readonly $amountForm!: VForm;
|
|
|
|
|
@Ref("submitForm") readonly $submitForm!: VForm;
|
|
|
|
|
@Ref('amountForm') readonly $amountForm!: VForm;
|
|
|
|
|
@Ref('submitForm') readonly $submitForm!: VForm;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 页面Module
|
|
|
|
@ -131,23 +99,23 @@ export default class VirtualSummary extends BasePage {
|
|
|
|
|
*/
|
|
|
|
|
amountForm = {
|
|
|
|
|
// oriSendSpot: '',
|
|
|
|
|
amount: "",
|
|
|
|
|
amount: '',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 上传表单
|
|
|
|
|
*/
|
|
|
|
|
submitForm = {
|
|
|
|
|
receiver: "",
|
|
|
|
|
receiverName: "",
|
|
|
|
|
password: "",
|
|
|
|
|
receiver: '',
|
|
|
|
|
receiverName: '',
|
|
|
|
|
password: '',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
amountFormRules: VFormRules<any> = {
|
|
|
|
|
amount: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: this.$t("message.Summary_PleaseInputNumber") as string,
|
|
|
|
|
message: this.$t('message.Summary_PleaseInputNumber') as string,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
@ -156,13 +124,13 @@ export default class VirtualSummary extends BasePage {
|
|
|
|
|
receiver: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: this.$t("message.Summary_PleaseInputReceiver") as string,
|
|
|
|
|
message: this.$t('message.Summary_PleaseInputReceiver') as string,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
password: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: this.$t("message.Summary_PleaseInputPassword") as string,
|
|
|
|
|
message: this.$t('message.Summary_PleaseInputPassword') as string,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
@ -209,12 +177,12 @@ export default class VirtualSummary extends BasePage {
|
|
|
|
|
const firstRecord = model.summaryList[0];
|
|
|
|
|
if (firstRecord === undefined) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.LBWK") as string,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.LBWK') as string,
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
console.log("firstRecord", firstRecord);
|
|
|
|
|
console.log('firstRecord', firstRecord);
|
|
|
|
|
await model.checkAmount({
|
|
|
|
|
sapFactoryCode: model.sapFactoryCode,
|
|
|
|
|
loginName: session.loginName as string,
|
|
|
|
@ -229,25 +197,36 @@ export default class VirtualSummary extends BasePage {
|
|
|
|
|
const firstSelection = this.model.summaryList.find((_: any) => _.checked);
|
|
|
|
|
if (firstSelection === undefined) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.Pi_tip7") as string,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.Pi_tip7') as string,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
const inputAmount = parseFloat(this.amountForm.amount);
|
|
|
|
|
const inputAmount = parseFloat(this.amountForm.amount); //本次交接数量
|
|
|
|
|
const totalHvAmount = firstSelection.totalHvAmount;
|
|
|
|
|
const totalMoAmount = firstSelection.totalMoAmount;
|
|
|
|
|
if (inputAmount + totalHvAmount - totalMoAmount > 0.000001) {
|
|
|
|
|
const demand = firstSelection.amount; //需求数量
|
|
|
|
|
const totalMoAmount = firstSelection.totalMoAmount; //累计拣配数量
|
|
|
|
|
console.log('2222', 2222222222222222222);
|
|
|
|
|
if (inputAmount + totalMoAmount > demand) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.Pi_tip8") as string,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.Pi_tip14') as string,
|
|
|
|
|
});
|
|
|
|
|
} else if (
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
console.log(1);
|
|
|
|
|
// if (inputAmount + totalHvAmount - totalMoAmount > 0.000001) {
|
|
|
|
|
// uni.showToast({
|
|
|
|
|
// icon: 'none',
|
|
|
|
|
// title: this.$t('message.Pi_tip8') as string,
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
if (
|
|
|
|
|
inputAmount <= 0
|
|
|
|
|
// inputAmount.toString().split(".")[1].length > 3
|
|
|
|
|
) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.Pi_tip2") as string,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.Pi_tip2') as string,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
// model.updateSummaryItem({
|
|
|
|
@ -264,8 +243,8 @@ export default class VirtualSummary extends BasePage {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.success") as string,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.success') as string,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -280,11 +259,11 @@ export default class VirtualSummary extends BasePage {
|
|
|
|
|
if (valid) {
|
|
|
|
|
let qtyStase = false;
|
|
|
|
|
let selectsta = true;
|
|
|
|
|
console.log("qqq", model.summaryList);
|
|
|
|
|
console.log('qqq', model.summaryList);
|
|
|
|
|
if (model.summaryList.length === 0) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.Pi_tip4") as string,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.Pi_tip4') as string,
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
@ -301,15 +280,15 @@ export default class VirtualSummary extends BasePage {
|
|
|
|
|
}
|
|
|
|
|
if (selectsta) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.Pi_tip4") as string,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.Pi_tip4') as string,
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (qtyStase) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.Summary_PleaseInputNumber") as string,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.Summary_PleaseInputNumber') as string,
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -329,16 +308,16 @@ export default class VirtualSummary extends BasePage {
|
|
|
|
|
dataList: model.summaryList.map((item) => ({
|
|
|
|
|
...pick(
|
|
|
|
|
[
|
|
|
|
|
"materialCode",
|
|
|
|
|
"materialDesc",
|
|
|
|
|
"unit",
|
|
|
|
|
"wkposCode",
|
|
|
|
|
"prdMaterialDesc",
|
|
|
|
|
"sendSpot",
|
|
|
|
|
'materialCode',
|
|
|
|
|
'materialDesc',
|
|
|
|
|
'unit',
|
|
|
|
|
'wkposCode',
|
|
|
|
|
'prdMaterialDesc',
|
|
|
|
|
'sendSpot',
|
|
|
|
|
// 'oriSendSpot',
|
|
|
|
|
"mrpCode",
|
|
|
|
|
'mrpCode',
|
|
|
|
|
],
|
|
|
|
|
item
|
|
|
|
|
item,
|
|
|
|
|
),
|
|
|
|
|
amount: String(item.amount),
|
|
|
|
|
hvAmount: String(item.hvAmount),
|
|
|
|
@ -346,13 +325,11 @@ export default class VirtualSummary extends BasePage {
|
|
|
|
|
totalHvAmount: String(item.totalHvAmount),
|
|
|
|
|
factoryCode: model.sapFactoryCode,
|
|
|
|
|
})),
|
|
|
|
|
includeOrderOutIdList: model.proOrderResultList.map(
|
|
|
|
|
(item: any) => item.orderOutId
|
|
|
|
|
),
|
|
|
|
|
includeOrderOutIdList: model.proOrderResultList.map((item: any) => item.orderOutId),
|
|
|
|
|
});
|
|
|
|
|
this.submitForm.receiverName = "";
|
|
|
|
|
this.submitForm.receiver = "";
|
|
|
|
|
this.submitForm.password = "";
|
|
|
|
|
this.submitForm.receiverName = '';
|
|
|
|
|
this.submitForm.receiver = '';
|
|
|
|
|
this.submitForm.password = '';
|
|
|
|
|
this.isBusinessFinished = true;
|
|
|
|
|
model.clearProOrderResultList();
|
|
|
|
|
setTimeout(() => {
|
|
|
|
@ -374,8 +351,8 @@ export default class VirtualSummary extends BasePage {
|
|
|
|
|
});
|
|
|
|
|
} catch (e) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: (this.$t("message.Summary_Tip") as string) + e.message,
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: (this.$t('message.Summary_Tip') as string) + e.message,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -384,8 +361,7 @@ export default class VirtualSummary extends BasePage {
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.page-aggregating-order {
|
|
|
|
|
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: 30rpx;
|
|
|
|
|
min-height: 100%;
|
|
|
|
|