New file |
| | |
| | | <script setup> |
| | | import { getCurrentInstance, ref, watch, reactive } from 'vue'; |
| | | import { useRouter } from "vue-router"; |
| | | import { get, post, postForm } from '@/utils/request.js' |
| | | import { message, Modal } from 'ant-design-vue'; |
| | | import { logout } from '@/config.js'; |
| | | import { formatMessage } from '@/utils/localeUtils.js'; |
| | | import useTableSearch from '@/utils/tableUtils.jsx'; |
| | | const context = getCurrentInstance()?.appContext.config.globalProperties; |
| | | |
| | | const router = useRouter(); |
| | | |
| | | const TABLE_KEY = 'table-locDetl'; |
| | | |
| | | let tableData = ref([]); |
| | | let open = ref(false); |
| | | const orderDetlId = ref(null); |
| | | |
| | | const showWidth = ref("60%") |
| | | |
| | | const { |
| | | getColumnSearchProps, |
| | | } = useTableSearch(); |
| | | |
| | | const state = reactive({ |
| | | selectedRowKeys: [], |
| | | loading: false, |
| | | columns: [], |
| | | }); |
| | | |
| | | state.columns = [ |
| | | { |
| | | title: formatMessage('db.man_task.task_no', '任务编号'), |
| | | dataIndex: 'taskNo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('taskNo'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.task_sts', '任务状态'), |
| | | dataIndex: 'taskSts$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('taskSts$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.task_type', '任务类型'), |
| | | dataIndex: 'taskType$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('taskType$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.io_pri', '优先级'), |
| | | dataIndex: 'ioPri', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('ioPri'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.origin_loc', '源库位'), |
| | | dataIndex: 'originLoc', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('originLoc'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.target_loc', '目标库位'), |
| | | dataIndex: 'targetLoc', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('targetLoc'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.origin_site', '源站点'), |
| | | dataIndex: 'originSite', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('originSite'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.target_site', '目标站点'), |
| | | dataIndex: 'targetSite', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('targetSite'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.barcode', '托盘码'), |
| | | dataIndex: 'barcode', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('barcode'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.status', '状态'), |
| | | dataIndex: 'status$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('status$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.create_time', '添加时间'), |
| | | dataIndex: 'createTime$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('createTime$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.create_by', '添加人员'), |
| | | dataIndex: 'createBy$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('createBy$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.update_time', '修改时间'), |
| | | dataIndex: 'updateTime$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('updateTime$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.update_by', '修改人员'), |
| | | dataIndex: 'updateBy$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('updateBy$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.memo', '备注'), |
| | | dataIndex: 'memo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('memo'), |
| | | }, |
| | | ]; |
| | | |
| | | const handleOk = () => { |
| | | open.value = false; |
| | | } |
| | | |
| | | const handleCancel = () => { |
| | | open.value = false; |
| | | orderDetlId.value = null; |
| | | } |
| | | |
| | | watch(orderDetlId, (newVal, oldVal) => { |
| | | if (newVal != null) { |
| | | get("/api/taskLog/orderDetlId/" + newVal, {}).then((resp) => { |
| | | let result = resp.data; |
| | | tableData.value = result.data; |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | defineExpose({ |
| | | tableData, |
| | | orderDetlId, |
| | | open, |
| | | showWidth, |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'completeTaskComponent' |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <a-modal v-model:open="open" :width="showWidth" @ok="handleOk" @cancel="handleCancel"> |
| | | <a-table :data-source="tableData" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id" |
| | | :scroll="{ y: 768 }" :columns="state.columns"> |
| | | </a-table> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | | |
| | | <style></style> |
New file |
| | |
| | | <script setup> |
| | | import { getCurrentInstance, ref, watch, reactive } from 'vue'; |
| | | import { useRouter } from "vue-router"; |
| | | import { get, post, postForm } from '@/utils/request.js' |
| | | import { message, Modal } from 'ant-design-vue'; |
| | | import { logout } from '@/config.js'; |
| | | import { formatMessage } from '@/utils/localeUtils.js'; |
| | | import useTableSearch from '@/utils/tableUtils.jsx'; |
| | | const context = getCurrentInstance()?.appContext.config.globalProperties; |
| | | |
| | | const router = useRouter(); |
| | | |
| | | const TABLE_KEY = 'table-locDetl'; |
| | | |
| | | let tableData = ref([]); |
| | | let open = ref(false); |
| | | const orderDetlId = ref(null); |
| | | |
| | | const showWidth = ref("60%") |
| | | |
| | | const { |
| | | getColumnSearchProps, |
| | | } = useTableSearch(); |
| | | |
| | | const state = reactive({ |
| | | selectedRowKeys: [], |
| | | loading: false, |
| | | columns: [], |
| | | }); |
| | | |
| | | state.columns = [ |
| | | { |
| | | title: formatMessage('db.man_task.task_no', '任务编号'), |
| | | dataIndex: 'taskNo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('taskNo'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.task_sts', '任务状态'), |
| | | dataIndex: 'taskSts$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('taskSts$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.task_type', '任务类型'), |
| | | dataIndex: 'taskType$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('taskType$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.io_pri', '优先级'), |
| | | dataIndex: 'ioPri', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('ioPri'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.origin_loc', '源库位'), |
| | | dataIndex: 'originLoc', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('originLoc'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.target_loc', '目标库位'), |
| | | dataIndex: 'targetLoc', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('targetLoc'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.origin_site', '源站点'), |
| | | dataIndex: 'originSite', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('originSite'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.target_site', '目标站点'), |
| | | dataIndex: 'targetSite', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('targetSite'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.barcode', '托盘码'), |
| | | dataIndex: 'barcode', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('barcode'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.status', '状态'), |
| | | dataIndex: 'status$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('status$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.create_time', '添加时间'), |
| | | dataIndex: 'createTime$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('createTime$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.create_by', '添加人员'), |
| | | dataIndex: 'createBy$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('createBy$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.update_time', '修改时间'), |
| | | dataIndex: 'updateTime$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('updateTime$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.update_by', '修改人员'), |
| | | dataIndex: 'updateBy$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('updateBy$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task.memo', '备注'), |
| | | dataIndex: 'memo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('memo'), |
| | | }, |
| | | ]; |
| | | |
| | | const handleOk = () => { |
| | | open.value = false; |
| | | } |
| | | |
| | | const handleCancel = () => { |
| | | open.value = false; |
| | | orderDetlId.value = null; |
| | | } |
| | | |
| | | watch(orderDetlId, (newVal, oldVal) => { |
| | | if (newVal != null) { |
| | | get("/api/task/orderDetlId/" + newVal, {}).then((resp) => { |
| | | let result = resp.data; |
| | | tableData.value = result.data; |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | defineExpose({ |
| | | tableData, |
| | | orderDetlId, |
| | | open, |
| | | showWidth, |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'workTaskComponent' |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <a-modal v-model:open="open" :width="showWidth" @ok="handleOk" @cancel="handleCancel"> |
| | | <a-table :data-source="tableData" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id" |
| | | :scroll="{ y: 768 }" :columns="state.columns"> |
| | | </a-table> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | | |
| | | <style></style> |
| | |
| | | import { logout } from '@/config.js'; |
| | | import { formatMessage } from '@/utils/localeUtils.js'; |
| | | import useTableSearch from '@/utils/tableUtils.jsx'; |
| | | import WorkTaskView from '@/components/order/workTask/index.vue' |
| | | import CompleteTaskView from '@/components/order/completeTask/index.vue' |
| | | const context = getCurrentInstance()?.appContext.config.globalProperties; |
| | | |
| | | const router = useRouter(); |
| | |
| | | orderType$: '', |
| | | orderSettle$: '', |
| | | }); |
| | | const workTaskChild = ref(null) |
| | | const completeTaskChild = ref(null) |
| | | |
| | | const showWidth = ref("60%") |
| | | getColumns(); |
| | |
| | | } |
| | | }) |
| | | |
| | | const openWorkTask = (record) => { |
| | | workTaskChild.value.open = true; |
| | | workTaskChild.value.showWidth = '55%'; |
| | | workTaskChild.value.orderDetlId = record.detlId; |
| | | } |
| | | |
| | | const openCompleteQty = (record) => { |
| | | completeTaskChild.value.open = true; |
| | | completeTaskChild.value.showWidth = '55%'; |
| | | completeTaskChild.value.orderDetlId = record.detlId; |
| | | } |
| | | |
| | | defineExpose({ |
| | | tableData, |
| | | orderId, |
| | |
| | | </div> |
| | | <a-table :data-source="tableData" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id" |
| | | :scroll="{ y: 768 }" :columns="state.columns"> |
| | | <template #bodyCell="{ column, text, record }"> |
| | | <template v-if="column.dataIndex === 'workQty'"> |
| | | <a-button type="link" @click="openWorkTask(record)">{{ text }}</a-button> |
| | | </template> |
| | | |
| | | <template v-if="column.dataIndex === 'qty'"> |
| | | <a-button type="link" @click="openCompleteQty(record)">{{ text }}</a-button> |
| | | </template> |
| | | </template> |
| | | </a-table> |
| | | |
| | | <WorkTaskView ref="workTaskChild" /> |
| | | <CompleteTaskView ref="completeTaskChild" /> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | |
| | | return R.ok().add(taskService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:task:list')") |
| | | @GetMapping("/task/orderDetlId/{orderDetlId}") |
| | | public R getByOrderDetlId(@PathVariable("orderDetlId") Long orderDetlId) { |
| | | return R.ok().add(taskService.getByOrderDetlId(orderDetlId)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:task:save')") |
| | | @OperationLog("添加任务") |
| | | @PostMapping("/task/save") |
| | |
| | | return R.ok().add(taskLogService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskLog:list')") |
| | | @GetMapping("/taskLog/orderDetlId/{orderDetlId}") |
| | | public R getByOrderDetlId(@PathVariable("orderDetlId") Long orderDetlId) { |
| | | return R.ok().add(taskLogService.getByOrderDetlId(orderDetlId)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskLog:save')") |
| | | @OperationLog("添加任务历史") |
| | | @PostMapping("/taskLog/save") |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface TaskDetlLogMapper extends BaseMapper<TaskDetlLog> { |
| | | |
| | | List<Long> getTaskIdsByDetlId(Long detlId); |
| | | |
| | | } |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface TaskDetlMapper extends BaseMapper<TaskDetl> { |
| | | |
| | | List<Long> getTaskIdsByDetlId(Long detlId); |
| | | |
| | | } |
| | |
| | | |
| | | List<TaskDetlLog> getTaskDetlLogByTaskId(Long taskId); |
| | | |
| | | List<Long> getTaskIdsByDetlId(Long detlId); |
| | | |
| | | } |
| | |
| | | |
| | | List<TaskDetl> getTaskDetlByTaskId(Long taskId); |
| | | |
| | | List<Long> getTaskIdsByDetlId(Long detlId); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.wms.asrs.entity.TaskLog; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface TaskLogService extends IService<TaskLog> { |
| | | |
| | | List<TaskLog> getByOrderDetlId(Long orderDetlId); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.wms.asrs.entity.Task; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface TaskService extends IService<Task> { |
| | | |
| | | List<Task> getByOrderDetlId(Long orderDetlId); |
| | | |
| | | } |
| | |
| | | } |
| | | return taskDetlLogs; |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> getTaskIdsByDetlId(Long detlId) { |
| | | return this.baseMapper.getTaskIdsByDetlId(detlId); |
| | | } |
| | | } |
| | |
| | | } |
| | | return taskDetls; |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> getTaskIdsByDetlId(Long detlId) { |
| | | return this.baseMapper.getTaskIdsByDetlId(detlId); |
| | | } |
| | | } |
| | |
| | | package com.zy.asrs.wms.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.wms.asrs.entity.Task; |
| | | import com.zy.asrs.wms.asrs.mapper.TaskLogMapper; |
| | | import com.zy.asrs.wms.asrs.entity.TaskLog; |
| | | import com.zy.asrs.wms.asrs.service.TaskDetlLogService; |
| | | import com.zy.asrs.wms.asrs.service.TaskLogService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | @Service("taskLogService") |
| | | public class TaskLogServiceImpl extends ServiceImpl<TaskLogMapper, TaskLog> implements TaskLogService { |
| | | |
| | | @Autowired |
| | | private TaskDetlLogService taskDetlLogService; |
| | | |
| | | @Override |
| | | public List<TaskLog> getByOrderDetlId(Long orderDetlId) { |
| | | ArrayList<TaskLog> tasks = new ArrayList<>(); |
| | | List<Long> taskIds = taskDetlLogService.getTaskIdsByDetlId(orderDetlId); |
| | | if (!taskIds.isEmpty()) { |
| | | return this.list(new LambdaQueryWrapper<TaskLog>().in(TaskLog::getId, taskIds)); |
| | | } |
| | | return tasks; |
| | | } |
| | | } |
| | |
| | | package com.zy.asrs.wms.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.wms.asrs.entity.TaskDetl; |
| | | import com.zy.asrs.wms.asrs.mapper.TaskMapper; |
| | | import com.zy.asrs.wms.asrs.entity.Task; |
| | | import com.zy.asrs.wms.asrs.service.TaskDetlService; |
| | | import com.zy.asrs.wms.asrs.service.TaskService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | @Service("taskService") |
| | | public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements TaskService { |
| | | |
| | | @Autowired |
| | | private TaskDetlService taskDetlService; |
| | | |
| | | @Override |
| | | public List<Task> getByOrderDetlId(Long orderDetlId) { |
| | | ArrayList<Task> tasks = new ArrayList<>(); |
| | | List<Long> taskIds = taskDetlService.getTaskIdsByDetlId(orderDetlId); |
| | | if (!taskIds.isEmpty()) { |
| | | return this.list(new LambdaQueryWrapper<Task>().in(Task::getId, taskIds)); |
| | | } |
| | | return tasks; |
| | | } |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.wms.asrs.mapper.TaskDetlLogMapper"> |
| | | |
| | | <select id="getTaskIdsByDetlId" resultType="long"> |
| | | select distinct task_id from man_task_detl_log |
| | | where detl_id = #{detlId} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.zy.asrs.wms.asrs.mapper.TaskDetlMapper"> |
| | | |
| | | <select id="getTaskIdsByDetlId" resultType="long"> |
| | | select distinct task_id from man_task_detl |
| | | where detl_id = #{detlId} |
| | | </select> |
| | | |
| | | </mapper> |