UserList.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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="6">
  8. <a-form-item label="">
  9. <j-input
  10. placeholder="会员名称"
  11. v-model="queryParam.user_name"
  12. ></j-input>
  13. </a-form-item>
  14. </a-col>
  15. <a-col :span="6">
  16. <a-form-item label="">
  17. <j-input
  18. placeholder="会员手机号"
  19. v-model="queryParam.mobile"
  20. ></j-input>
  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. @click="handleAdd"
  33. type="primary"
  34. icon="plus"
  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. <!-- table区域-begin -->
  45. <div>
  46. <a-table
  47. ref="table"
  48. size="middle"
  49. :scroll="{ x: true }"
  50. bordered
  51. rowKey="id"
  52. :columns="columns"
  53. :dataSource="dataSource"
  54. :pagination="ipagination"
  55. :loading="loading"
  56. :rowSelection="{
  57. selectedRowKeys: selectedRowKeys,
  58. onChange: onSelectChange,
  59. }"
  60. class="j-table-force-nowrap"
  61. @change="handleTableChange"
  62. >
  63. <template slot="htmlSlot" slot-scope="text">
  64. <div v-html="text"></div>
  65. </template>
  66. <template slot="imgSlot" slot-scope="text, record">
  67. <span v-if="!text" style="font-size: 12px; font-style: italic"
  68. >无图片</span
  69. >
  70. <img
  71. v-else
  72. :src="getImgView(text)"
  73. :preview="record.id"
  74. height="25px"
  75. alt=""
  76. style="max-width: 80px; font-size: 12px; font-style: italic"
  77. />
  78. </template>
  79. <template slot="fileSlot" slot-scope="text">
  80. <span v-if="!text" style="font-size: 12px; font-style: italic"
  81. >无文件</span
  82. >
  83. <a-button
  84. v-else
  85. :ghost="true"
  86. type="primary"
  87. icon="download"
  88. size="small"
  89. @click="downloadFile(text)"
  90. >
  91. 下载
  92. </a-button>
  93. </template>
  94. <span slot="action" slot-scope="text, record">
  95. <a v-if="record.statusName!=='已作废'" @click="handleEdit(record)">作废</a>
  96. </span>
  97. </a-table>
  98. </div>
  99. <!-- <bus-market-coupons-used-generate-form-modal
  100. ref="modalForm"
  101. @ok="modalFormOk"
  102. ></bus-market-coupons-used-generate-form-modal> -->
  103. </a-card>
  104. </template>
  105. <script>
  106. import "@/assets/less/TableExpand.less";
  107. import { mixinDevice } from "@/utils/mixin";
  108. import { JeecgListMixin } from "@/mixins/JeecgListMixin";
  109. // import BusMarketCouponsUsedGenerateFormModal from "./BusMarketCouponsUsedGenerateFormModal";
  110. import { httpAction, getAction } from "@/api/manage";
  111. export default {
  112. name: "BusMarketCouponsUsedList",
  113. mixins: [JeecgListMixin, mixinDevice],
  114. components: {
  115. // BusMarketCouponsUsedGenerateFormModal,
  116. },
  117. props: {
  118. couponsId: {
  119. type: String,
  120. default: "",
  121. },
  122. },
  123. data() {
  124. return {
  125. description: "免房券领取使用表管理页面",
  126. // 表头
  127. columns: [
  128. {
  129. title: "券号",
  130. align: "center",
  131. dataIndex: "code",
  132. },
  133. {
  134. title: "免房券名称",
  135. align: "center",
  136. dataIndex: "conponsName",
  137. },
  138. // {不知道这个金额是干啥用,数据库表中没加金额字段
  139. // title: "金额",
  140. // align: "center",
  141. // dataIndex: "",
  142. // },
  143. {
  144. title: "姓名",
  145. align: "center",
  146. dataIndex: "userName",
  147. },
  148. {
  149. title: "房间号",
  150. align: "center",
  151. dataIndex: "roomNumber",
  152. },
  153. {
  154. title: "入住单号",
  155. align: "center",
  156. dataIndex: "checkedInNo",
  157. },
  158. {
  159. title: "手机号",
  160. align: "center",
  161. dataIndex: "mobile",
  162. },
  163. {
  164. title: "领取时间",
  165. align: "center",
  166. dataIndex: "gainTime",
  167. customRender: function (text) {
  168. return !text ? "" : text.length > 10 ? text.substr(0, 10) : text;
  169. },
  170. },
  171. {
  172. title: "使用时间",
  173. align: "center",
  174. dataIndex: "usedTime",
  175. customRender: function (text) {
  176. return !text ? "" : text.length > 10 ? text.substr(0, 10) : text;
  177. },
  178. },
  179. {
  180. title: "状态",
  181. align: "center",
  182. dataIndex: "statusName",
  183. },
  184. {
  185. title: "操作",
  186. dataIndex: "action",
  187. align: "center",
  188. fixed: "right",
  189. width: 147,
  190. scopedSlots: { customRender: "action" },
  191. },
  192. ],
  193. url: {
  194. list: "/business/busMarketCouponsUsed/list?couponsId=" + this.couponsId,
  195. delete: "/business/busMarketCouponsUsed/delete",
  196. deleteBatch: "/business/busMarketCouponsUsed/deleteBatch",
  197. exportXlsUrl: "/business/busMarketCouponsUsed/exportXls",
  198. importExcelUrl: "business/busMarketCouponsUsed/importExcel",
  199. },
  200. dictOptions: {},
  201. superFieldList: [],
  202. };
  203. },
  204. created() {
  205. this.getSuperFieldList();
  206. },
  207. computed: {
  208. importExcelUrl: function () {
  209. return `${window._CONFIG["domianURL"]}/${this.url.importExcelUrl}`;
  210. },
  211. },
  212. methods: {
  213. handleEdit(item) {
  214. var that = this;
  215. this.$confirm({
  216. title: "确认作废",
  217. content: "是否作废?",
  218. onOk: function () {
  219. httpAction(
  220. "/business/busMarketCouponsUsed/voided",
  221. { id: item.id },
  222. "put"
  223. )
  224. .then((res) => {
  225. if (res.success) {
  226. that.$message.success(res.message);
  227. item.statusName = "已作废";
  228. } else {
  229. that.$message.warning(res.message);
  230. }
  231. })
  232. .finally(() => {});
  233. },
  234. onCancel: function () {},
  235. });
  236. },
  237. initDictConfig() {},
  238. getSuperFieldList() {
  239. let fieldList = [];
  240. fieldList.push({
  241. type: "string",
  242. value: "tenantId",
  243. text: "关联租户",
  244. dictCode: "",
  245. });
  246. fieldList.push({
  247. type: "string",
  248. value: "hotelId",
  249. text: "关联酒店",
  250. dictCode: "",
  251. });
  252. fieldList.push({
  253. type: "string",
  254. value: "couponsId",
  255. text: "免房券id",
  256. dictCode: "",
  257. });
  258. fieldList.push({
  259. type: "string",
  260. value: "code",
  261. text: "券号",
  262. dictCode: "",
  263. });
  264. fieldList.push({
  265. type: "int",
  266. value: "status",
  267. text: "状态 0未领取 1已领取 2已使用 3已作废",
  268. dictCode: "",
  269. });
  270. fieldList.push({
  271. type: "string",
  272. value: "userid",
  273. text: "会员id",
  274. dictCode: "",
  275. });
  276. fieldList.push({
  277. type: "string",
  278. value: "userName",
  279. text: "姓名",
  280. dictCode: "",
  281. });
  282. fieldList.push({
  283. type: "string",
  284. value: "roomNumber",
  285. text: "房间号",
  286. dictCode: "",
  287. });
  288. fieldList.push({
  289. type: "string",
  290. value: "checkedInNo",
  291. text: "入住单号",
  292. dictCode: "",
  293. });
  294. fieldList.push({
  295. type: "string",
  296. value: "mobile",
  297. text: "手机号",
  298. dictCode: "",
  299. });
  300. fieldList.push({ type: "date", value: "gainTime", text: "领取时间" });
  301. fieldList.push({ type: "date", value: "usedTime", text: "使用时间" });
  302. this.superFieldList = fieldList;
  303. },
  304. handleAdd() {
  305. },
  306. },
  307. };
  308. </script>
  309. <style scoped>
  310. @import "~@assets/less/common.less";
  311. </style>