代码更新
This commit is contained in:
@@ -248,37 +248,8 @@ export default {
|
||||
}
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// 将每行的检验有效期时间格式化
|
||||
const vDate = row.beginuse_date
|
||||
const vDateStr = vDate.replace(/-/g, '')
|
||||
// 获取当前时间并格式化
|
||||
var myDate = new Date()
|
||||
// 以下操作是为了补时间缺的0
|
||||
const month = myDate.getMonth() + 1
|
||||
const date = myDate.getDate()
|
||||
const stryear = myDate.getFullYear().toString()
|
||||
const strmonth = (myDate.getMonth() + 1).toString()
|
||||
const strdate = myDate.getDate().toString()
|
||||
var c
|
||||
var x
|
||||
var b
|
||||
b = stryear
|
||||
if (month < 10) {
|
||||
c = ('0' + strmonth)
|
||||
} else {
|
||||
c = strmonth
|
||||
}
|
||||
if (date < 10) {
|
||||
x = ('0' + strdate)
|
||||
} else {
|
||||
x = strdate
|
||||
}
|
||||
const vnowDate = b + c + x
|
||||
// 将字符串转换成int类型进行相减
|
||||
const a = parseInt(vDateStr) - parseInt(vnowDate)
|
||||
// 进行比较符合条件表格就变化颜色
|
||||
const stylejson = {}
|
||||
if (a < 15) {
|
||||
if (row.is_red !== undefined) {
|
||||
stylejson.background = '#e0838f'
|
||||
stylejson.color = 'green'
|
||||
return stylejson
|
||||
|
||||
@@ -217,37 +217,8 @@ export default {
|
||||
return true
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// 将每行的检验有效期时间格式化
|
||||
const vDate = row.next_docimasy_date
|
||||
const vDateStr = vDate.replace(/-/g, '')
|
||||
// 获取当前时间并格式化
|
||||
var myDate = new Date()
|
||||
// 以下操作是为了补时间缺的0
|
||||
const month = myDate.getMonth() + 1
|
||||
const date = myDate.getDate()
|
||||
const stryear = myDate.getFullYear().toString()
|
||||
const strmonth = (myDate.getMonth() + 1).toString()
|
||||
const strdate = myDate.getDate().toString()
|
||||
var c
|
||||
var x
|
||||
var b
|
||||
b = stryear
|
||||
if (month < 10) {
|
||||
c = ('0' + strmonth)
|
||||
} else {
|
||||
c = strmonth
|
||||
}
|
||||
if (date < 10) {
|
||||
x = ('0' + strdate)
|
||||
} else {
|
||||
x = strdate
|
||||
}
|
||||
const vnowDate = b + c + x
|
||||
// 将字符串转换成int类型进行相减
|
||||
const a = parseInt(vDateStr) - parseInt(vnowDate)
|
||||
// 进行比较符合条件表格就变化颜色
|
||||
const stylejson = {}
|
||||
if (a < 15) {
|
||||
if (row.is_red !== undefined) {
|
||||
stylejson.background = '#e0838f'
|
||||
stylejson.color = 'green'
|
||||
return stylejson
|
||||
|
||||
@@ -216,38 +216,8 @@ export default {
|
||||
return true
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// 将每行的检验有效期时间格式化
|
||||
const vDate = row.valid_term
|
||||
const vDateStr = vDate.replace(/-/g, '')
|
||||
// 获取当前时间并格式化
|
||||
var myDate = new Date()
|
||||
// 以下操作是为了补时间缺的0
|
||||
const month = myDate.getMonth() + 1
|
||||
const date = myDate.getDate()
|
||||
const stryear = myDate.getFullYear().toString()
|
||||
const strmonth = (myDate.getMonth() + 1).toString()
|
||||
const strdate = myDate.getDate().toString()
|
||||
var c
|
||||
var x
|
||||
var b
|
||||
b = stryear
|
||||
if (month < 10) {
|
||||
c = ('0' + strmonth)
|
||||
} else {
|
||||
c = strmonth
|
||||
}
|
||||
if (date < 10) {
|
||||
x = ('0' + strdate)
|
||||
} else {
|
||||
x = strdate
|
||||
}
|
||||
const vnowDate = b + c + x
|
||||
// 将字符串转换成int类型进行相减
|
||||
const a = parseInt(vDateStr) - parseInt(vnowDate)
|
||||
debugger
|
||||
// 进行比较符合条件表格就变化颜色
|
||||
const stylejson = {}
|
||||
if (a < 30) {
|
||||
if (row.is_red !== undefined) {
|
||||
stylejson.background = '#e0838f'
|
||||
stylejson.color = 'green'
|
||||
return stylejson
|
||||
|
||||
@@ -94,14 +94,16 @@
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="repair_id" label="设备维修单标识" />
|
||||
<el-table-column prop="repair_code" label="维修单号" width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="device_code" label="设备编码" width="120px" show-overflow-tooltip>
|
||||
<el-table-column prop="repair_code" label="维修单号" width="120px" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.device_code }}</el-link>
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.repair_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="device_code" label="设备编码" width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="device_name" label="设备名称" show-overflow-tooltip />
|
||||
<el-table-column prop="extend_code" label="设备自编码" width="90px" show-overflow-tooltip />
|
||||
<el-table-column prop="dept_name" label="归属部门" show-overflow-tooltip />
|
||||
<el-table-column prop="use_name" label="使用班组" show-overflow-tooltip />
|
||||
<el-table-column prop="invstatus" label="单据状态" :formatter="formatStatusName"/>
|
||||
<el-table-column prop="maintenancecycle" label="单据类型" :formatter="formatTypeName"/>
|
||||
<el-table-column prop="fault_level" label="故障等级" :formatter="formatLevelName"/>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
:disabled="start_flag"
|
||||
@click="startRepair"
|
||||
>
|
||||
开始维修
|
||||
@@ -95,7 +95,7 @@
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
:disabled="execu_flag"
|
||||
@click="executeRepair"
|
||||
>
|
||||
维修执行
|
||||
@@ -106,7 +106,7 @@
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
:disabled="end_flag"
|
||||
@click="endRepair"
|
||||
>
|
||||
结束维修
|
||||
@@ -117,7 +117,7 @@
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
:disabled="open_flag"
|
||||
@click="openReceive"
|
||||
>
|
||||
维修领用
|
||||
@@ -128,7 +128,7 @@
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
:disabled="confirm_flag"
|
||||
@click="confirmRepair"
|
||||
>
|
||||
维修确认
|
||||
@@ -139,7 +139,7 @@
|
||||
type="success"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="crud.selections.length !== 1"
|
||||
:disabled="result_flag"
|
||||
@click="resuftRepair"
|
||||
>
|
||||
结果录入
|
||||
@@ -221,6 +221,12 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
start_flag: true,
|
||||
execu_flag: true,
|
||||
end_flag: true,
|
||||
open_flag: true,
|
||||
confirm_flag: true,
|
||||
result_flag: true,
|
||||
classes: [],
|
||||
class_idStr: null,
|
||||
materOpt_code: '23',
|
||||
|
||||
@@ -105,14 +105,16 @@
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column v-if="false" prop="maint_id" label="保养单标识" />
|
||||
<el-table-column prop="maint_code" label="保养单号" width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="device_code" label="设备编码" show-overflow-tooltip>
|
||||
<el-table-column prop="maint_code" label="保养单号" width="120px" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.device_code }}</el-link>
|
||||
<el-link type="warning" @click="crud.toView(scope.row)">{{ scope.row.maint_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="device_code" label="设备编码" show-overflow-tooltip />
|
||||
<el-table-column prop="device_name" label="设备名称" show-overflow-tooltip />
|
||||
<el-table-column prop="extend_code" label="设备自编码" width="90px" show-overflow-tooltip />
|
||||
<el-table-column prop="dept_name" label="归属部门" show-overflow-tooltip />
|
||||
<el-table-column prop="use_name" label="使用班组" show-overflow-tooltip />
|
||||
<el-table-column prop="invstatus" label="单据状态" show-overflow-tooltip :formatter="formatInvsName" />
|
||||
<el-table-column prop="maintenancecycle" label="单据类型" :formatter="formatMainName" />
|
||||
<el-table-column prop="plan_start_date" label="计划保养日期" width="150px" />
|
||||
|
||||
Reference in New Issue
Block a user