Commit 90593db1 by pangchong

feat: 机械延误

parent af969a4d
import { http } from 'mocp/utils/http'
export const getMeDataListApi = (data, config) => {
return http({
method: 'POST',
url: '/repaircontrol/getMeDataList',
data,
config
})
}
export const getRcOptionsApi = (data, config) => {
return http({
method: 'POST',
url: '/repaircontrol/getRcOptions',
data,
config
})
}
export const getMeDataApi = (data, config) => {
return http({
method: 'POST',
url: '/repaircontrol/getMeData',
data,
config
})
}
......@@ -91,7 +91,7 @@ const ps = defineProps({
default: ''
},
options: {
type: Array,
type: [Array, Object],
default: () => {
return []
}
......@@ -193,17 +193,29 @@ const getColumns = computed(() => {
throw new Error('请输入存在的dictkey值')
}
} else {
if (ps.options && Object.prototype.toString.call(ps.options[0]) == '[object Object]') {
return ps.options
} else {
return ps.options.map((item) => {
return {
[ps.labelField]: item,
[ps.valueField]: item
if (ps.options) {
if (Array.isArray(ps.options)) {
if (Object.prototype.toString.call(ps.options[0]) == '[object Object]') {
return ps.options
} else {
return ps.options.map((item) => {
return {
[ps.labelField]: item,
[ps.valueField]: item
}
})
}
})
} else {
return Object.values(ps.options).map((v, i) => {
return {
[ps.labelField]: v,
[ps.valueField]: i
}
})
}
}
}
return []
})
//监听设置labelValue的值
watch(
......
......@@ -9,3 +9,4 @@ export * from './mco'
export * from './fleet'
export * from './electronicBill'
export * from './abnormalEventManage'
export * from './mechanicalAbnormalEvents'
// 建议以文件名首字母作为前缀mae_
export const mae_isOpen = [
{ label: 'OPEN', value: 1 },
{ label: 'CLOSE', value: 0 }
]
export const mae_eventType = [
{ label: '机械事件', value: 0 },
{ label: '运行事件', value: 1 },
{ label: '其他事件', value: 2 }
]
export const mae_runEvent = [
{ label: '鸟击', value: 0 },
{ label: '机轮扎伤', value: 1 },
{ label: '雷击', value: 2 },
{ label: 'FOD', value: 3 },
{ label: '其他', value: 4 }
]
export const mae_joinDaily = [
{ label: '否', value: 5 },
{ label: '是', value: 6 }
]
import { getMeDataApi, getRcOptionsApi } from 'mocp/api/mechanicalAbnormalEvents'
import { defineStore } from 'pinia'
const useMechanicalAbnormalEventsStore = defineStore('mechanicalAbnormalEvents', {
state: () => {
return {
searchData: {
isOpen: 1,
ac: '',
acType: '',
acOwn: '',
eventType: 0,
runEvent: null,
happenStn: '',
delayNature: '',
delayProperty: '',
startTime: null,
stopTime: null,
flightNo: '',
msg: ''
},
selectList: {
assurePhase: [],
commentConclusion: [],
delayNature: [],
delayProperty: [],
eventType: [],
flightImpact: [],
liabilityNature: [],
majorClass: [],
occurArea: [],
runPhase: [],
stopReason: []
},
workbenchId: '',
details: undefined
}
},
getters: {},
actions: {
async getRcOptions() {
const res = await getRcOptionsApi({})
if (res.code == 200) {
this.selectList.assurePhase = res.data.assurePhase || []
this.selectList.commentConclusion = res.data.commentConclusion || []
this.selectList.delayNature = res.data.delayNature || []
this.selectList.delayProperty = res.data.delayProperty || []
this.selectList.eventType = res.data.eventType || []
this.selectList.flightImpact = res.data.flightImpact || []
this.selectList.liabilityNature = res.data.liabilityNature || []
this.selectList.majorClass = res.data.majorClass || []
this.selectList.occurArea = res.data.occurArea || []
this.selectList.runPhase = res.data.runPhase || []
this.selectList.stopReason = res.data.stopReason || []
}
},
async getMeData() {
const res = await getMeDataApi({ workbenchId: this.workbenchId }, { loading: true })
if (res.code == 200) {
this.details = res.data
} else {
uni.$mocpMessage.error(res.message)
}
},
resetForm() {
this.searchData = {
isOpen: 1,
ac: '',
acType: '',
acOwn: '',
eventType: 0,
runEvent: null,
happenStn: '',
delayNature: '',
delayProperty: '',
startTime: null,
stopTime: null,
flightNo: '',
msg: ''
}
},
setState(...args) {
this.$patch({ [args[0]]: args[1] })
}
},
// 配置持久化
persist: false
})
export default useMechanicalAbnormalEventsStore
......@@ -14,7 +14,7 @@ const menuList = ref([
{ id: 'yxdc', name: '运行调查', icon: 'yxdc', group: '维修控制', default: false, count: 0 },
{ id: 'yxjc', name: '运行决策', icon: 'yxjc', group: '维修控制', default: false, count: 0, url: '/panel/move-decision/list' },
{ id: 'bzgz', name: '布置工作', icon: 'bzgz', group: '维修控制', default: false, count: 0, url: '/panel/assign-work/search' },
{ id: 'jxyw', name: '机械延误', icon: 'jxyw', group: '维修控制', default: false, count: 0 },
{ id: 'jxyw', name: '机械延误', icon: 'jxyw', group: '维修控制', default: false, count: 0, url: '/panel/mechanicalAbnormalEvents/list' },
{ id: 'ffh', name: '防风害', icon: 'ffh', group: '维修控制', default: false, count: 0 },
// 技术支援
{ id: 'jdzt', name: '机队状态', icon: 'jdzt', group: '技术支援', default: true, count: 0, url: '/panel/fleet/search' },
......
......@@ -59,7 +59,7 @@ export const previewFile = (fileUrl) => {
uni.openDocument({
filePath: filePath,
showMenu: true,
success: function (res) {
success: function () {
uni.hideLoading()
console.log('打开文件成功')
},
......
......@@ -554,6 +554,24 @@
"style": {
"navigationBarTitleText": "答题"
}
},
{
"path": "pages/modules/mocp/panel/mechanicalAbnormalEvents/list",
"style": {
"navigationBarTitleText": "机械延误"
}
},
{
"path": "pages/modules/mocp/panel/mechanicalAbnormalEvents/search",
"style": {
"navigationBarTitleText": "筛选"
}
},
{
"path": "pages/modules/mocp/panel/mechanicalAbnormalEvents/details",
"style": {
"navigationBarTitleText": "机械延误详情"
}
}
],
"globalStyle": {
......
......@@ -533,6 +533,17 @@ watch([() => formData.deicingQuantityTotal, () => formData.weatherToday, () => f
watch([() => formData.antiicingQuantityTotal, () => formData.weatherToday, () => formData.modelType], () => {
antiicingFlag.value = false
})
// 海航集团内部的宽体机——A330-,787-,747-,777-,A350-,其余为窄体,集团外部机型-机型类别无对应数据需要手动选择
const prefixes = ['A330-', '787-', '747-', '777-', 'A350-']
watchEffect(() => {
if (formData.model) {
if (prefixes.some((prefix) => formData.model.startsWith(prefix))) {
formData.modelType = '1'
} else {
formData.modelType = '2'
}
}
})
</script>
<style lang="scss" scoped>
:deep(.u-fade-zoom-enter-active) {
......
......@@ -141,6 +141,7 @@ export const submitDeicing = () => {
if (formData.deicingQuantityTotal > limit[1]) {
showDeicing.value = true
} else {
deicingFlag.value = true
showToast('提交成功')
}
}
......@@ -163,6 +164,7 @@ export const submitAntiicing = () => {
if (formData.antiicingQuantityTotal > limit[1]) {
showAntiicing.value = true
} else {
antiicingFlag.value = true
showToast('提交成功')
}
}
......
<template>
<global-page padding="0 24rpx" title="收费单" auto :localData="list">
<template #default="{ item }">
<global-card :title="item.title" titleSuffix="查看详情" :rightWidth="160" @handleTitleClick="navigateTo(item.url)">
<global-card :title="item.title" titleSuffix="查看详情" :rightWidth="180" @handleTitleClick="navigateTo(item.url)">
描述:{{ item.desc }}
</global-card>
</template>
......
<template>
<global-page :padding="24" title="航站不正常事件详情">
<template v-if="details">
<view class="mocp-cell">
<up-cell-group>
<up-cell title="事件分类" :value="useGetDictByValue('mae_eventType', details.eventType) || '-'" />
<up-cell title="运行事件" :value="useGetDictByValue('mae_runEvent', details.runEvent) || '-'" />
<up-cell title="加入日报" :value="useGetDictByValue('mae_joinDaily', details.joinDaily)" />
<up-cell title="发生航站" :value="baseStore.getTerminalObject[details.happenStn] || '-'" />
<up-cell title="发生区域" :value="mechanicalAbnormalEventsStore.selectList.occurArea[details.occurArea] || '-'" />
<up-cell title="生成日报日期" :value="timeStampFormat(details.dailyOpenDate, { format: 'YYYY/MM/DD' }) || '-'" />
<up-cell title="关闭日报日期" :value="timeStampFormat(details.dailyCloseDate, { format: 'YYYY/MM/DD' }) || '-'" />
<up-cell title="始发航站" :value="baseStore.getTerminalObject[details.startStn] || '-'" />
<view class="mocp-title">进出港</view>
<view class="mocp-subTitle">进港</view>
<up-cell title="保障阶段" :value="mechanicalAbnormalEventsStore.selectList.assurePhase[details.assurePhaseIn] || '-'" />
<up-cell title="航班日期" :value="timeStampFormat(details.flightDateIn, { format: 'YYYY/MM/DD' }) || '-'" />
<up-cell title="进港航班号" :value="details.flightNoIn || '-'" />
<up-cell title="起飞航站" :value="baseStore.getTerminalObject[details.depStnIn] || '-'" />
<up-cell title="落地航站" :value="baseStore.getTerminalObject[details.arrStnIn] || '-'" />
<view class="mocp-subTitle">出港</view>
<up-cell title="保障阶段" :value="mechanicalAbnormalEventsStore.selectList.assurePhase[details.assurePhaseOut] || '-'" />
<up-cell title="航班日期" :value="timeStampFormat(details.flightDateOut, { format: 'YYYY/MM/DD' }) || '-'" />
<up-cell title="出港航班号" :value="details.flightNoOut || '-'" />
<up-cell title="起飞航站" :value="baseStore.getTerminalObject[details.depStnOut] || '-'" />
<up-cell title="落地航站" :value="baseStore.getTerminalObject[details.arrStnOut] || '-'" />
<up-cell title="延误定性" :value="mechanicalAbnormalEventsStore.selectList.delayNature[details.delayNature] || '-'" />
<up-cell title="起飞延误分钟" :value="details.dur1 || '-'" />
<up-cell title="延误属性" :value="mechanicalAbnormalEventsStore.selectList.delayProperty[details.delayProperty] || '-'" />
<up-cell title="顺延班次" :value="details.postponedShift > 0 ? details.postponedShift : '-'" />
<up-cell title="取消班次" :value="details.cancelNo > 0 ? details.cancelNo : '-'" />
</up-cell-group>
</view>
<view class="mocp-cell">
<up-cell-group>
<template v-if="details.occur == 0">
<up-cell title="发生阶段" value="进港航班" />
<up-cell title="运行阶段" :value="mechanicalAbnormalEventsStore.selectList.runPhase[details.runPhaseIn]" />
</template>
<template v-else-if="details.occur == 1">
<up-cell title="发生阶段" value="出港航班" />
<up-cell title="运行阶段" :value="mechanicalAbnormalEventsStore.selectList.runPhase[details.runPhaseOut]" />
</template>
<template v-else>
<up-cell title="发生阶段" value="-" />
<up-cell title="运行阶段" value="-" />
</template>
<up-cell title="内容" :label="details.occurMsg || '-'" />
<up-cell title="故障描述" :label="details.faultMsg || '-'" />
<up-cell title="处理措施" :label="details.handleMsg || '-'" />
<up-cell title="处理措施文件">
<template #label>
<view style="margin-top: 16rpx">
<global-upload :fileList="details.handleFile" :showUpload="false"></global-upload>
</view>
</template>
</up-cell>
</up-cell-group>
</view>
<view class="mocp-cell">
<up-cell-group>
<template v-if="details.fly == 0">
<up-cell title="航班运行影响" value="进港航班" />
<up-cell title="航班影响" :value="mechanicalAbnormalEventsStore.selectList.flightImpact[details.flightImpactIn]" />
</template>
<template v-else-if="details.fly == 1">
<up-cell title="航班运行影响" value="出港航班" />
<up-cell title="航班影响" :value="mechanicalAbnormalEventsStore.selectList.flightImpact[details.flightImpactOut]" />
</template>
<template v-else>
<up-cell title="航班运行影响" value="-" />
<up-cell title="航班影响" value="-" />
</template>
<up-cell title="内容" :label="details.flyMsg || '-'" />
<up-cell title="其他运行影响" :label="details.otherMsg || '-'" />
</up-cell-group>
</view>
<view class="mocp-cell">
<up-cell-group>
<up-cell title="填报人" :value="details.openUsernameL || '-'" />
<up-cell title="填报时间" :value="timeStampFormat(details.openTimeL) || '-'" />
<up-cell title="关闭人" :value="details.closeUsername || '-'" />
<up-cell title="关闭时间" :value="timeStampFormat(details.closeTime) || '-'" />
</up-cell-group>
</view>
</template>
</global-page>
</template>
<script setup>
import { storeToRefs } from 'pinia'
import useBaseStore from 'mocp/store/base'
import { timeStampFormat } from 'mocp/utils/tool'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import useMechanicalAbnormalEventsStore from 'mocp/store/mechanicalAbnormalEvents'
import { onLoad } from '@dcloudio/uni-app'
const query = defineProps(['id'])
const baseStore = useBaseStore()
const mechanicalAbnormalEventsStore = useMechanicalAbnormalEventsStore()
onLoad(() => {
mechanicalAbnormalEventsStore.setState('workbenchId', query.workbenchId)
mechanicalAbnormalEventsStore.getMeData()
})
const { details } = storeToRefs(mechanicalAbnormalEventsStore)
</script>
<style lang="scss" scoped>
.mocp-cell {
background: #fff;
margin-bottom: 16rpx;
}
.mocp-title {
padding: 24rpx 32rpx 24rpx 32rpx;
background-color: #f7f8fa;
}
.mocp-subTitle {
padding: 24rpx 32rpx 0 32rpx;
font-weight: bold;
}
</style>
<template>
<global-page
ref="paging"
:api="getMeDataListApi"
:padding="24"
:params="searchData"
auto
isDataList
loadingMoreEnabled
navRightIcon="saixuan-01"
navRightType="icon"
refresherEnabled
showNavRight
title="机械延误"
@handleRightClick="handleRightClick"
>
<template #default="{ item }">
<view class="item" @tap="goDetails(item)">
<view class="item-title">
<view class="left">
<custom-state :value="useGetDictByValue('mae_isOpen', item.isOpen)"></custom-state>
</view>
<view class="right">
<text class="txt u-line-1" v-if="item.ac">{{ item.ac }}</text>
<text class="txt u-line-1" v-if="item.acType">{{ item.acType }}</text>
<text class="txt u-line-1" v-if="item.acOwn">{{ item.acOwn }}</text>
<text class="txt u-line-1" v-if="item.acTerminal">{{ item.acTerminal }}</text>
</view>
</view>
<view class="item-content">
<view style="margin-bottom: 20rpx">{{ item.eventId }}</view>
<view class="u-line-3">发生阶段:{{ item.occurMsg || '无' }}</view>
<view class="u-line-3">故障描述:{{ item.faultMsg || '无' }}</view>
<view class="u-line-3">处理措施:{{ item.handleMsg || '无' }}</view>
<view class="u-line-3">运行影响:{{ item.flyMsg || '无' }}</view>
<view class="u-line-3">其他运行影响:{{ item.otherMsg || '无' }}</view>
</view>
</view>
</template>
</global-page>
</template>
<script setup>
import { storeToRefs } from 'pinia'
import { getMeDataListApi } from 'mocp/api/mechanicalAbnormalEvents'
import useMechanicalAbnormalEventsStore from 'mocp/store/mechanicalAbnormalEvents'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import { onLoad, onUnload } from '@dcloudio/uni-app'
import { ref } from 'vue'
//跳转
const goDetails = (data) => {
uni.$mocpJump.navigateTo('/panel/mechanicalAbnormalEvents/details', {
workbenchId: data.workbenchId
})
}
//加载下拉框数据
const mechanicalAbnormalEventsStore = useMechanicalAbnormalEventsStore()
const { searchData } = storeToRefs(mechanicalAbnormalEventsStore)
onLoad(() => {
mechanicalAbnormalEventsStore.getRcOptions()
})
//筛选
const handleRightClick = () => {
uni.$mocpJump.navigateTo('/panel/mechanicalAbnormalEvents/search')
}
const paging = ref()
uni.$on('mechanicalAbnormalEventsReload', () => {
paging.value?.reload()
})
onUnload(() => {
uni.$off('mechanicalAbnormalEventsReload')
})
</script>
<style lang="scss" scoped>
@import 'mocpStatic/css/list.scss';
</style>
<template>
<global-page title="筛选">
<view class="search-form">
<up-form labelPosition="left" labelWidth="auto">
<up-form-item label="状态" prop="isOpen" :borderBottom="true">
<global-picker v-model="formData.isOpen" pickAlign="right" clearable dictkey="mae_isOpen"></global-picker>
</up-form-item>
<up-form-item label="机号" prop="ac" :borderBottom="true">
<global-picker pickAlign="right" v-model="formData.ac" :options="deviceNumList" clearable filter></global-picker>
</up-form-item>
<up-form-item label="机型" prop="acType" :borderBottom="true">
<global-picker v-model="formData.acType" pickAlign="right" :options="baseStore.getTypeSelect" clearable filter></global-picker>
</up-form-item>
<up-form-item label="航司" prop="acOwn" :borderBottom="true">
<global-picker v-model="formData.acOwn" pickAlign="right" :options="baseStore.getAirlineSelect" clearable filter></global-picker>
</up-form-item>
<up-form-item label="事件分类" prop="eventType" :borderBottom="true">
<global-picker v-model="formData.eventType" pickAlign="right" dictkey="mae_eventType" clearable></global-picker>
</up-form-item>
<up-form-item label="运行事件" prop="runEvent" :borderBottom="true">
<global-picker v-model="formData.runEvent" pickAlign="right" dictkey="mae_runEvent" clearable></global-picker>
</up-form-item>
<up-form-item label="发生航站" prop="happenStn" :borderBottom="true">
<global-picker
pickAlign="right"
v-model="formData.happenStn"
clearable
:options="baseStore.getTerminalSelect"
filter
></global-picker>
</up-form-item>
<up-form-item label="延误定性" prop="delayNature" :borderBottom="true">
<global-picker
pickAlign="right"
v-model="formData.delayNature"
clearable
:options="mechanicalAbnormalEventsStore.selectList.delayNature"
></global-picker>
</up-form-item>
<up-form-item label="延误属性" prop="delayProperty" :borderBottom="true">
<global-picker
pickAlign="right"
v-model="formData.delayProperty"
clearable
:options="mechanicalAbnormalEventsStore.selectList.delayProperty"
></global-picker>
</up-form-item>
<up-form-item label="日报生成日期" :borderBottom="true">
<global-calendar
pickAlign="right"
v-model:startTime="formData.startTime"
v-model:endTime="formData.stopTime"
clearable
></global-calendar>
</up-form-item>
<up-form-item label="航班号" prop="flightNo" :borderBottom="true">
<global-picker pickAlign="right" v-model="formData.flightNo" clearable :options="flightNumList" filter></global-picker>
</up-form-item>
<up-form-item label="事件描述" prop="msg" :borderBottom="true">
<up-input v-model="formData.msg" inputAlign="right" border="none" placeholder="请输入" clearable></up-input>
</up-form-item>
</up-form>
</view>
<template #bottom>
<view class="footer-btn">
<up-row gutter="10">
<up-col span="6">
<global-button type="primary" plain size="large" :radius="5" @tap="handleReset">重置</global-button>
</up-col>
<up-col span="6"><global-button type="primary" size="large" :radius="5" @tap="handleConfirm">确定</global-button></up-col>
</up-row>
</view>
</template>
</global-page>
</template>
<script setup>
import useBaseStore from 'mocp/store/base'
import { storeToRefs } from 'pinia'
import { cloneDeep } from 'lodash'
import { ref } from 'vue'
import useMechanicalAbnormalEventsStore from 'mocp/store/mechanicalAbnormalEvents'
//获取下拉框选项
const baseStore = useBaseStore()
const {
selectList: { deviceNumList, flightNumList }
} = useBaseStore()
const mechanicalAbnormalEventsStore = useMechanicalAbnormalEventsStore()
//获取查询表单数据
const { searchData } = storeToRefs(mechanicalAbnormalEventsStore)
const formData = ref(cloneDeep(searchData.value))
const handleReset = () => {
mechanicalAbnormalEventsStore.resetForm()
uni.$mocpJump.navigateBack()
uni.$emit('mechanicalAbnormalEventsReload')
}
const handleConfirm = () => {
mechanicalAbnormalEventsStore.setState('searchData', formData.value)
uni.$mocpJump.navigateBack()
uni.$emit('mechanicalAbnormalEventsReload')
}
</script>
<style lang="scss" scoped>
.search-form {
padding: 24rpx 24rpx 0 24rpx;
background: #fff;
}
.footer-btn {
padding: 24rpx 32rpx;
background-color: #fff;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment