|
@@ -0,0 +1,456 @@
|
|
|
|
+
|
|
|
|
+<style scoped>
|
|
|
|
+.user-panel {
|
|
|
|
+ margin: 10px auto;
|
|
|
|
+}
|
|
|
|
+</style>
|
|
|
|
+<template>
|
|
|
|
+ <el-dialog
|
|
|
|
+ :visible.sync="showDialog"
|
|
|
|
+ :title="title"
|
|
|
|
+ :modal-append-to-body="false"
|
|
|
|
+ style="text-align: left"
|
|
|
|
+ @close="closeDialog"
|
|
|
|
+ :close-on-click-modal="false"
|
|
|
|
+ >
|
|
|
|
+ <div class="user-panel" v-loading="loading">
|
|
|
|
+ <el-form
|
|
|
|
+ ref="form"
|
|
|
|
+ :model="formModel"
|
|
|
|
+ :rules="ruleValidate"
|
|
|
|
+ :label-width="'100px'"
|
|
|
|
+ >
|
|
|
|
+ <el-form-item label="督办类型" prop="caseType">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="formModel.caseType"
|
|
|
|
+ filterable
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ style="width: 300px"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="caseType in caseTypeResult"
|
|
|
|
+ :key="caseType.value"
|
|
|
|
+ :label="caseType.name"
|
|
|
|
+ :value="caseType.value"
|
|
|
|
+ ></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-row v-if="ldps">
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="领导批示类型" prop="instructionsType">
|
|
|
|
+ <el-select
|
|
|
|
+ v-model="formModel.instructionsType"
|
|
|
|
+ filterable
|
|
|
|
+ placeholder="请选择"
|
|
|
|
+ style="width: 300px"
|
|
|
|
+ >
|
|
|
|
+ <el-option
|
|
|
|
+ v-for="instructionsType in instructionsTypeResult"
|
|
|
|
+ :key="instructionsType.value"
|
|
|
|
+ :label="instructionsType.name"
|
|
|
|
+ :value="instructionsType.value"
|
|
|
|
+ ></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="批示时间" prop="instructionsTime">
|
|
|
|
+ <el-date-picker
|
|
|
|
+ v-model="formModel.instructionsTime"
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
+ type="date"
|
|
|
|
+ style="width: 300px"
|
|
|
|
+ placeholder="请选择批示时间"
|
|
|
|
+ >
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24">
|
|
|
|
+ <el-form-item label="领导批示" prop="instructions">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="formModel.instructions"
|
|
|
|
+ placeholder="请输入领导批示"
|
|
|
|
+ style="width: 95%"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-form-item label="标题" prop="title">
|
|
|
|
+ <el-input
|
|
|
|
+ v-model="formModel.title"
|
|
|
|
+ placeholder="请输入标题"
|
|
|
|
+ style="width: 95%"
|
|
|
|
+ ></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="内容" prop="content">
|
|
|
|
+ <mce-editor
|
|
|
|
+ ref="editor"
|
|
|
|
+ uploadName="upfile"
|
|
|
|
+ v-model="formModel.content"
|
|
|
|
+ :url="uploadUrl"
|
|
|
|
+ :config="editorConfig"
|
|
|
|
+ ></mce-editor>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="附件" prop="attList">
|
|
|
|
+ <el-upload
|
|
|
|
+ class="avatar-uploader"
|
|
|
|
+ name="photoFile"
|
|
|
|
+ :action="uploadImgUrl"
|
|
|
|
+ :headers="headers"
|
|
|
|
+ :data="uploadData"
|
|
|
|
+ :on-success="fileHandleAvatarSuccess"
|
|
|
|
+ :before-upload="fileBeforeAvatarUpload"
|
|
|
|
+ :before-remove="fileHandleRemove"
|
|
|
|
+ :on-preview="fileHandleDownload"
|
|
|
|
+ :file-list="formModel.attList"
|
|
|
|
+ :auto-upload="true"
|
|
|
|
+ accept="application/msword,application/vnd.ms-excel,application/vnd.ms-powerpoint,application/pdf"
|
|
|
|
+ >
|
|
|
|
+ <el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
+ </el-upload>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="图片" prop="picList">
|
|
|
|
+ <el-upload
|
|
|
|
+ class="avatar-uploader"
|
|
|
|
+ name="photoFile"
|
|
|
|
+ :action="uploadImgUrl"
|
|
|
|
+ :headers="headers"
|
|
|
|
+ :data="uploadData"
|
|
|
|
+ :on-success="picHandleAvatarSuccess"
|
|
|
|
+ :before-upload="picBeforeAvatarUpload"
|
|
|
|
+ :file-list="formModel.picList"
|
|
|
|
+ :auto-upload="true"
|
|
|
|
+ accept="image/png,image/jpeg"
|
|
|
|
+ list-type="picture-card"
|
|
|
|
+ >
|
|
|
|
+ <i slot="default" class="el-icon-plus"></i>
|
|
|
|
+ <div slot="file" slot-scope="{file}">
|
|
|
|
+ <img
|
|
|
|
+ class="el-upload-list__item-thumbnail"
|
|
|
|
+ :src="file.url" alt=""
|
|
|
|
+ >
|
|
|
|
+ <span class="el-upload-list__item-actions">
|
|
|
|
+ <span
|
|
|
|
+ class="el-upload-list__item-preview"
|
|
|
|
+ @click="picHandlePictureCardPreview(file)"
|
|
|
|
+ >
|
|
|
|
+ <i class="el-icon-zoom-in"></i>
|
|
|
|
+ </span>
|
|
|
|
+ <span
|
|
|
|
+ v-if="!picDisabled"
|
|
|
|
+ class="el-upload-list__item-delete"
|
|
|
|
+ @click="picHandleRemove(file)"
|
|
|
|
+ >
|
|
|
|
+ <i class="el-icon-delete"></i>
|
|
|
|
+ </span>
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ </el-upload>
|
|
|
|
+ <el-dialog :visible.sync="picDialogVisible"
|
|
|
|
+ title="查看图片"
|
|
|
|
+ :modal-append-to-body="false"
|
|
|
|
+ :append-to-body="true"
|
|
|
|
+ >
|
|
|
|
+ <img width="100%" :src="picDialogImageUrl" alt="">
|
|
|
|
+ </el-dialog>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="责任单位" prop="stepOrgId">
|
|
|
|
+ <el-select-tree
|
|
|
|
+ :props="props"
|
|
|
|
+ :options="queryOrgResult"
|
|
|
|
+ v-model="formModel.stepOrgId"
|
|
|
|
+ style="width:300px;"
|
|
|
|
+ size="mediumn"
|
|
|
|
+ height="200"
|
|
|
|
+ ></el-select-tree>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="12">
|
|
|
|
+ <el-form-item label="提醒时间" prop="stepWarnTime">
|
|
|
|
+ <el-date-picker
|
|
|
|
+ v-model="formModel.stepWarnTime"
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
+ type="date"
|
|
|
|
+ style="width: 300px"
|
|
|
|
+ placeholder="请选择提醒时间"
|
|
|
|
+ >
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <!-------------->
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button @click="closeDialog">取 消</el-button>
|
|
|
|
+ <el-button type="primary" @click="handleSubmit" :loading="submitting">确 定</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ </el-dialog>
|
|
|
|
+</template>
|
|
|
|
+<script>
|
|
|
|
+import Constant from "@/constant";
|
|
|
|
+import incidentApi from "@/api/base/incident";
|
|
|
|
+import dataDictionaryApi from "@/api/sys/dataDictionary";
|
|
|
|
+import organizationApi from "@/api/base/organization";
|
|
|
|
+import SelectTree from "@/components/SelectTree";
|
|
|
|
+import MceEditor from "@/components/Tinymce";
|
|
|
|
+import { getToken } from "@/utils/auth";
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ props: ["businessKey", "title"],
|
|
|
|
+ components: {
|
|
|
|
+ "mce-editor": MceEditor,
|
|
|
|
+ "el-select-tree": SelectTree
|
|
|
|
+ },
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ formModel: {},
|
|
|
|
+ ruleValidate: {
|
|
|
|
+ title: [{ required: true, message: "标题不能为空", trigger: "blur" }],
|
|
|
|
+ content: [{ required: true, message: "内容不能为空", trigger: "blur" }],
|
|
|
|
+ caseType: [
|
|
|
|
+ { required: true, message: "督办类型不能为空", trigger: "blur" },
|
|
|
|
+ ],
|
|
|
|
+ stepOrgId: [{ required: true, message: "责任单位不能为空", trigger: "blur" }],
|
|
|
|
+ stepWarnTime: [{ required: true, message: "提醒时间不能为空", trigger: "blur" }],
|
|
|
|
+ },
|
|
|
|
+ showDialog: true,
|
|
|
|
+ loading: false,
|
|
|
|
+ submitting: false,
|
|
|
|
+ caseTypeResult: [],
|
|
|
|
+ instructionsTypeResult: [],
|
|
|
|
+ ldps: false,
|
|
|
|
+ editorConfig: {
|
|
|
|
+ height: 200,
|
|
|
|
+ width: "95%",
|
|
|
|
+ },
|
|
|
|
+ uploadUrl: Constant.serverUrl + "/tinymce/upload?token=" + getToken(),
|
|
|
|
+ //上传图片start
|
|
|
|
+ uploadImgUrl: Constant.serverUrl + "/uploadPicture",
|
|
|
|
+ uploadData: {
|
|
|
|
+ subFolder: "supervision",
|
|
|
|
+ },
|
|
|
|
+ headers: {
|
|
|
|
+ Authorization: getToken(),
|
|
|
|
+ },
|
|
|
|
+ picDialogImageUrl: '',
|
|
|
|
+ picDialogVisible: false,
|
|
|
|
+ picDisabled: false,
|
|
|
|
+ //上传图片end
|
|
|
|
+ queryOrgResult: [],
|
|
|
|
+ props: {
|
|
|
|
+ // 配置项(必选)
|
|
|
|
+ value: "id",
|
|
|
|
+ label: "name"
|
|
|
|
+ }
|
|
|
|
+ };
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ var self = this;
|
|
|
|
+
|
|
|
|
+ dataDictionaryApi
|
|
|
|
+ .findByCatalogName({
|
|
|
|
+ catalogName: "督办类型",
|
|
|
|
+ })
|
|
|
|
+ .then((response) => {
|
|
|
|
+ var jsonData = response.data;
|
|
|
|
+ this.caseTypeResult = jsonData.data;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ dataDictionaryApi
|
|
|
|
+ .findByCatalogName({
|
|
|
|
+ catalogName: "领导批示类型",
|
|
|
|
+ })
|
|
|
|
+ .then((response) => {
|
|
|
|
+ var jsonData = response.data;
|
|
|
|
+ this.instructionsTypeResult = jsonData.data;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ picHandleRemove(file) {
|
|
|
|
+ var self = this;
|
|
|
|
+ self.$confirm("是否确认删除?", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ var index = self.formModel.picList.findIndex(item => {
|
|
|
|
+ if ( item.url == file.url) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ self.formModel.picList.splice(index,1);
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ picHandlePictureCardPreview(file) {
|
|
|
|
+ this.picDialogImageUrl = file.url;
|
|
|
|
+ this.picDialogVisible = true;
|
|
|
|
+ },
|
|
|
|
+ picHandleAvatarSuccess(res, file) {
|
|
|
|
+ this.loading = false;
|
|
|
|
+ var self = this;
|
|
|
|
+
|
|
|
|
+ var attachmentDTO = {
|
|
|
|
+ name: res.data.fileName,
|
|
|
|
+ url: res.data.fileUrl,
|
|
|
|
+ }
|
|
|
|
+ self.formModel.picList.push(attachmentDTO);
|
|
|
|
+ },
|
|
|
|
+ picBeforeAvatarUpload(file) {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ const isLt2M = file.size / 1024 / 1024 < 2;
|
|
|
|
+
|
|
|
|
+ if (!isLt2M) {
|
|
|
|
+ this.$message.error("上传图片大小不能超过 2MB!");
|
|
|
|
+ this.loading = false;
|
|
|
|
+ }
|
|
|
|
+ return isLt2M;
|
|
|
|
+ },
|
|
|
|
+ fileHandleDownload(file){
|
|
|
|
+ return false;
|
|
|
|
+ },
|
|
|
|
+ fileHandleRemove(file) {
|
|
|
|
+ var self = this;
|
|
|
|
+ self.$confirm("是否确认删除?", "提示", {
|
|
|
|
+ confirmButtonText: "确定",
|
|
|
|
+ cancelButtonText: "取消",
|
|
|
|
+ type: "warning",
|
|
|
|
+ })
|
|
|
|
+ .then(() => {
|
|
|
|
+ var index = self.formModel.attList.findIndex(item => {
|
|
|
|
+ if ( item.url == file.url) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ self.formModel.attList.splice(index,1);
|
|
|
|
+ })
|
|
|
|
+ .catch(() => {
|
|
|
|
+ });
|
|
|
|
+ return false;
|
|
|
|
+ },
|
|
|
|
+ fileHandleAvatarSuccess(res, file) {
|
|
|
|
+ this.loading = false;
|
|
|
|
+ var self = this;
|
|
|
|
+
|
|
|
|
+ var attachmentDTO = {
|
|
|
|
+ name: res.data.fileName,
|
|
|
|
+ url: res.data.fileUrl,
|
|
|
|
+ }
|
|
|
|
+ self.formModel.attList.push(attachmentDTO);
|
|
|
|
+ },
|
|
|
|
+ fileBeforeAvatarUpload(file) {
|
|
|
|
+ this.loading = true;
|
|
|
|
+ const isLt2M = file.size / 1024 / 1024 < 4;
|
|
|
|
+
|
|
|
|
+ if (!isLt2M) {
|
|
|
|
+ this.$message.error("上传附件大小不能超过 4MB!");
|
|
|
|
+ this.loading = false;
|
|
|
|
+ }
|
|
|
|
+ return isLt2M;
|
|
|
|
+ },
|
|
|
|
+ closeDialog() {
|
|
|
|
+ this.$emit("close", false);
|
|
|
|
+ },
|
|
|
|
+ handleReset(name) {
|
|
|
|
+ this.queryMenu();
|
|
|
|
+ },
|
|
|
|
+ handleSubmit() {
|
|
|
|
+ var self = this;
|
|
|
|
+ self.loading = true;
|
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ (function () {
|
|
|
|
+ var id = self.formModel.id;
|
|
|
|
+
|
|
|
|
+ self.formModel.content = self.$refs.editor.getContent();
|
|
|
|
+ if (id == null || id.length == 0) {
|
|
|
|
+ return incidentApi.add(self.formModel);
|
|
|
|
+ } else {
|
|
|
|
+ return incidentApi.update(self.formModel);
|
|
|
|
+ }
|
|
|
|
+ })().then(function (response) {
|
|
|
|
+ self.loading = false;
|
|
|
|
+ var jsonData = response.data;
|
|
|
|
+
|
|
|
|
+ if (jsonData.result) {
|
|
|
|
+ self.$message({
|
|
|
|
+ message: "保存成功!",
|
|
|
|
+ type: "success",
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ self.$emit("close", true);
|
|
|
|
+ } else {
|
|
|
|
+ self.$message({
|
|
|
|
+ message: jsonData.message + "",
|
|
|
|
+ type: "warning",
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ self.$emit("close", false);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ queryMenu(keywords) {
|
|
|
|
+ var formData = new FormData();
|
|
|
|
+ formData.append("keywords",keywords);
|
|
|
|
+
|
|
|
|
+ return organizationApi.query(formData).then(response=>{
|
|
|
|
+ var jsonData = response.data;
|
|
|
|
+
|
|
|
|
+ if(jsonData.result){
|
|
|
|
+ this.queryOrgResult = jsonData.data;
|
|
|
|
+ }
|
|
|
|
+ else{
|
|
|
|
+ this.$message.error(jsonData.message + "");
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ mounted: function () {
|
|
|
|
+ this.queryMenu("");
|
|
|
|
+ var self = this;
|
|
|
|
+
|
|
|
|
+ (function () {
|
|
|
|
+ if (self.businessKey.length == 0) {
|
|
|
|
+ return incidentApi.create();
|
|
|
|
+ } else {
|
|
|
|
+ return incidentApi.edit(self.businessKey);
|
|
|
|
+ }
|
|
|
|
+ })()
|
|
|
|
+ .then((response) => {
|
|
|
|
+ var jsonData = response.data;
|
|
|
|
+ self.loading = false;
|
|
|
|
+
|
|
|
|
+ if (jsonData.result) {
|
|
|
|
+ self.formModel = jsonData.data;
|
|
|
|
+ if (self.formModel.content != null) {
|
|
|
|
+ self.$refs.editor.setContent(self.formModel.content);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ self.$message.error(jsonData.message + "");
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ .catch((error) => {
|
|
|
|
+ self.$message.error(error + "");
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ watch: {
|
|
|
|
+ "formModel.caseType": function (newVal, oldVal) {
|
|
|
|
+ if (newVal != null) {
|
|
|
|
+ switch (newVal) {
|
|
|
|
+ case "1":
|
|
|
|
+ this.ldps = true;
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ this.ldps = false;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+</script>
|