BillRoomInfo.vue 80 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400
  1. <template>
  2. <div>
  3. <div class="tab_height" style="display: flex; gap: 15px">
  4. <div style="width: 33%">
  5. <div style="display: flex; justify-content: space-between">
  6. <h4
  7. style="
  8. color: rgba(255, 141, 26, 1);
  9. font-weight: 600;
  10. margin-top: 15px;
  11. "
  12. >
  13. 入住信息
  14. </h4>
  15. <div style="display: flex">
  16. <div
  17. style="display: flex; flex-direction: column"
  18. v-if="chooseLivingRoom.livingOrder && chooseLivingRoom.livingOrder.settleType == -1 && !chooseLivingRoom.isMain && tabSelectRoomId !== 1"
  19. @click="changeMainRoom">
  20. <a-icon
  21. type="clock-circle"
  22. style="color: rgba(255, 141, 26, 1); font-size: 18px"/>
  23. <a-button type="link"> 改为主房 </a-button>
  24. </div>
  25. <div style="display: flex; flex-direction: column" @click="puls()" v-if="isLiving">
  26. <a-icon
  27. type="clock-circle"
  28. style="color: rgba(255, 141, 26, 1); font-size: 18px"
  29. /><a-button type="link"> 叫醒服务 </a-button>
  30. </div>
  31. <div style="display: flex; flex-direction: column" @click="splitLiving" v-if="model.livingRoomIds.length > 2">
  32. <a-icon
  33. type="compass"
  34. style="color: rgba(255, 141, 26, 1); font-size: 18px"
  35. /><a-button
  36. type="link"
  37. :disabled="selectRoomId == '1'"
  38. >
  39. 拆分房间
  40. </a-button>
  41. </div>
  42. </div>
  43. </div>
  44. <a-divider />
  45. <a-tabs @change="tabChange" v-model="tabSelectRoomId">
  46. <a-tab-pane
  47. :key="item.roomId"
  48. v-for="(item, livingIndex) in model.livingRoomIds"
  49. >
  50. <span slot="tab">
  51. {{ item.roomName }}
  52. <a-badge
  53. dot
  54. :number-style="{ backgroundColor: '#52c41a' }"
  55. v-if="item.livingOrder && item.livingOrder.settleType == 1"
  56. >
  57. <span style="font-size: 12px">已结退房</span>
  58. </a-badge>
  59. <a-badge
  60. dot
  61. :number-style="{ backgroundColor: '#52c41a' }"
  62. v-if="item.livingOrder && item.livingOrder.settleType == 2"
  63. >
  64. <span style="font-size: 12px">未结退房</span>
  65. </a-badge>
  66. <span v-if="item.isMain && item.roomId !=='1' ">(主房间)</span>
  67. </span>
  68. <a-descriptions :column="2">
  69. <a-descriptions-item label="主客姓名">
  70. {{
  71. item.livingCustomers && item.livingCustomers[0]
  72. ? item.livingCustomers[0].customerName
  73. : "--"
  74. }}
  75. <a-icon
  76. v-if="livingIndex > 0 && isLiving"
  77. @click="editCustomer(item)"
  78. type="edit"
  79. style="color: rgba(255, 141, 26, 1); font-size: 18px"
  80. /></a-descriptions-item>
  81. <a-descriptions-item label="性别">
  82. {{
  83. item.livingCustomers && item.livingCustomers[0]
  84. ? item.livingCustomers[0].gender === 1
  85. ? "男"
  86. : "女"
  87. : "--"
  88. }}</a-descriptions-item
  89. >
  90. <a-descriptions-item label="房间数量">
  91. {{ livingIndex == 0 ? model.livingRoomIds.length - 1 : 1 }}间
  92. </a-descriptions-item>
  93. <a-descriptions-item label="手机号">
  94. {{
  95. item.livingCustomers && item.livingCustomers[0]
  96. ? item.livingCustomers[0].phone
  97. : "--"
  98. }}
  99. <a-icon
  100. v-if="livingIndex > 0 && isLiving"
  101. @click="editCustomer(item)"
  102. type="edit"
  103. style="color: rgba(255, 141, 26, 1); font-size: 18px"
  104. /></a-descriptions-item>
  105. <a-descriptions-item label="宾客类型">
  106. {{ customerTypeName( item.livingOrder && item.livingOrder.customerType) }}
  107. <a-icon
  108. v-if="livingIndex > 0 && isLiving"
  109. @click="editCustomerType(item)"
  110. type="edit"
  111. style="color: rgba(255, 141, 26, 1); font-size: 18px"
  112. /></a-descriptions-item>
  113. <a-descriptions-item label="入住时间">
  114. {{ item.livingOrder && item.livingOrder.arrivalTime }}
  115. </a-descriptions-item>
  116. <a-descriptions-item label="房价方案"> -- </a-descriptions-item>
  117. <a-descriptions-item label="预离时间">
  118. {{ item.livingOrder && item.livingOrder.dueOutTime }}
  119. </a-descriptions-item>
  120. <a-descriptions-item label="订单来源">
  121. {{ customerSourceName( item.livingOrder && item.livingOrder.customerSource) }}
  122. <a-icon
  123. v-if="livingIndex > 0 && isLiving"
  124. @click="editCustomerSource(item)"
  125. type="edit"
  126. style="color: rgba(255, 141, 26, 1); font-size: 18px"
  127. /></a-descriptions-item>
  128. <a-descriptions-item label="入住类型">
  129. {{ getlivingTypeText( item.livingOrder && item.livingOrder.livingType) }}
  130. <a-icon
  131. v-if="livingIndex > 0 && isLiving"
  132. @click="editBookingType(item)"
  133. type="edit"
  134. style="color: rgba(255, 141, 26, 1); font-size: 18px"
  135. />
  136. </a-descriptions-item>
  137. <a-descriptions-item label="入住天数" v-if="item.livingOrder.livingType !== 5">
  138. {{ item.livingOrder && item.livingOrder.dayCount }}
  139. </a-descriptions-item>
  140. <a-descriptions-item label="剩余天数" v-else>
  141. {{ moment(item.livingOrder.dueOutTime).diff(moment(new Date()), 'day') }}
  142. </a-descriptions-item>
  143. <a-descriptions-item label="早餐券">
  144. {{ item.livingOrder && item.livingOrder.breakfastNum }}
  145. <a-icon
  146. v-if="livingIndex > 0 && isLiving"
  147. @click="editBreakfastNum(item)"
  148. type="edit"
  149. style="color: rgba(255, 141, 26, 1); font-size: 18px"
  150. />
  151. </a-descriptions-item>
  152. <a-descriptions-item label="外部单号">
  153. {{ item.livingOrder && model.orderInfo.outerOrdersNo }}
  154. </a-descriptions-item>
  155. <a-descriptions-item label="销售员工">
  156. {{ warranterName( item.livingOrder && item.livingOrder.warranter) }}
  157. <a-icon
  158. v-if="livingIndex > 0 && isLiving"
  159. @click="editWarranter(item)"
  160. type="edit"
  161. style="color: rgba(255, 141, 26, 1); font-size: 18px"
  162. /></a-descriptions-item>
  163. <a-descriptions-item label="订单备注" :span="2">
  164. {{ item.livingOrder && item.livingOrder.remark
  165. }}<a-icon
  166. v-if="livingIndex > 0 && isLiving"
  167. @click="editRemark(item)"
  168. type="edit"
  169. style="color: rgba(255, 141, 26, 1); font-size: 18px"
  170. />
  171. </a-descriptions-item>
  172. <template
  173. v-if="
  174. wakeList.filter((item) => {
  175. return tabSelectRoomId == 1
  176. ? item
  177. : tabSelectRoomId == item.roomId;
  178. }).length == 0
  179. "
  180. >
  181. <a-descriptions-item label="叫醒服务" :span="2">
  182. <a-icon
  183. v-if="isLiving"
  184. type="plus-circle"
  185. class="dynamic-delete-button"
  186. @click="puls()"
  187. />
  188. </a-descriptions-item>
  189. </template>
  190. <template v-else>
  191. <a-descriptions-item
  192. label="叫醒服务"
  193. :span="2"
  194. v-for="(item, index) in wakeList.filter((item) => {
  195. return tabSelectRoomId == 1
  196. ? item
  197. : tabSelectRoomId == item.roomId;
  198. })"
  199. :key="index"
  200. >
  201. {{ item.roomName }}
  202. {{ item.jxDate ? item.jxDate + " /" : "" }} {{ item.jxTime }}
  203. <a-icon
  204. v-if="
  205. wakeList.filter((item) => {
  206. return tabSelectRoomId == 1
  207. ? item
  208. : tabSelectRoomId == item.roomId;
  209. }).length -
  210. 1 ==
  211. index
  212. "
  213. type="plus-circle"
  214. class="dynamic-delete-button"
  215. @click="puls()"
  216. />
  217. <a-icon
  218. type="minus-circle"
  219. style="color: #f56c6c"
  220. class="dynamic-delete-button"
  221. @click="removeWakeService(item.id)"
  222. />
  223. </a-descriptions-item>
  224. </template>
  225. <!-- 留言-->
  226. <template>
  227. </template>
  228. <a-descriptions-item
  229. label="留言"
  230. :span="2"
  231. v-for="(item, index) in messageList.filter((item) => {
  232. return tabSelectRoomId == 1
  233. ? item
  234. : tabSelectRoomId == item.roomId;
  235. })"
  236. :key="index"
  237. >
  238. {{ item.contentBody }}
  239. </a-descriptions-item>
  240. </a-descriptions>
  241. <div style="display: flex; justify-content: space-between">
  242. <h4
  243. style="
  244. color: rgba(255, 141, 26, 1);
  245. font-weight: 600;
  246. margin-top: 15px;
  247. "
  248. >
  249. 同住人
  250. </h4>
  251. <div style="display: flex">
  252. <div style="display: flex; flex-direction: column">
  253. <a-icon
  254. type="user-add"
  255. style="color: rgba(255, 141, 26, 1); font-size: 18px"
  256. /><a-button
  257. type="link"
  258. @click="addlivingCustomer(item.livingOrder.id, item.roomId)"
  259. >
  260. 添加
  261. </a-button>
  262. </div>
  263. </div>
  264. </div>
  265. <a-row v-for="(fItem, index) in addPeopleList" :key="index" style="margin-bottom:10px;">
  266. <a-col :span="5">
  267. <a-auto-complete
  268. v-model="fItem.customerName"
  269. placeholder="姓名"
  270. @search="handleSearch"
  271. @select="(e) => handleSelectMember(e,index)"
  272. >
  273. <template slot="dataSource">
  274. <a-select-option
  275. v-for="item in customerList"
  276. :key="item.id"
  277. >{{ item.name }}-{{ item.phone }}</a-select-option
  278. >
  279. </template>
  280. </a-auto-complete>
  281. </a-col>
  282. <a-col :span="5">
  283. <a-radio-group v-model="fItem.gender">
  284. <a-radio :value="1" style="margin-right: 0px">男</a-radio>
  285. <a-radio :value="2" style="margin-right: 0px">女</a-radio>
  286. </a-radio-group>
  287. </a-col>
  288. <a-col :span="6">
  289. <a-input
  290. v-model="fItem.certNo"
  291. placeholder="请输入证件号"
  292. ></a-input>
  293. </a-col>
  294. <a-col :span="5">
  295. <a-input
  296. v-model="fItem.phone"
  297. placeholder="请输入手机号"
  298. ></a-input>
  299. </a-col>
  300. <a-col :span="3">
  301. <a-icon @click="savePeople(fItem)" style="color:bule;" class="dynamic-delete-button" type="check-circle" />
  302. <a-icon @click="cancelPeople(index)" style="color: #f56c6c" class="dynamic-delete-button" type="close-circle" />
  303. </a-col>
  304. <a-col :span="21">
  305. <a-input v-model="fItem.address" placeholder="请输入地址" style="width: 70%;"></a-input>
  306. <a-button type="primary" ghost style="width: 20%; margin-left: 20px">读卡</a-button>
  307. </a-col>
  308. </a-row>
  309. <div id="livingCustomers-grid">
  310. <a-row
  311. v-for="(customer, index) in item.livingCustomers"
  312. :key="customer.id"
  313. >
  314. <template v-if="index > 0">
  315. <a-col :span="6">
  316. ({{ getRoomName(customer.roomId) }}){{
  317. customer.customerName
  318. }}
  319. </a-col>
  320. <a-col
  321. :span="2"
  322. >{{ customer.gender == 1 ? "男" : "女" }}
  323. </a-col>
  324. <a-col :span="8"> {{ customer.certNo || "--" }}</a-col>
  325. <a-col :span="6"> {{ customer.phone }}</a-col>
  326. <a-col :span="2">
  327. <a-icon
  328. type="minus-circle"
  329. style="color: #f56c6c"
  330. class="dynamic-delete-button"
  331. @click="() => removeLivingCustomer(customer.id)"
  332. /></a-col>
  333. </template>
  334. </a-row>
  335. </div>
  336. </a-tab-pane>
  337. </a-tabs>
  338. <template v-if="vipCustomer && vipCustomer.id">
  339. <h4
  340. style="
  341. color: rgba(255, 141, 26, 1);
  342. font-weight: 600;
  343. margin-top: 50px;
  344. "
  345. >
  346. 会员信息
  347. </h4>
  348. <a-divider />
  349. <a-descriptions :column="2">
  350. <a-descriptions-item label="姓名">
  351. {{ vipCustomer.name }}
  352. </a-descriptions-item>
  353. <a-descriptions-item
  354. label="证件号"
  355. >{{ vipCustomer.certificateNo }}
  356. </a-descriptions-item>
  357. <a-descriptions-item label="卡号">
  358. {{ vipCustomer.cardNo }}
  359. </a-descriptions-item>
  360. <a-descriptions-item label="手机号">
  361. {{ vipCustomer.mobile }}
  362. </a-descriptions-item>
  363. <a-descriptions-item label="会员级别">
  364. {{ vipCustomer.gradeName }}
  365. </a-descriptions-item>
  366. <a-descriptions-item
  367. label="余额"
  368. >{{ vipCustomer.balance.toFixed(2) }} 元
  369. </a-descriptions-item>
  370. <a-descriptions-item label="积分">
  371. {{ vipCustomer.integral }} 分
  372. </a-descriptions-item>
  373. </a-descriptions></template
  374. >
  375. </div>
  376. <div style="width: 51%">
  377. <div style="display: flex; justify-content: space-between">
  378. <h4
  379. style="
  380. color: rgba(255, 141, 26, 1);
  381. font-weight: 600;
  382. margin-top: 15px;
  383. "
  384. >
  385. 消费详情
  386. </h4>
  387. <div style="display: flex">
  388. <div
  389. @click="meterReading"
  390. :class="`${isLiving && selectRoomId != '1' && chooseLivingRoom.livingOrder && chooseLivingRoom.livingOrder.livingType === 5 ? '' : 'disabled'}`"
  391. style="display: flex; flex-direction: column">
  392. <a-icon
  393. type="pound"
  394. style="color: rgba(255, 141, 26, 1); font-size: 18px"
  395. /><a-button
  396. type="link">
  397. 抄表
  398. </a-button>
  399. </div>
  400. <div
  401. @click="strikeBalance"
  402. :class="`${isLiving ? '' : 'disabled'}`"
  403. style="display: flex; flex-direction: column">
  404. <a-icon
  405. type="pound"
  406. style="color: rgba(255, 141, 26, 1); font-size: 18px"
  407. /><a-button
  408. type="link"
  409. >
  410. 冲账
  411. </a-button>
  412. </div>
  413. <div
  414. @click="addProjectFee"
  415. style="display: flex; flex-direction: column"
  416. :class="`${selectRoomId == '1' || chooseLivingRoom.livingOrder && chooseLivingRoom.livingOrder.settleType !== -1 ? 'disabled' : ''}`">
  417. <a-icon
  418. type="tool"
  419. style="color: rgba(255, 141, 26, 1); font-size: 18px"
  420. /><a-button
  421. type="link"
  422. >
  423. 增加消费
  424. </a-button>
  425. </div>
  426. <div :class="`${isLiving ? '' : 'disabled'}`" style="display: flex; flex-direction: column">
  427. <a-icon
  428. type="property-safety"
  429. style="color: rgba(255, 141, 26, 1); font-size: 18px"
  430. /><a-button
  431. type="link"
  432. @click="partialSettle"
  433. >
  434. 部分结账
  435. </a-button>
  436. </div>
  437. </div>
  438. </div>
  439. <a-divider style="margin-bottom: 0px" />
  440. <a-tabs :v-model="active" @change="tabFeeChange" style="padding-top: 0px">
  441. <a-tab-pane tab="全部账单" key="0" :forceRender="true">
  442. <a-table
  443. :columns="columns0"
  444. :data-source="entiretyList"
  445. :pagination="false"
  446. :scroll="{ y: 160 }"
  447. rowKey="id"
  448. :rowSelection="{
  449. consumSelectedRowKeys: consumSelectedRowKeys,
  450. onChange: onSelectChange,
  451. }"
  452. >
  453. <template #default="{ record }">
  454. <a-table-column
  455. title="Selection"
  456. key="selection"
  457. align="center"
  458. >
  459. <a-checkbox :disabled="record.preferentialStatus === 2" />
  460. </a-table-column>
  461. <!-- 其他列 -->
  462. </template>
  463. <template slot="subjectType" slot-scope="text, record, index" class="strike_style">
  464. <span class="strike_style" v-if="record.returnItem">{{ getSubjectTypeText(text,record) }}</span>
  465. <span v-else>{{ getSubjectTypeText(text,record) }}</span>
  466. </template>
  467. <template slot="roomId" slot-scope="text, record, index">
  468. <span class="strike_style" v-if="record.returnItem">{{ getRoomName(text) }}</span>
  469. <span v-else>{{ getRoomName(text) }}</span>
  470. </template>
  471. <template slot="dayTime" slot-scope="text, record, index" class="strike_style">
  472. <span class="strike_style" v-if="record.returnItem">{{ record.dayTime || record.createTime }}</span>
  473. <span v-else>{{ record.dayTime || record.createTime }}</span>
  474. </template>
  475. <!-- 单价-->
  476. <template slot="originalPrice" slot-scope="text, record, index" class="strike_style">
  477. <span class="strike_style" v-if="record.returnItem">--</span>
  478. <span v-else-if="record.subjectType === 6 || record.subjectType === 7">{{ record.feeGoodVo.originalPrice ? record.feeGoodVo.originalPrice : record.originalMoney }}</span>
  479. <span v-else>{{ record.subjectType === 11 && record.longRentMeterLog.price ? record.longRentMeterLog.price : record.originalMoney }}</span>
  480. </template>
  481. <!--优惠价-->
  482. <template slot="money" slot-scope="text, record, index" class="strike_style">
  483. <span class="strike_style" v-if="record.returnItem">--</span>
  484. <span v-else-if="record.subjectType === 6 || record.subjectType === 7" >{{ record.feeGoodVo.price ? record.feeGoodVo.price : record.originalMoney }}</span>
  485. <span v-else-if="record.subjectType === 11 && record.longRentMeterLog.price">{{ record.longRentMeterLog.price }}</span>
  486. <span v-else>{{ record.originalMoney }}</span>
  487. </template>
  488. <template slot="num" slot-scope="text, record, index" class="strike_style">
  489. <span class="strike_style" v-if="record.returnItem">{{ record.returnNum }}</span>
  490. <span v-else-if="record.subjectType === 6 || record.subjectType === 7">{{ record.feeGoodVo.num ? record.feeGoodVo.num : 1 }}</span>
  491. <span v-else>{{ record.subjectType === 11 && record.longRentMeterLog.startRead ? Math.abs(record.longRentMeterLog.startRead - record.longRentMeterLog.endRead).toFixed(2) : '1' }}</span>
  492. </template>
  493. <!-- 小计 -->
  494. <template slot="originalMoney" slot-scope="text, record, index" class="strike_style">
  495. <span class="strike_style" v-if="record.returnItem">{{ record.money }}</span>
  496. <span v-else>{{ record.originalMoney }}</span>
  497. </template>
  498. <!-- <template slot="roomId" slot-scope="text, record, index" class="strike_style">
  499. {{ getRoomName(text) }}
  500. </template> -->
  501. </a-table>
  502. <div
  503. style="
  504. color: rgba(255, 87, 51, 1);
  505. font-weight: 600;
  506. text-align: right;
  507. "
  508. >
  509. 合计消费:{{ feesAmount.toFixed(2) }}
  510. </div>
  511. </a-tab-pane>
  512. <a-tab-pane tab="未结算" key="1" :forceRender="true">
  513. <a-table
  514. :columns="columns1"
  515. :data-source="feesList"
  516. :pagination="false"
  517. :scroll="{ y: 160 }"
  518. rowKey="id"
  519. :rowSelection="{
  520. consumSelectedRowKeys: consumSelectedRowKeys,
  521. onChange: onSelectChange}">
  522. <template slot="subjectType" slot-scope="text, record, index">
  523. {{ getSubjectTypeText(text,record) }}
  524. </template>
  525. <template slot="roomId" slot-scope="text, record, index">
  526. {{ getRoomName(text) }}
  527. </template>
  528. </a-table>
  529. <div
  530. style="
  531. color: rgba(255, 87, 51, 1);
  532. font-weight: 600;
  533. text-align: right;
  534. "
  535. >
  536. 合计消费:{{ unsettledAmount.toFixed(2) }}
  537. </div>
  538. </a-tab-pane>
  539. <a-tab-pane tab="已结算" key="2">
  540. <a-table
  541. :columns="columns1"
  542. :data-source="paidList"
  543. :pagination="false"
  544. :scroll="{ y: 160 }"
  545. rowKey="id"
  546. >
  547. <template slot="subjectType" slot-scope="text, record, index">
  548. {{ getSubjectTypeText(text,record) }}
  549. </template>
  550. <template slot="roomId" slot-scope="text, record, index">
  551. {{ getRoomName(text) }}
  552. </template>
  553. </a-table>
  554. <div
  555. style="
  556. color: rgba(255, 87, 51, 1);
  557. font-weight: 600;
  558. text-align: right;
  559. "
  560. >
  561. 合计消费:{{ paidAmount }}
  562. </div>
  563. </a-tab-pane>
  564. <a-tab-pane tab="冲账单" key="3">
  565. <a-table
  566. :columns="strikeColumns"
  567. :data-source="strikeList"
  568. :pagination="false"
  569. :scroll="{ y: 160 }"
  570. rowKey="id"
  571. >
  572. <template slot="subjectType" slot-scope="text, record, index">
  573. {{ getSubjectTypeText(text,record) }}
  574. </template>
  575. <template slot="roomId" slot-scope="text, record, index">
  576. {{ getRoomName(text) }}
  577. </template>
  578. </a-table>
  579. <div
  580. style="
  581. color: rgba(255, 87, 51, 1);
  582. font-weight: 600;
  583. text-align: right;
  584. "
  585. >
  586. 合计冲账:{{ strikeAmount }}
  587. </div>
  588. </a-tab-pane>
  589. </a-tabs>
  590. <div
  591. style="
  592. display: flex;
  593. justify-content: space-between;
  594. margin-top: 30px;
  595. "
  596. >
  597. <h4
  598. style="
  599. color: rgba(255, 141, 26, 1);
  600. font-weight: 600;
  601. margin-top: 15px;
  602. "
  603. >
  604. 收款详情
  605. </h4>
  606. <div style="display: flex" >
  607. <div
  608. @click="enterAccount"
  609. :class="`${isLiving ? '' : 'disabled'}`"
  610. style="display: flex; flex-direction: column">
  611. <a-icon
  612. type="transaction"
  613. style=" color: rgba(255, 141, 26, 1); font-size: 18px"
  614. /><a-button type="link" > 收款 </a-button>
  615. </div>
  616. <div
  617. @click="refund"
  618. :class="`${chooseLivingRoom.livingOrder && chooseLivingRoom.livingOrder.settleType !== -1 ? 'disabled' : ''}`"
  619. style="display: flex; flex-direction: column">
  620. <a-icon
  621. type="trademark"
  622. style="color: rgba(255, 141, 26, 1); font-size: 18px"
  623. /><a-button type="link"> 退款 </a-button>
  624. </div>
  625. </div>
  626. </div>
  627. <a-divider />
  628. <a-table
  629. :columns="columns2"
  630. :data-source="paymentList"
  631. :pagination="false"
  632. :scroll="{ y: 160 }"
  633. >
  634. <template slot="payType" slot-scope="text, record, index">
  635. {{ getPayTypeText(text) }}
  636. </template>
  637. <template slot="subjectType" slot-scope="text, record, index">
  638. {{ getSubjectTypeText(record.subjectType,record) }}
  639. </template>
  640. </a-table>
  641. <div
  642. style="
  643. color: rgba(255, 87, 51, 1);
  644. font-weight: 600;
  645. text-align: right;
  646. "
  647. >
  648. 合计收款:{{ paymentAmount.toFixed(2) }}
  649. </div>
  650. </div>
  651. <div style="width: 16%">
  652. <h4 style="color: rgba(255, 141, 26, 1); font-weight: 600">财务汇总</h4>
  653. <a-divider />
  654. <a-descriptions :column="1">
  655. <a-descriptions-item label="合计收款">
  656. + {{ paymentAmount.toFixed(2) }}
  657. </a-descriptions-item>
  658. <a-descriptions-item
  659. label="合计消费"
  660. >-{{ feesAmount.toFixed(2) }}
  661. </a-descriptions-item>
  662. <a-descriptions-item
  663. label="结账应退"
  664. v-if="paymentAmount - feesAmount > 0"
  665. >
  666. {{ (paymentAmount - feesAmount).toFixed(2) }}
  667. </a-descriptions-item>
  668. <a-descriptions-item label="结账应收" v-else>
  669. {{ (feesAmount - paymentAmount).toFixed(2) }}
  670. </a-descriptions-item>
  671. </a-descriptions>
  672. <a-button
  673. v-if="paymentAmount - feesAmount > 0"
  674. @click="handleAdd"
  675. type="danger"
  676. style="margin-left: 100px"
  677. :disabled="btnSisabled"
  678. >结账退款</a-button
  679. >
  680. <a-button
  681. v-else
  682. @click="handleAdd"
  683. type="danger"
  684. style="margin-left: 100px"
  685. :disabled="btnSisabled"
  686. >结账收款</a-button
  687. >
  688. </div>
  689. </div>
  690. <adjust-price-form ref="adjustPriceForm" @ok="modalFormOk"></adjust-price-form>
  691. <customer-modal ref="modalCustomerForm" @ok="modalFormOk"></customer-modal>
  692. <payment-modal ref="modalPaymentForm" @ok="modalFormOk"></payment-modal>
  693. <enter-account-model ref="enterAccountModel" @ok="modalFormOk"></enter-account-model>
  694. <refund-modal ref="modalRefundForm" @ok="modalFormOk"></refund-modal>
  695. <pay-or-refund-modal ref="modalPayOrRefundForm" @ok="modalFormOk"></pay-or-refund-modal>
  696. <fee-modal ref="modalFeeForm" @ok="modalFormOk"></fee-modal>
  697. <meter-reading-modal ref="modalMeterReading" @ok="modalFormOk"></meter-reading-modal>
  698. <strike-balance-model ref="modalStrikeBalanceForm" @ok="modalFormOk"></strike-balance-model>
  699. <member-message-modal ref="modalMemberMessage" @ok="modalFormOk"></member-message-modal>
  700. <lease-goods-modal ref="modalLeaseGoods" @ok="modalFormOk"></lease-goods-modal>
  701. <select-check-in-room-order-modal
  702. ref="modalSelectCheckInRoomOrder"
  703. @ok="modalFormOk"
  704. ></select-check-in-room-order-modal>
  705. <edit-customer-modal
  706. ref="modalEditCustomer"
  707. @ok="modalFormOk"
  708. ></edit-customer-modal>
  709. <edit-customer-type-modal
  710. ref="modalEditCustomerType"
  711. @ok="modalFormOk"
  712. ></edit-customer-type-modal>
  713. <edit-customer-source-modal
  714. ref="modalEditCustomerSource"
  715. @ok="modalFormOk"
  716. ></edit-customer-source-modal>
  717. <edit-warranter-modal
  718. ref="modalEditWarranter"
  719. @ok="modalFormOk"
  720. ></edit-warranter-modal>
  721. <edit-remark-modal
  722. ref="modalEditRemarkModal"
  723. @ok="modalFormOk"
  724. ></edit-remark-modal>
  725. <edit-breakfast-num-modal
  726. ref="modalEditBreakfastNumModal"
  727. @ok="modalFormOk"
  728. ></edit-breakfast-num-modal>
  729. <edit-booking-type-modal
  730. ref="modalEditBookingTypeModal"
  731. @ok="modalFormOk"
  732. ></edit-booking-type-modal>
  733. <continued-model ref="continuedModalVue" @ok="modalFormOk" ></continued-model>
  734. <batch-card-modal-copy ref="batchCardModalCopy"></batch-card-modal-copy>
  735. <!-- 叫醒服务弹窗 -->
  736. <j-modal
  737. :title="'叫醒服务'"
  738. :visible="wakeService"
  739. @cancel="wakeService = false"
  740. @ok="wakeServiceOk"
  741. destroyOnClose
  742. >
  743. <a-select
  744. style="width: 100px"
  745. placeholder="房间号"
  746. @change="onChange"
  747. v-model="wakeTime.id"
  748. >
  749. <a-select-option
  750. :value=" item.livingOrder && item.livingOrder.id"
  751. v-for="(item, index) in (model.livingRoomIds || []).filter(
  752. (item) => item.roomName != '全部'
  753. )"
  754. :key="index"
  755. >
  756. {{ item.roomName }}
  757. </a-select-option>
  758. <!-- <a-select-option value="lucy"> 1002 </a-select-option> -->
  759. </a-select>
  760. <a-date-picker
  761. style="width: 120px; margin-left: 2px"
  762. placeholder="日期"
  763. :default-value="wakeTime.date"
  764. @change="onChangeWakeService"
  765. />
  766. <a-time-picker
  767. style="width: 100px; margin-left: 2px"
  768. :default-value="moment(wakeTime.time, 'HH:mm')"
  769. format="HH:mm"
  770. @change="onChangeWakeServiceTime"
  771. />
  772. </j-modal>
  773. </div>
  774. </template>
  775. <script>
  776. import { httpAction, getAction, deleteAction, postAction } from '@/api/manage'
  777. import { validateDuplicateValue } from '@/utils/util'
  778. import moment from 'moment'
  779. import CustomerModal from './CustomerModal.vue'
  780. import RefundModal from './RefundModal.vue'
  781. import PaymentModal from './PaymentModal.vue'
  782. import FeeModal from './FeeModal'
  783. import MemberMessageModal from '@/views/room/modules/membergoodsmanage/membermessageModal'
  784. import LeaseGoodsModal from '@/views/room/modules/leasegoods/leasegoodsModal'
  785. import SelectCheckInRoomOrderModal from './SelectCheckInRoomOrderModal.vue'
  786. import EditCustomerModal from './EditCustomerModal.vue'
  787. import EditCustomerTypeModal from './EditCustomerTypeModal.vue'
  788. import EditCustomerSourceModal from './EditCustomerSourceModal.vue'
  789. import EditWarranterModal from './EditWarranterModal.vue'
  790. import EditRemarkModal from './EditRemarkModal.vue'
  791. import EditBreakfastNumModal from './EditBreakfastNumModal.vue'
  792. import EditBookingTypeModal from './EditBookingTypeModal.vue'
  793. import { match } from 'assert'
  794. import PayOrRefundModal from '@views/room/modules/checkIn/PayOrRefundModal'
  795. import AdjustPriceForm from '@views/room/modules/checkIn/AdjustPriceForm'
  796. import StrikeBalance from '@views/room/modules/checkIn/StrikeBalanceModel'
  797. import StrikeBalanceModel from '@views/room/modules/checkIn/StrikeBalanceModel'
  798. import EnterAccountModel from '@views/room/modules/checkIn/EnterAccountModel'
  799. import MeterReadingModal from '@views/room/modules/checkIn/MeterReadingModel'
  800. import ContinuedModel from '@views/room/modules/fangtaiModal/continuedModal/continuedModal'
  801. import BatchCardModalCopy from '@views/room/modules/checkIn/batchCardModalCopy'
  802. const columns0 = [
  803. {
  804. title: '房间号',
  805. dataIndex: 'roomId',
  806. width: 80,
  807. align: 'center',
  808. scopedSlots: { customRender: 'roomId' }
  809. },
  810. {
  811. title: '费项',
  812. dataIndex: 'subjectType',
  813. width: 150,
  814. align: 'center',
  815. scopedSlots: { customRender: 'subjectType' }
  816. },
  817. {
  818. title: '入账日期',
  819. dataIndex: 'dayTime',
  820. width: 180,
  821. align: 'center',
  822. scopedSlots: { customRender: 'dayTime' }
  823. // customRender: function (text, record) {
  824. // if (text !== null && text !== '') {
  825. // return record.dayTime.substring(0, 10)
  826. // }
  827. // }
  828. },
  829. {
  830. title: '单价',
  831. // dataIndex: 'money',
  832. width: 67,
  833. align: 'center',
  834. scopedSlots: { customRender: 'originalPrice' },
  835. // customRender: function (text, record) {
  836. // if ((record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.originalPrice) {
  837. // return record.feeGoodVo.originalPrice
  838. // }
  839. // return record.originalMoney
  840. // }
  841. },
  842. {
  843. title: '优惠价',
  844. align: 'center',
  845. dataIndex: 'money',
  846. scopedSlots: { customRender: 'money' },
  847. width: 67,
  848. // customRender: function (text, record) {
  849. // if ((record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.price) {
  850. // return record.feeGoodVo.price
  851. // }
  852. // return record.originalMoney
  853. // }
  854. },
  855. {
  856. title: '数量',
  857. dataIndex: 'num',
  858. width: 65,
  859. align: 'center',
  860. scopedSlots: { customRender: 'num' },
  861. // customRender: function (text, record) {
  862. // if ((record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.num) {
  863. // return record.feeGoodVo.num
  864. // }
  865. // return 1
  866. // }
  867. },
  868. {
  869. title: '小计',
  870. align: 'center',
  871. dataIndex: 'originalMoney',
  872. scopedSlots: { customRender: 'originalMoney' },
  873. width: 67
  874. },
  875. ]
  876. const columns1 = [
  877. {
  878. title: '房间号',
  879. dataIndex: 'roomId',
  880. width: 80,
  881. align: 'center',
  882. scopedSlots: { customRender: 'roomId' }
  883. },
  884. {
  885. title: '费项',
  886. dataIndex: 'subjectType',
  887. width: 150,
  888. align: 'center',
  889. scopedSlots: { customRender: 'subjectType' }
  890. },
  891. {
  892. title: '入账日期',
  893. dataIndex: 'dayTime',
  894. width: 180,
  895. align: 'center',
  896. scopedSlots: { customRender: 'dayTime' }
  897. },
  898. {
  899. title: '单价',
  900. // dataIndex: 'money',
  901. width: 67,
  902. align: 'center',
  903. // scopedSlots: { customRender: 'originalPrice' },
  904. customRender: function (text, record) {
  905. if ((record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.originalPrice) {
  906. return record.feeGoodVo.originalPrice
  907. } else if (record.subjectType === 11 && record.longRentMeterLog.price) {
  908. return record.longRentMeterLog.price
  909. }
  910. return record.originalMoney
  911. }
  912. },
  913. {
  914. title: '优惠价',
  915. align: 'center',
  916. dataIndex: 'money',
  917. // scopedSlots: { customRender: 'money' },
  918. width: 67,
  919. customRender: function (text, record) {
  920. if ((record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.price) {
  921. return record.feeGoodVo.price
  922. } else if (record.subjectType === 11 && record.longRentMeterLog.price) {
  923. return record.longRentMeterLog.price
  924. }
  925. return record.originalMoney
  926. }
  927. },
  928. {
  929. title: '数量',
  930. dataIndex: 'num',
  931. width: 65,
  932. align: 'center',
  933. // scopedSlots: { customRender: 'num' },
  934. customRender: function (text, record) {
  935. if ((record.subjectType === 6 || record.subjectType === 7) && record.feeGoodVo.num) {
  936. return record.feeGoodVo.num
  937. } else if (record.subjectType === 11 && record.longRentMeterLog.startRead) {
  938. return Math.abs(record.longRentMeterLog.startRead - record.longRentMeterLog.endRead).toFixed(2)
  939. }
  940. return 1
  941. }
  942. },
  943. {
  944. title: '小计',
  945. align: 'center',
  946. dataIndex: 'originalMoney',
  947. scopedSlots: { customRender: 'originalMoney' },
  948. width: 67
  949. },
  950. ]
  951. const columns2 = [
  952. {
  953. title: '入账时间',
  954. dataIndex: 'createTime',
  955. align: 'center',
  956. // width: 110,
  957. customRender: function (text, record) {
  958. if (text !== null && text !== '') {
  959. return record.createTime
  960. }
  961. }
  962. },
  963. {
  964. title: '支付方式',
  965. dataIndex: 'payType',
  966. align: 'center',
  967. // width: 100,
  968. scopedSlots: { customRender: 'payType' }
  969. },
  970. {
  971. title: '备注',
  972. dataIndex: 'remark',
  973. align: 'center',
  974. // width: 120,
  975. scopedSlots: { customRender: 'subjectType' }
  976. },
  977. {
  978. title: '金额',
  979. dataIndex: 'money',
  980. align: 'center',
  981. // width: 60,
  982. }
  983. ]
  984. const strikeColumns = [
  985. {
  986. title: '房间号',
  987. dataIndex: 'roomId',
  988. width: 60,
  989. align: 'center',
  990. scopedSlots: { customRender: 'roomId' }
  991. },
  992. {
  993. title: '费项',
  994. dataIndex: 'subjectType',
  995. width: 120,
  996. align: 'center',
  997. scopedSlots: { customRender: 'subjectType' }
  998. },
  999. {
  1000. title: '冲账日期',
  1001. dataIndex: 'dayTime',
  1002. width: 110,
  1003. align: 'center',
  1004. },
  1005. {
  1006. title: '冲账数量',
  1007. align: 'center',
  1008. dataIndex: 'returnNum',
  1009. width: 67,
  1010. },
  1011. {
  1012. title: '冲账金额',
  1013. align: 'center',
  1014. dataIndex: 'money',
  1015. width: 67,
  1016. customRender: function (text, record) {
  1017. return -record.money
  1018. }
  1019. }
  1020. ]
  1021. const data = []
  1022. for (let i = 0; i < 100; i++) {
  1023. data.push({
  1024. key: i,
  1025. name: `100${i}`,
  1026. age: '房费',
  1027. address: 280
  1028. })
  1029. }
  1030. const data2 = []
  1031. for (let i = 0; i < 8; i++) {
  1032. data2.push({
  1033. key: i,
  1034. name: `2023-02-0${i} 10:52`,
  1035. age: '支付宝',
  1036. remark: '押金',
  1037. amount: 888
  1038. })
  1039. }
  1040. const date = new Date()
  1041. const endDate = new Date(date.setDate(date.getDate() + 1))
  1042. export default {
  1043. name: 'BusMeetingRoomForm',
  1044. components: {
  1045. BatchCardModalCopy,
  1046. MeterReadingModal,
  1047. EnterAccountModel,
  1048. StrikeBalanceModel,
  1049. StrikeBalance,
  1050. AdjustPriceForm,
  1051. PayOrRefundModal,
  1052. CustomerModal,
  1053. RefundModal,
  1054. PaymentModal,
  1055. FeeModal,
  1056. MemberMessageModal,
  1057. LeaseGoodsModal,
  1058. SelectCheckInRoomOrderModal,
  1059. EditCustomerModal,
  1060. EditCustomerTypeModal,
  1061. EditCustomerSourceModal,
  1062. EditWarranterModal,
  1063. EditRemarkModal,
  1064. EditBreakfastNumModal,
  1065. EditBookingTypeModal,
  1066. ContinuedModel
  1067. },
  1068. props: {
  1069. // 表单禁用
  1070. disabled: {
  1071. type: Boolean,
  1072. default: false,
  1073. required: false
  1074. }
  1075. },
  1076. data() {
  1077. return {
  1078. isLiving: true,
  1079. wakeService: false,
  1080. wakeTime: {
  1081. id: '',
  1082. date: '',
  1083. time: ''
  1084. },
  1085. selectedRowKeys: [],
  1086. consumSelectedRowKeys: [],
  1087. consumSelectedRows: [],
  1088. data,
  1089. columns0,
  1090. columns1,
  1091. data2,
  1092. columns2,
  1093. strikeColumns,
  1094. wakeList: [{}],
  1095. messageList: [{}],
  1096. model: {
  1097. // data: data,
  1098. orderInfo: {},
  1099. roomIds: [],
  1100. layoutDayPrices: [],
  1101. livingRoomIds: []
  1102. },
  1103. labelCol: {
  1104. xs: { span: 24 },
  1105. sm: { span: 5 }
  1106. },
  1107. wrapperCol: {
  1108. xs: { span: 24 },
  1109. sm: { span: 16 }
  1110. },
  1111. confirmLoading: false,
  1112. validatorRules: {
  1113. dateRange: [{ required: true, message: '请选择维修时间!' }],
  1114. remark: [{ required: true, message: '请输入维修原因!' }]
  1115. },
  1116. url: {
  1117. add: '/business/busMeetingRoom/add',
  1118. edit: '/business/busMeetingRoom/edit',
  1119. queryById: '/business/busMeetingRoom/queryById',
  1120. getBookingOrderInfo:
  1121. '/business/busRoomBookingOrders/getBookingOrderInfo'
  1122. },
  1123. id: '',
  1124. roomId: '',
  1125. tabSelectRoomId: '',
  1126. customerSourceList: [],
  1127. warranterList: [],
  1128. key: 0,
  1129. // 未结算
  1130. feesList: [],
  1131. oldfeesList: [],
  1132. paymentList: [],
  1133. oldpaymentList: [],
  1134. // 已结算
  1135. paidList: [],
  1136. oldpaidList: [],
  1137. // 冲账
  1138. strikeList: [],
  1139. oldStrikeList: [],
  1140. payTypeList: [],
  1141. active: 1,
  1142. vipCustomer: {},
  1143. selectRoomId: '1',
  1144. /**
  1145. * 选中房间信息
  1146. */
  1147. chooseLivingRoom: {},
  1148. /**
  1149. * 同住人
  1150. */
  1151. addPeopleList: [],
  1152. customerList: [],
  1153. // 全部账单
  1154. entiretyList: [],
  1155. // 全部账单计算总消费金额
  1156. entiretyAmount: []
  1157. }
  1158. },
  1159. computed: {
  1160. formDisabled() {
  1161. return this.disabled
  1162. },
  1163. feesAmount() {
  1164. return this.entiretyList.filter(e => !e.returnItem).reduce(function (total, item) {
  1165. return total + item.money
  1166. }, 0)
  1167. },
  1168. /* 未结算合计 */
  1169. unsettledAmount() {
  1170. return this.feesList.reduce(function (total, item) {
  1171. return total + item.money
  1172. }, 0)
  1173. },
  1174. paidAmount() {
  1175. return this.paidList.reduce(function (total, item) {
  1176. return total + item.money
  1177. }, 0)
  1178. },
  1179. strikeAmount() {
  1180. return this.strikeList.reduce(function (total, item) {
  1181. return total - item.money
  1182. }, 0)
  1183. },
  1184. paymentAmount() {
  1185. return this.paymentList.reduce(function (total, item) {
  1186. return total + item.money
  1187. }, 0)
  1188. },
  1189. btnSisabled() {
  1190. var index = this.model.livingRoomIds.findLastIndex(
  1191. (t) => t.roomId == this.selectRoomId
  1192. )
  1193. var find = this.model.livingRoomIds[index]
  1194. if (find) {
  1195. return find.livingOrder.settleType == 1
  1196. }
  1197. return false
  1198. },
  1199. rowSelection() {
  1200. return {
  1201. onChange: (selectedRowKeys, selectedRows) => {
  1202. this.consumSelectedRowKeys = selectedRowKeys
  1203. this.consumSelectedRows = selectedRows
  1204. },
  1205. getCheckboxProps: (record) => ({
  1206. props: {
  1207. disabled: record.preferentialStatus === 2,
  1208. id: record.id
  1209. }
  1210. })
  1211. }
  1212. }
  1213. },
  1214. created() {
  1215. var _info = JSON.parse(localStorage.getItem('storeInfo'))
  1216. if (_info) {
  1217. this.model.hotelId = _info.id
  1218. }
  1219. // 备份model原始值
  1220. this.modelDefault = JSON.parse(JSON.stringify(this.model))
  1221. getAction('/business/busDictItem/queryList', {
  1222. hotelId: _info.id,
  1223. dictName: '客人来源设置'
  1224. }).then((res) => {
  1225. if (res.success) {
  1226. this.customerSourceList = res.result
  1227. }
  1228. })
  1229. getAction('/business/busSalesPerson/list', {
  1230. hotelId: _info.id,
  1231. pageNo: 1,
  1232. pageSize: 100
  1233. }).then((res) => {
  1234. if (res.success) {
  1235. this.warranterList = res.result.records
  1236. }
  1237. })
  1238. this.getbusCustomer()
  1239. },
  1240. methods: {
  1241. // table的expandIcon属性,修改默认展开关闭按钮 子表无数据时不显示展开图标
  1242. /**
  1243. * 添加同住人姓名
  1244. */
  1245. handleSelectMember(e, idx) {
  1246. var find = this.customerList.find((t) => t.id === e)
  1247. console.log(idx)
  1248. console.log(this.addPeopleList)
  1249. this.addPeopleList[idx].phone = find.phone
  1250. this.addPeopleList[idx].customerName = find.name
  1251. this.addPeopleList[idx].customerId = find.id
  1252. // this.model.phone = find.phone;
  1253. // this.model.customerName = find.name;
  1254. // this.model.customerId = find.id;
  1255. },
  1256. handleSearch(value) {
  1257. let result
  1258. if (!value) {
  1259. result = this.oldcustomerList
  1260. } else {
  1261. result = this.oldcustomerList.filter((t) => t.name.includes(value))
  1262. }
  1263. this.customerList = result
  1264. },
  1265. getbusCustomer() {
  1266. getAction('/bus/busCustomer/list', {}).then((res) => {
  1267. if (res.success) {
  1268. this.customerList = res.result.records
  1269. this.oldcustomerList = JSON.parse(JSON.stringify(this.customerList))
  1270. }
  1271. })
  1272. },
  1273. /**
  1274. * 添加同住人保存
  1275. */
  1276. savePeople(item) {
  1277. console.log(item)
  1278. const that = this
  1279. if (!item.customerName) {
  1280. this.$message.warning('姓名不能为空')
  1281. return
  1282. }
  1283. httpAction('/business/busLivingCustomer/add', item, 'post')
  1284. .then((res) => {
  1285. if (res.success) {
  1286. that.$message.success('入住成功')
  1287. // that.$emit("ok");
  1288. this.modalFormOk()
  1289. this.addPeopleList.length = 0
  1290. } else {
  1291. that.$message.warning(res.message)
  1292. }
  1293. })
  1294. .finally(() => {
  1295. // that.confirmLoading = false;
  1296. })
  1297. },
  1298. /**
  1299. * 添加同住人取消
  1300. */
  1301. cancelPeople(idx) {
  1302. this.addPeopleList.splice(idx, 1)
  1303. },
  1304. // 叫醒服务
  1305. wakeServiceOk() {
  1306. console.log(this.wakeTime)
  1307. if (!this.wakeTime.id) {
  1308. this.$message.warning('请选择房间号')
  1309. return
  1310. }
  1311. if (!this.wakeTime.date) {
  1312. this.$message.warning('请选择日期')
  1313. return
  1314. }
  1315. if (!this.wakeTime.time) {
  1316. this.$message.warning('请选择时间')
  1317. return
  1318. }
  1319. let obj = {
  1320. livingOrderId: this.wakeTime.id,
  1321. jxDate: this.wakeTime.date,
  1322. jxTime: this.wakeTime.time
  1323. }
  1324. postAction('/fw/fwLivingJx/add', obj).then((res) => {
  1325. if (res.success) {
  1326. this.$message.success('添加成功')
  1327. this.wakeTime = {}
  1328. this.getWakeServiceData()
  1329. this.wakeService = false
  1330. } else {
  1331. this.$message.warning(res.message)
  1332. }
  1333. })
  1334. },
  1335. // 获取叫醒服务数据
  1336. getWakeServiceData() {
  1337. let ids = []
  1338. this.model.livingRoomIds.forEach((item) => {
  1339. if (item.roomName != '全部') {
  1340. ids.push(item.livingOrder && item.livingOrder.id)
  1341. }
  1342. })
  1343. getAction('/fw/fwLivingJx/list?livingOrderId=' + ids.toString()).then(
  1344. (res) => {
  1345. if (res.success) {
  1346. this.wakeList = res.result.records
  1347. }
  1348. }
  1349. )
  1350. },
  1351. getMessageData() {
  1352. let ids = []
  1353. this.model.livingRoomIds.forEach((item) => {
  1354. if (item.roomName != '全部') {
  1355. ids.push(item.livingOrder && item.livingOrder.id)
  1356. }
  1357. })
  1358. getAction('business/busMemberMessage/list?livingOrderId=' + ids.toString()).then(
  1359. (res) => {
  1360. if (res.success) {
  1361. this.messageList = res.result.records
  1362. }
  1363. }
  1364. )
  1365. },
  1366. // 删除叫醒服务
  1367. removeWakeService(id) {
  1368. deleteAction('/fw/fwLivingJx/delete?id=' + id).then((res) => {
  1369. if (res.success) {
  1370. this.$message.success('删除成功')
  1371. this.getWakeServiceData()
  1372. } else {
  1373. this.$message.warning(res.message)
  1374. }
  1375. })
  1376. },
  1377. changeMainRoom() {
  1378. console.log(this.chooseLivingRoom)
  1379. const bookingRoom = {
  1380. 'id': this.chooseLivingRoom.id,
  1381. 'isMain': this.chooseLivingRoom.isMain,
  1382. 'bookingOrdersId': this.chooseLivingRoom.bookingOrderId
  1383. }
  1384. postAction('/business/busBookingRooms/set-main?livingOrderId=' + this.chooseLivingRoom.livingOrder.id, bookingRoom)
  1385. .then(resp => {
  1386. if (resp.success) {
  1387. this.$message.success('更换主房成功')
  1388. this.getBookingOrderInfo()
  1389. } else {
  1390. this.$message.success('更换主房失败')
  1391. }
  1392. })
  1393. },
  1394. onChangeWakeService(e, e1) {
  1395. console.log(e, e1)
  1396. this.wakeTime.date = e1
  1397. },
  1398. onChangeWakeServiceTime(e, e1) {
  1399. console.log(e, e1)
  1400. this.wakeTime.time = e1
  1401. },
  1402. editBookingType(item) {
  1403. var obj = {
  1404. orderId: item.livingOrder.id,
  1405. liveType: item.livingOrder.livingType,
  1406. fangAnId: item.livingOrder.hourRoomId,
  1407. livingDayPrices: item.livingDayPrices,
  1408. roomId: item.roomId
  1409. }
  1410. this.$refs.modalEditBookingTypeModal.edit(obj)
  1411. this.$refs.modalEditBookingTypeModal.title = '修改'
  1412. this.$refs.modalEditBookingTypeModal.disableSubmit = false
  1413. },
  1414. editBreakfastNum(item) {
  1415. var obj = {
  1416. orderId: item.livingOrder.id,
  1417. brkfstNum: item.livingOrder.breakfastNum
  1418. }
  1419. this.$refs.modalEditBreakfastNumModal.edit(obj)
  1420. this.$refs.modalEditBreakfastNumModal.title = '修改'
  1421. this.$refs.modalEditBreakfastNumModal.disableSubmit = false
  1422. },
  1423. editRemark(item) {
  1424. var obj = {
  1425. orderId: item.livingOrder.id,
  1426. remark: item.livingOrder.remark
  1427. }
  1428. this.$refs.modalEditRemarkModal.edit(obj)
  1429. this.$refs.modalEditRemarkModal.title = '修改'
  1430. this.$refs.modalEditRemarkModal.disableSubmit = false
  1431. },
  1432. editWarranter(item) {
  1433. var obj = {
  1434. orderId: item.livingOrder.id,
  1435. warranter: item.livingOrder.warranter
  1436. }
  1437. this.$refs.modalEditWarranter.edit(obj)
  1438. this.$refs.modalEditWarranter.title = '修改'
  1439. this.$refs.modalEditWarranter.disableSubmit = false
  1440. },
  1441. getlivingTypeText(livingType) {
  1442. var text = ''
  1443. if (livingType === 1) {
  1444. text = '全天'
  1445. } else if (livingType === 2) {
  1446. text = '钟点'
  1447. } else if (livingType === 3) {
  1448. text = '自用'
  1449. } else if (livingType === 4) {
  1450. text = '免费'
  1451. } else if (livingType === 4) {
  1452. text = '长租'
  1453. }
  1454. return text
  1455. },
  1456. editCustomerSource(item) {
  1457. var obj = {
  1458. orderId: item.livingOrder.id,
  1459. customerSource: item.livingOrder.customerSource
  1460. }
  1461. this.$refs.modalEditCustomerSource.edit(obj)
  1462. this.$refs.modalEditCustomerSource.title = '修改'
  1463. this.$refs.modalEditCustomerSource.disableSubmit = false
  1464. },
  1465. editCustomerType(item) {
  1466. console.log(item)
  1467. var obj = {
  1468. orderId: item.livingOrder.id,
  1469. customerType: item.livingOrder.customerType,
  1470. vipCustomerId: item.livingOrder.vipCustomerId,
  1471. contractTeamId: item.livingOrder.contractTeamId,
  1472. contractTeamProtocolId: item.livingOrder.contractTeamProtocolId
  1473. }
  1474. this.$refs.modalEditCustomerType.edit(obj)
  1475. this.$refs.modalEditCustomerType.title = '修改'
  1476. this.$refs.modalEditCustomerType.disableSubmit = false
  1477. },
  1478. editCustomer(item) {
  1479. var customer = item.livingCustomers[0] || {}
  1480. console.log(item)
  1481. console.log(customer)
  1482. var obj = {
  1483. orderId: item.livingOrder.id,
  1484. cusName: customer.customerName,
  1485. cusPhone: customer.phone,
  1486. cusId: customer.id,
  1487. certType: customer.certType,
  1488. certNo: customer.certNo,
  1489. address: customer.address,
  1490. gender: customer.gender,
  1491. nation: customer.nation
  1492. }
  1493. console.log(obj)
  1494. this.$refs.modalEditCustomer.edit(obj)
  1495. this.$refs.modalEditCustomer.title = '修改'
  1496. this.$refs.modalEditCustomer.disableSubmit = false
  1497. },
  1498. splitLiving() {
  1499. var that = this
  1500. this.$confirm({
  1501. title: '提示',
  1502. content: '确认要拆分房间?',
  1503. onOk: function () {
  1504. if (that.model.livingRoomIds.length === 2){
  1505. that.$message.warning('不能拆分主房')
  1506. return
  1507. }
  1508. var index = that.model.livingRoomIds.findLastIndex(
  1509. (t) => t.roomId == that.selectRoomId
  1510. )
  1511. var livingRoom = that.model.livingRoomIds[index]
  1512. console.log(that.model.livingRoomIds)
  1513. if (livingRoom.isMain) {
  1514. if (that.model.livingRoomIds.length > 2) {
  1515. that.$message.warning('请先变更主房间再拆分')
  1516. return
  1517. } else {
  1518. var index2 = that.model.livingRoomIds.findLastIndex(
  1519. (t) => t.roomId !== that.selectRoomId
  1520. )
  1521. livingRoom = that.model.livingRoomIds[index2]
  1522. }
  1523. }
  1524. httpAction(
  1525. 'business/busRoomBookingOrders/split-living?livingOrderId=' +
  1526. livingRoom.livingOrder.id,
  1527. {},
  1528. 'post'
  1529. )
  1530. .then((res) => {
  1531. if (res.success) {
  1532. that.$message.success('拆分成功')
  1533. that.getBookingOrderInfo()
  1534. that.$emit('ok')
  1535. console.log(that.model.livingRoomIds && that.model.livingRoomIds.length > 1)
  1536. if (that.model.livingRoomIds && that.model.livingRoomIds.length > 1) {
  1537. that.tabSelectRoomId = that.model.livingRoomIds[1].roomId
  1538. }
  1539. } else {
  1540. that.$message.warning(res.message)
  1541. }
  1542. })
  1543. .finally(() => {
  1544. that.confirmLoading = false
  1545. })
  1546. }
  1547. })
  1548. },
  1549. addUnion() {
  1550. if (this.selectRoomId === '1') {
  1551. this.$message.warning('请先选择房间')
  1552. return
  1553. }
  1554. var index = this.model.livingRoomIds.findLastIndex(
  1555. (t) => t.roomId == this.selectRoomId
  1556. )
  1557. console.log(this.model.livingRoomIds)
  1558. var find = this.model.livingRoomIds[index]
  1559. let arr = []
  1560. this.model.livingRoomIds.forEach((ele) => {
  1561. if (ele.roomName != '全部') {
  1562. arr.push(ele.livingOrder.id)
  1563. }
  1564. })
  1565. this.$refs.modalSelectCheckInRoomOrder.add()
  1566. this.$refs.modalSelectCheckInRoomOrder.title = '请选择需要关联的订单'
  1567. this.$refs.modalSelectCheckInRoomOrder.disableSubmit = false
  1568. this.$refs.modalSelectCheckInRoomOrder.livingOrderId =
  1569. find.livingOrder.id
  1570. this.$refs.modalSelectCheckInRoomOrder.filterIds = arr
  1571. this.$refs.modalSelectCheckInRoomOrder.livingRoomId = find.roomId
  1572. },
  1573. addLeaseGoods() {
  1574. // if (this.selectRoomId === "1") {
  1575. // this.$message.warning("请先选择房间");
  1576. // return;
  1577. // }
  1578. var index = this.model.livingRoomIds.findLastIndex(
  1579. (t) => t.roomId == this.selectRoomId
  1580. )
  1581. var find = this.model.livingRoomIds[index]
  1582. var livingOrderId = ''
  1583. if (find.roomId != '1') {
  1584. livingOrderId = find.livingOrder.id
  1585. } else {
  1586. this.model.livingRoomIds
  1587. .filter((t) => t.roomId != '1')
  1588. .forEach((t) => {
  1589. livingOrderId += t.livingOrder.id + ','
  1590. })
  1591. }
  1592. let chooseRooms = [this.chooseLivingRoom]
  1593. if (this.selectRoomId === '1') {
  1594. chooseRooms = this.model.livingRoomIds.filter(e => e.roomId !== '1')
  1595. }
  1596. this.$refs.modalLeaseGoods.add(chooseRooms)
  1597. this.$refs.modalLeaseGoods.title = '物品借用'
  1598. this.$refs.modalLeaseGoods.disableSubmit = false
  1599. this.$refs.modalLeaseGoods.livingOrderId = livingOrderId // find.livingOrder.id;
  1600. this.$refs.modalLeaseGoods.payTypeList = this.payTypeList
  1601. },
  1602. addMessage() {
  1603. if (this.selectRoomId === '1') {
  1604. this.$message.warning('请先选择房间')
  1605. return
  1606. }
  1607. var index = this.model.livingRoomIds.findLastIndex(
  1608. (t) => t.roomId == this.selectRoomId
  1609. )
  1610. var find = this.model.livingRoomIds[index]
  1611. console.log(find)
  1612. this.$refs.modalMemberMessage.add()
  1613. this.$refs.modalMemberMessage.title = '客人留言'
  1614. this.$refs.modalMemberMessage.disableSubmit = false
  1615. this.$refs.modalMemberMessage.livingOrderId = find.livingOrder.id
  1616. },
  1617. addProjectFee() {
  1618. var index = this.model.livingRoomIds.findLastIndex(
  1619. (t) => t.roomId == this.selectRoomId
  1620. )
  1621. var livingRoom = this.model.livingRoomIds[index]
  1622. console.log(livingRoom)
  1623. console.log(this.model.orderInfo)
  1624. console.log(livingRoom.livingOrder.vipCustomerId)
  1625. let obj = {
  1626. livingOrderId: livingRoom.livingOrder.id,
  1627. vipCustomerId: livingRoom.livingOrder.vipCustomerId
  1628. }
  1629. this.$refs.modalFeeForm.add(obj)
  1630. // this.$refs.modalFeeForm.livingOrderId = livingRoom.livingOrder.id
  1631. this.$refs.modalFeeForm.title = '增加消费项目'
  1632. this.$refs.modalFeeForm.disableSubmit = false
  1633. },
  1634. // tuidan() {
  1635. // postAction(
  1636. // '/business/busRoomBookingOrders/退你麻痹单狗东西',
  1637. // this.consumSelectedRowKeys
  1638. // ).then((res) => {
  1639. // if (res.success) {
  1640. // this.$message.success('退单成功')
  1641. // this.getBookingOrderInfo()
  1642. // } else {
  1643. // this.$message.warning(res.message)
  1644. // }
  1645. // })
  1646. // },
  1647. // 部分结账
  1648. partialSettle() {
  1649. if (this.selectRoomId === '1') {
  1650. this.$message.warning('请先选择房间')
  1651. return
  1652. }
  1653. if (this.consumSelectedRowKeys.length === 0) {
  1654. this.$message.warning('请先勾选消费')
  1655. return
  1656. }
  1657. var list2 = this.feesList.filter((t) =>
  1658. this.consumSelectedRowKeys.includes(t.id)
  1659. )
  1660. console.log(list2)
  1661. var amount = list2.reduce(function (total, item) {
  1662. return total + item.money
  1663. }, 0)
  1664. var index = this.model.livingRoomIds.findLastIndex(
  1665. (t) => t.roomId == this.selectRoomId
  1666. )
  1667. var livingRoom = this.model.livingRoomIds[index]
  1668. this.$refs.modalPaymentForm.edit({
  1669. billAmount: parseFloat(amount.toFixed(2)),
  1670. deposit: 0,
  1671. roomFee: parseFloat(amount.toFixed(2)),
  1672. subjectType: 5,
  1673. feeType: 2,
  1674. bookingOrderId: this.model.orderInfo.id,
  1675. livingOrderId:
  1676. livingRoom.roomId != '1' ? livingRoom.livingOrder.id : '',
  1677. preferentialType: 1,
  1678. couponFirstAmount: 0,
  1679. discount: 9,
  1680. vipCustomerId: this.model.orderInfo.vipCustomerId,
  1681. selectedFeeIds: this.consumSelectedRowKeys
  1682. })
  1683. this.$refs.modalPaymentForm.title = '部分结账收款'
  1684. this.$refs.modalPaymentForm.disableSubmit = false
  1685. this.$refs.modalPaymentForm.showYinshou = false
  1686. },
  1687. tabChange(e) {
  1688. //
  1689. this.selectRoomId = e
  1690. if (e == '1') {
  1691. this.entiretyList = JSON.parse(JSON.stringify(this.entiretyAmount))
  1692. this.feesList = this.oldfeesList
  1693. this.paymentList = this.oldpaymentList
  1694. this.paidList = this.oldpaidList
  1695. this.strikeList = this.oldStrikeList
  1696. this.strikeList.forEach(item => {
  1697. let tempindex = this.entiretyList.findIndex(index => index.id == item.returnFeeId)
  1698. console.log(this.tempindex);
  1699. this.entiretyList.splice(tempindex+1,0,item)
  1700. })
  1701. } else {
  1702. this.feesList = this.oldfeesList.filter((t) => t.roomId === e)
  1703. this.paymentList = this.oldpaymentList.filter((t) => t.roomId === e)
  1704. this.paidList = this.oldpaidList.filter((t) => t.roomId === e)
  1705. this.strikeList = this.oldStrikeList.filter((t) => t.roomId === e)
  1706. this.entiretyList = this.entiretyAmount.filter((t) => t.roomId === e)
  1707. let find = this.model.livingRoomIds.find((t) => t.roomId === this.selectRoomId)
  1708. this.chooseLivingRoom = find
  1709. console.log(this.model)
  1710. console.log(find)
  1711. // this.loadStrikeDate()
  1712. this.strikeList.forEach(item => {
  1713. let tempindex = this.entiretyList.findIndex(index => index.id == item.returnFeeId)
  1714. console.log(this.tempindex);
  1715. this.entiretyList.splice(tempindex+1,0,item)
  1716. })
  1717. this.isLiving = find.livingOrder.settleType === -1
  1718. this.$emit('changeLivingStatu', find.livingOrder.settleType)
  1719. }
  1720. },
  1721. getPayTypeText(text) {
  1722. var find = this.payTypeList.find((t) => t.id == text)
  1723. return find ? find.name : ''
  1724. },
  1725. getRoomName(id) {
  1726. // console.log(this.model.livingRoomIds)
  1727. var index = this.model.livingRoomIds.findLastIndex((t) => t.roomId == id)
  1728. var find = this.model.livingRoomIds[index]
  1729. return find ? find.roomName : ''
  1730. },
  1731. getSubjectTypeText(text, record) {
  1732. var msg = ''
  1733. if (text == 1) {
  1734. msg = '押金'
  1735. if (record.remark != null && record.remark != '') {
  1736. msg = record.remark
  1737. }
  1738. } else if (text == 2) {
  1739. msg = '预收房费'
  1740. } else if (text == 3) {
  1741. msg = '每日房费'
  1742. if (record.remark != null) {
  1743. msg = record.remark
  1744. }
  1745. } else if (text == 4) {
  1746. msg = '优惠金额'
  1747. } else if (text == 5) {
  1748. if (record.money < 0) {
  1749. msg = '结账退款'
  1750. } else {
  1751. msg = '结账收款'
  1752. }
  1753. } else if (text == 6) {
  1754. msg = '商品-' + record.feeGoodVo.name
  1755. } else if (text == 7) {
  1756. msg = '点餐-' + record.feeGoodVo.name
  1757. } else if (text == 8) {
  1758. msg = '夜审房费'
  1759. } else if (text == 9) {
  1760. msg = '会议室'
  1761. } else if (text == 10) {
  1762. msg = '手工房费'
  1763. } else if (text == 11) {
  1764. msg = record.remark
  1765. } else if (text == 12) {
  1766. msg = '赔偿费'
  1767. } else if (text == 13) {
  1768. msg = record.remark
  1769. } else if (text == 14) {
  1770. msg = record.remark
  1771. }
  1772. return msg
  1773. },
  1774. async getbusRoomPayType() {
  1775. await getAction('/business/busRoomPayType/list', {
  1776. pageSize: 99999,
  1777. pageNo: 1
  1778. }).then((res) => {
  1779. if (res.success) {
  1780. this.payTypeList = res.result.records
  1781. }
  1782. })
  1783. },
  1784. removeLivingCustomer(id) {
  1785. deleteAction('/business/busLivingCustomer/delete', { id: id }).then(
  1786. (res) => {
  1787. if (res.success) {
  1788. this.getBookingOrderInfo()
  1789. }
  1790. }
  1791. )
  1792. },
  1793. addlivingCustomer(id, roomId) {
  1794. console.log(id, roomId)
  1795. // this.$refs.modalCustomerForm.add(id, roomId);
  1796. // this.$refs.modalCustomerForm.title = "添加同住人";
  1797. // this.$refs.modalCustomerForm.disableSubmit = false;
  1798. this.addPeopleList.push({
  1799. livingOrderId: id,
  1800. roomId: roomId,
  1801. certType: 1,
  1802. gender: 1,
  1803. phone: '',
  1804. customerName: '',
  1805. customerId: '',
  1806. hotelId: JSON.parse(localStorage.getItem('storeInfo')).id
  1807. })
  1808. },
  1809. modalFormOk(e) {
  1810. this.getBookingOrderInfo()
  1811. this.$emit('ok')
  1812. },
  1813. customerTypeName(customerType) {
  1814. switch (customerType) {
  1815. case 1:
  1816. return '散客'
  1817. case 2:
  1818. return '会员'
  1819. case 3:
  1820. return '协议单位'
  1821. case 4:
  1822. return '中介'
  1823. default:
  1824. return '散客'
  1825. }
  1826. },
  1827. warranterName(warranter) {
  1828. var find = this.warranterList.find((t) => t.id == warranter)
  1829. return find ? find.name : '--'
  1830. },
  1831. customerSourceName(customerSource) {
  1832. var find = this.customerSourceList.find((t) => t.id == customerSource)
  1833. return find ? find.itemText : '--'
  1834. },
  1835. getMemberCard() {
  1836. getAction('/business/busMemberCard/list', {
  1837. id: this.model.orderInfo.vipCustomerId
  1838. }).then((res) => {
  1839. if (res.success) {
  1840. if (res.result.records && res.result.records.length > 0) {
  1841. this.vipCustomer = res.result.records[0]
  1842. }
  1843. }
  1844. })
  1845. },
  1846. async getBookingOrderInfo() {
  1847. if (this.payTypeList == 0) {
  1848. await this.getbusRoomPayType()
  1849. }
  1850. var obj = {
  1851. bookingNo: this.id
  1852. }
  1853. if (this.key && this.key == 1) {
  1854. obj = {
  1855. bookingOrderId: this.id
  1856. }
  1857. }
  1858. await getAction(this.url.getBookingOrderInfo, obj).then((res) => {
  1859. console.log(res);
  1860. if (res.success) {
  1861. if (res.result.livingRoomIds.length > 1) {
  1862. let index = res.result.livingRoomIds.findIndex(e => e.isMain === true)
  1863. if (index !== -1 && index !== 0) {
  1864. [res.result.livingRoomIds[0], res.result.livingRoomIds[index]] = [res.result.livingRoomIds[index], res.result.livingRoomIds[0]]
  1865. }
  1866. }
  1867. var livingRoomId = JSON.parse(
  1868. JSON.stringify(res.result.livingRoomIds[0])
  1869. )
  1870. livingRoomId.roomId = '1'
  1871. livingRoomId.roomName = '全部'
  1872. var list = []
  1873. res.result.livingRoomIds.forEach((t) => {
  1874. if (t.livingCustomers) {
  1875. list = [...list, ...t.livingCustomers]
  1876. }
  1877. })
  1878. livingRoomId.livingCustomers = list
  1879. res.result.livingRoomIds.unshift(livingRoomId)
  1880. this.tabSelectRoomId = this.roomId && res.result.livingRoomIds.find(t => t.roomId === this.roomId)
  1881. ? this.roomId
  1882. : res.result.livingRoomIds[1].roomId
  1883. this.selectRoomId = this.tabSelectRoomId
  1884. this.model = res.result
  1885. console.log(this.model);
  1886. this.getWakeServiceData()
  1887. this.getMessageData()
  1888. // 查询账单
  1889. getAction('/business/busRoomBookingOrders/living-fees', {
  1890. bookingOrderId: this.model.orderInfo.id,
  1891. isAllFee: true
  1892. }).then((res) => {
  1893. console.log(res);
  1894. if (res.success) {
  1895. if (res.result && res.result.length > 0) {
  1896. // 未支付的费用账单,oldfeesList用于存放所有费用账单,feesList为当前房间账单
  1897. this.feesList = res.result.filter((t) => t.feeType === 1 && t.preferentialStatus === 1)
  1898. this.oldfeesList = JSON.parse(JSON.stringify(this.feesList))
  1899. // 已支付的消费
  1900. this.paidList = res.result.filter((t) => t.feeType === 1 && t.preferentialStatus === 2)
  1901. this.oldpaidList = JSON.parse(JSON.stringify(this.paidList))
  1902. // 全部账单
  1903. this.entiretyAmount = this.feesList.concat(this.paidList)
  1904. this.entiretyList = JSON.parse(JSON.stringify(this.entiretyAmount))
  1905. // 收费账单
  1906. this.paymentList = res.result.filter((t) => t.feeType === 2)
  1907. this.oldpaymentList = JSON.parse(JSON.stringify(this.paymentList))
  1908. // 按当前选中房间过滤出费用
  1909. this.tabChange(this.tabSelectRoomId)
  1910. }
  1911. }
  1912. })
  1913. // 查询冲账账单
  1914. this.loadStrikeDate()
  1915. if (this.model.orderInfo.vipCustomerId) {
  1916. this.getMemberCard()
  1917. }
  1918. }
  1919. })
  1920. },
  1921. // 获取冲账单
  1922. async loadStrikeDate() {
  1923. await getAction('/business/busOrderFee/strike-balance-page', { bookingOrderId: this.model.orderInfo.id })
  1924. .then(res => {
  1925. console.log(res);
  1926. if (res.success) {
  1927. //
  1928. if (res.result && res.result.records.length > 0) {
  1929. // 未支付的费用账单,oldfeesList用于存放所有费用账单,feesList为当前房间账单
  1930. this.strikeList = res.result.records
  1931. this.oldStrikeList = JSON.parse(JSON.stringify(this.strikeList))
  1932. console.log(this.strikeList, '冲帐单')
  1933. // this.entiretyAmount = this.entiretyList
  1934. // console.log(this.entiretyAmount, '冲帐单')
  1935. // let templist = this.strikeList.find()
  1936. // this.strikeList.forEach(item => {
  1937. // this.entiretyList.forEach(index => {
  1938. // if (item.returnFeeId == index.id) {
  1939. // let tempindex = this.entiretyList.indexOf(index)
  1940. // this.entiretyList.splice(tempindex,0,item)
  1941. // }
  1942. // })
  1943. // }
  1944. // 处理全部账单加上冲帐单
  1945. // console.log(this.entiretyList);
  1946. // this.strikeList.forEach(item => {
  1947. // let tempindex = this.entiretyList.findIndex(index => index.id == item.returnFeeId)
  1948. // console.log(this.tempindex);
  1949. // this.entiretyList.splice(tempindex+1,0,item)
  1950. // })
  1951. // // if (item == this.entiretyList.find(index => index.id = item.returnFeeId)) {
  1952. // templist.push(this.entiretyList.find(index => index.id = item.returnFeeId),item)
  1953. // }
  1954. // // if ()
  1955. // // this.strikeList.forEach(index => {
  1956. // // if(item.id = index.returnFeeId) {
  1957. // // templist.push(item,index)
  1958. // // }
  1959. // // })
  1960. // });
  1961. this.tabChange(this.tabSelectRoomId)
  1962. }
  1963. }
  1964. })
  1965. },
  1966. getCharge() {
  1967. let ids = []
  1968. this.model.livingRoomIds.forEach((item) => {
  1969. if (item.roomName != '全部') {
  1970. ids.push(item.livingOrder && item.livingOrder.id)
  1971. }
  1972. })
  1973. console.log(ids, "ffffffffffffffffffffffffff")
  1974. getAction('/rooms/houseLongRentCharges/getMeterCharge', { livingOrderId: ids.toString() }).then((res) => {
  1975. if (res.success) {
  1976. console.log(res.result.records, 'res.result.records')
  1977. }
  1978. })
  1979. },
  1980. tabFeeChange() {
  1981. // this.
  1982. },
  1983. onSelectChange(selectedRowKeys, selectionRows) {
  1984. this.consumSelectedRowKeys = selectedRowKeys
  1985. this.consumSelectedRows = selectionRows
  1986. },
  1987. refund() {
  1988. let chooseRooms = [this.chooseLivingRoom]
  1989. if (this.selectRoomId === '1') {
  1990. chooseRooms = this.model.livingRoomIds.filter(e => e.roomId !== '1')
  1991. }
  1992. this.$refs.modalRefundForm.edit(chooseRooms)
  1993. this.$refs.modalRefundForm.payTypeList = this.payTypeList
  1994. },
  1995. meterReading() {
  1996. console.log(this.model, 'this.model')
  1997. var index = this.model.livingRoomIds.findLastIndex(
  1998. (t) => t.roomId == this.selectRoomId
  1999. )
  2000. var livingRoom = this.model.livingRoomIds[index]
  2001. this.$refs.modalMeterReading.visible = true
  2002. this.$refs.modalMeterReading.edit(livingRoom.roomId, livingRoom.livingOrder.id)
  2003. this.$refs.modalMeterReading.title = '读表'
  2004. },
  2005. strikeBalance() {
  2006. console.log(this.model)
  2007. let map = new Map()
  2008. this.model.livingRoomIds.forEach(e => {
  2009. if (e.roomId !== '1') {
  2010. map.set(e.roomId, e.roomName)
  2011. }
  2012. })
  2013. let fees = JSON.parse(JSON.stringify(this.feesList))
  2014. fees.forEach(e => {
  2015. if (e.subjectType === 6 || e.subjectType === 7) {
  2016. let returnNum = this.strikeList.filter(ele => ele.returnFeeId === e.id).reduce((sum, val) => {
  2017. return sum + val.returnNum
  2018. }, 0)
  2019. e.feeGoodVo.num = e.feeGoodVo.num - returnNum;
  2020. }
  2021. })
  2022. let vipId = {
  2023. vipCustomerId: this.model.vipCustomerId
  2024. }
  2025. this.$refs.modalStrikeBalanceForm.edit(fees, map,vipId)
  2026. this.$refs.modalStrikeBalanceForm.title = '冲账'
  2027. },
  2028. enterAccount() {
  2029. let chooseRooms = [this.chooseLivingRoom]
  2030. // vipCustomerId: livingRoom.livingOrder.vipCustomerId,
  2031. if (this.selectRoomId === '1') {
  2032. chooseRooms = this.model.livingRoomIds.filter(e => e.roomId !== '1')
  2033. }
  2034. this.$refs.enterAccountModel.title = '收款'
  2035. this.$refs.enterAccountModel.add(chooseRooms)
  2036. },
  2037. async handleAdd() {
  2038. var that = this
  2039. var index = this.model.livingRoomIds.findLastIndex(
  2040. (t) => t.roomId == this.selectRoomId
  2041. )
  2042. var livingRoom = this.model.livingRoomIds[index]
  2043. if (livingRoom.isMain && livingRoom.roomId !== '1') {
  2044. let livingRoomIdList = this.model.livingRoomIds.filter(item => item.livingOrder.settleType !== 1)
  2045. if (livingRoomIdList.length > 2) {
  2046. this.$message.warning('存在联房,主房不能单独结账')
  2047. return
  2048. }
  2049. }
  2050. if (livingRoom.roomId !== '1' && !livingRoom.isMain) {
  2051. this.$confirm({
  2052. title: '提示',
  2053. content: '是否团队结账?',
  2054. okText: '团队结账',
  2055. cancelText: '单房结账',
  2056. onOk: function () {
  2057. that.tabSelectRoomId = '1'
  2058. livingRoom = that.model.livingRoomIds.find((t) => t.roomId === '1')
  2059. that.tabChange('1')
  2060. that.settle(livingRoom)
  2061. },
  2062. onCancel: function () {
  2063. that.settle(livingRoom)
  2064. }
  2065. })
  2066. } else {
  2067. that.settle(livingRoom)
  2068. }
  2069. },
  2070. settle(livingRoom) {
  2071. var that = this
  2072. let livingOrderIds = ''
  2073. if (livingRoom.roomId !== '1') {
  2074. livingOrderIds = livingRoom.livingOrder.id
  2075. } else {
  2076. this.model.livingRoomIds.filter((t) => t.roomId != '1').forEach((t) => {livingOrderIds += t.livingOrder.id + ','})
  2077. }
  2078. /* 判断是否有租借物品未归还 */
  2079. var count = 0
  2080. getAction('/order/cesOrderLeaseGoods/checkReturnGoods', {
  2081. livingOrderId: livingOrderIds
  2082. }).then((res) => {
  2083. if (res.success) {
  2084. if (res.result && res.result > 0) {
  2085. count = res.result
  2086. that.$confirm({
  2087. title: '提示',
  2088. content: '您还有' + count + '件物品未归还,是否跳转物品租借页面?',
  2089. onOk: function () {
  2090. that.addLeaseGoods()
  2091. },
  2092. onCancel() {}
  2093. })
  2094. }
  2095. }
  2096. })
  2097. if (count !== 0) {
  2098. return
  2099. }
  2100. let differMoney = this.feesAmount - this.paymentAmount
  2101. this.$refs.modalPayOrRefundForm.edit({
  2102. money: differMoney,
  2103. collection: this.paymentAmount,
  2104. consumption: this.feesAmount,
  2105. subjectType: 5,
  2106. feeType: 2,
  2107. bookingOrderId: this.model.orderInfo.id,
  2108. livingOrderId:
  2109. livingRoom.roomId !== '1' ? livingRoom.livingOrder.id : '',
  2110. livingOrderIds: livingOrderIds,
  2111. vipCustomerId: livingRoom.livingOrder.vipCustomerId,
  2112. contractTeamId: livingRoom.livingOrder.contractTeamId,
  2113. contractTeamProtocolId: livingRoom.livingOrder.contractTeamProtocolId,
  2114. preferentialType: 1,
  2115. couponFirstAmount: 0,
  2116. discount: 9,
  2117. isRefund: differMoney > 0
  2118. })
  2119. this.$refs.modalPayOrRefundForm.title = differMoney > 0 ? '结账收款' : '结账退款'
  2120. this.$refs.modalPayOrRefundForm.disableSubmit = false
  2121. },
  2122. puls() {
  2123. this.wakeService = true
  2124. this.wakeTime.id = this.chooseLivingRoom.livingOrder.id
  2125. this.wakeTime.date = moment(new Date()).add(1, 'days').format('YYYY-MM-DD')
  2126. this.wakeTime.time = '07:00'
  2127. // this.wakeList.push({});
  2128. },
  2129. remove(index) {
  2130. this.wakeList.splice(index, 1)
  2131. },
  2132. moment,
  2133. onChange(e) {
  2134. console.log(e)
  2135. },
  2136. add(id, key, roomId) {
  2137. this.key = key
  2138. this.id = id
  2139. this.roomId = roomId
  2140. console.log(this.modelDefault)
  2141. this.edit(this.modelDefault)
  2142. this.getBookingOrderInfo()
  2143. },
  2144. edit(record) {
  2145. this.model = Object.assign({}, record)
  2146. this.visible = true
  2147. },
  2148. handleLeaveNotSettle(isLeaveNotSettle) {
  2149. if (this.selectRoomId === '1') {
  2150. this.$message.warning('请先选择房间')
  2151. return
  2152. }
  2153. var index = this.model.livingRoomIds.findLastIndex(
  2154. (t) => t.roomId == this.selectRoomId
  2155. )
  2156. var find = this.model.livingRoomIds[index]
  2157. console.log(find)
  2158. let url = '/business/busRoomBookingOrders/cancel-leave-not-settle?bookingOrderId='
  2159. if (isLeaveNotSettle) {
  2160. url = '/business/busRoomBookingOrders/leave-not-settle?bookingOrderId='
  2161. }
  2162. this.$emit('changeLoading', true)
  2163. httpAction(
  2164. url + find.bookingOrdersId + '&livingOrderId=' + find.livingOrder.id,
  2165. {},
  2166. 'post'
  2167. ).then((res) => {
  2168. if (res.success) {
  2169. this.$message.success(res.message)
  2170. this.getBookingOrderInfo()
  2171. this.$emit('changeLoading', false)
  2172. this.$emit('ok')
  2173. } else {
  2174. this.$message.warning(res.message)
  2175. this.$emit('changeLoading', false)
  2176. }
  2177. }).finally(e => {
  2178. this.$emit('changeLoading', false)
  2179. })
  2180. },
  2181. handleLeaveSettle() {
  2182. if (this.selectRoomId === '1') {
  2183. this.$message.warning('请先选择房间')
  2184. return
  2185. }
  2186. var index = this.model.livingRoomIds.findLastIndex(
  2187. (t) => t.roomId == this.selectRoomId
  2188. )
  2189. var find = this.model.livingRoomIds[index]
  2190. console.log(find)
  2191. let url = '/business/busRoomBookingOrders/cancel-leave-settle?bookingOrderId='
  2192. this.$emit('changeLoading', true)
  2193. httpAction(
  2194. url + find.bookingOrdersId + '&livingOrderId=' + find.livingOrder.id,
  2195. {},
  2196. 'post'
  2197. ).then((res) => {
  2198. if (res.success) {
  2199. this.$message.success(res.message)
  2200. this.getBookingOrderInfo()
  2201. this.$emit('changeLoading', false)
  2202. this.$emit('ok')
  2203. } else {
  2204. this.$message.warning(res.message)
  2205. this.$emit('changeLoading', false)
  2206. }
  2207. }).finally(e => {
  2208. this.$emit('changeLoading', false)
  2209. })
  2210. },
  2211. stayOver() {
  2212. var index = this.model.livingRoomIds.findLastIndex(
  2213. (t) => t.roomId === this.selectRoomId
  2214. )
  2215. var find = this.model.livingRoomIds[index]
  2216. let obj = {
  2217. name: find.roomName,
  2218. id: find.roomId,
  2219. layoutId: find.roomLayoutId,
  2220. layoutName: find.layoutName,
  2221. customerName: find.livingCustomers[0].customerName,
  2222. phone: find.livingCustomers[0].phone,
  2223. arriveTime: find.livingOrder.arrivalTime,
  2224. dueOutTime: find.livingOrder.dueOutTime
  2225. }
  2226. this.$refs.continuedModalVue.makeCardInfo = obj
  2227. let record = {
  2228. livingOrderId: find.livingOrder.id,
  2229. bookingOrderId: find.livingOrder.bookingOrderId
  2230. }
  2231. this.$refs.continuedModalVue.edit(record)
  2232. this.$refs.continuedModalVue.title = '续住'
  2233. this.$refs.continuedModalVue.disableSubmit = false
  2234. },
  2235. makeCard() {
  2236. let index = this.model.livingRoomIds.findLastIndex(
  2237. (t) => t.roomId === this.selectRoomId
  2238. )
  2239. let find = this.model.livingRoomIds[index]
  2240. console.log(find, 'find')
  2241. let obj = {
  2242. name: find.roomName,
  2243. id: find.roomId,
  2244. layoutId: find.roomLayoutId,
  2245. layoutName: find.layoutName,
  2246. customerName: find.livingCustomers[0].customerName,
  2247. phone: find.livingCustomers[0].phone,
  2248. arriveTime: find.livingOrder.arrivalTime,
  2249. dueOutTime: find.livingOrder.dueOutTime
  2250. }
  2251. this.$refs.batchCardModalCopy.edit([obj])
  2252. },
  2253. adjustPrice() {
  2254. console.log(this.model.livingRoomIds, 'this.model.livingRoomIds')
  2255. console.log(this.chooseLivingRoom)
  2256. if (this.chooseLivingRoom.roomId === '1' && this.model.livingRoomIds.every(e => moment(e.livingOrder.dueOutTime).format('yyyy-MM-DD') <= new Date().format('yyyy-MM-dd'))) {
  2257. this.$message.warning('当前时间已过预离时间,不能进行操作')
  2258. return
  2259. } else if (moment(this.chooseLivingRoom.livingOrder.dueOutTime).format('yyyy-MM-DD') <= new Date().format('yyyy-MM-dd')){
  2260. this.$message.warning('当前时间已过预离时间,不能进行操作')
  2261. return
  2262. }
  2263. let roomInfos = []
  2264. if (this.selectRoomId === '1') {
  2265. roomInfos = this.model.livingRoomIds.slice(1)
  2266. } else {
  2267. var index = this.model.livingRoomIds.findLastIndex(
  2268. (t) => t.roomId == this.selectRoomId)
  2269. var find = this.model.livingRoomIds[index]
  2270. roomInfos.push(find)
  2271. }
  2272. this.$refs.adjustPriceForm.edit(roomInfos)
  2273. this.$refs.adjustPriceForm.title = '批量调价'
  2274. },
  2275. submitForm() {
  2276. const that = this
  2277. that.$message.warning('未实现')
  2278. return
  2279. // 触发表单验证
  2280. this.$refs.form.validate((valid) => {
  2281. if (valid) {
  2282. that.confirmLoading = true
  2283. let httpurl = ''
  2284. let method = ''
  2285. if (!this.model.id) {
  2286. httpurl += this.url.add
  2287. method = 'post'
  2288. } else {
  2289. httpurl += this.url.edit
  2290. method = 'put'
  2291. }
  2292. httpAction(httpurl, this.model, method)
  2293. .then((res) => {
  2294. if (res.success) {
  2295. that.$message.success(res.message)
  2296. that.$emit('ok')
  2297. } else {
  2298. that.$message.warning(res.message)
  2299. }
  2300. })
  2301. .finally(() => {
  2302. that.confirmLoading = false
  2303. })
  2304. }
  2305. })
  2306. }
  2307. }
  2308. }
  2309. </script>
  2310. <style>
  2311. .tab_height .ant-table-wrapper{
  2312. height: auto !important;
  2313. }
  2314. </style>
  2315. <style scoped>
  2316. /deep/ .ant-btn-link {
  2317. flex: 1;
  2318. color: rgba(255, 141, 26, 1) !important;
  2319. }
  2320. .disabled {
  2321. pointer-events: none;
  2322. opacity: 0.6;
  2323. /* 可以根据需要添加其他样式 */
  2324. }
  2325. .menu {
  2326. display: flex;
  2327. flex-direction: column;
  2328. flex: 1;
  2329. color: #fff;
  2330. margin-top: 12px;
  2331. }
  2332. .dynamic-delete-button {
  2333. cursor: pointer;
  2334. position: relative;
  2335. /* top: 4px; */
  2336. margin-left: 5px;
  2337. font-size: 18px;
  2338. color: #1890ff;
  2339. transition: all 0.3s;
  2340. }
  2341. .dynamic-delete-button:hover {
  2342. color: #777;
  2343. }
  2344. .dynamic-delete-button[disabled] {
  2345. cursor: not-allowed;
  2346. opacity: 0.5;
  2347. }
  2348. /deep/ .noExpand .ant-table-row-expand-icon {
  2349. display: none;
  2350. }
  2351. /deep/.ant-table-thead > tr > th {
  2352. background: rgba(42, 130, 228, 1);
  2353. color: #ffffff;
  2354. }
  2355. /deep/.ant-divider-horizontal {
  2356. margin: 12px 0 !important;
  2357. }
  2358. /deep/ .ant-table-tbody .ant-table-row td {
  2359. padding-top: 5px;
  2360. padding-bottom: 5px;
  2361. }
  2362. /deep/.ant-table-thead > tr > th,
  2363. .ant-table-tbody > tr > td {
  2364. padding: 5px 5px !important;
  2365. overflow-wrap: break-word;
  2366. }
  2367. #livingCustomers-grid [class~="ant-col"] {
  2368. border: #ccc 1px solid;
  2369. }
  2370. #livingCustomers-grid [class~="ant-col"]:last-child {
  2371. border: 0;
  2372. }
  2373. .strike_style {
  2374. color: red !important;
  2375. }
  2376. </style>