| | |
| | | <MeslineDrawer @register="registerDrawer" @success="handleSuccess" /> |
| | | </div> |
| | | </template> |
| | | <script lang="ts"> |
| | | import { defineComponent } from 'vue'; |
| | | |
| | | <script lang="ts" setup> |
| | | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| | | |
| | | import { useDrawer } from '/@/components/Drawer'; |
| | | import MeslineDrawer from './MeslineDrawer.vue'; |
| | | |
| | | import { columns, searchFormSchema } from './mesline.data'; |
| | | import { DeleteLine, getMeslineListByPage } from '../../../../api/tigerapi/bas/mesline'; |
| | | import { DeleteEntity, getListByPage } from '/@/api/tigerapi/system'; |
| | | |
| | | export default defineComponent({ |
| | | name: 'MeslineManagement', |
| | | components: { BasicTable, MeslineDrawer, TableAction }, |
| | | setup() { |
| | | const [registerDrawer, { openDrawer }] = useDrawer(); |
| | | const [registerTable, { reload }] = useTable({ |
| | | title: '产线列表', |
| | | api: getMeslineListByPage, |
| | | columns, |
| | | formConfig: { |
| | | labelWidth: 120, |
| | | schemas: searchFormSchema, |
| | | }, |
| | | useSearchForm: true, |
| | | showTableSetting: true, |
| | | bordered: true, |
| | | showIndexColumn: false, |
| | | actionColumn: { |
| | | width: 80, |
| | | title: '操作', |
| | | dataIndex: 'action', |
| | | slots: { customRender: 'action' }, |
| | | }, |
| | | }); |
| | | function handleCreate() { |
| | | openDrawer(true, { |
| | | isUpdate: false, |
| | | }); |
| | | } |
| | | |
| | | function handleEdit(record: Recordable) { |
| | | openDrawer(true, { |
| | | record, |
| | | isUpdate: true, |
| | | }); |
| | | } |
| | | |
| | | function handleDelete(record: Recordable) { |
| | | console.log(record); |
| | | //删除产线 |
| | | const apiAction = DeleteLine(record); |
| | | apiAction.then((action) => { |
| | | if (action.IsSuccessed) { |
| | | reload(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function handleSuccess() { |
| | | reload(); |
| | | } |
| | | |
| | | return { |
| | | registerTable, |
| | | registerDrawer, |
| | | handleCreate, |
| | | handleEdit, |
| | | handleDelete, |
| | | handleSuccess, |
| | | }; |
| | | const [registerDrawer, { openDrawer }] = useDrawer(); |
| | | const [registerTable, { reload }] = useTable({ |
| | | title: '产线列表', |
| | | api: getListByPage, |
| | | searchInfo: { TABLE_NAME: 'MES_LINE' }, |
| | | columns, |
| | | formConfig: { |
| | | labelWidth: 120, |
| | | schemas: searchFormSchema, |
| | | }, |
| | | useSearchForm: true, |
| | | showTableSetting: true, |
| | | bordered: true, |
| | | showIndexColumn: false, |
| | | actionColumn: { |
| | | width: 80, |
| | | title: '操作', |
| | | dataIndex: 'action', |
| | | slots: { customRender: 'action' }, |
| | | }, |
| | | }); |
| | | function handleCreate() { |
| | | openDrawer(true, { |
| | | isUpdate: false, |
| | | }); |
| | | } |
| | | |
| | | function handleEdit(record: Recordable) { |
| | | openDrawer(true, { |
| | | record, |
| | | isUpdate: true, |
| | | }); |
| | | } |
| | | |
| | | function handleDelete(record: Recordable) { |
| | | console.log(record); |
| | | //删除产线 |
| | | const apiAction = DeleteEntity(record, 'MES_LINE'); |
| | | apiAction.then((action) => { |
| | | if (action.IsSuccessed) { |
| | | reload(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function handleSuccess() { |
| | | reload(); |
| | | } |
| | | </script> |