Commit 3e934781 by liujinbo

Merge branch 'refs/heads/master' into master_ljb

# Conflicts:
#	package-lock.json
#	package.json
#	src/mocp/hooks/use-dict/dict-data/index.js
#	src/mocp/store/base.js
#	src/mocp/store/user.js
parents b3b28341 fbdb0587
...@@ -21,3 +21,4 @@ dist ...@@ -21,3 +21,4 @@ dist
*.sw? *.sw?
pnpm-lock.yaml pnpm-lock.yaml
pnpm-lock.yaml pnpm-lock.yaml
pnpm-lock.yaml
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -58,8 +58,7 @@ ...@@ -58,8 +58,7 @@
"clipboard": "^2.0.11", "clipboard": "^2.0.11",
"dayjs": "^1.11.11", "dayjs": "^1.11.11",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"pina": "^0.20.2204228", "pinia": "^2.0.36",
"pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.1", "pinia-plugin-persistedstate": "^3.2.1",
"uview-plus": "^3.2.22", "uview-plus": "^3.2.22",
"vue": "^3.4.21", "vue": "^3.4.21",
......
...@@ -62,9 +62,9 @@ importers: ...@@ -62,9 +62,9 @@ importers:
lodash: lodash:
specifier: ^4.17.21 specifier: ^4.17.21
version: 4.17.21 version: 4.17.21
pina: pinia:
specifier: ^0.20.2204228 specifier: ^2.0.36
version: 0.20.2204228 version: 2.1.7(typescript@5.5.3)(vue@3.4.27(typescript@5.5.3))
pinia-plugin-persistedstate: pinia-plugin-persistedstate:
specifier: ^3.2.1 specifier: ^3.2.1
version: 3.2.1(pinia@2.1.7(typescript@5.5.3)(vue@3.4.27(typescript@5.5.3))) version: 3.2.1(pinia@2.1.7(typescript@5.5.3)(vue@3.4.27(typescript@5.5.3)))
...@@ -2789,9 +2789,6 @@ packages: ...@@ -2789,9 +2789,6 @@ packages:
resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
pina@0.20.2204228:
resolution: {integrity: sha512-osNVZg36DsDAEPHskmnTINhM5APSLsu+y8guYYX65nidbRPmnv/trAoPnacpfh8aCpsowGWR/DAYtQHZyZq8wQ==}
pinia-plugin-persistedstate@3.2.1: pinia-plugin-persistedstate@3.2.1:
resolution: {integrity: sha512-MK++8LRUsGF7r45PjBFES82ISnPzyO6IZx3CH5vyPseFLZCk1g2kgx6l/nW8pEBKxxd4do0P6bJw+mUSZIEZUQ==} resolution: {integrity: sha512-MK++8LRUsGF7r45PjBFES82ISnPzyO6IZx3CH5vyPseFLZCk1g2kgx6l/nW8pEBKxxd4do0P6bJw+mUSZIEZUQ==}
peerDependencies: peerDependencies:
...@@ -7180,8 +7177,6 @@ snapshots: ...@@ -7180,8 +7177,6 @@ snapshots:
pify@2.3.0: {} pify@2.3.0: {}
pina@0.20.2204228: {}
pinia-plugin-persistedstate@3.2.1(pinia@2.1.7(typescript@5.5.3)(vue@3.4.27(typescript@5.5.3))): pinia-plugin-persistedstate@3.2.1(pinia@2.1.7(typescript@5.5.3)(vue@3.4.27(typescript@5.5.3))):
dependencies: dependencies:
pinia: 2.1.7(typescript@5.5.3)(vue@3.4.27(typescript@5.5.3)) pinia: 2.1.7(typescript@5.5.3)(vue@3.4.27(typescript@5.5.3))
......
...@@ -42,6 +42,9 @@ export function createApp() { ...@@ -42,6 +42,9 @@ export function createApp() {
titleStyle: { titleStyle: {
color: '#1D2129' color: '#1D2129'
} }
},
input: {
placeholderStyle: 'fontSize: 28rpx'
} }
} }
}) })
......
...@@ -9,15 +9,6 @@ export const getAircraftNumbersApi = (data, config) => { ...@@ -9,15 +9,6 @@ export const getAircraftNumbersApi = (data, config) => {
config config
}) })
} }
//通过机号查询飞机相关数据
export const getAcReduceListApi = (data, config) => {
return http({
method: 'POST',
url: '/system/Aircraft/getAcReduceList',
data,
config
})
}
//获取用户基本信息分页列表 //获取用户基本信息分页列表
export const getAdminListApi = (data, config) => { export const getAdminListApi = (data, config) => {
return http({ return http({
...@@ -80,3 +71,12 @@ export const getATAApi = (data, config) => { ...@@ -80,3 +71,12 @@ export const getATAApi = (data, config) => {
config config
}) })
} }
//获取发动机列表
export const getEngineListApi = (data, config) => {
return http({
method: 'POST',
url: '/resource/getEngineList',
data,
config
})
}
import { http } from 'mocp/utils/http'
export const getMcoListApi = (data, config) => {
return http({
method: 'POST',
url: '/workbench/getMcoList',
data,
config
})
}
export const getMcoDetailsApi = (data, config) => {
return http({
method: 'POST',
url: '/workbench/getMcoDetails',
data,
config
})
}
export const addBackApi = (data, config) => {
return http({
method: 'POST',
url: '/workbench/addBack',
data,
config
})
}
import { post } from 'mocp/utils/http'
export const getSupportRequestListApi = (data, config) => {
return post({
method: 'POST',
url: '/workbench/getSupportRequestList',
data,
config
})
}
export const addUpdateSupportApi = (data, config) => {
return post({
method: 'POST',
url: '/workbench/addUpdateSupport',
data,
config
})
}
import { http } from 'mocp/utils/http'
//通过机号查询飞机相关数据
export const getAcReduceListApi = (data, config) => {
return http({
method: 'POST',
url: '/system/Aircraft/getAcReduceList',
data,
config
})
}
//通过机号和航站查询相关席位
export const getSysSeatListApi = (data, config) => {
return http({
method: 'POST',
url: '/system/getSysSeatList',
data,
config
})
}
<template> <template>
<view class="global-card" :class="class" :style="style"> <view class="global-card" :class="class" :style="style">
<view class="global-card-title"> <view class="global-card-title" :style="getTitleStyle">
<view class="left"> <view class="left u-line-1">
<view class="txt">{{ title }}</view> <view class="txt">{{ title }}</view>
</view> </view>
<view class="right" @tap="handleTitleClick"> <view class="right" @tap="handleTitleClick">
...@@ -9,13 +9,15 @@ ...@@ -9,13 +9,15 @@
<up-icon name="arrow-right" size="16"></up-icon> <up-icon name="arrow-right" size="16"></up-icon>
</view> </view>
</view> </view>
<view class="global-card-content"> <view class="global-card-content" v-if="showContent">
<slot></slot> <slot></slot>
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { computed } from 'vue'
const es = defineEmits(['handleTitleClick']) const es = defineEmits(['handleTitleClick'])
const ps = defineProps({ const ps = defineProps({
class: { class: {
...@@ -32,10 +34,28 @@ const ps = defineProps({ ...@@ -32,10 +34,28 @@ const ps = defineProps({
type: String, type: String,
default: '' default: ''
}, },
titleStyle: {
type: Object,
default: () => {
return {}
}
},
titleSuffix: { titleSuffix: {
type: String, type: String,
default: '' default: ''
},
//是否显示内容
showContent: {
type: Boolean,
default: true
}
})
const getTitleStyle = computed(() => {
const _style = { ...ps.titleStyle }
if (ps.showContent) {
_style['padding-bottom'] = '16rpx'
} }
return _style
}) })
const handleTitleClick = () => { const handleTitleClick = () => {
es('handleTitleClick') es('handleTitleClick')
...@@ -48,8 +68,6 @@ const handleTitleClick = () => { ...@@ -48,8 +68,6 @@ const handleTitleClick = () => {
padding: 24rpx; padding: 24rpx;
margin-top: 16rpx; margin-top: 16rpx;
&-title { &-title {
padding-bottom: 16rpx;
border-bottom: 2rpx solid #f4f4f4;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
...@@ -60,8 +78,11 @@ const handleTitleClick = () => { ...@@ -60,8 +78,11 @@ const handleTitleClick = () => {
} }
} }
.right { .right {
flex-basis: 280rpx;
margin-left: 16rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: flex-end;
.txt { .txt {
color: $mocp-text-4; color: $mocp-text-4;
margin-right: 16rpx; margin-right: 16rpx;
...@@ -69,6 +90,7 @@ const handleTitleClick = () => { ...@@ -69,6 +90,7 @@ const handleTitleClick = () => {
} }
} }
&-content { &-content {
border-top: 2rpx solid #f4f4f4;
padding-top: 16rpx; padding-top: 16rpx;
line-height: 40rpx; line-height: 40rpx;
color: $mocp-text-4; color: $mocp-text-4;
......
...@@ -130,6 +130,11 @@ const ps = defineProps({ ...@@ -130,6 +130,11 @@ const ps = defineProps({
confirmColor: { confirmColor: {
type: String, type: String,
default: '#165dff' default: '#165dff'
},
//打开前判断
onBeforeOpen: {
type: Function,
default: null
} }
}) })
//获取下拉框样式 //获取下拉框样式
...@@ -164,7 +169,11 @@ const getPickerClass = computed(() => { ...@@ -164,7 +169,11 @@ const getPickerClass = computed(() => {
}) })
const show = ref(false) const show = ref(false)
//打开 //打开
const open = () => { const open = async () => {
if (ps.onBeforeOpen) {
const flag = await ps.onBeforeOpen()
if (!flag) return
}
searchKey.value = '' searchKey.value = ''
show.value = true show.value = true
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import { computed } from 'vue' import { computed } from 'vue'
const ps = defineProps({ const ps = defineProps({
//primary / success / warning / danger //primary / success / warning / info / danger
type: { type: {
type: String, type: String,
default: 'primary' default: 'primary'
...@@ -40,6 +40,10 @@ const getClass = computed(() => { ...@@ -40,6 +40,10 @@ const getClass = computed(() => {
_class.push('mocp-bg-warning-2') _class.push('mocp-bg-warning-2')
_class.push('mocp-color-warning-6') _class.push('mocp-color-warning-6')
} }
if (ps.type == 'info') {
_class.push('mocp-bg-fill-4')
_class.push('mocp-color-text-1')
}
if (ps.type == 'danger') { if (ps.type == 'danger') {
_class.push('mocp-bg-danger-2') _class.push('mocp-bg-danger-2')
_class.push('mocp-color-danger-6') _class.push('mocp-color-danger-6')
......
...@@ -20,3 +20,9 @@ export const otherDetails_status = [ ...@@ -20,3 +20,9 @@ export const otherDetails_status = [
{ text: '已完成', class: 'mocp-color-success-6', value: '0' }, { text: '已完成', class: 'mocp-color-success-6', value: '0' },
{ text: '未完成', class: 'mocp-color-danger-6', value: '1' } { text: '未完成', class: 'mocp-color-danger-6', value: '1' }
] ]
export const mocMaterial_isValid = [
{ text: '有效', class: 'mocp-color-success-6', value: '1' },
{ text: '无效', class: 'mocp-color-danger-6', value: '0' },
{ text: '-', class: 'mocp-color-text-4', value: '' }
]
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</view> </view>
<lsj-upload <lsj-upload
width="640rpx" width="640rpx"
:height="isLoading ? '0rpx' : '88rpx'" :height="isLoading || !(getFileList.length < 1 || multiple) ? '0rpx' : '88rpx'"
:option="getOptions" :option="getOptions"
:size="30" :size="30"
:instantly="true" :instantly="true"
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
@uploadEnd="onuploadEnd" @uploadEnd="onuploadEnd"
@change="change" @change="change"
> >
<view class="upload-button"> <view class="upload-button" v-if="getFileList.length < 1 || multiple">
<up-icon name="plus" size="16" color="#4E5969"></up-icon> <up-icon name="plus" size="16" color="#4E5969"></up-icon>
<text class="txt">上传文件</text> <text class="txt">上传文件</text>
</view> </view>
...@@ -65,6 +65,11 @@ import { onBeforeUnmount } from 'vue' ...@@ -65,6 +65,11 @@ import { onBeforeUnmount } from 'vue'
const es = defineEmits(['update:modelValue', 'change', 'getFileList']) const es = defineEmits(['update:modelValue', 'change', 'getFileList'])
const ps = defineProps({ const ps = defineProps({
//是否支持上传多个文件
multiple: {
type: Boolean,
default: true
},
style: { style: {
type: Object, type: Object,
default: () => { default: () => {
......
...@@ -4,4 +4,6 @@ export * from './move-decision' ...@@ -4,4 +4,6 @@ export * from './move-decision'
export * from './technology-evaluation' export * from './technology-evaluation'
export * from './work-assignment' export * from './work-assignment'
export * from './aog' export * from './aog'
export * from './support-application'
export * from './mco'
export * from './fleet' export * from './fleet'
// 建议以文件名首字母作为前缀mco_
export const mco_choose = [
{ label: '是', value: 1 },
{ label: '否', value: 0 }
]
export const mco_stepState = [
{ label: '进行中', value: 1 },
{ label: '已完成', value: 2 }
]
// 建议以文件名首字母作为前缀sa_
export const sa_state = [
{ label: 'OPEN', value: '1' },
{ label: 'CLOSE', value: '2' }
]
...@@ -5,6 +5,7 @@ import { ...@@ -5,6 +5,7 @@ import {
getAircraftNumbersApi, getAircraftNumbersApi,
getAircraftTerminalsApi, getAircraftTerminalsApi,
getBasicParamsListApi, getBasicParamsListApi,
getEngineListApi,
getFlightNumApi, getFlightNumApi,
getPlaneModelsRepairApi getPlaneModelsRepairApi
} from 'mocp/api/base' } from 'mocp/api/base'
...@@ -20,7 +21,8 @@ const useBaseStore = defineStore('base', { ...@@ -20,7 +21,8 @@ const useBaseStore = defineStore('base', {
airlineCodeList: [], //航司下拉数据 airlineCodeList: [], //航司下拉数据
flightNumList: [], //航班号下拉数据 flightNumList: [], //航班号下拉数据
typeList: [], //机型下拉数据 typeList: [], //机型下拉数据
ATAList: [] //章节下拉数据 ATAList: [], //章节下拉数据
engineList: [] //发动机型号列表
}, },
allBasicParams: {} //系统基础参数 allBasicParams: {} //系统基础参数
} }
...@@ -57,15 +59,15 @@ const useBaseStore = defineStore('base', { ...@@ -57,15 +59,15 @@ const useBaseStore = defineStore('base', {
value: a value: a
})) }))
}, },
//章节下拉数据 //格式化章节下拉数据
getAllATASelect(state) { getAllATASelect(state) {
return state.selectList.ATAList.map((q) => ({ return state.selectList.ATAList.map((q) => ({
label: q.label + `(${ q.zstortGc })`, label: q.label + `(${q.zstortGc})`,
value: q.label, value: q.label,
id: q.id id: q.id
})) }))
}, },
getATASelect(state, e) { getATASelect(state) {
return uniqueArray( return uniqueArray(
state.selectList.ATAList.map((q) => ({ state.selectList.ATAList.map((q) => ({
label: q.label, label: q.label,
...@@ -81,6 +83,15 @@ const useBaseStore = defineStore('base', { ...@@ -81,6 +83,15 @@ const useBaseStore = defineStore('base', {
value: q.label value: q.label
})) }))
} }
},
//格式化发动机型号数据
getEngineSelect(state) {
return state.selectList.engineList.map((v) => {
return {
label: v.zMETYPE,
value: v.zMETYPE
}
})
} }
}, },
actions: { actions: {
...@@ -97,7 +108,8 @@ const useBaseStore = defineStore('base', { ...@@ -97,7 +108,8 @@ const useBaseStore = defineStore('base', {
this.getAirLinesList(), this.getAirLinesList(),
this.getFlightNum(), this.getFlightNum(),
this.getPlaneModelsRepair(), this.getPlaneModelsRepair(),
this.getATA() this.getATA(),
this.getEngineList()
]) ])
} finally { } finally {
uni.hideLoading() uni.hideLoading()
...@@ -118,14 +130,17 @@ const useBaseStore = defineStore('base', { ...@@ -118,14 +130,17 @@ const useBaseStore = defineStore('base', {
async getAirLinesList() { async getAirLinesList() {
const res = await getAirLinesListApi({}) const res = await getAirLinesListApi({})
if (res.code == 200) { if (res.code == 200) {
this.selectList.airlineCodeList = res.data.filter((a) => a.sortId !== '0').sort((q, w) => Number(q.sortId) - Number(w.sortId)).map((z) => ({ this.selectList.airlineCodeList = res.data
value: z.zOP2, .filter((a) => a.sortId !== '0')
label: z.zOP2, .sort((q, w) => Number(q.sortId) - Number(w.sortId))
name: z.zCNAME20, .map((z) => ({
zOP3: z.zOP3, value: z.zOP2,
shortName: z.reduceName, label: z.zOP2,
zCFNAME: z.zCFNAME name: z.zCNAME20,
})) zOP3: z.zOP3,
shortName: z.reduceName,
zCFNAME: z.zCFNAME
}))
} }
}, },
async getFlightNum() { async getFlightNum() {
...@@ -165,11 +180,11 @@ const useBaseStore = defineStore('base', { ...@@ -165,11 +180,11 @@ const useBaseStore = defineStore('base', {
pageSize: 100, pageSize: 100,
realName realName
} }
getAdminListApi(params, {loading: true}).then((res) => { getAdminListApi(params, { loading: true }).then((res) => {
if (res.code == 200) { if (res.code == 200) {
const selectList = res.data.list.map((item) => { const selectList = res.data.list.map((item) => {
return { return {
label: `${ item.nickname }(${ (item.enetAccount || '无易网号') + '-' + (item.deptFullName || '无机构') })`, label: `${item.nickname}(${(item.enetAccount || '无易网号') + '-' + (item.deptFullName || '无机构')})`,
value: item.id value: item.id
} }
}) })
...@@ -180,6 +195,12 @@ const useBaseStore = defineStore('base', { ...@@ -180,6 +195,12 @@ const useBaseStore = defineStore('base', {
} }
}) })
}) })
},
async getEngineList() {
const res = await getEngineListApi({})
if (res.code == 200) {
this.selectList.engineList = res.data
}
} }
}, },
// 配置持久化 // 配置持久化
......
import { getMcoDetailsApi } from 'mocp/api/mco'
import { defineStore } from 'pinia'
const useMcoStore = defineStore('mco', {
state: () => {
return {
searchData: {
state: null,
machineNumber: '',
model: '',
terminal: '',
majorCategory: '',
startTime: '',
stopTime: '',
faultDescription: '',
testRun: null,
airStop: null,
inspect: null
},
id: '',
details: undefined,
materialsIndex: -1, //航材详情下标
toolsIndex: -1, //工具详情下标
stepIndex: -1 //步骤详情下标
}
},
getters: {
//航材列表
getMaterialsList(state) {
return state.details?.materialsList?.materialsList || []
},
getMaterialsDetails(state) {
return this.getMaterialsList[state.materialsIndex]
},
//工具列表
getToolsList(state) {
return state.details?.toolsList?.materialsList || []
},
getToolsDetails(state) {
return this.getToolsList[state.toolsIndex]
},
//步骤列表
getStepList(state) {
return state.details?.mcoStepList || []
},
getStepDetails(state) {
return this.getStepList[state.stepIndex]
}
},
actions: {
resetForm() {
this.searchData = {
state: null,
machineNumber: '',
model: '',
terminal: '',
majorCategory: '',
startTime: '',
stopTime: '',
faultDescription: '',
testRun: null,
airStop: null,
inspect: null
}
},
async getMcoDetails() {
const res = await getMcoDetailsApi({ id: this.id }, { loading: true })
if (res.code == 200) {
this.details = res.data
} else {
uni.$mocpMessage.error(res.message)
}
},
setState(...args) {
this.$patch({ [args[0]]: args[1] })
}
},
// 配置持久化
persist: {
// 调整为兼容多端的API
storage: {
setItem(key, value) {
uni.setStorageSync(key, value)
},
getItem(key) {
return uni.getStorageSync(key)
}
}
}
})
export default useMcoStore
import { defineStore } from 'pinia'
const useSupportApplicationStore = defineStore('supportApplication', {
state: () => {
return {
searchData: {
state: '',
machineNumber: '',
model: '',
aviation: '',
terminal: '',
specialty: '',
engineModel: ''
},
details: undefined
}
},
getters: {},
actions: {
resetForm() {
this.searchData = {
state: '',
machineNumber: '',
model: '',
aviation: '',
terminal: '',
specialty: '',
engineModel: ''
}
},
setState(...args) {
this.$patch({ [args[0]]: args[1] })
}
},
// 配置持久化
persist: false
})
export default useSupportApplicationStore
...@@ -4,7 +4,7 @@ import { ref } from 'vue' ...@@ -4,7 +4,7 @@ import { ref } from 'vue'
const menuList = ref([ const menuList = ref([
{id: 1, name: '信息通报', icon: 'xxtb', group: '技术支援', count: 12, url: '/panel/inforDisclosure/search'}, {id: 1, name: '信息通报', icon: 'xxtb', group: '技术支援', count: 12, url: '/panel/inforDisclosure/search'},
{id: 2, name: '机队状态', icon: 'jdzt', group: '技术支援', count: 0, url: '/panel/fleet/search'}, {id: 2, name: '机队状态', icon: 'jdzt', group: '技术支援', count: 0, url: '/panel/fleet/search'},
{id: 3, name: '支援申请', icon: 'zysq', group: '技术支援', count: 0}, {id: 3, name: '支援申请', icon: 'zysq', group: '技术支援', count: 0, url: '/panel/support-application/search'},
{id: 4, name: '工作指令', icon: 'gzzl', group: '技术支援', count: 0, url: '/panel/work-assignment/search'}, {id: 4, name: '工作指令', icon: 'gzzl', group: '技术支援', count: 0, url: '/panel/work-assignment/search'},
{id: 5, name: '技术评估', icon: 'jspg', group: '技术支援', count: 0, url: '/panel/technology-evaluation/list'}, {id: 5, name: '技术评估', icon: 'jspg', group: '技术支援', count: 0, url: '/panel/technology-evaluation/list'},
{id: 6, name: '运行调查', icon: 'yxdc', group: '维修控制', count: 0}, {id: 6, name: '运行调查', icon: 'yxdc', group: '维修控制', count: 0},
...@@ -15,7 +15,7 @@ const menuList = ref([ ...@@ -15,7 +15,7 @@ const menuList = ref([
{id: 11, name: '不正常事件', icon: 'bzcsj', group: '运行品质', count: 0}, {id: 11, name: '不正常事件', icon: 'bzcsj', group: '运行品质', count: 0},
{id: 12, name: '考核记录', icon: 'khjl', group: '运行品质', count: 0, url: '/panel/appraisal-record/list'}, {id: 12, name: '考核记录', icon: 'khjl', group: '运行品质', count: 0, url: '/panel/appraisal-record/list'},
{id: 13, name: 'AOG任务', icon: 'AOG', group: '运行品质', count: 0, url: '/panel/aog/search'}, {id: 13, name: 'AOG任务', icon: 'AOG', group: '运行品质', count: 0, url: '/panel/aog/search'},
{id: 14, name: 'MCO', icon: 'MCO', group: '运行品质', count: 0}, {id: 14, name: 'MCO', icon: 'MCO', group: '运行品质', count: 0, url: '/panel/mco/search'},
{id: 15, name: '航班保障', icon: 'hbbz', group: '运行品质', count: 0, url: '/panel/flight-support/list'} {id: 15, name: '航班保障', icon: 'hbbz', group: '运行品质', count: 0, url: '/panel/flight-support/list'}
]) ])
const useUserStore = defineStore('user', { const useUserStore = defineStore('user', {
...@@ -65,7 +65,7 @@ const useUserStore = defineStore('user', { ...@@ -65,7 +65,7 @@ const useUserStore = defineStore('user', {
this.allHomeMenuList.push({ this.allHomeMenuList.push({
userId: this.userInfo.id, userId: this.userInfo.id,
homeMenuList: this.getMenuList.map((item) => { homeMenuList: this.getMenuList.map((item) => {
return {id: item.id} return { id: item.id }
}) })
}) })
} }
......
import useUserStore from 'mocp/store/user' 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 = 'https://moc.hnatechnic.com/api'
class ServiceLoading { class ServiceLoading {
open(loading) { open(loading) {
...@@ -33,13 +33,19 @@ export const httpInterceptor = (options) => { ...@@ -33,13 +33,19 @@ export const httpInterceptor = (options) => {
//loading //loading
const loading = options.config?.loading const loading = options.config?.loading
serviceLoading.open(loading) serviceLoading.open(loading)
//application
const application = options.application || 'form'
//重组提交数据 //重组提交数据
if (options.data) { if (options.data) {
options.data = { if (application == 'json') {
...options.data, //传对象
apiPwd: 'Ifar$2_0160_525_Mocp', } else {
requestFrom: '6', options.data = {
realUserId: userStore.userInfo?.id ...options.data,
apiPwd: 'Ifar$2_0160_525_Mocp',
requestFrom: '6',
realUserId: userStore.userInfo?.id
}
} }
} }
// 非 http 开头需拼接地址 // 非 http 开头需拼接地址
...@@ -60,9 +66,18 @@ export const httpInterceptor = (options) => { ...@@ -60,9 +66,18 @@ export const httpInterceptor = (options) => {
...options.header ...options.header
} }
} else { } else {
options.header = { if (application == 'json') {
'Content-Type': 'application/x-www-form-urlencoded', options.header = {
...options.header 'Content-Type': 'application/json',
Requestfrom: '6',
Realuserid: userStore.userInfo?.id,
...options.header
}
} else {
options.header = {
'Content-Type': 'application/x-www-form-urlencoded',
...options.header
}
} }
} }
// 添加 token 请求头标识 // 添加 token 请求头标识
...@@ -116,6 +131,14 @@ export const http = (options) => { ...@@ -116,6 +131,14 @@ export const http = (options) => {
}) })
}) })
} }
//post请求
export const post = (options) => {
options = {
application: 'json',
...options
}
return http(options)
}
//upload请求 //upload请求
export const upload = (options) => { export const upload = (options) => {
options = httpInterceptor(options) options = httpInterceptor(options)
......
...@@ -374,6 +374,78 @@ ...@@ -374,6 +374,78 @@
"style": { "style": {
"navigationBarTitleText": "其他特殊保障详情" "navigationBarTitleText": "其他特殊保障详情"
} }
},
{
"path": "pages/modules/mocp/panel/support-application/list",
"style": {
"navigationBarTitleText": "支援申请"
}
},
{
"path": "pages/modules/mocp/panel/support-application/search",
"style": {
"navigationBarTitleText": "筛选"
}
},
{
"path": "pages/modules/mocp/panel/support-application/add",
"style": {
"navigationBarTitleText": "新建支援申请"
}
},
{
"path": "pages/modules/mocp/panel/support-application/details",
"style": {
"navigationBarTitleText": "支援申请详情"
}
},
{
"path": "pages/modules/mocp/panel/mco/search",
"style": {
"navigationBarTitleText": "筛选"
}
},
{
"path": "pages/modules/mocp/panel/mco/list",
"style": {
"navigationBarTitleText": "MCO列表"
}
},
{
"path": "pages/modules/mocp/panel/mco/details",
"style": {
"navigationBarTitleText": "MCO详情"
}
},
{
"path": "pages/modules/mocp/panel/mco/materials-list",
"style": {
"navigationBarTitleText": "航材列表"
}
},
{
"path": "pages/modules/mocp/panel/mco/materials-details",
"style": {
"navigationBarTitleText": "航材详情"
}
},
{
"path": "pages/modules/mocp/panel/mco/tools-list",
"style": {
"navigationBarTitleText": "工具列表"
}
},
{
"path": "pages/modules/mocp/panel/mco/tools-details",
"style": {
"navigationBarTitleText": "工具详情"
}
},
{
"path": "pages/modules/mocp/panel/mco/step-back",
"style": {
"navigationBarTitleText": "步骤反馈"
}
} }
], ],
"globalStyle": { "globalStyle": {
......
import { ref } from 'vue'
export const formRef = ref()
// 表单数据
export const formData = ref({
state: null,
terminal: '',
valid: null,
decisionState: null,
aviation: '',
machineNumber: '',
startTimeS: null,
startTimeE: null
})
import { toRaw } from 'vue'
import { formData, formRef } from './search.compositions'
export const handleReset = () => {
formData.value = {
state: null,
presenter: '',
seat: '',
workType: null,
startTime: null,
stopTime: null
}
formRef.value?.resetFields()
handleConfirm()
}
export const handleConfirm = () => {
uni.$mocpJump.navigateBack()
uni.$emit('assignWorkReload', { params: toRaw(formData.value) })
}
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
></up-textarea> ></up-textarea>
</up-form-item> </up-form-item>
<up-form-item label="完成时限" :borderBottom="true"> <up-form-item label="完成时限" :borderBottom="true">
<global-date pickAlign="right" clearable placeholder="请选择日期" v-model="item.time" :emptyValue="null"></global-date> <global-date pickAlign="right" clearable v-model="item.time" :emptyValue="null"></global-date>
</up-form-item> </up-form-item>
</view> </view>
</template> </template>
......
.details {
padding: 16rpx 24rpx;
border-radius: 12rpx;
background: #ffffff;
color: $mocp-text-4;
&-header {
padding-bottom: 16rpx;
&-top {
.top {
.txt {
margin-right: 16rpx;
}
}
.center {
margin-top: 16rpx;
font-size: 34rpx;
}
}
&-footer {
display: flex;
align-items: center;
justify-content: space-between;
margin-top: 16rpx;
.label {
display: flex;
align-items: center;
.txt {
margin-left: 16rpx;
}
}
.left {
color: $mocp-primary-6;
display: flex;
align-items: center;
justify-content: space-between;
.txt {
color: $mocp-text-5;
font-size: 28rpx;
margin-left: 16rpx;
&:first-child {
margin-left: 0;
}
}
}
}
}
&-body {
border-top: 2rpx solid #f4f4f4;
border-bottom: 2rpx solid #f4f4f4;
padding: 16rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
}
&-footer {
padding-top: 16rpx;
display: flex;
align-items: center;
.txt {
margin-left: 16rpx;
color: $mocp-text-4;
}
}
}
.card-details {
color: $mocp-text-4;
&-item {
margin-bottom: 16rpx;
.msg {
margin-top: 8rpx;
font-size: 30rpx;
}
&:last-child {
margin-bottom: 0;
}
}
}
<template>
<global-page :padding="24" title="MCO详情">
<template v-if="details">
<view class="details">
<view class="details-header">
<view class="details-header-top">
<view class="top">
<global-tag type="primary" class="txt">{{ getParamNameByValue('GuaranteeStage', details.guaranteeStage) }}</global-tag>
<global-tag type="success" class="txt">{{ getParamNameByValue('MajorCategory', details.majorCategory) }}</global-tag>
<global-tag type="info" class="txt">{{ getParamNameByValue('McoCurrentState', details.state) }}</global-tag>
</view>
<view class="center">
<text class="txt mocp-color-text-5">{{ details.mcoNumber || '-' }}</text>
</view>
<view class="bottom">
<text class="txt mocp-color-text-5">{{ details.aogNum }}</text>
</view>
</view>
<view class="details-header-footer">
<view class="left">
<text class="txt u-line-1" v-if="details.machineNumber">{{ details.machineNumber }}</text>
<text class="txt u-line-1" v-if="details.model">{{ details.model }}</text>
<text class="txt u-line-1" v-if="details.aviation">
{{ useGetDictByValue('', details.aviation, { data: baseStore.getAirlineSelect }) }}
</text>
</view>
<view class="right">
<text class="txt u-line-1" v-if="details.terminal">{{ details.terminal }}</text>
</view>
</view>
</view>
<view class="details-body">
<global-field label="ATA章节:" :value="details.ata || '-'"></global-field>
<global-field label="故障代码:" :value="details.faultCode || '-'"></global-field>
</view>
<view class="details-footer">
<global-icon icon="calendar" color="#1D2129"></global-icon>
<view class="txt">{{ timeStampFormat(details.executionDate, { format: 'YYYY/MM/DD' }) }}</view>
</view>
</view>
<global-card title="信息通报">
<view class="card-details">
<view class="card-details-item">
<view class="title">故障描述:</view>
<view class="msg">
{{ details.faultDescription || '无' }}
</view>
</view>
</view>
</global-card>
<global-card :title="`步骤${index + 1}`" v-for="(item, index) in getStepList" :key="item.id" @handleTitleClick="goStepDetails(index)">
{{ item.stepContent || '无' }}
</global-card>
<global-card title="航材" titleSuffix="查看详情" :showContent="false" @handleTitleClick="goTo('/panel/mco/materials-list')"></global-card>
<global-card title="工具" titleSuffix="查看详情" :showContent="false" @handleTitleClick="goTo('/panel/mco/tools-list')"></global-card>
</template>
</global-page>
</template>
<script setup>
import { storeToRefs } from 'pinia'
import { timeStampFormat } from 'mocp/utils/tool'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import useBaseStore from 'mocp/store/base'
import useMcoStore from 'mocp/store/mco'
import { onLoad, onUnload } from '@dcloudio/uni-app'
import { getParamNameByValue } from 'mocp/hooks/use-params/useParams'
const query = defineProps(['id'])
const baseStore = useBaseStore()
const mcoStore = useMcoStore()
const { details, getStepList } = storeToRefs(mcoStore)
onLoad(() => {
mcoStore.setState('id', query.id)
mcoStore.getMcoDetails()
})
const goStepDetails = (index) => {
uni.$mocpJump.navigateTo('/panel/mco/step-back').then(() => {
mcoStore.setState('stepIndex', index)
})
}
const goTo = (url, params) => {
uni.$mocpJump.navigateTo(url, params)
}
uni.$on('updateDetails', () => {
mcoStore.getMcoDetails()
})
onUnload(() => {
uni.$off('updateDetails')
})
</script>
<style lang="scss" scoped>
@import './constants/details.scss';
</style>
<template>
<global-page
title="MCO列表"
isDataList
refresherEnabled
loadingMoreEnabled
auto
ref="paging"
:params="searchData"
showNavRight
navRightType="icon"
navRightIcon="saixuan-01"
@handleRightClick="handleRightClick"
:api="getMcoListApi"
:padding="24"
>
<template #="{ dataList }">
<view class="item" v-for="item in dataList" :key="item.id" @tap="goDetails(item)">
<view class="item-title">
<view class="left grade">
{{ getParamNameByValue('WorkGrade', item.workGrade) }}
</view>
<view class="right">
<global-tag type="primary" class="txt">{{ getParamNameByValue('GuaranteeStage', item.guaranteeStage) }}</global-tag>
<global-tag type="success" class="txt">{{ getParamNameByValue('MajorCategory', item.majorCategory) }}</global-tag>
<global-tag type="info" class="txt">{{ getParamNameByValue('McoCurrentState', item.state) }}</global-tag>
</view>
</view>
<view class="item-content u-line-3">
{{ item.faultDescription || '无' }}
</view>
<view class="item-footer">
<view class="label">
<global-icon icon="calendar"></global-icon>
<text class="txt">
{{ timeStampFormat(item.executionDate, { format: 'YYYY/MM/DD' }) }}
</text>
</view>
</view>
</view>
</template>
</global-page>
</template>
<script setup>
import { ref } from 'vue'
import { timeStampFormat } from 'mocp/utils/tool'
import { storeToRefs } from 'pinia'
import { onUnload } from '@dcloudio/uni-app'
import { getMcoListApi } from 'mocp/api/mco'
import useMcoStore from 'mocp/store/mco'
import { getParamNameByValue } from 'mocp/hooks/use-params/useParams'
//跳转
const mcoStore = useMcoStore()
const { searchData } = storeToRefs(mcoStore)
const goDetails = (data) => {
uni.$mocpJump.navigateTo('/panel/mco/details', { id: data.id })
}
//筛选
const handleRightClick = () => {
uni.$mocpJump.navigateBack()
}
//刷新
const paging = ref()
uni.$on('mcoReload', () => {
paging.value?.reload()
})
onUnload(() => {
uni.$off('mcoReload')
})
</script>
<style lang="scss" scoped>
@import 'mocpStatic/css/list.scss';
.grade {
font-size: 34rpx;
color: $mocp-primary-6;
}
</style>
<template>
<global-page title="航材详情">
<view class="mocp-cell">
<up-cell-group v-if="getMaterialsDetails">
<up-cell title="件号" :value="getMaterialsDetails.pn"></up-cell>
<up-cell title="名称" :value="getMaterialsDetails.name"></up-cell>
<up-cell title="属性" :value="getParamNameByValue('MaterialType', getMaterialsDetails.aviationAttribute)"></up-cell>
<up-cell title="需求数量" :value="getMaterialsDetails.quantity"></up-cell>
<up-cell title="是否有效">
<template #value>
<global-text-status :value="getMaterialsDetails.isValid" dictkey="mocMaterial_isValid"></global-text-status>
</template>
</up-cell>
<up-cell title="备注" :value="getMaterialsDetails.remarks"></up-cell>
</up-cell-group>
</view>
</global-page>
</template>
<script setup>
import { storeToRefs } from 'pinia'
import useMcoStore from 'mocp/store/mco'
import { getParamNameByValue } from 'mocp/hooks/use-params/useParams'
const mcoStore = useMcoStore()
const { getMaterialsDetails } = storeToRefs(mcoStore)
</script>
<style lang="scss" scoped>
.mocp-cell {
background: #fff;
}
</style>
<template>
<global-page :padding="24" title="航材列表">
<template v-for="(item, index) in getMaterialsList" :key="item.id">
<global-card :title="item.name" titleSuffix="查看详情" @handleTitleClick="goTo(index)">
<global-text-status :value="item.isValid" dictkey="mocMaterial_isValid"></global-text-status>
</global-card>
</template>
</global-page>
</template>
<script setup>
import { storeToRefs } from 'pinia'
import useMcoStore from 'mocp/store/mco'
const mcoStore = useMcoStore()
const { getMaterialsList } = storeToRefs(mcoStore)
const goTo = (index) => {
uni.$mocpJump.navigateTo('/panel/mco/materials-details').then(() => {
mcoStore.setState('materialsIndex', index)
})
}
</script>
<style lang="scss" scoped></style>
<template>
<global-page title="筛选">
<view class="search-form">
<up-form labelPosition="left" labelWidth="auto">
<up-form-item label="状态" prop="state" :borderBottom="true">
<global-picker
v-model.number="formData.state"
pickAlign="right"
clearable
:options="getParamsByType('McoCurrentState')"
></global-picker>
</up-form-item>
<up-form-item label="机号" prop="machineNumber" :borderBottom="true">
<global-picker pickAlign="right" v-model="formData.machineNumber" :options="deviceNumList" clearable filter></global-picker>
</up-form-item>
<up-form-item label="机型" prop="model" :borderBottom="true">
<global-picker v-model="formData.model" pickAlign="right" :options="baseStore.getTypeSelect" clearable filter></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="专业类别" prop="majorCategory" :borderBottom="true">
<global-picker
v-model="formData.majorCategory"
pickAlign="right"
:options="getParamsByType('MajorCategory')"
clearable
></global-picker>
</up-form-item>
<up-form-item label="执行日期(开始)" prop="startTime" :borderBottom="true">
<global-date v-model="formData.startTime" pickAlign="right" clearable></global-date>
</up-form-item>
<up-form-item label="执行日期(结束)" prop="stopTime" :borderBottom="true">
<global-date v-model="formData.stopTime" pickAlign="right" clearable></global-date>
</up-form-item>
<up-form-item label="故障描述" prop="faultDescription" :borderBottom="true">
<up-input v-model="formData.faultDescription" inputAlign="right" border="none" placeholder="请输入" clearable></up-input>
</up-form-item>
<up-form-item label="试车" prop="testRun" :borderBottom="true">
<global-picker v-model.number="formData.testRun" pickAlign="right" clearable dictkey="mco_choose"></global-picker>
</up-form-item>
<up-form-item label="放空停" prop="airStop" :borderBottom="true">
<global-picker v-model.number="formData.airStop" pickAlign="right" clearable dictkey="mco_choose"></global-picker>
</up-form-item>
<up-form-item label="必检" prop="inspect" :borderBottom="true">
<global-picker v-model.number="formData.inspect" pickAlign="right" clearable dictkey="mco_choose"></global-picker>
</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 useMcoStore from 'mocp/store/mco'
import { getParamsByType } from 'mocp/hooks/use-params/useParams'
//获取下拉框选项
const baseStore = useBaseStore()
const {
selectList: { deviceNumList }
} = useBaseStore()
const mcoStore = useMcoStore()
//获取查询表单数据
const { searchData } = storeToRefs(mcoStore)
const formData = ref(cloneDeep(searchData.value))
const handleReset = () => {
mcoStore.resetForm()
uni.$mocpJump.navigateTo('/panel/mco/list')
uni.$emit('mcoReload')
}
const handleConfirm = () => {
mcoStore.setState('searchData', formData.value)
uni.$mocpJump.navigateTo('/panel/mco/list')
uni.$emit('mcoReload')
}
</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="步骤反馈" showFooterBtn footerBtnText="确认提交" @handleFooterClick="handleFooterClick">
<view class="mocp-cell" v-if="getStepDetails">
<view class="mocp-title">步骤详情</view>
<up-cell-group>
<up-cell title="MCO编号" :value="getStepDetails.mcoNumber"></up-cell>
<up-cell title="创建时间" :value="timeStampFormat(getStepDetails.creationTime)"></up-cell>
<up-cell title="计划工时" :value="getStepDetails.plannedWork"></up-cell>
<up-cell title="步骤描述" :label="getStepDetails.stepContent || '无'"></up-cell>
</up-cell-group>
</view>
<view class="mocp-cell">
<view class="mocp-title">反馈</view>
<view class="mocp-form">
<up-form labelPosition="left" labelWidth="auto">
<up-form-item label="状态" prop="state" :borderBottom="true">
<global-picker v-model.number="formData.state" pickAlign="right" clearable dictkey="mco_stepState"></global-picker>
</up-form-item>
<up-form-item label="工作人" :borderBottom="true">
<global-picker
pickAlign="right"
clearable
v-model="formData.staff"
:options="selectList"
emptyValue="-1"
filter
></global-picker>
</up-form-item>
<up-form-item label="实际工时" :borderBottom="true">
<up-input v-model="formData.stateP" inputAlign="right" border="none" placeholder="请输入" clearable type="number">
<template #suffix>人数</template>
</up-input>
<up-input v-model="formData.stateH" inputAlign="right" border="none" placeholder="请输入" clearable type="number">
<template #suffix>小时</template>
</up-input>
</up-form-item>
<up-form-item label="反馈内容" :borderBottom="true" labelPosition="top">
<up-textarea
placeholder="一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容"
:height="40"
border="none"
v-model="formData.content"
></up-textarea>
</up-form-item>
<up-form-item label="附件" :borderBottom="true" labelPosition="top">
<view style="margin-top: 24rpx">
<global-upload
:fileList="getStepDetails.backList?.contentFile || ''"
v-model="formData.contentFile"
mapFieldName="id"
:multiple="false"
></global-upload>
</view>
</up-form-item>
</up-form>
</view>
</view>
</global-page>
</template>
<script setup>
import { storeToRefs } from 'pinia'
import useMcoStore from 'mocp/store/mco'
import { timeStampFormat } from 'mocp/utils/tool'
import useBaseStore from 'mocp/store/base'
import { reactive, ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { addBackApi } from 'mocp/api/mco'
const baseStore = useBaseStore()
const mcoStore = useMcoStore()
const { getStepDetails } = storeToRefs(mcoStore)
const formData = reactive({
state: '',
staff: '',
stateP: '',
stateH: '',
content: '',
contentFile: ''
})
//获取下拉框列表
const selectList = ref([])
onLoad(() => {
const details = getStepDetails.value.backList || {}
formData.state = details.state
formData.staff = details.staff
formData.stateP = details.actualWork.split('X')[0]
formData.stateH = details.actualWork.split('X')[1]
formData.content = details.content
baseStore.getAdminList().then((res) => {
selectList.value = res
})
})
//提交
const handleFooterClick = async () => {
const params = {}
params.id = getStepDetails.value.id
if (getStepDetails.value.backList) {
params.isAdd = 2
} else {
params.isAdd = 1
}
if (formData.state) {
params.state = formData.state
}
if (formData.staff) {
params.staff = formData.staff
}
if (formData.stateP && formData.stateH) {
params.stateType = formData.stateP + 'X' + formData.stateH
}
if (formData.content) {
params.content = formData.content
}
if (formData.contentFile) {
params.contentFile = formData.contentFile
}
const res = await addBackApi(params, { loading: true })
if (res.code == 200) {
uni.$mocpJump.navigateBack()
uni.$mocpMessage.success(res.message)
//更新详情
uni.$emit('updateDetails')
} else {
uni.$mocpMessage.error(res.message)
}
}
</script>
<style lang="scss" scoped>
.mocp-cell {
background: #fff;
margin-top: 16rpx;
}
.mocp-title {
padding: 16rpx;
background-color: #f7f8fa;
}
.mocp-form {
padding: 0 32rpx;
}
</style>
<template>
<global-page title="工具详情">
<view class="mocp-cell">
<up-cell-group v-if="getToolsDetails">
<up-cell title="件号" :value="getToolsDetails.pn"></up-cell>
<up-cell title="名称" :value="getToolsDetails.name"></up-cell>
<up-cell title="类型" :value="getParamNameByValue('MaterialType', getToolsDetails.aviationAttribute)"></up-cell>
<up-cell title="需求数量" :value="getToolsDetails.quantity"></up-cell>
<up-cell title="是否有效">
<template #value>
<global-text-status :value="getToolsDetails.isValid" dictkey="mocMaterial_isValid"></global-text-status>
</template>
</up-cell>
<up-cell title="备注" :value="getToolsDetails.remarks"></up-cell>
</up-cell-group>
</view>
</global-page>
</template>
<script setup>
import { storeToRefs } from 'pinia'
import useMcoStore from 'mocp/store/mco'
import { getParamNameByValue } from 'mocp/hooks/use-params/useParams'
const mcoStore = useMcoStore()
const { getToolsDetails } = storeToRefs(mcoStore)
</script>
<style lang="scss" scoped>
.mocp-cell {
background: #fff;
}
</style>
<template>
<global-page :padding="24" title="工具列表">
<template v-for="(item, index) in getToolsList" :key="item.id">
<global-card :title="item.name" titleSuffix="查看详情" @handleTitleClick="goTo(index)">
<global-text-status :value="item.isValid" dictkey="mocMaterial_isValid"></global-text-status>
</global-card>
</template>
</global-page>
</template>
<script setup>
import { storeToRefs } from 'pinia'
import useMcoStore from 'mocp/store/mco'
const mcoStore = useMcoStore()
const { getToolsList } = storeToRefs(mcoStore)
const goTo = (index) => {
uni.$mocpJump.navigateTo('/panel/mco/tools-details').then(() => {
mcoStore.setState('toolsIndex', index)
})
}
</script>
<style lang="scss" scoped></style>
...@@ -19,20 +19,42 @@ ...@@ -19,20 +19,42 @@
:options="deviceNumList" :options="deviceNumList"
clearable clearable
@change="changeAc" @change="changeAc"
filter
></global-picker> ></global-picker>
</up-form-item> </up-form-item>
<up-form-item label="机型" :borderBottom="true"> <up-form-item label="机型" :borderBottom="true">
<up-input border="none" inputAlign="right" clearable v-model="formData.model" disabled disabledColor="#fff"></up-input> <up-input
border="none"
inputAlign="right"
clearable
v-model="formData.model"
disabled
disabledColor="#fff"
placeholder="请选择机号自动关联"
></up-input>
</up-form-item> </up-form-item>
<up-form-item label="航司" :borderBottom="true"> <up-form-item label="航司" :borderBottom="true">
<up-input border="none" inputAlign="right" clearable disabled disabledColor="#fff"> <up-input
border="none"
inputAlign="right"
clearable
disabled
disabledColor="#fff"
:placeholder="formData.aviation ? '' : '请选择机号自动关联'"
>
<template #suffix> <template #suffix>
{{ useGetDictByValue('', formData.aviation, { data: baseStore.getAirlineSelect }) }} {{ useGetDictByValue('', formData.aviation, { data: baseStore.getAirlineSelect }) }}
</template> </template>
</up-input> </up-input>
</up-form-item> </up-form-item>
<up-form-item label="航站" :borderBottom="true"> <up-form-item label="航站" :borderBottom="true">
<global-picker pickAlign="right" v-model="formData.terminal" clearable :options="baseStore.getTerminalSelect"></global-picker> <global-picker
pickAlign="right"
v-model="formData.terminal"
clearable
:options="baseStore.getTerminalSelect"
filter
></global-picker>
</up-form-item> </up-form-item>
<up-form-item label="日期" :borderBottom="true"> <up-form-item label="日期" :borderBottom="true">
<global-date <global-date
...@@ -135,7 +157,7 @@ import useMoveDecisionStore from 'mocp/store/move-decision' ...@@ -135,7 +157,7 @@ import useMoveDecisionStore from 'mocp/store/move-decision'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import useBaseStore from 'mocp/store/base' import useBaseStore from 'mocp/store/base'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict' import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import { getAcReduceListApi } from 'mocp/api/base' import { getAcReduceListApi } from 'mocp/api/system'
import { updateDecisionApi } from 'mocp/api/move-decision' import { updateDecisionApi } from 'mocp/api/move-decision'
import { getParamsByType } from 'mocp/hooks/use-params/useParams' import { getParamsByType } from 'mocp/hooks/use-params/useParams'
......
<template>
<global-page title="新建支援申请" showFooterBtn footerBtnText="申请" @handleFooterClick="handleFooterClick">
<view class="mocp-form">
<up-form labelPosition="left" labelWidth="auto" :model="formData" :rules="rules" ref="formRef">
<up-form-item label="机号" prop="machineNumber" :borderBottom="true" required>
<global-picker
pickAlign="right"
v-model="formData.machineNumber"
:options="deviceNumList"
clearable
@change="changeAc"
filter
></global-picker>
</up-form-item>
<up-form-item label="机型" :borderBottom="true">
<up-input
border="none"
inputAlign="right"
clearable
v-model="formData.model"
disabled
disabledColor="#fff"
placeholder="请选择机号自动关联"
></up-input>
</up-form-item>
<up-form-item label="航司" :borderBottom="true">
<up-input
border="none"
inputAlign="right"
clearable
disabled
disabledColor="#fff"
:placeholder="formData.aviation ? '' : '请选择机号自动关联'"
>
<template #suffix>
{{ useGetDictByValue('', formData.aviation, { data: baseStore.getAirlineSelect }) }}
</template>
</up-input>
</up-form-item>
<up-form-item label="航站" prop="terminal" :borderBottom="true" required>
<global-picker
pickAlign="right"
v-model="formData.terminal"
clearable
:options="baseStore.getTerminalSelect"
filter
></global-picker>
</up-form-item>
<up-form-item label="ATA章节" prop="ata" :borderBottom="true" required>
<global-picker v-model="formData.ata" pickAlign="right" :options="baseStore.getATASelect" clearable filter></global-picker>
</up-form-item>
<up-form-item label="专业" prop="specialty" :borderBottom="true" required>
<global-picker
v-model="formData.specialty"
pickAlign="right"
:options="getParamsByType('MajorCategory')"
clearable
></global-picker>
</up-form-item>
<up-form-item label="发动机型号" prop="engineModel" :borderBottom="true">
<global-picker
v-model="formData.engineModel"
pickAlign="right"
:options="baseStore.getEngineSelect"
clearable
filter
></global-picker>
</up-form-item>
<up-form-item label="故障描述及处理方案简要描述" prop="faultDescription" :borderBottom="true" labelPosition="top">
<up-textarea
placeholder="一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容"
:height="40"
border="none"
v-model="formData.faultDescription"
></up-textarea>
</up-form-item>
<up-form-item label="飞机当前状态/下一段航班计划" prop="airplaneState" :borderBottom="true" labelPosition="top">
<up-textarea
placeholder="一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容"
:height="40"
border="none"
v-model="formData.airplaneState"
></up-textarea>
</up-form-item>
<up-form-item label="手册要求描述" prop="manualDescription" :borderBottom="true" labelPosition="top">
<up-textarea
placeholder="一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容"
:height="40"
border="none"
v-model="formData.manualDescription"
></up-textarea>
</up-form-item>
<up-form-item label="支援申请描述" prop="supportNeeds" :borderBottom="true" labelPosition="top" required>
<up-textarea
placeholder="一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容"
:height="40"
border="none"
v-model="formData.supportNeeds"
></up-textarea>
</up-form-item>
<up-form-item label="上传故障描述附件" :borderBottom="true" labelPosition="top">
<view style="margin-top: 24rpx">
<global-upload v-model="formData.supportFile" mapFieldName="id"></global-upload>
</view>
</up-form-item>
<up-form-item label="执管评估意见" prop="suggestion" :borderBottom="true" labelPosition="top">
<up-textarea
placeholder="一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容"
:height="40"
border="none"
v-model="formData.suggestion"
></up-textarea>
</up-form-item>
<up-form-item label="相关席位" prop="relevantSeats" :borderBottom="true" required>
<global-picker
v-model="formData.relevantSeats"
pickAlign="right"
:options="relatedSeatSet"
clearable
filter
:onBeforeOpen="onBeforeOpen"
label-field="seatName"
value-field="id"
></global-picker>
</up-form-item>
</up-form>
</view>
</global-page>
</template>
<script setup>
import useBaseStore from 'mocp/store/base'
import { getParamsByType } from 'mocp/hooks/use-params/useParams'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import { formData, formRef, relatedSeatSet, rules } from './constants/add.compositions'
import { onBeforeOpen, changeAc, handleSubmit } from './constants/add.functionals'
import useUserStore from 'mocp/store/user'
const baseStore = useBaseStore()
const userStore = useUserStore()
//获取下拉框选项
const {
selectList: { deviceNumList }
} = useBaseStore()
const handleFooterClick = () => {
handleSubmit(userStore.userInfo?.id)
}
</script>
<style lang="scss" scoped>
.mocp-form {
background: #fff;
padding: 0 32rpx;
}
</style>
import { reactive, ref } from 'vue'
export const formRef = ref()
//验证
export const rules = reactive({
machineNumber: [
{
required: true,
message: '请选择机号',
trigger: ['blur', 'change']
}
],
terminal: [
{
required: true,
message: '请选择航站',
trigger: ['blur', 'change']
}
],
ata: [
{
required: true,
message: '请选择ATA章节',
trigger: ['blur', 'change']
}
],
specialty: [
{
required: true,
message: '请选择专业',
trigger: ['blur', 'change']
}
],
supportNeeds: [
{
required: true,
message: '请输入支援需求',
trigger: ['blur']
}
],
relevantSeats: [
{
required: true,
message: '请选择相关席位',
trigger: ['blur', 'change']
}
]
})
// 表单数据
export const formData = reactive({
id: '',
machineNumber: null,
model: null,
aviation: null,
terminal: null,
ata: null,
specialty: null,
engineModel: null,
supportNeeds: '',
supportFile: '',
faultDescription: '',
airplaneState: '',
manualDescription: '',
suggestion: '',
relevantSeats: null
})
//席位
export const relatedSeatSet = ref([])
import { getAcReduceListApi, getSysSeatListApi } from 'mocp/api/system'
import { formData, formRef, relatedSeatSet } from './add.compositions'
import { addUpdateSupportApi } from 'mocp/api/support-application'
//切换机号
export const changeAc = async () => {
const res = await getAcReduceListApi({ ac: formData.machineNumber }, { loading: true })
if (res.code == 200) {
formData.model = res.data[0]?.zstortgc
formData.aviation = res.data[0]?.zop3
} else {
uni.$mocpMessage.error(res.message)
}
}
//选择相关席位
export const onBeforeOpen = async () => {
if (!formData.machineNumber) {
uni.$mocpMessage.error('请选择机号')
return false
}
if (!formData.terminal) {
uni.$mocpMessage.error('请选择航站')
return false
}
try {
await uni.showLoading({
mask: true,
title: '检索席位中'
})
const terminalCode = formData.terminal.match(/[A-Z]+/gi)[0]
const resp = await Promise.all([
getSysSeatListApi({
pid: 0,
seatType: 1,
pageSize: 1000,
terminalCode
}),
getSysSeatListApi({
pid: 0,
seatType: 1,
pageSize: 1000,
acType: formData.model
})
])
if (resp.every((a) => a.code.toString() === '200')) {
relatedSeatSet.value = resp[0].data.list.concat(resp[1].data.list)
return true
} else {
throw new Error('请求席位失败!')
}
} catch (res) {
uni.$mocpMessage.error(res.message)
} finally {
uni.hideLoading()
}
}
//提交表单
export const handleSubmit = async (sponsorSeat) => {
await formRef.value?.validate()
const res = await addUpdateSupportApi({ ...formData, sponsorSeat }, { loading: true })
if (res.code == 200) {
uni.$mocpJump.navigateBack()
uni.$mocpMessage.success(res.message)
uni.$emit('supportApplicationReload')
} else {
uni.$mocpMessage.error(res.message)
}
}
<template>
<global-page title="支援申请详情">
<view class="mocp-cell">
<up-cell-group v-if="details">
<up-cell title="创建时间" :value="details.createTime"></up-cell>
<up-cell title="发起人" :value="details.sponsor"></up-cell>
<up-cell title="接收人" :value="details.recipient || '-'"></up-cell>
<up-cell title="状态">
<template #value>
<custom-state :value="useGetDictByValue('sa_state', details.state)" :size="28"></custom-state>
</template>
</up-cell>
<up-cell title="机号" :value="details.machineNumber || '-'"></up-cell>
<up-cell title="机型" :value="details.model || '-'"></up-cell>
<up-cell title="相关席位" :value="details.relevantSeatsName || '-'"></up-cell>
<up-cell title="航司" :value="useGetDictByValue('', details.aviation, { data: baseStore.getAirlineSelect }) || '-'"></up-cell>
<up-cell title="航站" :value="details.terminal || '-'"></up-cell>
<up-cell title="任务需求" :label="details.supportNeeds || '-'"></up-cell>
</up-cell-group>
</view>
</global-page>
</template>
<script setup>
import { storeToRefs } from 'pinia'
import useSupportApplicationStore from 'mocp/store/support-application'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import useBaseStore from 'mocp/store/base'
const baseStore = useBaseStore()
const supportApplicationStore = useSupportApplicationStore()
const { details } = storeToRefs(supportApplicationStore)
</script>
<style lang="scss" scoped>
.mocp-cell {
background: #fff;
}
</style>
<template>
<global-page
title="支援申请"
isDataList
refresherEnabled
loadingMoreEnabled
auto
ref="paging"
:params="searchData"
showNavRight
navRightType="icon"
navRightIcon="saixuan-01"
@handleRightClick="handleRightClick"
:api="getSupportRequestListApi"
:padding="24"
showFooterBtn
footerBtnText="新建"
@handleFooterClick="handleFooterClick"
>
<template #="{ dataList }">
<view class="item" v-for="item in dataList" :key="item.id" @tap="goDetails(item)">
<view class="item-title">
<view class="left">
<custom-state :value="useGetDictByValue('sa_state', item.state)"></custom-state>
<text class="txt u-line-1" v-if="item.supportNumber">{{ item.supportNumber }}</text>
</view>
</view>
<view class="item-content u-line-3">
{{ item.faultDescription || '无' }}
</view>
<view class="item-footer">
<view class="left">
<text class="txt u-line-1" v-if="item.machineNumber">{{ item.machineNumber }}</text>
<text class="txt u-line-1" v-if="item.model">{{ item.model }}</text>
<text class="txt u-line-1" v-if="item.aviation">
{{ useGetDictByValue('', item.aviation, { data: baseStore.getAirlineSelect }) }}
</text>
</view>
<view class="label">
<text class="txt u-line-1" v-if="item.terminal">{{ item.terminal }}</text>
</view>
</view>
</view>
</template>
</global-page>
</template>
<script setup>
import { ref } from 'vue'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import { storeToRefs } from 'pinia'
import { onUnload } from '@dcloudio/uni-app'
import { getSupportRequestListApi } from 'mocp/api/support-application'
import useSupportApplicationStore from 'mocp/store/support-application'
import useBaseStore from 'mocp/store/base'
const baseStore = useBaseStore()
//跳转
const supportApplicationStore = useSupportApplicationStore()
const { searchData } = storeToRefs(supportApplicationStore)
const goDetails = (data) => {
uni.$mocpJump.navigateTo('/panel/support-application/details', { id: data.id }).then(() => {
supportApplicationStore.setState('details', data)
})
}
//筛选
const handleRightClick = () => {
uni.$mocpJump.navigateBack('/panel/support-application/search')
}
//刷新
const paging = ref()
uni.$on('supportApplicationReload', () => {
paging.value?.reload()
})
//新建
const handleFooterClick = () => {
uni.$mocpJump.navigateTo('/panel/support-application/add')
}
onUnload(() => {
uni.$off('supportApplicationReload')
})
</script>
<style lang="scss" scoped>
@import 'mocpStatic/css/list.scss';
</style>
<template>
<global-page title="筛选">
<view class="search-form">
<up-form labelPosition="left" labelWidth="auto">
<up-form-item label="状态" prop="state" :borderBottom="true">
<global-picker v-model="formData.state" pickAlign="right" clearable dictkey="wa_state"></global-picker>
</up-form-item>
<up-form-item label="机号" prop="machineNumber" :borderBottom="true">
<global-picker pickAlign="right" v-model="formData.machineNumber" :options="deviceNumList" clearable filter></global-picker>
</up-form-item>
<up-form-item label="机型" prop="model" :borderBottom="true">
<global-picker v-model="formData.model" pickAlign="right" :options="baseStore.getTypeSelect" clearable filter></global-picker>
</up-form-item>
<up-form-item label="航司" prop="aviation" :borderBottom="true">
<global-picker
v-model="formData.aviation"
pickAlign="right"
:options="baseStore.getAirlineSelect"
clearable
filter
></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="专业" prop="specialty" :borderBottom="true">
<global-picker
v-model="formData.specialty"
pickAlign="right"
:options="getParamsByType('MajorCategory')"
clearable
></global-picker>
</up-form-item>
<up-form-item label="发动机型号" prop="engineModel" :borderBottom="true">
<global-picker
v-model="formData.engineModel"
pickAlign="right"
:options="baseStore.getEngineSelect"
clearable
filter
></global-picker>
</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 useSupportApplicationStore from 'mocp/store/support-application'
import { getParamsByType } from 'mocp/hooks/use-params/useParams'
//获取下拉框选项
const baseStore = useBaseStore()
const {
selectList: { deviceNumList }
} = useBaseStore()
const supportApplicationStore = useSupportApplicationStore()
//获取查询表单数据
const { searchData } = storeToRefs(supportApplicationStore)
const formData = ref(cloneDeep(searchData.value))
const handleReset = () => {
supportApplicationStore.resetForm()
uni.$mocpJump.navigateTo('/panel/support-application/list')
uni.$emit('supportApplicationReload')
}
const handleConfirm = () => {
supportApplicationStore.setState('searchData', formData.value)
uni.$mocpJump.navigateTo('/panel/support-application/list')
uni.$emit('supportApplicationReload')
}
</script>
<style lang="scss" scoped>
.search-form {
padding: 24rpx 24rpx 0 24rpx;
background: #fff;
}
.footer-btn {
padding: 24rpx 32rpx;
background-color: #fff;
}
</style>
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
.txt { .txt {
color: $mocp-text-5;
font-size: 28rpx; font-size: 28rpx;
margin-left: 16rpx; margin-left: 16rpx;
} }
......
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