<template>
|
<el-dialog
|
:title="title"
|
:visible.sync="dialogVisible"
|
:close-on-press-escape="false"
|
width="45%">
|
<el-form :model="complainForm" ref="ruleForm" label-width="200px">
|
<div v-if="ifReview">
|
<el-row>
|
<el-col :span="20">
|
<el-form-item label="申诉描述" prop="punishmentreason">
|
<el-input type="textarea" :row="2" v-model="complainForm.appealcontent" :disabled="true">
|
</el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="20">
|
<el-form-item label="处罚文件:" prop="directionCode">
|
<div style="text-decoration: underline;color: blue" @click="showFile1">{{file1.split('/')[1]}}</div>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="20">
|
<el-form-item label="申诉文件:" prop="directionCode">
|
<div style="text-decoration: underline;color: blue" @click="showFile2">{{file2.split('/')[1]}}</div>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="20">
|
<el-form-item label="拒绝原因" prop="rejectappealreason">
|
<el-input type="textarea" :row="2" v-model="rejectappealreason">
|
</el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</div>
|
<div v-if="ifComplain">
|
<el-row>
|
<el-col :span="20">
|
<el-form-item label="申诉描述" prop="punishmentreason">
|
<el-input type="textarea" :row="2" v-model="complainForm.appealcontent">
|
</el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="20">
|
<el-form-item label="文件:" prop="directionCode">
|
<input id="upload" ref="upload" type="file" accept="image/*"/>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</div>
|
</el-form>
|
<div align="center">
|
<el-button @click="dialogVisible = false" v-if="ifComplain === true">取消</el-button>
|
<el-button type="primary" @click="submit()" v-if="ifComplain === true">确定</el-button>
|
<el-button @click="rejectComplain" v-if="ifReview === true">拒绝</el-button>
|
<el-button type="primary" @click="submit()" v-if="ifReview === true">同意</el-button>
|
</div>
|
</el-dialog>
|
</template>
|
|
<script>
|
import {
|
enterpriseComplain,
|
enterpriseComplainAgree,
|
enterpriseComplainReject
|
} from "../../../../api/enterpriseJudgeComplain";
|
import {mapGetters} from "vuex";
|
import {uploadUrl} from "../../../../assets/upload/url";
|
import {reviewRegister} from "../../../../api/login";
|
|
export default {
|
name: "complainForm",
|
data(){
|
return{
|
type:'',
|
dialogVisible:false,
|
ifComplain:false,
|
ifReview:false,
|
file1:'',
|
file2:'',
|
rejectappealreason:'',
|
complainForm:{
|
id:'',
|
appealcontent:'',
|
file:'',
|
},
|
title:'申述',
|
}
|
},
|
methods:{
|
showComplainForm(value,type){
|
this.type = type
|
this.dialogVisible = true
|
if(type === '审批'){
|
this.ifComplain = false
|
this.ifReview = true
|
this.complainForm.id = ''
|
this.complainForm.appealcontent = ''
|
this.file2 = ''
|
this.file1 = ''
|
this.complainForm.id = value.id
|
this.complainForm.appealcontent = value.appealcontent
|
this.file1 = value.path1
|
this.file2 = value.path2
|
}else{
|
this.complainForm = {
|
id:'',
|
appealcontent:'',
|
file:'',
|
}
|
this.ifComplain = true
|
this.ifReview = false
|
this.complainForm.id = value.id
|
}
|
},
|
async submit(){
|
if(this.type === '申诉'){
|
const formData = new FormData();
|
for (const i in this.complainForm) {
|
if (
|
this.complainForm[i] != undefined &&
|
this.complainForm[i].toString() != ""
|
) {
|
formData.append(i, this.complainForm[i]);
|
}
|
}
|
const files1 = this.$refs["upload"].files;
|
if (files1 && files1.length > 0) {
|
for (let i = 0; i < files1.length; i++)
|
formData.append("file", files1[i]);
|
}
|
let res = await enterpriseComplain(formData)
|
if(res.data.code === '200'){
|
this.dialogVisible = false
|
this.$emit('getinfo')
|
this.$notify({
|
type:'success',
|
duration:2000,
|
message:'申诉提交成功',
|
title:'成功'
|
})
|
}else{
|
this.$message({
|
type:'warning',
|
message:res.data.message
|
})
|
}
|
}else{
|
this.$confirm('同意此条申诉,是否继续','提示',{
|
confirmButtonText:'确定',
|
cancelButtonText:'取消',
|
type:'warning',
|
}).then(()=> {
|
enterpriseComplainAgree({id:this.complainForm.id}).then( (res)=>{
|
if(res.data.code === "200"){
|
this.dialogVisible = false
|
this.$emit('getinfo')
|
this.$notify({
|
title:'成功',
|
message:'审核同意成功',
|
type:'success',
|
duration:2000,
|
})
|
}else{
|
this.$message({
|
type:'warning',
|
message:res.data.message
|
})
|
}
|
})
|
})
|
}
|
},
|
rejectComplain(){
|
this.$confirm('拒绝此条申诉,是否继续','提示',{
|
confirmButtonText:'确定',
|
cancelButtonText:'取消',
|
type:'warning',
|
}).then(()=> {
|
enterpriseComplainReject({id:this.complainForm.id,rejectappealreason:this.rejectappealreason}).then( (res)=>{
|
if(res.data.code === "200"){
|
this.dialogVisible = false
|
this.$emit('getinfo')
|
this.$notify({
|
title:'成功',
|
message:'审核拒绝成功',
|
type:'success',
|
duration:2000,
|
})
|
}else{
|
this.$message({
|
type:'warning',
|
message:res.data.message
|
})
|
}
|
})
|
})
|
},
|
showFile1(){
|
window.open(uploadUrl() + this.file1, '_blank')
|
},
|
showFile2(){
|
window.open(uploadUrl() + this.file2, '_blank')
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
|
</style>
|