Merge remote-tracking branch 'origin/material-ui' into material-ui
This commit is contained in:
		
						commit
						68d7fe22e8
					
				| 
						 | 
				
			
			@ -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) {
 | 
			
		||||
            // 获取过滤后的状态选项(排除值为1和2的选项)
 | 
			
		||||
| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue