|
|
@ -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,如果支持,使用HTMLElement,如果不支持,通过判断DOM的特征,如果拥有这些特征说明就是ODM节点,特征使用的越多越准确
|
|
|
|
// 首先判断是否支持HTMLELement,如果支持,使用HTMLElement,如果不支持,通过判断DOM的特征,如果拥有这些特征说明就是ODM节点,特征使用的越多越准确
|
|
|
|
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),
|
|
|
|