考核任务完成
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
<template>
|
||||
<section class="AiBottomBtn">
|
||||
<slot v-if="$slots.default"/>
|
||||
<div class="transport" v-if="$slots.default">
|
||||
<slot/>
|
||||
</div>
|
||||
<u-gap v-else height="112"/>
|
||||
<div class="fixed" @click="$emit('click')">
|
||||
<slot v-if="$slots.default"/>
|
||||
@@ -36,5 +38,9 @@ export default {
|
||||
background: #1365DD;
|
||||
box-shadow: inset 0px 1px 0px 0px #EEEEEE;
|
||||
}
|
||||
|
||||
.transport {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -69,7 +69,7 @@ export default {
|
||||
},
|
||||
handleDetail(item) {
|
||||
const {taskId, taskDetailId} = item
|
||||
uni.navigateTo({url: this.$qs.stringifyUrl({url: "./rsDetail", query: {taskId, taskDetailId}})})
|
||||
uni.navigateTo({url: this.$qs.stringifyUrl({url: "./rsDetail", query: {taskId, taskDetailId,approve:+(this.search.type==2)}})})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
@@ -15,19 +15,24 @@
|
||||
</AiItem>
|
||||
</template>
|
||||
</AiGroup>
|
||||
<AiBottomBtn text="提交" @click="submit"/>
|
||||
<AiBottomBtn>
|
||||
<div flex>
|
||||
<div class="fill reject" @click="handleReject">审批拒绝</div>
|
||||
<div class="fill text" @click="handlePass">审批通过</div>
|
||||
</div>
|
||||
</AiBottomBtn>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DynaComponent from "./lib/dynaComponent";
|
||||
|
||||
export default {
|
||||
name: "rsApproval",
|
||||
components: {DynaComponent},
|
||||
appName: "考核评分",
|
||||
data() {
|
||||
return {
|
||||
task: {},
|
||||
detail: [],//动态表单
|
||||
}
|
||||
},
|
||||
@@ -35,7 +40,7 @@ export default {
|
||||
form() {
|
||||
let form = {}
|
||||
this.detail.map(e => {
|
||||
if (e.inputType == "0") {
|
||||
if (e.inputType == "2") {
|
||||
if (!form[e.groupLevel1Name]) {
|
||||
form[e.groupLevel1Name] = {}
|
||||
}
|
||||
@@ -50,16 +55,6 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getTask() {
|
||||
const {taskId: id} = this.$route.query
|
||||
return this.$http.post("/app/appassessmentscorev2task/queryDetailById", null, {
|
||||
params: {id}
|
||||
}).then(res => {
|
||||
if (res?.data) {
|
||||
this.task = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
getDetail() {
|
||||
const {taskDetailId} = this.$route.query
|
||||
return this.$http.post("/app/appassessmentscorev2task/queryDataInfoById2", null, {
|
||||
@@ -77,8 +72,34 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
submit() {
|
||||
if (!this.detail.filter(e => e.inputType == '0')?.some(e => {
|
||||
handleReject() {
|
||||
if (this.check()) {
|
||||
const {$route: {query: {taskDetailId}}, detail: fields} = this
|
||||
this.$http.post("/app/appassessmentscorev2task/examine", {
|
||||
taskDetailId, pass: false, fields
|
||||
}).then(res => {
|
||||
if (res?.code == 0) {
|
||||
this.$u.toast("提交成功!")
|
||||
uni.navigateBack()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
handlePass() {
|
||||
if (this.check()) {
|
||||
const {$route: {query: {taskDetailId}}, detail: fields} = this
|
||||
this.$http.post("/app/appassessmentscorev2task/examine", {
|
||||
taskDetailId, pass: true, fields
|
||||
}).then(res => {
|
||||
if (res?.code == 0) {
|
||||
this.$u.toast("提交成功!")
|
||||
uni.navigateBack()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
check() {
|
||||
return !this.detail.filter(e => e.inputType == '0')?.some(e => {
|
||||
const desc = [e.groupLevel1Name, e.groupLevel2Name, e.fieldName].filter(Boolean)?.join("-")
|
||||
if (e.mustFill == 1 && !e.fieldValue) {
|
||||
this.$u.toast("请填写" + desc)
|
||||
@@ -87,22 +108,11 @@ export default {
|
||||
this.$u.toast(`${desc}请输入正确范围(0~${e.maxScore})`)
|
||||
return true
|
||||
} else return false
|
||||
})) {
|
||||
const {$route: {query: {taskDetailId, taskId}}, detail: fields} = this
|
||||
this.$http.post("/app/appassessmentscorev2task/commit", {
|
||||
taskDetailId, taskId, fields
|
||||
}).then(res => {
|
||||
if (res?.code == 0) {
|
||||
this.$u.toast("提交成功!")
|
||||
uni.navigateBack()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getDetail()
|
||||
this.getTask()
|
||||
},
|
||||
onShow() {
|
||||
document.title = this.$options.appName
|
||||
@@ -112,5 +122,39 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.rsApproval {
|
||||
.reject{
|
||||
font-family: PingFangSC-Medium, PingFang SC;
|
||||
line-height: 112px;
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
color: #f46;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
::v-deep .groupHeader {
|
||||
position: relative;
|
||||
|
||||
&:before {
|
||||
position: absolute;
|
||||
display: block;
|
||||
content: " ";
|
||||
width: 4px;
|
||||
height: 24px;
|
||||
background: #3975C6;
|
||||
left: -8px;
|
||||
top: 50%;
|
||||
transform: translate(-100%, -50%);
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .AiItem {
|
||||
.labelPane {
|
||||
flex-wrap: wrap;
|
||||
|
||||
.label {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -10,16 +10,17 @@
|
||||
<div class="subLabel" v-text="key"/>
|
||||
<AiItem v-for="row in item" :key="row.id" :label="row.fieldName" topLabel>
|
||||
<div class="mar-t8" slot="sub" v-if="row.explain" v-text="row.explain"/>
|
||||
<dyna-component :item.sync="row" @input="handleDetailItem"/>
|
||||
<dyna-component :item.sync="row" @input="handleDetailItem" :disabled="isApprove"/>
|
||||
</AiItem>
|
||||
</template>
|
||||
<AiItem v-else :label="item.fieldName" topLabel>
|
||||
<div class="mar-t8" slot="sub" v-if="item.explain" v-text="item.explain"/>
|
||||
<dyna-component :item.sync="item" @input="handleDetailItem"/>
|
||||
<dyna-component :item.sync="item" @input="handleDetailItem" :disabled="isApprove"/>
|
||||
</AiItem>
|
||||
</template>
|
||||
</AiGroup>
|
||||
<AiBottomBtn text="提交" @click="submit"/>
|
||||
<AiBottomBtn v-if="isApprove" text="评分审核" @click="gotoApprove"/>
|
||||
<AiBottomBtn v-else text="提交" @click="submit"/>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
@@ -37,6 +38,7 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isApprove:v=>v.$route.query.approve==1,
|
||||
form() {
|
||||
let form = {}
|
||||
this.detail.map(e => {
|
||||
@@ -103,6 +105,10 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
gotoApprove(){
|
||||
const {taskId,taskDetailId} = this.$route.query
|
||||
uni.navigateTo({url: this.$qs.stringifyUrl({url: "./rsApproval", query: {taskId, taskDetailId}})})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
Reference in New Issue
Block a user