<template>
|
<u-modal
|
v-model="show"
|
ref="uModal"
|
title=""
|
:show-cancel-button="true"
|
@confirm="confirm"
|
@cancel="cancel"
|
:async-close="true"
|
>
|
<view class="packing-registration-param">
|
<scroll-view scroll-y="true" style="height: 100%">
|
<view class="packing-registration-param-view">
|
<view class="packing-registration-param-item param-extra">
|
<view class="packing-registration-param-item-left">
|
<text class="item-one">批次号</text>
|
</view>
|
<view class="packing-registration-param-item-right">
|
<u-input
|
class="item-one item-two"
|
v-model="form.overallLength"
|
disabled
|
/>
|
</view>
|
</view>
|
<view class="packing-registration-param-item param-extra">
|
<view class="packing-registration-param-item-left">
|
<text class="item-one">产品描述</text>
|
</view>
|
<view class="packing-registration-param-item-right">
|
<u-input
|
class="item-one item-two"
|
v-model="form.proposedLocation"
|
disabled
|
/>
|
</view>
|
</view>
|
<view class="packing-registration-param-item param-extra">
|
<view class="packing-registration-param-item-left">
|
<text class="item-one">零件位</text>
|
</view>
|
<view class="packing-registration-param-item-right">
|
<u-input
|
class="item-one item-two"
|
v-model="form.reelNumber"
|
disabled
|
/>
|
</view>
|
</view>
|
<view class="packing-registration-param-item param-extra">
|
<view class="packing-registration-param-item-left">
|
<text class="item-one">毛重</text>
|
</view>
|
<view class="packing-registration-param-item-right">
|
<u-input
|
class="item-one item-two"
|
v-model="form.reelWeight"
|
disabled
|
/>
|
</view>
|
</view>
|
<view class="packing-registration-param-item param-extra">
|
<view class="packing-registration-param-item-left">
|
<text class="item-one">盘重</text>
|
</view>
|
<view class="packing-registration-param-item-right">
|
<u-input
|
class="item-one item-two"
|
v-model="form.grossWeight"
|
disabled
|
/>
|
</view>
|
</view>
|
<view class="packing-registration-param-item param-extra">
|
<view class="packing-registration-param-item-left">
|
<text class="item-one">净重</text>
|
</view>
|
<view class="packing-registration-param-item-right">
|
<u-input
|
class="item-one item-two"
|
v-model="form.netWeight"
|
disabled
|
/>
|
</view>
|
</view>
|
<view class="packing-registration-param-item param-extra">
|
<view class="packing-registration-param-item-left">
|
<text class="item-one">核磅重量</text>
|
</view>
|
<view class="packing-registration-param-item-right">
|
<u-input class="item-one item-two" v-model="form.name" />
|
</view>
|
</view>
|
<view class="packing-registration-param-item param-extra">
|
<view class="packing-registration-param-item-left">
|
<text class="item-one">叉车重量</text>
|
</view>
|
<view class="packing-registration-param-item-right">
|
<u-input class="item-one item-two" v-model="form.outerDiameter" />
|
</view>
|
</view>
|
<view class="packing-registration-param-item param-extra">
|
<view class="packing-registration-param-item-left">
|
<text class="item-one">长度</text>
|
</view>
|
<view class="packing-registration-param-item-right">
|
<u-input class="item-one item-two" v-model="form.voltage" />
|
</view>
|
</view>
|
<view class="packing-registration-param-item param-extra">
|
<view class="packing-registration-param-item-left">
|
<text class="item-one">盘号</text>
|
</view>
|
<view class="packing-registration-param-item-right">
|
<u-input class="item-one item-two" v-model="form.speed" />
|
</view>
|
</view>
|
</view>
|
</scroll-view>
|
</view>
|
</u-modal>
|
</template>
|
|
<script>
|
export default {
|
props: {
|
operationTaskList: {
|
type: Object,
|
required: true,
|
default: () => ({}),
|
},
|
},
|
data() {
|
return {
|
show: false,
|
form: {},
|
};
|
},
|
methods: {
|
confirm() {
|
if (!this.form.outerDiameter) {
|
this.$u.toast("请输入核磅重量");
|
this.$refs.uModal.clearLoading(); // 清除加载状态
|
return;
|
}
|
if (!this.form.voltage) {
|
this.$u.toast("请输入叉车重量");
|
this.$refs.uModal.clearLoading(); // 清除加载状态
|
return;
|
}
|
// PDA 扫码核磅规则:
|
// (1).铜杆
|
// 正磅差:0-3kg 可直接提交
|
// 4-10kg 皮重不变
|
// 如果为 4kg 净重加 2kg、毛重加 2kg
|
// 如果为 5kg 净重加 3kg、毛重加 4kg
|
// 如果为 6kg 净重加 4kg、毛重加 4kg
|
// 以此类推
|
// 添加弹窗提示:更改合格证毛重为..(改后的值)、净重为..(改后的净重)
|
// 超过 10kg提示生产核查(不能提交)
|
// 负磅差(要加负号):净重不变
|
// -10kg 以内
|
// 核磅重量-2(新的毛重)皮重(新的毛重-净重)超过 10kg提示生产核查(不能提交)
|
// (2).导体
|
// 正磅差:0-3kg可直接提交
|
// 超过 3kg及 负磅差提示生产核查(不能提交)
|
// (3).导体2.6
|
// 士0.5kg 都可直接提交
|
// 超过0.5 提示生产核查
|
//磅差计算:核榜-叉车盘-毛重
|
Number(this.form.h);
|
const magnetic =
|
Number(this.form.h) - Number(this.form.children) - Number(this.form.m);
|
uni.showModal({
|
title: "提示",
|
content: "磅差为:" + magnetic,
|
showCancel: false,
|
success: function () {
|
switch (this.operationTaskList.productType) {
|
case "铜杆":
|
if (magnetic > 0 && magnetic < 3) {
|
this.verifySubmission(this.form);
|
}
|
if (magnetic == 4) {
|
this.form.grossWeight = Number(this.form.grossWeight) + 2;
|
this.form.netWeight = Number(this.form.netWeight) + 2;
|
this.$u.toast(
|
"更改合格证毛重为:" +
|
this.form.grossWeight +
|
"净重为:" +
|
this.form.netWeight
|
);
|
this.verifySubmission(this.form);
|
}
|
if (magnetic == 5) {
|
this.form.grossWeight = Number(this.form.grossWeight) + 3;
|
this.form.netWeight = Number(this.form.netWeight) + 3;
|
this.$u.toast(
|
"更改合格证毛重为:" +
|
this.form.grossWeight +
|
"净重为:" +
|
this.form.netWeight
|
);
|
this.verifySubmission(this.form);
|
}
|
if (magnetic == 6) {
|
this.form.grossWeight = Number(this.form.grossWeight) + 4;
|
this.form.netWeight = Number(this.form.netWeight) + 4;
|
this.$u.toast(
|
"更改合格证毛重为:" +
|
this.form.grossWeight +
|
"净重为:" +
|
this.form.netWeight
|
);
|
this.verifySubmission(this.form);
|
}
|
if (magnetic == 7) {
|
this.form.grossWeight = Number(this.form.grossWeight) + 5;
|
this.form.netWeight = Number(this.form.netWeight) + 5;
|
this.$u.toast(
|
"更改合格证毛重为:" +
|
this.form.grossWeight +
|
"净重为:" +
|
this.form.netWeight
|
);
|
this.verifySubmission(this.form);
|
}
|
if (magnetic == 8) {
|
this.form.grossWeight = Number(this.form.grossWeight) + 6;
|
this.form.netWeight = Number(this.form.netWeight) + 6;
|
this.$u.toast(
|
"更改合格证毛重为:" +
|
this.form.grossWeight +
|
"净重为:" +
|
this.form.netWeight
|
);
|
this.verifySubmission(this.form);
|
}
|
if (magnetic == 9) {
|
this.form.grossWeight = Number(this.form.grossWeight) + 7;
|
this.form.netWeight = Number(this.form.netWeight) + 7;
|
this.$u.toast(
|
"更改合格证毛重为:" +
|
this.form.grossWeight +
|
"净重为:" +
|
this.form.netWeight
|
);
|
this.verifySubmission(this.form);
|
}
|
if (magnetic == 10) {
|
this.form.grossWeight = Number(this.form.grossWeight) + 8;
|
this.form.netWeight = Number(this.form.netWeight) + 8;
|
this.$u.toast(
|
"更改合格证毛重为:" +
|
this.form.grossWeight +
|
"净重为:" +
|
this.form.netWeight
|
);
|
this.verifySubmission(this.form);
|
}
|
if (magnetic > 10) {
|
this.$u.toast("生产核查");
|
}
|
break;
|
// case "导体":
|
// if (magnetic > 0 && magnetic < 3) {
|
// this.verifySubmission(this.form);
|
// } else {
|
// this.$u.toast("生产核查");
|
// }
|
// break;
|
// case "导体2.6":
|
// if (magnetic > -0.5 && magnetic < 0.5) {
|
// this.verifySubmission(this.form);
|
// } else {
|
// this.$u.toast("生产核查");
|
// }
|
// break;
|
}
|
},
|
});
|
},
|
// 校验后提交
|
verifySubmission(Obj) {
|
this.$emit("update", Obj);
|
},
|
cancel() {
|
this.show = false;
|
this.form = {};
|
},
|
open(val) {
|
this.show = true;
|
this.form = val;
|
},
|
},
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
::v-deep .u-model__title {
|
padding-top: 0 !important;
|
}
|
|
::v-deep .u-input__input {
|
text-align: right !important;
|
}
|
|
.packing-registration-param {
|
padding: 40rpx 30rpx 10rpx 30rpx;
|
height: 350px;
|
overflow: hidden;
|
|
.packing-registration-param-title {
|
display: flex;
|
flex-direction: row;
|
align-items: center;
|
margin-bottom: 30rpx;
|
|
.title-label {
|
margin-left: 14rpx;
|
font-size: 34rpx;
|
font-weight: bold;
|
color: #283e65;
|
}
|
}
|
|
.packing-registration-param-view {
|
height: 177rpx;
|
background-color: #fff;
|
border-radius: 10rpx;
|
padding: 0rpx 23rpx;
|
margin-bottom: 30rpx;
|
|
.packing-registration-param-item {
|
height: 90rpx;
|
border: 1px solid #adc8e4;
|
line-height: 90rpx;
|
display: flex;
|
justify-content: space-between;
|
border: none;
|
|
.packing-registration-param-item-left {
|
.item-one {
|
font-size: 30rpx;
|
color: #666666;
|
}
|
}
|
|
.packing-registration-param-item-right {
|
display: flex;
|
justify-content: space-between;
|
|
.item-one {
|
font-size: 15rpx;
|
color: #060505;
|
margin-right: 6rpx;
|
}
|
|
.item-two {
|
font-size: 15rpx;
|
color: #a6b4cc;
|
margin-right: 6rpx;
|
}
|
|
.item-three {
|
font-size: 30rpx;
|
color: #214ded;
|
margin-right: 6rpx;
|
}
|
}
|
}
|
|
.param-extra {
|
border-bottom: 1px solid #ededed;
|
}
|
}
|
}
|
</style>
|