createOrder.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808
  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" :border="false">
  80. <text slot="icon" class="label bold">房价</text>
  81. <view slot="title" class="title">
  82. <u--input border="none" class="input" inputAlign="right" placeholderStyle="font-size:26rpx"
  83. type="textarea" placeholder="请输入" @change="compoutPrice()" v-model="dataForm.detailFormList[0].roomAmount"
  84. height="200"></u--input>
  85. </view>
  86. </u-cell>
  87. </u-cell-group>
  88. </view>
  89. <view class="box">
  90. <view class="tit tit2"><text>消费信息</text> <u-icon @click="addBreast()" name="plus-circle" label="添加消费"
  91. labelColor="#1372FF" labelSize="24" color="1372FF" size="30"></u-icon></view>
  92. <u-swipe-action>
  93. <u-swipe-action-item :show="item.show" :index="index" class=""
  94. v-for="(item, index) in dataForm.detailFormList[0].breakfastData" :key="index" @click="click(index)"
  95. :options="options">
  96. <view class="goodsInfo item">
  97. <view class="title-wrap">
  98. <text class="title u-line-2">{{item.breakfastName}}/{{item.num}}/{{item.price}}</text>
  99. </view>
  100. </view>
  101. </u-swipe-action-item>
  102. <u-swipe-action-item :show="item.show" :index="index2" class=""
  103. v-for="(item, index2) in dataForm.detailFormList[0].otherData" :key="index2" @click="click2(index2)"
  104. :options="options">
  105. <view class="goodsInfo item">
  106. <view class="title-wrap">
  107. <text class="title u-line-2">{{item.projectName}}/{{item.num}}/{{item.defaultPrice}}</text>
  108. </view>
  109. </view>
  110. </u-swipe-action-item>
  111. </u-swipe-action>
  112. </view>
  113. <view class="box">
  114. <view class="tit tit2"><text>收款信息</text> <u-icon @click="addpay()" name="plus-circle" label="添加收款"
  115. labelColor="#1372FF" labelSize="24" color="1372FF" size="30"></u-icon></view>
  116. <u-swipe-action>
  117. <u-swipe-action-item :show="item.show" :index="index" class=""
  118. v-for="(item, index) in dataForm.flowRecord" :key="index" @click="click3(index)" :options="options">
  119. <view class="goodsInfo item">
  120. <view class="title-wrap">
  121. <text
  122. class="title u-line-2">{{item.flowTypeName}}/{{item.payTypeName}}/{{item.amount}}</text>
  123. </view>
  124. </view>
  125. </u-swipe-action-item>
  126. </u-swipe-action>
  127. </view>
  128. <view class="box">
  129. <u-cell-group :border="false" customStyle="margin:0 -30rpx">
  130. <u-cell customStyle="height:88rpx" :border="false">
  131. <text slot="icon" class="label bold">备注</text>
  132. <view slot="title" class="title">
  133. <u--input border="none" class="input" inputAlign="right" placeholderStyle="font-size:26rpx"
  134. type="textarea" placeholder="请输入" v-model="dataForm.remarks" height="200"></u--input>
  135. </view>
  136. </u-cell>
  137. </u-cell-group>
  138. </view>
  139. <view class="footer">
  140. <view class="total"><text>订单金额:</text><text>¥{{totalMOney}}</text></view>
  141. <view class="btns">
  142. <text @click="confirmOrder(2)" v-if="today==1">直接入住</text>
  143. <text @click="confirmOrder(1)" v-if="!orderStatus">保存</text>
  144. <!-- 新增和编辑时由此按钮 -->
  145. </view>
  146. </view>
  147. <u-picker :itemHeight="88" :immediateChange="true" :show="showLaiyuan" :columns="laiyuan" title="来源选择"
  148. keyName="guestSource" :defaultIndex="passengerDefault" @cancel="showLaiyuan=false;"
  149. @confirm="passengerConfirm"></u-picker>
  150. <u-picker :itemHeight="88" :immediateChange="true" :show="checkInTypeShow" :columns="checkInType" title="入住类型选择"
  151. keyName="label" :defaultIndex="passengerDefault2" @cancel="checkInTypeShow=false;"
  152. @confirm="passengerConfirm2"></u-picker>
  153. </view>
  154. </template>
  155. <script>
  156. import {
  157. encrypt
  158. } from '../../utils/aes.js'
  159. export default {
  160. data() {
  161. return {
  162. credentialsDefaulttime: [10, 1, 0],
  163. titleStyle: {
  164. fontSize: '34rpx',
  165. fontWeight: "bold",
  166. },
  167. showLaiyuan: false,
  168. checkInTypeShow: false,
  169. passengerDefault: [0],
  170. passengerDefault2: [0],
  171. leaveDateShow: false,
  172. options: [{
  173. text: '删除',
  174. style: {
  175. backgroundColor: '#dd524d'
  176. }
  177. }],
  178. orderStatus: '',
  179. totalMOney: 0, //订单总金额
  180. dataForm: {
  181. arriveDate: "",
  182. detailFormList: [{
  183. breakfastAmount: 0,
  184. checkInPersonList: [],
  185. checkInType: 0,
  186. checkInTypeName: '',
  187. id: 0,
  188. otherAmount: 0,
  189. roomAmount: 0,
  190. roomIds: "",
  191. breakfastData: [],
  192. otherData: [],
  193. roomNumber: "",
  194. }],
  195. flowRecord: [],
  196. guestName: "",
  197. guestPhone: "",
  198. guestSourceId: null,
  199. guestSourceName: null,
  200. homestayId: uni.getStorageSync('homestayId'),
  201. houseBaseId: 0,
  202. houseBaseName: '',
  203. leaveDate: "",
  204. num: 0,
  205. orderStatus: null,
  206. remarks: "",
  207. },
  208. checkInType: [
  209. [{
  210. label: '正常入住',
  211. val: 1
  212. }, {
  213. label: '自用房',
  214. val: 2
  215. },
  216. {
  217. label: '免费入住',
  218. val: 3
  219. }
  220. ]
  221. ],
  222. flowTypeNames: ['微信', '支付宝', '云闪付'],
  223. roomId: '',
  224. laiyuan: [
  225. []
  226. ],
  227. currentDate: '',
  228. today: '',
  229. //加密备用
  230. tempCheckInPersonList: [],
  231. tempGuestName: null,
  232. tempGuestPhone: null,
  233. oldVal:''
  234. }
  235. },
  236. onReady() {
  237. // 微信小程序需要用此写法
  238. },
  239. onLoad(opt) {
  240. setTimeout(()=>{
  241. this.getLaiyuan();
  242. },1000)
  243. this.getLaiyuan();
  244. if (opt.roomId) {
  245. this.roomId = opt.roomId.split(',');
  246. }
  247. if (opt.id) { //编辑
  248. if (opt.orderStatus) {
  249. this.orderStatus = opt.orderStatus;
  250. }
  251. this.dataForm.id = opt.id;
  252. this.getInfo2()
  253. } else {
  254. //新增获取简单信息
  255. this.getInfo();
  256. }
  257. // 当前日期
  258. let myDate = new Date();
  259. let year = myDate.getFullYear();
  260. let mon = myDate.getMonth() + 1;
  261. let day = myDate.getDate();
  262. mon = mon > 9 ? mon : '0' + mon;
  263. day = day > 9 ? day : '0' + day;
  264. this.currentDate = year + '-' + mon + '-' + day;
  265. },
  266. watch: {
  267. // 'dataForm.detailFormList': {
  268. // handler(newVal, oldVal) {
  269. // let disp = newVal[0].roomAmount - this.oldVal;
  270. // console.log(disp)
  271. // console.log(this.totalMOney)
  272. // console.log(newVal[0].roomAmount)
  273. // this.oldval = newVal[0].roomAmount; //上一次价格
  274. // this.totalMOney += parseFloat(disp);
  275. // },
  276. // deep: true
  277. // }
  278. },
  279. methods: {
  280. compoutPrice(e){
  281. console.log(e)
  282. console.log(this.oldval)
  283. let disp = e - this.oldVal;
  284. console.log(69-169)
  285. console.log(disp)
  286. this.oldval = e; //上一次价格
  287. console.log(this.oldval)
  288. this.totalMOney += disp;
  289. },
  290. showPick() {
  291. this.leaveDateShow = true;
  292. this.$refs.picker.innerValue = new Date().getTime()
  293. },
  294. //i计算天数
  295. getDaysBetween(dateString1, dateString2) {
  296. var startDate = Date.parse(dateString1);
  297. var endDate = Date.parse(dateString2);
  298. if (startDate > endDate) {
  299. return 0;
  300. }
  301. if (startDate == endDate) {
  302. return 1;
  303. }
  304. var days = (endDate - startDate) / (1 * 24 * 60 * 60 * 1000);
  305. this.dataForm.num = days;
  306. //return days;
  307. },
  308. credentialsConfirmtime(e) {
  309. // 创建一个Date对象并传入时间戳
  310. const date = new Date(e.value);
  311. // 使用Date对象的方法获取年、月、日、小时、分钟和秒
  312. const year = date.getFullYear();
  313. const month = ('0' + (date.getMonth() + 1)).slice(-2);
  314. const day = ('0' + date.getDate()).slice(-2);
  315. // 格式化时间
  316. const formattedTime = `${year}-${month}-${day}`;
  317. this.dataForm.leaveDate = formattedTime;
  318. this.getDaysBetween(this.dataForm.arriveDate, this.dataForm.leaveDate);
  319. this.leaveDateShow = false;
  320. },
  321. compareDate(data) {
  322. let data2 = data.substring(0, 10);
  323. if (
  324. new Date(data2).getTime() < new Date(this.currentDate).getTime()
  325. ) {
  326. this.today = -1;
  327. }
  328. if (
  329. new Date(data2).getTime() == new Date(this.currentDate).getTime()
  330. ) {
  331. this.today = 1;
  332. }
  333. if (
  334. new Date(data2).getTime() > new Date(this.currentDate).getTime()
  335. ) {
  336. this.today = 2;
  337. }
  338. },
  339. //添加入住人
  340. goStayCheck() {
  341. let list = JSON.stringify(this.dataForm);
  342. uni.navigateTo({
  343. url: '/pages/house/stayCheck?orderInfo=' + list,
  344. events: {
  345. addSuccess: data => {
  346. this.dataForm.detailFormList[0].checkInPersonList = data.data || [];
  347. }
  348. },
  349. })
  350. },
  351. //添加早餐
  352. addBreast() {
  353. let list = JSON.stringify(this.dataForm.detailFormList[0].breakfastData);
  354. let list2 = JSON.stringify(this.dataForm.detailFormList[0].otherData)
  355. uni.navigateTo({
  356. url: '/pages/house/breast?list1=' + list + '&list2=' + list2,
  357. events: {
  358. addSuccess: data => {
  359. this.dataForm.detailFormList[0].breakfastData = data.data1.filter((item) => item
  360. .num && item
  361. .num != 0);
  362. this.dataForm.detailFormList[0].otherData = data.data2.filter((item) => item.num &&
  363. item.num !=
  364. 0);
  365. this.totalMOney = this.dataForm.detailFormList[0].roomAmount;
  366. this.dataForm.detailFormList[0].breakfastAmount = 0;
  367. this.dataForm.detailFormList[0].otherAmount = 0;
  368. for (let i = 0; i < this.dataForm.detailFormList[0].breakfastData.length; i++) {
  369. this.totalMOney += parseFloat(this.dataForm.detailFormList[0].breakfastData[i]
  370. .price) * this.dataForm.detailFormList[0].breakfastData[i].num;
  371. this.dataForm.detailFormList[0].breakfastAmount += parseFloat(this.dataForm
  372. .detailFormList[0].breakfastData[i]
  373. .price) * this.dataForm.detailFormList[0].breakfastData[i].num;
  374. }
  375. for (let i = 0; i < this.dataForm.detailFormList[0].otherData.length; i++) {
  376. this.totalMOney += parseFloat(this.dataForm.detailFormList[0].otherData[i]
  377. .defaultPrice) * this.dataForm.detailFormList[0].otherData[i].num;
  378. this.dataForm.detailFormList[0].otherAmount += parseFloat(this.dataForm
  379. .detailFormList[0].otherData[i]
  380. .defaultPrice) * this.dataForm.detailFormList[0].otherData[i].num;
  381. }
  382. }
  383. }
  384. })
  385. },
  386. //添加收款
  387. addpay() {
  388. uni.navigateTo({
  389. url: '/pages/house/payAdd?money=' + this.totalMOney + '&list=' +
  390. JSON.stringify(this.dataForm.flowRecord),
  391. events: {
  392. addSuccess: data => {
  393. if (data.data.amount != 0) {
  394. this.dataForm.flowRecord = this.dataForm.flowRecord || [];
  395. this.dataForm.flowRecord.push(data.data)
  396. // if(data.data.flowType==1){ //收款
  397. // this.totalMOney+=parseFloat(data.data.amount);
  398. // }else{
  399. // this.totalMOney=parseFloat(data.data.amount);
  400. // }
  401. }
  402. }
  403. }
  404. })
  405. },
  406. delPer(index) {
  407. this.dataForm.detailFormList[0].checkInPersonList.splice(index, 1)
  408. },
  409. confirmOrder(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.totalMOney -= this.dataForm.detailFormList[0].breakfastData[index].price * this.dataForm
  522. .detailFormList[0].breakfastData[index].num;
  523. this.dataForm.detailFormList[0].breakfastData.splice(index, 1);
  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.totalMOney -= this.dataForm.detailFormList[0].otherData[index].defaultPrice * this.dataForm
  529. .detailFormList[0].otherData[index].num;
  530. this.dataForm.detailFormList[0].otherData.splice(index, 1);
  531. },
  532. click3(index) {
  533. this.dataForm.flowRecord.splice(index, 1);
  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. </style>
  620. <style lang="scss" scoped>
  621. .u-swipe-action-item__right__button__wrapper {
  622. height: 36px
  623. }
  624. .u-swipe-action-item__right__button__wrapper__text {
  625. font-size: 28rpx;
  626. }
  627. .footer {
  628. position: fixed;
  629. bottom: 0;
  630. width: 100%;
  631. background-color: #fff;
  632. left: 0;
  633. z-index: 99;
  634. padding: 30rpx;
  635. box-sizing: border-box;
  636. .total {
  637. text {
  638. color: #1372FF;
  639. font-size: 32rpx;
  640. &:first-child {
  641. color: #333;
  642. }
  643. }
  644. }
  645. .btns {
  646. display: flex;
  647. justify-content: space-between;
  648. margin-top: 30rpx;
  649. text {
  650. display: inline-block;
  651. width: 48%;
  652. height: 96rpx;
  653. line-height: 96rpx;
  654. text-align: center;
  655. font-size: 34rpx;
  656. border-radius: 48rpx;
  657. border: 1rpx solid #D1D1D1;
  658. color: #999;
  659. margin: 0 3%;
  660. flex: 1;
  661. &:last-child {
  662. background-color: #1372FF;
  663. color: #fff;
  664. }
  665. }
  666. }
  667. }
  668. .u-cell__body {
  669. padding: 0 !important;
  670. }
  671. .page {
  672. background: #F3F4F4;
  673. padding-bottom: 260rpx;
  674. box-sizing: border-box;
  675. overflow-y: auto;
  676. overflow-x: auto;
  677. }
  678. .box {
  679. background-color: #fff;
  680. margin: 20rpx auto 0;
  681. border-radius: 10rpx;
  682. width: 96%;
  683. padding: 0 30rpx 30rpx;
  684. box-sizing: border-box;
  685. .label {
  686. color: #333;
  687. font-size: 30rpx;
  688. &.bold {
  689. font-weight: bold;
  690. font-size: 32rpx;
  691. }
  692. }
  693. &.box1 {
  694. padding: 0 30rpx;
  695. .title {
  696. text-align: right;
  697. }
  698. }
  699. .title {
  700. color: #999;
  701. }
  702. }
  703. .tit,
  704. .tit2 {
  705. font-size: 32rpx;
  706. font-weight: bold;
  707. padding-top: 30rpx;
  708. color: #333;
  709. margin-bottom: 10rpx;
  710. }
  711. .tit2 {
  712. display: flex;
  713. justify-content: space-between;
  714. align-items: center;
  715. }
  716. .goodsInfo.item {
  717. padding: 20rpx 0;
  718. text {
  719. font-size: 30rpx;
  720. }
  721. }
  722. .perItem {
  723. display: flex;
  724. align-items: center;
  725. padding: 26rpx 0;
  726. border-bottom: 1rpx solid #E1E1E1;
  727. &:last-child {
  728. border: 0;
  729. }
  730. text {
  731. font-size: 30rpx;
  732. color: #333;
  733. &:nth-of-type(2) {
  734. flex: 1;
  735. margin: 0 10rpx;
  736. }
  737. }
  738. }
  739. .dateBetween {
  740. display: flex;
  741. justify-content: space-between;
  742. align-items: center;
  743. padding: 20rpx 0 30rpx;
  744. border-bottom: 1rpx solid #E1E1E1;
  745. .start,
  746. .end {
  747. text-align: center;
  748. display: flex;
  749. flex-direction: column;
  750. justify-content: center;
  751. text {
  752. &.txt {
  753. font-size: 40rpx;
  754. font-weight: bold;
  755. margin-top: 20rpx;
  756. }
  757. }
  758. }
  759. .dateNum {
  760. text-align: center;
  761. border-radius: 30rpx;
  762. display: inline-block;
  763. width: 120rpx;
  764. height: 50rpx;
  765. line-height: 50rpx;
  766. font-size: 30rpx;
  767. color: #333;
  768. background-color: #F9FAFC;
  769. }
  770. }
  771. </style>