| | |
| | | <script setup> |
| | | import { getCurrentInstance, ref, computed, reactive, defineProps } from 'vue'; |
| | | import { useRouter } from "vue-router"; |
| | | import { get, post, postBlob } from '@/utils/request.js' |
| | | import { get, post, postBlob, postForm } from '@/utils/request.js' |
| | | import { message, Modal } from 'ant-design-vue'; |
| | | import { globalState, logout } from '@/config.js'; |
| | | import EditView from './edit.vue' |
| | |
| | | let currentPage = 1; |
| | | let pageSize = 10; |
| | | const searchInput = ref("") |
| | | const searchParam = ref({ |
| | | orderNo: null, |
| | | orderType: null, |
| | | orderSettle: null, |
| | | }) |
| | | const editChild = ref(null) |
| | | const showOrderDetlChild = ref(null) |
| | | |
| | |
| | | current: currentPage, |
| | | pageSize: pageSize, |
| | | condition: searchInput.value, |
| | | _param: searchParam.value, |
| | | }).then((resp) => { |
| | | let result = resp.data; |
| | | if (result.code == 200) { |
| | |
| | | |
| | | const handleExport = async (intl) => { |
| | | postBlob('/api/order/export', { |
| | | ioModel: props.ioModel |
| | | ioModel: props.ioModel, |
| | | condition: searchInput.value, |
| | | _param: searchParam.value, |
| | | }).then(result => { |
| | | const blob = new Blob([result.data], { type: 'application/vnd.ms-excel' }); |
| | | window.location.href = window.URL.createObjectURL(blob); |
| | |
| | | } |
| | | }; |
| | | |
| | | const orderTypeQueryList = ref(null); |
| | | orderTypeQuery(); |
| | | function orderTypeQuery() { |
| | | postForm('/api/orderType/query', { |
| | | type: 1 |
| | | }).then(resp => { |
| | | let result = resp.data; |
| | | orderTypeQueryList.value = result.data; |
| | | }) |
| | | } |
| | | const orderSettleQueryList = ref(null); |
| | | orderSettleQuery(); |
| | | function orderSettleQuery() { |
| | | postForm('/api/orderSettle/query', {}).then(resp => { |
| | | let result = resp.data; |
| | | orderSettleQueryList.value = result.data; |
| | | }) |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <script> |
| | |
| | | <EditView ref="editChild" @tableReload="handleTableReload" |
| | | :ioModel="ioModel == 'in' ? 1 : ioModel == 'out' ? 2 : null" /> |
| | | <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.orderNo" :placeholder="formatMessage('page.order.orderNo.input', '请输入订单编号')" |
| | | style="width: 140px;margin-right: 10px;" /> |
| | | <a-select v-model:value="searchParam.orderSettle" :placeholder="formatMessage('page.order.orderSettle.select', '请选择单据状态')" |
| | | style="width: 140px;margin-right: 10px;" show-search allowClear :options="orderSettleQueryList" optionFilterProp="label" |
| | | optionLabelProp="label"> |
| | | </a-select> |
| | | <a-select v-model:value="searchParam.orderType" :placeholder="formatMessage('page.order.orderType.select', '请选择单据类型')" |
| | | style="width: 140px;margin-right: 10px;" show-search allowClear :options="orderTypeQueryList" optionFilterProp="label" |
| | | optionLabelProp="label"> |
| | | </a-select> |
| | | |
| | | <a-input-search v-model:value="searchInput" :placeholder="formatMessage('page.input', '请输入')" |
| | | style="width: 200px;" @search="onSearch" /> |
| | | </div> |
| | | <div class="table-header-right"> |
| | | <a-dropdown> |
| | | <template #overlay> |
| | |
| | | <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" :loading="state.loading"> |
| | | :scroll="{ y: 768, scrollToFirstRowOnChange: true }" :columns="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;"> |