¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { IDS, PageQuery, PageResult } from '#/api/common'; |
| | | import type { FixBorrowVO } from '#/api/eims/fixture-borrow/model'; |
| | | |
| | | import { commonExport } from '#/api/helper'; |
| | | import { requestClient } from '#/api/request'; |
| | | |
| | | enum Api { |
| | | fixBorrowExport = '/eims/fixBorrow/export', |
| | | fixBorrowImport = '/eims/fixBorrow/importData', |
| | | fixBorrowList = '/eims/fixBorrow/list', |
| | | root = '/eims/fixBorrow' |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ãå·¥å
·åç¨ãå表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export function listFixBorrow(params?: PageQuery) { |
| | | return requestClient.get<PageResult<FixBorrowVO>>(Api.fixBorrowList, { params }); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ãå·¥å
·åç¨ãè¯¦ç» |
| | | * @param fixId |
| | | */ |
| | | export function getFixBorrow(fixId: any) { |
| | | return requestClient.get<FixBorrowVO>(`${Api.root}/${fixId}`); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ãå·¥å
·åç¨ã |
| | | * @param data |
| | | */ |
| | | export function addFixBorrow(data: any) { |
| | | return requestClient.postWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ãå·¥å
·åç¨ã |
| | | * @param data |
| | | */ |
| | | export function updateFixBorrow(data: any) { |
| | | return requestClient.putWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ãå·¥å
·åç¨ã |
| | | * @param fixIds |
| | | */ |
| | | export function delFixBorrow(fixIds: IDS) { |
| | | return requestClient.deleteWithMsg<void>(`${Api.root}/${fixIds}`); |
| | | } |
| | | |
| | | /** |
| | | * 导åºãå·¥å
·åç¨ã |
| | | * @param data |
| | | */ |
| | | export function fixBorrowExport(data: any) { |
| | | return commonExport(Api.fixBorrowExport, data); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface FixBorrowVO { |
| | | /** |
| | | * |
| | | */ |
| | | id: number | string; |
| | | |
| | | /** |
| | | * åç¨å·¥å
·id |
| | | */ |
| | | fixtureId: number | string; |
| | | |
| | | /** |
| | | * åç¨å·¥å
·åç§° |
| | | */ |
| | | fixtureName: string; |
| | | |
| | | /** |
| | | * åç¨é¨é¨ |
| | | */ |
| | | borrowDept: number; |
| | | |
| | | /** |
| | | * åç¨äºº |
| | | */ |
| | | borrowUser: number; |
| | | |
| | | /** |
| | | * ç»å人 |
| | | */ |
| | | agentUser: number; |
| | | |
| | | /** |
| | | * ç»å人 |
| | | */ |
| | | agentUserName: string; |
| | | |
| | | /** |
| | | * åç¨è®°å½ç¶æï¼åå
¸ï¼ |
| | | */ |
| | | status: string; |
| | | |
| | | /** |
| | | * åç¨æ¶é´ |
| | | */ |
| | | borrowTime: string; |
| | | |
| | | /** |
| | | * é¢è®¡å½è¿æ¶é´ |
| | | */ |
| | | planReturnTime: string; |
| | | |
| | | /** |
| | | * å½è¿æ¶é´ |
| | | */ |
| | | returnTime: string; |
| | | |
| | | /** |
| | | * åç¨çç± |
| | | */ |
| | | borrowReason: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import { ref } from 'vue'; |
| | | |
| | | import { useVbenModal } from '@vben/common-ui'; |
| | | |
| | | import { message } from 'ant-design-vue'; |
| | | |
| | | import InnerView from '#/views/eims/fixture/index.vue'; |
| | | |
| | | const emit = defineEmits<{ updateSelect: [any] }>(); |
| | | |
| | | const [BasicModal, modalApi] = useVbenModal({ |
| | | fullscreenButton: false, |
| | | draggable: true, |
| | | onCancel: handleCancel, |
| | | onConfirm: handleConfirm |
| | | }); |
| | | const innerView = ref(); |
| | | |
| | | async function handleConfirm() { |
| | | try { |
| | | modalApi.modalLoading(true); |
| | | const tableSelect = innerView.value.tableSelect(); |
| | | if (tableSelect.length > 1) { |
| | | message.error('æå¤åªè½éæ©ä¸ä¸ªå·¥å
·ï¼'); |
| | | modalApi.modalLoading(false); |
| | | return false; |
| | | } |
| | | emit('updateSelect', tableSelect[0]); |
| | | await handleCancel(); |
| | | } catch (error) { |
| | | console.error(error); |
| | | } finally { |
| | | modalApi.modalLoading(false); |
| | | } |
| | | } |
| | | |
| | | async function handleCancel() { |
| | | modalApi.close(); |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <BasicModal :fullscreen-button="true" class="w-[800px]"> |
| | | <InnerView ref="innerView" /> |
| | | </BasicModal> |
| | | </template> |
| | | |
| | | <style scoped></style> |
| | |
| | | allowClear: true, |
| | | getPopupContainer |
| | | }, |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'equId', |
| | | label: '设å¤id' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'equName', |
| | | label: '设å¤åç§°' |
| | | }, |
| | | { |
| | |
| | | <script setup lang="ts"> |
| | | import { computed, ref } from 'vue'; |
| | | |
| | | import { useVbenDrawer } from '@vben/common-ui'; |
| | | import { useVbenDrawer, useVbenModal } from '@vben/common-ui'; |
| | | import { $t } from '@vben/locales'; |
| | | import { addFullName, cloneDeep, getPopupContainer } from '@vben/utils'; |
| | | |
| | | import { InputSearch } from 'ant-design-vue'; |
| | | |
| | | import { useVbenForm } from '#/adapter/form'; |
| | | import { listEqu } from '#/api/eims/equ'; |
| | | import { addEquStatu, getEquStatu, updateEquStatu } from '#/api/eims/equ-statu'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | import equModal from '#/views/eims/components/equ-modal.vue'; |
| | | |
| | | import { drawerSchema } from './data'; |
| | | |
| | |
| | | // åå§å |
| | | await setupEquSelect(); |
| | | await setupDeptSelect(); |
| | | |
| | | // 设å¤è¯¦æ
页æå¼æå®è®¾å¤id |
| | | const { equId } = drawerApi.getData() as { equId?: number | string }; |
| | | if (equId) { |
| | | await formApi.setValues({ equId}); |
| | | } |
| | | // æ´æ° && èµå¼ |
| | | if (isUpdate.value && id) { |
| | | const record = await getEquStatu(id); |
| | | await formApi.setValues(record); |
| | | if(isUpdate.value && record.userDept){ |
| | | if (isUpdate.value && record.userDept) { |
| | | await setupUserOptions(record.userDept); |
| | | } |
| | | } |
| | | // 设å¤idæå¼æ¶ä¸å
许ç¼è¾ï¼1.ç¼è¾ 2.设å¤è¯¦æ
页æå¼ï¼ |
| | | const flag = equId !== undefined || isUpdate.value; |
| | | formApi.updateSchema([ |
| | | { |
| | | componentProps: { |
| | | disabled: flag |
| | | }, |
| | | fieldName: 'equId' |
| | | } |
| | | ]); |
| | | |
| | | drawerApi.drawerLoading(false); |
| | | } |
| | | }); |
| | |
| | | async function setupEquSelect() { |
| | | const equPageResult = await listEqu({ |
| | | pageNum: 1, |
| | | pageSize: 1000, |
| | | pageSize: 1000 |
| | | }); |
| | | // 使ç¨mapæ¥è·è¸ªå·²ç»éå°çequIdï¼ä½¿ç¨filteræ¥è¿æ»¤æéå¤çå
ç´ ã |
| | | const uniqueItems = equPageResult.rows.filter((item, index, self) => index === self.findIndex((tm) => tm.equId === item.equId)); |
| | |
| | | drawerApi.close(); |
| | | await formApi.resetForm(); |
| | | } |
| | | |
| | | // EQU modal |
| | | const [EquModal, equModalApi] = useVbenModal({ |
| | | connectedComponent: equModal, |
| | | draggable: true, |
| | | title: 'éæ©æå' |
| | | }); |
| | | |
| | | function handleEquModal() { |
| | | equModalApi.setData({}); |
| | | equModalApi.open(); |
| | | } |
| | | |
| | | async function selectEqu(equ: any) { |
| | | await formApi.setValues({ 'equId': equ.equId, 'equName': equ.equName }); |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <BasicDrawer :close-on-click-modal="false" :title="title" class="w-[600px]"> |
| | | <BasicForm /> |
| | | <BasicForm> |
| | | <template #equName="slotProps"> |
| | | <InputSearch :enter-button="true" placeholder="è¯·éæ©" @search="handleEquModal" v-bind="slotProps" /> |
| | | </template> |
| | | </BasicForm> |
| | | <EquModal :disabled="true" class="w-[1200px]" @update-equ="selectEqu" /> |
| | | </BasicDrawer> |
| | | </template> |
| | |
| | | height: 'auto', |
| | | keepSource: true, |
| | | pagerConfig: {}, |
| | | toolbarConfig: { |
| | | enabled: !props.equDetailFlag |
| | | }, |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues = {}) => { |
| | |
| | | allowClear: true, |
| | | getPopupContainer |
| | | }, |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'equId', |
| | | label: '设å¤id' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'equName', |
| | | label: '设å¤åç§°' |
| | | }, |
| | | { |
| | |
| | | <script setup lang="ts"> |
| | | import { computed, ref } from 'vue'; |
| | | |
| | | import { useVbenDrawer } from '@vben/common-ui'; |
| | | import { useVbenDrawer, useVbenModal } from '@vben/common-ui'; |
| | | import { $t } from '@vben/locales'; |
| | | import { addFullName, cloneDeep, getPopupContainer } from '@vben/utils'; |
| | | |
| | | import { InputSearch, Modal } from 'ant-design-vue'; |
| | | |
| | | import { useVbenForm } from '#/adapter/form'; |
| | | import { listEqu } from '#/api/eims/equ'; |
| | | import { addEquTrial, getEquTrial, updateEquTrial } from '#/api/eims/equ-trial'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | import equModal from '#/views/eims/components/equ-modal.vue'; |
| | | |
| | | import { drawerSchema } from './data'; |
| | | |
| | |
| | | if (isUpdate.value && id) { |
| | | const record = await getEquTrial(id); |
| | | await formApi.setValues(record); |
| | | if(isUpdate.value && record.operatorDept){ |
| | | if (isUpdate.value && record.operatorDept) { |
| | | await setupUserOptions(record.operatorDept); |
| | | } |
| | | } |
| | |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | async function handleConfirm() { |
| | | try { |
| | | drawerApi.drawerLoading(true); |
| | |
| | | drawerApi.close(); |
| | | await formApi.resetForm(); |
| | | } |
| | | |
| | | // EQU modal |
| | | const [EquModal, equModalApi] = useVbenModal({ |
| | | connectedComponent: equModal, |
| | | draggable: true, |
| | | title: 'éæ©æå' |
| | | }); |
| | | |
| | | function handleEquModal() { |
| | | equModalApi.setData({}); |
| | | equModalApi.open(); |
| | | } |
| | | |
| | | async function selectEqu(equ: any) { |
| | | // TODO ç¡®å®ä¸åå
¸å¯¹åºsys_equ_status |
| | | if (equ.status !== null && equ.status === '0') { |
| | | await formApi.setValues({ 'equId': equ.equId, 'equName': equ.equName }); |
| | | } else { |
| | | Modal.confirm({ |
| | | title: 'æç¤º', |
| | | okType: 'danger', |
| | | content: `å½å设å¤ç¶æä¸å±äºè¯ç¨è®¾å¤ï¼ç¡®è®¤æ·»å åï¼`, |
| | | onOk: async () => { |
| | | await formApi.setValues({ 'equId': equ.equId, 'equName': equ.equName }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <BasicDrawer :close-on-click-modal="false" :title="title" class="w-[600px]"> |
| | | <BasicForm /> |
| | | <BasicForm> |
| | | <template #equName="slotProps"> |
| | | <InputSearch :enter-button="true" placeholder="è¯·éæ©" @search="handleEquModal" v-bind="slotProps" /> |
| | | </template> |
| | | </BasicForm> |
| | | <EquModal :disabled="true" class="w-[1200px]" @update-equ="selectEqu" /> |
| | | </BasicDrawer> |
| | | </template> |
| | |
| | | height: 'auto', |
| | | keepSource: true, |
| | | pagerConfig: {}, |
| | | toolbarConfig: { |
| | | enabled: !props.equDetailFlag |
| | | }, |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues = {}) => { |
| | |
| | | // è¿ç¨æåº |
| | | remote: true, |
| | | // æ¯æå¤å段æåº é»è®¤å
³é |
| | | multiple: true, |
| | | multiple: true |
| | | }, |
| | | id: 'eims-equ-trial-index' |
| | | }; |
| | |
| | | formOptions, |
| | | gridOptions, |
| | | gridEvents: { |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams), |
| | | }, |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams) |
| | | } |
| | | }); |
| | | |
| | | const [EquTrialDrawer, equTrialDrawerApi] = useVbenDrawer({ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { VxeGridProps } from '#/adapter/vxe-table'; |
| | | |
| | | import { DictEnum } from '@vben/constants'; |
| | | import { getPopupContainer } from '@vben/utils'; |
| | | |
| | | import { type FormSchemaGetter } from '#/adapter/form'; |
| | | import { getDictOptions } from '#/utils/dict'; |
| | | import { renderDict } from '#/utils/render'; |
| | | |
| | | export const querySchema: FormSchemaGetter = () => [ |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'fixtureName', |
| | | label: 'å·¥å
·åç§°' |
| | | }, |
| | | { |
| | | component: 'TreeSelect', |
| | | // å¨draweréæ´æ° è¿éä¸éè¦é»è®¤çcomponentProps |
| | | defaultValue: undefined, |
| | | fieldName: 'borrowDept', |
| | | label: 'åç¨é¨é¨' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | showSearch: true, |
| | | allowClear: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'borrowUser', |
| | | label: 'åç¨äºº' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DictEnum.FIXTURE_BORROW_RECORD_STATUS) |
| | | }, |
| | | fieldName: 'status', |
| | | label: 'åç¨ç¶æ' |
| | | }, |
| | | { |
| | | component: 'RangePicker', |
| | | fieldName: 'borrowTime', |
| | | label: 'åç¨æ¶é´' |
| | | } |
| | | ]; |
| | | |
| | | export const columns: VxeGridProps['columns'] = [ |
| | | { type: 'checkbox', width: 60, fixed: 'left' }, |
| | | { |
| | | title: 'å·¥å
·åç§°', |
| | | field: 'fixtureName', |
| | | minWidth: 100, |
| | | fixed: 'left', |
| | | slots: { default: 'fixtureName' } |
| | | }, |
| | | { |
| | | title: 'åç¨ç¶æ', |
| | | field: 'status', |
| | | sortable: true, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | if (row.status === null || row.status === '') { |
| | | return ''; |
| | | } |
| | | return renderDict(row.status, DictEnum.FIXTURE_BORROW_RECORD_STATUS); |
| | | } |
| | | }, |
| | | minWidth: 100, |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | title: 'åç¨é¨é¨', |
| | | field: 'borrowDeptName', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | title: 'åç¨äºº', |
| | | field: 'borrowUserName', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: 'ç»å人', |
| | | field: 'agentUserName', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: 'åç¨æ¶é´', |
| | | field: 'borrowTime', |
| | | minWidth: 120 |
| | | }, |
| | | { |
| | | title: 'åç¨åå ', |
| | | field: 'borrowReason', |
| | | minWidth: 140 |
| | | }, |
| | | { |
| | | title: 'é¢è®¡å½è¿æ¶é´', |
| | | field: 'planReturnTime', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | title: 'å®é
å½è¿æ¶é´', |
| | | field: 'returnTime', |
| | | minWidth: 160 |
| | | }, |
| | | { |
| | | field: 'action', |
| | | fixed: 'right', |
| | | slots: { default: 'action' }, |
| | | title: 'æä½', |
| | | width: 200 |
| | | } |
| | | ]; |
| | | |
| | | export const drawerSchema: FormSchemaGetter = () => [ |
| | | { |
| | | component: 'Input', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'id' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | showSearch: true, |
| | | allowClear: true, |
| | | getPopupContainer |
| | | }, |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'fixtureId', |
| | | label: 'å·¥å
·id', |
| | | rules: 'required' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'fixtureName', |
| | | label: 'å·¥å
·åç§°', |
| | | rules: 'required' |
| | | }, |
| | | { |
| | | component: 'TreeSelect', |
| | | // å¨draweréæ´æ° è¿éä¸éè¦é»è®¤çcomponentProps |
| | | defaultValue: undefined, |
| | | fieldName: 'borrowDept', |
| | | label: 'åç¨é¨é¨', |
| | | rules: 'selectRequired' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | showSearch: true, |
| | | allowClear: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'borrowUser', |
| | | label: 'åç¨äºº', |
| | | rules: 'required' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | showSearch: true, |
| | | allowClear: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'agentUser', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | }, |
| | | label: 'ç»å人' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'agentUserName', |
| | | label: 'ç»å人', |
| | | }, |
| | | { |
| | | component: 'RadioGroup', |
| | | componentProps: { |
| | | buttonStyle: 'solid', |
| | | options: getDictOptions(DictEnum.FIXTURE_BORROW_RECORD_STATUS), |
| | | optionType: 'button' |
| | | }, |
| | | defaultValue: '0', |
| | | fieldName: 'status', |
| | | label: 'åç¨ç¶æ' |
| | | }, |
| | | { |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | showTime: true, |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'borrowTime', |
| | | label: 'åç¨æ¶é´' |
| | | }, |
| | | { |
| | | component: 'Textarea', |
| | | formItemClass: 'items-baseline', |
| | | fieldName: 'borrowReason', |
| | | label: 'åç¨åå ' |
| | | }, |
| | | { |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | showTime: true, |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'planReturnTime', |
| | | label: 'é¢è®¡å½è¿æ¶é´' |
| | | }, |
| | | { |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | showTime: true, |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'returnTime', |
| | | label: 'å®é
å½è¿æ¶é´' |
| | | } |
| | | ]; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import { computed, ref } from 'vue'; |
| | | |
| | | import { useVbenDrawer, useVbenModal } from '@vben/common-ui'; |
| | | import { $t } from '@vben/locales'; |
| | | import { addFullName, cloneDeep, getPopupContainer } from '@vben/utils'; |
| | | |
| | | import { InputSearch } from 'ant-design-vue'; |
| | | |
| | | import { useVbenForm } from '#/adapter/form'; |
| | | import { addFixBorrow, getFixBorrow, updateFixBorrow } from '#/api/eims/fixture-borrow'; |
| | | import { userProfile } from '#/api/system/profile'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | import fixModal from '#/views/eims/components/fixture-modal.vue'; |
| | | import userModal from '#/views/eims/components/user-modal.vue'; |
| | | |
| | | import { drawerSchema } from './data'; |
| | | |
| | | const emit = defineEmits<{ reload: [] }>(); |
| | | |
| | | const isUpdate = ref(false); |
| | | const title = computed(() => { |
| | | return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add'); |
| | | }); |
| | | |
| | | const [BasicForm, formApi] = useVbenForm({ |
| | | commonConfig: { |
| | | formItemClass: 'col-span-2', |
| | | componentProps: { |
| | | class: 'w-full' |
| | | }, |
| | | labelWidth: 120 |
| | | }, |
| | | schema: drawerSchema(), |
| | | showDefaultActions: false, |
| | | wrapperClass: 'grid-cols-2' |
| | | }); |
| | | |
| | | const [BasicDrawer, drawerApi] = useVbenDrawer({ |
| | | onCancel: handleCancel, |
| | | onConfirm: handleConfirm, |
| | | async onOpenChange(isOpen) { |
| | | if (!isOpen) { |
| | | return null; |
| | | } |
| | | drawerApi.drawerLoading(true); |
| | | const { id } = drawerApi.getData() as { id?: number | string }; |
| | | isUpdate.value = !!id; |
| | | // åå§å |
| | | await setupDeptSelect(); |
| | | |
| | | // ä»å·¥å
·å°è´¦é¡µé¢æå¼ç¹æ®å¤ç |
| | | const { fixturePage } = drawerApi.getData() as { fixturePage?: boolean }; |
| | | if (fixturePage) { |
| | | formApi.updateSchema([ |
| | | { |
| | | componentProps: { |
| | | disabled: false |
| | | }, |
| | | fieldName: 'fixtureName' |
| | | } |
| | | ]); |
| | | await updateCustomData(drawerApi.getData()); |
| | | } |
| | | |
| | | formApi.updateSchema([ |
| | | { |
| | | componentProps: { |
| | | disabled: isUpdate.value || fixturePage |
| | | }, |
| | | fieldName: 'fixtureName' |
| | | } |
| | | ]); |
| | | // æ´æ° && èµå¼ |
| | | if (isUpdate.value && id) { |
| | | const record = await getFixBorrow(id); |
| | | await formApi.setValues(record); |
| | | if (isUpdate.value && record.borrowDept) { |
| | | await setupUserOptions(record.borrowDept); |
| | | } |
| | | } |
| | | |
| | | drawerApi.drawerLoading(false); |
| | | } |
| | | }); |
| | | |
| | | /** |
| | | * ä»è®¾å¤å°è´¦é¡µé¢æå¼æ´æ°é¨åæ°æ® |
| | | * @param data |
| | | */ |
| | | async function updateCustomData(data: any) { |
| | | const resp = await userProfile(); |
| | | const deptId = resp?.user?.deptId; |
| | | await setupUserOptions(deptId); |
| | | data.borrowDept = deptId; |
| | | await formApi.setValues(data); |
| | | } |
| | | |
| | | /** |
| | | * ç¨æ·çå è½½ |
| | | */ |
| | | async function setupUserOptions(deptId: any) { |
| | | const params = { deptId }; |
| | | const userPageResult = await userList({ |
| | | pageNum: 1, |
| | | pageSize: 500, |
| | | ...params |
| | | }); |
| | | const options = userPageResult.rows.map((item) => ({ |
| | | label: item.nickName || item.userName, |
| | | value: item.userId |
| | | })); |
| | | // çé |
| | | const filterOption = (input: string, option: any) => { |
| | | return option.label.toLowerCase().includes(input.toLowerCase()); |
| | | }; |
| | | |
| | | const placeholder = options.length > 0 ? 'è¯·éæ©' : '该é¨é¨ä¸ææ ç¨æ·'; |
| | | formApi.updateSchema([ |
| | | { |
| | | componentProps: { options, placeholder, filterOption }, |
| | | fieldName: 'borrowUser' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | /** |
| | | * åå§åé¨é¨éæ© |
| | | */ |
| | | async function setupDeptSelect() { |
| | | // updateSchema |
| | | const deptTree = await getDeptTree(); |
| | | // éä¸åæ¾ç¤ºå¨è¾å
¥æ¡çå¼ å³ç¶èç¹ / åèç¹ |
| | | addFullName(deptTree, 'label', ' / '); |
| | | formApi.updateSchema([ |
| | | { |
| | | componentProps: (formModel) => ({ |
| | | class: 'w-full', |
| | | fieldNames: { |
| | | key: 'id', |
| | | value: 'id', |
| | | children: 'children' |
| | | }, |
| | | getPopupContainer, |
| | | async onSelect(deptId: number | string) { |
| | | /** æ ¹æ®é¨é¨IDå è½½ç¨æ· */ |
| | | await setupUserOptions(deptId); |
| | | /** åååéè¦éæ°éæ©ç¨æ· */ |
| | | formModel.operatorId = undefined; |
| | | }, |
| | | placeholder: 'è¯·éæ©', |
| | | showSearch: true, |
| | | treeData: deptTree, |
| | | treeDefaultExpandAll: true, |
| | | treeLine: { showLeafIcon: false }, |
| | | // çéçåæ®µ |
| | | treeNodeFilterProp: 'label', |
| | | // éä¸åæ¾ç¤ºå¨è¾å
¥æ¡çå¼ |
| | | treeNodeLabelProp: 'fullName' |
| | | }), |
| | | fieldName: 'borrowDept' |
| | | } |
| | | ]); |
| | | } |
| | | async function handleConfirm() { |
| | | try { |
| | | drawerApi.drawerLoading(true); |
| | | const { valid } = await formApi.validate(); |
| | | if (!valid) { |
| | | return; |
| | | } |
| | | const data = cloneDeep(await formApi.getValues()); |
| | | await (isUpdate.value ? updateFixBorrow(data) : addFixBorrow(data)); |
| | | emit('reload'); |
| | | await handleCancel(); |
| | | } catch (error) { |
| | | console.error(error); |
| | | } finally { |
| | | drawerApi.drawerLoading(false); |
| | | } |
| | | } |
| | | |
| | | async function handleCancel() { |
| | | drawerApi.close(); |
| | | await formApi.resetForm(); |
| | | } |
| | | |
| | | // user modal |
| | | const [UserModal, userModalApi] = useVbenModal({ |
| | | connectedComponent: userModal, |
| | | draggable: true, |
| | | title: 'éæ©æå' |
| | | }); |
| | | |
| | | function handleUserModal() { |
| | | userModalApi.setData({}); |
| | | userModalApi.open(); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°éæ©çæå |
| | | * @param user |
| | | */ |
| | | async function selectUser(user: any) { |
| | | await formApi.setValues({ 'agentUser': user.userId, 'agentUserName': user.nickName }); |
| | | } |
| | | |
| | | // user modal |
| | | const [FixModal, fixModalApi] = useVbenModal({ |
| | | connectedComponent: fixModal, |
| | | draggable: true, |
| | | title: '鿩工å
·' |
| | | }); |
| | | |
| | | function handleFixModal() { |
| | | fixModalApi.setData({}); |
| | | fixModalApi.open(); |
| | | } |
| | | |
| | | /** |
| | | * æ´æ°éæ©çå·¥å
· |
| | | * @param fix |
| | | */ |
| | | async function selectFix(fix: any) { |
| | | await formApi.setValues({ 'fixtureId': fix.id, 'fixtureName': fix.fixtureName }); |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <BasicDrawer :close-on-click-modal="false" :title="title" class="w-[600px]"> |
| | | <BasicForm> |
| | | <template #agentUserName="slotProps"> |
| | | <InputSearch :enter-button="true" placeholder="è¯·éæ©" @search="handleUserModal" v-bind="slotProps" /> |
| | | </template> |
| | | <template #fixtureName="slotProps"> |
| | | <InputSearch :enter-button="true" placeholder="è¯·éæ©" @search="handleFixModal" v-bind="slotProps" /> |
| | | </template> |
| | | </BasicForm> |
| | | <UserModal class="w-[1200px]" @select-user="selectUser" /> |
| | | <FixModal class="w-[1200px]" @update-select="selectFix" /> |
| | | </BasicDrawer> |
| | | </template> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import type { Recordable } from '@vben/types'; |
| | | |
| | | import { onMounted } from 'vue'; |
| | | |
| | | import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui'; |
| | | import { $t } from '@vben/locales'; |
| | | import { addFullName, getPopupContainer, getVxePopupContainer } from '@vben/utils'; |
| | | |
| | | import { Modal, Popconfirm, Space } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid, vxeCheckboxChecked, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { delFixBorrow, fixBorrowExport, listFixBorrow } from '#/api/eims/fixture-borrow'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | import { commonDownloadExcel } from '#/utils/file/download'; |
| | | |
| | | import { columns, querySchema } from './data'; |
| | | import fixBorrowDrawer from './fixture-borrow-drawer.vue'; |
| | | |
| | | const formOptions: VbenFormProps = { |
| | | commonConfig: { |
| | | labelWidth: 80, |
| | | componentProps: { |
| | | allowClear: true |
| | | } |
| | | }, |
| | | schema: querySchema(), |
| | | wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4', |
| | | // æ¥æéæ©æ ¼å¼å |
| | | fieldMappingTime: [ |
| | | ['borrowTime', ['params[beginBorrowTime]', 'params[endBorrowTime]'], ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59']], |
| | | ['planReturnTime', ['params[beginPlanReturnTime]', 'params[endPlanReturnTime]'], ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59']] |
| | | ] |
| | | }; |
| | | |
| | | const gridOptions: VxeGridProps = { |
| | | checkboxConfig: { |
| | | // é«äº® |
| | | highlight: true, |
| | | // 翻页æ¶ä¿çéä¸ç¶æ |
| | | reserve: true |
| | | // ç¹å»è¡éä¸ |
| | | // trigger: 'row' |
| | | }, |
| | | columns, |
| | | height: 'auto', |
| | | keepSource: true, |
| | | pagerConfig: {}, |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues = {}) => { |
| | | return await listFixBorrow({ |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | rowConfig: { |
| | | isHover: true, |
| | | keyField: 'id' |
| | | }, |
| | | sortConfig: { |
| | | // è¿ç¨æåº |
| | | remote: true, |
| | | // æ¯æå¤å段æåº é»è®¤å
³é |
| | | multiple: true |
| | | }, |
| | | id: 'fixture-borrow-index' |
| | | }; |
| | | |
| | | const [BasicTable, tableApi] = useVbenVxeGrid({ |
| | | formOptions, |
| | | gridOptions, |
| | | gridEvents: { |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams) |
| | | } |
| | | }); |
| | | |
| | | const [FixBorrowDrawer, fixBorrowDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: fixBorrowDrawer |
| | | }); |
| | | |
| | | function handleAdd() { |
| | | fixBorrowDrawerApi.setData({}); |
| | | fixBorrowDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleEdit(record: Recordable<any>) { |
| | | fixBorrowDrawerApi.setData({ id: record.id }); |
| | | fixBorrowDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleDelete(row: Recordable<any>) { |
| | | await delFixBorrow(row.id); |
| | | await tableApi.query(); |
| | | } |
| | | |
| | | function handleMultiDelete() { |
| | | const rows = tableApi.grid.getCheckboxRecords(); |
| | | const ids = rows.map((row: any) => row.id); |
| | | Modal.confirm({ |
| | | title: 'æç¤º', |
| | | okType: 'danger', |
| | | content: `确认å é¤éä¸ç${ids.length}æ¡è®°å½åï¼`, |
| | | onOk: async () => { |
| | | await delFixBorrow(ids); |
| | | await tableApi.query(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function handleDownloadExcel() { |
| | | commonDownloadExcel(fixBorrowExport, 'å·¥å
·åç¨è®°å½', tableApi.formApi.form.values, { |
| | | fieldMappingTime: formOptions.fieldMappingTime |
| | | }); |
| | | } |
| | | /** |
| | | * ç¨æ·çå è½½ |
| | | */ |
| | | async function setupUserOptions(deptId: any) { |
| | | const params = { deptId }; |
| | | const userPageResult = await userList({ |
| | | pageNum: 1, |
| | | pageSize: 500, |
| | | ...params |
| | | }); |
| | | const options = userPageResult.rows.map((item) => ({ |
| | | label: item.nickName || item.userName, |
| | | value: item.userId |
| | | })); |
| | | // çé |
| | | const filterOption = (input: string, option: any) => { |
| | | return option.label.toLowerCase().includes(input.toLowerCase()); |
| | | }; |
| | | |
| | | const placeholder = options.length > 0 ? 'è¯·éæ©' : '该é¨é¨ä¸ææ ç¨æ·'; |
| | | tableApi.formApi.updateSchema([ |
| | | { |
| | | componentProps: { options, placeholder, filterOption }, |
| | | fieldName: 'borrowUser' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | /** |
| | | * åå§åé¨é¨éæ© |
| | | */ |
| | | async function setupDeptSelect() { |
| | | // updateSchema |
| | | const deptTree = await getDeptTree(); |
| | | // éä¸åæ¾ç¤ºå¨è¾å
¥æ¡çå¼ å³ç¶èç¹ / åèç¹ |
| | | addFullName(deptTree, 'label', ' / '); |
| | | tableApi.formApi.updateSchema([ |
| | | { |
| | | componentProps: (formModel) => ({ |
| | | class: 'w-full', |
| | | fieldNames: { |
| | | key: 'id', |
| | | value: 'id', |
| | | children: 'children' |
| | | }, |
| | | getPopupContainer, |
| | | async onSelect(deptId: number | string) { |
| | | /** æ ¹æ®é¨é¨IDå è½½ç¨æ· */ |
| | | await setupUserOptions(deptId); |
| | | /** åååéè¦éæ°éæ©ç¨æ· */ |
| | | formModel.inventoryUser = undefined; |
| | | }, |
| | | placeholder: 'è¯·éæ©', |
| | | showSearch: true, |
| | | treeData: deptTree, |
| | | treeDefaultExpandAll: true, |
| | | treeLine: { showLeafIcon: false }, |
| | | // çéçåæ®µ |
| | | treeNodeFilterProp: 'label', |
| | | // éä¸åæ¾ç¤ºå¨è¾å
¥æ¡çå¼ |
| | | treeNodeLabelProp: 'fullName' |
| | | }), |
| | | fieldName: 'borrowDept' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | onMounted(async () => { |
| | | await setupDeptSelect(); |
| | | }); |
| | | </script> |
| | | |
| | | <template> |
| | | <Page :auto-content-height="true"> |
| | | <div class="flex h-full gap-[8px]"> |
| | | <BasicTable class="flex-1 overflow-hidden" table-title="åç¨è®°å½å表"> |
| | | <template #toolbar-tools> |
| | | <Space> |
| | | <a-button v-access:code="['eims:fixtureBorrow:export']" @click="handleDownloadExcel"> |
| | | {{ $t('pages.common.export') }} |
| | | </a-button> |
| | | <a-button |
| | | :disabled="!vxeCheckboxChecked(tableApi)" |
| | | danger |
| | | type="primary" |
| | | v-access:code="['eims:fixtureBorrow:remove']" |
| | | @click="handleMultiDelete" |
| | | > |
| | | {{ $t('pages.common.delete') }} |
| | | </a-button> |
| | | <a-button type="primary" v-access:code="['eims:fixtureBorrow:add']" @click="handleAdd"> |
| | | {{ $t('pages.common.add') }} |
| | | </a-button> |
| | | </Space> |
| | | </template> |
| | | |
| | | <template #fixtureName="{ row }"> |
| | | <Space> |
| | | <span>{{ row.fixtureName }}</span> |
| | | </Space> |
| | | </template> |
| | | |
| | | <template #action="{ row }"> |
| | | <Space> |
| | | <ghost-button v-access:code="['eims:fixtureBorrow:edit']" @click.stop="handleEdit(row)"> |
| | | {{ $t('pages.common.edit') }} |
| | | </ghost-button> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" @confirm="handleDelete(row)"> |
| | | <ghost-button danger v-access:code="['eims:fixtureBorrow:remove']" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </ghost-button> |
| | | </Popconfirm> |
| | | </Space> |
| | | </template> |
| | | </BasicTable> |
| | | </div> |
| | | <FixBorrowDrawer @reload="tableApi.query()" /> |
| | | </Page> |
| | | </template> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { AnalysisOverviewItem, WorkbenchTrendItem } from '@vben/common-ui'; |
| | | |
| | | import { SvgBellIcon, SvgCakeIcon, SvgCardIcon, SvgDownloadIcon } from '@vben/icons'; |
| | | |
| | | export const overviewItems: AnalysisOverviewItem[] = [ |
| | | { |
| | | icon: SvgCardIcon, |
| | | title: 'å·¥å
·æ»æ°', |
| | | totalTitle: 'å·¥å
·æ»æ°', |
| | | totalValue: 120_000, |
| | | value: 2000 |
| | | }, |
| | | { |
| | | icon: SvgCakeIcon, |
| | | title: 'å¯ç¨å·¥å
·æ°', |
| | | totalTitle: 'å¯ç¨å·¥å
·æ°', |
| | | totalValue: 500_000, |
| | | value: 20_000 |
| | | }, |
| | | { |
| | | icon: SvgDownloadIcon, |
| | | title: 'æè¿ååº', |
| | | totalTitle: 'æè¿ååº', |
| | | totalValue: 120_000, |
| | | value: 8000 |
| | | }, |
| | | { |
| | | icon: SvgBellIcon, |
| | | title: 'æè¿æ´æ°', |
| | | totalTitle: 'æè¿æ´æ°', |
| | | totalValue: 50_000, |
| | | value: 5000 |
| | | } |
| | | ]; |
| | | |
| | | export const trendItems: WorkbenchTrendItem[] = [ |
| | | { |
| | | avatar: 'svg:avatar-1', |
| | | content: `å¨ <a>弿ºç»</a> å建äºé¡¹ç® <a>Vue</a>`, |
| | | date: 'åå', |
| | | title: 'å¨å»', |
| | | }, |
| | | { |
| | | avatar: 'svg:avatar-2', |
| | | content: `å
³æ³¨äº <a>å¨å»</a> `, |
| | | date: '1ä¸ªå°æ¶å', |
| | | title: 'è¾æ', |
| | | }, |
| | | { |
| | | avatar: 'svg:avatar-3', |
| | | content: `åå¸äº <a>ä¸ªäººå¨æ</a> `, |
| | | date: '1天å', |
| | | title: 'å
鿝', |
| | | }, |
| | | { |
| | | avatar: 'svg:avatar-4', |
| | | content: `å表æç« <a>å¦ä½ç¼åä¸ä¸ªViteæä»¶</a> `, |
| | | date: '2天å', |
| | | title: 'Vben', |
| | | }, |
| | | { |
| | | avatar: 'svg:avatar-1', |
| | | content: `åå¤äº <a>æ°å
</a> çé®é¢ <a>å¦ä½è¿è¡é¡¹ç®ä¼åï¼</a>`, |
| | | date: '3天å', |
| | | title: 'ç®ç¹', |
| | | }, |
| | | { |
| | | avatar: 'svg:avatar-2', |
| | | content: `å
³éäºé®é¢ <a>å¦ä½è¿è¡é¡¹ç®</a> `, |
| | | date: '1å¨å', |
| | | title: 'æ°å
', |
| | | }, |
| | | { |
| | | avatar: 'svg:avatar-3', |
| | | content: `åå¸äº <a>ä¸ªäººå¨æ</a> `, |
| | | date: '1å¨å', |
| | | title: 'å¨å»', |
| | | }, |
| | | { |
| | | avatar: 'svg:avatar-4', |
| | | content: `æ¨éäºä»£ç å° <a>Github</a>`, |
| | | date: '2021-04-01 20:00', |
| | | title: 'å¨å»', |
| | | }, |
| | | { |
| | | avatar: 'svg:avatar-4', |
| | | content: `å表æç« <a>å¦ä½ç¼åä½¿ç¨ Admin Vben</a> `, |
| | | date: '2021-03-01 20:00', |
| | | title: 'Vben', |
| | | }, |
| | | ]; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import { AnalysisOverview, Page, WorkbenchTrends } from '@vben/common-ui'; |
| | | |
| | | import { overviewItems, trendItems } from './data'; |
| | | </script> |
| | | |
| | | <template> |
| | | <Page :auto-content-height="true"> |
| | | <div class="h-full"> |
| | | <AnalysisOverview :items="overviewItems" /> |
| | | <WorkbenchTrends :items="trendItems" class="mt-5" title="ææ°å¨æ" /> |
| | | <div class="h-5"></div> |
| | | </div> |
| | | </Page> |
| | | </template> |
| | | |
| | | <style scoped></style> |
| | |
| | | label: 'å·¥å
·ç¶æ' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: getDictOptions(DictEnum.FIXTURE_BORROW_STATUS) |
| | | }, |
| | | fieldName: 'borrowStatus', |
| | | label: 'åç¨ç¶æ' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'assetNo', |
| | | label: 'èµäº§ç¼å·' |
| | |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | title: 'åç¨ç¶æ', |
| | | field: 'borrowStatus', |
| | | sortable: true, |
| | | slots: { |
| | | default: ({ row }) => { |
| | | if (row.borrowStatus === null || row.borrowStatus === '') { |
| | | return ''; |
| | | } |
| | | return renderDict(row.borrowStatus, DictEnum.FIXTURE_BORROW_STATUS); |
| | | } |
| | | }, |
| | | minWidth: 100, |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | title: 'ç±»å', |
| | | field: 'fixtureTypeName', |
| | | minWidth: 100 |
| | |
| | | minWidth: 140 |
| | | }, |
| | | { |
| | | title: 'åç¨äºº', |
| | | field: 'borrowUserName', |
| | | minWidth: 100 |
| | | }, |
| | | { |
| | | title: 'å·¥å
·ç¼ç ', |
| | | field: 'fixtureCode', |
| | | sortable: true, |
| | |
| | | |
| | | const [BasicDrawer, drawerApi] = useVbenDrawer({ |
| | | onCancel: handleCancel, |
| | | closeOnPressEscape: true, |
| | | placement: 'left', |
| | | onConfirm: handleConfirm, |
| | | async onOpenChange(isOpen) { |
| | | if (!isOpen) { |
| | |
| | | <script setup lang="ts"> |
| | | import type { Recordable } from '@vben/types'; |
| | | |
| | | import { onMounted, ref } from 'vue'; |
| | | import { useRouter } from 'vue-router'; |
| | | import { computed, onMounted, ref } from 'vue'; |
| | | |
| | | import { useAccess } from '@vben/access'; |
| | | import { Page, useVbenDrawer, useVbenModal, type VbenFormProps } from '@vben/common-ui'; |
| | | import { $t } from '@vben/locales'; |
| | | import { useUserStore } from '@vben/stores'; |
| | | import { addFullName, getPopupContainer, getVxePopupContainer } from '@vben/utils'; |
| | | |
| | | import { Modal, Popconfirm, Space } from 'ant-design-vue'; |
| | |
| | | import { delFixture, fixtureExport, listFixture } from '#/api/eims/fixture'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | import { commonDownloadExcel } from '#/utils/file/download'; |
| | | import fixtureBorrowDrawer from '#/views/eims/fixture-borrow/fixture-borrow-drawer.vue'; |
| | | |
| | | import { columns, querySchema } from './data'; |
| | | import fixtureDrawer from './fixture-drawer.vue'; |
| | | import fixtureImportModal from './fixture-import-modal.vue'; |
| | | import FixtureTypeTree from './fixture-type-tree.vue'; |
| | | |
| | | const userStore = useUserStore(); |
| | | const userId = userStore.userInfo?.userId; |
| | | |
| | | // 左边工å
፱Ȍ |
| | | const selectTypeId = ref<string[]>([]); |
| | | defineExpose({ |
| | | tableSelect |
| | | }); |
| | | |
| | | const formOptions: VbenFormProps = { |
| | | commonConfig: { |
| | |
| | | connectedComponent: fixtureDrawer |
| | | }); |
| | | |
| | | const [FixtureBorrowDrawer, fixtureBorrowDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: fixtureBorrowDrawer |
| | | }); |
| | | |
| | | /** |
| | | * 导å
¥ |
| | | */ |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function handleBorrow(row: Recordable<any>, status: string) { |
| | | if (userId === null || userId === undefined || userId === '') { |
| | | Modal.error({ |
| | | content: 'è·åç¨æ·ä¿¡æ¯å¤±è´¥ï¼è¯·éæ°ç»å½åéè¯ï¼', |
| | | title: 'æç¤º' |
| | | }); |
| | | return false; |
| | | } |
| | | // å·¥å
·å°è´¦åç¨ç¶æTODO fixture_borrow_status 0-ç©ºé² 1-ååº |
| | | if (status === '0') { |
| | | // ç©ºé²æ¶ååºï¼æ°å¢ä¸æ¡ååºæ°æ® |
| | | fixtureBorrowDrawerApi.setData({ status, borrowUser: userId, fixtureId: row.id, fixtureName: row.fixtureName, fixturePage: true }); |
| | | fixtureBorrowDrawerApi.open(); |
| | | } else if (status === '1') { |
| | | // ååºæ¶å½è¿ï¼æ´æ°ååºæ°æ® |
| | | fixtureBorrowDrawerApi.setData({ id: row.curBorrowId }); |
| | | fixtureBorrowDrawerApi.open(); |
| | | } |
| | | } |
| | | function handleDownloadExcel() { |
| | | commonDownloadExcel(fixtureExport, 'å·¥å
·å°è´¦', tableApi.formApi.form.values, { |
| | | fieldMappingTime: formOptions.fieldMappingTime |
| | | }); |
| | | } |
| | | |
| | | const router = useRouter(); |
| | | |
| | | function handleDetail(record: Recordable<any>) { |
| | | router.push(`/fixture/detail/${record.id}`); |
| | | } |
| | | |
| | | /** |
| | |
| | | onMounted(async () => { |
| | | await setupDeptSelect(); |
| | | }); |
| | | |
| | | const { hasAccessByRoles } = useAccess(); |
| | | const isSuperAdmin = computed(() => hasAccessByRoles(['superadmin'])); |
| | | /** |
| | | * åªæåç¨ç¨æ·å管çåå¯ä»¥ç¹å»å½è¿ |
| | | */ |
| | | function isBorrowUser(row: any) { |
| | | return isSuperAdmin.value || row?.borrowUser === userId; |
| | | } |
| | | |
| | | function isBorrow(row: any) { |
| | | // TODO 对åºåå
¸ç¶æfixture_borrow_status 0-ç©ºé² 1-ååº |
| | | return row.borrowStatus === '0' || row.borrowStatus === null; |
| | | } |
| | | |
| | | function isReturn(row: any) { |
| | | // TODO 对åºåå
¸ç¶æfixture_borrow_status 0-ç©ºé² 1-ååº |
| | | return row.borrowStatus === '1'; |
| | | } |
| | | |
| | | // é䏿°æ® |
| | | function tableSelect() { |
| | | return tableApi.grid.getCheckboxRecords(); |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | </Space> |
| | | </template> |
| | | |
| | | <template #equName="{ row }"> |
| | | <Space> |
| | | <a-button type="link" @click="handleDetail(row)"> {{ row.equName }}</a-button> |
| | | </Space> |
| | | </template> |
| | | |
| | | <template #action="{ row }"> |
| | | <Space> |
| | | <ghost-button v-access:code="['eims:fixture:edit']" @click.stop="handleEdit(row)"> |
| | | {{ $t('pages.common.edit') }} |
| | | </ghost-button> |
| | | <ghost-button v-if="row.menuType !== 'F'" class="btn-success" v-access:code="['eims:fixture:list']" @click="handleDetail(row)"> |
| | | {{ $t('pages.common.info') }} |
| | | <ghost-button v-if="isBorrow(row)" class="btn-success" v-access:code="['eims:fixture:borrow']" @click="handleBorrow(row, '0')"> |
| | | åç¨ |
| | | </ghost-button> |
| | | <ghost-button |
| | | v-else-if="isReturn(row) && isBorrowUser(row)" |
| | | v-access:code="['eims:fixture:borrow']" |
| | | @click="handleBorrow(row, '1')" |
| | | > |
| | | å½è¿ |
| | | </ghost-button> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" @confirm="handleDelete(row)"> |
| | | <ghost-button danger v-access:code="['eims:fixture:remove']" @click.stop=""> |
| | |
| | | </BasicTable> |
| | | </div> |
| | | <FixtureDrawer @reload="tableApi.query()" /> |
| | | <FixtureBorrowDrawer @reload="tableApi.query()" /> |
| | | <FixtureImportModal @reload="tableApi.query()" /> |
| | | </Page> |
| | | </template> |
| | |
| | | import { delRepairReq, listRepairReq, repairReqExport } from '#/api/eims/repair-req'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | import { commonDownloadExcel } from '#/utils/file/download'; |
| | | import { useRoleBaseFilters } from '#/views/eims/repair-req/use-role-base-filters'; |
| | | |
| | | import { columns, querySchema } from './data'; |
| | | import repairReqDrawer from './repair-req-drawer.vue'; |
| | |
| | | return await listRepairReq({ |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues, |
| | | ...useRoleBaseFilters() |
| | | ...formValues |
| | | // ...useRoleBaseFilters() |
| | | }); |
| | | } |
| | | } |
| | |
| | | if (repair.value) { |
| | | params.status = '0'; |
| | | } |
| | | console.info('useRoleBaseFilters'); |
| | | console.info(params); |
| | | return { params }; |
| | | } |
| | |
| | | export enum DictEnum { |
| | | EIMS_EQU_UNIT = 'eims_equ_unit', // 设å¤çç¹ç¶æ |
| | | EIMS_FIXTURE_STATUS = 'eims_fixture_status', // 设å¤çç¹ç¶æ |
| | | EIMS_FIXTURE_STATUS = 'eims_fixture_status', // å·¥å
·ï¼æ²»å
·ï¼ç¶æ |
| | | EIMS_INVENTORY_DETAIL_STATU = 'inventory_detail_statu', // 设å¤çç¹ç¶æ |
| | | EIMS_INVENTORY_STATU = 'inventory_statu', // 设å¤çç¹ç¶æ |
| | | EQU_IMPORT_STATU = 'equ_import_status', // 设å¤å¯¼å
¥ç¶æ |
| | | FIXTURE_BORROW_RECORD_STATUS = 'fixture_borrow_record_status', // å·¥å
·ï¼æ²»å
·ï¼åç¨è®°å½ç¶æ |
| | | FIXTURE_BORROW_STATUS = 'fixture_borrow_status', // å·¥å
·ï¼æ²»å
·ï¼åç¨ç¶æ |
| | | REPAIR_FAULT_TYPE = 'repair_fault_type', // æ¥ä¿®ç¶æ |
| | | REPAIR_REQ_STATUS = 'repair_req_status', // æ¥ä¿®ç¶æ |
| | | REPAIR_REQ_TYPE = 'repair_req_type', // æ¥ä¿®ç±»å |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.controller; |
| | | |
| | | import java.util.List; |
| | | |
| | | import lombok.RequiredArgsConstructor; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import jakarta.validation.constraints.*; |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.dromara.common.idempotent.annotation.RepeatSubmit; |
| | | import org.dromara.common.log.annotation.Log; |
| | | import org.dromara.common.web.core.BaseController; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | import org.dromara.common.core.domain.R; |
| | | import org.dromara.common.core.validate.AddGroup; |
| | | import org.dromara.common.core.validate.EditGroup; |
| | | import org.dromara.common.log.enums.BusinessType; |
| | | import org.dromara.common.excel.utils.ExcelUtil; |
| | | import org.dromara.eims.domain.vo.EimsFixtureBorrowVo; |
| | | import org.dromara.eims.domain.bo.EimsFixtureBorrowBo; |
| | | import org.dromara.eims.service.IEimsFixtureBorrowService; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * åç¨è®°å½ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-02-18 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/eims/fixBorrow") |
| | | public class EimsFixtureBorrowController extends BaseController { |
| | | |
| | | private final IEimsFixtureBorrowService eimsFixtureBorrowService; |
| | | |
| | | /** |
| | | * æ¥è¯¢åç¨è®°å½å表 |
| | | */ |
| | | @SaCheckPermission("eims:fixtureBorrow:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<EimsFixtureBorrowVo> list(EimsFixtureBorrowBo bo, PageQuery pageQuery) { |
| | | return eimsFixtureBorrowService.queryPageList(bo, pageQuery); |
| | | } |
| | | |
| | | /** |
| | | * 导åºåç¨è®°å½å表 |
| | | */ |
| | | @SaCheckPermission("eims:fixtureBorrow:export") |
| | | @Log(title = "åç¨è®°å½", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(EimsFixtureBorrowBo bo, HttpServletResponse response) { |
| | | List<EimsFixtureBorrowVo> list = eimsFixtureBorrowService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "åç¨è®°å½", EimsFixtureBorrowVo.class, response); |
| | | } |
| | | |
| | | /** |
| | | * è·ååç¨è®°å½è¯¦ç»ä¿¡æ¯ |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | @SaCheckPermission("eims:fixtureBorrow:query") |
| | | @GetMapping("/{id}") |
| | | public R<EimsFixtureBorrowVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long id) { |
| | | return R.ok(eimsFixtureBorrowService.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢åç¨è®°å½ |
| | | */ |
| | | @SaCheckPermission("eims:fixtureBorrow:add") |
| | | @Log(title = "åç¨è®°å½", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping() |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody EimsFixtureBorrowBo bo) { |
| | | return toAjax(eimsFixtureBorrowService.insertByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹åç¨è®°å½ |
| | | */ |
| | | @SaCheckPermission("eims:fixtureBorrow:edit") |
| | | @Log(title = "åç¨è®°å½", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping() |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody EimsFixtureBorrowBo bo) { |
| | | return toAjax(eimsFixtureBorrowService.updateByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤åç¨è®°å½ |
| | | * |
| | | * @param ids 主é®ä¸² |
| | | */ |
| | | @SaCheckPermission("eims:fixtureBorrow:remove") |
| | | @Log(title = "åç¨è®°å½", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public R<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] ids) { |
| | | return toAjax(eimsFixtureBorrowService.deleteWithValidByIds(List.of(ids), true)); |
| | | } |
| | | } |
| | |
| | | private Long borrowUser; |
| | | |
| | | /** |
| | | * åç¨ç¶æ |
| | | */ |
| | | private String borrowStatus; |
| | | |
| | | /** |
| | | * ç¶æï¼åå
¸ï¼ |
| | | */ |
| | | private String status; |
| | |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * å½ååç¨è®°å½id |
| | | */ |
| | | private Long curBorrowId; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain; |
| | | |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import java.io.Serial; |
| | | |
| | | /** |
| | | * å·¥å
·åç¨å¯¹è±¡ eims_fixture_borrow |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-02-18 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("eims_fixture_borrow") |
| | | public class EimsFixtureBorrow extends BaseEntity { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * åç¨å·¥å
·id |
| | | */ |
| | | private Long fixtureId; |
| | | |
| | | /** |
| | | * åç¨å·¥å
·åç§° |
| | | */ |
| | | private String fixtureName; |
| | | |
| | | /** |
| | | * åç¨é¨é¨ |
| | | */ |
| | | private Long borrowDept; |
| | | |
| | | /** |
| | | * åç¨äºº |
| | | */ |
| | | private Long borrowUser; |
| | | |
| | | /** |
| | | * ç»å人 |
| | | */ |
| | | private Long agentUser; |
| | | |
| | | /** |
| | | * åç¨è®°å½ç¶æï¼åå
¸ï¼ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * åç¨æ¶é´ |
| | | */ |
| | | private Date borrowTime; |
| | | |
| | | /** |
| | | * é¢è®¡å½è¿æ¶é´ |
| | | */ |
| | | private Date planReturnTime; |
| | | |
| | | /** |
| | | * å½è¿æ¶é´ |
| | | */ |
| | | private Date returnTime; |
| | | |
| | | /** |
| | | * åç¨çç± |
| | | */ |
| | | private String borrowReason; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
| | |
| | | package org.dromara.eims.domain.bo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import org.dromara.common.excel.annotation.ExcelDictFormat; |
| | | import org.dromara.common.excel.convert.ExcelDictConvert; |
| | | import org.dromara.eims.domain.EimsFixture; |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | import org.dromara.common.core.validate.AddGroup; |
| | |
| | | private Long borrowUser; |
| | | |
| | | /** |
| | | * åç¨ç¶æ |
| | | */ |
| | | private String borrowStatus; |
| | | |
| | | /** |
| | | * ç¶æï¼åå
¸ï¼ |
| | | */ |
| | | private String status; |
| | |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * å½ååç¨è®°å½id |
| | | */ |
| | | private Long curBorrowId; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.bo; |
| | | |
| | | import org.dromara.eims.domain.EimsFixtureBorrow; |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | import org.dromara.common.core.validate.AddGroup; |
| | | import org.dromara.common.core.validate.EditGroup; |
| | | import io.github.linpeilie.annotations.AutoMapper; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import jakarta.validation.constraints.*; |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | /** |
| | | * å·¥å
·åç¨ä¸å¡å¯¹è±¡ eims_fixture_borrow |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-02-18 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @AutoMapper(target = EimsFixtureBorrow.class, reverseConvertGenerate = false) |
| | | public class EimsFixtureBorrowBo extends BaseEntity { |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @NotNull(message = "ä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long id; |
| | | |
| | | /** |
| | | * åç¨å·¥å
·id |
| | | */ |
| | | @NotNull(message = "åç¨å·¥å
·idä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long fixtureId; |
| | | |
| | | /** |
| | | * åç¨å·¥å
·åç§° |
| | | */ |
| | | @NotBlank(message = "åç¨å·¥å
·åç§°ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String fixtureName; |
| | | |
| | | /** |
| | | * åç¨é¨é¨ |
| | | */ |
| | | @NotNull(message = "åç¨é¨é¨ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long borrowDept; |
| | | |
| | | /** |
| | | * åç¨äºº |
| | | */ |
| | | @NotNull(message = "åç¨äººä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Long borrowUser; |
| | | |
| | | /** |
| | | * ç»å人 |
| | | */ |
| | | private Long agentUser; |
| | | |
| | | /** |
| | | * åç¨è®°å½ç¶æï¼åå
¸ï¼ |
| | | */ |
| | | @NotBlank(message = "åç¨è®°å½ç¶æï¼åå
¸ï¼ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String status; |
| | | |
| | | /** |
| | | * åç¨æ¶é´ |
| | | */ |
| | | @NotNull(message = "åç¨æ¶é´ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Date borrowTime; |
| | | |
| | | /** |
| | | * é¢è®¡å½è¿æ¶é´ |
| | | */ |
| | | @NotNull(message = "é¢è®¡å½è¿æ¶é´ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Date planReturnTime; |
| | | |
| | | /** |
| | | * å½è¿æ¶é´ |
| | | */ |
| | | private Date returnTime; |
| | | |
| | | /** |
| | | * åç¨çç± |
| | | */ |
| | | @NotBlank(message = "åç¨çç±ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String borrowReason; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.vo; |
| | | |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.dromara.common.translation.annotation.Translation; |
| | | import org.dromara.common.translation.constant.TransConstant; |
| | | import org.dromara.eims.domain.EimsFixtureBorrow; |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import org.dromara.common.excel.annotation.ExcelDictFormat; |
| | | import org.dromara.common.excel.convert.ExcelDictConvert; |
| | | import io.github.linpeilie.annotations.AutoMapper; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | |
| | | /** |
| | | * å·¥å
·åç¨è§å¾å¯¹è±¡ eims_fixture_borrow |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-02-18 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @AutoMapper(target = EimsFixtureBorrow.class) |
| | | public class EimsFixtureBorrowVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ExcelProperty(value = "") |
| | | private Long id; |
| | | |
| | | /** |
| | | * åç¨å·¥å
·id |
| | | */ |
| | | @ExcelProperty(value = "åç¨å·¥å
·id") |
| | | private Long fixtureId; |
| | | |
| | | /** |
| | | * åç¨å·¥å
·åç§° |
| | | */ |
| | | @ExcelProperty(value = "åç¨å·¥å
·åç§°") |
| | | private String fixtureName; |
| | | |
| | | /** |
| | | * åç¨é¨é¨ |
| | | */ |
| | | private Long borrowDept; |
| | | |
| | | /** |
| | | * åç¨é¨é¨ |
| | | */ |
| | | @ExcelProperty(value = "åç¨é¨é¨") |
| | | @Translation(type = TransConstant.DEPT_ID_TO_NAME, mapper = "borrowDept") |
| | | private String borrowDeptName; |
| | | |
| | | /** |
| | | * åç¨äºº |
| | | */ |
| | | private Long borrowUser; |
| | | /** |
| | | * åç¨äºº |
| | | */ |
| | | @ExcelProperty(value = "åç¨äºº") |
| | | @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "borrowUser") |
| | | private String borrowUserName; |
| | | |
| | | /** |
| | | * ç»å人 |
| | | */ |
| | | private Long agentUser; |
| | | |
| | | /** |
| | | * ç»å人 |
| | | */ |
| | | @ExcelProperty(value = "ç»å人") |
| | | @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "agentUser") |
| | | private Long agentUserName; |
| | | |
| | | |
| | | /** |
| | | * åç¨è®°å½ç¶æï¼åå
¸ï¼ |
| | | */ |
| | | @ExcelProperty(value = "åç¨è®°å½ç¶æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "fixture_borrow_record_status") |
| | | private String status; |
| | | |
| | | /** |
| | | * åç¨æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "åç¨æ¶é´") |
| | | private Date borrowTime; |
| | | |
| | | /** |
| | | * é¢è®¡å½è¿æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "é¢è®¡å½è¿æ¶é´") |
| | | private Date planReturnTime; |
| | | |
| | | /** |
| | | * å½è¿æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "å½è¿æ¶é´") |
| | | private Date returnTime; |
| | | |
| | | /** |
| | | * åç¨çç± |
| | | */ |
| | | @ExcelProperty(value = "åç¨çç±") |
| | | private String borrowReason; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | |
| | | } |
| | |
| | | private Long borrowUser; |
| | | |
| | | /** |
| | | * åç¨ç¶æ |
| | | */ |
| | | @ExcelProperty(value = "åç¨ç¶æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "fixture_borrow_status") |
| | | private String borrowStatus; |
| | | |
| | | /** |
| | | * åç¨äºº |
| | | */ |
| | | @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "borrowUser") |
| | | private String borrowUserName; |
| | | |
| | | /** |
| | |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * å½ååç¨è®°å½id |
| | | */ |
| | | private Long curBorrowId; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.mapper; |
| | | |
| | | import org.dromara.eims.domain.EimsFixtureBorrow; |
| | | import org.dromara.eims.domain.vo.EimsFixtureBorrowVo; |
| | | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
| | | |
| | | /** |
| | | * å·¥å
·åç¨Mapperæ¥å£ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-02-18 |
| | | */ |
| | | public interface EimsFixtureBorrowMapper extends BaseMapperPlus<EimsFixtureBorrow, EimsFixtureBorrowVo> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service; |
| | | |
| | | import org.dromara.eims.domain.vo.EimsFixtureBorrowVo; |
| | | import org.dromara.eims.domain.bo.EimsFixtureBorrowBo; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | |
| | | import java.util.Collection; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å·¥å
·åç¨Serviceæ¥å£ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-02-18 |
| | | */ |
| | | public interface IEimsFixtureBorrowService { |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¥å
·åç¨ |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return å·¥å
·åç¨ |
| | | */ |
| | | EimsFixtureBorrowVo queryById(Long id); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢å·¥å
·åç¨å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return å·¥å
·åç¨å页å表 |
| | | */ |
| | | TableDataInfo<EimsFixtureBorrowVo> queryPageList(EimsFixtureBorrowBo bo, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çå·¥å
·åç¨å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return å·¥å
·åç¨å表 |
| | | */ |
| | | List<EimsFixtureBorrowVo> queryList(EimsFixtureBorrowBo bo); |
| | | |
| | | /** |
| | | * æ°å¢å·¥å
·åç¨ |
| | | * |
| | | * @param bo å·¥å
·åç¨ |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | Boolean insertByBo(EimsFixtureBorrowBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹å·¥å
·åç¨ |
| | | * |
| | | * @param bo å·¥å
·åç¨ |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | Boolean updateByBo(EimsFixtureBorrowBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤å·¥å
·åç¨ä¿¡æ¯ |
| | | * |
| | | * @param ids å¾
å é¤ç主é®éå |
| | | * @param isValid æ¯å¦è¿è¡æææ§æ ¡éª |
| | | * @return æ¯å¦å 餿å |
| | | */ |
| | | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | import org.dromara.common.mybatis.core.page.PageQuery; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.dromara.common.satoken.utils.LoginHelper; |
| | | import org.dromara.eims.domain.EimsEquType; |
| | | import org.dromara.eims.domain.EimsFixture; |
| | | import org.dromara.eims.domain.vo.EimsEquTypeVo; |
| | | import org.dromara.eims.domain.vo.EimsFixtureVo; |
| | | import org.dromara.eims.mapper.EimsFixtureMapper; |
| | | import org.dromara.system.domain.SysDept; |
| | | import org.dromara.system.domain.vo.SysDeptVo; |
| | | import org.dromara.system.mapper.SysDeptMapper; |
| | | import org.dromara.system.service.ISysDeptService; |
| | | import org.springframework.stereotype.Service; |
| | | import org.dromara.eims.domain.bo.EimsFixtureBorrowBo; |
| | | import org.dromara.eims.domain.vo.EimsFixtureBorrowVo; |
| | | import org.dromara.eims.domain.EimsFixtureBorrow; |
| | | import org.dromara.eims.mapper.EimsFixtureBorrowMapper; |
| | | import org.dromara.eims.service.IEimsFixtureBorrowService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Collection; |
| | | |
| | | /** |
| | | * å·¥å
·åç¨Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-02-18 |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class EimsFixtureBorrowServiceImpl implements IEimsFixtureBorrowService { |
| | | |
| | | private final EimsFixtureBorrowMapper baseMapper; |
| | | private final EimsFixtureMapper fixtureMapper; |
| | | private final SysDeptMapper sysDeptMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢å·¥å
·åç¨ |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return å·¥å
·åç¨ |
| | | */ |
| | | @Override |
| | | public EimsFixtureBorrowVo queryById(Long id){ |
| | | return baseMapper.selectVoById(id); |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢å·¥å
·åç¨å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return å·¥å
·åç¨å页å表 |
| | | */ |
| | | @Override |
| | | public TableDataInfo<EimsFixtureBorrowVo> queryPageList(EimsFixtureBorrowBo bo, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<EimsFixtureBorrow> lqw = buildQueryWrapper(bo); |
| | | Page<EimsFixtureBorrowVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çå·¥å
·åç¨å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return å·¥å
·åç¨å表 |
| | | */ |
| | | @Override |
| | | public List<EimsFixtureBorrowVo> queryList(EimsFixtureBorrowBo bo) { |
| | | LambdaQueryWrapper<EimsFixtureBorrow> lqw = buildQueryWrapper(bo); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<EimsFixtureBorrow> buildQueryWrapper(EimsFixtureBorrowBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<EimsFixtureBorrow> lqw = Wrappers.lambdaQuery(); |
| | | lqw.eq(bo.getFixtureId() != null, EimsFixtureBorrow::getFixtureId, bo.getFixtureId()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getFixtureName()), EimsFixtureBorrow::getFixtureName, bo.getFixtureName()); |
| | | |
| | | lqw.eq(bo.getBorrowUser() != null, EimsFixtureBorrow::getBorrowUser, bo.getBorrowUser()); |
| | | lqw.eq(bo.getAgentUser() != null, EimsFixtureBorrow::getAgentUser, bo.getAgentUser()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getStatus()), EimsFixtureBorrow::getStatus, bo.getStatus()); |
| | | lqw.between(params.get("beginBorrowTime") != null && params.get("endBorrowTime") != null, |
| | | EimsFixtureBorrow::getBorrowTime ,params.get("beginBorrowTime"), params.get("endBorrowTime")); |
| | | lqw.between(params.get("beginPlanReturnTime") != null && params.get("endPlanReturnTime") != null, |
| | | EimsFixtureBorrow::getPlanReturnTime ,params.get("beginPlanReturnTime"), params.get("endPlanReturnTime")); |
| | | lqw.eq(bo.getReturnTime() != null, EimsFixtureBorrow::getReturnTime, bo.getReturnTime()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getBorrowReason()), EimsFixtureBorrow::getBorrowReason, bo.getBorrowReason()); |
| | | |
| | | /** |
| | | * æ¥è¯¢é¨é¨ä¸ææåé¨é¨ |
| | | */ |
| | | if (bo.getBorrowDept() != null ) { |
| | | List<Long> allDescendantIds = getAllDescendantIds(bo.getBorrowDept()); |
| | | lqw.in(bo.getBorrowDept() != null ,EimsFixtureBorrow::getBorrowDept, allDescendantIds); |
| | | } |
| | | |
| | | |
| | | return lqw; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®idï¼è·åææå代id |
| | | * @param rootId |
| | | * @return |
| | | */ |
| | | public List<Long> getAllDescendantIds(Long rootId) { |
| | | List<Long> result = new ArrayList<>(); |
| | | result.add(rootId); |
| | | collectDescendants(rootId, result); |
| | | return result; |
| | | } |
| | | |
| | | private void collectDescendants(Long currentId, List<Long> collector) { |
| | | QueryWrapper<SysDept> sysDeptWrapper = new QueryWrapper<>(); |
| | | sysDeptWrapper.lambda().eq(SysDept::getParentId, currentId); |
| | | |
| | | List<SysDeptVo> children = sysDeptMapper.selectVoList(sysDeptWrapper); |
| | | if (children != null && !children.isEmpty()) { |
| | | for (SysDeptVo child : children) { |
| | | Long childId = child.getDeptId(); |
| | | collector.add(childId); |
| | | collectDescendants(childId, collector); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢å·¥å
·åç¨ |
| | | * |
| | | * @param bo å·¥å
·åç¨ |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean insertByBo(EimsFixtureBorrowBo bo) { |
| | | EimsFixtureBorrow add = MapstructUtils.convert(bo, EimsFixtureBorrow.class); |
| | | validEntityBeforeSave(add); |
| | | boolean flag = baseMapper.insert(add) > 0; |
| | | if (flag) { |
| | | bo.setId(add.getId()); |
| | | //åæ¶æ´æ°å·¥å
·å°è´¦è¡¨ä¸åç¨äºº |
| | | EimsFixtureVo eimsFixtureVo = fixtureMapper.selectVoById(bo.getFixtureId()); |
| | | eimsFixtureVo.setBorrowUser(LoginHelper.getUserId()); |
| | | //设置工å
·å°è´¦ç¶æä¸ºåç¨ |
| | | eimsFixtureVo.setBorrowStatus("1");//TODO ä¿æåå
¸æ°æ®ä¸è´fixture_borrow_status |
| | | //æ´æ°å·¥å
·å°è´¦å½ååç¨è®°å½id |
| | | eimsFixtureVo.setCurBorrowId(add.getId()); |
| | | eimsFixtureVo.setBorrowDept(LoginHelper.getDeptId()); |
| | | EimsFixture fixture = MapstructUtils.convert(eimsFixtureVo, EimsFixture.class); |
| | | fixtureMapper.updateById(fixture); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å·¥å
·åç¨ |
| | | * |
| | | * @param bo å·¥å
·åç¨ |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Boolean updateByBo(EimsFixtureBorrowBo bo) { |
| | | EimsFixtureBorrow update = MapstructUtils.convert(bo, EimsFixtureBorrow.class); |
| | | validEntityBeforeSave(update); |
| | | //设置工å
·å°è´¦ç¶æä¸ºå½è¿ TODO ä¿æåå
¸æ°æ®ä¸è´fixture_borrow_record_status |
| | | if(bo.getStatus().equals("1")){ |
| | | EimsFixtureVo eimsFixtureVo = fixtureMapper.selectVoById(bo.getFixtureId()); |
| | | //设置工å
·å°è´¦ç¶æä¸ºå½è¿ |
| | | eimsFixtureVo.setBorrowStatus("0"); //TODO ä¿æåå
¸æ°æ®ä¸è´fixture_borrow_status |
| | | EimsFixture fixture = MapstructUtils.convert(eimsFixtureVo, EimsFixture.class); |
| | | fixtureMapper.updateById(fixture); |
| | | } |
| | | return baseMapper.updateById(update) > 0; |
| | | } |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | */ |
| | | private void validEntityBeforeSave(EimsFixtureBorrow entity){ |
| | | //TODO åä¸äºæ°æ®æ ¡éª,å¦å¯ä¸çº¦æ |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤å·¥å
·åç¨ä¿¡æ¯ |
| | | * |
| | | * @param ids å¾
å é¤ç主é®éå |
| | | * @param isValid æ¯å¦è¿è¡æææ§æ ¡éª |
| | | * @return æ¯å¦å 餿å |
| | | */ |
| | | @Override |
| | | public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
| | | if(isValid){ |
| | | //TODO åä¸äºä¸å¡ä¸çæ ¡éª,夿æ¯å¦éè¦æ ¡éª |
| | | } |
| | | return baseMapper.deleteByIds(ids) > 0; |
| | | } |
| | | } |
| | |
| | | lqw.eq(StringUtils.isNotBlank(bo.getFixtureDesc()), EimsFixture::getFixtureDesc, bo.getFixtureDesc()); |
| | | lqw.eq(bo.getBorrowDept()!=null, EimsFixture::getBorrowDept, bo.getBorrowDept()); |
| | | lqw.eq(bo.getBorrowUser()!=null, EimsFixture::getBorrowUser, bo.getBorrowUser()); |
| | | lqw.eq(StringUtils.isNotEmpty(bo.getBorrowStatus()), EimsFixture::getBorrowStatus, bo.getBorrowStatus()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getStatus()), EimsFixture::getStatus, bo.getStatus()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getAssetNo()), EimsFixture::getAssetNo, bo.getAssetNo()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getModelNo()), EimsFixture::getModelNo, bo.getModelNo()); |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.dromara.eims.domain.EimsEqu; |
| | | import org.dromara.eims.domain.EimsFixtureBorrow; |
| | | import org.dromara.eims.domain.vo.EimsInventoryDetailVo; |
| | | import org.dromara.eims.utils.DataFilterUtil; |
| | | import org.dromara.system.domain.SysDept; |
| | | import org.dromara.system.domain.vo.SysDeptVo; |
| | | import org.dromara.system.mapper.SysDeptMapper; |
| | | import org.springframework.stereotype.Service; |
| | | import org.dromara.eims.domain.bo.EimsRepairReqBo; |
| | | import org.dromara.eims.domain.vo.EimsRepairReqVo; |
| | |
| | | import org.dromara.eims.mapper.EimsRepairReqMapper; |
| | | import org.dromara.eims.service.IEimsRepairReqService; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Collection; |
| | |
| | | public class EimsRepairReqServiceImpl implements IEimsRepairReqService { |
| | | |
| | | private final EimsRepairReqMapper baseMapper; |
| | | private final SysDeptMapper sysDeptMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ
éæ¥ä¿® |
| | |
| | | * @return æ
éæ¥ä¿® |
| | | */ |
| | | @Override |
| | | public EimsRepairReqVo queryById(Long id){ |
| | | public EimsRepairReqVo queryById(Long id) { |
| | | return baseMapper.selectVoById(id); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public TableDataInfo<EimsRepairReqVo> queryPageListCustom(EimsRepairReqBo bo, PageQuery pageQuery) { |
| | | DataFilterUtil.getInstance().filterRepairReq(bo); |
| | | Page<EimsRepairReqVo> page = baseMapper.selectRepairReqList(pageQuery.build(), buildWrapper(bo)); |
| | | return TableDataInfo.build(page); |
| | | } |
| | |
| | | private QueryWrapper<EimsRepairReq> buildWrapper(EimsRepairReqBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | QueryWrapper<EimsRepairReq> qw = Wrappers.query(); |
| | | qw.like(StringUtils.isNotBlank(bo.getCode()),"a.code", bo.getCode()); |
| | | qw.like(StringUtils.isNotBlank(bo.getCode()), "a.code", bo.getCode()); |
| | | qw.eq(StringUtils.isNotBlank(bo.getStatus()), "a.status", bo.getStatus()); |
| | | qw.eq(bo.getReqTime() != null, "a.req_time", bo.getReqTime()); |
| | | qw.eq(bo.getReqDept() != null, "a.req_dept", bo.getReqDept()); |
| | | qw.eq(bo.getReqUser() != null,"a.req_user", bo.getReqUser()); |
| | | qw.eq(bo.getReqUser() != null, "a.req_user", bo.getReqUser()); |
| | | qw.eq(StringUtils.isNotBlank(bo.getUrgencyLevel()), "a.urgency_level", bo.getUrgencyLevel()); |
| | | qw.eq(StringUtils.isNotBlank(bo.getReqType()), "a.req_type", bo.getReqType()); |
| | | qw.eq(bo.getEquId() != null, "a.equ_id", bo.getEquId()); |
| | | qw.eq(bo.getRepairDept() != null,"a.repair_dept", bo.getRepairDept()); |
| | | qw.eq(bo.getRepairDept() != null, "a.repair_dept", bo.getRepairDept()); |
| | | qw.eq(bo.getRepairUser() != null, "a.repair_user", bo.getRepairUser()); |
| | | qw.eq(StringUtils.isNotBlank(bo.getFaultType()), "a,fault_type", bo.getFaultType()); |
| | | qw.eq(params.containsKey("createBy"), "a.create_by", params.get("createBy")); |
| | | qw.eq(params.containsKey("status"), "a.status", params.get("status")); |
| | | qw.between(params.get("beginReqTime") != null && params.get("endReqTime") != null, |
| | | "a.req_time", params.get("beginReqTime"), params.get("endReqTime")); |
| | | |
| | | |
| | | qw.eq(bo.getCreateBy()!=null, "a.create_by", bo.getCreateBy()); |
| | | qw.eq(StringUtils.isNotEmpty(bo.getStatus()), "a.status", bo.getStatus()); |
| | | |
| | | /** |
| | | * æ¥è¯¢é¨é¨ä¸ææåé¨é¨ |
| | | */ |
| | | if (bo.getReqDept() != null) { |
| | | List<Long> allDescendantIds = getAllDescendantIds(bo.getReqDept()); |
| | | qw.in(bo.getReqDept() != null, "a.req_dept", allDescendantIds); |
| | | } |
| | | |
| | | return qw; |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®idï¼è·åææå代id |
| | | * |
| | | * @param rootId |
| | | * @return |
| | | */ |
| | | public List<Long> getAllDescendantIds(Long rootId) { |
| | | List<Long> result = new ArrayList<>(); |
| | | result.add(rootId); |
| | | collectDescendants(rootId, result); |
| | | return result; |
| | | } |
| | | |
| | | private void collectDescendants(Long currentId, List<Long> collector) { |
| | | QueryWrapper<SysDept> sysDeptWrapper = new QueryWrapper<>(); |
| | | sysDeptWrapper.lambda().eq(SysDept::getParentId, currentId); |
| | | |
| | | List<SysDeptVo> children = sysDeptMapper.selectVoList(sysDeptWrapper); |
| | | if (children != null && !children.isEmpty()) { |
| | | for (SysDeptVo child : children) { |
| | | Long childId = child.getDeptId(); |
| | | collector.add(childId); |
| | | collectDescendants(childId, collector); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çæ
éæ¥ä¿®å表 |
| | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | */ |
| | | private void validEntityBeforeSave(EimsRepairReq entity){ |
| | | private void validEntityBeforeSave(EimsRepairReq entity) { |
| | | //TODO åä¸äºæ°æ®æ ¡éª,å¦å¯ä¸çº¦æ |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
| | | if(isValid){ |
| | | if (isValid) { |
| | | //TODO åä¸äºä¸å¡ä¸çæ ¡éª,夿æ¯å¦éè¦æ ¡éª |
| | | } |
| | | return baseMapper.deleteByIds(ids) > 0; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.utils; |
| | | |
| | | import org.dromara.common.core.domain.model.LoginUser; |
| | | import org.dromara.common.satoken.utils.LoginHelper; |
| | | import org.dromara.eims.domain.bo.EimsRepairReqBo; |
| | | |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * èªå®ä¹æ°æ®é离 |
| | | */ |
| | | public class DataFilterUtil { |
| | | |
| | | //TODO ä¿æä¸æ°æ®åºä¸ç´ å®ä¹è§è²ç±»å operator-æä½å·¥ repair-维修工 |
| | | private enum Role { |
| | | operator, repair |
| | | } |
| | | |
| | | private static final DataFilterUtil INSTANCE = new DataFilterUtil(); |
| | | |
| | | private DataFilterUtil() { |
| | | } |
| | | public static DataFilterUtil getInstance() { |
| | | return INSTANCE; |
| | | } |
| | | //æ¥ä¿®å |
| | | public void filterRepairReq(EimsRepairReqBo bo){ |
| | | LoginUser loginUser = LoginHelper.getLoginUser(); |
| | | if (loginUser == null) return; |
| | | Set<String> rolePermission = loginUser.getRolePermission(); |
| | | if (rolePermission == null) return; |
| | | if (rolePermission.contains(Role.operator.name())) { |
| | | //维修工åªè½æ¥è¯¢èªå·±çæ°æ® |
| | | bo.setCreateBy(loginUser.getUserId()); |
| | | }else if (rolePermission.contains(Role.repair.name())) { |
| | | //TODO 维修工åªè½æ¥è¯¢æªæ¥åç¶æçæ¥ä¿®åï¼å
·ä½ç¶æåèåå
¸repair_req_statusï¼ |
| | | bo.setStatus("0"); |
| | | } |
| | | System.err.println(loginUser); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.dromara.eims.mapper.EimsFixtureBorrowMapper"> |
| | | |
| | | </mapper> |