Commit cdf74bc6 by pangchong

feat: 防风害操作单

parent 67f56ff8
......@@ -88,3 +88,11 @@ export const savePatrolWorkApi = (data, config) => {
config
})
}
export const saveOperateWorkApi = (data, config) => {
return post({
method: 'POST',
url: '/terminal/saveOperateWork',
data,
config
})
}
......@@ -48,19 +48,41 @@ const useWindDamageManagementStore = defineStore('windDamageManagement303030', {
getDetails(state) {
if (state.tabIndex == 0) {
return state.details?.patrolList.find((item) => item.patrolBasicVo.id == String(state.basicId)) || {}
} else if (state.tabIndex == 1) {
return state.details?.operateList.find((item) => item.operateBasicVo.id == String(state.basicId)) || {}
}
return {}
},
getBasicVo(state) {
if (state.tabIndex == 0) {
return this.getDetails.patrolBasicVo || {}
} else if (state.tabIndex == 1) {
return this.getDetails?.operateBasicVo || {}
}
return {}
},
getConclusionVo(state) {
if (state.tabIndex == 0) {
return this.getDetails.patrolConclusionVo || {}
} else if (state.tabIndex == 1) {
return this.getDetails.operateConclusionVo || {}
}
return {}
},
getWorkVo(state) {
if (state.tabIndex == 0) {
return this.getDetails.patrolWorkVo || {}
} else if (state.tabIndex == 1) {
return this.getDetails.operateWorkVo || {}
}
return {}
}
},
actions: {
async getAllTaskInfoByWeather(weatherId, weatherSource) {
const res = await getAllTaskInfoByWeatherApi(
{ weatherId: weatherId || this.weatherId, weatherSource: weatherSource || this.weatherSource },
{ loading: true }
)
async getAllTaskInfoByWeather() {
const res = await getAllTaskInfoByWeatherApi({ weatherId: this.weatherId, weatherSource: this.weatherSource }, { loading: true })
if (res.code == 200) {
if (this.tabIndex == 0) {
this.details = res.data
}
this.details = res.data
} else {
uni.$mocpMessage.error(res.message)
}
......@@ -82,6 +104,6 @@ const useWindDamageManagementStore = defineStore('windDamageManagement303030', {
}
},
// 配置持久化
persist: false
persist: true
})
export default useWindDamageManagementStore
......@@ -736,12 +736,6 @@
}
},
{
"path": "pages/modules/mocp/panel/windDamageManagement/patrolDetails",
"style": {
"navigationBarTitleText": "防风害巡场检查单"
}
},
{
"path": "pages/modules/mocp/panel/windDamageManagement/editBasic",
"style": {
"navigationBarTitleText": "基础信息"
......@@ -758,6 +752,18 @@
"style": {
"navigationBarTitleText": "结论"
}
},
{
"path": "pages/modules/mocp/panel/windDamageManagement/patrolDetails",
"style": {
"navigationBarTitleText": "防风害巡场检查单"
}
},
{
"path": "pages/modules/mocp/panel/windDamageManagement/operateDetails",
"style": {
"navigationBarTitleText": "防风害操作单"
}
}
],
"globalStyle": {
......
......@@ -10,18 +10,21 @@
pickAlign="right"
clearable
v-model="formData.dutyUid"
:search-value="getDetails.patrolBasicVo?.dutyName"
:search-value="getBasicVo.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">
<up-form-item label="机号" :borderBottom="true" prop="acs" required v-if="tabIndex > 0">
<global-picker pickAlign="right" v-model="formData.acs" :options="deviceNumList" clearable filter></global-picker>
</up-form-item>
<up-form-item :label="tabIndex == 0 ? '巡场人员' : '操作人'" :borderBottom="true">
<custom-admin-picker
pickAlign="right"
clearable
v-model="formData.operateUid"
:search-value="getDetails.patrolBasicVo?.operateName"
:search-value="getBasicVo.operateName"
></custom-admin-picker>
</up-form-item>
</up-form>
......@@ -35,9 +38,13 @@ import { computed, reactive, ref } from 'vue'
import { savePwdCommonTaskApi } from 'mocp/api/windDamageManagement'
import { storeToRefs } from 'pinia'
import useWindDamageManagementStore from 'mocp/store/windDamageManagement'
import useBaseStore from 'mocp/store/base'
const {
selectList: { deviceNumList }
} = useBaseStore()
const windDamageManagementStore = useWindDamageManagementStore()
const { details, getDetails, tabIndex } = storeToRefs(windDamageManagementStore)
const { details, getBasicVo, tabIndex } = storeToRefs(windDamageManagementStore)
const rules = reactive({
windSpeed: [
{
......@@ -45,6 +52,13 @@ const rules = reactive({
message: '请输入预报风速',
trigger: ['blur', 'change']
}
],
acs: [
{
required: true,
message: '请选择机号',
trigger: ['blur', 'change']
}
]
})
const getTitle = computed(() => {
......@@ -76,9 +90,9 @@ onLoad(async () => {
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
formData.dutyUid = getBasicVo.value.dutyUid
formData.operateUid = getBasicVo.value.operateUid
formData.windSpeed = getBasicVo.value.windSpeed
})
//提交表单
const formRef = ref()
......
......@@ -16,18 +16,21 @@
pickAlign="right"
clearable
v-model="formData.dutyUid"
:searchValue="getDetails.patrolBasicVo.dutyName"
:searchValue="getBasicVo.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">
<up-form-item label="机号" :borderBottom="true" prop="ac" required>
<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">
<custom-admin-picker
pickAlign="right"
clearable
v-model="formData.operateUid"
:searchValue="getDetails.patrolBasicVo.operateName"
:searchValue="getBasicVo.operateName"
></custom-admin-picker>
</up-form-item>
</up-form>
......@@ -43,11 +46,12 @@ import { storeToRefs } from 'pinia'
import useWindDamageManagementStore from 'mocp/store/windDamageManagement'
const windDamageManagementStore = useWindDamageManagementStore()
const { getDetails, tabIndex, details } = storeToRefs(windDamageManagementStore)
const { getBasicVo, tabIndex, details } = storeToRefs(windDamageManagementStore)
// 表单数据
const formData = reactive({
generateTime: '',
terminal: '',
ac: '',
startTime: '',
dutyUid: '',
id: '',
......@@ -59,12 +63,13 @@ const formData = reactive({
onLoad(() => {
formData.generateTime = details.value.generateTime
formData.terminal = details.value.terminal
formData.ac = getBasicVo.value.ac
formData.startTime = details.value.startTime
formData.dutyUid = getDetails.value.patrolBasicVo.dutyUid
formData.id = getDetails.value.patrolBasicVo.id
formData.operateUid = getDetails.value.patrolBasicVo.operateUid
formData.dutyUid = getBasicVo.value.dutyUid
formData.id = getBasicVo.value.id
formData.operateUid = getBasicVo.value.operateUid
formData.type = tabIndex.value + 1
formData.windSpeed = getDetails.value.patrolBasicVo.windSpeed
formData.windSpeed = getBasicVo.value.windSpeed
})
//提交表单
const handleSubmit = async () => {
......
......@@ -17,7 +17,7 @@
<up-cell title="附件">
<template #label>
<view style="margin-top: 16rpx">
<global-upload v-model="formData.files" :file-list="getDetails.patrolConclusionVo?.files"></global-upload>
<global-upload v-model="formData.files" :file-list="getConclusionVo.files"></global-upload>
</view>
</template>
</up-cell>
......@@ -34,7 +34,7 @@ import { storeToRefs } from 'pinia'
import useWindDamageManagementStore from 'mocp/store/windDamageManagement'
const windDamageManagementStore = useWindDamageManagementStore()
const { getDetails } = storeToRefs(windDamageManagementStore)
const { getConclusionVo } = storeToRefs(windDamageManagementStore)
// 表单数据
const formData = reactive({
basicId: '',
......@@ -46,7 +46,7 @@ const formData = reactive({
})
// 页面初始化
onLoad(() => {
Object.assign(formData, getDetails.value?.patrolConclusionVo)
Object.assign(formData, getConclusionVo.value)
})
//提交表单
const handleSubmit = async () => {
......
......@@ -29,15 +29,15 @@
<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 class="item-content">
<view class="row" v-if="option.ac">机号:{{ option.ac }}</view>
<view class="row" v-if="item.terminal">航站:{{ baseStore.getTerminalObject[item.terminal] }}</view>
<view class="u-line-3">{{ option.windSpeed || '无' }}</view>
</view>
<view class="item-footer">
<view class="label">
......@@ -77,39 +77,41 @@ 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'
import useBaseStore from 'mocp/store/base'
const baseStore = useBaseStore()
const windDamageManagementStore = useWindDamageManagementStore()
const { getSearchData, tabIndex } = storeToRefs(windDamageManagementStore)
const tabList = [
{
name: '巡场检查单',
api: getPwdPatrolListApi
api: getPwdPatrolListApi,
url: '/panel/windDamageManagement/patrolDetails'
},
{
name: '操作单',
api: getPwdOperateListApi
api: getPwdOperateListApi,
url: '/panel/windDamageManagement/operateDetails'
},
{
name: '系留单',
api: getPwdMooringListApi
api: getPwdMooringListApi,
url: '/panel/windDamageManagement/patrolDetails'
},
{
name: '防沙尘暴签署单',
api: getPwdSandstormListApi
api: getPwdSandstormListApi,
url: '/panel/windDamageManagement/patrolDetails'
}
]
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)
uni.$mocpJump.navigateTo(tabList[tabIndex.value].url)
}
//追击
const goAppend = (data, basicId) => {
......
......@@ -65,6 +65,9 @@
margin-left: 0;
}
}
.row {
margin-bottom: 16rpx;
}
}
&-footer {
display: flex;
......
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