立讯优化

This commit is contained in:
loujf
2022-07-26 17:21:03 +08:00
parent 11aa0b8528
commit 9f7e4ac78e
15 changed files with 198 additions and 42 deletions

View File

@@ -149,6 +149,16 @@ public class AgvDto implements Serializable {
*/ */
private String today_odo; private String today_odo;
/**
* 本次运行时间(开机后到当前的时间)
*/
private String time;
/**
* 累计运行时间
*/
private String total_time;
/** /**
* 电压 * 电压
*/ */

View File

@@ -565,6 +565,12 @@ public class AgvServiceImpl implements AgvService {
} else if(StrUtil.equals(state,"6")){ } else if(StrUtil.equals(state,"6")){
state_name = "CANCELED"; state_name = "CANCELED";
} }
//本次运行时间(开机后到当前的时间)
String time = rbk_report.getString("time");
//累计运行时间
String total_time = rbk_report.getString("total_time");
//今日累计行驶里程
String today_odo = rbk_report.getString("today_odo");
String energyLevel = String.valueOf(rbk_report.getDouble("battery_level")); String energyLevel = String.valueOf(rbk_report.getDouble("battery_level"));
String transportOrder = current_order.getString("id"); String transportOrder = current_order.getString("id");
@@ -608,6 +614,10 @@ public class AgvServiceImpl implements AgvService {
dto.setVx(vx); dto.setVx(vx);
dto.setVy(vy); dto.setVy(vy);
dto.setW(w); dto.setW(w);
dto.setToday_odo(today_odo);
dto.setTotal_time(total_time);
dto.setTime(time);
if (AGVDeviceStatus.containsKey(name)) { if (AGVDeviceStatus.containsKey(name)) {
AGVDeviceStatus.remove(name); AGVDeviceStatus.remove(name);
AGVDeviceStatus.put(name, dto); AGVDeviceStatus.put(name, dto);

View File

@@ -63,8 +63,9 @@ public class AcsToWmsController {
@PostMapping("/feedbackAgv") @PostMapping("/feedbackAgv")
@Log("反馈AGV设备信息") @Log("反馈AGV设备信息")
@ApiOperation("反馈AGV设备信息") @ApiOperation("反馈AGV设备信息")
public ResponseEntity<Object> feedbackAgv(@RequestBody JSONArray from) { public ResponseEntity<Object> feedbackAgv(@RequestBody String from) {
return new ResponseEntity<>(acstowmsService.feedbackAgv(from), HttpStatus.OK); JSONArray array = JSONArray.fromObject(from);
return new ResponseEntity<>(acstowmsService.feedbackAgv(array), HttpStatus.OK);
} }
@PostMapping("/feedbackDeviceStatus") @PostMapping("/feedbackDeviceStatus")

View File

@@ -139,13 +139,13 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
} }
List<RouteLineDto> list = RouteLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code); List<RouteLineDto> list = RouteLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
if (ObjectUtil.isEmpty(list)) { // if (ObjectUtil.isEmpty(list)) {
JSONObject json = new JSONObject(); // JSONObject json = new JSONObject();
json.put("task_code", task_code); // json.put("task_code", task_code);
json.put("message", "路由不通!"); // json.put("message", "路由不通!");
errArr.add(json); // errArr.add(json);
continue; // continue;
} // }
TaskDto taskDto = TaskService.findByCodeFromCache(task_code); TaskDto taskDto = TaskService.findByCodeFromCache(task_code);
if (taskDto != null) { if (taskDto != null) {
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
@@ -233,7 +233,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
} catch (Exception e) { } catch (Exception e) {
resultJson.put("status", 400); resultJson.put("status", 200);
resultJson.put("errArr", e.getMessage()); resultJson.put("errArr", e.getMessage());
resultJson.put("message", e.getMessage()); resultJson.put("message", e.getMessage());
resultJson.put("data", new JSONObject()); resultJson.put("data", new JSONObject());

View File

@@ -137,4 +137,20 @@ public class InstructionController {
public ResponseEntity<Object> queryByTaskId(@RequestBody String taskId) { public ResponseEntity<Object> queryByTaskId(@RequestBody String taskId) {
return new ResponseEntity<>(instructionService.getByTaskId(taskId), HttpStatus.OK); return new ResponseEntity<>(instructionService.getByTaskId(taskId), HttpStatus.OK);
} }
@Log("取货完成")
@ApiOperation("取货完成")
@PostMapping(value = "/getFinish/{id}")
public ResponseEntity<Object> getFinish(@RequestBody String id) throws Exception {
instructionService.getFinish(id);
return new ResponseEntity<>(HttpStatus.OK);
}
@Log("放货完成")
@ApiOperation("放货完成")
@PostMapping(value = "/putFinish/{id}")
public ResponseEntity<Object> putFinish(@RequestBody String id) throws Exception {
instructionService.putFinish(id);
return new ResponseEntity<>(HttpStatus.OK);
}
} }

View File

@@ -249,4 +249,18 @@ public interface InstructionService {
boolean removeByCodeFromCache(String code); boolean removeByCodeFromCache(String code);
/**
* 取货完成
*
* @param id
*/
void getFinish(String id) throws Exception;
/**
* 放货完成
*
* @param id
*/
void putFinish(String id) throws Exception;
} }

View File

@@ -23,6 +23,7 @@ import org.nl.acs.device_driver.standard_conveyor_control_with_scanner.StandardC
import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver;
import org.nl.acs.device_driver.standard_storage.StandardStorageDeviceDriver; import org.nl.acs.device_driver.standard_storage.StandardStorageDeviceDriver;
import org.nl.acs.device_driver.traffic_light.TrafficLightDeviceDriver; import org.nl.acs.device_driver.traffic_light.TrafficLightDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.log.service.LogServer; import org.nl.acs.log.service.LogServer;
@@ -79,6 +80,8 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
TaskService taskService; TaskService taskService;
@Autowired @Autowired
LogServer logServer; LogServer logServer;
@Autowired
AcsToWmsService acsToWmsService;
@Override @Override
@@ -105,7 +108,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
String point_code = (String) whereJson.get("point_code"); String point_code = (String) whereJson.get("point_code");
String is_over = (String) whereJson.get("is_over"); String is_over = (String) whereJson.get("is_over");
if (!StrUtil.isEmpty(code)) { if (!StrUtil.isEmpty(code)) {
map.put("code", code); map.put("code", "%" + code + "%");
} }
if (!StrUtil.isEmpty(vehicle_code)) { if (!StrUtil.isEmpty(vehicle_code)) {
map.put("vehicle_code", vehicle_code); map.put("vehicle_code", vehicle_code);
@@ -117,7 +120,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
map.put("status", status); map.put("status", status);
} }
if (!StrUtil.isEmpty(point_code)) { if (!StrUtil.isEmpty(point_code)) {
map.put("point_code", point_code); map.put("point_code", "%" + point_code + "%");
} }
if (!StrUtil.isEmpty(is_over)) { if (!StrUtil.isEmpty(is_over)) {
map.put("is_over", is_over); map.put("is_over", is_over);
@@ -140,7 +143,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
String create_time = (String) whereJson.get("createTime"); String create_time = (String) whereJson.get("createTime");
String end_time = (String) whereJson.get("end_time"); String end_time = (String) whereJson.get("end_time");
if (!StrUtil.isEmpty(code)) { if (!StrUtil.isEmpty(code)) {
map.put("code", code); map.put("code", "%" + code + "%");
} }
if (!StrUtil.isEmpty(vehicle_code)) { if (!StrUtil.isEmpty(vehicle_code)) {
map.put("vehicle_code", vehicle_code); map.put("vehicle_code", vehicle_code);
@@ -152,7 +155,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
map.put("status", status); map.put("status", status);
} }
if (!StrUtil.isEmpty(point_code)) { if (!StrUtil.isEmpty(point_code)) {
map.put("point_code", point_code); map.put("point_code", "%" + point_code + "%");
} }
if (!StrUtil.isEmpty(create_time) && !StrUtil.isEmpty(end_time)) { if (!StrUtil.isEmpty(create_time) && !StrUtil.isEmpty(end_time)) {
map.put("create_time", create_time); map.put("create_time", create_time);
@@ -1227,4 +1230,34 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$"); Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
return pattern.matcher(str).matches(); return pattern.matcher(str).matches();
} }
@Override
public void getFinish(String id){
Instruction inst = this.findById(id);
JSONObject feedjo = new JSONObject();
feedjo.put("status","1");
feedjo.put("device_code",inst.getStart_device_code());
feedjo.put("vehicle_code",inst.getVehicle_code());
feedjo.put("task_code",inst.getTask_code());
JSONArray feedja = JSONArray.fromObject(feedjo);
acsToWmsService.feedbackActionStatusToWms(feedja);
inst.setFinish_type("1");
this.update(inst);
}
@Override
public void putFinish(String id){
Instruction inst = this.findById(id);
JSONObject feedjo = new JSONObject();
feedjo.put("status","2");
feedjo.put("device_code",inst.getNext_device_code());
feedjo.put("vehicle_code",inst.getVehicle_code());
feedjo.put("task_code",inst.getTask_code());
JSONArray feedja = JSONArray.fromObject(feedjo);
acsToWmsService.feedbackActionStatusToWms(feedja);
inst.setFinish_type("2");
this.update(inst);
}
} }

View File

@@ -59,11 +59,11 @@
OPTION 输入.is_over <> "1" OPTION 输入.is_over <> "1"
inst.instruction_status < 2 inst.instruction_status < 2
ENDOPTION ENDOPTION
OPTION 输入.task_code <> "" OPTION 输入.code <> ""
( (
inst.instruction_code = 输入.code inst.instruction_code like 输入.code
OR OR
inst.task_code = 输入.code inst.task_code like 输入.code
) )
ENDOPTION ENDOPTION
OPTION 输入.status <> "" OPTION 输入.status <> ""
@@ -77,9 +77,9 @@
ENDOPTION ENDOPTION
OPTION 输入.point_code <> "" OPTION 输入.point_code <> ""
( (
inst.start_point_code = 输入.point_code inst.start_point_code like 输入.point_code
OR OR
inst.next_point_code = 输入.point_code inst.next_point_code like 输入.point_code
) )
ENDOPTION ENDOPTION
ENDSELECT ENDSELECT
@@ -94,11 +94,11 @@
acs_instruction inst acs_instruction inst
WHERE WHERE
is_delete =0 is_delete =0
OPTION 输入.task_code <> "" OPTION 输入.code <> ""
( (
inst.instruction_code = 输入.code inst.instruction_code like 输入.code
OR OR
inst.task_code = 输入.code inst.task_code like 输入.code
) )
ENDOPTION ENDOPTION
OPTION 输入.status <> "" OPTION 输入.status <> ""
@@ -112,9 +112,9 @@
ENDOPTION ENDOPTION
OPTION 输入.point_code <> "" OPTION 输入.point_code <> ""
( (
inst.start_point_code = 输入.point_code inst.start_point_code like 输入.point_code
OR OR
inst.next_point_code = 输入.point_code inst.next_point_code like 输入.point_code
) )
ENDOPTION ENDOPTION
ENDOPTION ENDOPTION

View File

@@ -124,7 +124,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
String point_code = (String) whereJson.get("point_code"); String point_code = (String) whereJson.get("point_code");
String is_over = (String) whereJson.get("is_over"); String is_over = (String) whereJson.get("is_over");
if (!StrUtil.isEmpty(task_code)) { if (!StrUtil.isEmpty(task_code)) {
map.put("task_code", task_code); map.put("task_code", "%" + task_code + "%");
} }
if (!StrUtil.isEmpty(vehicle_code)) { if (!StrUtil.isEmpty(vehicle_code)) {
map.put("vehicle_code", vehicle_code); map.put("vehicle_code", vehicle_code);
@@ -136,7 +136,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
map.put("status", status); map.put("status", status);
} }
if (!StrUtil.isEmpty(point_code)) { if (!StrUtil.isEmpty(point_code)) {
map.put("point_code", point_code); map.put("point_code", "%" + point_code + "%");
} }
if (!StrUtil.isEmpty(is_over)) { if (!StrUtil.isEmpty(is_over)) {
map.put("is_over", is_over); map.put("is_over", is_over);
@@ -200,7 +200,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
String create_time = (String) whereJson.get("createTime"); String create_time = (String) whereJson.get("createTime");
String end_time = (String) whereJson.get("end_time"); String end_time = (String) whereJson.get("end_time");
if (!StrUtil.isEmpty(task_code)) { if (!StrUtil.isEmpty(task_code)) {
map.put("task_code", task_code); map.put("task_code", "%" + task_code + "%");
} }
if (!StrUtil.isEmpty(vehicle_code)) { if (!StrUtil.isEmpty(vehicle_code)) {
map.put("vehicle_code", vehicle_code); map.put("vehicle_code", vehicle_code);
@@ -212,7 +212,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
map.put("status", status); map.put("status", status);
} }
if (!StrUtil.isEmpty(point_code)) { if (!StrUtil.isEmpty(point_code)) {
map.put("point_code", point_code); map.put("point_code", "%" + point_code + "%");
} }
if (!StrUtil.isEmpty(create_time) && !StrUtil.isEmpty(end_time)) { if (!StrUtil.isEmpty(create_time) && !StrUtil.isEmpty(end_time)) {
map.put("create_time", create_time); map.put("create_time", create_time);

View File

@@ -58,7 +58,7 @@
task.task_status < 2 task.task_status < 2
ENDOPTION ENDOPTION
OPTION 输入.task_code <> "" OPTION 输入.task_code <> ""
task.task_code = 输入.task_code task.task_code like 输入.task_code
ENDOPTION ENDOPTION
OPTION 输入.status <> "" OPTION 输入.status <> ""
task.task_status = 输入.status task.task_status = 输入.status
@@ -71,9 +71,9 @@
ENDOPTION ENDOPTION
OPTION 输入.point_code <> "" OPTION 输入.point_code <> ""
( (
task.start_point_code = 输入.point_code task.start_point_code like 输入.point_code
OR OR
task.next_point_code = 输入.point_code task.next_point_code like 输入.point_code
) )
ENDOPTION ENDOPTION
ENDSELECT ENDSELECT
@@ -89,7 +89,7 @@ IF 输入.flag = "2"
WHERE WHERE
1=1 1=1
OPTION 输入.task_code <> "" OPTION 输入.task_code <> ""
task.task_code = 输入.task_code task.task_code like 输入.task_code
ENDOPTION ENDOPTION
OPTION 输入.status <> "" OPTION 输入.status <> ""
task.task_status = 输入.status task.task_status = 输入.status
@@ -102,9 +102,9 @@ IF 输入.flag = "2"
ENDOPTION ENDOPTION
OPTION 输入.point_code <> "" OPTION 输入.point_code <> ""
( (
task.start_point_code = 输入.point_code task.start_point_code like 输入.point_code
OR OR
task.next_point_code = 输入.point_code task.next_point_code like 输入.point_code
) )
ENDOPTION ENDOPTION
OPTION 输入.create_time <> "" OPTION 输入.create_time <> ""

View File

@@ -11,6 +11,8 @@ import org.nl.acs.agv.server.AgvService;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.instruction.service.dto.Instruction;
import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@@ -32,6 +34,9 @@ public class QueryXZAgvTaskStatus {
@Autowired @Autowired
AcsToWmsService acsToWmsService; AcsToWmsService acsToWmsService;
@Autowired
TaskService taskService;
public void run() throws Exception { public void run() throws Exception {
HttpResponse response = agvService.queryXZAgvInstStatus(); HttpResponse response = agvService.queryXZAgvInstStatus();
@@ -55,7 +60,7 @@ public class QueryXZAgvTaskStatus {
JSONObject feedjo = new JSONObject(); JSONObject feedjo = new JSONObject();
feedjo.put("status","1"); feedjo.put("status","1");
feedjo.put("device_code",device_code); feedjo.put("device_code",device_code);
feedjo.put("vehicle_code ",inst.getVehicle_code()); feedjo.put("vehicle_code",inst.getVehicle_code());
feedjo.put("task_code",inst.getTask_code()); feedjo.put("task_code",inst.getTask_code());
JSONArray feedja = JSONArray.fromObject(feedjo); JSONArray feedja = JSONArray.fromObject(feedjo);
acsToWmsService.feedbackActionStatusToWms(feedja); acsToWmsService.feedbackActionStatusToWms(feedja);
@@ -68,7 +73,7 @@ public class QueryXZAgvTaskStatus {
feedjo.put("status","2"); feedjo.put("status","2");
feedjo.put("device_code",device_code); feedjo.put("device_code",device_code);
feedjo.put("task_code",inst.getTask_code()); feedjo.put("task_code",inst.getTask_code());
feedjo.put("vehicle_code ",inst.getVehicle_code()); feedjo.put("vehicle_code",inst.getVehicle_code());
JSONArray feedja = JSONArray.fromObject(feedjo); JSONArray feedja = JSONArray.fromObject(feedjo);
acsToWmsService.feedbackActionStatusToWms(feedja); acsToWmsService.feedbackActionStatusToWms(feedja);
inst.setFinish_type("2"); inst.setFinish_type("2");
@@ -107,9 +112,15 @@ public class QueryXZAgvTaskStatus {
inst.setInstruction_status("1"); inst.setInstruction_status("1");
instructionService.update(inst); instructionService.update(inst);
} }
} else {
} }
// else if ("STOPPED".equals(state)){
// if (inst != null) {
// instructionService.cancel(inst.getInstruction_id());
//
// TaskDto taskDto = taskService.findByCode(inst.getTask_code());
// taskService.cancel(taskDto.getTask_id());
// }
// }
} }
} }

View File

@@ -54,6 +54,9 @@ public class ToAgvDevice {
row.put("odo", agvDto.getOdo()); row.put("odo", agvDto.getOdo());
row.put("vx", agvDto.getVx()); row.put("vx", agvDto.getVx());
row.put("w", agvDto.getW()); row.put("w", agvDto.getW());
row.put("today_odo", agvDto.getToday_odo());
row.put("total_time", agvDto.getTotal_time());
row.put("time", agvDto.getTime());
agv_rows.add(row); agv_rows.add(row);
} }

View File

@@ -63,4 +63,20 @@ export function reload() {
}) })
} }
export default { add, edit, del, finish, cancel, queryUnFinish, queryByTaskId,reload } export function getFinish(instruction_id) {
return request({
url: 'api/instruction/getFinish/' + instruction_id,
method: 'post',
data: instruction_id
})
}
export function putFinish(instruction_id) {
return request({
url: 'api/instruction/putFinish/' + instruction_id,
method: 'post',
data: instruction_id
})
}
export default { add, edit, del, finish, cancel, queryUnFinish, queryByTaskId, reload, getFinish, putFinish }

