ticketingCollection.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
  4. <el-form-item label="取票码" label-width="100px">
  5. <el-input
  6. v-model="queryParams.qrcodeNo"
  7. placeholder="请输入取票码"
  8. clearable
  9. style="width: 240px;"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="手机号:" prop="mobile">
  14. <el-input
  15. v-model="queryParams.mobile"
  16. placeholder="请输入手机号"
  17. clearable
  18. style="width: 240px;"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item label="身份证号:" label-width="120px" prop="idcard">
  23. <el-input
  24. v-model="queryParams.idcard"
  25. placeholder="请输入身份证号"
  26. clearable
  27. style="width: 240px;"
  28. @keyup.enter.native="handleQuery"
  29. />
  30. </el-form-item>
  31. <el-form-item label="订单状态">
  32. <el-select
  33. v-model="queryParams.orderStatus"
  34. placeholder="订单状态"
  35. clearable
  36. style="width: 100%"
  37. >
  38. <el-option
  39. v-for="dict in dict.type.order_status_type"
  40. :key="dict.value"
  41. :label="dict.label"
  42. :value="dict.value"
  43. />
  44. </el-select>
  45. </el-form-item>
  46. <el-form-item>
  47. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  48. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  49. </el-form-item>
  50. </el-form>
  51. <el-row :gutter="10" class="mb8">
  52. <el-col :span="1.5">
  53. <el-button
  54. :disabled="multipleSelection.length == 0"
  55. type="primary"
  56. plain
  57. icon="el-icon-plus"
  58. size="mini"
  59. @click="print(multipleSelection)"
  60. v-hasPermi="['windowTicketSales:ticketingCollection:print']"
  61. >批量打印名票</el-button>
  62. </el-col>
  63. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  64. </el-row>
  65. <el-table
  66. ref="tables"
  67. v-loading="loading"
  68. :data="dataList"
  69. @selection-change="handleSelectionChange"
  70. border>
  71. <el-table-column type="selection" width="55"></el-table-column>
  72. <el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
  73. <el-table-column label="姓名" align="center" prop="name" />
  74. <el-table-column label="身份证号" align="center" prop="qrcodeNo" />
  75. <el-table-column label="取票码" align="center" prop="qrcodeNo" />
  76. <el-table-column label="订单号" align="center" prop="orderId" />
  77. <el-table-column label="剧目名称" align="center" prop="performName" />
  78. <el-table-column label="票务名称" align="center" prop="goodsName" />
  79. <el-table-column label="座位信息" align="center" prop="seatName" />
  80. <el-table-column label="座位类型" align="center" prop="seatTypeName" />
  81. <el-table-column label="节目播出日期" align="center" prop="performDate" />
  82. <el-table-column label="下单时间" align="center" prop="createTime" />
  83. <el-table-column label="购票渠道" align="center" prop="source">
  84. <template slot-scope="scope">
  85. <dict-tag :options="dict.type.order_form_type" :value="scope.row.source"/>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="订单状态" align="center" prop="status">
  89. <template slot-scope="scope">
  90. <dict-tag :options="dict.type.order_status_type" :value="scope.row.status"/>
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="操作" align="center" fixed="right" width="80" class-name="small-padding fixed-width">
  94. <template slot-scope="scope">
  95. <el-button
  96. size="mini"
  97. type="text"
  98. @click="print([scope.row])"
  99. v-hasPermi="['windowTicketSales:ticketingCollection:print']"
  100. >打印门票</el-button>
  101. </template>
  102. </el-table-column>
  103. <template slot="empty">
  104. <div>
  105. <span>未查询到相关订单,请重新输入!</span>
  106. </div>
  107. </template>
  108. </el-table>
  109. </div>
  110. </template>
  111. <script>
  112. import { pageList,printApi } from '@/api/windowTicketSales/ticketingCollection'
  113. export default {
  114. name: "distributionapplication",
  115. dicts: ['order_form_type','order_status_type'],
  116. data() {
  117. return {
  118. // 遮罩层
  119. loading: false,
  120. // 选中数组
  121. multipleSelection: [],
  122. // 显示搜索条件
  123. showSearch: true,
  124. // 总条数
  125. total: 0,
  126. // 用户表格数据
  127. dataList: null,
  128. // 查询参数
  129. queryParams: {
  130. // pageNum: 1,
  131. // pageSize: 10,
  132. // type: undefined
  133. orderStatus: 3
  134. },
  135. visibleStatus: false,
  136. visibleStatusLoading: false,
  137. ruleForm: {},
  138. rules: {
  139. remark: [
  140. { required: true, message: '请输入备注', trigger: ['blur','change'] },
  141. { min: 0, max: 50, message: '长度在 0 到 50 个字符', trigger: ['blur','change'] }
  142. ]
  143. }
  144. };
  145. },
  146. created() {
  147. //this.getList();
  148. },
  149. methods: {
  150. /** 查询列表 */
  151. getList() {
  152. this.loading = true;
  153. pageList(this.queryParams,)
  154. .then(response => {
  155. this.dataList = response.data.list;
  156. //this.total = response.data.total;
  157. this.loading = false;
  158. }
  159. );
  160. },
  161. // 取消按钮
  162. cancel() {
  163. this.open = false;
  164. },
  165. /** 搜索按钮操作 */
  166. handleQuery() {
  167. this.getList();
  168. },
  169. /** 重置按钮操作 */
  170. resetQuery() {
  171. this.dateRange = [];
  172. this.$set(this.queryParams, 'qrcodeNo', '');
  173. this.$set(this.queryParams, 'idcard', '');
  174. this.$set(this.queryParams, 'mobile', '');
  175. this.$set(this.queryParams, 'orderStatus', '');
  176. this.handleQuery();
  177. },
  178. setRemark(data) {
  179. this.visibleStatus = true
  180. this.resetForm.id = data.id
  181. },
  182. submitForm(formName) {
  183. this.$refs[formName].validate(async (valid) => {
  184. if (valid) {
  185. try {
  186. this.visibleStatusLoading = true
  187. let res = await setRemark({
  188. id: this.resetForm.id,
  189. "remark": this.ruleForm.remark
  190. })
  191. this.visibleStatus = false
  192. this.visibleStatusLoading = false
  193. this.resetForm('ruleForm')
  194. this.queryParams.pageNum = 1;
  195. this.getList()
  196. } catch (error) {
  197. this.visibleStatusLoading = false
  198. }
  199. } else {
  200. this.visibleStatusLoading = false
  201. return false;
  202. }
  203. });
  204. },
  205. resetForm(formName) {
  206. this.$refs[formName].resetFields();
  207. },
  208. handleSelectionChange(val) {
  209. console.log("val====",val)
  210. this.multipleSelection = val;
  211. },
  212. // 打印
  213. async print(list = []){
  214. if(!list||list.length==0) return
  215. let idList = []
  216. list.forEach((item,index)=>{
  217. idList.push(item.id)
  218. })
  219. console.log("isList===",idList)
  220. return
  221. try {
  222. let res = await printApi({viewerList:idList})
  223. if(res.code == 200) {
  224. }else {
  225. throw new Error(res)
  226. }
  227. } catch (error) {
  228. console.error("error=====",error)
  229. }
  230. },
  231. }
  232. };
  233. </script>