|
|
@ -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-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-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="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>
|
|
|
|
<div class="table-right">
|
|
|
|
<div class="table-right">
|
|
|
|
<!-- <span>合计: {{ totalCtnall }}</span> -->
|
|
|
|
<!-- <span>合计: {{ totalCtnall }}</span> -->
|
|
|
@ -1174,6 +1175,77 @@ export default {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
this.totalPkgs = pkgs
|
|
|
|
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() {
|
|
|
|
openDialog() {
|
|
|
|
if (this.tableData.length === 0) {
|
|
|
|
if (this.tableData.length === 0) {
|
|
|
|
return false
|
|
|
|
return false
|
|
|
@ -1506,11 +1578,12 @@ export default {
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<style lang="less">
|
|
|
|
<style lang="less">
|
|
|
|
.from-line {
|
|
|
|
.from-line {
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
margin: 0 0 10px 0;
|
|
|
|
margin: 0 0 10px 0;
|
|
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
.left {
|
|
|
|
.left {
|
|
|
|
flex: 1;
|
|
|
|
|
|
|
|
text-align: left;
|
|
|
|
text-align: left;
|
|
|
|
|
|
|
|
width: 660px;
|
|
|
|
|
|
|
|
float:left;
|
|
|
|
.btn {
|
|
|
|
.btn {
|
|
|
|
margin-right: 10px;
|
|
|
|
margin-right: 10px;
|
|
|
|
font-size: 14px;
|
|
|
|
font-size: 14px;
|
|
|
@ -1555,6 +1628,8 @@ export default {
|
|
|
|
.table-right {
|
|
|
|
.table-right {
|
|
|
|
line-height: 28px;
|
|
|
|
line-height: 28px;
|
|
|
|
font-size: 14px;
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
|
|
width: 260px;
|
|
|
|
|
|
|
|
float: right;
|
|
|
|
span {
|
|
|
|
span {
|
|
|
|
margin-left: 10px;
|
|
|
|
margin-left: 10px;
|
|
|
|
color: #666;
|
|
|
|
color: #666;
|
|
|
|