| | |
| | | * åç¨äºº |
| | | */ |
| | | borrowUserName: string; |
| | | /** |
| | | * åç¨ç¶æ |
| | | */ |
| | | borrowStatus: string; |
| | | |
| | | createTime: string; |
| | | |
| | | /** |
| | | * ç¶æï¼åå
¸ï¼ |
| | |
| | | updateBy?: any; |
| | | updateTime?: any; |
| | | } |
| | | |
| | | export interface DictDataItem { |
| | | dictType: string; |
| | | dictValue: string; |
| | | } |
| | |
| | | import type { DictData } from './dict-data-model'; |
| | | import type { DictData, DictDataItem } from './dict-data-model'; |
| | | |
| | | import type { ID, IDS, PageQuery } from '#/api/common'; |
| | | |
| | |
| | | |
| | | enum Api { |
| | | dictDataExport = '/system/dict/data/export', |
| | | dictDataItem = '/system/dict/data/item', |
| | | dictDataList = '/system/dict/data/list', |
| | | root = '/system/dict/data', |
| | | root = '/system/dict/data' |
| | | } |
| | | |
| | | /** |
| | |
| | | export function dictDetailInfo(dictCode: ID) { |
| | | return requestClient.get<DictData>(`${Api.root}/${dictCode}`); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢åå
¸æ°æ®è¯¦ç» |
| | | * @param params |
| | | * @returns åå
¸æ°æ® |
| | | */ |
| | | export function dictDataItem(params: DictDataItem) { |
| | | return requestClient.get<DictData>(Api.dictDataItem, { params }); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | /** |
| | | * æä½ç±»å |
| | | */ |
| | | export enum SYS_OPER_TYPE { |
| | | ADD = '1', |
| | | EDIT = '2' |
| | | } |
| | | |
| | | |
| | | /** |
| | | * å·¥å
·åç¨è®°å½è¡¨ä¸åç¨è®°å½ç¶æ |
| | | */ |
| | | export enum FIXTURE_BORROW_RECORD_STATUS{ |
| | | BORROW = '0', |
| | | RERURN = '1' |
| | | |
| | | } |
| | |
| | | width: 200 |
| | | } |
| | | ]; |
| | | export const customColumns: 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 |
| | | } |
| | | ]; |
| | | |
| | | |
| | | |
| | | export const drawerSchema: FormSchemaGetter = () => [ |
| | | { |
| | |
| | | <script setup lang="ts"> |
| | | import { AnalysisOverview, Page, WorkbenchTrends } from '@vben/common-ui'; |
| | | import { onMounted, ref } from 'vue'; |
| | | |
| | | import { overviewItems, trendItems } from './data'; |
| | | import { AnalysisOverview, type AnalysisOverviewItem, Page, type WorkbenchTrendItem, WorkbenchTrends } from '@vben/common-ui'; |
| | | import { DictEnum } from '@vben/constants'; |
| | | |
| | | import { listFixture } from '#/api/eims/fixture'; |
| | | import { operLogList } from '#/api/monitor/operlog'; |
| | | import { dictDataInfo } from '#/api/system/dict/dict-data'; |
| | | import { SYS_OPER_TYPE } from '#/constants/dict'; |
| | | |
| | | const fixtureList = ref<AnalysisOverviewItem[]>([ |
| | | { |
| | | icon: 'svg:card', |
| | | title: 'å·¥å
·æ»æ°', |
| | | totalTitle: 'å·¥å
·æ»æ°', |
| | | totalValue: 0, |
| | | value: 0 |
| | | }, |
| | | { |
| | | icon: 'svg:cake', |
| | | title: 'å¯ç¨å·¥å
·æ°', |
| | | totalTitle: 'å¯ç¨å·¥å
·æ°', |
| | | totalValue: 0, |
| | | value: 0 |
| | | }, |
| | | { |
| | | icon: 'svg:download', |
| | | title: 'ååºæ»æ°', |
| | | totalTitle: 'ååºæ»æ°', |
| | | totalValue: 0, |
| | | value: 0 |
| | | }, |
| | | { |
| | | icon: 'svg:bell', |
| | | title: 'æè¿æ´æ°', |
| | | totalTitle: 'æè¿æ´æ°', |
| | | totalValue: 0, |
| | | value: 0 |
| | | } |
| | | ]); |
| | | const logList = ref<WorkbenchTrendItem[]>([]); |
| | | |
| | | async function initFixtrueList() { |
| | | const data = await listFixture({ |
| | | pageNum: 1, |
| | | pageSize: 100_000 |
| | | }); |
| | | if (!data) { |
| | | console.error('Failed to fetch data.'); |
| | | return; |
| | | } |
| | | |
| | | const rows = data.rows; |
| | | const now = Date.now(); // è·åå½åæ¶é´çæ¶é´æ³ |
| | | const sevenDaysAgo = now - 7 * 24 * 60 * 60 * 1000; // 计ç®7天åçæ¶é´æ³ |
| | | |
| | | const kongxian = rows.filter((item) => item.borrowStatus === '0' || item.borrowStatus === null); |
| | | const jiechu = rows.filter((item) => item.borrowStatus === '1'); |
| | | const zuijin = rows.filter((item) => new Date(item.createTime).getTime() >= sevenDaysAgo); |
| | | |
| | | fixtureList.value[0]!.value = fixtureList.value[0]!.totalValue = data.total || 0; |
| | | fixtureList.value[1]!.value = fixtureList.value[1]!.totalValue = kongxian.length; |
| | | fixtureList.value[2]!.value = fixtureList.value[2]!.totalValue = jiechu.length; |
| | | fixtureList.value[3]!.value = fixtureList.value[3]!.totalValue = zuijin.length; |
| | | } |
| | | |
| | | async function initLogList() { |
| | | const params = { title: 'åç¨è®°å½', orderByColumn: 'operTime', isAsc: 'desc' }; |
| | | const res = await operLogList({ |
| | | pageNum: 1, |
| | | pageSize: 20, |
| | | ...params |
| | | }); |
| | | let list = res?.rows; |
| | | list = list.filter((i) => i.businessType.toString() === SYS_OPER_TYPE.ADD || i.businessType.toString() === SYS_OPER_TYPE.EDIT); |
| | | list = list.filter((i) => i.jsonResult !== null && JSON.parse(i.jsonResult).code === 200); |
| | | |
| | | const recordStatusList = await dictDataInfo(DictEnum.FIXTURE_BORROW_RECORD_STATUS); |
| | | list.forEach((row) => { |
| | | const operParam = JSON.parse(row.operParam); |
| | | const label = recordStatusList.find((item) => item.dictValue === operParam.status)?.dictLabel; |
| | | logList.value.push({ |
| | | avatar: 'svg:avatar-1', |
| | | content: `${row?.deptName} ${row?.operName} <a>${label}</a> ${operParam?.fixtureName} `, |
| | | date: row.operTime, |
| | | title: row.title |
| | | }); |
| | | }); |
| | | } |
| | | onMounted(() => { |
| | | initFixtrueList(); |
| | | initLogList(); |
| | | }); |
| | | </script> |
| | | |
| | | <template> |
| | | <Page :auto-content-height="true"> |
| | | <div class="h-full"> |
| | | <AnalysisOverview :items="overviewItems" /> |
| | | <WorkbenchTrends :items="trendItems" class="mt-5" title="ææ°å¨æ" /> |
| | | <AnalysisOverview :items="fixtureList" /> |
| | | <WorkbenchTrends :items="logList" class="mt-5" title="ææ°å¨æ" /> |
| | | <div class="h-5"></div> |
| | | </div> |
| | | </Page> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import { useVbenDrawer, type VbenFormProps } from '@vben/common-ui'; |
| | | |
| | | import { Space } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { listFixBorrow } from '#/api/eims/fixture-borrow'; |
| | | import { customColumns as columns, querySchema } from '#/views/eims/fixture-borrow/data'; |
| | | |
| | | const [BasicDrawer, drawerApi] = useVbenDrawer({ |
| | | onCancel: handleCancel, |
| | | onConfirm: handleConfirm, |
| | | async onOpenChange(isOpen) { |
| | | if (!isOpen) { |
| | | return null; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | const formOptions: VbenFormProps = { |
| | | commonConfig: { |
| | | labelWidth: 80, |
| | | componentProps: { |
| | | allowClear: true |
| | | } |
| | | }, |
| | | collapsed: true, |
| | | schema: querySchema(), |
| | | wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4', |
| | | handleReset: async () => { |
| | | // eslint-disable-next-line no-use-before-define |
| | | const { formApi, reload } = tableApi; |
| | | await formApi.resetForm(); |
| | | const formValues = formApi.form.values; |
| | | formApi.setLatestSubmissionValues(formValues); |
| | | await reload(formValues); |
| | | }, |
| | | // æ¥æéæ©æ ¼å¼å |
| | | fieldMappingTime: [] |
| | | }; |
| | | |
| | | const gridOptions: VxeGridProps = { |
| | | checkboxConfig: { |
| | | // é«äº® |
| | | highlight: true, |
| | | // 翻页æ¶ä¿çéä¸ç¶æ |
| | | reserve: true |
| | | // ç¹å»è¡éä¸ |
| | | // trigger: 'row' |
| | | }, |
| | | columns, |
| | | height: 'auto', |
| | | keepSource: true, |
| | | pagerConfig: {}, |
| | | toolbarConfig: { |
| | | enabled: false |
| | | }, |
| | | formConfig: { |
| | | enabled: false |
| | | }, |
| | | proxyConfig: { |
| | | ajax: { |
| | | query: async ({ page }, formValues = {}) => { |
| | | const { fixtureId } = drawerApi.getData() as { fixtureId?: number | string }; |
| | | return await listFixBorrow({ |
| | | fixtureId, |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | rowConfig: { |
| | | isHover: true, |
| | | keyField: 'id' |
| | | }, |
| | | sortConfig: { |
| | | // è¿ç¨æåº |
| | | remote: true, |
| | | // æ¯æå¤å段æåº é»è®¤å
³é |
| | | multiple: true |
| | | }, |
| | | id: 'fixture-borrow-list-index' |
| | | }; |
| | | const [BasicTable, tableApi] = useVbenVxeGrid({ |
| | | gridOptions, |
| | | gridEvents: { |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams) |
| | | } |
| | | }); |
| | | |
| | | async function handleCancel() { |
| | | drawerApi.close(); |
| | | } |
| | | |
| | | async function handleConfirm() { |
| | | try { |
| | | drawerApi.drawerLoading(true); |
| | | |
| | | await handleCancel(); |
| | | } catch (error) { |
| | | console.error(error); |
| | | } finally { |
| | | drawerApi.drawerLoading(false); |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <BasicDrawer :close-on-click-modal="false" class="w-[800px]" title="åç¨è®°å½"> |
| | | <BasicTable class="flex-1 overflow-hidden" table-title="åç¨è®°å½"> |
| | | <template #fixtureName="{ row }"> |
| | | <Space> |
| | | <span>{{ row.fixtureName }}</span> |
| | | </Space> |
| | | </template> |
| | | |
| | | <template #action="{ row }"> </template> |
| | | </BasicTable> |
| | | </BasicDrawer> |
| | | </template> |
| | | |
| | | <style scoped></style> |
| | |
| | | |
| | | import { columns, querySchema } from './data'; |
| | | import fixtureDrawer from './fixture-drawer.vue'; |
| | | import fixtureBorrowListDrawer from './fixture-borrow-list-drawer.vue'; |
| | | import fixtureImportModal from './fixture-import-modal.vue'; |
| | | import FixtureTypeTree from './fixture-type-tree.vue'; |
| | | |
| | |
| | | formOptions, |
| | | gridOptions, |
| | | gridEvents: { |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams) |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams), |
| | | cellClick: (e: any) => { |
| | | const { row } = e; |
| | | console.error() |
| | | handleBorroeList(row) |
| | | } |
| | | } |
| | | }); |
| | | |
| | | const [FixtureDrawer, fixtureDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: fixtureDrawer |
| | | }); |
| | | const [FixtureBorrowListDrawer, fixtureBorrowListDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: fixtureBorrowListDrawer, |
| | | placement: 'left' |
| | | }); |
| | | |
| | | const [FixtureBorrowDrawer, fixtureBorrowDrawerApi] = useVbenDrawer({ |
| | |
| | | function handleAdd() { |
| | | fixtureDrawerApi.setData({}); |
| | | fixtureDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleBorroeList(record: Recordable<any>) { |
| | | fixtureBorrowListDrawerApi.setData({ fixtureId: record.id }); |
| | | fixtureBorrowListDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleEdit(record: Recordable<any>) { |
| | |
| | | <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 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)"> |
| | |
| | | </BasicTable> |
| | | </div> |
| | | <FixtureDrawer @reload="tableApi.query()" /> |
| | | <!--å·¥å
·ååºå½è¿æä½--> |
| | | <FixtureBorrowDrawer @reload="tableApi.query()" /> |
| | | <!--æ¥çå·¥å
·ååºå½è¿è®°å½--> |
| | | <FixtureBorrowListDrawer /> |
| | | <FixtureImportModal @reload="tableApi.query()" /> |
| | | </Page> |
| | | </template> |
| | |
| | | }); |
| | | check.value = data1 !== null && data1.length > 0 ? `å·²ç(${data1.length})` : `å·²ç(0)`; |
| | | } |
| | | |
| | | }); |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <Page :auto-content-height="true"> |
| | | <div class="flex h-full gap-[8px]"> |
| | | <EquTypeTree v-model:select-dept-id="selectTypeId" class="w-[260px]" @reload="() => tableApi.reload()" |
| | | @select="() => tableApi.reload()" /> |
| | | <EquTypeTree v-model:select-dept-id="selectTypeId" class="w-[260px]" @reload="() => tableApi.reload()" @select="() => tableApi.reload()" /> |
| | | <BasicTable class="flex-1 overflow-hidden" table-title="çç¹æç»å表"> |
| | | <template #toolbar-tools> |
| | | <Space> |
| | |
| | | |
| | | <template #action="{ row }"> |
| | | <Space> |
| | | <ghost-button :disabled="!isSuperAdmin" v-access:code="['eims:inventory:edit']" |
| | | @click.stop="handleEdit(row)"> |
| | | <ghost-button :disabled="!isSuperAdmin" v-access:code="['eims:inventory:edit']" @click.stop="handleEdit(row)"> |
| | | {{ $t('pages.common.edit') }} |
| | | </ghost-button> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" |
| | | @confirm="handleDelete(row)"> |
| | | <Popconfirm :get-popup-container="getVxePopupContainer" placement="left" title="确认å é¤ï¼" @confirm="handleDelete(row)"> |
| | | <ghost-button :disabled="!isSuperAdmin" danger v-access:code="['eims:inventory:remove']" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </ghost-button> |
| | |
| | | |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.dromara.common.mybatis.core.domain.BaseEntity; |
| | | import org.dromara.common.translation.annotation.Translation; |
| | | import org.dromara.common.translation.constant.TransConstant; |
| | | import org.dromara.eims.domain.EimsFixture; |
| | |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @AutoMapper(target = EimsFixture.class) |
| | | public class EimsFixtureVo implements Serializable { |
| | | public class EimsFixtureVo extends BaseEntity implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | |
| | | public R<SysDictDataVo> getInfo(@PathVariable Long dictCode) { |
| | | return R.ok(dictDataService.selectDictDataById(dictCode)); |
| | | } |
| | | /** |
| | | * æ¥è¯¢åå
¸æ°æ®è¯¦ç» |
| | | * |
| | | * @param dictType åå
¸type |
| | | */ |
| | | @SaCheckPermission("system:dict:query") |
| | | @GetMapping(value = "/item") |
| | | public R<SysDictDataVo> getDictItem(String dictType,String dictValue) { |
| | | return R.ok(dictDataService.selectDictItem(dictType,dictValue)); |
| | | } |
| | | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åæ¥è¯¢åå
¸æ°æ®ä¿¡æ¯ |
| | |
| | | */ |
| | | boolean checkDictDataUnique(SysDictDataBo dict); |
| | | |
| | | SysDictDataVo selectDictItem(String dictType, String dictValue); |
| | | } |
| | |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | public SysDictDataVo selectDictItem(String dictType, String dictValue) { |
| | | LambdaQueryWrapper<SysDictData> QueryWrapper = new LambdaQueryWrapper<>(); |
| | | QueryWrapper.eq(SysDictData::getDictType, dictType); |
| | | QueryWrapper.eq(SysDictData::getDictValue, dictValue); |
| | | return baseMapper.selectVoOne(QueryWrapper, SysDictDataVo.class); |
| | | } |
| | | |
| | | } |