fangwuLookRoom.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. <template>
  2. <a-card :bordered="false">
  3. <a-tabs default-active-key="1">
  4. <a-tab-pane key="1" tab="待查房">
  5. <!-- 查询区域 -->
  6. <div class="table-page-search-wrapper">
  7. <a-form layout="inline" @keyup.enter.native="searchQuery">
  8. <a-row :gutter="24">
  9. <a-col :span="15">
  10. <a-button @click="cancelRoom" :disabled="setBtnsDisable(4)" type="danger">设置取消查房</a-button>
  11. <a-button @click="setWaitRoom" :disabled="setBtnsDisable(1)" style="margin-left: 8px">设置等待查房</a-button>
  12. <a-button @click="setInRoom" :disabled="setBtnsDisable(2)" style="margin-left: 8px">设置正在查房</a-button>
  13. <a-button @click="setFinishRoom" :disabled="setBtnsDisable(3)" style="margin-left: 8px">设置查房完毕</a-button>
  14. <a-button type="primary" @click="searchQuery" icon="reload" style="margin-left: 8px">刷新</a-button>
  15. </a-col>
  16. <a-col :span="3">
  17. <a-form-item label="">
  18. <a-input placeholder="房号" v-model="queryParam.roomName"></a-input>
  19. </a-form-item>
  20. </a-col>
  21. <a-col :span="3">
  22. <a-form-item label="">
  23. <a-select v-model="queryParam.state" style="width: 100%" placeholder="请选择" allowClear>
  24. <a-select-option :value="4">取消查房</a-select-option>
  25. <a-select-option :value="0">待查房</a-select-option>
  26. <a-select-option :value="1">等待查房</a-select-option>
  27. <a-select-option :value="2">正在查房</a-select-option>
  28. <a-select-option :value="3">查房完毕</a-select-option>
  29. </a-select>
  30. </a-form-item>
  31. </a-col>
  32. <a-col :span="3">
  33. <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
  34. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  35. </span>
  36. </a-col>
  37. </a-row>
  38. </a-form>
  39. </div>
  40. <!-- 查询区域-END -->
  41. <!-- table区域-begin -->
  42. <div>
  43. <!-- type:'radio' -->
  44. <a-table ref="table" size="middle" :scroll="{ x: true }" bordered rowKey="id" :columns="columns" :dataSource="dataSource" :pagination="ipagination" :loading="loading" :rowSelection="{
  45. selectedRowKeys: selectedRowKeys,
  46. onChange: onSelectChange,
  47. }" class="j-table-force-nowrap" @change="handleTableChange">
  48. <!-- <template slot="name" slot-scope="text, record">
  49. <a @click="handleBillInfo(record)">{{record.contactName}}</a>
  50. </template> -->
  51. </a-table>
  52. </div>
  53. </a-tab-pane>
  54. <a-tab-pane key="2" tab="历史查房">
  55. <historyLookRoom />
  56. </a-tab-pane>
  57. </a-tabs>
  58. <a-modal :title="title" :visible="visibleLook" @cancel="changeCancel" @ok="submitOK">
  59. <!-- <j-form-container :disabled="false"> -->
  60. <a-form-model-item label="服务员" :labelCol="labelCol" :wrapperCol="wrapperCol" v-if="status==2">
  61. <a-select placeholder="服务员" v-model="waiterId" style="width:40%">
  62. <a-select-option :value="item.id" v-for="(item, index) in busWaiterList" :key="item.id">
  63. {{ item.name }}
  64. </a-select-option>
  65. </a-select>
  66. </a-form-model-item>
  67. <a-form-model-item label="请输入备注" :labelCol="labelCol" :wrapperCol="wrapperCol" v-else>
  68. <a-input v-model="remarks" placeholder="请输入备注"></a-input>
  69. </a-form-model-item>
  70. <!-- </j-form-container> -->
  71. </a-modal>
  72. </a-card>
  73. </template>
  74. <script>
  75. import "@/assets/less/TableExpand.less";
  76. import {
  77. mixinDevice
  78. } from "@/utils/mixin";
  79. import {
  80. JeecgListMixin
  81. } from "@/mixins/JeecgListMixin";
  82. // import BillRoomInfoModal from "./modules/checkIn/BillRoomInfoModal.vue";
  83. import {
  84. httpAction,
  85. postAction,
  86. getAction
  87. } from "@/api/manage";
  88. import historyLookRoom from './historyLookRoom.vue';
  89. export default {
  90. name: "CesOrderMessageList",
  91. mixins: [JeecgListMixin, mixinDevice],
  92. components: {
  93. // BillRoomInfoModal,
  94. historyLookRoom
  95. },
  96. data() {
  97. return {
  98. title: "",
  99. busWaiterList: [],
  100. labelCol: {
  101. xs: {
  102. span: 24
  103. },
  104. sm: {
  105. span: 5
  106. },
  107. },
  108. wrapperCol: {
  109. xs: {
  110. span: 24
  111. },
  112. sm: {
  113. span: 16
  114. },
  115. },
  116. waiterId: '',
  117. visibleLook: false,
  118. status: null,
  119. // 表头
  120. columns: [{
  121. title: "查房状态",
  122. align: "center",
  123. dataIndex: 'state',
  124. customRender: function (text) {
  125. let txt = "";
  126. switch (text) {
  127. case 0:
  128. txt = "待查房";
  129. break;
  130. case 1:
  131. txt = "等待查房";
  132. break;
  133. case 2:
  134. txt = "正在查房";
  135. break;
  136. case 3:
  137. txt = "查房完毕";
  138. break;
  139. case 4:
  140. txt = "取消查房";
  141. break;
  142. default:
  143. break;
  144. }
  145. return txt;
  146. },
  147. },
  148. {
  149. title: "房号",
  150. align: "center",
  151. dataIndex: "roomName",
  152. },
  153. {
  154. title: "客人姓名",
  155. align: "center",
  156. dataIndex: "contactName",
  157. scopedSlots: { customRender: 'name' }
  158. },
  159. {
  160. title: "查房发起人",
  161. align: "center",
  162. dataIndex: "promoterBy",
  163. },
  164. {
  165. title: "查房发起时间",
  166. align: "center",
  167. dataIndex: "promoterTime",
  168. },
  169. {
  170. title: "查房备注",
  171. align: "center",
  172. dataIndex: "remark",
  173. },
  174. {
  175. title: "查房人",
  176. align: "center",
  177. dataIndex: "cfWaiterName",
  178. },
  179. {
  180. title: "查房时间",
  181. align: "center",
  182. dataIndex: "cfTime",
  183. },
  184. {
  185. title: "查房反馈",
  186. align: "center",
  187. dataIndex: "feedback",
  188. },
  189. {
  190. title: "查房完成人",
  191. align: "center",
  192. dataIndex: "completedBy",
  193. },
  194. {
  195. title: "查房完成时间",
  196. align: "center",
  197. dataIndex: "completedTime",
  198. },
  199. {
  200. title: "房间状态",
  201. align: "center",
  202. dataIndex: "roomStatus",
  203. }
  204. ],
  205. url: {
  206. list: "/fw/fwRoomExamine/list",
  207. delete: "/order/cesOrderMessage/delete",
  208. deleteBatch: "/order/cesOrderMessage/deleteBatch",
  209. exportXlsUrl: "/order/cesOrderMessage/exportXls",
  210. importExcelUrl: "order/cesOrderMessage/importExcel",
  211. },
  212. dictOptions: {},
  213. superFieldList: [],
  214. hotelList: [],
  215. queryParam: {
  216. // type: 1,
  217. // livingStatus: -1,
  218. // bookingStatus: 1
  219. },
  220. remarks: "",
  221. };
  222. },
  223. created() {
  224. getAction("/business/busWaiter/list", {
  225. // hotelId: _info.id,
  226. pageNo: 1,
  227. pageSize: 99999,
  228. }).then((res) => {
  229. if (res.success) {
  230. this.busWaiterList = res.result.records;
  231. }
  232. });
  233. },
  234. computed: {
  235. importExcelUrl: function () {
  236. return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`;
  237. },
  238. },
  239. methods: {
  240. /**
  241. * 根据选中数据设置按钮是否可用
  242. */
  243. setBtnsDisable(type) {
  244. if (this.selectedRowKeys.length === 0) {
  245. return true
  246. }
  247. if (type == 4 && this.selectionRows.some(item => item.state == 1 || item.state == 2)) {
  248. return false
  249. }
  250. if (type == 1 && this.selectionRows.some(item => item.state == 0 || item.state == 4)) {
  251. return false
  252. }
  253. if (type == 2 && this.selectionRows.some(item => item.state == 1)) {
  254. return false
  255. }
  256. if (type == 3 && this.selectionRows.some(item => item.state == 2)) {
  257. return false
  258. }
  259. return true
  260. },
  261. /**
  262. * 设置取消查房
  263. */
  264. cancelRoom() {
  265. // console.log(this.selectionRows);
  266. this.status = 4
  267. this.selectionRows.forEach(item => {
  268. this.editLookRoom(item, 4)
  269. })
  270. // this.editLookRoom(this.selectionRows.livingOrderId, 4)
  271. },
  272. changeCancel(){
  273. this.remarks = ''
  274. this.waiterId = ''
  275. this.visibleLook = false
  276. },
  277. editLookRoom(data, state, remark = '') {
  278. // let obj = {
  279. // id: id,
  280. // livingOrderId: livingOrderId,
  281. // state: state,
  282. // remark: remark,
  283. // waiterId: this.waiterId,
  284. // cfTime: this.waiterId?new Date().toLocaleString().replaceAll('/','-'):''
  285. // }
  286. data.state = state*1
  287. if (remark && this.status !=3) {
  288. data.remark = remark
  289. }
  290. if (this.status == 2) {
  291. data.waiterId = this.waiterId
  292. data.cfTime = new Date().toLocaleString().replaceAll('/', '-')
  293. }
  294. if (this.status == 3) {
  295. // data.remark = ''
  296. data.feedback = this.remarks
  297. }
  298. console.log(typeof data.state);
  299. console.log(data);
  300. // return
  301. httpAction("/fw/fwRoomExamine/checkRoom", data, 'post').then(res => {
  302. this.confirmLoading = false;
  303. if (res.success) {
  304. this.$message.success("成功");
  305. this.onClearSelected()
  306. this.visibleLook = false
  307. this.loadData()
  308. } else {
  309. this.$message.warning(res.message);
  310. }
  311. })
  312. .finally(() => {
  313. this.remarks = ''
  314. this.waiterId = ''
  315. this.confirmLoading = false;
  316. });
  317. console.log('3333333333333333333333333333', this.waiterId, this.remarks);
  318. },
  319. /**
  320. * 设置等待查房
  321. */
  322. setWaitRoom() {
  323. this.title = '申请查房'
  324. this.status = 1
  325. this.visibleLook = true
  326. },
  327. /**
  328. * 设置正在查房
  329. */
  330. setInRoom() {
  331. this.title = '设置正在查房'
  332. this.waiterId = ''
  333. this.status = 2
  334. this.visibleLook = true
  335. },
  336. /**
  337. * 设置查房完毕
  338. */
  339. setFinishRoom() {
  340. this.title = '查房完毕'
  341. this.status = 3
  342. this.visibleLook = true
  343. },
  344. /**
  345. * 表单提交
  346. */
  347. submitOK() {
  348. if (this.status == 2 && !this.waiterId) {
  349. this.$message.warning('请选择查房人')
  350. return
  351. }
  352. this.confirmLoading = true;
  353. this.selectionRows.forEach(item => {
  354. this.editLookRoom(item, this.status, this.remarks)
  355. })
  356. },
  357. handleBillInfo(data){
  358. console.log(data);
  359. }
  360. },
  361. };
  362. </script>
  363. <style scoped>
  364. @import "~@assets/less/common.less";
  365. </style>