|
@@ -0,0 +1,139 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="hui-flex hui-dialog">
|
|
|
|
+ <div class="hui-flex-box hui-dialog-content">
|
|
|
|
+ <el-form ref="form" label-position="top" :model="form">
|
|
|
|
+ <el-form-item label="会议名称" prop="name" :rules="[{required: true, message: '请输入会议名称'}]">
|
|
|
|
+ <el-input type="text" v-model="form.name" placeholder="请输入会议名称"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+
|
|
|
|
+ <el-form-item label="会议日期" prop="date" :rules="[{required: true, message: '请选择会议日期'}]">
|
|
|
|
+ <el-date-picker v-model="form.date" value-format="yyyy-MM-dd" type="date" placeholder="请选择会议日期">
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="会议时长" prop="duration" :rules="[{required: true, message: '请输入会议时长'}]">
|
|
|
|
+ <el-input type="text" v-model="form.duration" placeholder="请输入会议时长"></el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="会议类型" prop="typeId" :rules="[{required: true, message: '请选择企业'}]">
|
|
|
|
+ <el-select v-model="form.typeId" placeholder="请选择企业">
|
|
|
|
+ <el-option :label="item.name" :value="item.id" v-for="(item,index) in meetingType" :key="index">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="会议场所" prop="placeId" :rules="[{required: true, message: '请选择会议场所'}]">
|
|
|
|
+ <el-select v-model="form.placeId" placeholder="请选择会议场所">
|
|
|
|
+ <el-option :label="item.name" :value="item.id" v-for="(item,index) in meetingPlace"
|
|
|
|
+ :key="index">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="参与人员" class="hui-textarea">
|
|
|
|
+ <cc ref="cc" type="insert" :ccList="ccList" label="会议人员"></cc>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="会议内容" class="hui-textarea">
|
|
|
|
+ <meeting-content ref="content" :list="contentList"></meeting-content>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="上传附件" class="hui-textarea">
|
|
|
|
+ <upload ref="upload" :list="responsibility" type="insert" text="上传附件" accept="*"></upload>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="hui-dialog-submit">
|
|
|
|
+ <el-button size="medium" @click="$emit('callback')">取 消</el-button>
|
|
|
|
+ <el-button size="medium" type="primary" @click="submit">保 存</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script>
|
|
|
|
+ import {
|
|
|
|
+ getMeetingPlaceListByQuery,
|
|
|
|
+ getMeetingTypeListByQuery,
|
|
|
|
+ insertMeeting,
|
|
|
|
+ updateMeeting,
|
|
|
|
+ getMeetingDetailById
|
|
|
|
+ } from '@/httpApi/operation'
|
|
|
|
+ import upload from '@/components/common/upload'
|
|
|
|
+ import cc from '@/components/common/cc'
|
|
|
|
+ import meetingContent from '@/components/work/operation/meeting/content'
|
|
|
|
+ export default {
|
|
|
|
+ props: ['isUpdate', 'detailId', 'type'],
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ form: {
|
|
|
|
+ name: '',
|
|
|
|
+ duration: '',
|
|
|
|
+ placeId: '',
|
|
|
|
+ typeId: '',
|
|
|
|
+ },
|
|
|
|
+ responsibility: [],
|
|
|
|
+ meetingPlace: [],
|
|
|
|
+ meetingType: [],
|
|
|
|
+ ccList: [],
|
|
|
|
+ contentList: []
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ created() {
|
|
|
|
+ this.initParams();
|
|
|
|
+ if (!this.isUpdate) {
|
|
|
|
+ this.form['organizationId'] = this.$store.getters.organization.id;
|
|
|
|
+ this.form['projectId'] = this.$store.getters.project.id;
|
|
|
|
+ this.form['type'] = this.type;
|
|
|
|
+ } else {
|
|
|
|
+ getMeetingDetailById(this.detailId).then(res => {
|
|
|
|
+ if (res.state) {
|
|
|
|
+ this.form = res.data;
|
|
|
|
+ if (this.form.attachment) this.responsibility = JSON.parse(this.form.attachment);
|
|
|
|
+ if (this.form.content) this.contentList = JSON.parse(this.form.content);
|
|
|
|
+ this.ccList = this.form.joinUserList;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ initParams() {
|
|
|
|
+ let data = {
|
|
|
|
+ organizationId: this.$store.getters.organization.id,
|
|
|
|
+ projectId: this.$store.getters.project.id,
|
|
|
|
+ };
|
|
|
|
+ const successFunc = (res, type) => {
|
|
|
|
+ if (res.state) {
|
|
|
|
+ this[type] = res.data;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ getMeetingPlaceListByQuery(data).then(res => successFunc(res, 'meetingPlace'));
|
|
|
|
+ getMeetingTypeListByQuery(data).then(res => successFunc(res, 'meetingType'));
|
|
|
|
+ },
|
|
|
|
+ submit() {
|
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ let postData = JSON.parse(JSON.stringify(this.form));
|
|
|
|
+ postData['attachment'] = JSON.stringify(this.$refs.upload.fileList);
|
|
|
|
+ postData['content'] = JSON.stringify(this.$refs.content.listData);
|
|
|
|
+ if (this.$refs.cc.list.length > 0) postData['joinUserIds'] = this.$refs.cc.list.map(node =>
|
|
|
|
+ node.id).join(',');
|
|
|
|
+ if (this.isUpdate) {
|
|
|
|
+ updateMeeting(postData).then(this.successFunc);
|
|
|
|
+ } else {
|
|
|
|
+ insertMeeting(postData).then(this.successFunc);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ successFunc(res) {
|
|
|
|
+ if (res.state) {
|
|
|
|
+ this.$message.success('操作成功');
|
|
|
|
+ this.$emit('callback', 'init');
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ components: {
|
|
|
|
+ upload,
|
|
|
|
+ cc,
|
|
|
|
+ meetingContent
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss"></style>
|