<!--
|
* @Author: your name
|
* @Date: 2019-10-21 15:40:58
|
* @LastEditTime: 2019-12-10 10:05:10
|
* @LastEditors: PengJianTian
|
* @Description: In User Settings Edit
|
* @FilePath: /e:\Demo\cts-web\src\views\area\enterprise\update\ApproveOpinion.vue
|
-->
|
<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>
|
<!-- <enp-select :config.sync="form.phasechoice"></enp-select>-->
|
<!-- <el-col :md="12" :lg="8" :span="16"> -->
|
<el-col :span="16">
|
<el-form-item label="审批结果" prop="phasechoice" :rules="rules" id="enterprise-opinion">
|
<el-select v-model="form.phasechoice" filterable clearable placeholder="请选择" @change="change" style="width:750px">
|
<el-option
|
v-for="item in options.phasechoice"
|
:key="item.value"
|
:label="item.valueDesc"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<enpterprise-input rows="5" is-text-area="textarea" :config.sync="form.phaseopinion" :length='500'></enpterprise-input>
|
</el-row>
|
</el-form>
|
</div>
|
</template>
|
|
<script>
|
import { qryEnpApproveOpinion, updateEnpApproveOpinion, queryCommitActionRange } from '@/api/area/enterprise'
|
import EnpSelect from '../components/EnpSelect'
|
import EnpterpriseInput from '../components/EnpterpriseInput'
|
import { mapState } from 'vuex'
|
export default {
|
components: { EnpSelect, EnpterpriseInput },
|
data: function() {
|
return {
|
loading: true,
|
form: {
|
phasechoice: '',
|
phaseopinion: '',
|
processtaskno: '',
|
serialno: ''
|
},
|
options: {
|
phasechoice: ''
|
},
|
rules: {
|
required: true,
|
message: '请输入选择审批结果',
|
trigger: 'blur'
|
}
|
}
|
},
|
created() {
|
this.selectLoad()
|
this.initForm()
|
},
|
watch: {
|
'form.phasechoice': function(val) {
|
this.form.phaseopinion.required = Boolean(val !== '01')
|
}
|
},
|
computed: {
|
...mapState({
|
enterpriseParams: state => state.risk.enterpriseParams
|
})
|
},
|
methods: {
|
// 初始化
|
async initForm() {
|
let params = {
|
objectno: this.enterpriseParams.tempSerialNo,
|
objecttype: this.enterpriseParams.objectType,
|
phaseno: this.enterpriseParams.phaseno
|
}
|
let res = await qryEnpApproveOpinion(params)
|
this._.merge(this.form, res.result)
|
this.form.phasechoice = res.result.phasechoice.value
|
this.loading = false
|
},
|
selectLoad() {
|
let params = {
|
objectType: this.enterpriseParams.objectType,
|
serialno: this.enterpriseParams.tempSerialNo
|
}
|
queryCommitActionRange(params).then(res => {
|
this.options.phasechoice = res.result
|
})
|
},
|
// 表单提交
|
handleSubmit() {
|
this.$refs['form'].validate(valid => {
|
if (valid) {
|
let params = {
|
objectno: this.enterpriseParams.tempSerialNo,
|
objecttype: this.enterpriseParams.objectType,
|
phasechoice: this.form.phasechoice,
|
phaseopinion: this.form.phaseopinion.value,
|
checkFlag: true
|
}
|
updateEnpApproveOpinion(params).then(res => {
|
if (res.code === '00') {
|
// this.$message.success('提交成功!')
|
this.$emit('handleNextPage', true)
|
}
|
})
|
} else {
|
this.$message.warning('当前页面存在必填项未录入或数据录入错误,请检查!')
|
return false
|
}
|
})
|
},
|
handleSave() {
|
this.$refs['form'].validate(valid => {
|
if (valid) {
|
let params = {
|
objectno: this.enterpriseParams.tempSerialNo,
|
objecttype: this.enterpriseParams.objectType,
|
phasechoice: this.form.phasechoice,
|
phaseopinion: this.form.phaseopinion.value,
|
checkFlag: true
|
}
|
updateEnpApproveOpinion(params).then(res => {
|
if (res.code === '00') {
|
this.$message.success('保存成功')
|
// this.$emit('handleNextPage', true)
|
}
|
})
|
} else {
|
this.$message.warning('当前页面存在必填项未录入或数据录入错误,请检查!')
|
return false
|
}
|
})
|
},
|
change(value) {
|
if (value !== '01') {
|
this.form.phaseopinion.required = true
|
}
|
}
|
}
|
}
|
</script>
|
|
<style lang="stylus" scoped>
|
>>> .el-textarea
|
width 750px
|
#enterprise-opinion
|
>>> .el-input__inner
|
width 750px
|
</style>
|