createOrder.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817
  1. <template>
  2. <view class="page" :style="{'height':(h)+'px','padding-top':mt+'px'}">
  3. <c-nav-bar :title="!dataForm.id?'新增订单':!orderStatus?'编辑订单':'办理入住'" :showIcon="true"></c-nav-bar>
  4. <view class="box box1">
  5. <view class="tit">预订信息</view>
  6. <u-cell-group :border="false" customStyle="margin:0 -30rpx">
  7. <u-cell customStyle="height:88rpx">
  8. <text>*</text>
  9. <text slot="icon" class="label">姓名</text>
  10. <view slot="title" class="title">
  11. <u--input border="none" class="input" inputAlign="right" placeholderStyle="font-size:26rpx"
  12. placeholder="请输入姓名" v-model="dataForm.guestName"></u--input>
  13. </view>
  14. </u-cell>
  15. <u-cell customStyle="height:88rpx">
  16. <text slot="icon" class="label">手机号码</text>
  17. <view slot="title" class="title">
  18. <u--input border="none" class="input" inputAlign="right" placeholderStyle="font-size:26rpx"
  19. placeholder="请输入手机号码" v-model="dataForm.guestPhone"></u--input>
  20. </view>
  21. </u-cell>
  22. <u-cell :isLink="true" @click="showLaiyuan=true">
  23. <text slot="icon" class="label">订单来源</text>
  24. <view slot="title" class="title">
  25. {{dataForm.guestSourceName||''}}
  26. </view>
  27. </u-cell>
  28. </u-cell-group>
  29. </view>
  30. <view class="box">
  31. <view class="tit tit2">入住登记<u-icon @click="goStayCheck()" name="plus-circle" label="添加入住人"
  32. labelColor="#1372FF" labelSize="24" color="1372FF" size="30"></u-icon></view>
  33. <view class="perItem" v-for="(item,index) in dataForm.detailFormList[0].checkInPersonList" :key="index">
  34. <text>{{item.checkInName}}</text>
  35. <text style="margin-left: 40px;">{{item.idCard}}</text>
  36. <u-icon name="close-circle-fill" color="#ddd" size="30" @click="delPer(index)"></u-icon>
  37. </view>
  38. </view>
  39. <view class="box box1">
  40. <view class="tit">房间信息</view>
  41. <view class="dateBetween">
  42. <view class="start" v-if="dataForm.arriveDate">
  43. <text>入住日期</text>
  44. <text class="txt">{{dataForm.arriveDate.substring(5,10)}}</text>
  45. </view>
  46. <view class="dateNum">共{{dataForm.num}}晚</view>
  47. <view class="end" v-if="dataForm.leaveDate">
  48. <text>离店日期</text>
  49. <text @click="showPick()" class="txt">{{dataForm.leaveDate.substring(5,10)}}</text>
  50. <u-datetime-picker :show="leaveDateShow" mode="date" ref="picker" @cancel="leaveDateShow=false"
  51. @confirm="credentialsConfirmtime" :defaultIndex="credentialsDefaulttime"></u-datetime-picker>
  52. </view>
  53. </view>
  54. <u-cell-group :border="false" customStyle="margin:0 -30rpx">
  55. <u-cell isLink="true" @click="checkInTypeShow=true">
  56. <text slot="icon" class="label">入住类型</text>
  57. <view slot="title" class="title">
  58. {{dataForm.detailFormList[0].checkInTypeName}}
  59. </view>
  60. </u-cell>
  61. <u-cell>
  62. <text slot="icon" class="label">房间类型</text>
  63. <view slot="title" class="title">
  64. {{dataForm.houseBaseName}}
  65. </view>
  66. </u-cell>
  67. <u-cell>
  68. <text slot="icon" class="label bold">房间号</text>
  69. <view slot="title" class="title">
  70. {{dataForm.detailFormList[0].roomNumber}}
  71. </view>
  72. </u-cell>
  73. <!-- <u-cell>
  74. <text slot="icon" class="label bold"></text>
  75. <view slot="title" class="title">
  76. {{dataForm.detailFormList[0].roomAmount}}
  77. </view>
  78. </u-cell> -->
  79. <u-cell customStyle="height:88rpx;" style="display: flex; justify-content: space-between;"
  80. :border="false">
  81. <text slot="icon" class="label bold">房价</text>
  82. <view slot="title" class="title">
  83. <input class="input" inputAlign="right" placeholderStyle="font-size:26rpx" placeholder="请输入"
  84. @change="compoutPrice()" v-model="dataForm.detailFormList[0].roomAmount"
  85. style=" margin-bottom: 5rpx; height: 50rpx; " />
  86. </view>
  87. </u-cell>
  88. </u-cell-group>
  89. </view>
  90. <view class="box">
  91. <view class="tit tit2"><text>消费信息</text> <u-icon @click="addBreast()" name="plus-circle" label="添加消费"
  92. labelColor="#1372FF" labelSize="24" color="1372FF" size="30"></u-icon></view>
  93. <u-swipe-action>
  94. <u-swipe-action-item :show="item.show" :index="index" class=""
  95. v-for="(item, index) in dataForm.detailFormList[0].breakfastData" :key="index" @click="click(index)"
  96. :options="options">
  97. <view class="goodsInfo item">
  98. <view class="title-wrap">
  99. <text class="title u-line-2">{{item.breakfastName}}/{{item.num}}/{{item.price}}</text>
  100. </view>
  101. </view>
  102. </u-swipe-action-item>
  103. <u-swipe-action-item :show="item.show" :index="index2" class=""
  104. v-for="(item, index2) in dataForm.detailFormList[0].otherData" :key="index2" @click="click2(index2)"
  105. :options="options">
  106. <view class="goodsInfo item">
  107. <view class="title-wrap">
  108. <text class="title u-line-2">{{item.projectName}}/{{item.num}}/{{item.defaultPrice}}</text>
  109. </view>
  110. </view>
  111. </u-swipe-action-item>
  112. </u-swipe-action>
  113. </view>
  114. <view class="box">
  115. <view class="tit tit2"><text>收款信息</text> <u-icon @click="addpay()" name="plus-circle" label="添加收款"
  116. labelColor="#1372FF" labelSize="24" color="1372FF" size="30"></u-icon></view>
  117. <u-swipe-action>
  118. <u-swipe-action-item :show="item.show" :index="index" class=""
  119. v-for="(item, index) in dataForm.flowRecord" :key="index" @click="click3(index)" :options="options">
  120. <view class="goodsInfo item">
  121. <view class="title-wrap">
  122. <text
  123. class="title u-line-2">{{item.flowTypeName}}/{{item.payTypeName}}/{{item.amount}}</text>
  124. </view>
  125. </view>
  126. </u-swipe-action-item>
  127. </u-swipe-action>
  128. </view>
  129. <view class="box">
  130. <u-cell-group :border="false" customStyle="margin:0 -30rpx">
  131. <u-cell customStyle="height:88rpx" :border="false">
  132. <text slot="icon" class="label bold">备注</text>
  133. <view slot="title" class="titlebeuzhu" style="text-align: right;">
  134. <!-- <u--input border="none" class="input" inputAlign="right" placeholderStyle="font-size:26rpx"
  135. type="textarea" placeholder="请输入" v-model="dataForm.remarks" height="200"></u--input> -->
  136. <input class="input" inputAlign="right" placeholderStyle="font-size:26rpx" placeholder="请输入"
  137. v-model="dataForm.remarks" style=" margin-bottom: 5rpx; height: 50rpx; " />
  138. </view>
  139. </u-cell>
  140. </u-cell-group>
  141. </view>
  142. <view class="footer">
  143. <view class="total"><text>订单金额:</text><text>¥{{totalMOney}}</text></view>
  144. <view class="btns">
  145. <text @click="confirmOrder(2)" v-if="today==1">直接入住</text>
  146. <text @click="confirmOrder()" v-if="!orderStatus">保存</text>
  147. <!-- 新增和编辑时由此按钮 -->
  148. </view>
  149. </view>
  150. <u-picker :itemHeight="88" :immediateChange="true" :show="showLaiyuan" :columns="laiyuan" title="来源选择"
  151. keyName="guestSource" :defaultIndex="passengerDefault" @cancel="showLaiyuan=false;"
  152. @confirm="passengerConfirm"></u-picker>
  153. <u-picker :itemHeight="88" :immediateChange="true" :show="checkInTypeShow" :columns="checkInType" title="入住类型选择"
  154. keyName="label" :defaultIndex="passengerDefault2" @cancel="checkInTypeShow=false;"
  155. @confirm="passengerConfirm2"></u-picker>
  156. </view>
  157. </template>
  158. <script>
  159. import {
  160. encrypt
  161. } from '../../utils/aes.js'
  162. export default {
  163. data() {
  164. return {
  165. credentialsDefaulttime: [10, 1, 0],
  166. titleStyle: {
  167. fontSize: '34rpx',
  168. fontWeight: "bold",
  169. },
  170. showLaiyuan: false,
  171. checkInTypeShow: false,
  172. passengerDefault: [0],
  173. passengerDefault2: [0],
  174. leaveDateShow: false,
  175. options: [{
  176. text: '删除',
  177. style: {
  178. backgroundColor: '#dd524d'
  179. }
  180. }],
  181. orderStatus: null,
  182. totalMOney: 0, //订单总金额
  183. dataForm: {
  184. arriveDate: "",
  185. detailFormList: [{
  186. breakfastAmount: 0,
  187. checkInPersonList: [],
  188. checkInType: 0,
  189. checkInTypeName: '',
  190. id: 0,
  191. otherAmount: 0,
  192. roomAmount: 0,
  193. roomIds: "",
  194. breakfastData: [],
  195. otherData: [],
  196. roomNumber: "",
  197. }],
  198. flowRecord: [],
  199. guestName: "",
  200. guestPhone: "",
  201. guestSourceId: null,
  202. guestSourceName: null,
  203. homestayId: uni.getStorageSync('homestayId'),
  204. houseBaseId: 0,
  205. houseBaseName: '',
  206. leaveDate: "",
  207. num: 0,
  208. orderStatus: null,
  209. remarks: "",
  210. },
  211. checkInType: [
  212. [{
  213. label: '正常入住',
  214. val: 1
  215. }, {
  216. label: '自用房',
  217. val: 2
  218. },
  219. {
  220. label: '免费入住',
  221. val: 3
  222. }
  223. ]
  224. ],
  225. flowTypeNames: ['微信', '支付宝', '云闪付'],
  226. roomId: '',
  227. laiyuan: [
  228. []
  229. ],
  230. currentDate: '',
  231. today: '',
  232. //加密备用
  233. tempCheckInPersonList: [],
  234. tempGuestName: null,
  235. tempGuestPhone: null,
  236. oldVal: ''
  237. }
  238. },
  239. onReady() {
  240. // 微信小程序需要用此写法
  241. },
  242. onLoad(opt) {
  243. setTimeout(() => {
  244. this.getLaiyuan();
  245. }, 1000)
  246. this.getLaiyuan();
  247. if (opt.roomId) {
  248. this.roomId = opt.roomId.split(',');
  249. }
  250. if (opt.id) { //编辑
  251. if (opt.orderStatus) {
  252. this.orderStatus = opt.orderStatus;
  253. }
  254. this.dataForm.id = opt.id;
  255. this.getInfo2()
  256. } else {
  257. //新增获取简单信息
  258. this.getInfo();
  259. }
  260. // 当前日期
  261. let myDate = new Date();
  262. let year = myDate.getFullYear();
  263. let mon = myDate.getMonth() + 1;
  264. let day = myDate.getDate();
  265. mon = mon > 9 ? mon : '0' + mon;
  266. day = day > 9 ? day : '0' + day;
  267. this.currentDate = year + '-' + mon + '-' + day;
  268. },
  269. watch: {
  270. // 'dataForm.detailFormList': {
  271. // handler(newVal, oldVal) {
  272. // let disp = newVal[0].roomAmount - this.oldVal;
  273. // console.log(disp)
  274. // console.log(this.totalMOney)
  275. // console.log(newVal[0].roomAmount)
  276. // this.oldval = newVal[0].roomAmount; //上一次价格
  277. // this.totalMOney += parseFloat(disp);
  278. // },
  279. // deep: true
  280. // }
  281. },
  282. methods: {
  283. compoutPrice(e) {
  284. this.dealTotalMoney();
  285. },
  286. dealTotalMoney() {
  287. let fjMoney = parseFloat(this.dataForm.detailFormList[0].roomAmount) || 0;
  288. let bdList = this.dataForm.detailFormList[0].breakfastData;
  289. let bdMoney = bdList.reduce((cur, pre) => cur + pre.price * pre.num, 0);
  290. let odList = this.dataForm.detailFormList[0].otherData;
  291. let odMoney = odList.reduce((cur, pre) => cur + pre.defaultPrice * pre.num, 0);
  292. let frList = this.dataForm.flowRecord;
  293. let frMoney = frList.reduce((cur, pre) => cur + (parseFloat(pre.amount) || 0), 0);
  294. // this.totalMOney = fjMoney+bdMoney+odMoney-frMoney;
  295. this.totalMOney = fjMoney + bdMoney + odMoney;
  296. },
  297. showPick() {
  298. this.leaveDateShow = true;
  299. this.$refs.picker.innerValue = new Date().getTime()
  300. },
  301. //i计算天数
  302. getDaysBetween(dateString1, dateString2) {
  303. var startDate = Date.parse(dateString1);
  304. var endDate = Date.parse(dateString2);
  305. if (startDate > endDate) {
  306. return 0;
  307. }
  308. if (startDate == endDate) {
  309. return 1;
  310. }
  311. var days = (endDate - startDate) / (1 * 24 * 60 * 60 * 1000);
  312. this.dataForm.num = days;
  313. //return days;
  314. },
  315. credentialsConfirmtime(e) {
  316. // 创建一个Date对象并传入时间戳
  317. const date = new Date(e.value);
  318. // 使用Date对象的方法获取年、月、日、小时、分钟和秒
  319. const year = date.getFullYear();
  320. const month = ('0' + (date.getMonth() + 1)).slice(-2);
  321. const day = ('0' + date.getDate()).slice(-2);
  322. // 格式化时间
  323. const formattedTime = `${year}-${month}-${day}`;
  324. this.dataForm.leaveDate = formattedTime;
  325. this.getDaysBetween(this.dataForm.arriveDate, this.dataForm.leaveDate);
  326. this.leaveDateShow = false;
  327. },
  328. compareDate(data) {
  329. let data2 = data.substring(0, 10);
  330. if (
  331. new Date(data2).getTime() < new Date(this.currentDate).getTime()
  332. ) {
  333. this.today = -1;
  334. }
  335. if (
  336. new Date(data2).getTime() == new Date(this.currentDate).getTime()
  337. ) {
  338. this.today = 1;
  339. }
  340. if (
  341. new Date(data2).getTime() > new Date(this.currentDate).getTime()
  342. ) {
  343. this.today = 2;
  344. }
  345. },
  346. //添加入住人
  347. goStayCheck() {
  348. let list = JSON.stringify(this.dataForm);
  349. uni.navigateTo({
  350. url: '/pages/house/stayCheck?orderInfo=' + list,
  351. events: {
  352. addSuccess: data => {
  353. this.dataForm.detailFormList[0].checkInPersonList = data.data || [];
  354. }
  355. },
  356. })
  357. },
  358. //添加早餐
  359. addBreast() {
  360. let list = JSON.stringify(this.dataForm.detailFormList[0].breakfastData);
  361. let list2 = JSON.stringify(this.dataForm.detailFormList[0].otherData)
  362. uni.navigateTo({
  363. url: '/pages/house/breast?list1=' + list + '&list2=' + list2,
  364. events: {
  365. addSuccess: data => {
  366. this.dataForm.detailFormList[0].breakfastData = data.data1.filter((item) => item
  367. .num && item
  368. .num != 0);
  369. this.dataForm.detailFormList[0].otherData = data.data2.filter((item) => item.num &&
  370. item.num !=
  371. 0);
  372. this.dataForm.detailFormList[0].breakfastAmount = 0;
  373. this.dataForm.detailFormList[0].otherAmount = 0;
  374. for (let i = 0; i < this.dataForm.detailFormList[0].breakfastData.length; i++) {
  375. this.dataForm.detailFormList[0].breakfastAmount += parseFloat(this.dataForm
  376. .detailFormList[0].breakfastData[i]
  377. .price) * this.dataForm.detailFormList[0].breakfastData[i].num;
  378. }
  379. for (let i = 0; i < this.dataForm.detailFormList[0].otherData.length; i++) {
  380. this.dataForm.detailFormList[0].otherAmount += parseFloat(this.dataForm
  381. .detailFormList[0].otherData[i]
  382. .defaultPrice) * this.dataForm.detailFormList[0].otherData[i].num;
  383. }
  384. this.dealTotalMoney();
  385. }
  386. }
  387. })
  388. },
  389. //添加收款
  390. addpay() {
  391. uni.navigateTo({
  392. url: '/pages/house/payAdd?money=' + this.totalMOney + '&list=' +
  393. JSON.stringify(this.dataForm.flowRecord),
  394. events: {
  395. addSuccess: data => {
  396. if (data.data.amount != 0) {
  397. this.dataForm.flowRecord = this.dataForm.flowRecord || [];
  398. this.dataForm.flowRecord.push(data.data)
  399. this.dealTotalMoney();
  400. }
  401. }
  402. }
  403. })
  404. },
  405. delPer(index) {
  406. this.dataForm.detailFormList[0].checkInPersonList.splice(index, 1)
  407. },
  408. confirmOrder(orderStatus) {
  409. console.log('0000000', orderStatus);
  410. if (!this.dataForm.guestName) {
  411. this.$showToast('请输入姓名');
  412. return
  413. }
  414. let value = this.dataForm.guestPhone;
  415. if (value.indexOf("**") > -1) {
  416. value = value.replace(/\*/g, "5");
  417. }
  418. if (!this.$u.test.mobile(value)) {
  419. this.$showToast('请输入正确手机号');
  420. return
  421. }
  422. if (!this.dataForm.guestSourceName) {
  423. this.$showToast('请选择来源');
  424. return
  425. }
  426. // if (!this.dataForm.detailFormList[0].checkInPersonList || this.dataForm.detailFormList[0].checkInPersonList
  427. // .length == 0) {
  428. // this.$showToast('请添加入住人');
  429. // return
  430. // }
  431. //orderStatus//预约入住 1,直接入住2
  432. if (orderStatus) {
  433. this.dataForm.orderStatus = orderStatus;
  434. }
  435. let url = '';
  436. if (this.dataForm.id) {
  437. url = '/merchant/hotel/order/updOrder'
  438. if (this.orderStatus) {
  439. this.dataForm.orderStatus = this.orderStatus;
  440. }
  441. } else {
  442. url = '/merchant/hotel/order/placeOrder'
  443. }
  444. //加密
  445. let newDataForm = JSON.parse(JSON.stringify(this.dataForm));
  446. if (
  447. newDataForm.guestName &&
  448. this.tempGuestName != newDataForm.guestName
  449. ) {
  450. //编辑了
  451. newDataForm.guestName = encrypt(
  452. newDataForm.guestName
  453. );
  454. } else {
  455. newDataForm.guestName = null;
  456. }
  457. if (
  458. newDataForm.guestPhone &&
  459. this.tempGuestPhone != newDataForm.guestPhone
  460. ) {
  461. newDataForm.guestPhone = encrypt(
  462. newDataForm.guestPhone
  463. );
  464. } else {
  465. newDataForm.guestPhone = null;
  466. }
  467. let checkInPersonList =
  468. newDataForm.detailFormList[0].checkInPersonList;
  469. //入住人里面身份证
  470. //let len = this.tempCheckInPersonList;
  471. checkInPersonList.forEach((element, i) => {
  472. //姓名 checkInName,idCard,checkInPhone
  473. //新增直接加密,编辑判断是否修改
  474. if (
  475. (this.tempCheckInPersonList.length == 0) || (!this.tempCheckInPersonList[i]) ||
  476. element.checkInName &&
  477. element.checkInName != this.tempCheckInPersonList[i].checkInName
  478. ) {
  479. element.checkInName = encrypt(element.checkInName);
  480. } else {
  481. element.checkInName = this.tempCheckInPersonList[i].checkInName2;
  482. }
  483. //身份证
  484. if (
  485. (this.tempCheckInPersonList.length == 0) || (!this.tempCheckInPersonList[i]) ||
  486. element.idCard &&
  487. element.idCard != this.tempCheckInPersonList[i].idCard
  488. ) {
  489. element.idCard = encrypt(element.idCard);
  490. } else {
  491. element.idCard = this.tempCheckInPersonList[i].idCard2;
  492. }
  493. //手机号
  494. if (
  495. (this.tempCheckInPersonList.length == 0) || (!this.tempCheckInPersonList[i]) ||
  496. element.checkInPhone &&
  497. element.checkInPhone != this.tempCheckInPersonList[i].checkInPhone
  498. ) {
  499. element.checkInPhone = encrypt(
  500. element.checkInPhone
  501. );
  502. } else {
  503. element.checkInPhone = this.tempCheckInPersonList[i].checkInPhone2;
  504. }
  505. });
  506. newDataForm.detailFormList[0].checkInPersonList = checkInPersonList;
  507. this.$api.post(url, newDataForm).then(res => {
  508. if (res.data.code == 0) {
  509. this.$showToast('操作成功');
  510. setTimeout(() => {
  511. uni.navigateTo({
  512. url: '/pagesMy/orderList/orderList'
  513. })
  514. }, 1500)
  515. }
  516. })
  517. },
  518. click(index) {
  519. this.dataForm.detailFormList[0].breakfastAmount -= this.dataForm.detailFormList[0].breakfastData[index]
  520. .price * this.dataForm.detailFormList[0].breakfastData[index].num;
  521. this.dataForm.detailFormList[0].breakfastData.splice(index, 1);
  522. this.dealTotalMoney();
  523. },
  524. click2(index) {
  525. this.dataForm.detailFormList[0].otherAmount -= this.dataForm.detailFormList[0].otherData[index]
  526. .defaultPrice * this.dataForm.detailFormList[0].otherData[index].num;
  527. this.dataForm.detailFormList[0].otherData.splice(index, 1);
  528. this.dealTotalMoney();
  529. },
  530. click3(index) {
  531. this.dataForm.flowRecord.splice(index, 1);
  532. this.dealTotalMoney();
  533. },
  534. getLaiyuan() {
  535. this.$api.get("/merchant/hotel/room/state/getSourceDownBox", {
  536. homestayId: this.dataForm.homestayId,
  537. })
  538. .then((res) => {
  539. if (res.data.code == 0) {
  540. this.laiyuan = [res.data.data];
  541. console.log(this.laiyuan)
  542. }
  543. });
  544. },
  545. getInfo2() { //详情信息
  546. this.$api.get('/merchant/hotel/order/getOrderDetail/' + this.dataForm.id).then(res => {
  547. if (res.data.code == 0) {
  548. this.dataForm = {
  549. ...this.dataForm,
  550. ...res.data.data,
  551. };
  552. //加密备用
  553. if (this.dataForm.detailFormList[0].checkInPersonList.length != 0) {
  554. this.tempCheckInPersonList = JSON.parse(
  555. JSON.stringify(this.dataForm.detailFormList[0].checkInPersonList)
  556. );
  557. } //入住人集合
  558. this.tempGuestName = this.dataForm.guestName;
  559. this.tempGuestPhone = this.dataForm.guestPhone;
  560. this.compareDate(this.dataForm.arriveDate);
  561. this.dataForm.detailFormList[0].checkInType = res.data.data.detailFormList[0].checkInType;
  562. this.dataForm.detailFormList[0].checkInTypeName = this.checkInType[0].filter((item => item
  563. .val == this.dataForm.detailFormList[0].checkInType))[0].label;
  564. this.totalMOney = this.dataForm.orderAmount;
  565. this.oldVal = this.totalMOney;
  566. this.dataForm.flowRecord.forEach((i, index) => {
  567. let flowTypeName = i.flowType == 1 ? '收款' : '退款';
  568. var payTypeName = '微信';
  569. if (i.payType) {
  570. payTypeName = this.flowTypeNames[i.payType - 1];
  571. }
  572. this.$set(this.dataForm.flowRecord[index], 'flowTypeName', flowTypeName)
  573. this.$set(this.dataForm.flowRecord[index], 'payTypeName', payTypeName)
  574. })
  575. }
  576. })
  577. },
  578. // 房型列表
  579. getInfo() {
  580. this.$api.post('/merchant/hotel/order/getRoomInfoList', this.roomId).then(res => {
  581. if (res.data.code == 0) {
  582. this.dataForm.detailFormList[0].roomIds = res.data.data.roomIds;
  583. this.dataForm.detailFormList[0].roomNumber = res.data.data.roomNumber;
  584. this.dataForm.detailFormList[0].checkInType = res.data.data.checkInType;
  585. this.dataForm.detailFormList[0].checkInTypeName = this.checkInType[0].filter((item => item
  586. .val == res.data.data.checkInType))[0].label;
  587. this.dataForm.detailFormList[0].roomAmount = res.data.data.roomAmount;
  588. this.dataForm.arriveDate = res.data.data.arriveDate;
  589. this.compareDate(this.dataForm.arriveDate);
  590. this.dataForm.leaveDate = res.data.data.leaveDate;
  591. this.dataForm.houseBaseId = res.data.data.houseBaseId;
  592. this.dataForm.houseBaseName = res.data.data.houseBaseName;
  593. this.dataForm.num = res.data.data.num;
  594. this.totalMOney = res.data.data.roomAmount;
  595. this.oldVal = this.totalMOney;
  596. }
  597. })
  598. },
  599. // 来源
  600. passengerConfirm(e) {
  601. this.dataForm.guestSourceId = e.value[0].id;
  602. this.dataForm.guestSourceName = e.value[0].guestSource;
  603. this.showLaiyuan = false;
  604. },
  605. //入住类型
  606. passengerConfirm2(e) {
  607. this.dataForm.detailFormList[0].checkInType = e.value[0].val;
  608. this.dataForm.detailFormList[0].checkInTypeName = e.value[0].label;
  609. this.checkInTypeShow = false;
  610. }
  611. }
  612. }
  613. </script>
  614. <style>
  615. .u-swipe-action-item__right__button__wrapper__text {
  616. font-size: 28rpx !important;
  617. }
  618. .u-cell__body__content {
  619. overflow: hidden !important;
  620. box-sizing: border-box !important;
  621. }
  622. </style>
  623. <style lang="scss" scoped>
  624. .u-swipe-action-item__right__button__wrapper {
  625. height: 36px
  626. }
  627. .u-swipe-action-item__right__button__wrapper__text {
  628. font-size: 28rpx;
  629. }
  630. .footer {
  631. position: fixed;
  632. bottom: 0;
  633. width: 100%;
  634. background-color: #fff;
  635. left: 0;
  636. z-index: 99;
  637. padding: 30rpx;
  638. box-sizing: border-box;
  639. .total {
  640. text {
  641. color: #1372FF;
  642. font-size: 32rpx;
  643. &:first-child {
  644. color: #333;
  645. }
  646. }
  647. }
  648. .btns {
  649. display: flex;
  650. justify-content: space-between;
  651. margin-top: 30rpx;
  652. text {
  653. display: inline-block;
  654. width: 48%;
  655. height: 96rpx;
  656. line-height: 96rpx;
  657. text-align: center;
  658. font-size: 34rpx;
  659. border-radius: 48rpx;
  660. border: 1rpx solid #D1D1D1;
  661. color: #999;
  662. margin: 0 3%;
  663. flex: 1;
  664. &:last-child {
  665. background-color: #1372FF;
  666. color: #fff;
  667. }
  668. }
  669. }
  670. }
  671. .u-cell__body {
  672. padding: 0 !important;
  673. }
  674. .page {
  675. background: #F3F4F4;
  676. padding-bottom: 360rpx;
  677. box-sizing: border-box;
  678. overflow-y: auto;
  679. overflow-x: auto;
  680. }
  681. .box {
  682. background-color: #fff;
  683. margin: 20rpx auto 0;
  684. border-radius: 10rpx;
  685. width: 96%;
  686. padding: 0 30rpx 30rpx;
  687. box-sizing: border-box;
  688. overflow-y: auto;
  689. overflow-x: auto;
  690. .label {
  691. color: #333;
  692. font-size: 30rpx;
  693. &.bold {
  694. font-weight: bold;
  695. font-size: 32rpx;
  696. }
  697. }
  698. &.box1 {
  699. padding: 0 30rpx;
  700. .title {
  701. text-align: right;
  702. }
  703. }
  704. .title {
  705. color: #999;
  706. }
  707. }
  708. .tit,
  709. .tit2 {
  710. font-size: 32rpx;
  711. font-weight: bold;
  712. padding-top: 30rpx;
  713. color: #333;
  714. margin-bottom: 10rpx;
  715. }
  716. .tit2 {
  717. display: flex;
  718. justify-content: space-between;
  719. align-items: center;
  720. }
  721. .goodsInfo.item {
  722. padding: 20rpx 0;
  723. text {
  724. font-size: 30rpx;
  725. }
  726. }
  727. .perItem {
  728. display: flex;
  729. align-items: center;
  730. padding: 26rpx 0;
  731. border-bottom: 1rpx solid #E1E1E1;
  732. &:last-child {
  733. border: 0;
  734. }
  735. text {
  736. font-size: 30rpx;
  737. color: #333;
  738. &:nth-of-type(2) {
  739. flex: 1;
  740. margin: 0 10rpx;
  741. }
  742. }
  743. }
  744. .dateBetween {
  745. display: flex;
  746. justify-content: space-between;
  747. align-items: center;
  748. padding: 20rpx 0 30rpx;
  749. border-bottom: 1rpx solid #E1E1E1;
  750. .start,
  751. .end {
  752. text-align: center;
  753. display: flex;
  754. flex-direction: column;
  755. justify-content: center;
  756. text {
  757. &.txt {
  758. font-size: 40rpx;
  759. font-weight: bold;
  760. margin-top: 20rpx;
  761. }
  762. }
  763. }
  764. .dateNum {
  765. text-align: center;
  766. border-radius: 30rpx;
  767. display: inline-block;
  768. width: 120rpx;
  769. height: 50rpx;
  770. line-height: 50rpx;
  771. font-size: 30rpx;
  772. color: #333;
  773. background-color: #F9FAFC;
  774. }
  775. }
  776. </style>