applicationDetails.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467
  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="setRejectOpen" >驳回</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.performTimeId,
  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. let listCopy = {}
  245. list.forEach(item => {
  246. item.isDisabled = (item.occupyStatus != null && (item.occupyStatus == 0 || item.occupyStatus == 1) ? true : false); // 座位是否已被选择
  247. item.isSelect = false;
  248. if(!listCopy['key_'+item.rowNo]) {
  249. listCopy['key_'+item.rowNo] = [item]
  250. }else {
  251. listCopy['key_'+item.rowNo].push(item)
  252. }
  253. //this.seatMapList.push(item)
  254. })
  255. let listCopy2 = Object.keys(listCopy)
  256. let listCopy3 = []
  257. listCopy2.forEach((item)=>{
  258. listCopy3.push({
  259. key: item,
  260. sort: Number(item.replace('key_',''))
  261. })
  262. })
  263. listCopy3.sort((a,b)=>{
  264. return a.sort - b.sort
  265. })
  266. let listCopy1 = []
  267. listCopy3.forEach((item,index)=>{
  268. listCopy1 = listCopy1.concat(listCopy[item.key])
  269. })
  270. this.seatMapList = [].concat(listCopy1)
  271. }
  272. },
  273. // 座位点击事件
  274. seatClick(row) {
  275. if(row.isDisabled){
  276. return false
  277. }
  278. if(this.seatSelectList.length >= this.details.viewersList.length ){
  279. if(row.isSelect) {
  280. let indexs = null;
  281. this.seatSelectList.forEach((item, index) =>{
  282. if(item.id == row.id){
  283. indexs = index;
  284. }
  285. })
  286. if(indexs != null) {
  287. row.isSelect = !row.isSelect;
  288. this.seatSelectList.splice(indexs, 1)
  289. }
  290. } else {
  291. this.$message.error("观影人数限制" + this.details.viewersList.length + "人!");
  292. }
  293. return false
  294. }
  295. row.isSelect = !row.isSelect
  296. this.seatSelectList = this.seatMapList.filter(item => item.isSelect);
  297. this.$forceUpdate()
  298. },
  299. // 审核通过
  300. passOpenEven() {
  301. this.passOpen = true;
  302. this.seatMapList = [];
  303. this.seatSelectList = [];
  304. this.getSeatApi();
  305. //this.setSeatMapList()
  306. },
  307. /**
  308. * 保存
  309. * @date 2023-11-22
  310. * @returns {any}
  311. */
  312. submitForm() {
  313. this.$refs["refRejectForm"].validate(async (valid) => {
  314. if (valid) {
  315. try {
  316. this.loading = true;
  317. setTimeout(() => {
  318. this.loading = false;
  319. }, 3000)
  320. this.rejectForm.applyId = this.details.id || this.applyId;
  321. const { code } = await teamApplyAudit({ ...this.rejectForm });
  322. if (code === 200) {
  323. this.loading = false;
  324. this.rejectOpen = false;
  325. this.$message.success("操作成功!");
  326. this.$emit("getList");
  327. this.cancel();
  328. }
  329. } catch (error) {
  330. this.loading = false;
  331. } finally {
  332. }
  333. }
  334. });
  335. },
  336. // 审核通过 - 座位选择保存
  337. submitPass() {
  338. try {
  339. this.passLoading = true;
  340. setTimeout(() => {
  341. this.passLoading = false;
  342. }, 3000)
  343. let seatList = this.seatMapList.filter(item => item.isSelect);
  344. if(seatList && seatList.length > 0) {
  345. let postMap = {
  346. applyId: this.details.id || this.applyId,
  347. status: 1,
  348. seatList: seatList
  349. }
  350. teamApplyAudit(postMap).then((res) => {
  351. this.passLoading = false;
  352. if (res.code == 200) {
  353. this.$message.success("操作成功!");
  354. this.passOpen = false;
  355. this.$emit("getList");
  356. this.cancel();
  357. }
  358. });
  359. } else {
  360. this.$message.error("请选择座位!");
  361. }
  362. } catch (error) {
  363. this.passLoading = false;
  364. } finally {
  365. }
  366. },
  367. /**
  368. * 关闭弹框
  369. * @date 2023-11-22
  370. * @returns {any}
  371. */
  372. cancel() {
  373. this.open = false;
  374. },
  375. setRejectOpen() {
  376. this.rejectOpen = true
  377. this.$set(this.rejectForm,'errReason','')
  378. this.$nextTick(()=>{
  379. this.$refs.refRejectForm.clearValidate('errReason')
  380. })
  381. }
  382. },
  383. };
  384. </script>
  385. <style lang="scss" scoped>
  386. .dialog {
  387. padding: 0 30px;
  388. max-height: 65vh;
  389. overflow-y: auto;
  390. }
  391. .dialog {
  392. padding: 0 30px;
  393. .upload-btn {
  394. width: 100px;
  395. height: 100px;
  396. background-color: #fbfdff;
  397. border: dashed 1px #c0ccda;
  398. border-radius: 5px;
  399. i {
  400. font-size: 30px;
  401. margin-top: 20px;
  402. }
  403. &-text {
  404. margin-top: -10px;
  405. }
  406. }
  407. .avatar {
  408. cursor: pointer;
  409. }
  410. .title-class{
  411. font-size: 16px;
  412. font-weight: bold;
  413. color: black;
  414. margin-bottom: 20px;
  415. margin-top: 20px;
  416. }
  417. .item-class{
  418. margin-bottom: 20px;
  419. }
  420. .seat-box-class{
  421. width: 800px;
  422. height: auto;
  423. padding: 5px;
  424. border-radius: 10px;
  425. border: 1px solid #323333;
  426. .disabled-class{
  427. background-color: #aaabad;
  428. }
  429. .select-class{
  430. background-color: #e85353 !important;
  431. color: #eceaea !important;
  432. }
  433. .seat-item-class{
  434. display: block;
  435. float: left;
  436. width: 60px;
  437. height: 60px;
  438. margin: 5px;
  439. border: 1px solid #4c4d4d;
  440. border-radius: 3px;
  441. cursor: pointer;
  442. position: relative;
  443. &:hover{
  444. opacity: 0.6;
  445. }
  446. .text-class{
  447. font-size: 12px;
  448. padding: 5px;
  449. line-height: 16px;
  450. margin: 0;
  451. }
  452. }
  453. }
  454. }
  455. </style>