|
|
|
@ -46,7 +46,6 @@ |
|
|
|
:data="dataList" |
|
|
|
border |
|
|
|
v-loading="dataListLoading" |
|
|
|
:cell-class-name="tableCellClassName" |
|
|
|
:row-style="rowStyle" |
|
|
|
@row-click="onRowClick" |
|
|
|
@cell-click="onTableCellClick" |
|
|
|
@ -69,7 +68,7 @@ |
|
|
|
v-model="scope.row[item.columnProp]" |
|
|
|
size="mini" |
|
|
|
@blur="onStringPropBlur(scope.row, item.columnProp)" |
|
|
|
:class="['ms-cell-editor', { 'ms-modified': isCellDirty(scope.row, item.columnProp) }]" /> |
|
|
|
:class="['ms-cell-editor', { 'ms-modified': isCellDirty(scope.row, item.columnProp), 'ms-input-highlight': findHighlightRowIndex === scope.$index && findHighlightColumnProp === item.columnProp }]" /> |
|
|
|
<el-input-number |
|
|
|
v-else-if="item.columnProp === 'efficiencyFactor'" |
|
|
|
v-model="scope.row[item.columnProp]" |
|
|
|
@ -79,7 +78,7 @@ |
|
|
|
:max="100" |
|
|
|
size="mini" |
|
|
|
class="ms-num-input" |
|
|
|
:class="{ 'ms-modified': isCellDirty(scope.row, item.columnProp) }" |
|
|
|
:class="{ 'ms-modified': isCellDirty(scope.row, item.columnProp), 'ms-input-highlight': findHighlightRowIndex === scope.$index && findHighlightColumnProp === item.columnProp }" |
|
|
|
style="width: 100%" /> |
|
|
|
<el-input-number |
|
|
|
v-else-if="item.columnProp === 'crewSize'" |
|
|
|
@ -88,7 +87,7 @@ |
|
|
|
:step="1" |
|
|
|
size="mini" |
|
|
|
class="ms-num-input" |
|
|
|
:class="{ 'ms-modified': isCellDirty(scope.row, item.columnProp) }" |
|
|
|
:class="{ 'ms-modified': isCellDirty(scope.row, item.columnProp), 'ms-input-highlight': findHighlightRowIndex === scope.$index && findHighlightColumnProp === item.columnProp }" |
|
|
|
style="width: 100%" /> |
|
|
|
<el-input-number |
|
|
|
v-else |
|
|
|
@ -98,7 +97,7 @@ |
|
|
|
:precision="10" |
|
|
|
size="mini" |
|
|
|
class="ms-num-input" |
|
|
|
:class="{ 'ms-modified': isCellDirty(scope.row, item.columnProp) }" |
|
|
|
:class="{ 'ms-modified': isCellDirty(scope.row, item.columnProp), 'ms-input-highlight': findHighlightRowIndex === scope.$index && findHighlightColumnProp === item.columnProp }" |
|
|
|
style="width: 100%" /> |
|
|
|
</template> |
|
|
|
<template v-else-if="!item.columnHidden && ['machSetupTime', 'laborSetupTime', 'setupCrewSize', 'machRunFactor', 'laborRunFactor', 'efficiencyFactor', 'crewSize'].includes(item.columnProp)"> |
|
|
|
@ -199,7 +198,6 @@ export default { |
|
|
|
limit: 50 |
|
|
|
}, |
|
|
|
columnList: [ |
|
|
|
{ columnProp: 'site', columnLabel: '工厂', headerAlign: 'center', align: 'center', columnSortable: false, columnHidden: false, showOverflowTooltip: true, fixed: '', columnWidth: 80 }, |
|
|
|
{ columnProp: 'partNo', columnLabel: '物料编码', headerAlign: 'center', align: 'left', columnSortable: false, columnHidden: false, showOverflowTooltip: true, fixed: '', columnWidth: 120 }, |
|
|
|
{ columnProp: 'partDesc', columnLabel: '物料名称', headerAlign: 'center', align: 'left', columnSortable: false, columnHidden: false, showOverflowTooltip: true, fixed: '', columnWidth: 180 }, |
|
|
|
{ columnProp: 'routingType', columnLabel: '工艺类型', headerAlign: 'center', align: 'center', columnSortable: false, columnHidden: false, showOverflowTooltip: true, fixed: '', columnWidth: 120 }, |
|
|
|
@ -285,30 +283,14 @@ export default { |
|
|
|
onRowClick (row) { |
|
|
|
this.currentRow = row |
|
|
|
}, |
|
|
|
setHighlight (rowIndex, colProp) { |
|
|
|
if (this.findHighlightRowIndex >= 0 && this.findHighlightRowIndex < this.dataList.length) { |
|
|
|
this.$set(this.dataList[this.findHighlightRowIndex], '_highlightCol', '') |
|
|
|
} |
|
|
|
this.findHighlightRowIndex = rowIndex |
|
|
|
this.findHighlightColumnProp = colProp |
|
|
|
if (rowIndex >= 0 && rowIndex < this.dataList.length) { |
|
|
|
this.$set(this.dataList[rowIndex], '_highlightCol', colProp) |
|
|
|
} |
|
|
|
}, |
|
|
|
tableCellClassName ({ row, column }) { |
|
|
|
let p = column.property |
|
|
|
if (row._highlightCol === p) { |
|
|
|
return 'ms-find-highlight' |
|
|
|
} |
|
|
|
return '' |
|
|
|
}, |
|
|
|
onTableCellClick (row, column) { |
|
|
|
let p = column.property |
|
|
|
if (!this.isEditableProp(p)) return |
|
|
|
this.activeFindColumn = p |
|
|
|
const idx = this.dataList.indexOf(row) |
|
|
|
this.lastFindRowIndex = idx |
|
|
|
this.setHighlight(idx, p) |
|
|
|
this.findHighlightRowIndex = idx |
|
|
|
this.findHighlightColumnProp = p |
|
|
|
}, |
|
|
|
normalizeRowFromServer (raw) { |
|
|
|
const row = { ...raw } |
|
|
|
@ -408,7 +390,8 @@ export default { |
|
|
|
const val = this.dataList[i][col] |
|
|
|
if (this.cellMatchesFind(val, needle)) { |
|
|
|
this.lastFindRowIndex = i |
|
|
|
this.setHighlight(i, col) |
|
|
|
this.findHighlightRowIndex = i |
|
|
|
this.findHighlightColumnProp = col |
|
|
|
this.$nextTick(() => this.scrollToRow(i)) |
|
|
|
return |
|
|
|
} |
|
|
|
@ -497,7 +480,7 @@ export default { |
|
|
|
row[prop] = String(row[prop]).trim().toUpperCase() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Update descriptions |
|
|
|
this.updateDescIfNeeded(row, prop) |
|
|
|
}, |
|
|
|
@ -529,7 +512,7 @@ export default { |
|
|
|
formatNumber (value) { |
|
|
|
if (value === null || value === undefined || value === '') return value |
|
|
|
let numStr = String(value) |
|
|
|
if (numStr.includes('e') || numStr.includes('E')) { |
|
|
|
if ((numStr.includes('e') || numStr.includes('E')) && !isNaN(Number(value))) { |
|
|
|
return Number(value).toLocaleString('fullwide', { useGrouping: false, maximumFractionDigits: 20 }) |
|
|
|
} |
|
|
|
return value |
|
|
|
@ -557,6 +540,7 @@ export default { |
|
|
|
this.searchData.page = this.pageIndex |
|
|
|
this.queryLoading = true |
|
|
|
this.dataListLoading = true |
|
|
|
|
|
|
|
routingOperationsSearch(this.searchData) |
|
|
|
.then(({ data }) => { |
|
|
|
if (data.code === 0) { |
|
|
|
@ -693,13 +677,13 @@ export default { |
|
|
|
</style> |
|
|
|
|
|
|
|
<style> |
|
|
|
.routing-operations .ms-find-highlight { |
|
|
|
background-color: #ffc107 !important; |
|
|
|
} |
|
|
|
.ms-find-replace-dialog .el-dialog__body { |
|
|
|
padding: 15px 20px 20px; |
|
|
|
} |
|
|
|
.ms-find-replace-dialog .el-dialog__header { |
|
|
|
padding: 15px 20px 10px; |
|
|
|
} |
|
|
|
.ms-input-highlight .el-input__inner { |
|
|
|
border: 2px solid #ffc107 !important; |
|
|
|
} |
|
|
|
</style> |