rebookBox.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  1. <template>
  2. <!-- 改签对话框 -->
  3. <el-dialog
  4. title="订单改签"
  5. :visible.sync="rebookDialog"
  6. width="95%"
  7. append-to-body
  8. class="rebook1_dialog"
  9. :close-on-click-modal="false"
  10. :close-on-press-escape="false"
  11. :modal="false"
  12. :before-close="handleClose"
  13. center
  14. >
  15. <div class="rebook1_box" v-loading="loading">
  16. <div class="rebook1_from-box">
  17. <div class="rebook1_from">
  18. <el-form :model="rebookForm" ref="rebookForm" label-width="100px" :rules="rules">
  19. <el-form-item label="剧目名称:" style="margin-bottom: 0px;">
  20. <span>{{ rebookForm.performName }}</span>
  21. </el-form-item>
  22. <el-form-item label="票务名称:" style="margin-bottom: 0px;">
  23. <span>{{ rebookForm.goodsName }}</span>
  24. </el-form-item>
  25. <el-form-item label="座位类型:" style="margin-bottom: 0px;">
  26. <span>{{ rebookForm.seatTypeName }}</span>
  27. </el-form-item>
  28. <el-form-item label="订单座位数:" style="margin-bottom: 0px;">
  29. <span>{{ rebookForm.touristNum }}个</span>
  30. </el-form-item>
  31. <el-form-item label="选择日期:" prop="performDate">
  32. <el-date-picker
  33. v-model="rebookForm.performDate"
  34. type="date"
  35. style="width: 100%"
  36. value-format="yyyy-MM-dd"
  37. placeholder="选择日期" @change="handleDateChange" />
  38. </el-form-item>
  39. <el-form-item label="选择场次:" prop="performTimeId">
  40. <el-select
  41. v-model="rebookForm.performTimeId"
  42. placeholder="选择场次"
  43. style="width: 100%"
  44. @change="resubmitInfoFun()"
  45. >
  46. <el-option
  47. v-for="item in intervalList"
  48. :key="item.performTimeId"
  49. :label="item.performInterval"
  50. :value="item.performTimeId"
  51. />
  52. </el-select>
  53. </el-form-item>
  54. <el-form-item label="订单总额:">
  55. <span>{{ rebookForm.realPrice }}元</span>
  56. </el-form-item>
  57. <el-form-item v-if="rebookForm.diffPrice < 0" label="改签费用:">
  58. <span>退款{{ Math.abs(rebookForm.diffPrice) }}元</span>
  59. </el-form-item>
  60. <el-form-item v-if="rebookForm.diffPrice > 0" label="改签费用:">
  61. <span>补差价{{ Math.abs(rebookForm.diffPrice) }}元</span>
  62. </el-form-item>
  63. <el-form-item v-if="rebookForm.diffPrice > 0 && rebookForm.channelType != 'group'" label="支付方式 :" prop="paymentType">
  64. <el-radio-group v-model="rebookForm.paymentType">
  65. <el-radio label="1">扫码支付</el-radio>
  66. <el-radio label="2">现金支付</el-radio>
  67. </el-radio-group>
  68. </el-form-item>
  69. <el-form-item v-if="rebookForm.diffPrice > 0 && rebookForm.channelType == 'group'" label="支付方式 :" prop="paymentType">
  70. <el-radio-group v-model="rebookForm.paymentType">
  71. <el-radio label="3">对公支付</el-radio>
  72. <el-radio label="6">挂账</el-radio>
  73. <el-radio label="7">链接支付</el-radio>
  74. <el-radio label="4">账户余额({{ balance }})</el-radio>
  75. <el-radio label="5">授信余额({{ grantQuota }})</el-radio>
  76. </el-radio-group>
  77. </el-form-item>
  78. <el-form-item v-if="rebookForm.diffPrice > 0 && rebookForm.paymentType == 2 " label="收取现金 :" prop="realPrice_1">
  79. <!-- <el-input @input="setRealPrice_1" style="width: 200px;" v-model="rebookForm.realPrice_1"></el-input> -->
  80. <el-input v-model="rebookForm.realPrice_1" @input="setRealPrice_1" controls-position="right"
  81. :min="0"></el-input>
  82. <span>元</span>
  83. </el-form-item>
  84. <el-form-item label="找零金额 :" v-if="rebookForm.diffPrice > 0 && rebookForm.paymentType == 2">
  85. ¥{{ rebookForm.small }}元
  86. </el-form-item>
  87. <el-form-item v-if="rebookForm.paymentType == 6" label="账期" prop="rePaymentTime">
  88. <el-date-picker v-model="rebookForm.rePaymentTime" type="date" value-format="yyyy-MM-dd"
  89. placeholder="选择日期">
  90. </el-date-picker>
  91. </el-form-item>
  92. <el-form-item v-if="rebookForm.paymentType == 3 || rebookForm.paymentType == 6" :label="rebookForm.paymentType == 3 ? '凭证上传' : '挂账类型凭证'" prop="photoList">
  93. <div style="display: flex;flex-wrap: wrap;">
  94. <div v-for="(item, index) in rebookForm.photoList" :key="index"
  95. style="width: 100px; height: 100px;margin-top: 5px; position: relative;border: 1px solid #999;border-radius: 5px;margin-right: 20px;">
  96. <el-image style="width: 100%; height: 100%" :src="item"
  97. :preview-src-list="rebookForm.photoList">
  98. </el-image>
  99. <span @click="handleRemove(index)"
  100. style="position: absolute;top: -15px;right: -15px;color: red;font-size: 24px;z-index: 999;cursor: pointer;">
  101. <i class="el-icon-error"></i>
  102. </span>
  103. </div>
  104. <div style="width: 100px; height: 100px;margin-top: 5px;"
  105. v-if="!rebookForm.photoList || rebookForm.photoList.length < 15" v-loading="actionUrlLoading"
  106. element-loading-text="上传中..." element-loading-spinner="el-icon-loading"
  107. element-loading-background="rgba(0, 0, 0, 0.8)">
  108. <el-upload class="avatar-uploader" :action="uploadObj.url"
  109. :headers="uploadObj.headers" :show-file-list="false"
  110. :before-upload="beforeAvatarUpload" :on-success="handleAvatarSuccess"
  111. :on-progress="handleAvatarProgress" :disabled="actionUrlLoading"
  112. :on-error="handleAvatarError">
  113. <i class="el-icon-plus avatar-uploader-icon"></i>
  114. </el-upload>
  115. </div>
  116. </div>
  117. </el-form-item>
  118. <el-form-item label="备注:" prop="resubmitRemark">
  119. <el-input
  120. v-model="rebookForm.resubmitRemark"
  121. :placeholder="rebookForm.payWay != 'cahsh'?'请输入备注':'请输入已退款的现金金额'"
  122. clearable
  123. type="textarea"
  124. />
  125. </el-form-item>
  126. </el-form>
  127. <div class="tip-box">
  128. <p>温馨提示:仅限改签一次,且改签后禁止退款,确认要继续改签吗?</p>
  129. </div>
  130. </div>
  131. <div class="rebook1_seat" v-loading="seatLoading" :element-loading-text="seatLoadText">
  132. <seatBox
  133. ref="seatBox"
  134. :seatTypeLimit="configStockNumObj"
  135. @selectSeat="selectSeat"
  136. height="100%"
  137. :channelType="rebookForm.channelType"
  138. />
  139. </div>
  140. </div>
  141. <div style="width: 100%;display: flex;justify-content: center;">
  142. <el-button @click="rebookDialog = false">取 消</el-button>
  143. <el-button type="primary" @click="submitRebook">确认改签</el-button>
  144. </div>
  145. <!-- 支付过程 控制 -->
  146. <div v-if="payStatus" class="increase-viewers-pay-status">
  147. <div class="increase-viewers-pay-status-info" v-if="!loading">
  148. <span style="font-weight: 600;font-size: 20px;">提示</span>
  149. <span style="padding: 10px 0;">
  150. {{ payStatus==1 ? '生成订单失败!!!' :
  151. payStatus==2 ? '生成订单生成成功,请点击调取扫码盒子' :
  152. payStatus==4 ? '扫码支付失败!!!' :
  153. payStatus==5 ? '请出示付款码!!!' :
  154. payStatus==5.5 ? '扫码成功,支付中...' :
  155. payStatus==5.6 ? '扫码成功,支付中...' :
  156. payStatus==6 ? '连接扫码器失败!!!' :
  157. payStatus==7 ? '用户支付失败或未支付,请重新连接支付!!!' :
  158. payStatus==8 ? '用户支付成功,请点击打印票!!!' :
  159. payStatus==9 ? '支付超时!!!' :
  160. payStatus==10 ? '订单已关闭,请重新选择座位,再购买!!!' :
  161. payStatus==3 ? '现金支付记录入库失败,请重新提交' : '未知状态' }}
  162. </span>
  163. <!-- 重新生成订单 1 -->
  164. <div v-if="payStatus==1" style="display: flex;">
  165. <el-button @click="payStatus = null" type="success">修改信息</el-button>
  166. <el-button @click="orderInfoSubmitFun()" style="margin-left: 20px;" type="primary">重新生成订单</el-button>
  167. </div>
  168. <!-- 生成订单成功 选择支付方式 -->
  169. <div>
  170. <!-- 扫码支付 2 -->
  171. <el-button v-if="payStatus==2" @click="vbar_open(orderId)" type="success">扫码支付</el-button>
  172. <!-- 扫码支付 4 -->
  173. <el-button v-if="payStatus==4" @click="vbar_open(orderId)" type="success">重新扫码支付</el-button>
  174. <!-- 重新支付 3 -->
  175. <el-button v-if="payStatus==3" @click="gotoCashPayFun(orderId)" type="success">重新提交入库</el-button>
  176. <!-- 重新支付 6 7 -->
  177. <el-button v-if="payStatus==6 || payStatus==7" @click="vbar_open(orderId)" type="success">重新连接扫码支付</el-button>
  178. </div>
  179. <!-- 打印 8 -->
  180. <div v-if="payStatus==8">
  181. <el-select v-model="printListId" placeholder="选择打印机">
  182. <el-option
  183. :label="item.deviceName"
  184. :key="item.id"
  185. :value="item.id"
  186. v-for="(item) in printList"></el-option>
  187. </el-select>
  188. <el-button style="margin-left: 15px" @click="print" type="success">打印门票</el-button>
  189. <el-button style="margin-left: 15px" @click="goTicketingCollections" type="success">跳转取票界面</el-button>
  190. </div>
  191. <!-- 支付超时 9 -->
  192. <div v-if="payStatus==9">
  193. <!-- <el-button @click="print" type="danger">取消支付</el-button> -->
  194. <el-button @click="orderInfoSubmitFun()" type="primary">重新扫码</el-button>
  195. </div>
  196. <!-- 订单被关闭 10 -->
  197. <div v-if="payStatus==10">
  198. <!-- <el-button @click="print" type="danger">取消支付</el-button> -->
  199. <el-button @click="handleClose()" type="primary">关闭</el-button>
  200. </div>
  201. </div>
  202. </div>
  203. </div>
  204. </el-dialog>
  205. </template>
  206. <script>
  207. import { getDateTimeAll,resubmitInfoApi } from '@/api/windowTicketSales/rebook'
  208. import {
  209. querySeatListNew,
  210. selectMarketTeamBySourceApi
  211. } from '@/api/windowTicketSales/ticketingSales'
  212. import { getSelectById as getBalanceInfo } from '@/api/team/teamMr'
  213. import { countBySeatTyp } from '@/api/ticketMr/InventoryTemplate'
  214. import { pageList as getSeatType } from '@/api/seatTypeMr/seatTypeMr'
  215. import seatBox from '@/components/seatBox/index.vue';
  216. import { getToken } from "@/utils/auth";
  217. import payJs from "../mixins/pay"
  218. const mathM = require('mathjs')
  219. export default {
  220. name: "RebookBox",
  221. components: { seatBox },
  222. mixins: [payJs],
  223. data() {
  224. return {
  225. // 改签对话框
  226. rebookDialog: false,
  227. loading: false,
  228. // 改签表单
  229. rebookForm: {
  230. orderId: undefined,
  231. performDate: undefined,
  232. performTimeId: undefined,
  233. performInterval: undefined,
  234. performId: undefined,
  235. auditoriumId: undefined,
  236. photoList: [],
  237. payWay: ''
  238. },
  239. rules: {
  240. performDate: [{ required: true, message: '请选择日期', trigger: ['blur','change'] }],
  241. performTimeId: [{ required: true, message: '请选择场次', trigger: ['blur','change'] }],
  242. realPrice_1: [{ required: true, message: '请输入金额', trigger: ['blur','change'] }],
  243. resubmitRemark: [{ required: false, message: '请输入备注', trigger: ['blur','change'] }]
  244. },
  245. // 场次列表
  246. intervalList: [],
  247. intervalListLoading: false,
  248. // 支付相关
  249. payDialog: false,
  250. payStatus: null,
  251. code: '',
  252. websocketData: null,
  253. codeTime: null,
  254. // 成功对话框
  255. successDialog: false,
  256. newOrderId: '',
  257. printList: [],
  258. configStockNumObj: {},
  259. countBySeatTypList:[],
  260. seatTypeListAll: [],
  261. seatLoading: false,
  262. seatLoadText: '获取座位中...',
  263. setList: [],
  264. balance: null, // 授信额度
  265. grantQuota: null, // 授信使用额度
  266. uploadObj: {
  267. url: process.env.VUE_APP_UPLOAD_FILE_API + "/upload/single/minio",
  268. Headers: { Authorization: "Bearer " + getToken() },
  269. },
  270. actionUrlLoading: false,
  271. }
  272. },
  273. created(){
  274. this.getSeatTypeAllList()
  275. },
  276. methods: {
  277. async initData(row) {
  278. this.rebookDialog = true
  279. this.payStatus = null
  280. this.orderId = null
  281. this.rebookForm = {
  282. resubmitType: 1, // 改签类型: 1-改签 2-升舱 不传默认为改签
  283. goodsDiffAmount: undefined,
  284. performName: row.performName,
  285. goodsName: row.goodsName,
  286. seatTypeName: row.seatTypeName,
  287. seatTypeId: row.seatTypeId,
  288. goodsId: row.goodsId,
  289. orderId: row.orderId,
  290. performDate: undefined,
  291. performTimeId: undefined,
  292. performId: row.performId,
  293. auditoriumId: row.auditoriumId,
  294. paymentType: "1", // 支付方式'
  295. touristNum: row.touristNum,
  296. seatList: [],
  297. memberId: row.memberId,
  298. channelType: row.channelType,
  299. photoList: [],
  300. payWay: row.payWay,
  301. }
  302. if(row.payWay == 'cahsh') {
  303. this.$set(this.rules.resubmitRemark[0],'required',true)
  304. }else {
  305. this.$set(this.rules.resubmitRemark[0],'required',false)
  306. }
  307. await this.countBySeatTypFun(row.auditoriumId)
  308. if(row.channelType == 'group') {
  309. await this.handleCorporatePay(this.rebookForm)
  310. }
  311. this.$nextTick(()=>{
  312. this.$refs.rebookForm.clearValidate()
  313. })
  314. },
  315. handleDialogOpen() {
  316. const today = new Date()
  317. this.rebookForm.performDate = this.formatDate(today)
  318. this.handleDateChange()
  319. },
  320. /** 获取场次 */
  321. handleDateChange() {
  322. this.intervalListLoading = true
  323. this.rebookForm.performTimeId = undefined
  324. this.intervalList = []
  325. this.$set(this.rebookForm,'realPrice',0)
  326. this.$set(this.rebookForm,'realPrice',0)
  327. if (!this.rebookForm.performDate) return
  328. getDateTimeAll({
  329. performDate: this.rebookForm.performDate,
  330. orderId: this.rebookForm.orderId,
  331. performId: this.rebookForm.performId,
  332. auditoriumId: this.rebookForm.auditoriumId
  333. }).then(res => {
  334. this.intervalList = res.data.list || []
  335. if(this.intervalList.length == 0){
  336. this.$message.error('没有可售卖的场次!!!');
  337. }
  338. this.intervalListLoading = false
  339. }).catch(()=>{
  340. this.intervalListLoading = true
  341. })
  342. },
  343. selectInterval(item) {
  344. this.rebookForm.performTimeId = item.performTimeId
  345. },
  346. formatDate(date) {
  347. const year = date.getFullYear()
  348. const month = String(date.getMonth() + 1).padStart(2, '0')
  349. const day = String(date.getDate()).padStart(2, '0')
  350. return `${year}-${month}-${day}`
  351. },
  352. /** 提交表单 */
  353. submitRebook() {
  354. this.$refs.rebookForm.validate((valid) => {
  355. if (valid) {
  356. if(!this.rebookForm.seatList||this.rebookForm.seatList.length==0) {
  357. this.$message.error('请选择座位!!!');
  358. return
  359. }
  360. if( this.rebookForm.seatList.length < this.rebookForm.touristNum ) {
  361. this.$message.error(`请选择${ this.rebookForm.touristNum }座位!!!`);
  362. return
  363. }
  364. if(this.rebookForm.paymentType == 4 && (!this.balance||this.balance<=0||this.balance < this.rebookForm.realPrice)) {
  365. this.$message.error('团队账户余额不足!!!');
  366. return
  367. }
  368. if(this.rebookForm.paymentType == 5 && (!this.grantQuota||this.grantQuota<=0||this.grantQuota < this.rebookForm.realPrice)) {
  369. this.$message.error('团队授信余额不足!!!');
  370. return
  371. }
  372. if((this.rebookForm.paymentType == 3 || this.rebookForm.paymentType == 6) && this.form.photoList.length<1){
  373. this.$message.error('请上传凭证')
  374. return
  375. }
  376. this.orderInfoSubmitFun()
  377. } else {
  378. return false;
  379. }
  380. });
  381. },
  382. /** 退出窗口 */
  383. handleClose(done) {
  384. // if(this.payStatus==8) {
  385. // this.$message.error('请daying');
  386. // return
  387. // }
  388. this.$confirm('确认关闭?')
  389. .then(_ => {
  390. if(this.orderId){
  391. document.removeEventListener('keydown',this.keydownAdd);
  392. this.orderInfoCancelFun(true)
  393. }else {
  394. this.$refs.seatBox.querySeatListFun(true,[],[],[])
  395. this.rebookDialog = false
  396. }
  397. })
  398. .catch(_ => {});
  399. },
  400. /**
  401. *
  402. * 获取升舱/改签信息
  403. *
  404. */
  405. async resubmitInfoFun() {
  406. try {
  407. let res = await resubmitInfoApi({
  408. orderId: this.rebookForm.orderId,
  409. timeId: this.rebookForm.performTimeId,
  410. seatTypeId: this.rebookForm.seatTypeId,
  411. //goodsDiffAmount: this.rebookForm.goodsDiffAmount,
  412. })
  413. if(res.data.reSubmitInfo) {
  414. this.rebookForm = {
  415. ...this.rebookForm,
  416. realPrice: res.data.reSubmitInfo.realPrice,
  417. diffPrice: res.data.reSubmitInfo.diffPrice
  418. }
  419. }
  420. console.log('this.rebookForm.diffPrice <= 0',this.rebookForm.diffPrice <= 0)
  421. if(this.rebookForm.diffPrice <= 0) {
  422. this.rebookForm.paymentType = "2"
  423. }
  424. this.querySeatListFun()
  425. } catch (error) {
  426. console.error(error)
  427. }
  428. },
  429. /** 获取座位 */
  430. async querySeatListFun(type){
  431. try {
  432. let res = await querySeatListNew({
  433. auditoriumId: this.rebookForm.auditoriumId,
  434. timeId: this.rebookForm.performTimeId,
  435. goodsId: this.rebookForm.goodsId,
  436. channelType: this.rebookForm.channelType
  437. })
  438. if(res.code == 200){
  439. let list1 = []
  440. res.data.forEach((item,index)=>{
  441. list1.push({
  442. ...item,
  443. isSame: this.rebookForm.seatTypeId != item.seatTypeId
  444. })
  445. })
  446. this.setList = list1;
  447. let list = []
  448. let list3 = []
  449. this.countBySeatTypList.forEach((item,index)=>{
  450. list3.push(item.seatTypeId)
  451. })
  452. let list4 = []
  453. this.seatTypeListAll.forEach((item,index)=>{
  454. if(list3.includes(item.id)) {
  455. list4.push({...item})
  456. }
  457. })
  458. this.$nextTick(() =>{
  459. this.$refs.seatBox.querySeatListFun(true,this.setList,list,list4)
  460. })
  461. }
  462. this.loading = false
  463. } catch (error) {
  464. this.loading = false
  465. console.error("error===",error)
  466. }
  467. },
  468. /** 获取座位类型 */
  469. async countBySeatTypFun(value) {
  470. try {
  471. if(!value) return
  472. let res = await countBySeatTyp({auditoriumId: value})
  473. this.countBySeatTypList = res.data ? res.data : []
  474. let obj = {}
  475. this.countBySeatTypList.forEach((item,index)=>{
  476. obj['seatNum_'+item.seatTypeId] = {
  477. stockTotal: item.stock,
  478. stockSelect: item.stock,
  479. stockYes: item.stock,
  480. stockNo: 0,
  481. isNoSelect: true,
  482. }
  483. if(item.seatTypeId == this.rebookForm.seatTypeId){
  484. obj['seatNum_'+item.seatTypeId].stockYes = item.stock-this.rebookForm.touristNum
  485. obj['seatNum_'+item.seatTypeId].isNoSelect = false
  486. }
  487. })
  488. this.configStockNumObj = obj
  489. } catch (error) {
  490. console.error("error1====",error)
  491. }
  492. },
  493. /** 获取座位类型 说明 */
  494. async getSeatTypeAllList() {
  495. try {
  496. let res = await getSeatType({
  497. pageNum: 1,
  498. pageSize: 999,
  499. })
  500. if(res.code == 200) {
  501. this.seatTypeListAll = res.data.rows || [];
  502. }
  503. } catch (error) {
  504. }
  505. },
  506. /** 选择座位 */
  507. selectSeat(list) {
  508. let list1 = []
  509. list.forEach((item)=>{
  510. list1.push({
  511. seatId: item.id
  512. })
  513. })
  514. this.rebookForm.seatList = list1
  515. console.log("已选择的====",list)
  516. },
  517. setRealPrice_1(value) {
  518. if(this.rebookForm.diffPrice && !isNaN(this.rebookForm.diffPrice) && value && !isNaN(value)) {
  519. this.$set(this.rebookForm,'small',mathM.format(Number(value) - Number(this.rebookForm.diffPrice),10) )
  520. }
  521. },
  522. /** 获取授信余额和账户余额 */
  523. async selectMarketTeamBySourceFun(value) {
  524. console.log("value===",value)
  525. try {
  526. let res = await selectMarketTeamBySourceApi({
  527. source: value
  528. })
  529. this.balance = res.data.balance
  530. if(res.data.grantQuota && res.data.grantUsed) {
  531. this.grantQuota = res.data.grantQuota - res.data.grantUsed
  532. }else if(res.data.grantQuota) {
  533. this.grantQuota = res.data.grantQuota
  534. }else {
  535. this.grantQuota = 0
  536. }
  537. } catch (error) {
  538. this.balance = null
  539. this.grantQuota = null
  540. }
  541. },
  542. /** 上传图片 单张 */
  543. handleAvatarSuccess(response, file, fileList) {
  544. this.actionUrlLoading = false
  545. if (response.code == 200) {
  546. this.rebookForm.photoList.push(response.data.url)
  547. }
  548. this.$refs.rebookForm.validateField('photoList')
  549. },
  550. beforeAvatarUpload(file) {
  551. const isLt2M = file.size / 1024 / 1024 <= 100;
  552. let testmsg = file.name.substring(file.name.lastIndexOf('.') + 1)
  553. let typeList = ['png', 'jepg', 'jpg', 'gif']
  554. const isJPG = typeList.includes(testmsg);
  555. if (!isJPG) {
  556. this.$message.error(`上传图片图片只能是 ${typeList} 格式!`);
  557. }
  558. if (!isLt2M) {
  559. this.$message.error('上传图片图片大小不能超过 100MB!');
  560. }
  561. return isJPG && isLt2M;
  562. },
  563. handleAvatarProgress() {
  564. this.actionUrlLoading = true
  565. },
  566. handleAvatarError() {
  567. this.actionUrlLoading = false
  568. },
  569. async handleCorporatePay(row) {
  570. // 获取余额信息
  571. try {
  572. const balanceRes = await getBalanceInfo(row.memberId)
  573. if(balanceRes.code === 200) {
  574. this.balance = balanceRes.data.balance
  575. this.balance = balanceRes.data.grantQuota
  576. }
  577. } catch(err) {
  578. console.error('获取余额信息失败', err)
  579. }
  580. },
  581. }
  582. }
  583. </script>
  584. <style lang="scss" scoped>
  585. .rebook1_dialog ::v-deep .el-dialog__body {
  586. padding: 0 !important;
  587. }
  588. .rebook1_box {
  589. width: 100%;
  590. height: 100%;
  591. padding-bottom: 10px;
  592. .rebook1_from-box {
  593. display: flex;
  594. width: 100%;
  595. height: 80vh;
  596. box-sizing: border-box;
  597. padding: 0 20px 20px;
  598. }
  599. .rebook1_from {
  600. width: 100%;
  601. height: 100%;
  602. padding: 0 20px 0 0;
  603. width: 400px;
  604. box-sizing: border-box;
  605. overflow: hidden;
  606. overflow-y: auto;
  607. .tip-box {
  608. >p {
  609. color: red;
  610. }
  611. }
  612. }
  613. .rebook1_seat {
  614. width: calc( 100% - 400px );
  615. height: 100%;
  616. }
  617. }
  618. .increase-viewers-pay-status {
  619. width: 100%;
  620. height: 100%;
  621. position: absolute;
  622. z-index: 999;
  623. background-color: rgba(0,0,0,0.3);
  624. top: 0;
  625. left: 0;
  626. .increase-viewers-pay-status-info {
  627. width: 100%;
  628. height: 100%;
  629. display: flex;
  630. flex-direction: column;
  631. justify-content: center;
  632. align-items: center;
  633. color: #fff;
  634. }
  635. }
  636. </style>