guoshuang 4 years ago
commit 7620947a98

@ -4,36 +4,19 @@
<view class="left"> <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>
<view class="title">{{ $t("message.Summary_HandoverByOrder") }}</view> <view class="title">{{ $t('message.Summary_HandoverByOrder') }}</view>
<view class="right"></view> <view class="right"></view>
</view> </view>
<view class="table-wrapper"> <view class="table-wrapper">
<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>
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>
<view class="bottom-bar"> <view class="bottom-bar">
<view class="extra"> <view class="extra">
<u-form ref="amountForm" :model="amountForm" :error-type="['toast']"> <u-form ref="amountForm" :model="amountForm" :error-type="['toast']">
<u-row class="bottom-info"> <u-row class="bottom-info">
<u-col :span="12"> <u-col :span="12">
<u-form-item <u-form-item prop="amount" :label="$t('message.Summary_Number')" label-width="120rpx">
prop="amount" <u-input type="number" v-model="amountForm.amount" :placeholder="$t('message.po_PleaseInput')" />
: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-form-item>
</u-col> </u-col>
</u-row> </u-row>
@ -41,28 +24,13 @@
<u-form ref="submitForm" :model="submitForm" :error-type="['toast']"> <u-form ref="submitForm" :model="submitForm" :error-type="['toast']">
<u-row class="bottom-info"> <u-row class="bottom-info">
<u-col :span="6"> <u-col :span="6">
<u-form-item <u-form-item prop="receiverName" :label="$t('message.Summary_Receiver')" label-width="120rpx">
prop="receiverName" <u-input v-model="submitForm.receiverName" @confirm="onReceiverConfirm" :placeholder="$t('message.po_PleaseInput')" />
: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-form-item>
</u-col> </u-col>
<u-col :span="6"> <u-col :span="6">
<u-form-item <u-form-item prop="password" :label="$t('message.Summary_Password')">
prop="password" <u-input type="password" v-model="submitForm.password" :placeholder="$t('message.po_PleaseInput')" />
:label="$t('message.Summary_Password')"
>
<u-input
type="password"
v-model="submitForm.password"
:placeholder="$t('message.po_PleaseInput')"
/>
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
@ -72,17 +40,17 @@
<u-row> <u-row>
<u-col :span="4"> <u-col :span="4">
<u-button type="warning" @click="onSelectAll"> <u-button type="warning" @click="onSelectAll">
{{ $t("message.po_SelectAll") }} {{ $t('message.po_SelectAll') }}
</u-button> </u-button>
</u-col> </u-col>
<u-col :span="4"> <u-col :span="4">
<u-button type="primary" @click="onOk"> <u-button type="primary" @click="onOk">
{{ $t("message.dn_Confirm") }} {{ $t('message.dn_Confirm') }}
</u-button> </u-button>
</u-col> </u-col>
<u-col :span="4"> <u-col :span="4">
<u-button type="success" @click="onSubmit"> <u-button type="success" @click="onSubmit">
{{ $t("message.po_Submit") }} {{ $t('message.po_Submit') }}
</u-button> </u-button>
</u-col> </u-col>
</u-row> </u-row>
@ -92,24 +60,24 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Ref } from "vue-property-decorator"; import { Component, Ref } from 'vue-property-decorator';
import { BasePage } from "@/components/base/page"; import { BasePage } from '@/components/base/page';
import model from "./model"; import model from './model';
import { orderHeaders } from "./config"; import { orderHeaders } from './config';
import { VForm, VFormRules } from "vue/types/form"; import { VForm, VFormRules } from 'vue/types/form';
import { auth } from "@/store/modules/auth"; import { auth } from '@/store/modules/auth';
import { pick } from "lodash/fp"; import { pick } from 'lodash/fp';
import http from "@/utils/request"; import http from '@/utils/request';
import { url } from "@/utils/url"; import { url } from '@/utils/url';
import { session } from "@/store/modules/session"; import { session } from '@/store/modules/session';
@Component @Component
export default class AggregatingOrder extends BasePage { export default class AggregatingOrder extends BasePage {
/** /**
* 表单引用 * 表单引用
*/ */
@Ref("amountForm") readonly $amountForm!: VForm; @Ref('amountForm') readonly $amountForm!: VForm;
@Ref("submitForm") readonly $submitForm!: VForm; @Ref('submitForm') readonly $submitForm!: VForm;
/** /**
* 页面Module * 页面Module
@ -130,23 +98,23 @@ export default class AggregatingOrder extends BasePage {
* 更改数量表单 * 更改数量表单
*/ */
amountForm = { amountForm = {
amount: "", amount: '',
}; };
/** /**
* 上传表单 * 上传表单
*/ */
submitForm = { submitForm = {
receiver: "", receiver: '',
receiverName: "", receiverName: '',
password: "", password: '',
}; };
amountFormRules: VFormRules<any> = { amountFormRules: VFormRules<any> = {
amount: [ amount: [
{ {
required: true, 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: [ receiverName: [
{ {
required: true, required: true,
message: this.$t("message.Summary_PleaseInputReceiver") as string, message: this.$t('message.Summary_PleaseInputReceiver') as string,
}, },
], ],
password: [ password: [
{ {
required: true, 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() { async onReceiverConfirm() {
console.log("this.submitForm", this.submitForm); console.log('this.submitForm', this.submitForm);
const userInfo = await auth.getUserInfo({ const userInfo = await auth.getUserInfo({
loginName: this.submitForm.receiverName, loginName: this.submitForm.receiverName,
}); });
@ -207,8 +175,8 @@ export default class AggregatingOrder extends BasePage {
const firstSelection = this.model.orderList.find((_) => _.checked); const firstSelection = this.model.orderList.find((_) => _.checked);
if (firstSelection === undefined) { if (firstSelection === undefined) {
uni.showToast({ uni.showToast({
icon: "none", icon: 'none',
title: this.$t("message.Pi_tip7") as string, title: this.$t('message.Pi_tip7') as string,
}); });
} else { } else {
// //
@ -219,17 +187,17 @@ export default class AggregatingOrder extends BasePage {
const totalMoAmount = parseFloat(firstSelection.totalMoAmount); const totalMoAmount = parseFloat(firstSelection.totalMoAmount);
if (currentPickNum <= 0) { if (currentPickNum <= 0) {
uni.showToast({ uni.showToast({
icon: "none", icon: 'none',
title: this.$t("message.Pi_tip2") as string, title: this.$t('message.Pi_tip2') as string,
}); });
return; return;
} }
if (currentPickNum + totalHvAmount - totalMoAmount > 0.000001) { if (currentPickNum + totalHvAmount - totalMoAmount > 0.000001) {
uni.showModal({ uni.showModal({
title: "Tip", title: 'Tip',
content: this.$t("message.Pi_tip11") as string, content: this.$t('message.Pi_tip11') as string,
confirmText: this.$t("message.workArea_Confirm") as string, confirmText: this.$t('message.workArea_Confirm') as string,
cancelText: this.$t("message.Cancel") as string, cancelText: this.$t('message.Cancel') as string,
showCancel: true, showCancel: true,
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
@ -258,8 +226,8 @@ export default class AggregatingOrder extends BasePage {
if (valid) { if (valid) {
if (model.orderList.length === 0) { if (model.orderList.length === 0) {
uni.showToast({ uni.showToast({
icon: "none", icon: 'none',
title: this.$t("message.Pi_tip4") as string, title: this.$t('message.Pi_tip4') as string,
}); });
} else { } else {
await auth.checkPassword({ await auth.checkPassword({
@ -282,15 +250,15 @@ export default class AggregatingOrder extends BasePage {
}); });
if (selectsta) { if (selectsta) {
uni.showToast({ uni.showToast({
icon: "none", icon: 'none',
title: this.$t("message.Pi_tip4") as string, title: this.$t('message.Pi_tip4') as string,
}); });
return; return;
} }
if (submit) { if (submit) {
uni.showToast({ uni.showToast({
icon: "none", icon: 'none',
title: this.$t("message.Summary_PleaseInputNumber") as string, title: this.$t('message.Summary_PleaseInputNumber') as string,
}); });
return; return;
} }
@ -303,24 +271,21 @@ export default class AggregatingOrder extends BasePage {
}); });
if (List.length == 0) { if (List.length == 0) {
uni.showToast({ uni.showToast({
icon: "none", icon: 'none',
title: "请先选择要提交的物料" as string, title: '请先选择要提交的物料' as string,
}); });
return; return;
} }
List.forEach((item: any) => { List.forEach((item: any) => {
if ( if (parseFloat(item.totalMoAmount) - parseFloat(item.totalHvAmount) != parseFloat(item.hvAmount)) {
parseFloat(item.totalMoAmount) - parseFloat(item.totalHvAmount) !=
parseFloat(this.amountForm.amount)
) {
isTrue = false; isTrue = false;
return; return;
} }
}); });
if (isTrue != true) { if (isTrue != true) {
uni.showToast({ uni.showToast({
icon: "none", icon: 'none',
title: "请确保交接数量等于需求数量" as string, title: '请确保交接数量等于需求数量' as string,
}); });
return; return;
} }
@ -329,39 +294,22 @@ export default class AggregatingOrder extends BasePage {
factoryCode: session.factoryCode, factoryCode: session.factoryCode,
loginName: session.loginName, loginName: session.loginName,
orderOutIdAmountList: List.map((item: any) => ({ orderOutIdAmountList: List.map((item: any) => ({
...pick( ...pick(['materialCode', 'amount', 'totalHvAmount', 'sapFactoryCode', 'sendSpot', 'materialDesc', 'mrpCode', 'unit', 'prdOrder', 'proType', 'wkposCode', 'hvAmount', 'orderOutId'], item),
[
"materialCode",
"amount",
"totalHvAmount",
"sapFactoryCode",
"sendSpot",
"materialDesc",
"mrpCode",
"unit",
"prdOrder",
"proType",
"wkposCode",
"hvAmount",
"orderOutId",
],
item
),
pickNum: item.totalMoAmount, pickNum: item.totalMoAmount,
factoryCode: session.factoryCode, factoryCode: session.factoryCode,
})), })),
}); });
this.submitForm.receiver = ""; this.submitForm.receiver = '';
this.submitForm.receiverName = ""; this.submitForm.receiverName = '';
this.submitForm.password = ""; this.submitForm.password = '';
// setTimeout(() => { // setTimeout(() => {
// uni.navigateBack({ delta: 2 }); // uni.navigateBack({ delta: 2 });
// }, 2000); // }, 2000);
// uni.navigateBack({ delta: 2 }); // uni.navigateBack({ delta: 2 });
uni.showModal({ uni.showModal({
title: this.$t("message.Pi_tip") as string, title: this.$t('message.Pi_tip') as string,
content: this.$t("message.Warehouse_Tip9") as string, content: this.$t('message.Warehouse_Tip9') as string,
confirmText: this.$t("message.workArea_Confirm") as string, confirmText: this.$t('message.workArea_Confirm') as string,
showCancel: false, showCancel: false,
success: () => { success: () => {
this.toPage(this.page.raw.handover.aggregating.index); this.toPage(this.page.raw.handover.aggregating.index);
@ -376,9 +324,7 @@ export default class AggregatingOrder extends BasePage {
* 解锁 * 解锁
*/ */
async unlock() { async unlock() {
const orderOutIdList = model.proOrderResultList.map( const orderOutIdList = model.proOrderResultList.map((_: any) => _.orderOutId);
(_: any) => _.orderOutId
);
try { try {
await http.post(url.sumscan.unlock.list, { await http.post(url.sumscan.unlock.list, {
factoryCode: session.factoryCode, factoryCode: session.factoryCode,
@ -387,8 +333,8 @@ export default class AggregatingOrder extends BasePage {
}); });
} catch (e) { } catch (e) {
uni.showToast({ uni.showToast({
icon: "none", icon: 'none',
title: (this.$t("message.Summary_Tip") as string) + e.message, title: (this.$t('message.Summary_Tip') as string) + e.message,
}); });
} }
} }
@ -397,8 +343,7 @@ export default class AggregatingOrder extends BasePage {
<style lang="scss" scoped> <style lang="scss" scoped>
.page-aggregating-order { .page-aggregating-order {
background: #f2f2f2 background: #f2f2f2 linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
linear-gradient(0deg, #f2f2f2 0%, #4a78ea 51%, #1753ea 100%) no-repeat;
background-size: 100% 600rpx; background-size: 100% 600rpx;
padding: 30rpx; padding: 30rpx;
min-height: 100%; min-height: 100%;

@ -279,7 +279,11 @@ export default class AggregatingSummary extends BasePage {
return; return;
} }
List.forEach((item: any) => { 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; isTrue = false;
return; return;
} }

Loading…
Cancel
Save