FormInfo.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750
  1. <template>
  2. <div>
  3. <el-card>
  4. <template slot="header">
  5. <div
  6. class="card-title"
  7. style="display:flex;"
  8. v-if="currentTicket">
  9. <div style="display:flex;">
  10. <div class="top-title">当前票种:<b>{{ currentTicket.name || '无' }}</b></div>
  11. <span v-if="currentTicket.isSale === 0" style="color: red">(停售)</span>
  12. <div v-if="category === 'batch'" style="margin-left: 20px;">当前场次:<b>{{ currentBatchName || '无' }}</b></div>
  13. </div>
  14. <div>{{ form.playDateBegin | formatDate }} 票价:<span class="price"><b>{{ currentPrice }}</b> 元</span></div>
  15. </div>
  16. <span
  17. v-else
  18. style="color:red">请选择门票</span>
  19. </template>
  20. <el-form
  21. v-loading="loading"
  22. class="sale-form-wrap"
  23. ref="form"
  24. :model="form"
  25. :inline="true"
  26. label-width="100px">
  27. <el-form-item
  28. v-if="isTeam"
  29. verify
  30. required
  31. label="团体">
  32. <el-select
  33. filterable
  34. v-model="form.teamId">
  35. <el-option
  36. v-for="item in teamList"
  37. :key="item.id"
  38. :label="`${item.name}-余额¥${item.balance}-信用额度¥${item.creditLimit}`"
  39. :value="item.id">
  40. </el-option>
  41. </el-select>
  42. </el-form-item>
  43. <el-form-item
  44. v-if="isTeam"
  45. label="导游">
  46. <el-select
  47. filterable
  48. v-model="form.guideId">
  49. <el-option
  50. v-for="item in guideList"
  51. :key="item.id"
  52. :label="item.name"
  53. :value="item.id">
  54. </el-option>
  55. </el-select>
  56. </el-form-item>
  57. <el-form-item
  58. verify
  59. can-be-empty
  60. label="顾客姓名"
  61. prop="buyerName">
  62. <el-input
  63. v-model="form.buyerName"></el-input>
  64. </el-form-item>
  65. <el-form-item
  66. can-be-empty
  67. :verify="verifyPhone"
  68. label="顾客电话"
  69. prop="buyerPhone">
  70. <el-input
  71. v-model="form.buyerPhone"></el-input>
  72. </el-form-item>
  73. <el-form-item
  74. label="证件类型"
  75. prop="buyerIdentifyType">
  76. <el-select
  77. :disabled="identifyLockCheckStyle"
  78. v-model="form.buyerIdentifyType"
  79. placeholder="请选择">
  80. <el-option
  81. v-for="(item, idx) in papersType"
  82. :key="`id-${idx}`"
  83. :label="item.label"
  84. :value="item.value">
  85. </el-option>
  86. </el-select>
  87. <el-checkbox
  88. style="margin-left:10px"
  89. v-model="identifyLockCheckStyle">
  90. 锁定
  91. </el-checkbox>
  92. </el-form-item>
  93. <!-- <el-form-item
  94. key="id1"
  95. :verify="form.buyerIdentifyType === 0 ? verifyId : ''"
  96. can-be-empty
  97. v-if="form.buyerIdentifyType === 0"
  98. label="证件号码"
  99. prop="buyerIdentify">
  100. <ReaderInput
  101. type="ID"
  102. @change="form.buyerName = $event.Name,Certificate=$event"
  103. @input="form.buyerIdentify = $event"
  104. v-model="form.buyerIdentify"></ReaderInput>
  105. </el-form-item> -->
  106. <el-form-item
  107. key="id2"
  108. label="证件号码"
  109. prop="buyerIdentify">
  110. <!-- <el-input v-model="form.buyerIdentify"></el-input> -->
  111. <ReaderInput
  112. type="ID"
  113. v-model="form.buyerIdentify"></ReaderInput>
  114. </el-form-item>
  115. <el-form-item
  116. v-if="Certificate.Nation"
  117. label="国家"
  118. >
  119. {{ Certificate.Nation }}
  120. </el-form-item>
  121. <el-form-item
  122. v-if="Certificate.Sex"
  123. label="性别"
  124. >
  125. {{ Certificate.Sex }}
  126. </el-form-item>
  127. <el-form-item
  128. v-if="Certificate.ValidDate"
  129. label="有效截止日期"
  130. >
  131. {{ Certificate.ValidDate }}
  132. </el-form-item>
  133. <el-form-item
  134. prop="playDateBegin"
  135. label="游玩日期">
  136. <el-date-picker
  137. :clearable="false"
  138. type="date"
  139. :editable="false"
  140. disabled
  141. :picker-options="dateOption"
  142. v-model="form.playDateBegin"
  143. >
  144. </el-date-picker>
  145. </el-form-item>
  146. <el-form-item
  147. prop="playDateEnd"
  148. label="结束日期">
  149. <el-date-picker
  150. :clearable="false"
  151. :editable="false"
  152. disabled
  153. :picker-options="dateOption"
  154. v-model="form.playDateEnd"
  155. type="date"
  156. >
  157. </el-date-picker>
  158. </el-form-item>
  159. <el-form-item
  160. verify
  161. number
  162. label="购买数量"
  163. prop="count"
  164. >
  165. <el-input-number
  166. ref="ticketCount"
  167. name="ticket-count"
  168. v-model.number="form.count"
  169. :min="1"
  170. :max="10000"
  171. :precision="0"
  172. ></el-input-number>
  173. </el-form-item>
  174. <el-form-item
  175. label="检票方式"
  176. prop="checkWay">
  177. <el-select
  178. v-model="form.checkWay"
  179. :disabled="retailLockCheckStyle">
  180. <el-option
  181. v-for="item in checkWayList"
  182. :key="item.val"
  183. :value="item.val"
  184. :label="item.name"
  185. ></el-option>
  186. </el-select>
  187. <el-checkbox
  188. style="margin-left:10px"
  189. v-model="retailLockCheckStyle">
  190. 锁定
  191. </el-checkbox>
  192. </el-form-item>
  193. <!-- v-if="form.checkWay === 3 || form.checkWay === 4" -->
  194. <el-form-item
  195. label="游客信息"
  196. >
  197. <div
  198. v-if="currentTicket"
  199. class="input-space"
  200. >
  201. <el-button
  202. type="primary"
  203. size="small"
  204. icon="el-icon-edit"
  205. @click="showTouristList"
  206. >
  207. 编辑查看
  208. </el-button>
  209. </div>
  210. </el-form-item>
  211. </el-form>
  212. <div class="btn-wrap">
  213. <el-button
  214. @click="resetForm"
  215. style="margin-right:20px">
  216. 重置表单
  217. </el-button>
  218. <el-button
  219. type="primary"
  220. @click="addToOrder">
  221. 加入订单
  222. </el-button>
  223. </div>
  224. </el-card>
  225. <!-- 游客列表 -->
  226. <TouristList
  227. :check-ticket-no="needCheckTicket"
  228. :check-face="needCheckFace"
  229. :check-id="needCheckId"
  230. :check-ic="needCheckIc"
  231. :tourist-list="touristList"
  232. :update-tourist="updateTourist"
  233. ref="touristList"></TouristList>
  234. </div>
  235. </template>
  236. <script>
  237. import { randomString } from '@/utils'
  238. import { verifyId, verifyPhone } from '@/utils/validate'
  239. import { checkWayList } from '@/assets/staticData'
  240. import { setTourist } from '@/pages/common'
  241. import TouristList from '../common/TouristList'
  242. import ReaderInput from '@/components/ReaderInput'
  243. import moment from 'moment'
  244. import { IDENTIFY_TYPES } from '@/const'
  245. import { getTeamList, getGuideList } from '@/api/checker'
  246. import { EventBus } from '@/utils/eventBus'
  247. export default {
  248. props: {
  249. currentTicket: {
  250. type: Object,
  251. default: () => null
  252. },
  253. currentBatch: {
  254. type: Object,
  255. default: () => null
  256. },
  257. orderItems: {
  258. type: Array,
  259. default: () => []
  260. }
  261. },
  262. components: {
  263. TouristList,
  264. ReaderInput
  265. },
  266. computed: {
  267. projectName () {
  268. return this.$store.state.app.projectName
  269. },
  270. totalPrice () {
  271. if (!this.currentTicket) {
  272. return 0
  273. }
  274. return this.$NP.times(this.currentPrice, this.form.count)
  275. },
  276. scenicName () {
  277. return this.$store.state.user.scenicName
  278. },
  279. currentBatchName () {
  280. if (!this.currentTicket || !this.currentBatch) return ''
  281. const { name, startTime, endTime } = this.currentBatch
  282. return name ? `${name} ${startTime} - ${endTime}` : ''
  283. },
  284. needCheckTicket () {
  285. return this.form.checkWay === 5
  286. },
  287. needCheckId () {
  288. const { category, currentTicket } = this
  289. return category === 'member' && currentTicket?.checkType?.includes('idcard')
  290. },
  291. needCheckFace () {
  292. const { category, currentTicket } = this
  293. return category === 'member' && currentTicket?.checkType?.includes('face')
  294. },
  295. needCheckIc () {
  296. const { category, currentTicket } = this
  297. return category === 'member' && currentTicket?.checkType?.includes('card')
  298. }
  299. },
  300. data () {
  301. const category = this.$route.meta.category || 'ticket'
  302. const type = this.$route.meta.type
  303. console.log('category', category, type)
  304. return {
  305. category,
  306. isTeam: type === 'team',
  307. loading: false,
  308. keyControl: 2, // 键盘控制:1,2,3标识选中顺序
  309. isFocus: false, // 当前组件是否选中
  310. papersType: IDENTIFY_TYPES,
  311. checkWayList,
  312. pricePlan: [],
  313. currentPrice: 0,
  314. currentPlan: null,
  315. retailLockCheckStyle: (() => {
  316. let prefix = 'single'
  317. if (category === 'batch') prefix = 'batch'
  318. else if (category === 'member') prefix = 'member'
  319. else if (type === 'team') prefix = 'team'
  320. return !!this.$localStore.get(`${prefix}_lockCheckStyle`) || false
  321. })(),
  322. identifyLockCheckStyle: (() => {
  323. let prefix = 'single'
  324. if (category === 'batch') prefix = 'batch'
  325. else if (category === 'member') prefix = 'member'
  326. else if (type === 'team') prefix = 'team'
  327. return !!this.$localStore.get(`${prefix}_identifyLockCheckStyle`) || false
  328. })(),
  329. saleType: (() => {
  330. if (category === 'batch') return 'batch'
  331. else if (category === 'member') return 'member'
  332. else if (type === 'team') return 'team'
  333. else return 'single'
  334. })(),
  335. touristList: [{
  336. batchConfigId: randomString(),
  337. guestName: '',
  338. guestPhone: '',
  339. guestIdentify: '',
  340. guestIdentifyType: 0,
  341. ticketTypeId: 0,
  342. checkNum: 1,
  343. price: 0,
  344. seatId: 0,
  345. playDateBegin: new Date(moment().startOf('day').valueOf()),
  346. lock: false // 是否可编辑
  347. }],
  348. form: {
  349. buyerIdentify: '',
  350. buyerName: '',
  351. buyerIdentifyType: 0,
  352. buyerPhone: '',
  353. groupIndividual: 1,
  354. teamIndividual: type === 'team' ? 2 : 1,
  355. count: this.$localStore.get('initNum') === '空' ? undefined : 1,
  356. payChannel: '现金',
  357. playDateBegin: new Date(moment().startOf('day').valueOf()),
  358. playDateEnd: '',
  359. price: 0,
  360. teamId: '',
  361. guideId: '',
  362. checkWay: type === 'team' ? 2 : 1,
  363. actualMoney: 0 // 实付金额,不需要传给后台
  364. },
  365. Certificate: {
  366. },
  367. dateOption: {
  368. // 日历禁用日期
  369. disabledDate () {
  370. return false
  371. }
  372. },
  373. disablePlayDateBegin: false,
  374. teamList: [],
  375. guideList: [],
  376. ticketAutoAddMap: {}
  377. }
  378. },
  379. created () {
  380. if (this.isTeam) {
  381. this.getTeams()
  382. getGuideList({ pageSize: -1, pageNum: 1 }).then(res => {
  383. this.guideList = res.data.records || []
  384. })
  385. }
  386. },
  387. methods: {
  388. verifyId,
  389. verifyPhone,
  390. randomString,
  391. getTeams () {
  392. getTeamList({ pageSize: -1, pageNum: 1 }).then(res => {
  393. this.teamList = res.data.records || []
  394. })
  395. },
  396. setFocus () {
  397. this.$refs.ticketCount.focus()
  398. this.$refs.ticketCount.select()
  399. },
  400. resetForm () {
  401. this.touristList = [{
  402. batchConfigId: randomString(),
  403. guestName: '',
  404. guestPhone: '',
  405. guestIdentify: '',
  406. guestIdentifyType: 0,
  407. lock: false // 是否可编辑
  408. }]
  409. this.$refs.form.resetFields()
  410. if (this.retailLockCheckStyle) {
  411. this.form.checkWay = this.$localStore.get(`${this.saleType}_checkWay`) || (this.isTeam ? 2 : 1)
  412. } else {
  413. this.form.checkWay = this.isTeam ? 2 : 1
  414. }
  415. this.Certificate = {}
  416. },
  417. setEndDate (val) {
  418. const { category, currentTicket } = this
  419. const { useDateType, memberUseDateType, useDays } = currentTicket
  420. if ((category === 'ticket' && useDateType === 1) || (category === 'member' && memberUseDateType === 2)) {
  421. this.form.playDateEnd = moment(val).add((useDays || 1) - 1, 'days').format('YYYY-MM-DD')
  422. }
  423. if (category === 'batch') {
  424. this.form.playDateEnd = moment(val).format('YYYY-MM-DD')
  425. }
  426. if (category === 'member' && memberUseDateType === 1) {
  427. this.form.playDateEnd = moment(val).add((useDays || 1) - 1, 'days').format('YYYY-MM-DD')
  428. }
  429. },
  430. // 更新游客列表
  431. updateTourist (data) {
  432. this.form.count = data.length
  433. this.touristList = data
  434. },
  435. // 同步游客数据与游客数
  436. syncTouristList () {
  437. let num = this.form.count - this.touristList.length
  438. setTourist(this.touristList, num)
  439. },
  440. // 显示游客弹窗
  441. showTouristList () {
  442. this.syncTouristList()
  443. this.$refs.touristList.show()
  444. },
  445. isPlayToday () {
  446. const isBefore = moment(this.form.playDateBegin).isBefore(moment().format('YYYY-MM-DD'))
  447. const isAfter = moment(this.form.playDateBegin).isAfter(moment().format('YYYY-MM-DD'))
  448. return !(isBefore || isAfter)
  449. },
  450. addToOrder (callback) {
  451. if (this.currentTicket && this.currentTicket.isSale === 0) {
  452. return this.$message.error('当前票种已停售')
  453. }
  454. if (!this.isPlayToday()) {
  455. // 期票不提示日期不是今天
  456. const isPeriodTicket = this.currentTicket && this.currentTicket.useDateType === 2
  457. if (!isPeriodTicket) {
  458. // 客户端下单的时候游玩日期不是当天,提示一下
  459. this.$message.warning('友情提示:您下单的游玩日期不是今天!')
  460. }
  461. }
  462. if (!this.currentTicket?.id) {
  463. return this.$message.error('请选择门票')
  464. }
  465. if (this.category === 'batch') {
  466. if (!this.currentBatch) {
  467. return this.$message.error('请选场次')
  468. }
  469. if (this.currentBatch.leftNums !== -1) {
  470. if (this.currentBatch.leftNums === 0) {
  471. return this.$message.error('当前场次已售罄')
  472. }
  473. if (this.currentBatch.leftNums < this.form.count) {
  474. return this.$message.error('当前场次剩余票数不足')
  475. }
  476. }
  477. }
  478. if (this.loading) return
  479. this.$refs.form.validate((valid) => {
  480. if (valid) {
  481. this.syncTouristList()
  482. const { playDateBegin, playDateEnd } = this.form
  483. const { currentBatch } = this
  484. const { id, name, checkCount, isUseDateLimit, printTemplateId, price } = this.currentTicket
  485. // const price = this.currentPrice
  486. const originalPrice = price
  487. if (this.isTeam) {
  488. if (!this.form.teamId) {
  489. this.$message.error('请选择团队')
  490. return
  491. }
  492. }
  493. if (this.form.checkWay === 3) {
  494. // 是否存在未填写的内容
  495. let blankData = this.touristList.find(item => {
  496. return !item.guestName || !item.guestIdentify
  497. })
  498. if (blankData) {
  499. this.$message.error('游客信息不完整,请编辑查看')
  500. return
  501. }
  502. }
  503. if (this.form.checkWay === 4) {
  504. // 是否存在未填写的内容
  505. let blankData = this.touristList.find(item => {
  506. return !item.face
  507. })
  508. if (blankData) {
  509. this.$message.error('游客人脸信息不完整,请编辑查看')
  510. return
  511. }
  512. }
  513. const pdb = moment(playDateBegin).format('YYYY-MM-DD')
  514. const pde = moment(playDateEnd).format('YYYY-MM-DD')
  515. let tickets = this.touristList.map(item => {
  516. return {
  517. ...item,
  518. ticketTypeId: id,
  519. checkNum: checkCount,
  520. price,
  521. originalPrice,
  522. discountPrice: 0,
  523. ticketNo: item.ticketNo,
  524. batchConfigId: currentBatch?.id || '',
  525. face: item.face,
  526. isPrepare: this.form.checkWay === 5 ? 1 : 0,
  527. pricePlanId: this.currentPlan || 0,
  528. playDateBegin: pdb,
  529. playDateEnd: pde,
  530. printTemplateId
  531. }
  532. })
  533. const ticketNum = tickets.length
  534. // 合并游玩日期相同的票种数据
  535. const existItem = this.orderItems.find(i => {
  536. let dateIsEque
  537. if (isUseDateLimit) {
  538. dateIsEque = JSON.stringify(i.playDateBegin) === JSON.stringify(pdb)
  539. } else {
  540. dateIsEque = true
  541. }
  542. // 日期对象不全等
  543. return i.id === id && dateIsEque && i.price === price
  544. })
  545. if (existItem) {
  546. Object.assign(existItem, this.form)
  547. existItem.tickets = existItem.tickets.concat(tickets)
  548. existItem.count = existItem.tickets.length
  549. existItem.total = this.$NP.plus(existItem.total, this.totalPrice)
  550. } else {
  551. this.orderItems.push({
  552. ...this.form,
  553. keyId: randomString(), // 唯一标识
  554. id, // 票种Id
  555. ticketName: name,
  556. count: ticketNum,
  557. price,
  558. originalPrice,
  559. discountPrice: 0,
  560. total: ticketNum * price,
  561. playDateBegin: pdb,
  562. currentTicket: {
  563. ...this.currentTicket,
  564. pricePlanId:
  565. this.currentPlan,
  566. price,
  567. playDateBegin: pdb,
  568. playDateEnd: pde,
  569. printTemplateId
  570. },
  571. tickets
  572. })
  573. }
  574. // 重置游客数量
  575. this.touristList = [{
  576. batchConfigId: randomString(),
  577. guestName: '',
  578. guestPhone: '',
  579. guestIdentify: '',
  580. guestIdentifyType: 0,
  581. playDateBegin: moment().format('YYYY-MM-DD'),
  582. lock: false // 是否可编辑
  583. }]
  584. this.form.count = this.$localStore.get('initNum') === '空' ? undefined : 1
  585. if (callback && typeof callback === 'function') {
  586. callback()
  587. }
  588. this.$nextTick(() => {
  589. this.$refs.form.clearValidate()
  590. })
  591. }
  592. })
  593. },
  594. setPrice (price) {
  595. this.currentPrice = price || this.currentTicket.price
  596. this.form.price = this.currentPrice
  597. },
  598. defaultPapersType () {
  599. if (this.projectName === 'zql') {
  600. return 0
  601. } else if (this.$localStore.get(`${this.saleType}_identify`)) {
  602. return this.$localStore.get(`${this.saleType}_identify`)
  603. } else {
  604. return ''
  605. }
  606. }
  607. },
  608. mounted () {
  609. EventBus.$on('ticketChanged', (ticket) => {
  610. if (!ticket) return
  611. this.currentTicket = ticket
  612. if (this.category === 'batch') return
  613. if (this.projectName === 'jingxianlvyou') return
  614. setTimeout(() => {
  615. // if (!this.ticketAutoAddMap[this.currentTicket.id]) {
  616. // this.ticketAutoAddMap[this.currentTicket.id] = true
  617. // }
  618. this.addToOrder()
  619. }, 600)
  620. })
  621. EventBus.$on('orderCreated', () => {
  622. if (this.isTeam) {
  623. this.getTeams()
  624. }
  625. })
  626. if (this.retailLockCheckStyle) {
  627. this.form.checkWay = this.$localStore.get(`${this.saleType}_checkWay`) || (this.isTeam ? 2 : 1)
  628. } else {
  629. this.form.checkWay = this.isTeam ? 2 : 1
  630. }
  631. },
  632. beforeDestroy () {
  633. EventBus.$off('ticketChanged')
  634. EventBus.$off('orderCreated')
  635. },
  636. watch: {
  637. async currentTicket (val, oldVal) {
  638. if (!val) return
  639. await this.$nextTick()
  640. this.resetForm()
  641. const { useDateType, useDateStart, useDateEnd, useDays, memberUseDateType, playDate } = val
  642. this.disablePlayDateBegin = false
  643. switch (this.category) {
  644. case 'ticket':
  645. if (useDateType === 2) {
  646. this.form.playDateBegin = moment(useDateStart).format('YYYY-MM-DD')
  647. this.form.playDateEnd = moment(useDateEnd).format('YYYY-MM-DD')
  648. this.disablePlayDateBegin = true
  649. } else {
  650. this.form.playDateBegin = moment(playDate).format('YYYY-MM-DD')
  651. this.form.playDateEnd = moment(playDate).add((useDays || 1) - 1, 'days').format('YYYY-MM-DD')
  652. }
  653. break
  654. case 'batch':
  655. this.form.playDateBegin = moment(playDate).format('YYYY-MM-DD')
  656. this.form.playDateEnd = moment(playDate).format('YYYY-MM-DD')
  657. this.disablePlayDateBegin = true
  658. break
  659. case 'member':
  660. if (memberUseDateType === 1) {
  661. this.form.playDateBegin = moment(playDate).format('YYYY-MM-DD')
  662. this.form.playDateEnd = moment(playDate).add((useDays || 1) - 1, 'days').format('YYYY-MM-DD')
  663. } else {
  664. this.form.playDateBegin = moment(useDateStart).format('YYYY-MM-DD')
  665. this.form.playDateEnd = moment(useDateEnd).format('YYYY-MM-DD')
  666. }
  667. this.disablePlayDateBegin = true
  668. break
  669. default :
  670. break
  671. }
  672. // 设置不可选日期
  673. this.dateOption.disabledDate = (date) => {
  674. let beforeToday = moment().subtract(1, 'days').isAfter(date)
  675. let beforeStart = moment(val.useDateStart).isAfter(date)
  676. let afterEnd = moment(val.useDateEnd).isBefore(date)
  677. return beforeToday || beforeStart || afterEnd
  678. }
  679. this.timer && clearTimeout(this.timer)
  680. this.timer = setTimeout(() => {
  681. this.setPrice(this.currentTicket.price)
  682. }, 300)
  683. },
  684. retailLockCheckStyle (val) {
  685. if (val) {
  686. this.$localStore.set(`${this.saleType}_checkWay`, this.form.checkWay)
  687. }
  688. this.$localStore.set(`${this.saleType}_lockCheckStyle`, val)
  689. },
  690. identifyLockCheckStyle (val) {
  691. if (val) {
  692. this.$localStore.set(`${this.saleType}_identify`, this.form.buyerIdentifyType)
  693. }
  694. this.$localStore.set(`${this.saleType}_identifyLockCheckStyle`, val)
  695. },
  696. 'form.playDateBegin' (val) {
  697. if (val) {
  698. this.setEndDate(val)
  699. this.currentPlan = null
  700. this.$emit('changePlayDate', moment(val).format('YYYY-MM-DD'))
  701. this.timer && clearTimeout(this.timer)
  702. }
  703. }
  704. }
  705. }
  706. </script>
  707. <style lang="scss" scoped>
  708. .el-input,.el-select,.el-date-editor,.el-date-editor.el-input,.el-input-number {
  709. width: 200px;
  710. }
  711. </style>