Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mocp-uniapp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pangchong
mocp-uniapp
Commits
96e7742d
Commit
96e7742d
authored
Sep 20, 2024
by
pangchong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 协议单位收尾
parent
e06a6419
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
483 additions
and
10 deletions
+483
-10
src/mocp/api/workSupervision.js
+34
-0
src/mocp/components/global-checkbox/global-checkbox.vue
+2
-2
src/mocp/components/global-page/global-page.vue
+2
-0
src/mocp/components/global-radio/global-radio.vue
+19
-4
src/mocp/store/user.js
+1
-1
src/pages.json
+12
-0
src/pages/modules/mocp/panel/app-center/index.vue
+6
-0
src/pages/modules/mocp/panel/electronicBill/deicing/add.vue
+3
-3
src/pages/modules/mocp/panel/electronicBill/deicing/constants/add.compositions.js
+7
-0
src/pages/modules/mocp/panel/electronicBill/deicing/constants/add.functionals.js
+4
-0
src/pages/modules/mocp/panel/workSupervision/answerQuestion.vue
+223
-0
src/pages/modules/mocp/panel/workSupervision/constants/answerQuestion.compositions.js
+5
-0
src/pages/modules/mocp/panel/workSupervision/constants/answerQuestion.functionals.js
+115
-0
src/pages/modules/mocp/panel/workSupervision/list.vue
+50
-0
No files found.
src/mocp/api/workSupervision.js
0 → 100644
View file @
96e7742d
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
})
}
src/mocp/components/global-checkbox/global-checkbox.vue
View file @
96e7742d
...
@@ -6,8 +6,8 @@
...
@@ -6,8 +6,8 @@
:customStyle=
"getCustomStyle"
:customStyle=
"getCustomStyle"
v-for=
"(item, index) in getColumns"
v-for=
"(item, index) in getColumns"
:key=
"index"
:key=
"index"
:label=
"item
.label
"
:label=
"item
[labelField]
"
:name=
"item
.value
"
:name=
"item
[valueField]
"
></up-checkbox>
></up-checkbox>
</up-checkbox-group>
</up-checkbox-group>
</view>
</view>
...
...
src/mocp/components/global-page/global-page.vue
View file @
96e7742d
...
@@ -346,6 +346,8 @@ const queryList = (pageIndex, pageSize) => {
...
@@ -346,6 +346,8 @@ const queryList = (pageIndex, pageSize) => {
}
else
{
}
else
{
if
(
ps
.
localData
)
{
if
(
ps
.
localData
)
{
paging
.
value
?.
complete
(
ps
.
localData
||
[])
paging
.
value
?.
complete
(
ps
.
localData
||
[])
}
else
if
(
ps
.
showEmpty
)
{
paging
.
value
?.
complete
([])
}
else
{
}
else
{
paging
.
value
?.
complete
(
true
)
paging
.
value
?.
complete
(
true
)
}
}
...
...
src/mocp/components/global-radio/global-radio.vue
View file @
96e7742d
...
@@ -9,7 +9,13 @@
...
@@ -9,7 +9,13 @@
:disabled=
"disabled"
:disabled=
"disabled"
:borderBottom=
"borderBottom"
: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>
</up-radio-group>
</
template
>
</
template
>
...
@@ -91,9 +97,12 @@ const getAlign = computed(() => {
...
@@ -91,9 +97,12 @@ const getAlign = computed(() => {
return
radioAlign
return
radioAlign
})
})
const
getStyle
=
computed
(()
=>
{
const
getStyle
=
computed
(()
=>
{
return
{
const
_style
=
{}
justifyContent
:
getAlign
.
value
_style
.
justifyContent
=
getAlign
.
value
if
(
ps
.
placement
==
'column'
)
{
_style
.
marginTop
=
'16rpx'
}
}
return
_style
})
})
const
getCustomStyle
=
computed
(()
=>
{
const
getCustomStyle
=
computed
(()
=>
{
const
_style
=
{
const
_style
=
{
...
@@ -146,4 +155,10 @@ const radioChange = (value) => {
...
@@ -146,4 +155,10 @@ const radioChange = (value) => {
es
(
'change'
,
value
)
es
(
'change'
,
value
)
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
scoped
></
style
>
<
style
lang=
"scss"
>
:deep
(
.radio-group
)
{
.
u-radio
:
last-child
{
margin-bottom
:
0
!important
;
}
}
</
style
>
src/mocp/store/user.js
View file @
96e7742d
...
@@ -30,7 +30,7 @@ const menuList = ref([
...
@@ -30,7 +30,7 @@ const menuList = ref([
{
id
:
'gcfx'
,
name
:
'工程分析'
,
icon
:
'gcfx'
,
group
:
'运行品质'
,
default
:
false
,
count
:
0
},
{
id
:
'gcfx'
,
name
:
'工程分析'
,
icon
:
'gcfx'
,
group
:
'运行品质'
,
default
:
false
,
count
:
0
},
// 航站管理
// 航站管理
{
id
:
'hzgl'
,
name
:
'航站管理'
,
icon
:
'hzgl'
,
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'
,
{
const
useUserStore
=
defineStore
(
'mocpUser'
,
{
state
:
()
=>
{
state
:
()
=>
{
...
...
src/pages.json
View file @
96e7742d
...
@@ -542,6 +542,18 @@
...
@@ -542,6 +542,18 @@
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"编辑航站不正常事件"
"navigationBarTitleText"
:
"编辑航站不正常事件"
}
}
},
{
"path"
:
"pages/modules/mocp/panel/workSupervision/list"
,
"style"
:
{
"navigationBarTitleText"
:
"协议单位工作监察"
}
},
{
"path"
:
"pages/modules/mocp/panel/workSupervision/answerQuestion"
,
"style"
:
{
"navigationBarTitleText"
:
"答题"
}
}
}
],
],
"globalStyle"
:
{
"globalStyle"
:
{
...
...
src/pages/modules/mocp/panel/app-center/index.vue
View file @
96e7742d
...
@@ -98,6 +98,12 @@ const handleHomeMenu = (menu, type) => {
...
@@ -98,6 +98,12 @@ const handleHomeMenu = (menu, type) => {
}
else
{
}
else
{
!
menu
.
isHome
&&
homeMenuList
.
value
.
push
(
menu
)
!
menu
.
isHome
&&
homeMenuList
.
value
.
push
(
menu
)
}
}
}
else
{
if
(
menu
.
url
)
{
uni
.
$mocpJump
.
navigateTo
(
menu
.
url
)
}
else
{
uni
.
$mocpMessage
.
warning
(
'暂未开放!'
)
}
}
}
}
}
//获取全部应用
//获取全部应用
...
...
src/pages/modules/mocp/panel/electronicBill/deicing/add.vue
View file @
96e7742d
...
@@ -41,10 +41,10 @@
...
@@ -41,10 +41,10 @@
<up-form-item
label=
"机型类别"
prop=
"modelType"
:borderBottom=
"true"
required
>
<up-form-item
label=
"机型类别"
prop=
"modelType"
:borderBottom=
"true"
required
>
<global-picker
pickAlign=
"right"
v-model=
"formData.modelType"
dictkey=
"eb_modelType"
clearable
></global-picker>
<global-picker
pickAlign=
"right"
v-model=
"formData.modelType"
dictkey=
"eb_modelType"
clearable
></global-picker>
</up-form-item>
</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-input
v-model=
"formData.flightNoIn"
inputAlign=
"right"
border=
"none"
placeholder=
"请输入"
clearable
></up-input>
</up-form-item>
</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-input
v-model=
"formData.flightNoOut"
inputAlign=
"right"
border=
"none"
placeholder=
"请输入"
clearable
></up-input>
</up-form-item>
</up-form-item>
</view>
</view>
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
<global-switch
v-model=
"formData.originalAircraftPositionDeicing"
></global-switch>
<global-switch
v-model=
"formData.originalAircraftPositionDeicing"
></global-switch>
</view>
</view>
<view
class=
"mocp-switch"
>
<view
class=
"mocp-switch"
>
<view
class=
"mocp-switch-label"
>
是否包含
预除冰
</view>
<view
class=
"mocp-switch-label"
>
预除冰
</view>
<global-switch
v-model=
"formData.expectDeicing"
></global-switch>
<global-switch
v-model=
"formData.expectDeicing"
></global-switch>
</view>
</view>
</view>
</view>
...
...
src/pages/modules/mocp/panel/electronicBill/deicing/constants/add.compositions.js
View file @
96e7742d
...
@@ -137,6 +137,13 @@ export const rules = reactive({
...
@@ -137,6 +137,13 @@ export const rules = reactive({
message
:
'请选择机型类别'
,
message
:
'请选择机型类别'
,
trigger
:
[
'blur'
,
'change'
]
trigger
:
[
'blur'
,
'change'
]
}
}
],
flightNoOut
:
[
{
required
:
true
,
message
:
'请选择出港航班号'
,
trigger
:
[
'blur'
,
'change'
]
}
]
]
})
})
export
const
formRef
=
ref
()
export
const
formRef
=
ref
()
...
...
src/pages/modules/mocp/panel/electronicBill/deicing/constants/add.functionals.js
View file @
96e7742d
...
@@ -140,6 +140,8 @@ export const submitDeicing = () => {
...
@@ -140,6 +140,8 @@ export const submitDeicing = () => {
if
(
formData
.
deicingQuantityTotal
&&
formData
.
deicingQuantityTotal
>
0
)
{
if
(
formData
.
deicingQuantityTotal
&&
formData
.
deicingQuantityTotal
>
0
)
{
if
(
formData
.
deicingQuantityTotal
>
limit
[
1
])
{
if
(
formData
.
deicingQuantityTotal
>
limit
[
1
])
{
showDeicing
.
value
=
true
showDeicing
.
value
=
true
}
else
{
showToast
(
'提交成功'
)
}
}
}
}
}
}
...
@@ -160,6 +162,8 @@ export const submitAntiicing = () => {
...
@@ -160,6 +162,8 @@ export const submitAntiicing = () => {
if
(
formData
.
antiicingQuantityTotal
&&
formData
.
antiicingQuantityTotal
>
0
)
{
if
(
formData
.
antiicingQuantityTotal
&&
formData
.
antiicingQuantityTotal
>
0
)
{
if
(
formData
.
antiicingQuantityTotal
>
limit
[
1
])
{
if
(
formData
.
antiicingQuantityTotal
>
limit
[
1
])
{
showAntiicing
.
value
=
true
showAntiicing
.
value
=
true
}
else
{
showToast
(
'提交成功'
)
}
}
}
}
}
}
...
...
src/pages/modules/mocp/panel/workSupervision/answerQuestion.vue
0 → 100644
View file @
96e7742d
<
template
>
<global-page
:title=
"templateDetail?.templateName"
navLeftType=
"text"
:showNavRight=
"formData?.length > 0"
navRightType=
"button"
navRightText=
"提交"
:showEmpty=
"!templateDetail?.questionList?.length"
@
handleRightClick=
"handleSubmit"
>
<view
class=
"mocp-form"
v-if=
"formData?.length > 0"
>
<up-form
labelPosition=
"left"
labelWidth=
"auto"
:model=
"formData"
ref=
"formRef"
>
<template
v-for=
"(item, index) in templateDetail?.questionList"
:key=
"item.id"
>
<!-- 单项填空 -->
<template
v-if=
"item.quType == '0' && showQuestion(item)"
>
<up-form-item
:label=
"index + 1 + ',' + item.quName + (item.quDesc ? `[$
{item.quDesc}]` : '')"
labelPosition="top"
:borderBottom="true"
:required="item.required == '1'"
>
<up-textarea
v-model=
"formData[index].value"
placeholder=
"请输入"
:height=
"40"
border=
"none"
></up-textarea>
</up-form-item>
</
template
>
<!-- 单选|判断 -->
<
template
v-if=
"(item.quType == '1' || item.quType == '2') && showQuestion(item)"
>
<up-form-item
:label=
"index + 1 + ',' + item.quName + (item.quDesc ? `[$
{item.quDesc}]` : '')"
labelPosition="top"
:borderBottom="true"
:required="item.required == '1'"
>
<up-radio-group
placement=
"column"
v-model=
"formData[index].value"
>
<view
class=
"mocp-radio"
v-for=
"(option, optionIndex) in item.quRadioList"
:key=
"option.id"
>
<up-radio
:label=
"option.optionName"
:name=
"option.id"
></up-radio>
<view
class=
"mocp-input"
>
<up-input
placeholder=
"请输入"
clearable
v-if=
"option.isFillblank == '1' && formData[index].value?.includes(option.id)"
v-model=
"formData[index].quRadioList[optionIndex].value"
></up-input>
</view>
</view>
</up-radio-group>
</up-form-item>
</
template
>
<!-- 附件 -->
<
template
v-if=
"item.quType == '3' && showQuestion(item)"
>
<up-form-item
:label=
"index + 1 + ',' + item.quName + (item.quDesc ? `[$
{item.quDesc}]` : '')"
:borderBottom="true"
:required="item.required == '1'"
labelPosition="top"
>
<view
style=
"margin-top: 16rpx"
>
<global-upload-image
v-model=
"formData[index].value"
map-field-name=
"id"
></global-upload-image>
</view>
</up-form-item>
</
template
>
<!-- 多选 -->
<
template
v-if=
"item.quType == '4' && showQuestion(item)"
>
<up-form-item
:label=
"index + 1 + ',' + item.quName + (item.quDesc ? `[$
{item.quDesc}]` : '')"
labelPosition="top"
:borderBottom="true"
:required="item.required == '1'"
>
<up-checkbox-group
placement=
"column"
v-model=
"formData[index].value"
>
<view
class=
"mocp-checkbox"
v-for=
"option in item.quRadioList"
:key=
"option.id"
>
<up-checkbox
:label=
"option.optionName"
:name=
"option.id"
></up-checkbox>
<view
class=
"mocp-input"
>
<up-input
placeholder=
"请输入"
clearable
v-if=
"option.isFillblank == '1' && formData[index].value?.includes(option.id)"
v-model=
"formData[index].quRadioList[optionIndex].value"
></up-input>
</view>
</view>
</up-checkbox-group>
</up-form-item>
</
template
>
<!-- 多项填空 -->
<
template
v-if=
"item.quType == '5' && showQuestion(item)"
>
<template
v-for=
"(_item, _index) in item.quName?.split('##
{input}##')" :key="_index">
<up-form-item
v-if=
"_item"
:label=
"
_index == 0
? `$
{index + 1 + ',' + _item}` + (item.quDesc ? `[${item.quDesc}]` : '')
: `${' ' + _item}` + (item.quDesc ? `[${item.quDesc}]` : '')
"
:borderBottom="true"
:required="item.required == '1'"
>
<up-input
inputAlign=
"right"
border=
"none"
placeholder=
"请输入"
clearable
v-model=
"formData[index].inputList[_index].value"
></up-input>
</up-form-item>
</
template
>
</template>
<!-- 日期 -->
<
template
v-if=
"item.quType == '6' && showQuestion(item)"
>
<up-form-item
:label=
"index + 1 + ',' + item.quName + (item.quDesc ? `[$
{item.quDesc}]` : '')"
:borderBottom="true"
:required="item.required == '1'"
>
<global-date
v-model=
"formData[index].value"
pickAlign=
"right"
clearable
></global-date>
</up-form-item>
</
template
>
<!-- 下拉框 -->
<
template
v-if=
"item.quType == '7' && showQuestion(item)"
>
<up-form-item
:label=
"index + 1 + ',' + item.quName + (item.quDesc ? `[$
{item.quDesc}]` : '')"
:borderBottom="true"
:required="item.required == '1'"
>
<global-picker
v-model=
"formData[index].value"
pickAlign=
"right"
:options=
"item.quRadioList"
labelField=
"optionName"
valueField=
"id"
clearable
></global-picker>
</up-form-item>
</
template
>
</template>
</up-form>
</view>
</global-page>
</template>
<
script
setup
>
import
{
formData
,
formRef
,
templateDetail
}
from
'./constants/answerQuestion.compositions'
import
{
onLoad
}
from
'@dcloudio/uni-app'
import
{
getParams
,
getSurveyTemplateDetail
}
from
'./constants/answerQuestion.functionals'
import
{
computed
}
from
'vue'
import
{
submitAnswersApi
}
from
'mocp/api/workSupervision'
defineOptions
({
name
:
'AnswerQuestion'
})
//初始化
const
query
=
defineProps
([
'templateId'
])
onLoad
(()
=>
{
getSurveyTemplateDetail
(
query
.
templateId
)
})
// 验证
const
validateQuestions
=
()
=>
{
const
questions
=
formData
.
value
for
(
let
i
=
0
;
i
<
questions
.
length
;
i
++
)
{
const
question
=
questions
[
i
]
if
(
showQuestion
(
question
)
&&
question
.
required
==
'1'
)
{
if
(
question
.
quType
===
'5'
)
{
// 多项填空
if
(
question
.
inputList
&&
question
.
inputList
.
length
>
0
)
{
if
(
!
question
.
inputList
.
every
((
input
)
=>
input
.
value
.
trim
()
!==
''
))
{
return
{
index
:
i
,
question
:
question
}
}
}
}
else
{
// 单项填空|附件|日期|下拉框|单选|判断|多选
if
(
!
question
.
value
)
{
return
{
index
:
i
,
question
:
question
}
}
}
}
}
return
null
}
//提交
const
handleSubmit
=
async
()
=>
{
const
validate
=
validateQuestions
()
if
(
validate
)
{
return
uni
.
$mocpMessage
.
warning
(
`请填写第
${
validate
.
index
+
1
}
题`
)
}
const
params
=
getParams
(
query
)
const
res
=
await
submitAnswersApi
(
params
,
{
loading
:
'提交中...'
})
if
(
res
.
code
==
200
)
{
uni
.
$mocpJump
.
navigateBack
()
uni
.
$mocpMessage
.
success
(
'提交成功'
)
}
else
{
uni
.
$mocpMessage
.
error
(
res
.
message
)
}
}
//回答选择的题ID(单选题和多选题)
const
getCgQuItemId
=
computed
(()
=>
{
const
getCgQuItemId
=
[]
formData
.
value
.
forEach
((
item
)
=>
{
if
([
'1'
,
'2'
,
'4'
].
includes
(
item
.
quType
)
&&
item
.
value
)
{
getCgQuItemId
.
push
(
item
.
value
)
}
})
return
getCgQuItemId
})
//是否展示题目
const
showQuestion
=
(
question
)
=>
{
return
(
question
.
display
==
'1'
&&
!
question
.
cgQuItemId
)
||
(
question
.
cgQuItemId
&&
getCgQuItemId
.
value
.
includes
(
question
.
cgQuItemId
))
}
</
script
>
<
style
lang=
"scss"
scoped
>
.mocp-radio
,
.mocp-checkbox
{
display
:
flex
;
align-items
:
center
;
margin-top
:
16
rpx
;
}
.mocp-input
{
margin-left
:
16
rpx
;
}
.mocp-form
{
background
:
#fff
;
margin-bottom
:
24
rpx
;
padding
:
0
32
rpx
;
}
</
style
>
src/pages/modules/mocp/panel/workSupervision/constants/answerQuestion.compositions.js
0 → 100644
View file @
96e7742d
import
{
ref
}
from
'vue'
export
const
formData
=
ref
([])
export
const
formRef
=
ref
()
export
const
templateDetail
=
ref
()
src/pages/modules/mocp/panel/workSupervision/constants/answerQuestion.functionals.js
0 → 100644
View file @
96e7742d
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
}
}
src/pages/modules/mocp/panel/workSupervision/list.vue
0 → 100644
View file @
96e7742d
<
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
:
16
rpx
;
border-radius
:
12
rpx
;
padding
:
24
rpx
;
font-size
:
28
rpx
;
color
:
$
mocp-text-5
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment