Commit 6faddd2e by liujinbo

信息通报-依据详情

parent 07e8507d
...@@ -145,7 +145,7 @@ watch( ...@@ -145,7 +145,7 @@ watch(
} }
} }
}, },
{ immediate: true } {immediate: true}
) )
//点击确定按钮 //点击确定按钮
const confirm = (e) => { const confirm = (e) => {
...@@ -171,26 +171,32 @@ const clear = () => { ...@@ -171,26 +171,32 @@ const clear = () => {
<style lang="scss" scoped> <style lang="scss" scoped>
.date { .date {
flex: auto; flex: auto;
&-content { &-content {
display: flex; display: flex;
align-items: center; align-items: center;
line-height: 48rpx; line-height: 48rpx;
&.placeholder { &.placeholder {
.date-value { .date-value {
color: $mocp-text-3; color: $mocp-text-3;
} }
} }
&.disabled { &.disabled {
background: #f5f7fa; background: #f5f7fa;
} }
} }
&-value { &-value {
color: $mocp-text-4; color: $mocp-text-4;
margin-right: 8rpx; margin-right: 8rpx;
} }
&-icon { &-icon {
display: flex; display: flex;
align-items: center; align-items: center;
&-close { &-close {
margin-left: 4rpx; margin-left: 4rpx;
} }
......
...@@ -140,27 +140,26 @@ const queryList = (pageIndex, pageSize) => { ...@@ -140,27 +140,26 @@ const queryList = (pageIndex, pageSize) => {
if (ps.tabValue != null && !ps.alone) { if (ps.tabValue != null && !ps.alone) {
params[ps.tabValueField] = ps.tabValue params[ps.tabValueField] = ps.tabValue
} }
console.log(ps.api)
if (Object.prototype.toString.call(ps.api) == '[object Function]') { if (Object.prototype.toString.call(ps.api) == '[object Function]') {
ps.api(params, { loading: true }) ps.api(params, {loading: true}).then((res) => {
.then((res) => { if (res.code == 200 || res.list?.length) {
if (res.code == 200 || res.list?.length) { let data = res.list || res.data?.list || res?.data || []
let data = res.list || res.data?.list || res?.data || [] if (ps.transformData) {
if (ps.transformData) { data = ps.transformData(data) || []
data = ps.transformData(data) || [] }
} if (ps.localPaging) {
if (ps.localPaging) { paging.value?.setLocalPaging(data)
paging.value?.setLocalPaging(data)
} else {
paging.value?.complete(data)
}
} else { } else {
paging.value?.complete(false) paging.value?.complete(data)
uni.$mocpMessage.error(res.message)
} }
}) } else {
.catch(() => {
paging.value?.complete(false) paging.value?.complete(false)
}) uni.$mocpMessage.error(res.message)
}
}).catch(() => {
paging.value?.complete(false)
})
} else { } else {
paging.value?.complete(false) paging.value?.complete(false)
} }
......
...@@ -11,17 +11,20 @@ ...@@ -11,17 +11,20 @@
<!-- 自定义导航栏 --> <!-- 自定义导航栏 -->
<global-navbar :title="title" v-if="showNavbar" :bgColor="navbgColor" :color="navColor"> <global-navbar :title="title" v-if="showNavbar" :bgColor="navbgColor" :color="navColor">
<template #left v-if="pages.length > 1 && showNavLeft"> <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> <view v-if="navLeftType == 'text'" class="cancel" @tap="handleLeftClick">{{ navLeftText }}</view>
</template> </template>
<template #right v-if="showNavRight"> <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">
{{ navRightText }} {{ navRightText }}
</global-button> </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 }} {{ navRightText }}
</global-button> </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> </template>
</global-navbar> </global-navbar>
<!-- tab切换 --> <!-- tab切换 -->
...@@ -99,7 +102,7 @@ ...@@ -99,7 +102,7 @@
import { computed, nextTick, onUnmounted, ref, watch } from 'vue' import { computed, nextTick, onUnmounted, ref, watch } from 'vue'
// 获取屏幕边界到安全区域距离 // 获取屏幕边界到安全区域距离
const { safeAreaInsets } = uni.getSystemInfoSync() const {safeAreaInsets} = uni.getSystemInfoSync()
const es = defineEmits(['handleLeftClick', 'handleRightClick', 'handleFooterClick', 'handleChooseData']) const es = defineEmits(['handleLeftClick', 'handleRightClick', 'handleFooterClick', 'handleChooseData'])
const ps = defineProps({ const ps = defineProps({
background: { background: {
...@@ -336,15 +339,16 @@ const swiperAnimationfinish = (e) => { ...@@ -336,15 +339,16 @@ const swiperAnimationfinish = (e) => {
//获取查询参数 //获取查询参数
const getParams = computed(() => { const getParams = computed(() => {
if (ps.alone) { if (ps.alone) {
ps.tabList[current.value].params || {} return ps.tabList[current.value].params || {}
} else { } else {
return ps.params return ps.params
} }
}) })
//获取查询接口 //获取查询接口
const getApi = computed(() => { const getApi = computed(() => {
console.log(ps.alone, ps.tabList[current.value].api)
if (ps.alone) { if (ps.alone) {
ps.tabList[current.value].api return ps.tabList[current.value].api
} else { } else {
return ps.api return ps.api
} }
......
...@@ -14,9 +14,11 @@ ...@@ -14,9 +14,11 @@
<template v-else> <template v-else>
<image src="/static/mocp/image/common/pdf.png" mode="widthFix" /> <image src="/static/mocp/image/common/pdf.png" mode="widthFix" />
</template> </template>
<view class="u-line-1">{{ item.fileName }}</view> <view class="u-line-1">{{ item[nameField] }}</view>
</view>
<view class="tool" @tap="previewFile(item.fileUrl)">
<up-icon name="eye" size="18" color="#4E5969"></up-icon>
</view> </view>
<view class="tool" @tap="previewFile(item.fileUrl)"><up-icon name="eye" size="18" color="#4E5969"></up-icon></view>
</view> </view>
<view class="upload-item-right" @tap="deleteFile(index)" v-if="showUpload"> <view class="upload-item-right" @tap="deleteFile(index)" v-if="showUpload">
<global-icon icon="delete-01" color="#F53F3F"></global-icon> <global-icon icon="delete-01" color="#F53F3F"></global-icon>
...@@ -86,6 +88,10 @@ const ps = defineProps({ ...@@ -86,6 +88,10 @@ const ps = defineProps({
type: String, type: String,
default: 'fileExt' default: 'fileExt'
}, },
nameField: {
type: String,
default: 'fileName'
},
url: { url: {
type: String, type: String,
default: '/resource/uploadFile' default: '/resource/uploadFile'
...@@ -102,6 +108,7 @@ const ps = defineProps({ ...@@ -102,6 +108,7 @@ const ps = defineProps({
type: Boolean, type: Boolean,
default: true default: true
} }
}) })
const fileList = ref([]) const fileList = ref([])
watch( watch(
...@@ -115,15 +122,15 @@ watch( ...@@ -115,15 +122,15 @@ watch(
} }
} }
}, },
{ immediate: true } {immediate: true}
) )
const getFileList = computed(() => { const getFileList = computed(() => {
return fileList.value?.map((item) => { return fileList.value?.map((item) => {
return { ...item, url: item.fileUrl } return {...item, url: item.fileUrl}
}) })
}) })
const getOptions = computed(() => { const getOptions = computed(() => {
return httpInterceptor({ url: ps.url, name: 'file' }) return httpInterceptor({url: ps.url, name: 'file'})
}) })
// 删除文件 // 删除文件
const show = ref(false) const show = ref(false)
...@@ -145,22 +152,22 @@ const previewFile = (fileUrl) => { ...@@ -145,22 +152,22 @@ const previewFile = (fileUrl) => {
}) })
uni.downloadFile({ uni.downloadFile({
url: fileUrl, url: fileUrl,
success: function (res) { success: function(res) {
var filePath = res.tempFilePath var filePath = res.tempFilePath
uni.openDocument({ uni.openDocument({
filePath: filePath, filePath: filePath,
showMenu: true, showMenu: true,
success: function (res) { success: function(res) {
uni.hideLoading() uni.hideLoading()
console.log('打开文件成功') console.log('打开文件成功')
}, },
fail: function () { fail: function() {
uni.hideLoading() uni.hideLoading()
uni.$mocpMessage.error('打开文件失败,请重新打开') uni.$mocpMessage.error('打开文件失败,请重新打开')
} }
}) })
}, },
fail: function () { fail: function() {
uni.hideLoading() uni.hideLoading()
uni.$mocpMessage.error('打开文件失败,请重新打开') uni.$mocpMessage.error('打开文件失败,请重新打开')
} }
...@@ -197,7 +204,7 @@ watch( ...@@ -197,7 +204,7 @@ watch(
es('change', files) es('change', files)
es('getFileList', cloneDeep(value)) es('getFileList', cloneDeep(value))
}, },
{ deep: true, immediate: true } {deep: true, immediate: true}
) )
onBeforeUnmount(() => { onBeforeUnmount(() => {
uni.$emit('$upload-hide', {}) uni.$emit('$upload-hide', {})
...@@ -214,10 +221,12 @@ onBeforeUnmount(() => { ...@@ -214,10 +221,12 @@ onBeforeUnmount(() => {
width: 640rpx; width: 640rpx;
height: 88rpx; height: 88rpx;
line-height: 88rpx; line-height: 88rpx;
.txt { .txt {
color: $mocp-text-5; color: $mocp-text-5;
} }
} }
&-item { &-item {
height: 72rpx; height: 72rpx;
line-height: 72rpx; line-height: 72rpx;
...@@ -225,6 +234,7 @@ onBeforeUnmount(() => { ...@@ -225,6 +234,7 @@ onBeforeUnmount(() => {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
&-left { &-left {
width: 100%; width: 100%;
display: flex; display: flex;
...@@ -233,23 +243,27 @@ onBeforeUnmount(() => { ...@@ -233,23 +243,27 @@ onBeforeUnmount(() => {
box-sizing: border-box; box-sizing: border-box;
padding: 0 20rpx 0 24rpx; padding: 0 20rpx 0 24rpx;
border-radius: 4rpx; border-radius: 4rpx;
.label { .label {
flex: auto; flex: auto;
display: flex; display: flex;
align-items: center; align-items: center;
margin-right: 10rpx; margin-right: 10rpx;
color: $mocp-text-5; color: $mocp-text-5;
image { image {
width: 32rpx; width: 32rpx;
min-width: 32rpx; min-width: 32rpx;
margin-right: 20rpx; margin-right: 20rpx;
} }
.name { .name {
flex: auto; flex: auto;
word-break: break-all; word-break: break-all;
} }
} }
} }
&-right { &-right {
width: 46rpx; width: 46rpx;
text-align: right; text-align: right;
......
...@@ -37,6 +37,12 @@ const getStyle = computed(() => { ...@@ -37,6 +37,12 @@ const getStyle = computed(() => {
if (ps.value == '跟踪') { if (ps.value == '跟踪') {
_style.color = '#00B42A' _style.color = '#00B42A'
} }
if (ps.value == '未完成') {
_style.color = '#F53F3F'
}
if (ps.value == '保留OPEN') {
_style.color = '#0e42d2'
}
return { return {
..._style, ..._style,
fontSize: ps.size + 'rpx', fontSize: ps.size + 'rpx',
......
...@@ -4,31 +4,34 @@ const useInforDisclosureStore = defineStore('inforDisclosure', { ...@@ -4,31 +4,34 @@ const useInforDisclosureStore = defineStore('inforDisclosure', {
state: () => { state: () => {
return { return {
searchData: { searchData: {
state: 1, state: '',
machine_number: '', machine_number: '',
planeModel: '', planeModel: '',
aviation: '', aviation: '',
termin: '', termin: '',
startTime: '', startTime: '',
stopTime: '',
guarantee: '', guarantee: '',
rlease_state: '', rlease_state: '',
function_Info: '', function_Info: '',
failure_state: '', failure_state: '',
professional: '' professional: ''
}, },
details: undefined details: undefined,
releaseBasisDetails: undefined
} }
}, },
getters: {}, getters: {},
actions: { actions: {
resetForm () { resetForm () {
this.searchData = { this.searchData = {
state: 1, state: '',
machine_number: '', machine_number: '',
planeModel: '', planeModel: '',
aviation: '', aviation: '',
termin: '', termin: '',
startTime: '', startTime: '',
stopTime: '',
guarantee: '', guarantee: '',
rlease_state: '', rlease_state: '',
function_Info: '', function_Info: '',
......
...@@ -33,6 +33,18 @@ export const followAcTagAll = [ ...@@ -33,6 +33,18 @@ export const followAcTagAll = [
'未接收', '已接收', '已出发', '已到位', '已登机' '未接收', '已接收', '已出发', '已到位', '已登机'
] ]
export const mocMapper = {
'01': '高高原',
'02': '国际',
'03': '客舱',
'04': '货舱',
'05': '座椅',
'06': '系统',
'07': '载重',
'08': '航段数据',
'99': '其他'
}
export const fightListTime = ['etdChn', 'atdChn', 'etaChn', 'ataChn'] export const fightListTime = ['etdChn', 'atdChn', 'etaChn', 'ataChn']
export const fightListPlanTime = ['staChn', 'schTime'] export const fightListPlanTime = ['staChn', 'schTime']
export const finishedStatus = ['ARR', 'NDR', 'ATA'] export const finishedStatus = ['ARR', 'NDR', 'ATA']
......
...@@ -202,6 +202,12 @@ ...@@ -202,6 +202,12 @@
} }
}, },
{ {
"path": "pages/modules/mocp/panel/inforDisclosure/releaseBasisDetails",
"style": {
"navigationBarTitleText": "保留依据"
}
},
{
"path": "pages/modules/mocp/panel/inforDisclosure/addDetails", "path": "pages/modules/mocp/panel/inforDisclosure/addDetails",
"style": { "style": {
"navigationBarTitleText": "追加信息通报" "navigationBarTitleText": "追加信息通报"
......
...@@ -29,6 +29,41 @@ ...@@ -29,6 +29,41 @@
margin-top: 10rpx; margin-top: 10rpx;
color: $mocp-text-3; color: $mocp-text-3;
} }
.cell {
display: flex;
justify-content: space-between;
padding: 24rpx 26rpx;
color: $mocp-text-4;
}
}
.detailReleaseBasis {
font-size: 28rpx;
display: flex;
justify-content: space-between;
padding: 24rpx 26rpx;
border-bottom: 1px solid rgb(214, 215, 217, 0.5);
align-items: center;
.basisLf {
flex: 1;
display: flex;
align-items: flex-start;
.releaseBasis {
width: 250rpx;
color: $mocp-text-3;
}
}
.basisRt {
flex: 1;
display: flex;
justify-content: flex-end;
font-size: 28rpx;
color: $mocp-text-4;
}
} }
} }
......
...@@ -15,6 +15,34 @@ ...@@ -15,6 +15,34 @@
</view> </view>
<up-cell title="专业类别" :value="details.professionalValue || '-'" /> <up-cell title="专业类别" :value="details.professionalValue || '-'" />
<up-cell title="放行状态" :value="details.tags[3]?.text || '-'" /> <up-cell title="放行状态" :value="details.tags[3]?.text || '-'" />
<template v-if="details?.releaseBasisList?.length">
<view
v-for="item of details.releaseBasisList"
:key="item.id"
@tap="toReleaseBasisDetails(item)"
class="detailReleaseBasis"
>
<view class="basisLf">
<global-icon icon="saixuan-01" /><!--wallet-->
<view>
<view>保留依据</view>
<view class="releaseBasis u-line-1">
{{ item.releaseBasis }}
</view>
</view>
</view>
<view class="basisRt">
<view>故障状态(
<text>
<custom-state size="28" :value="failureStateVal(item.failureState)" />
</text>
)
</view>
<up-icon name="arrow-right" size="18" />
</view>
</view>
</template>
</up-cell-group> </up-cell-group>
</view> </view>
...@@ -60,16 +88,29 @@ import useInforDisclosureStore from 'mocp/store/inforDisclosure' ...@@ -60,16 +88,29 @@ import useInforDisclosureStore from 'mocp/store/inforDisclosure'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { formData } from '../support-application/constants/add.compositions' import { formData } from '../support-application/constants/add.compositions'
import StatusPopup from './components/status-popup.vue' import StatusPopup from './components/status-popup.vue'
import { ref } from 'vue' import { computed, ref } from 'vue'
import { getParamsByType } from 'mocp/hooks/use-params/useParams'
const inforDisclosure = useInforDisclosureStore() const inforDisclosureStore = useInforDisclosureStore()
const {details} = storeToRefs(inforDisclosure) const {details} = storeToRefs(inforDisclosureStore)
const statusPopupRef = ref() const statusPopupRef = ref()
const handleRightClick = () => { const handleRightClick = () => {
statusPopupRef.value?.open() statusPopupRef.value?.open()
} }
console.log(details.value) console.log(details.value)
const failureStateVal = (value) => {
// 事件状态EventStatus
const selectObj = getParamsByType('RetentionBasis').find(typeItem => typeItem.value == value)
return selectObj?.label || getParamsByType('RetentionBasis')[0].label
}
const toReleaseBasisDetails = (data) => {
uni.$mocpJump.navigateTo('/panel/inforDisclosure/releaseBasisDetails', {id: data.id}).then(() => {
inforDisclosureStore.setState('releaseBasisDetails', data)
})
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
:padding="24" :padding="24"
:transformData="transformData" :transformData="transformData"
:tabList="tabList" :tabList="tabList"
tabValueField="state" tabValueField="event_status"
tabsWidth="50%" tabsWidth="50%"
showNavRight showNavRight
navRightType="icon" navRightType="icon"
...@@ -40,11 +40,11 @@ const {searchData} = storeToRefs(inforDisclosureStore) ...@@ -40,11 +40,11 @@ const {searchData} = storeToRefs(inforDisclosureStore)
const tabList = [ const tabList = [
{ {
name: '当前通报', name: '当前通报',
value: 1 value: '1,2'
}, },
{ {
name: '历史通报', name: '历史通报',
value: 2 value: '3,4,5'
} }
] ]
...@@ -54,6 +54,8 @@ const transformData = (data) => { ...@@ -54,6 +54,8 @@ const transformData = (data) => {
const ReleaseStatuList = getParamsByType('ReleaseStatu') const ReleaseStatuList = getParamsByType('ReleaseStatu')
const FaultReportingList = getParamsByType('FaultReporting') const FaultReportingList = getParamsByType('FaultReporting')
const MajorCategoryList = getParamsByType('MajorCategory') const MajorCategoryList = getParamsByType('MajorCategory')
const EventStatusList = getParamsByType('EventStatus')
console.log('EventStatusList', EventStatusList)
data = data.reduce((q, w) => { data = data.reduce((q, w) => {
q.push(w) q.push(w)
...@@ -66,9 +68,10 @@ const transformData = (data) => { ...@@ -66,9 +68,10 @@ const transformData = (data) => {
return { return {
...item, ...item,
time: item.creationTime.replace(/-/g, '/').replace(/:\d+?$/, ''), time: item.creationTime.replace(/-/g, '/').replace(/:\d+?$/, ''),
status: item.failureState.toString() === '0' ? /*status: item.failureState.toString() === '0' ?
'open' : item.failureState.toString() === '1' ? 'open' : item.failureState.toString() === '1' ?
'close' : '作废', 'close' : '作废',*/
status: EventStatusList.find(statusItem => statusItem.value == item.eventStatus)?.label,
tags: [ tags: [
{ {
text: item.pid === '0' ? '主项' : '子项', text: item.pid === '0' ? '主项' : '子项',
......
<template>
<global-page :padding="24" title="信息通报详情">
<view class="mocp-cell">
<up-cell-group v-if="details">
<up-cell title="保留依据" :value="details?.releaseBasis || '-'" />
<view
v-if="details?.releaseEnclosure?.length"
class="detailFaultDes">
<view class="title">保留依据附件</view>
<view class="content">
<global-upload
:fileList="details.releaseEnclosure"
typeField="type"
nameField="name"
:showUpload="false" />
</view>
</view>
<up-cell v-if="details?.takeOffM" title="每次起飞前OI/M项" value="是" />
<up-cell v-if="details?.apu" title="APU限制" value="是" />
<view
v-if="details?.executeAttachment?.length"
class="detailFaultDes">
<view class="title">执行M/OI项附件</view>
<view class="content">
<global-upload
:fileList="details.executeAttachment"
typeField="type"
nameField="name"
:showUpload="false" />
</view>
</view>
<view
v-if="details?.flightRestrict == 1"
class="detailFaultDes">
<view class="title">航班限制</view>
<view v-if="details?.seatRestriction" class="cell">
<text>座椅限制</text>
<text>{{ details.seatRestriction }}</text>
</view>
<view v-if="details?.seatDisable" class="cell">
<text>座椅禁用</text>
<text>{{ details.seatDisable }}</text>
</view>
<view v-if="details?.runRestrictValue" class="cell">
<text>运行限制</text>
<text>{{ details.runRestrictValue }}</text>
</view>
</view>
<up-cell title="保留类型:" :value="details.retentionTypeValue" />
</up-cell-group>
</view>
</global-page>
</template>
<script setup>
import { ref, toRefs, watch } from 'vue'
import useInforDisclosureStore from 'mocp/store/inforDisclosure'
import { storeToRefs } from 'pinia'
import { cloneDeep } from 'lodash'
import { mocMapper } from 'mocp/utils/getFlightList'
import { getParamsByType } from 'mocp/hooks/use-params/useParams'
const inforDisclosure = useInforDisclosureStore()
const {releaseBasisDetails} = storeToRefs(inforDisclosure)
const details = ref()
watch(
releaseBasisDetails,
(value) => {
if (value) {
const msg = cloneDeep(value)
console.log(msg)
const retentionTypeList = getParamsByType('RetentionType')
if (msg.executeAttachment) msg.executeAttachment = JSON.parse(msg.executeAttachment)
if (msg.releaseEnclosure) msg.releaseEnclosure = JSON.parse(msg.releaseEnclosure)
if (msg?.runRestrict?.length > 1) {
msg.runRestrictValue = msg.runRestrict?.split(',')?.map(item => {
return mocMapper[item]
})?.join(',')
}
if (msg?.retentionType) {
const retentionTypeValue = retentionTypeList.find(item => item.value == msg?.retentionType)
msg.retentionTypeValue = retentionTypeValue?.label || '-'
console.log(msg.retentionType, retentionTypeList)
}
details.value = msg
// RetentionType
console.log('details', details.value)
}
},
{immediate: true}
)
</script>
<style lang="scss" scoped>
@import '../work-assignment/constants/details.scss';
@import './constants/inforDisclosure.scss';
</style>
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</up-form-item> </up-form-item>
<up-form-item <up-form-item
label="填报日期" label="填报日期(开始)"
prop="startTime" prop="startTime"
:borderBottom="true"> :borderBottom="true">
<global-date <global-date
...@@ -63,6 +63,17 @@ ...@@ -63,6 +63,17 @@
clearable clearable
/> />
</up-form-item> </up-form-item>
<up-form-item
label="填报日期(结束)"
prop="stopTime"
:borderBottom="true">
<global-date
v-model="formData.stopTime"
pickAlign="right"
clearable
:timestamp="false"
/>
</up-form-item>
<up-form-item label="保障阶段" prop="guarantee" :borderBottom="true"> <up-form-item label="保障阶段" prop="guarantee" :borderBottom="true">
<global-picker <global-picker
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
tabsWidth="50%" tabsWidth="50%"
chooseDataType="checkbox" chooseDataType="checkbox"
@handleChooseData="handleChooseData" @handleChooseData="handleChooseData"
alone
> >
<template #="{ item }"> <template #="{ item }">
<supportedTaskItem :item="item" /> <supportedTaskItem :item="item" />
...@@ -59,11 +60,13 @@ ...@@ -59,11 +60,13 @@
import { ref } from 'vue' import { ref } from 'vue'
import useSupportedTaskStore from 'mocp/store/supportedTask' import useSupportedTaskStore from 'mocp/store/supportedTask'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { userTasksApi, updateFlyFollowAcApi, getMoveList } from 'mocp/api/supportedTask' import { userTasksApi, updateFlyFollowAcApi, getMoveListApi } from 'mocp/api/supportedTask'
import supportedTaskItem from './components/supportedTaskItem.vue' import supportedTaskItem from './components/supportedTaskItem.vue'
import { followAcTagAll } from 'mocp/utils/getFlightList' import { followAcTagAll } from 'mocp/utils/getFlightList'
import { orderBy } from 'lodash' import { orderBy } from 'lodash'
import useUserStore from 'mocp/store/user'
const userStore = useUserStore()
const paging = ref(null) const paging = ref(null)
const showAction = ref(false) const showAction = ref(false)
const supportedTaskStore = useSupportedTaskStore() const supportedTaskStore = useSupportedTaskStore()
...@@ -77,11 +80,17 @@ const followAcTagAllDispose = followAcTagAll.map(item => { ...@@ -77,11 +80,17 @@ const followAcTagAllDispose = followAcTagAll.map(item => {
const tabList = [ const tabList = [
{ {
name: '今日及次日后跟机任务', name: '今日及次日后跟机任务',
value: 1 value: 1,
params: {},
api: userTasksApi
}, },
{ {
name: '历史跟机任务', name: '历史跟机任务',
value: 2 value: 2,
params: {
userId: userStore.userInfo?.id
},
api: getMoveListApi
} }
] ]
const selectList = ref([]) const selectList = ref([])
...@@ -117,20 +126,19 @@ const handleChooseData = (data) => { ...@@ -117,20 +126,19 @@ const handleChooseData = (data) => {
selectList.value = data selectList.value = data
} }
const handleSelect = async (followStatus) => { const handleSelect = async (followStatus) => {
console.log('选中的状态***', followStatus, selectList.value)
try { try {
const changeStatus = await Promise.all( const changeStatus = await Promise.all(
selectList.value.map(item => updateFlyFollowAcApi({ selectList.value.map(item => updateFlyFollowAcApi({
id: item.id, id: item.id,
followStatus followStatus: followAcTagAll.indexOf(followStatus)
})) }))
) )
if (changeStatus.every(a => a.data.code.toString() === '200')) { if (changeStatus.every(a => a.code.toString() === '200')) {
uni.$mocpMessage.success('修改成功') uni.$mocpMessage.success('修改成功')
paging.value.reload() paging.value.reload()
} }
} catch (e) { } catch (e) {
console.log('遍历修改状态错误') console.log('遍历修改状态错误', e)
} }
} }
const handleReset = () => { const handleReset = () => {
......
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