batchCardDetailCopy.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template>
  2. <div>
  3. <a-card title="批量制卡" style="width: 100%">
  4. <div slot="extra" style="display:flex;align-items:center;">
  5. <a-switch></a-switch>制卡完毕自动跳转下一张
  6. </div>
  7. <p>
  8. <a-row type="flex" justify="center">
  9. <a-col :span="12">
  10. <div style="display:flex;flex-direction:column;justify-content:center;align-items:center;">
  11. <h3 style="color:rgba(42, 130, 228, 1)">
  12. 当前房间号
  13. </h3>
  14. <div style="color:#fff;background: rgba(42, 130, 228, 1);line-height:60px;width:50%;text-align:center;border-radius:12px;">
  15. {{roomList[roomIndex] && roomList[roomIndex].name}}
  16. </div>
  17. </div>
  18. </a-col>
  19. <a-col :span="12">
  20. <div style="display:flex;flex-direction:column;justify-content:flex-end;height:100%;">
  21. <div style="display:flex;align-items:center;justify-content:space-between">
  22. <div>
  23. 入住时长:{{'--'}}天
  24. </div>
  25. <div>
  26. 已制卡:{{'--'}}张
  27. </div>
  28. </div>
  29. <div>
  30. <!-- 入住时间:{{roomList[roomIndex] && roomList[roomIndex].Info.arrivalTime2}} -->
  31. 入住时间:{{'--'}}
  32. </div>
  33. <div>
  34. <!-- 预离时间:{{roomList[roomIndex] && roomList[roomIndex].Info.dueOutTime2}} -->
  35. 预离时间:{{'--'}}
  36. </div>
  37. </div>
  38. </a-col>
  39. </a-row>
  40. </p>
  41. <p>
  42. <a-row :gutter="[6,6]">
  43. <a-col :span="5">
  44. <a-button @click="changeErr">制新卡</a-button>
  45. </a-col>
  46. <a-col :span="5">
  47. <a-button @click="changeErr">复制卡</a-button>
  48. </a-col>
  49. <a-col :span="4">
  50. <a-button @click="changeErr">读卡</a-button>
  51. </a-col>
  52. <a-col :span="4">
  53. <a-button @click="changeErr">注销</a-button>
  54. </a-col>
  55. <a-col :span="5" v-if="roomIndex>0">
  56. <a-button @click="handleCutRoom">上一张</a-button>
  57. </a-col>
  58. <a-col :span="5" v-if="roomIndex<roomList.length-1">
  59. <a-button @click="handleAddRoom">下一张</a-button>
  60. </a-col>
  61. </a-row>
  62. </p>
  63. <p>
  64. <a-table ref="table" size="middle" :scroll="{ x: '100%' }" bordered rowKey="id" :columns="columns" :dataSource="roomList" :pagination="ipagination" :loading="loading" class="j-table-force-nowrap">
  65. <span slot="state" slot-scope="record">
  66. {{record?'已制卡':''}}
  67. <!-- {{record}} -->
  68. </span>
  69. <!-- <template slot="num" slot-scope="text, record, index">
  70. {{ (ipagination.current-1)*ipagination.pageSize+index+1}}
  71. </template> -->
  72. <span slot="action" slot-scope="text, record">
  73. <a @click="ok(record)">选择</a>
  74. </span>
  75. </a-table>
  76. </p>
  77. </a-card>
  78. </div>
  79. </template>
  80. <script>
  81. export default {
  82. data() {
  83. return {
  84. // 表头
  85. columns: [
  86. // {
  87. // title: "序号",
  88. // align: "center",
  89. // loading:false,
  90. // width: 60,
  91. // scopedSlots: {
  92. // customRender: 'num'
  93. // }
  94. // },
  95. {
  96. title: "房间号",
  97. align: "center",
  98. dataIndex: "name",
  99. },
  100. {
  101. title: "房型",
  102. align: "center",
  103. dataIndex: "layoutName",
  104. },
  105. {
  106. title: "住客姓名",
  107. align: "center",
  108. dataIndex: "roomInfo.key1",
  109. },
  110. {
  111. title: "手机号码",
  112. align: "center",
  113. dataIndex: "roomInfo.key5",
  114. },
  115. {
  116. title: "",
  117. align: "center",
  118. dataIndex: "iscard",
  119. }
  120. ],
  121. ipagination:{},
  122. dataSource:[],
  123. loading:false,
  124. roomList:[],
  125. roomIndex:0,
  126. }
  127. },
  128. methods: {
  129. changeErr(){
  130. this.$message.error('接口程序未打开,请打开接口程序')
  131. },
  132. handleAddRoom(){
  133. console.log(this.roomIndex);
  134. if (this.roomIndex == this.roomList.length-1) {
  135. this.$message.error('已经是最后一间了')
  136. return
  137. }else{
  138. this.roomIndex++;
  139. }
  140. },
  141. handleCutRoom(){
  142. console.log(this.roomIndex);
  143. if (this.roomIndex == 0) {
  144. this.$message.error('已经是第一间了')
  145. return
  146. }
  147. this.roomIndex--;
  148. },
  149. edit(record){
  150. console.log(record);
  151. // let arr = []
  152. // arr = record.roomPrices
  153. // console.log(arr);
  154. // arr.forEach(ele=>{
  155. // ele.roomInfo = record.roomIds.filter(item=> item.roomId==ele.roomId)[0]
  156. // ele.Info = record.orderInfo
  157. // })
  158. // console.log(arr);
  159. this.roomList = record;
  160. },
  161. submitForm(){
  162. this.$emit('ok')
  163. }
  164. }
  165. }
  166. </script>
  167. <style scoped>
  168. /deep/.ant-table-thead > tr > th {
  169. background: rgba(42, 130, 228, 1);
  170. color: #ffffff;
  171. }
  172. /deep/.ant-divider-horizontal {
  173. margin: 12px 0 !important;
  174. }
  175. /deep/ .ant-table-tbody .ant-table-row td {
  176. padding-top: 5px;
  177. padding-bottom: 5px;
  178. }
  179. /deep/.ant-table-thead > tr > th,
  180. .ant-table-tbody > tr > td {
  181. padding: 5px 5px !important;
  182. overflow-wrap: break-word;
  183. }
  184. </style>