View File

@@ -125,6 +125,12 @@
<span v-if="scope.row.send_status=='2' ">失败</span> <span v-if="scope.row.send_status=='2' ">失败</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="finish_type" label="完成类型">
<template slot-scope="scope">
<span v-if="scope.row.finish_type=='1' ">取货完成</span>
<span v-if="scope.row.finish_type=='2' ">放货完成</span>
</template>
</el-table-column>
<el-table-column prop="start_point_code" label="起点" /> <el-table-column prop="start_point_code" label="起点" />
<el-table-column prop="start_parent_code" label="父起点点位" /> <el-table-column prop="start_parent_code" label="父起点点位" />
<el-table-column prop="next_point_code" label="终点" /> <el-table-column prop="next_point_code" label="终点" />
@@ -159,6 +165,8 @@
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">完成</el-dropdown-item> <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">完成</el-dropdown-item>
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">取消</el-dropdown-item> <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">取消</el-dropdown-item>
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'c')">取货完成</el-dropdown-item>
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'d')">放货完成</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</template> </template>
@@ -173,6 +181,7 @@
import crudInstruction from '@/api/acs/instruction/instruction' import crudInstruction from '@/api/acs/instruction/instruction'
import CRUD, { presenter, header, form, crud } from '@crud/crud' import CRUD, { presenter, header, form, crud } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation' import crudOperation from '@crud/CRUD.operation'
import rrOperation from '@crud/RR.operation'
import { getDicts } from '@/api/system/dict' import { getDicts } from '@/api/system/dict'
import crudTask from '@/api/acs/task/task' import crudTask from '@/api/acs/task/task'
@@ -215,7 +224,8 @@ const defaultForm = {
export default { export default {
dicts: ['task_status'], dicts: ['task_status'],
name: 'Instruction', name: 'Instruction',
components: { crudOperation }, // eslint-disable-next-line vue/no-unused-components
components: { crudOperation, rrOperation },
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() { cruds() {
return CRUD({ return CRUD({
@@ -228,6 +238,7 @@ export default {
add: false, add: false,
edit: true, edit: true,
del: true del: true
// reset: true
} }
}) })
}, },
@@ -290,6 +301,22 @@ export default {
console.log(err.response.data.message) console.log(err.response.data.message)
}) })
}, },
getFinish(index, row) {
crudInstruction.getFinish(row.instruction_id).then(res => {
this.crud.toQuery()
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(err => {
console.log(err.response.data.message)
})
},
putFinish(index, row) {
crudInstruction.putFinish(row.instruction_id).then(res => {
this.crud.toQuery()
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(err => {
console.log(err.response.data.message)
})
},
reload() { reload() {
crudInstruction.reload().then(res => { crudInstruction.reload().then(res => {
this.crud.toQuery() this.crud.toQuery()
@@ -313,6 +340,12 @@ export default {
case 'b':// 取消 case 'b':// 取消
this.cancel(command.index, command.row) this.cancel(command.index, command.row)
break break
case 'c':// 取消
this.getFinish(command.index, command.row)
break
case 'd':// 取消
this.putFinish(command.index, command.row)
break
} }
} }

View File

@@ -55,6 +55,7 @@
class="filter-item" class="filter-item"
@keyup.enter.native="crud.toQuery" @keyup.enter.native="crud.toQuery"
/> />
<rrOperation />
</div> </div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'--> <!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission"> <crudOperation :permission="permission">
@@ -283,6 +284,7 @@
import crudTask from '@/api/acs/task/task' import crudTask from '@/api/acs/task/task'
import CRUD, { crud, form, header, presenter } from '@crud/crud' import CRUD, { crud, form, header, presenter } from '@crud/crud'
import crudOperation from '@crud/CRUD.operation' import crudOperation from '@crud/CRUD.operation'
import rrOperation from '@crud/RR.operation'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
import deviceCrud from '@/api/acs/device/device' import deviceCrud from '@/api/acs/device/device'
import routeCurd from '@/api/acs/route/routePlan' import routeCurd from '@/api/acs/route/routePlan'
@@ -310,11 +312,18 @@ const defaultForm = {
} }
export default { export default {
name: 'Task', name: 'Task',
components: { pagination, crudOperation }, components: { pagination, crudOperation, rrOperation },
dicts: ['task_status', 'task_type'], dicts: ['task_status', 'task_type'],
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() { cruds() {
return CRUD({ title: '任务', url: 'api/task', idField: 'task_id', sort: 'task_id,desc', crudMethod: { ...crudTask }}) return CRUD({ title: '任务', url: 'api/task', idField: 'task_id', sort: 'task_id,desc', crudMethod: { ...crudTask },
optShow: {
add: true,
edit: true,
del: true
// reset: true
}
})
}, },
data() { data() {
const checkFromY = (rule, value, callback) => { const checkFromY = (rule, value, callback) => {