Commit f38ab0df authored by 罗超's avatar 罗超

1

parent 95400b17
......@@ -33,10 +33,6 @@
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat class="sticky-tow-column-table"
separator="none" title="" :data="data" :columns="columns" row-key="name">
<template v-slot:top="props">
<!-- <div class="page-option" style="width:100%;">
<q-btn color="accent" style="float:right;margin-right:0;" size="sm" class="q-mr-md" icon="add"
label="发布公文" @click="addDoc(null)" />
</div> -->
</template>
<template v-slot:body-cell-NoticeStateName="props">
<q-td :props="props">
......@@ -60,7 +56,7 @@
<q-btn flat size="xs" icon="iconfont icon-xiangqing-" style="font-weight:400;color: #3FC4FF"
class="q-mr-xs" label="详情" @click="EditConfig(props.row.Id)" />
<q-btn flat size="xs" icon="iconfont icon-xiangqing-" style="font-weight:400;color: #3FC4FF"
class="q-mr-xs" label="审批" @click="showApproval(props.row.Id)" />
class="q-mr-xs" label="审批" @click="showApproval(props.row.Id)" v-if="shenpiId==loginId"/>
</q-td>
</template>
<template v-slot:bottom>
......@@ -185,26 +181,16 @@
</template>
<script>
import{getConten} from '../../api/system/notiveSysSet'
import {
getNoticePageList,
getNoticeStateEnumList,
getNoticeRuleEnumList, //获取编号规则 枚举列表
setNoticeBaseInfo, //新增修改 公告配置
setNoticeOperation, //公告操作
setNoticeInfo, //发布公告
GetNoticeInfo, //公告详情
setReviewNotice,//公告审批
getMyApproval,//我审批的公告
} from '../../api/administration/document';
import {
getDeptTree
} from '../../api/system/dept.js'
import {
queryEmployee
} from '../../api/users/user'
import {
UploadSelfFile,
} from '../../api/common/common'
import extEditor from '../../components/common/ext-editor'
import selectTree from '../../components/common/select-tree'
......@@ -331,7 +317,7 @@
},
{
name: 'LogContent',
label: '备注',
label: '审批备注',
align: 'left',
field: 'LogContent'
},
......@@ -346,35 +332,6 @@
NoticeList: [],
PersionList: [], //员工列表
AllemployeeList: [], //所有员工
NoticeBaseInfo: { //基础配置
Id: 0,
Image: '',
From: '',
NumberRule: '',
NumberRuleName: '',
CopyPeople: '',
},
tempManager: [], //默认抄送
tempManager2: [], //发布公告 默认抄送
RuleEnumList: [], //编号规则列表
saveLoading: false,
persistent: false,
addMsg: { //添加和修改公告
Id: 0,
From: '',
To: '-1', //抄送部门
CopyPeople: '-1', //抄送人
Title: '',
Content: '',
NoticeState: 1, //状态 1发布 2草稿
Is_Top: 2, //是否置顶 1是 2否
FileList: [], //附件列表
SendType: 1, //1-全公司,2-指定部门
},
fileList: [], //上传列表
DeptList: [], // 部门下拉
returnString: [], //默认岗位
drawer: false, //显示右侧抽屉
NInfo: {}, //详情内容
persistent2: false,
persistent3: false,
......@@ -384,21 +341,21 @@
LogContent:""
},
mydata:[],
mypageCount:0
mypageCount:0,
shenpiId:0,//审批人Id
loginId:0,//登录人Id
}
},
created(){
let data=JSON.parse(localStorage.getItem('loginUserInfo'))
this.loginId=data.data.Id
},
mounted() {
this.getList();
this.getNoticeList()
this.getEmployee()
this.getDepartList();
this.getNoticeRule() //获取编号规则 枚举列表
this.getEmployee();
this.getshenpiren();
},
methods: {
//获取编辑器值
getEditValue(obj) {
this.addMsg.Content = obj;
},
tabChange() {
if (this.tabCheck == 'first') {
this.getList();
......@@ -406,38 +363,6 @@
this.getMyList()
}
},
onRejected(rejectedEntries) {
this.$q.notify({
type: 'negative',
position: "top",
message: `文件验证失败,请重新上传`
})
},
uploadFile(files) {
UploadSelfFile('studentIcon', files[0], res => {
if (res.Code == 1) {
this.NoticeBaseInfo.Image = res.FileUrl;
}
})
},
uploadFile2(files) {
UploadSelfFile('studentIcon', files.file, res => {
if (res.Code == 1) {
let obj = {
name: res.FileName,
url: res.FileUrl,
}
this.fileList.push(obj)
}
})
},
beforeRemove(file, fileList) { //删除的操作
this.fileList.forEach((x, j) => {
if (x.uid == file.uid) {
this.fileList.splice(j, 1)
}
})
},
getList() {
this.loading = false;
getNoticePageList(this.msg).then(res => {
......@@ -448,22 +373,6 @@
this.loading = false
})
},
getNoticeList() {
this.loading = false;
getNoticeStateEnumList({
Name: '',
Id: ''
}).then(res => {
this.NoticeList = res.Data
let obj = {
Name: '不限',
Id: 0
}
this.NoticeList.unshift(obj)
}).catch(() => {
this.loading = false
})
},
//筛选员工
filterFn(val, update) {
update(() => {
......@@ -495,212 +404,25 @@
}
})
},
//获取部门下拉数据
getDepartList(id) {
let msg = {
School_Id: 0
}
getDeptTree(msg).then(res => {
if (res.Code == 1) {
this.DeptList = res.Data;
}
})
},
//分页改变
changePage(val) {
this.msg.PageIndex = val;
this.getList()
},
getChild(deptArray) {
var tempStr = "";
if (deptArray && deptArray != '') {
tempStr = deptArray;
}
if (tempStr) {
this.addMsg.To = tempStr;
} else {
this.addMsg.To = '';
}
},
getNoticeRule() {
getNoticeRuleEnumList({
Name: '',
Id: ''
}).then(res => {
if (res.Code == 1) {
this.RuleEnumList = res.Data
}
})
},
save() {
this.saveLoading = true;
var tempStr = "";
if (this.tempManager && this.tempManager.length > 0) {
this.tempManager.forEach(item => {
tempStr += "," + item;
});
}
if (tempStr && tempStr != '') {
//去掉第一个字符
tempStr = tempStr.substr(1);
}
this.NoticeBaseInfo.CopyPeople = tempStr;
setNoticeBaseInfo(this.NoticeBaseInfo).then(res => {
this.saveLoading = false
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
}
}).catch(() => {
this.saveLoading = false
})
},
// 获取详情
getNInfo(id) {
GetNoticeInfo({
NoticeId: id
}).then(res => {
if (res.Code == 1) {
this.NInfo = JSON.parse(JSON.stringify(res.Data));
this.addMsg.Id = res.Data.Id;
this.addMsg.From = res.Data.From;
//数组处理
this.addMsg.To = res.Data.To;
this.returnString = []
this.returnString = res.Data.To.split(',').map(Number)
//数组处理
this.addMsg.CopyPeople = res.Data.CopyPeople;
this.tempManager2 = res.Data.CopyPeople.split(',').map(Number) //字符串转为数组map 是转为数字
this.addMsg.Title = res.Data.Title;
this.addMsg.Content = res.Data.Content;
this.addMsg.NoticeState = res.Data.NoticeState;
this.addMsg.Is_Top = res.Data.Is_Top;
if (res.Data.To == "0" || res.Data.To == "-1") {
this.addMsg.SendType = 1;
} else {
this.addMsg.SendType = 2;
}
this.fileList = [];
res.Data.FileList.forEach((x) => {
let obj = {
name: x.FileName,
url: x.FileUrl
}
this.fileList.push(obj)
})
}
}).catch(() => {})
},
addDoc(id) {
if (id) {
this.getNInfo(id)
} else {
this.tempManager2 = this.tempManager ? this.tempManager : []
this.addMsg.From = this.NoticeBaseInfo.From;
this.addMsg.Title = this.NoticeBaseInfo.Title;
this.addMsg.Id = 0;
this.addMsg.Content = this.NoticeBaseInfo.Content;
this.addMsg.NoticeState = 1;
this.addMsg.Is_Top = 2;
this.addMsg.FileList = [];
this.fileList = []
}
this.persistent = true;
},
closeSaveForm() {
this.persistent = false
},
save_t(val) {
this.$refs.From.validate()
this.$refs.Title.validate()
if (!this.$refs.From.hasError && !this.$refs.Title.hasError) {
this.addMsg.NoticeState = val //发布状态
this.saveLoading = true;
var tempStr = "";
if (this.tempManager2 && this.tempManager2.length > 0) {
this.tempManager2.forEach(item => {
tempStr += "," + item;
});
}
if (tempStr && tempStr != '') {
//去掉第一个字符
tempStr = tempStr.substr(1);
}
this.addMsg.CopyPeople = tempStr;
this.addMsg.FileList = []
this.fileList.forEach((x) => {
let obj = {
FileName: x.name,
FileUrl: x.url
}
this.addMsg.FileList.push(obj)
})
let data = this.addMsg
if (data.CopyPeople == '') {
data.CopyPeople = -1
}
if (data.To == '') {
data.To = -1
}
if (data.SendType == 1) {
data.To = -1;
}
setNoticeInfo(data).then(res => {
this.saveLoading = false
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '数据保存成功!',
position: 'top'
})
this.$emit("success")
this.persistent = false
this.getList();
}
}).catch(() => {
this.saveLoading = false
})
}
},
EditConfig(id) {
this.persistent2 = true;
this.getNInfo(id);
},
setNoticeOtion(id, type) {
setNoticeOperation({
NoticeId: id,
Type: type
}).then(res => {
this.saveLoading = false
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: '操作成功!',
position: 'top'
})
this.$emit("success")
this.persistent = false
this.msg.PageIndex = 1;
this.getList();
}
}).catch(() => {
this.saveLoading = false
})
},
wopen(file) {
window.open(file.FileUrl);
},
//显示审批弹窗
showApproval(id) {
this.persistent3 = true
......@@ -739,6 +461,14 @@
this.mymsg.PageIndex = val;
this.getMyList()
},
//获取审批人
getshenpiren() {
getConten({}).then(res => {
if (res.Code === 1) {
this.shenpiId = parseInt(res.Data.Content)
}
})
},
}
}
......
......@@ -13,8 +13,17 @@
公告审批人:
</div>
<div class="col-3">
<q-select v-model="msg.Content" :options="EmployeeListOption" color="primary" filled clearable
option-label="EmployeeName" option-value="Id" ref="Admin" emit-value map-options :rules="[val => !!val|| '请选择公告审批人']"/>
<q-select option-value="Id" option-label="EmployeeName" color="primary" filled
:rules="[val => !!val|| '请选择公告审批人']" v-model="msg.Content" use-input clearable @filter="filterFn"
:options="EmployeeListOption" emit-value map-options ref="Admin">
<template v-slot:no-option>
<q-item>
<q-item-section class="text-grey">
未找到相关数据
</q-item-section>
</q-item>
</template>
</q-select>
</div>
<div class="col-3" style="padding:18px 0 0 10px;color:gray">
</div>
......@@ -50,6 +59,7 @@
Content: 0
},
EmployeeListOption: [],
allEmployeeListOption: [],
}
},
created() {},
......@@ -67,9 +77,22 @@
queryEmployee(qMsg).then(res => {
if (res.Code == 1) {
this.EmployeeListOption = res.Data;
this.allEmployeeListOption = res.Data;
}
}).catch(() => {})
},
//筛选员工
filterFn(val, update) {
update(() => {
if (val === '') {
this.EmployeeListOption = JSON.parse(JSON.stringify(this.allEmployeeListOption))
} else {
const needle = val.toLowerCase();
this.EmployeeListOption = this.allEmployeeListOption.filter(v => v.EmployeeName.toLowerCase().indexOf(
needle) > -1);
}
})
},
getData() {
getConten({}).then(res => {
if (res.Code === 1) {
......@@ -81,12 +104,12 @@
this.$refs.Admin.validate();
if (!this.$refs.Admin.hasError) {
setConten(this.msg).then(res => {
if(res.Code===1){
this.$message.success('操作成功')
this.getConten();
}else{
this.$message.error(res.Message)
}
if (res.Code === 1) {
this.$message.success('操作成功')
this.getConten();
} else {
this.$message.error(res.Message)
}
})
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment