upgradeBox.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  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" style="margin-bottom: 20px;">需支付¥{{ calTotalPrice(rebookForm.goodsDiffAmount,rebookForm.touristNum) }}元</span>
  147. <!-- <span v-if="payStatus==2">需支付{{ rebookForm.payAmount }}元</span> -->
  148. <!-- 重新生成订单 1 -->
  149. <div v-if="payStatus==1" style="display: flex;">
  150. <el-button @click="payStatus = null" type="success">修改信息</el-button>
  151. <el-button @click="orderInfoSubmitFun()" style="margin-left: 20px;"
  152. type="primary">重新生成订单</el-button>
  153. </div>
  154. <!-- 生成订单成功 选择支付方式 -->
  155. <div>
  156. <!-- 取消支付 -->
  157. <el-button @click="handleClose()" type="primary">取消支付</el-button>
  158. <!-- 扫码支付 2 -->
  159. <el-button v-if="payStatus==2" @click="vbar_open(orderId)" type="success">扫码支付</el-button>
  160. <!-- 扫码支付 4 -->
  161. <el-button v-if="payStatus==4" @click="vbar_open(orderId)" type="success">重新扫码支付</el-button>
  162. <!-- 重新支付 3 -->
  163. <el-button v-if="payStatus==3" @click="gotoCashPayFun(orderId)"
  164. type="success">重新提交入库</el-button>
  165. <!-- 重新支付 6 7 -->
  166. <el-button v-if="payStatus==6 || payStatus==7" @click="vbar_open(orderId)"
  167. type="success">重新连接扫码支付</el-button>
  168. </div>
  169. <!-- 打印 8 -->
  170. <div v-if="payStatus==8">
  171. <el-select v-model="printListId" placeholder="选择打印机">
  172. <el-option :label="item.deviceName" :key="item.id" :value="item.id"
  173. v-for="(item) in printList"></el-option>
  174. </el-select>
  175. <el-button style="margin-left: 15px" @click="print" type="success">打印门票</el-button>
  176. <el-button style="margin-left: 15px" @click="goTicketingCollections"
  177. type="success">跳转取票界面</el-button>
  178. </div>
  179. <!-- 支付超时 9 -->
  180. <div v-if="payStatus==9">
  181. <!-- <el-button @click="print" type="danger">取消支付</el-button> -->
  182. <el-button @click="orderInfoSubmitFun()" type="primary">重新扫码</el-button>
  183. </div>
  184. <!-- 订单被关闭 10 -->
  185. <div v-if="payStatus==10">
  186. <!-- <el-button @click="print" type="danger">取消支付</el-button> -->
  187. <el-button @click="handleClose()" type="primary">关闭</el-button>
  188. </div>
  189. </div>
  190. </div>
  191. </div>
  192. </el-dialog>
  193. </template>
  194. <script>
  195. import {
  196. querySeatListNew,
  197. selectMarketTeamBySourceApi
  198. } from '@/api/windowTicketSales/ticketingSales'
  199. import { getSelectById as getBalanceInfo } from '@/api/team/teamMr'
  200. import { rebookApi,getTimeSeatTypeAllApi,resubmitInfoApi } from '@/api/windowTicketSales/rebook'
  201. import { countBySeatTyp } from '@/api/ticketMr/InventoryTemplate'
  202. import { pageList as getSeatType } from '@/api/seatTypeMr/seatTypeMr'
  203. import { getSelectById } from '@/api/order/orderMr'
  204. import seatBox from '@/components/seatBox/index.vue';
  205. import { getToken } from "@/utils/auth";
  206. import payJs from "../mixins/pay"
  207. const mathM = require('mathjs')
  208. export default {
  209. name: "RebookBox",
  210. components: { seatBox },
  211. mixins: [payJs],
  212. data() {
  213. return {
  214. // 改签对话框
  215. rebookDialog: false,
  216. loading: false,
  217. // 改签表单
  218. rebookForm: {
  219. orderId: undefined,
  220. performDate: undefined,
  221. performTimeId: undefined,
  222. performInterval: undefined,
  223. performId: undefined,
  224. auditoriumId: undefined,
  225. photoList: []
  226. },
  227. rules: {
  228. seatTypeId: [{ required: true, message: '请选择票档', trigger: ['blur','change'] }],
  229. realPrice_1: [{ required: true, message: '请输入金额', trigger: ['blur','change'] }],
  230. paymentType: [{ required: true, message: '请输入支付方式', trigger: ['blur','change'] }],
  231. rePaymentTime: [{ required: true, message: '选择日期', trigger: ['blur','change'] }],
  232. photoList: [{ required: true, message: '请上传凭证', trigger: ['blur','change'] }],
  233. goodsDiffAmount: [{ required: true, message: '请输入金额', trigger: ['blur','change'] }],
  234. resubmitRemark: [{ required: false, message: '请输入备注', trigger: ['blur','change'] }]
  235. },
  236. // 场次列表
  237. intervalList: [],
  238. intervalListLoading: false,
  239. // 支付相关
  240. payDialog: false,
  241. payStatus: null,
  242. code: '',
  243. websocketData: null,
  244. codeTime: null,
  245. // 成功对话框
  246. successDialog: false,
  247. newOrderId: '',
  248. printList: [],
  249. configStockNumObj: {},
  250. countBySeatTypList:[],
  251. seatTypeListAll: [],
  252. seatLoading: false,
  253. seatLoadText: '获取座位中...',
  254. setList: [],
  255. balance: null, // 授信额度
  256. grantQuota: null, // 授信使用额度
  257. uploadObj: {
  258. url: process.env.VUE_APP_UPLOAD_FILE_API + "/upload/single/minio",
  259. Headers: { Authorization: "Bearer " + getToken() },
  260. },
  261. actionUrlLoading: false,
  262. }
  263. },
  264. created(){
  265. this.getSeatTypeAllList()
  266. },
  267. methods: {
  268. async initData(row) {
  269. this.rebookDialog = true
  270. this.payStatus = null
  271. this.orderId = null
  272. this.rebookForm = {
  273. resubmitType: 2, // 改签类型: 1-改签 2-升舱 不传默认为改签
  274. goodsDiffAmount: undefined,
  275. performName: row.performName,
  276. goodsName: row.goodsName,
  277. seatTypeName: row.seatTypeName,
  278. seatTypeId: null,
  279. goodsId: row.goodsId,
  280. orderId: row.orderId,
  281. performDate: row.performDate,
  282. performTimeId: null,
  283. performId: row.performId,
  284. auditoriumId: row.auditoriumId,
  285. paymentType: "1", // 支付方式'
  286. realPrice: row.realPrice,
  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. calTotalPrice(unitPrice, quantity) {
  370. console.log(this.rebookForm,'2222');
  371. let totalPrice = 0
  372. if(unitPrice && quantity ) {
  373. totalPrice = mathM.multiply(unitPrice, quantity);
  374. }
  375. return totalPrice
  376. },
  377. /** 退出窗口 */
  378. handleClose(done) {
  379. // if(this.payStatus==8) {
  380. // this.$message.error('请daying');
  381. // return
  382. // }
  383. this.$confirm('确认关闭?')
  384. .then(_ => {
  385. if(this.orderId){
  386. document.removeEventListener('keydown',this.keydownAdd);
  387. this.orderInfoCancelFun(true)
  388. }else {
  389. this.$refs.seatBox.querySeatListFun(true,[],[],[])
  390. this.rebookDialog = false
  391. }
  392. })
  393. .catch(_ => {});
  394. },
  395. /**
  396. *
  397. * 获取升舱/改签信息
  398. *
  399. */
  400. async resubmitInfoFun() {
  401. try {
  402. let res = await resubmitInfoApi({
  403. orderId: this.rebookForm.orderId,
  404. timeId: this.rebookForm.performTimeId,
  405. seatTypeId: this.rebookForm.seatTypeId,
  406. //goodsDiffAmount: this.rebookForm.goodsDiffAmount,
  407. })
  408. this.rebookForm = {
  409. ...this.rebookForm,
  410. realPrice: res.data.reSubmitInfo.realPrice,
  411. diffPrice: res.data.reSubmitInfo.diffPrice
  412. }
  413. if(this.rebookForm.diffPrice <= 0) {
  414. this.rebookForm.paymentType = "2"
  415. }
  416. } catch (error) {
  417. }
  418. },
  419. /** 获取座位 */
  420. async querySeatListFun(type){
  421. try {
  422. await this.countBySeatTypFun(this.rebookForm.auditoriumId)
  423. await this.resubmitInfoFun()
  424. let res = await querySeatListNew({
  425. auditoriumId: this.rebookForm.auditoriumId,
  426. timeId: this.rebookForm.performTimeId,
  427. goodsId: this.rebookForm.goodsId,
  428. channelType: this.rebookForm.channelType
  429. })
  430. if(res.code == 200){
  431. let list1 = []
  432. res.data.forEach((item,index)=>{
  433. list1.push({
  434. ...item,
  435. isSame: this.rebookForm.seatTypeId != item.seatTypeId
  436. })
  437. })
  438. this.setList = list1;
  439. let list = []
  440. let list3 = []
  441. this.countBySeatTypList.forEach((item,index)=>{
  442. list3.push(item.seatTypeId)
  443. })
  444. let list4 = []
  445. this.seatTypeListAll.forEach((item,index)=>{
  446. if(list3.includes(item.id)) {
  447. list4.push({...item})
  448. }
  449. })
  450. this.$nextTick(() =>{
  451. this.$refs.seatBox.querySeatListFun(true,this.setList,list,list4)
  452. })
  453. }
  454. this.loading = false
  455. } catch (error) {
  456. this.loading = false
  457. console.error("error===",error)
  458. }
  459. },
  460. /** 获取座位类型 */
  461. async countBySeatTypFun(value) {
  462. try {
  463. if(!value) return
  464. let res = await countBySeatTyp({auditoriumId: value})
  465. this.countBySeatTypList = res.data ? res.data : []
  466. let obj = {}
  467. this.countBySeatTypList.forEach((item,index)=>{
  468. obj['seatNum_'+item.seatTypeId] = {
  469. stockTotal: item.stock,
  470. stockSelect: item.stock,
  471. stockYes: item.stock,
  472. stockNo: 0,
  473. isNoSelect: true,
  474. }
  475. if(item.seatTypeId == this.rebookForm.seatTypeId){
  476. obj['seatNum_'+item.seatTypeId].stockYes = item.stock-this.rebookForm.touristNum
  477. obj['seatNum_'+item.seatTypeId].isNoSelect = false
  478. }
  479. })
  480. this.configStockNumObj = obj
  481. } catch (error) {
  482. console.error("error1====",error)
  483. }
  484. },
  485. /** 获取座位类型 说明 */
  486. async getSeatTypeAllList() {
  487. try {
  488. let res = await getSeatType({
  489. pageNum: 1,
  490. pageSize: 999,
  491. })
  492. if(res.code == 200) {
  493. this.seatTypeListAll = res.data.rows || [];
  494. }
  495. } catch (error) {
  496. }
  497. },
  498. /** 选择座位 */
  499. selectSeat(list) {
  500. let list1 = []
  501. list.forEach((item)=>{
  502. list1.push({
  503. seatId: item.id
  504. })
  505. })
  506. this.rebookForm.seatList = list1
  507. console.log("已选择的====",list)
  508. },
  509. setRealPrice_1(value) {
  510. if(this.rebookForm.goodsDiffAmount && !isNaN(this.rebookForm.goodsDiffAmount) && value && !isNaN(value)) {
  511. this.$set(this.rebookForm,'small',mathM.format(Number(value) - Number(this.rebookForm.goodsDiffAmount),10) )
  512. }
  513. },
  514. setRealPrice_2(value) {
  515. if(this.rebookForm.realPrice_1 && !isNaN(this.rebookForm.realPrice_1) && value && !isNaN(value)) {
  516. this.$set(this.rebookForm,'small',mathM.format(Number(this.rebookForm.realPrice_1) - Number(value),10) )
  517. }
  518. },
  519. /** 上传图片 单张 */
  520. handleAvatarSuccess(response, file, fileList) {
  521. this.actionUrlLoading = false
  522. if (response.code == 200) {
  523. this.rebookForm.photoList.push(response.data.url)
  524. }
  525. this.$refs.rebookForm.validateField('photoList')
  526. },
  527. beforeAvatarUpload(file) {
  528. const isLt2M = file.size / 1024 / 1024 <= 100;
  529. let testmsg = file.name.substring(file.name.lastIndexOf('.') + 1)
  530. let typeList = ['png', 'jepg', 'jpg', 'gif']
  531. const isJPG = typeList.includes(testmsg);
  532. if (!isJPG) {
  533. this.$message.error(`上传图片图片只能是 ${typeList} 格式!`);
  534. }
  535. if (!isLt2M) {
  536. this.$message.error('上传图片图片大小不能超过 100MB!');
  537. }
  538. return isJPG && isLt2M;
  539. },
  540. handleAvatarProgress() {
  541. this.actionUrlLoading = true
  542. },
  543. handleAvatarError() {
  544. this.actionUrlLoading = false
  545. },
  546. handleRemove(index) {
  547. this.rebookForm.photoList.splice(index,1)
  548. this.$refs.rebookForm.validateField('photoList')
  549. },
  550. async handleCorporatePay(row) {
  551. // 获取余额信息
  552. try {
  553. const balanceRes = await getBalanceInfo(row.memberId)
  554. if(balanceRes.code === 200) {
  555. this.balance = balanceRes.data.balance
  556. this.grantQuota = balanceRes.data.grantSurplus
  557. }
  558. } catch(err) {
  559. console.error('获取余额信息失败', err)
  560. }
  561. },
  562. }
  563. }
  564. </script>
  565. <style lang="scss" scoped>
  566. .rebook1_dialog ::v-deep .el-dialog__body {
  567. padding: 0 !important;
  568. }
  569. .rebook1_box {
  570. width: 100%;
  571. height: 100%;
  572. padding-bottom: 10px;
  573. .rebook1_from-box {
  574. display: flex;
  575. width: 100%;
  576. height: 80vh;
  577. box-sizing: border-box;
  578. padding: 0 20px 20px;
  579. }
  580. .rebook1_from {
  581. width: 100%;
  582. height: 100%;
  583. overflow: hidden;
  584. overflow-y: auto;
  585. padding: 0 20px 0 0;
  586. width: 400px;
  587. box-sizing: border-box;
  588. .tip-box {
  589. >p {
  590. color: red;
  591. }
  592. }
  593. }
  594. .rebook1_seat {
  595. width: calc( 100% - 400px );
  596. height: 100%;
  597. }
  598. }
  599. .increase-viewers-pay-status {
  600. width: 100%;
  601. height: 100%;
  602. position: absolute;
  603. z-index: 999;
  604. background-color: rgba(0,0,0,0.3);
  605. top: 0;
  606. left: 0;
  607. .increase-viewers-pay-status-info {
  608. width: 100%;
  609. height: 100%;
  610. display: flex;
  611. flex-direction: column;
  612. justify-content: center;
  613. align-items: center;
  614. color: #fff;
  615. }
  616. }
  617. ::v-deep .avatar-uploader .el-upload {
  618. border: 1px dashed #d9d9d9;
  619. border-radius: 6px;
  620. cursor: pointer;
  621. position: relative;
  622. overflow: hidden;
  623. }
  624. ::v-deep .avatar-uploader .el-upload:hover {
  625. border-color: #409EFF;
  626. }
  627. ::v-deep .avatar-uploader-icon {
  628. font-size: 28px;
  629. color: #8c939d;
  630. width: 100px;
  631. height: 100px;
  632. line-height: 100px;
  633. text-align: center;
  634. }
  635. ::v-deep .avatar {
  636. width: 100px;
  637. height: 100px;
  638. display: block;
  639. }
  640. </style>