<template>
|
<!--行政处罚执行情况记录表-->
|
<el-main>
|
<el-form ref="form" :model="form" :disabled="form.registerState == '1'">
|
<el-form-item label="行政处罚决定书文号" :label-width="formLabelWidth">
|
<el-input v-model="form.wordSize" autocomplete="off"></el-input>
|
</el-form-item>
|
<el-form-item label="案由" :label-width="formLabelWidth">
|
<el-input v-model="form.casePoint" autocomplete="off"></el-input>
|
</el-form-item>
|
<el-form-item label="处罚内容" :label-width="formLabelWidth">
|
<el-input
|
v-model="form.penaltyContent"
|
type="textarea"
|
autocomplete="off"
|
></el-input>
|
</el-form-item>
|
<el-form-item label="行政处罚执行情况" :label-width="formLabelWidth">
|
<el-input
|
v-model="form.implementation"
|
type="textarea"
|
autocomplete="off"
|
></el-input>
|
</el-form-item>
|
<el-form-item label="备注" :label-width="formLabelWidth">
|
<el-input
|
v-model="form.remark"
|
type="textarea"
|
autocomplete="off"
|
></el-input>
|
</el-form-item>
|
<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 {getObj, saveObj} from "@/api/News/administrativePenaltyRecord";
|
import WordView from "@/views/News/word-view";
|
import moment from "moment";
|
|
export default {
|
name: "administrative_penalty_record",
|
props: ['isShowYulan', 'id', 'isFinish', 'processId'],
|
components:{
|
WordView
|
},
|
data() {
|
return {
|
showView:false,
|
form: {
|
wordSize: "",
|
casePoint: "",
|
penaltyContent: "",
|
implementation: "",
|
remark: "",
|
},
|
formLabelWidth: "140px",
|
}
|
},
|
created() {
|
this.init()
|
},
|
methods: {
|
init() {
|
getObj(this.id).then((res) => {
|
// 转换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();
|
})
|
})
|
} 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();
|
})
|
}
|
}
|
})
|
},
|
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(data, "/wordes/administrativePenaltyRecord.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(data, "/wordes/administrativePenaltyRecord.docx", '行政处罚执行情况记录表.docx');
|
},
|
}
|
}
|
</script>
|
|
<style scoped>
|
|
</style>
|