更新代码
This commit is contained in:
@@ -24,7 +24,7 @@ public class TaskDto implements Serializable {
|
|||||||
private String task_code;
|
private String task_code;
|
||||||
|
|
||||||
/** 任务类型 */
|
/** 任务类型 */
|
||||||
private Long task_type;
|
private String task_type;
|
||||||
|
|
||||||
/** 任务状态 */
|
/** 任务状态 */
|
||||||
private String task_status;
|
private String task_status;
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import org.nl.modules.common.exception.BadRequestException;
|
|||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
import org.nl.modules.wql.util.WqlUtil;
|
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.TaskService;
|
||||||
import org.nl.wms.sch.service.dto.TaskDto;
|
import org.nl.wms.sch.service.dto.TaskDto;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
@@ -35,6 +37,8 @@ import java.util.Map;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class TaskServiceImpl implements TaskService {
|
public class TaskServiceImpl implements TaskService {
|
||||||
|
|
||||||
|
private final ClassstandardService classstandardService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryAll(Map form, Pageable page) {
|
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") + "%");
|
map.put("vehicle_code", "%" + whereJson.getString("vehicle_code") + "%");
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotEmpty(whereJson.getString("task_type"))) {
|
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"))) {
|
if (StrUtil.isNotEmpty(whereJson.getString("taskdtl_type"))) {
|
||||||
map.put("taskdtl_type", whereJson.getString("taskdtl_type"));
|
map.put("taskdtl_type", whereJson.getString("taskdtl_type"));
|
||||||
|
|||||||
@@ -52,10 +52,12 @@
|
|||||||
PAGEQUERY
|
PAGEQUERY
|
||||||
SELECT
|
SELECT
|
||||||
task.*,
|
task.*,
|
||||||
md.class_name task_type_name
|
md.class_name task_type_name,
|
||||||
|
dict.label task_status_name
|
||||||
FROM
|
FROM
|
||||||
sch_base_task task
|
sch_base_task task
|
||||||
LEFT JOIN md_pb_classstandard md ON task.task_type = md.class_code
|
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
|
WHERE
|
||||||
task.is_delete = '0'
|
task.is_delete = '0'
|
||||||
OPTION 输入.task_type <> ""
|
OPTION 输入.task_type <> ""
|
||||||
|
|||||||
@@ -40,21 +40,13 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="任务类型">
|
<el-form-item label="任务类型">
|
||||||
<el-select
|
<treeselect
|
||||||
v-model="query.task_type"
|
v-model="query.task_type"
|
||||||
filterable
|
:load-options="loadChildNodes"
|
||||||
|
:options="classes1"
|
||||||
style="width: 180px"
|
style="width: 180px"
|
||||||
placeholder="任务类型"
|
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>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="完成方式">
|
<el-form-item label="完成方式">
|
||||||
<el-select
|
<el-select
|
||||||
@@ -140,22 +132,18 @@
|
|||||||
v-permission="['admin','instruction:edit','instruction:del']"
|
v-permission="['admin','instruction:edit','instruction:del']"
|
||||||
fixed="right"
|
fixed="right"
|
||||||
label="操作"
|
label="操作"
|
||||||
width="80px"
|
width="120px"
|
||||||
align="center"
|
align="center"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-dropdown trigger="click" @command="handleCommand">
|
<el-button
|
||||||
<span class="el-dropdown-link">
|
type="text"
|
||||||
<i class="el-icon-menu" />
|
icon="el-icon-upload"
|
||||||
</span>
|
@click="doOperate(scope.row, 'a')">下发</el-button>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-button
|
||||||
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'d')">下发</el-dropdown-item>
|
type="text"
|
||||||
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">完成</el-dropdown-item>
|
icon="el-icon-success"
|
||||||
<!-- <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">取消</el-dropdown-item>-->
|
@click="doOperate(scope.row, 'b')">完成</el-button>
|
||||||
<!-- <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>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -187,13 +175,17 @@ import crudTask from '@/api/wms/sch/task'
|
|||||||
import CRUD, { crud, header, presenter } from '@crud/crud'
|
import CRUD, { crud, header, presenter } from '@crud/crud'
|
||||||
import rrOperation from '@crud/RR.operation'
|
import rrOperation from '@crud/RR.operation'
|
||||||
import crudOperation from '@crud/CRUD.operation'
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import udOperation from '@crud/UD.operation'
|
||||||
import pagination from '@crud/Pagination'
|
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 {
|
export default {
|
||||||
name: 'Task',
|
name: 'Task',
|
||||||
dicts: [],
|
dicts: [],
|
||||||
components: {
|
components: {
|
||||||
pagination, crudOperation, rrOperation
|
pagination, crudOperation, rrOperation, Treeselect, udOperation
|
||||||
},
|
},
|
||||||
mixins: [presenter(), header(), crud()],
|
mixins: [presenter(), header(), crud()],
|
||||||
cruds() {
|
cruds() {
|
||||||
@@ -229,10 +221,12 @@ export default {
|
|||||||
permission: {
|
permission: {
|
||||||
|
|
||||||
},
|
},
|
||||||
rules: {}
|
rules: {},
|
||||||
|
classes1: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.initClass1()
|
||||||
crudTask.getTaskStatus().then(data => {
|
crudTask.getTaskStatus().then(data => {
|
||||||
this.taskStatusList = data
|
this.taskStatusList = data
|
||||||
})
|
})
|
||||||
@@ -243,6 +237,42 @@ export default {
|
|||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
},
|
},
|
||||||
methods: {
|
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) {
|
hand(value) {
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
},
|
},
|
||||||
@@ -268,6 +298,40 @@ export default {
|
|||||||
}
|
}
|
||||||
return ''
|
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) {
|
beforeHandleCommand(index, row, command) {
|
||||||
return {
|
return {
|
||||||
'index': index,
|
'index': index,
|
||||||
|
|||||||
Reference in New Issue
Block a user