Merge branch 'master' of http://121.40.234.130:8899/root/wuHanXinRui
This commit is contained in:
@@ -41,4 +41,11 @@ public class DownloadWordDto implements Serializable {
|
||||
@WordProperty("资产使用人")
|
||||
private String user_name;
|
||||
|
||||
@WordProperty("投产日期")
|
||||
private String beginuse_date;
|
||||
|
||||
|
||||
@WordProperty("存放地点")
|
||||
private String setting_place;
|
||||
|
||||
}
|
||||
|
||||
@@ -140,6 +140,8 @@ public class DeviceScrapServiceImpl implements DeviceScrapService {
|
||||
.oraginal_value(jsonFile.getString("oraginal_value"))
|
||||
.net_amount(jsonFile.getString("net_amount"))
|
||||
.belong_dept(jsonDept.getString("name"))
|
||||
.beginuse_date(jsonFile.getString("beginuse_date"))
|
||||
.setting_place(jsonFile.getString("setting_place"))
|
||||
.user_name(jsonFile.getString("user_name")).build();
|
||||
// 获取本地模板
|
||||
String path = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("DEVICE_WORD_PATH").getValue();
|
||||
|
||||
@@ -57,6 +57,14 @@ public class DevicefaultcaeController {
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PostMapping("/getFaultList")
|
||||
@Log("获取故障下拉框")
|
||||
@ApiOperation("获取故障下拉框")
|
||||
//@PreAuthorize("@el.check('devicesparepartivt:add')")
|
||||
public ResponseEntity<Object> getFaultList() {
|
||||
return new ResponseEntity<>(devicefaultcaeService.getFaultList(),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改设备故障分析")
|
||||
@ApiOperation("修改设备故障分析")
|
||||
|
||||
@@ -16,6 +16,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -39,4 +41,18 @@ public class DeviceooestatController {
|
||||
return new ResponseEntity<>(deviceooestatService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/queryDtl")
|
||||
@Log("设备OEE指标分析查询明细")
|
||||
@ApiOperation("设备OEE指标分析查询明细")
|
||||
//@PreAuthorize("@el.check('devicesparepartivt:list')")
|
||||
public ResponseEntity<Object> queryDtl(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(deviceooestatService.queryDtl(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
public void download(HttpServletResponse response, @RequestParam Map whereJson) throws IOException {
|
||||
deviceooestatService.download(whereJson, response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
package org.nl.wms.sb.stat.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.nl.wms.sb.stat.service.dto.DevicesparepartivtDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
@@ -82,4 +83,6 @@ public interface DevicefaultcaeService {
|
||||
*/
|
||||
Map<String, Object> dtlQuery(Map whereJson, Pageable page);
|
||||
|
||||
JSONArray getFaultList();
|
||||
|
||||
}
|
||||
|
||||
@@ -25,4 +25,15 @@ public interface DeviceooestatService {
|
||||
*/
|
||||
Map<String, Object> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
*
|
||||
* @param whereJson 条件
|
||||
* @param page 分页参数
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> queryDtl(Map whereJson, Pageable page);
|
||||
|
||||
void download(Map whereJson, HttpServletResponse response) throws IOException;
|
||||
|
||||
}
|
||||
|
||||
@@ -47,17 +47,21 @@ public class DevicefaultcaeServiceImpl implements DevicefaultcaeService {
|
||||
String material_type_id = MapUtil.getStr(whereJson, "material_type_id");
|
||||
String class_idStr = (String) whereJson.get("class_idStr");
|
||||
String device_gz = MapUtil.getStr(whereJson, "device_gz");
|
||||
String class_idStr2 = (String) whereJson.get("class_idStr2");
|
||||
|
||||
String device_code = MapUtil.getStr(whereJson, "device_code");
|
||||
String dept_id = MapUtil.getStr(whereJson, "dept_id");
|
||||
String begin_time = MapUtil.getStr(whereJson, "begin_time");
|
||||
String end_time = MapUtil.getStr(whereJson, "end_time");
|
||||
|
||||
if (ObjectUtil.isEmpty(begin_time)) {
|
||||
throw new BadRequestException("请选择日期");
|
||||
}
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "1");
|
||||
map.put("begin_time", begin_time);
|
||||
map.put("end_time", end_time);
|
||||
map.put("device_gz", device_gz);
|
||||
if (ObjectUtil.isNotEmpty(device_code)) map.put("device_code", "%"+device_code+"%");
|
||||
if (ObjectUtil.isNotEmpty(dept_id)) map.put("dept_id", "%"+dept_id+"%");
|
||||
//处理设备当前节点的所有子节点
|
||||
@@ -69,44 +73,50 @@ public class DevicefaultcaeServiceImpl implements DevicefaultcaeService {
|
||||
String classIds = classstandardService.getAllChildIdStr(class_idStr);
|
||||
map.put("classIds", classIds);
|
||||
}
|
||||
//处理故障当前节点的所有子节点
|
||||
if (!StrUtil.isEmpty(device_gz)) {
|
||||
map.put("device_gz", device_gz);
|
||||
String classIds2 = classstandardService.getChildIdStr(device_gz);
|
||||
map.put("classIds2", classIds2);
|
||||
} else if (ObjectUtil.isNotEmpty(class_idStr2)) {
|
||||
String classIds2 = classstandardService.getAllChildIdStr(class_idStr2);
|
||||
map.put("classIds2", classIds2);
|
||||
}
|
||||
|
||||
JSONObject json = WQL.getWO("EM_DEVICEFAULTCAE01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "re.devicerecord_id DESC");
|
||||
// 处理平均故障间隔时间 && 平均故障修复时间
|
||||
/* WQLObject tab = WQLObject.getWQLObject("EM_BI_DeviceRepairRequest");
|
||||
WQLObject tab = WQLObject.getWQLObject("EM_BI_DeviceRepairRequest");
|
||||
JSONArray content = json.getJSONArray("content");
|
||||
for (int i = 0; i < content.size(); i++) {
|
||||
JSONObject jsonObject = content.getJSONObject(i);
|
||||
String devicerecord_id = jsonObject.getString("devicerecord_id");
|
||||
JSONArray arr = tab.query("devicerecord_id = '" + devicerecord_id + "' and is_delete = '0'").getResultJSONArray(0);
|
||||
|
||||
// 计算平均故障修复时间
|
||||
String nunm = jsonObject.getString("nunm");
|
||||
String create_time_all = "0";
|
||||
String finish_time_all = "0";
|
||||
for (int j = 0; j < arr.size(); j++) {
|
||||
JSONObject jsonObject1 = arr.getJSONObject(j);
|
||||
// 去掉时间中的特殊字符
|
||||
String create_time = jsonObject1.getString("create_time").replaceAll("[[\\s-:punct:]]","");
|
||||
String create_time = jsonObject1.getString("create_time").substring(0,10).replaceAll("[[\\s-:punct:]]","");
|
||||
String finish_time = "0";
|
||||
if (ObjectUtil.isNotEmpty(jsonObject1.getString("finish_time"))) {
|
||||
finish_time = jsonObject1.getString("finish_time").replaceAll("[[\\s-:punct:]]","");
|
||||
finish_time = jsonObject1.getString("finish_time").substring(0,10).replaceAll("[[\\s-:punct:]]","");
|
||||
}
|
||||
// 相加
|
||||
create_time_all = String.valueOf(NumberUtil.add(create_time_all,create_time));
|
||||
finish_time_all = String.valueOf(NumberUtil.add(finish_time_all,finish_time));
|
||||
}
|
||||
BigDecimal avgRep_time = NumberUtil.div(String.valueOf(NumberUtil.sub(finish_time_all, create_time_all)), nunm);
|
||||
jsonObject.put("avgRep_time",String.valueOf(avgRep_time));
|
||||
BigDecimal mul = NumberUtil.mul(NumberUtil.sub(finish_time_all, create_time_all), 24);
|
||||
BigDecimal div = NumberUtil.div(mul.toString(), nunm);
|
||||
|
||||
if (div.intValue() < 0) {
|
||||
jsonObject.put("avgRep_time","0");
|
||||
} else {
|
||||
jsonObject.put("avgRep_time",String.valueOf(div));
|
||||
}
|
||||
|
||||
// 计算平均故障间隔时间
|
||||
String re_end_time = end_time.substring(0, 10).replaceAll("[[\\s-:punct:]]", "");
|
||||
String re_begin_time = begin_time.substring(0, 10).replaceAll("[[\\s-:punct:]]", "");
|
||||
|
||||
BigDecimal add = NumberUtil.add(NumberUtil.sub(re_end_time, re_begin_time).toString(), "1");
|
||||
BigDecimal avgVal_time = NumberUtil.div(NumberUtil.mul(add, 24).toString(), nunm);
|
||||
jsonObject.put("avgVal_time",avgVal_time.toString());
|
||||
}
|
||||
json.put("content",content);*/
|
||||
json.put("content",content);
|
||||
return json;
|
||||
}
|
||||
|
||||
@@ -243,4 +253,10 @@ public class DevicefaultcaeServiceImpl implements DevicefaultcaeService {
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getFaultList() {
|
||||
JSONArray resultJSONArray = WQL.getWO("EM_DEVICEFAULTCAE01").addParam("flag", "3").process().getResultJSONArray(0);
|
||||
return resultJSONArray;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,9 +5,11 @@ package org.nl.wms.sb.stat.service.impl;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.utils.FileUtil;
|
||||
import org.nl.wms.basedata.master.service.ClassstandardService;
|
||||
import org.nl.wms.sb.stat.service.DeviceooestatService;
|
||||
import org.nl.wql.WQL;
|
||||
@@ -15,8 +17,9 @@ import org.nl.wql.util.WqlUtil;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author Liuxy
|
||||
@@ -51,15 +54,63 @@ public class DeviceooestatServiceImpl implements DeviceooestatService {
|
||||
map.put("classIds", classIds);
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(begin_time)) {
|
||||
map.put("flag", "1");
|
||||
} else {
|
||||
map.put("flag", "2");
|
||||
map.put("begin_time",begin_time);
|
||||
map.put("end_time",end_time);
|
||||
}
|
||||
map.put("flag", "2");
|
||||
map.put("begin_time",begin_time);
|
||||
map.put("end_time",end_time);
|
||||
JSONObject json = WQL.getWO("EM_DEVICEOOESTAT001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "file.device_code ASC");
|
||||
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryDtl(Map whereJson, Pageable page) {
|
||||
|
||||
String begin_time = MapUtil.getStr(whereJson, "startTime");
|
||||
String end_time = MapUtil.getStr(whereJson, "endTime");
|
||||
String devicerecord_id = MapUtil.getStr(whereJson, "devicerecord_id");
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "1");
|
||||
map.put("begin_time", begin_time);
|
||||
map.put("end_time", end_time);
|
||||
map.put("devicerecord_id", devicerecord_id);
|
||||
JSONObject json = WQL.getWO("EM_DEVICEOOESTAT001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "run.run_date ASC");
|
||||
|
||||
return json;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(Map whereJson, HttpServletResponse response) throws IOException {
|
||||
String begin_time = MapUtil.getStr(whereJson, "startTime");
|
||||
String end_time = MapUtil.getStr(whereJson, "endTime");
|
||||
String devicerecord_id = MapUtil.getStr(whereJson, "devicerecord_id");
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "1");
|
||||
map.put("begin_time", begin_time);
|
||||
map.put("end_time", end_time);
|
||||
map.put("devicerecord_id", devicerecord_id);
|
||||
|
||||
JSONArray rows = WQL.getWO("EM_DEVICEOOESTAT001").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (int i = 0; i < rows.size(); i++) {
|
||||
JSONObject jo = rows.getJSONObject(i);
|
||||
Map<String, Object> dtl_map = new LinkedHashMap<>();
|
||||
dtl_map.put("日期", jo.getString("run_date"));
|
||||
dtl_map.put("设备编码", jo.getString("device_code"));
|
||||
dtl_map.put("设备名称", jo.getString("device_name"));
|
||||
dtl_map.put("工作时间(分钟)", jo.getString("run_times"));
|
||||
dtl_map.put("准备时间(分钟)", jo.getString("prepare_times"));
|
||||
dtl_map.put("故障时间(分钟)", jo.getString("error_times"));
|
||||
dtl_map.put("工装调整时间(分钟)", jo.getString("adjust_times"));
|
||||
dtl_map.put("生产总量", jo.getString("product_qty"));
|
||||
dtl_map.put("不合格数", jo.getString("nok_qty"));
|
||||
dtl_map.put("理论生产节拍(分钟)", jo.getString("theory_beat"));
|
||||
dtl_map.put("OEE指标", jo.getString("oee_value"));
|
||||
list.add(dtl_map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
输入.devicerecord_id TYPEAS s_string
|
||||
输入.device_gz TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -57,8 +58,8 @@
|
||||
FROM
|
||||
EM_BI_DeviceRepairRequest re
|
||||
LEFT JOIN EM_BI_EquipmentFile file ON file.devicerecord_id = re.devicerecord_id
|
||||
LEFT JOIN EM_BI_DeviceFaultClass fclass ON fclass.device_faultclass_id = re.device_faultclass_id
|
||||
LEFT JOIN md_pb_classstandard class ON file.material_type_id = class.class_id
|
||||
LEFT JOIN md_pb_classstandard class2 ON re.device_faultclass_id = class2.class_id
|
||||
LEFT JOIN sys_dept dept ON file.use_deptid = dept.dept_id
|
||||
WHERE
|
||||
re.is_delete = '0'
|
||||
@@ -66,8 +67,8 @@
|
||||
class.class_id in 输入.classIds
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.classIds2 <> ""
|
||||
class2.class_id in 输入.classIds2
|
||||
OPTION 输入.device_gz <> ""
|
||||
fclass.device_faultclass_id = 输入.device_gz
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.device_code <> ""
|
||||
@@ -99,7 +100,7 @@
|
||||
SELECT
|
||||
re.*,
|
||||
dept.name,
|
||||
class.class_name,
|
||||
fclass.device_faultclass_name AS class_name,
|
||||
pari.real_start_date,
|
||||
pari.real_end_date,
|
||||
pari.outsourceaskfor_optid,
|
||||
@@ -110,7 +111,7 @@
|
||||
FROM
|
||||
EM_BI_DeviceRepairRequest re
|
||||
LEFT JOIN EM_BI_EquipmentFile file ON file.devicerecord_id = re.devicerecord_id
|
||||
LEFT JOIN md_pb_classstandard class ON re.device_faultclass_id = class.class_id
|
||||
LEFT JOIN EM_BI_DeviceFaultClass fclass ON fclass.device_faultclass_id = re.device_faultclass_id
|
||||
LEFT JOIN sys_dept dept ON file.use_deptid = dept.dept_id
|
||||
LEFT JOIN EM_BI_DeviceRepairMst pari ON pari.source_bill_id = re.request_id
|
||||
WHERE
|
||||
@@ -131,4 +132,17 @@
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "3"
|
||||
QUERY
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
EM_BI_DeviceFaultClass
|
||||
WHERE
|
||||
is_delete = '0'
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -19,6 +19,7 @@
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
输入.dept_code TYPEAS s_string
|
||||
输入.devicerecord_id TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -82,6 +83,10 @@
|
||||
run.run_date <= 输入.end_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.devicerecord_id <> ""
|
||||
run.devicerecord_id = 输入.devicerecord_id
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -24,4 +24,11 @@ export function edit(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
export function getFaultList() {
|
||||
return request({
|
||||
url: 'api/devicefaultcae/getFaultList',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getFaultList }
|
||||
|
||||
@@ -264,22 +264,29 @@ export default {
|
||||
return this.dict.label.DEVICE_ATTRIBUTE_SCODE[row.device_type]
|
||||
},
|
||||
scrap() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = _selectData[0]
|
||||
// if (data.status !== '10') {
|
||||
// return this.crud.notify('设备未启用或不存在', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
// }
|
||||
if (data.device_is_delete === '1') {
|
||||
return this.crud.notify('设备不存在或被删除', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
if (data.status === '10' || data.status === '11') {
|
||||
crudDevicescrap.scrap(data).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
} else {
|
||||
return this.crud.notify('设备状态不正确,需启动设备或完成维修单及保养单', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
const msg = '是否继续'
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = _selectData[0]
|
||||
// if (data.status !== '10') {
|
||||
// return this.crud.notify('设备未启用或不存在', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
// }
|
||||
if (data.device_is_delete === '1') {
|
||||
return this.crud.notify('设备不存在或被删除', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
if (data.status === '10' || data.status === '11') {
|
||||
crudDevicescrap.scrap(data).then(res => {
|
||||
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
} else {
|
||||
return this.crud.notify('设备状态不正确,需启动设备或完成维修单及保养单', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
})
|
||||
},
|
||||
downloadWord() {
|
||||
const msg = '是否继续'
|
||||
|
||||
@@ -22,13 +22,20 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="设备故障">
|
||||
<treeselect
|
||||
<el-select
|
||||
v-model="query.device_gz"
|
||||
:load-options="loadClass"
|
||||
:options="classes2"
|
||||
style="width: 200px;"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请选择"
|
||||
/>
|
||||
class="filter-item"
|
||||
@change="hand"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in FaultList"
|
||||
:label="item.device_faultclass_name"
|
||||
:value="item.device_faultclass_id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="日期">
|
||||
@@ -69,8 +76,8 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="device_model" label="型号规格" />
|
||||
<el-table-column prop="nunm" label="故障次数" />
|
||||
<el-table-column prop="" label="平均故障间隔时间" />
|
||||
<el-table-column prop="" label="平均故障修复时间" />
|
||||
<el-table-column prop="avgVal_time" label="平均故障间隔时间(小时)" :formatter="crud.formatNum2" />
|
||||
<el-table-column prop="avgRep_time" label="平均故障修复时间(小时)" :formatter="crud.formatNum2" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
@@ -96,6 +103,7 @@ import DateRangePicker from '@/components/DateRangePicker'
|
||||
import DtlDialog from '@/views/wms/sb/stat/devicefaultcae/DtlDialog'
|
||||
|
||||
const defaultForm = { }
|
||||
const start = new Date()
|
||||
export default {
|
||||
name: 'Devicefaultcae',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, Treeselect, DateRangePicker, DtlDialog },
|
||||
@@ -113,6 +121,9 @@ export default {
|
||||
del: false,
|
||||
download: false,
|
||||
reset: true
|
||||
},
|
||||
query: {
|
||||
createTime: [start.daysAgo(30), new Date()]
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -124,6 +135,7 @@ export default {
|
||||
class_idStr2: null,
|
||||
materOpt_code: '23',
|
||||
materOpt_code2: '24',
|
||||
FaultList: [],
|
||||
openParam: null,
|
||||
dtlDialog: false,
|
||||
permission: {
|
||||
@@ -140,14 +152,17 @@ export default {
|
||||
this.crud.toQuery()
|
||||
this.queryClassId()
|
||||
})
|
||||
const param2 = {
|
||||
'materOpt_code': this.materOpt_code2
|
||||
}
|
||||
crudMaterialbase.getMaterOptType(param2).then(res => {
|
||||
this.class_idStr2 = res.class_idStr
|
||||
this.crud.query.class_idStr2 = this.class_idStr2
|
||||
this.crud.toQuery()
|
||||
this.queryClassId2()
|
||||
// const param2 = {
|
||||
// 'materOpt_code': this.materOpt_code2
|
||||
// }
|
||||
// crudMaterialbase.getMaterOptType(param2).then(res => {
|
||||
// this.class_idStr2 = res.class_idStr
|
||||
// this.crud.query.class_idStr2 = this.class_idStr2
|
||||
// this.crud.toQuery()
|
||||
// this.queryClassId2()
|
||||
// })
|
||||
crudDevicefaultcae.getFaultList().then(res => {
|
||||
this.FaultList = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
191
mes/qd/src/views/wms/sb/stat/deviceooestat/DtlDialog.vue
Normal file
191
mes/qd/src/views/wms/sb/stat/deviceooestat/DtlDialog.vue
Normal file
@@ -0,0 +1,191 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="明细"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
fullscreen
|
||||
:before-close="handleClose"
|
||||
destroy-on-close
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
<div class="head-container">
|
||||
<el-form
|
||||
size="mini"
|
||||
:inline="true"
|
||||
class="demo-form-inline"
|
||||
label-position="right"
|
||||
label-width="80px"
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="日期">
|
||||
<!-- <date-range-picker v-model="dtlFrom.createTime" class="date-item" />-->
|
||||
<div>
|
||||
<el-input
|
||||
v-model="dtlFrom.startTime"
|
||||
disabled
|
||||
style="width: 100px"
|
||||
size="mini"
|
||||
/> --
|
||||
<el-input
|
||||
v-model="dtlFrom.endTime"
|
||||
disabled
|
||||
style="width: 100px"
|
||||
size="mini"
|
||||
/>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备">
|
||||
<el-input
|
||||
v-model="dtlFrom.device_name"
|
||||
disabled
|
||||
size="mini"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="oee指标">
|
||||
<el-input
|
||||
v-model="dtlFrom.oee_value"
|
||||
disabled
|
||||
size="mini"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
type="success"
|
||||
icon="el-icon-check"
|
||||
size="mini"
|
||||
@click="downdtl"
|
||||
>
|
||||
导出Excel
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%;"
|
||||
size="mini"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column show-overflow-tooltip prop="run_date" label="日期" />
|
||||
<el-table-column show-overflow-tooltip prop="device_code" label="设备编码" />
|
||||
<el-table-column show-overflow-tooltip prop="device_name" label="设备名称" />
|
||||
<el-table-column show-overflow-tooltip prop="run_times" label="工作时间(分钟)" />
|
||||
<el-table-column show-overflow-tooltip prop="prepare_times" label="准备时间(分钟)" />
|
||||
<el-table-column show-overflow-tooltip prop="error_times" label="故障时间(分钟)" />
|
||||
<el-table-column show-overflow-tooltip prop="adjust_times" label="工装调整时间(分钟)" />
|
||||
<el-table-column show-overflow-tooltip prop="product_qty" label="生产总量" />
|
||||
<el-table-column show-overflow-tooltip prop="nok_qty" label="不合格数" />
|
||||
<el-table-column show-overflow-tooltip prop="theory_beat" label="理论生产节拍(分钟)" />
|
||||
<el-table-column show-overflow-tooltip prop="oee_value" label="OEE指标" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { crud, presenter, header } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import crudDeviceooestat from '@/api/wms/sb/deviceooestat'
|
||||
import { download } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
|
||||
export default {
|
||||
name: 'DtlShowDialog',
|
||||
components: { rrOperation, crudOperation, udOperation, pagination, DateRangePicker },
|
||||
mixins: [presenter(), header(), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
url: 'api/deviceooestat/queryDtl',
|
||||
idField: 'request_id',
|
||||
sort: 'request_id,desc',
|
||||
crudMethod: { ... crudDeviceooestat },
|
||||
optShow: {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: false,
|
||||
download: false,
|
||||
reset: false
|
||||
}
|
||||
})
|
||||
},
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
openParam: {
|
||||
type: Object
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
dtlFrom: {}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done()
|
||||
})
|
||||
.catch(_ => {
|
||||
})
|
||||
},
|
||||
close() {
|
||||
debugger
|
||||
this.dtlFrom = {}
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
open() {
|
||||
debugger
|
||||
this.dtlFrom = this.openParam.dtlFrom
|
||||
if (this.openParam.time !== null) {
|
||||
this.dtlFrom.startTime = this.openParam.time.startTime
|
||||
this.dtlFrom.endTime = this.openParam.time.endTime
|
||||
}
|
||||
|
||||
this.crud.query.startTime = this.dtlFrom.startTime
|
||||
this.crud.query.endTime = this.dtlFrom.endTime
|
||||
this.crud.query.devicerecord_id = this.dtlFrom.devicerecord_id
|
||||
this.crud.toQuery()
|
||||
},
|
||||
downdtl() {
|
||||
if (this.currentRow !== null) {
|
||||
crud.downloadLoading = true
|
||||
download('/api/deviceooestat/download', this.crud.query).then(result => {
|
||||
downloadFile(result, 'oee指标统计', 'xlsx')
|
||||
crud.downloadLoading = false
|
||||
}).catch(() => {
|
||||
crud.downloadLoading = false
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -12,7 +12,7 @@
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="统计日期">
|
||||
<date-range-picker v-model="query.createTime" class="date-item" value-format="yyyy-MM-dd"/>
|
||||
<date-range-picker v-model="query.createTime" class="date-item" @change="changeTime" value-format="yyyy-MM-dd"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类别">
|
||||
<treeselect
|
||||
@@ -53,7 +53,11 @@
|
||||
<el-table-column v-if="false" prop="runrecord_id" label="记录标识" />
|
||||
<el-table-column prop="dept_name" label="使用部门" />
|
||||
<el-table-column prop="class_name" label="设备类型" />
|
||||
<el-table-column prop="device_code" label="设备编码" />
|
||||
<el-table-column prop="device_code" label="设备编码">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="openDtl(scope.row)">{{ scope.row.device_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="device_name" label="设备名称" width="120px" show-overflow-tooltip />
|
||||
<el-table-column prop="run_times" label="工作时间(分钟)" width="120px" />
|
||||
<el-table-column prop="prepare_times" label="准备时间(分钟)" width="120px" />
|
||||
@@ -67,6 +71,7 @@
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
<DtlDialog :dialog-show.sync="openDtldialog" :open-param="openParam" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -82,11 +87,12 @@ import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
import crudMaterialbase from '@/api/wms/basedata/master/materialbase'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
import DtlDialog from '@/views/wms/sb/stat/deviceooestat/DtlDialog'
|
||||
|
||||
const defaultForm = { runrecord_id: null, devicerecord_id: null, run_date: null, run_times: null, prepare_times: null, error_times: null, adjust_times: null, product_qty: null, nok_qty: null, oee_value: null, remark: null, create_id: null, create_name: null, create_time: null }
|
||||
export default {
|
||||
name: 'Deviceooestat',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, Treeselect, DateRangePicker },
|
||||
components: { DtlDialog, pagination, crudOperation, rrOperation, udOperation, Treeselect, DateRangePicker },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({
|
||||
@@ -108,8 +114,11 @@ export default {
|
||||
return {
|
||||
classes: [],
|
||||
class_idStr: null,
|
||||
openParam: null,
|
||||
changeTimeAge: null,
|
||||
materOpt_code: '23',
|
||||
deviceDialog: false,
|
||||
openDtldialog: false,
|
||||
permission: {
|
||||
}
|
||||
}
|
||||
@@ -160,6 +169,24 @@ export default {
|
||||
return obj
|
||||
})
|
||||
})
|
||||
},
|
||||
openDtl(row) {
|
||||
if (!this.changeTimeAge) {
|
||||
return this.crud.notify('请选择日期', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
this.openParam = {
|
||||
'dtlFrom': row,
|
||||
'time': this.changeTimeAge
|
||||
}
|
||||
this.openDtldialog = true
|
||||
},
|
||||
changeTime(val) {
|
||||
debugger
|
||||
this.changeTimeAge = {
|
||||
'startTime': val[0],
|
||||
'endTime': val[1]
|
||||
}
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ export default {
|
||||
mixins: [crud],
|
||||
data() {
|
||||
return {
|
||||
path: 'ws://localhost:8010/webSocket/20',
|
||||
path: 'ws://192.168.81.252:8086//webSocket/20',
|
||||
currentDate: new Date(),
|
||||
getTime: '',
|
||||
getDate: '',
|
||||
|
||||
@@ -36,7 +36,7 @@ export default {
|
||||
name: 'Test',
|
||||
data() {
|
||||
return {
|
||||
path: 'ws://localhost:8010/webSocket/21',
|
||||
path: 'ws://192.168.81.252:8086//webSocket/21',
|
||||
table: [
|
||||
{ 'fault_time': '暂无数据', 'create_time': '暂无数据', 'name': '暂无数据', 'device_name': '暂无数据', 'class_name': '暂无数据' }
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user