| | |
| | | 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 { message, Modal, Col, Divider, Row, Flex } from 'ant-design-vue';
|
| | | import { logout } from '@/config.js';
|
| | | import EditView from './edit.vue'
|
| | | import InitView from './init.vue'
|
| | |
| | | </script>
|
| | |
|
| | | <template>
|
| | | <div style="display: flex;">
|
| | | <a-card :title="formatMessage('db.man_loc_area_type.type_id', '库位类型')" style="flex: 3;margin-right: 30px;">
|
| | | <a-input v-model:value="searchLocType" @change="handleLocAreaTypeDept"
|
| | | :placeholder="formatMessage('page.input', '请输入')" style="margin-bottom: 8px" />
|
| | | <a-tree v-model:expandedKeys="locTypeExpandedKeys" @select="handleLocTypeSelected"
|
| | | :tree-data="locTypeData" blockNode>
|
| | | <template #title="{ name }">
|
| | | <span>{{ name }}</span>
|
| | | </template>
|
| | | </a-tree>
|
| | | </a-card>
|
| | |
|
| | | <a-card style="flex: 10;">
|
| | | <InitView ref="initChild" @tableReload="handleTableReload" />
|
| | | <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="handleInit(null)" type="primary">{{ formatMessage('page.init', '初始化') }}</a-button>
|
| | | <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" :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="handleEdit(record)">{{ formatMessage('page.edit', '编辑')
|
| | | }}</a-button>
|
| | | <a-button type="link" danger @click="handleDel([record])">{{ formatMessage('page.delete', '删除')
|
| | | }}</a-button>
|
| | | </div>
|
| | | <Row>
|
| | | <Col :span="5">
|
| | | <a-card :title="formatMessage('db.man_loc_area_type.type_id', '库位类型')" style="flex: 3;margin-right: 30px;">
|
| | | <a-input v-model:value="searchLocType" @change="handleLocAreaTypeDept"
|
| | | :placeholder="formatMessage('page.input', '请输入')" style="margin-bottom: 8px" />
|
| | | <a-tree v-model:expandedKeys="locTypeExpandedKeys" @select="handleLocTypeSelected"
|
| | | :tree-data="locTypeData" blockNode>
|
| | | <template #title="{ name }">
|
| | | <span>{{ name }}</span>
|
| | | </template>
|
| | | </template>
|
| | | </a-table>
|
| | | </a-card>
|
| | | </div>
|
| | | </a-tree>
|
| | | </a-card>
|
| | | </Col>
|
| | | <Col :span="19">
|
| | | <a-card style="flex: 10;">
|
| | | <InitView ref="initChild" @tableReload="handleTableReload" />
|
| | | <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="handleInit(null)" type="primary">{{ formatMessage('page.init', '初始化') }}</a-button>
|
| | | <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" :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="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>
|
| | | </a-card>
|
| | | </Col>
|
| | | </Row>
|
| | | </template>
|
| | |
|
| | | <style></style>
|