Commit 96e7742d by pangchong

feat: 协议单位收尾

parent e06a6419
import { http } from 'mocp/utils/http'
export const getRepairWorkSupervisionListApi = (data, config) => {
return http({
method: 'POST',
url: '/technical-support/getRepairWorkSupervisionList',
data,
config
})
}
export const getSurveyTemplateDetailApi = (data, config) => {
return http({
method: 'POST',
url: '/technical-support/getSurveyTemplateDetail',
data,
config
})
}
export const submitAnswersApi = (data, config) => {
return http({
method: 'POST',
url: '/technical-support/submitAnswers',
data,
config
})
}
export const getRepairTaskInfoListApi = (data, config) => {
return http({
method: 'POST',
url: '/technical-support/getRepairTaskInfoList',
data,
config
})
}
......@@ -6,8 +6,8 @@
:customStyle="getCustomStyle"
v-for="(item, index) in getColumns"
:key="index"
:label="item.label"
:name="item.value"
:label="item[labelField]"
:name="item[valueField]"
></up-checkbox>
</up-checkbox-group>
</view>
......
......@@ -346,6 +346,8 @@ const queryList = (pageIndex, pageSize) => {
} else {
if (ps.localData) {
paging.value?.complete(ps.localData || [])
} else if (ps.showEmpty) {
paging.value?.complete([])
} else {
paging.value?.complete(true)
}
......
......@@ -9,7 +9,13 @@
:disabled="disabled"
:borderBottom="borderBottom"
>
<up-radio :customStyle="getCustomStyle" v-for="(item, index) in getColumns" :key="index" :label="item.label" :name="item.value"></up-radio>
<up-radio
:customStyle="getCustomStyle"
v-for="(item, index) in getColumns"
:key="index"
:label="item[labelField]"
:name="item[valueField]"
></up-radio>
</up-radio-group>
</template>
......@@ -91,9 +97,12 @@ const getAlign = computed(() => {
return radioAlign
})
const getStyle = computed(() => {
return {
justifyContent: getAlign.value
const _style = {}
_style.justifyContent = getAlign.value
if (ps.placement == 'column') {
_style.marginTop = '16rpx'
}
return _style
})
const getCustomStyle = computed(() => {
const _style = {
......@@ -146,4 +155,10 @@ const radioChange = (value) => {
es('change', value)
}
</script>
<style lang="scss" scoped></style>
<style lang="scss">
:deep(.radio-group) {
.u-radio:last-child {
margin-bottom: 0 !important;
}
}
</style>
......@@ -30,7 +30,7 @@ const menuList = ref([
{ id: 'gcfx', name: '工程分析', icon: 'gcfx', group: '运行品质', default: false, count: 0 },
// 航站管理
{ id: 'hzgl', name: '航站管理', icon: 'hzgl', group: '航站管理', default: false, count: 0 },
{ id: 'xydw', name: '协议单位', icon: 'xydw', group: '航站管理', default: false, count: 0 }
{ id: 'xydw', name: '协议单位', icon: 'xydw', group: '航站管理', default: false, count: 0, url: '/panel/workSupervision/list' }
])
const useUserStore = defineStore('mocpUser', {
state: () => {
......
......@@ -542,6 +542,18 @@
"style": {
"navigationBarTitleText": "编辑航站不正常事件"
}
},
{
"path": "pages/modules/mocp/panel/workSupervision/list",
"style": {
"navigationBarTitleText": "协议单位工作监察"
}
},
{
"path": "pages/modules/mocp/panel/workSupervision/answerQuestion",
"style": {
"navigationBarTitleText": "答题"
}
}
],
"globalStyle": {
......
......@@ -98,6 +98,12 @@ const handleHomeMenu = (menu, type) => {
} else {
!menu.isHome && homeMenuList.value.push(menu)
}
} else {
if (menu.url) {
uni.$mocpJump.navigateTo(menu.url)
} else {
uni.$mocpMessage.warning('暂未开放!')
}
}
}
//获取全部应用
......
......@@ -41,10 +41,10 @@
<up-form-item label="机型类别" prop="modelType" :borderBottom="true" required>
<global-picker pickAlign="right" v-model="formData.modelType" dictkey="eb_modelType" clearable></global-picker>
</up-form-item>
<up-form-item label="进港航班号" prop="flightNoIn" :borderBottom="true" required>
<up-form-item label="进港航班号" prop="flightNoIn" :borderBottom="true">
<up-input v-model="formData.flightNoIn" inputAlign="right" border="none" placeholder="请输入" clearable></up-input>
</up-form-item>
<up-form-item label="出港航班号" prop="flightNoOut" :borderBottom="true">
<up-form-item label="出港航班号" prop="flightNoOut" :borderBottom="true" required>
<up-input v-model="formData.flightNoOut" inputAlign="right" border="none" placeholder="请输入" clearable></up-input>
</up-form-item>
</view>
......@@ -60,7 +60,7 @@
<global-switch v-model="formData.originalAircraftPositionDeicing"></global-switch>
</view>
<view class="mocp-switch">
<view class="mocp-switch-label">是否包含预除冰</view>
<view class="mocp-switch-label">预除冰</view>
<global-switch v-model="formData.expectDeicing"></global-switch>
</view>
</view>
......
......@@ -137,6 +137,13 @@ export const rules = reactive({
message: '请选择机型类别',
trigger: ['blur', 'change']
}
],
flightNoOut: [
{
required: true,
message: '请选择出港航班号',
trigger: ['blur', 'change']
}
]
})
export const formRef = ref()
......
......@@ -140,6 +140,8 @@ export const submitDeicing = () => {
if (formData.deicingQuantityTotal && formData.deicingQuantityTotal > 0) {
if (formData.deicingQuantityTotal > limit[1]) {
showDeicing.value = true
} else {
showToast('提交成功')
}
}
}
......@@ -160,6 +162,8 @@ export const submitAntiicing = () => {
if (formData.antiicingQuantityTotal && formData.antiicingQuantityTotal > 0) {
if (formData.antiicingQuantityTotal > limit[1]) {
showAntiicing.value = true
} else {
showToast('提交成功')
}
}
}
......
import { ref } from 'vue'
export const formData = ref([])
export const formRef = ref()
export const templateDetail = ref()
import { getSurveyTemplateDetailApi } from 'mocp/api/workSupervision'
import { formData, templateDetail } from './answerQuestion.compositions'
export const getSurveyTemplateDetail = async (templateId) => {
//清空内容
templateDetail.value = undefined
formData.value = []
const res = await getSurveyTemplateDetailApi({ templateId }, { loading: true })
if (res.code == 200) {
templateDetail.value = res.data
formData.value = res.data?.questionList.map((item) => {
//选项
const quRadioList = item.quRadioList.map((option) => {
return {
...option,
value: undefined
}
})
//多选填空输入框
const inputList = []
item.quName?.split('##{input}##').forEach((option) => {
if (option && item.quType == '5') {
inputList.push({ value: '' })
}
})
return {
...item,
quRadioList,
inputList,
value: undefined
}
})
} else {
uni.$mocpMessage.error(res.message)
}
}
export const getParams = ({ templateId, belongId: belongTaskId }) => {
const anAttaList = [] //附件题答案
const anFillblankList = [] //填空题答案
const anRadioList = [] //单选题/多选题/判断题/下拉框答案
const anTimeList = [] //时间题型答案
formData.value.forEach((item) => {
// 附件题答案
if (item.quType == '3') {
anAttaList.push({
templateId,
belongTaskId,
quId: item.id,
atta: item.value
})
}
// 填空题答案
if (item.quType == '0') {
anFillblankList.push({
templateId,
belongTaskId,
quId: item.id,
answer: item.value
})
}
if (item.quType == '5') {
anFillblankList.push({
templateId,
belongTaskId,
quId: item.id,
answer: item.inputList.map((option) => option.value).join(',')
})
}
// 单选题/判断题/多选题/下拉框答案
if (item.quType == '1' || item.quType == '2' || item.quType == '4' || item.quType == '7') {
const quItemId = item.quType == '4' ? item.value.join(',') : item.value
const content = item.quRadioList
.filter((option) => item.value?.includes(option.id) && option.isFillblank == '1')
.map((option) => {
return {
id: option.id,
content: option.value || ''
}
})
if (content.length) {
anRadioList.push({
templateId,
belongTaskId,
quId: item.id,
quItemId,
content
})
} else {
anRadioList.push({
templateId,
belongTaskId,
quId: item.id,
quItemId
})
}
}
// 时间题型答案
if (item.quType == '6') {
anTimeList.push({
templateId,
belongTaskId,
quId: item.id,
answer: item.value
})
}
})
return {
anAttaList: JSON.stringify(anAttaList),
anFillblankList: JSON.stringify(anFillblankList),
anRadioList: JSON.stringify(anRadioList),
anTimeList: JSON.stringify(anTimeList),
repairTaskInfoId: belongTaskId
}
}
<template>
<global-page
title="协议单位工作监察"
isDataList
refresherEnabled
loadingMoreEnabled
auto
ref="paging"
:api="getRepairWorkSupervisionListApi"
:pageSize="20"
:padding="24"
>
<template #default="{ item }">
<view class="work-item" @tap="goTo(item)">
{{ item.taskName }}
<up-icon name="arrow-right"></up-icon>
</view>
</template>
</global-page>
</template>
<script setup>
import { getRepairTaskInfoListApi, getRepairWorkSupervisionListApi } from 'mocp/api/workSupervision'
const goTo = async (row) => {
const res = await getRepairTaskInfoListApi({ id: row.id }, { loading: true })
if (res.code == 200) {
if (res.data?.length) {
uni.$mocpJump.navigateTo('/panel/workSupervision/answerQuestion', { templateId: row.templateId, belongId: res.data[0].id })
} else {
uni.$mocpMessage.error('请下发任务')
}
} else {
uni.$mocpMessage.error(res.message)
}
}
</script>
<style lang="scss" scoped>
.work-item {
background: #fff;
margin-bottom: 16rpx;
border-radius: 12rpx;
padding: 24rpx;
font-size: 28rpx;
color: $mocp-text-5;
display: flex;
align-items: center;
justify-content: space-between;
}
</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