createOrder.vue 25 KB

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