| | |
| | | import { Modal, Popconfirm, Space } from 'ant-design-vue'; |
| | | |
| | | import { useVbenVxeGrid, vxeCheckboxChecked, type VxeGridProps, vxeSortEvent } from '#/adapter/vxe-table'; |
| | | import { listRepairRecord } from '#/api/eims/repair-record'; |
| | | 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 BasisSubTable from '#/views/eims/components/basis-sub-table.vue'; |
| | | |
| | | import RepairRecord from '../repair-record/index.vue'; |
| | | import fbPreviewDrawer from '../repair-fb/fb-preview-drawer.vue'; |
| | | import repairFbDrawer from '../repair-fb/repair-fb-drawer.vue'; |
| | | import { columns as repairRecordCol } from '../repair-record/data'; |
| | | 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; |
| | |
| | | }); |
| | | |
| | | function handleAddFb(record: Recordable<any>) { |
| | | repairFbDrawerApi.setData({ resId: record.id, resCode: record.resCode, fbUser: userId, fbDept: deptId}); |
| | | repairFbDrawerApi.setData({ resId: record.id, resCode: record.resCode, fbUser: userId, fbDept: deptId }); |
| | | repairFbDrawerApi.open(); |
| | | } |
| | | |
| | |
| | | fbPreviewDrawerApi.setData({ id: record.fbId }); |
| | | fbPreviewDrawerApi.open(); |
| | | } |
| | | |
| | | |
| | | function handleAdd() { |
| | | repairResDrawerApi.setData({ resUser: userId, resDept: deptId }); |
| | |
| | | |
| | | const { hasAccessByRoles } = useAccess(); |
| | | const isSuperAdmin = computed(() => hasAccessByRoles(['superadmin'])); |
| | | |
| | | const isLeader = computed(() => hasAccessByRoles(['leader'])); |
| | | |
| | | function pingjiaAdd(row: any) { |
| | | return (isSuperAdmin.value || row.reqUser === userId) && row.status === REPAIR_RES_STATUS.WANCHENG && !row.fbId; |
| | | return (isSuperAdmin.value || isLeader.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; |
| | | return (isSuperAdmin.value || isLeader.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; |
| | | return (isSuperAdmin.value || isLeader.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; |
| | | return (isSuperAdmin.value || isLeader.value || row.resUser === userId) && row.status === REPAIR_RES_STATUS.WEIXIU; |
| | | } |
| | | |
| | | async function handleDelete(row: Recordable<any>) { |
| | |
| | | |
| | | <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="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" |
| | |
| | | </Space> |
| | | </template> |
| | | </BasicTable> |
| | | <RepairRecord :res-id="resId" class="h-1/3" table-title="维修记录" /> |
| | | <BasisSubTable :columns="repairRecordCol" :list-api="listRepairRecord" :req-value="resId" class="h-1/3" req-key="resId" title="操作记录" /> |
| | | </div> |
| | | <RepairResDrawer @reload="tableApi.query()" /> |
| | | <RepairFbDrawer @reload="tableApi.query()" /> |