upgradeBox.vue 31 KB

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