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

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

@ -5,11 +5,14 @@
<div class="left">
<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-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 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-icon type="arrows-alt" />展开箱量
@ -171,7 +174,7 @@ export default {
class="ctnallView"
allow-clear={true}
style="width: 90px"
filter-option={ this.filterOption }
filter-option={this.filterOption}
on-change={val => {
// console.log('== change ==')
if (val !== undefined) {
@ -294,7 +297,7 @@ export default {
showSearch
defaultValue={row['kindpkgs']}
option-filter-prop="children"
filter-option={ this.filterOption }
filter-option={this.filterOption}
style="width: 120px"
class="kindpkgsView"
on-change={val => {
@ -309,10 +312,12 @@ export default {
// console.log('== - ==', index, item.kindpkgs)
if (
document
.getElementsByClassName('kindpkgsView')[index].getElementsByClassName('ant-select-selection-selected-value')[0]
.getElementsByClassName('kindpkgsView')
[index].getElementsByClassName('ant-select-selection-selected-value')[0]
) {
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 || ''
} else {
document.getElementsByClassName('kindpkgsView')[index].getElementsByTagName('input')[0].val =
@ -328,7 +333,8 @@ export default {
if (index !== rowIndex) {
item.kindpkgs = ''
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,
renderBodyCell: ({ row, column, rowIndex }, h) => {
return (
<a-date-picker value={row['weighdate']} on-change={(date, dateString) => {
<a-date-picker
value={row['weighdate']}
on-change={(date, dateString) => {
// console.log('== ==', dateString)
this.tableData[rowIndex].weighdate = dateString
row['weighdate'] = dateString
}} />
}}
/>
)
},
renderHeaderCell: ({ column }, h) => {
@ -495,7 +504,7 @@ export default {
</span>
)
}
},
}
],
modelColumns: [
{
@ -644,7 +653,9 @@ export default {
tableData: [],
editOption: {
beforeCellValueChange: ({ row, column, changeValue }) => {
if (this.inTableLoad) { return false }
if (this.inTableLoad) {
return false
}
if (
['pkgs', 'kgs', 'cbm', 'tareweight'].includes(column.field) &&
!new RegExp(/^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/).test(changeValue)
@ -689,7 +700,9 @@ export default {
}
},
afterCellValueChange: ({ row, column, changeValue }) => {
if (this.inTableLoad) { return false }
if (this.inTableLoad) {
return false
}
if (['kgs', 'cbm', 'tareweight', 'weighkgs'].includes(column.field)) {
changeValue = changeValue + ''
const valIndex = changeValue.includes('.') ? changeValue.indexOf('.') + 1 : false
@ -811,8 +824,7 @@ export default {
}
}
},
cellValueChange: ({ row, column }) => {
}
cellValueChange: ({ row, column }) => {}
},
editChildOption: {
beforeCellValueChange: ({ row, column, changeValue }) => {
@ -1049,19 +1061,20 @@ export default {
val: this.totalCbm
})
},
openEdit (nval, oval) {
openEdit(nval, oval) {
// -
if (nval) {
const editDom = document.getElementsByClassName('ve-table-edit-input')[0]
// console.log('', editDom)
editDom.addEventListener('focus', (e) => {
editDom.addEventListener('focus', e => {
// console.log('== ==', this.cellSelectionOption.enable)
// if (!this.cellSelectionOption.enable) { return false }
document.onkeydown = event => {
// - start
if (event.key === 'Backspace' && this.ctnallViewIndex !== null) {
const val = document.getElementsByClassName('ctnallView')[this.ctnallViewIndex].getElementsByTagName('input')[0]
.value
const val = document
.getElementsByClassName('ctnallView')
[this.ctnallViewIndex].getElementsByTagName('input')[0].value
document
.getElementsByClassName('ctnallView')
[this.ctnallViewIndex].getElementsByTagName('input')[0].value = val.substr(0, val.length - 1)
@ -1077,7 +1090,11 @@ export default {
// this.tableData[this.ctnallViewIndex].ctnall = val.substr(0, val.length - 1)
}
// - 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);
// if ([37, 38, 39, 40, 9].includes(event.keyCode)) {
// event = window.event || event;
@ -1132,9 +1149,9 @@ export default {
methods: {
isDOM(item) {
// HTMLELement使HTMLElementDOMODM使
return (typeof HTMLElement === 'function')
? (item instanceof HTMLElement)
: (item && (typeof item === 'object') && (item.nodeType === 1) && (typeof item.nodeName === 'string'));
return typeof HTMLElement === 'function'
? item instanceof HTMLElement
: item && typeof item === 'object' && item.nodeType === 1 && typeof item.nodeName === 'string'
},
//
changeSelectedRowKeys(keys) {
@ -1145,7 +1162,7 @@ export default {
this.$refs['tableRef'].startEditingCell({ rowKey, colKey, defaultValue })
},
setCellSelection(rowKey, colKey) {
this.$refs['tableRef'].setCellSelection({ rowKey, colKey });
this.$refs['tableRef'].setCellSelection({ rowKey, colKey })
},
init() {
this.inTableLoad = true
@ -1211,9 +1228,7 @@ export default {
}, 1200)
},
filterOption(input, option) {
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
enmuErrorLabel(val) {
switch (val) {
@ -1276,6 +1291,9 @@ export default {
this.totalPkgs = pkgs
this.checkboxOption.selectedRowKeys = []
this.selectArr = []
this.tableData.forEach((item, index) => {
item.rowKey = index
})
},
developboxLine() {
const arr = []
@ -1496,6 +1514,7 @@ export default {
this.$message.error('请选择一条数据')
} else {
console.log(this.tableData, this.selectArr[0])
console.log(this.tableData[this.selectArr[0]])
if (this.tableData[this.selectArr[0]].ctnnum > 1) {
console.log(
parseFloat(this.tableData[this.selectArr[0]].ctnnum),

Loading…
Cancel
Save