index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. :inline="true"
  7. v-show="showSearch"
  8. label-width="90px"
  9. >
  10. <el-form-item label="盲票组名称">
  11. <el-input
  12. v-model="queryParams.name"
  13. placeholder="请输入盲票组名称"
  14. clearable
  15. size="small"
  16. style="width: 240px"
  17. @keyup.enter.native="handleQuery"
  18. />
  19. </el-form-item>
  20. <el-form-item label="盲票组类型">
  21. <el-select
  22. v-model="queryParams.ticketType"
  23. placeholder="请选择盲票组类型"
  24. clearable
  25. size="small"
  26. @change="handleQuery"
  27. >
  28. <el-option
  29. v-for="item in ticketTypeArr"
  30. :key="item.areaId"
  31. :label="item.areaName"
  32. :value="item.areaId"
  33. />
  34. </el-select>
  35. </el-form-item>
  36. <el-form-item label="盲票组状态">
  37. <el-select
  38. v-model="queryParams.ticketState"
  39. placeholder="请选择盲票组状态"
  40. clearable
  41. size="small"
  42. @change="handleQuery"
  43. >
  44. <el-option
  45. v-for="item in ticketStateArr"
  46. :key="item.areaId"
  47. :label="item.areaName"
  48. :value="item.areaId"
  49. />
  50. </el-select>
  51. </el-form-item>
  52. <el-form-item>
  53. <el-button
  54. type="primary"
  55. icon="el-icon-search"
  56. size="mini"
  57. @click="handleQuery"
  58. >搜索</el-button
  59. >
  60. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
  61. >重置</el-button
  62. >
  63. </el-form-item>
  64. </el-form>
  65. <el-row :gutter="10" class="mb8">
  66. <el-col :span="1.5">
  67. <el-button
  68. type="primary"
  69. icon="el-icon-plus"
  70. size="mini"
  71. @click="handleAdd"
  72. v-hasPermi="['business:ticket:add']"
  73. >添加盲票组</el-button
  74. >
  75. </el-col>
  76. <right-toolbar
  77. :showSearch.sync="showSearch"
  78. @queryTable="getList"
  79. ></right-toolbar>
  80. </el-row>
  81. <el-table
  82. v-loading="loading"
  83. :data="list"
  84. @selection-change="handleSelectionChange"
  85. class="el-table"
  86. >
  87. <el-table-column
  88. type="selection"
  89. width="55"
  90. align="center"
  91. fixed="left"
  92. />
  93. <el-table-column label="盲票组ID" prop="boxId" min-width="80" />
  94. <el-table-column label="盲票图片" prop="storeName" min-width="100">
  95. <template slot-scope="scope">
  96. <div>
  97. <el-image
  98. style="width: 100px; height: 100px"
  99. :src="scope.row.picUrl"
  100. :preview-src-list="[scope.row.picUrl]"
  101. />
  102. </div>
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="盲票组名称" prop="title" min-width="85" />
  106. <el-table-column label="盲票组面值" prop="billType" min-width="85">
  107. <template slot-scope="scope">
  108. <div>¥{{ $numberFormat(scope.row.facePrice) }}</div>
  109. </template>
  110. </el-table-column>
  111. <el-table-column label="盲票总数" prop="quantity" width="80" />
  112. <el-table-column label="已售张数" prop="saleQty" min-width="80" />
  113. <el-table-column label="盲票类型" prop="realAmt" min-width="80">
  114. <template slot-scope="scope">
  115. {{ scope.row.type == 1 ? "线下" : "线上" }}
  116. </template>
  117. </el-table-column>
  118. <el-table-column label="采购单价" prop="status" min-width="80">
  119. <template slot-scope="scope">
  120. <div>¥{{ $numberFormat(scope.row.pkgSalePrice) }}</div>
  121. </template>
  122. </el-table-column>
  123. <el-table-column label="已采购数量" prop="salePkgQty" min-width="80" />
  124. <el-table-column label="状态" prop="status" min-width="80">
  125. <template slot-scope="scope">
  126. {{ scope.row.status.desc }}
  127. </template>
  128. </el-table-column>
  129. <el-table-column
  130. label="操作"
  131. align="center"
  132. show-overflow-tooltip
  133. class-name="small-padding fixed-width"
  134. min-width="150"
  135. fixed="right"
  136. >
  137. <template>
  138. <div>
  139. <el-button
  140. size="mini"
  141. type="text"
  142. disabled
  143. @click="handleDetail(scope.row)"
  144. v-hasPermi="['']"
  145. >查看</el-button
  146. >
  147. </div>
  148. </template>
  149. </el-table-column>
  150. </el-table>
  151. <pagination
  152. v-show="total > 0"
  153. :total="total"
  154. :page.sync="pageParams.pageNum"
  155. :limit.sync="pageParams.pageSize"
  156. @pagination="getList"
  157. />
  158. </div>
  159. </template>
  160. <script>
  161. import { getTicketList } from "@/api/business/ticket";
  162. import { publicFileGetUrl } from "@/api/common";
  163. export default {
  164. name: "Ticket",
  165. data() {
  166. return {
  167. loading: false,
  168. showSearch: true,
  169. queryParams: {
  170. name: "",
  171. ticketType: "",
  172. ticketState: "",
  173. },
  174. pageParams: {
  175. pageNum: 1,
  176. pageSize: 10,
  177. },
  178. ticketTypeArr: [],
  179. ticketStateArr: [],
  180. // 总条数
  181. total: 10,
  182. list: [],
  183. };
  184. },
  185. created() {
  186. this.getList();
  187. },
  188. methods: {
  189. // 盲票组列表
  190. getList() {
  191. this.loading = true;
  192. getTicketList(
  193. "pageNum=" +
  194. this.pageParams.pageNum +
  195. "&pageSize=" +
  196. this.pageParams.pageSize +
  197. "&",
  198. this.queryParams
  199. )
  200. .then((res) => {
  201. this.loading = false;
  202. if (res.code == 0) {
  203. res.rows.forEach((item) => {
  204. let picUrlArr = item.picUrl.split(",");
  205. item.picUrl = publicFileGetUrl + picUrlArr[0];
  206. item.status = JSON.parse(item.status);
  207. });
  208. this.total = res.total;
  209. this.list = res.rows;
  210. }
  211. })
  212. .catch(() => {
  213. this.loading = false;
  214. });
  215. },
  216. // 搜索
  217. handleQuery() {},
  218. // 重置
  219. resetQuery() {},
  220. // 添加盲票组
  221. handleAdd() {
  222. this.$router.push({ name: "TicketCreate" });
  223. },
  224. // 表格多选
  225. handleSelectionChange() {},
  226. handleDetail(){
  227. },
  228. },
  229. components: {},
  230. mounted() {},
  231. destroyed() {},
  232. };
  233. </script>
  234. <style lang="scss" scoped>
  235. </style>