Commit 438127eb by liujinbo

我的跟机

parent f7f3e704
......@@ -8,3 +8,19 @@ export const userTasksApi = (data, config) => {
config
})
}
export const updateFlyFollowAcApi = (data, config) => {
return http({
method: 'POST',
url: '/flighting/updateFlyFollowAc',
data,
config
})
}
export const getMoveListApi = (data, config) => {
return http({
method: 'POST',
url: '/workbench/getMoveList',
data,
config
})
}
......@@ -68,9 +68,10 @@
:transformData="transformData"
>
<template #="{ dataList }">
<up-checkbox-group v-model="chooseValue" v-if="chooseDataType == 'checkbox'">
<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'">
<up-checkbox :name="index" v-if="chooseDataType == 'checkbox'" class="f-flex-1">
<template #label>
<slot :item="item" :index="index"></slot>
</template>
......@@ -376,4 +377,12 @@ defineExpose({
.swiper {
height: 100%;
}
.checkbox-group {
display: block;
}
.f-flex-1 {
flex: 1;
}
</style>
......@@ -80,8 +80,8 @@ const useFlightSupportStore = defineStore('flightSupport', {
}
},
// 配置持久化
// persist: false
persist: {
persist: false
/*persist: {
// 调整为兼容多端的API
storage: {
setItem (key, value) {
......@@ -91,7 +91,7 @@ const useFlightSupportStore = defineStore('flightSupport', {
return uni.getStorageSync(key)
}
}
}
}*/
})
export default useFlightSupportStore
......@@ -4,15 +4,14 @@ import useUserStore from 'mocp/store/user'
const useInforDisclosureStore = defineStore('supportedTask', {
state: () => {
return {
searchData: {},
details: undefined
searchData: {}
}
},
getters: {},
actions: {
resetForm () {
const userStore = useUserStore()
this.searchData.realUserId = userStore.userInfo.id
this.searchData.userId = userStore.userInfo.id
},
setState (...args) {
this.$patch({[args[0]]: args[1]})
......
......@@ -25,8 +25,8 @@ export const listTab = ref([
export const listScreen = [
{name: '进港', value: 0},
{name: '出港', value: 1},
{name: '无航班', value: 2}
{name: '出港', value: 1}
// {name: '无航班', value: 2}
]
export const followAcTagAll = [
......
......@@ -2,6 +2,18 @@
<global-page title="筛选">
<view class="screen-form">
<up-form labelPosition="left" labelWidth="auto">
<up-form-item label="机号" prop="ac" :borderBottom="true">
<global-picker v-model="formData.ac" pickAlign="right" clearable :options="deviceNumList" filter />
</up-form-item>
<up-form-item label="机型" prop="acType" :borderBottom="true">
<global-picker
v-model="formData.acType"
pickAlign="right"
:options="baseStore.getTypeSelect"
clearable filter />
</up-form-item>
<up-form-item label="航站" prop="terminal" :borderBottom="true">
<global-picker
pickAlign="right"
......@@ -12,19 +24,21 @@
/>
</up-form-item>
<up-form-item label="机型" prop="acType" :borderBottom="true">
<up-form-item label="航司" prop="acOwn" :borderBottom="true">
<global-picker
v-model="formData.acType"
v-model="formData.acOwn"
pickAlign="right"
:options="baseStore.getTypeSelect"
clearable filter />
:options="baseStore.getAirlineSelect"
clearable
filter
/>
</up-form-item>
<up-form-item label="航司" prop="acOwn" :borderBottom="true">
<up-form-item label="航班号" prop="flightNo" :borderBottom="true">
<global-picker
v-model="formData.acOwn"
v-model="formData.flightNo"
pickAlign="right"
:options="baseStore.getAirlineSelect"
:options="baseStore.selectList.flightNumList"
clearable
filter
/>
......@@ -35,7 +49,8 @@
<view class="footer-btn">
<up-row gutter="10">
<up-col span="6">
<global-button type="light" 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>
......@@ -56,6 +71,9 @@ import { onUnload } from '@dcloudio/uni-app'
//获取下拉框选项
const baseStore = useBaseStore()
const {
selectList: {deviceNumList}
} = useBaseStore()
const flightSupportStore = useFlightSupportStore()
//获取查询表单数据
......
......@@ -65,6 +65,9 @@
border-bottom: 1px solid rgba(231, 231, 231, 1);
.topTabItem {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
}
}
......@@ -73,7 +76,7 @@
padding: 0.5rem 0.75rem;
.listScreenRT {
width: 262rpx;
width: 172rpx;
::v-deep .u-subsection__item {
border: none !important;
......
......@@ -26,6 +26,9 @@
<view class="flex listTopTab text-center">
<view v-for="item of getSelectedList" :key="item.id" class="topTabItem" :style="{ flex: item.flex }">
{{ item.label }}
<!--<up-icon
v-if="item.keyValue == 'time' || item.keyValue == 'staChn'" name="photo" color="#2979ff"
size="12"></up-icon>-->
</view>
</view>
</template>
......@@ -101,7 +104,6 @@ const toCustom = () => {
const subsectionChange = (e) => {
if (searchData.value.isOut == e) return
searchData.value.isOut = e
currentInBoundModeForFlightTablePage.value = e
const ind = listTab.value.findIndex((item) => item.label == '出发地' || item.label == '目的地')
const isCurrentIn = currentInBoundModeForFlightTablePage.value == allInBoundMode.In
......@@ -109,6 +111,7 @@ const subsectionChange = (e) => {
listTab.value[ind].label = isCurrentIn ? '出发地' : '目的地'
}
paging.value.reload()
searchData.value.isOut = e
}
uni.$on('screenReload', () => {
......
<template>
<view
class="item"
>
<view class="item-title">
<view class="left">
<custom-state :value="item.status?.toUpperCase()" />
<view class="supportedTaskItem f-flex-1">
<view class="itemFlex itemTop">
<view class="txt f-flex-2 text-left">{{ followAcTagAll[item.followStatus] }}</view>
<view class="txt f-flex-3 text-center">
{{ timeStampFormat(item.flightDate, {format: 'YYYY-MM-DD'}) || '-' }}
</view>
<view class="right inforDisTags">
<global-tag
v-for="tagItem of item.tags"
:key="tagItem.text"
:type="tagItem.type" class="txt">
{{ tagItem.text }}
</global-tag>
<view class="txt f-flex-2 text-center">
{{ timeStampFormat(item.stdChn, {format: 'HH:mm'}) || '-' }}
</view>
<view class="txt f-flex-3 text-right">航站:{{ item.depStn }}</view>
</view>
<view class="item-content u-line-3">
<view class="inforDis">
<text v-if="item.machineNumber">机号:{{ item.machineNumber }}</text>
<text v-if="item.ATA">ATA:{{ item.ata }}</text>
</view>
<text>{{ item.faultDescription || '无' }}</text>
</view>
<view class="item-footer inforDisFooter">
<view class="label">
<global-icon icon="calendar" />
<text class="txt">
{{ item.time }}
</text>
</view>
<view class="label right">
<global-icon icon="idcard" />
<text class="txt">
值班人员:{{ item.filledBy }}
</text>
</view>
<view class="itemFlex itemBom">
<view class="txt f-flex-2">{{ item.acOwn }}</view>
<view class="txt f-flex-3 text-center">{{ item.flightNo }}</view>
<view class="txt f-flex-2 text-center">{{ item.ac }}</view>
<view class="txt f-flex-3 text-right">{{ item.acType }}</view>
</view>
</view>
</template>
<script setup>
import { ref } from 'vue'
import { timeStampFormat } from 'mocp/utils/tool'
import { followAcTagAll } from 'mocp/utils/getFlightList'
const ps = defineProps({
item: {
......@@ -50,7 +35,8 @@ const ps = defineProps({
})
const {item} = ps
</script>
<style lang="scss" scoped>
@import 'mocpStatic/css/list.scss';
@import '../constants/supportedTask.scss';
</style>
.f-flex-1 {
flex: 1;
}
.f-flex-2 {
flex: 2;
}
.f-flex-3 {
flex: 3;
}
.text-left {
text-align: left;
}
.text-center {
text-align: center;
}
.text-right {
text-align: right;
}
.footer-btn {
padding: 24rpx 32rpx;
background-color: #fff;
}
.supportedTaskItem {
background-color: #fff;
padding: 32rpx;
margin: 10rpx 0 10rpx 32rpx;
border-radius: 10rpx;
font-size: 12px;
.itemFlex {
display: flex;
align-items: center;
justify-content: space-around;
.txt {
//flex: 1;
}
}
.itemBom {
margin-top: 18rpx;
.txt {
border-right: 1px $mocp-fill-3 solid;
&:last-child {
border-right: none;
}
}
}
}
\ No newline at end of file
......@@ -17,22 +17,63 @@
@handleChooseData="handleChooseData"
>
<template #="{ item }">
<supportedTaskItem :item="itemMsg" />
<supportedTaskItem :item="item" />
</template>
<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-swiper>
<global-action-sheet
v-model="showAction"
:options="followAcTagAllDispose"
@select="handleSelect"
/>
</template>
<script setup>
import { ref } from 'vue'
import useSupportedTaskStore from 'mocp/store/supportedTask'
import { storeToRefs } from 'pinia'
import { userTasksApi } from 'mocp/api/supportedTask'
import { userTasksApi, updateFlyFollowAcApi, getMoveList } from 'mocp/api/supportedTask'
import supportedTaskItem from './components/supportedTaskItem.vue'
import { followAcTagAll } from 'mocp/utils/getFlightList'
import { orderBy } from 'lodash'
//跳转
const paging = ref(null)
const showAction = ref(false)
const supportedTaskStore = useSupportedTaskStore()
const {searchData} = storeToRefs(supportedTaskStore)
const followAcTagAllDispose = followAcTagAll.map(item => {
return {
label: item,
value: item
}
})
const tabList = [
{
name: '今日及次日后跟机任务',
......@@ -43,25 +84,63 @@ const tabList = [
value: 2
}
]
const selectList = ref([])
const transformData = (data) => {
console.log('@@mappedData', data)
return [
const test = [
{
followStatus: 1,//跟机状态
aaa: 1,//跟机航班日期
bbb: 1,//起飞时间
ccc: 1,//跟机航站
ddd: 1,//航司
eee: 1,//航班号
fff: 1,//飞机号
ggg: 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//机型
}
]
}
console.log('@@mappedData', data.followAc)
return orderBy(data.followAc, 'stdChn')
}
const handleChooseData = (data) => {
console.log('@@', data)
selectList.value = data
}
const handleSelect = async (followStatus) => {
console.log('选中的状态***', followStatus, selectList.value)
try {
const changeStatus = await Promise.all(
selectList.value.map(item => updateFlyFollowAcApi({
id: item.id,
followStatus
}))
)
if (changeStatus.every(a => a.data.code.toString() === '200')) {
uni.$mocpMessage.success('修改成功')
paging.value.reload()
}
} catch (e) {
console.log('遍历修改状态错误')
}
}
const handleReset = () => {
paging.value.updateCache()
}
const handleConfirm = () => {
if (!selectList.value?.length) return uni.$mocpMessage.error('请至少勾选一条数据')
showAction.value = true
}
</script>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
@import './constants/supportedTask.scss';
</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