<template>
|
<el-dialog
|
:title="'立案审批表'"
|
:visible.sync="visible"
|
:before-close="cancel"
|
width="55%"
|
v-dialogDrag>
|
<!--立案审批表-->
|
<el-form :model="dataForm" :rules="dataRules" ref="dataForm" label-width="130px"
|
:disabled="dataForm.registerState == '1'">
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="文号">
|
<el-input v-model="dataForm.unitName" readonly></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="案件来源" prop="caseSource">
|
<el-select v-model="dataForm.caseSource" placeholder="请选择案件来源" style="width: 100%;">
|
<el-option
|
v-for="item in caseSourceList"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
<el-form-item label="案由" prop="casePoint">
|
<el-input v-model="dataForm.casePoint"></el-input>
|
</el-form-item>
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="当事人姓名(名称)" prop="litigant">
|
<el-select v-model="dataForm.litigant" placeholder="请选择当事人" value-key="id"
|
:disabled="dataForm.registerState == '1'" style="width: 100%;" @change="marketChange">
|
<el-option
|
v-for="item in marketList"
|
:key="item.subjectName"
|
:label="item.subjectName"
|
:value="item">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="法定代表人" prop="legalPerson">
|
<el-input v-model="dataForm.legalPerson"></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="当事人证件名称" prop="certNo">
|
<el-select v-model="dataForm.litigantCert" placeholder="请选择当事人证件类型"
|
:disabled="dataForm.registerState == '1'" style="width: 100%;">
|
<el-option
|
v-for="item in cardList"
|
:label="item.label"
|
:value="item.value">
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="当事人证件号码" prop="certNo">
|
<el-input v-model="dataForm.certNo"></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="住址" prop="address">
|
<el-input v-model="dataForm.address"></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="电话" prop="phone">
|
<el-input v-model="dataForm.phone"></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
<el-form-item label="案情及立案理由" prop="caseDetail">
|
<el-input type="textarea" :row="2" v-model="dataForm.caseDetail"></el-input>
|
</el-form-item>
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="办案人员" prop="hanlderIds">
|
<el-select v-model="dataForm.hanlderIds" clearable filterable multiple :multiple-limit="2"
|
placeholder="请选择" style="width: 100%;" @change="setPersonname($event)">
|
<el-option
|
v-for="item in organPersons"
|
:key="item.userId"
|
:label="item.realName"
|
:value="item.userId">
|
<span style="float: left">{{ item.realName }}</span>
|
<span style="float: right; color: #8492a6; font-size: 13px">执法证号:{{ item.lawCert }}</span>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<public-opinion ref="publicOpinion" :registerState="dataForm.registerState"></public-opinion>
|
<WordView ref="wordInfo" :isShowYulan="showView" @cancel="cancelWord"></WordView>
|
|
|
</el-form>
|
<!-- <div style="text-align: center;">
|
<el-button v-show="dataForm.registerState != '1'" plain @click="dataFormSubmit('0')">保存</el-button>
|
<el-button v-show="dataForm.registerState != '1'" type="warning" plain @click="dataFormSubmit('1')">定稿</el-button>
|
<el-button type="primary" plain @click="viewVord(dataForm)">预览</el-button>
|
<el-button type="success" plain @click="downloadWord(dataForm)">下载</el-button>
|
</div>-->
|
</el-dialog>
|
</template>
|
<script>
|
import {getObj, saveObj, getMarketList, getDocNo} from "@/api/News/fileCase";
|
import {getfindAll} from "@/api/News/useres";
|
import publicOpinion from "@/views/News/publicOpinion"
|
import WordView from '@/views/News/word-view/index'
|
import moment from "moment";
|
import {remote} from "@/api/admin/dict"
|
|
|
export default {
|
name: "fileCase",
|
props: ["isShowYulan", 'id', 'processId'],
|
components: {
|
publicOpinion,
|
WordView
|
},
|
data() {
|
return {
|
showView: false,
|
visible: false,
|
dataForm: {
|
unitName: '',
|
docNo: '',
|
sourceType: '',
|
casePoint: '',
|
litigant: '',
|
litigantCert: '',
|
certNo: '',
|
address: '',
|
phone: '',
|
legalPerson: '',
|
caseDetail: '',
|
hanlders: '',
|
registerState: '',
|
hanlderIds: '',
|
litigantId: '',
|
publicOpinion:{
|
id: '',
|
undertakerView: '',
|
undertakerOne: '',
|
lawcertOne: '',
|
undertakerTwo: '',
|
lawcertTwo: '',
|
undertakeDate: '',
|
takedeptView: '',
|
takedeptPerson: '',
|
takeDate: '',
|
legalView: '',
|
legalHeader: '',
|
legalDate: '',
|
organView: '',
|
organPerson: '',
|
organDate: '',
|
}
|
},
|
caseSourceList: [],
|
dataRules: {},
|
submitLoading: false,
|
organPersons: [],
|
cardList: [],
|
marketList: [],
|
imgSize : { //控制导出的word图片大小
|
autographOne: [120, 35],
|
autographTwo: [120, 35],
|
autographDept: [120, 35],
|
autographLegal: [120, 35],
|
autographOrgan: [120, 35]
|
},
|
}
|
},
|
methods: {
|
init(id) {
|
//查询字典
|
remote('document_type').then(res => {
|
this.cardList = res.data.data;
|
})
|
//查询人员
|
getfindAll().then((res) => {
|
this.organPersons = res.data.data;
|
})
|
this.getDataType();
|
this.getMarketSubjects();
|
//查询数据
|
this.dataForm.id = id || 0;
|
this.$nextTick(() => {
|
this.visible = true;
|
if (this.dataForm.id) {
|
getObj(id).then((res) => {
|
this.dataForm = res.data.data;
|
if (this.dataForm.hanlderIds != "") {
|
let ids = [];
|
this.dataForm.hanlderIds.split(",").forEach(o => {
|
ids.push(parseInt(o));
|
})
|
this.dataForm.hanlderIds = ids;
|
}
|
//审批意见
|
this.$nextTick(() => {
|
this.$refs.publicOpinion.init(this.dataForm.publicOpinion);
|
})
|
});
|
} else {
|
getDocNo().then((res) => {
|
if (res.data.code == 0) {
|
this.dataForm.unitName = res.data.data.unitName;
|
}
|
})
|
}
|
})
|
|
},
|
//选择当事人回填信息
|
marketChange(item) {
|
this.dataForm.litigant = "";
|
this.dataForm.legalPerson = "";
|
this.dataForm.litigantCert = "";
|
this.dataForm.certNo = "";
|
this.dataForm.address = "";
|
this.dataForm.phone = "";
|
this.dataForm.litigantId = item.id;
|
if ("法人" == item.subjectType) {
|
this.dataForm.litigant = item.subjectName;
|
this.dataForm.legalPerson = item.legalPerson;
|
this.dataForm.litigantCert = "营业执照";
|
this.dataForm.certNo = item.idCard;
|
this.dataForm.address = item.address;
|
this.dataForm.phone = item.phone;
|
} else if ("公民" == item.subjectType) {
|
this.dataForm.litigant = item.subjectName;
|
this.dataForm.litigantCert = "居民身份证";
|
this.dataForm.certNo = item.idCard;
|
this.dataForm.address = item.address;
|
this.dataForm.phone = item.phone;
|
} else if ("其他组织" == item.subjectType) {
|
this.dataForm.litigant = item.subjectName;
|
this.dataForm.legalPerson = item.legalPerson;
|
this.dataForm.certNo = item.idCard;
|
this.dataForm.address = item.address;
|
this.dataForm.phone = item.phone;
|
}
|
},
|
//查询市场主体
|
getMarketSubjects() {
|
getMarketList().then((res) => {
|
this.marketList = res.data.data;
|
})
|
},
|
//获取来源
|
getDataType() {
|
remote('caseSource_Type').then(res => {
|
this.caseSourceList = res.data.data
|
})
|
},
|
cancel() {
|
this.$emit('cancel', false);
|
this.visible = false;
|
},
|
dataFormSubmit(type) {
|
this.$refs['dataForm'].validate((valid) => {
|
if (valid) {
|
let obj = this;
|
if ("1" == type) {
|
this.$confirm('保存为定稿将不能修改,是否继续?', '提示', {
|
confirmButtonText: '是',
|
cancelButtonText: '否',
|
type: 'warning'
|
}).then(function () {
|
obj.submitLoading = true;
|
obj.dataForm.registerState = type;
|
obj.dataForm.registerId = obj.id;
|
obj.dataForm.processId = obj.processId;
|
obj.dataForm.hanlderIds = obj.dataForm.hanlderIds.toString();
|
if (obj.dataForm.hanlderIds.length < 1) {
|
obj.dataForm.hanlders = '';
|
}
|
saveObj(obj.dataForm).then((res) => {
|
if (res.data.code == 0) {
|
obj.$message.success("操作成功");
|
obj.cancel();
|
obj.$emit('getDataList');
|
}
|
})
|
})
|
} else {
|
this.submitLoading = true;
|
this.dataForm.registerState = type;
|
this.dataForm.processId = this.processId;
|
this.dataForm.hanlderIds = this.dataForm.hanlderIds.toString();
|
if (this.dataForm.hanlderIds.length < 1) {
|
this.dataForm.hanlders = '';
|
}
|
saveObj(this.dataForm).then((res) => {
|
if (res.data.code == 0) {
|
this.$message.success("操作成功");
|
this.cancel();
|
this.$emit('getDataList');
|
}
|
})
|
}
|
}
|
})
|
},
|
cancelWord() {
|
this.showView = false;
|
this.$emit('getDataList');
|
},
|
viewVord(data) {
|
if(data.registerState == null || data.registerState == ""){
|
//预览前先进行保存
|
data.registerState = '0';
|
data.registerId = this.id;
|
data.processId = this.processId;
|
saveObj(data).then((res) => {
|
})
|
}
|
//↓↓↓↓↓↓以下部分根据具体业务修改↓↓↓↓↓↓
|
//格式转换
|
let arry = ['autographOne', 'autographTwo', 'autographDept', 'autographLegal', 'autographOrgan']
|
let wordData = this.transforData(data);
|
//↑↑↑↑↑↑以上部分根据具体业务修改↑↑↑↑↑↑
|
this.showView = true;
|
this.$nextTick(() => {
|
this.$refs.wordInfo.initMore(wordData, "/wordes/lasp.docx",arry, this.imgSize);
|
})
|
},
|
downloadWord(data) {
|
if(data.registerState == null || ""){
|
//预览前先进行保存
|
data.registerState = '0';
|
data.registerId = this.id;
|
data.processId = this.processId;
|
saveObj(data).then((res) => {
|
})
|
}
|
let arry = ['autographOne', 'autographTwo', 'autographDept', 'autographLegal', 'autographOrgan']
|
let wordData = this.transforData(data);
|
this.$nextTick(() => {
|
this.$refs.wordInfo.exportDocMore(wordData, "/wordes/lasp.docx", "立案审批表.docx",arry, this.imgSize);
|
})
|
},
|
transforData(obj) {
|
let s = JSON.stringify(obj);
|
let data = JSON.parse(s);
|
if (data.caseDate != '' && data.caseDate != null) {
|
data.caseDate = moment(data.caseDate).format('YYYY年MM月DD日');
|
}
|
let opinion = data.publicOpinion;
|
for (let attr in opinion) {
|
if (opinion[attr] == null) {
|
data[attr] = '';
|
} else {
|
data[attr] = opinion[attr];
|
}
|
}
|
let str = JSON.stringify(data);
|
let jsonData = JSON.parse(str);
|
data = jsonData;
|
|
if (opinion.undertakeDate != '' && opinion.undertakeDate != null) {
|
data.undertakeDate = moment(opinion.undertakeDate).format('YYYY年MM月DD日');
|
} else {
|
data.undertakeDate = ' 年 月 日'
|
}
|
if (opinion.takeDate != '' && opinion.takeDate != null) {
|
data.takeDate = moment(opinion.takeDate).format('YYYY年MM月DD日');
|
} else {
|
data.takeDate = ' 年 月 日'
|
}
|
if (opinion.legalDate != '' && opinion.legalDate != null) {
|
data.legalDate = moment(opinion.legalDate).format('YYYY年MM月DD日');
|
} else {
|
data.legalDate = ' 年 月 日'
|
}
|
if (opinion.organDate != '' && opinion.organDate != null) {
|
data.organDate = moment(opinion.organDate).format('YYYY年MM月DD日');
|
} else {
|
data.organDate = ' 年 月 日'
|
}
|
return data;
|
},
|
setPersonname(val) {
|
let names = "";
|
for (let i in this.organPersons) {
|
if (val.toString().indexOf(this.organPersons[i].userId) > -1) {
|
names += this.organPersons[i].realName + ",";
|
}
|
}
|
if (names != "") {
|
this.dataForm.hanlders = names.substring(0, names.length - 1);
|
}
|
}
|
},
|
|
}
|
</script>
|
|
<style scoped>
|
|
</style>
|