更新代码

This commit is contained in:
lyd
2022-10-19 20:06:00 +08:00
parent 36b489ffdc
commit c79adbcdae
4 changed files with 102 additions and 31 deletions

View File

@@ -24,7 +24,7 @@ public class TaskDto implements Serializable {
private String task_code;
/** 任务类型 */
private Long task_type;
private String task_type;
/** 任务状态 */
private String task_status;

View File

@@ -14,6 +14,8 @@ import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.WqlUtil;
import org.nl.wms.basedata.service.ClassstandardService;
import org.nl.wms.basedata.service.dto.ClassstandardDto;
import org.nl.wms.sch.service.TaskService;
import org.nl.wms.sch.service.dto.TaskDto;
import org.springframework.data.domain.Pageable;
@@ -35,6 +37,8 @@ import java.util.Map;
@Slf4j
public class TaskServiceImpl implements TaskService {
private final ClassstandardService classstandardService;
@Override
public Map<String, Object> queryAll(Map form, Pageable page) {
@@ -66,7 +70,8 @@ public class TaskServiceImpl implements TaskService {
map.put("vehicle_code", "%" + whereJson.getString("vehicle_code") + "%");
}
if (StrUtil.isNotEmpty(whereJson.getString("task_type"))) {
map.put("task_type", whereJson.getString("task_type"));
ClassstandardDto task_type = classstandardService.findById(whereJson.getString("task_type"));
map.put("task_type", task_type.getClass_code());
}
if (StrUtil.isNotEmpty(whereJson.getString("taskdtl_type"))) {
map.put("taskdtl_type", whereJson.getString("taskdtl_type"));

View File

@@ -52,10 +52,12 @@
PAGEQUERY
SELECT
task.*,
md.class_name task_type_name
md.class_name task_type_name,
dict.label task_status_name
FROM
sch_base_task task
LEFT JOIN md_pb_classstandard md ON task.task_type = md.class_code
LEFT JOIN sys_dict_detail dict ON dict.`value` = task.task_status AND dict.`name` = 'task_status'
WHERE
task.is_delete = '0'
OPTION 输入.task_type <> ""

View File

@@ -40,21 +40,13 @@
/>
</el-form-item>
<el-form-item label="任务类型">
<el-select
<treeselect
v-model="query.task_type"
filterable
:load-options="loadChildNodes"
:options="classes1"
style="width: 180px"
placeholder="任务类型"
class="filter-item"
clearable
@change="hand"
>
<el-option
v-for="item in dict.SCH_TASK_TYPE"
:label="item.label"
:value="item.value"
/>
</el-select>
placeholder="请选择"
/>
</el-form-item>
<el-form-item label="完成方式">
<el-select
@@ -140,22 +132,18 @@
v-permission="['admin','instruction:edit','instruction:del']"
fixed="right"
label="操作"
width="80px"
width="120px"
align="center"
>
<template slot-scope="scope">
<el-dropdown trigger="click" @command="handleCommand">
<span class="el-dropdown-link">
<i class="el-icon-menu" />
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'d')">下发</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,'c')">拉回</el-dropdown-item>-->
<!-- <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'e')">详情</el-dropdown-item>-->
</el-dropdown-menu>
</el-dropdown>
<el-button
type="text"
icon="el-icon-upload"
@click="doOperate(scope.row, 'a')">下发</el-button>
<el-button
type="text"
icon="el-icon-success"
@click="doOperate(scope.row, 'b')">完成</el-button>
</template>
</el-table-column>
</el-table>
@@ -187,13 +175,17 @@ import crudTask from '@/api/wms/sch/task'
import CRUD, { crud, header, presenter } 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 Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import crudClassstandard from '@/api/wms/basedata/classstandard'
export default {
name: 'Task',
dicts: [],
components: {
pagination, crudOperation, rrOperation
pagination, crudOperation, rrOperation, Treeselect, udOperation
},
mixins: [presenter(), header(), crud()],
cruds() {
@@ -229,10 +221,12 @@ export default {
permission: {
},
rules: {}
rules: {},
classes1: []
}
},
created() {
this.initClass1()
crudTask.getTaskStatus().then(data => {
this.taskStatusList = data
})
@@ -243,6 +237,42 @@ export default {
this.crud.toQuery()
},
methods: {
initClass1() {
const param = {
parent_class_code: 'task_type'
}
crudClassstandard.getClassType(param).then(res => {
const data = res.content
this.buildTree(data)
this.classes1 = data
})
},
buildTree(classes) {
classes.forEach(data => {
if (data.children) {
this.buildTree(data.children)
}
if (data.hasChildren && !data.children) {
data.children = null // 重点代码
}
})
},
// 获取子节点数据
loadChildNodes({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) {
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
parentNode.children = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
setTimeout(() => {
callback()
}, 100)
})
}
},
hand(value) {
this.crud.toQuery()
},
@@ -268,6 +298,40 @@ export default {
}
return ''
},
doOperate(row, command) {
let method_name = ''
switch (command) {
case 'a':// 完成
method_name = 'forceFinish'
break
case 'b':// 取消
method_name = 'cancel'
break
case 'c':// 拉回
method_name = 'pullBack'
break
case 'd':// 下发
method_name = 'renotifyAcs'
break
case 'e':// 详情
method_name = 'view'
break
}
if (method_name === 'view') {
this.view(row)
return
}
const data = {
task_id: row.task_id,
method_name: method_name
}
crudTask.operation(data).then(res => {
this.crud.toQuery()
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(err => {
console.log(err.response.data.message)
})
},
beforeHandleCommand(index, row, command) {
return {
'index': index,