Commit ab339465 by pangchong

feat: 防风害收尾

parent 91a5e79a
import { http } from 'mocp/utils/http' import { http, post } from 'mocp/utils/http'
//获取用户基本信息分页列表 //获取用户基本信息分页列表
export const getAdminListApi = (data, config) => { export const getAdminListApi = (data, config) => {
...@@ -10,6 +10,16 @@ export const getAdminListApi = (data, config) => { ...@@ -10,6 +10,16 @@ export const getAdminListApi = (data, config) => {
}) })
} }
//获取用户基本信息详情
export const getAdminDetailApi = (data, config) => {
return http({
method: 'POST',
url: '/system/getAdminDetail',
data,
config
})
}
//通过机号查询飞机相关数据 //通过机号查询飞机相关数据
export const getAcReduceListApi = (data, config) => { export const getAcReduceListApi = (data, config) => {
return http({ return http({
......
...@@ -112,3 +112,27 @@ export const saveRelieveInfoApi = (data, config) => { ...@@ -112,3 +112,27 @@ export const saveRelieveInfoApi = (data, config) => {
config config
}) })
} }
export const saveSandstormWorkApi = (data, config) => {
return post({
method: 'POST',
url: '/terminal/saveSandstormWork',
data,
config
})
}
export const getPwdTaByAcApi = (data, config) => {
return http({
method: 'POST',
url: '/terminal/getPwdTaByAc',
data,
config
})
}
export const getTerminalWeatherListApi = (data, config) => {
return http({
method: 'POST',
url: '/terminal/getTerminalWeatherList',
data,
config
})
}
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
:cancelColor="cancelColor" :cancelColor="cancelColor"
:confirmColor="confirmColor" :confirmColor="confirmColor"
></up-datetime-picker> ></up-datetime-picker>
<view class="date-content" :class="getPickerClass" @tap="show = true" :style="getStyle"> <view class="date-content" :class="getPickerClass" @tap="open" :style="getStyle">
<text class="date-value">{{ getLabelValue }}</text> <text class="date-value">{{ getLabelValue }}</text>
<view class="date-icon"> <view class="date-icon">
<view class="date-icon-close" v-if="clearable && !showPlaceholder && !disabled" @tap.stop="clear"> <view class="date-icon-close" v-if="clearable && !showPlaceholder && !disabled" @tap.stop="clear">
...@@ -97,6 +97,11 @@ const ps = defineProps({ ...@@ -97,6 +97,11 @@ const ps = defineProps({
default: '#165dff' default: '#165dff'
} }
}) })
const open = () => {
if (!ps.disabled) {
show.value = true
}
}
//获取下拉框样式 //获取下拉框样式
const getStyle = computed(() => { const getStyle = computed(() => {
let pickAlign = 'flex-start' let pickAlign = 'flex-start'
...@@ -201,6 +206,7 @@ const clear = () => { ...@@ -201,6 +206,7 @@ const clear = () => {
&.disabled { &.disabled {
background: #f5f7fa; background: #f5f7fa;
padding: 0 12rpx;
} }
} }
......
...@@ -89,6 +89,11 @@ const getCustomStyle = computed(() => { ...@@ -89,6 +89,11 @@ const getCustomStyle = computed(() => {
height: ps.height ? ps.height + 'rpx' : 'auto', height: ps.height ? ps.height + 'rpx' : 'auto',
background: ps.background background: ps.background
} }
if (ps.mode == 'bottom') {
style.borderTopLeftRadius = ps.round + 'rpx'
style.borderTopRightRadius = ps.round + 'rpx'
style.marginTop = safeAreaInsets?.top + 'px'
}
if (ps.mode == 'right') { if (ps.mode == 'right') {
style.borderTopLeftRadius = ps.round + 'rpx' style.borderTopLeftRadius = ps.round + 'rpx'
style.marginTop = safeAreaInsets?.top + 'px' style.marginTop = safeAreaInsets?.top + 'px'
......
...@@ -23,8 +23,11 @@ ...@@ -23,8 +23,11 @@
</view> </view>
</global-popup> </global-popup>
<view class="picker-content" :class="getPickerClass" @tap="open" :style="getContentStyle"> <view class="picker-content" :class="getPickerClass" @tap="open" :style="getContentStyle">
<text class="picker-value">{{ getLabelValue }}</text> <text class="picker-value">
{{ getLabelValue }}
</text>
<view class="picker-icon"> <view class="picker-icon">
<up-loading-icon :show="loading && !show"></up-loading-icon>
<view class="picker-icon-close" v-if="clearable && !showPlaceholder && !disabled" @tap.stop="clear"> <view class="picker-icon-close" v-if="clearable && !showPlaceholder && !disabled" @tap.stop="clear">
<up-icon name="close-circle-fill" color="#c0c4cc" size="36rpx"></up-icon> <up-icon name="close-circle-fill" color="#c0c4cc" size="36rpx"></up-icon>
</view> </view>
...@@ -36,8 +39,8 @@ ...@@ -36,8 +39,8 @@
<script setup> <script setup>
import { debounce } from 'lodash' import { debounce } from 'lodash'
import { getAdminListApi } from 'mocp/api/system' import { getAdminDetailApi, getAdminListApi } from 'mocp/api/system'
import { computed, ref, watch, watchEffect } from 'vue' import { computed, ref, watch } from 'vue'
const es = defineEmits(['update:modelValue', 'change']) const es = defineEmits(['update:modelValue', 'change'])
const ps = defineProps({ const ps = defineProps({
...@@ -138,7 +141,7 @@ const getContentStyle = computed(() => { ...@@ -138,7 +141,7 @@ const getContentStyle = computed(() => {
const labelValue = ref('') const labelValue = ref('')
const getLabelValue = computed(() => { const getLabelValue = computed(() => {
if (labelValue.value == ps.emptyValue) { if (labelValue.value == ps.emptyValue) {
return ps.placeholder return loading.value ? '' : ps.placeholder
} }
return labelValue.value || ps.placeholder return labelValue.value || ps.placeholder
}) })
...@@ -203,14 +206,30 @@ const onChange = debounce((value) => { ...@@ -203,14 +206,30 @@ const onChange = debounce((value) => {
} }
}, 200) }, 200)
//获取label的内容 //获取label的内容
watchEffect(() => { const loading = ref(false)
const option = columns.value?.find((option) => String(option[ps.valueField]) === String(ps.modelValue)) const getAdminDetail = async (id) => {
if (option) { loading.value = true
labelValue.value = option[ps.labelField] const res = await getAdminDetailApi({ id })
loading.value = false
if (res.code == 200) {
labelValue.value = `${res.data?.nickname}(${(res.data?.enetAccount || '无易网号') + '-' + (res.data?.deptFullName || '无机构')})`
} else { } else {
labelValue.value = ps.emptyValue uni.$mocpMessage.error(res.message)
} }
}) }
watch(
() => ps.modelValue,
(value) => {
if (value) {
getAdminDetail(value)
} else {
labelValue.value = ps.emptyValue
}
},
{
immediate: true
}
)
//弹出层列表点击 //弹出层列表点击
const handleChoose = (row) => { const handleChoose = (row) => {
es('update:modelValue', row[ps.valueField], row) es('update:modelValue', row[ps.valueField], row)
......
...@@ -52,6 +52,8 @@ const useWindDamageManagementStore = defineStore('windDamageManagement303030', { ...@@ -52,6 +52,8 @@ const useWindDamageManagementStore = defineStore('windDamageManagement303030', {
return state.details?.operateList.find((item) => item.operateBasicVo.id == String(state.basicId)) || {} return state.details?.operateList.find((item) => item.operateBasicVo.id == String(state.basicId)) || {}
} else if (state.tabIndex == 2) { } else if (state.tabIndex == 2) {
return state.details?.mooringList.find((item) => item.mooringBasicVo.id == String(state.basicId)) || {} return state.details?.mooringList.find((item) => item.mooringBasicVo.id == String(state.basicId)) || {}
} else if (state.tabIndex == 3) {
return state.details?.sandstormList.find((item) => item.sandstormBasicVo.id == String(state.basicId)) || {}
} }
return {} return {}
}, },
...@@ -62,6 +64,8 @@ const useWindDamageManagementStore = defineStore('windDamageManagement303030', { ...@@ -62,6 +64,8 @@ const useWindDamageManagementStore = defineStore('windDamageManagement303030', {
return this.getDetails?.operateBasicVo || {} return this.getDetails?.operateBasicVo || {}
} else if (state.tabIndex == 2) { } else if (state.tabIndex == 2) {
return this.getDetails?.mooringBasicVo || {} return this.getDetails?.mooringBasicVo || {}
} else if (state.tabIndex == 3) {
return this.getDetails?.sandstormBasicVo || {}
} }
return {} return {}
}, },
...@@ -72,6 +76,8 @@ const useWindDamageManagementStore = defineStore('windDamageManagement303030', { ...@@ -72,6 +76,8 @@ const useWindDamageManagementStore = defineStore('windDamageManagement303030', {
return this.getDetails.operateConclusionVo || {} return this.getDetails.operateConclusionVo || {}
} else if (state.tabIndex == 2) { } else if (state.tabIndex == 2) {
return this.getDetails.mooringConclusionVo || {} return this.getDetails.mooringConclusionVo || {}
} else if (state.tabIndex == 3) {
return this.getDetails.sandstormConclusionVo || {}
} }
return {} return {}
}, },
...@@ -82,8 +88,22 @@ const useWindDamageManagementStore = defineStore('windDamageManagement303030', { ...@@ -82,8 +88,22 @@ const useWindDamageManagementStore = defineStore('windDamageManagement303030', {
return this.getDetails.operateWorkVo || {} return this.getDetails.operateWorkVo || {}
} else if (state.tabIndex == 2) { } else if (state.tabIndex == 2) {
return this.getDetails.mooringWorkVo || {} return this.getDetails.mooringWorkVo || {}
} else if (state.tabIndex == 3) {
return this.getDetails.sandstormWorkVo || {}
} }
return {} return {}
},
getDisabled(state) {
if (state.tabIndex == 0) {
return this.getBasicVo.rxStatus == '0' || state.details.patrolIsOpen == '0'
} else if (state.tabIndex == 1) {
return this.getBasicVo.rxStatus == '0' || state.details.operateIsOpen == '0'
} else if (state.tabIndex == 2) {
return this.getBasicVo.rxStatus == '0' || state.details.mooringIsOpen == '0'
} else if (state.tabIndex == 3) {
return this.getBasicVo.rxStatus == '0' || state.details.sandstormIsOpen == '0'
}
return false
} }
}, },
actions: { actions: {
...@@ -112,6 +132,6 @@ const useWindDamageManagementStore = defineStore('windDamageManagement303030', { ...@@ -112,6 +132,6 @@ const useWindDamageManagementStore = defineStore('windDamageManagement303030', {
} }
}, },
// 配置持久化 // 配置持久化
persist: true persist: false
}) })
export default useWindDamageManagementStore export default useWindDamageManagementStore
...@@ -49,7 +49,7 @@ export const uniqueArray = (arr) => { ...@@ -49,7 +49,7 @@ export const uniqueArray = (arr) => {
*/ */
export const previewFile = (fileUrl) => { export const previewFile = (fileUrl) => {
uni.showLoading({ uni.showLoading({
title: '正在打开文件', title: '正在打开文件...',
mask: true mask: true
}) })
uni.downloadFile({ uni.downloadFile({
...@@ -77,6 +77,48 @@ export const previewFile = (fileUrl) => { ...@@ -77,6 +77,48 @@ export const previewFile = (fileUrl) => {
} }
/** /**
* 文件下载
* @param {*} fileUrl
*/
export const downloadFile = (fileUrl) => {
return new Promise((resolve, reject) => {
uni.showLoading({
mask: true,
title: '保存中...'
})
uni.downloadFile({
url: fileUrl,
success: (res) => {
if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: () => {
uni.$mocpMessage.success('文件下载成功,已保存到相册')
resolve(res.tempFilePath)
},
fail: (err) => {
uni.$mocpMessage.error('保存到相册失败:', err)
reject(err)
},
complete: () => {
uni.hideLoading()
}
})
} else {
uni.$mocpMessage.error('文件下载失败')
reject(new Error('文件下载失败'))
}
},
fail: (err) => {
uni.hideLoading()
uni.$mocpMessage.error('下载文件失败:', err)
reject(err)
}
})
})
}
/**
* 如果至少有一个参数被填写,那么所有参数都必须被填写 * 如果至少有一个参数被填写,那么所有参数都必须被填写
* @param {...any} params * @param {...any} params
* @returns * @returns
......
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
{ {
"path": "pages/modules/mocp/panel/move-decision/edit-mco-director", "path": "pages/modules/mocp/panel/move-decision/edit-mco-director",
"style": { "style": {
"navigationBarTitleText": "MCO主任意见" "navigationBarTitleText": "MOC主任意见"
} }
}, },
{ {
...@@ -770,6 +770,12 @@ ...@@ -770,6 +770,12 @@
"style": { "style": {
"navigationBarTitleText": "防风害系留操作单" "navigationBarTitleText": "防风害系留操作单"
} }
},
{
"path": "pages/modules/mocp/panel/windDamageManagement/sandstormDetails",
"style": {
"navigationBarTitleText": "防沙尘暴签署单"
}
} }
], ],
"globalStyle": { "globalStyle": {
......
...@@ -69,19 +69,19 @@ ...@@ -69,19 +69,19 @@
</view> </view>
</view> </view>
<custom-card-details <custom-card-details
title="MCO主任意见" title="MOC主任意见"
showfooter showfooter
:idcard="details.mcoDirectorUpdateName" :idcard="details.mcoDirectorUpdateName"
:calendar="details.mcoDirectorUpdateTime" :calendar="details.mcoDirectorUpdateTime"
edit edit
@handleAdd="handleAdd('edit-mco-director')" @handleAdd="handleAdd('edit-mco-director')"
> >
<custom-card-details-item label="MCO主任" :value="details.mcoDirectorName || '-'"></custom-card-details-item> <custom-card-details-item label="MOC主任" :value="details.mcoDirectorName || '-'"></custom-card-details-item>
<custom-card-details-item <custom-card-details-item
label="MCO主任意见" label="MOC主任意见"
:value="useGetDictByValue('md_decisionState', details.mcoDirectorDecisionState) || '-'" :value="useGetDictByValue('md_decisionState', details.mcoDirectorDecisionState) || '-'"
></custom-card-details-item> ></custom-card-details-item>
<custom-card-details-item label="MCO主任意见描述" :value="details.mcoDirectorOpinion || '-'"></custom-card-details-item> <custom-card-details-item label="MOC主任意见描述" :value="details.mcoDirectorOpinion || '-'"></custom-card-details-item>
</custom-card-details> </custom-card-details>
<custom-card-details <custom-card-details
title="公司值班经理意见" title="公司值班经理意见"
......
<template> <template>
<global-page title="MCO主任意见" navLeftType="text" showNavRight navRightType="button" navRightText="保存" @handleRightClick="handleRightClick"> <global-page title="MOC主任意见" navLeftType="text" showNavRight navRightType="button" navRightText="保存" @handleRightClick="handleRightClick">
<view class="mocp-form"> <view class="mocp-form">
<up-form labelPosition="left" labelWidth="auto"> <up-form labelPosition="left" labelWidth="auto">
<up-form-item label="MCO主任" :borderBottom="true"> <up-form-item label="MOC主任" :borderBottom="true">
<custom-admin-picker <custom-admin-picker
ref="adminPickerRef" ref="adminPickerRef"
pickAlign="right" pickAlign="right"
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
:searchValue="details.mcoDirectorName" :searchValue="details.mcoDirectorName"
></custom-admin-picker> ></custom-admin-picker>
</up-form-item> </up-form-item>
<up-form-item label="MCP主任意见" :borderBottom="true"> <up-form-item label="MOC主任意见" :borderBottom="true">
<global-radio radioAlign="right" clearable v-model="formData.mcoDirectorDecisionState" dictkey="md_decisionState"></global-radio> <global-radio radioAlign="right" clearable v-model="formData.mcoDirectorDecisionState" dictkey="md_decisionState"></global-radio>
</up-form-item> </up-form-item>
<up-form-item label="MCP主任意见描述" :borderBottom="true" labelPosition="top"> <up-form-item label="MOC主任意见描述" :borderBottom="true" labelPosition="top">
<up-textarea placeholder="请输入" :height="40" border="none" v-model="formData.mcoDirectorOpinion"></up-textarea> <up-textarea placeholder="请输入" :height="40" border="none" v-model="formData.mcoDirectorOpinion"></up-textarea>
</up-form-item> </up-form-item>
</up-form> </up-form>
......
<template>
<global-popup v-model="show" title="TA文件" background="#F7F8FA" :round="32" closeable>
<up-cell-group v-if="taList.length">
<template v-for="(item, index) in taList" :key="index">
<up-cell :title="item.fileName" @tap="downloadFile(item.fileUrl)" />
</template>
</up-cell-group>
<view class="global-empty" v-else>
<global-empty></global-empty>
</view>
</global-popup>
</template>
<script setup>
import { getPwdTaByAcApi } from 'mocp/api/windDamageManagement'
import { downloadFile } from 'mocp/utils/tool'
import { ref } from 'vue'
const show = ref(false)
const taList = ref([])
const open = (params) => {
taList.value = []
getPwdTaByAc(params)
}
const getPwdTaByAc = async (params) => {
const res = await getPwdTaByAcApi(params, { loading: true })
if (res.code == 200) {
if (res.data?.files) {
taList.value = JSON.parse(res.data?.files)
}
if (taList.value.length == 0) {
uni.$mocpMessage.warning('暂无对应文件')
}
if (taList.value.length == 1) {
downloadFile(taList.value[0].fileUrl)
}
if (taList.value.length > 1) {
show.value = true
}
} else {
uni.$mocpMessage.error(res.message)
}
}
defineExpose({
open
})
</script>
<style lang="scss" scoped>
.global-empty {
padding: 24rpx 0;
}
:deep(.u-cell__title-text) {
word-break: break-all;
}
</style>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<up-form-item label="航站" :borderBottom="true" prop="terminal" required> <up-form-item label="航站" :borderBottom="true" prop="terminal" required>
<up-input border="none" inputAlign="right" clearable v-model="formData.terminal" disabled disabledColor="#fff"></up-input> <up-input border="none" inputAlign="right" clearable v-model="formData.terminal" disabled disabledColor="#fff"></up-input>
</up-form-item> </up-form-item>
<up-form-item label="机号" :borderBottom="true" prop="ac" required> <up-form-item label="机号" :borderBottom="true" prop="ac" required v-if="tabIndex > 0">
<up-input border="none" inputAlign="right" clearable v-model="formData.ac" disabled disabledColor="#fff"></up-input> <up-input border="none" inputAlign="right" clearable v-model="formData.ac" disabled disabledColor="#fff"></up-input>
</up-form-item> </up-form-item>
<up-form-item :label="tabIndex == 0 ? '巡场人员' : '操作人'" :borderBottom="true"> <up-form-item :label="tabIndex == 0 ? '巡场人员' : '操作人'" :borderBottom="true">
......
...@@ -46,9 +46,9 @@ const formData = reactive({ ...@@ -46,9 +46,9 @@ const formData = reactive({
}) })
// 页面初始化 // 页面初始化
onLoad(() => { onLoad(() => {
Object.assign(formData, getConclusionVo.value)
formData.basicId = basicId.value formData.basicId = basicId.value
formData.type = tabIndex.value + 1 formData.type = tabIndex.value + 1
Object.assign(formData, getConclusionVo.value)
}) })
//提交表单 //提交表单
const handleSubmit = async () => { const handleSubmit = async () => {
......
...@@ -101,7 +101,7 @@ const tabList = [ ...@@ -101,7 +101,7 @@ const tabList = [
{ {
name: '防沙尘暴签署单', name: '防沙尘暴签署单',
api: getPwdSandstormListApi, api: getPwdSandstormListApi,
url: '/panel/windDamageManagement/patrolDetails' url: '/panel/windDamageManagement/sandstormDetails'
} }
] ]
const handleTabsChange = (value) => { const handleTabsChange = (value) => {
......
<template> <template>
<global-page title="气象信息"> <global-page
<view class="mocp-cell"> title="气象信息"
<up-cell-group v-if="details"> isDataList
<up-cell title="报文生成时间" :value="details.generateTime || '-'"></up-cell> refresherEnabled
<up-cell title="气象类型" :value="useGetDictByValue('wdm_alarmcategory', details.weatherType) || '-'"></up-cell> loadingMoreEnabled
<up-cell title="气象中文描述" :label="details.weatherDescribe || '-'"></up-cell> auto
<up-cell title="平均风速" :value="details.windfs || '-'"></up-cell> :params="{ terminal: query.terminal }"
<up-cell title="最大风速" :value="details.windzf || '-'"></up-cell> :api="getTerminalWeatherListApi"
<up-cell title="预计开始时间" :value="details.startTime || '-'"></up-cell> :padding="24"
<up-cell title="预计解除时间" :value="details.endTime || '-'"></up-cell> >
</up-cell-group> <template #default="{ item }">
</view> <template v-for="(option, index) in item.weatherList" :key="index">
<view class="mocp-cell">
<view class="mocp-title">报文生成时间:{{ option.generateTime || '-' }}</view>
<up-cell-group>
<up-cell title="气象类型" :value="useGetDictByValue('wdm_alarmcategory', option.weatherType) || '-'"></up-cell>
<up-cell title="气象中文描述" :label="option.weatherDescribe || '-'"></up-cell>
<up-cell title="平均风速" :value="option.windfs || '-'"></up-cell>
<up-cell title="最大风速" :value="option.windzf || '-'"></up-cell>
<up-cell title="预计开始时间" :value="option.startTime || '-'"></up-cell>
<up-cell title="预计解除时间" :value="option.endTime || '-'"></up-cell>
</up-cell-group>
</view>
</template>
</template>
</global-page> </global-page>
</template> </template>
<script setup> <script setup>
import { getTerminalWeatherListApi } from 'mocp/api/windDamageManagement'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict' import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import { ref } from 'vue'
const details = ref({ const query = defineProps(['id'])
deleted: '0',
endTime: '2024-10-20 08:00:00',
generateTime: '2024-10-06 02:29:02',
id: '1842633935596224514',
issued: '1',
msgType: '预报',
startTime: '2024-10-07 06:00:00',
terminal: 'MEL',
terminalType: '3',
weatherDescribe: 'FT: 07日06:00至07日08:00: 320度 9米/秒,阵风15米/秒',
weatherSource: '0',
weatherType: 'StrongWind',
windfs: '9',
windzf: '15'
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.mocp-cell { .mocp-cell {
background: #fff; background: #fff;
} }
.mocp-title {
color: $mocp-text-5;
font-size: 24rpx;
padding: 20rpx 0;
background: #f7f8fa;
}
</style> </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