countNoConsume.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" @submit.native.prevent :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="订单条码" prop="orderNo">
  5. <el-input v-model="queryParams.orderNo" placeholder="请输入订单条码" clearable @keyup.enter.native="handleQuery" />
  6. </el-form-item>
  7. <el-form-item label="交易时间">
  8. <el-date-picker v-model="createTimeRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :clearable="false" :picker-options="pickerOptions"></el-date-picker>
  9. </el-form-item>
  10. <el-form-item label="会员手机" prop="phoneNumber">
  11. <el-input v-model.number="queryParams.phoneNumber" placeholder="请输入会员手机" clearable @keyup.enter.native="handleQuery" />
  12. </el-form-item>
  13. <el-form-item label="会员条码" prop="userId">
  14. <el-input v-model="queryParams.userId" placeholder="会员条码" clearable @keyup.enter.native="handleQuery" />
  15. </el-form-item>
  16. <el-form-item>
  17. <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
  18. <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
  19. </el-form-item>
  20. </el-form>
  21. <el-row :gutter="10" class="mb8">
  22. <el-card>
  23. <span>
  24. 总衣服件数: <span style="color: #ff4949">{{ countCloth }}</span> 件
  25. </span>
  26. <span style="margin-left: 20px">
  27. 未收金额: <span style="color: #ff4949">{{ countWillMoney }}</span> 元</span
  28. >
  29. </el-card>
  30. </el-row>
  31. <el-row :gutter="10" class="mb8">
  32. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  33. </el-row>
  34. <el-table v-loading="loading" fit highlight-current-row border stripe :data="clothOrderList" style="margin-top: 10px">
  35. <el-table-column label="订单编号" align="center" prop="orderNo" width="200" fixed="left" />
  36. <el-table-column label="客户姓名" align="center" prop="userName" />
  37. <el-table-column label="客户手机号" align="center" prop="phoneNumber" width="130" />
  38. <el-table-column label="衣服件数" align="center" prop="orderClothCount" />
  39. <el-table-column label="金额(元)" align="center" prop="orderClothPrice" />
  40. <el-table-column label="实收金额(元)" align="center" prop="payAmount" />
  41. <el-table-column label="收款类型" align="center" prop="payType">
  42. <template slot-scope="scope">
  43. <dict-tag :options="dict.type.recharge_pay_type" :value="scope.row.payType" />
  44. </template>
  45. </el-table-column>
  46. <el-table-column label="店员姓名" align="center" prop="employeeName" />
  47. <el-table-column label="交易时间" align="center" prop="createTime" width="160" />
  48. <el-table-column label="是否付款" align="center" prop="hasPay">
  49. <template slot-scope="scope">
  50. <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.hasPay" />
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
  55. </div>
  56. </template>
  57. <script>
  58. import { listCountNoConsumeByClothOrder } from '@/api/order/cloth'
  59. export default {
  60. name: 'CountNoConsume',
  61. dicts: ['sys_yes_no', 'recharge_pay_type'],
  62. data() {
  63. return {
  64. // 遮罩层
  65. loading: true,
  66. // 选中数组
  67. ids: [],
  68. // 非单个禁用
  69. single: true,
  70. // 非多个禁用
  71. multiple: true,
  72. // 显示搜索条件
  73. showSearch: true,
  74. // 总条数
  75. total: 0,
  76. // 洗衣订单衣服明细表格数据
  77. clothOrderList: [],
  78. // 弹出层标题
  79. title: '',
  80. // 是否显示弹出层
  81. open: false,
  82. // 查询参数
  83. queryParams: {
  84. pageNum: 1,
  85. pageSize: 10,
  86. phoneNumber: null,
  87. userId: null,
  88. beginCreateTime: '',
  89. endCreateTime: ''
  90. },
  91. createTimeRange: [],
  92. countCloth: 0,
  93. countWillMoney: 0,
  94. countAlreadyMoney: 0,
  95. pickerOptions: {
  96. onPick: this.getPickDate,
  97. disabledDate: this.disabledDate
  98. },
  99. pickDate: '' // 存放getPickDate获取的数据
  100. }
  101. },
  102. created() {
  103. this.setDefaultRange()
  104. this.getList()
  105. },
  106. methods: {
  107. setDefaultRange() {
  108. const end = this.formatDates(new Date(), 2)
  109. const start = new Date()
  110. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
  111. this.createTimeRange = [this.formatDates(start, 2), end]
  112. },
  113. getPickDate(pick) {
  114. this.pickDate = pick
  115. },
  116. disabledDate(date) {
  117. const { minDate, maxDate } = this.pickDate
  118. if (minDate && !maxDate) {
  119. const diff = Math.abs(minDate.valueOf() - date.valueOf())
  120. if (diff > 1000 * 3600 * 24 * 90) {
  121. return true
  122. }
  123. }
  124. },
  125. /** 查询洗衣订单衣服明细列表 */
  126. getList() {
  127. this.loading = true
  128. if (null != this.createTimeRange && '' != this.createTimeRange) {
  129. this.queryParams['beginCreateTime'] = this.createTimeRange[0]
  130. this.queryParams['endCreateTime'] = this.createTimeRange[1]
  131. } else {
  132. delete this.queryParams.beginCreateTime
  133. delete this.queryParams.endCreateTime
  134. }
  135. listCountNoConsumeByClothOrder(this.queryParams).then((response) => {
  136. this.clothOrderList = response.data.orderClothCountConsumeVOList
  137. this.total = response.data.total
  138. this.countCloth = response.data.totalOrderClothCount
  139. this.countWillMoney = response.data.totalWillMoney
  140. this.countAlreadyMoney = response.data.totalAlreadyMoney
  141. this.loading = false
  142. })
  143. },
  144. // 取消按钮
  145. cancel() {
  146. this.open = false
  147. this.reset()
  148. },
  149. // 表单重置
  150. reset() {
  151. this.resetForm('form')
  152. },
  153. /** 搜索按钮操作 */
  154. handleQuery() {
  155. this.queryParams.pageNum = 1
  156. this.getList()
  157. },
  158. /** 重置按钮操作 */
  159. resetQuery() {
  160. // this.createTimeRange = null;
  161. this.queryParams.beginCreateTime = null
  162. this.queryParams.endCreateTime = null
  163. this.setDefaultRange()
  164. this.resetForm('queryForm')
  165. this.handleQuery()
  166. },
  167. // 多选框选中数据
  168. handleSelectionChange(selection) {
  169. this.ids = selection.map((item) => item.id)
  170. this.single = selection.length !== 1
  171. this.multiple = !selection.length
  172. },
  173. checkClose(done) {
  174. this.$confirm('是否关闭表单,关闭后数据将丢失?')
  175. .then(function () {
  176. done()
  177. })
  178. .then(() => {})
  179. .catch(() => {})
  180. }
  181. }
  182. }
  183. </script>