guoshuang 4 years ago
commit 7620947a98

@ -4,36 +4,19 @@
<view class="left">
<u-icon class="icon" name="arrow-left" @click="uni.navigateBack()" />
</view>
<view class="title">{{ $t("message.Summary_HandoverByOrder") }}</view>
<view class="title">{{ $t('message.Summary_HandoverByOrder') }}</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.orderList"
: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.orderList" :show-vert-border="false"></wyb-table>
</view>
<view class="bottom-bar">
<view class="extra">
<u-form ref="amountForm" :model="amountForm" :error-type="['toast']">
<u-row class="bottom-info">
<u-col :span="12">
<u-form-item
prop="amount"
:label="$t('message.Summary_Number')"
label-width="120rpx"
>
<u-input
type="number"
v-model="amountForm.amount"
:placeholder="$t('message.po_PleaseInput')"
/>
<u-form-item prop="amount" :label="$t('message.Summary_Number')" label-width="120rpx">
<u-input type="number" v-model="amountForm.amount" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
</u-row>
@ -41,28 +24,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="$t('message.Summary_Receiver')"
label-width="120rpx"
>
<u-input
v-model="submitForm.receiverName"
@confirm="onReceiverConfirm"
:placeholder="$t('message.po_PleaseInput')"
/>
<u-form-item prop="receiverName" :label="$t('message.Summary_Receiver')" label-width="120rpx">
<u-input v-model="submitForm.receiverName" @confirm="onReceiverConfirm" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
<u-col :span="6">
<u-form-item
prop="password"
:label="$t('message.Summary_Password')"
>
<u-input
type="password"
v-model="submitForm.password"
:placeholder="$t('message.po_PleaseInput')"
/>
<u-form-item prop="password" :label="$t('message.Summary_Password')">
<u-input type="password" v-model="submitForm.password" :placeholder="$t('message.po_PleaseInput')" />
</u-form-item>
</u-col>
</u-row>
@ -72,17 +40,17 @@
<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") }}
{{ $t('message.dn_Confirm') }}
</u-button>
</u-col>
<u-col :span="4">
<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 { orderHeaders } 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 { orderHeaders } 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 AggregatingOrder extends BasePage {
/**
* 表单引用
*/
@Ref("amountForm") readonly $amountForm!: VForm;
@Ref("submitForm") readonly $submitForm!: VForm;
@Ref('amountForm') readonly $amountForm!: VForm;
@Ref('submitForm') readonly $submitForm!: VForm;
/**
* 页面Module
@ -130,23 +98,23 @@ export default class AggregatingOrder 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,
message: this.$t('message.Summary_PleaseInputNumber') as string,
},
],
};
@ -155,13 +123,13 @@ export default class AggregatingOrder extends BasePage {
receiverName: [
{
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,
},
],
};
@ -190,7 +158,7 @@ export default class AggregatingOrder extends BasePage {
* 接收人确认
*/
async onReceiverConfirm() {
console.log("this.submitForm", this.submitForm);
console.log('this.submitForm', this.submitForm);
const userInfo = await auth.getUserInfo({
loginName: this.submitForm.receiverName,
});
@ -207,8 +175,8 @@ export default class AggregatingOrder extends BasePage {
const firstSelection = this.model.orderList.find((_) => _.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 {
//
@ -219,17 +187,17 @@ export default class AggregatingOrder extends BasePage {
const totalMoAmount = parseFloat(firstSelection.totalMoAmount);
if (currentPickNum <= 0) {
uni.showToast({
icon: "none",
title: this.$t("message.Pi_tip2") as string,
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) {
@ -258,8 +226,8 @@ export default class AggregatingOrder extends BasePage {
if (valid) {
if (model.orderList.length === 0) {
uni.showToast({
icon: "none",
title: this.$t("message.Pi_tip4") as string,
icon: 'none',
title: this.$t('message.Pi_tip4') as string,
});
} else {
await auth.checkPassword({
@ -282,15 +250,15 @@ export default class AggregatingOrder 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 (submit) {
uni.showToast({
icon: "none",
title: this.$t("message.Summary_PleaseInputNumber") as string,
icon: 'none',
title: this.$t('message.Summary_PleaseInputNumber') as string,
});
return;
}
@ -303,24 +271,21 @@ export default class AggregatingOrder extends BasePage {
});
if (List.length == 0) {
uni.showToast({
icon: "none",
title: "请先选择要提交的物料" as string,
icon: 'none',
title: '请先选择要提交的物料' as string,
});
return;
}
List.forEach((item: any) => {
if (
parseFloat(item.totalMoAmount) - parseFloat(item.totalHvAmount) !=
parseFloat(this.amountForm.amount)
) {
if (parseFloat(item.totalMoAmount) - parseFloat(item.totalHvAmount) != parseFloat(item.hvAmount)) {
isTrue = false;
return;
}
});
if (isTrue != true) {
uni.showToast({
icon: "none",
title: "请确保交接数量等于需求数量" as string,
icon: 'none',
title: '请确保交接数量等于需求数量' as string,
});
return;
}
@ -329,39 +294,22 @@ export default class AggregatingOrder extends BasePage {
factoryCode: session.factoryCode,
loginName: session.loginName,
orderOutIdAmountList: List.map((item: any) => ({
...pick(
[
"materialCode",
"amount",
"totalHvAmount",
"sapFactoryCode",
"sendSpot",
"materialDesc",
"mrpCode",
"unit",
"prdOrder",
"proType",
"wkposCode",
"hvAmount",
"orderOutId",
],
item
),
...pick(['materialCode', 'amount', 'totalHvAmount', 'sapFactoryCode', 'sendSpot', 'materialDesc', 'mrpCode', 'unit', 'prdOrder', 'proType', 'wkposCode', 'hvAmount', 'orderOutId'], item),
pickNum: item.totalMoAmount,
factoryCode: session.factoryCode,
})),
});
this.submitForm.receiver = "";
this.submitForm.receiverName = "";
this.submitForm.password = "";
this.submitForm.receiver = '';
this.submitForm.receiverName = '';
this.submitForm.password = '';
// setTimeout(() => {
// uni.navigateBack({ delta: 2 });
// }, 2000);
// uni.navigateBack({ delta: 2 });
uni.showModal({
title: this.$t("message.Pi_tip") as string,
content: this.$t("message.Warehouse_Tip9") as string,
confirmText: this.$t("message.workArea_Confirm") as string,
title: this.$t('message.Pi_tip') as string,
content: this.$t('message.Warehouse_Tip9') as string,
confirmText: this.$t('message.workArea_Confirm') as string,
showCancel: false,
success: () => {
this.toPage(this.page.raw.handover.aggregating.index);
@ -376,9 +324,7 @@ export default class AggregatingOrder 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,
@ -387,8 +333,8 @@ export default class AggregatingOrder 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,
});
}
}
@ -397,8 +343,7 @@ export default class AggregatingOrder 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%;

@ -279,7 +279,11 @@ export default class AggregatingSummary extends BasePage {
return;
}
List.forEach((item: any) => {
if (parseFloat(item.totalMoAmount) - parseFloat(item.totalHvAmount) != parseFloat(this.amountForm.amount)) {
// console.log("111");
// console.log(item.totalMoAmount);//
// console.log(item.totalHvAmount);//
// console.log(item.hvAmount);
if (parseFloat(item.totalMoAmount) - parseFloat(item.totalHvAmount) != parseFloat(item.hvAmount)) {
isTrue = false;
return;
}

Loading…
Cancel
Save