Commit e960efb7 by liujinbo

信息通报隐藏状态修改

parent ab7e061d
...@@ -8,3 +8,11 @@ export const getMocinfoListApi = (data, config) => { ...@@ -8,3 +8,11 @@ export const getMocinfoListApi = (data, config) => {
config config
}) })
} }
export const updateOpenAndCloseApi = (data, config) => {
return http({
method: 'POST',
url: '/moc/updateOpenAndClose',
data,
config
})
}
...@@ -41,6 +41,17 @@ const useInforDisclosureStore = defineStore('inforDisclosure', { ...@@ -41,6 +41,17 @@ const useInforDisclosureStore = defineStore('inforDisclosure', {
} }
}, },
// 配置持久化 // 配置持久化
persist: false // persist: false
persist: {
// 调整为兼容多端的API
storage: {
setItem(key, value) {
uni.setStorageSync(key, value)
},
getItem(key) {
return uni.getStorageSync(key)
}
}
}
}) })
export default useInforDisclosureStore export default useInforDisclosureStore
...@@ -2,7 +2,7 @@ import { ref, computed } from 'vue' ...@@ -2,7 +2,7 @@ import { ref, computed } from 'vue'
const dayForMilliseconds = 24 * 3600 * 1000 const dayForMilliseconds = 24 * 3600 * 1000
export function decideTimeRange(inputNum: number) { export function decideTimeRange(inputNum) {
const d = new Date(inputNum) const d = new Date(inputNum)
d.setHours(5, 0, 0, 0) d.setHours(5, 0, 0, 0)
return { return {
......
import useUserStore from 'mocp/store/user' import useUserStore from 'mocp/store/user'
// const baseURL = 'https://hna-platform.anyremote.cn' // const baseURL = 'https://hna-platform.anyremote.cn'//测试
const baseURL = 'https://moc.hnatechnic.com/api' const baseURL = 'https://moc.hnatechnic.com/api'//生产
class ServiceLoading { class ServiceLoading {
open(loading) { open(loading) {
...@@ -16,12 +16,14 @@ class ServiceLoading { ...@@ -16,12 +16,14 @@ class ServiceLoading {
}) })
} }
} }
close(loading) { close(loading) {
if (loading || loading === '') { if (loading || loading === '') {
uni.hideLoading() uni.hideLoading()
} }
} }
} }
const serviceLoading = new ServiceLoading() const serviceLoading = new ServiceLoading()
//请求拦截器 //请求拦截器
export const httpInterceptor = (options) => { export const httpInterceptor = (options) => {
...@@ -82,7 +84,7 @@ export const httpInterceptor = (options) => { ...@@ -82,7 +84,7 @@ export const httpInterceptor = (options) => {
} }
// 添加 token 请求头标识 // 添加 token 请求头标识
if (userStore.token) { if (userStore.token) {
options.header.Authorization = `Bearer ${userStore.token}` options.header.Authorization = `Bearer ${ userStore.token }`
} }
console.log('接口请求信息:', options) console.log('接口请求信息:', options)
return options return options
......
...@@ -40,7 +40,7 @@ export function beforeJumpSingleFlightHandleFunc(ac, identifier, inBoundMode, ai ...@@ -40,7 +40,7 @@ export function beforeJumpSingleFlightHandleFunc(ac, identifier, inBoundMode, ai
currentAirlineCode.value = airlineCode currentAirlineCode.value = airlineCode
} }
export function currentSelectedIndexInAllRelatedFlightsChanged(v) { /*export function currentSelectedIndexInAllRelatedFlightsChanged(v) {
disableUpdateInTimeForTasks() disableUpdateInTimeForTasks()
currentSelectedIndexInAllRelatedFlights.value = v currentSelectedIndexInAllRelatedFlights.value = v
currentFlightDataPassAlong.value = currentAllRelatedFlights.value[v] currentFlightDataPassAlong.value = currentAllRelatedFlights.value[v]
...@@ -49,6 +49,6 @@ export function currentSelectedIndexInAllRelatedFlightsChanged(v) { ...@@ -49,6 +49,6 @@ export function currentSelectedIndexInAllRelatedFlightsChanged(v) {
} else if (v === initialIndexConfig + 1) { } else if (v === initialIndexConfig + 1) {
currentInBoundModeForFlightSinglePage.value = initialType === allInBoundMode.In ? allInBoundMode.Out : allInBoundMode.In currentInBoundModeForFlightSinglePage.value = initialType === allInBoundMode.In ? allInBoundMode.Out : allInBoundMode.In
} }
} }*/
<template>
<global-popup
v-model="showPopup"
mode="bottom"
:width="580"
background="#F7F8FA"
:round="32"
>
<view class="list">
<view class="item" @tap="handleClick">{{ details.failureState == 0 ? '作废' : 'open' }}</view>
<view class="item" @tap="close">取消</view>
</view>
</global-popup>
</template>
<script setup>
import { ref } from 'vue'
import { storeToRefs } from 'pinia'
import { updateOpenAndCloseApi } from 'mocp/api/inforDisclosure'
import useInforDisclosureStore from 'mocp/store/inforDisclosure'
import useUserStore from 'mocp/store/user'
const inforDisclosure = useInforDisclosureStore()
const {details} = storeToRefs(inforDisclosure)
const userStore = useUserStore()
const showPopup = ref(false)
const open = () => {
showPopup.value = true
}
const close = () => {
showPopup.value = false
}
const handleClick = async () => {
console.log(details.value)
const params = {
id: details.value.id,
state: details.value.failureState == 0 ? 1 : 0,//0开户 1作废
userId: userStore.userInfo.id,
username: userStore.userInfo.nickname
}
console.log(params)
const res = await updateOpenAndCloseApi(params, {loading: true})
console.log(res)
if (res.code == '200') {
const toast = details.value.failureState == 0 ? '已作废' : '已开启'
uni.$mocpMessage.success(toast)
details.value.failureState = details.value.failureState == 0 ? 1 : 0
showPopup.value = false
uni.$emit('inforDisclosureReload')
} else {
uni.$mocpMessage.error('变更失败!')
}
}
defineExpose({
open,
close
})
</script>
<style lang="scss" scoped>
.list {
padding: 18rpx 32rpx;
.item {
color: $mocp-text-4;
font-size: 30rpx;
background: #fff;
margin-bottom: 24rpx;
padding: 16rpx 24rpx;
text-align: center;
}
}
</style>
...@@ -2,5 +2,43 @@ ...@@ -2,5 +2,43 @@
.txt { .txt {
font-size: 10px; font-size: 10px;
} }
}
.inforDis {
display: flex;
justify-content: space-between;
font-size: 28rpx;
color: $mocp-text-4;
margin-bottom: 20rpx;
}
.inforDisFooter {
color: $mocp-text-4;
}
.mocp-cell {
background-color: #fff;
margin-bottom: 100rpx;
.detailFaultDes {
font-size: 15px;
padding: 24rpx 26rpx;
border-bottom: 1px solid rgb(214, 215, 217, 0.5);
.content {
margin-top: 10rpx;
color: $mocp-text-3;
}
}
}
.footer-btn {
padding: 24rpx 32rpx;
background-color: #fff;
.detailsFooterBtn {
display: flex;
align-items: center;
justify-content: center;
}
} }
<template> <template>
<global-page :padding="24" title="机队状态网详情"> <global-page :padding="24" title="信息通报详情">
<template v-if="details"> <view class="mocp-cell">
<view class="details fleetDetails"> <up-cell-group v-if="details">
<view class="details-header"> <up-cell title="机号" :value="details.machineNumber || '-'" />
<view class="details-header-top"> <up-cell title="航站" :value="details.termin || '-'" />
<view class="left"> <up-cell title="机型" :value="details.planeModel || '-'" />
<custom-state <up-cell title="航司" :value="details.aviation || '-'" />
:value="useGetDictByValue('wa_state', details.state)" <up-cell title="保障阶段" :value="details.tags[1]?.text || '-'" />
:size="32" /> <up-cell title="运行阶段" :value="details.tags[2]?.text || '-'" />
<up-cell title="故障报告人" :value="details.reporterValue || '-'" />
<view class="detailFaultDes">
<view class="title">故障描述</view>
<view class="content">{{ details.faultDescription }}</view>
</view> </view>
<view class="right"> <up-cell title="专业类别" :value="details.professionalValue || '-'" />
<global-tag :type="useGetDictByValue('wa_isSuccessType', details.isSuccess)"> <up-cell title="放行状态" :value="details.tags[3]?.text || '-'" />
{{ useGetDictByValue('wa_isSuccess', details.isSuccess) }} </up-cell-group>
</global-tag>
</view> </view>
</view>
<view class="details-header-bottom">
<view class="left">
<global-icon class="left-icon" icon="Vector" size="24" color="#DD4012"></global-icon>
<view class="txt">
{{ details.aviation }} {{ details.machineNumber }} {{ details.model }}
</view>
</view>
</view>
</view>
<view class="details-body fleetATA">
<view class="details-body-content ataCont">
<text>ATA章节:{{ details.ata }}</text>
<view class="fleetDescribe">故障描述:</view>
<view class="describeCont">{{ details.faultDescribe || '无' }}</view>
<template #bottom v-if="false">
<view class="footer-btn">
<up-row gutter="10">
<up-col span="6">
<global-button
type="primary"
plain
size="large"
:radius="5"
@tap="handleRightClick"
>
<view class="detailsFooterBtn">
<text>状态 ({{ details.status.toUpperCase() }}</text>
<up-icon name="arrow-up" size="16" :color="$mocp-primary-7" />
</view> </view>
</view>
<view class="details-footer">
<view class="fleetDescribe">处理措施:</view> </global-button>
<view class="describeCont">{{ details.handle || '无' }}</view> </up-col>
<view class="footerData occurrenceData"> <up-col span="6">
发生日期:{{ timeStampFormat(details.sendingTime, {format: 'YYYY-MM-DD'}) }} <global-button
</view> type="primary"
<view class="footerData occurrenceData"> size="large"
填报时间:{{ timeStampFormat(details.creationTime, {format: 'YYYY-MM-DD'}) }} :radius="5"
</view> >
</view> 追加
</global-button>
</up-col>
</up-row>
</view> </view>
</template> </template>
</global-page> </global-page>
<!--作废-->
<StatusPopup ref="statusPopupRef" />
</template> </template>
<script setup> <script setup>
import useFleetStore from 'mocp/store/fleet' import useInforDisclosureStore from 'mocp/store/inforDisclosure'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import useUserStore from 'mocp/store/user' import { formData } from '../support-application/constants/add.compositions'
import { timeStampFormat } from 'mocp/utils/tool' import StatusPopup from './components/status-popup.vue'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import { ref } from 'vue' import { ref } from 'vue'
import { getFleetListApi } from 'mocp/api/fleet'
import { WorkTaskIsSuccessApi } from 'mocp/api/work-assignment'
import Day from 'mocp/utils/dayjs'
const inforDisclosure = useInforDisclosureStore()
const {details} = storeToRefs(inforDisclosure)
const statusPopupRef = ref()
const handleRightClick = () => {
statusPopupRef.value?.open()
}
const fleetStore = useFleetStore() console.log(details.value)
const {details} = storeToRefs(fleetStore)
console.log(details, details.value.creationTime, timeStampFormat('1721810489517', {format: 'YYYY-MM-DD'}))
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../work-assignment/constants/details.scss'; @import '../work-assignment/constants/details.scss';
@import './constants/inforDisclosure.scss'; @import './constants/inforDisclosure.scss';
</style> </style>
...@@ -7,14 +7,16 @@ ...@@ -7,14 +7,16 @@
auto auto
ref="paging" ref="paging"
:params="searchData" :params="searchData"
@handleRightClick="handleRightClick"
:api="getMocinfoListApi" :api="getMocinfoListApi"
:padding="24" :padding="24"
localPaging :transformData="transformData"
:localPagingCB="localPagingCB"
:tabList="tabList" :tabList="tabList"
tabValueField="state" tabValueField="state"
tabsWidth="50%" tabsWidth="50%"
showNavRight
navRightType="icon"
navRightIcon="saixuan-01"
@handleRightClick="handleRightClick"
> >
<template #="{ dataList }"> <template #="{ dataList }">
<view <view
...@@ -25,7 +27,7 @@ ...@@ -25,7 +27,7 @@
> >
<view class="item-title"> <view class="item-title">
<view class="left"> <view class="left">
<custom-state :value="item.status.toUpperCase()" /> <custom-state :value="item.status?.toUpperCase()" />
</view> </view>
<view class="right inforDisTags"> <view class="right inforDisTags">
<global-tag <global-tag
...@@ -34,16 +36,28 @@ ...@@ -34,16 +36,28 @@
:type="tagItem.type" class="txt"> :type="tagItem.type" class="txt">
{{ tagItem.text }} {{ tagItem.text }}
</global-tag> </global-tag>
<!--<global-tag type="success" class="txt">
{{ getParamNameByValue('MajorCategory', item.majorCategory) }}
</global-tag>
<global-tag type="info" class="txt">
{{ getParamNameByValue('McoCurrentState', item.state) }}
</global-tag>-->
</view> </view>
</view> </view>
<view class="item-content u-line-3 fleetItemCont"> <view class="item-content u-line-3">
<global-icon icon="calendar"></global-icon> <view class="inforDis">
<text v-if="item.machineNumber">机号:{{ item.machineNumber }}</text>
<text v-if="item.ATA">ATA:{{ item.ata }}</text>
</view>
<text>{{ item.faultDescription || '无' }}</text>
</view>
<view class="item-footer inforDisFooter">
<view class="label">
<global-icon icon="calendar" />
<text class="txt">
{{ item.time }}
</text>
</view>
<view class="label right">
<global-icon icon="idcard" />
<text class="txt">
值班人员:{{ item.filledBy }}
</text>
</view>
</view> </view>
</view> </view>
</template> </template>
...@@ -53,18 +67,16 @@ ...@@ -53,18 +67,16 @@
<script setup> <script setup>
import { ref } from 'vue' import { ref } from 'vue'
import { timeStampFormat } from 'mocp/utils/tool'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import useInforDisclosureStore from 'mocp/store/inforDisclosure' import useInforDisclosureStore from 'mocp/store/inforDisclosure'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { onUnload } from '@dcloudio/uni-app' import { onUnload } from '@dcloudio/uni-app'
import { getMocinfoListApi } from 'mocp/api/inforDisclosure' import { getMocinfoListApi } from 'mocp/api/inforDisclosure'
import { getParamNameByValue, getParamsByType } from 'mocp/hooks/use-params/useParams' import { getParamsByType } from 'mocp/hooks/use-params/useParams'
//跳转 //跳转
const inforDisclosure = useInforDisclosureStore() const inforDisclosureStore = useInforDisclosureStore()
const {searchData} = storeToRefs(inforDisclosure) const {searchData} = storeToRefs(inforDisclosureStore)
const tabList = [ const tabList = [
{ {
...@@ -78,16 +90,20 @@ const tabList = [ ...@@ -78,16 +90,20 @@ const tabList = [
] ]
const goDetails = (data) => { const goDetails = (data) => {
console.log(data)
uni.$mocpJump.navigateTo('/panel/inforDisclosure/details', {id: data.id}).then(() => { uni.$mocpJump.navigateTo('/panel/inforDisclosure/details', {id: data.id}).then(() => {
inforDisclosure.setState('details', data) inforDisclosureStore.setState('details', data)
}) })
} }
const localPagingCB = (data) => { const transformData = (data) => {
const RetentionBasisList = getParamsByType('RetentionBasis') const GuaranteeStageList = getParamsByType('GuaranteeStage')
const OperationPhaseList = getParamsByType('OperationPhase') const OperationPhaseList = getParamsByType('OperationPhase')
const ReleaseStatuList = getParamsByType('ReleaseStatu') const ReleaseStatuList = getParamsByType('ReleaseStatu')
data.list = data.list.reduce((q, w) => { const FaultReportingList = getParamsByType('FaultReporting')
const MajorCategoryList = getParamsByType('MajorCategory')
data = data.reduce((q, w) => {
q.push(w) q.push(w)
if (Array.isArray(w.cascade) && w.cascade.length > 0) { if (Array.isArray(w.cascade) && w.cascade.length > 0) {
q.push(...w.cascade) q.push(...w.cascade)
...@@ -95,11 +111,10 @@ const localPagingCB = (data) => { ...@@ -95,11 +111,10 @@ const localPagingCB = (data) => {
return q return q
}, []) }, [])
const mappedData = data.list.map(item => { const mappedData = data.map(item => {
return { return {
...item,
time: item.creationTime.replace(/-/g, '/').replace(/:\d+?$/, ''), time: item.creationTime.replace(/-/g, '/').replace(/:\d+?$/, ''),
operator: item.filledBy,
info: item.faultDescription,
status: item.failureState.toString() === '0' ? status: item.failureState.toString() === '0' ?
'open' : item.failureState.toString() === '1' ? 'open' : item.failureState.toString() === '1' ?
'close' : '作废', 'close' : '作废',
...@@ -109,7 +124,7 @@ const localPagingCB = (data) => { ...@@ -109,7 +124,7 @@ const localPagingCB = (data) => {
type: item.pid === '0' ? 'primary' : 'warning' type: item.pid === '0' ? 'primary' : 'warning'
}, },
{ {
text: RetentionBasisList[item.guarantee * 1]?.label, text: GuaranteeStageList[item.guarantee * 1]?.label,
type: 'primary' type: 'primary'
}, },
{ {
...@@ -121,7 +136,8 @@ const localPagingCB = (data) => { ...@@ -121,7 +136,8 @@ const localPagingCB = (data) => {
type: 'info' type: 'info'
} }
], ],
id: item.id reporterValue: FaultReportingList[Number(item.reporter)]?.label,
professionalValue: MajorCategoryList[Number(item.professional)]?.label
} }
}) })
console.log('@@mappedData', mappedData[0]) console.log('@@mappedData', mappedData[0])
...@@ -130,7 +146,7 @@ const localPagingCB = (data) => { ...@@ -130,7 +146,7 @@ const localPagingCB = (data) => {
//筛选 //筛选
const handleRightClick = () => { const handleRightClick = () => {
uni.$mocpJump.redirectTo('/panel/inforDisclosure/search') uni.$mocpJump.navigateTo('/panel/inforDisclosure/search')
} }
//刷新 //刷新
const paging = ref() const paging = ref()
......
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