Commit 67f56ff8 by pangchong

feat: 防风害巡场检查单

parent edbd851c
import { http, post } from 'mocp/utils/http'
export const getPwdPatrolListApi = (data, config) => {
return http({
method: 'POST',
url: '/terminal/getPwdPatrolList',
data,
config
})
}
export const getPwdOperateListApi = (data, config) => {
return http({
method: 'POST',
url: '/terminal/getPwdOperateList',
data,
config
})
}
export const getPwdMooringListApi = (data, config) => {
return http({
method: 'POST',
url: '/terminal/getPwdMooringList',
data,
config
})
}
export const getPwdSandstormListApi = (data, config) => {
return http({
method: 'POST',
url: '/terminal/getPwdSandstormList',
data,
config
})
}
export const getAllTaskInfoByWeatherApi = (data, config) => {
return http({
method: 'POST',
url: '/terminal/getAllTaskInfoByWeather',
data,
config
})
}
export const savePwdCommonTaskApi = (data, config) => {
return post({
method: 'POST',
url: '/terminal/savePwdCommonTask',
data,
config
})
}
export const getPwdReceiveHistoryListApi = (data, config) => {
return http({
method: 'POST',
url: '/terminal/getPwdReceiveHistoryList',
data,
config
})
}
export const saveReceiveInfoApi = (data, config) => {
return http({
method: 'POST',
url: '/terminal/saveReceiveInfo',
data,
config
})
}
export const savePwdBasicApi = (data, config) => {
return post({
method: 'POST',
url: '/terminal/savePwdBasic',
data,
config
})
}
export const savePwdConclusionApi = (data, config) => {
return post({
method: 'POST',
url: '/terminal/savePwdConclusion',
data,
config
})
}
export const savePatrolWorkApi = (data, config) => {
return post({
method: 'POST',
url: '/terminal/savePatrolWork',
data,
config
})
}
......@@ -99,7 +99,7 @@ const getRadius = computed(() => {
margin-right: 8rpx;
}
&[disabled] {
opacity: 0.75;
opacity: 0.5;
}
}
</style>
......@@ -32,7 +32,7 @@ import Day from 'mocp/utils/dayjs'
const es = defineEmits(['update:modelValue', 'change'])
const ps = defineProps({
//日历模式date,time,year-month
//日历模式date,datetime,time,year-month
mode: {
type: String,
default: 'date'
......@@ -113,7 +113,7 @@ const getStyle = computed(() => {
const labelValue = ref('')
const getLabelValue = computed(() => {
if (labelValue.value) {
if (ps.mode == 'date') {
if (['date', 'datetime'].includes(ps.mode)) {
return Day(labelValue.value).format(ps.format)
} else {
return labelValue.value
......
......@@ -25,7 +25,7 @@
<script setup>
import { filterEmptyValues } from 'mocp/utils/tool'
import { computed, ref, watch } from 'vue'
import { ref, watch } from 'vue'
const paging = ref()
const dataList = ref([])
......@@ -140,26 +140,27 @@ const queryList = (pageIndex, pageSize) => {
if (ps.tabValue != null && !ps.alone) {
params[ps.tabValueField] = ps.tabValue
}
console.log(ps.api)
if (Object.prototype.toString.call(ps.api) == '[object Function]') {
ps.api(params, {loading: true}).then((res) => {
if (res.code == 200 || res.list?.length) {
let data = res.list || res.data?.list || res?.data || []
if (ps.transformData) {
data = ps.transformData(data) || []
}
if (ps.localPaging) {
paging.value?.setLocalPaging(data)
ps.api(params, { loading: true })
.then((res) => {
if (res.code == 200 || res.list?.length) {
let data = res.list || res.data?.list || res?.data || []
if (ps.transformData) {
data = ps.transformData(data) || []
}
if (ps.localPaging) {
paging.value?.setLocalPaging(data)
} else {
paging.value?.complete(data)
}
} else {
paging.value?.complete(data)
paging.value?.complete(false)
uni.$mocpMessage.error(res.message)
}
} else {
})
.catch(() => {
paging.value?.complete(false)
uni.$mocpMessage.error(res.message)
}
}).catch(() => {
paging.value?.complete(false)
})
})
} else {
paging.value?.complete(false)
}
......
......@@ -11,20 +11,17 @@
<!-- 自定义导航栏 -->
<global-navbar :title="title" v-if="showNavbar" :bgColor="navbgColor" :color="navColor">
<template #left v-if="pages.length > 1 && showNavLeft">
<up-icon v-if="navLeftType == 'icon'" :name="navLeftIcon" size="16" @tap="handleLeftClick"
:color="navColor"></up-icon>
<up-icon v-if="navLeftType == 'icon'" :name="navLeftIcon" size="16" @tap="handleLeftClick" :color="navColor"></up-icon>
<view v-if="navLeftType == 'text'" class="cancel" @tap="handleLeftClick">{{ navLeftText }}</view>
</template>
<template #right v-if="showNavRight">
<global-button type="text" size="small" v-if="navRightType == 'text'" @tap="handleRightClick">
{{ navRightText }}
</global-button>
<global-button type="primary" size="small" v-if="navRightType == 'button'" style="padding: 0 32rpx"
@tap="handleRightClick">
<global-button type="primary" size="small" v-if="navRightType == 'button'" style="padding: 0 32rpx" @tap="handleRightClick">
{{ navRightText }}
</global-button>
<global-icon v-if="navRightType == 'icon'" :icon="navRightIcon"
@tap="handleRightClick"></global-icon>
<global-icon v-if="navRightType == 'icon'" :icon="navRightIcon" @tap="handleRightClick"></global-icon>
</template>
</global-navbar>
<!-- tab切换 -->
......@@ -69,8 +66,7 @@
:transformData="transformData"
>
<template #="{ dataList }">
<up-checkbox-group v-model="chooseValue" v-if="chooseDataType == 'checkbox'"
class="checkbox-group">
<up-checkbox-group v-model="chooseValue" v-if="chooseDataType == 'checkbox'" class="checkbox-group">
<template v-for="(item, index) in dataList" :key="index">
<up-checkbox :name="index" v-if="chooseDataType == 'checkbox'" class="f-flex-1">
<template #label>
......@@ -102,7 +98,7 @@
import { computed, nextTick, onUnmounted, ref, watch } from 'vue'
// 获取屏幕边界到安全区域距离
const {safeAreaInsets} = uni.getSystemInfoSync()
const { safeAreaInsets } = uni.getSystemInfoSync()
const es = defineEmits(['handleLeftClick', 'handleRightClick', 'handleFooterClick', 'handleChooseData', 'handleTabsChange'])
const ps = defineProps({
background: {
......@@ -340,16 +336,15 @@ const swiperAnimationfinish = (e) => {
//获取查询参数
const getParams = computed(() => {
if (ps.alone) {
return ps.tabList[current.value].params || {}
return ps.tabList[current.value].params || ps.params || {}
} else {
return ps.params
}
})
//获取查询接口
const getApi = computed(() => {
console.log(ps.alone, ps.tabList[current.value].api)
if (ps.alone) {
return ps.tabList[current.value].api
return ps.tabList[current.value].api || ps.api
} else {
return ps.api
}
......
......@@ -35,10 +35,17 @@
<view v-if="navLeftType == 'text'" class="cancel" @tap="handleLeftClick">{{ navLeftText }}</view>
</template>
<template #right v-if="showNavRight">
<global-button type="text" size="small" v-if="navRightType == 'text'" @tap="handleRightClick">
<global-button type="text" size="small" v-if="navRightType == 'text'" @tap="handleRightClick" :disabled="navRightDisabled">
{{ navRightText }}
</global-button>
<global-button type="primary" size="small" v-if="navRightType == 'button'" style="padding: 0 32rpx" @tap="handleRightClick">
<global-button
type="primary"
:disabled="navRightDisabled"
size="small"
v-if="navRightType == 'button'"
style="padding: 0 32rpx"
@tap="handleRightClick"
>
{{ navRightText }}
</global-button>
<global-icon v-if="navRightType == 'icon'" :icon="navRightIcon" @tap="handleRightClick"></global-icon>
......@@ -174,6 +181,10 @@ const ps = defineProps({
type: String,
default: '编辑'
},
navRightDisabled: {
type: Boolean,
default: false
},
//是否显示底部按钮
showFooterBtn: {
type: Boolean,
......@@ -365,7 +376,9 @@ const handleLeftClick = () => {
}
//点击右边插槽
const handleRightClick = () => {
es('handleRightClick')
if (!ps.navRightDisabled) {
es('handleRightClick')
}
}
//消息提示
const uToastRef = ref()
......
......@@ -26,13 +26,13 @@
<up-icon name="eye" size="18" color="#4E5969"></up-icon>
</view>
</view>
<view class="upload-item-right" @tap="deleteFile(index)" v-if="showUpload">
<view class="upload-item-right" @tap="deleteFile(index)" v-if="getShowUpload">
<global-icon icon="delete-01" color="#F53F3F"></global-icon>
</view>
</view>
</view>
<view v-if="getFileList.length == 0 && !showUpload">暂无文件</view>
<template v-if="showUpload">
<view v-if="getFileList.length == 0 && !getShowUpload">暂无文件</view>
<template v-if="getShowUpload">
<view class="upload-button" v-if="isLoading">
<up-loading-icon text="上传中" textSize="14"></up-loading-icon>
</view>
......@@ -40,7 +40,6 @@
width="640rpx"
:height="isLoading || !(getFileList.length < 1 || multiple) ? '0rpx' : '88rpx'"
:option="getOptions"
:size="30"
:instantly="true"
:distinct="true"
@uploadEnd="onuploadEnd"
......@@ -114,9 +113,17 @@ const ps = defineProps({
showUpload: {
type: Boolean,
default: true
},
limit: {
type: Number,
default: 10
}
})
const fileList = ref([])
const showUpload = ref(true)
const getShowUpload = computed(() => {
return ps.showUpload && showUpload.value
})
watch(
() => ps.fileList,
(value) => {
......@@ -167,12 +174,17 @@ const onuploadEnd = (e) => {
}
isLoading.value = false
}
const change = (e) => {
const change = () => {
isLoading.value = true
}
watch(
fileList,
(value) => {
if (value.length >= ps.limit) {
showUpload.value = false
} else {
showUpload.value = true
}
let files = cloneDeep(value)
if (ps.mapFieldName) {
files = files.map((v) => v[ps.mapFieldName]).join(ps.mapFieldSplit)
......
......@@ -14,3 +14,4 @@ export * from './operationalSurvey'
export * from './qualityAnalysis'
export * from './technicalAnalysis'
export * from './engineeringEvaluation'
export * from './windDamageManagement'
// 建议以文件名首字母作为前缀wdm_
export const wdm_isOpen = [
{ label: 'OPEN', value: 1 },
{ label: 'CLOSE', value: 0 }
]
export const wdm_rxStatus = [
{ label: '待接收', value: '0' },
{ label: '已接受', value: '1' },
{ label: '已反馈', value: '2' }
]
export const wdm_rxStatusType = [
{ label: 'danger', value: '0' },
{ label: 'success', value: '1' },
{ label: 'info', value: '2' }
]
export const wdm_alarmcategory = [
{ label: '大风', value: 'StrongWind' },
{ label: '积冰', value: 'Icing' },
{ label: '沙尘', value: 'SandDust' },
{ label: '冰雹', value: 'Hail' }
]
export const wdm_complete = [
{ label: '是', value: '1' },
{ label: '否', value: '2' },
{ label: '不适用', value: '3' }
]
export const wdm_isAbnormal = [
{ label: '是', value: '1' },
{ label: '否', value: '2' }
]
......@@ -15,7 +15,7 @@ const menuList = ref([
{ 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, url: '/panel/mechanicalAbnormalEvents/list' },
{ id: 'ffh', name: '防风害', icon: 'ffh', group: '维修控制', default: false, count: 0 },
{ id: 'ffh', name: '防风害', icon: 'ffh', group: '维修控制', default: false, count: 0, url: '/panel/windDamageManagement/list' },
// 技术支援
{ id: 'jdzt', name: '机队状态', icon: 'jdzt', group: '技术支援', default: true, count: 0, url: '/panel/fleet/search' },
{ id: 'zysq', name: '支援申请', icon: 'zysq', group: '技术支援', default: false, count: 0, url: '/panel/support-application/search' },
......
import { getAllTaskInfoByWeatherApi } from 'mocp/api/windDamageManagement'
import { defineStore } from 'pinia'
const useWindDamageManagementStore = defineStore('windDamageManagement303030', {
state: () => {
return {
tabIndex: 0,
searchData: {
0: {
isOpen: 1,
rxStatus: '',
terminal: '',
proposedTimeBegin: null,
proposedTimeEnd: null
},
1: {
isOpen: 1,
rxStatus: '',
terminal: '',
proposedTimeBegin: null,
proposedTimeEnd: null
},
2: {
isOpen: 1,
rxStatus: '',
terminal: '',
proposedTimeBegin: null,
proposedTimeEnd: null
},
3: {
isOpen: 1,
rxStatus: '',
terminal: '',
proposedTimeBegin: null,
proposedTimeEnd: null
}
},
weatherId: '',
weatherSource: undefined,
basicId: undefined,
details: undefined
}
},
getters: {
getSearchData(state) {
return state.searchData[state.tabIndex]
},
getDetails(state) {
if (state.tabIndex == 0) {
return state.details?.patrolList.find((item) => item.patrolBasicVo.id == String(state.basicId)) || {}
}
}
},
actions: {
async getAllTaskInfoByWeather(weatherId, weatherSource) {
const res = await getAllTaskInfoByWeatherApi(
{ weatherId: weatherId || this.weatherId, weatherSource: weatherSource || this.weatherSource },
{ loading: true }
)
if (res.code == 200) {
if (this.tabIndex == 0) {
this.details = res.data
}
} else {
uni.$mocpMessage.error(res.message)
}
},
resetForm() {
this.searchData[this.tabIndex] = {
isOpen: 1,
rxStatus: '',
terminal: '',
proposedTimeBegin: null,
proposedTimeEnd: null
}
},
setSearchData(searchData) {
this.searchData[this.tabIndex] = searchData
},
setState(...args) {
this.$patch({ [args[0]]: args[1] })
}
},
// 配置持久化
persist: false
})
export default useWindDamageManagementStore
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 = "http://10.123.48.67/api" //Amms内网
// const baseURL = 'https://hnaelbtest.hnatechnic.com/mocptest/api' //内网
const baseURL = 'https://hnaelbtest.hnatechnic.com/mocptest/api' //内网
class ServiceLoading {
open(loading) {
......@@ -123,7 +123,8 @@ export const http = (options) => {
}, 500)
reject(res)
} else {
uni.$mocpMessage.error(res.data.path + '接口错误')
const path = res.data.path || options.url.replace(baseURL, '')
uni.$mocpMessage.error(path + '接口错误')
reject(res)
}
},
......
......@@ -716,6 +716,48 @@
"style": {
"navigationBarTitleText": "同类事件详情"
}
},
{
"path": "pages/modules/mocp/panel/windDamageManagement/list",
"style": {
"navigationBarTitleText": "防风害管理"
}
},
{
"path": "pages/modules/mocp/panel/windDamageManagement/search",
"style": {
"navigationBarTitleText": "筛选"
}
},
{
"path": "pages/modules/mocp/panel/windDamageManagement/append",
"style": {
"navigationBarTitleText": "追加"
}
},
{
"path": "pages/modules/mocp/panel/windDamageManagement/patrolDetails",
"style": {
"navigationBarTitleText": "防风害巡场检查单"
}
},
{
"path": "pages/modules/mocp/panel/windDamageManagement/editBasic",
"style": {
"navigationBarTitleText": "基础信息"
}
},
{
"path": "pages/modules/mocp/panel/windDamageManagement/weather",
"style": {
"navigationBarTitleText": "气象信息"
}
},
{
"path": "pages/modules/mocp/panel/windDamageManagement/editConclusion",
"style": {
"navigationBarTitleText": "结论"
}
}
],
"globalStyle": {
......
import { loginCode, loginForm, showLoad } from './index.compositions'
import { loginCode, loginForm } from './index.compositions'
import { getGifCaptchaApi } from 'mocp/api/user'
//获取验证码
......
......@@ -52,6 +52,17 @@ export const getRecordData = (data, index) => {
}
return colorValue
}
const getHolidayDiff = (count, start) => {
return Array(count)
.fill(start)
.map(function (_, index) {
if (index === 0) return new Date(_).getTime()
return new Date(_).getTime() + dayTS * index
})
}
const dayTS = 1000 * 3600 * 24
const holidaySet = [...getHolidayDiff(3, '2023-06-22 00:00:00.000'), ...getHolidayDiff(8, '2023-09-29 00:00:00.000')]
const weekHoliday = [0, 6]
export function workDayAhead(tarTime, dayDiffer) {
let tsNow = new Date(tarTime)
tsNow.setHours(0, 0, 0, 0)
......
......@@ -280,7 +280,6 @@ import { onLoad } from '@dcloudio/uni-app'
import { getParamNameByValue } from 'mocp/hooks/use-params/useParams'
import { navigateTo } from 'mocp/utils/jump'
import useEngineeringEvaluationStore from 'mocp/store/engineeringEvaluation'
import { computed } from 'vue'
const query = defineProps(['workbenchId'])
const baseStore = useBaseStore()
......
<template>
<global-page :padding="24" title="航站不正常事件详情">
<global-page :padding="24" title="机械延误详情">
<template v-if="details">
<view class="mocp-cell">
<up-cell-group>
......
......@@ -46,7 +46,7 @@
<view class="label">
<global-icon icon="calendar"></global-icon>
<text class="txt">
{{ Day(item.dateTime).format('YYYY/MM/DD') }}
{{ item.dateTime ? Day(item.dateTime).format('YYYY/MM/DD') : '-' }}
</text>
</view>
</view>
......
......@@ -6,8 +6,6 @@
loadingMoreEnabled
auto
ref="paging"
:params="searchData"
:api="userTasksApi"
:padding="24"
:transformData="transformData"
:tabList="tabList"
......@@ -25,35 +23,17 @@
<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>
<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>
<global-button type="primary" size="large" :radius="5" @tap="handleConfirm">确认选择</global-button>
</up-col>
</up-row>
</view>
</template>
</global-page-swiper>
<global-action-sheet
v-model="showAction"
:options="followAcTagAllDispose"
@select="handleSelect"
/>
<global-action-sheet v-model="showAction" :options="followAcTagAllDispose" @select="handleSelect" />
</template>
<script setup>
......@@ -70,8 +50,8 @@ const userStore = useUserStore()
const paging = ref(null)
const showAction = ref(false)
const supportedTaskStore = useSupportedTaskStore()
const {searchData} = storeToRefs(supportedTaskStore)
const followAcTagAllDispose = followAcTagAll.map(item => {
const { searchData } = storeToRefs(supportedTaskStore)
const followAcTagAllDispose = followAcTagAll.map((item) => {
return {
label: item,
value: item
......@@ -98,24 +78,24 @@ const selectList = ref([])
const transformData = (data) => {
const test = [
{
followStatus: 1,//跟机状态
flightDate: 1,//跟机航班日期
stdChn: 1,//起飞时间
depStn: 1,//跟机航站
acOwn: 1,//航司
flightNo: 1,//航班号
ac: 1,//机号
acType: 1//机型
followStatus: 1, //跟机状态
flightDate: 1, //跟机航班日期
stdChn: 1, //起飞时间
depStn: 1, //跟机航站
acOwn: 1, //航司
flightNo: 1, //航班号
ac: 1, //机号
acType: 1 //机型
},
{
followStatus: 2,//跟机状态
flightDate: 2,//跟机航班日期
stdChn: 2,//起飞时间
depStn: 2,//跟机航站
acOwn: 2,//航司
flightNo: 2,//航班号
ac: 2,//机号
acType: 2//机型
followStatus: 2, //跟机状态
flightDate: 2, //跟机航班日期
stdChn: 2, //起飞时间
depStn: 2, //跟机航站
acOwn: 2, //航司
flightNo: 2, //航班号
ac: 2, //机号
acType: 2 //机型
}
]
console.log('@@mappedData', data.followAc)
......@@ -128,12 +108,14 @@ const handleChooseData = (data) => {
const handleSelect = async (followStatus) => {
try {
const changeStatus = await Promise.all(
selectList.value.map(item => updateFlyFollowAcApi({
id: item.id,
followStatus: followAcTagAll.indexOf(followStatus)
}))
selectList.value.map((item) =>
updateFlyFollowAcApi({
id: item.id,
followStatus: followAcTagAll.indexOf(followStatus)
})
)
)
if (changeStatus.every(a => a.code.toString() === '200')) {
if (changeStatus.every((a) => a.code.toString() === '200')) {
uni.$mocpMessage.success('修改成功')
paging.value.reload()
}
......
......@@ -30,7 +30,10 @@
<global-field label="航站:" :value="baseStore.getTerminalObject[details.terminal] || '-'"></global-field>
</view>
<view class="details-body-item">
<global-field label="日期:" :value="Day(details.dateTime).format('YYYY/MM/DD') || '-'"></global-field>
<global-field
label="日期:"
:value="details.dateTime ? Day(details.dateTime).format('YYYY/MM/DD') : '-'"
></global-field>
<global-field label="ATA章节:" :value="details.ata || '-'"></global-field>
</view>
</view>
......@@ -68,7 +71,10 @@
</view>
<view class="details-body-item border-top padding-x">
<global-field label="授权工程师:" :value="details.accredit || '-'"></global-field>
<global-field label="日期:" :value="Day(details.accreditTime).format('YYYY/MM/DD') || '-'"></global-field>
<global-field
label="日期:"
:value="details.accreditTime ? Day(details.accreditTime).format('YYYY/MM/DD') : '-'"
></global-field>
</view>
</view>
<view class="details-body-item" style="padding-top: 16rpx; margin-bottom: 0">
......
......@@ -35,7 +35,7 @@
<view class="label">
<global-icon icon="calendar"></global-icon>
<text class="txt">
{{ Day(item.dateTime).format('YYYY/MM/DD') }}
{{ item.dateTime ? Day(item.dateTime).format('YYYY/MM/DD') : '-' }}
</text>
</view>
</view>
......
<template>
<global-page :title="getTitle" showFooterBtn @handleFooterClick="handleSubmit">
<view class="mocp-form">
<up-form ref="formRef" labelPosition="left" labelWidth="auto" :model="formData" :rules="rules">
<up-form-item label="预报风速" :borderBottom="true" prop="windSpeed" required>
<up-input border="none" inputAlign="right" clearable v-model="formData.windSpeed" placeholder="请输入预报风速"></up-input>
</up-form-item>
<up-form-item label="基地值班" :borderBottom="true">
<custom-admin-picker
pickAlign="right"
clearable
v-model="formData.dutyUid"
:search-value="getDetails.patrolBasicVo?.dutyName"
></custom-admin-picker>
</up-form-item>
<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">
<custom-admin-picker
pickAlign="right"
clearable
v-model="formData.operateUid"
:search-value="getDetails.patrolBasicVo?.operateName"
></custom-admin-picker>
</up-form-item>
</up-form>
</view>
</global-page>
</template>
<script setup>
import { onLoad } from '@dcloudio/uni-app'
import { computed, reactive, ref } from 'vue'
import { savePwdCommonTaskApi } from 'mocp/api/windDamageManagement'
import { storeToRefs } from 'pinia'
import useWindDamageManagementStore from 'mocp/store/windDamageManagement'
const windDamageManagementStore = useWindDamageManagementStore()
const { details, getDetails, tabIndex } = storeToRefs(windDamageManagementStore)
const rules = reactive({
windSpeed: [
{
required: true,
message: '请输入预报风速',
trigger: ['blur', 'change']
}
]
})
const getTitle = computed(() => {
if (formData.taskType == 1) {
return '追加防风害巡场检查单'
} else if (formData.taskType == 2) {
return '追加防风害操作单'
} else if (formData.taskType == 3) {
return '追加系留操作单'
} else {
return '追加防尘暴签署单'
}
})
// 表单数据
const formData = reactive({
dutyUid: undefined,
operateUid: undefined,
taskType: 1,
acs: '',
terminal: '',
windSpeed: '',
weatherId: '',
weatherSource: undefined
})
// 页面初始化
onLoad(async () => {
await windDamageManagementStore.getAllTaskInfoByWeather()
formData.taskType = tabIndex.value + 1
formData.terminal = details.value?.terminal
formData.weatherId = details.value?.weatherId
formData.weatherSource = details.value?.weatherSource
formData.dutyUid = getDetails.value?.patrolBasicVo.dutyUid
formData.operateUid = getDetails.value?.patrolBasicVo.operateUid
formData.windSpeed = getDetails.value?.patrolBasicVo.windSpeed
})
//提交表单
const formRef = ref()
const handleSubmit = async () => {
await formRef.value?.validate()
const res = await savePwdCommonTaskApi(formData, { loading: true })
if (res.code == 200) {
uni.$mocpJump.navigateBack()
uni.$emit('windDamageManagementReload')
uni.$mocpMessage.success(res.message)
} else {
uni.$mocpMessage.error(res.message)
}
}
</script>
<style lang="scss" scoped>
.mocp-form {
background: #fff;
padding: 0 32rpx;
}
</style>
<template>
<global-popup v-model="show" background="#F7F8FA" title="接收历史" :round="32" closeable>
<up-cell-group v-if="historyList.length">
<template v-for="(item, index) in historyList" :key="index">
<up-cell :title="'接收人:' + item.name" :value="'接收时间:' + (timeStampFormat(item.time) || '-')" />
</template>
</up-cell-group>
<view class="global-empty" v-else>
<global-empty></global-empty>
</view>
</global-popup>
</template>
<script setup>
import { getPwdReceiveHistoryListApi } from 'mocp/api/windDamageManagement'
import { timeStampFormat } from 'mocp/utils/tool'
import { ref } from 'vue'
const show = ref(false)
const historyList = ref([])
const open = (params) => {
historyList.value = []
getPwdReceiveHistoryList(params)
}
const getPwdReceiveHistoryList = async (params) => {
const res = await getPwdReceiveHistoryListApi(params, { loading: true })
if (res.code == 200) {
show.value = true
historyList.value = res.data
} else {
uni.$mocpMessage.error(res.message)
}
}
defineExpose({
open
})
</script>
<style lang="scss" scoped>
.global-empty {
padding-bottom: 24rpx;
}
</style>
<template>
<global-page title="基础信息" showFooterBtn @handleFooterClick="handleSubmit">
<view class="mocp-form">
<up-form labelPosition="left" labelWidth="auto" :model="formData">
<up-form-item label="报文生成时间" :borderBottom="true" prop="generateTime">
<up-input border="none" inputAlign="right" clearable v-model="formData.generateTime" disabled disabledColor="#fff"></up-input>
</up-form-item>
<up-form-item label="预报风速" :borderBottom="true" prop="windSpeed" required>
<up-input border="none" inputAlign="right" clearable v-model="formData.windSpeed" disabled disabledColor="#fff"></up-input>
</up-form-item>
<up-form-item label="预计开始时间" :borderBottom="true" prop="startTime">
<up-input border="none" inputAlign="right" clearable v-model="formData.startTime" disabled disabledColor="#fff"></up-input>
</up-form-item>
<up-form-item label="基地值班" :borderBottom="true">
<custom-admin-picker
pickAlign="right"
clearable
v-model="formData.dutyUid"
:searchValue="getDetails.patrolBasicVo.dutyName"
></custom-admin-picker>
</up-form-item>
<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">
<custom-admin-picker
pickAlign="right"
clearable
v-model="formData.operateUid"
:searchValue="getDetails.patrolBasicVo.operateName"
></custom-admin-picker>
</up-form-item>
</up-form>
</view>
</global-page>
</template>
<script setup>
import { onLoad } from '@dcloudio/uni-app'
import { reactive } from 'vue'
import { savePwdBasicApi } from 'mocp/api/windDamageManagement'
import { storeToRefs } from 'pinia'
import useWindDamageManagementStore from 'mocp/store/windDamageManagement'
const windDamageManagementStore = useWindDamageManagementStore()
const { getDetails, tabIndex, details } = storeToRefs(windDamageManagementStore)
// 表单数据
const formData = reactive({
generateTime: '',
terminal: '',
startTime: '',
dutyUid: '',
id: '',
operateUid: '',
type: 1,
windSpeed: ''
})
// 页面初始化
onLoad(() => {
formData.generateTime = details.value.generateTime
formData.terminal = details.value.terminal
formData.startTime = details.value.startTime
formData.dutyUid = getDetails.value.patrolBasicVo.dutyUid
formData.id = getDetails.value.patrolBasicVo.id
formData.operateUid = getDetails.value.patrolBasicVo.operateUid
formData.type = tabIndex.value + 1
formData.windSpeed = getDetails.value.patrolBasicVo.windSpeed
})
//提交表单
const handleSubmit = async () => {
const res = await savePwdBasicApi(formData, { loading: true })
if (res.code == 200) {
uni.$mocpJump.navigateBack()
uni.$mocpMessage.success(res.message)
windDamageManagementStore.getAllTaskInfoByWeather()
uni.$emit('windDamageManagementReload')
} else {
uni.$mocpMessage.error(res.message)
}
}
</script>
<style lang="scss" scoped>
.mocp-form {
background: #fff;
padding: 0 32rpx;
}
</style>
<template>
<global-page title="结论" showFooterBtn @handleFooterClick="handleSubmit">
<view class="mocp-form">
<up-cell-group>
<up-cell title="是否有异常">
<template #value>
<view>
<global-radio radioAlign="right" v-model="formData.isAbnormal" clearable dictkey="wdm_isAbnormal"></global-radio>
</view>
</template>
</up-cell>
<up-cell>
<template #label>
<up-textarea placeholder="请输入" v-model="formData.content" :height="40" border="none"></up-textarea>
</template>
</up-cell>
<up-cell title="附件">
<template #label>
<view style="margin-top: 16rpx">
<global-upload v-model="formData.files" :file-list="getDetails.patrolConclusionVo?.files"></global-upload>
</view>
</template>
</up-cell>
</up-cell-group>
</view>
</global-page>
</template>
<script setup>
import { onLoad } from '@dcloudio/uni-app'
import { reactive } from 'vue'
import { savePwdConclusionApi } from 'mocp/api/windDamageManagement'
import { storeToRefs } from 'pinia'
import useWindDamageManagementStore from 'mocp/store/windDamageManagement'
const windDamageManagementStore = useWindDamageManagementStore()
const { getDetails } = storeToRefs(windDamageManagementStore)
// 表单数据
const formData = reactive({
basicId: '',
content: '',
files: '',
id: '',
isAbnormal: undefined,
type: undefined
})
// 页面初始化
onLoad(() => {
Object.assign(formData, getDetails.value?.patrolConclusionVo)
})
//提交表单
const handleSubmit = async () => {
const res = await savePwdConclusionApi(formData, { loading: true })
if (res.code == 200) {
uni.$mocpJump.navigateBack()
uni.$mocpMessage.success(res.message)
windDamageManagementStore.getAllTaskInfoByWeather()
uni.$emit('windDamageManagementReload')
} else {
uni.$mocpMessage.error(res.message)
}
}
</script>
<style lang="scss" scoped>
.mocp-form {
background: #fff;
padding: 0 32rpx;
}
</style>
<template>
<global-page-swiper
title="防风害管理"
isDataList
refresherEnabled
loadingMoreEnabled
auto
ref="paging"
:params="getSearchData"
:padding="24"
:tabList="tabList"
tabsWidth="24%"
@handleTabsChange="handleTabsChange"
alone
showNavRight
navRightIcon="saixuan-01"
navRightType="icon"
@handleRightClick="navigateTo('/panel/windDamageManagement/search')"
>
<template #="{ item }">
<template v-for="option in item.basicInfoList" :key="option.id">
<view
class="item"
@tap="goDetails(item, option.id)"
v-if="(getSearchData.rxStatus && getSearchData.rxStatus == option.rxStatus) || getSearchData.rxStatus == ''"
>
<view class="item-title">
<view class="left">
<custom-state :value="useGetDictByValue('wdm_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.terminal">{{ item.terminal }}</text>
<global-tag :type="useGetDictByValue('wdm_rxStatusType', option.rxStatus)" style="margin-left: 12rpx">
{{ useGetDictByValue('wdm_rxStatus', option.rxStatus) }}
</global-tag>
</view>
</view>
<view class="item-content u-line-3">
{{ option.windSpeed || '无' }}
</view>
<view class="item-footer">
<view class="label">
<global-icon icon="calendar"></global-icon>
<text class="txt">
{{ timeStampFormat(option.proposedTime) }}
</text>
</view>
<view class="label u-line-1">
<global-icon icon="idcard"></global-icon>
<text class="txt">{{ tabIndex > 0 ? '操作人' : '巡场人员' }}:{{ option.name || '-' }}</text>
</view>
</view>
<view class="item-extra">
<view style="width: 120rpx">
<global-button type="primary" @tap.stop="goAppend(item, option.id)" v-if="item.isOpen == '1' && option.rxStatus == 2">
追加
</global-button>
</view>
<view class="mocp-color-danger-6" style="display: flex" v-if="option.isAbnormal == '1'">
<up-icon name="info-circle" color="#f53f3f"></up-icon>
<text style="margin-left: 4rpx">疑似异常,请关注</text>
</view>
</view>
</view>
</template>
</template>
</global-page-swiper>
</template>
<script setup>
import { ref } from 'vue'
import { storeToRefs } from 'pinia'
import { getPwdMooringListApi, getPwdOperateListApi, getPwdPatrolListApi, getPwdSandstormListApi } from 'mocp/api/windDamageManagement'
import useWindDamageManagementStore from 'mocp/store/windDamageManagement'
import { onUnload } from '@dcloudio/uni-app'
import { timeStampFormat } from 'mocp/utils/tool'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import { navigateTo } from 'mocp/utils/jump'
const windDamageManagementStore = useWindDamageManagementStore()
const { getSearchData, tabIndex } = storeToRefs(windDamageManagementStore)
const tabList = [
{
name: '巡场检查单',
api: getPwdPatrolListApi
},
{
name: '操作单',
api: getPwdOperateListApi
},
{
name: '系留单',
api: getPwdMooringListApi
},
{
name: '防沙尘暴签署单',
api: getPwdSandstormListApi
}
]
const handleTabsChange = (value) => {
windDamageManagementStore.setState('tabIndex', value)
}
const goDetails = (data, basicId) => {
let url = ''
if (tabIndex.value == 0) {
url = '/panel/windDamageManagement/patrolDetails'
}
windDamageManagementStore.setState('basicId', basicId)
windDamageManagementStore.setState('weatherId', data.id)
windDamageManagementStore.setState('weatherSource', data.weatherSource)
uni.$mocpJump.navigateTo(url)
}
//追击
const goAppend = (data, basicId) => {
windDamageManagementStore.setState('basicId', basicId)
windDamageManagementStore.setState('weatherId', data.id)
windDamageManagementStore.setState('weatherSource', data.weatherSource)
uni.$mocpJump.navigateTo('/panel/windDamageManagement/append')
}
//刷新
const paging = ref()
uni.$on('windDamageManagementReload', () => {
paging.value?.reload()
})
onUnload(() => {
uni.$off('windDamageManagementReload')
})
</script>
<style lang="scss" scoped>
@import 'mocpStatic/css/list.scss';
.item-extra {
margin-top: 12rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
</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="wdm_isOpen"></global-picker>
</up-form-item>
<up-form-item label="进度" prop="rxStatus" :borderBottom="true">
<global-picker v-model="formData.rxStatus" pickAlign="right" clearable dictkey="wdm_rxStatus"></global-picker>
</up-form-item>
<up-form-item label="航站" prop="terminal" :borderBottom="true">
<global-picker
pickAlign="right"
v-model="formData.terminal"
clearable
:options="baseStore.getTerminalSelect"
filter
></global-picker>
</up-form-item>
<up-form-item label="开始日期" :borderBottom="true">
<global-calendar
pickAlign="right"
v-model:startTime="formData.proposedTimeBegin"
v-model:endTime="formData.proposedTimeEnd"
clearable
></global-calendar>
</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 useWindDamageManagementStore from 'mocp/store/windDamageManagement'
//获取下拉框选项
const baseStore = useBaseStore()
const windDamageManagementStore = useWindDamageManagementStore()
//获取查询表单数据
const { getSearchData } = storeToRefs(windDamageManagementStore)
const formData = ref(cloneDeep(getSearchData.value))
const handleReset = () => {
windDamageManagementStore.resetForm()
uni.$mocpJump.navigateBack()
uni.$emit('windDamageManagementReload')
}
const handleConfirm = () => {
windDamageManagementStore.setSearchData(formData.value)
uni.$mocpJump.navigateBack()
uni.$emit('windDamageManagementReload')
}
</script>
<style lang="scss" scoped>
.search-form {
padding: 24rpx 24rpx 0 24rpx;
background: #fff;
}
.footer-btn {
padding: 24rpx 32rpx;
background-color: #fff;
}
</style>
<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>
</template>
<script setup>
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'
})
</script>
<style lang="scss" scoped>
.mocp-cell {
background: #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