jiangping
2024-08-26 e23a1db0b60437f17d09d65c65f8fd0c8a5d88c7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
<template>
  <GlobalAlertWindow
    :title="title"
    :visible.sync="visible"
    :confirm-working="isWorking"
    @confirm="confirm"
    width="600px"
  >
    <div class="title-style">
      <div class="header-title">{{ form.name }}</div>
      <div class="item-value">{{ `${form.roomName} ${form.meetingTime}` }}</div>
    </div>
    <div class="content-style">
      <div class="item">
        <div class="item-title">参会人员</div>
        <div>
          {{ form.sysList.map((item) => `${item.realName}`).join(",") }}
        </div>
      </div>
      <div class="item">
        <div class="item-title">会议内容</div>
        <div class="item-value">{{ form.content || "无" }}</div>
      </div>
      <div v-if="form.projectList.length" class="item">
        <div class="">服务项</div>
        <div class="item-value">
          {{ form.projectList.map((item) => item.projectName).join(" | ") }}
        </div>
      </div>
      <div class="item" v-if="form.fileList.length">
        <div class="item-title">附件</div>
        <div>
          <FileLink
            :links="form.fileList"
            linkName="fileFullUrl"
            :isUpload="false"
          />
        </div>
      </div>
      <div class="item" v-if="!!form.remark">
        <div class="item-title">备注</div>
        <div class="item-value">{{ form.remark }}</div>
      </div>
    </div>
    <div class="bottom-style">
      <div class="item-title">预约人</div>
      <div class="item-value">{{ form.managerInfo }}</div>
    </div>
    <div slot="footer">
      <el-button type="primary" v-if="form.meetingStatus == 1" @click="openCancel('0')">撤销</el-button>
      <el-button v-if="form.meetingStatus == 2" type="primary" @click="openCancel('1')">结束</el-button>
      <el-button @click="visible = false">取消</el-button>
    </div>
    <!-- 取消/结束 -->
    <el-dialog
      :title="cancelParam.falg == '1' ? '结束会议' : '撤销会议'"
      :visible.sync="isShowCancel"
      append-to-body
      width="500px"
    >
      <el-form style="padding: 30px">
        <el-form-item label="撤回说明">
          <el-input
            type="textarea"
            :rows="4"
            placeholder="请输入说明。"
            v-model="cancelParam.businessRemark"
          >
          </el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="isShowCancel = false">取消</el-button>
        <el-button type="primary" @click="onSubCancel()">确定</el-button>
      </span>
    </el-dialog>
  </GlobalAlertWindow>
</template>
 
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalAlertWindow from '@/components/common/GlobalAlertWindow'
import FileLink from '@/views/meeting/components/common/FileLink'
import { cancelById, overBookById } from '@/api/meeting/bookings'
export default {
  name: 'OperaBookingsDetailWindow',
  extends: BaseOpera,
  components: { GlobalAlertWindow, FileLink },
  data () {
    return {
      // 表单数据
      form: {
        id: null,
        name: '',
        roomName: '',
        meetingTime: '',
        date: '',
        editDate: '',
        projectList: [],
        remark: '',
        roomId: '',
        meetingStatus: '',
        startTime: '',
        endTime: '',
        times: [],
        content: '',
        sysList: [],
        fileList: [],
        managerInfo: ''
      },
      // room: [],
      sysList: [],
      projectList: [],
      timelist: [],
 
      isShowCancel: false,
      cancelParam: {
        flag: '0'
      },
      // 验证规则
      rules: {
 
      }
    }
  },
  created () {
    this.config({
      api: '/meeting/bookings',
      'field.id': 'id'
    })
  },
  methods: {
    openCancel (flag) {
      this.isShowCancel = true
      this.cancelParam.flag = flag
    },
    onSubCancel () {
      const { id } = this.form
      const fn = this.cancelParam.flag === '0' ? cancelById : overBookById
      fn({ id, businessRemark: this.cancelParam.businessRemark }).then(res => {
        this.$tip.success('提交成功')
        this.visible = false
        this.isShowCancel = false
        this.$emit('success')
      })
    }
    /**
     * 打开窗口
     * @title 窗口标题
     * @target 编辑的对象
     */
    //  open (title, target) {
    //   this.title = title
    //   this.visible = true
    //   this.timelist = []
    //   // 新建
    //   if (target == null) {
    //     this.$nextTick(() => {
    //       this.$refs.form.resetFields()
    //       this.form[this.configData['field.id']] = null
    //     })
    //     return
    //   }
    //   // 编辑
    //   this.$nextTick(() => {
    //     for (const key in this.form) {
    //       this.form[key] = target[key]
    //     }
    //     // this.form.projectList = target.projectList ? target.projectList.map(item => item.projectId) : []
    //     // this.form.sysList = this.form.sysList ? this.form.sysList.map(item => item.userId) : []
    //     // this.form.date = target.startTime.split(' ')[0]
 
    //   })
    // },
 
  }
}
</script>
 
<style lang="scss" scoped>
::v-deep .el-dialog__body {
  padding: 0;
}
.title-style {
  padding: 20px;
  border-bottom: 10px #f7f7f7 solid;
}
.content-style {
  padding: 20px;
  border-bottom: 10px #f7f7f7 solid;
}
.item {
  padding: 5px 0;
}
.header-title {
  font-size: 16px;
  font-weight: 600;
  padding-bottom: 5px;
}
.item-title {
  font-size: 16px;
  color: #999;
  padding-bottom: 5px;
}
.item-value {
  font-size: 14px;
  color: #111;
}
.bottom-style {
  padding: 20px;
}
</style>