| | |
| | | <script setup> |
| | | import { getCurrentInstance, ref, computed, reactive } from 'vue'; |
| | | import { getCurrentInstance, ref, computed, reactive, watch } from 'vue'; |
| | | import { useRouter } from "vue-router"; |
| | | import { get, post, postBlob } from '@/utils/request.js' |
| | | import { message, Modal } from 'ant-design-vue'; |
| | |
| | | import EditView from './edit.vue' |
| | | import { formatMessage } from '@/utils/localeUtils.js'; |
| | | import useTableSearch from '@/utils/tableUtils.jsx'; |
| | | import OrderOutMergePreviewView from '@/components/orderOut/orderOutMergePreview/index.vue'; |
| | | import OrderOutWavePreviewView from '@/components/orderOut/orderOutWavePreview/index.vue'; |
| | | const context = getCurrentInstance()?.appContext.config.globalProperties; |
| | | |
| | | const router = useRouter(); |
| | |
| | | let currentPage = 1; |
| | | let pageSize = 10; |
| | | const searchInput = ref("") |
| | | const searchParam = ref({ |
| | | waveNo: null, |
| | | matnr: null, |
| | | batch: null, |
| | | }) |
| | | const editChild = ref(null) |
| | | const orderOutMergePreviewChild = ref(null); |
| | | const orderOutWavePreviewChild = ref(null); |
| | | |
| | | const state = reactive({ |
| | | selectedRowKeys: [], |
| | | loading: false, |
| | | columns: [], |
| | | }); |
| | | |
| | | let tableData = ref([]); |
| | | getPage(); |
| | |
| | | rowSpan: count, |
| | | }; |
| | | } |
| | | |
| | | const state = reactive({ |
| | | selectedRowKeys: [], |
| | | loading: false, |
| | | columns: [], |
| | | }); |
| | | |
| | | state.columns = [ |
| | | { |
| | |
| | | }, |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wave.orderNo', '订单号'), |
| | | dataIndex: ['orderNo'], |
| | | title: formatMessage('db.man_wave.waveStatus$', '状态'), |
| | | dataIndex: 'waveStatus$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('waveType$'), |
| | | ...getColumnSearchProps('waveStatus$'), |
| | | customCell: (_, index) => { |
| | | return customColSpanProps(index) |
| | | }, |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wave.matnr', '商品编号'), |
| | |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wave.batch', '批号'), |
| | | dataIndex: ['mat$', 'batch'], |
| | | dataIndex: ['batch'], |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('batch'), |
| | |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('anfme'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.man_wave.work_qty', '工作数量'), |
| | | dataIndex: ['workQty'], |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('workQty'), |
| | | }, |
| | | |
| | | ]; |
| | |
| | | }; |
| | | |
| | | function getPage() { |
| | | state.loading = true; |
| | | |
| | | post('/api/wave/page', { |
| | | current: currentPage, |
| | | pageSize: pageSize, |
| | | condition: searchInput.value |
| | | condition: searchInput.value, |
| | | _param: searchParam.value, |
| | | }).then((resp) => { |
| | | let result = resp.data; |
| | | if (result.code == 200) { |
| | |
| | | data.forEach((item) => { |
| | | let count = 0; |
| | | |
| | | item.waveDetlList.forEach((val) => { |
| | | count += val.orderDetl$.length; |
| | | val.orderDetl$.forEach((detl) => { |
| | | detl.key = idx; |
| | | detl.waveNo = item.waveNo; |
| | | detl.waveId = item.id; |
| | | detl.waveType = item.waveType; |
| | | detl.waveType$ = item.waveType$; |
| | | tmp.push(detl) |
| | | }) |
| | | item.waveDetlList.forEach((detl) => { |
| | | detl.waveStatus = item.waveStatus; |
| | | detl.waveStatus$ = item.waveStatus$; |
| | | detl.waveType = item.waveType; |
| | | detl.waveType$ = item.waveType$; |
| | | |
| | | count++; |
| | | tmp.push(detl) |
| | | }) |
| | | |
| | | colSpan[idx] = count; |
| | |
| | | tableDataColSpan = colSpan; |
| | | tableData.value = tmp; |
| | | |
| | | console.log(tmp); |
| | | state.loading = false; |
| | | |
| | | } else if (result.code === 401) { |
| | | message.error(result.msg); |
| | |
| | | // editChild.value.isSave = item == null; |
| | | // } |
| | | |
| | | const handleGenerateOut = (item) => { |
| | | console.log(item); |
| | | |
| | | get('/api/wave/list/' + item.waveId, {}).then(resp => { |
| | | let result = resp.data; |
| | | let data = result.data; |
| | | let orderIds = [] |
| | | data.forEach((item) => { |
| | | orderIds.push(item.orderId) |
| | | }) |
| | | |
| | | orderOutMergePreviewChild.value.open = true; |
| | | orderOutMergePreviewChild.value.records = orderIds; |
| | | }) |
| | | const handleGenerateOut = (waveId) => { |
| | | orderOutWavePreviewChild.value.open = true; |
| | | orderOutWavePreviewChild.value.waveId = waveId; |
| | | } |
| | | |
| | | const handleDel = (rows) => { |
| | | Modal.confirm({ |
| | | title: formatMessage('page.delete', '删除'), |
| | | content: formatMessage('page.delete.confirm', '确定删除该项吗?'), |
| | | title: formatMessage('page.cancel', '取消'), |
| | | content: formatMessage('page.cancel.confirm', '确定取消该项吗?'), |
| | | maskClosable: true, |
| | | onOk: async () => { |
| | | const hide = message.loading(formatMessage('common.loading', '请求中')); |
| | |
| | | <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> |
| | | <a-input v-model:value="searchParam.waveNo" :placeholder="formatMessage('page.wave.waveNo.input', '请输入波次号')" |
| | | style="width: 140px;margin-right: 10px;" /> |
| | | <a-input v-model:value="searchParam.matnr" :placeholder="formatMessage('page.wave.matnr.input', '请输入商品编号')" |
| | | style="width: 140px;margin-right: 10px;" /> |
| | | <a-input v-model:value="searchParam.batch" :placeholder="formatMessage('page.wave.batch.input', '请输入批号')" |
| | | style="width: 140px;margin-right: 10px;" /> |
| | | |
| | | <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '请输入')" |
| | | style="width: 200px;" @search="onSearch" /> |
| | | </div> |
| | | <!-- <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 :data-source="tableData" :defaultExpandAllRows="false" :key="TABLE_KEY" rowKey="index" |
| | | :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="state.columns" @resizeColumn="handleResizeColumn"> |
| | | :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="state.columns" @resizeColumn="handleResizeColumn" |
| | | :loading="state.loading"> |
| | | <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="handleGenerateOut(record)">{{ formatMessage('page.generateOut', |
| | | '生成出库任务') |
| | | <a-button type="link" primary :disabled="record.waveStatus != 0" |
| | | @click="handleGenerateOut(record.waveId)">{{ |
| | | formatMessage('page.generateOut', |
| | | '生成出库任务') |
| | | }}</a-button> |
| | | <a-button type="link" danger @click="handleDel([record])">{{ formatMessage('page.delete', '删除') |
| | | <a-button type="link" danger @click="handleDel([record])">{{ formatMessage('page.cancel', '取消') |
| | | }}</a-button> |
| | | </div> |
| | | </template> |
| | | </template> |
| | | </a-table> |
| | | |
| | | <OrderOutMergePreviewView ref="orderOutMergePreviewChild" @reload="handleChildReload" /> |
| | | <OrderOutWavePreviewView ref="orderOutWavePreviewChild" @reload="handleChildReload" /> |
| | | </div> |
| | | </template> |
| | | |