szh_zidingyibiaoti
张同海 2 years ago
parent 448ec0a1b1
commit 3fbd03323b

@ -1225,6 +1225,8 @@ export default {
this.setDeatilsFun(res, true) this.setDeatilsFun(res, true)
setTimeout(() => { setTimeout(() => {
this.inAddSave = false this.inAddSave = false
this.getRightAll()
this.$refs.rightContent.init()
}, 2000) }, 2000)
} else if (that.$route.query.mblno === that.bookingDetails.mblno) { } else if (that.$route.query.mblno === that.bookingDetails.mblno) {
that.isCopy = false that.isCopy = false

@ -5,11 +5,14 @@
<div class="left"> <div class="left">
<a-button class="btn btn-add" type="primary" @click="addboxLine"></a-button> <a-button class="btn btn-add" type="primary" @click="addboxLine"></a-button>
<a-button class="btn btn-delete" @click="removeLine" :style="{ marginRight: '50px' }">删除</a-button> <a-button class="btn btn-delete" @click="removeLine" :style="{ marginRight: '50px' }">删除</a-button>
<a-button class="btn btn-more-name" type="primary" @click="openDialog" :disabled="tableData.length === 0"><a-icon type="appstore" />多品名 <a-button class="btn btn-more-name" type="primary" @click="openDialog" :disabled="tableData.length === 0"
><a-icon type="appstore" />多品名
</a-button> </a-button>
<a-button class="btn btn-import-station" type="primary" @click="importYarn" :loading="YarnLoading"><a-icon type="import" />引入场站数据</a-button <a-button class="btn btn-import-station" type="primary" @click="importYarn" :loading="YarnLoading"
><a-icon type="import" />引入场站数据</a-button
> >
<a-button class="btn btn-weight" type="primary" @click="importWeight" :loading="WeightLoading"><a-icon type="import" />引入箱皮重</a-button <a-button class="btn btn-weight" type="primary" @click="importWeight" :loading="WeightLoading"
><a-icon type="import" />引入箱皮重</a-button
> >
<a-button class="btn btn-weight" type="primary" @click="arrowsWeight"> <a-button class="btn btn-weight" type="primary" @click="arrowsWeight">
<a-icon type="arrows-alt" />展开箱量 <a-icon type="arrows-alt" />展开箱量
@ -171,7 +174,7 @@ export default {
class="ctnallView" class="ctnallView"
allow-clear={true} allow-clear={true}
style="width: 90px" style="width: 90px"
filter-option={ this.filterOption } filter-option={this.filterOption}
on-change={val => { on-change={val => {
// console.log('== change ==') // console.log('== change ==')
if (val !== undefined) { if (val !== undefined) {
@ -294,7 +297,7 @@ export default {
showSearch showSearch
defaultValue={row['kindpkgs']} defaultValue={row['kindpkgs']}
option-filter-prop="children" option-filter-prop="children"
filter-option={ this.filterOption } filter-option={this.filterOption}
style="width: 120px" style="width: 120px"
class="kindpkgsView" class="kindpkgsView"
on-change={val => { on-change={val => {
@ -309,10 +312,12 @@ export default {
// console.log('== - ==', index, item.kindpkgs) // console.log('== - ==', index, item.kindpkgs)
if ( if (
document document
.getElementsByClassName('kindpkgsView')[index].getElementsByClassName('ant-select-selection-selected-value')[0] .getElementsByClassName('kindpkgsView')
[index].getElementsByClassName('ant-select-selection-selected-value')[0]
) { ) {
document document
.getElementsByClassName('kindpkgsView')[index].getElementsByClassName('ant-select-selection-selected-value')[0].innerHTML = .getElementsByClassName('kindpkgsView')
[index].getElementsByClassName('ant-select-selection-selected-value')[0].innerHTML =
this.packageList[val].name || '' this.packageList[val].name || ''
} else { } else {
document.getElementsByClassName('kindpkgsView')[index].getElementsByTagName('input')[0].val = document.getElementsByClassName('kindpkgsView')[index].getElementsByTagName('input')[0].val =
@ -328,7 +333,8 @@ export default {
if (index !== rowIndex) { if (index !== rowIndex) {
item.kindpkgs = '' item.kindpkgs = ''
document document
.getElementsByClassName('kindpkgsView')[index].getElementsByClassName('ant-select-selection-selected-value')[0].innerHTML = '' .getElementsByClassName('kindpkgsView')
[index].getElementsByClassName('ant-select-selection-selected-value')[0].innerHTML = ''
} }
}) })
} }
@ -481,11 +487,14 @@ export default {
edit: false, edit: false,
renderBodyCell: ({ row, column, rowIndex }, h) => { renderBodyCell: ({ row, column, rowIndex }, h) => {
return ( return (
<a-date-picker value={row['weighdate']} on-change={(date, dateString) => { <a-date-picker
// console.log('== ==', dateString) value={row['weighdate']}
this.tableData[rowIndex].weighdate = dateString on-change={(date, dateString) => {
row['weighdate'] = dateString // console.log('== ==', dateString)
}} /> this.tableData[rowIndex].weighdate = dateString
row['weighdate'] = dateString
}}
/>
) )
}, },
renderHeaderCell: ({ column }, h) => { renderHeaderCell: ({ column }, h) => {
@ -495,7 +504,7 @@ export default {
</span> </span>
) )
} }
}, }
], ],
modelColumns: [ modelColumns: [
{ {
@ -644,7 +653,9 @@ export default {
tableData: [], tableData: [],
editOption: { editOption: {
beforeCellValueChange: ({ row, column, changeValue }) => { beforeCellValueChange: ({ row, column, changeValue }) => {
if (this.inTableLoad) { return false } if (this.inTableLoad) {
return false
}
if ( if (
['pkgs', 'kgs', 'cbm', 'tareweight'].includes(column.field) && ['pkgs', 'kgs', 'cbm', 'tareweight'].includes(column.field) &&
!new RegExp(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/).test(changeValue) !new RegExp(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/).test(changeValue)
@ -689,7 +700,9 @@ export default {
} }
}, },
afterCellValueChange: ({ row, column, changeValue }) => { afterCellValueChange: ({ row, column, changeValue }) => {
if (this.inTableLoad) { return false } if (this.inTableLoad) {
return false
}
if (['kgs', 'cbm', 'tareweight', 'weighkgs'].includes(column.field)) { if (['kgs', 'cbm', 'tareweight', 'weighkgs'].includes(column.field)) {
changeValue = changeValue + '' changeValue = changeValue + ''
const valIndex = changeValue.includes('.') ? changeValue.indexOf('.') + 1 : false const valIndex = changeValue.includes('.') ? changeValue.indexOf('.') + 1 : false
@ -811,8 +824,7 @@ export default {
} }
} }
}, },
cellValueChange: ({ row, column }) => { cellValueChange: ({ row, column }) => {}
}
}, },
editChildOption: { editChildOption: {
beforeCellValueChange: ({ row, column, changeValue }) => { beforeCellValueChange: ({ row, column, changeValue }) => {
@ -1049,19 +1061,20 @@ export default {
val: this.totalCbm val: this.totalCbm
}) })
}, },
openEdit (nval, oval) { openEdit(nval, oval) {
// - // -
if (nval) { if (nval) {
const editDom = document.getElementsByClassName('ve-table-edit-input')[0] const editDom = document.getElementsByClassName('ve-table-edit-input')[0]
// console.log('', editDom) // console.log('', editDom)
editDom.addEventListener('focus', (e) => { editDom.addEventListener('focus', e => {
// console.log('== ==', this.cellSelectionOption.enable) // console.log('== ==', this.cellSelectionOption.enable)
// if (!this.cellSelectionOption.enable) { return false } // if (!this.cellSelectionOption.enable) { return false }
document.onkeydown = event => { document.onkeydown = event => {
// - start // - start
if (event.key === 'Backspace' && this.ctnallViewIndex !== null) { if (event.key === 'Backspace' && this.ctnallViewIndex !== null) {
const val = document.getElementsByClassName('ctnallView')[this.ctnallViewIndex].getElementsByTagName('input')[0] const val = document
.value .getElementsByClassName('ctnallView')
[this.ctnallViewIndex].getElementsByTagName('input')[0].value
document document
.getElementsByClassName('ctnallView') .getElementsByClassName('ctnallView')
[this.ctnallViewIndex].getElementsByTagName('input')[0].value = val.substr(0, val.length - 1) [this.ctnallViewIndex].getElementsByTagName('input')[0].value = val.substr(0, val.length - 1)
@ -1076,8 +1089,12 @@ export default {
[this.kindpkgsViewIndex].getElementsByTagName('input')[0].value = val.substr(0, val.length - 1) [this.kindpkgsViewIndex].getElementsByTagName('input')[0].value = val.substr(0, val.length - 1)
// this.tableData[this.ctnallViewIndex].ctnall = val.substr(0, val.length - 1) // this.tableData[this.ctnallViewIndex].ctnall = val.substr(0, val.length - 1)
} }
// - end // - end
console.log('按下:' + event.key + '键:' + event.keyCode, '== 当前是否允许编辑 ==', this.cellSelectionOption.enable); console.log(
'按下:' + event.key + '键:' + event.keyCode,
'== 当前是否允许编辑 ==',
this.cellSelectionOption.enable
)
// console.log(':' + event.key + ':' + event.keyCode, document.activeElement); // console.log(':' + event.key + ':' + event.keyCode, document.activeElement);
// if ([37, 38, 39, 40, 9].includes(event.keyCode)) { // if ([37, 38, 39, 40, 9].includes(event.keyCode)) {
// event = window.event || event; // event = window.event || event;
@ -1131,10 +1148,10 @@ export default {
methods: { methods: {
isDOM(item) { isDOM(item) {
// HTMLELement使HTMLElementDOMODM使 // HTMLELement使HTMLElementDOMODM使
return (typeof HTMLElement === 'function') return typeof HTMLElement === 'function'
? (item instanceof HTMLElement) ? item instanceof HTMLElement
: (item && (typeof item === 'object') && (item.nodeType === 1) && (typeof item.nodeName === 'string')); : item && typeof item === 'object' && item.nodeType === 1 && typeof item.nodeName === 'string'
}, },
// //
changeSelectedRowKeys(keys) { changeSelectedRowKeys(keys) {
@ -1145,7 +1162,7 @@ export default {
this.$refs['tableRef'].startEditingCell({ rowKey, colKey, defaultValue }) this.$refs['tableRef'].startEditingCell({ rowKey, colKey, defaultValue })
}, },
setCellSelection(rowKey, colKey) { setCellSelection(rowKey, colKey) {
this.$refs['tableRef'].setCellSelection({ rowKey, colKey }); this.$refs['tableRef'].setCellSelection({ rowKey, colKey })
}, },
init() { init() {
this.inTableLoad = true this.inTableLoad = true
@ -1211,9 +1228,7 @@ export default {
}, 1200) }, 1200)
}, },
filterOption(input, option) { filterOption(input, option) {
return ( return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
}, },
enmuErrorLabel(val) { enmuErrorLabel(val) {
switch (val) { switch (val) {
@ -1276,6 +1291,9 @@ export default {
this.totalPkgs = pkgs this.totalPkgs = pkgs
this.checkboxOption.selectedRowKeys = [] this.checkboxOption.selectedRowKeys = []
this.selectArr = [] this.selectArr = []
this.tableData.forEach((item, index) => {
item.rowKey = index
})
}, },
developboxLine() { developboxLine() {
const arr = [] const arr = []
@ -1496,6 +1514,7 @@ export default {
this.$message.error('请选择一条数据') this.$message.error('请选择一条数据')
} else { } else {
console.log(this.tableData, this.selectArr[0]) console.log(this.tableData, this.selectArr[0])
console.log(this.tableData[this.selectArr[0]])
if (this.tableData[this.selectArr[0]].ctnnum > 1) { if (this.tableData[this.selectArr[0]].ctnnum > 1) {
console.log( console.log(
parseFloat(this.tableData[this.selectArr[0]].ctnnum), parseFloat(this.tableData[this.selectArr[0]].ctnnum),

Loading…
Cancel
Save