|
|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
<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">
|
|
|
|
|
@ -59,7 +59,10 @@
|
|
|
|
|
</u-form-item>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-form-item prop="password" :label="this.$t('message.Summary_Password')">
|
|
|
|
|
<u-form-item
|
|
|
|
|
prop="password"
|
|
|
|
|
:label="this.$t('message.Summary_Password')"
|
|
|
|
|
>
|
|
|
|
|
<u-input
|
|
|
|
|
type="password"
|
|
|
|
|
v-model="submitForm.password"
|
|
|
|
|
@ -73,10 +76,14 @@
|
|
|
|
|
<view class="container">
|
|
|
|
|
<u-row>
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-button type="primary" @click="onOk"> {{ $t('message.dn_Confirm') }} </u-button>
|
|
|
|
|
<u-button type="primary" @click="onOk">
|
|
|
|
|
{{ $t("message.dn_Confirm") }}
|
|
|
|
|
</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col :span="6">
|
|
|
|
|
<u-button type="success" @click="onSubmit"> {{ $t('message.po_Submit') }} </u-button>
|
|
|
|
|
<u-button type="success" @click="onSubmit">
|
|
|
|
|
{{ $t("message.po_Submit") }}
|
|
|
|
|
</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
</u-row>
|
|
|
|
|
</view>
|
|
|
|
|
@ -85,24 +92,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
|
|
|
|
|
@ -124,28 +131,39 @@ 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 }],
|
|
|
|
|
amount: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: this.$t("message.Summary_PleaseInputNumber") as string,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
submitFormRules: VFormRules<any> = {
|
|
|
|
|
receiver: [
|
|
|
|
|
{ required: true, message: this.$t('message.Summary_PleaseInputReceiver') as string },
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: this.$t("message.Summary_PleaseInputReceiver") as string,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
password: [
|
|
|
|
|
{ required: true, message: this.$t('message.Summary_PleaseInputPassword') as string },
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: this.$t("message.Summary_PleaseInputPassword") as string,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -190,10 +208,13 @@ 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 });
|
|
|
|
|
uni.showToast({
|
|
|
|
|
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,
|
|
|
|
|
@ -207,25 +228,45 @@ 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 });
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.Pi_tip7") as string,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
const inputAmount = parseFloat(this.amountForm.amount);
|
|
|
|
|
const totalHvAmount = firstSelection.totalHvAmount;
|
|
|
|
|
const totalMoAmount = firstSelection.totalMoAmount;
|
|
|
|
|
if (inputAmount + totalHvAmount - totalMoAmount > 0.000001) {
|
|
|
|
|
uni.showToast({ icon: 'none', title: this.$t('message.Pi_tip8') as string });
|
|
|
|
|
} else if (inputAmount <= 0 || inputAmount.toString().split('.')[1].length > 3) {
|
|
|
|
|
uni.showToast({ icon: 'none', title: this.$t('message.Pi_tip2') as string });
|
|
|
|
|
} else {
|
|
|
|
|
model.updateSummaryItem({
|
|
|
|
|
index: this.model.summaryList.findIndex((_: any) => _.checked),
|
|
|
|
|
newItem: {
|
|
|
|
|
...firstSelection,
|
|
|
|
|
// oriSendSpot: this.amountForm.oriSendSpot,
|
|
|
|
|
hvAmount: inputAmount,
|
|
|
|
|
},
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.Pi_tip8") as string,
|
|
|
|
|
});
|
|
|
|
|
} else if (
|
|
|
|
|
inputAmount <= 0
|
|
|
|
|
// inputAmount.toString().split(".")[1].length > 3
|
|
|
|
|
) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.Pi_tip2") as string,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
// model.updateSummaryItem({
|
|
|
|
|
// index: this.model.summaryList.findIndex((_: any) => _.checked),
|
|
|
|
|
// newItem: {
|
|
|
|
|
// ...firstSelection,
|
|
|
|
|
// // oriSendSpot: this.amountForm.oriSendSpot,
|
|
|
|
|
// hvAmount: inputAmount,
|
|
|
|
|
// },
|
|
|
|
|
// });
|
|
|
|
|
this.model.summaryList.forEach((item: any) => {
|
|
|
|
|
if (item.checked) {
|
|
|
|
|
item.hvAmount = this.amountForm.amount;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.success") as string,
|
|
|
|
|
});
|
|
|
|
|
uni.showToast({ icon: 'none', title: this.$t('message.success') as string });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
@ -239,9 +280,12 @@ 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 });
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: this.$t("message.Pi_tip4") as string,
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
model.summaryList.map((item) => {
|
|
|
|
|
@ -257,19 +301,26 @@ 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;
|
|
|
|
|
}
|
|
|
|
|
console.log('111');
|
|
|
|
|
let res = await auth.checkPassword({
|
|
|
|
|
rfPwd: this.submitForm.password,
|
|
|
|
|
factoryCode: session.factoryCode as string,
|
|
|
|
|
loginName: this.submitForm.receiverName,
|
|
|
|
|
});
|
|
|
|
|
if (res.code != 1) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
await model.uploadSummaryList({
|
|
|
|
|
operatorPass: this.submitForm.receiver,
|
|
|
|
|
factoryCode: session.factoryCode as string,
|
|
|
|
|
@ -278,16 +329,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),
|
|
|
|
|
@ -295,13 +346,14 @@ 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;
|
|
|
|
|
// uni.navigateBack({ delta: 2 });
|
|
|
|
|
model.clearProOrderResultList();
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
uni.navigateBack({ delta: 2 });
|
|
|
|
|
@ -322,8 +374,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,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -332,7 +384,8 @@ 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%;
|
|
|
|
|
|