leasegoods.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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. <a-input placeholder="姓名" v-model="queryParam.userName"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :span="6">
  13. <a-form-item label="">
  14. <a-range-picker
  15. format="YYYY-MM-DD"
  16. :placeholder="['租借开始日期', '租借结束日期']"
  17. @change="onChange"
  18. v-model="datetime"
  19. :allowClear="false"
  20. />
  21. </a-form-item>
  22. </a-col>
  23. <a-col :md="6" :sm="8">
  24. <span
  25. style="float: left; overflow: hidden"
  26. class="table-page-search-submitButtons"
  27. >
  28. <a-button type="primary" @click="searchQuery" icon="search"
  29. >查询</a-button
  30. >
  31. <!-- <a-button
  32. type="primary"
  33. @click="searchReset"
  34. icon="reload"
  35. style="margin-left: 8px"
  36. >重置</a-button
  37. > -->
  38. </span>
  39. </a-col>
  40. </a-row>
  41. </a-form>
  42. </div>
  43. <!-- 查询区域-END -->
  44. <!-- 操作按钮区域 -->
  45. <div class="table-operator">
  46. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  47. </div>
  48. <!-- table区域-begin -->
  49. <div>
  50. <a-table
  51. ref="table"
  52. size="middle"
  53. :scroll="{ x: true }"
  54. bordered
  55. rowKey="id"
  56. :columns="columns"
  57. :dataSource="dataSource"
  58. :pagination="ipagination"
  59. :loading="loading"
  60. :rowSelection="{
  61. selectedRowKeys: selectedRowKeys,
  62. onChange: onSelectChange,
  63. }"
  64. class="j-table-force-nowrap"
  65. @change="handleTableChange"
  66. >
  67. <template slot="htmlSlot" slot-scope="text">
  68. <div v-html="text"></div>
  69. </template>
  70. <template slot="imgSlot" slot-scope="text, record">
  71. <span v-if="!text" style="font-size: 12px; font-style: italic"
  72. >无图片</span
  73. >
  74. <img
  75. v-else
  76. :src="getImgView(text)"
  77. :preview="record.id"
  78. height="25px"
  79. alt=""
  80. style="max-width: 80px; font-size: 12px; font-style: italic"
  81. />
  82. </template>
  83. <template slot="fileSlot" slot-scope="text">
  84. <span v-if="!text" style="font-size: 12px; font-style: italic"
  85. >无文件</span
  86. >
  87. <a-button
  88. v-else
  89. :ghost="true"
  90. type="primary"
  91. icon="download"
  92. size="small"
  93. @click="downloadFile(text)"
  94. >
  95. 下载
  96. </a-button>
  97. </template>
  98. <span slot="action" slot-scope="text, record">
  99. <template v-if="!record.revertDate">
  100. <a @click="handleEdit(record)">编辑</a>
  101. <a-divider type="vertical"
  102. /></template>
  103. <a @click="handleDelete(record.id)">删除</a>
  104. <template v-if="!record.revertDate">
  105. <a-divider type="vertical" />
  106. <a @click="handleRevert(record.id)">归还</a></template
  107. >
  108. </span>
  109. </a-table>
  110. </div>
  111. <ces-order-lease-goods-modal
  112. ref="modalForm"
  113. @ok="modalFormOk"
  114. ></ces-order-lease-goods-modal>
  115. </a-card>
  116. </template>
  117. <script>
  118. import "@/assets/less/TableExpand.less";
  119. import { mixinDevice } from "@/utils/mixin";
  120. import { JeecgListMixin } from "@/mixins/JeecgListMixin";
  121. import CesOrderLeaseGoodsModal from "./modules/leasegoods/CesOrderLeaseGoodsModal";
  122. import { httpAction, postAction, getAction } from "@/api/manage";
  123. export default {
  124. name: "租借物品",
  125. mixins: [JeecgListMixin, mixinDevice],
  126. components: {
  127. CesOrderLeaseGoodsModal,
  128. },
  129. data() {
  130. return {
  131. description: "客单",
  132. // 表头
  133. columns: [
  134. {
  135. title: "单号",
  136. align: "center",
  137. dataIndex: "orderNo",
  138. },
  139. {
  140. title: "房号",
  141. align: "center",
  142. dataIndex: "roomNo",
  143. },
  144. {
  145. title: "姓名",
  146. align: "center",
  147. dataIndex: "userName",
  148. },
  149. {
  150. title: "物品",
  151. align: "center",
  152. dataIndex: "goodsId",
  153. },
  154. {
  155. title: "数量",
  156. align: "center",
  157. dataIndex: "num",
  158. },
  159. {
  160. title: "押金",
  161. align: "center",
  162. dataIndex: "deposit",
  163. },
  164. {
  165. title: "租借时间",
  166. align: "center",
  167. dataIndex: "createDate",
  168. },
  169. {
  170. title: "归还时间",
  171. align: "center",
  172. dataIndex: "revertDate",
  173. },
  174. {
  175. title: "操作",
  176. dataIndex: "action",
  177. align: "center",
  178. fixed: "right",
  179. width: 147,
  180. scopedSlots: { customRender: "action" },
  181. },
  182. ],
  183. url: {
  184. list: "/order/cesOrderLeaseGoods/list",
  185. delete: "/order/cesOrderLeaseGoods/delete",
  186. deleteBatch: "/order/cesOrderLeaseGoods/deleteBatch",
  187. exportXlsUrl: "/order/cesOrderLeaseGoods/exportXls",
  188. importExcelUrl: "order/cesOrderLeaseGoods/importExcel",
  189. },
  190. dictOptions: {},
  191. superFieldList: [],
  192. hotelList: [],
  193. datetime: [],
  194. };
  195. },
  196. created() {},
  197. computed: {
  198. importExcelUrl: function () {
  199. return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`;
  200. },
  201. },
  202. methods: {
  203. onChange(e, dateString) {
  204. this.queryParam.startTime = dateString[0];
  205. this.queryParam.endTime = dateString[1];
  206. },
  207. handleRevert(id) {
  208. var that = this;
  209. postAction("/order/cesOrderLeaseGoods/revert", { id: id }).then((res) => {
  210. if (res.success) {
  211. that.$message.success(res.message);
  212. that.loadData();
  213. } else {
  214. that.$message.warning(res.message);
  215. }
  216. });
  217. },
  218. initDictConfig() {},
  219. getSuperFieldList() {
  220. let fieldList = [];
  221. fieldList.push({ type: "string", value: "tenantId", text: "关联租户" });
  222. fieldList.push({ type: "string", value: "hotelId", text: "关联酒店" });
  223. fieldList.push({ type: "int", value: "userId", text: "用户ID" });
  224. fieldList.push({
  225. type: "int",
  226. value: "messageType",
  227. text: "留言类型 1 投诉 2建议",
  228. });
  229. fieldList.push({ type: "string", value: "images", text: "图片逗号分隔" });
  230. fieldList.push({ type: "string", value: "contentBody", text: "内容" });
  231. fieldList.push({ type: "string", value: "userName", text: "姓名" });
  232. fieldList.push({ type: "string", value: "userMobile", text: "手机号" });
  233. fieldList.push({ type: "string", value: "roomNo", text: "房号" });
  234. fieldList.push({ type: "date", value: "createDate", text: "创建时间" });
  235. this.superFieldList = fieldList;
  236. },
  237. },
  238. };
  239. </script>
  240. <style scoped>
  241. @import "~@assets/less/common.less";
  242. </style>