| | |
| | | v-bind="$attrs" |
| | | ok-text="保存" |
| | | @register="register" |
| | | :title="t('导入工单料站表')" |
| | | :title="t(props.title)" |
| | | @ok="handleSubmit" |
| | | > |
| | | <a-button style="position: relative; left: 100px" @click="aoaToExcel" class="m-3"> |
| | | 模板 |
| | | </a-button> |
| | | <ImpExcel |
| | | style="width: 100px; position: relative; top: -56px" |
| | | @success="loadDataSuccess" |
| | | dateFormat="YYYY-MM-DD" |
| | | > |
| | | <a-button class="m-3"> 导入Excel </a-button> |
| | | </ImpExcel> |
| | | |
| | | <div class="high-form"> |
| | | <p style="color: red" v-text="err"></p> |
| | | <a-card style="position: relative; top: -55px" :title="t('列表')" :bordered="false"> |
| | | <!-- :columns="dtlColumns" |
| | | :dataSource="data" --> |
| | | <PageWrapper dense contentClass="flex"> |
| | | <BasicTable |
| | | :maxHeight="500" |
| | | v-for="(table, index) in tableListRef" |
| | | :key="index" |
| | | :title="table.title" |
| | | :columns="table.columns" |
| | | :dataSource="table.dataSource" |
| | | /> |
| | | </PageWrapper> |
| | | </a-card> |
| | | > |
| | | <template #toolbar> |
| | | <a-button @click="aoaToExcel" color="primary" preIcon="tmpDownload-white|svg"> |
| | | 模板 |
| | | </a-button> |
| | | <ImpExcel @success="loadDataSuccess" dateFormat="YYYY-MM-DD"> |
| | | <a-button class="m-3" preIcon="excel-import|svg"> 导入Excel </a-button> |
| | | </ImpExcel> |
| | | </template> |
| | | </BasicTable> |
| | | </div> |
| | | </BasicModal> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent, ref, nextTick, unref, h } from 'vue'; |
| | | import { Tag, Tooltip } from 'ant-design-vue'; |
| | | <script lang="ts" setup> |
| | | import { ref, nextTick, unref, h } from 'vue'; |
| | | import { Tag, Tooltip, Card } from 'ant-design-vue'; |
| | | import { BasicModal, useModalInner } from '/@/components/Modal'; |
| | | import { BasicForm, FormSchema, useForm } from '/@/components/Form/index'; |
| | | import { SaveSmttable, ExportTable, SaveExportTable } from '/@/api/tigerapi/mes/smt/smttable'; |
| | | import { useI18n } from '/@/hooks/web/useI18n'; |
| | | import { aoaToSheetXlsx, ImpExcel, ExcelData } from '/@/components/Excel'; |
| | | import { useMessage } from '/@/hooks/web/useMessage'; |
| | | import { useLocale } from '/@/locales/useLocale'; |
| | | import { PageWrapper } from '/@/components/Page'; |
| | | import { BasicTable, BasicColumn } from '/@/components/Table'; |
| | | |
| | | const emit = defineEmits(['success', 'register', 'toExcel']); |
| | | const props = defineProps({ |
| | | title: { |
| | | type: String, |
| | | default: '', |
| | | }, |
| | | mtitle: { |
| | | type: String, |
| | | default: '', |
| | | }, |
| | | arr: { |
| | | type: Array, |
| | | default: () => [1, 2, 3, 4], |
| | | }, |
| | | }); |
| | | const ACard = Card; |
| | | const { getLocale } = useLocale(); |
| | | |
| | | const { t } = useI18n(''); |
| | | const { createMessage, createConfirm } = useMessage(); |
| | | export default defineComponent({ |
| | | components: { BasicModal, BasicForm, PageWrapper, ImpExcel, BasicTable }, |
| | | props: { |
| | | userData: { type: Object }, |
| | | }, |
| | | emit: ['success', 'register'], |
| | | setup(_, { emit }) { |
| | | const modelRef = ref({}); |
| | | const tableListRef = ref< |
| | | { |
| | |
| | | dataSource?: any[]; |
| | | }[] |
| | | >([]); |
| | | |
| | | const [register, { setModalProps, closeModal }] = useModalInner((data) => { |
| | | setModalProps({ confirmLoading: false }); |
| | | tableListRef.value = []; |
| | | tableListRef.value = [ |
| | | { |
| | | title: '列表信息', |
| | | columns: [ |
| | | { |
| | | title: '字段1', |
| | | dataIndex: 'field1', |
| | | width: 200, |
| | | sorter: true, |
| | | resizable: true, |
| | | }, |
| | | { |
| | | title: '字段2', |
| | | dataIndex: 'field2', |
| | | width: 200, |
| | | sorter: true, |
| | | resizable: true, |
| | | }, |
| | | ], |
| | | dataSource: [], |
| | | }, |
| | | ]; |
| | | }); |
| | | var err = ref(''); |
| | | async function loadDataSuccess(excelDataList: ExcelData[]) { |
| | |
| | | setModalProps({ confirmLoading: false }); |
| | | } |
| | | } |
| | | |
| | | return { |
| | | register, |
| | | model: modelRef, |
| | | handleSubmit, |
| | | loadDataSuccess, |
| | | tableListRef, |
| | | err, |
| | | t, |
| | | aoaToExcel, |
| | | }; |
| | | }, |
| | | }); |
| | | </script> |
| | | <style lang="less" scoped> |
| | | .high-form { |
| | | padding: 5px 10px 10px 10px; |
| | | background: #f5f9fe; |
| | | } |
| | | </style> |