代码更新
This commit is contained in:
@@ -983,6 +983,37 @@ public class DevicerepairmstServiceImpl implements DevicerepairmstService {
|
||||
map.put("classIds", classIds);
|
||||
}
|
||||
JSONObject json = WQL.getWO("EM_BI_DEVICEREPAIR001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mst.input_time DESC");
|
||||
|
||||
JSONArray content = json.getJSONArray("content");
|
||||
for (int i = 0; i < content.size(); i++) {
|
||||
JSONObject jsonObject = content.getJSONObject(i);
|
||||
String real_start_date = jsonObject.getString("real_start_date");
|
||||
String estimaterepair_times = jsonObject.getString("estimaterepair_times");
|
||||
|
||||
if (ObjectUtil.isNotEmpty(real_start_date) && ObjectUtil.isNotEmpty(estimaterepair_times)) {
|
||||
// 超过预计时间:(开始时间+预计修复时间) - 当前时间 > 0 且结束为正常
|
||||
int minute = NumberUtil.mul(estimaterepair_times, "60").intValue();
|
||||
DateTime date = DateUtil.parse(real_start_date);
|
||||
|
||||
DateTime date1 = DateUtil.parse(DateUtil.offsetMinute(date, minute).toString());
|
||||
DateTime date2 = DateUtil.parse(DateUtil.now());
|
||||
|
||||
long between = DateUtil.between(date2, date1, DateUnit.MINUTE,false);
|
||||
|
||||
if (between < 0) {
|
||||
if ("01,02,03,04,05".contains(jsonObject.getString("invstatus"))) {
|
||||
jsonObject.put("is_red", "1");
|
||||
} else {
|
||||
jsonObject.put("is_red", "0");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
jsonObject.put("is_red", "0");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return json;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
>
|
||||
<el-form ref="form" :inline="true" :model="form4" size="mini" label-width="120px" label-suffix=":">
|
||||
<el-form ref="form" :inline="true" :model="form4" size="mini" label-width="150px" label-suffix=":">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="维修人" prop="update_optname">
|
||||
@@ -18,7 +18,7 @@
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="预计修复时间" prop="estimaterepair_times">
|
||||
<el-form-item label="预计修复时间(小时)" prop="estimaterepair_times">
|
||||
<el-input-number v-model="form4.estimaterepair_times" :precision="1" :min="0" :max="999" style="width: 200px" :controls="false"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="mySelectionChange">
|
||||
<el-table ref="table" v-loading="crud.loading" :row-style="tableRowClassName" :data="crud.data" size="mini" style="width: 100%;" @selection-change="mySelectionChange">
|
||||
<el-table-column fixed="left" type="selection" min-width="35" />
|
||||
<el-table-column fixed="left" prop="repair_code" label="维修单号" min-width="105" />
|
||||
<el-table-column fixed="left" prop="device_code" label="设备编码" min-width="85" />
|
||||
@@ -155,7 +155,7 @@
|
||||
<el-table-column prop="update_optname" label="维修人" min-width="150" />
|
||||
<el-table-column prop="real_start_date" label="开始时间" min-width="140" />
|
||||
<el-table-column prop="real_end_date" label="结束时间" min-width="140" />
|
||||
<el-table-column prop="estimaterepair_times" label="预计修复时间" min-width="130" />
|
||||
<el-table-column prop="estimaterepair_times" label="预计修复时间H" min-width="130" />
|
||||
<el-table-column prop="confirm_optname" label="验收人" min-width="90" />
|
||||
<el-table-column prop="confirm_time" label="验收时间" min-width="140" />
|
||||
<el-table-column prop="audit_optname" label="审核人" min-width="90" />
|
||||
@@ -429,6 +429,14 @@ export default {
|
||||
this.open_flag = true
|
||||
this.confirm_flag = true
|
||||
this.result_flag = true
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
const stylejson = {}
|
||||
if (row.is_red === '1') {
|
||||
stylejson.background = '#e0838f'
|
||||
stylejson.color = 'green'
|
||||
return stylejson
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user