|
|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
<view class="left">
|
|
|
|
|
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
|
|
|
|
|
</view>
|
|
|
|
|
<view class="title">{{ $t('message.Summary_SummaryAndHandover') }}</view>
|
|
|
|
|
<view class="title">{{ $t("message.Summary_SummaryAndHandover") }}</view>
|
|
|
|
|
<view class="right"></view>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="table-wrapper">
|
|
|
|
|
@ -54,7 +54,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"
|
|
|
|
|
@ -69,14 +72,18 @@
|
|
|
|
|
<u-row>
|
|
|
|
|
<u-col :span="4">
|
|
|
|
|
<u-button type="warning" @click="onSelectAll">
|
|
|
|
|
{{ $t('message.po_SelectAll') }}
|
|
|
|
|
{{ $t("message.po_SelectAll") }}
|
|
|
|
|
</u-button>
|
|
|
|
|
</u-col>
|
|
|
|
|
<u-col :span="4">
|
|
|
|
|
<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="4">
|
|
|
|
|
<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 AggregatingSummary extends BasePage {
|
|
|
|
|
/**
|
|
|
|
|
* 表单引用
|
|
|
|
|
*/
|
|
|
|
|
@Ref('amountForm') readonly $amountForm!: VForm;
|
|
|
|
|
@Ref('submitForm') readonly $submitForm!: VForm;
|
|
|
|
|
@Ref("amountForm") readonly $amountForm!: VForm;
|
|
|
|
|
@Ref("submitForm") readonly $submitForm!: VForm;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 页面Module
|
|
|
|
|
@ -123,28 +130,39 @@ export default class AggregatingSummary extends BasePage {
|
|
|
|
|
* 更改数量表单
|
|
|
|
|
*/
|
|
|
|
|
amountForm = {
|
|
|
|
|
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,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@ -187,7 +205,10 @@ export default class AggregatingSummary extends BasePage {
|
|
|
|
|
if (!valid) return;
|
|
|
|
|
const firstSelection = this.model.aggregateList.find((_) => _.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 currentPickNum = parseFloat(this.amountForm.amount);
|
|
|
|
|
@ -195,16 +216,22 @@ export default class AggregatingSummary extends BasePage {
|
|
|
|
|
const totalHvAmount = parseFloat(firstSelection.totalHvAmount);
|
|
|
|
|
// 拣配数量
|
|
|
|
|
const totalMoAmount = parseFloat(firstSelection.totalMoAmount);
|
|
|
|
|
if (currentPickNum <= 0 || currentPickNum.toString().split('.')[1].length > 3) {
|
|
|
|
|
uni.showToast({ icon: 'none', title: this.$t('message.Pi_tip2') as string });
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// if (
|
|
|
|
|
// currentPickNum <= 0 ||
|
|
|
|
|
// currentPickNum.toString().split(".")[1].length > 3
|
|
|
|
|
// ) {
|
|
|
|
|
// uni.showToast({
|
|
|
|
|
// icon: "none",
|
|
|
|
|
// title: this.$t("message.Pi_tip2") as string,
|
|
|
|
|
// });
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
if (currentPickNum + totalHvAmount - totalMoAmount > 0.000001) {
|
|
|
|
|
uni.showModal({
|
|
|
|
|
title: 'Tip',
|
|
|
|
|
content: this.$t('message.Pi_tip11') as string,
|
|
|
|
|
confirmText: this.$t('message.workArea_Confirm') as string,
|
|
|
|
|
cancelText: this.$t('message.Cancel') as string,
|
|
|
|
|
title: "Tip",
|
|
|
|
|
content: this.$t("message.Pi_tip11") as string,
|
|
|
|
|
confirmText: this.$t("message.workArea_Confirm") as string,
|
|
|
|
|
cancelText: this.$t("message.Cancel") as string,
|
|
|
|
|
showCancel: true,
|
|
|
|
|
success: (res) => {
|
|
|
|
|
if (res.confirm) {
|
|
|
|
|
@ -232,36 +259,66 @@ export default class AggregatingSummary extends BasePage {
|
|
|
|
|
this.$submitForm.validate(async (valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (model.aggregateList.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,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
await auth.checkPassword({
|
|
|
|
|
rfPwd: this.submitForm.password,
|
|
|
|
|
factoryCode: session.factoryCode as string,
|
|
|
|
|
loginName: this.submitForm.receiver,
|
|
|
|
|
});
|
|
|
|
|
let submit = false;
|
|
|
|
|
let selectsta = true;
|
|
|
|
|
model.aggregateList.forEach((item) => {
|
|
|
|
|
if (!item.checked) {
|
|
|
|
|
return;
|
|
|
|
|
} else if (item.hvAmount == null || item.hvAmount == 0) {
|
|
|
|
|
submit = true;
|
|
|
|
|
}
|
|
|
|
|
// await auth.checkPassword({
|
|
|
|
|
// rfPwd: this.submitForm.password,
|
|
|
|
|
// factoryCode: session.factoryCode as string,
|
|
|
|
|
// loginName: this.submitForm.receiver,
|
|
|
|
|
// });
|
|
|
|
|
// let submit = false;
|
|
|
|
|
// let selectsta = true;
|
|
|
|
|
// model.aggregateList.forEach((item) => {
|
|
|
|
|
// if (!item.checked) {
|
|
|
|
|
// return;
|
|
|
|
|
// } else if (item.hvAmount == null || item.hvAmount == 0) {
|
|
|
|
|
// submit = true;
|
|
|
|
|
// }
|
|
|
|
|
// if (item.checked) {
|
|
|
|
|
// selectsta = false;
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// if (selectsta) {
|
|
|
|
|
// uni.showToast({
|
|
|
|
|
// icon: "none",
|
|
|
|
|
// title: this.$t("message.Pi_tip4") as string,
|
|
|
|
|
// });
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
// if (submit) {
|
|
|
|
|
// uni.showToast({
|
|
|
|
|
// icon: "none",
|
|
|
|
|
// title: this.$t("message.Summary_PleaseInputNumber") as string,
|
|
|
|
|
// });
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
let List: any = [];
|
|
|
|
|
let isTrue = true;
|
|
|
|
|
this.model.aggregateList.forEach((item: any) => {
|
|
|
|
|
if (item.checked) {
|
|
|
|
|
selectsta = false;
|
|
|
|
|
List.push(item);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (selectsta) {
|
|
|
|
|
if (List.length == 0) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.Pi_tip4') as string,
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: "请先选择要提交的物料" as string,
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (submit) {
|
|
|
|
|
List.forEach((item: any) => {
|
|
|
|
|
if (item.hvAmount != item.amount) {
|
|
|
|
|
isTrue = false;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
if (isTrue != true) {
|
|
|
|
|
uni.showToast({
|
|
|
|
|
icon: 'none',
|
|
|
|
|
title: this.$t('message.Summary_PleaseInputNumber') as string,
|
|
|
|
|
icon: "none",
|
|
|
|
|
title: "请确保交接数量等于需求数量" as string,
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
@ -269,32 +326,34 @@ export default class AggregatingSummary extends BasePage {
|
|
|
|
|
operatorPass: this.submitForm.receiver,
|
|
|
|
|
factoryCode: session.factoryCode as string,
|
|
|
|
|
loginName: session.loginName as string,
|
|
|
|
|
dataList: model.aggregateList.map((item) => ({
|
|
|
|
|
dataList: List.map((item: any) => ({
|
|
|
|
|
...pick(
|
|
|
|
|
[
|
|
|
|
|
'materialCode',
|
|
|
|
|
'sapFactoryCode',
|
|
|
|
|
'materialDesc',
|
|
|
|
|
'unit',
|
|
|
|
|
'prdMaterialDesc',
|
|
|
|
|
'wkposCode',
|
|
|
|
|
'mrpCode',
|
|
|
|
|
'sendSpot',
|
|
|
|
|
"materialCode",
|
|
|
|
|
"sapFactoryCode",
|
|
|
|
|
"materialDesc",
|
|
|
|
|
"unit",
|
|
|
|
|
"prdMaterialDesc",
|
|
|
|
|
"wkposCode",
|
|
|
|
|
"mrpCode",
|
|
|
|
|
"sendSpot",
|
|
|
|
|
],
|
|
|
|
|
item,
|
|
|
|
|
item
|
|
|
|
|
),
|
|
|
|
|
amount: String(item.amount),
|
|
|
|
|
hvAmount: item.hvAmount == null ? '0' : String(item.hvAmount),
|
|
|
|
|
serialNo: item.serialNo == null ? '' : item.serialNo,
|
|
|
|
|
hvAmount: item.hvAmount == null ? "0" : String(item.hvAmount),
|
|
|
|
|
serialNo: item.serialNo == null ? "" : item.serialNo,
|
|
|
|
|
totalMoAmount: String(item.totalMoAmount),
|
|
|
|
|
totalHvAmount: String(item.totalHvAmount),
|
|
|
|
|
prdMaterialDesc: String(item.prdMaterialCode),
|
|
|
|
|
})),
|
|
|
|
|
includeOrderOutIdList: model.proOrderResultList.map((item: any) => item.orderOutId),
|
|
|
|
|
includeOrderOutIdList: model.proOrderResultList.map(
|
|
|
|
|
(item: any) => item.orderOutId
|
|
|
|
|
),
|
|
|
|
|
});
|
|
|
|
|
this.submitForm.receiver = '';
|
|
|
|
|
this.submitForm.receiverName = '';
|
|
|
|
|
this.submitForm.password = '';
|
|
|
|
|
this.submitForm.receiver = "";
|
|
|
|
|
this.submitForm.receiverName = "";
|
|
|
|
|
this.submitForm.password = "";
|
|
|
|
|
this.isBusinessFinished = true;
|
|
|
|
|
// uni.navigateBack({ delta: 2 });
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
@ -320,7 +379,9 @@ export default class AggregatingSummary extends BasePage {
|
|
|
|
|
* 解锁
|
|
|
|
|
*/
|
|
|
|
|
async unlock() {
|
|
|
|
|
const orderOutIdList = model.proOrderResultList.map((_: any) => _.orderOutId);
|
|
|
|
|
const orderOutIdList = model.proOrderResultList.map(
|
|
|
|
|
(_: any) => _.orderOutId
|
|
|
|
|
);
|
|
|
|
|
try {
|
|
|
|
|
await http.post(url.sumscan.unlock.list, {
|
|
|
|
|
factoryCode: session.factoryCode,
|
|
|
|
|
@ -329,8 +390,8 @@ export default class AggregatingSummary 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,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -339,7 +400,8 @@ export default class AggregatingSummary 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%;
|
|
|
|
|
|