|
@@ -0,0 +1,233 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="meeting-set">
|
|
|
|
+ <div class="meeting-item hui-flex hui-content border-box">
|
|
|
|
+ <div class="hui-content-title">
|
|
|
|
+ <div class="hui-title-item active">会议场所</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="hui-flex-box">
|
|
|
|
+ <div class="tag">
|
|
|
|
+ <div class="target-item" v-for="item in placeList" :key="item.id">
|
|
|
|
+ <span class="label">{{item.name}}</span>
|
|
|
|
+ <i class="iconfont huifont-bianji" v-permission="'/work/oa/meeting/set/place/update'"
|
|
|
|
+ @click.stop="updateFunc(1,item)"></i>
|
|
|
|
+ <i class="iconfont huifont-guanbi" v-permission="'/work/oa/meeting/set/place/delete'"
|
|
|
|
+ @click.stop="deleteFunc(1,item)"></i>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="target-item target-item-insert" v-permission="'/work/oa/meeting/set/place/add'"
|
|
|
|
+ @click="insertFunc(1)">
|
|
|
|
+ <i class="iconfont huifont-xinzeng"></i>
|
|
|
|
+ <span class="label">新增场所</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="meeting-line"></div>
|
|
|
|
+ <div class="meeting-item hui-flex hui-content border-box">
|
|
|
|
+ <div class="hui-content-title">
|
|
|
|
+ <div class="hui-title-item active">会议类型</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="hui-flex-box">
|
|
|
|
+ <div class="tag">
|
|
|
|
+ <div class="target-item" v-for="item in typeList" :key="item.id">
|
|
|
|
+ <span class="label">{{item.name}}</span>
|
|
|
|
+ <i class="iconfont huifont-bianji" v-permission="'/work/oa/meeting/set/type/update'"
|
|
|
|
+ @click.stop="updateFunc(2,item)"></i>
|
|
|
|
+ <i class="iconfont huifont-guanbi" v-permission="'/work/oa/meeting/set/type/delete'"
|
|
|
|
+ @click.stop="deleteFunc(2,item)"></i>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="target-item target-item-insert" v-permission="'/work/oa/meeting/set/type/add'"
|
|
|
|
+ @click="insertFunc(2)">
|
|
|
|
+ <i class="iconfont huifont-xinzeng"></i>
|
|
|
|
+ <span class="label">新增类型</span>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ import {
|
|
|
|
+ getMeetingPlaceListByQuery,
|
|
|
|
+ insertMeetingPlace,
|
|
|
|
+ updateMeetingPlace,
|
|
|
|
+ deleteMeetingPlaceById,
|
|
|
|
+ getMeetingTypeListByQuery,
|
|
|
|
+ insertMeetingType,
|
|
|
|
+ updateMeetingType,
|
|
|
|
+ deleteMeetingTypeById
|
|
|
|
+ } from '@/api/oa'
|
|
|
|
+ export default {
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ placeList: [],
|
|
|
|
+ typeList: []
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ this.initPlaceList();
|
|
|
|
+ this.initTypeList();
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ initPlaceList() {
|
|
|
|
+ if (!this.auth('/work/oa/meeting/set/place/list')) return;
|
|
|
|
+ getMeetingPlaceListByQuery({
|
|
|
|
+ organizationId: this.$store.getters.organization.id,
|
|
|
|
+ projectId: this.$store.getters.project.id
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.state) {
|
|
|
|
+ this.placeList = res.data;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ initTypeList() {
|
|
|
|
+ if (!this.auth('/work/oa/meeting/set/type/list')) return;
|
|
|
|
+ getMeetingTypeListByQuery({
|
|
|
|
+ organizationId: this.$store.getters.organization.id,
|
|
|
|
+ projectId: this.$store.getters.project.id
|
|
|
|
+ }).then(res => {
|
|
|
|
+ if (res.state) {
|
|
|
|
+ this.typeList = res.data;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ insertFunc(type) {
|
|
|
|
+ let msg = type === 1 ? '场所名称' : '类型名称';
|
|
|
|
+ this.$prompt(`请输入${msg}`, 'WorkArk', {
|
|
|
|
+ confirmButtonText: '确 定',
|
|
|
|
+ cancelButtonClass: 'cancel',
|
|
|
|
+ confirmButtonClass: 'confirm',
|
|
|
|
+ cancelButtonText: '取 消',
|
|
|
|
+ inputPattern: /\S/,
|
|
|
|
+ inputErrorMessage: `请输入${msg}`
|
|
|
|
+ }).then(({
|
|
|
|
+ value
|
|
|
|
+ }) => {
|
|
|
|
+ let postData = {
|
|
|
|
+ organizationId: this.$store.getters.organization.id,
|
|
|
|
+ projectId: this.$store.getters.project.id
|
|
|
|
+ }
|
|
|
|
+ postData['name'] = value;
|
|
|
|
+ if (type === 1) {
|
|
|
|
+ insertMeetingPlace(postData).then(res => this.successFunc(res, type))
|
|
|
|
+ } else {
|
|
|
|
+ insertMeetingType(postData).then(res => this.successFunc(res, type))
|
|
|
|
+ }
|
|
|
|
+ }).catch(() => {});
|
|
|
|
+ },
|
|
|
|
+ updateFunc(type, item) {
|
|
|
|
+ let msg = type === 1 ? '场所名称' : '类型名称';
|
|
|
|
+ this.$prompt(`请输入${msg}`, 'WoraArk', {
|
|
|
|
+ confirmButtonText: '确 定',
|
|
|
|
+ cancelButtonClass: 'cancel',
|
|
|
|
+ confirmButtonClass: 'confirm',
|
|
|
|
+ cancelButtonText: '取 消',
|
|
|
|
+ inputPattern: /\S/,
|
|
|
|
+ inputErrorMessage: `请输入${msg}`,
|
|
|
|
+ inputValue: item.name
|
|
|
|
+ }).then(({
|
|
|
|
+ value
|
|
|
|
+ }) => {
|
|
|
|
+ if (type === 1) {
|
|
|
|
+ updateMeetingPlace({
|
|
|
|
+ id: item.id,
|
|
|
|
+ name: value
|
|
|
|
+ }).then(res => this.successFunc(res, type))
|
|
|
|
+ } else {
|
|
|
|
+ updateMeetingType({
|
|
|
|
+ id: item.id,
|
|
|
|
+ name: value
|
|
|
|
+ }).then(res => this.successFunc(res, type))
|
|
|
|
+ }
|
|
|
|
+ }).catch(() => {});
|
|
|
|
+ },
|
|
|
|
+ deleteFunc(type, item) {
|
|
|
|
+ let msg = type === 1 ? '场所名称' : '类型名称';
|
|
|
|
+ this.$confirm(`确定要删除该${msg}?`, () => {
|
|
|
|
+ if (type === 1) {
|
|
|
|
+ deleteMeetingPlaceById(item.id).then(res => this.successFunc(res, type))
|
|
|
|
+ } else {
|
|
|
|
+ deleteMeetingTypeById(item.id).then(res => this.successFunc(res, type))
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ successFunc(res, type) {
|
|
|
|
+ if (res.state) {
|
|
|
|
+ type === 1 ? this.initPlaceList() : this.initTypeList();
|
|
|
|
+ this.$message.success('操作成功');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss">
|
|
|
|
+ .meeting-set {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ display: flex;
|
|
|
|
+
|
|
|
|
+ .meeting-item {
|
|
|
|
+ flex: 1;
|
|
|
|
+ height: 100%;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .hui-flex-box {
|
|
|
|
+ padding: 10px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .meeting-line {
|
|
|
|
+ width: 15px;
|
|
|
|
+ height: 100%;
|
|
|
|
+ background: $--background-color-base;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .tag {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
+
|
|
|
|
+ .target-item {
|
|
|
|
+ display: flex;
|
|
|
|
+ height: 28px;
|
|
|
|
+ align-items: center;
|
|
|
|
+ margin: 5px 0;
|
|
|
|
+ margin-right: 15px;
|
|
|
|
+ background: $--color-primary;
|
|
|
|
+ color: #fff;
|
|
|
|
+ border-radius: 15px;
|
|
|
|
+ padding: 0 15px;
|
|
|
|
+
|
|
|
|
+ .label {
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .iconfont {
|
|
|
|
+ margin-left: 10px;
|
|
|
|
+ font-size: 12px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .huifont-bianji {
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .target-item-insert {
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ background: transparent;
|
|
|
|
+ border: 1px solid $--border-color-base;
|
|
|
|
+ color: $--color-text-primary;
|
|
|
|
+
|
|
|
|
+ .iconfont {
|
|
|
|
+ margin-left: 0;
|
|
|
|
+ margin-right: 10px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .target-item-insert:hover {
|
|
|
|
+ border-color: $--color-primary;
|
|
|
|
+ color: $--color-primary;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</style>
|