Merge remote-tracking branch 'origin/material-ui' into material-ui

This commit is contained in:
syruan 2025-07-28 15:54:21 +08:00
commit 68d7fe22e8
1 changed files with 28 additions and 2 deletions

View File

@ -268,7 +268,7 @@
</el-col>
</el-row>
<el-table v-loading="loadingTwo" :data="outCodeList" height="500" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="selection" width="55" align="center" :selectable="selectable" />
<el-table-column label="序号" align="center" width="80" type="index">
<!-- <template slot-scope="scope">
<span>{{
@ -279,6 +279,12 @@
<el-table-column label="类型名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
<el-table-column label="规格型号" align="center" prop="materialModel" :show-overflow-tooltip="true" />
<el-table-column label="设备编码" align="center" prop="maCode" :show-overflow-tooltip="true" />
<el-table-column label="本次检验时间" align="center" prop="thisCheckTime" :show-overflow-tooltip="true" />
<el-table-column label="下次检验时间" align="center" prop="nextCheckTime" :show-overflow-tooltip="true">
<template slot-scope="{ row }">
<span :style="{color: isWithinOneMonth(row.nextCheckTime) ? 'red' : ''}">{{ row.nextCheckTime }}</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="outTotal > 0"
@ -787,6 +793,25 @@ export default {
// getList
},
methods: {
selectable(row, index) {
if (row.jiJuType == 2) {
return this.isWithinOneMonth(row.nextCheckTime)
} else {
return true
}
},
isWithinOneMonth(dateStr) {
if (!dateStr) return false
const inputDate = new Date(dateStr)
const today = new Date()
today.setHours(0, 0, 0, 0) //
const diffTime = inputDate.getTime() - today.getTime()
const diffDays = diffTime / (1000 * 60 * 60 * 24)
return diffDays <= 30
},
//
onDictReady(dict) {
// 12
@ -819,7 +844,8 @@ export default {
maCode: item.maCode,
parentId: this.parentIdTemp,
outNum: 1,
publishTask: this.publishTask
publishTask: this.publishTask,
jiJuType: item.jiJuType
})
})
this.single = selection.length != 1