Files
laws_weilai/jero-web/src/views/processCenter/processForm/evaluationProcess/index.vue
T

367 lines
12 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div id="examineBox">
<headerProcess
:title="title"
/>
<div class="detail-box">
<div class="detail-content" style="padding: 10px 0 0 0">
<standardContent
v-if="isDisplay"
:title="$t('essentialInformation')"
:standardContentList="standardContentList"
:url="url"
:standardContentQuery="queryProject"
/>
<evaluatorFeedback
v-if="isDisplay && !isTrue"
ref="evaluatorFeedbackRef"
:complianceResult="complianceResult"
:feedbackDataList="feedbackDataList"
:title="$t('evaluatorFeedback')"
/>
<evaluatorFeedbackList
v-if="isDisplay && isTrue"
:evaluatorFeedbackList="evaluatorFeedbackList"
ref="evaluatorFeedbackListRef"
:title="$t('evaluatorFeedback')"
/>
<footerProcess
v-if="isDisplay && !disabled"
:isPreservation="isPreservation"
:isSubmit="true"
:isSendBack="isSendBack"
@preservation="preservation"
@submit="submit"
@sendBack="sendBack"
/>
<circulationHistory :isTrue="true" v-if="isDisplay"/>
</div>
</div>
<JLoading :loading="loading">{{this.$t('pleaseWaitWhileRunning')}}</JLoading>
</div>
</template>
<script>
import headerProcess from '../../components/headerProcess'
import standardContent from '../../components/standardContent'
import circulationHistory from '../../components/regulatoryCirculationHistory'
import footerProcess from '../../components/footerProcess'
import evaluatorFeedback from '../../components/evaluatorFeedback'
import evaluatorFeedbackList from '../../components/evaluatorFeedbackList'
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
import moment from 'moment'
import { mapGetters } from 'vuex'
export default {
name: 'evaluationProcess',
components: {
headerProcess,
standardContent,
circulationHistory,
footerProcess,
evaluatorFeedback,
evaluatorFeedbackList
},
data() {
return {
title: this.$t('regulatoryTechnicalAssessment'),
url: {
queryTaskDetailByTaskIds: '/task/queryTaskDetailByTaskIds',
list: '/lawsTechnologyEvaluation/lawsTechnologyEvaluationResultEO/queryEvaluationResultAndComplianceResult'
},
loading: false,
isDisplay: true,
feedbackDataList: [],
queryProject: {},
evaluatorFeedbackList: [],
complianceResult: {},
isPreservation: false,
isSendBack: false,
isTrue: false,
disabled:false,
standardContentList: [],
standardContent: [
{
title: this.$t('standard'),
value: 'serialNumber',
type: 5
},
{
title: this.$t('title'),
value: localStorage.getItem('language') && localStorage.getItem('language') == 'zh-cn'?'title':'title_en'
},
{
title: this.$t('regulatoryEngineer'),
value: 'regulationOwnerName'
},
{
title: this.$t('closingDate'),
value: 'endTime'
},
{
title: this.$t('evaluationMethod'),
value: 'evaluationMethodsName'
},
{
title: this.$t('RelevantMaterials'),
value: 'relatedDataFileId',
type: 2
},
{
title: this.$t('processBackground'),
value: 'processBackground',
type: 4
}
],
evaluatorFeedback: [
{
title: this.$t('standard'),
value: 'serialNumber',
type: 5
},
{
title: this.$t('title'),
value: 'title'
},
{
title: this.$t('regulatoryEngineer'),
value: 'regulationOwnerName'
},
{
title: this.$t('closingDate'),
value: 'endTime'
},
{
title: this.$t('RelevantMaterials'),
value: 'relatedDataFileId',
type: 2
},
{},
{
title: this.$t('processBackground'),
value: 'processBackground',
type: 4
}
]
}
},
mounted() {
document.title = this.$t('regulatoryTechnicalAssessment')
this.isDisplay = false
if (this.$route.query.taskDefinitionKey == 'pgrqr') {
this.isPreservation = true
this.isSendBack = false
} else {
this.isPreservation = false
this.isSendBack = true
}
this.queryTaskDetailByTask()
if (this.$route.query.isDisabled) {
this.disabled = JSON.parse(this.$route.query.isDisabled)
}
},
methods: {
...mapGetters(['userInfo']),
queryTaskDetailByTask() {
this.loading = true
getAction(this.url.queryTaskDetailByTaskIds, { taskIds: this.$route.query.taskIds }).then((res) => {
if (res instanceof String) {
this.queryProject = JSON.parse(res) || {}
} else {
this.queryProject = res || {}
}
this.isTrue = this.queryProject.evaluationType == 'Feedback evaluation' ? false : true
if (this.isTrue) {
this.standardContentList = this.evaluatorFeedback
this.lawsTechnologyEvaluationItem()
} else {
this.standardContentList = this.standardContent
this.lawsOpinionAssessmentResult()
}
})
},
lawsTechnologyEvaluationItem() {
getAction('/lawsTechnologyEvaluation/lawsTechnologyEvaluationItemResultEO/list', {
lawsTechnologyEvaluationId: this.queryProject.lawsTechnologyEvaluationId,
actiProcInstId: this.$route.query.prcId
}).then((res) => {
if (res.success) {
this.evaluatorFeedbackList = res.result || []
this.loading = false
} else {
this.evaluatorFeedbackList = []
this.loading = false
}
this.isDisplay = true
})
},
lawsOpinionAssessmentResult() {
getAction(this.url.list, {
lawsTechnologyEvaluationId: this.queryProject.lawsTechnologyEvaluationId,
actiProcInstId: this.$route.query.prcId
}).then((res) => {
if (res.success) {
this.complianceResult = res.result.complianceResult || {}
this.feedbackDataList = res.result.evaluationResultEOList || []
this.loading = false
} else {
this.feedbackDataList = []
this.complianceResult = {}
this.loading = false
}
this.isDisplay = true
})
},
preservation() {
this.loading = true
if (this.isTrue) {
this.$refs.evaluatorFeedbackListRef.preservationData((res) => {
this.batchUpdate(res, 1)
})
} else {
this.$refs.evaluatorFeedbackRef.preservationData((res) => {
this.insertBatch(res, 1)
})
}
},
batchUpdate(val, num) {
let query = {
actiProcInstId: this.$route.query.prcId,
lawsTechnologyEvaluationId: this.queryProject.lawsTechnologyEvaluationId,
itemResultList: val
}
postAction('/lawsTechnologyEvaluation/lawsTechnologyEvaluationItemResultEO/batchUpdate', query).then((res) => {
if (res.success) {
if (num == 1) {
this.$message.success(this.$t('OperationSuccessful'))
this.loading = false
} else {
if (this.queryProject.msg) {
delete this.queryProject.msg
}
this.completeTask()
}
} else {
if (num == 1) {
this.loading = false
this.$message.warning(this.$t('operationFailed'))
}
}
})
},
insertBatch(val, num) {
let query = {
actiProcInstId: this.$route.query.prcId,
lawsTechnologyEvaluationId: this.queryProject.lawsTechnologyEvaluationId,
complianceResult: val.complianceResult,
evaluationResultList: val.dataList
}
postAction('/lawsTechnologyEvaluation/lawsTechnologyEvaluationResultEO/evaluatorSaveResult', query).then((res) => {
if (res.success) {
if (num == 1) {
this.$message.success(this.$t('OperationSuccessful'))
this.loading = false
} else {
this.completeTask()
}
} else {
if (num == 1) {
this.loading = false
this.$message.warning(this.$t('operationFailed'))
}
}
})
},
sendBack() {
if (this.isTrue) {
this.$refs.evaluatorFeedbackListRef.preservationData((res) => {
this.loading = true
this.queryProject.flag = '2'
this.batchUpdate(res, 2)
})
} else {
this.$refs.evaluatorFeedbackRef.preservationData((res) => {
this.loading = true
this.queryProject.approvalOpinion = res.approvalOpinion
this.queryProject.flag = '2'
this.completeTask()
})
}
},
submit() {
if (this.isTrue) {
this.$refs.evaluatorFeedbackListRef.submitData((res) => {
if (this.$route.query.taskDefinitionKey == 'pgrqr') {
this.loading = true
this.batchUpdate(res, 2)
} else {
this.loading = true
this.queryProject.flag = '1'
this.batchUpdate(res, 2)
}
})
} else {
this.$refs.evaluatorFeedbackRef.submitData((res) => {
if (this.$route.query.taskDefinitionKey == 'pgrqr') {
this.loading = true
this.insertBatch(res, 2)
} else {
this.loading = true
this.queryProject.approvalOpinion = res.approvalOpinion
this.queryProject.flag = '1'
this.completeTask()
}
})
}
},
completeTask() {
let value = JSON.parse(JSON.stringify(this.queryProject))
let handlingTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
value.handlingTime = handlingTime
Object.keys(value).forEach(res => {
if (value[res] && typeof value[res] == 'string') {
value[res] = value[res].replace(/\"/g, '“')
value[res] = value[res].replace(/\'/g, '')
}
})
let query = {
userid: this.userInfo().id,
taskId: this.$route.query.taskIds,
flag: this.queryProject.flag,
json: JSON.stringify(value).replace(/\"/g, '\'')
}
postAction('/workFlow/completeTask', query).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.loading = false
this.$router.push({
path: this.$route.query.router
})
} else {
this.loading = false
this.$message.warning(res.message)
}
})
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
.detail-box {
padding: 67px 0 0 0;
background: #ffffff;
height: 100%;
overflow: auto;
}
#examineBox {
display: flex;
flex-direction: column;
background: #fff;
position: relative;
height: 100%;
overflow-y: auto;
}
</style>