New file |
| | |
| | | <script setup> |
| | | import { getCurrentInstance, ref, watch, reactive } from 'vue'; |
| | | import { useRouter } from "vue-router"; |
| | | import { get, post, postForm } from '@/utils/request.js' |
| | | import { message, Modal } from 'ant-design-vue'; |
| | | import { logout } from '@/config.js'; |
| | | import { formatMessage } from '@/utils/localeUtils.js'; |
| | | import useTableSearch from '@/utils/tableUtils.jsx'; |
| | | const context = getCurrentInstance()?.appContext.config.globalProperties; |
| | | |
| | | const router = useRouter(); |
| | | |
| | | const TABLE_KEY = 'table-locDetl'; |
| | | |
| | | let tableData = ref([]); |
| | | let open = ref(false); |
| | | const orderDetlId = ref(null); |
| | | |
| | | const showWidth = ref("60%") |
| | | |
| | | const { |
| | | getColumnSearchProps, |
| | | } = useTableSearch(); |
| | | |
| | | const state = reactive({ |
| | | selectedRowKeys: [], |
| | | loading: false, |
| | | columns: [], |
| | | }); |
| | | |
| | | state.columns = [ |
| | | { |
| | | title: formatMessage('db.man_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'), |
| | | }, |
| | | ]; |
| | | |
| | | const handleOk = () => { |
| | | open.value = false; |
| | | } |
| | | |
| | | const handleCancel = () => { |
| | | open.value = false; |
| | | orderDetlId.value = null; |
| | | } |
| | | |
| | | watch(orderDetlId, (newVal, oldVal) => { |
| | | if (newVal != null) { |
| | | get("/api/waitPakin/orderDetlId/" + newVal, {}).then((resp) => { |
| | | let result = resp.data; |
| | | tableData.value = result.data; |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | defineExpose({ |
| | | tableData, |
| | | orderDetlId, |
| | | open, |
| | | showWidth, |
| | | }) |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'waitTaskComponent' |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <div> |
| | | <a-modal v-model:open="open" :width="showWidth" @ok="handleOk" @cancel="handleCancel"> |
| | | <a-table :data-source="tableData" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="id" |
| | | :scroll="{ y: 768 }" :columns="state.columns"> |
| | | </a-table> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | | |
| | | <style></style> |
| | |
| | | import useTableSearch from '@/utils/tableUtils.jsx'; |
| | | import WorkTaskView from '@/components/order/workTask/index.vue' |
| | | import CompleteTaskView from '@/components/order/completeTask/index.vue' |
| | | import WaitTaskView from '@/components/order/waitTask/index.vue' |
| | | const context = getCurrentInstance()?.appContext.config.globalProperties; |
| | | |
| | | const router = useRouter(); |
| | |
| | | }); |
| | | const workTaskChild = ref(null) |
| | | const completeTaskChild = ref(null) |
| | | const waitTaskChild = ref(null) |
| | | |
| | | const showWidth = ref("60%") |
| | | getColumns(); |
| | |
| | | { |
| | | title: formatMessage('db.man_loc_detl.workQty', '作业中数量'), |
| | | dataIndex: 'workQty', |
| | | width: 140, |
| | | ellipsis: true, |
| | | editable: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_loc_detl.waitQty', '组托数量'), |
| | | dataIndex: 'waitQty', |
| | | width: 140, |
| | | ellipsis: true, |
| | | editable: true, |
| | |
| | | anfme: item.anfme, |
| | | qty: item.qty, |
| | | workQty: item.workQty, |
| | | waitQty: item.waitQty, |
| | | memo: item.memo |
| | | }; |
| | | fieldList.forEach((field) => { |
| | |
| | | completeTaskChild.value.open = true; |
| | | completeTaskChild.value.showWidth = '55%'; |
| | | completeTaskChild.value.orderDetlId = record.detlId; |
| | | } |
| | | |
| | | const openWaitQty = (record) => { |
| | | waitTaskChild.value.open = true; |
| | | waitTaskChild.value.showWidth = '55%'; |
| | | waitTaskChild.value.orderDetlId = record.detlId; |
| | | } |
| | | |
| | | defineExpose({ |
| | |
| | | <template v-if="column.dataIndex === 'qty'"> |
| | | <a-button type="link" @click="openCompleteQty(record)">{{ text }}</a-button> |
| | | </template> |
| | | |
| | | <template v-if="column.dataIndex === 'waitQty'"> |
| | | <a-button type="link" @click="openWaitQty(record)">{{ text }}</a-button> |
| | | </template> |
| | | </template> |
| | | </a-table> |
| | | |
| | | <WorkTaskView ref="workTaskChild" /> |
| | | <CompleteTaskView ref="completeTaskChild" /> |
| | | <WaitTaskView ref="waitTaskChild" /> |
| | | </a-modal> |
| | | </div> |
| | | </template> |
| | |
| | | isRouterAlive.value = false; |
| | | nextTick(() => { |
| | | isRouterAlive.value = true; |
| | | message.success(formatMessage('common.success', '加载成功')); |
| | | // message.success(formatMessage('common.success', '加载成功')); |
| | | }) |
| | | } catch (error) { |
| | | message.error(formatMessage('common.fail', '加载失败')); |
| | |
| | | </div> |
| | | <router-view v-slot="{ Component, route }" v-if="isRouterAlive"> |
| | | <keep-alive :include="routerCache"> |
| | | <component :is="Component" /> |
| | | <component :is="Component" @pageReload="reloadTabs" /> |
| | | </keep-alive> |
| | | </router-view> |
| | | </a-layout-content> |
| | |
| | | let result = resp.data; |
| | | if (result.code === 200) { |
| | | message.success(isSave.value ? formatMessage('page.add.success', '新增成功') : formatMessage('page.update.success', '更新成功')); |
| | | emit('tableReload', 'reload') |
| | | } else { |
| | | message.error(result.msg); |
| | | } |
| | | emit('tableReload', 'reload') |
| | | nextTick(() => { |
| | | formTable.value.resetFields() |
| | | }) |
| | |
| | | zpalletBarcodeQuery(e) |
| | | } |
| | | |
| | | const handleSearchChange = (e) =>{ |
| | | const handleSearchChange = (e) => { |
| | | orderQuery(e); |
| | | } |
| | | |
| | |
| | | let result = await orderDetlQuery(id); |
| | | let tmp = [] |
| | | result.data.forEach((item) => { |
| | | let count = item.anfme - item.qty - item.workQty; |
| | | let count = item.anfme - item.qty - item.workQty - item.waitQty; |
| | | tmp.push({ |
| | | value: item.id, |
| | | label: item.mat$.matnr + '-' + count, |
| | |
| | | |
| | | const router = useRouter(); |
| | | |
| | | const emit = defineEmits(['pageReload']) |
| | | |
| | | const TABLE_KEY = 'table-waitPakin'; |
| | | let currentPage = 1; |
| | | let pageSize = 10; |
| | |
| | | } |
| | | |
| | | function handleTableReload(value) { |
| | | getPage() |
| | | emit('pageReload', 'reload') |
| | | } |
| | | |
| | | const generateTask = () => { |
| | |
| | | return R.ok().add(waitPakinService.getById(id)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:waitPakin:list')") |
| | | @GetMapping("/waitPakin/orderDetlId/{orderDetlId}") |
| | | public R getByOrderDetlId(@PathVariable("orderDetlId") Long orderDetlId) { |
| | | return R.ok().add(waitPakinService.getByOrderDetlId(orderDetlId)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('asrs:waitPakin:save')") |
| | | @OperationLog("添加组托通知档") |
| | | @PostMapping("/waitPakin/save") |
| | |
| | | return R.error("托盘正在入库中"); |
| | | } |
| | | |
| | | if (!waitPakinService.save(waitPakin)) { |
| | | return R.error("添加失败"); |
| | | //查询是否存在相同明细和托盘码的组托通知档 |
| | | WaitPakin waitPakin1 = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, waitPakin.getBarcode()).eq(WaitPakin::getDetlId, waitPakin.getDetlId())); |
| | | if (waitPakin1 == null) { |
| | | //不存在组托通知档,创建 |
| | | if (!waitPakinService.save(waitPakin)) { |
| | | return R.error("添加失败"); |
| | | } |
| | | }else { |
| | | //存在组托通知档,更新 |
| | | waitPakin1.setAnfme(waitPakin1.getAnfme() + waitPakin.getAnfme()); |
| | | waitPakin1.setUpdateTime(new Date()); |
| | | if (!waitPakinService.updateById(waitPakin1)) { |
| | | return R.error("添加失败"); |
| | | } |
| | | } |
| | | |
| | | OrderDetl orderDetl = orderDetlService.getById(waitPakin.getDetlId()); |
| | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | 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.OrderService; |
| | | import com.zy.asrs.wms.asrs.service.WaitPakinService; |
| | | import com.zy.asrs.wms.system.entity.Host; |
| | | import com.zy.asrs.wms.system.entity.User; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | |
| | | // null // 备注 |
| | | // ); |
| | | |
| | | //获取组托数量 |
| | | public Double getWaitQty(){ |
| | | Double qty = 0D; |
| | | WaitPakinService service = SpringUtils.getBean(WaitPakinService.class); |
| | | List<WaitPakin> waitPakins = service.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getDetlId, id)); |
| | | for (WaitPakin waitPakin : waitPakins) { |
| | | qty += waitPakin.getAnfme(); |
| | | } |
| | | return qty; |
| | | } |
| | | |
| | | public String getOrderId$(){ |
| | | OrderService service = SpringUtils.getBean(OrderService.class); |
| | | Order order = service.getById(this.orderId); |
| | |
| | | @SelectProvider(type = SqlProvider.class, method = "createViewSql") |
| | | void createView(@Param("list") List<MatField> list); |
| | | |
| | | |
| | | @SelectProvider(type = SqlProvider.class, method = "createLocDetlView") |
| | | void createLocDetlView(); |
| | | |
| | | class SqlProvider { |
| | | public String createViewSql(Map<String, Object> params) { |
| | | List<MatField> list = (List<MatField>) params.get("list"); |
| | |
| | | |
| | | return sql.toString(); |
| | | } |
| | | |
| | | public String createLocDetlView() { |
| | | StringBuilder sql = new StringBuilder(); |
| | | |
| | | sql.append(" CREATE OR REPLACE VIEW view_man_loc_detl AS \n"); |
| | | sql.append(" select * from man_loc_detl ld "); |
| | | sql.append(" left join view_man_loc_detl_field ldf "); |
| | | sql.append(" on ld.id = ldf.detl_id "); |
| | | |
| | | return sql.toString(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.zy.asrs.wms.asrs.entity.WaitPakin; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface WaitPakinService extends IService<WaitPakin> { |
| | | |
| | | List<WaitPakin> getByOrderDetlId(Long orderDetlId); |
| | | |
| | | } |
| | |
| | | public void createView() { |
| | | List<MatField> list = this.list(); |
| | | this.baseMapper.createView(list); |
| | | this.baseMapper.createLocDetlView(); |
| | | } |
| | | |
| | | } |
| | |
| | | package com.zy.asrs.wms.asrs.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.asrs.wms.asrs.mapper.WaitPakinMapper; |
| | | import com.zy.asrs.wms.asrs.entity.WaitPakin; |
| | | import com.zy.asrs.wms.asrs.service.WaitPakinService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | |
| | | @Service("waitPakinService") |
| | | public class WaitPakinServiceImpl extends ServiceImpl<WaitPakinMapper, WaitPakin> implements WaitPakinService { |
| | | |
| | | @Override |
| | | public List<WaitPakin> getByOrderDetlId(Long orderDetlId) { |
| | | return this.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getDetlId, orderDetlId)); |
| | | } |
| | | } |
| | |
| | | locDetlField.setDetlId(locDetl.getId()); |
| | | locDetlField.setFieldId(detlField.getFieldId()); |
| | | locDetlField.setName(detlField.getName()); |
| | | locDetlField.setValue(detlField.getValue()); |
| | | locDetlField.setHostId(hostId); |
| | | if (!locDetlFieldService.save(locDetlField)) { |
| | | throw new CoolException("插入明细扩展字段失败"); |
| | |
| | | } |
| | | |
| | | //组托通知档转历史档 |
| | | WaitPakin waitPakin = waitPakinService.getOne(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, task.getBarcode()).eq(WaitPakin::getHostId, hostId)); |
| | | if (waitPakin == null) { |
| | | List<WaitPakin> waitPakins = waitPakinService.list(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, task.getBarcode()).eq(WaitPakin::getHostId, hostId)); |
| | | if(waitPakins.isEmpty()) { |
| | | throw new CoolException("组托通知档不存在"); |
| | | } |
| | | WaitPakinLog waitPakinLog = new WaitPakinLog(); |
| | | waitPakinLog.sync(waitPakin); |
| | | if (!waitPakinLogService.save(waitPakinLog)) { |
| | | throw new CoolException("组托通知档转历史档失败"); |
| | | } |
| | | for (WaitPakin waitPakin : waitPakins) { |
| | | WaitPakinLog waitPakinLog = new WaitPakinLog(); |
| | | waitPakinLog.sync(waitPakin); |
| | | if (!waitPakinLogService.save(waitPakinLog)) { |
| | | throw new CoolException("组托通知档转历史档失败"); |
| | | } |
| | | |
| | | //删除组托通知档 |
| | | waitPakinService.remove(new LambdaQueryWrapper<WaitPakin>().eq(WaitPakin::getBarcode, task.getBarcode()).eq(WaitPakin::getHostId, hostId)); |
| | | //删除组托通知档 |
| | | waitPakinService.removeById(waitPakin.getId()); |
| | | } |
| | | |
| | | break; |
| | | } |