| | |
| | | import { logout } from '@/config.js'; |
| | | import { formatMessage } from '@/utils/localeUtils.js'; |
| | | import useTableSearch from '@/utils/tableUtils.jsx'; |
| | | import WorkTaskView from '@/components/order/workTask/index.vue' |
| | | import CompleteTaskView from '@/components/order/completeTask/index.vue' |
| | | import WaitTaskView from '@/components/order/waitTask/index.vue' |
| | | const context = getCurrentInstance()?.appContext.config.globalProperties; |
| | | |
| | | const router = useRouter(); |
| | |
| | | orderType$: '', |
| | | orderSettle$: '', |
| | | }); |
| | | const workTaskChild = ref(null) |
| | | const completeTaskChild = ref(null) |
| | | const waitTaskChild = ref(null) |
| | | |
| | | const showWidth = ref("60%") |
| | | getColumns(); |
| | | |
| | | const { |
| | |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_loc_detl.matnr', '物料号'), |
| | | title: formatMessage('db.man_loc_detl.matnr', '商品编号'), |
| | | dataIndex: 'matnr', |
| | | width: 140, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_loc_detl.maktx', '物料名'), |
| | | title: formatMessage('db.man_loc_detl.maktx', '商品名称'), |
| | | dataIndex: 'maktx', |
| | | width: 140, |
| | | ellipsis: true, |
| | |
| | | { |
| | | title: formatMessage('db.man_loc_detl.anfme', '数量'), |
| | | dataIndex: 'anfme', |
| | | width: 140, |
| | | ellipsis: true, |
| | | editable: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_loc_detl.qty', '已完成数量'), |
| | | dataIndex: 'qty', |
| | | width: 140, |
| | | ellipsis: true, |
| | | editable: true, |
| | | }, |
| | | { |
| | | 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, |
| | |
| | | openDetl.value = false; |
| | | } |
| | | |
| | | watch(orderId, (newVal, oldVal) => { |
| | | get("/api/orderDetl/orderId/" + newVal, {}).then((resp) => { |
| | | let result = resp.data; |
| | | let index = 1; |
| | | let tmp = []; |
| | | result.data.forEach((item) => { |
| | | let data = { |
| | | _id: index++, |
| | | detlId: item.id, |
| | | matnr: item.mat$.matnr, |
| | | maktx: item.mat$.maktx, |
| | | batch: item.batch, |
| | | anfme: item.anfme, |
| | | memo: item.memo |
| | | }; |
| | | fieldList.forEach((field) => { |
| | | data[field] = item[field]; |
| | | }) |
| | | tmp.push(data) |
| | | }) |
| | | tableData.value = tmp; |
| | | }) |
| | | const handleCancel = () => { |
| | | openDetl.value = false; |
| | | orderId.value = null; |
| | | } |
| | | |
| | | get("/api/order/" + newVal, {}).then((resp) => { |
| | | let result = resp.data; |
| | | orderInfo.value = result.data; |
| | | }) |
| | | watch(orderId, (newVal, oldVal) => { |
| | | if (newVal != null) { |
| | | get("/api/orderDetl/orderId/" + newVal, {}).then((resp) => { |
| | | let result = resp.data; |
| | | let index = 1; |
| | | let tmp = []; |
| | | result.data.forEach((item) => { |
| | | let data = { |
| | | _id: index++, |
| | | detlId: item.id, |
| | | matnr: item.mat$.matnr, |
| | | maktx: item.mat$.maktx, |
| | | batch: item.batch, |
| | | anfme: item.anfme, |
| | | qty: item.qty, |
| | | workQty: item.workQty, |
| | | waitQty: item.waitQty, |
| | | memo: item.memo |
| | | }; |
| | | fieldList.forEach((field) => { |
| | | data[field] = item[field]; |
| | | }) |
| | | tmp.push(data) |
| | | }) |
| | | tableData.value = tmp; |
| | | }) |
| | | |
| | | get("/api/order/" + newVal, {}).then((resp) => { |
| | | let result = resp.data; |
| | | if(result.data != null) { |
| | | orderInfo.value = result.data; |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | const openWorkTask = (record) => { |
| | | workTaskChild.value.open = true; |
| | | workTaskChild.value.showWidth = '55%'; |
| | | workTaskChild.value.orderDetlId = record.detlId; |
| | | } |
| | | |
| | | const openCompleteQty = (record) => { |
| | | completeTaskChild.value.open = true; |
| | | completeTaskChild.value.showWidth = '55%'; |
| | | completeTaskChild.value.orderDetlId = record.detlId; |
| | | } |
| | | |
| | | const openWaitQty = (record) => { |
| | | waitTaskChild.value.open = true; |
| | | waitTaskChild.value.showWidth = '55%'; |
| | | waitTaskChild.value.orderDetlId = record.detlId; |
| | | } |
| | | |
| | | defineExpose({ |
| | | tableData, |
| | | orderId, |
| | | openDetl, |
| | | showWidth, |
| | | }) |
| | | |
| | | </script> |
| | |
| | | |
| | | <template> |
| | | <div> |
| | | <a-modal v-model:open="openDetl" width="60%" @ok="handleOk"> |
| | | <h3> |
| | | 订单号:{{ orderInfo.orderNo }} |
| | | </h3> |
| | | <h3> |
| | | 单据类型:{{ orderInfo.orderType$ }} |
| | | </h3> |
| | | <h3> |
| | | 单据状态:{{ orderInfo.orderSettle$ }} |
| | | </h3> |
| | | <a-modal v-model:open="openDetl" :width="showWidth" @ok="handleOk" @cancel="handleCancel"> |
| | | <div class="component-header"> |
| | | <div> |
| | | <h3> |
| | | 订单号:{{ orderInfo.orderNo }} |
| | | </h3> |
| | | <h3> |
| | | 单据类型:{{ orderInfo.orderType$ }} |
| | | </h3> |
| | | <h3> |
| | | 单据状态:{{ orderInfo.orderSettle$ }} |
| | | </h3> |
| | | </div> |
| | | <div class="qrcode"> |
| | | <a-qrcode :value="orderInfo.orderNo" :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 === 'workQty'"> |
| | | <a-button type="link" @click="openWorkTask(record)">{{ text }}</a-button> |
| | | </template> |
| | | |
| | | <template v-if="column.dataIndex === 'qty'"> |
| | | <a-button type="link" @click="openCompleteQty(record)">{{ text }}</a-button> |
| | | </template> |
| | | |
| | | <template 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> |
| | | |
| | | <style></style> |
| | | <style> |
| | | .component-header { |
| | | display: flex; |
| | | } |
| | | |
| | | .component-header>div { |
| | | flex: 1; |
| | | } |
| | | |
| | | .qrcode { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | margin-right: 30px; |
| | | } |
| | | </style> |