箱量展开,改样式

dev
lilu 2 years ago
parent e0e9604406
commit 68e3975622

@ -977,10 +977,10 @@ export default {
},
bookingOrderUpdate() {
if (!this.bookingDetails.mblno) {
this.$message.error('请输入提单号')
return false
}
// if (!this.bookingDetails.mblno) {
// this.$message.error('')
// return false
// }
// - start
let basicFrom = true
this.$refs.basicInfo.$refs.basicFrom.validate(valid => {
@ -1107,10 +1107,10 @@ export default {
},
bookingOrderAdd() {
if (!this.bookingDetails.mblno) {
this.$message.error('请输入提单号')
return false
}
// if (!this.bookingDetails.mblno) {
// this.$message.error('')
// return false
// }
// - start
let basicFrom = true
this.$refs.basicInfo.$refs.basicFrom.validate(valid => {

@ -8,6 +8,7 @@
<a-button size="default" class="btn btn-more-name" type="primary" @click="openDialog" :disabled="tableData.length === 0"><a-icon type="appstore" />多品名 </a-button>
<a-button size="default" class="btn btn-import-station" type="primary" @click="importYarn" :loading="YarnLoading"><a-icon type="import" />引入场站数据</a-button>
<a-button size="default" class="btn btn-weight" type="primary" @click="importWeight" :loading="WeightLoading"><a-icon type="import" />引入箱皮重</a-button>
<!-- <a-button size="default" class="btn btn-weight" type="primary" @click="developboxLine"><a-icon type="arrows-alt" />多柜展开箱量</a-button> -->
</div>
<div class="table-right">
<!-- <span>合计: {{ totalCtnall }}</span> -->
@ -1174,6 +1175,77 @@ export default {
})
this.totalPkgs = pkgs
},
developboxLine () {
const arr = []
let key = 0
this.tableData.map((item, index) => {
const num = Number(item.ctnnum)
if (num > 1) {
//
let surplusPkgs = item.pkgs
let surpluskgs = item.kgs * 100000
let surpluscbm = item.cbm * 100000
for (let i = 0; i < num; i++) {
// eslint-disable-next-line prefer-const
let sunData = JSON.parse(JSON.stringify(item))
sunData.ctnnum = 1
sunData.rowKey = key
key++
if (!(/(^[1-9]\d*$)/.test(sunData.pkgs / num))) {
if (i !== num - 1) {
const averagePkgs = (sunData.pkgs / num) + ''
const cNum = averagePkgs.indexOf('.')
sunData.pkgs = Number(averagePkgs.substr(0, cNum))
surplusPkgs = surplusPkgs - sunData.pkgs
} else {
sunData.pkgs = surplusPkgs
}
} else {
sunData.pkgs = sunData.pkgs / num
}
//
if (!(/(^[1-9]\d*$)/.test(sunData.kgs * 100000 / num))) {
if (i !== num - 1) {
const averagekgs = (sunData.kgs * 100000 / num) + ''
const cNum = averagekgs.indexOf('.')
sunData.kgs = Number(averagekgs.substr(0, cNum)) / 100000
surpluskgs = surpluskgs - Number(averagekgs.substr(0, cNum))
} else {
sunData.kgs = surpluskgs / 100000
}
} else {
sunData.kgs = ((sunData.kgs * 100000) / num) / 100000
}
//
if (!(/(^[1-9]\d*$)/.test(sunData.cbm * 100000 / num))) {
if (i !== num - 1) {
const averagecbm = (sunData.cbm * 100000 / num) + ''
const cNum = averagecbm.indexOf('.')
sunData.cbm = Number(averagecbm.substr(0, cNum)) / 100000
surpluscbm = surpluscbm - Number(averagecbm.substr(0, cNum))
} else {
sunData.cbm = surpluscbm / 100000
}
} else {
sunData.cbm = ((sunData.cbm * 100000) / num) / 100000
}
if (sunData.weightype === '累加') {
sunData['weighkgs'] = this.calc(Number(sunData['kgs']), Number(sunData['tareweight']), '+')
}
// sunData.weighkgs = 1 //
arr.push(sunData)
}
} else {
item.rowKey = key
key++
arr.push(item)
}
})
this.tableData = arr
console.log(arr)
},
openDialog() {
if (this.tableData.length === 0) {
return false
@ -1506,11 +1578,12 @@ export default {
</script>
<style lang="less">
.from-line {
display: flex;
margin: 0 0 10px 0;
overflow: hidden;
.left {
flex: 1;
text-align: left;
width: 660px;
float:left;
.btn {
margin-right: 10px;
font-size: 14px;
@ -1555,6 +1628,8 @@ export default {
.table-right {
line-height: 28px;
font-size: 14px;
width: 260px;
float: right;
span {
margin-left: 10px;
color: #666;

@ -398,11 +398,18 @@
has-feedback
>
<div class="box-flex">
<a-input
<!-- <a-input
class="remark-input"
style="width:1000px !important; text-align: left;"
:allowClear="true"
v-model="initCabinFrom.remark"
/> -->
<a-textarea
class="remark-input"
style="width:1000px !important; text-align: left;height:100px;"
:allowClear="true"
:auto-size="{ minRows: 2, maxRows: 5 }"
v-model="initCabinFrom.remark"
/>
</div>
</a-form-item>
@ -1886,12 +1893,48 @@ export default {
top: 0;
left: 0;
width: 100%;
height: 100%;
// height: 100%;
height: 24px;
z-index: -1;
background-color: @primary-color !important;
opacity: 0.04;
}
}
.cabin-box{
/deep/ .ant-modal-body .ant-input-affix-wrapper {
position: relative;
z-index: 1;
&::after {
content: '';
position: absolute;
top: 4px;
left: 0;
width: 100%;
// height: 100%;
height: 24px;
z-index: -1;
background-color: @primary-color !important;
opacity: 0.04;
}
}
}
// /deep/ .ant-input{
// position: relative;
// z-index: 1;
// &::after {
// content: '';
// position: absolute;
// top: 0;
// left: 0;
// width: 100%;
// height: 100%;
// z-index: -1;
// display: block;
// background-color: @primary-color !important;
// opacity: 0.04;
// }
// }
/deep/ .ant-select-selection {
position: relative;
z-index: 1;

Loading…
Cancel
Save