Commit 7f8f1a83 by pangchong

fix: bug修复

parent 752fb438
......@@ -42,3 +42,9 @@ export const md_isValid = [
{ text: '有效', class: 'mocp-color-success-6', value: '1' },
{ text: '无效', class: 'mocp-color-danger-6', value: '0' }
]
export const mco_feedBack = [
{ text: '进行中', class: 'mocp-color-warning-6', value: 1 },
{ text: '已完成', class: 'mocp-color-success-6', value: 2 },
{ text: '-', class: 'mocp-color-text-4', value: '' }
]
......@@ -19,9 +19,8 @@ const useMcoStore = defineStore('mco', {
},
id: '',
details: undefined,
materialsIndex: -1, //航材详情下标
toolsIndex: -1, //工具详情下标
stepIndex: -1 //步骤详情下标
stepIndex: -1, //步骤详情下标
feedBackType: 1 //反馈类型 1整体反馈 2额外反馈
}
},
getters: {
......@@ -29,22 +28,27 @@ const useMcoStore = defineStore('mco', {
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]
},
getStepBackDetails() {
return this.getStepDetails?.backList || {}
},
//获取反馈详情
getFeedBackDetails(state) {
if (state.feedBackType == 1) {
return state.details?.whole || {}
} else {
return state.details?.extra || {}
}
}
},
actions: {
......@@ -76,6 +80,16 @@ const useMcoStore = defineStore('mco', {
}
},
// 配置持久化
persist: false
persist: {
// 调整为兼容多端的API
storage: {
setItem(key, value) {
uni.setStorageSync(key, value)
},
getItem(key) {
return uni.getStorageSync(key)
}
}
}
})
export default useMcoStore
......@@ -420,31 +420,25 @@
{
"path": "pages/modules/mocp/panel/mco/materials-list",
"style": {
"navigationBarTitleText": "航材列表"
}
},
{
"path": "pages/modules/mocp/panel/mco/materials-details",
"style": {
"navigationBarTitleText": "航材详情"
"navigationBarTitleText": "航材"
}
},
{
"path": "pages/modules/mocp/panel/mco/tools-list",
"style": {
"navigationBarTitleText": "工具列表"
"navigationBarTitleText": "工具"
}
},
{
"path": "pages/modules/mocp/panel/mco/tools-details",
"path": "pages/modules/mocp/panel/mco/step-back",
"style": {
"navigationBarTitleText": "工具详情"
"navigationBarTitleText": "步骤详情"
}
},
{
"path": "pages/modules/mocp/panel/mco/step-back",
"path": "pages/modules/mocp/panel/mco/feed-back",
"style": {
"navigationBarTitleText": "步骤详情"
"navigationBarTitleText": "反馈详情"
}
}
],
......
......@@ -15,6 +15,18 @@
margin-top: 16rpx;
font-size: 34rpx;
}
.bottom {
display: flex;
align-items: center;
.txt {
color: $mocp-text-5;
font-size: 28rpx;
margin-left: 16rpx;
&:first-child {
margin-left: 0;
}
}
}
}
&-footer {
display: flex;
......@@ -47,10 +59,13 @@
&-body {
border-top: 2rpx solid #f4f4f4;
border-bottom: 2rpx solid #f4f4f4;
padding: 16rpx 0;
display: flex;
align-items: center;
justify-content: space-between;
padding-bottom: 16rpx;
&-row {
padding-top: 16rpx;
display: flex;
align-items: center;
justify-content: space-between;
}
}
&-footer {
padding-top: 16rpx;
......@@ -69,6 +84,7 @@
.msg {
margin-top: 8rpx;
font-size: 30rpx;
word-break: break-all;
}
&:last-child {
margin-bottom: 0;
......
......@@ -13,11 +13,15 @@
<text class="txt mocp-color-text-5">{{ details.mcoNumber || '-' }}</text>
</view>
<view class="bottom">
<text class="txt mocp-color-text-5">{{ details.aogNum }}</text>
<text class="txt" v-if="details.isRsc == '1'">涉及RSC串件</text>
<text class="txt" v-if="details.testRun == '1'">试车</text>
<text class="txt" v-if="details.airStop == '1'">防空停</text>
<text class="txt" v-if="details.inspect == '1'">必检</text>
</view>
</view>
<view class="details-header-footer">
<view class="left">
<global-airline-image :code="details.aviation" :width="30" :height="30"></global-airline-image>
<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">
......@@ -30,8 +34,17 @@
</view>
</view>
<view class="details-body">
<global-field label="ATA章节:" :value="details.ata || '-'"></global-field>
<global-field label="故障代码:" :value="details.faultCode || '-'"></global-field>
<view class="details-body-row">
<global-field label="发动机型号" :value="details.engineModel || '-'"></global-field>
<global-field label="工作等级:" :value="getParamNameByValue('WorkGrade', details.workGrade) || '-'"></global-field>
</view>
<view class="details-body-row">
<global-field label="ATA章节:" :value="details.ata || '-'"></global-field>
<global-field label="故障代码:" :value="details.faultCode || '-'"></global-field>
</view>
<view class="details-body-row">
<global-field label="故障现象标签:" :value="details.faultLabel || '-'"></global-field>
</view>
</view>
<view class="details-footer">
<global-icon icon="calendar" color="#1D2129"></global-icon>
......@@ -51,6 +64,18 @@
<global-card :title="`步骤${index + 1}`" v-for="(item, index) in getStepList" :key="item.id" @handleTitleClick="goStepDetails(index)">
{{ item.stepContent || '无' }}
</global-card>
<global-card
title="整体反馈"
:showContent="false"
v-if="!['1', '2'].includes(details.state)"
@handleTitleClick="goFeedBack(1)"
></global-card>
<global-card
title="额外反馈"
:showContent="false"
v-if="!['1', '2'].includes(details.state)"
@handleTitleClick="goFeedBack(2)"
></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>
......@@ -74,6 +99,7 @@ onLoad(() => {
mcoStore.setState('id', query.id)
mcoStore.getMcoDetails()
})
//步骤反馈详情
const goStepDetails = (index) => {
uni.$mocpJump.navigateTo('/panel/mco/step-back').then(() => {
mcoStore.setState('stepIndex', index)
......@@ -82,6 +108,12 @@ const goStepDetails = (index) => {
const goTo = (url, params) => {
uni.$mocpJump.navigateTo(url, params)
}
//反馈详情
const goFeedBack = (feedBackType) => {
uni.$mocpJump.navigateTo('/panel/mco/feed-back').then(() => {
mcoStore.setState('feedBackType', feedBackType)
})
}
uni.$on('updateDetails', () => {
mcoStore.getMcoDetails()
})
......
<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 title="反馈详情">
<template v-if="getFeedBackDetails">
<view class="mocp-cell">
<up-cell-group>
<up-cell title="状态">
<template #value>
<global-text-status :value="getFeedBackDetails.state" dictkey="mco_feedBack"></global-text-status>
</template>
</up-cell>
<up-cell title="工作人" :value="getFeedBackDetails.staff || '-'"></up-cell>
<up-cell title="总实际工时" :value="getFeedBackDetails.actualWork || '-'"></up-cell>
<up-cell title="反馈内容" :label="getFeedBackDetails.content || '无'"></up-cell>
</up-cell-group>
</view>
</template>
</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)
const { getFeedBackDetails } = storeToRefs(mcoStore)
</script>
<style lang="scss" scoped>
.mocp-cell {
......
<template>
<global-page :padding="24" title="航材列表" auto :localData="getMaterialsList">
<global-page title="航材" auto :localData="getMaterialsList">
<template #default="{ item, index }">
<global-card :title="item.name" titleSuffix="查看详情" @handleTitleClick="goTo(index)">
<global-text-status :value="item.isValid" dictkey="mocMaterial_isValid"></global-text-status>
</global-card>
<up-collapse :value="[index]">
<up-collapse-item :title="item.name" :name="index">
<view class="mocp-cell">
<up-cell-group>
<up-cell title="件号" :value="item.pn"></up-cell>
<up-cell title="名称" :value="item.name"></up-cell>
<up-cell title="属性" :value="getParamNameByValue('MaterialType', item.aviationAttribute)"></up-cell>
<up-cell title="需求数量" :value="item.quantity"></up-cell>
<up-cell title="是否有效">
<template #value>
<global-text-status :value="item.isValid" dictkey="mocMaterial_isValid"></global-text-status>
</template>
</up-cell>
<up-cell title="备注" :value="item.remarks"></up-cell>
</up-cell-group>
</view>
</up-collapse-item>
</up-collapse>
</template>
</global-page>
</template>
......@@ -11,13 +26,26 @@
<script setup>
import { storeToRefs } from 'pinia'
import useMcoStore from 'mocp/store/mco'
import { getParamNameByValue } from 'mocp/hooks/use-params/useParams'
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>
<style lang="scss" scoped>
.mocp-cell {
background: #fff;
}
:deep(.u-collapse-item) {
background: #f7f8fa;
.u-cell__body {
padding: 24rpx !important;
}
.u-cell__title {
color: $mocp-text-5;
font-size: 34rpx;
}
.u-collapse-item__content__text {
padding: 0;
}
}
</style>
<template>
<global-page title="步骤详情" :showFooterBtn="false" footerBtnText="确认提交" @handleFooterClick="handleFooterClick">
<global-page title="步骤详情">
<template v-if="getStepDetails">
<view class="mocp-cell">
<!-- <view class="mocp-title">步骤详情</view> -->
<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>
......@@ -10,45 +10,18 @@
<up-cell title="步骤描述" :label="getStepDetails.stepContent || '无'"></up-cell>
</up-cell-group>
</view>
<view class="mocp-cell" style="display: none">
<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">
<custom-admin-picker
pickAlign="right"
clearable
v-model="formData.staff"
valueField="label"
:searchValue="formData.staff"
></custom-admin-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>
<up-cell-group>
<up-cell title="状态">
<template #value>
<global-text-status :value="getStepBackDetails.state" dictkey="mco_feedBack"></global-text-status>
</template>
</up-cell>
<up-cell title="工作人" :value="getStepBackDetails.staff || '-'"></up-cell>
<up-cell title="实际工时" :value="getStepBackDetails.actualWork || '-'"></up-cell>
<up-cell title="反馈内容" :label="getStepBackDetails.content || '无'"></up-cell>
</up-cell-group>
</view>
</template>
</global-page>
......@@ -58,62 +31,9 @@
import { storeToRefs } from 'pinia'
import useMcoStore from 'mocp/store/mco'
import { timeStampFormat } from 'mocp/utils/tool'
import { reactive } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { addBackApi } from 'mocp/api/mco'
const mcoStore = useMcoStore()
const { getStepDetails } = storeToRefs(mcoStore)
const formData = reactive({
state: '',
staff: '',
stateP: '',
stateH: '',
content: '',
contentFile: ''
})
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
})
//提交
const handleFooterClick = async () => {
const params = {}
params.id = getStepDetails.value.id
if (getStepDetails.value?.backList?.id) {
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)
}
}
const { getStepDetails, getStepBackDetails } = storeToRefs(mcoStore)
</script>
<style lang="scss" scoped>
.mocp-cell {
......
<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="工具列表" auto :localData="getToolsList">
<global-page :padding="24" title="工具" auto :localData="getToolsList">
<template #default="{ item, index }">
<global-card :title="item.name" titleSuffix="查看详情" @handleTitleClick="goTo(index)">
<global-text-status :value="item.isValid" dictkey="mocMaterial_isValid"></global-text-status>
</global-card>
<up-collapse :value="[index]">
<up-collapse-item :title="item.name" :name="index">
<view class="mocp-cell">
<up-cell-group>
<up-cell title="件号" :value="item.pn"></up-cell>
<up-cell title="名称" :value="item.name"></up-cell>
<up-cell title="类型" :value="getParamNameByValue('MaterialType', item.aviationAttribute)"></up-cell>
<up-cell title="需求数量" :value="item.quantity"></up-cell>
<up-cell title="是否有效">
<template #value>
<global-text-status :value="item.isValid" dictkey="mocMaterial_isValid"></global-text-status>
</template>
</up-cell>
<up-cell title="备注" :value="item.remarks"></up-cell>
</up-cell-group>
</view>
</up-collapse-item>
</up-collapse>
</template>
</global-page>
</template>
......@@ -14,10 +29,22 @@ 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>
<style lang="scss" scoped>
.mocp-cell {
background: #fff;
}
:deep(.u-collapse-item) {
background: #f7f8fa;
.u-cell__body {
padding: 24rpx !important;
}
.u-cell__title {
color: $mocp-text-5;
font-size: 34rpx;
}
.u-collapse-item__content__text {
padding: 0;
}
}
</style>
......@@ -15,7 +15,7 @@
</view>
</view>
<up-collapse :value="getDefaultCollapse">
<up-collapse-item title="客户管控技术支援工程师完成初始评估" name="updat-technology">
<up-collapse-item title="客户管控技术支援工程师完成初始评估" name="update-technology">
<view class="details-body">
<view class="details-body-list">
<view class="details-body-item">
......@@ -205,7 +205,6 @@ import useTechnologyEvaluationStore from 'mocp/store/technology-evaluation'
import { storeToRefs } from 'pinia'
import useBaseStore from 'mocp/store/base'
import { useGetDictByValue } from 'mocp/hooks/use-dict/useDict'
import { timeStampFormat } from 'mocp/utils/tool'
import { computed } from 'vue'
import { getParamNameByValue } from 'mocp/hooks/use-params/useParams'
......@@ -214,7 +213,7 @@ const { details } = storeToRefs(technologyEvaluationStore)
const baseStore = useBaseStore()
//获取默认展开项
const getDefaultCollapse = computed(() => {
const defaultCollapse = ['updat-technology']
const defaultCollapse = ['update-technology']
if (details.value?.estimateTime) {
defaultCollapse.push('add-engineering')
}
......
......@@ -47,6 +47,7 @@
font-size: 30rpx;
color: $mocp-text-4;
line-height: 40rpx;
word-break: break-all;
}
&-footer {
display: flex;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment