diff --git a/src/views/main/BookingLedger/detail/components/sedOrder.vue b/src/views/main/BookingLedger/detail/components/sedOrder.vue index 7006e92..21ce60b 100644 --- a/src/views/main/BookingLedger/detail/components/sedOrder.vue +++ b/src/views/main/BookingLedger/detail/components/sedOrder.vue @@ -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 diff --git a/src/views/main/BookingLedger/detail/index.vue b/src/views/main/BookingLedger/detail/index.vue index 67680f3..a8ad682 100644 --- a/src/views/main/BookingLedger/detail/index.vue +++ b/src/views/main/BookingLedger/detail/index.vue @@ -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: '当点击确定按钮时,此页面 将会关闭。', diff --git a/src/views/main/BookingLedger/detail/modules/goodsTable.vue b/src/views/main/BookingLedger/detail/modules/goodsTable.vue index 3f09141..e528f17 100644 --- a/src/views/main/BookingLedger/detail/modules/goodsTable.vue +++ b/src/views/main/BookingLedger/detail/modules/goodsTable.vue @@ -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 ( - // - // { - // - // } - // { - // - // - // - // } - // { - const data = this.ctnList[val] - this.tableData[rowIndex].ctnall = data.name - this.tableData[rowIndex].ctncode = data.code - row['ctnall'] = data.name - this.$forceUpdate() + 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 {item.name} })} + //
+ // { + // 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) + // }} + // /> + //
) } }, @@ -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 ( { - const data = this.packageList[val] - this.tableData[rowIndex].kindpkgs = data.name - row['kindpkgs'] = data.name - this.$forceUpdate() + 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,23 +1126,50 @@ 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) => { - const _data = { - rowKey: lastNum + index, - ctnall: '', - ctnnum: '1', - cntrno: '', - sealno: '', - pkgs: '', - kindpkgs: '', - kgs: '', - cbm: '', - tareweight: item.TAREWEIGHT, - weightype: '', - weighkgs: '' + 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: '', + ctnnum: '1', + cntrno: '', + sealno: '', + pkgs: '', + kindpkgs: '', + kgs: '', + cbm: '', + tareweight: item.TAREWEIGHT, + weightype: '', + weighkgs: '' + } + addTable.push(_data) } - addTable.push(_data) }) this.tableData = [...this.tableData, ...addTable] this.$forceUpdate() diff --git a/src/views/main/BookingLedger/detail/modules/mailingInfo.vue b/src/views/main/BookingLedger/detail/modules/mailingInfo.vue index ba51f81..cf60b68 100644 --- a/src/views/main/BookingLedger/detail/modules/mailingInfo.vue +++ b/src/views/main/BookingLedger/detail/modules/mailingInfo.vue @@ -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); diff --git a/src/views/main/BookingLedger/detail/modules/operationArea.vue b/src/views/main/BookingLedger/detail/modules/operationArea.vue index fa83a86..55d22ed 100644 --- a/src/views/main/BookingLedger/detail/modules/operationArea.vue +++ b/src/views/main/BookingLedger/detail/modules/operationArea.vue @@ -28,7 +28,7 @@ - + + + @@ -281,7 +281,21 @@ :wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }" has-feedback > - {{ details.yard || '--' }} + + + + {{ yard.selectShowTab }} + + @@ -291,7 +305,7 @@ :wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }" has-feedback > - {{ details.yardcontract || '--' }} + @@ -301,7 +315,7 @@ :wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }" has-feedback > - {{ details.yardcontracttel || '--' }} + @@ -311,7 +325,16 @@ :wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }" has-feedback > - {{ details.closingdate || '--' }} + + + + @@ -321,7 +344,16 @@ :wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }" has-feedback > - {{ details.closedocdate || '--' }} + + + + @@ -331,7 +363,16 @@ :wrapperCol="{ xs: { span: 24 }, sm: { span: 15 } }" has-feedback > - {{ details.closevgmdate || '--' }} + + + + @@ -345,6 +386,7 @@ >
{ 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; } diff --git a/src/views/main/BookingLedger/detail/modules/remarksInfo.vue b/src/views/main/BookingLedger/detail/modules/remarksInfo.vue index 91b1ba2..74769c4 100644 --- a/src/views/main/BookingLedger/detail/modules/remarksInfo.vue +++ b/src/views/main/BookingLedger/detail/modules/remarksInfo.vue @@ -7,7 +7,7 @@
截单备注
- +
diff --git a/src/views/main/BookingLedger/list/index.vue b/src/views/main/BookingLedger/list/index.vue index 1d57a92..70749fa 100644 --- a/src/views/main/BookingLedger/list/index.vue +++ b/src/views/main/BookingLedger/list/index.vue @@ -14,7 +14,7 @@
- +