箱量展开,改样式

dev
lilu 2 years ago
parent e0e9604406
commit 68e3975622

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

@ -398,11 +398,18 @@
has-feedback has-feedback
> >
<div class="box-flex"> <div class="box-flex">
<a-input <!-- <a-input
class="remark-input" class="remark-input"
style="width:1000px !important; text-align: left;" style="width:1000px !important; text-align: left;"
:allowClear="true" :allowClear="true"
v-model="initCabinFrom.remark" 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> </div>
</a-form-item> </a-form-item>
@ -1886,12 +1893,48 @@ export default {
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; // height: 100%;
height: 24px;
z-index: -1; z-index: -1;
background-color: @primary-color !important; background-color: @primary-color !important;
opacity: 0.04; 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 { /deep/ .ant-select-selection {
position: relative; position: relative;
z-index: 1; z-index: 1;

Loading…
Cancel
Save