| | |
| | | <BasicTable @register="registerTable"> |
| | | <template #toolbar> |
| | | <!-- <a-button type="primary" @click="handleRenew"> 批量更新 </a-button> --> |
| | | <a-button type="primary" @click="handleCreate"> 新增物料 </a-button> |
| | | <a-button type="primary" @click="handleCreate" v-if="HasRole"> 新增物料 </a-button> |
| | | </template> |
| | | <template #action="{ record }"> |
| | | <!-- b87079a98deb456a9cfa506bfd1a7bc6 --> |
| | |
| | | confirm: handleDelete.bind(null, record), |
| | | }, |
| | | }, |
| | | { |
| | | icon: 'binding|svg', |
| | | tooltip: '绑定工艺', |
| | | onClick: handleBinding.bind(null, record), |
| | | }, |
| | | // { |
| | | // icon: 'binding|svg', |
| | | // tooltip: '绑定工艺', |
| | | // onClick: handleBinding.bind(null, record), |
| | | // }, |
| | | ]" |
| | | /> |
| | | </template> |
| | |
| | | import { useModal } from '/@/components/Modal'; |
| | | import { getListByPage } from '/@/api/tigerapi/system'; |
| | | import { useGo } from '/@/hooks/web/usePage'; |
| | | import { useRouter } from 'vue-router'; |
| | | import { onMounted, ref } from 'vue'; |
| | | import { getMenuButtons } from '/@/api/sys/menu'; |
| | | import { useUserStore } from '/@/store/modules/user'; |
| | | |
| | | const go = useGo(); |
| | | const { currentRoute } = useRouter(); |
| | | const [registerDrawer, { openDrawer }] = useDrawer(); |
| | | const [registerModal, { openModal: openMaterialModal }] = useModal(); |
| | | const buttons = ref([]); |
| | | const HasRole = ref(false); |
| | | const [registerTable, { reload }] = useTable({ |
| | | title: '物料列表', |
| | | api: getListByPage, |
| | |
| | | }); |
| | | } |
| | | |
| | | onMounted(async () => { |
| | | buttons.value = (await getMenuButtons(currentRoute.value.meta.menuCode as string)).Data.Items; |
| | | const roles = useUserStore().getUserInfo.roles; |
| | | HasRole.value = roles.some((item) => item.MENU_CODE === buttons.value[0]['FUNC_CODE']); |
| | | }); |
| | | |
| | | /** |
| | | * @description: 跳转产品工艺绑定页面 |
| | | * @param {*} record |