Files
laws_weilai/jero-web/src/views/processCenter/components/examineInformation.vue
T
2022-11-01 15:59:37 +08:00

287 lines
8.0 KiB
Java

<template>
<div class="box">
<div class="box-text">
<div class="header-text">
{{title}}
</div>
</div>
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24" v-if="isFlag">
<a-col :span="24">
<div class="box-title-text">
<!-- <div class="title-text">-->
<!-- <span class="Required">*</span>-->
<!-- <span class="title-text-text" :title="$t('reviewResults')">{{$t('reviewResults')}}</span>-->
<!-- </div>-->
<a-form-model-item style="margin-left: 36px" class="itemModel" prop="flag">
<a-radio-group style="margin-top: 2px" @change="flagChange" class="box-input" v-model="formInline.flag">
<a-radio value="0">
{{$t('accept')}}
</a-radio>
<a-radio value="1">
{{$t('disagree')}}
</a-radio>
<a-radio value="3" v-if="issue">
{{$t('inquiry')}}
</a-radio>
<a-radio value="4" v-if="isSendBack">
{{$t('sendBack')}}
</a-radio>
</a-radio-group>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24" v-if="isTrue">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span class="title-text-text" :title="$t('selectInquiry')">{{$t('selectInquiry')}}</span>
</div>
<a-form-model-item class="itemModel" prop="dreUserIdName">
<PersonnelSelection class="box-input"
:personneQuery="formInline"
:query="{db_field_name:'dreUserId',db_field_txt:$t('selectInquiry')}"
:isInput="true"
:isSingleChoice="true"
@change="PersonnelSelectionChange"
v-model="formInline.dreUserIdName"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24" v-if="isApprovalOpinion">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('feedbackMessage')">{{$t('feedbackMessage')}}</span>
</div>
<a-form-model-item class="itemModel" prop="approvalOpinion">
<a-textarea :placeholder="$t('pleaseEnter')+$t('feedbackMessage')" v-model="formInline.approvalOpinion"
:rows="4"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24" v-if="isViewUploadedFiles">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('enclosure')">{{$t('enclosure')}}</span>
</div>
<a-form-model-item class="itemModel" prop="approvalFile">
<a-button type="primary" class="button-text"
@click="clickButtonToUpload('approvalFile')">
{{ (formInline.approvalFile === 'null' || formInline.approvalFile === '' ||
formInline.approvalFile == null) ? $t('clickUpload') : $t('viewUploadedFiles')
}}
</a-button>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"/>
</div>
</template>
<script>
import { getAction, postAction } from '@/api/manage'
import uploadFile from '@/components/uploadFile/file'
import PersonnelSelection from '@/components/PersonnelSelection/index'
export default {
name: 'examineInformation',
props: {
isFlag: {
type: Boolean,
default: false
},
isViewUploadedFiles: {
type: Boolean,
default: false
},
isApprovalOpinion: {
type: Boolean,
default: false
},
title: {
type: String,
default: ''
},
isSendBack:{
type: Boolean,
default: false
}
},
components: {
uploadFile,
PersonnelSelection
},
computed: {
issue() {
if (this.$route.query.taskDefinitionKey == 'zrrjsrw') {
return true
}
return false
}
},
data() {
return {
formInline: {},
isTrue: false,
rules: {
flag: [
{
required: true,
message: this.$t('reviewResults') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
dreUserIdName: [
{
required: true,
message: this.$t('selectInquiry') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
approvalOpinion: [
{
max: 300,
message: this.$t('feedbackMessage') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
]
}
}
},
mounted() {
this.formInline.approvalOpinion = ''
this.formInline = {...this.formInline}
},
methods: {
clickButtonToUpload(item) {
this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.visible = true
this.uploadName = item
getAction('sys/common/getFileInfos', { id: this.formInline[item] }).then((res) => {
if (res.success) {
this.$refs.uploadFile.perentHandleFunc(res.result)
} else {
this.$refs.uploadFile.perentHandleFunc()
}
})
},
/** 上传文件的回调 */
uploadSuccess(data) {
let attIdList = []
if (data && data.length > 0) {
data.map(item => {
attIdList.push(item.id || data.name)
})
}
/** 赋值给当前对应的表单文件 */
this.formInline[this.uploadName] = attIdList.join(',')
this.formInline = { ...this.formInline }
},
PersonnelSelectionChange(value, id) {
this.formInline[value] = id
this.formInline = { ...this.formInline }
},
flagChange(event) {
if (event.target.value == 3) {
this.isTrue = true
} else {
this.isTrue = false
}
},
submit(callBack) {
this.$refs.ruleForm.validate(valid => {
if (valid) {
callBack(this.formInline)
}
})
},
submitNoRule(callBack) {
callBack(this.formInline)
}
}
}
</script>
<style scoped lang="less">
.box {
padding: 0 24px 0 24px;
box-sizing: border-box;
}
.box-text {
display: flex;
justify-content: space-between;
height: 60px;
line-height: 40px;
.header-text {
font-size: 18px;
font-weight: 400;
color: #000F16;
}
}
.box-title-text {
line-height: 1.4;
display: flex;
/*align-items: center;*/
}
.title-text {
width: 88px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 48px;
color: #000F16;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.itemModel {
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
margin-bottom: 12px;
}
.Required {
color: red;
margin-right: 4px;
}
.title-text-text {
margin-top: 9px;
}
/*.formAdd {*/
/* margin-bottom: 40px;*/
/*}*/
.button-text {
height: 38px;
width: calc(100% - 100px);
line-height: 38px;
background: #fff;
border: 1px #00B3BE solid;
color: #00B3BE;
}
</style>