applicationDetails.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. <!--
  2. * @Description: 详情弹框
  3. * @Author: Sugar.
  4. * @Date: 2023-11-24 13:55:00
  5. * @LastEditors: Sugar.
  6. * @LastEditTime: 2023-11-24 13:55:00
  7. * @FilePath: \cattle_webui\src\views\team\applicationMr\applicationDetails.vue
  8. * @Copyright: Copyright (c) 2016~2023 by Sugar., All Rights Reserved.
  9. -->
  10. <template>
  11. <el-dialog
  12. :title="title"
  13. :visible.sync="open"
  14. width="700px"
  15. append-to-body
  16. :close-on-click-modal="false"
  17. @close="cancel"
  18. >
  19. <div class="dialog" v-if="form">
  20. <!-- 基础信息 -->
  21. <div class="title-class" style="margin-top: 0">基础信息</div>
  22. <el-row>
  23. <el-col :span="12">
  24. <div class="grid-content bg-purple item-class">团队名称: <span>{{ details.teamName || ''}}</span></div>
  25. </el-col>
  26. <el-col :span="12">
  27. <div class="grid-content bg-purple item-class">团队类型: <span><dict-tag style="display: inline-block" :options="dict.type.team_type" :value="details.teamType"/></span></div>
  28. </el-col>
  29. <el-col :span="12">
  30. <div class="grid-content bg-purple item-class">预约场馆: <span>{{ details.theatreName || '' }}</span></div>
  31. </el-col>
  32. <el-col :span="12">
  33. <div class="grid-content bg-purple item-class">预约演出厅: <span>{{ details.auditoriumName || '' }}</span></div>
  34. </el-col>
  35. <el-col :span="12">
  36. <div class="grid-content bg-purple item-class">预约剧目: <span>{{ details.performName || '' }}</span></div>
  37. </el-col>
  38. <el-col :span="12">
  39. <div class="grid-content bg-purple item-class">票务名称: <span>{{ details.goodsName || '' }}</span></div>
  40. </el-col>
  41. <el-col :span="12">
  42. <div class="grid-content bg-purple item-class">座位类型: <span>{{ details.seatTypeName || '' }}</span></div>
  43. </el-col>
  44. <el-col :span="12">
  45. <div class="grid-content bg-purple item-class">团购单价: <span>¥{{ details.price || '' }}</span></div>
  46. </el-col>
  47. <el-col :span="12">
  48. <div class="grid-content bg-purple item-class">预约时间: <span>{{ details.performDate || '' }}日 {{ details.performTimeStart +' --' || '' }} {{ details.performTimeEnd || '' }}</span></div>
  49. </el-col>
  50. <el-col :span="12">
  51. <div class="grid-content bg-purple item-class">报名时间: <span>{{ details.createTime || '' }}</span></div>
  52. </el-col>
  53. <el-col :span="12">
  54. <div class="grid-content bg-purple item-class">负责人: <span>{{ details.teamContact || '' }}</span></div>
  55. </el-col>
  56. <el-col :span="12">
  57. <div class="grid-content bg-purple item-class">联系电话: <span>{{ details.teamMobile || '' }}</span></div>
  58. </el-col>
  59. <el-col :span="12" v-if="details.errReason">
  60. <div class="grid-content bg-purple item-class">驳回原因: <span style="color: red;">{{ details.errReason || '' }}</span></div>
  61. </el-col>
  62. </el-row>
  63. <!-- 观影人员信息 -->
  64. <div class="title-class">观影人员信息</div>
  65. <el-row>
  66. <el-col :span="24">
  67. <el-table ref="tables" :data="details.viewersList" border>
  68. <el-table-column label="序号" align="center" type="index" width="60"></el-table-column>
  69. <el-table-column label="姓名" align="center" prop="name" />
  70. <el-table-column label="身份证号码" align="center" prop="cardId" />
  71. </el-table>
  72. </el-col>
  73. </el-row>
  74. </div>
  75. <span slot="footer" class="dialog-footer" v-if="!detailsType">
  76. <el-button type="primary" @click="cancel">确定</el-button>
  77. </span>
  78. <span slot="footer" class="dialog-footer" v-if="detailsType">
  79. <el-button type="primary" @click="passOpenEven" style="margin-right: 20px">通过</el-button>
  80. <el-button type="danger" @click="rejectOpen = true" >驳回</el-button>
  81. </span>
  82. <!-- 审核驳回 -->
  83. <el-dialog
  84. title="审核驳回"
  85. :visible.sync="rejectOpen"
  86. width="700px"
  87. append-to-body
  88. :close-on-click-modal="false"
  89. @close="rejectOpen = false"
  90. >
  91. <div class="dialog">
  92. <el-form :model="rejectForm" ref="refRejectForm" :rules="rejectRules" label-width="90px">
  93. <el-form-item label="驳回原因:" prop="errReason">
  94. <el-input
  95. type="textarea"
  96. placeholder="请输入驳回原因"
  97. v-model="rejectForm.errReason"
  98. maxlength="300"
  99. show-word-limit
  100. >
  101. </el-input>
  102. </el-form-item>
  103. </el-form>
  104. </div>
  105. <span slot="footer" class="dialog-footer">
  106. <el-button @click="rejectOpen = false">取消</el-button>
  107. <el-button
  108. type="primary"
  109. @click="submitForm"
  110. v-loading.fullscreen.lock="loading"
  111. element-loading-text="提交中..."
  112. element-loading-spinner="el-icon-loading"
  113. element-loading-background="rgba(0, 0, 0, 0.8)"
  114. >
  115. <span v-if="loading">提交中...</span>
  116. <span v-else>保存</span>
  117. </el-button>
  118. </span>
  119. </el-dialog>
  120. <!-- 审核通过 -->
  121. <el-dialog
  122. title="选择座位"
  123. :visible.sync="passOpen"
  124. width="910px"
  125. append-to-body
  126. :close-on-click-modal="false"
  127. @close="passOpen = false"
  128. >
  129. <!-- 座位排版 -->
  130. <div class="dialog">
  131. <div class="seat-box-class clearfix" v-if="seatMapList && seatMapList.length > 0">
  132. <div class="seat-item-class" :class="item.isDisabled ? 'disabled-class' : item.isSelect ? 'select-class' : ''" v-for="(item, index) in seatMapList" @click.stop="seatClick(item)" :key="index">
  133. <p class="text-class">{{item.name ? item.name : (item.rowNo + '排' + item.columnNo + '座')}}</p>
  134. </div>
  135. </div>
  136. </div>
  137. <div style="margin-top: 5px; margin-left: 30px">已勾选:{{ seatSelectList.length }}个座位</div>
  138. <span slot="footer" class="dialog-footer">
  139. <el-button @click="passOpen = false">取消</el-button>
  140. <el-button
  141. type="primary"
  142. @click="submitPass"
  143. v-loading.fullscreen.lock="passLoading"
  144. element-loading-text="提交中..."
  145. element-loading-spinner="el-icon-loading"
  146. element-loading-background="rgba(0, 0, 0, 0.8)"
  147. >
  148. <span v-if="passLoading">提交中...</span>
  149. <span v-else>保存</span>
  150. </el-button>
  151. </span>
  152. </el-dialog>
  153. </el-dialog>
  154. </template>
  155. <script>
  156. import { getSelectById, teamApplyAudit, querySeatList } from '@/api/team/applicationMr'
  157. import { updateStatus } from '@/api/team/ticketMr'
  158. export default {
  159. name: "applicationDetails",
  160. props: {
  161. dict: {
  162. type: Object,
  163. default: () => [],
  164. },
  165. },
  166. data() {
  167. return {
  168. title: "编辑",
  169. model: "EDIT",
  170. open: false,
  171. rejectOpen: false,
  172. passOpen: false,
  173. loading: false,
  174. passLoading: false,
  175. form: {
  176. id: undefined,
  177. },
  178. details: {},
  179. performerVisible: false,
  180. performerList: [],
  181. refund: false,
  182. rejectRules: {
  183. errReason: [{ required: true, message: "请输入驳回原因", trigger: ["change","blur"] }],
  184. },
  185. dataList: [],
  186. rejectForm: {
  187. status: 2
  188. },
  189. detailsType: false,
  190. seatMapList: [], // 座位集合
  191. applyId: '', // 申请单id
  192. applyMap: {},
  193. setList: [],
  194. seatSelectList: []
  195. };
  196. },
  197. methods: {
  198. /**
  199. * 打开弹框
  200. * @date 2023-11-22
  201. * @param {any} obj
  202. * @returns {any}
  203. */
  204. openDialog(title, obj, type) {
  205. this.open = true;
  206. this.rejectOpen = false;
  207. this.passOpen = false;
  208. this.applyId = obj.id;
  209. this.applyMap = obj;
  210. if(type) {
  211. this.detailsType = true
  212. this.title = '审核'
  213. } else {
  214. this.detailsType = false
  215. this.title = '详情'
  216. }
  217. this.getSelectByIdApi(obj);
  218. },
  219. /** 获取详情 */
  220. getSelectByIdApi(row) {
  221. const id = row.id
  222. getSelectById(id).then(response => {
  223. this.details = {}
  224. this.details = response.data;
  225. });
  226. },
  227. /** 获取座位信息 */
  228. getSeatApi(row) {
  229. let map = {
  230. auditoriumId: this.applyMap.auditoriumId,
  231. seatTypeId: this.applyMap.seatTypeId,
  232. timeId: this.applyMap.performId,
  233. }
  234. querySeatList(map).then(response => {
  235. this.setList = response.data;
  236. if(this.setList && this.setList.length > 0) {
  237. this.setSeatMapList(this.setList);
  238. }
  239. });
  240. },
  241. // 设置座位集合
  242. setSeatMapList(list) {
  243. if(list && list.length > 0) {
  244. list.forEach(item => {
  245. item.isDisabled = (item.occupyStatus != null && (item.occupyStatus == 0 || item.occupyStatus == 1) ? true : false); // 座位是否已被选择
  246. item.isSelect = false;
  247. this.seatMapList.push(item)
  248. })
  249. }
  250. },
  251. // 座位点击事件
  252. seatClick(row) {
  253. if(row.isDisabled){
  254. return false
  255. }
  256. if(this.seatSelectList.length >= this.details.viewersList.length ){
  257. if(row.isSelect) {
  258. let indexs = null;
  259. this.seatSelectList.forEach((item, index) =>{
  260. if(item.id == row.id){
  261. indexs = index;
  262. }
  263. })
  264. if(indexs != null) {
  265. row.isSelect = !row.isSelect;
  266. this.seatSelectList.splice(indexs, 1)
  267. }
  268. } else {
  269. this.$message.error("观影人数限制" + this.details.viewersList.length + "人!");
  270. }
  271. return false
  272. }
  273. row.isSelect = !row.isSelect
  274. this.seatSelectList = this.seatMapList.filter(item => item.isSelect);
  275. this.$forceUpdate()
  276. },
  277. // 审核通过
  278. passOpenEven() {
  279. this.passOpen = true;
  280. this.seatMapList = [];
  281. this.seatSelectList = [];
  282. this.getSeatApi();
  283. this.setSeatMapList()
  284. },
  285. /**
  286. * 保存
  287. * @date 2023-11-22
  288. * @returns {any}
  289. */
  290. submitForm() {
  291. this.$refs["refRejectForm"].validate(async (valid) => {
  292. if (valid) {
  293. try {
  294. this.loading = true;
  295. setTimeout(() => {
  296. this.loading = false;
  297. }, 3000)
  298. this.rejectForm.applyId = this.details.id || this.applyId;
  299. const { code } = await teamApplyAudit({ ...this.rejectForm });
  300. if (code === 200) {
  301. this.loading = false;
  302. this.rejectOpen = false;
  303. this.$message.success("操作成功!");
  304. this.$emit("getList");
  305. this.cancel();
  306. }
  307. } catch (error) {
  308. this.loading = false;
  309. } finally {
  310. }
  311. }
  312. });
  313. },
  314. // 审核通过 - 座位选择保存
  315. submitPass() {
  316. try {
  317. this.passLoading = true;
  318. setTimeout(() => {
  319. this.passLoading = false;
  320. }, 3000)
  321. let seatList = this.seatMapList.filter(item => item.isSelect);
  322. if(seatList && seatList.length > 0) {
  323. let postMap = {
  324. applyId: this.details.id || this.applyId,
  325. status: 1,
  326. seatList: seatList
  327. }
  328. teamApplyAudit(postMap).then((res) => {
  329. this.passLoading = false;
  330. if (res.code == 200) {
  331. this.$message.success("操作成功!");
  332. this.passOpen = false;
  333. this.$emit("getList");
  334. this.cancel();
  335. }
  336. });
  337. } else {
  338. this.$message.error("请选择座位!");
  339. }
  340. } catch (error) {
  341. this.passLoading = false;
  342. } finally {
  343. }
  344. },
  345. /**
  346. * 关闭弹框
  347. * @date 2023-11-22
  348. * @returns {any}
  349. */
  350. cancel() {
  351. this.open = false;
  352. },
  353. },
  354. };
  355. </script>
  356. <style lang="scss" scoped>
  357. .dialog {
  358. padding: 0 30px;
  359. max-height: 65vh;
  360. overflow-y: auto;
  361. }
  362. .dialog {
  363. padding: 0 30px;
  364. .upload-btn {
  365. width: 100px;
  366. height: 100px;
  367. background-color: #fbfdff;
  368. border: dashed 1px #c0ccda;
  369. border-radius: 5px;
  370. i {
  371. font-size: 30px;
  372. margin-top: 20px;
  373. }
  374. &-text {
  375. margin-top: -10px;
  376. }
  377. }
  378. .avatar {
  379. cursor: pointer;
  380. }
  381. .title-class{
  382. font-size: 16px;
  383. font-weight: bold;
  384. color: black;
  385. margin-bottom: 20px;
  386. margin-top: 20px;
  387. }
  388. .item-class{
  389. margin-bottom: 20px;
  390. }
  391. .seat-box-class{
  392. width: 800px;
  393. height: auto;
  394. padding: 5px;
  395. border-radius: 10px;
  396. border: 1px solid #323333;
  397. .disabled-class{
  398. background-color: #aaabad;
  399. }
  400. .select-class{
  401. background-color: #e85353 !important;
  402. color: #eceaea !important;
  403. }
  404. .seat-item-class{
  405. display: block;
  406. float: left;
  407. width: 60px;
  408. height: 60px;
  409. margin: 5px;
  410. border: 1px solid #4c4d4d;
  411. border-radius: 3px;
  412. cursor: pointer;
  413. position: relative;
  414. &:hover{
  415. opacity: 0.6;
  416. }
  417. .text-class{
  418. font-size: 12px;
  419. padding: 5px;
  420. line-height: 16px;
  421. margin: 0;
  422. }
  423. }
  424. }
  425. }
  426. </style>