|
|
|
@ -9,10 +9,11 @@
|
|
|
|
|
>
|
|
|
|
|
<a-tab-pane key="1" tab="主单信息">
|
|
|
|
|
<a-row :gutter="24">
|
|
|
|
|
<a-col :span="18">
|
|
|
|
|
<a-col :span="18" class="left-box">
|
|
|
|
|
<template>
|
|
|
|
|
<operationArea
|
|
|
|
|
:details="bookingDetails"
|
|
|
|
|
:class="scrollTop < 100 ? 'normal-nav' : 'fixed-nav'"
|
|
|
|
|
@refresh="refreshPage"
|
|
|
|
|
@save="saveFun"
|
|
|
|
|
@rules="getRules"
|
|
|
|
@ -178,7 +179,7 @@ const initDetail = {
|
|
|
|
|
payableat: '',
|
|
|
|
|
blfrt: '',
|
|
|
|
|
thirdpayaddr: '',
|
|
|
|
|
service: '',
|
|
|
|
|
service: 'CY-CY',
|
|
|
|
|
reeferf: '',
|
|
|
|
|
tempset: '',
|
|
|
|
|
tempid: '',
|
|
|
|
@ -245,7 +246,8 @@ export default {
|
|
|
|
|
tabActiveKey: '1',
|
|
|
|
|
historyData: {},
|
|
|
|
|
Showtabs: false,
|
|
|
|
|
inChildLoading: false
|
|
|
|
|
inChildLoading: false,
|
|
|
|
|
scrollTop: 0
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
@ -271,6 +273,11 @@ export default {
|
|
|
|
|
created() {
|
|
|
|
|
this.init()
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
window.addEventListener('scroll', () => {
|
|
|
|
|
this.scrollTop = document.getElementById('app').scrollTop
|
|
|
|
|
}, true)
|
|
|
|
|
},
|
|
|
|
|
beforeRouteUpdate(to, from, next) {
|
|
|
|
|
// console.log('fromId:', from.query.id, '| toId:', to.query.id)
|
|
|
|
|
console.log('Router 2.2 === beforeRouteUpdate ===', this.$route.query.id, this.isCopy)
|
|
|
|
@ -494,6 +501,14 @@ export default {
|
|
|
|
|
ediAttnMail: ''
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 初始化箱型 累加 称重总重
|
|
|
|
|
if (res.data.ctnInputs.length > 0) {
|
|
|
|
|
res.data.ctnInputs.map((item, index) => {
|
|
|
|
|
if (item.weightype === '累加') {
|
|
|
|
|
item.weighkgs = this.calc(Number(item['kgs']), Number(item['tareweight']), '+')
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
this.$set(this, 'bookingDetails', res.data)
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
// console.log(' 1. === 主单获取信息更新 ===')
|
|
|
|
@ -618,7 +633,7 @@ export default {
|
|
|
|
|
changePageFun(type) {
|
|
|
|
|
const _this = this
|
|
|
|
|
const key = this.$route.fullPath
|
|
|
|
|
if (this.needSavePages[key].details || this.needSavePages[key].hbList) {
|
|
|
|
|
if (Object.keys(this.needSavePages).includes(key) && (this.needSavePages[key].details || this.needSavePages[key].hbList)) {
|
|
|
|
|
// console.log('== 切换上一票下一票 - biu 弹窗出现 ==')
|
|
|
|
|
this.$confirm({
|
|
|
|
|
title: '请确认无未保存数据!',
|
|
|
|
@ -723,6 +738,93 @@ export default {
|
|
|
|
|
this.$set(lastPages, key, $data)
|
|
|
|
|
this.setNeedSavePages(lastPages)
|
|
|
|
|
// console.log('== vuex 配置更新信息 ==', this.needSavePages)
|
|
|
|
|
},
|
|
|
|
|
calc(num1, num2, calcStr) {
|
|
|
|
|
var str1; // 转换为字符串的数字
|
|
|
|
|
var str2;
|
|
|
|
|
var ws1 = 0; // ws1,ws2 用来存储传入的num的小数点后的数字的位数
|
|
|
|
|
var ws2 = 0; // 赋默认值,解决当整数和小数运算时倍数计算错误导致的结果误差
|
|
|
|
|
var bigger; // bigger和smaller用于加,减,除法找出小的那个数字,给后面补0,解决位数不对从而造成的计算错误的问题;乘法需要将结果除两个数字的倍数之和
|
|
|
|
|
var smaller; // 例如:加减除法中1.001 + 2.03 ,如果不给2.03进行补0,最后会变成1001+203,数字错位导致结果错误;乘法中1.12*1.1会放大为112*11,所以结果需要除以1000才会是正确的结果,112*11/1000=1.232
|
|
|
|
|
var zeroCount; // 需要补充0的个数
|
|
|
|
|
var isExistDot1; // 传入的数字是否存在小数点
|
|
|
|
|
var isExistDot2;
|
|
|
|
|
var sum;
|
|
|
|
|
var beishu = 1
|
|
|
|
|
// 将数字转换为字符串
|
|
|
|
|
str1 = num1.toString()
|
|
|
|
|
str2 = num2.toString()
|
|
|
|
|
// 是否存在小数点(判断需要计算的数字是不是包含小数)
|
|
|
|
|
isExistDot1 = str1.indexOf('.') != -1 ? true : false
|
|
|
|
|
isExistDot2 = str2.indexOf('.') != -1 ? true : false
|
|
|
|
|
// 取小数点后面的位数
|
|
|
|
|
if (isExistDot1) {
|
|
|
|
|
ws1 = str1.split('.')[1].length
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (isExistDot2) {
|
|
|
|
|
ws2 = str2.split('.')[1].length
|
|
|
|
|
}
|
|
|
|
|
// 如ws1 和 ws2 无默认值,如果num1 或 num2 不是小数的话则 ws1 或 ws2 的值将为 undefined
|
|
|
|
|
// bigger 和 smaller 的值会和预期不符
|
|
|
|
|
bigger = ws1 > ws2 ? ws1 : ws2
|
|
|
|
|
smaller = ws1 < ws2 ? ws1 : ws2
|
|
|
|
|
|
|
|
|
|
switch (calcStr) {
|
|
|
|
|
// 加减法找出小的那个数字,给后面补0,解决位数不对从而造成的计算错误的问题
|
|
|
|
|
// 例如:1.001 + 2.03 ,如果不给2.03进行补0,最后会变成1001+203,数字错位导致结果错误
|
|
|
|
|
case '+':
|
|
|
|
|
case '-':
|
|
|
|
|
case '/':
|
|
|
|
|
zeroCount = bigger - smaller
|
|
|
|
|
for (var i = 0; i < zeroCount; i++) {
|
|
|
|
|
if (ws1 == smaller) {
|
|
|
|
|
str1 += '0'
|
|
|
|
|
} else {
|
|
|
|
|
str2 += '0'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break
|
|
|
|
|
case '*':
|
|
|
|
|
// 乘法需要将结果除两个数字的倍数之和
|
|
|
|
|
bigger = bigger + smaller
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
return '暂不支持的计算类型,现已支持的有加法、减法、乘法、除法'
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 去除数字中的小数点
|
|
|
|
|
str1 = str1.replace('.', '')
|
|
|
|
|
str2 = str2.replace('.', '')
|
|
|
|
|
|
|
|
|
|
// 计算倍数,例如:1.001小数点后有三位,则需要乘 1000 变成 1001,变成整数后精度丢失问题则不会存在
|
|
|
|
|
for (var i = 0; i < bigger; i++) {
|
|
|
|
|
beishu *= 10 // 等价于beishu = beishu * 10;
|
|
|
|
|
}
|
|
|
|
|
num1 = parseInt(str1)
|
|
|
|
|
num2 = parseInt(str2)
|
|
|
|
|
// 进行最终计算并除相应倍数
|
|
|
|
|
switch (calcStr) {
|
|
|
|
|
case '+':
|
|
|
|
|
sum = (num1 + num2) / beishu
|
|
|
|
|
break
|
|
|
|
|
case '-':
|
|
|
|
|
sum = (num1 - num2) / beishu
|
|
|
|
|
break
|
|
|
|
|
case '*':
|
|
|
|
|
sum = (num1 * num2) / beishu
|
|
|
|
|
break
|
|
|
|
|
case '/':
|
|
|
|
|
sum = num1 / num2
|
|
|
|
|
/* 除数与被除数同时放大一定倍数,不影响结果,
|
|
|
|
|
所以对数字进行放大对应倍数并进行补0操作后不用另对倍数做处理 */
|
|
|
|
|
break
|
|
|
|
|
default:
|
|
|
|
|
return '暂不支持的计算类型,现已支持的有加法、减法、乘法、除法'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return sum
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -785,4 +887,63 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// .ant-calendar-picker-input{
|
|
|
|
|
// padding: 0 4px;
|
|
|
|
|
// }
|
|
|
|
|
// .ant-calendar-range-picker-input{
|
|
|
|
|
// height: 28px;
|
|
|
|
|
// font-size: 12px;
|
|
|
|
|
// vertical-align: top;
|
|
|
|
|
// text-align: center;
|
|
|
|
|
// // background: #f99;
|
|
|
|
|
// }
|
|
|
|
|
// .ant-select-auto-complete.ant-select .ant-input{
|
|
|
|
|
// height: 28px !important;
|
|
|
|
|
// // padding-top: 4px !important;
|
|
|
|
|
// background: #f99 !important;
|
|
|
|
|
// }
|
|
|
|
|
.ant-input-affix-wrapper .ant-input:not(:last-child){
|
|
|
|
|
height: 28px !important;
|
|
|
|
|
// margin-top: 4px !important;
|
|
|
|
|
// background: #9f9 !important;
|
|
|
|
|
}
|
|
|
|
|
.ant-select-selection{
|
|
|
|
|
height: 28px !important;
|
|
|
|
|
// margin-top: 4px !important;
|
|
|
|
|
// background: #f00 !important;
|
|
|
|
|
}
|
|
|
|
|
.ant-input:placeholder-shown{
|
|
|
|
|
height: 28px !important;
|
|
|
|
|
// margin-top: 4px !important;
|
|
|
|
|
// background: #99f !important;
|
|
|
|
|
}
|
|
|
|
|
.ant-calendar-picker-input.ant-input{
|
|
|
|
|
height: 28px !important;
|
|
|
|
|
// margin-top: 4px !important;
|
|
|
|
|
}
|
|
|
|
|
.ant-form-item-label{
|
|
|
|
|
line-height: 30px !important;
|
|
|
|
|
// border: 1px solid #f00;
|
|
|
|
|
}
|
|
|
|
|
.ant-form-item-control-wrapper{
|
|
|
|
|
// border: 1px solid #f99;
|
|
|
|
|
// height: 30px;
|
|
|
|
|
// vertical-align: top;
|
|
|
|
|
// padding: 0;
|
|
|
|
|
}
|
|
|
|
|
.left-box{
|
|
|
|
|
// padding-top: 60px;
|
|
|
|
|
}
|
|
|
|
|
.normal-nav{
|
|
|
|
|
transition: .5s all;
|
|
|
|
|
}
|
|
|
|
|
.fixed-nav{
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 56px;
|
|
|
|
|
box-shadow:0px 15px 10px -15px #ccc;
|
|
|
|
|
z-index: 999;
|
|
|
|
|
background:#fff;
|
|
|
|
|
transition: .5s all;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|