| | |
| | | import { logout } from '@/config.js';
|
| | | import EditView from './edit.vue'
|
| | | import { formatMessage } from '@/utils/localeUtils.js';
|
| | | import LocsPrint from '@/components/print/locsPrint/index.vue';
|
| | | import useTableSearch from '@/utils/tableUtils.jsx';
|
| | | const context = getCurrentInstance()?.appContext.config.globalProperties;
|
| | |
|
| | |
| | | const TABLE_KEY = 'table-loc';
|
| | | let currentPage = 1;
|
| | | let pageSize = 10;
|
| | | let printDisable = true
|
| | | const printChild = ref("")
|
| | | const searchInput = ref("")
|
| | | const searchParam = ref({
|
| | | locNo: null,
|
| | |
| | | const state = reactive({
|
| | | selectedRowKeys: [],
|
| | | loading: false,
|
| | | selectRecords: []
|
| | | });
|
| | |
|
| | | let tableData = ref([]);
|
| | |
| | | }, 1000);
|
| | | };
|
| | | const onSelectChange = selectedRowKeys => {
|
| | | // console.log('selectedRowKeys changed: ', selectedRowKeys);
|
| | | let printData = [];
|
| | | console.log('selectedRowKeys changed: ', selectedRowKeys);
|
| | | state.selectedRowKeys = selectedRowKeys;
|
| | | state.selectRecords = tableData.value.records.filter(item => {
|
| | | return selectedRowKeys.includes(item.id)
|
| | | })
|
| | |
|
| | | if (state.selectRecords.length > 0) {
|
| | | printDisable = false
|
| | | } else {
|
| | | printDisable = true
|
| | | }
|
| | | };
|
| | |
|
| | | const handlePrint = (item) => {
|
| | | printChild.value.printData = state.selectRecords;
|
| | | printChild.value.open = true;
|
| | | }
|
| | |
|
| | | function getPage() {
|
| | | state.loading = true;
|
| | |
| | | if (result.code == 200) {
|
| | | let data = result.data;
|
| | | tableData.value = data;
|
| | |
|
| | | state.loading = false;
|
| | | } else if (result.code === 401) {
|
| | | message.error(result.msg);
|
| | |
| | | style="width: 200px;" @search="onSearch" />
|
| | | </div>
|
| | | <div class="table-header-right">
|
| | | <a-button @click="handlePrint(null)" type="primary" :disabled="printDisable">{{ formatMessage('page.add', '打印')
|
| | | }}</a-button>
|
| | | <a-button @click="handleEdit(null)" type="primary">{{ formatMessage('page.add', '添加') }}</a-button>
|
| | | <a-button @click="handleExport">{{ formatMessage('page.export', '导出') }}</a-button>
|
| | | </div>
|
| | |
| | | </template>
|
| | | </template>
|
| | | </a-table>
|
| | | <LocsPrint ref="printChild" />
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | <style></style>
|