1.移动端添加自定义navbar导航栏
2.移动端添加角色控制操作按钮
| | |
| | | // colorTheme: 'red', |
| | | // buttonPrimaryBgColor: '#07c160', |
| | | // buttonPrimaryColor: '#07c160', |
| | | navbarColor: '#FFFFFF', |
| | | navbarDescFontColor: '#FFFFFF', |
| | | navbarTitleFontSize: '16px', |
| | | navbarDescFontSize: '14px', |
| | | } |
| | | </script> |
| | |
| | | "layout": "default", |
| | | "needLogin": true, |
| | | "style": { |
| | | "navigationBarTitleText": "设备列表" |
| | | "navigationBarTitleText": "设备列表", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | |
| | | "needLogin": true, |
| | | "style": { |
| | | "navigationBarTitleText": "点检记录", |
| | | "app-plus": { |
| | | "titleNView": { |
| | | "buttons": [ |
| | | { |
| | | "text": "提交", |
| | | "fontSize": "14px", |
| | | "color": "#FFFFFF" |
| | | }, |
| | | { |
| | | "text": "", |
| | | "fontSize": "24px", |
| | | "color": "#FFFFFF" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | |
| | | "needLogin": true, |
| | | "style": { |
| | | "navigationBarTitleText": "保养工单", |
| | | "app-plus": { |
| | | "titleNView": { |
| | | "buttons": [ |
| | | { |
| | | "text": "提交", |
| | | "fontSize": "14px", |
| | | "color": "#FFFFFF" |
| | | }, |
| | | { |
| | | "text": "", |
| | | "fontSize": "24px", |
| | | "color": "#FFFFFF" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | |
| | | "needLogin": true, |
| | | "style": { |
| | | "navigationBarTitleText": "工单明细", |
| | | "app-plus": { |
| | | "titleNView": { |
| | | "buttons": [ |
| | | { |
| | | "text": "提交", |
| | | "fontSize": "14px", |
| | | "color": "#FFFFFF" |
| | | }, |
| | | { |
| | | "text": "", |
| | | "fontSize": "24px", |
| | | "color": "#FFFFFF" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | |
| | | "path": "pages/repair/repair-add", |
| | | "type": "page", |
| | | "layout": "default", |
| | | "needLogin": true, |
| | | "style": { |
| | | "navigationBarTitleText": "添加报修", |
| | | "app-plus": { |
| | | "titleNView": { |
| | | "buttons": [ |
| | | { |
| | | "text": "提交", |
| | | "fontSize": "14px", |
| | | "color": "#FFFFFF" |
| | | }, |
| | | { |
| | | "text": "", |
| | | "fontSize": "24px", |
| | | "color": "#FFFFFF" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | |
| | | "layout": "default", |
| | | "needLogin": true, |
| | | "style": { |
| | | "navigationBarTitleText": "设备报修", |
| | | "app-plus": { |
| | | "titleNView": { |
| | | "buttons": [ |
| | | { |
| | | "text": "新增", |
| | | "fontSize": "14px", |
| | | "color": "#FFFFFF" |
| | | }, |
| | | { |
| | | "text": "", |
| | | "fontSize": "24px", |
| | | "color": "#FFFFFF" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | "navigationBarTitleText": "报修列表", |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | |
| | | "needLogin": true, |
| | | "style": { |
| | | "navigationBarTitleText": "设备维修", |
| | | "app-plus": { |
| | | "titleNView": { |
| | | "buttons": [ |
| | | { |
| | | "text": "接单", |
| | | "fontSize": "14px", |
| | | "color": "#FFFFFF" |
| | | }, |
| | | { |
| | | "text": "", |
| | | "fontSize": "24px", |
| | | "color": "#FFFFFF" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | "navigationStyle": "custom" |
| | | } |
| | | }, |
| | | { |
| | |
| | | { |
| | | layout: 'default', |
| | | needLogin: true, |
| | | style: { |
| | | navigationBarTitleText: '设备列表', |
| | | }, |
| | | style: { navigationBarTitleText: '设备列表', navigationStyle: 'custom' }, |
| | | } |
| | | </route> |
| | | <template> |
| | | <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time> |
| | | <template #top> |
| | | <wd-navbar |
| | | title="设备列表" |
| | | left-arrow |
| | | @click-left="goBack" |
| | | custom-style="background: #4D80F0;" |
| | | safeAreaInsetTop |
| | | ></wd-navbar> |
| | | <wd-drop-menu> |
| | | <wd-drop-menu-item |
| | | v-model="equTypeId" |
| | |
| | | }) |
| | | } |
| | | |
| | | const goBack = () => { |
| | | uni.navigateBack() |
| | | } |
| | | |
| | | /** |
| | | * 设备条目点击事件 |
| | | * @param item |
| | |
| | | v-for="(item, index) in commonMenu" |
| | | :key="item.id" |
| | | @click.stop="goItemPage(item)" |
| | | v-show="!(isLeader() && item.custom)" |
| | | > |
| | | <image class="slot-img text-center" :src="item.icon" /> |
| | | <text>{{ item.name }}</text> |
| | |
| | | { |
| | | layout: 'default', |
| | | needLogin: true, |
| | | style: { |
| | | navigationBarTitleText: '点检记录', |
| | | 'app-plus': { |
| | | titleNView: { |
| | | buttons: [ |
| | | { |
| | | text: '提交', |
| | | fontSize: '14px', |
| | | color: '#FFFFFF', |
| | | }, |
| | | { |
| | | text: '', |
| | | fontSize: '24px', |
| | | color: '#FFFFFF', |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | }, |
| | | style: { navigationBarTitleText: '点检记录', navigationStyle: 'custom' }, |
| | | } |
| | | </route> |
| | | <template> |
| | | <z-paging ref="paging" v-model="dataList" :auto="false" @query="queryList" show-refresher-update-time> |
| | | <template #top> |
| | | <wd-navbar |
| | | title="点检记录" |
| | | left-arrow |
| | | @click-left="goBack" |
| | | right-text="提交" |
| | | @click-right="handleClickRight" |
| | | custom-style="background: #4D80F0;" |
| | | safeAreaInsetTop |
| | | > |
| | | <template #right> |
| | | <text v-if="isOperatorOrRepair()" class="text-white">提交</text> |
| | | </template> |
| | | </wd-navbar> |
| | | <wd-card type="rectangle"> |
| | | <template #title> |
| | | <view class="flex justify-between"> |
| | |
| | | <script setup lang="ts"> |
| | | import { ref } from 'vue' |
| | | import { useUserStore, useAccessStore, useSystemConfigStore } from '@/store' |
| | | import { isLeader, isOperatorOrRepair } from "@/utils/RoleUtils"; |
| | | import { |
| | | getInspStRecordList, |
| | | getInspSt, |
| | |
| | | const goBack = () => { |
| | | uni.navigateBack() |
| | | } |
| | | onNavigationBarButtonTap((e) => { |
| | | if (e.index === 0) { |
| | | |
| | | function handleClickRight() { |
| | | if(isOperatorOrRepair()){ |
| | | handleConfirm() |
| | | } |
| | | }) |
| | | |
| | | } |
| | | |
| | | const toggleCollapse = () => { |
| | | isAllExpanded.value = !isAllExpanded.value |
| | |
| | | <template #top> |
| | | <wd-drop-menu> |
| | | <wd-drop-menu-item v-model="viewMode" :options="viewModeList" @change="handleViewMode" /> |
| | | <wd-drop-menu-item |
| | | v-model="filterDate" |
| | | :options="filterDateList" |
| | | @change="handleFilterDate" |
| | | /> |
| | | <wd-drop-menu-item v-model="equName" :options="equList" @change="handleEquName" /> |
| | | </wd-drop-menu> |
| | | </template> |
| | |
| | | <text class="ml-1">进行中</text> |
| | | </template> |
| | | </view> |
| | | <view class="text-color-gray text-xs mt-2 flex"> |
| | | 创建时间: {{item.createTime}} |
| | | </view> |
| | | <view class="text-color-gray text-xs mt-2 flex">创建时间: {{ item.createTime }}</view> |
| | | </view> |
| | | <wd-button size="small" icon="edit-outline" @click.stop="itemClick(item)">明细</wd-button> |
| | | </view> |
| | |
| | | <script setup lang="ts"> |
| | | import { ref } from 'vue' |
| | | import { getInspStList } from '@/service/inspect' |
| | | import { onShow } from '@dcloudio/uni-app' |
| | | import dayjs from 'dayjs' |
| | | |
| | | const viewMode = ref<string>('Day') |
| | | const equName = ref<string>('所有设备') |
| | | const filterDate = ref<string>('1') |
| | | |
| | | const viewModeList = ref<Record<string, any>[]>([ |
| | | { label: '日视图', value: 'Day' }, |
| | | { label: '月视图', value: 'Month' }, |
| | | ]) |
| | | const filterDateList = ref<Record<string, any>[]>([ |
| | | { label: '所有数据', value: '0' }, |
| | | { label: '当天(月)数据', value: '1' }, |
| | | ]) |
| | | |
| | | const equList = ref<Record<string, any>[]>([{ label: '所有设备', value: '所有设备' }]) |
| | | function handleViewMode({ value }) { |
| | | reloadData() |
| | |
| | | function handleEquName({ value }) { |
| | | console.log(value) |
| | | } |
| | | function handleFilterDate({ value }) { |
| | | reloadData() |
| | | } |
| | | |
| | | const paging = ref(null) |
| | | const dataList = ref([]) |
| | | |
| | | const queryList = (pageNum?: number, pageSize?: number) => { |
| | | // 这里的pageNo和pageSize会自动计算好,直接传给服务器即可 |
| | | // 这里的请求只是演示,请替换成自己的项目的网络请求,并在网络请求回调中通过paging.value.complete(请求回来的数组)将请求结果传给z-paging |
| | | getInspStList({ pageNum, pageSize, viewMode: viewMode.value }) |
| | | const params: any = { |
| | | pageNum, |
| | | pageSize, |
| | | viewMode: viewMode.value, |
| | | } |
| | | if (filterDate.value === '1') { |
| | | params.planTime = dayjs().format('YYYY-MM-DD') |
| | | } else { |
| | | delete params.planTime |
| | | } |
| | | getInspStList(params) |
| | | .then((res: any) => { |
| | | // 请勿在网络请求回调中给dataList赋值!!只需要调用complete就可以了 |
| | | paging.value.completeByTotal(res.rows, res.total) |
| | |
| | | { |
| | | layout: 'default', |
| | | needLogin: true, |
| | | style: { |
| | | navigationBarTitleText: '保养工单', |
| | | 'app-plus': { |
| | | titleNView: { |
| | | buttons: [ |
| | | { |
| | | text: '提交', |
| | | fontSize: '14px', |
| | | color: '#FFFFFF', |
| | | }, |
| | | { |
| | | text: '', |
| | | fontSize: '24px', |
| | | color: '#FFFFFF', |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | }, |
| | | style: { navigationBarTitleText: '保养工单', navigationStyle: 'custom' }, |
| | | } |
| | | </route> |
| | | |
| | |
| | | show-refresher-update-time |
| | | > |
| | | <template #top> |
| | | <wd-navbar |
| | | title="保养工单" |
| | | left-arrow |
| | | @click-left="goBack" |
| | | right-text="提交" |
| | | @click-right="handleClickRight" |
| | | custom-style="background: #4D80F0;" |
| | | safeAreaInsetTop |
| | | > |
| | | <template #right> |
| | | <text v-if="isOperatorOrRepair()" class="text-white">提交</text> |
| | | </template> |
| | | </wd-navbar> |
| | | <wd-cell> |
| | | <template #title> |
| | | <text class="text-color-gray">设备</text> |
| | |
| | | function reloadData() { |
| | | initMaintSt(maintStId.value) |
| | | } |
| | | onNavigationBarButtonTap((e) => { |
| | | if (e.index === 0) { |
| | | |
| | | const goBack = () => { |
| | | uni.navigateBack() |
| | | } |
| | | |
| | | function handleClickRight() { |
| | | if(isOperatorOrRepair()){ |
| | | handleUpdateMaintSt() |
| | | } |
| | | }) |
| | | |
| | | } |
| | | |
| | | onLoad(() => { |
| | | uni.$on('maint-order-refresh', reloadData) |
| | |
| | | <template #top> |
| | | <wd-drop-menu> |
| | | <wd-drop-menu-item v-model="equName" :options="equList" @change="handleEquName" /> |
| | | <wd-drop-menu-item |
| | | v-model="filterDate" |
| | | :options="filterDateList" |
| | | @change="handleFilterDate" |
| | | /> |
| | | <wd-drop-menu-item v-model="status" :options="statusList" @change="handleStatus" /> |
| | | </wd-drop-menu> |
| | | </template> |
| | |
| | | <script setup lang="ts"> |
| | | import { ref } from 'vue' |
| | | import { getMaintStList } from '@/service/maint' |
| | | import dayjs from 'dayjs' |
| | | |
| | | /** |
| | | * 其他页面传过来的数据 |
| | |
| | | assetNo?: string |
| | | equName?: string |
| | | status?: string |
| | | params?: NonNullable<unknown> |
| | | } |
| | | |
| | | // 页面参数,上个页面传递过来的参数 |
| | |
| | | }) |
| | | const status = ref<string>('-1') |
| | | const equName = ref<string>('-1') |
| | | const filterDate = ref<string>('1') |
| | | |
| | | const filterDateList = ref<Record<string, any>[]>([ |
| | | { label: '所有数据', value: '0' }, |
| | | { label: '当月数据', value: '1' }, |
| | | ]) |
| | | |
| | | const statusList = ref<Record<string, any>[]>([ |
| | | { label: '所有状态', value: '-1' }, |
| | |
| | | function handleEquName({ value }) { |
| | | console.log(value) |
| | | } |
| | | function handleFilterDate({ value }) { |
| | | reloadData() |
| | | } |
| | | |
| | | const paging = ref(null) |
| | | const dataList = ref([]) |
| | |
| | | const queryList = (pageNum?: number, pageSize?: number) => { |
| | | // 这里的pageNo和pageSize会自动计算好,直接传给服务器即可 |
| | | // 这里的请求只是演示,请替换成自己的项目的网络请求,并在网络请求回调中通过paging.value.complete(请求回来的数组)将请求结果传给z-paging |
| | | const params: QueryParams = { |
| | | const queryParams: QueryParams = { |
| | | pageNum, |
| | | pageSize, |
| | | equName: equName.value, |
| | | status: status.value, |
| | | } |
| | | if (filterDate.value === '1') { |
| | | // 获取当前日期 |
| | | const now = dayjs() |
| | | queryParams.params = { |
| | | beginPlanTime: now.startOf('month').format('YYYY-MM-DD 00:00:00'), |
| | | endPlanTime: now.endOf('month').format('YYYY-MM-DD 23:59:59'), |
| | | } |
| | | } else { |
| | | delete queryParams.params |
| | | } |
| | | |
| | | if (equName.value === '-1') { |
| | | delete params.equName |
| | | delete queryParams.equName |
| | | } |
| | | if (status.value === '-1') { |
| | | delete params.status |
| | | delete queryParams.status |
| | | } |
| | | // 如果是从扫码页面过来,只能查询固定设备的数据 |
| | | if (option?.from === 'scan') { |
| | | params.assetNo = option.assetNo |
| | | queryParams.assetNo = option.assetNo |
| | | } |
| | | |
| | | getMaintStList(params) |
| | | getMaintStList(queryParams) |
| | | .then((res: any) => { |
| | | // 请勿在网络请求回调中给dataList赋值!!只需要调用complete就可以了 |
| | | paging.value.completeByTotal(res.rows, res.total) |
| | |
| | | { |
| | | layout: 'default', |
| | | needLogin: true, |
| | | style: { |
| | | navigationBarTitleText: '工单明细', |
| | | 'app-plus': { |
| | | titleNView: { |
| | | buttons: [ |
| | | { |
| | | text: '提交', |
| | | fontSize: '14px', |
| | | color: '#FFFFFF', |
| | | }, |
| | | { |
| | | text: '', |
| | | fontSize: '24px', |
| | | color: '#FFFFFF', |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | }, |
| | | style: { navigationBarTitleText: '工单明细', navigationStyle: 'custom' }, |
| | | } |
| | | </route> |
| | | <template> |
| | | <view class="bg-base container" safeAreaInsetTopBottom> |
| | | <wd-navbar |
| | | title="保养工单" |
| | | left-arrow |
| | | @click-left="goBack" |
| | | right-text="提交" |
| | | @click-right="handleClickRight" |
| | | custom-style="background: #4D80F0;" |
| | | safeAreaInsetTop |
| | | > |
| | | <template #right> |
| | | <text v-if="isOperatorOrRepair()" class="text-white">提交</text> |
| | | <text v-else-if="isLeader()" class="text-white">验证</text> |
| | | </template> |
| | | </wd-navbar> |
| | | <wd-form ref="form" :model="order" :rules="rules"> |
| | | <wd-cell-group custom-class="group" title="设备信息" border> |
| | | <wd-cell title="设备名称" title-width="200rpx" is-link> |
| | |
| | | toast.success('操作成功') |
| | | } |
| | | |
| | | function handleClickRight(data: any) { |
| | | function handleSubmit(data: any) { |
| | | message |
| | | .confirm({ |
| | | msg: '确定提交?', |
| | |
| | | }) |
| | | } |
| | | |
| | | onNavigationBarButtonTap((e) => { |
| | | if (e.index === 0) { |
| | | const goBack = () => { |
| | | uni.navigateBack() |
| | | } |
| | | function handleClickRight() { |
| | | // 管理员角色 且待验证状态 |
| | | if (isLeader()) { |
| | | switch (order.status) { |
| | |
| | | // 修改工单状态为已完成 |
| | | const data: any = Object.assign({}, { id: order.id, status: order.status }) |
| | | data.status = '3' |
| | | handleClickRight(data) |
| | | handleSubmit(data) |
| | | } else { |
| | | toast.warning('请选择是否验证通过') |
| | | } |
| | |
| | | // 修改工单状态为待验证 |
| | | data.status = '2' |
| | | } |
| | | handleClickRight(data) |
| | | handleSubmit(data) |
| | | } |
| | | break |
| | | case '2': |
| | |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | |
| | | onMounted(() => {}) |
| | | onLoad((options) => { |
| | |
| | | <template> |
| | | <view class="bg-base"> |
| | | <wd-cell-group border> |
| | | <wd-cell title="登录用户" :value="realName" icon="user" is-link /> |
| | | <wd-cell title="角色" :value="loginRoleName()" icon="bags" is-link /> |
| | | <wd-cell title="人员管理" icon="usergroup" is-link @click="handleInfo" /> |
| | | <wd-cell title="登录用户" :value="realName" icon="user" custom-icon-class="icon-color-base" is-link /> |
| | | <wd-cell title="角色" :value="loginRoleName()" icon="bags" custom-icon-class="icon-color-base" is-link /> |
| | | <wd-cell title="人员管理" icon="usergroup" is-link custom-icon-class="icon-color-base" @click="handleInfo" /> |
| | | </wd-cell-group> |
| | | <wd-cell-group border class="mt-2"> |
| | | <wd-cell title="退出登录" icon="login" is-link @click="handleLogout" /> |
| | | <wd-cell title="退出登录" icon="login" is-link custom-icon-class="icon-color-base" @click="handleLogout" /> |
| | | </wd-cell-group> |
| | | </view> |
| | | </template> |
| | |
| | | <route lang="json5" type="page"> |
| | | { |
| | | layout: 'default', |
| | | style: { |
| | | navigationBarTitleText: '添加报修', |
| | | 'app-plus': { |
| | | titleNView: { |
| | | buttons: [ |
| | | { |
| | | text: '提交', |
| | | fontSize: '14px', |
| | | color: '#FFFFFF', |
| | | }, |
| | | { |
| | | text: '', |
| | | fontSize: '24px', |
| | | color: '#FFFFFF', |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | }, |
| | | needLogin: true, |
| | | style: { navigationBarTitleText: '添加报修', navigationStyle: 'custom' }, |
| | | } |
| | | </route> |
| | | |
| | | <template> |
| | | <view class="bg-base"> |
| | | <wd-navbar |
| | | title="添加报修" |
| | | left-arrow |
| | | @click-left="goBack" |
| | | right-text="提交" |
| | | @click-right="handleSubmit" |
| | | custom-style="background: #4D80F0;" |
| | | safeAreaInsetTop |
| | | ></wd-navbar> |
| | | <wd-form ref="form" :model="model"> |
| | | <wd-cell-group custom-class="group" title="类型信息" border> |
| | | <wd-picker |
| | |
| | | fixtureName: '', |
| | | fileList: [], |
| | | }) |
| | | |
| | | const goBack = () => { |
| | | uni.navigateBack() |
| | | } |
| | | /** |
| | | * 选择设备 |
| | | */ |
| | |
| | | /** |
| | | * 选择报修类型 |
| | | */ |
| | | function handleConfirmReqType({ value }) { |
| | | } |
| | | function handleConfirmReqType({ value }) {} |
| | | |
| | | /** |
| | | * 选择故障类别 |
| | | */ |
| | | function handleConfirmFaultType({ value }) { |
| | | } |
| | | function handleConfirmFaultType({ value }) {} |
| | | |
| | | /** |
| | | * 选择紧急程度 |
| | | */ |
| | | function handleConfirmUrgencyLevel({ value }) { |
| | | } |
| | | function handleConfirmUrgencyLevel({ value }) {} |
| | | |
| | | async function initData() { |
| | | const reqTypeList = await getDictInfo(DICT_REPAIR_REQ_TYPE) |
| | |
| | | const uList = await getDictInfo(DICT_REPAIR_URGENCY_LEVEL) |
| | | urgencyList.value = uList |
| | | } |
| | | |
| | | onNavigationBarButtonTap((e) => { |
| | | if (e.index === 0) { |
| | | handleSubmit() |
| | | } |
| | | }) |
| | | |
| | | onLoad((options) => { |
| | | Object.assign(option, options) |
| | |
| | | { |
| | | layout: 'default', |
| | | needLogin: true, |
| | | style: { |
| | | navigationBarTitleText: '设备报修', |
| | | 'app-plus': { |
| | | titleNView: { |
| | | buttons: [ |
| | | { |
| | | text: '新增', |
| | | fontSize: '14px', |
| | | color: '#FFFFFF', |
| | | }, |
| | | { |
| | | text: '', |
| | | fontSize: '24px', |
| | | color: '#FFFFFF', |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | }, |
| | | style: { navigationBarTitleText: '报修列表', navigationStyle: 'custom' }, |
| | | } |
| | | </route> |
| | | <template> |
| | | <z-paging ref="paging" v-model="dataList" :auto="false" @query="queryList" show-refresher-update-time> |
| | | <z-paging |
| | | ref="paging" |
| | | v-model="dataList" |
| | | :auto="false" |
| | | @query="queryList" |
| | | show-refresher-update-time |
| | | > |
| | | <template #top> |
| | | <wd-navbar |
| | | title="报修列表" |
| | | left-arrow |
| | | @click-left="goBack" |
| | | right-text="新增" |
| | | @click-right="handleClickRight" |
| | | custom-style="background: #4D80F0;" |
| | | safeAreaInsetTop |
| | | ></wd-navbar> |
| | | <wd-drop-menu v-if="!isSelectReq"> |
| | | <wd-drop-menu-item |
| | | v-model="reqTypeId" |
| | |
| | | value-key="dictValue" |
| | | :options="reqTypeList" |
| | | @change="handleReqType" |
| | | /> |
| | | <wd-drop-menu-item |
| | | v-model="filterDate" |
| | | :options="filterDateList" |
| | | @change="handleFilterDate" |
| | | /> |
| | | <wd-drop-menu-item |
| | | v-model="status" |
| | |
| | | import { useToast, useMessage } from 'wot-design-uni' |
| | | import { getRepairReqList, delRepairReq } from '@/service/repair' |
| | | import { DICT_REPAIR_REQ_STATUS, DICT_REPAIR_REQ_TYPE, getDictInfo } from '@/service/dict' |
| | | import dayjs from "dayjs"; |
| | | |
| | | const message = useMessage() |
| | | const toast = useToast() |
| | |
| | | |
| | | const isSelectReq = ref(false) |
| | | |
| | | const filterDate = ref<string>('2') |
| | | |
| | | const filterDateList = ref<Record<string, any>[]>([ |
| | | { label: '所有数据', value: '0' }, |
| | | { label: '当天数据', value: '1' }, |
| | | { label: '当月数据', value: '2' }, |
| | | ]) |
| | | |
| | | const reqTypeList = ref<any>([{ dictLabel: '所有类型', dictValue: -1 }]) |
| | | const statusList = ref<any>([{ dictLabel: '所有状态', dictValue: -1 }]) |
| | | function handleReqType({ value }) { |
| | |
| | | function handleReqStatu({ value }) { |
| | | reloadData() |
| | | } |
| | | function handleFilterDate({ value }) { |
| | | reloadData() |
| | | } |
| | | |
| | | |
| | | |
| | | const paging = ref(null) |
| | | const dataList = ref([]) |
| | | |
| | | const queryList = (pageNum?: number, pageSize?: number) => { |
| | | const parmams = { |
| | | const queryParams: any = { |
| | | pageNum, |
| | | pageSize, |
| | | reqType: reqTypeId.value, |
| | | status: status.value, |
| | | } |
| | | if (reqTypeId.value === -1) { |
| | | delete parmams.reqType |
| | | delete queryParams.reqType |
| | | } |
| | | if (status.value === -1) { |
| | | delete parmams.status |
| | | delete queryParams.status |
| | | } |
| | | |
| | | getRepairReqList(parmams) |
| | | if (filterDate.value === '1') { |
| | | // 获取当前日期 |
| | | const now = dayjs() |
| | | queryParams.params = { |
| | | beginReqTime: now.startOf('day').format('YYYY-MM-DD 00:00:00'), |
| | | endReqTime: now.endOf('day').format('YYYY-MM-DD 23:59:59'), |
| | | } |
| | | } else if (filterDate.value === '2') { |
| | | const now = dayjs() |
| | | queryParams.params = { |
| | | beginReqTime: now.startOf('month').format('YYYY-MM-DD 00:00:00'), |
| | | endReqTime: now.endOf('month').format('YYYY-MM-DD 23:59:59'), |
| | | } |
| | | } else { |
| | | delete queryParams.params |
| | | } |
| | | |
| | | getRepairReqList(queryParams) |
| | | .then((res: any) => { |
| | | paging.value.completeByTotal(res.rows, res.total) |
| | | }) |
| | |
| | | }) |
| | | } |
| | | |
| | | onNavigationBarButtonTap((e) => { |
| | | if (e.index === 0 && !isSelectReq.value) { |
| | | const goBack = () => { |
| | | uni.navigateBack() |
| | | } |
| | | function handleClickRight() { |
| | | // if (e.index === 0 && !isSelectReq.value) { |
| | | // uni.navigateTo({ |
| | | // url: `/pages/repair/repair-add`, |
| | | // }) |
| | | // } |
| | | |
| | | uni.navigateTo({ |
| | | url: `/pages/repair/repair-add`, |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | const eventChannel = ref<any>() |
| | | onMounted(() => { |
| | |
| | | { |
| | | layout: 'default', |
| | | needLogin: true, |
| | | style: { |
| | | navigationBarTitleText: '设备维修', |
| | | 'app-plus': { |
| | | titleNView: { |
| | | buttons: [ |
| | | { |
| | | text: '接单', |
| | | fontSize: '14px', |
| | | color: '#FFFFFF', |
| | | }, |
| | | { |
| | | text: '', |
| | | fontSize: '24px', |
| | | color: '#FFFFFF', |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | }, |
| | | style: { navigationBarTitleText: '设备维修', navigationStyle: 'custom' }, |
| | | } |
| | | </route> |
| | | <template> |
| | | <z-paging ref="paging" v-model="dataList" @query="queryList" show-refresher-update-time> |
| | | <template #top> |
| | | <wd-navbar |
| | | title="设备维修" |
| | | left-arrow |
| | | @click-left="goBack" |
| | | right-text="提交" |
| | | @click-right="handleClickRight" |
| | | custom-style="background: #4D80F0;" |
| | | safeAreaInsetTop |
| | | > |
| | | <template #right> |
| | | <text v-if="isOperatorOrRepair()" class="text-white">接单</text> |
| | | </template> |
| | | </wd-navbar> |
| | | <wd-drop-menu> |
| | | <wd-drop-menu-item |
| | | v-model="resTypeId" |
| | |
| | | value-key="dictValue" |
| | | :options="resTypeList" |
| | | @change="handleResType" |
| | | /> |
| | | <wd-drop-menu-item |
| | | v-model="filterDate" |
| | | :options="filterDateList" |
| | | @change="handleFilterDate" |
| | | /> |
| | | <wd-drop-menu-item |
| | | v-model="status" |
| | |
| | | import { isLeader, isOperatorOrRepair } from '@/utils/RoleUtils' |
| | | import { useUserStore } from '@/store' |
| | | import { formatDate } from '@/utils/DateUtils' |
| | | import dayjs from "dayjs"; |
| | | const userStore = useUserStore() |
| | | |
| | | const message = useMessage() |
| | |
| | | const status = ref<number>(-1) |
| | | |
| | | const isSelectRes = ref(false) |
| | | const filterDate = ref<string>('2') |
| | | |
| | | const filterDateList = ref<Record<string, any>[]>([ |
| | | { label: '所有数据', value: '0' }, |
| | | { label: '当天数据', value: '1' }, |
| | | { label: '当月数据', value: '2' }, |
| | | ]) |
| | | const resTypeList = ref<any>([{ dictLabel: '所有类型', dictValue: -1 }]) |
| | | const statusList = ref<any>([{ dictLabel: '所有状态', dictValue: -1 }]) |
| | | function handleResType({ value }) { |
| | |
| | | function handleResStatu({ value }) { |
| | | reloadData() |
| | | } |
| | | function handleFilterDate({ value }) { |
| | | reloadData() |
| | | } |
| | | |
| | | const paging = ref(null) |
| | | const dataList = ref([]) |
| | | |
| | | const queryList = (pageNum?: number, pageSize?: number) => { |
| | | const params: any = { |
| | | const queryParams: any = { |
| | | pageNum, |
| | | pageSize, |
| | | reqType: resTypeId.value, |
| | | status: status.value, |
| | | } |
| | | if (resTypeId.value === -1) { |
| | | delete params.reqType |
| | | delete queryParams.reqType |
| | | } |
| | | if (status.value === -1) { |
| | | delete params.status |
| | | delete queryParams.status |
| | | } |
| | | |
| | | if (filterDate.value === '1') { |
| | | // 获取当前日期 |
| | | const now = dayjs() |
| | | queryParams.params = { |
| | | beginReqTime: now.startOf('day').format('YYYY-MM-DD 00:00:00'), |
| | | endReqTime: now.endOf('day').format('YYYY-MM-DD 23:59:59'), |
| | | } |
| | | } else if (filterDate.value === '2') { |
| | | const now = dayjs() |
| | | queryParams.params = { |
| | | beginReqTime: now.startOf('month').format('YYYY-MM-DD 00:00:00'), |
| | | endReqTime: now.endOf('month').format('YYYY-MM-DD 23:59:59'), |
| | | } |
| | | } else { |
| | | delete queryParams.params |
| | | } |
| | | // 如果是从扫码页面过来,只能查询固定设备的数据 |
| | | if (option?.from === 'scan') { |
| | | params.assetNo = option.assetNo |
| | | queryParams.assetNo = option.assetNo |
| | | } |
| | | getRepairResList(params) |
| | | getRepairResList(queryParams) |
| | | .then((res: any) => { |
| | | paging.value.completeByTotal(res.rows, res.total) |
| | | }) |
| | |
| | | url: `/pages/repair/repair-fb?id=${item.id}`, |
| | | }) |
| | | } |
| | | |
| | | onNavigationBarButtonTap((e) => { |
| | | if (e.index === 0) { |
| | | const goBack = () => { |
| | | uni.navigateBack() |
| | | } |
| | | function handleClickRight() { |
| | | if (isLeader()) { |
| | | toast.info('请登录维修工账号接单') |
| | | } else if (isOperatorOrRepair()) { |
| | | handleSelectReq() |
| | | } |
| | | } |
| | | }) |
| | | |
| | | |
| | | /** |
| | | * 选择报修单 |
| | |
| | | import lombok.EqualsAndHashCode; |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serial; |
| | | |
| | |
| | | /** |
| | | * 计划时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date planTime; |
| | | |
| | | /** |
| | |
| | | import jakarta.validation.constraints.*; |
| | | import java.util.Date; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | /** |
| | | * 点检汇总业务对象 eims_inspect_st |
| | |
| | | /** |
| | | * 计划时间 |
| | | */ |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date planTime; |
| | | |
| | | /** |
| | |
| | | |
| | | 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; |
| | |
| | | * 计划时间 |
| | | */ |
| | | @ExcelProperty(value = "计划时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date planTime; |
| | | private String planTimeStr; |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.dromara.common.core.constant.DictConstants; |
| | | import org.dromara.common.core.utils.DateUtils; |
| | | import org.dromara.common.core.utils.MapstructUtils; |
| | | import org.dromara.common.core.utils.StringUtils; |
| | | import org.dromara.common.mybatis.core.page.TableDataInfo; |
| | |
| | | qw.like(StringUtils.isNotBlank(bo.getTitle()), "st.title", bo.getTitle()); |
| | | qw.like(StringUtils.isNotBlank(bo.getEquName()), "equ.equ_name", bo.getEquName()); |
| | | qw.like(StringUtils.isNotBlank(bo.getAssetNo()), "equ.asset_no", bo.getAssetNo()); |
| | | if(bo.getPlanTime()!=null&&bo.getViewMode() != null && bo.getViewMode().equals("Day")){ |
| | | qw.eq("DATE_FORMAT(st.plan_time, '%Y-%m-%d')", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD,bo.getPlanTime())); |
| | | }else if(bo.getPlanTime()!=null&&bo.getViewMode() != null && bo.getViewMode().equals("Month")){ |
| | | qw.eq("DATE_FORMAT(st.plan_time, '%Y-%m')", DateUtils.parseDateToStr(DateUtils.YYYY_MM,bo.getPlanTime())); |
| | | } |
| | | qw.eq( "st.type", bo.getType()); |
| | | qw.between(params.get("beginPlanTime") != null && params.get("endPlanTime") != null, |
| | | "st.plan_time", params.get("beginPlanTime"), params.get("endPlanTime")); |
| | |
| | | qw.eq(bo.getReqUser() != null, "res.req_user", bo.getReqUser()); |
| | | qw.eq(bo.getAssetNo() != null, "equ.asset_no", bo.getAssetNo()); |
| | | |
| | | qw.between(params.get("beginReqTime") != null && params.get("endReqTime") != null, |
| | | "req.req_time", params.get("beginReqTime"), params.get("endReqTime")); |
| | | |
| | | List<Long> resDeptIds = getAllDescendantIds(bo.getResDept()); |
| | | qw.in(bo.getResDept() != null, "res.res_dept", resDeptIds); |
| | | |