createOrder.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803
  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. this.dealTotalMoney();
  282. },
  283. dealTotalMoney(){
  284. let fjMoney = parseFloat(this.dataForm.detailFormList[0].roomAmount)||0;
  285. let bdList = this.dataForm.detailFormList[0].breakfastData;
  286. let bdMoney = bdList.reduce((cur,pre)=>cur+pre.price*pre.num,0);
  287. let odList = this.dataForm.detailFormList[0].otherData;
  288. let odMoney = odList.reduce((cur,pre)=>cur+pre.defaultPrice*pre.num,0);
  289. let frList = this.dataForm.flowRecord;
  290. let frMoney = frList.reduce((cur,pre)=>cur+(parseFloat(pre.amount)||0),0);
  291. // this.totalMOney = fjMoney+bdMoney+odMoney-frMoney;
  292. this.totalMOney = fjMoney+bdMoney+odMoney;
  293. },
  294. showPick() {
  295. this.leaveDateShow = true;
  296. this.$refs.picker.innerValue = new Date().getTime()
  297. },
  298. //i计算天数
  299. getDaysBetween(dateString1, dateString2) {
  300. var startDate = Date.parse(dateString1);
  301. var endDate = Date.parse(dateString2);
  302. if (startDate > endDate) {
  303. return 0;
  304. }
  305. if (startDate == endDate) {
  306. return 1;
  307. }
  308. var days = (endDate - startDate) / (1 * 24 * 60 * 60 * 1000);
  309. this.dataForm.num = days;
  310. //return days;
  311. },
  312. credentialsConfirmtime(e) {
  313. // 创建一个Date对象并传入时间戳
  314. const date = new Date(e.value);
  315. // 使用Date对象的方法获取年、月、日、小时、分钟和秒
  316. const year = date.getFullYear();
  317. const month = ('0' + (date.getMonth() + 1)).slice(-2);
  318. const day = ('0' + date.getDate()).slice(-2);
  319. // 格式化时间
  320. const formattedTime = `${year}-${month}-${day}`;
  321. this.dataForm.leaveDate = formattedTime;
  322. this.getDaysBetween(this.dataForm.arriveDate, this.dataForm.leaveDate);
  323. this.leaveDateShow = false;
  324. },
  325. compareDate(data) {
  326. let data2 = data.substring(0, 10);
  327. if (
  328. new Date(data2).getTime() < new Date(this.currentDate).getTime()
  329. ) {
  330. this.today = -1;
  331. }
  332. if (
  333. new Date(data2).getTime() == new Date(this.currentDate).getTime()
  334. ) {
  335. this.today = 1;
  336. }
  337. if (
  338. new Date(data2).getTime() > new Date(this.currentDate).getTime()
  339. ) {
  340. this.today = 2;
  341. }
  342. },
  343. //添加入住人
  344. goStayCheck() {
  345. let list = JSON.stringify(this.dataForm);
  346. uni.navigateTo({
  347. url: '/pages/house/stayCheck?orderInfo=' + list,
  348. events: {
  349. addSuccess: data => {
  350. this.dataForm.detailFormList[0].checkInPersonList = data.data || [];
  351. }
  352. },
  353. })
  354. },
  355. //添加早餐
  356. addBreast() {
  357. let list = JSON.stringify(this.dataForm.detailFormList[0].breakfastData);
  358. let list2 = JSON.stringify(this.dataForm.detailFormList[0].otherData)
  359. uni.navigateTo({
  360. url: '/pages/house/breast?list1=' + list + '&list2=' + list2,
  361. events: {
  362. addSuccess: data => {
  363. this.dataForm.detailFormList[0].breakfastData = data.data1.filter((item) => item
  364. .num && item
  365. .num != 0);
  366. this.dataForm.detailFormList[0].otherData = data.data2.filter((item) => item.num &&
  367. item.num !=
  368. 0);
  369. this.dataForm.detailFormList[0].breakfastAmount = 0;
  370. this.dataForm.detailFormList[0].otherAmount = 0;
  371. for (let i = 0; i < this.dataForm.detailFormList[0].breakfastData.length; i++) {
  372. this.dataForm.detailFormList[0].breakfastAmount += parseFloat(this.dataForm
  373. .detailFormList[0].breakfastData[i]
  374. .price) * this.dataForm.detailFormList[0].breakfastData[i].num;
  375. }
  376. for (let i = 0; i < this.dataForm.detailFormList[0].otherData.length; i++) {
  377. this.dataForm.detailFormList[0].otherAmount += parseFloat(this.dataForm
  378. .detailFormList[0].otherData[i]
  379. .defaultPrice) * this.dataForm.detailFormList[0].otherData[i].num;
  380. }
  381. this.dealTotalMoney();
  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. this.dealTotalMoney();
  397. }
  398. }
  399. }
  400. })
  401. },
  402. delPer(index) {
  403. this.dataForm.detailFormList[0].checkInPersonList.splice(index, 1)
  404. },
  405. confirmOrder(orderStatus) {
  406. if (!this.dataForm.guestName) {
  407. this.$showToast('请输入姓名');
  408. return
  409. }
  410. let value = this.dataForm.guestPhone;
  411. if (value.indexOf("**") > -1) {
  412. value = value.replace(/\*/g, "5");
  413. }
  414. if (!this.$u.test.mobile(value)) {
  415. this.$showToast('请输入正确手机号');
  416. return
  417. }
  418. if (!this.dataForm.guestSourceName) {
  419. this.$showToast('请选择来源');
  420. return
  421. }
  422. // if (!this.dataForm.detailFormList[0].checkInPersonList || this.dataForm.detailFormList[0].checkInPersonList
  423. // .length == 0) {
  424. // this.$showToast('请添加入住人');
  425. // return
  426. // }
  427. //orderStatus//预约入住 1,直接入住2
  428. if (orderStatus) {
  429. this.dataForm.orderStatus = orderStatus;
  430. }
  431. let url = '';
  432. if (this.dataForm.id) {
  433. url = '/merchant/hotel/order/updOrder'
  434. if (this.orderStatus) {
  435. this.dataForm.orderStatus = this.orderStatus;
  436. }
  437. } else {
  438. url = '/merchant/hotel/order/placeOrder'
  439. }
  440. //加密
  441. let newDataForm = JSON.parse(JSON.stringify(this.dataForm));
  442. if (
  443. newDataForm.guestName &&
  444. this.tempGuestName != newDataForm.guestName
  445. ) {
  446. //编辑了
  447. newDataForm.guestName = encrypt(
  448. newDataForm.guestName
  449. );
  450. } else {
  451. newDataForm.guestName = null;
  452. }
  453. if (
  454. newDataForm.guestPhone &&
  455. this.tempGuestPhone != newDataForm.guestPhone
  456. ) {
  457. newDataForm.guestPhone = encrypt(
  458. newDataForm.guestPhone
  459. );
  460. } else {
  461. newDataForm.guestPhone = null;
  462. }
  463. let checkInPersonList =
  464. newDataForm.detailFormList[0].checkInPersonList;
  465. //入住人里面身份证
  466. //let len = this.tempCheckInPersonList;
  467. checkInPersonList.forEach((element, i) => {
  468. //姓名 checkInName,idCard,checkInPhone
  469. //新增直接加密,编辑判断是否修改
  470. if (
  471. (this.tempCheckInPersonList.length == 0) || (!this.tempCheckInPersonList[i]) ||
  472. element.checkInName &&
  473. element.checkInName != this.tempCheckInPersonList[i].checkInName
  474. ) {
  475. element.checkInName = encrypt(element.checkInName);
  476. } else {
  477. element.checkInName = this.tempCheckInPersonList[i].checkInName2;
  478. }
  479. //身份证
  480. if (
  481. (this.tempCheckInPersonList.length == 0) || (!this.tempCheckInPersonList[i]) ||
  482. element.idCard &&
  483. element.idCard != this.tempCheckInPersonList[i].idCard
  484. ) {
  485. element.idCard = encrypt(element.idCard);
  486. } else {
  487. element.idCard = this.tempCheckInPersonList[i].idCard2;
  488. }
  489. //手机号
  490. if (
  491. (this.tempCheckInPersonList.length == 0) || (!this.tempCheckInPersonList[i]) ||
  492. element.checkInPhone &&
  493. element.checkInPhone != this.tempCheckInPersonList[i].checkInPhone
  494. ) {
  495. element.checkInPhone = encrypt(
  496. element.checkInPhone
  497. );
  498. } else {
  499. element.checkInPhone = this.tempCheckInPersonList[i].checkInPhone2;
  500. }
  501. });
  502. newDataForm.detailFormList[0].checkInPersonList = checkInPersonList;
  503. this.$api.post(url, newDataForm).then(res => {
  504. if (res.data.code == 0) {
  505. this.$showToast('操作成功');
  506. setTimeout(() => {
  507. uni.navigateTo({
  508. url: '/pagesMy/orderList/orderList'
  509. })
  510. }, 1500)
  511. }
  512. })
  513. },
  514. click(index) {
  515. this.dataForm.detailFormList[0].breakfastAmount -= this.dataForm.detailFormList[0].breakfastData[index]
  516. .price * this.dataForm.detailFormList[0].breakfastData[index].num;
  517. this.dataForm.detailFormList[0].breakfastData.splice(index, 1);
  518. this.dealTotalMoney();
  519. },
  520. click2(index) {
  521. this.dataForm.detailFormList[0].otherAmount -= this.dataForm.detailFormList[0].otherData[index]
  522. .defaultPrice * this.dataForm.detailFormList[0].otherData[index].num;
  523. this.dataForm.detailFormList[0].otherData.splice(index, 1);
  524. this.dealTotalMoney();
  525. },
  526. click3(index) {
  527. this.dataForm.flowRecord.splice(index, 1);
  528. this.dealTotalMoney();
  529. },
  530. getLaiyuan() {
  531. this.$api.get("/merchant/hotel/room/state/getSourceDownBox", {
  532. homestayId: this.dataForm.homestayId,
  533. })
  534. .then((res) => {
  535. if (res.data.code == 0) {
  536. this.laiyuan = [res.data.data];
  537. console.log(this.laiyuan)
  538. }
  539. });
  540. },
  541. getInfo2() { //详情信息
  542. this.$api.get('/merchant/hotel/order/getOrderDetail/' + this.dataForm.id).then(res => {
  543. if (res.data.code == 0) {
  544. this.dataForm = {
  545. ...this.dataForm,
  546. ...res.data.data,
  547. };
  548. //加密备用
  549. if (this.dataForm.detailFormList[0].checkInPersonList.length != 0) {
  550. this.tempCheckInPersonList = JSON.parse(
  551. JSON.stringify(this.dataForm.detailFormList[0].checkInPersonList)
  552. );
  553. } //入住人集合
  554. this.tempGuestName = this.dataForm.guestName;
  555. this.tempGuestPhone = this.dataForm.guestPhone;
  556. this.compareDate(this.dataForm.arriveDate);
  557. this.dataForm.detailFormList[0].checkInType = res.data.data.detailFormList[0].checkInType;
  558. this.dataForm.detailFormList[0].checkInTypeName = this.checkInType[0].filter((item => item
  559. .val == this.dataForm.detailFormList[0].checkInType))[0].label;
  560. this.totalMOney = this.dataForm.orderAmount;
  561. this.oldVal = this.totalMOney;
  562. this.dataForm.flowRecord.forEach((i, index) => {
  563. let flowTypeName = i.flowType == 1 ? '收款' : '退款';
  564. var payTypeName = '微信';
  565. if (i.payType) {
  566. payTypeName = this.flowTypeNames[i.payType - 1];
  567. }
  568. this.$set(this.dataForm.flowRecord[index], 'flowTypeName', flowTypeName)
  569. this.$set(this.dataForm.flowRecord[index], 'payTypeName', payTypeName)
  570. })
  571. }
  572. })
  573. },
  574. // 房型列表
  575. getInfo() {
  576. this.$api.post('/merchant/hotel/order/getRoomInfoList', this.roomId).then(res => {
  577. if (res.data.code == 0) {
  578. this.dataForm.detailFormList[0].roomIds = res.data.data.roomIds;
  579. this.dataForm.detailFormList[0].roomNumber = res.data.data.roomNumber;
  580. this.dataForm.detailFormList[0].checkInType = res.data.data.checkInType;
  581. this.dataForm.detailFormList[0].checkInTypeName = this.checkInType[0].filter((item => item
  582. .val == res.data.data.checkInType))[0].label;
  583. this.dataForm.detailFormList[0].roomAmount = res.data.data.roomAmount;
  584. this.dataForm.arriveDate = res.data.data.arriveDate;
  585. this.compareDate(this.dataForm.arriveDate);
  586. this.dataForm.leaveDate = res.data.data.leaveDate;
  587. this.dataForm.houseBaseId = res.data.data.houseBaseId;
  588. this.dataForm.houseBaseName = res.data.data.houseBaseName;
  589. this.dataForm.num = res.data.data.num;
  590. this.totalMOney = res.data.data.roomAmount;
  591. this.oldVal = this.totalMOney;
  592. }
  593. })
  594. },
  595. // 来源
  596. passengerConfirm(e) {
  597. this.dataForm.guestSourceId = e.value[0].id;
  598. this.dataForm.guestSourceName = e.value[0].guestSource;
  599. this.showLaiyuan = false;
  600. },
  601. //入住类型
  602. passengerConfirm2(e) {
  603. this.dataForm.detailFormList[0].checkInType = e.value[0].val;
  604. this.dataForm.detailFormList[0].checkInTypeName = e.value[0].label;
  605. this.checkInTypeShow = false;
  606. }
  607. }
  608. }
  609. </script>
  610. <style>
  611. .u-swipe-action-item__right__button__wrapper__text {
  612. font-size: 28rpx !important;
  613. }
  614. </style>
  615. <style lang="scss" scoped>
  616. .u-swipe-action-item__right__button__wrapper {
  617. height: 36px
  618. }
  619. .u-swipe-action-item__right__button__wrapper__text {
  620. font-size: 28rpx;
  621. }
  622. .footer {
  623. position: fixed;
  624. bottom: 0;
  625. width: 100%;
  626. background-color: #fff;
  627. left: 0;
  628. z-index: 99;
  629. padding: 30rpx;
  630. box-sizing: border-box;
  631. .total {
  632. text {
  633. color: #1372FF;
  634. font-size: 32rpx;
  635. &:first-child {
  636. color: #333;
  637. }
  638. }
  639. }
  640. .btns {
  641. display: flex;
  642. justify-content: space-between;
  643. margin-top: 30rpx;
  644. text {
  645. display: inline-block;
  646. width: 48%;
  647. height: 96rpx;
  648. line-height: 96rpx;
  649. text-align: center;
  650. font-size: 34rpx;
  651. border-radius: 48rpx;
  652. border: 1rpx solid #D1D1D1;
  653. color: #999;
  654. margin: 0 3%;
  655. flex: 1;
  656. &:last-child {
  657. background-color: #1372FF;
  658. color: #fff;
  659. }
  660. }
  661. }
  662. }
  663. .u-cell__body {
  664. padding: 0 !important;
  665. }
  666. .page {
  667. background: #F3F4F4;
  668. padding-bottom: 260rpx;
  669. box-sizing: border-box;
  670. overflow-y: auto;
  671. overflow-x: auto;
  672. }
  673. .box {
  674. background-color: #fff;
  675. margin: 20rpx auto 0;
  676. border-radius: 10rpx;
  677. width: 96%;
  678. padding: 0 30rpx 30rpx;
  679. box-sizing: border-box;
  680. .label {
  681. color: #333;
  682. font-size: 30rpx;
  683. &.bold {
  684. font-weight: bold;
  685. font-size: 32rpx;
  686. }
  687. }
  688. &.box1 {
  689. padding: 0 30rpx;
  690. .title {
  691. text-align: right;
  692. }
  693. }
  694. .title {
  695. color: #999;
  696. }
  697. }
  698. .tit,
  699. .tit2 {
  700. font-size: 32rpx;
  701. font-weight: bold;
  702. padding-top: 30rpx;
  703. color: #333;
  704. margin-bottom: 10rpx;
  705. }
  706. .tit2 {
  707. display: flex;
  708. justify-content: space-between;
  709. align-items: center;
  710. }
  711. .goodsInfo.item {
  712. padding: 20rpx 0;
  713. text {
  714. font-size: 30rpx;
  715. }
  716. }
  717. .perItem {
  718. display: flex;
  719. align-items: center;
  720. padding: 26rpx 0;
  721. border-bottom: 1rpx solid #E1E1E1;
  722. &:last-child {
  723. border: 0;
  724. }
  725. text {
  726. font-size: 30rpx;
  727. color: #333;
  728. &:nth-of-type(2) {
  729. flex: 1;
  730. margin: 0 10rpx;
  731. }
  732. }
  733. }
  734. .dateBetween {
  735. display: flex;
  736. justify-content: space-between;
  737. align-items: center;
  738. padding: 20rpx 0 30rpx;
  739. border-bottom: 1rpx solid #E1E1E1;
  740. .start,
  741. .end {
  742. text-align: center;
  743. display: flex;
  744. flex-direction: column;
  745. justify-content: center;
  746. text {
  747. &.txt {
  748. font-size: 40rpx;
  749. font-weight: bold;
  750. margin-top: 20rpx;
  751. }
  752. }
  753. }
  754. .dateNum {
  755. text-align: center;
  756. border-radius: 30rpx;
  757. display: inline-block;
  758. width: 120rpx;
  759. height: 50rpx;
  760. line-height: 50rpx;
  761. font-size: 30rpx;
  762. color: #333;
  763. background-color: #F9FAFC;
  764. }
  765. }
  766. </style>