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) => {
......@@ -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) => {
return http({
......
......@@ -112,3 +112,27 @@ export const saveRelieveInfoApi = (data, 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 @@
:cancelColor="cancelColor"
:confirmColor="confirmColor"
></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>
<view class="date-icon">
<view class="date-icon-close" v-if="clearable && !showPlaceholder && !disabled" @tap.stop="clear">
......@@ -97,6 +97,11 @@ const ps = defineProps({
default: '#165dff'
}
})
const open = () => {
if (!ps.disabled) {
show.value = true
}
}
//获取下拉框样式
const getStyle = computed(() => {
let pickAlign = 'flex-start'
......@@ -201,6 +206,7 @@ const clear = () => {
&.disabled {
background: #f5f7fa;
padding: 0 12rpx;
}
}
......
......@@ -89,6 +89,11 @@ const getCustomStyle = computed(() => {
height: ps.height ? ps.height + 'rpx' : 'auto',
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') {
style.borderTopLeftRadius = ps.round + 'rpx'
style.marginTop = safeAreaInsets?.top + 'px'
......
......@@ -23,8 +23,11 @@
</view>
</global-popup>
<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">
<up-loading-icon :show="loading && !show"></up-loading-icon>
<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>
</view>
......@@ -36,8 +39,8 @@
<script setup>
import { debounce } from 'lodash'
import { getAdminListApi } from 'mocp/api/system'
import { computed, ref, watch, watchEffect } from 'vue'
import { getAdminDetailApi, getAdminListApi } from 'mocp/api/system'
import { computed, ref, watch } from 'vue'
const es = defineEmits(['update:modelValue', 'change'])
const ps = defineProps({
......@@ -138,7 +141,7 @@ const getContentStyle = computed(() => {
const labelValue = ref('')
const getLabelValue = computed(() => {
if (labelValue.value == ps.emptyValue) {
return ps.placeholder
return loading.value ? '' : ps.placeholder
}
return labelValue.value || ps.placeholder
})
......@@ -203,14 +206,30 @@ const onChange = debounce((value) => {
}
}, 200)
//获取label的内容
watchEffect(() => {
const option = columns.value?.find((option) => String(option[ps.valueField]) === String(ps.modelValue))
if (option) {
labelValue.value = option[ps.labelField]
const loading = ref(false)
const getAdminDetail = async (id) => {
loading.value = true
const res = await getAdminDetailApi({ id })
loading.value = false
if (res.code == 200) {
labelValue.value = `${res.data?.nickname}(${(res.data?.enetAccount || '无易网号') + '-' + (res.data?.deptFullName || '无机构')})`
} 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) => {
es('update:modelValue', row[ps.valueField], row)
......
......@@ -52,6 +52,8 @@ const useWindDamageManagementStore = defineStore('windDamageManagement303030', {
return state.details?.operateList.find((item) => item.operateBasicVo.id == String(state.basicId)) || {}
} else if (state.tabIndex == 2) {
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 {}
},
......@@ -62,6 +64,8 @@ const useWindDamageManagementStore = defineStore('windDamageManagement303030', {
return this.getDetails?.operateBasicVo || {}
} else if (state.tabIndex == 2) {
return this.getDetails?.mooringBasicVo || {}
} else if (state.tabIndex == 3) {
return this.getDetails?.sandstormBasicVo || {}
}
return {}
},
......@@ -72,6 +76,8 @@ const useWindDamageManagementStore = defineStore('windDamageManagement303030', {
return this.getDetails.operateConclusionVo || {}
} else if (state.tabIndex == 2) {
return this.getDetails.mooringConclusionVo || {}
} else if (state.tabIndex == 3) {
return this.getDetails.sandstormConclusionVo || {}
}
return {}
},
......@@ -82,8 +88,22 @@ const useWindDamageManagementStore = defineStore('windDamageManagement303030', {
return this.getDetails.operateWorkVo || {}
} else if (state.tabIndex == 2) {
return this.getDetails.mooringWorkVo || {}
} else if (state.tabIndex == 3) {
return this.getDetails.sandstormWorkVo || {}
}
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: {
......@@ -112,6 +132,6 @@ const useWindDamageManagementStore = defineStore('windDamageManagement303030', {
}
},
// 配置持久化
persist: true
persist: false
})
export default useWindDamageManagementStore
......@@ -49,7 +49,7 @@ export const uniqueArray = (arr) => {
*/
export const previewFile = (fileUrl) => {
uni.showLoading({
title: '正在打开文件',
title: '正在打开文件...',
mask: true
})
uni.downloadFile({
......@@ -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
* @returns
......
......@@ -168,7 +168,7 @@
{
"path": "pages/modules/mocp/panel/move-decision/edit-mco-director",
"style": {
"navigationBarTitleText": "MCO主任意见"
"navigationBarTitleText": "MOC主任意见"
}
},
{
......@@ -770,6 +770,12 @@
"style": {
"navigationBarTitleText": "防风害系留操作单"
}
},
{
"path": "pages/modules/mocp/panel/windDamageManagement/sandstormDetails",
"style": {
"navigationBarTitleText": "防沙尘暴签署单"
}
}
],
"globalStyle": {
......
......@@ -69,19 +69,19 @@
</view>
</view>
<custom-card-details
title="MCO主任意见"
title="MOC主任意见"
showfooter
:idcard="details.mcoDirectorUpdateName"
:calendar="details.mcoDirectorUpdateTime"
edit
@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
label="MCO主任意见"
label="MOC主任意见"
:value="useGetDictByValue('md_decisionState', details.mcoDirectorDecisionState) || '-'"
></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
title="公司值班经理意见"
......
<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">
<up-form labelPosition="left" labelWidth="auto">
<up-form-item label="MCO主任" :borderBottom="true">
<up-form-item label="MOC主任" :borderBottom="true">
<custom-admin-picker
ref="adminPickerRef"
pickAlign="right"
......@@ -11,10 +11,10 @@
:searchValue="details.mcoDirectorName"
></custom-admin-picker>
</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>
</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-form-item>
</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 @@
<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-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-form-item>
<up-form-item :label="tabIndex == 0 ? '巡场人员' : '操作人'" :borderBottom="true">
......
......@@ -46,9 +46,9 @@ const formData = reactive({
})
// 页面初始化
onLoad(() => {
Object.assign(formData, getConclusionVo.value)
formData.basicId = basicId.value
formData.type = tabIndex.value + 1
Object.assign(formData, getConclusionVo.value)
})
//提交表单
const handleSubmit = async () => {
......
......@@ -101,7 +101,7 @@ const tabList = [
{
name: '防沙尘暴签署单',
api: getPwdSandstormListApi,
url: '/panel/windDamageManagement/patrolDetails'
url: '/panel/windDamageManagement/sandstormDetails'
}
]
const handleTabsChange = (value) => {
......
<template>
<global-page title="气象信息">
<view class="mocp-cell">
<up-cell-group v-if="details">
<up-cell title="报文生成时间" :value="details.generateTime || '-'"></up-cell>
<up-cell title="气象类型" :value="useGetDictByValue('wdm_alarmcategory', details.weatherType) || '-'"></up-cell>
<up-cell title="气象中文描述" :label="details.weatherDescribe || '-'"></up-cell>
<up-cell title="平均风速" :value="details.windfs || '-'"></up-cell>
<up-cell title="最大风速" :value="details.windzf || '-'"></up-cell>
<up-cell title="预计开始时间" :value="details.startTime || '-'"></up-cell>
<up-cell title="预计解除时间" :value="details.endTime || '-'"></up-cell>
</up-cell-group>
</view>
<global-page
title="气象信息"
isDataList
refresherEnabled
loadingMoreEnabled
auto
:params="{ terminal: query.terminal }"
:api="getTerminalWeatherListApi"
:padding="24"
>
<template #default="{ item }">
<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>
</template>
<script setup>
import { getTerminalWeatherListApi } from 'mocp/api/windDamageManagement'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import { ref } from 'vue'
const details = ref({
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'
})
const query = defineProps(['id'])
</script>
<style lang="scss" scoped>
.mocp-cell {
background: #fff;
}
.mocp-title {
color: $mocp-text-5;
font-size: 24rpx;
padding: 20rpx 0;
background: #f7f8fa;
}
</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