|
@@ -1,8 +1,8 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <el-row>
|
|
|
- <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px"
|
|
|
- label-position="left">
|
|
|
+ <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px"
|
|
|
+ label-position="left">
|
|
|
+ <el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="收件主体" prop="deptflg" >
|
|
|
<el-radio-group v-model="formData.deptflg" size="medium" @change="agreeChange">
|
|
@@ -19,8 +19,9 @@
|
|
|
type="primary"
|
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
- @click="handleSelect"
|
|
|
- >选择人员</el-button>
|
|
|
+ @click="handleSelect">
|
|
|
+ 选择人员
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-input>
|
|
|
<el-input v-model="formData.RecvAccount" v-show="false"/>
|
|
@@ -28,33 +29,28 @@
|
|
|
</el-col>
|
|
|
<el-col :span="24" v-if="showdw">
|
|
|
<el-form-item label="收件单位" prop="deptId">
|
|
|
-<!-- <el-tree-->
|
|
|
-<!-- :data="deptOptions"-->
|
|
|
-<!-- show-checkbox-->
|
|
|
-<!-- default-expand-all-->
|
|
|
-<!-- ref="dept"-->
|
|
|
-<!-- node-key="id"-->
|
|
|
-<!-- empty-text="加载中,请稍后"-->
|
|
|
-<!-- :props="defaultProps"-->
|
|
|
-<!-- ></el-tree>-->
|
|
|
- <el-input v-model="formData.RecvPerson" placeholder="请选择部门" clearable="true">
|
|
|
+ <el-input v-model="formData.RecvPerson" placeholder="请选择单位" clearable="true">
|
|
|
<template slot="append">
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
- @click="handleDept"
|
|
|
- >选择部门</el-button>
|
|
|
+ @click="handledept">
|
|
|
+ 选择单位
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-input>
|
|
|
+ <el-input v-model="formData.RecvAccount" v-show="false"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="通知标题" prop="Title">
|
|
|
<el-input v-model="formData.Title" placeholder="请输入通知标题" clearable :style="{width: '100%'}">
|
|
|
</el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
+
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="通知内容" prop="Content" style="height: 240px;">
|
|
|
<Editor v-model="formData.Content" />
|
|
@@ -97,48 +93,53 @@
|
|
|
<el-button @click="resetForm">重置</el-button>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- </el-form>
|
|
|
- <select-user-by-dept ref="selectUserByDept" :title="title" :open="open" :inputName="receiverName" :inputAccount="receiverAccount" append-to-body @ok="selectOK"/>
|
|
|
- <el-dialog :title="title" :visible.sync="open1" width="20%" :show-close="false" append-to-body>
|
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-table
|
|
|
- v-loading="loading"
|
|
|
- :data="deptList"
|
|
|
- row-key="deptId"
|
|
|
- default-expand-all
|
|
|
- :tree-props="{children: 'children', hasChildren: 'hasChildren'}" @selection-change="handleSelectionChange" >
|
|
|
- <el-table-column type="selection" width="55"></el-table-column>
|
|
|
- <el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
|
|
|
-<!-- <el-table-column label="创建时间" align="center" prop="createTime" width="200">-->
|
|
|
-<!-- <template slot-scope="scope">-->
|
|
|
-<!-- <span>{{ parseTime(scope.row.createTime) }}</span>-->
|
|
|
-<!-- </template>-->
|
|
|
-<!-- </el-table-column>-->
|
|
|
- </el-table>
|
|
|
- </el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitForm1">确 定</el-button>
|
|
|
- <el-button @click="cancel">取 消</el-button>
|
|
|
- </div>
|
|
|
- </el-dialog>
|
|
|
- </el-row>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+
|
|
|
+ <!-- 选择人员对话框 -->
|
|
|
+ <el-dialog :title="tctitle" :visible.sync="open" width="1000px" append-to-body>
|
|
|
+ <SelectRen ref="renlist"/>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitRen">选 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog :title="tctitle" :visible.sync="open1" width="20%" append-to-body style="size: 30px">
|
|
|
+ <el-tree
|
|
|
+ :data="deptOptions"
|
|
|
+ show-checkbox
|
|
|
+ default-expand-all
|
|
|
+ ref="dept"
|
|
|
+ node-key="id"
|
|
|
+ empty-text="加载中,请稍后"
|
|
|
+ :props="defaultProps"
|
|
|
+ ></el-tree>
|
|
|
+
|
|
|
+
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" @click="getDeptAllCheckedKeys">确 定</el-button>
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import SelectUserByDept from "@/components/SelectRen/selectUserByDept";
|
|
|
- import { listDept } from "@/api/system/dept";
|
|
|
|
|
|
- import { addtzfs,uploadfj } from "@/api/system/notify_info/tzfs";
|
|
|
+ import SelectRen from '@/components/SelectRen';
|
|
|
+ import { addtzfs,uploadfj } from "@/api/system/tzgl/tzfs";
|
|
|
import { treeselect } from "@/api/system/dept";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
import Editor from '@/components/Editor';
|
|
|
export default {
|
|
|
components: {
|
|
|
- SelectUserByDept,
|
|
|
- // SelectDept,
|
|
|
- Editor
|
|
|
+ SelectRen,
|
|
|
+ Treeselect,
|
|
|
+ Editor,
|
|
|
},
|
|
|
props: [],
|
|
|
data() {
|
|
@@ -154,14 +155,14 @@
|
|
|
deptflg:0,
|
|
|
fileName:'',
|
|
|
filePath:'',
|
|
|
- single:true
|
|
|
},
|
|
|
+
|
|
|
rules: {
|
|
|
- // deptId:[{
|
|
|
- // required:true,
|
|
|
- // message:'请选择收件单位',
|
|
|
- // trigger:'blur'
|
|
|
- // }],
|
|
|
+ deptId:[{
|
|
|
+ required:true,
|
|
|
+ message:'请选择收件单位',
|
|
|
+ trigger:'blur'
|
|
|
+ }],
|
|
|
RecvPerson:[{
|
|
|
required:true,
|
|
|
message:'请选择收件人',
|
|
@@ -187,11 +188,11 @@
|
|
|
message: '请输入收件人',
|
|
|
trigger: 'blur'
|
|
|
}],
|
|
|
- // SendAccount: [{
|
|
|
- // required: true,
|
|
|
- // message: '请输入收件单位',
|
|
|
- // trigger: 'blur'
|
|
|
- // }],
|
|
|
+ SendAccount: [{
|
|
|
+ required: true,
|
|
|
+ message: '请输入收件单位',
|
|
|
+ trigger: 'blur'
|
|
|
+ }],
|
|
|
ContactPerson: [{
|
|
|
required: true,
|
|
|
message: '请输入联系人',
|
|
@@ -210,16 +211,18 @@
|
|
|
tctitle: "",
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
- open1: false,
|
|
|
+ open1:false,
|
|
|
filterText: '', //人员选择器中的 筛选
|
|
|
+
|
|
|
// 部门树选项
|
|
|
deptOptions: [],
|
|
|
defaultProps: {
|
|
|
children: "children",
|
|
|
label: "label"
|
|
|
},
|
|
|
+
|
|
|
// 部门id
|
|
|
- depid: [],
|
|
|
+
|
|
|
depname:[],
|
|
|
deptflgOptions: [{
|
|
|
"label": "个人",
|
|
@@ -237,102 +240,32 @@
|
|
|
// watch: {},
|
|
|
created() {
|
|
|
this.getTreeselect();
|
|
|
- this.getList();
|
|
|
- this.getDicts("sys_normal_disable").then(response => {
|
|
|
- this.statusOptions = response.data;
|
|
|
- });
|
|
|
-
|
|
|
},
|
|
|
//mounted() {},
|
|
|
methods: {
|
|
|
- handleSelectionChange(selection) {
|
|
|
- // this.ids = selection.map(item => item.id)
|
|
|
- // this.single = selection.length!=1
|
|
|
- // this.multiple = !selection.length
|
|
|
- this.depid = selection.map(item => item.deptId);
|
|
|
- this.depname = selection.map(item => item.deptName);
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- /** 写信中的 选择人员 按钮弹窗操作 */
|
|
|
- handleSelect() {
|
|
|
- this.$refs.selectUserByDept.childOpen=true;
|
|
|
- this.open = true;
|
|
|
- this.title = "选择收件人";
|
|
|
- },
|
|
|
- selectOK(zh, xm) {
|
|
|
- this.formData.RecvPerson = xm;
|
|
|
- this.formData.RecvAccount = zh;
|
|
|
- this.open=false;
|
|
|
- },
|
|
|
- /** 写信中的 选择部门 按钮弹窗操作 */
|
|
|
- /** 查询部门列表 */
|
|
|
- handleDept() {
|
|
|
- this.open1=true;
|
|
|
- this.title = "选择部门";
|
|
|
- },
|
|
|
- getList() {
|
|
|
- this.loading = true;
|
|
|
- listDept(this.queryParams).then(response => {
|
|
|
- this.deptList = this.handleTree(response.data, "deptId");
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
- },
|
|
|
- /** 转换部门数据结构 */
|
|
|
- normalizer(node) {
|
|
|
- if (node.children && !node.children.length) {
|
|
|
- delete node.children;
|
|
|
- }
|
|
|
- return {
|
|
|
- id: node.deptId,
|
|
|
- label: node.deptName,
|
|
|
- children: node.children
|
|
|
- };
|
|
|
- },
|
|
|
- // 字典状态字典翻译
|
|
|
- statusFormat(row, column) {
|
|
|
- return this.selectDictLabel(this.statusOptions, row.status);
|
|
|
- },
|
|
|
-
|
|
|
- submitForm1(){
|
|
|
- // alert("success")
|
|
|
- // alert(this.depid)
|
|
|
- this.formData.RecvPerson = this.depname;
|
|
|
- this.open1=false;
|
|
|
- },
|
|
|
-
|
|
|
submitForm() {
|
|
|
this.$refs['elForm'].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- // TODO 提交表单
|
|
|
- if (this.formData.deptflg === 1) {
|
|
|
- this.formData.deptId = "";
|
|
|
- // this.depid = this.getDeptAllCheckedKeys();
|
|
|
- // alert(this.depid.length)
|
|
|
- if (this.depid.length > 0) {
|
|
|
- for (let i = 0; i < this.depid.length; i++) {
|
|
|
- this.formData.deptId += this.depid[i] + ',';
|
|
|
- }
|
|
|
- }else{
|
|
|
- this.msgError("请选择收件单位") ;
|
|
|
- return false;
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (this.formData.RecvAccount == "" || this.formData.RecvAccount == null) {
|
|
|
- this.msgError("请点击“选择人员”按钮,选择收件人");
|
|
|
- return false;
|
|
|
+ // TODO 提交表单
|
|
|
+ if (this.formData.deptflg === 1) {
|
|
|
+ this.formData.deptId = "";
|
|
|
+ this.depid = this.getDeptAllCheckedKeys();
|
|
|
+ if (this.depid.length > 0) {
|
|
|
+ for (let i = 0; i < this.depid.length; i++) {
|
|
|
+ this.formData.deptId += this.depid[i] + ',';
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- addtzfs(this.formData).then(response => {
|
|
|
- if (response.code === 200) {
|
|
|
- this.msgSuccess("发送成功");
|
|
|
- this.open = false; this.open1 = false;
|
|
|
- this.reset();
|
|
|
- }
|
|
|
- });
|
|
|
}
|
|
|
+
|
|
|
+ addtzfs(this.formData).then(response => {
|
|
|
+
|
|
|
+ if (response.code === 200) {
|
|
|
+ this.msgSuccess("发送成功");
|
|
|
+ this.open = false;
|
|
|
+ this.open1 = false;
|
|
|
+ this.getTreeselect();
|
|
|
+ this.reset();
|
|
|
+ }
|
|
|
+ });
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -356,40 +289,55 @@
|
|
|
this.depid = [];
|
|
|
this.deptOptions = [];
|
|
|
this.open = false;
|
|
|
+ this.open1 = false;
|
|
|
this.fjfileList = [];
|
|
|
this.fileList = [];
|
|
|
+ this.depname=[];
|
|
|
this.resetForm();
|
|
|
},
|
|
|
-
|
|
|
resetForm() {
|
|
|
+
|
|
|
+ this.depname=[];
|
|
|
+ this.formData.RecvPerson=[];
|
|
|
+ this.formData.RecvAccount=[];
|
|
|
this.$refs['elForm'].resetFields()
|
|
|
- },
|
|
|
|
|
|
+ },
|
|
|
+ /** ---------------收件人---------------*/
|
|
|
+ handleSelect() {
|
|
|
+ this.open = true;
|
|
|
+ this.tctitle = "选择收件人";
|
|
|
+ },
|
|
|
|
|
|
+ submitRen(){
|
|
|
+ this.formData.RecvPerson =this.$refs.renlist.names.join(',');
|
|
|
+ this.formData.RecvAccount=this.$refs.renlist.accounts.join(',');
|
|
|
+ this.open = false;
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ /** 人员选择器中的 筛选 */
|
|
|
+ filterText(val) {
|
|
|
+ this.$refs.tree.filter(val);
|
|
|
+ }
|
|
|
+ },
|
|
|
/** ---------------收件人end---------------*/
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
|
this.open1 = false;
|
|
|
this.filterText='';
|
|
|
+
|
|
|
+ },
|
|
|
+ handledept() {
|
|
|
+ this.open1 = true;
|
|
|
+ this.tctitle = "选择部门";
|
|
|
},
|
|
|
/** --------------查询部门下拉树结构---------------- */
|
|
|
getTreeselect() {
|
|
|
treeselect().then(response => {
|
|
|
this.deptOptions = response.data;
|
|
|
+ console.log(response.data)
|
|
|
});
|
|
|
},
|
|
|
- /** <!-- <el-tree-->
|
|
|
- <!-- :data="deptOptions"-->
|
|
|
- <!-- show-checkbox-->
|
|
|
- <!-- default-expand-all-->
|
|
|
- <!-- ref="dept"-->
|
|
|
- <!-- node-key="id"-->
|
|
|
- <!-- empty-text="加载中,请稍后"-->
|
|
|
- <!-- :props="defaultProps"-->
|
|
|
- <!-- ></el-tree>-->*/
|
|
|
- handleNodeClick(data) {
|
|
|
- console.log(data);
|
|
|
- },
|
|
|
// 筛选节点
|
|
|
filterNode(value, data) {
|
|
|
if (!value) return true;
|
|
@@ -403,8 +351,6 @@
|
|
|
getRoleDeptTreeselect(roleId) {
|
|
|
roleDeptTreeselect(roleId).then(response => {
|
|
|
this.deptOptions = response.depts;
|
|
|
- // this.deptOptions = response.data;
|
|
|
- console.log(response)
|
|
|
this.$refs.dept.setCheckedKeys(response.checkedKeys);
|
|
|
});
|
|
|
},
|
|
@@ -421,9 +367,18 @@
|
|
|
let checkedKeys = this.$refs.dept.getHalfCheckedKeys();
|
|
|
// 半选中的部门节点
|
|
|
let halfCheckedKeys = this.$refs.dept.getCheckedKeys();
|
|
|
+ let a= this.$refs.dept.getCheckedNodes();
|
|
|
+ for (let i = 0; i <a.length ; i++) {
|
|
|
+ this.depname.push(a[i].label)
|
|
|
+ }
|
|
|
+ console.log(this.depname)
|
|
|
checkedKeys.unshift.apply(checkedKeys, halfCheckedKeys);
|
|
|
- //return checkedKeys;
|
|
|
+ this.formData.RecvAccount =halfCheckedKeys ;
|
|
|
+ this.formData.RecvPerson = this.depname ;
|
|
|
+ this.open1=false;
|
|
|
+ this.depname=[];
|
|
|
return halfCheckedKeys;
|
|
|
+
|
|
|
},
|
|
|
/** 根据角色ID查询部门树结构 */
|
|
|
getRoleDeptTreeselect(roleId) {
|
|
@@ -432,6 +387,7 @@
|
|
|
this.$refs.dept.setCheckedKeys(response.checkedKeys);
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
/** ---------------查询部门下拉树结构end----------------- */
|
|
|
|
|
|
/** ---------------附件----------------- */
|
|
@@ -448,7 +404,7 @@
|
|
|
},
|
|
|
handleSuccess(file, fileInfo) {
|
|
|
console.log(fileInfo);
|
|
|
- debugger;
|
|
|
+
|
|
|
this.fileList.push({
|
|
|
name: fileInfo.name,
|
|
|
uuid: fileInfo.uid,
|
|
@@ -460,13 +416,8 @@
|
|
|
this.fjfileList.forEach((item, index) => {
|
|
|
debugger;
|
|
|
console.log(item);
|
|
|
- console.log(this.formData.fileName);
|
|
|
if (item.uid === file.uid) {
|
|
|
this.fjfileList.splice(index, 1);
|
|
|
- this.fileList.splice(index, 1);
|
|
|
- this.formData.fileName=this.formData.fileName.replace(""+item.name+",","");
|
|
|
- this.formData.filePath=this.formData.filePath.replace(""+item.filepath+",","");
|
|
|
- console.log(this.formData.fileName);
|
|
|
//删除
|
|
|
}
|
|
|
});
|
|
@@ -474,8 +425,6 @@
|
|
|
beforeRemove(file, fileList) {
|
|
|
return this.$confirm(`确定移除 ${ file.name }?`);
|
|
|
},
|
|
|
-
|
|
|
- //附件上传
|
|
|
fileRequest(item) {
|
|
|
let uploadData = new FormData()
|
|
|
uploadData.append('file',item.file)
|
|
@@ -495,7 +444,7 @@
|
|
|
/** ---------------附件end----------------- */
|
|
|
agreeChange(val){
|
|
|
let app = this;
|
|
|
- debugger;
|
|
|
+
|
|
|
this.formData.deptflg=val;
|
|
|
if(val===0)
|
|
|
{
|
|
@@ -511,7 +460,7 @@
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
-<style>
|
|
|
+<style >
|
|
|
.el-upload__tip {
|
|
|
line-height: 1.2;
|
|
|
}
|