meetingroom.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :span="3">
  8. <a-form-item label="">
  9. <j-input placeholder="名称" v-model="queryParam.name"></j-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="8">
  13. <span
  14. style="float: left; overflow: hidden"
  15. class="table-page-search-submitButtons"
  16. >
  17. <a-button type="primary" @click="searchQuery" icon="search"
  18. >查询</a-button
  19. >
  20. </span>
  21. </a-col>
  22. </a-row>
  23. </a-form>
  24. </div>
  25. <!-- 查询区域-END -->
  26. <!-- 操作按钮区域 -->
  27. <div class="table-operator">
  28. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  29. <a-button @click="batchDel" type="danger" icon="minus">批量删除</a-button>
  30. </div>
  31. <!-- table区域-begin -->
  32. <div>
  33. <a-table
  34. ref="table"
  35. size="middle"
  36. :scroll="{ x: true }"
  37. bordered
  38. rowKey="id"
  39. :columns="columns"
  40. :dataSource="dataSource"
  41. :pagination="ipagination"
  42. :loading="loading"
  43. :rowSelection="{
  44. selectedRowKeys: selectedRowKeys,
  45. onChange: onSelectChange,
  46. }"
  47. class="j-table-force-nowrap"
  48. @change="handleTableChange"
  49. >
  50. <template slot="htmlSlot" slot-scope="text">
  51. <div v-html="text"></div>
  52. </template>
  53. <template slot="imgSlot" slot-scope="text, record">
  54. <span v-if="!text" style="font-size: 12px; font-style: italic"
  55. >无图片</span
  56. >
  57. <img
  58. v-else
  59. :src="getImgView(text)"
  60. :preview="record.id"
  61. height="25px"
  62. alt=""
  63. style="max-width: 80px; font-size: 12px; font-style: italic"
  64. />
  65. </template>
  66. <template slot="fileSlot" slot-scope="text">
  67. <span v-if="!text" style="font-size: 12px; font-style: italic"
  68. >无文件</span
  69. >
  70. <a-button
  71. v-else
  72. :ghost="true"
  73. type="primary"
  74. icon="download"
  75. size="small"
  76. @click="downloadFile(text)"
  77. >
  78. 下载
  79. </a-button>
  80. </template>
  81. <span slot="action" slot-scope="text, record">
  82. <a v-if="record.status != 1" @click="setStatus(record,1)">启用</a>
  83. <a v-else @click="setStatus(record,0)">禁用</a>
  84. <a-divider type="vertical" />
  85. <a @click="handleEdit(record)">编辑</a>
  86. <a-divider type="vertical" />
  87. <a-dropdown>
  88. <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
  89. <a-menu slot="overlay">
  90. <a-menu-item>
  91. <a @click="handleDetail(record)">详情</a>
  92. </a-menu-item>
  93. <a-menu-item>
  94. <a-popconfirm
  95. title="确定删除吗?"
  96. @confirm="() => handleDelete(record.id)"
  97. >
  98. <a>删除</a>
  99. </a-popconfirm>
  100. </a-menu-item>
  101. </a-menu>
  102. </a-dropdown>
  103. </span>
  104. </a-table>
  105. </div>
  106. <bus-meeting-room-modal
  107. ref="modalForm"
  108. @ok="modalFormOk"
  109. ></bus-meeting-room-modal>
  110. </a-card>
  111. </template>
  112. <script>
  113. import "@/assets/less/TableExpand.less";
  114. import { mixinDevice } from "@/utils/mixin";
  115. import { JeecgListMixin } from "@/mixins/JeecgListMixin";
  116. import BusMeetingRoomModal from "./modules/meetingRoom/BusMeetingRoomModal";
  117. import { httpAction, postAction } from "@/api/manage";
  118. export default {
  119. name: "BusMeetingRoomList",
  120. mixins: [JeecgListMixin, mixinDevice],
  121. components: {
  122. BusMeetingRoomModal,
  123. },
  124. data() {
  125. return {
  126. description: "bus_meeting_room管理页面",
  127. // 表头
  128. columns: [
  129. {
  130. title: "名称",
  131. align: "center",
  132. dataIndex: "name",
  133. },
  134. {
  135. title: "规格",
  136. align: "center",
  137. dataIndex: "spec",
  138. },
  139. {
  140. title: "面积",
  141. align: "center",
  142. dataIndex: "area",
  143. },
  144. {
  145. title: "人数",
  146. align: "center",
  147. dataIndex: "number",
  148. },
  149. {
  150. title: "管理员姓名",
  151. align: "center",
  152. dataIndex: "adminName",
  153. },
  154. {
  155. title: "地址",
  156. align: "center",
  157. dataIndex: "address",
  158. },
  159. {
  160. title: "设备",
  161. align: "center",
  162. dataIndex: "facility",
  163. },
  164. {
  165. title: "排序",
  166. align: "center",
  167. dataIndex: "sort",
  168. },
  169. {
  170. title: "描述",
  171. align: "center",
  172. dataIndex: "remark",
  173. },
  174. {
  175. title: "状态",
  176. align: "center",
  177. dataIndex: "status",
  178. customRender: function (text) {
  179. return text == 1 ? "启用" : "未启用";
  180. },
  181. },
  182. {
  183. title: "操作",
  184. dataIndex: "action",
  185. align: "center",
  186. fixed: "right",
  187. width: 147,
  188. scopedSlots: { customRender: "action" },
  189. },
  190. ],
  191. url: {
  192. list: "/business/busMeetingRoom/list",
  193. delete: "/business/busMeetingRoom/delete",
  194. deleteBatch: "/business/busMeetingRoom/deleteBatch",
  195. exportXlsUrl: "/business/busMeetingRoom/exportXls",
  196. importExcelUrl: "business/busMeetingRoom/importExcel",
  197. },
  198. dictOptions: {},
  199. superFieldList: [],
  200. };
  201. },
  202. created() {
  203. this.getSuperFieldList();
  204. },
  205. computed: {
  206. importExcelUrl: function () {
  207. return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`;
  208. },
  209. },
  210. methods: {
  211. setStatus(record, status) {
  212. record.status = status;
  213. postAction("/business/busMeetingRoom/edit", record).then((res) => {
  214. if (res.success) {
  215. this.$message.success(res.message);
  216. } else {
  217. this.$message.warning(res.message);
  218. }
  219. });
  220. },
  221. initDictConfig() {},
  222. getSuperFieldList() {
  223. let fieldList = [];
  224. fieldList.push({ type: "string", value: "tenantId", text: "关联租户" });
  225. fieldList.push({ type: "string", value: "hotelId", text: "关联酒店" });
  226. fieldList.push({ type: "string", value: "name", text: "名称" });
  227. fieldList.push({ type: "string", value: "spec", text: "规格" });
  228. fieldList.push({ type: "number", value: "area", text: "金额" });
  229. fieldList.push({ type: "int", value: "number", text: "人数" });
  230. fieldList.push({
  231. type: "string",
  232. value: "adminName",
  233. text: "管理员姓名",
  234. });
  235. fieldList.push({ type: "string", value: "address", text: "地址" });
  236. fieldList.push({ type: "string", value: "facility", text: "设备" });
  237. fieldList.push({ type: "int", value: "sort", text: "排序" });
  238. fieldList.push({ type: "string", value: "remark", text: "描述" });
  239. fieldList.push({ type: "int", value: "status", text: "状态" });
  240. this.superFieldList = fieldList;
  241. },
  242. },
  243. };
  244. </script>
  245. <style scoped>
  246. @import "~@assets/less/common.less";
  247. </style>