|
|
|
@ -38,38 +38,30 @@
|
|
|
|
|
@ok="handleModelSubmit"
|
|
|
|
|
@cancel="handleModelCancel"
|
|
|
|
|
>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<div>
|
|
|
|
|
<div class="parent-table parent-table-title">
|
|
|
|
|
<span>箱型</span>
|
|
|
|
|
<span>箱量</span>
|
|
|
|
|
<span>箱号</span>
|
|
|
|
|
<span>封号</span>
|
|
|
|
|
<span>件数</span>
|
|
|
|
|
<span>包装</span>
|
|
|
|
|
<span>重量</span>
|
|
|
|
|
<span>尺码</span>
|
|
|
|
|
<span>箱皮重</span>
|
|
|
|
|
<span>称重方式</span>
|
|
|
|
|
<span>称重重量</span>
|
|
|
|
|
</div>
|
|
|
|
|
<a-radio-group default-value="a" size="large">
|
|
|
|
|
<a-radio-button value="a" :style="radioStyle" v-for="(pitem,pindex) in tableData" :key="pindex">
|
|
|
|
|
<div class="parent-table">
|
|
|
|
|
<span>{{ pitem.ctnall }}</span>
|
|
|
|
|
<span>{{ pitem.ctnnum }}</span>
|
|
|
|
|
<span>{{ pitem.cntrno }}</span>
|
|
|
|
|
<span>{{ pitem.sealno }}</span>
|
|
|
|
|
<span>{{ pitem.pkgs }}</span>
|
|
|
|
|
<span>{{ pitem.kindpkgs }}</span>
|
|
|
|
|
<span>{{ pitem.kgs }}</span>
|
|
|
|
|
<span>{{ pitem.cbm }}</span>
|
|
|
|
|
<span>{{ pitem.tareweight }}</span>
|
|
|
|
|
<span>{{ pitem.weightype }}</span>
|
|
|
|
|
<span>{{ pitem.weighkgs }}</span>
|
|
|
|
|
</div>
|
|
|
|
|
</a-radio-button>
|
|
|
|
|
</a-radio-group>
|
|
|
|
|
<div class="model-content">
|
|
|
|
|
<ve-table
|
|
|
|
|
style="width:100%"
|
|
|
|
|
:columns="modelColumns"
|
|
|
|
|
:table-data="tableData"
|
|
|
|
|
:radio-option="radioOption"
|
|
|
|
|
row-key-field-name="rowKey"
|
|
|
|
|
/>
|
|
|
|
|
<div class="model-botton-box">
|
|
|
|
|
<a-button class="btn" type="primary" @click="addChildData">新增</a-button>
|
|
|
|
|
<a-button class="btn" @click="removeChildData">删除</a-button>
|
|
|
|
|
<a-button class="btn" type="primary" @click="saveChildData">保存</a-button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="model-child-table">
|
|
|
|
|
<ve-table
|
|
|
|
|
:columns="childColumns"
|
|
|
|
|
:table-data="childTableData"
|
|
|
|
|
borderY
|
|
|
|
|
:cell-autofill-option="cellAutofillOption"
|
|
|
|
|
:editOption="editChildOption"
|
|
|
|
|
rowKeyFieldName="rowKey"
|
|
|
|
|
:rowStyleOption="rowStyleOption"
|
|
|
|
|
:checkbox-option="checkChildboxOption"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</a-modal>
|
|
|
|
@ -259,6 +251,153 @@ export default {
|
|
|
|
|
edit: true
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
modelColumns: [
|
|
|
|
|
{
|
|
|
|
|
field: '',
|
|
|
|
|
key: 'radio',
|
|
|
|
|
type: 'radio',
|
|
|
|
|
title: '',
|
|
|
|
|
width: 40,
|
|
|
|
|
operationColumn: true,
|
|
|
|
|
align: 'center',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'ctnall',
|
|
|
|
|
key: 'ctnall',
|
|
|
|
|
title: '箱型',
|
|
|
|
|
align: 'left',
|
|
|
|
|
width: 80,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'ctnnum',
|
|
|
|
|
key: 'ctnnum ',
|
|
|
|
|
title: '箱量',
|
|
|
|
|
align: 'left',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'cntrno',
|
|
|
|
|
key: 'cntrno',
|
|
|
|
|
title: '箱号',
|
|
|
|
|
align: 'left',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'sealno',
|
|
|
|
|
key: 'sealno',
|
|
|
|
|
title: '封号',
|
|
|
|
|
align: 'left',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'pkgs',
|
|
|
|
|
key: 'pkgs',
|
|
|
|
|
title: '件数',
|
|
|
|
|
align: 'left',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'kindpkgs',
|
|
|
|
|
key: 'kindpkgs',
|
|
|
|
|
title: '包装',
|
|
|
|
|
align: 'left',
|
|
|
|
|
width: 130
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'weighkgs',
|
|
|
|
|
key: 'weighkgs',
|
|
|
|
|
title: '毛重',
|
|
|
|
|
align: 'left',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'cbm',
|
|
|
|
|
key: 'cbm',
|
|
|
|
|
title: '尺码',
|
|
|
|
|
align: 'left',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
childColumns: [
|
|
|
|
|
{
|
|
|
|
|
field: '',
|
|
|
|
|
key: 'checkbox',
|
|
|
|
|
type: 'checkbox',
|
|
|
|
|
title: '',
|
|
|
|
|
width: 40,
|
|
|
|
|
operationColumn: true,
|
|
|
|
|
align: 'center',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'pkgs',
|
|
|
|
|
key: 'pkgs',
|
|
|
|
|
title: '件数',
|
|
|
|
|
align: 'left',
|
|
|
|
|
edit: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'kindpkgs',
|
|
|
|
|
key: 'kindpkgs',
|
|
|
|
|
title: '包装',
|
|
|
|
|
align: 'left',
|
|
|
|
|
edit: false,
|
|
|
|
|
width: 130,
|
|
|
|
|
renderBodyCell: ({ row, column, rowIndex }, h) => {
|
|
|
|
|
return (
|
|
|
|
|
<a-select
|
|
|
|
|
show-search
|
|
|
|
|
value={row['kindpkgs']}
|
|
|
|
|
placeholder="请输入包装"
|
|
|
|
|
option-filter-prop="children"
|
|
|
|
|
style="width: 120px"
|
|
|
|
|
on-change={(val) => {
|
|
|
|
|
const data = this.packageList[val]
|
|
|
|
|
row['kindpkgs'] = data.name
|
|
|
|
|
this.childTableData[rowIndex].kindpkgs = data.name
|
|
|
|
|
this.details.ctnInputs[this.childModelSelectIndex].ctnDetailInputs[rowIndex].kindpkgs = data.name
|
|
|
|
|
console.log(this.childTableData[rowIndex])
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{
|
|
|
|
|
this.packageList.map((item, index) => {
|
|
|
|
|
return (<a-select-option value={index}>{item.name}</a-select-option>)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</a-select>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'weighkgs',
|
|
|
|
|
key: 'weighkgs',
|
|
|
|
|
title: '毛重',
|
|
|
|
|
align: 'left',
|
|
|
|
|
edit: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'cbm',
|
|
|
|
|
key: 'cbm',
|
|
|
|
|
title: '尺码',
|
|
|
|
|
align: 'left',
|
|
|
|
|
edit: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'hscode',
|
|
|
|
|
key: 'hscode',
|
|
|
|
|
title: 'HS代码',
|
|
|
|
|
align: 'left',
|
|
|
|
|
edit: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'marks',
|
|
|
|
|
key: 'marks',
|
|
|
|
|
title: '唛头',
|
|
|
|
|
align: 'left',
|
|
|
|
|
edit: true,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'description',
|
|
|
|
|
key: 'description',
|
|
|
|
|
title: '货描',
|
|
|
|
|
align: 'left',
|
|
|
|
|
edit: true,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
tableData: [],
|
|
|
|
|
editOption: {
|
|
|
|
|
beforeCellValueChange: ({ row, column, changeValue }) => {
|
|
|
|
@ -313,6 +452,69 @@ export default {
|
|
|
|
|
console.log('编辑', row, column)
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
editChildOption: {
|
|
|
|
|
beforeCellValueChange: ({ row, column, changeValue }) => {
|
|
|
|
|
console.log('beforeCellValueChange')
|
|
|
|
|
console.log('row::', row)
|
|
|
|
|
console.log('column::', column)
|
|
|
|
|
console.log('changeValue::', changeValue)
|
|
|
|
|
if (['pkgs', 'kgs', 'cbm'].includes(column.field) && !/^\d+$/.test(changeValue)) {
|
|
|
|
|
const height = document.body.clientHeight - 100
|
|
|
|
|
this.$message.config({
|
|
|
|
|
top: `${height}px`,
|
|
|
|
|
duration: 2,
|
|
|
|
|
maxCount: 3
|
|
|
|
|
});
|
|
|
|
|
this.$message.error(`输入的${this.enmuErrorLabel(column.field)}不符合规则`)
|
|
|
|
|
row['cntrno'] = ''
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.$message.destroy()
|
|
|
|
|
}, 2000)
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
afterCellValueChange: ({ row, column, changeValue }) => {
|
|
|
|
|
console.log('afterCellValueChange')
|
|
|
|
|
console.log('row::', row)
|
|
|
|
|
console.log('column::', column)
|
|
|
|
|
console.log('changeValue::', changeValue)
|
|
|
|
|
let num = null
|
|
|
|
|
this.childTableData.map((item, index) => {
|
|
|
|
|
if (row.rowKey === item.rowKey) {
|
|
|
|
|
// eslint-disable-next-line no-const-assign
|
|
|
|
|
num = index
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.childTableData[num][column.field] = changeValue
|
|
|
|
|
this.details.ctnInputs[this.childModelSelectIndex].ctnDetailInputs[num][column.field] = changeValue
|
|
|
|
|
this.$forceUpdate()
|
|
|
|
|
// if (column.field === 'pkgs') {
|
|
|
|
|
// let num = 0
|
|
|
|
|
// this.tableData.map((item, index) => {
|
|
|
|
|
// num += Number(item.pkgs)
|
|
|
|
|
// })
|
|
|
|
|
// this.totalPkgs = num
|
|
|
|
|
// }
|
|
|
|
|
// if (column.field === 'kgs') {
|
|
|
|
|
// let num = 0
|
|
|
|
|
// this.tableData.map((item, index) => {
|
|
|
|
|
// num += Number(item.kgs)
|
|
|
|
|
// })
|
|
|
|
|
// this.totalKgs = num
|
|
|
|
|
// }
|
|
|
|
|
// if (column.field === 'cbm') {
|
|
|
|
|
// let num = 0
|
|
|
|
|
// this.tableData.map((item, index) => {
|
|
|
|
|
// num += Number(item.cbm)
|
|
|
|
|
// })
|
|
|
|
|
// this.totalCbm = num
|
|
|
|
|
// }
|
|
|
|
|
console.log('---')
|
|
|
|
|
},
|
|
|
|
|
cellValueChange: ({ row, column }) => {
|
|
|
|
|
console.log('编辑', row, column)
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
// 可控单元格编辑
|
|
|
|
|
rowStyleOption: {
|
|
|
|
|
clickHighlight: false,
|
|
|
|
@ -336,6 +538,23 @@ export default {
|
|
|
|
|
console.log('全选', isSelected, selectedRowKeys)
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
checkChildboxOption: {
|
|
|
|
|
hideSelectAll: false,
|
|
|
|
|
// 行选择改变事件
|
|
|
|
|
selectedRowChange: ({ row, isSelected, selectedRowKeys }) => {
|
|
|
|
|
console.log('行选择', row, isSelected, selectedRowKeys)
|
|
|
|
|
this.selectChildArr = selectedRowKeys
|
|
|
|
|
},
|
|
|
|
|
// 全选改变事件
|
|
|
|
|
selectedAllChange: ({ isSelected, selectedRowKeys }) => {
|
|
|
|
|
if (isSelected) {
|
|
|
|
|
this.selectChildArr = selectedRowKeys
|
|
|
|
|
} else {
|
|
|
|
|
this.selectChildArr = []
|
|
|
|
|
}
|
|
|
|
|
console.log('全选', isSelected, selectedRowKeys)
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
tableLoaded: false,
|
|
|
|
|
ctnList: [],
|
|
|
|
|
packageList: [],
|
|
|
|
@ -346,14 +565,24 @@ export default {
|
|
|
|
|
totalCbm: 0,
|
|
|
|
|
moreVisible: false,
|
|
|
|
|
moreModelconfirm: false,
|
|
|
|
|
radioStyle: {
|
|
|
|
|
display: 'block',
|
|
|
|
|
height: '40px',
|
|
|
|
|
lineHeight: '40px',
|
|
|
|
|
marginBottom: '10px',
|
|
|
|
|
width: '1200px',
|
|
|
|
|
padding: '0'
|
|
|
|
|
radioOption: {
|
|
|
|
|
// 行选择改变事件
|
|
|
|
|
selectedRowChange: ({ row }) => {
|
|
|
|
|
console.log(row);
|
|
|
|
|
this.childModelSelect = row
|
|
|
|
|
this.tableData.map((item, index) => {
|
|
|
|
|
if (item.rowKey === row.rowKey) {
|
|
|
|
|
this.childModelSelectIndex = index
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
this.childTableData = this.tableData[this.childModelSelectIndex].ctnDetailInputs || []
|
|
|
|
|
// 写到这里了,有个报错
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
childTableData: [],
|
|
|
|
|
childModelSelect: null,
|
|
|
|
|
childModelSelectIndex: null,
|
|
|
|
|
selectChildArr: []
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
@ -451,7 +680,7 @@ export default {
|
|
|
|
|
tareweight: '',
|
|
|
|
|
weightype: '',
|
|
|
|
|
weighkgs: '',
|
|
|
|
|
rowKey: Number(this.tableData[this.tableData.length - 1].rowKey) + 1
|
|
|
|
|
rowKey: this.tableData.length > 0 ? Number(this.tableData[this.tableData.length - 1].rowKey) + 1 : 0
|
|
|
|
|
}
|
|
|
|
|
this.tableData.push(data)
|
|
|
|
|
},
|
|
|
|
@ -467,10 +696,33 @@ export default {
|
|
|
|
|
openDialog() {
|
|
|
|
|
this.moreVisible = true
|
|
|
|
|
},
|
|
|
|
|
// 多品名维护保存
|
|
|
|
|
handleModelSubmit() {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
handleModelCancel() {
|
|
|
|
|
this.moreVisible = false
|
|
|
|
|
},
|
|
|
|
|
addChildData() {
|
|
|
|
|
if (!this.childModelSelect) {
|
|
|
|
|
this.$message.error('请选择数据')
|
|
|
|
|
}
|
|
|
|
|
const data = {
|
|
|
|
|
rowKey: this.childTableData.length > 0 ? Number(this.childTableData[this.childTableData.length - 1].rowKey) + 1 : 0,
|
|
|
|
|
pkgs: '',
|
|
|
|
|
kindpkgs: '',
|
|
|
|
|
weighkgs: '',
|
|
|
|
|
cbm: '',
|
|
|
|
|
hscode: this.details.hscode,
|
|
|
|
|
marks: this.details.marks,
|
|
|
|
|
description: this.details.marks
|
|
|
|
|
}
|
|
|
|
|
this.childTableData.push(data)
|
|
|
|
|
},
|
|
|
|
|
removeChildData() {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
saveChildData() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@ -498,34 +750,11 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.parent-table{
|
|
|
|
|
display: flex;
|
|
|
|
|
span{
|
|
|
|
|
display: inline-block;
|
|
|
|
|
flex:1;
|
|
|
|
|
border-right: 1px solid #eee;
|
|
|
|
|
text-align: center;
|
|
|
|
|
&:nth-last-child(1){
|
|
|
|
|
border: none;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.parent-table-title{
|
|
|
|
|
display: block;
|
|
|
|
|
height: 40px;
|
|
|
|
|
line-height: 40px;
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
width: 1200px;
|
|
|
|
|
display: flex;
|
|
|
|
|
background: #f4f4f4;
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
span{
|
|
|
|
|
display: inline-block;
|
|
|
|
|
flex:1;
|
|
|
|
|
border-right: 1px solid #eee;
|
|
|
|
|
text-align: center;
|
|
|
|
|
&:nth-last-child(1){
|
|
|
|
|
border: none;
|
|
|
|
|
.model-content{
|
|
|
|
|
.model-botton-box{
|
|
|
|
|
margin: 40px 0;
|
|
|
|
|
.btn{
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|