黑龙江民政考核评分基本完成

This commit is contained in:
aixianling
2022-10-24 18:03:11 +08:00
parent 9ef85056d8
commit e17b089c44
7 changed files with 278 additions and 37 deletions

View File

@@ -36,7 +36,8 @@ export default {
}, },
isPreview() { isPreview() {
return !!this.$route.query?.preview return !!this.$route.query?.preview
} },
action: v => v.$route.query.action || "appquestionnairetemplate"
}, },
methods: { methods: {
...mapActions(['getCode', 'getToken']), ...mapActions(['getCode', 'getToken']),
@@ -45,7 +46,7 @@ export default {
if (this.isPreview) { if (this.isPreview) {
this.access = true this.access = true
} else if (!!this.user.token) { } else if (!!this.user.token) {
this.$http.post("/app/appquestionnairetemplate/commitCheck", null, { this.$http.post(`/app/${this.action}/commitCheck`, null, {
params: {id} params: {id}
}).then(res => { }).then(res => {
if (res?.code == 0) { if (res?.code == 0) {

View File

@@ -80,7 +80,8 @@ export default {
}, },
isPreview() { isPreview() {
return !!this.$route.query?.preview return !!this.$route.query?.preview
} },
action: v => v.$route.query.action || "appquestionnairetemplate"
}, },
data() { data() {
return { return {
@@ -113,7 +114,7 @@ export default {
...mapMutations(['logout']), ...mapMutations(['logout']),
getForm() { getForm() {
let {id} = this.$route.query let {id} = this.$route.query
this.$http.post("/app/appquestionnairetemplate/queryDetailById", null, { this.$http.post(`/app/${this.action}/queryDetailById`, null, {
withoutToken: true, withoutToken: true,
params: {id} params: {id}
}).then(res => { }).then(res => {
@@ -124,7 +125,7 @@ export default {
}, },
getResult() { getResult() {
let {id} = this.$route.query let {id} = this.$route.query
this.$http.post("/app/appquestionnairetemplate/commitCheck", null, { this.$http.post(`/app/${this.action}/commitCheck`, null, {
params: {id} params: {id}
}).then(res => { }).then(res => {
if (res?.data) { if (res?.data) {
@@ -144,7 +145,7 @@ export default {
if (this.validateForm()) { if (this.validateForm()) {
this.handleScore() this.handleScore()
let {avatar: avatarUrl, openId, name: nickName, type: userType, unionId, corpName} = this.openUser let {avatar: avatarUrl, openId, name: nickName, type: userType, unionId, corpName} = this.openUser
this.$http.post("/app/appquestionnairetemplate/commit", { this.$http.post(`/app/${this.action}/commit`, {
fields: this.fields.map(e => ({ fields: this.fields.map(e => ({
...e, ...e,
fieldInfo: JSON.stringify(e.fieldInfo), fieldInfo: JSON.stringify(e.fieldInfo),

View File

@@ -1,5 +1,6 @@
<template> <template>
<section class="AiGroup"> <section class="AiGroup" :class="{noBorder,description}" :style="{paddingLeft:left+'rpx'}">
<div class="groupHeader" v-if="title" v-text="title"/>
<slot/> <slot/>
</section> </section>
</template> </template>
@@ -7,11 +8,25 @@
<script> <script>
export default { export default {
name: "AiGroup", name: "AiGroup",
data() { provide() {
return {} return {
labelColor: this.labelColor,
description: this.description,
activeStep: this.activeStep
}
}, },
methods: {}, props: {
created() { title: String,
noBorder: Boolean,
left: {default: 32},
labelColor: {default: "#333"},
description: {default: false}, //用于展示则不会又红星,会把标签的内间距去掉
activeStep: {default: 1}//用于步骤组件的当前步数
},
data() {
return {
items: []
}
} }
} }
</script> </script>
@@ -20,10 +35,27 @@ export default {
.AiGroup { .AiGroup {
background: #FFFFFF; background: #FFFFFF;
box-shadow: inset 0px -1px 0px 0px #DDDDDD; box-shadow: inset 0px -1px 0px 0px #DDDDDD;
padding-left: 32px;
&.noBorder {
box-shadow: none;
}
& + .AiGroup { & + .AiGroup {
margin-top: 16px; margin-top: 16px;
} }
.groupHeader {
font-weight: bold;
font-size: 36px;
padding-left: 20px;
margin-bottom: 16px;
}
&.description {
.groupHeader {
padding-left: 0;
}
}
} }
</style> </style>

View File

@@ -1,22 +1,28 @@
<template> <template>
<section class="AiItem" :class="{border}"> <section class="AiItem" :class="{border,readonly}">
<div v-if="topLabel" class="topLabel"> <div v-if="topLabel" class="topLabel">
<div class="labelPane" flex> <div class="labelPane flex">
<div class="label" :class="{required,labelBold}" v-text="label"/> <slot v-if="$slots.label" name="label"/>
<slot name="sub" v-if="$scopedSlots.sub"/> <template v-else>
<div class="label" :class="{required,labelBold}" :style="{color}" v-text="label"/>
<slot name="sub" v-if="$slots.sub"/>
</template>
</div> </div>
<div class="content"> <div class="itemContent">
<slot v-if="$scopedSlots.default"/> <slot v-if="$slots.default"/>
<div v-else v-text="value"/> <div v-else v-text="value"/>
</div> </div>
</div> </div>
<div v-else class="normal" flex> <div v-else class="normal flex">
<div class="fill" flex> <div class="fill flex">
<div class="label" :class="{required,labelBold}" v-text="label"/> <slot v-if="$slots.label" name="label"/>
<slot name="sub" v-if="$scopedSlots.sub"/> <template v-else>
<div class="label" :class="{required,labelBold}" :style="{color}" v-text="label"/>
<slot name="sub" v-if="$slots.sub"/>
</template>
</div> </div>
<div class="flexContent"> <div class="flexContent">
<slot v-if="$scopedSlots.default"/> <slot v-if="$slots.default"/>
<div v-else v-text="value"/> <div v-else v-text="value"/>
</div> </div>
</div> </div>
@@ -26,16 +32,21 @@
<script> <script>
export default { export default {
name: "AiItem", name: "AiItem",
inject: {
labelColor: {default: "#333"},
description: {default: false}
},
props: { props: {
value: {default: ""}, value: {default: ""},
label: {default: ""}, label: {default: ""},
required: Boolean, required: Boolean,
topLabel: Boolean, topLabel: Boolean,
border: {default: true}, border: {default: true},
labelBold: Boolean labelBold: Boolean,
}, },
data() { computed: {
return {} color: v => v.labelColor,
readonly: v => !!v.description
} }
} }
</script> </script>
@@ -43,7 +54,6 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.AiItem { .AiItem {
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
width: 100%;
&.border { &.border {
.normal { .normal {
@@ -63,17 +73,12 @@ export default {
.flexContent { .flexContent {
max-width: 62vw; max-width: 62vw;
input {
text-align: right;
}
} }
} }
.label { .label {
padding-left: 20px; padding-left: 20px;
font-weight: 400; font-weight: 400;
color: #333333;
margin-right: 20px; margin-right: 20px;
position: relative; position: relative;
@@ -100,7 +105,7 @@ export default {
margin-bottom: 32px; margin-bottom: 32px;
} }
.content { .itemContent {
padding-left: 20px; padding-left: 20px;
.AiMore > .u-icon { .AiMore > .u-icon {
@@ -108,5 +113,18 @@ export default {
} }
} }
} }
//展示模式下的特有样式
&.readonly {
.label, .itemContent {
padding-left: 0;
}
}
.AiStep:last-of-type {
.stepLine {
display: none
}
}
} }
</style> </style>

View File

@@ -0,0 +1,91 @@
<template>
<section class="AppAssessmentScoreTask">
<AiGroup>
<div v-for="item in list" :key="item.id" class="listItem pad-r32" flex @click="handleDetail(item.id)">
<div class="fill mar-r20">
<h3 class="mar-b8" v-text="item.templateName"/>
<div class="sub" v-text="item.taskTitle"/>
</div>
<div class="status" :class="{finish:item.unfinishedCount==0}">{{ item.unfinishedCount == 0 ? '已完成' : '尚未完成' }}</div>
</div>
</AiGroup>
<AiEmpty class="pad-t96" v-if="!list.length"/>
</section>
</template>
<script>
export default {
name: "AppAssessmentScoreTask",
appName: "考核评分",
data() {
return {
current: 1,
total: 0,
list: []
}
},
methods: {
getList() {
const {current, total, list} = this
if (current == 1 || list.length < total) {
this.getTasks()
}
},
getTasks() {
const {current} = this
this.$http.post("/app/appassessmentscortask/myTaskList", null, {
params: {size: 999, current}
}).then(res => {
if (res?.data) {
this.list = [this.list, res.data.records].flat().filter(Boolean)
this.total = res.data.total
}
})
},
handleDetail(id) {
uni.navigateTo({url: "./astDetail?id=" + id})
}
},
onShow() {
this.getList()
},
onReachBottom() {
this.current++
this.getList()
}
}
</script>
<style lang="scss" scoped>
.AppAssessmentScoreTask {
background: #f5f5f5;
.listItem {
height: 160px;
justify-content: space-between;
.sub {
font-size: 26px;
color: #3975C6;
line-height: 36px;
}
& > h3 {
font-size: 32px;
color: #333;
line-height: 44px;
}
.status {
font-size: 18px;
color: #FFA938;
&.finish {
color: #1CCEB0;
}
}
}
}
</style>

View File

@@ -0,0 +1,97 @@
<template>
<section class="astDetail">
<AiGroup left="48" class="header mar-b16">
<h3 flex class="mar-b8">{{ detail.templateName }}</h3>
<div class="color-999">开始日期{{ $dateFormat(detail.beginTime, "YYYY-MM-DD HH:mm") }}</div>
<div class="color-999">截止日期{{ $dateFormat(detail.endTime, "YYYY-MM-DD HH:mm") }}</div>
</AiGroup>
<AiGroup title="参评人员" description class="pad-t32">
<div flex class="pad-r32 pad-t16 pad-b16" v-for="item in list" :key="item.id" @click="handleScore(item.id)">
<div flex class="fill">
<ai-image class="mar-r32" :src="item.evaluatorsAvatar"/>
<div>
<h4>{{ item.evaluatorsName }}</h4>
<div class="color-999">{{ item.evaluatorsDepartments }}</div>
</div>
</div>
<div class="result" :class="{finish:item.status==1}">{{ item.status == 1 ? `${item.totalScore || 0}` : "去填报" }}</div>
</div>
<AiEmpty class="pad-b32" v-if="!list.length"/>
</AiGroup>
</section>
</template>
<script>
export default {
name: "astDetail",
appName: "评分任务",
data() {
return {
detail: {},
current: 1,
total: 0,
list: []
}
},
methods: {
getDetail() {
const {id} = this.$route.query
this.$http.post("/app/appassessmentscortask/taskTemplateDetail", null, {
params: {id}
}).then(res => {
if (res?.data) {
this.detail = res.data
}
})
},
getList() {
const {id} = this.$route.query,
{current, list, total} = this
if (current == 1 || list.length < total) {
this.$http.post("/app/appassessmentscortask/myScoreList", null, {
params: {id, size: 999, current}
}).then(res => {
if (res?.data) {
this.list = [this.list, res.data.records].flat().filter(Boolean)
this.total = res.data.total
}
})
}
},
handleScore(id) {
uni.navigateTo({url: `/apps/AppAskForm/AppForm?id=${id}&action=${appassessmentscortask}`})
}
},
onShow() {
this.getDetail()
this.getList()
},
onReachBottom() {
this.current++
this.getList()
}
}
</script>
<style lang="scss" scoped>
.astDetail {
background: #f5f5f5;
.header {
padding: 32px 0;
}
h3 {
font-size: 40px;
min-height: 56px;
}
.result {
color: #FFA938;
.finish {
color: #2C51CE;
}
}
}
</style>

View File

@@ -13,7 +13,7 @@
*/ */
@each $padMar, $pm in (mar:margin, pad:padding) { @each $padMar, $pm in (mar:margin, pad:padding) {
@each $pos, $p in (l:left, r:right, t:top, b:bottom) { @each $pos, $p in (l:left, r:right, t:top, b:bottom) {
@each $v in (8, 10, 16, 32) { @each $v in (8, 10, 16, 32, 64, 96) {
.#{$padMar}-#{$pos+$v} { .#{$padMar}-#{$pos+$v} {
#{$pm}-#{$p}: #{$v}px #{$pm}-#{$p}: #{$v}px
} }
@@ -51,6 +51,7 @@ div[shrink] {
min-width: 0; min-width: 0;
min-height: 0; min-height: 0;
} }
.t-center{
.t-center {
text-align: center; text-align: center;
} }