Files
laws_weilai/jero-web/src/views/processCenter/processForm/handshakeProcess/index.vue
T
2022-05-25 15:49:09 +08:00

296 lines
9.1 KiB
Java

<template>
<div id="examineBox">
<headerProcess
:title="$t('regulatoryCertificationTaskConfirmation')"
/>
<div class="detail-box">
<div class="detail-content">
<projectInformation
v-if="isDisplay"
:projectInformationList="projectInformationList"
:url="url"
:queryProject="queryProject"
:projectInformationId="this.queryBy.projectLibraryId"
/>
<standardContent
v-if="isDisplay"
:title="$t('TaskRequirements')"
:standardContentList="standardContentList"
:url="url"
:isConfirmationDeadline="true"
:standardContentQuery="queryProject"
/>
<standardContentListTable
v-if="isDisplay"
:standardContentListQuery="queryProject"
:url="url
"/>
<examineInformation
:isFlag="isFlag"
v-if="isDisplay"
isApprovalOpinion
:title="titleName"
ref="examineInformationRef"
:url="url"/>
<!-- @terminationProcess="terminationProcess"-->
<footerProcess
is-submit
:isSendBack="isSendBack"
@submit="submit"
@sendBack="sendBack"
/>
<circulationHistory v-if="isDisplay"/>
</div>
</div>
<JLoading :loading="loading">{{textLoading}}</JLoading>
</div>
</template>
<script>
import headerProcess from '../../components/headerProcess'
import footerProcess from '../../components/footerProcess'
import projectInformation from '../../components/projectInformation'
import standardContent from '../../components/standardContent'
import standardContentListTable from '../../components/standardContentList'
import examineInformation from '../../components/examineInformation'
import circulationHistory from '../../components/circulationHistory'
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
import { mapGetters } from 'vuex'
import moment from 'moment'
export default {
name: 'handshakeProcess',
components: {
headerProcess,
projectInformation,
standardContent,
standardContentListTable,
examineInformation,
circulationHistory,
footerProcess
},
data() {
return {
projectInformationList: [
{
title: this.$t('RelatedItems'),
value: 'projectName'
},
{
title: this.$t('targetMarket'),
value: 'targetMarket_dictText'
},
{},
{
title: this.$t('standard'),
value: 'serialNumber'
},
{
title: this.$t('title'),
value: 'title'
},
{
title: this.$t('subtitle'),
value: 'subtitle'
},
{
title: this.$t('areaOfResponsibility'),
value: 'dutyTerritory_dictText'
},
{
title: this.$t('applicableSupplement'),
value: 'applicableSupplement'
}
],
standardContentList: [],
url: {
urlFrom: 'project/projectLibraryBase/queryById',
queryProjectLawsInventoryInfoById: 'project/projectLawsInventoryEO/queryProjectLawsInventoryInfoById',
queryTaskDetailByTaskIds: '/task/queryTaskDetailByTaskIds'
},
queryBy: {},
isDisplay: false,
queryProject: {},
loading: false,
titleName: '',
textLoading: this.$t('dataLoading')
}
},
mounted() {
let _this = this
this.isDisplay = false
if (this.$route.query.taskDefinitionKey == 'dreqr') {
this.titleName = this.$t('engineerReply')
} else {
this.titleName = this.$t('confirmationEngineeringInterfacePerson')
}
this.queryTaskDetailByTask(function() {
_this.queryProjectLawsInventoryInfo()
})
},
computed: {
isSendBack() {
if (this.$route.query.taskDefinitionKey == 'zrrjsrw' || this.$route.query.taskDefinitionKey == 'zrrqr') {
return false
}
return true
},
isFlag() {
if (this.$route.query.taskDefinitionKey == 'dreqr') {
return false
}
return true
}
},
methods: {
...mapGetters(['userInfo']),
// terminationProcess(handlingTime) {
// this.textLoading = this.$t('terminationProcessing')
// this.loading = true
// this.completeTask({ flag: 2 }, handlingTime)
// },
submit(handlingTime) {
this.$refs.examineInformationRef.submit((res) => {
this.textLoading = this.$t('Submitting')
this.loading = true
if (!this.isFlag) {
res.flag = 0
}
this.completeTask(res, handlingTime)
})
},
sendBack(handlingTime) {
this.textLoading = this.$t('Returning')
this.loading = true
this.$refs.examineInformationRef.submitNoRule((res) => {
this.completeTask({ ...res,flag: 1 }, handlingTime,)
})
},
queryTaskDetailByTask(callback) {
this.loading = true
getAction(this.url.queryTaskDetailByTaskIds, { taskIds: this.$route.query.taskIds }).then((res) => {
if (res instanceof String) {
this.queryBy = JSON.parse(res)
callback()
} else {
this.queryBy = res
callback()
}
})
},
completeTask(value, handlingTime) {
let json = Object.assign(this.queryBy, { handlingTime: handlingTime }, value)
let data = JSON.stringify(json).replace(/\"/g, '\'')
let query = {
userid: this.userInfo().id,
taskId: this.$route.query.taskId || this.$route.query.taskIds,
json: data
}
postAction('/workFlow/completeTask', query).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.loading = false
if (this.$route.query.taskDefinitionKey == 'zrrjsrw' || this.$route.query.taskDefinitionKey == 'zrrqr') {
if (value.flag == 0) {
if (this.queryProject.verifyDeliverableType) {
this.startProcessDesign(this.queryBy, 4)
}
if (this.queryProject.prehomoDeliverableType) {
this.startProcessDesign(this.queryBy, 3)
}
if (this.queryProject.designDeliverableType) {
this.startProcessDesign(this.queryBy, 2)
}
if (!this.queryProject.verifyDeliverableType && !this.queryProject.prehomoDeliverableType &&
!this.queryProject.designDeliverableType) {
this.$router.push({
path: '/ProcessCenter'
})
}
} else {
this.$router.push({
path: '/ProcessCenter'
})
}
} else {
this.$router.push({
path: '/ProcessCenter'
})
}
} else {
this.loading = false
this.$message.warning(this.$t('operationFailed'))
}
})
},
startProcessDesign(value, num) {
let query = {
type: num,
msg: JSON.stringify(value).replace(/\"/g, '\'')
}
postAction('/workFlow/startProcess', query).then((res) => {
if (res.success) {
this.completeTaskDesign(value, res.result)
}
})
},
completeTaskDesign(value, taskId) {
value.reviewResult = 'launch'
let operatorTime = moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
value.operatorTime = operatorTime
let query = {
userid: this.userInfo().id,
taskId: taskId,
json: JSON.stringify(value).replace(/\"/g, '\'')
}
postAction('/workFlow/completeTask', query).then((res) => {
if (res.success) {
this.visible = false
// this.$message.success(this.$t('OperationSuccessful'))
this.$router.push({
path: '/ProcessCenter'
})
} else {
this.$message.warning(this.$t('operationFailed'))
}
})
},
queryProjectLawsInventoryInfo() {
let query = {
id: this.queryBy.id,
operatorType: 'taskAffirmQuery'
}
getAction(this.url.queryProjectLawsInventoryInfoById, query).then((res) => {
if (res.success) {
this.queryProject = res.result[0] || {}
this.loading = false
this.isDisplay = true
} else {
this.queryProject = {}
this.loading = false
this.isDisplay = true
}
})
}
}
}
</script>
<style lang="less" scoped>
.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>