Files
laws_weilai/jero-web/src/views/processCenter/components/reviewedByThePersonInCharge.vue
T
2022-05-19 17:59:37 +08:00

335 lines
10 KiB
Java

<template>
<div class="box">
<div class="box-text">
<div class="header-text">
{{$route.query.TaskKey == 'zrrclrw' ? $t('personLiableConfirm'):$t('fillInProjectDelivery')}}
</div>
</div>
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24" v-if="$route.query.TaskKey == 'zrrclrw'">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="Required" v-if="$route.query.TaskKey == 'zrrclrw'">*</span>
<span class="title-text-text" :title="$t('reviewResults')">{{$t('reviewResults')}}</span>
</div>
<a-form-model-item class="itemModel" :prop="$route.query.TaskKey == 'fqrsh'?'':'reviewResult'">
<a-radio-group style="margin-top: 2px"
:disabled="$route.query.TaskKey == 'fqrsh'?true:false"
class="box-input"
v-model="formInline.reviewResult">
<a-radio value="Compliance">
{{$t('accord')}}
</a-radio>
<a-radio value="Non-Compliance">
{{$t('nonConformity')}}
</a-radio>
<a-radio value="To be tracked">
{{$t('Tracked')}}
</a-radio>
<a-radio value="NA">
{{$t('notInvolved')}}
</a-radio>
</a-radio-group>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24" v-if="$route.query.TaskKey == 'zrrclrw'">
<a-col :span="24">
<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="$route.query.TaskKey == 'dreDispose'">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text-fq">
<span class="title-text-text" :title="$t('projectDeliveryDescription')">{{$t('projectDeliveryDescription')}}</span>
</div>
<a-form-model-item class="itemModel">
<span class="text-header">
{{formInline.deliveryRequirements}}
</span>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24" v-if="$route.query.TaskKey == 'dreDispose'">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text-fq">
<span class="title-text-text"
:title="$t('feedbackFromTheEngineer')">{{$t('feedbackFromTheEngineer')}}</span>
</div>
<a-form-model-item class="itemModel" prop="engineerFeedbackContent">
<a-textarea :placeholder="$t('pleaseEnter')+$t('feedbackFromTheEngineer')"
v-model="formInline.engineerFeedbackContent"
:rows="4"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24" v-if="$route.query.TaskKey == 'dreDispose'">
<a-col :span="12">
<div class="box-title-text">
<div class="title-text-fq">
<span class="title-text-text"
:title="$t('Deliverables')">{{$t('Deliverables')}}</span>
</div>
<a-form-model-item class="itemModel">
<a-button type="primary" class="button-text"
@click="clickButtonToUpload('fileId')">
{{ (formInline.fileId === 'null' || formInline.fileId === '' ||
formInline.fileId == null) ? $t('clickUpload') : $t('viewUploadedFiles')
}}
</a-button>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24" v-if="$route.query.TaskKey == 'fqrsh'">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text-fq">
<span class="title-text-text" :title="$t('complianceResults')">{{$t('complianceResults')}}</span>
</div>
<a-form-model-item class="itemModel">
<span class="text-header">
爱上克里夫就的撒开了房间圣诞快乐房价士大夫打扫房间圣诞快乐房价是罚款乱收费考虑是否就但是考虑
</span>
</a-form-model-item>
</div>
</a-col>
</a-row>
<a-row :gutter="24" v-if="$route.query.TaskKey == 'fqrsh'">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text-fq">
<span class="title-text-text" :title="$t('feedbackMessage')">{{$t('feedbackMessage')}}</span>
</div>
<a-form-model-item class="itemModel">
<span class="text-header">
{{formInline.approvalOpinion}}
</span>
</a-form-model-item>
</div>
</a-col>
</a-row>
<div class="box-text" v-if="$route.query.TaskKey == 'fqrsh'">
<div class="header-text">
{{$t('sponsorReview')}}
</div>
</div>
<a-row :gutter="24" v-if="$route.query.TaskKey == 'fqrsh'">
<a-col :span="24">
<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-form-model>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"/>
</div>
</template>
<script>
import { getAction, postAction, putAction, deleteAction } from '@/api/manage'
import uploadFile from '@/components/uploadFile/file'
export default {
name: 'reviewedByThePersonInCharge',
components: {
uploadFile
},
props: ['queryBy','queryPersonInCharge'],
data() {
return {
formInline: {},
isTrue: false,
rules: {
reviewResult: [
{
required: true,
message: this.$t('reviewResults') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
approvalOpinion: [
{
max: 300,
message: this.$t('feedbackMessage') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
],
engineerFeedbackContent: [
{
max: 300,
message: this.$t('feedbackFromTheEngineer') + this.$t('cannotExceed') + 300 + this.$t('Characters'),
trigger: 'blur'
}
]
}
}
},
mounted() {
if (this.queryBy) {
this.formInline.reviewResult = this.queryBy.reviewResult || undefined
this.formInline.approvalOpinion = ''
this.formInline = { ...this.formInline }
}
if (this.queryPersonInCharge){
this.formInline.deliveryRequirements = this.queryPersonInCharge.deliveryRequirements
this.formInline.engineerFeedbackContent = this.queryPersonInCharge.engineerFeedbackContent
this.formInline.fileId = this.queryPersonInCharge.fileId
}
},
methods: {
submit(callBack) {
this.$refs.ruleForm.validate(valid => {
if (valid) {
callBack(this.formInline)
}
})
},
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 }
this.$nextTick(() => {
this.$refs.ruleForm.validateField([this.uploadName])
})
}
}
}
</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: 16px;
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;
}
.title-text-fq {
width: 124px;
text-align: left;
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: 100%;
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;*/
/*}*/
.text-header {
font-size: 16px;
color: #040B29;
font-weight: 400;
}
.button-text {
height: 38px;
width: calc(50% - 100px);
line-height: 38px;
background: #fff;
border: 1px #00B3BE solid;
color: #00B3BE;
}
</style>