|
|
@ -117,21 +117,26 @@ |
|
|
:close-on-click-modal="false"> |
|
|
:close-on-click-modal="false"> |
|
|
<el-form :model="editBoxForm" ref="editBoxForm" label-position="top" label-width="100px"> |
|
|
<el-form :model="editBoxForm" ref="editBoxForm" label-position="top" label-width="100px"> |
|
|
<el-row :gutter="20"> |
|
|
<el-row :gutter="20"> |
|
|
<el-col :span="24"> |
|
|
|
|
|
|
|
|
<el-col :span="12"> |
|
|
<el-form-item label="箱数" prop="box_qty"> |
|
|
<el-form-item label="箱数" prop="box_qty"> |
|
|
<el-input v-model="editBoxForm.box_qty" @input="onBoxQtyChange" :min="1" :precision="0" style="width: 100%"></el-input> |
|
|
<el-input v-model="editBoxForm.box_qty" @input="onBoxQtyChange" :min="1" :precision="0" style="width: 100%"></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="24"> |
|
|
|
|
|
|
|
|
<el-col :span="12"> |
|
|
<el-form-item label="毛重" prop="grossWeight"> |
|
|
<el-form-item label="毛重" prop="grossWeight"> |
|
|
<el-input v-model="editBoxForm.grossWeight" @input="onGrossWeightChange" :min="0" :precision="2" style="width: 100%"></el-input> |
|
|
<el-input v-model="editBoxForm.grossWeight" @input="onGrossWeightChange" :min="0" :precision="2" style="width: 100%"></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="24"> |
|
|
|
|
|
|
|
|
<el-col :span="12"> |
|
|
<el-form-item label="净重" prop="netWeight"> |
|
|
<el-form-item label="净重" prop="netWeight"> |
|
|
<el-input v-model="editBoxForm.netWeight" @input="onNetWeightChange" :min="0" :precision="2" style="width: 100%"></el-input> |
|
|
<el-input v-model="editBoxForm.netWeight" @input="onNetWeightChange" :min="0" :precision="2" style="width: 100%"></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-form-item label="Rolls" prop="netWeight"> |
|
|
|
|
|
<el-input v-model="editBoxForm.rolls" :min="0" :precision="2" style="width: 100%"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
@ -258,6 +263,20 @@ |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
|
|
|
|
|
|
|
|
|
<el-table-column label="总Rolls" prop="rolls" width="100" align="center"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="scope.row.rolls" |
|
|
|
|
|
size="mini" |
|
|
|
|
|
type="number" |
|
|
|
|
|
:disabled="hasDetailRolls(scope.row)" |
|
|
|
|
|
:placeholder="hasDetailRolls(scope.row) ? '自动计算' : '请输入'" |
|
|
|
|
|
:class="{'modified-input': isBoxFieldModified(scope.row, 'rolls')}" |
|
|
|
|
|
@change="onBatchBoxFieldChange(scope.row, 'rolls')"> |
|
|
|
|
|
</el-input> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
|
<!-- 明细信息列(不合并) --> |
|
|
<!-- 明细信息列(不合并) --> |
|
|
<el-table-column label="PO" prop="poNo" min-width="120" align="left"> |
|
|
<el-table-column label="PO" prop="poNo" min-width="120" align="left"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
@ -283,14 +302,15 @@ |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
|
|
|
|
|
|
<el-table-column label="Rolls" prop="rolls" width="80" align="center"> |
|
|
|
|
|
|
|
|
<el-table-column label="Rolls" prop="detailRolls" width="80" align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<el-input |
|
|
<el-input |
|
|
v-model="scope.row.rolls" |
|
|
|
|
|
|
|
|
v-model="scope.row.detailRolls" |
|
|
size="mini" |
|
|
size="mini" |
|
|
type="number" |
|
|
type="number" |
|
|
:class="{'modified-input': isDetailFieldModified(scope.row, 'rolls')}" |
|
|
|
|
|
@change="onBatchDetailFieldChange(scope.row, 'rolls')"> |
|
|
|
|
|
|
|
|
:class="{'modified-input': isDetailFieldModified(scope.row, 'detailRolls')}" |
|
|
|
|
|
@input="onDetailRollsInput(scope.row)" |
|
|
|
|
|
@change="onBatchDetailFieldChange(scope.row, 'detailRolls')"> |
|
|
</el-input> |
|
|
</el-input> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
@ -342,7 +362,8 @@ export default { |
|
|
item_no: '', |
|
|
item_no: '', |
|
|
box_qty: 1, |
|
|
box_qty: 1, |
|
|
grossWeight: 0, |
|
|
grossWeight: 0, |
|
|
netWeight: 0 |
|
|
|
|
|
|
|
|
netWeight: 0, |
|
|
|
|
|
rolls: 0 |
|
|
}, |
|
|
}, |
|
|
editBoxSubmitting: false, |
|
|
editBoxSubmitting: false, |
|
|
currentEditBox: null, |
|
|
currentEditBox: null, |
|
|
@ -537,6 +558,24 @@ export default { |
|
|
fixed: '', |
|
|
fixed: '', |
|
|
columnWidth: 50 |
|
|
columnWidth: 50 |
|
|
}, |
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
userId: this.$store.state.user.name, |
|
|
|
|
|
functionId: 801002, |
|
|
|
|
|
serialNumber: '801002TableNetWeight', |
|
|
|
|
|
tableId: "801002Table3", |
|
|
|
|
|
tableName: "装箱明细", |
|
|
|
|
|
columnProp: "rolls", |
|
|
|
|
|
headerAlign: "center", |
|
|
|
|
|
align: "right", |
|
|
|
|
|
columnLabel: "总Rolls", |
|
|
|
|
|
columnHidden: false, |
|
|
|
|
|
columnImage: false, |
|
|
|
|
|
columnSortable: false, |
|
|
|
|
|
sortLv: 0, |
|
|
|
|
|
status: true, |
|
|
|
|
|
fixed: '', |
|
|
|
|
|
columnWidth: 50 |
|
|
|
|
|
}, |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
@ -714,6 +753,7 @@ export default { |
|
|
this.editBoxForm.box_qty = boxRow.box_qty; |
|
|
this.editBoxForm.box_qty = boxRow.box_qty; |
|
|
this.editBoxForm.grossWeight = boxRow.grossWeight; |
|
|
this.editBoxForm.grossWeight = boxRow.grossWeight; |
|
|
this.editBoxForm.netWeight = boxRow.netWeight; |
|
|
this.editBoxForm.netWeight = boxRow.netWeight; |
|
|
|
|
|
this.editBoxForm.rolls = boxRow.rolls; |
|
|
this.editBoxDialogVisible = true; |
|
|
this.editBoxDialogVisible = true; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -863,6 +903,7 @@ export default { |
|
|
box_qty: this.editBoxForm.box_qty, |
|
|
box_qty: this.editBoxForm.box_qty, |
|
|
grossWeight: this.editBoxForm.grossWeight, |
|
|
grossWeight: this.editBoxForm.grossWeight, |
|
|
netWeight: this.editBoxForm.netWeight, |
|
|
netWeight: this.editBoxForm.netWeight, |
|
|
|
|
|
rolls: this.editBoxForm.rolls, |
|
|
updateBy: this.$store.state.user.name |
|
|
updateBy: this.$store.state.user.name |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
@ -1090,6 +1131,7 @@ export default { |
|
|
box_qty: box.box_qty, |
|
|
box_qty: box.box_qty, |
|
|
grossWeight: box.grossWeight, |
|
|
grossWeight: box.grossWeight, |
|
|
netWeight: box.netWeight, |
|
|
netWeight: box.netWeight, |
|
|
|
|
|
rolls: box.rolls, // Box的总Rolls |
|
|
// 明细信息 |
|
|
// 明细信息 |
|
|
_detailKey: `${detail.seqNo}_${detail.itemNo}_${detail.notifyDetailItemNo}`, |
|
|
_detailKey: `${detail.seqNo}_${detail.itemNo}_${detail.notifyDetailItemNo}`, |
|
|
_hasDetail: true, |
|
|
_hasDetail: true, |
|
|
@ -1099,14 +1141,14 @@ export default { |
|
|
poNo: detail.poNo, |
|
|
poNo: detail.poNo, |
|
|
pn: detail.pn, |
|
|
pn: detail.pn, |
|
|
qty: detail.qty, |
|
|
qty: detail.qty, |
|
|
rolls: detail.rolls |
|
|
|
|
|
|
|
|
detailRolls: detail.rolls // 明细的Rolls |
|
|
}; |
|
|
}; |
|
|
tableData.push(rowData); |
|
|
tableData.push(rowData); |
|
|
|
|
|
|
|
|
// 保存原始数据 |
|
|
// 保存原始数据 |
|
|
this.batchEditOriginalData[rowData._detailKey] = { |
|
|
this.batchEditOriginalData[rowData._detailKey] = { |
|
|
qty: detail.qty, |
|
|
qty: detail.qty, |
|
|
rolls: detail.rolls |
|
|
|
|
|
|
|
|
detailRolls: detail.rolls |
|
|
}; |
|
|
}; |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
@ -1114,7 +1156,8 @@ export default { |
|
|
this.batchEditOriginalData[this.getBoxRowKey(box)] = { |
|
|
this.batchEditOriginalData[this.getBoxRowKey(box)] = { |
|
|
box_qty: box.box_qty, |
|
|
box_qty: box.box_qty, |
|
|
grossWeight: box.grossWeight, |
|
|
grossWeight: box.grossWeight, |
|
|
netWeight: box.netWeight |
|
|
|
|
|
|
|
|
netWeight: box.netWeight, |
|
|
|
|
|
rolls: box.rolls |
|
|
}; |
|
|
}; |
|
|
} else { |
|
|
} else { |
|
|
// 没有明细时,创建一行空明细的数据 |
|
|
// 没有明细时,创建一行空明细的数据 |
|
|
@ -1127,11 +1170,12 @@ export default { |
|
|
box_qty: box.box_qty, |
|
|
box_qty: box.box_qty, |
|
|
grossWeight: box.grossWeight, |
|
|
grossWeight: box.grossWeight, |
|
|
netWeight: box.netWeight, |
|
|
netWeight: box.netWeight, |
|
|
|
|
|
rolls: box.rolls, // Box的总Rolls |
|
|
_hasDetail: false, |
|
|
_hasDetail: false, |
|
|
poNo: '', |
|
|
poNo: '', |
|
|
pn: '', |
|
|
pn: '', |
|
|
qty: '', |
|
|
qty: '', |
|
|
rolls: '' |
|
|
|
|
|
|
|
|
detailRolls: '' |
|
|
}; |
|
|
}; |
|
|
tableData.push(rowData); |
|
|
tableData.push(rowData); |
|
|
|
|
|
|
|
|
@ -1139,7 +1183,8 @@ export default { |
|
|
this.batchEditOriginalData[this.getBoxRowKey(box)] = { |
|
|
this.batchEditOriginalData[this.getBoxRowKey(box)] = { |
|
|
box_qty: box.box_qty, |
|
|
box_qty: box.box_qty, |
|
|
grossWeight: box.grossWeight, |
|
|
grossWeight: box.grossWeight, |
|
|
netWeight: box.netWeight |
|
|
|
|
|
|
|
|
netWeight: box.netWeight, |
|
|
|
|
|
rolls: box.rolls |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ -1158,8 +1203,8 @@ export default { |
|
|
* 表格行合并方法 |
|
|
* 表格行合并方法 |
|
|
*/ |
|
|
*/ |
|
|
batchEditSpanMethod({ row, column, rowIndex, columnIndex }) { |
|
|
batchEditSpanMethod({ row, column, rowIndex, columnIndex }) { |
|
|
// Box信息列(前4列:序号、箱数、毛重、净重)需要合并 |
|
|
|
|
|
if (columnIndex < 4) { |
|
|
|
|
|
|
|
|
// Box信息列(前5列:序号、箱数、毛重、净重、总Rolls)需要合并 |
|
|
|
|
|
if (columnIndex < 5) { |
|
|
if (row._isFirstRowOfBox) { |
|
|
if (row._isFirstRowOfBox) { |
|
|
return { |
|
|
return { |
|
|
rowspan: row._rowSpan, |
|
|
rowspan: row._rowSpan, |
|
|
@ -1372,6 +1417,63 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 明细Rolls输入事件处理 - 自动计算总Rolls |
|
|
|
|
|
*/ |
|
|
|
|
|
onDetailRollsInput(row) { |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
this.calculateBoxTotalRolls(row); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 计算同一Box下所有明细Rolls的总和 |
|
|
|
|
|
*/ |
|
|
|
|
|
calculateBoxTotalRolls(row) { |
|
|
|
|
|
const boxKey = row._boxKey; |
|
|
|
|
|
|
|
|
|
|
|
// 获取同一Box下的所有行 |
|
|
|
|
|
const boxRows = this.batchEditTableData.filter(r => r._boxKey === boxKey && r._hasDetail); |
|
|
|
|
|
|
|
|
|
|
|
// 计算明细Rolls总和 |
|
|
|
|
|
let totalDetailRolls = 0; |
|
|
|
|
|
let hasDetailRolls = false; |
|
|
|
|
|
|
|
|
|
|
|
boxRows.forEach(r => { |
|
|
|
|
|
const rollsValue = parseFloat(r.detailRolls); |
|
|
|
|
|
if (!isNaN(rollsValue) && rollsValue > 0) { |
|
|
|
|
|
totalDetailRolls += rollsValue; |
|
|
|
|
|
hasDetailRolls = true; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// 计算新的总Rolls值(有明细Rolls则计算,否则清空) |
|
|
|
|
|
const newRolls = hasDetailRolls ? Math.round(totalDetailRolls) : null; |
|
|
|
|
|
|
|
|
|
|
|
// 同步更新所有同Box的行的总Rolls |
|
|
|
|
|
this.batchEditTableData.forEach(r => { |
|
|
|
|
|
if (r._boxKey === boxKey) { |
|
|
|
|
|
this.$set(r, 'rolls', newRolls); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// 触发Box字段变化检测 |
|
|
|
|
|
this.onBatchBoxFieldChange(row, 'rolls'); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 检查Box是否有明细Rolls值(用于禁用总Rolls输入) |
|
|
|
|
|
*/ |
|
|
|
|
|
hasDetailRolls(row) { |
|
|
|
|
|
const boxKey = row._boxKey; |
|
|
|
|
|
const boxRows = this.batchEditTableData.filter(r => r._boxKey === boxKey && r._hasDetail); |
|
|
|
|
|
|
|
|
|
|
|
return boxRows.some(r => { |
|
|
|
|
|
const rollsValue = parseFloat(r.detailRolls); |
|
|
|
|
|
return !isNaN(rollsValue) && rollsValue > 0; |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 获取批量编辑行样式 |
|
|
* 获取批量编辑行样式 |
|
|
*/ |
|
|
*/ |
|
|
@ -1411,7 +1513,8 @@ export default { |
|
|
palletRemark: row.palletRemark, |
|
|
palletRemark: row.palletRemark, |
|
|
box_qty: row.box_qty, |
|
|
box_qty: row.box_qty, |
|
|
grossWeight: row.grossWeight, |
|
|
grossWeight: row.grossWeight, |
|
|
netWeight: row.netWeight |
|
|
|
|
|
|
|
|
netWeight: row.netWeight, |
|
|
|
|
|
rolls: row.rolls // Box的总Rolls |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -1429,7 +1532,7 @@ export default { |
|
|
poNo: row.poNo, |
|
|
poNo: row.poNo, |
|
|
pn: row.pn, |
|
|
pn: row.pn, |
|
|
qty: row.qty, |
|
|
qty: row.qty, |
|
|
rolls: row.rolls |
|
|
|
|
|
|
|
|
rolls: row.detailRolls // 明细的Rolls |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -1596,7 +1699,7 @@ export default { |
|
|
.batch-edit-toolbar { |
|
|
.batch-edit-toolbar { |
|
|
margin-bottom: 10px; |
|
|
margin-bottom: 10px; |
|
|
display: flex; |
|
|
display: flex; |
|
|
justify-content: flex-end; |
|
|
|
|
|
|
|
|
justify-content: flex-start; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* 批量编辑弹窗样式 */ |
|
|
/* 批量编辑弹窗样式 */ |
|
|
|