<template>
|
<div class="dataBack" v-loading="loading">
|
<el-form label-position="right" :model="form" v-show="!loading" ref="form">
|
<el-row>
|
<p class="title">审批意见</p>
|
<!-- <partner-select :config.sync="phasechoice"></partner-select>-->
|
<el-col :span="16">
|
<el-form-item label="审批结果" prop="phasechoice" :rules="rules" id="partner-opinion">
|
<el-select v-model="phasechoice" filterable clearable placeholder="请选择" style="width:750px">
|
<el-option
|
v-for="(item, key) in form.options"
|
:key="key"
|
:label="item.valueDesc"
|
:value="item.value">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<parter-input rows="5" is-text-area="textarea" :config.sync="form.phaseopinion" :length='500' class="textareaOpinion"></parter-input>
|
</el-row>
|
</el-form>
|
</div>
|
</template>
|
|
<script>
|
import { ChannelApproveInfoRequest, updateEnpApproveOpinion, saveChannelApproveInfo, queryChanelCommitActionRange } from '@/api/area/partner'
|
import PartnerSelect from './components/PartnerSelect'
|
import ParterInput from './components/ParterInput'
|
import { mapState } from 'vuex'
|
export default {
|
components: { ParterInput, PartnerSelect },
|
data: function() {
|
return {
|
loading: true,
|
phasechoice: '',
|
// options: '',
|
form: {
|
phasechoice: '',
|
phaseopinion: '',
|
approveorg: '',
|
inputorg: '',
|
objectno: '',
|
inputuser: '',
|
inputtime: '',
|
objecttype: '',
|
opinionno: '',
|
serialno: '',
|
options: '',
|
},
|
rules: {
|
required: true,
|
message: '请输入选择审批结果',
|
trigger: 'blur'
|
}
|
}
|
},
|
created() {
|
this.initForm()
|
},
|
computed: {
|
...mapState({
|
partnerParams: state => state.risk.partnerParams
|
})
|
},
|
watch: {
|
'phasechoice': function (newVal) {
|
// 通过-01 拒绝-02 驳回上一级-04
|
if (newVal === '01') {
|
this.form.phaseopinion.required = false
|
this.form.phaseopinion.writeAble = true
|
} else {
|
this.form.phaseopinion.required = true
|
this.form.phaseopinion.writeAble = true
|
}
|
}
|
},
|
methods: {
|
// 初始化
|
async initForm() {
|
let params = {
|
ftserialno: this.partnerParams.ftserialno,
|
objectType: this.partnerParams.objectType,
|
objectno: this.partnerParams.serialno,
|
}
|
let res = await ChannelApproveInfoRequest(params)
|
this._.merge(this.form, res.result)
|
this.phasechoice = this.form.phasechoice.value
|
let phasechoice = await queryChanelCommitActionRange(params)
|
this.form.options = phasechoice.result
|
this.loading = false
|
},
|
// 表单提交
|
handleSubmit() {
|
this.$refs['form'].validate(valid => {
|
if (valid) {
|
let params = {
|
ftserialno: this.partnerParams.ftserialno,
|
objectType: this.partnerParams.objectType,
|
objectno: this.partnerParams.serialno,
|
phasechoice: this.phasechoice,
|
phaseopinion: this.form.phaseopinion.value,
|
isCheck: true,
|
}
|
saveChannelApproveInfo(params).then(res => {
|
if (res.code === '00') {
|
// this.$message.success('提交成功!')
|
this.$emit('handleNextPage', true)
|
}
|
})
|
} else {
|
// this.$message.warning('当前页面存在必填项未录入或数据录入错误,请检查!')
|
return false
|
}
|
})
|
},
|
async handleSave(saveOpinion) {
|
// 点击保存是不传递saveOpinion参数,点击提交传递saveOpinion=true
|
// if( this.form.phaseopinion.required === true && this.form.phaseopinion.value === ''){
|
// // this.$message.error('请检查必填项!');
|
// } else {
|
// if(!saveOpinion){
|
// let params = {
|
// ftserialno: this.partnerParams.ftserialno,
|
// objectType: this.partnerParams.objectType,
|
// objectno: this.partnerParams.serialno,
|
// phasechoice: this.phasechoice,
|
// phaseopinion: this.form.phaseopinion.value,
|
// isCheck: false,
|
// }
|
// saveChannelApproveInfo(params).then(res => {
|
// if (res.code === '00') {
|
// if(!saveOpinion){
|
// this.$message.success('保存成功!')
|
// }
|
// }
|
// })
|
// }else{
|
this.$refs['form'].validate(valid => {
|
if (valid) {
|
let params = {
|
ftserialno: this.partnerParams.ftserialno,
|
objectType: this.partnerParams.objectType,
|
objectno: this.partnerParams.serialno,
|
phasechoice: this.phasechoice,
|
phaseopinion: this.form.phaseopinion.value,
|
isCheck: true,
|
}
|
saveChannelApproveInfo(params).then(res => {
|
if (res.code === '00') {
|
// console.log(saveOpinion)
|
if (saveOpinion) {
|
this.$emit('opinionSubmit', true)
|
} else {
|
this.$message.success('保存成功')
|
}
|
}
|
})
|
} else {
|
this.$message.warning('当前页面存在必填项未录入或数据录入错误,请检查!')
|
}
|
})
|
// }
|
// }
|
}
|
}
|
}
|
</script>
|
|
<style lang="stylus" scoped>
|
>>> .el-textarea
|
width 750px
|
>>> .el-col-24 .el-form-item__label
|
margin-bottom 200px
|
#partner-opinion
|
>>> .el-input__inner
|
width 750px
|
.textareaOpinion
|
& >>> .el-form-item__content
|
top -50px
|
</style>
|