<template>
|
<!--行政处罚听证通知书-->
|
<el-main>
|
<el-form ref="form" :model="form" :disabled="form.registerState == '1'">
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="文号" :label-width="formLabelWidth">
|
<el-input v-model="form.unitName" placeholder="_______听通〔 〕第 号"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="当事人姓名" :label-width="formLabelWidth">
|
<el-input v-model="form.litigant" autocomplete="off"></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
<el-form-item label="地点" :label-width="formLabelWidth">
|
<el-input v-model="form.place" autocomplete="off"></el-input>
|
</el-form-item>
|
|
<el-form-item label="案件名称" :label-width="formLabelWidth">
|
<el-input v-model="form.caseName" autocomplete="off"></el-input>
|
</el-form-item>
|
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="听证时间" :label-width="formLabelWidth">
|
<el-date-picker
|
v-model="form.hearingTime"
|
type="datetime"
|
:value-format="`yyyy-MM-dd HH:mm:ss`"
|
placeholder="选择日期"
|
style="width: 100%"
|
>
|
</el-date-picker>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="主持人" :label-width="formLabelWidth">
|
<el-input v-model="form.host" autocomplete="off"></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="听证员" :label-width="formLabelWidth">
|
<el-input
|
v-model="form.hearingOfficer"
|
autocomplete="off"
|
></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="记录人" :label-width="formLabelWidth">
|
<el-input v-model="form.recorder" autocomplete="off"></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
<el-form-item label="准备:" :label-width="formLabelWidth">
|
<el-checkbox-group v-model="form.preparations">
|
<el-checkbox label="0" name="type">携带身份证明和有关证据材料;</el-checkbox><br>
|
<el-checkbox label="1" name="type">通知有关证人出席作证,并事先告知本机关联系人;</el-checkbox>
|
<el-checkbox label="2" name="type">如委托代理人,委托代理人须提交身份证明及授权委托书;</el-checkbox>
|
<el-checkbox label="3" name="type">如申请主持人回避,须及时告知本机关并说明理由。</el-checkbox>
|
</el-checkbox-group>
|
</el-form-item>
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="联系人" :label-width="formLabelWidth">
|
<el-input v-model="form.phoneName" autocomplete="off"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="联系电话" :label-width="formLabelWidth">
|
<el-input v-model="form.phone" autocomplete="off"></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="通知日期" :label-width="formLabelWidth">
|
<el-date-picker
|
v-model="form.notificationTime"
|
type="date"
|
:value-format="`yyyy-MM-dd`"
|
placeholder="选择日期"
|
style="width: 100%"
|
>
|
</el-date-picker>
|
</el-form-item>
|
</el-col>
|
<!-- <el-col :span="12">-->
|
<!-- <el-form-item label="接收日期" :label-width="formLabelWidth">-->
|
<!-- <el-date-picker-->
|
<!-- v-model="form.receiptTime"-->
|
<!-- type="datetime"-->
|
<!-- :value-format="`yyyy-MM-dd HH:mm:ss`"-->
|
<!-- placeholder="选择日期"-->
|
<!-- style="width: 100%"-->
|
<!-- >-->
|
<!-- </el-date-picker>-->
|
<!-- </el-form-item>-->
|
<!-- </el-col>-->
|
</el-row>
|
|
<!-- <el-row>-->
|
<!-- <el-col :span="12">-->
|
<!-- <el-form-item label="当事人电话" :label-width="formLabelWidth">-->
|
<!-- <el-input-->
|
<!-- v-model="form.litigantPhone"-->
|
<!-- autocomplete="off"-->
|
<!-- ></el-input>-->
|
<!-- </el-form-item>-->
|
<!-- </el-col>-->
|
<!-- </el-row>-->
|
<WordView ref="wordInfo" :isShowYulan="showView" @cancel="cancelWord"></WordView>
|
</el-form>
|
<div style="text-align: center">
|
<el-button v-if="isFinish!='2'" plain @click="dataFormSubmit('0')">保存</el-button>
|
<el-button v-if="isFinish!='2'" type="warning" plain @click="dataFormSubmit('1')">定稿</el-button>
|
<el-button type="primary" plain @click="viewVord(form)">预览</el-button>
|
<el-button type="success" plain @click="downloadWord(form)">下载</el-button>
|
</div>
|
</el-main>
|
</template>
|
|
<script>
|
import WordView from "@/views/News/word-view";
|
import {getObj, saveObj} from "@/api/News/hearingNotice";
|
import moment from "moment";
|
|
export default {
|
name: "hearingNotice",
|
props:['isShowYulan','id','isFinish','processId','title'],
|
components:{
|
WordView
|
},
|
data() {
|
return {
|
showView: false,
|
form: {
|
unitName: "",
|
litigant: "",
|
place: "",
|
caseName: "",
|
hearingTime: "",
|
host: "",
|
hearingOfficer: "",
|
recorder: "",
|
phoneName: "",
|
phone: "",
|
notificationTime: "",
|
receiptTime: "",
|
litigantPhone: "",
|
preparations:[]
|
},
|
formLabelWidth: "140px",
|
};
|
},
|
created() {
|
this.init()
|
},
|
methods: {
|
init() {
|
getObj(this.id).then((res) => {
|
// if (res.data.code == 0) {
|
// 转换null为""
|
let v = res.data.data;
|
for (let attr in v) {
|
if (v[attr] == null) {
|
v[attr] = "";
|
}
|
}
|
let str = JSON.stringify(v);
|
let data = JSON.parse(str);
|
this.form = data;
|
// }
|
});
|
},
|
dataFormSubmit(type) {
|
console.log(type)
|
this.$refs['form'].validate((valid) => {
|
if (valid) {
|
let obj = this;
|
if ("1" == type) {
|
this.$confirm('保存为定稿将不能修改,是否继续?', '提示', {
|
confirmButtonText: '是',
|
cancelButtonText: '否',
|
type: 'warning'
|
}).then(function () {
|
obj.form.registerState = type;
|
obj.form.registerId = obj.id;
|
obj.form.processId = obj.processId;
|
saveObj(obj.form).then((res) => {
|
// this.submitLoading = false;
|
obj.$message.success('操作成功');
|
obj.cancel();
|
obj.$emit('getDataList');
|
})
|
})
|
} else {
|
obj.form.registerState = type;
|
obj.form.registerId = obj.id;
|
obj.form.processId = obj.processId;
|
saveObj(obj.form).then((res) => {
|
// this.submitLoading = false;
|
obj.$message.success("操作成功");
|
obj.cancel();
|
obj.$emit('getDataList');
|
})
|
}
|
}
|
})
|
},
|
cancel() {
|
this.$emit('cancel', false);
|
},
|
cancelWord() {
|
this.showView = false;
|
},
|
viewVord(data) {
|
if(data.registerState == null || data.registerState == ""){
|
//预览前先进行保存
|
data.registerState = '0';
|
data.registerId = this.id;
|
data.processId = this.processId;
|
saveObj(data).then((res) => {
|
})
|
}
|
//↓↓↓↓↓↓以下部分根据具体业务修改↓↓↓↓↓↓
|
//格式转换
|
let wordData = this.transforData(data);
|
//↑↑↑↑↑↑以上部分根据具体业务修改↑↑↑↑↑↑
|
this.showView = true;
|
this.$nextTick(() => {
|
this.$refs.wordInfo.init(wordData, "/wordes/hearingNotice.docx");
|
})
|
},
|
downloadWord(data) {
|
if(data.registerState == null || data.registerState == ""){
|
//预览前先进行保存
|
data.registerState = '0';
|
data.registerId = this.id;
|
data.processId = this.processId;
|
saveObj(data).then((res) => {
|
})
|
}
|
let wordData = this.transforData(data);
|
WordView.methods.exportDoc(wordData, "/wordes/hearingNotice.docx", this.title+'.docx');
|
},
|
transforData(obj) {
|
let s = JSON.stringify(obj);
|
let data = JSON.parse(s);
|
|
let str = data.preparations;
|
if (str.indexOf("0") >= 0){
|
data.xie = true;
|
data.dai = false;
|
}else {
|
data.xie = false;
|
data.dai = true;
|
}
|
if (str.indexOf("1") >= 0){
|
data.tong = true;
|
data.zhi = false;
|
}else {
|
data.tong = false;
|
data.zhi = true;
|
}
|
if (str.indexOf("2") >= 0){
|
data.wei = true;
|
data.tuo = false;
|
}else {
|
data.wei = false;
|
data.tuo = true;
|
}
|
if (str.indexOf("3") >= 0){
|
data.shen = true;
|
data.qing = false;
|
}else {
|
data.shen = false;
|
data.qing = true;
|
}
|
if (data.hearingTime != '' && data.hearingTime != null) {
|
data.hearingTime = moment(data.hearingTime).format('YYYY年MM月DD日HH时mm分');
|
}else {
|
data.hearingTime = ' 年 月 日 时 分'
|
}
|
|
if (data.notificationTime != '' && data.notificationTime != null) {
|
data.notificationTime = moment(data.notificationTime).format('YYYY年MM月DD日');
|
}else {
|
data.notificationTime = ' 年 月 日'
|
}
|
|
if (data.receiptTime != '' && data.receiptTime != null) {
|
data.receiptTime = moment(data.receiptTime).format('YYYY年MM月DD日HH时mm分');
|
}else {
|
data.receiptTime = ' 年 月 日 时 分'
|
}
|
|
return data;
|
}
|
}
|
}
|
</script>
|
|
<style scoped>
|
|
</style>
|