| | |
| | | orderType$: '', |
| | | orderSettle$: '', |
| | | }); |
| | | |
| | | const showWidth = ref("60%") |
| | | getColumns(); |
| | | |
| | | const { |
| | |
| | | tableData, |
| | | orderId, |
| | | openDetl, |
| | | showWidth, |
| | | }) |
| | | |
| | | </script> |
| | |
| | | |
| | | <template> |
| | | <div> |
| | | <a-modal v-model:open="openDetl" width="60%" @ok="handleOk" @cancel="handleCancel"> |
| | | <a-modal v-model:open="openDetl" :width="showWidth" @ok="handleOk" @cancel="handleCancel"> |
| | | <div class="component-header"> |
| | | <div> |
| | | <h3> |
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 emit = defineEmits(['tableReload']) |
| | | |
| | | const open = ref(false); |
| | | const barcode = ref(null); |
| | | |
| | | const { |
| | | getColumnSearchProps, |
| | | } = useTableSearch(); |
| | | |
| | | const handleOk = () => { |
| | | open.value = false; |
| | | post('/api/rpc/generatePakIn', { |
| | | taskType: 1, |
| | | barcode: barcode.value, |
| | | originSite: "101" |
| | | }).then(resp => { |
| | | let result = resp.data; |
| | | if (result.code === 200) { |
| | | message.success(formatMessage('page.add.success', '生成成功')); |
| | | emit('tableReload', 'reload') |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const handleCancel = () => { |
| | | open.value = false; |
| | | } |
| | | |
| | | const waitPakinQueryList = ref(null); |
| | | waitPakinQueryListQuery(); |
| | | function waitPakinQueryListQuery() { |
| | | postForm('/api/waitPakin/barcode/query', {}).then(resp => { |
| | | let result = resp.data; |
| | | waitPakinQueryList.value = result.data; |
| | | }) |
| | | } |
| | | |
| | | defineExpose({ |
| | | open, |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'generateTaskComponent' |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <a-modal v-model:open="open" :title="formatMessage('task.generateTask', '生成任务')" @ok="handleOk" |
| | | @cancel="handleCancel"> |
| | | <a-select v-model:value="barcode" :placeholder="formatMessage('common.select', '请选择')" style="width: 100%" |
| | | show-search :options="waitPakinQueryList" optionFilterProp="label" optionLabelProp="label"> |
| | | </a-select> |
| | | </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'; |
| | | import ShowOrderDetlComponent from '@/components/orderDetl/show.vue'; |
| | | const context = getCurrentInstance()?.appContext.config.globalProperties; |
| | | |
| | | const router = useRouter(); |
| | | |
| | | const TABLE_KEY = 'table-locDetl'; |
| | | |
| | | let tableData = ref([]); |
| | | let open = ref(false); |
| | | const taskId = ref(null); |
| | | const taskInfo = ref({ |
| | | taskNo: '', |
| | | taskSts$: '', |
| | | taskType$: '', |
| | | }); |
| | | const showWidth = ref("60%") |
| | | |
| | | const showOrderDetlChild = ref(null) |
| | | getColumns(); |
| | | |
| | | const { |
| | | getColumnSearchProps, |
| | | } = useTableSearch(); |
| | | |
| | | const state = reactive({ |
| | | selectedRowKeys: [], |
| | | loading: false, |
| | | columns: [], |
| | | }); |
| | | |
| | | state.columns = [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '_id', |
| | | width: 60, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.task_no', '任务编号'), |
| | | dataIndex: 'taskNo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('taskNo'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.matnr', '物料号'), |
| | | dataIndex: ['mat$', 'matnr'], |
| | | width: 140, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.maktx', '物料名'), |
| | | dataIndex: ['mat$', 'maktx'], |
| | | width: 140, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.anfme', '数量'), |
| | | dataIndex: 'anfme', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('anfme'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.stock', '库存'), |
| | | dataIndex: 'stock', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('stock'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.batch', '批号'), |
| | | dataIndex: 'batch', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('batch'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.barcode', '托盘码'), |
| | | dataIndex: 'barcode', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('barcode'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.order_no', '订单编号'), |
| | | dataIndex: 'orderNo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('orderNo'), |
| | | }, |
| | | ]; |
| | | |
| | | const fieldList = []; |
| | | //加载扩展字段 |
| | | async function getColumns() { |
| | | let fieldResp = await post('/api/matField/list', { |
| | | fieldType: 1 |
| | | }) |
| | | let fieldResult = fieldResp.data; |
| | | let tmp = state.columns; |
| | | if (fieldResult.code == 200) { |
| | | let data = fieldResult.data; |
| | | |
| | | data.forEach((item) => { |
| | | tmp.push({ |
| | | title: formatMessage(item.language, item.describe), |
| | | name: item.name, |
| | | dataIndex: item.name, |
| | | key: item.name, |
| | | width: 140, |
| | | editable: true, |
| | | }) |
| | | |
| | | fieldList.push(item.name); |
| | | }) |
| | | |
| | | // tmp.push({ |
| | | // title: formatMessage('common.operation', '操作'), |
| | | // name: 'oper', |
| | | // dataIndex: 'oper', |
| | | // key: 'oper', |
| | | // width: 140, |
| | | // }) |
| | | |
| | | state.columns = tmp; |
| | | } else if (result.code === 401) { |
| | | message.error(result.msg); |
| | | logout() |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | } |
| | | |
| | | const handleOk = () => { |
| | | open.value = false; |
| | | } |
| | | |
| | | const handleCancel = () => { |
| | | open.value = false; |
| | | taskId.value = null; |
| | | } |
| | | |
| | | watch(taskId, (newVal, oldVal) => { |
| | | if (newVal != null) { |
| | | get("/api/taskDetl/taskId/" + newVal, {}).then((resp) => { |
| | | let result = resp.data; |
| | | let index = 1; |
| | | let tmp = []; |
| | | result.data.forEach((item) => { |
| | | item['_id'] = index++; |
| | | tmp.push(item) |
| | | }) |
| | | tableData.value = tmp; |
| | | }) |
| | | |
| | | get("/api/task/" + newVal, {}).then((resp) => { |
| | | let result = resp.data; |
| | | taskInfo.value = result.data; |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | const openOrderDetl = (record) => { |
| | | showOrderDetlChild.value.openDetl = true; |
| | | showOrderDetlChild.value.orderId = record.orderId; |
| | | showOrderDetlChild.value.showWidth = '55%' |
| | | } |
| | | |
| | | defineExpose({ |
| | | tableData, |
| | | taskId, |
| | | open, |
| | | showWidth, |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'showOrderDetlComponent' |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <a-modal v-model:open="open" :width="showWidth" @ok="handleOk" @cancel="handleCancel"> |
| | | <div class="component-header"> |
| | | <div> |
| | | <h3> |
| | | 任务编号:{{ taskInfo.taskNo }} |
| | | </h3> |
| | | <h3> |
| | | 任务状态:{{ taskInfo.taskSts$ }} |
| | | </h3> |
| | | <h3> |
| | | 任务类型:{{ taskInfo.taskType$ }} |
| | | </h3> |
| | | </div> |
| | | <div class="qrcode"> |
| | | <a-qrcode :value="taskInfo.taskNo" :size="100" :bordered="false" /> |
| | | </div> |
| | | </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 === 'orderNo'"> |
| | | <a-button type="link" @click="openOrderDetl(record)">{{ text }}</a-button> |
| | | </template> |
| | | </template> |
| | | </a-table> |
| | | </a-modal> |
| | | |
| | | <ShowOrderDetlComponent ref="showOrderDetlChild" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <style> |
| | | .component-header { |
| | | display: flex; |
| | | } |
| | | |
| | | .component-header>div { |
| | | flex: 1; |
| | | } |
| | | |
| | | .qrcode { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | margin-right: 30px; |
| | | } |
| | | </style> |
New file |
| | |
| | | <script setup> |
| | | import { ref, nextTick } from 'vue'; |
| | | import { get, post, postBlob, postForm } from '@/utils/request.js' |
| | | import { formatMessage } from '@/utils/localeUtils.js'; |
| | | import { message } from 'ant-design-vue'; |
| | | |
| | | const formTable = ref(null); |
| | | const submitButton = ref(null); |
| | | const isSave = ref(true); |
| | | const open = ref(false); |
| | | const initFormData = {} |
| | | let formData = ref(initFormData); |
| | | |
| | | const emit = defineEmits(['tableReload']) |
| | | |
| | | const handleOk = (e) => { |
| | | nextTick(() => { |
| | | setTimeout(() => { |
| | | submitButton.value.$el.click(); |
| | | }, 100); |
| | | }); |
| | | }; |
| | | |
| | | const onFinish = values => { |
| | | // console.log('Success:', values); |
| | | open.value = false; |
| | | post(isSave.value ? '/api/taskDetlField/save' : '/api/taskDetlField/update', formData.value).then((resp) => { |
| | | let result = resp.data; |
| | | if (result.code === 200) { |
| | | message.success(isSave.value ? formatMessage('page.add.success', '新增成功') : formatMessage('page.update.success', '更新成功')); |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | emit('tableReload', 'reload') |
| | | nextTick(() => { |
| | | formTable.value.resetFields() |
| | | }) |
| | | }) |
| | | }; |
| | | const onFinishFailed = errorInfo => { |
| | | console.log('Failed:', errorInfo); |
| | | }; |
| | | |
| | | const matFieldQueryList = ref(null); |
| | | matFieldQuery(); |
| | | function matFieldQuery() { |
| | | postForm('/api/matField/query', {}).then(resp => { |
| | | let result = resp.data; |
| | | matFieldQueryList.value = result.data; |
| | | }) |
| | | } |
| | | const taskDetlQueryList = ref(null); |
| | | taskDetlQuery(); |
| | | function taskDetlQuery() { |
| | | postForm('/api/taskDetl/query', {}).then(resp => { |
| | | let result = resp.data; |
| | | taskDetlQueryList.value = result.data; |
| | | }) |
| | | } |
| | | const userQueryList = ref(null); |
| | | userQuery(); |
| | | function userQuery() { |
| | | postForm('/api/user/query', {}).then(resp => { |
| | | let result = resp.data; |
| | | userQueryList.value = result.data; |
| | | }) |
| | | } |
| | | |
| | | |
| | | defineExpose({ |
| | | open, |
| | | formData, |
| | | initFormData, |
| | | isSave, |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | export default { |
| | | name: '任务明细扩展字段-edit' |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <a-modal v-model:open="open" |
| | | :title="isSave ? formatMessage('page.add', '添加') : formatMessage('page.edit', '编辑')" @ok="handleOk" |
| | | style="width: 600px;"> |
| | | <a-form :model="formData" ref="formTable" name="formTable" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" |
| | | style="display: flex;justify-content: space-between;flex-wrap: wrap;" autocomplete="off" |
| | | @finish="onFinish" @finishFailed="onFinishFailed"> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl_field.name', '字段名') " |
| | | name="name" |
| | | style="width: 250px;" |
| | | > |
| | | <a-input |
| | | v-model:value="formData.name" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl_field.field_id', '字段') " |
| | | name="fieldId" |
| | | style="width: 250px;" |
| | | > |
| | | <a-select |
| | | v-model:value="formData.fieldId" |
| | | :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" |
| | | show-search |
| | | :options="matFieldQueryList" |
| | | optionFilterProp="label" |
| | | optionLabelProp="label" |
| | | > |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl_field.detl_id', '任务明细') " |
| | | name="detlId" |
| | | style="width: 250px;" |
| | | > |
| | | <a-select |
| | | v-model:value="formData.detlId" |
| | | :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" |
| | | show-search |
| | | :options="taskDetlQueryList" |
| | | optionFilterProp="label" |
| | | optionLabelProp="label" |
| | | > |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl_field.value', '参数值') " |
| | | name="value" |
| | | style="width: 250px;" |
| | | > |
| | | <a-input |
| | | v-model:value="formData.value" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl_field.status', '状态') " |
| | | name="status" |
| | | style="width: 250px;" |
| | | > |
| | | <a-select |
| | | v-model:value="formData.status" |
| | | :options="[ |
| | | { label: '正常', value: 1 }, |
| | | { label: '禁用', value: 0 }, |
| | | ]" |
| | | > |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl_field.create_time', '添加时间') " |
| | | name="createTime" |
| | | style="width: 250px;" |
| | | > |
| | | <a-date-picker |
| | | v-model:value="formData.createTime" |
| | | show-time |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl_field.create_by', '添加人员') " |
| | | name="createBy" |
| | | style="width: 250px;" |
| | | > |
| | | <a-select |
| | | v-model:value="formData.createBy" |
| | | :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" |
| | | show-search |
| | | :options="userQueryList" |
| | | optionFilterProp="label" |
| | | optionLabelProp="label" |
| | | > |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl_field.update_time', '修改时间') " |
| | | name="updateTime" |
| | | style="width: 250px;" |
| | | > |
| | | <a-date-picker |
| | | v-model:value="formData.updateTime" |
| | | show-time |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl_field.update_by', '修改人员') " |
| | | name="updateBy" |
| | | style="width: 250px;" |
| | | > |
| | | <a-select |
| | | v-model:value="formData.updateBy" |
| | | :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" |
| | | show-search |
| | | :options="userQueryList" |
| | | optionFilterProp="label" |
| | | optionLabelProp="label" |
| | | > |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl_field.memo', '备注') " |
| | | name="memo" |
| | | style="width: 250px;" |
| | | > |
| | | <a-input |
| | | v-model:value="formData.memo" |
| | | /> |
| | | </a-form-item> |
| | | |
| | | <a-form-item> |
| | | <a-button type="primary" html-type="submit" ref="submitButton" |
| | | style="visibility: hidden;">Submit</a-button> |
| | | </a-form-item> |
| | | </a-form> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | | |
| | | <style></style> |
New file |
| | |
| | | <script setup> |
| | | import { getCurrentInstance, ref, computed, reactive } from 'vue'; |
| | | import { useRouter } from "vue-router"; |
| | | import { get, post, postBlob } from '@/utils/request.js' |
| | | import { message, Modal } from 'ant-design-vue'; |
| | | import { logout } from '@/config.js'; |
| | | import EditView from './edit.vue' |
| | | 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-taskDetlField'; |
| | | let currentPage = 1; |
| | | let pageSize = 10; |
| | | const searchInput = ref("") |
| | | const editChild = ref(null) |
| | | |
| | | let tableData = ref([]); |
| | | getPage(); |
| | | |
| | | const { |
| | | getColumnSearchProps, |
| | | handleResizeColumn, |
| | | } = useTableSearch(); |
| | | |
| | | const columns = [ |
| | | { |
| | | title: formatMessage('db.man_task_detl_field.name', '字段名'), |
| | | dataIndex: 'name', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('name'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl_field.field_id', '字段'), |
| | | dataIndex: 'fieldId$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('fieldId$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl_field.detl_id', '任务明细'), |
| | | dataIndex: 'detlId$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('detlId$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl_field.value', '参数值'), |
| | | dataIndex: 'value', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('value'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl_field.status', '状态'), |
| | | dataIndex: 'status$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('status$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl_field.create_time', '添加时间'), |
| | | dataIndex: 'createTime$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('createTime$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl_field.create_by', '添加人员'), |
| | | dataIndex: 'createBy$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('createBy$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl_field.update_time', '修改时间'), |
| | | dataIndex: 'updateTime$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('updateTime$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl_field.update_by', '修改人员'), |
| | | dataIndex: 'updateBy$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('updateBy$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl_field.memo', '备注'), |
| | | dataIndex: 'memo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('memo'), |
| | | }, |
| | | |
| | | { |
| | | title: formatMessage('common.operation', '操作'), |
| | | name: 'oper', |
| | | dataIndex: 'oper', |
| | | key: 'oper', |
| | | width: 140, |
| | | }, |
| | | ]; |
| | | |
| | | const state = reactive({ |
| | | selectedRowKeys: [], |
| | | loading: false, |
| | | }); |
| | | const hasSelected = computed(() => state.selectedRowKeys.length > 0); |
| | | const start = () => { |
| | | state.loading = true; |
| | | // ajax request after empty completing |
| | | setTimeout(() => { |
| | | state.loading = false; |
| | | state.selectedRowKeys = []; |
| | | }, 1000); |
| | | }; |
| | | const onSelectChange = selectedRowKeys => { |
| | | // console.log('selectedRowKeys changed: ', selectedRowKeys); |
| | | state.selectedRowKeys = selectedRowKeys; |
| | | }; |
| | | |
| | | function getPage() { |
| | | post('/api/taskDetlField/page', { |
| | | current: currentPage, |
| | | pageSize: pageSize, |
| | | condition: searchInput.value |
| | | }).then((resp) => { |
| | | let result = resp.data; |
| | | if (result.code == 200) { |
| | | let data = result.data; |
| | | tableData.value = data; |
| | | } else if (result.code === 401) { |
| | | message.error(result.msg); |
| | | logout() |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const handleEdit = (item) => { |
| | | editChild.value.open = true; |
| | | editChild.value.formData = item == null ? editChild.value.initFormData : JSON.parse(JSON.stringify(item)); |
| | | editChild.value.isSave = item == null; |
| | | } |
| | | |
| | | const handleDel = (rows) => { |
| | | Modal.confirm({ |
| | | title: formatMessage('page.delete', '删除'), |
| | | content: formatMessage('page.delete.confirm', '确定删除该项吗?'), |
| | | maskClosable: true, |
| | | onOk: async () => { |
| | | const hide = message.loading(formatMessage('common.loading', '请求中')); |
| | | try { |
| | | post('/api/taskDetlField/remove/' + rows.map((row) => row.id).join(','), {}).then(resp => { |
| | | let result = resp.data; |
| | | if (result.code === 200) { |
| | | message.success(result.msg); |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | getPage() |
| | | hide() |
| | | }) |
| | | } catch (error) { |
| | | message.error(formatMessage('common.fail', '请求失败')); |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | const handleExport = async (intl) => { |
| | | postBlob('/api/taskDetlField/export', {}).then(result => { |
| | | const blob = new Blob([result.data], { type: 'application/vnd.ms-excel' }); |
| | | window.location.href = window.URL.createObjectURL(blob); |
| | | return true; |
| | | }) |
| | | }; |
| | | |
| | | const onSearch = () => { |
| | | // console.log('search'); |
| | | getPage() |
| | | } |
| | | |
| | | const onPageChange = (page, size) => { |
| | | currentPage = page; |
| | | pageSize = size; |
| | | getPage(); |
| | | } |
| | | |
| | | function handleTableReload(value) { |
| | | getPage() |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | export default { |
| | | name: '任务明细扩展字段' |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <EditView ref="editChild" @tableReload="handleTableReload" /> |
| | | <div class="table-header"> |
| | | <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '请输入')" |
| | | style="width: 200px;" @search="onSearch" /> |
| | | <div class="table-header-right"> |
| | | <a-button @click="handleEdit(null)" type="primary">{{ formatMessage('page.add', '添加') }}</a-button> |
| | | <a-button @click="handleExport">{{ formatMessage('page.export', '导出') }}</a-button> |
| | | </div> |
| | | </div> |
| | | <a-table :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }" |
| | | :data-source="tableData.records" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id" |
| | | :pagination="{ total: tableData.total, onChange: onPageChange }" |
| | | :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns" @resizeColumn="handleResizeColumn"> |
| | | <template #bodyCell="{ column, text, record }"> |
| | | <template v-if="column.dataIndex === 'oper'"> |
| | | <div style="display: flex;justify-content: space-evenly;"> |
| | | <a-button type="link" primary @click="handleEdit(record)">{{ formatMessage('page.edit', '编辑') }}</a-button> |
| | | <a-button type="link" danger @click="handleDel([record])">{{ formatMessage('page.delete', '删除') |
| | | }}</a-button> |
| | | </div> |
| | | </template> |
| | | </template> |
| | | </a-table> |
| | | </div> |
| | | </template> |
| | | |
| | | <style></style> |
| | |
| | | |
| | | <script> |
| | | export default { |
| | | name: '库位-edit' |
| | | name: '库位管理-edit' |
| | | } |
| | | </script> |
| | | |
| | |
| | | |
| | | <script> |
| | | export default { |
| | | name: '库位' |
| | | name: '库位管理' |
| | | } |
| | | </script> |
| | | |
| | |
| | | import EditView from './edit.vue' |
| | | import { formatMessage } from '@/utils/localeUtils.js'; |
| | | import useTableSearch from '@/utils/tableUtils.jsx'; |
| | | import GenerateTaskView from '@/components/task/generateTask/index.vue'; |
| | | const context = getCurrentInstance()?.appContext.config.globalProperties; |
| | | |
| | | const router = useRouter(); |
| | |
| | | let pageSize = 10; |
| | | const searchInput = ref("") |
| | | const editChild = ref(null) |
| | | const generateTaskChild = ref(null) |
| | | |
| | | let tableData = ref([]); |
| | | getPage(); |
| | |
| | | } = useTableSearch(); |
| | | |
| | | const columns = [ |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.order_id', '订单ID'), |
| | | dataIndex: 'orderId$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('orderId$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.order_no', '订单编号'), |
| | | dataIndex: 'orderNo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('orderNo'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.barcode', '托盘码'), |
| | | dataIndex: 'barcode', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('barcode'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.matnr', '物料号'), |
| | | dataIndex: ['detl$','mat$','matnr'], |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('detl$.matnr'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.batch', '批号'), |
| | | dataIndex: ['detl$','batch'], |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('detl$.matnr'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.anfme', '组托数量'), |
| | | dataIndex: 'anfme', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('anfme'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.io_status', '组托状态'), |
| | | dataIndex: 'ioStatus$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('ioStatus$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.status', '状态'), |
| | | dataIndex: 'status$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('status$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.create_time', '添加时间'), |
| | | dataIndex: 'createTime$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('createTime$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.create_by', '添加人员'), |
| | | dataIndex: 'createBy$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('createBy$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.update_time', '修改时间'), |
| | | dataIndex: 'updateTime$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('updateTime$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.update_by', '修改人员'), |
| | | dataIndex: 'updateBy$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('updateBy$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.memo', '备注'), |
| | | dataIndex: 'memo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('memo'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.order_id', '订单ID'), |
| | | dataIndex: 'orderId$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('orderId$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.order_no', '订单编号'), |
| | | dataIndex: 'orderNo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('orderNo'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.barcode', '托盘码'), |
| | | dataIndex: 'barcode', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('barcode'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.matnr', '物料号'), |
| | | dataIndex: ['detl$', 'mat$', 'matnr'], |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('detl$.matnr'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.batch', '批号'), |
| | | dataIndex: ['detl$', 'batch'], |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('detl$.matnr'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.anfme', '组托数量'), |
| | | dataIndex: 'anfme', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('anfme'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.io_status', '组托状态'), |
| | | dataIndex: 'ioStatus$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('ioStatus$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.status', '状态'), |
| | | dataIndex: 'status$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('status$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.create_time', '添加时间'), |
| | | dataIndex: 'createTime$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('createTime$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.create_by', '添加人员'), |
| | | dataIndex: 'createBy$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('createBy$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.update_time', '修改时间'), |
| | | dataIndex: 'updateTime$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('updateTime$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.update_by', '修改人员'), |
| | | dataIndex: 'updateBy$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('updateBy$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wait_pakin.memo', '备注'), |
| | | dataIndex: 'memo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('memo'), |
| | | }, |
| | | |
| | | { |
| | | title: formatMessage('common.operation', '操作'), |
| | |
| | | getPage() |
| | | } |
| | | |
| | | const generateTask = () => { |
| | | generateTaskChild.value.open = true; |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | |
| | | <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '请输入')" |
| | | style="width: 200px;" @search="onSearch" /> |
| | | <div class="table-header-right"> |
| | | <a-button @click="generateTask()" type="primary">{{ formatMessage('page.generateTask', '生成任务') }}</a-button> |
| | | <a-button @click="handleEdit(null)" type="primary">{{ formatMessage('page.add', '添加') }}</a-button> |
| | | <a-button @click="handleExport">{{ formatMessage('page.export', '导出') }}</a-button> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <template v-if="column.dataIndex === 'ioStatus$'"> |
| | | <a-switch :checked="record.ioStatus == 1" :checked-children="formatMessage('waitPakin.switch.open','入库中')" :un-checked-children="formatMessage('waitPakin.switch.close','待入库')" :disabled="true" /> |
| | | <a-switch :checked="record.ioStatus == 1" :checked-children="formatMessage('waitPakin.switch.open', '入库中')" |
| | | :un-checked-children="formatMessage('waitPakin.switch.close', '待入库')" :disabled="true" /> |
| | | </template> |
| | | |
| | | </template> |
| | | </a-table> |
| | | </div> |
| | | |
| | | <GenerateTaskView ref="generateTaskChild" @tableReload="handleTableReload" /> |
| | | </template> |
| | | |
| | | <style></style> |
New file |
| | |
| | | <script setup> |
| | | import { ref, nextTick } from 'vue'; |
| | | import { get, post, postBlob, postForm } from '@/utils/request.js' |
| | | import { formatMessage } from '@/utils/localeUtils.js'; |
| | | import { message } from 'ant-design-vue'; |
| | | |
| | | const formTable = ref(null); |
| | | const submitButton = ref(null); |
| | | const isSave = ref(true); |
| | | const open = ref(false); |
| | | const initFormData = {} |
| | | let formData = ref(initFormData); |
| | | |
| | | const emit = defineEmits(['tableReload']) |
| | | |
| | | const handleOk = (e) => { |
| | | nextTick(() => { |
| | | setTimeout(() => { |
| | | submitButton.value.$el.click(); |
| | | }, 100); |
| | | }); |
| | | }; |
| | | |
| | | const onFinish = values => { |
| | | // console.log('Success:', values); |
| | | open.value = false; |
| | | post(isSave.value ? '/api/task/save' : '/api/task/update', formData.value).then((resp) => { |
| | | let result = resp.data; |
| | | if (result.code === 200) { |
| | | message.success(isSave.value ? formatMessage('page.add.success', '新增成功') : formatMessage('page.update.success', '更新成功')); |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | emit('tableReload', 'reload') |
| | | nextTick(() => { |
| | | formTable.value.resetFields() |
| | | }) |
| | | }) |
| | | }; |
| | | const onFinishFailed = errorInfo => { |
| | | console.log('Failed:', errorInfo); |
| | | }; |
| | | |
| | | const taskStsQueryList = ref(null); |
| | | taskStsQuery(); |
| | | function taskStsQuery() { |
| | | postForm('/api/taskSts/query', {}).then(resp => { |
| | | let result = resp.data; |
| | | taskStsQueryList.value = result.data; |
| | | }) |
| | | } |
| | | const taskTypeQueryList = ref(null); |
| | | taskTypeQuery(); |
| | | function taskTypeQuery() { |
| | | postForm('/api/taskType/query', {}).then(resp => { |
| | | let result = resp.data; |
| | | taskTypeQueryList.value = result.data; |
| | | }) |
| | | } |
| | | const userQueryList = ref(null); |
| | | userQuery(); |
| | | function userQuery() { |
| | | postForm('/api/user/query', {}).then(resp => { |
| | | let result = resp.data; |
| | | userQueryList.value = result.data; |
| | | }) |
| | | } |
| | | |
| | | |
| | | defineExpose({ |
| | | open, |
| | | formData, |
| | | initFormData, |
| | | isSave, |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | export default { |
| | | name: '任务管理-edit' |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <a-modal v-model:open="open" |
| | | :title="isSave ? formatMessage('page.add', '添加') : formatMessage('page.edit', '编辑')" @ok="handleOk" |
| | | style="width: 600px;"> |
| | | <a-form :model="formData" ref="formTable" name="formTable" :label-col="{ span: 8 }" |
| | | :wrapper-col="{ span: 16 }" style="display: flex;justify-content: space-between;flex-wrap: wrap;" |
| | | autocomplete="off" @finish="onFinish" @finishFailed="onFinishFailed"> |
| | | <a-form-item :label="formatMessage('db.man_task.task_no', '任务编号')" name="taskNo" style="width: 250px;"> |
| | | <a-input v-model:value="formData.taskNo" /> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_task.task_sts', '任务状态')" name="taskSts" |
| | | style="width: 250px;"> |
| | | <a-select v-model:value="formData.taskSts" :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" show-search :options="taskStsQueryList" optionFilterProp="label" |
| | | optionLabelProp="label"> |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_task.task_type', '任务类型')" name="taskType" |
| | | style="width: 250px;"> |
| | | <a-select v-model:value="formData.taskType" :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" show-search :options="taskTypeQueryList" optionFilterProp="label" |
| | | optionLabelProp="label"> |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_task.io_pri', '优先级')" name="ioPri" style="width: 250px;"> |
| | | <a-input v-model:value="formData.ioPri" /> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_task.origin_loc', '源库位')" name="originLoc" |
| | | style="width: 250px;"> |
| | | <a-input v-model:value="formData.originLoc" /> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_task.target_loc', '目标库位')" name="targetLoc" |
| | | style="width: 250px;"> |
| | | <a-input v-model:value="formData.targetLoc" /> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_task.origin_site', '源站点')" name="originSite" |
| | | style="width: 250px;"> |
| | | <a-input v-model:value="formData.originSite" /> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_task.target_site', '目标站点')" name="targetSite" |
| | | style="width: 250px;"> |
| | | <a-input v-model:value="formData.targetSite" /> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_task.barcode', '托盘码')" name="barcode" style="width: 250px;"> |
| | | <a-input v-model:value="formData.barcode" /> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_task.status', '状态')" name="status" style="width: 250px;"> |
| | | <a-select v-model:value="formData.status" :options="[ |
| | | { label: '正常', value: 1 }, |
| | | { label: '禁用', value: 0 }, |
| | | ]"> |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_task.create_time', '添加时间')" name="createTime" |
| | | style="width: 250px;"> |
| | | <a-date-picker v-model:value="formData.createTime" show-time format="YYYY-MM-DD HH:mm:ss" |
| | | value-format="YYYY-MM-DD HH:mm:ss" /> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_task.create_by', '添加人员')" name="createBy" |
| | | style="width: 250px;"> |
| | | <a-select v-model:value="formData.createBy" :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" show-search :options="userQueryList" optionFilterProp="label" |
| | | optionLabelProp="label"> |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_task.update_time', '修改时间')" name="updateTime" |
| | | style="width: 250px;"> |
| | | <a-date-picker v-model:value="formData.updateTime" show-time format="YYYY-MM-DD HH:mm:ss" |
| | | value-format="YYYY-MM-DD HH:mm:ss" /> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_task.update_by', '修改人员')" name="updateBy" |
| | | style="width: 250px;"> |
| | | <a-select v-model:value="formData.updateBy" :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" show-search :options="userQueryList" optionFilterProp="label" |
| | | optionLabelProp="label"> |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item :label="formatMessage('db.man_task.memo', '备注')" name="memo" style="width: 250px;"> |
| | | <a-input v-model:value="formData.memo" /> |
| | | </a-form-item> |
| | | |
| | | <a-form-item> |
| | | <a-button type="primary" html-type="submit" ref="submitButton" |
| | | style="visibility: hidden;">Submit</a-button> |
| | | </a-form-item> |
| | | </a-form> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | | |
| | | <style></style> |
New file |
| | |
| | | <script setup> |
| | | import { getCurrentInstance, ref, computed, reactive } from 'vue'; |
| | | import { useRouter } from "vue-router"; |
| | | import { get, post, postBlob } from '@/utils/request.js' |
| | | import { message, Modal } from 'ant-design-vue'; |
| | | import { logout } from '@/config.js'; |
| | | import EditView from './edit.vue' |
| | | import { formatMessage } from '@/utils/localeUtils.js'; |
| | | import useTableSearch from '@/utils/tableUtils.jsx'; |
| | | import ShowTaskDetlComponent from '@/components/task/showTaskDetl/index.vue'; |
| | | const context = getCurrentInstance()?.appContext.config.globalProperties; |
| | | |
| | | const router = useRouter(); |
| | | |
| | | const TABLE_KEY = 'table-task'; |
| | | let currentPage = 1; |
| | | let pageSize = 10; |
| | | const searchInput = ref("") |
| | | const editChild = ref(null) |
| | | const showTaskDetlChild = ref(null) |
| | | |
| | | let tableData = ref([]); |
| | | getPage(); |
| | | |
| | | const { |
| | | getColumnSearchProps, |
| | | handleResizeColumn, |
| | | } = useTableSearch(); |
| | | |
| | | const 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'), |
| | | }, |
| | | { |
| | | title: formatMessage('common.operation', '操作'), |
| | | name: 'oper', |
| | | dataIndex: 'oper', |
| | | key: 'oper', |
| | | fixed: 'right', |
| | | width: 240, |
| | | }, |
| | | ]; |
| | | |
| | | const state = reactive({ |
| | | selectedRowKeys: [], |
| | | loading: false, |
| | | }); |
| | | const hasSelected = computed(() => state.selectedRowKeys.length > 0); |
| | | const start = () => { |
| | | state.loading = true; |
| | | // ajax request after empty completing |
| | | setTimeout(() => { |
| | | state.loading = false; |
| | | state.selectedRowKeys = []; |
| | | }, 1000); |
| | | }; |
| | | const onSelectChange = selectedRowKeys => { |
| | | // console.log('selectedRowKeys changed: ', selectedRowKeys); |
| | | state.selectedRowKeys = selectedRowKeys; |
| | | }; |
| | | |
| | | function getPage() { |
| | | post('/api/task/page', { |
| | | current: currentPage, |
| | | pageSize: pageSize, |
| | | condition: searchInput.value |
| | | }).then((resp) => { |
| | | let result = resp.data; |
| | | if (result.code == 200) { |
| | | let data = result.data; |
| | | tableData.value = data; |
| | | } else if (result.code === 401) { |
| | | message.error(result.msg); |
| | | logout() |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const handleEdit = (item) => { |
| | | editChild.value.open = true; |
| | | editChild.value.formData = item == null ? editChild.value.initFormData : JSON.parse(JSON.stringify(item)); |
| | | editChild.value.isSave = item == null; |
| | | } |
| | | |
| | | const handleDel = (rows) => { |
| | | Modal.confirm({ |
| | | title: formatMessage('page.delete', '删除'), |
| | | content: formatMessage('page.delete.confirm', '确定删除该项吗?'), |
| | | maskClosable: true, |
| | | onOk: async () => { |
| | | const hide = message.loading(formatMessage('common.loading', '请求中')); |
| | | try { |
| | | post('/api/task/remove/' + rows.map((row) => row.id).join(','), {}).then(resp => { |
| | | let result = resp.data; |
| | | if (result.code === 200) { |
| | | message.success(result.msg); |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | getPage() |
| | | hide() |
| | | }) |
| | | } catch (error) { |
| | | message.error(formatMessage('common.fail', '请求失败')); |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | const handleExport = async (intl) => { |
| | | postBlob('/api/task/export', {}).then(result => { |
| | | const blob = new Blob([result.data], { type: 'application/vnd.ms-excel' }); |
| | | window.location.href = window.URL.createObjectURL(blob); |
| | | return true; |
| | | }) |
| | | }; |
| | | |
| | | const onSearch = () => { |
| | | // console.log('search'); |
| | | getPage() |
| | | } |
| | | |
| | | const onPageChange = (page, size) => { |
| | | currentPage = page; |
| | | pageSize = size; |
| | | getPage(); |
| | | } |
| | | |
| | | function handleTableReload(value) { |
| | | getPage() |
| | | } |
| | | |
| | | const showDetl = (record) => { |
| | | showTaskDetlChild.value.open = true; |
| | | showTaskDetlChild.value.taskId = record.id; |
| | | } |
| | | |
| | | const handleComplete = (record) => { |
| | | Modal.confirm({ |
| | | title: formatMessage('page.complete', '完成'), |
| | | content: formatMessage('page.complete.confirm', '确定完成该项吗?'), |
| | | maskClosable: true, |
| | | onOk: async () => { |
| | | const hide = message.loading(formatMessage('common.loading', '请求中')); |
| | | try { |
| | | post('/api/task/complete', record).then(resp => { |
| | | let result = resp.data; |
| | | if (result.code === 200) { |
| | | message.success(result.msg); |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | getPage() |
| | | hide() |
| | | }) |
| | | } catch (error) { |
| | | message.error(formatMessage('common.fail', '请求失败')); |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | const handleCancel = (record) => { |
| | | Modal.confirm({ |
| | | title: formatMessage('page.cancel', '取消'), |
| | | content: formatMessage('page.cancel.confirm', '确定取消该项吗?'), |
| | | maskClosable: true, |
| | | onOk: async () => { |
| | | const hide = message.loading(formatMessage('common.loading', '请求中')); |
| | | try { |
| | | post('/api/task/cancel', record).then(resp => { |
| | | let result = resp.data; |
| | | if (result.code === 200) { |
| | | message.success(result.msg); |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | getPage() |
| | | hide() |
| | | }) |
| | | } catch (error) { |
| | | message.error(formatMessage('common.fail', '请求失败')); |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | export default { |
| | | name: '任务管理' |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <EditView ref="editChild" @tableReload="handleTableReload" /> |
| | | <div class="table-header"> |
| | | <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '请输入')" |
| | | style="width: 200px;" @search="onSearch" /> |
| | | <div class="table-header-right"> |
| | | <a-button @click="handleEdit(null)" type="primary">{{ formatMessage('page.add', '添加') }}</a-button> |
| | | <a-button @click="handleExport">{{ formatMessage('page.export', '导出') }}</a-button> |
| | | </div> |
| | | </div> |
| | | <a-table :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }" |
| | | :data-source="tableData.records" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id" |
| | | :pagination="{ total: tableData.total, onChange: onPageChange }" |
| | | :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns" @resizeColumn="handleResizeColumn"> |
| | | <template #bodyCell="{ column, text, record }"> |
| | | <template v-if="column.dataIndex === 'oper'"> |
| | | <div style="display: flex;justify-content: space-evenly;"> |
| | | <a-button type="link" primary @click="showDetl(record)">{{ formatMessage('page.task.orderDetl', '任务明细') |
| | | }}</a-button> |
| | | <a-button type="link" primary @click="handleComplete(record)">{{ formatMessage('page.complete', '完成') }}</a-button> |
| | | <a-button type="link" danger @click="handleCancel(record)">{{ formatMessage('page.cancel', '取消') |
| | | }}</a-button> |
| | | </div> |
| | | </template> |
| | | </template> |
| | | </a-table> |
| | | |
| | | <ShowTaskDetlComponent ref="showTaskDetlChild" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <style></style> |
New file |
| | |
| | | <script setup> |
| | | import { ref, nextTick } from 'vue'; |
| | | import { get, post, postBlob, postForm } from '@/utils/request.js' |
| | | import { formatMessage } from '@/utils/localeUtils.js'; |
| | | import { message } from 'ant-design-vue'; |
| | | |
| | | const formTable = ref(null); |
| | | const submitButton = ref(null); |
| | | const isSave = ref(true); |
| | | const open = ref(false); |
| | | const initFormData = {} |
| | | let formData = ref(initFormData); |
| | | |
| | | const emit = defineEmits(['tableReload']) |
| | | |
| | | const handleOk = (e) => { |
| | | nextTick(() => { |
| | | setTimeout(() => { |
| | | submitButton.value.$el.click(); |
| | | }, 100); |
| | | }); |
| | | }; |
| | | |
| | | const onFinish = values => { |
| | | // console.log('Success:', values); |
| | | open.value = false; |
| | | post(isSave.value ? '/api/taskDetl/save' : '/api/taskDetl/update', formData.value).then((resp) => { |
| | | let result = resp.data; |
| | | if (result.code === 200) { |
| | | message.success(isSave.value ? formatMessage('page.add.success', '新增成功') : formatMessage('page.update.success', '更新成功')); |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | emit('tableReload', 'reload') |
| | | nextTick(() => { |
| | | formTable.value.resetFields() |
| | | }) |
| | | }) |
| | | }; |
| | | const onFinishFailed = errorInfo => { |
| | | console.log('Failed:', errorInfo); |
| | | }; |
| | | |
| | | const taskQueryList = ref(null); |
| | | taskQuery(); |
| | | function taskQuery() { |
| | | postForm('/api/task/query', {}).then(resp => { |
| | | let result = resp.data; |
| | | taskQueryList.value = result.data; |
| | | }) |
| | | } |
| | | const orderQueryList = ref(null); |
| | | orderQuery(); |
| | | function orderQuery() { |
| | | postForm('/api/order/query', {}).then(resp => { |
| | | let result = resp.data; |
| | | orderQueryList.value = result.data; |
| | | }) |
| | | } |
| | | const orderDetlQueryList = ref(null); |
| | | orderDetlQuery(); |
| | | function orderDetlQuery() { |
| | | postForm('/api/orderDetl/query', {}).then(resp => { |
| | | let result = resp.data; |
| | | orderDetlQueryList.value = result.data; |
| | | }) |
| | | } |
| | | const matQueryList = ref(null); |
| | | matQuery(); |
| | | function matQuery() { |
| | | postForm('/api/mat/query', {}).then(resp => { |
| | | let result = resp.data; |
| | | matQueryList.value = result.data; |
| | | }) |
| | | } |
| | | const userQueryList = ref(null); |
| | | userQuery(); |
| | | function userQuery() { |
| | | postForm('/api/user/query', {}).then(resp => { |
| | | let result = resp.data; |
| | | userQueryList.value = result.data; |
| | | }) |
| | | } |
| | | |
| | | |
| | | defineExpose({ |
| | | open, |
| | | formData, |
| | | initFormData, |
| | | isSave, |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | export default { |
| | | name: '任务明细-edit' |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <a-modal v-model:open="open" |
| | | :title="isSave ? formatMessage('page.add', '添加') : formatMessage('page.edit', '编辑')" @ok="handleOk" |
| | | style="width: 600px;"> |
| | | <a-form :model="formData" ref="formTable" name="formTable" :label-col="{ span: 8 }" :wrapper-col="{ span: 16 }" |
| | | style="display: flex;justify-content: space-between;flex-wrap: wrap;" autocomplete="off" |
| | | @finish="onFinish" @finishFailed="onFinishFailed"> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl.task_id', '任务ID') " |
| | | name="taskId" |
| | | style="width: 250px;" |
| | | > |
| | | <a-select |
| | | v-model:value="formData.taskId" |
| | | :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" |
| | | show-search |
| | | :options="taskQueryList" |
| | | optionFilterProp="label" |
| | | optionLabelProp="label" |
| | | > |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl.task_no', '任务编号') " |
| | | name="taskNo" |
| | | style="width: 250px;" |
| | | > |
| | | <a-input |
| | | v-model:value="formData.taskNo" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl.anfme', '数量') " |
| | | name="anfme" |
| | | style="width: 250px;" |
| | | > |
| | | <a-input |
| | | v-model:value="formData.anfme" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl.batch', '批号') " |
| | | name="batch" |
| | | style="width: 250px;" |
| | | > |
| | | <a-input |
| | | v-model:value="formData.batch" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl.barcode', '托盘码') " |
| | | name="barcode" |
| | | style="width: 250px;" |
| | | > |
| | | <a-input |
| | | v-model:value="formData.barcode" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl.order_id', '订单ID') " |
| | | name="orderId" |
| | | style="width: 250px;" |
| | | > |
| | | <a-select |
| | | v-model:value="formData.orderId" |
| | | :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" |
| | | show-search |
| | | :options="orderQueryList" |
| | | optionFilterProp="label" |
| | | optionLabelProp="label" |
| | | > |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl.order_no', '订单编号') " |
| | | name="orderNo" |
| | | style="width: 250px;" |
| | | > |
| | | <a-input |
| | | v-model:value="formData.orderNo" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl.detl_id', '明细ID') " |
| | | name="detlId" |
| | | style="width: 250px;" |
| | | > |
| | | <a-select |
| | | v-model:value="formData.detlId" |
| | | :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" |
| | | show-search |
| | | :options="orderDetlQueryList" |
| | | optionFilterProp="label" |
| | | optionLabelProp="label" |
| | | > |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl.mat_id', '物料ID') " |
| | | name="matId" |
| | | style="width: 250px;" |
| | | > |
| | | <a-select |
| | | v-model:value="formData.matId" |
| | | :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" |
| | | show-search |
| | | :options="matQueryList" |
| | | optionFilterProp="label" |
| | | optionLabelProp="label" |
| | | > |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl.status', '状态') " |
| | | name="status" |
| | | style="width: 250px;" |
| | | > |
| | | <a-select |
| | | v-model:value="formData.status" |
| | | :options="[ |
| | | { label: '正常', value: 1 }, |
| | | { label: '禁用', value: 0 }, |
| | | ]" |
| | | > |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl.create_time', '添加时间') " |
| | | name="createTime" |
| | | style="width: 250px;" |
| | | > |
| | | <a-date-picker |
| | | v-model:value="formData.createTime" |
| | | show-time |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl.create_by', '添加人员') " |
| | | name="createBy" |
| | | style="width: 250px;" |
| | | > |
| | | <a-select |
| | | v-model:value="formData.createBy" |
| | | :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" |
| | | show-search |
| | | :options="userQueryList" |
| | | optionFilterProp="label" |
| | | optionLabelProp="label" |
| | | > |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl.update_time', '修改时间') " |
| | | name="updateTime" |
| | | style="width: 250px;" |
| | | > |
| | | <a-date-picker |
| | | v-model:value="formData.updateTime" |
| | | show-time |
| | | format="YYYY-MM-DD HH:mm:ss" |
| | | value-format="YYYY-MM-DD HH:mm:ss" |
| | | /> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl.update_by', '修改人员') " |
| | | name="updateBy" |
| | | style="width: 250px;" |
| | | > |
| | | <a-select |
| | | v-model:value="formData.updateBy" |
| | | :placeholder="formatMessage('common.select', '请选择')" |
| | | style="width: 100%" |
| | | show-search |
| | | :options="userQueryList" |
| | | optionFilterProp="label" |
| | | optionLabelProp="label" |
| | | > |
| | | </a-select> |
| | | </a-form-item> |
| | | <a-form-item |
| | | :label="formatMessage('db.man_task_detl.memo', '备注') " |
| | | name="memo" |
| | | style="width: 250px;" |
| | | > |
| | | <a-input |
| | | v-model:value="formData.memo" |
| | | /> |
| | | </a-form-item> |
| | | |
| | | <a-form-item> |
| | | <a-button type="primary" html-type="submit" ref="submitButton" |
| | | style="visibility: hidden;">Submit</a-button> |
| | | </a-form-item> |
| | | </a-form> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | | |
| | | <style></style> |
New file |
| | |
| | | <script setup> |
| | | import { getCurrentInstance, ref, computed, reactive } from 'vue'; |
| | | import { useRouter } from "vue-router"; |
| | | import { get, post, postBlob } from '@/utils/request.js' |
| | | import { message, Modal } from 'ant-design-vue'; |
| | | import { logout } from '@/config.js'; |
| | | import EditView from './edit.vue' |
| | | 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-taskDetl'; |
| | | let currentPage = 1; |
| | | let pageSize = 10; |
| | | const searchInput = ref("") |
| | | const editChild = ref(null) |
| | | |
| | | let tableData = ref([]); |
| | | getPage(); |
| | | |
| | | const { |
| | | getColumnSearchProps, |
| | | handleResizeColumn, |
| | | } = useTableSearch(); |
| | | |
| | | const columns = [ |
| | | { |
| | | title: formatMessage('db.man_task_detl.task_id', '任务ID'), |
| | | dataIndex: 'taskId$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('taskId$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.task_no', '任务编号'), |
| | | dataIndex: 'taskNo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('taskNo'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.anfme', '数量'), |
| | | dataIndex: 'anfme', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('anfme'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.stock', '库存'), |
| | | dataIndex: 'stock', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('stock'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.batch', '批号'), |
| | | dataIndex: 'batch', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('batch'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.barcode', '托盘码'), |
| | | dataIndex: 'barcode', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('barcode'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.order_id', '订单ID'), |
| | | dataIndex: 'orderId$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('orderId$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.order_no', '订单编号'), |
| | | dataIndex: 'orderNo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('orderNo'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.detl_id', '明细ID'), |
| | | dataIndex: 'detlId$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('detlId$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.mat_id', '物料ID'), |
| | | dataIndex: 'matId$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('matId$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.status', '状态'), |
| | | dataIndex: 'status$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('status$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.create_time', '添加时间'), |
| | | dataIndex: 'createTime$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('createTime$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.create_by', '添加人员'), |
| | | dataIndex: 'createBy$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('createBy$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.update_time', '修改时间'), |
| | | dataIndex: 'updateTime$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('updateTime$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.update_by', '修改人员'), |
| | | dataIndex: 'updateBy$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('updateBy$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_task_detl.memo', '备注'), |
| | | dataIndex: 'memo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('memo'), |
| | | }, |
| | | |
| | | { |
| | | title: formatMessage('common.operation', '操作'), |
| | | name: 'oper', |
| | | dataIndex: 'oper', |
| | | key: 'oper', |
| | | width: 140, |
| | | }, |
| | | ]; |
| | | |
| | | const state = reactive({ |
| | | selectedRowKeys: [], |
| | | loading: false, |
| | | }); |
| | | const hasSelected = computed(() => state.selectedRowKeys.length > 0); |
| | | const start = () => { |
| | | state.loading = true; |
| | | // ajax request after empty completing |
| | | setTimeout(() => { |
| | | state.loading = false; |
| | | state.selectedRowKeys = []; |
| | | }, 1000); |
| | | }; |
| | | const onSelectChange = selectedRowKeys => { |
| | | // console.log('selectedRowKeys changed: ', selectedRowKeys); |
| | | state.selectedRowKeys = selectedRowKeys; |
| | | }; |
| | | |
| | | function getPage() { |
| | | post('/api/taskDetl/page', { |
| | | current: currentPage, |
| | | pageSize: pageSize, |
| | | condition: searchInput.value |
| | | }).then((resp) => { |
| | | let result = resp.data; |
| | | if (result.code == 200) { |
| | | let data = result.data; |
| | | tableData.value = data; |
| | | } else if (result.code === 401) { |
| | | message.error(result.msg); |
| | | logout() |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | }) |
| | | } |
| | | |
| | | const handleEdit = (item) => { |
| | | editChild.value.open = true; |
| | | editChild.value.formData = item == null ? editChild.value.initFormData : JSON.parse(JSON.stringify(item)); |
| | | editChild.value.isSave = item == null; |
| | | } |
| | | |
| | | const handleDel = (rows) => { |
| | | Modal.confirm({ |
| | | title: formatMessage('page.delete', '删除'), |
| | | content: formatMessage('page.delete.confirm', '确定删除该项吗?'), |
| | | maskClosable: true, |
| | | onOk: async () => { |
| | | const hide = message.loading(formatMessage('common.loading', '请求中')); |
| | | try { |
| | | post('/api/taskDetl/remove/' + rows.map((row) => row.id).join(','), {}).then(resp => { |
| | | let result = resp.data; |
| | | if (result.code === 200) { |
| | | message.success(result.msg); |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | getPage() |
| | | hide() |
| | | }) |
| | | } catch (error) { |
| | | message.error(formatMessage('common.fail', '请求失败')); |
| | | } |
| | | }, |
| | | }); |
| | | } |
| | | |
| | | const handleExport = async (intl) => { |
| | | postBlob('/api/taskDetl/export', {}).then(result => { |
| | | const blob = new Blob([result.data], { type: 'application/vnd.ms-excel' }); |
| | | window.location.href = window.URL.createObjectURL(blob); |
| | | return true; |
| | | }) |
| | | }; |
| | | |
| | | const onSearch = () => { |
| | | // console.log('search'); |
| | | getPage() |
| | | } |
| | | |
| | | const onPageChange = (page, size) => { |
| | | currentPage = page; |
| | | pageSize = size; |
| | | getPage(); |
| | | } |
| | | |
| | | function handleTableReload(value) { |
| | | getPage() |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | export default { |
| | | name: '任务明细' |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <EditView ref="editChild" @tableReload="handleTableReload" /> |
| | | <div class="table-header"> |
| | | <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '请输入')" |
| | | style="width: 200px;" @search="onSearch" /> |
| | | <div class="table-header-right"> |
| | | <a-button @click="handleEdit(null)" type="primary">{{ formatMessage('page.add', '添加') }}</a-button> |
| | | <a-button @click="handleExport">{{ formatMessage('page.export', '导出') }}</a-button> |
| | | </div> |
| | | </div> |
| | | <a-table :row-selection="{ selectedRowKeys: state.selectedRowKeys, onChange: onSelectChange }" |
| | | :data-source="tableData.records" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id" |
| | | :pagination="{ total: tableData.total, onChange: onPageChange }" |
| | | :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="columns" @resizeColumn="handleResizeColumn"> |
| | | <template #bodyCell="{ column, text, record }"> |
| | | <template v-if="column.dataIndex === 'oper'"> |
| | | <div style="display: flex;justify-content: space-evenly;"> |
| | | <a-button type="link" primary @click="handleEdit(record)">{{ formatMessage('page.edit', '编辑') }}</a-button> |
| | | <a-button type="link" danger @click="handleDel([record])">{{ formatMessage('page.delete', '删除') |
| | | }}</a-button> |
| | | </div> |
| | | </template> |
| | | </template> |
| | | </a-table> |
| | | </div> |
| | | </template> |
| | | |
| | | <style></style> |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.framework.common.R; |
| | | import com.zy.asrs.wms.asrs.service.WorkService; |
| | | import com.zy.asrs.wms.common.annotation.OperationLog; |
| | | import com.zy.asrs.wms.common.domain.BaseParam; |
| | | import com.zy.asrs.wms.common.domain.KeyValVo; |
| | | import com.zy.asrs.wms.common.domain.PageParam; |
| | | import com.zy.asrs.wms.asrs.entity.Task; |
| | | import com.zy.asrs.wms.asrs.service.TaskService; |
| | | import com.zy.asrs.wms.system.controller.BaseController; |
| | | import com.zy.asrs.wms.utils.ExcelUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/api") |
| | | public class TaskController extends BaseController { |
| | | |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private WorkService workService; |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:task:list')") |
| | | @PostMapping("/task/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<Task, BaseParam> pageParam = new PageParam<>(baseParam, Task.class); |
| | | return R.ok().add(taskService.page(pageParam, pageParam.buildWrapper(true))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:task:list')") |
| | | @PostMapping("/task/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(taskService.list()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:task:list')") |
| | | @GetMapping("/task/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(taskService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:task:save')") |
| | | @OperationLog("添加任务") |
| | | @PostMapping("/task/save") |
| | | public R save(@RequestBody Task task) { |
| | | if (!taskService.save(task)) { |
| | | return R.error("添加失败"); |
| | | } |
| | | return R.ok("添加成功"); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:task:update')") |
| | | @OperationLog("修改任务") |
| | | @PostMapping("/task/update") |
| | | public R update(@RequestBody Task task) { |
| | | if (!taskService.updateById(task)) { |
| | | return R.error("修改失败"); |
| | | } |
| | | return R.ok("修改成功"); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:task:remove')") |
| | | @OperationLog("删除任务") |
| | | @PostMapping("/task/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (!taskService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("删除失败"); |
| | | } |
| | | return R.ok("删除成功"); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:task:list')") |
| | | @PostMapping("/task/query") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | | LambdaQueryWrapper<Task> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(Task::getId, condition); |
| | | } |
| | | taskService.page(new Page<>(1, 30), wrapper).getRecords().forEach( |
| | | item -> vos.add(new KeyValVo(item.getId(), item.getId())) |
| | | ); |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:task:list')") |
| | | @PostMapping("/task/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(taskService.list(), Task.class), response); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:task:update')") |
| | | @OperationLog("取消任务") |
| | | @PostMapping("/task/cancel") |
| | | public R cancel(@RequestBody Task task) { |
| | | try { |
| | | boolean result = workService.cancelTask(task.getId()); |
| | | return R.ok("修改成功"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return R.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.framework.common.R; |
| | | import com.zy.asrs.wms.common.annotation.OperationLog; |
| | | import com.zy.asrs.wms.common.domain.BaseParam; |
| | | import com.zy.asrs.wms.common.domain.KeyValVo; |
| | | import com.zy.asrs.wms.common.domain.PageParam; |
| | | import com.zy.asrs.wms.asrs.entity.TaskDetl; |
| | | import com.zy.asrs.wms.asrs.service.TaskDetlService; |
| | | import com.zy.asrs.wms.system.controller.BaseController; |
| | | import com.zy.asrs.wms.utils.ExcelUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/api") |
| | | public class TaskDetlController extends BaseController { |
| | | |
| | | @Autowired |
| | | private TaskDetlService taskDetlService; |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskDetl:list')") |
| | | @PostMapping("/taskDetl/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<TaskDetl, BaseParam> pageParam = new PageParam<>(baseParam, TaskDetl.class); |
| | | return R.ok().add(taskDetlService.page(pageParam, pageParam.buildWrapper(true))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskDetl:list')") |
| | | @PostMapping("/taskDetl/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(taskDetlService.list()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskDetl:list')") |
| | | @GetMapping("/taskDetl/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(taskDetlService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskDetl:list')") |
| | | @GetMapping("/taskDetl/taskId/{id}") |
| | | public R getByTaskId(@PathVariable("id") Long id) { |
| | | return R.ok().add(taskDetlService.getTaskDetlByTaskId(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskDetl:save')") |
| | | @OperationLog("添加任务明细") |
| | | @PostMapping("/taskDetl/save") |
| | | public R save(@RequestBody TaskDetl taskDetl) { |
| | | if (!taskDetlService.save(taskDetl)) { |
| | | return R.error("添加失败"); |
| | | } |
| | | return R.ok("添加成功"); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskDetl:update')") |
| | | @OperationLog("修改任务明细") |
| | | @PostMapping("/taskDetl/update") |
| | | public R update(@RequestBody TaskDetl taskDetl) { |
| | | if (!taskDetlService.updateById(taskDetl)) { |
| | | return R.error("修改失败"); |
| | | } |
| | | return R.ok("修改成功"); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskDetl:remove')") |
| | | @OperationLog("删除任务明细") |
| | | @PostMapping("/taskDetl/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (!taskDetlService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("删除失败"); |
| | | } |
| | | return R.ok("删除成功"); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskDetl:list')") |
| | | @PostMapping("/taskDetl/query") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | | LambdaQueryWrapper<TaskDetl> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(TaskDetl::getId, condition); |
| | | } |
| | | taskDetlService.page(new Page<>(1, 30), wrapper).getRecords().forEach( |
| | | item -> vos.add(new KeyValVo(item.getId(), item.getId())) |
| | | ); |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskDetl:list')") |
| | | @PostMapping("/taskDetl/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(taskDetlService.list(), TaskDetl.class), response); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.framework.common.R; |
| | | import com.zy.asrs.wms.common.annotation.OperationLog; |
| | | import com.zy.asrs.wms.common.domain.BaseParam; |
| | | import com.zy.asrs.wms.common.domain.KeyValVo; |
| | | import com.zy.asrs.wms.common.domain.PageParam; |
| | | import com.zy.asrs.wms.asrs.entity.TaskDetlField; |
| | | import com.zy.asrs.wms.asrs.service.TaskDetlFieldService; |
| | | import com.zy.asrs.wms.system.controller.BaseController; |
| | | import com.zy.asrs.wms.utils.ExcelUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | @RequestMapping("/api") |
| | | public class TaskDetlFieldController extends BaseController { |
| | | |
| | | @Autowired |
| | | private TaskDetlFieldService taskDetlFieldService; |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskDetlField:list')") |
| | | @PostMapping("/taskDetlField/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<TaskDetlField, BaseParam> pageParam = new PageParam<>(baseParam, TaskDetlField.class); |
| | | return R.ok().add(taskDetlFieldService.page(pageParam, pageParam.buildWrapper(true))); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskDetlField:list')") |
| | | @PostMapping("/taskDetlField/list") |
| | | public R list(@RequestBody Map<String, Object> map) { |
| | | return R.ok().add(taskDetlFieldService.list()); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskDetlField:list')") |
| | | @GetMapping("/taskDetlField/{id}") |
| | | public R get(@PathVariable("id") Long id) { |
| | | return R.ok().add(taskDetlFieldService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskDetlField:save')") |
| | | @OperationLog("添加任务明细扩展字段") |
| | | @PostMapping("/taskDetlField/save") |
| | | public R save(@RequestBody TaskDetlField taskDetlField) { |
| | | if (!taskDetlFieldService.save(taskDetlField)) { |
| | | return R.error("添加失败"); |
| | | } |
| | | return R.ok("添加成功"); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskDetlField:update')") |
| | | @OperationLog("修改任务明细扩展字段") |
| | | @PostMapping("/taskDetlField/update") |
| | | public R update(@RequestBody TaskDetlField taskDetlField) { |
| | | if (!taskDetlFieldService.updateById(taskDetlField)) { |
| | | return R.error("修改失败"); |
| | | } |
| | | return R.ok("修改成功"); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskDetlField:remove')") |
| | | @OperationLog("删除任务明细扩展字段") |
| | | @PostMapping("/taskDetlField/remove/{ids}") |
| | | public R remove(@PathVariable Long[] ids) { |
| | | if (!taskDetlFieldService.removeByIds(Arrays.asList(ids))) { |
| | | return R.error("删除失败"); |
| | | } |
| | | return R.ok("删除成功"); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskDetlField:list')") |
| | | @PostMapping("/taskDetlField/query") |
| | | public R query(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | | LambdaQueryWrapper<TaskDetlField> wrapper = new LambdaQueryWrapper<>(); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.like(TaskDetlField::getId, condition); |
| | | } |
| | | taskDetlFieldService.page(new Page<>(1, 30), wrapper).getRecords().forEach( |
| | | item -> vos.add(new KeyValVo(item.getId(), item.getId())) |
| | | ); |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:taskDetlField:list')") |
| | | @PostMapping("/taskDetlField/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(taskDetlFieldService.list(), TaskDetlField.class), response); |
| | | } |
| | | |
| | | } |
| | |
| | | wrapper.like(TaskSts::getId, condition); |
| | | } |
| | | taskStsService.page(new Page<>(1, 30), wrapper).getRecords().forEach( |
| | | item -> vos.add(new KeyValVo(item.getId(), item.getId())) |
| | | item -> vos.add(new KeyValVo(item.getId(), item.getTitle())) |
| | | ); |
| | | return R.ok().add(vos); |
| | | } |
| | |
| | | wrapper.like(TaskType::getId, condition); |
| | | } |
| | | taskTypeService.page(new Page<>(1, 30), wrapper).getRecords().forEach( |
| | | item -> vos.add(new KeyValVo(item.getId(), item.getId())) |
| | | item -> vos.add(new KeyValVo(item.getId(), item.getTitle())) |
| | | ); |
| | | return R.ok().add(vos); |
| | | } |
| | |
| | | package com.zy.asrs.wms.asrs.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.framework.common.R; |
| | |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:waitPakin:list')") |
| | | @PostMapping("/waitPakin/barcode/query") |
| | | public R barcodeQuery(@RequestParam(required = false) String condition) { |
| | | List<KeyValVo> vos = new ArrayList<>(); |
| | | QueryWrapper<WaitPakin> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.select("distinct barcode"); |
| | | if (!Cools.isEmpty(condition)) { |
| | | queryWrapper.like("barcode", condition); |
| | | } |
| | | waitPakinService.page(new Page<>(1, 30), queryWrapper).getRecords().forEach( |
| | | item -> vos.add(new KeyValVo(item.getBarcode(), item.getBarcode())) |
| | | ); |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:waitPakin:list')") |
| | | @PostMapping("/waitPakin/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | ExcelUtil.build(ExcelUtil.create(waitPakinService.list(), WaitPakin.class), response); |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.controller; |
| | | |
| | | import com.zy.asrs.framework.common.R; |
| | | import com.zy.asrs.wms.asrs.entity.param.GeneratePakInParam; |
| | | import com.zy.asrs.wms.asrs.service.WorkService; |
| | | import com.zy.asrs.wms.common.annotation.OperationLog; |
| | | import com.zy.asrs.wms.system.controller.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @RestController |
| | | @RequestMapping("/api") |
| | | public class WorkController extends BaseController { |
| | | |
| | | @Autowired |
| | | private WorkService workService; |
| | | |
| | | @OperationLog("生成入库任务") |
| | | @PostMapping("/rpc/generatePakIn") |
| | | public R generatePakIn(@RequestBody GeneratePakInParam param) { |
| | | try { |
| | | workService.generatePakIn(param); |
| | | return R.ok("添加成功"); |
| | | } catch (Exception e) { |
| | | return R.error(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.zy.asrs.wms.asrs.service.TaskStsService; |
| | | import com.zy.asrs.wms.asrs.service.TaskTypeService; |
| | | import com.zy.asrs.wms.system.entity.Host; |
| | | import com.zy.asrs.wms.system.entity.User; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.framework.common.SpringUtils; |
| | | import com.zy.asrs.wms.system.service.UserService; |
| | | import com.zy.asrs.wms.system.service.HostService; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("man_task") |
| | | public class Task implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 任务编号 |
| | | */ |
| | | @ApiModelProperty(value= "任务编号") |
| | | private String taskNo; |
| | | |
| | | /** |
| | | * 任务状态 |
| | | */ |
| | | @ApiModelProperty(value= "任务状态") |
| | | private Long taskSts; |
| | | |
| | | /** |
| | | * 任务类型 |
| | | */ |
| | | @ApiModelProperty(value= "任务类型") |
| | | private Long taskType; |
| | | |
| | | /** |
| | | * 优先级 |
| | | */ |
| | | @ApiModelProperty(value= "优先级") |
| | | private Integer ioPri; |
| | | |
| | | /** |
| | | * 源库位 |
| | | */ |
| | | @ApiModelProperty(value= "源库位") |
| | | private String originLoc; |
| | | |
| | | /** |
| | | * 目标库位 |
| | | */ |
| | | @ApiModelProperty(value= "目标库位") |
| | | private String targetLoc; |
| | | |
| | | /** |
| | | * 源站点 |
| | | */ |
| | | @ApiModelProperty(value= "源站点") |
| | | private String originSite; |
| | | |
| | | /** |
| | | * 目标站点 |
| | | */ |
| | | @ApiModelProperty(value= "目标站点") |
| | | private String targetSite; |
| | | |
| | | /** |
| | | * 托盘码 |
| | | */ |
| | | @ApiModelProperty(value= "托盘码") |
| | | private String barcode; |
| | | |
| | | /** |
| | | * 所属机构 |
| | | */ |
| | | @ApiModelProperty(value= "所属机构") |
| | | private Long hostId; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 禁用 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 禁用 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 是否删除 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否删除 1: 是 0: 否 ") |
| | | private Integer deleted; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | public Task() {} |
| | | |
| | | public Task(String taskNo,Long taskSts,Long taskType,Integer ioPri,String originLoc,String targetLoc,String originSite,String targetSite,String barcode,Long hostId,Integer status,Integer deleted,Date createTime,Long createBy,Date updateTime,Long updateBy,String memo) { |
| | | this.taskNo = taskNo; |
| | | this.taskSts = taskSts; |
| | | this.taskType = taskType; |
| | | this.ioPri = ioPri; |
| | | this.originLoc = originLoc; |
| | | this.targetLoc = targetLoc; |
| | | this.originSite = originSite; |
| | | this.targetSite = targetSite; |
| | | this.barcode = barcode; |
| | | this.hostId = hostId; |
| | | this.status = status; |
| | | this.deleted = deleted; |
| | | this.createTime = createTime; |
| | | this.createBy = createBy; |
| | | this.updateTime = updateTime; |
| | | this.updateBy = updateBy; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // Task task = new Task( |
| | | // null, // 任务编号 |
| | | // null, // 任务状态 |
| | | // null, // 任务类型 |
| | | // null, // 优先级 |
| | | // null, // 源库位 |
| | | // null, // 目标库位 |
| | | // null, // 源站点 |
| | | // null, // 目标站点 |
| | | // null, // 托盘码 |
| | | // null, // 所属机构 |
| | | // null, // 状态 |
| | | // null, // 是否删除 |
| | | // null, // 添加时间 |
| | | // null, // 添加人员 |
| | | // null, // 修改时间 |
| | | // null, // 修改人员 |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getTaskSts$(){ |
| | | TaskStsService service = SpringUtils.getBean(TaskStsService.class); |
| | | TaskSts taskSts = service.getById(this.taskSts); |
| | | if (!Cools.isEmpty(taskSts)){ |
| | | return String.valueOf(taskSts.getTitle()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getTaskType$(){ |
| | | TaskTypeService service = SpringUtils.getBean(TaskTypeService.class); |
| | | TaskType taskType = service.getById(this.taskType); |
| | | if (!Cools.isEmpty(taskType)){ |
| | | return String.valueOf(taskType.getTitle()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getHostId$(){ |
| | | HostService service = SpringUtils.getBean(HostService.class); |
| | | Host host = service.getById(this.hostId); |
| | | if (!Cools.isEmpty(host)){ |
| | | return String.valueOf(host.getName()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return "正常"; |
| | | case 0: |
| | | return "禁用"; |
| | | default: |
| | | return String.valueOf(this.status); |
| | | } |
| | | } |
| | | |
| | | public String getDeleted$(){ |
| | | if (null == this.deleted){ return null; } |
| | | switch (this.deleted){ |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | | return "否"; |
| | | default: |
| | | return String.valueOf(this.deleted); |
| | | } |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getCreateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.getById(this.createBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.getById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonAnyGetter; |
| | | import com.zy.asrs.common.utils.Synchro; |
| | | import com.zy.asrs.wms.asrs.service.MatService; |
| | | import com.zy.asrs.wms.asrs.service.OrderDetlService; |
| | | import com.zy.asrs.wms.asrs.service.OrderService; |
| | | import com.zy.asrs.wms.asrs.service.TaskService; |
| | | import com.zy.asrs.wms.system.entity.Host; |
| | | import com.zy.asrs.wms.system.entity.User; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.framework.common.SpringUtils; |
| | | import com.zy.asrs.wms.system.service.UserService; |
| | | import com.zy.asrs.wms.system.service.HostService; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("man_task_detl") |
| | | public class TaskDetl implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 任务ID |
| | | */ |
| | | @ApiModelProperty(value= "任务ID") |
| | | private Long taskId; |
| | | |
| | | /** |
| | | * 任务编号 |
| | | */ |
| | | @ApiModelProperty(value= "任务编号") |
| | | private String taskNo; |
| | | |
| | | /** |
| | | * 数量 |
| | | */ |
| | | @ApiModelProperty(value= "数量") |
| | | private Double anfme; |
| | | |
| | | /** |
| | | * 库存 |
| | | */ |
| | | @ApiModelProperty(value= "库存") |
| | | private Double stock; |
| | | |
| | | /** |
| | | * 批号 |
| | | */ |
| | | @ApiModelProperty(value= "批号") |
| | | private String batch; |
| | | |
| | | /** |
| | | * 托盘码 |
| | | */ |
| | | @ApiModelProperty(value= "托盘码") |
| | | private String barcode; |
| | | |
| | | /** |
| | | * 订单ID |
| | | */ |
| | | @ApiModelProperty(value= "订单ID") |
| | | private Long orderId; |
| | | |
| | | /** |
| | | * 订单编号 |
| | | */ |
| | | @ApiModelProperty(value= "订单编号") |
| | | private String orderNo; |
| | | |
| | | /** |
| | | * 明细ID |
| | | */ |
| | | @ApiModelProperty(value= "明细ID") |
| | | private Long detlId; |
| | | |
| | | /** |
| | | * 物料ID |
| | | */ |
| | | @ApiModelProperty(value= "物料ID") |
| | | private Long matId; |
| | | |
| | | /** |
| | | * 所属机构 |
| | | */ |
| | | @ApiModelProperty(value= "所属机构") |
| | | private Long hostId; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 禁用 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 禁用 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 是否删除 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否删除 1: 是 0: 否 ") |
| | | private Integer deleted; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | public TaskDetl() {} |
| | | |
| | | public TaskDetl(Long taskId,String taskNo,Double anfme,String batch,String barcode,Long orderId,String orderNo,Long detlId,Long matId,Long hostId,Integer status,Integer deleted,Date createTime,Long createBy,Date updateTime,Long updateBy,String memo) { |
| | | this.taskId = taskId; |
| | | this.taskNo = taskNo; |
| | | this.anfme = anfme; |
| | | this.batch = batch; |
| | | this.barcode = barcode; |
| | | this.orderId = orderId; |
| | | this.orderNo = orderNo; |
| | | this.detlId = detlId; |
| | | this.matId = matId; |
| | | this.hostId = hostId; |
| | | this.status = status; |
| | | this.deleted = deleted; |
| | | this.createTime = createTime; |
| | | this.createBy = createBy; |
| | | this.updateTime = updateTime; |
| | | this.updateBy = updateBy; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // TaskDetl taskDetl = new TaskDetl( |
| | | // null, // 任务ID |
| | | // null, // 任务编号 |
| | | // null, // 数量 |
| | | // null, // 批号 |
| | | // null, // 托盘码 |
| | | // null, // 订单ID |
| | | // null, // 订单编号 |
| | | // null, // 明细ID |
| | | // null, // 物料ID |
| | | // null, // 所属机构 |
| | | // null, // 状态 |
| | | // null, // 是否删除 |
| | | // null, // 添加时间 |
| | | // null, // 添加人员 |
| | | // null, // 修改时间 |
| | | // null, // 修改人员 |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getTaskId$(){ |
| | | TaskService service = SpringUtils.getBean(TaskService.class); |
| | | Task task = service.getById(this.taskId); |
| | | if (!Cools.isEmpty(task)){ |
| | | return String.valueOf(task.getId()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getOrderId$() { |
| | | OrderService service = SpringUtils.getBean(OrderService.class); |
| | | Order order = service.getById(this.orderId); |
| | | if (!Cools.isEmpty(order)) { |
| | | return String.valueOf(order.getId()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public Order getOrder$() { |
| | | OrderService service = SpringUtils.getBean(OrderService.class); |
| | | Order order = service.getById(this.orderId); |
| | | if (!Cools.isEmpty(order)) { |
| | | return order; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getDetlId$(){ |
| | | OrderDetlService service = SpringUtils.getBean(OrderDetlService.class); |
| | | OrderDetl orderDetl = service.getById(this.detlId); |
| | | if (!Cools.isEmpty(orderDetl)){ |
| | | return String.valueOf(orderDetl.getId()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public OrderDetl getDetl$(){ |
| | | OrderDetlService service = SpringUtils.getBean(OrderDetlService.class); |
| | | OrderDetl orderDetl = service.getById(this.detlId); |
| | | if (!Cools.isEmpty(orderDetl)){ |
| | | return orderDetl; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getMatId$(){ |
| | | MatService service = SpringUtils.getBean(MatService.class); |
| | | Mat mat = service.getById(this.matId); |
| | | if (!Cools.isEmpty(mat)){ |
| | | return String.valueOf(mat.getMatnr()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public Mat getMat$(){ |
| | | MatService service = SpringUtils.getBean(MatService.class); |
| | | Mat mat = service.getById(this.matId); |
| | | if (!Cools.isEmpty(mat)){ |
| | | return mat; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getHostId$(){ |
| | | HostService service = SpringUtils.getBean(HostService.class); |
| | | Host host = service.getById(this.hostId); |
| | | if (!Cools.isEmpty(host)){ |
| | | return String.valueOf(host.getName()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return "正常"; |
| | | case 0: |
| | | return "禁用"; |
| | | default: |
| | | return String.valueOf(this.status); |
| | | } |
| | | } |
| | | |
| | | public String getDeleted$(){ |
| | | if (null == this.deleted){ return null; } |
| | | switch (this.deleted){ |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | | return "否"; |
| | | default: |
| | | return String.valueOf(this.deleted); |
| | | } |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getCreateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.getById(this.createBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.getById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public void sync(Object source) { |
| | | Synchro.Copy(source, this); |
| | | } |
| | | |
| | | //动态扩展字段 |
| | | public transient Map<String, Object> dynamicFields = new HashMap<>(); |
| | | |
| | | @JsonAnyGetter |
| | | public Map<String,Object> getDynamicFields() { |
| | | return dynamicFields; |
| | | } |
| | | |
| | | public void syncField(List<TaskDetlField> list) { |
| | | ArrayList<String> keys = new ArrayList<>(); |
| | | Field[] fields = this.getClass().getFields(); |
| | | for (Field field : fields) { |
| | | keys.add(field.getName()); |
| | | } |
| | | |
| | | Map<String, Object> dynamicFields = new HashMap<>(); |
| | | for (TaskDetlField taskDetlField : list) { |
| | | if (keys.contains(taskDetlField.getName())) { |
| | | continue; |
| | | } |
| | | dynamicFields.put(taskDetlField.getName(), taskDetlField.getValue()); |
| | | } |
| | | |
| | | this.dynamicFields = dynamicFields; |
| | | } |
| | | |
| | | public void syncFieldMap(Map<String, Object> map) { |
| | | ArrayList<String> keys = new ArrayList<>(); |
| | | Field[] fields = this.getClass().getDeclaredFields(); |
| | | for (Field field : fields) { |
| | | keys.add(field.getName()); |
| | | } |
| | | keys.add("detlId"); |
| | | |
| | | Map<String, Object> dynamicFields = new HashMap<>(); |
| | | for (Map.Entry<String, Object> entry : map.entrySet()) { |
| | | if (keys.contains(entry.getKey())) { |
| | | continue; |
| | | } |
| | | dynamicFields.put(entry.getKey(), entry.getValue()); |
| | | } |
| | | |
| | | this.dynamicFields = dynamicFields; |
| | | } |
| | | |
| | | public String getFieldString(String key) { |
| | | return dynamicFields.get(key).toString(); |
| | | } |
| | | |
| | | public void setField(String key, Object value) { |
| | | dynamicFields.put(key, value); |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.zy.asrs.wms.asrs.service.MatFieldService; |
| | | import com.zy.asrs.wms.asrs.service.TaskDetlService; |
| | | import com.zy.asrs.wms.system.entity.Host; |
| | | import com.zy.asrs.wms.system.entity.User; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.zy.asrs.framework.common.Cools; |
| | | import com.zy.asrs.framework.common.SpringUtils; |
| | | import com.zy.asrs.wms.system.service.UserService; |
| | | import com.zy.asrs.wms.system.service.HostService; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("man_task_detl_field") |
| | | public class TaskDetlField implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 字段名 |
| | | */ |
| | | @ApiModelProperty(value= "字段名") |
| | | private String name; |
| | | |
| | | /** |
| | | * 字段 |
| | | */ |
| | | @ApiModelProperty(value= "字段") |
| | | private Long fieldId; |
| | | |
| | | /** |
| | | * 任务明细 |
| | | */ |
| | | @ApiModelProperty(value= "任务明细") |
| | | private Long detlId; |
| | | |
| | | /** |
| | | * 参数值 |
| | | */ |
| | | @ApiModelProperty(value= "参数值") |
| | | private String value; |
| | | |
| | | /** |
| | | * 所属机构 |
| | | */ |
| | | @ApiModelProperty(value= "所属机构") |
| | | private Long hostId; |
| | | |
| | | /** |
| | | * 状态 1: 正常 0: 禁用 |
| | | */ |
| | | @ApiModelProperty(value= "状态 1: 正常 0: 禁用 ") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 是否删除 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否删除 1: 是 0: 否 ") |
| | | private Integer deleted; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @ApiModelProperty(value= "添加时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 添加人员 |
| | | */ |
| | | @ApiModelProperty(value= "添加人员") |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value= "修改时间") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 修改人员 |
| | | */ |
| | | @ApiModelProperty(value= "修改人员") |
| | | private Long updateBy; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @ApiModelProperty(value= "备注") |
| | | private String memo; |
| | | |
| | | public TaskDetlField() {} |
| | | |
| | | public TaskDetlField(String name,Long fieldId,Long detlId,String value,Long hostId,Integer status,Integer deleted,Date createTime,Long createBy,Date updateTime,Long updateBy,String memo) { |
| | | this.name = name; |
| | | this.fieldId = fieldId; |
| | | this.detlId = detlId; |
| | | this.value = value; |
| | | this.hostId = hostId; |
| | | this.status = status; |
| | | this.deleted = deleted; |
| | | this.createTime = createTime; |
| | | this.createBy = createBy; |
| | | this.updateTime = updateTime; |
| | | this.updateBy = updateBy; |
| | | this.memo = memo; |
| | | } |
| | | |
| | | // TaskDetlField taskDetlField = new TaskDetlField( |
| | | // null, // 字段名 |
| | | // null, // 字段 |
| | | // null, // 任务明细 |
| | | // null, // 参数值 |
| | | // null, // 所属机构 |
| | | // null, // 状态 |
| | | // null, // 是否删除 |
| | | // null, // 添加时间 |
| | | // null, // 添加人员 |
| | | // null, // 修改时间 |
| | | // null, // 修改人员 |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | public String getFieldId$(){ |
| | | MatFieldService service = SpringUtils.getBean(MatFieldService.class); |
| | | MatField matField = service.getById(this.fieldId); |
| | | if (!Cools.isEmpty(matField)){ |
| | | return String.valueOf(matField.getId()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getDetlId$(){ |
| | | TaskDetlService service = SpringUtils.getBean(TaskDetlService.class); |
| | | TaskDetl taskDetl = service.getById(this.detlId); |
| | | if (!Cools.isEmpty(taskDetl)){ |
| | | return String.valueOf(taskDetl.getId()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getHostId$(){ |
| | | HostService service = SpringUtils.getBean(HostService.class); |
| | | Host host = service.getById(this.hostId); |
| | | if (!Cools.isEmpty(host)){ |
| | | return String.valueOf(host.getName()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getStatus$(){ |
| | | if (null == this.status){ return null; } |
| | | switch (this.status){ |
| | | case 1: |
| | | return "正常"; |
| | | case 0: |
| | | return "禁用"; |
| | | default: |
| | | return String.valueOf(this.status); |
| | | } |
| | | } |
| | | |
| | | public String getDeleted$(){ |
| | | if (null == this.deleted){ return null; } |
| | | switch (this.deleted){ |
| | | case 1: |
| | | return "是"; |
| | | case 0: |
| | | return "否"; |
| | | default: |
| | | return String.valueOf(this.deleted); |
| | | } |
| | | } |
| | | |
| | | public String getCreateTime$(){ |
| | | if (Cools.isEmpty(this.createTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime); |
| | | } |
| | | |
| | | public String getCreateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.getById(this.createBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public String getUpdateTime$(){ |
| | | if (Cools.isEmpty(this.updateTime)){ |
| | | return ""; |
| | | } |
| | | return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.updateTime); |
| | | } |
| | | |
| | | public String getUpdateBy$(){ |
| | | UserService service = SpringUtils.getBean(UserService.class); |
| | | User user = service.getById(this.updateBy); |
| | | if (!Cools.isEmpty(user)){ |
| | | return String.valueOf(user.getNickname()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | * 是否删除 1: 是 0: 否 |
| | | */ |
| | | @ApiModelProperty(value= "是否删除 1: 是 0: 否 ") |
| | | @TableLogic |
| | | private Integer deleted; |
| | | |
| | | /** |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.entity.enums; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.framework.common.SpringUtils; |
| | | import com.zy.asrs.framework.exception.CoolException; |
| | | import com.zy.asrs.wms.asrs.entity.LocSts; |
| | | import com.zy.asrs.wms.asrs.service.LocStsService; |
| | | |
| | | public enum LocStsType { |
| | | |
| | | D,//空板 |
| | | F,//在库 |
| | | O,//空库 |
| | | X,//禁用 |
| | | S,//入库预约 |
| | | R,//出库预约 |
| | | ; |
| | | |
| | | LocStsType() { |
| | | } |
| | | |
| | | public long val() { |
| | | LocStsService service = SpringUtils.getBean(LocStsService.class); |
| | | LocSts locSts = service.getOne(new LambdaQueryWrapper<LocSts>().eq(LocSts::getLocSts, this.toString())); |
| | | if (locSts == null) { |
| | | throw new CoolException("LocStsType Error!"); |
| | | } |
| | | return locSts.getId(); |
| | | } |
| | | |
| | | public static LocStsType get(String el) { |
| | | for (LocStsType value : LocStsType.values()) { |
| | | if (el.equals(value.toString())) { |
| | | return value; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.entity.param; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class GeneratePakInParam { |
| | | |
| | | //任务类型 |
| | | private Long taskType; |
| | | |
| | | //托盘码 |
| | | private String barcode; |
| | | |
| | | //源站点 |
| | | private String originSite; |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.mapper; |
| | | |
| | | import com.zy.asrs.wms.asrs.entity.TaskDetlField; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface TaskDetlFieldMapper extends BaseMapper<TaskDetlField> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.mapper; |
| | | |
| | | import com.zy.asrs.wms.asrs.entity.TaskDetl; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface TaskDetlMapper extends BaseMapper<TaskDetl> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.mapper; |
| | | |
| | | import com.zy.asrs.wms.asrs.entity.Task; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface TaskMapper extends BaseMapper<Task> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.wms.asrs.entity.TaskDetlField; |
| | | |
| | | public interface TaskDetlFieldService extends IService<TaskDetlField> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.wms.asrs.entity.TaskDetl; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface TaskDetlService extends IService<TaskDetl> { |
| | | |
| | | List<TaskDetl> getTaskDetlByTaskId(Long taskId); |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.wms.asrs.entity.Task; |
| | | |
| | | public interface TaskService extends IService<Task> { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.service; |
| | | |
| | | import com.zy.asrs.wms.asrs.entity.Loc; |
| | | import com.zy.asrs.wms.asrs.entity.param.GeneratePakInParam; |
| | | |
| | | public interface WorkService { |
| | | |
| | | //生成任务号 |
| | | String generateTaskNo(Long taskType); |
| | | |
| | | //生成优先级 |
| | | Integer generateIoPri(Long taskType); |
| | | |
| | | //生成可用库位号 |
| | | Loc generateLoc(Long taskType); |
| | | |
| | | //生成入库任务 |
| | | boolean generatePakIn(GeneratePakInParam param); |
| | | |
| | | //取消任务 |
| | | boolean cancelTask(Long taskId); |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.wms.asrs.mapper.TaskDetlFieldMapper; |
| | | import com.zy.asrs.wms.asrs.entity.TaskDetlField; |
| | | import com.zy.asrs.wms.asrs.service.TaskDetlFieldService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("taskDetlFieldService") |
| | | public class TaskDetlFieldServiceImpl extends ServiceImpl<TaskDetlFieldMapper, TaskDetlField> implements TaskDetlFieldService { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.wms.asrs.entity.TaskDetlField; |
| | | import com.zy.asrs.wms.asrs.mapper.TaskDetlMapper; |
| | | import com.zy.asrs.wms.asrs.entity.TaskDetl; |
| | | import com.zy.asrs.wms.asrs.service.TaskDetlFieldService; |
| | | import com.zy.asrs.wms.asrs.service.TaskDetlService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | @Service("taskDetlService") |
| | | public class TaskDetlServiceImpl extends ServiceImpl<TaskDetlMapper, TaskDetl> implements TaskDetlService { |
| | | |
| | | @Autowired |
| | | private TaskDetlFieldService taskDetlFieldService; |
| | | |
| | | @Override |
| | | public List<TaskDetl> getTaskDetlByTaskId(Long taskId) { |
| | | List<TaskDetl> taskDetls = this.list(new LambdaQueryWrapper<TaskDetl>().eq(TaskDetl::getTaskId, taskId)); |
| | | for (TaskDetl taskDetl : taskDetls) { |
| | | List<TaskDetlField> list = taskDetlFieldService.list(new LambdaQueryWrapper<TaskDetlField>().eq(TaskDetlField::getDetlId, taskDetl.getId())); |
| | | taskDetl.syncField(list); |
| | | } |
| | | return taskDetls; |
| | | } |
| | | } |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.service.impl; |
| | | |
| | | import com.zy.asrs.wms.asrs.mapper.TaskMapper; |
| | | import com.zy.asrs.wms.asrs.entity.Task; |
| | | import com.zy.asrs.wms.asrs.service.TaskService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("taskService") |
| | | public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements TaskService { |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.asrs.wms.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.framework.exception.CoolException; |
| | | import com.zy.asrs.wms.asrs.entity.*; |
| | | import com.zy.asrs.wms.asrs.entity.enums.LocStsType; |
| | | import com.zy.asrs.wms.asrs.entity.param.GeneratePakInParam; |
| | | import com.zy.asrs.wms.asrs.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | |
| | | @Service("workService") |
| | | public class WorkServiceImpl implements WorkService { |
| | | |
| | | @Autowired |
| | | private TaskService taskService; |
| | | @Autowired |
| | | private TaskDetlService taskDetlService; |
| | | @Autowired |
| | | private WaitPakinService waitPakinService; |
| | | @Autowired |
| | | private TaskTypeService taskTypeService; |
| | | @Autowired |
| | | private OrderDetlFieldService orderDetlFieldService; |
| | | @Autowired |
| | | private TaskDetlFieldService taskDetlFieldService; |
| | | @Autowired |
| | | private OrderDetlService orderDetlService; |
| | | @Autowired |
| | | private LocService locService; |
| | | @Autowired |
| | | private LocStsService locStsService; |
| | | |
| | | @Override |
| | | public String generateTaskNo(Long taskType) { |
| | | Random random = new Random(); |
| | | int nextInt = random.nextInt(99999); |
| | | return "R" + nextInt; |
| | | } |
| | | |
| | | @Override |
| | | public Integer generateIoPri(Long taskType) { |
| | | return 10; |
| | | } |
| | | |
| | | @Override |
| | | public Loc generateLoc(Long taskType) { |
| | | LocSts locSts = locStsService.getOne(new LambdaQueryWrapper<LocSts>().eq(LocSts::getLocSts, String.valueOf(LocStsType.O))); |
| | | List<Loc> list = locService.list(new LambdaQueryWrapper<Loc>().eq(Loc::getLocStsId, locSts.getId())); |
| | | if (list.isEmpty()) { |
| | | throw new CoolException("没有空库位"); |
| | | } |
| | | return list.get(0); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public boolean generatePakIn(GeneratePakInParam param) { |
| | | List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, param.getBarcode())); |
| | | if (waitPakins.isEmpty()) { |
| | | throw new CoolException("托盘未组托"); |
| | | } |
| | | |
| | | TaskType taskType = taskTypeService.getById(param.getTaskType()); |
| | | if (taskType == null) { |
| | | throw new CoolException("任务类型不存在"); |
| | | } |
| | | |
| | | //生成库位 |
| | | Loc loc = this.generateLoc(param.getTaskType()); |
| | | |
| | | Task task = new Task(); |
| | | task.setTaskNo(this.generateTaskNo(taskType.getId()));//任务号 |
| | | task.setTaskSts(1L);//1.生成入库任务 |
| | | task.setTaskType(taskType.getId());//任务类型 |
| | | task.setIoPri(this.generateIoPri(taskType.getId()));//优先级 |
| | | task.setOriginLoc(null); |
| | | task.setTargetLoc(loc.getLocNo()); |
| | | task.setOriginSite(param.getOriginSite()); |
| | | task.setTargetSite(null); |
| | | task.setBarcode(param.getBarcode());//托盘码 |
| | | boolean taskSave = taskService.save(task); |
| | | if (!taskSave) { |
| | | throw new CoolException("任务生成失败"); |
| | | } |
| | | |
| | | //生成任务明细 |
| | | for (WaitPakin waitPakin : waitPakins) { |
| | | TaskDetl taskDetl = new TaskDetl(); |
| | | taskDetl.setTaskId(task.getId()); |
| | | taskDetl.setTaskNo(task.getTaskNo()); |
| | | taskDetl.setAnfme(waitPakin.getAnfme());//数量 |
| | | taskDetl.setStock(0D);//库存 |
| | | taskDetl.setBatch(waitPakin.getDetl$().getBatch());//批号 |
| | | taskDetl.setBarcode(waitPakin.getBarcode()); |
| | | taskDetl.setOrderId(waitPakin.getOrderId()); |
| | | taskDetl.setOrderNo(waitPakin.getOrderNo()); |
| | | taskDetl.setDetlId(waitPakin.getDetlId()); |
| | | taskDetl.setMatId(waitPakin.getDetl$().getMatId()); |
| | | boolean taskDetlSave = taskDetlService.save(taskDetl); |
| | | if(!taskDetlSave){ |
| | | throw new CoolException("任务明细生成失败"); |
| | | } |
| | | |
| | | //生成明细扩展 |
| | | List<OrderDetlField> orderDetlFields = orderDetlFieldService.list(new LambdaQueryWrapper<OrderDetlField>().eq(OrderDetlField::getDetlId, waitPakin.getDetlId())); |
| | | for (OrderDetlField orderDetlField : orderDetlFields) { |
| | | TaskDetlField taskDetlField = new TaskDetlField(); |
| | | taskDetlField.setName(orderDetlField.getName()); |
| | | taskDetlField.setFieldId(orderDetlField.getFieldId()); |
| | | taskDetlField.setDetlId(taskDetl.getId()); |
| | | taskDetlField.setValue(orderDetlField.getValue()); |
| | | boolean taskDetlFieldSave = taskDetlFieldService.save(taskDetlField); |
| | | if(!taskDetlFieldSave){ |
| | | throw new CoolException("明细扩展生成失败"); |
| | | } |
| | | } |
| | | |
| | | //更新组托通知档 |
| | | waitPakin.setIoStatus(1); |
| | | waitPakin.setUpdateTime(new Date()); |
| | | boolean waitPakinUpdate = waitPakinService.updateById(waitPakin); |
| | | if(!waitPakinUpdate){ |
| | | throw new CoolException("组托通知档更新失败"); |
| | | } |
| | | |
| | | //更新订单数据 |
| | | OrderDetl orderDetl = orderDetlService.getById(taskDetl.getDetlId()); |
| | | if(orderDetl == null){ |
| | | throw new CoolException("订单数据异常"); |
| | | } |
| | | |
| | | orderDetl.setWorkQty(orderDetl.getWorkQty() + taskDetl.getAnfme()); |
| | | orderDetl.setUpdateTime(new Date()); |
| | | boolean orderDetlUpdate = orderDetlService.updateById(orderDetl); |
| | | if(!orderDetlUpdate){ |
| | | throw new CoolException("订单更新失败"); |
| | | } |
| | | } |
| | | |
| | | //库位O => S |
| | | loc.setLocStsId(LocStsType.S.val()); |
| | | loc.setUpdateTime(new Date()); |
| | | boolean locUpdate = locService.updateById(loc); |
| | | if(!locUpdate){ |
| | | throw new CoolException("库位状态更新失败"); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public boolean cancelTask(Long taskId) { |
| | | Task task = taskService.getById(taskId); |
| | | if(task == null){ |
| | | throw new CoolException("任务不存在"); |
| | | } |
| | | |
| | | List<TaskDetl> taskDetls = taskDetlService.getTaskDetlByTaskId(taskId); |
| | | if (taskDetls.isEmpty()) { |
| | | throw new CoolException("任务明细不存在"); |
| | | } |
| | | |
| | | //更新库位状态 |
| | | Loc loc = null; |
| | | switch (task.getTaskType().intValue()) { |
| | | case 1://入库 |
| | | case 53://拣料 |
| | | case 54://并板 |
| | | case 57://盘点 |
| | | loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getLocNo, task.getTargetLoc())); |
| | | if(loc == null){ |
| | | throw new CoolException("库位不存在"); |
| | | } |
| | | if(loc.getLocStsId() != LocStsType.S.val()){ |
| | | throw new CoolException("库位状态不处于S.入库预约"); |
| | | } |
| | | loc.setLocStsId(LocStsType.O.val()); |
| | | loc.setUpdateTime(new Date()); |
| | | if(!locService.updateById(loc)){ |
| | | throw new CoolException("库位状态变更失败"); |
| | | } |
| | | break; |
| | | case 101://出库 |
| | | case 103://拣料 |
| | | case 104://并板 |
| | | case 107://盘点 |
| | | loc = locService.getOne(new LambdaQueryWrapper<Loc>().eq(Loc::getLocNo, task.getOriginLoc())); |
| | | if(loc == null){ |
| | | throw new CoolException("库位不存在"); |
| | | } |
| | | if(loc.getLocStsId() != LocStsType.R.val()){ |
| | | throw new CoolException("库位状态不处于R.出库预约"); |
| | | } |
| | | loc.setLocStsId(LocStsType.F.val()); |
| | | loc.setUpdateTime(new Date()); |
| | | if(!locService.updateById(loc)){ |
| | | throw new CoolException("库位状态变更失败"); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | //回滚订单 |
| | | for (TaskDetl taskDetl : taskDetls) { |
| | | OrderDetl orderDetl = orderDetlService.getById(taskDetl.getDetlId()); |
| | | if(orderDetl == null){ |
| | | throw new CoolException("订单明细不存在"); |
| | | } |
| | | |
| | | //回滚工作数量 |
| | | orderDetl.setWorkQty(orderDetl.getWorkQty() - taskDetl.getAnfme()); |
| | | orderDetl.setUpdateTime(new Date()); |
| | | boolean orderDetlUpdate = orderDetlService.updateById(orderDetl); |
| | | if(!orderDetlUpdate){ |
| | | throw new CoolException("工作数量回滚失败"); |
| | | } |
| | | |
| | | //入库回滚组托通知档 |
| | | if (task.getTaskType() == 1) { |
| | | WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getDetlId, taskDetl.getDetlId()).eq(WaitPakin::getBarcode, task.getBarcode())); |
| | | if(waitPakin == null){ |
| | | throw new CoolException("组托通知档不存在"); |
| | | } |
| | | |
| | | waitPakin.setIoStatus(0); |
| | | waitPakin.setUpdateTime(new Date()); |
| | | boolean updateWaitPakin = waitPakinService.updateById(waitPakin); |
| | | if(!updateWaitPakin){ |
| | | throw new CoolException("组托通知档回滚失败"); |
| | | } |
| | | } |
| | | |
| | | //删除明细扩展 |
| | | boolean removeField = taskDetlFieldService.remove(new LambdaQueryWrapper<TaskDetlField>().eq(TaskDetlField::getDetlId, taskDetl.getId())); |
| | | if(!removeField){ |
| | | throw new CoolException("回滚扩展明细失败"); |
| | | } |
| | | |
| | | //删除明细 |
| | | boolean removeDetl = taskDetlService.removeById(taskDetl.getId()); |
| | | if(!removeDetl){ |
| | | throw new CoolException("回滚明细失败"); |
| | | } |
| | | } |
| | | |
| | | //删除任务 |
| | | boolean removeTask = taskService.removeById(taskId); |
| | | if(!removeTask){ |
| | | throw new CoolException("回滚任务失败"); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | } |
| | |
| | | // generator.username="sa"; |
| | | // generator.password="Zoneyung@zy56$"; |
| | | |
| | | generator.table="man_task_type"; |
| | | generator.tableName="任务类型"; |
| | | generator.table="man_task_detl_log"; |
| | | generator.tableName="任务明细扩展字段历史"; |
| | | generator.rootPackagePath="com.zy.asrs.wms"; |
| | | generator.packagePath="com.zy.asrs.wms.asrs"; |
| | | |
New file |
| | |
| | | -- save taskDetlField record |
| | | -- mysql |
| | | insert into `sys_menu` ( `name`, `parent_id`, `route`, `component`, `type`, `sort`, `host_id`, `status`) values ( '任务明细扩展字段管理', '0', '/asrs/taskDetlField', '/asrs/taskDetlField', '0' , '0', '1' , '1'); |
| | | |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '查询任务明细扩展字段', '', '1', 'asrs:taskDetlField:list', '0', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '添加任务明细扩展字段', '', '1', 'asrs:taskDetlField:save', '1', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '修改任务明细扩展字段', '', '1', 'asrs:taskDetlField:update', '2', '1', '1'); |
| | | insert into `sys_menu` ( `name`, `parent_id`, `type`, `authority`, `sort`, `host_id`, `status`) values ( '删除任务明细扩展字段', '', '1', 'asrs:taskDetlField:remove', '3', '1', '1'); |
| | | |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!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.TaskDetlFieldMapper"> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!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"> |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!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.TaskMapper"> |
| | | |
| | | </mapper> |