diff --git a/src/option/distribution/addVehicleStowage.js b/src/option/distribution/addVehicleStowage.js index d18b6f72..454b5175 100644 --- a/src/option/distribution/addVehicleStowage.js +++ b/src/option/distribution/addVehicleStowage.js @@ -382,6 +382,7 @@ export const columnList = [ isshowSummary: true, sortable: true, }, + // AddVehicleStowage { prop: 'customerTrain', label: '客户车次', @@ -392,6 +393,26 @@ export const columnList = [ fixed: false, sortable: true, }, + { + prop: 'warehouseEntryTimeStart', + label: '最早入库时间', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, + { + prop: 'warehouseEntryTimeEnd', + label: '最新入库时间', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, { prop: 'remark', label: '运单备注', @@ -626,9 +647,19 @@ export const newColumnList = [ fixed: false, sortable: true, }, + { + prop: 'warehouseEntryTimeStart', + label: '最早入库时间', + type: 1, + values: '', + width: '130', + checkarr: [], + fixed: false, + sortable: true, + }, { prop: 'warehouseEntryTimeEnd', - label: '入库时间', + label: '最新入库时间', type: 1, values: '', width: '130', diff --git a/src/views/distribution/artery/AddVehicleStowage.vue b/src/views/distribution/artery/AddVehicleStowage.vue index 7b41dffb..789c14ba 100644 --- a/src/views/distribution/artery/AddVehicleStowage.vue +++ b/src/views/distribution/artery/AddVehicleStowage.vue @@ -425,6 +425,7 @@ @inputTxt="inputsc" :loading="loadingObj.oldListLoading" @selection="selectionChange" + :tableRowClassName="handleSetRowClassName" > @@ -2126,6 +2127,25 @@ const handleSubmitProblemData = () => { } }; +/** 设置表格行样式 */ +const handleSetRowClassName = (row, rowIndex) => { + if (!row.warehouseEntryTimeStart) return 'timeOut'; + + // 设置预警 -- 以创建时间为基准, 24小时后为超期, 临近2小时为临期 + + // 当前时间 - 创建时间 + const time = Date.now() - new Date(row.warehouseEntryTimeStart).getTime(); + + // 预警时间 + const WarningTime = 1000 * 60 * 60 * (24 * 2 - 2); + + // 超时 + const timeOut = 1000 * 60 * 60 * 24 * 2; + + if (time > timeOut) return 'timeOut'; + else if (time > WarningTime && time < timeOut) return 'WarningTime'; +}; + /** 关闭页面 */ const back = () => { $store.commit('DEL_TAG_CURRENT'); @@ -2822,4 +2842,25 @@ onActivated(() => { :deep(.el-form-item__content) { width: 250px !important; } + +// 表格行样式 +:deep(.el-table) { + tr { + &.WarningTime { + color: #e6a23c !important; + + .el-text { + color: #e6a23c !important; + } + } + + &.timeOut { + color: #f56c6c !important; + + .el-text { + color: #f56c6c !important; + } + } + } +} diff --git a/src/views/distribution/artery/addTripartiteTransfer.vue b/src/views/distribution/artery/addTripartiteTransfer.vue index 007ab63d..afcff915 100644 --- a/src/views/distribution/artery/addTripartiteTransfer.vue +++ b/src/views/distribution/artery/addTripartiteTransfer.vue @@ -365,6 +365,7 @@ @timeCheck="timesc" @selectCheck="selectsc" @selection="selectionChange" + :tableRowClassName="handleSetRowClassName" > @@ -1296,6 +1297,25 @@ const handleSubmit = (formEl: FormInstance | undefined) => { } }); }; + +/** 设置表格行样式 */ +const handleSetRowClassName = (row, rowIndex) => { + if (!row.warehouseEntryTimeStart) return 'timeOut'; + + // 设置预警 -- 以创建时间为基准, 24小时后为超期, 临近2小时为临期 + + // 当前时间 - 创建时间 + const time = Date.now() - new Date(row.warehouseEntryTimeStart).getTime(); + + // 预警时间 + const WarningTime = 1000 * 60 * 60 * (24 * 2 - 2); + + // 超时 + const timeOut = 1000 * 60 * 60 * 24 * 2; + + if (time > timeOut) return 'timeOut'; + else if (time > WarningTime && time < timeOut) return 'WarningTime'; +};