rev: 修改任务状态的获取
This commit is contained in:
@@ -4,11 +4,14 @@ package org.nl.wms.sch.rest;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.anno.Log;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.system.service.dict.ISysDictService;
|
||||
import org.nl.system.service.dict.dao.Dict;
|
||||
import org.nl.wms.sch.manage.FinishTypeEnum;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.service.TaskService;
|
||||
@@ -34,6 +37,7 @@ import java.util.Map;
|
||||
public class TaskController {
|
||||
|
||||
private final TaskService taskService;
|
||||
private final ISysDictService dictService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询任务")
|
||||
@@ -74,20 +78,8 @@ public class TaskController {
|
||||
@Log("获取任务状态列表")
|
||||
@ApiOperation("获取任务状态列表")
|
||||
public ResponseEntity<Object> getTaskStatus() {
|
||||
TaskStatusEnum[] values = TaskStatusEnum.values();
|
||||
JSONArray arr = new JSONArray();
|
||||
for (TaskStatusEnum value : values) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("code", value.getCode());
|
||||
json.put("name", value.getName());
|
||||
arr.add(json);
|
||||
}
|
||||
//增加未完成状态
|
||||
JSONObject unFinish = new JSONObject();
|
||||
unFinish.put("code", "-1");
|
||||
unFinish.put("name", "未完成");
|
||||
arr.add(unFinish);
|
||||
return new ResponseEntity<>(arr, HttpStatus.OK);
|
||||
return new ResponseEntity<>(dictService.list(new LambdaQueryWrapper<Dict>()
|
||||
.eq(Dict::getCode, "task_status")), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/taskType")
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
SELECT
|
||||
task.*,
|
||||
md.class_name task_type_name,
|
||||
dict.label task_status_name,
|
||||
DICT.label task_status_name,
|
||||
reg1.region_name as point1_region_name,
|
||||
reg2.region_name as point2_region_name,
|
||||
reg3.region_name as point3_region_name,
|
||||
|
||||
@@ -109,8 +109,8 @@
|
||||
<el-option
|
||||
v-for="item in taskStatusList"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -143,7 +143,7 @@
|
||||
<el-table-column v-if="false" prop="task_type_name" label="任务类型" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column v-if="false" prop="task_status" label="任务状态" />
|
||||
<el-table-column prop="product_area" label="生产区域" />
|
||||
<el-table-column prop="task_status_name" label="任务状态" width="95px" :formatter="formatTaskStatusName" />
|
||||
<el-table-column prop="task_status_name" label="任务状态" width="120px" :formatter="formatTaskStatusName" />
|
||||
<el-table-column prop="vehicle_type" label="载具类型" min-width="100" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.vehicle_type[scope.row.vehicle_type] }}
|
||||
@@ -294,6 +294,7 @@ export default {
|
||||
parent_class_code: 'task_type'
|
||||
}
|
||||
crudClassstandard.getClassType(param).then(res => {
|
||||
console.log(res)
|
||||
const data = res.content
|
||||
this.buildTree(data)
|
||||
this.classes1 = data
|
||||
@@ -337,8 +338,8 @@ export default {
|
||||
},
|
||||
formatTaskStatusName(row, column) {
|
||||
for (const item of this.taskStatusList) {
|
||||
if (item.code === row.task_status) {
|
||||
return item.name
|
||||
if (item.value === row.task_status) {
|
||||
return item.label
|
||||
}
|
||||
}
|
||||
return ''
|
||||
|
||||
Reference in New Issue
Block a user