张同海 2 years ago
commit 187ed89d2e

@ -289,7 +289,7 @@ export default {
}
let data = JSON.parse(JSON.stringify(this.editDetails))
delete data.isNoSave
data.parentId = this.$route.query.id
data.parentid = this.$route.query.id
data.id = 0
data.ctnInputs.map((item, index) => {
item.id = 0

@ -237,7 +237,7 @@ export default {
isCopy: this.$route.query.isCopy || false,
inPageLoading: false,
// bookingDetails: {},
bookingDetails: initDetail,
bookingDetails: JSON.parse(JSON.stringify(initDetail)),
tabBarStyle: {
background: '#fff',
padding: '0 20px'
@ -314,6 +314,18 @@ export default {
id: this.id
}
this.$set(this.historyData, `copy-${this.id}`, hisData)
} else if (this.$route.query.addNum) {
const hisData = {
bookingDetails: this.bookingDetails,
excuteRules: this.excuteRules,
excuteRulesType: this.excuteRulesType,
isAdd: this.isAdd,
tabActiveKey: this.tabActiveKey,
type: this.type,
isCopy: this.isCopy
// id: this.id
}
this.$set(this.historyData, `add-${this.$route.query.addNum}`, hisData)
} else {
const hisData = {
bookingDetails: this.bookingDetails,
@ -359,6 +371,18 @@ export default {
id: this.id
}
this.$set(this.historyData, `copy-${this.id}`, hisData)
} else if (this.$route.query.addNum) {
const hisData = {
bookingDetails: this.bookingDetails,
excuteRules: this.excuteRules,
excuteRulesType: this.excuteRulesType,
isAdd: this.isAdd,
tabActiveKey: this.tabActiveKey,
type: this.type,
isCopy: this.isCopy
// id: this.id
}
this.$set(this.historyData, `add-${this.$route.query.addNum}`, hisData)
} else {
const hisData = {
bookingDetails: this.bookingDetails,
@ -402,6 +426,9 @@ export default {
this.tabActiveKey = $data.tabActiveKey
this.isCopy = this.$route.query.isCopy
this.inPageLoading = false
if (this.bookingDetails.hbList && this.bookingDetails.hbList.length > 0) {
this.Showtabs = true
}
setTimeout(() => {
this.inChildLoading = false
if (!Object.keys(this.needSavePages).includes(this.$route.fullPath)) {
@ -410,6 +437,30 @@ export default {
}, 1500)
// console.log('== ==', $data.isCopy, this.$route.query.isCopy, this.isCopy)
this.$forceUpdate()
} else if (Object.keys(this.historyData).includes(`add-${this.$route.query.addNum}`) && this.$route.query.addNum) {
const $data = JSON.parse(JSON.stringify(this.historyData[`add-${this.$route.query.addNum}`]))
this.bookingDetails = $data.bookingDetails
this.excuteRules = $data.excuteRules
this.excuteRulesType = $data.excuteRulesType
this.isAdd = $data.isAdd
this.tabActiveKey = $data.tabActiveKey
this.isCopy = this.$route.query.isCopy
this.inPageLoading = false
// console.log('== ==', $data.isCopy, this.$route.query.isCopy, this.isCopy)
if (this.isCopy && !$data.isCopy) {
// console.log('== , ==')
this.bookingDetails.mblno = ''
}
if (this.bookingDetails.hbList && this.bookingDetails.hbList.length > 0) {
this.Showtabs = true
}
setTimeout(() => {
this.inChildLoading = false
if (!Object.keys(this.needSavePages).includes(this.$route.fullPath)) {
this.checkSaveFun({ type: 'details', hasChange: false })
}
}, 1500)
this.$forceUpdate()
} else if (Object.keys(this.historyData).includes(newId)) {
this.id = this.$route.query.id
const $data = JSON.parse(JSON.stringify(this.historyData[newId]))
@ -420,6 +471,9 @@ export default {
this.tabActiveKey = $data.tabActiveKey
this.isCopy = this.$route.query.isCopy
this.inPageLoading = false
if (this.bookingDetails.hbList && this.bookingDetails.hbList.length > 0) {
this.Showtabs = true
}
// console.log('== ==', $data.isCopy, this.$route.query.isCopy, this.isCopy)
if (this.isCopy && !$data.isCopy) {
// console.log('== , ==')
@ -442,7 +496,7 @@ export default {
}
},
init() {
this.bookingDetails = initDetail
this.bookingDetails = JSON.parse(JSON.stringify(initDetail))
this.excuteRules = []
this.excuteRulesType = ''
this.Showtabs = false
@ -615,6 +669,7 @@ export default {
this.isAdd = false
this.id = res.data
this.$message.success('保存成功')
// this.bookingDetails = JSON.parse(JSON.stringify(initDetail))
this.$router.replace({
name: 'BookingDetail',
query: {
@ -669,7 +724,6 @@ export default {
Object.keys(this.needSavePages).includes(key) &&
(this.needSavePages[key].details || this.needSavePages[key].hbList)
) {
// console.log('== - biu ==')
this.$confirm({
title: '请确认无未保存数据!',
content: '当点击确定按钮时,此页面 将会关闭。',

@ -21,6 +21,8 @@
:columns="columns"
:table-data="tableData"
borderY
ref="tableRef"
style="min-width:970;"
:cell-autofill-option="cellAutofillOption"
:editOption="editOption"
rowKeyFieldName="rowKey"
@ -119,47 +121,59 @@ export default {
edit: false,
renderBodyCell: ({ row, column, rowIndex }, h) => {
return (
// <a-auto-complete
// class="certain-category-search"
// dropdown-class-name="certain-category-search-dropdown"
// dropdown-match-select-width={false}
// size="large"
// style="width: 120px"
// option-label-prop="value"
// >
// {
// <template slot="dataSource">
// <a-select-opt-group>
// {
// this.ctnList.map((item, index) => {
// return <a-select-option>{ item.name }</a-select-option>
// })
// }
// </a-select-opt-group>
// </template>
// }
// {
// <a-input>
// <a-icon slot="suffix" type="search" class="certain-category-icon" />
// </a-input>
// }
// </a-auto-complete>
<a-select
value={row['ctnall']}
showSearch
ref="ctnallView"
class="ctnallView"
allow-clear={true}
style="width: 120px"
style="width: 90px"
on-change={val => {
console.log(' change - 修改内容', val)
if (val) {
const data = this.ctnList[val]
this.tableData[rowIndex].ctnall = data.name
this.tableData[rowIndex].ctncode = data.code
row['ctnall'] = data.name
this.$forceUpdate()
} else {
row['ctnall'] = ''
this.tableData[rowIndex].ctnall = ''
this.tableData[rowIndex].ctncode = ''
}
}}
on-focus={val => {
this.ctnallViewIndex = rowIndex
console.log('=获取焦点=', rowIndex, this.ctnallViewIndex)
}}
on-blur={val => {
this.ctnallViewIndex = null
console.log('=失去焦点=', rowIndex, this.ctnallViewIndex, val)
}}
on-input={val => {
console.log('== input - 修改内容==', val)
}}
>
{this.ctnList.map((item, index) => {
return <a-select-option value={index}>{item.name}</a-select-option>
})}
</a-select>
// <div class="ctnallView">
// <input type="text"
// v-model={row['ctnall']}
// on-focus={val => {
// this.ctnallViewIndex = rowIndex
// console.log('==', rowIndex, this.ctnallViewIndex)
// }}
// on-blur={val => {
// this.ctnallViewIndex = null
// console.log('==', rowIndex, this.ctnallViewIndex)
// }}
// on-input={val => {
// console.log('', val)
// }}
// />
// </div>
)
}
},
@ -168,6 +182,7 @@ export default {
key: 'ctnnum ',
title: '箱量',
align: 'left',
width: 60,
edit: true
},
{
@ -175,6 +190,7 @@ export default {
key: 'cntrno',
title: '箱号',
align: 'left',
width: 180,
edit: true
},
{
@ -202,14 +218,46 @@ export default {
return (
<a-select
allow-clear={true}
showSearch
defaultValue={row['kindpkgs']}
option-filter-prop="children"
style="width: 120px"
class="kindpkgsView"
on-change={val => {
console.log('包装修改:', this.packageList[val])
if (val) {
const data = this.packageList[val]
this.tableData[rowIndex].kindpkgs = data.name
row['kindpkgs'] = data.name
this.tableData.map((item, index) => {
item.kindpkgs = this.packageList[val].name || ''
if (document.getElementsByClassName('kindpkgsView')[index].getElementsByClassName('ant-select-selection-selected-value')[0]) {
document.getElementsByClassName('kindpkgsView')[index].getElementsByClassName('ant-select-selection-selected-value')[0].innerHTML = this.packageList[val].name || ''
} else {
document.getElementsByClassName('kindpkgsView')[index].getElementsByTagName('input')[0].val = this.packageList[val].name || ''
}
})
this.$forceUpdate()
} else {
row['kindpkgs'] = ''
this.tableData[rowIndex].kindpkgs = ''
this.tableData.map((item, index) => {
item.kindpkgs = ''
document.getElementsByClassName('kindpkgsView')[index].getElementsByClassName('ant-select-selection-selected-value')[0].innerHTML = ''
})
}
console.log(this.tableData)
}}
on-focus={val => {
this.kindpkgsViewIndex = rowIndex
console.log('=获取焦点=', rowIndex, this.kindpkgsViewIndex)
}}
on-blur={val => {
this.kindpkgsViewIndex = null
console.log('=失去焦点=', rowIndex, this.kindpkgsViewIndex)
}}
on-input={val => {
console.log('== input - 修改内容==', val)
}}
>
{this.packageList.map((item, index) => {
@ -305,7 +353,8 @@ export default {
field: 'cntrno',
key: 'cntrno',
title: '箱号',
align: 'left'
align: 'left',
width: 240
},
{
field: 'sealno',
@ -532,6 +581,8 @@ export default {
}
},
cellValueChange: ({ row, column }) => {
console.log('cellValueChange row::', row);
console.log('cellValueChange column::', column);
}
},
editChildOption: {
@ -722,7 +773,9 @@ export default {
childModelSelectIndex: null,
selectChildArr: [],
YarnLoading: false,
WeightLoading: false
WeightLoading: false,
ctnallViewIndex: null,
kindpkgsViewIndex: null
}
},
watch: {
@ -770,9 +823,35 @@ export default {
created() {
this.init()
document.onkeydown = (event) => {
console.log("按下:"+event.key+"键:"+event.keyCode, document.activeElement);
console.log(document.activeElement);
if (event.key === 'Backspace' && this.ctnallViewIndex !== null) {
const val = document.getElementsByClassName('ctnallView')[this.ctnallViewIndex].getElementsByTagName('input')[0].value
console.log('内容', val, this.ctnList)
document.getElementsByClassName('ctnallView')[this.ctnallViewIndex].getElementsByTagName('input')[0].value = val.substr(0, val.length - 1)
// this.tableData[this.ctnallViewIndex].ctnall = val.substr(0, val.length - 1)
}
if (event.key === 'Backspace' && this.kindpkgsViewIndex !== null) {
const val = document.getElementsByClassName('kindpkgsView')[this.kindpkgsViewIndex].getElementsByTagName('input')[0].value
console.log('内容', val, this.ctnList)
document.getElementsByClassName('kindpkgsView')[this.kindpkgsViewIndex].getElementsByTagName('input')[0].value = val.substr(0, val.length - 1)
// this.tableData[this.ctnallViewIndex].ctnall = val.substr(0, val.length - 1)
}
if (event.key === 'Tab') {
const activeDom = document.activeElement
if (activeDom.dataset['next'] === 'box-ctnall') {
this.startEditingCell('0', 'ctnall')
}
console.log(this.ctnallViewIndex)
}
}
},
methods: {
startEditingCell(rowKey, colKey, defaultValue) {
this.$refs['tableRef'].startEditingCell({ rowKey, colKey, defaultValue });
},
init() {
if (Object.keys(this.details).length > 0) {
const arr = []
@ -853,7 +932,7 @@ export default {
kgs: '',
cbm: '',
tareweight: '',
weightype: '',
weightype: '累加',
weighkgs: '',
rowKey: this.tableData.length > 0 ? Number(this.tableData[this.tableData.length - 1].rowKey) + 1 : 0
}
@ -1047,8 +1126,34 @@ export default {
if (res.success) {
const data = JSON.parse(res.data)
const addTable = []
const cntrnoArr = []
this.tableData.map((item, index) => {
if (!item.cntrno) {
// delete this.tableData[index]
this.tableData.splice(index, 1)
} else {
cntrnoArr.push(item.cntrno)
}
})
const lastNum = this.tableData.length > 0 ? Number(this.tableData[this.tableData.length - 1].rowKey) + 1 : 0
data.map((item, index) => {
if (cntrnoArr.includes(item.CNTRNO)) {
const setWeighkgs = this.calc(Number(this.tableData[cntrnoArr.indexOf(item.CNTRNO)].kgs), Number(item.TAREWEIGHT), '+')
this.tableData[cntrnoArr.indexOf(item.CNTRNO)] = {
rowKey: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].rowKey,
ctnall: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].ctnall,
ctnnum: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].ctnnum,
cntrno: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].cntrno,
sealno: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].sealno,
pkgs: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].pkgs,
kindpkgs: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].kindpkgs,
kgs: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].kgs,
cbm: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].cbm,
tareweight: item.TAREWEIGHT,
weightype: this.tableData[cntrnoArr.indexOf(item.CNTRNO)].weightype,
weighkgs: setWeighkgs
}
} else {
const _data = {
rowKey: lastNum + index,
ctnall: '',
@ -1064,6 +1169,7 @@ export default {
weighkgs: ''
}
addTable.push(_data)
}
})
this.tableData = [...this.tableData, ...addTable]
this.$forceUpdate()

@ -1214,10 +1214,14 @@ export default {
},
kindpkgsSelect(value) {
this.details.kindpkgs = value
const enCapitalRes = this.SetTOTALNO(this.details.pkgs)
this.$emit('pkgsEnCapital', enCapitalRes)
},
kindpkgsChange(value) {
if (!value) {
this.details.kindpkgs = this.details.kindpkgs ? this.details.kindpkgs : ''
const enCapitalRes = this.SetTOTALNO(this.details.pkgs)
this.$emit('pkgsEnCapital', enCapitalRes)
}
this.getPackage(value)
},
@ -1473,7 +1477,7 @@ export default {
},
changePkgs () {
console.log(this.details.pkgs)
let enCapitalRes = this.SetTOTALNO(this.details.pkgs)
const enCapitalRes = this.SetTOTALNO(this.details.pkgs)
this.$emit('pkgsEnCapital', enCapitalRes)
},
SetTOTALNO (SS) {
@ -1502,7 +1506,6 @@ export default {
' ONLY.'
}
} else {
// const strNum = Number(SS);
const strNum = this.GetStringNum(SS);
console.log(strNum)
strKind = SS.substring(strNum.length);

@ -28,7 +28,7 @@
<button @click="openModel('cutOff')" :style="{ marginLeft: '4px' }">
<span class="iconfont icon-daibanshixiang"></span>截单
</button>
<button><span class="iconfont icon-xiugai" :style="{ marginLeft: '8px' }"></span>更改及退舱</button>
<button :style="{ marginLeft: '14px' }"><span class="iconfont icon-xiugai"></span>更改及退舱</button>
<button @click="openModel('vgm')"><span class="iconfont icon-dingdan"></span>VGM</button>
<button @click="openModel('paper')">
<span class="iconfont icon-zhizhishu" style="font-size:18px;"></span>下货纸
@ -62,10 +62,10 @@
</div>
<div
class="btn-list single-view-1"
v-if="!details.hbList || details.hbList.length === 0"
:style="{ width: '110px' }"
:style="{ width: '150px' }"
>
<button @click="addChild()"><span class="iconfont icon-zhizhishu"></span>添加分单</button>
<button @click="addChild()" v-if="!details.hbList || details.hbList.length === 0"><span class="iconfont icon-zhizhishu"></span></button>
<button><span class="iconfont icon-electronic-signature"></span>自定义必填项</button>
</div>
</a-card>
@ -281,7 +281,21 @@
:wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }"
has-feedback
>
{{ details.yard || '--' }}
<!-- {{ details.yard || '--' }} -->
<a-select
class="customer-input"
style="width:195px;"
:default-value="initCabinFrom.yard"
v-model="initCabinFrom.yard"
@change="handleYardChange"
show-search
:filter-option="filterOption"
:dropdownMatchSelectWidth="false"
>
<a-select-option v-for="(yard, yindex) in yardSelectData" :key="yindex" :value="yindex">
{{ yard.selectShowTab }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="8">
@ -291,7 +305,7 @@
:wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }"
has-feedback
>
{{ details.yardcontract || '--' }}
<a-input class="box-input" style="width:195px;" :allowClear="true" v-model="initCabinFrom.yardcontract" />
</a-form-item>
</a-col>
<a-col :span="8">
@ -301,7 +315,7 @@
:wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }"
has-feedback
>
{{ details.yardcontracttel || '--' }}
<a-input class="box-input" style="width:195px;" :allowClear="true" v-model="initCabinFrom.yardcontracttel" />
</a-form-item>
</a-col>
<a-col :span="8">
@ -311,7 +325,16 @@
:wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }"
has-feedback
>
{{ details.closingdate || '--' }}
<!-- {{ details.closingdate || '--' }} -->
<a-date-picker
show-time
style="width:120px;"
format="YYYY-MM-DD HH:mm:ss"
v-model="initCabinFrom.closingTime"
@change="closingdateChange"
>
<a-icon slot="suffixIcon" type="time" style="display: none" />
</a-date-picker>
</a-form-item>
</a-col>
<a-col :span="8">
@ -321,7 +344,16 @@
:wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }"
has-feedback
>
{{ details.closedocdate || '--' }}
<!-- {{ details.closedocdate || '--' }} -->
<a-date-picker
show-time
style="width:120px;"
format="YYYY-MM-DD HH:mm:ss"
v-model="initCabinFrom.closeDocTime"
@change="closedocdateChange"
>
<a-icon slot="suffixIcon" type="time" style="display: none" />
</a-date-picker>
</a-form-item>
</a-col>
<a-col :span="8">
@ -331,7 +363,16 @@
:wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }"
has-feedback
>
{{ details.closevgmdate || '--' }}
<!-- {{ details.closevgmdate || '--' }} -->
<a-date-picker
show-time
style="width:120px;"
format="YYYY-MM-DD HH:mm:ss"
v-model="initCabinFrom.vgmTime"
@change="closevgmdateChange"
>
<a-icon slot="suffixIcon" type="time" style="display: none" />
</a-date-picker>
</a-form-item>
</a-col>
</div>
@ -345,6 +386,7 @@
>
<div class="box-flex">
<a-input
class="remark-input"
style="width:1000px !important; text-align: left;"
:allowClear="true"
v-model="initCabinFrom.remark"
@ -652,7 +694,8 @@ import {
DownloadBookingOrClosingEDI,
DeleteLetterYard,
LetterYardPdf,
SendTrace
SendTrace,
GetYardlist
} from '@/api/modular/main/BookingLedger'
export default {
@ -756,6 +799,7 @@ export default {
},
mounted() {
this.BCvData = [...this.CvData]
this.getYardlist()
},
watch: {
scale() {
@ -981,7 +1025,14 @@ export default {
urlVgm: '',
urlVgmSi: ''
},
remark: ''
remark: '',
yard: this.details.yard,
yardid: this.details.yardid,
closeDocTime: this.details.closedocdate,
closingTime: this.details.closingdate,
vgmTime: this.details.closevgmdate,
yardcontract: this.details.yardcontract,
yardcontracttel: this.details.yardcontracttel
}
}
if (type === 'initCabin') {
@ -1322,18 +1373,20 @@ export default {
//
saveBookingLetteryard() {
console.log('=== 放舱 ===', this.initCabinFrom)
// if (!this.id) {
this.initCabinFrom = {
...this.initCabinFrom,
...{
closeDocTime: this.details.closedocdate,
closingTime: this.details.closingdate,
vgmTime: this.details.closevgmdate,
yardcontract: this.details.yardcontract,
yardcontracttel: this.details.yardcontracttel
}
}
// this.initCabinFrom = {
// ...this.initCabinFrom,
// ...{
// closeDocTime: this.details.closedocdate,
// closingTime: this.details.closingdate,
// vgmTime: this.details.closevgmdate,
// yardcontract: this.details.yardcontract,
// yardcontracttel: this.details.yardcontracttel
// }
// }
// }
debugger
SaveBookingLetteryard(this.initCabinFrom)
.then(res => {
if (res.success) {
@ -1514,6 +1567,52 @@ export default {
.catch(err => {
console.log(err)
})
},
getYardlist(name = '') {
GetYardlist({
keyword: name
})
.then(res => {
if (res.code === 200) {
this.yardData = res.data
const arr = []
res.data.map((item, index) => {
arr.push({
...{ selectShowTab: item.name + ' / ' + item.code },
...item
})
})
this.yardSelectData = arr
this.$forceUpdate()
}
})
.catch(err => {
console.log(err)
})
},
yardSelect(value) {
this.details.yard = value
const index = this.yardDataArr.indexOf(value)
this.details.yardid = this.yardData[index].code
},
yardChange(value) {
// this.getYardlist(value)
},
handleYardChange(index) {
this.initCabinFrom.yard = this.yardSelectData[index].name
this.initCabinFrom.yardid = this.yardSelectData[index].code
},
filterOption(input, option) {
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
closingdateChange (date, dateString) {
this.initCabinFrom.closingTime = dateString
},
closevgmdateChange (date, dateString) {
this.initCabinFrom.vgmTime = dateString
},
closedocdateChange (date, dateString) {
this.initCabinFrom.closeDocTime = dateString
}
}
}
@ -1601,7 +1700,7 @@ export default {
}
}
.more-view-1 {
width: 265px;
width: 270px;
.iconfont {
color: #26b578;
}
@ -1771,6 +1870,66 @@ export default {
opacity: 0.04;
}
}
/deep/ .ant-select-selection{
position: relative;
z-index: 1;
&::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
background-color: @primary-color !important;
opacity: 0.04;
}
}
/deep/ .ant-calendar-picker{
position: relative;
z-index: 1;
&::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
background-color: @primary-color !important;
opacity: 0.04;
}
}
/deep/ .ant-input-affix-wrapper, .ant-input-affix-wrapper-textarea-with-clear-btn{
position: relative;
z-index: 1;
&::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
background-color: @primary-color !important;
opacity: 0.04;
}
}
.remark-input{
position: relative;
z-index: 1;
&::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
background-color: @primary-color !important;
opacity: 0.04;
}
}
/deep/ .ant-modal-body .ant-input {
background: none;
}

@ -7,7 +7,7 @@
</a-col>
<a-col :span="12">
<div class="tit"><span class="iconfont icon-bianji"></span>截单备注</div>
<a-textarea class="input-box" v-model="details.siremark" />
<a-textarea class="input-box" v-model="details.siremark" data-next="box-ctnall"/>
</a-col>
</a-row>
</a-card>

@ -14,7 +14,7 @@
<x-card>
<div slot="content" class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="48">
<a-row :gutter="48" class="booking-from-box">
<template v-for="(formLabel, findex) in formData">
<a-col
:md="6"
@ -347,7 +347,8 @@ export default {
{ label: '起运港', value: '1' },
{ label: '目的港', value: '2' }
],
traceValue: []
traceValue: [],
addNum: 0
}
},
created() {
@ -391,7 +392,7 @@ export default {
this.getTableList()
},
getFormData() {
getFormData(isReset = false) {
DjyUserConfigGet({ type: 'booking_list_cond' }).then(res => {
if (res.data && JSON.parse(res.data.configJson).length) {
const arr = JSON.parse(res.data.configJson)
@ -426,13 +427,16 @@ export default {
this.formData.map((item, index) => {
this.$set(this.formRes, item.label, this.formRes[item.label] || '')
})
if (!isReset) {
this.getList(this.formRes)
}
const len = this.formData.length % 4
if (this.formData.length === 4 || this.formData.length > 4) {
this.formBtnCol = 8
} else {
this.formBtnCol = 24 - len * 4
}
console.log('== 测试宽度1 ==', this.formBtnCol)
this.$forceUpdate()
})
},
@ -485,8 +489,10 @@ export default {
}
} else {
const len = this.formData.length % 6
this.formBtnCol = 24 - len * 4
// this.formBtnCol = 24 - len * 4
this.formBtnCol = 24 - len * 4 === 4 ? 24 : 24 - len * 4
}
console.log('== 测试宽度2 ==', this.formBtnCol)
},
tableRefresh() {
let data = { ...this.formRes }
@ -531,7 +537,12 @@ export default {
Object.keys(this.formRes).map((item, index) => {
this.formRes[item] = ''
})
this.init()
Object.keys(this.$refs).map((label, index) => {
if (label.includes('fromlabel-') && this.$refs[label].length > 0) {
this.$refs[label][0].$data.value = ''
}
})
this.ResetType = true
},
submitForm(data) {
@ -720,7 +731,8 @@ export default {
},
addSubmit() {
this.addVisible = false
this.$router.push({ name: 'BookingDetail', query: { type: this.carrierRadio } })
this.addNum = Math.round(Math.random() * 1000)
this.$router.push({ name: 'BookingDetail', query: { type: this.carrierRadio, addNum: this.addNum } })
},
addCancel() {
this.addVisible = false
@ -1427,4 +1439,10 @@ export default {
}
}
}
@media (min-width: 1192px) and (max-width: 1591px) {
.booking-from-box{
padding-right: 24px;
}
}
</style>

Loading…
Cancel
Save