upgradeBox.vue 29 KB

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