You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

contentSection.vue 32KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965
  1. <template>
  2. <section id="contact2">
  3. <div class="container">
  4. <div class="row">
  5. <div class="col-lg-12">
  6. <div class="section-header">
  7. <h2>Week Information</h2>
  8. </div>
  9. <div align="left" class="custom-control custom-switch mb-2">
  10. <div class="row">
  11. <div align="center" class="col">
  12. <label class="mr-5">Were you referred by an agent?</label>
  13. <input
  14. type="checkbox"
  15. class="custom-control-input"
  16. id="customSwitch1"
  17. :checked="refAgent"
  18. @change="changeRef"
  19. />
  20. <label
  21. class="custom-control-label"
  22. for="customSwitch1"
  23. >{{ refAgent ? "Yes" : "No" }}</label>
  24. <div class="refbyAgent" :class="{ 'refbyAgent--clicked': refAgent }">
  25. <div class="col-md-6" v-if="refAgent">
  26. <label for="Name of Agency">Agency</label>
  27. <select
  28. class="form-control uniSelect"
  29. id="Agency"
  30. name="agency"
  31. v-model="sellItem.agencyId"
  32. >
  33. <option v-for="(item, i) in agencies" :key="i" :value="item.id">
  34. {{
  35. item.agencyName
  36. }}
  37. </option>
  38. </select>
  39. </div>
  40. <div class="col-md-6" v-if="refAgent">
  41. <label for="Name of Agent">Agent</label>
  42. <select
  43. class="form-control uniSelect"
  44. id="agent"
  45. name="agent"
  46. v-model="sellItem.agentId"
  47. :disabled="!sellItem.agencyId"
  48. >
  49. <option
  50. v-for="(item, i) in displayNotDeletedAgents"
  51. :key="i"
  52. :value="item.id"
  53. >
  54. <div>{{ item.name + " " + item.surname }}</div>
  55. </option>
  56. </select>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <div class="form">
  63. <div id="sendmessage">Your details has been sent. Thank you!</div>
  64. <div id="errormessage"></div>
  65. <div class="form-row">
  66. <div class="form-group col-md-6">
  67. <div class="input-group">
  68. <label
  69. v-if="!sellItem.region"
  70. class="uniSelectLabel"
  71. for="weekInfoRegionSelect"
  72. >REGION</label>
  73. <select
  74. id="weekInfoRegionSelect"
  75. class="form-control uniSelect"
  76. v-model="sellItem.region"
  77. @change="regionChange()"
  78. style="font-size: 15px"
  79. >
  80. <option
  81. v-for="(region, r) in regions"
  82. :key="r"
  83. :value="region"
  84. >{{ region.regionName }}</option>
  85. </select>
  86. </div>
  87. <!-- <input
  88. type="text"
  89. name="region"
  90. class="form-control"
  91. id="region"
  92. placeholder="Region"
  93. data-rule="minlen:4"
  94. data-msg="Please enter the region"
  95. />-->
  96. <div class="validation"></div>
  97. </div>
  98. <div class="form-group col-md-6">
  99. <div class="input-group">
  100. <label
  101. v-if="!sellItem.resort"
  102. class="uniSelectLabel"
  103. for="weekInfoResortSelect"
  104. >RESORT NAME</label>
  105. <select
  106. id="weekInfoResortSelect"
  107. class="form-control uniSelect"
  108. v-model="sellItem.resort"
  109. @change="resortChange()"
  110. >
  111. <option value="Other">Other</option>
  112. <option
  113. v-for="(resort, r) in filteredResort"
  114. :key="r"
  115. :value="resort"
  116. >{{ resort.resortName }}</option>
  117. </select>
  118. </div>
  119. <!-- <input
  120. type="text"
  121. class="form-control"
  122. name="resort"
  123. id="resort"
  124. placeholder="Resort Name"
  125. data-rule="minlen:4"
  126. data-msg="Please enter resort name"
  127. />-->
  128. <div class="validation"></div>
  129. </div>
  130. <div class="form-group col-md-6">
  131. <input
  132. class="form-control"
  133. v-if="sellItem.otherResort"
  134. placeholder="NAME OF RESORT (* IF OTHER)"
  135. type="text"
  136. name="other"
  137. v-model="sellItem.otherResortName"
  138. />
  139. </div>
  140. <div class="form-group col-md-6">
  141. <div v-if="sellItem.otherResort">
  142. <label v-if="!sellItem.region" class="uniSelectLabel" for="region">REGION</label>
  143. </div>
  144. <select
  145. class="form-control uniSelect"
  146. v-if="sellItem.otherResort"
  147. name="region"
  148. id="region"
  149. v-model="sellItem.region"
  150. >
  151. <option v-for="(region, r) in regions" :key="r">{{ region.regionName }}</option>
  152. </select>
  153. </div>
  154. <div class="form-group col-md-6">
  155. <input
  156. type="number"
  157. class="form-control"
  158. name="unitNumber"
  159. id="unitNumber"
  160. placeholder="UNIT NUMBER"
  161. v-model="sellItem.unitNumber"
  162. data-msg="Please enter unit number"
  163. />
  164. <div class="validation"></div>
  165. </div>
  166. <div class="form-group col-md-6">
  167. <input
  168. type="number"
  169. class="form-control"
  170. name="week"
  171. id="week"
  172. placeholder="UNIT / WEEK NUMBER"
  173. v-model="sellItem.module"
  174. data-msg="Please enter week number"
  175. />
  176. <div class="validation"></div>
  177. </div>
  178. <div class="form-group col-md-6">
  179. <label v-if="!sellItem.season" class="uniSelectLabel" for="region">SEASON</label>
  180. <select
  181. class="form-control uniSelect"
  182. name="region"
  183. id="region"
  184. v-model="sellItem.season"
  185. >
  186. <option v-for="(season, r) in seasons" :key="r">{{ season.name }}</option>
  187. </select>
  188. <div class="validation"></div>
  189. </div>
  190. <div class="form-group col-md-6">
  191. <label v-if="!sellItem.bedrooms" class="uniSelectLabel" for="region">BEDROOM/S</label>
  192. <select
  193. class="form-control uniSelect"
  194. name="region"
  195. id="region"
  196. v-model="sellItem.bedrooms"
  197. >
  198. <option v-for="(item, i) in resortBedrooms" :key="i">{{ item }}</option>
  199. </select>
  200. <div class="validation"></div>
  201. </div>
  202. <div class="form-group col-md-6">
  203. <label v-if="!sellItem.maxSleep" class="uniSelectLabel" for="region">SLEEP MAX</label>
  204. <select
  205. class="form-control uniSelect"
  206. name="region"
  207. id="region"
  208. v-model="sellItem.maxSleep"
  209. >
  210. <option v-for="(item, i) in maxSleep" :key="i">{{ item }}</option>
  211. </select>
  212. <div class="validation"></div>
  213. </div>
  214. <div class="form-group col-md-6">
  215. <input
  216. type="number"
  217. class="form-control"
  218. name="levy"
  219. id="levy"
  220. placeholder="Levy Amount"
  221. v-model="sellItem.levyAmount"
  222. data-msg="Please enter levy amount"
  223. />
  224. <div class="validation"></div>
  225. </div>
  226. <div class="form-group col-md-6">
  227. <label v-if="!sellItem.weekType" class="uniSelectLabel" for="region">WEEK TYPE</label>
  228. <select
  229. class="form-control uniSelect"
  230. name="region"
  231. id="region"
  232. v-model="sellItem.weekType"
  233. >
  234. <option :key="0">Flexi</option>
  235. <option :key="1">Fixed</option>
  236. <option :key="2">Module</option>
  237. <option :key="3">Syndicate</option>
  238. </select>
  239. </div>
  240. </div>
  241. </div>
  242. <div align="left" class="custom-control custom-switch mb-2">
  243. <div class="row">
  244. <div align="center" class="col">
  245. <label class="mr-5">Has your week been spacebanked for the current year?</label>
  246. <input
  247. type="checkbox"
  248. class="custom-control-input"
  249. id="customSwitch2"
  250. :checked="sellItem.currentYearBanked"
  251. @change="changeCurrentBanked"
  252. />
  253. <label
  254. class="custom-control-label"
  255. for="customSwitch2"
  256. >{{ sellItem.currentYearBanked ? "Yes" : "No" }}</label>
  257. <div
  258. class="spacebanked1"
  259. :class="{ 'spacebanked1--clicked': sellItem.currentYearBanked }"
  260. >
  261. <div class="col-md-6">
  262. <label
  263. for="If yes, please confirm with whom"
  264. v-if="sellItem.currentYearBanked"
  265. >Please confirm with whom</label>
  266. <select
  267. class="form-control uniSelect"
  268. name="spacebankOwner"
  269. v-if="sellItem.currentYearBanked"
  270. v-model="sellItem.bankedWith"
  271. >
  272. <option v-for="(item, i) in bankedEntities" :key="i">{{ item }}</option>
  273. </select>
  274. </div>
  275. </div>
  276. </div>
  277. </div>
  278. </div>
  279. <div class="section-header">
  280. <h2>Detailed Individual Information</h2>
  281. </div>
  282. <div class="form">
  283. <div class="row">
  284. <div class="form-group col-md-6">
  285. <input
  286. type="text"
  287. name="name"
  288. class="form-control"
  289. id="name"
  290. placeholder="Name"
  291. data-rule="minlen:4"
  292. data-msg="Please enter your name"
  293. v-model="indiv.name"
  294. />
  295. <div class="validation"></div>
  296. </div>
  297. <div class="form-group col-md-6">
  298. <input
  299. type="text"
  300. class="form-control"
  301. name="surname"
  302. id="surname"
  303. placeholder="Surname"
  304. data-msg="Please enter your surname"
  305. v-model="indiv.surname"
  306. />
  307. <div class="validation"></div>
  308. </div>
  309. </div>
  310. <div class="row">
  311. <div class="form-group col-md-6">
  312. <input
  313. type="text"
  314. name="idnum"
  315. class="form-control"
  316. id="idnum"
  317. placeholder="ID Number"
  318. data-rule="minlen:4"
  319. data-msg="Please enter your ID number"
  320. v-model="indiv.idNumber"
  321. />
  322. <div class="validation"></div>
  323. </div>
  324. <div class="form-group col-md-6">
  325. <input
  326. type="text"
  327. class="form-control"
  328. name="company"
  329. id="company"
  330. placeholder="Company Reg Number"
  331. data-rule="minlen:4"
  332. data-msg="Please enter your company reg number"
  333. v-model="indiv.companyRegNumber"
  334. />
  335. <div class="validation"></div>
  336. </div>
  337. </div>
  338. <div class="row">
  339. <div class="form-group col-md-6">
  340. <input
  341. type="text"
  342. name="marital"
  343. class="form-control"
  344. id="marital"
  345. placeholder="Marital Status"
  346. data-rule="minlen:4"
  347. data-msg="Please enter your marital status"
  348. v-model="indiv.maritalStatus"
  349. />
  350. <div class="validation"></div>
  351. </div>
  352. <div class="form-group col-md-6">
  353. <input
  354. type="text"
  355. class="form-control"
  356. name="email"
  357. id="email"
  358. placeholder="Email Address"
  359. data-msg="Please enter your email address"
  360. v-model="indiv.emailAddress"
  361. />
  362. <div class="validation"></div>
  363. </div>
  364. </div>
  365. <div class="row">
  366. <div class="form-group col-md-6">
  367. <input
  368. type="text"
  369. name="cell"
  370. class="form-control"
  371. id="cell"
  372. placeholder="Cell Number"
  373. data-rule="minlen:4"
  374. data-msg="Please enter your cell number"
  375. v-model="indiv.cellNumner"
  376. />
  377. <div class="validation"></div>
  378. </div>
  379. <div class="form-group col-md-6">
  380. <input
  381. type="text"
  382. class="form-control"
  383. name="landline"
  384. id="landline"
  385. placeholder="Landline Number"
  386. data-msg="Please enter your landline number"
  387. v-model="indiv.landlineNumber"
  388. />
  389. <div class="validation"></div>
  390. </div>
  391. </div>
  392. </div>
  393. <div class="section-header">
  394. <h2>Address</h2>
  395. </div>
  396. <div class="form">
  397. <div class="row">
  398. <div class="form-group col-md-12">
  399. <addressAutoComplete @GoogleAddress="UpdateAddress" />
  400. </div>
  401. </div>
  402. <div class="form-row">
  403. <div class="form-group col-md-6">
  404. <input
  405. type="text"
  406. name="street-nr"
  407. class="form-control"
  408. id="street-nr"
  409. placeholder="Street Number"
  410. data-rule="minlen:4"
  411. data-msg="Please enter your street number"
  412. v-model="indiv.address.streetNumber"
  413. disabled
  414. />
  415. <div class="validation"></div>
  416. </div>
  417. <div class="form-group col-md-6">
  418. <input
  419. type="text"
  420. class="form-control"
  421. name="street"
  422. id="street"
  423. placeholder="Street Name"
  424. data-msg="Please enter your street name"
  425. disabled
  426. v-model="indiv.address.street"
  427. />
  428. <div class="validation"></div>
  429. </div>
  430. <div class="form-group col-md-6">
  431. <input
  432. type="text"
  433. name="province"
  434. class="form-control"
  435. id="province"
  436. placeholder="Province"
  437. data-rule="minlen:4"
  438. data-msg="Please enter your province"
  439. disabled
  440. v-model="indiv.address.province"
  441. />
  442. <div class="validation"></div>
  443. </div>
  444. <div class="form-group col-md-6">
  445. <input
  446. type="text"
  447. class="form-control"
  448. name="city"
  449. id="city"
  450. placeholder="City"
  451. data-rule="minlen:4"
  452. data-msg="Please enter your city"
  453. v-model="indiv.address.city"
  454. disabled
  455. />
  456. <div class="validation"></div>
  457. </div>
  458. <div class="form-group col-md-6">
  459. <input
  460. type="text"
  461. name="suburb"
  462. class="form-control"
  463. id="suburb"
  464. placeholder="Suburb"
  465. data-rule="minlen:4"
  466. data-msg="Please enter your suburb"
  467. v-model="indiv.address.suburb"
  468. disabled
  469. />
  470. <div class="validation"></div>
  471. </div>
  472. <div class="form-group col-md-6">
  473. <input
  474. type="text"
  475. class="form-control"
  476. name="postal"
  477. id="postal"
  478. placeholder="Postal Code"
  479. data-msg="Please enter your postal code"
  480. v-model="indiv.address.postalCode"
  481. disabled
  482. />
  483. <div class="validation"></div>
  484. </div>
  485. </div>
  486. </div>
  487. <div class="section-header">
  488. <h2>Banking Details</h2>
  489. </div>
  490. <div class="form">
  491. <div class="form-row">
  492. <div class="form-group col-md-6">
  493. <div class="input-group">
  494. <label
  495. v-if="!indiv.bankingDetails.bank"
  496. class="uniSelectLabel"
  497. for="weekInfoRegionSelect"
  498. >BANK</label>
  499. <select
  500. id="weekInfoRegionSelect"
  501. class="form-control uniSelect"
  502. @change="regionChange()"
  503. style="font-size: 15px"
  504. v-model="indiv.bankingDetails.bank"
  505. >
  506. <option v-for="bank in banks" :key="bank.id" :value="bank">{{ bank.name }}</option>
  507. </select>
  508. </div>
  509. <div class="validation"></div>
  510. </div>
  511. <div class="form-group col-md-6">
  512. <input
  513. type="text"
  514. class="form-control"
  515. name="acc-nr"
  516. id="acc-nr"
  517. placeholder="Account Number"
  518. data-msg="Please enter account number"
  519. v-model="indiv.bankingDetails.accountNumber"
  520. />
  521. <div class="validation"></div>
  522. </div>
  523. <div class="form-group col-md-6">
  524. <input
  525. type="text"
  526. name="holder"
  527. class="form-control"
  528. id="holder"
  529. placeholder="Account Holder"
  530. data-rule="minlen:4"
  531. data-msg="Please enter account holder"
  532. v-model="indiv.bankingDetails.accountHolder"
  533. />
  534. <div class="validation"></div>
  535. </div>
  536. </div>
  537. </div>
  538. <div class="section-header">
  539. <h2>Share Transfer Information</h2>
  540. </div>
  541. <div class="form">
  542. <div id="sendmessage">Your details has been sent. Thank you!</div>
  543. <div id="errormessage"></div>
  544. <div class="form-row">
  545. <div
  546. class="form-group col-md-12"
  547. style="border:solid;border-width:2px; border-color:rgb(27, 117, 187); border-radius: 3px"
  548. >
  549. <p
  550. style="text-align: left; margin:auto; padding:10px"
  551. >1. With respect to my timeshare module/week, I confirm that:</p>
  552. <div class="validation"></div>
  553. </div>
  554. </div>
  555. <div class="form-row">
  556. <div class="col-md-8">
  557. <p>1.1. All levy amounts for the current cycle have been paid in full</p>
  558. </div>
  559. <div class="form-group col-md-2">
  560. <div class="custom-control custom-switch">
  561. <input
  562. type="checkbox"
  563. class="custom-control-input"
  564. id="customSwitch3"
  565. :checked="sellItem.leviesPaidInFull"
  566. @change="changeLeviesPaidInFull"
  567. />
  568. <label
  569. class="custom-control-label"
  570. for="customSwitch3"
  571. >{{ sellItem.leviesPaidInFull ? "Yes" : "No" }}</label>
  572. </div>
  573. <div class="validation"></div>
  574. </div>
  575. </div>
  576. <div class="form-row">
  577. <div class="col-md-8">
  578. <p>1.2. My week is placed for rental this year</p>
  579. </div>
  580. <div class="form-group col-md-2">
  581. <div class="custom-control custom-switch">
  582. <input
  583. type="checkbox"
  584. class="custom-control-input"
  585. id="customSwitch4"
  586. :checked="sellItem.weekPlacedForRental"
  587. @change="changeWeekPlacedForRental"
  588. />
  589. <label
  590. class="custom-control-label"
  591. for="customSwitch4"
  592. >{{ sellItem.weekPlacedForRental ? "Yes" : "No" }}</label>
  593. </div>
  594. <div class="validation"></div>
  595. </div>
  596. </div>
  597. <div class="form-row">
  598. <div class="col-md-8">
  599. <p>1.3. I / We bought the timeshare module/week on the following date:</p>
  600. </div>
  601. <div class="form-group col-md-2">
  602. <input
  603. type="date"
  604. class="form-control"
  605. name="date"
  606. v-model="sellItem.originalPurchaseDate"
  607. />
  608. <div class="validation"></div>
  609. </div>
  610. </div>
  611. <div class="form-row">
  612. <div class="col-md-8">
  613. <p>1.4. The purchase price for which I / we bought timeshare module / week was:</p>
  614. </div>
  615. <div class="form-group col-md-2">
  616. <input
  617. class="form-control"
  618. placeholder="R"
  619. type="number"
  620. step="any"
  621. name="purchasePrice"
  622. v-model="sellItem.originalPurchasePrice"
  623. />
  624. <div class="validation"></div>
  625. </div>
  626. </div>
  627. <div class="form-row">
  628. <div class="col-md-8">
  629. <p>
  630. 1.5. I / We bought the timeshare module / week for the following dates for the
  631. current year:
  632. </p>
  633. </div>
  634. <div class="form-group col-md-2">
  635. Arrival Date :
  636. <input
  637. type="date"
  638. class="form-control"
  639. name="occupationDate1"
  640. v-model="sellItem.arrivalDate"
  641. />
  642. <div class="validation"></div>
  643. </div>
  644. <div class="form-group col-md-2">
  645. Departure Date :
  646. <input
  647. type="date"
  648. class="form-control"
  649. name="occupationDate2"
  650. v-model="sellItem.departureDate"
  651. />
  652. <div class="validation"></div>
  653. </div>
  654. </div>
  655. <div class="form-row">
  656. <div class="col-md-8">
  657. <p>
  658. 1.6. The selling price for the timeshare module / week for which I / we want to
  659. sell is: (Incl. Vat)
  660. </p>
  661. </div>
  662. <div class="form-group col-md-2">
  663. <input
  664. class="form-control"
  665. type="number"
  666. step="any"
  667. name="sellingPrice"
  668. v-model="sellItem.sellPrice"
  669. placeholder="R"
  670. />
  671. <div class="validation"></div>
  672. </div>
  673. </div>
  674. <div class="form-row">
  675. <div class="col-md-8">
  676. <p>1.7. Estate agent's commission agreed to (state Rand value)</p>
  677. </div>
  678. <div class="form-group col-md-2">
  679. <input
  680. class="form-control"
  681. type="number"
  682. step="any"
  683. name="commission"
  684. v-model="sellItem.agentCommission"
  685. placeholder="R"
  686. />
  687. <div class="validation"></div>
  688. </div>
  689. </div>
  690. <div class="form-row">
  691. <div class="col-md-8">
  692. <p>1.8. Mandate to sell timeshare</p>
  693. </div>
  694. <div class="form-group col-md-4">
  695. <div class="custom-file">
  696. <input class="custom-file-input mb-2" type="file" name="mandate" />
  697. <label class="custom-file-label" for="customFile">Choose file</label>
  698. </div>
  699. <div class="validation"></div>
  700. </div>
  701. </div>
  702. <div class="text-center col-12">
  703. <button class="btn-solid-blue" v-if="!sellItem.id" @click="submitSale()">SUBMIT</button>
  704. <button class="btn-solid-blue" v-else @click="newSale()">NEW WEEK</button>
  705. </div>
  706. <div class="text-center col-12">
  707. <button class="btn-solid-blue" @click="paygateRedirect()">PayGate</button>
  708. </div>
  709. <br />
  710. <br />
  711. </div>
  712. </div>
  713. <br />
  714. <br />
  715. </div>
  716. <div v-if="wait" id="preloader"></div>
  717. </div>
  718. </section>
  719. </template>
  720. <script>
  721. /* eslint-disable */
  722. import { mapState, mapActions, mapGetters } from "vuex";
  723. import addressAutoComplete from "../../shared/addressAutoComplete";
  724. import Alert from "../../shared/alert.vue";
  725. import Log from "../../../assets/Log";
  726. export default {
  727. name: "TimeshareToSell",
  728. props: {
  729. weekId: {
  730. default: 0,
  731. },
  732. },
  733. data() {
  734. return {
  735. wait: false,
  736. userLoggedIn: Log.isLoggedIn(),
  737. };
  738. },
  739. components: {
  740. addressAutoComplete,
  741. Alert,
  742. },
  743. mounted() {
  744. if (this.sellItem.id) {
  745. this.newSale();
  746. }
  747. this.initTimeshare(0);
  748. this.getIndividual(Log.getUser().id);
  749. this.getBanks();
  750. },
  751. created() {
  752. this.initTimeshare(this.weekId);
  753. },
  754. computed: {
  755. ...mapState("timeshare", [
  756. "resorts",
  757. "regions",
  758. "detailedRegion",
  759. "seasons",
  760. "result",
  761. "resortBedrooms",
  762. "maxSleep",
  763. "bankedEntities",
  764. "sellItem",
  765. "agencies",
  766. "agents",
  767. "getTemplate",
  768. ]),
  769. ...mapState("individual", ["indiv"]),
  770. ...mapState("authentication", ["isLoggedIn"]),
  771. ...mapGetters({
  772. user: "authentication/getUser",
  773. person: "authentication/getPerson",
  774. }),
  775. ...mapState("bank", ["banks"]),
  776. refAgent() {
  777. return this.sellItem && this.sellItem.referedByAgent;
  778. },
  779. filteredResort() {
  780. let list = [];
  781. if (
  782. this.sellItem &&
  783. this.sellItem.region &&
  784. this.sellItem.region.regionCode
  785. ) {
  786. const item = this.detailedRegion.find(
  787. (region) =>
  788. region.region.regionCode === this.sellItem.region.regionCode
  789. );
  790. if (item) {
  791. list = item.children;
  792. }
  793. } else {
  794. list = this.resorts;
  795. }
  796. return _.sortBy(list, (x) => x.resortName);
  797. },
  798. isLoggedIn() {
  799. return this.user && this.person;
  800. },
  801. displayNotDeletedAgents() {
  802. var notDeletedArr = [];
  803. this.agents.forEach((agent) => {
  804. if (!agent.isDeleted) {
  805. if (agent.agencyId === this.sellItem.agencyId) {
  806. notDeletedArr.push(agent);
  807. }
  808. }
  809. });
  810. return notDeletedArr;
  811. },
  812. },
  813. methods: {
  814. ...mapActions("individual", ["getIndividual"]),
  815. ...mapActions("timeshare", [
  816. "initTimeshare",
  817. "onResortChange",
  818. "saveWeek",
  819. "getBlankWeek",
  820. ]),
  821. ...mapActions("payment", ["addPayment"]),
  822. ...mapActions("bank", ["getBanks"]),
  823. newSale() {
  824. this.weekId = 0;
  825. this.getBlankWeek();
  826. },
  827. submitSale() {
  828. if (this.userLoggedIn) {
  829. this.sellItem.ownerObject = this.indiv;
  830. this.sellItem.status = undefined;
  831. console.log(JSON.stringify(this.sellItem));
  832. // this.saveWeek(this.sellItem).then((fulfilled) => {
  833. // this.paygateRedirect();
  834. // });
  835. } else this.$router.push("/user/login");
  836. },
  837. paygateRedirect() {
  838. var paymentObj = {
  839. timeshareWeekId: this.sellItem.id, // this.sellItem.Id,
  840. propertyId: 0,
  841. creatydById: Log.getUser().id, //Log.getUser().id,
  842. amount: 380.0,
  843. paymentStatus: "",
  844. paymentToken: "",
  845. };
  846. this.addPayment(paymentObj).then((res) => {
  847. this.$router.push({
  848. name: "PaymentGateway",
  849. params: {
  850. paymentReqId: res.PAY_REQUEST_ID,
  851. checksum: res.CHECKSUM,
  852. },
  853. });
  854. });
  855. },
  856. previewFiles(event) {
  857. console.log(event.target.files);
  858. },
  859. changeRef() {
  860. this.sellItem.agent = undefined;
  861. this.sellItem.agency = undefined;
  862. this.sellItem.referedByAgent = !this.sellItem.referedByAgent;
  863. },
  864. changeLeviesPaidInFull() {
  865. this.sellItem.leviesPaidInFull = !this.sellItem.leviesPaidInFull;
  866. },
  867. changeWeekPlacedForRental() {
  868. this.sellItem.weekPlacedForRental = !this.sellItem.weekPlacedForRental;
  869. },
  870. changeCurrentBanked() {
  871. this.sellItem.bankedWith = undefined;
  872. this.sellItem.currentYearBanked = !this.sellItem.currentYearBanked;
  873. },
  874. resortChange() {
  875. this.onResortChange({
  876. resortName: this.sellItem.resort.resortName,
  877. resortCode: this.sellItem.resort.resortCode,
  878. });
  879. if (this.sellItem && this.sellItem.resort === "Other") {
  880. this.sellItem.otherResortName = undefined;
  881. this.sellItem.otherResort = true;
  882. } else {
  883. this.sellItem.otherResortName = undefined;
  884. this.sellItem.otherResort = false;
  885. }
  886. },
  887. regionChange() {
  888. this.sellItem.regionId = this.sellItem.region
  889. ? this.sellItem.region.id
  890. : 1;
  891. },
  892. UpdateAddress(address) {
  893. this.indiv.address.streetNumber = address.streetNumber;
  894. this.indiv.address.street = address.streetName;
  895. this.indiv.address.province = address.province;
  896. this.indiv.address.city = address.city;
  897. this.indiv.address.suburb = address.suburb;
  898. this.indiv.address.postalCode = address.postalCode;
  899. },
  900. },
  901. };
  902. </script>
  903. <style lang="scss" scoped>
  904. .refbyAgent {
  905. will-change: transform;
  906. transition: height 500ms;
  907. height: 0px;
  908. }
  909. .refbyAgent--clicked {
  910. height: 150px;
  911. }
  912. .spacebanked1 {
  913. will-change: transform;
  914. transition: height 500ms;
  915. height: 0px;
  916. }
  917. .spacebanked1--clicked {
  918. height: 150px;
  919. }
  920. .custom-file-label {
  921. border-width: 2px;
  922. border-color: rgb(27, 117, 187);
  923. margin-bottom: 20px;
  924. }
  925. .custom-file-label::after {
  926. border-left: none;
  927. border-bottom: solid;
  928. border-width: 2px;
  929. border-color: rgb(27, 117, 187);
  930. font-family: "Muli";
  931. }
  932. </style>