Commit 3fbac100 by pangchong

feat: MCO收尾

parent 606c6bdd
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
})
}
<template>
<view class="global-card" :class="class" :style="style">
<view class="global-card-title">
<view class="left">
<view class="global-card-title" :style="getTitleStyle">
<view class="left u-line-1">
<view class="txt">{{ title }}</view>
</view>
<view class="right" @tap="handleTitleClick">
......@@ -9,13 +9,15 @@
<up-icon name="arrow-right" size="16"></up-icon>
</view>
</view>
<view class="global-card-content">
<view class="global-card-content" v-if="showContent">
<slot></slot>
</view>
</view>
</template>
<script setup>
import { computed } from 'vue'
const es = defineEmits(['handleTitleClick'])
const ps = defineProps({
class: {
......@@ -32,10 +34,28 @@ const ps = defineProps({
type: String,
default: ''
},
titleStyle: {
type: Object,
default: () => {
return {}
}
},
titleSuffix: {
type: String,
default: ''
},
//是否显示内容
showContent: {
type: Boolean,
default: true
}
})
const getTitleStyle = computed(() => {
const _style = { ...ps.titleStyle }
if (ps.showContent) {
_style['padding-bottom'] = '16rpx'
}
return _style
})
const handleTitleClick = () => {
es('handleTitleClick')
......@@ -48,8 +68,6 @@ const handleTitleClick = () => {
padding: 24rpx;
margin-top: 16rpx;
&-title {
padding-bottom: 16rpx;
border-bottom: 2rpx solid #f4f4f4;
display: flex;
align-items: center;
justify-content: space-between;
......@@ -60,8 +78,11 @@ const handleTitleClick = () => {
}
}
.right {
flex-basis: 280rpx;
margin-left: 16rpx;
display: flex;
align-items: center;
justify-content: flex-end;
.txt {
color: $mocp-text-4;
margin-right: 16rpx;
......@@ -69,6 +90,7 @@ const handleTitleClick = () => {
}
}
&-content {
border-top: 2rpx solid #f4f4f4;
padding-top: 16rpx;
line-height: 40rpx;
color: $mocp-text-4;
......
......@@ -8,7 +8,7 @@
import { computed } from 'vue'
const ps = defineProps({
//primary / success / warning / danger
//primary / success / warning / info / danger
type: {
type: String,
default: 'primary'
......@@ -40,6 +40,10 @@ const getClass = computed(() => {
_class.push('mocp-bg-warning-2')
_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') {
_class.push('mocp-bg-danger-2')
_class.push('mocp-color-danger-6')
......
......@@ -20,3 +20,9 @@ export const otherDetails_status = [
{ text: '已完成', class: 'mocp-color-success-6', value: '0' },
{ 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 @@
</view>
<lsj-upload
width="640rpx"
:height="isLoading ? '0rpx' : '88rpx'"
:height="isLoading || !(getFileList.length < 1 || multiple) ? '0rpx' : '88rpx'"
:option="getOptions"
:size="30"
:instantly="true"
......@@ -38,7 +38,7 @@
@uploadEnd="onuploadEnd"
@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>
<text class="txt">上传文件</text>
</view>
......@@ -65,6 +65,11 @@ import { onBeforeUnmount } from 'vue'
const es = defineEmits(['update:modelValue', 'change', 'getFileList'])
const ps = defineProps({
//是否支持上传多个文件
multiple: {
type: Boolean,
default: true
},
style: {
type: Object,
default: () => {
......
......@@ -5,3 +5,4 @@ export * from './technology-evaluation'
export * from './work-assignment'
export * from './aog'
export * from './support-application'
export * from './mco'
// 建议以文件名首字母作为前缀mco_
export const mco_choose = [
{ label: '是', value: 1 },
{ label: '否', value: 0 }
]
export const mco_stepState = [
{ label: '进行中', value: 1 },
{ label: '已完成', value: 2 }
]
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
......@@ -14,7 +14,7 @@ const menuList = ref([
{ id: 11, name: '不正常事件', icon: 'bzcsj', group: '运行品质', count: 0 },
{ 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: 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 }
])
const useUserStore = defineStore('user', {
......
import useUserStore from 'mocp/store/user'
// const baseURL = 'https://hna-platform.anyremote.cn'
const baseURL = 'https://moc.hnatechnic.com/api'
const baseURL = 'https://hna-platform.anyremote.cn'
// const baseURL = 'https://moc.hnatechnic.com/api'
class ServiceLoading {
open(loading) {
......
......@@ -331,6 +331,54 @@
"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": {
......
......@@ -30,7 +30,7 @@
></up-textarea>
</up-form-item>
<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>
</view>
</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>
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