| | |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | v-if="permission.notice_delete" |
| | | plain |
| | | @click="handleDelete" |
| | | >删 除 |
| | |
| | | <el-tag>{{ row.categoryName }}</el-tag> |
| | | </template> |
| | | <template slot-scope="{ type, size, row }" slot="menu"> |
| | | <el-button |
| | | :size="size" |
| | | :type="type" |
| | | @click="handleUploadPage(row)" |
| | | <el-button |
| | | :size="size" |
| | | :type="type" |
| | | v-if="permission.notice_upload" |
| | | @click="handleUploadPage(row)" |
| | | >附件上传 |
| | | </el-button> |
| | | <!-- <el-button |
| | |
| | | import { getListPage, remove, update, add, getNotice } from "@/api/desk/notice"; |
| | | import { getDept } from "@/api/system/dept"; |
| | | import { mapGetters } from "vuex"; |
| | | import { mapState } from 'vuex'; |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | border: true, |
| | | index: true, |
| | | stripe: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | excelBtn: false, |
| | | addBtnText: "发布", |
| | | addTitle: "发布", |
| | | saveBtnText: "发布", |
| | | menuWidth: 320, |
| | | dialogClickModal: false, |
| | | column: [ |
| | |
| | | label: "通知标题", |
| | | prop: "title", |
| | | span: 24, |
| | | searchSpan: 4, |
| | | row: true, |
| | | search: true, |
| | | rules: [ |
| | |
| | | defaultValue: "1", |
| | | prop: "category", |
| | | search: true, |
| | | searchSpan:5, |
| | | searchSpan: 4, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | label: "通知时间", |
| | | prop: "releaseTimeRange", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd hh:mm:ss", |
| | | valueFormat: "yyyy-MM-dd hh:mm:ss", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | searchRange: true, |
| | | hide: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | search: true, |
| | | searchSpan:6, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | ...mapGetters(["userInfo", "permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: this.vaildData(this.permissionAdd, true), |
| | | viewBtn: this.vaildData(this.permissionView, true), |
| | | delBtn: this.vaildData(this.permissionDelete, true), |
| | | editBtn: this.vaildData(this.permissionEdit, true), |
| | | addBtn: this.vaildData(this.permission.notice_add, false), |
| | | viewBtn: this.vaildData(this.permission.notice_view, false), |
| | | delBtn: this.vaildData(this.permission.notice_delete, false), |
| | | editBtn: this.vaildData(this.permission.notice_edit, false), |
| | | }; |
| | | }, |
| | | ids() { |
| | |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | ...mapState({ |
| | | userInfo: state => state.user.userInfo |
| | | }) |
| | | }, |
| | | mounted() {}, |
| | | mounted() { |
| | | this.getDeptInfo(this.userInfo.dept_id); |
| | | }, |
| | | methods: { |
| | | //获取当前用户部门信息 |
| | | getDeptInfo(deptId) { |
| | |
| | | ? (that.deptCategory = true) |
| | | : (that.deptCategory = false); |
| | | |
| | | // if (that.deptCategory) { |
| | | that.permissionAdd = this.permission.notice_add; |
| | | that.permissionView = this.permission.notice_view; |
| | | that.permissionDelete = this.permission.notice_delete; |
| | | that.permissionEdit = this.permission.notice_edit; |
| | | // } |
| | | }); |
| | | }, |
| | | //跳转到附近列表页面 |
| | | //跳转到附件列表页面 |
| | | handleUploadPage(row) { |
| | | this.$router.push({ |
| | | path: `/resource/attach`, |
| | | path: `/resource/uploadNotice`, |
| | | query: { |
| | | deptId: row.deptId, |
| | | noticeId: row.id, |
| | | }, |
| | | }); |
| | | }, |
| | | rowSave(row, done, loading) { |
| | | row.category = 1; |
| | | if (this.deptCategory) { |
| | | row.category = 1; |
| | | }else{ |
| | | row.category = 2; |
| | | } |
| | | row['type'] = 1; |
| | | row.deptId = this.deptId; |
| | | add(row).then( |
| | | () => { |
| | |
| | | ); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | row.category = 1; |
| | | // if (this.deptCategory) { |
| | | // row.category = 1; |
| | | // }else{ |
| | | // row.category = 2; |
| | | // } |
| | | row.deptId = this.deptId; |
| | | update(row).then( |
| | | () => { |
| | |
| | | ? (that.deptCategory = true) |
| | | : (that.deptCategory = false); |
| | | |
| | | // if (that.deptCategory) { |
| | | that.permissionAdd = this.permission.notice_add; |
| | | that.permissionView = this.permission.notice_view; |
| | | that.permissionDelete = this.permission.notice_delete; |
| | | that.permissionEdit = this.permission.notice_edit; |
| | | // } |
| | | |
| | | const { releaseTimeRange } = this.query; |
| | | // if (that.deptCategory) { |
| | | params["deptId"] = this.deptId; |
| | | params["jurisdiction"] = this.jurisdiction; |
| | | // } |
| | | params["jurisdiction"] = this.jurisdiction; |
| | | params["type"] = 1; |
| | | let values = { |
| | | ...params, |
| | | }; |
| | |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | // this.data.forEach((item) => { |
| | | // if (item.category == 2) { |
| | | // that.option.addBtn = false; |
| | | // that.option.editBtn = false; |
| | | // that.option.delBtn = false; |
| | | // } |
| | | // if (item.category == 1) { |
| | | // that.option.addBtn = true; |
| | | // that.option.editBtn = true; |
| | | // that.option.delBtn = true; |
| | | // } |
| | | // }); |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |