¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { RepairFbVO } from './model'; |
| | | |
| | | import type { ID, IDS } from '#/api/common'; |
| | | |
| | | import { commonExport } from '#/api/helper'; |
| | | import { requestClient } from '#/api/request'; |
| | | |
| | | enum Api { |
| | | repairFbExport = '/eims/repairFb/export', |
| | | repairFbList = '/eims/repairFb/list', |
| | | root = '/eims/repairFb' |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç»´ä¿®è¯ä»·å表 |
| | | * @param query |
| | | * @returns {*} |
| | | */ |
| | | |
| | | export function listRepairFb(params?: any) { |
| | | return requestClient.get<RepairFbVO[]>(Api.repairFbList, { params }); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç»´ä¿®è¯ä»·è¯¦ç» |
| | | * @param repairFbId |
| | | */ |
| | | export function getRepairFb(repairFbId: ID) { |
| | | return requestClient.get<RepairFbVO>(`${Api.root}/${repairFbId}`); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç»´ä¿®è¯ä»· |
| | | * @param data |
| | | */ |
| | | export function addRepairFb(data: any) { |
| | | return requestClient.postWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç»´ä¿®è¯ä»· |
| | | * @param data |
| | | */ |
| | | export function updateRepairFb(data: any) { |
| | | return requestClient.putWithMsg<void>(Api.root, data); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç»´ä¿®è¯ä»· |
| | | * @param repairFbId |
| | | */ |
| | | export function delRepairFb(repairFbId: IDS) { |
| | | return requestClient.deleteWithMsg<void>(`${Api.root}/${repairFbId}`); |
| | | } |
| | | /** |
| | | * å¯¼åº |
| | | * @param |
| | | */ |
| | | export function repairFbExport(data: any) { |
| | | return commonExport(Api.repairFbExport, data); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export interface RepairFbVO { |
| | | /** |
| | | * |
| | | */ |
| | | id: number | string; |
| | | |
| | | /** |
| | | * 维修工åid |
| | | |
| | | */ |
| | | resId: number | string; |
| | | /** |
| | | * 维修工åcode |
| | | |
| | | */ |
| | | resCode: string; |
| | | |
| | | /** |
| | | * åé¦ç»æ |
| | | */ |
| | | fbResult: string; |
| | | |
| | | /** |
| | | * åé¦äºº |
| | | */ |
| | | fbUser: number; |
| | | |
| | | /** |
| | | * åé¦äººé¨é¨ |
| | | */ |
| | | fbDept: number; |
| | | |
| | | /** |
| | | * å馿¶é´ |
| | | */ |
| | | fbTime: string; |
| | | |
| | | /** |
| | | * ç»´ä¿®åæ¶æ§(åå
¸) |
| | | */ |
| | | repairTimeliness: number | string; |
| | | |
| | | /** |
| | | * æå¡æåº¦ |
| | | */ |
| | | serviceAttitude: number | string; |
| | | |
| | | /** |
| | | * ç»´ä¿®ç°åº6s |
| | | */ |
| | | repairSs: number | string; |
| | | |
| | | /** |
| | | * 维修满æåº¦ |
| | | */ |
| | | repairSatisfaction: number | string; |
| | | |
| | | /** |
| | | * æè§æå»ºè®® |
| | | */ |
| | | suggestions: string; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | remark: string; |
| | | } |
| | |
| | | QuarkIcon, |
| | | SafariIcon, |
| | | UcIcon, |
| | | WindowsIcon, |
| | | WindowsIcon |
| | | } from '@vben/icons'; |
| | | |
| | | import { Tag } from 'ant-design-vue'; |
| | | import { Rate, Tag } from 'ant-design-vue'; |
| | | |
| | | import { DictTag } from '#/components/dict'; |
| | | |
| | |
| | | DELETE: 'red', |
| | | GET: 'green', |
| | | POST: 'blue', |
| | | PUT: 'orange', |
| | | PUT: 'orange' |
| | | }; |
| | | |
| | | const color = colors[method] ?? 'default'; |
| | |
| | | * @param [gap] é´é |
| | | * @returns render |
| | | */ |
| | | export function renderDictTags( |
| | | value: string[], |
| | | dicts: DictData[], |
| | | wrap = true, |
| | | gap = 1, |
| | | ) { |
| | | export function renderDictTags(value: string[], dicts: DictData[], wrap = true, gap = 1) { |
| | | if (!Array.isArray(value)) { |
| | | return <div>{value}</div>; |
| | | } |
| | |
| | | const dictInfo = getDict(dictName); |
| | | return renderDictTag(value, dictInfo); |
| | | } |
| | | export function renderIconSpan( |
| | | icon: ComponentType, |
| | | value: string, |
| | | center = false, |
| | | marginLeft = '2px', |
| | | ) { |
| | | export function renderIconSpan(icon: ComponentType, value: string, center = false, marginLeft = '2px') { |
| | | const justifyCenter = center ? 'justify-center' : ''; |
| | | |
| | | return ( |
| | |
| | | { icon: LinuxIcon, value: 'linux' }, |
| | | { icon: OSXIcon, value: 'osx' }, |
| | | { icon: AndroidIcon, value: 'android' }, |
| | | { icon: IPhoneIcon, value: 'iphone' }, |
| | | { icon: IPhoneIcon, value: 'iphone' } |
| | | ]; |
| | | |
| | | /** |
| | |
| | | { icon: QQIcon, value: 'qq' }, |
| | | { icon: DingtalkIcon, value: 'dingtalk' }, |
| | | { icon: UcIcon, value: 'uc' }, |
| | | { icon: BaiduIcon, value: 'baidu' }, |
| | | { icon: BaiduIcon, value: 'baidu' } |
| | | ]; |
| | | |
| | | export function renderOsIcon(os: string, center = false) { |
| | | if (!os) { |
| | | return; |
| | | } |
| | | let current = osOptions.find((item) => |
| | | os.toLocaleLowerCase().includes(item.value), |
| | | ); |
| | | let current = osOptions.find((item) => os.toLocaleLowerCase().includes(item.value)); |
| | | // windowsè¦ç¹æ®å¤ç |
| | | if (os.toLocaleLowerCase().includes('windows')) { |
| | | current = osOptions[0]; |
| | |
| | | if (!browser) { |
| | | return; |
| | | } |
| | | const current = browserOptions.find((item) => |
| | | browser.toLocaleLowerCase().includes(item.value), |
| | | ); |
| | | const current = browserOptions.find((item) => browser.toLocaleLowerCase().includes(item.value)); |
| | | if (current) { |
| | | return renderIconSpan(current.icon, browser, center, '5px'); |
| | | } |
| | |
| | | const defaultIcon = DefaultBrowserIcon; |
| | | return renderIconSpan(defaultIcon, browser, center, '5px'); |
| | | } |
| | | |
| | | export function renderRate(value: string) { |
| | | if (!value) { |
| | | return null; |
| | | } |
| | | |
| | | return <Rate disabled value={Number(value)}></Rate>; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import type { VxeGridProps } from '#/adapter/vxe-table'; |
| | | import type { DescItem } from '#/components/description'; |
| | | |
| | | import { getPopupContainer } from '@vben/utils'; |
| | | |
| | | import { Rate } from 'ant-design-vue'; |
| | | |
| | | import { type FormSchemaGetter } from '#/adapter/form'; |
| | | |
| | | export const querySchema: FormSchemaGetter = () => [ |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'resCode', |
| | | label: 'ç»´ä¿®åå·' |
| | | }, |
| | | { |
| | | component: 'TreeSelect', |
| | | // å¨draweréæ´æ° è¿éä¸éè¦é»è®¤çcomponentProps |
| | | defaultValue: undefined, |
| | | fieldName: 'resDept', |
| | | label: 'ç»´ä¿®é¨é¨' |
| | | // rules: 'selectRequired', |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | showSearch: true, |
| | | allowClear: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'resUser', |
| | | label: '维修人' |
| | | } |
| | | ]; |
| | | |
| | | export const columns: VxeGridProps['columns'] = [ |
| | | { type: 'checkbox', width: 60, fixed: 'left' }, |
| | | { |
| | | title: 'ç»´ä¿®åå·', |
| | | field: 'resCode', |
| | | minWidth: 160, |
| | | fixed: 'left' |
| | | }, |
| | | { |
| | | title: 'ç»æ', |
| | | field: 'fbResult', |
| | | minWidth: 200 |
| | | }, |
| | | { |
| | | field: 'action', |
| | | fixed: 'right', |
| | | slots: { default: 'action' }, |
| | | title: 'æä½', |
| | | width: 200 |
| | | } |
| | | ]; |
| | | |
| | | export const drawerSchema: FormSchemaGetter = () => [ |
| | | { |
| | | component: 'Input', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'id' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | dependencies: { |
| | | show: () => false, |
| | | triggerFields: [''] |
| | | }, |
| | | fieldName: 'resId' |
| | | }, |
| | | { |
| | | component: 'Input', |
| | | fieldName: 'resCode', |
| | | componentProps: { |
| | | readonly: true |
| | | }, |
| | | label: '维修工å' |
| | | }, |
| | | { |
| | | component: 'Textarea', |
| | | formItemClass: 'items-baseline', |
| | | fieldName: 'fbResult', |
| | | label: 'ç»æåé¦' |
| | | }, |
| | | { |
| | | component: 'Rate', |
| | | fieldName: 'repairSatisfaction', |
| | | label: '维修满æåº¦' |
| | | }, |
| | | { |
| | | component: 'Rate', |
| | | fieldName: 'repairTimeliness', |
| | | label: 'ç»´ä¿®åæ¶æ§' |
| | | }, |
| | | { |
| | | component: 'Rate', |
| | | fieldName: 'serviceAttitude', |
| | | label: 'ç»´ä¿®åæåº¦' |
| | | }, |
| | | { |
| | | component: 'Rate', |
| | | fieldName: 'repairSs', |
| | | label: 'ç»´ä¿®ç°åº6S' |
| | | }, |
| | | { |
| | | component: 'Textarea', |
| | | formItemClass: 'items-baseline', |
| | | fieldName: 'suggestions', |
| | | label: 'æè§æå»ºè®®' |
| | | }, |
| | | { |
| | | component: 'TreeSelect', |
| | | // å¨draweréæ´æ° è¿éä¸éè¦é»è®¤çcomponentProps |
| | | defaultValue: undefined, |
| | | fieldName: 'fbDept', |
| | | label: 'è¯ä»·äººé¨é¨', |
| | | rules: 'selectRequired' |
| | | }, |
| | | { |
| | | component: 'Select', |
| | | componentProps: { |
| | | showSearch: true, |
| | | allowClear: true, |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'fbUser', |
| | | label: 'è¯ä»·äºº', |
| | | rules: 'selectRequired' |
| | | }, |
| | | { |
| | | component: 'DatePicker', |
| | | componentProps: { |
| | | format: 'YYYY-MM-DD HH:mm:ss', |
| | | showTime: true, |
| | | valueFormat: 'YYYY-MM-DD HH:mm:ss', |
| | | getPopupContainer |
| | | }, |
| | | fieldName: 'fbTime', |
| | | label: 'è¯ä»·æ¶é´' |
| | | } |
| | | ]; |
| | | |
| | | export const descSchema: DescItem[] = [ |
| | | { |
| | | field: 'resCode', |
| | | label: '维修工å', |
| | | labelMinWidth: 80 |
| | | }, |
| | | { |
| | | field: 'fbResult', |
| | | label: 'ç»æåé¦' |
| | | }, |
| | | { |
| | | field: 'repairSatisfaction', |
| | | label: '维修满æåº¦', |
| | | render(value) { |
| | | return ( |
| | | <div class="flex items-center"> |
| | | <Rate disabled value={Number(value)}></Rate> |
| | | </div> |
| | | ); |
| | | } |
| | | }, |
| | | { |
| | | field: 'repairTimeliness', |
| | | label: 'ç»´ä¿®åæ¶æ§', |
| | | render(value) { |
| | | return ( |
| | | <div class="flex items-center"> |
| | | <Rate disabled value={Number(value)}></Rate> |
| | | </div> |
| | | ); |
| | | } |
| | | }, |
| | | { |
| | | field: 'serviceAttitude', |
| | | label: 'ç»´ä¿®åæåº¦', |
| | | render(value) { |
| | | return ( |
| | | <div class="flex items-center"> |
| | | <Rate disabled value={Number(value)}></Rate> |
| | | </div> |
| | | ); |
| | | } |
| | | }, |
| | | { |
| | | field: 'repairSs', |
| | | label: 'ç»´ä¿®ç°åº6s', |
| | | render(value) { |
| | | return ( |
| | | <div class="flex items-center"> |
| | | <Rate disabled value={Number(value)}></Rate> |
| | | </div> |
| | | ); |
| | | } |
| | | }, |
| | | { |
| | | field: 'suggestions', |
| | | label: 'æè§æå»ºè®®' |
| | | }, |
| | | { |
| | | field: 'fbDeptName', |
| | | label: 'è¯ä»·äººé¨é¨' |
| | | }, |
| | | { |
| | | field: 'fbUserName', |
| | | label: 'è¯ä»·äºº' |
| | | }, |
| | | { |
| | | field: 'fbTime', |
| | | label: 'è¯ä»·æ¶é´' |
| | | } |
| | | ]; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import { useVbenDrawer } from '@vben/common-ui'; |
| | | |
| | | import { getRepairFb } from '#/api/eims/repair-fb'; |
| | | import { Description, useDescription } from '#/components/description'; |
| | | import { descSchema } from '#/views/eims/repair-fb/data'; |
| | | |
| | | const [BasicDrawer, drawerApi] = useVbenDrawer({ |
| | | onOpenChange: handleOpenChange |
| | | }); |
| | | |
| | | const [registerDescription, { setDescProps }] = useDescription({ |
| | | column: 1, |
| | | schema: descSchema |
| | | }); |
| | | |
| | | async function handleOpenChange(open: boolean) { |
| | | if (!open) { |
| | | return null; |
| | | } |
| | | const { id } = drawerApi.getData() as { id?: number | string }; |
| | | if (id) { |
| | | const record = await getRepairFb(id); |
| | | setDescProps({ data: record }, true); |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <BasicDrawer :footer="false" class="w-[600px]" title="è¯ä»·æç»"> |
| | | <Description @register="registerDescription" /> |
| | | </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 { delRepairFb, listRepairFb, repairFbExport } from '#/api/eims/repair-fb'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | import { commonDownloadExcel } from '#/utils/file/download'; |
| | | |
| | | import { columns, querySchema } from './data'; |
| | | import repairFbDrawer from './repair-fb-drawer.vue'; |
| | | |
| | | const formOptions: VbenFormProps = { |
| | | commonConfig: { |
| | | labelWidth: 80, |
| | | componentProps: { |
| | | allowClear: true |
| | | } |
| | | }, |
| | | schema: querySchema(), |
| | | collapsed: true, |
| | | wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4', |
| | | // æ¥æéæ©æ ¼å¼å |
| | | fieldMappingTime: [['startTime', ['params[beginStartTime]', 'params[endStartTime]'], ['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 listRepairFb({ |
| | | pageNum: page.currentPage, |
| | | pageSize: page.pageSize, |
| | | ...formValues |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | rowConfig: { |
| | | isHover: true, |
| | | keyField: 'id' |
| | | }, |
| | | sortConfig: { |
| | | // è¿ç¨æåº |
| | | remote: true, |
| | | // æ¯æå¤å段æåº é»è®¤å
³é |
| | | multiple: true |
| | | }, |
| | | id: 'eims-repair-fb-index' |
| | | }; |
| | | |
| | | const [BasicTable, tableApi] = useVbenVxeGrid({ |
| | | formOptions, |
| | | gridOptions, |
| | | gridEvents: { |
| | | sortChange: (sortParams) => vxeSortEvent(tableApi, sortParams), |
| | | cellClick: (e: any) => { |
| | | const { row } = e; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | const [RepairFbDrawer, repairFbDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: repairFbDrawer |
| | | }); |
| | | |
| | | function handleAdd() { |
| | | repairFbDrawerApi.setData({ }); |
| | | repairFbDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleEdit(record: Recordable<any>) { |
| | | repairFbDrawerApi.setData({ id: record.id }); |
| | | repairFbDrawerApi.open(); |
| | | } |
| | | |
| | | async function handleDelete(row: Recordable<any>) { |
| | | await delRepairFb(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 delRepairFb(ids); |
| | | await tableApi.query(); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | function handleDownloadExcel() { |
| | | commonDownloadExcel(repairFbExport, 'ç»´ä¿®è¯ä»·è®°å½', tableApi.formApi.form.values, { |
| | | fieldMappingTime: formOptions.fieldMappingTime |
| | | }); |
| | | } |
| | | |
| | | onMounted(async () => { |
| | | await setupDeptSelect(); |
| | | }); |
| | | |
| | | /** |
| | | * ç¨æ·çå è½½ |
| | | */ |
| | | 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: 'resUser' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | /** |
| | | * åå§åé¨é¨éæ© |
| | | */ |
| | | 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.reqUser = undefined; |
| | | }, |
| | | placeholder: 'è¯·éæ©', |
| | | showSearch: true, |
| | | treeData: deptTree, |
| | | treeDefaultExpandAll: true, |
| | | treeLine: { showLeafIcon: false }, |
| | | // çéçåæ®µ |
| | | treeNodeFilterProp: 'label', |
| | | // éä¸åæ¾ç¤ºå¨è¾å
¥æ¡çå¼ |
| | | treeNodeLabelProp: 'fullName' |
| | | }), |
| | | fieldName: 'resDept' |
| | | } |
| | | ]); |
| | | } |
| | | </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:repairFb:export']" @click="handleDownloadExcel"> |
| | | {{ $t('pages.common.export') }} |
| | | </a-button> |
| | | <a-button |
| | | :disabled="!vxeCheckboxChecked(tableApi)" |
| | | danger |
| | | type="primary" |
| | | v-access:code="['eims:repairFb:remove']" |
| | | @click="handleMultiDelete" |
| | | > |
| | | {{ $t('pages.common.delete') }} |
| | | </a-button> |
| | | <a-button type="primary" v-access:code="['eims:repairFb:add']" @click="handleAdd"> {{ $t('pages.common.add') }}</a-button> |
| | | </Space> |
| | | </template> |
| | | |
| | | <template #action="{ row }"> |
| | | <Space> |
| | | <ghost-button v-access:code="['eims:repairFb: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:repairFb:remove']" @click.stop=""> |
| | | {{ $t('pages.common.delete') }} |
| | | </ghost-button> |
| | | </Popconfirm> |
| | | </Space> |
| | | </template> |
| | | </BasicTable> |
| | | </div> |
| | | <RepairFbDrawer @reload="tableApi.query()" /> |
| | | </Page> |
| | | </template> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script setup lang="ts"> |
| | | import type { RepairFbVO } from '#/api/eims/repair-fb/model'; |
| | | |
| | | import { computed, ref } from 'vue'; |
| | | |
| | | import { useVbenDrawer } from '@vben/common-ui'; |
| | | import { $t } from '@vben/locales'; |
| | | import { addFullName, cloneDeep, getPopupContainer } from '@vben/utils'; |
| | | |
| | | import { useVbenForm } from '#/adapter/form'; |
| | | import { addRepairFb, getRepairFb, updateRepairFb } from '#/api/eims/repair-fb'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | |
| | | 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 }; |
| | | // æ°æ®ä» repair_res index ä¼ è¿æ¥ |
| | | const repairFb = drawerApi.getData() as RepairFbVO; |
| | | if (repairFb?.fbDept) { |
| | | await setupUserOptions(repairFb.fbDept); |
| | | } |
| | | if (repairFb) { |
| | | await formApi.setValues(repairFb); |
| | | } |
| | | isUpdate.value = !!id; |
| | | // åå§å |
| | | await setupDeptSelect(); |
| | | |
| | | // æ´æ° && èµå¼ |
| | | if (isUpdate.value && id) { |
| | | const record = await getRepairFb(id); |
| | | if (record.fbDept) { |
| | | await setupUserOptions(record.fbDept); |
| | | } |
| | | record.repairSatisfaction = Number(record.repairSatisfaction); |
| | | record.repairSs = Number(record.repairSs); |
| | | record.serviceAttitude = Number(record.serviceAttitude); |
| | | record.repairTimeliness = Number(record.repairTimeliness); |
| | | await formApi.setValues(record); |
| | | } |
| | | |
| | | drawerApi.drawerLoading(false); |
| | | } |
| | | }); |
| | | |
| | | /** |
| | | * ç¨æ·çå è½½ |
| | | */ |
| | | 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: 'fbUser' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | /** |
| | | * åå§åé¨é¨éæ© |
| | | */ |
| | | 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.fbUser = undefined; |
| | | }, |
| | | placeholder: 'è¯·éæ©', |
| | | showSearch: true, |
| | | treeData: deptTree, |
| | | treeDefaultExpandAll: true, |
| | | treeLine: { showLeafIcon: false }, |
| | | // çéçåæ®µ |
| | | treeNodeFilterProp: 'label', |
| | | // éä¸åæ¾ç¤ºå¨è¾å
¥æ¡çå¼ |
| | | treeNodeLabelProp: 'fullName' |
| | | }), |
| | | fieldName: 'fbDept' |
| | | } |
| | | ]); |
| | | } |
| | | |
| | | async function handleConfirm() { |
| | | try { |
| | | drawerApi.drawerLoading(true); |
| | | const { valid } = await formApi.validate(); |
| | | if (!valid) { |
| | | return; |
| | | } |
| | | const data = cloneDeep(await formApi.getValues()); |
| | | await (isUpdate.value ? updateRepairFb(data) : addRepairFb(data)); |
| | | emit('reload'); |
| | | await handleCancel(); |
| | | } catch (error) { |
| | | console.error(error); |
| | | } finally { |
| | | drawerApi.drawerLoading(false); |
| | | } |
| | | } |
| | | |
| | | async function handleCancel() { |
| | | drawerApi.close(); |
| | | await formApi.resetForm(); |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | | <BasicDrawer :close-on-click-modal="false" :title="title" class="w-[600px]"> |
| | | <BasicForm /> |
| | | </BasicDrawer> |
| | | </template> |
| | |
| | | import { Modal, Popconfirm, Space } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid, vxeCheckboxChecked, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { delRepairRes, listRepairRes, repairResExport, updateRepairRes } from '#/api/eims/repair-res'; |
| | | import { delRepairRes, listRepairRes, repairResExport } from '#/api/eims/repair-res'; |
| | | import { getDeptTree, userList } from '#/api/system/user'; |
| | | import { REPAIR_RES_STATUS } from '#/constants/dict'; |
| | | import { commonDownloadExcel } from '#/utils/file/download'; |
| | |
| | | import RepairRecord from '../repair-record/index.vue'; |
| | | import { columns, querySchema } from './data'; |
| | | import repairResDrawer from './repair-res-drawer.vue'; |
| | | |
| | | import repairFbDrawer from '../repair-fb/repair-fb-drawer.vue' |
| | | import fbPreviewDrawer from '../repair-fb/fb-preview-drawer.vue' |
| | | |
| | | const userStore = useUserStore(); |
| | | const userId = userStore.userInfo?.userId; |
| | |
| | | connectedComponent: repairResDrawer |
| | | }); |
| | | |
| | | const [RepairFbDrawer, repairFbDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: repairFbDrawer |
| | | }); |
| | | |
| | | const [FbPreviewDrawer, fbPreviewDrawerApi] = useVbenDrawer({ |
| | | connectedComponent: fbPreviewDrawer |
| | | }); |
| | | |
| | | function handleAddFb(record: Recordable<any>) { |
| | | repairFbDrawerApi.setData({ resId: record.id, resCode: record.resCode, fbUser: userId, fbDept: deptId}); |
| | | repairFbDrawerApi.open(); |
| | | } |
| | | |
| | | function handleDetailFb(record: Recordable<any>) { |
| | | fbPreviewDrawerApi.setData({ id: record.fbId }); |
| | | fbPreviewDrawerApi.open(); |
| | | } |
| | | |
| | | |
| | | function handleAdd() { |
| | | repairResDrawerApi.setData({ resUser: userId, resDept: deptId }); |
| | | repairResDrawerApi.open(); |
| | |
| | | const { hasAccessByRoles } = useAccess(); |
| | | const isSuperAdmin = computed(() => hasAccessByRoles(['superadmin'])); |
| | | |
| | | |
| | | function pingjiaAdd(row: any) { |
| | | return (isSuperAdmin.value || row.reqUser === userId) && row.status === REPAIR_RES_STATUS.WANCHENG && !row.fbId; |
| | | } |
| | | |
| | | function pingjiaDetail(row: any) { |
| | | return (isSuperAdmin.value || row.reqUser === userId) && row.status === REPAIR_RES_STATUS.WANCHENG && row.fbId; |
| | | } |
| | | |
| | | function weixiu(row: any) { |
| | | return (isSuperAdmin.value || row.resUser === userId) && row.status === REPAIR_RES_STATUS.YIJIEDAN; |
| | | } |
| | | |
| | | function wancheng(row: any) { |
| | | return (isSuperAdmin.value || row.resUser === userId) && row.status === REPAIR_RES_STATUS.WEIXIU; |
| | | } |
| | | |
| | | async function handleRepairStatus(record: Recordable<any>, status: string) { |
| | | record.status = status; |
| | | handleConfirm(record); |
| | | } |
| | | |
| | | async function handleDelete(row: Recordable<any>) { |
| | |
| | | commonDownloadExcel(repairResExport, '维修工åè®°å½', tableApi.formApi.form.values, { |
| | | fieldMappingTime: formOptions.fieldMappingTime |
| | | }); |
| | | } |
| | | |
| | | async function handleConfirm(data: any) { |
| | | try { |
| | | await updateRepairRes(data); |
| | | } catch (error) { |
| | | console.error(error); |
| | | } finally { |
| | | } |
| | | } |
| | | |
| | | onMounted(async () => { |
| | |
| | | |
| | | <template #action="{ row }"> |
| | | <Space> |
| | | <ghost-button v-if="pingjiaAdd(row)" class="btn-success" v-access:code="['eims:repairRes:edit']" @click.stop="handleAddFb(row)"> è¯ä»· </ghost-button> |
| | | <ghost-button v-if="pingjiaDetail(row)" class="btn-success" v-access:code="['eims:repairRes:edit']" @click.stop="handleDetailFb(row)"> é
è¯ </ghost-button> |
| | | <ghost-button |
| | | v-if="weixiu(row)" |
| | | class="btn-success" |
| | |
| | | <RepairRecord :res-id="resId" class="h-1/3" table-title="维修记å½" /> |
| | | </div> |
| | | <RepairResDrawer @reload="tableApi.query()" /> |
| | | <RepairFbDrawer @reload="tableApi.query()" /> |
| | | <FbPreviewDrawer /> |
| | | </Page> |
| | | </template> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.dromara.eims.service.IEimsRepairResService; |
| | | 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.EimsRepairFbVo; |
| | | import org.dromara.eims.domain.bo.EimsRepairFbBo; |
| | | import org.dromara.eims.service.IEimsRepairFbService; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | | |
| | | /** |
| | | * ç»´ä¿®è¯ä»· |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-02-28 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @RestController |
| | | @RequestMapping("/eims/repairFb") |
| | | public class EimsRepairFbController extends BaseController { |
| | | |
| | | private final IEimsRepairFbService eimsRepairFbService; |
| | | private final IEimsRepairResService repairResService; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç»´ä¿®è¯ä»·å表 |
| | | */ |
| | | @SaCheckPermission("eims:repairFb:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<EimsRepairFbVo> list(EimsRepairFbBo bo, PageQuery pageQuery) { |
| | | return eimsRepairFbService.queryPageList(bo, pageQuery); |
| | | } |
| | | |
| | | /** |
| | | * 导åºç»´ä¿®è¯ä»·å表 |
| | | */ |
| | | @SaCheckPermission("eims:repairFb:export") |
| | | @Log(title = "ç»´ä¿®è¯ä»·", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(EimsRepairFbBo bo, HttpServletResponse response) { |
| | | List<EimsRepairFbVo> list = eimsRepairFbService.queryList(bo); |
| | | ExcelUtil.exportExcel(list, "ç»´ä¿®è¯ä»·", EimsRepairFbVo.class, response); |
| | | } |
| | | |
| | | /** |
| | | * è·åç»´ä¿®è¯ä»·è¯¦ç»ä¿¡æ¯ |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | @SaCheckPermission("eims:repairFb:query") |
| | | @GetMapping("/{id}") |
| | | public R<EimsRepairFbVo> getInfo(@NotNull(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long id) { |
| | | return R.ok(eimsRepairFbService.queryById(id)); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç»´ä¿®è¯ä»· |
| | | */ |
| | | @SaCheckPermission("eims:repairFb:add") |
| | | @Log(title = "ç»´ä¿®è¯ä»·", businessType = BusinessType.INSERT) |
| | | @RepeatSubmit() |
| | | @PostMapping() |
| | | public R<Void> add(@Validated(AddGroup.class) @RequestBody EimsRepairFbBo bo) { |
| | | return toAjax(eimsRepairFbService.insertByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç»´ä¿®è¯ä»· |
| | | */ |
| | | @SaCheckPermission("eims:repairFb:edit") |
| | | @Log(title = "ç»´ä¿®è¯ä»·", businessType = BusinessType.UPDATE) |
| | | @RepeatSubmit() |
| | | @PutMapping() |
| | | public R<Void> edit(@Validated(EditGroup.class) @RequestBody EimsRepairFbBo bo) { |
| | | return toAjax(eimsRepairFbService.updateByBo(bo)); |
| | | } |
| | | |
| | | /** |
| | | * å é¤ç»´ä¿®è¯ä»· |
| | | * |
| | | * @param ids 主é®ä¸² |
| | | */ |
| | | @SaCheckPermission("eims:repairFb:remove") |
| | | @Log(title = "ç»´ä¿®è¯ä»·", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public R<Void> remove(@NotEmpty(message = "主é®ä¸è½ä¸ºç©º") |
| | | @PathVariable Long[] ids) { |
| | | return toAjax(eimsRepairFbService.deleteWithValidByIds(List.of(ids), true)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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_repair_fb |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-02-28 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("eims_repair_fb") |
| | | public class EimsRepairFb extends BaseEntity { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @TableId(value = "id") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 维修工åid |
| | | |
| | | */ |
| | | private Long resId; |
| | | |
| | | /** |
| | | * 维修工åcode |
| | | |
| | | */ |
| | | private String resCode; |
| | | |
| | | /** |
| | | * åé¦ç»æ |
| | | */ |
| | | private String fbResult; |
| | | |
| | | /** |
| | | * åé¦äºº |
| | | */ |
| | | private Long fbUser; |
| | | |
| | | /** |
| | | * åé¦äººé¨é¨ |
| | | */ |
| | | private Long fbDept; |
| | | |
| | | /** |
| | | * å馿¶é´ |
| | | */ |
| | | private Date fbTime; |
| | | |
| | | /** |
| | | * ç»´ä¿®åæ¶æ§(åå
¸) |
| | | */ |
| | | private String repairTimeliness; |
| | | |
| | | /** |
| | | * æå¡æåº¦ |
| | | */ |
| | | private String serviceAttitude; |
| | | |
| | | /** |
| | | * ç»´ä¿®ç°åº6s |
| | | */ |
| | | private String repairSs; |
| | | |
| | | /** |
| | | * 维修满æåº¦ |
| | | */ |
| | | private String repairSatisfaction; |
| | | |
| | | /** |
| | | * æè§æå»ºè®® |
| | | */ |
| | | private String suggestions; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
| | |
| | | private String remark; |
| | | |
| | | |
| | | /** |
| | | * è¯ä»·id |
| | | */ |
| | | private Long fbId; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.domain.bo; |
| | | |
| | | import org.dromara.eims.domain.EimsRepairFb; |
| | | 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_repair_fb |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-02-28 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @AutoMapper(target = EimsRepairFb.class, reverseConvertGenerate = false) |
| | | public class EimsRepairFbBo extends BaseEntity { |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @NotNull(message = "ä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 维修工åid |
| | | |
| | | */ |
| | | private Long resId; |
| | | |
| | | private String resCode; |
| | | |
| | | /** |
| | | * åé¦ç»æ |
| | | */ |
| | | private String fbResult; |
| | | |
| | | /** |
| | | * åé¦äºº |
| | | */ |
| | | private Long fbUser; |
| | | |
| | | /** |
| | | * åé¦äººé¨é¨ |
| | | */ |
| | | private Long fbDept; |
| | | |
| | | /** |
| | | * å馿¶é´ |
| | | */ |
| | | private Date fbTime; |
| | | |
| | | /** |
| | | * ç»´ä¿®åæ¶æ§(åå
¸) |
| | | */ |
| | | private String repairTimeliness; |
| | | |
| | | /** |
| | | * æå¡æåº¦ |
| | | */ |
| | | private String serviceAttitude; |
| | | |
| | | /** |
| | | * ç»´ä¿®ç°åº6s |
| | | */ |
| | | private String repairSs; |
| | | |
| | | /** |
| | | * 维修满æåº¦ |
| | | */ |
| | | private String repairSatisfaction; |
| | | |
| | | /** |
| | | * æè§æå»ºè®® |
| | | */ |
| | | private String suggestions; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
| | |
| | | private String remark; |
| | | |
| | | |
| | | /** |
| | | * è¯ä»·id |
| | | */ |
| | | private Long fbId; |
| | | |
| | | |
| | | //è¾
å©å段 |
| | | /** |
| | | * éè¦æ¹éæ·»å çæ¥ä¿®åå· |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.EimsRepairFb; |
| | | 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_repair_fb |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-02-28 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | @AutoMapper(target = EimsRepairFb.class) |
| | | public class EimsRepairFbVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @ExcelProperty(value = "") |
| | | private Long id; |
| | | |
| | | /** |
| | | * 维修工åid |
| | | |
| | | */ |
| | | @ExcelProperty(value = "维修工åid") |
| | | private Long resId; |
| | | |
| | | /** |
| | | * 维修工åcode |
| | | |
| | | */ |
| | | @ExcelProperty(value = "维修工åcode") |
| | | private String resCode; |
| | | |
| | | /** |
| | | * åé¦ç»æ |
| | | */ |
| | | @ExcelProperty(value = "åé¦ç»æ") |
| | | private String fbResult; |
| | | |
| | | /** |
| | | * åé¦äºº |
| | | */ |
| | | @ExcelProperty(value = "åé¦äºº") |
| | | private Long fbUser; |
| | | |
| | | |
| | | @Translation(type = TransConstant.USER_ID_TO_NICKNAME, mapper = "fbUser") |
| | | private String fbUserName; |
| | | |
| | | /** |
| | | * åé¦äººé¨é¨ |
| | | */ |
| | | @ExcelProperty(value = "åé¦äººé¨é¨") |
| | | private Long fbDept; |
| | | |
| | | |
| | | |
| | | @Translation(type = TransConstant.DEPT_ID_TO_NAME, mapper = "fbDept") |
| | | private String fbDeptName; |
| | | |
| | | /** |
| | | * å馿¶é´ |
| | | */ |
| | | @ExcelProperty(value = "å馿¶é´") |
| | | private Date fbTime; |
| | | |
| | | /** |
| | | * ç»´ä¿®åæ¶æ§(åå
¸) |
| | | */ |
| | | @ExcelProperty(value = "ç»´ä¿®åæ¶æ§(åå
¸)") |
| | | private String repairTimeliness; |
| | | |
| | | /** |
| | | * æå¡æåº¦ |
| | | */ |
| | | @ExcelProperty(value = "æå¡æåº¦") |
| | | private String serviceAttitude; |
| | | |
| | | /** |
| | | * ç»´ä¿®ç°åº6s |
| | | */ |
| | | @ExcelProperty(value = "ç»´ä¿®ç°åº6s") |
| | | private String repairSs; |
| | | |
| | | /** |
| | | * 维修满æåº¦ |
| | | */ |
| | | @ExcelProperty(value = "维修满æåº¦") |
| | | private String repairSatisfaction; |
| | | |
| | | /** |
| | | * æè§æå»ºè®® |
| | | */ |
| | | @ExcelProperty(value = "æè§æå»ºè®®") |
| | | private String suggestions; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * è¯ä»·id |
| | | */ |
| | | private Long fbId; |
| | | |
| | | |
| | | // å
³èè¡¨åæ®µ |
| | |
| | | private String reqCode;//æ¥ä¿®ç¼ç |
| | | |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.mapper; |
| | | |
| | | import org.dromara.eims.domain.EimsRepairFb; |
| | | import org.dromara.eims.domain.vo.EimsRepairFbVo; |
| | | import org.dromara.common.mybatis.core.mapper.BaseMapperPlus; |
| | | |
| | | /** |
| | | * ç»´ä¿®è¯ä»·Mapperæ¥å£ |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-02-28 |
| | | */ |
| | | public interface EimsRepairFbMapper extends BaseMapperPlus<EimsRepairFb, EimsRepairFbVo> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service; |
| | | |
| | | import org.dromara.eims.domain.vo.EimsRepairFbVo; |
| | | import org.dromara.eims.domain.bo.EimsRepairFbBo; |
| | | 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-28 |
| | | */ |
| | | public interface IEimsRepairFbService { |
| | | |
| | | /** |
| | | * æ¥è¯¢ç»´ä¿®è¯ä»· |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return ç»´ä¿®è¯ä»· |
| | | */ |
| | | EimsRepairFbVo queryById(Long id); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ç»´ä¿®è¯ä»·å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ç»´ä¿®è¯ä»·å页å表 |
| | | */ |
| | | TableDataInfo<EimsRepairFbVo> queryPageList(EimsRepairFbBo bo, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çç»´ä¿®è¯ä»·å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return ç»´ä¿®è¯ä»·å表 |
| | | */ |
| | | List<EimsRepairFbVo> queryList(EimsRepairFbBo bo); |
| | | |
| | | /** |
| | | * æ°å¢ç»´ä¿®è¯ä»· |
| | | * |
| | | * @param bo ç»´ä¿®è¯ä»· |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | Boolean insertByBo(EimsRepairFbBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹ç»´ä¿®è¯ä»· |
| | | * |
| | | * @param bo ç»´ä¿®è¯ä»· |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | Boolean updateByBo(EimsRepairFbBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤ç»´ä¿®è¯ä»·ä¿¡æ¯ |
| | | * |
| | | * @param ids å¾
å é¤ç主é®éå |
| | | * @param isValid æ¯å¦è¿è¡æææ§æ ¡éª |
| | | * @return æ¯å¦å 餿å |
| | | */ |
| | | Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.dromara.eims.service.impl; |
| | | |
| | | import org.dromara.common.core.service.RepairResService; |
| | | 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.eims.domain.EimsRepairRes; |
| | | import org.dromara.eims.mapper.EimsRepairResMapper; |
| | | import org.springframework.stereotype.Service; |
| | | import org.dromara.eims.domain.bo.EimsRepairFbBo; |
| | | import org.dromara.eims.domain.vo.EimsRepairFbVo; |
| | | import org.dromara.eims.domain.EimsRepairFb; |
| | | import org.dromara.eims.mapper.EimsRepairFbMapper; |
| | | import org.dromara.eims.service.IEimsRepairFbService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Collection; |
| | | |
| | | /** |
| | | * ç»´ä¿®è¯ä»·Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author zhuguifei |
| | | * @date 2025-02-28 |
| | | */ |
| | | @RequiredArgsConstructor |
| | | @Service |
| | | public class EimsRepairFbServiceImpl implements IEimsRepairFbService { |
| | | |
| | | private final EimsRepairFbMapper baseMapper; |
| | | private final EimsRepairResMapper repairResMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢ç»´ä¿®è¯ä»· |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return ç»´ä¿®è¯ä»· |
| | | */ |
| | | @Override |
| | | public EimsRepairFbVo queryById(Long id){ |
| | | return baseMapper.selectVoById(id); |
| | | } |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ç»´ä¿®è¯ä»·å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @param pageQuery å页忰 |
| | | * @return ç»´ä¿®è¯ä»·å页å表 |
| | | */ |
| | | @Override |
| | | public TableDataInfo<EimsRepairFbVo> queryPageList(EimsRepairFbBo bo, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<EimsRepairFb> lqw = buildQueryWrapper(bo); |
| | | Page<EimsRepairFbVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(result); |
| | | } |
| | | |
| | | /** |
| | | * æ¥è¯¢ç¬¦åæ¡ä»¶çç»´ä¿®è¯ä»·å表 |
| | | * |
| | | * @param bo æ¥è¯¢æ¡ä»¶ |
| | | * @return ç»´ä¿®è¯ä»·å表 |
| | | */ |
| | | @Override |
| | | public List<EimsRepairFbVo> queryList(EimsRepairFbBo bo) { |
| | | LambdaQueryWrapper<EimsRepairFb> lqw = buildQueryWrapper(bo); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<EimsRepairFb> buildQueryWrapper(EimsRepairFbBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<EimsRepairFb> lqw = Wrappers.lambdaQuery(); |
| | | lqw.eq(bo.getResId() != null, EimsRepairFb::getResId, bo.getResId()); |
| | | lqw.eq(bo.getFbUser() != null, EimsRepairFb::getFbUser, bo.getFbUser()); |
| | | lqw.eq(bo.getFbDept() != null, EimsRepairFb::getFbDept, bo.getFbDept()); |
| | | lqw.eq(bo.getFbTime() != null, EimsRepairFb::getFbTime, bo.getFbTime()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getRepairTimeliness()), EimsRepairFb::getRepairTimeliness, bo.getRepairTimeliness()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getServiceAttitude()), EimsRepairFb::getServiceAttitude, bo.getServiceAttitude()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getRepairSs()), EimsRepairFb::getRepairSs, bo.getRepairSs()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getRepairSatisfaction()), EimsRepairFb::getRepairSatisfaction, bo.getRepairSatisfaction()); |
| | | return lqw; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢ç»´ä¿®è¯ä»· |
| | | * |
| | | * @param bo ç»´ä¿®è¯ä»· |
| | | * @return æ¯å¦æ°å¢æå |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public Boolean insertByBo(EimsRepairFbBo bo) { |
| | | EimsRepairFb add = MapstructUtils.convert(bo, EimsRepairFb.class); |
| | | validEntityBeforeSave(add); |
| | | boolean flag = baseMapper.insert(add) > 0; |
| | | if (flag) { |
| | | bo.setId(add.getId()); |
| | | //æ°å¢æ¶æ´æ°repair_res表è¯ä»·id |
| | | EimsRepairRes eimsRepairRes = repairResMapper.selectById(bo.getResId()); |
| | | eimsRepairRes.setFbId(add.getId()); |
| | | repairResMapper.updateById(eimsRepairRes); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ç»´ä¿®è¯ä»· |
| | | * |
| | | * @param bo ç»´ä¿®è¯ä»· |
| | | * @return æ¯å¦ä¿®æ¹æå |
| | | */ |
| | | @Override |
| | | public Boolean updateByBo(EimsRepairFbBo bo) { |
| | | EimsRepairFb update = MapstructUtils.convert(bo, EimsRepairFb.class); |
| | | validEntityBeforeSave(update); |
| | | return baseMapper.updateById(update) > 0; |
| | | } |
| | | |
| | | /** |
| | | * ä¿ååçæ°æ®æ ¡éª |
| | | */ |
| | | private void validEntityBeforeSave(EimsRepairFb entity){ |
| | | //TODO åä¸äºæ°æ®æ ¡éª,å¦å¯ä¸çº¦æ |
| | | } |
| | | |
| | | /** |
| | | * æ ¡éªå¹¶æ¹éå é¤ç»´ä¿®è¯ä»·ä¿¡æ¯ |
| | | * |
| | | * @param ids å¾
å é¤ç主é®éå |
| | | * @param isValid æ¯å¦è¿è¡æææ§æ ¡éª |
| | | * @return æ¯å¦å 餿å |
| | | */ |
| | | @Override |
| | | public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) { |
| | | if(isValid){ |
| | | //TODO åä¸äºä¸å¡ä¸çæ ¡éª,夿æ¯å¦éè¦æ ¡éª |
| | | } |
| | | return baseMapper.deleteByIds(ids) > 0; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.EimsRepairFbMapper"> |
| | | |
| | | </mapper> |