|
|
@ -89,6 +89,7 @@ |
|
|
stripe highlight-current-row |
|
|
stripe highlight-current-row |
|
|
height="700" |
|
|
height="700" |
|
|
v-loading="dataListLoading" |
|
|
v-loading="dataListLoading" |
|
|
|
|
|
@sort-change="handleTrackingTableSortChange" |
|
|
@selection-change="selectionChange" |
|
|
@selection-change="selectionChange" |
|
|
@row-click="rowClick" |
|
|
@row-click="rowClick" |
|
|
style="width: 100%; margin-top: 8px" |
|
|
style="width: 100%; margin-top: 8px" |
|
|
@ -140,8 +141,10 @@ |
|
|
<el-table-column |
|
|
<el-table-column |
|
|
v-for="(item, processColumnIndex) in visibleProcessColumns" |
|
|
v-for="(item, processColumnIndex) in visibleProcessColumns" |
|
|
:key="`${item.code}_${item.sortNo || ''}_${processColumnIndex}`" |
|
|
:key="`${item.code}_${item.sortNo || ''}_${processColumnIndex}`" |
|
|
|
|
|
:prop="item.actualField" |
|
|
:label="item.label" |
|
|
:label="item.label" |
|
|
:width="getProcessColumnWidth(item)" |
|
|
:width="getProcessColumnWidth(item)" |
|
|
|
|
|
sortable="custom" |
|
|
align="center" |
|
|
align="center" |
|
|
header-align="center" |
|
|
header-align="center" |
|
|
> |
|
|
> |
|
|
@ -1431,6 +1434,8 @@ export default { |
|
|
hasUserTrackingColumnConfig: false, |
|
|
hasUserTrackingColumnConfig: false, |
|
|
processColumns: cloneDefaultProcessColumns(), |
|
|
processColumns: cloneDefaultProcessColumns(), |
|
|
processCodeLabelMap: buildProcessCodeLabelMapByRows(cloneDefaultProcessColumns()), |
|
|
processCodeLabelMap: buildProcessCodeLabelMapByRows(cloneDefaultProcessColumns()), |
|
|
|
|
|
trackingTableSortProp: '', |
|
|
|
|
|
trackingTableSortOrder: '', |
|
|
buProcessCategoryOptionsMap: {}, |
|
|
buProcessCategoryOptionsMap: {}, |
|
|
buProcessConfigLoading: false, |
|
|
buProcessConfigLoading: false, |
|
|
buProcessConfigDialogVisible: false, |
|
|
buProcessConfigDialogVisible: false, |
|
|
@ -1560,7 +1565,7 @@ export default { |
|
|
syncBatchNpiLoading: false, |
|
|
syncBatchNpiLoading: false, |
|
|
syncBatchProofLoading: false, |
|
|
syncBatchProofLoading: false, |
|
|
pageIndex: 1, |
|
|
pageIndex: 1, |
|
|
pageSize: 20, |
|
|
|
|
|
|
|
|
pageSize: 50, |
|
|
totalPage: 0, |
|
|
totalPage: 0, |
|
|
currentRow: null, |
|
|
currentRow: null, |
|
|
manualSelectedTrackingId: null, |
|
|
manualSelectedTrackingId: null, |
|
|
@ -3647,6 +3652,8 @@ export default { |
|
|
if (data && data.code === 0) { |
|
|
if (data && data.code === 0) { |
|
|
this.dataList = (data.page && data.page.list) || [] |
|
|
this.dataList = (data.page && data.page.list) || [] |
|
|
this.syncDataListProcessValues() |
|
|
this.syncDataListProcessValues() |
|
|
|
|
|
this.resetDataListPageOrderIndexes() |
|
|
|
|
|
this.applyTrackingTableSort() |
|
|
this.totalPage = (data.page && data.page.totalCount) || 0 |
|
|
this.totalPage = (data.page && data.page.totalCount) || 0 |
|
|
if (this.commentsEditingTrackingId) { |
|
|
if (this.commentsEditingTrackingId) { |
|
|
const hasEditingRow = this.dataList.some(item => item.trackingId === this.commentsEditingTrackingId) |
|
|
const hasEditingRow = this.dataList.some(item => item.trackingId === this.commentsEditingTrackingId) |
|
|
@ -3871,6 +3878,79 @@ export default { |
|
|
this.$message.error('Comments保存异常') |
|
|
this.$message.error('Comments保存异常') |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
handleTrackingTableSortChange (sortData) { |
|
|
|
|
|
this.trackingTableSortProp = sortData && sortData.prop ? String(sortData.prop) : '' |
|
|
|
|
|
this.trackingTableSortOrder = sortData && sortData.order ? String(sortData.order) : '' |
|
|
|
|
|
this.applyTrackingTableSort() |
|
|
|
|
|
this.refreshTrackingTableLayout() |
|
|
|
|
|
}, |
|
|
|
|
|
resolveTrackingTableSortValue (row, prop) { |
|
|
|
|
|
if (!row || !prop) { |
|
|
|
|
|
return '' |
|
|
|
|
|
} |
|
|
|
|
|
const rawValue = row[prop] |
|
|
|
|
|
const formattedValue = this.formatDate(rawValue) |
|
|
|
|
|
if (formattedValue) { |
|
|
|
|
|
return formattedValue |
|
|
|
|
|
} |
|
|
|
|
|
return rawValue == null ? '' : String(rawValue).trim() |
|
|
|
|
|
}, |
|
|
|
|
|
compareDataListOrderIndex (a, b) { |
|
|
|
|
|
const aOrderIndex = Number(a && a._pageOrderIndex != null ? a._pageOrderIndex : Number.MAX_SAFE_INTEGER) |
|
|
|
|
|
const bOrderIndex = Number(b && b._pageOrderIndex != null ? b._pageOrderIndex : Number.MAX_SAFE_INTEGER) |
|
|
|
|
|
return aOrderIndex - bOrderIndex |
|
|
|
|
|
}, |
|
|
|
|
|
resetDataListPageOrderIndexes () { |
|
|
|
|
|
if (!Array.isArray(this.dataList) || this.dataList.length === 0) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.dataList.forEach((row, index) => { |
|
|
|
|
|
if (!row) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.$set(row, '_pageOrderIndex', index) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
restoreDataListPageOrder () { |
|
|
|
|
|
if (!Array.isArray(this.dataList) || this.dataList.length <= 1) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.dataList = this.dataList.slice().sort((a, b) => this.compareDataListOrderIndex(a, b)) |
|
|
|
|
|
}, |
|
|
|
|
|
applyTrackingTableSort () { |
|
|
|
|
|
if (!Array.isArray(this.dataList) || this.dataList.length <= 1) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const sortProp = this.trackingTableSortProp |
|
|
|
|
|
const sortOrder = this.trackingTableSortOrder |
|
|
|
|
|
if (!sortProp || !sortOrder) { |
|
|
|
|
|
this.restoreDataListPageOrder() |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const isAscending = sortOrder === 'ascending' |
|
|
|
|
|
this.dataList = this.dataList.slice().sort((a, b) => { |
|
|
|
|
|
const aValue = this.resolveTrackingTableSortValue(a, sortProp) |
|
|
|
|
|
const bValue = this.resolveTrackingTableSortValue(b, sortProp) |
|
|
|
|
|
const aEmpty = !aValue |
|
|
|
|
|
const bEmpty = !bValue |
|
|
|
|
|
if (aEmpty && bEmpty) { |
|
|
|
|
|
return this.compareDataListOrderIndex(a, b) |
|
|
|
|
|
} |
|
|
|
|
|
if (aEmpty) { |
|
|
|
|
|
return 1 |
|
|
|
|
|
} |
|
|
|
|
|
if (bEmpty) { |
|
|
|
|
|
return -1 |
|
|
|
|
|
} |
|
|
|
|
|
if (aValue === bValue) { |
|
|
|
|
|
return this.compareDataListOrderIndex(a, b) |
|
|
|
|
|
} |
|
|
|
|
|
if (isAscending) { |
|
|
|
|
|
return aValue > bValue ? 1 : -1 |
|
|
|
|
|
} |
|
|
|
|
|
return aValue < bValue ? 1 : -1 |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
rowClick (row) { |
|
|
rowClick (row) { |
|
|
this.currentRow = row |
|
|
this.currentRow = row |
|
|
this.manualSelectedTrackingId = row && row.trackingId ? row.trackingId : null |
|
|
this.manualSelectedTrackingId = row && row.trackingId ? row.trackingId : null |
|
|
|