index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="90px">
  4. <el-form-item label="姓名:" prop="userName">
  5. <el-input
  6. v-model.trim="queryParams.userName"
  7. placeholder="请输入姓名"
  8. clearable
  9. size="small"
  10. style="width: 140px"
  11. @keyup.enter.native="handleQuery"
  12. />
  13. </el-form-item>
  14. <el-form-item label="手机号:" prop="userPhone">
  15. <el-input
  16. v-model.trim="queryParams.userPhone"
  17. placeholder="请输入手机号"
  18. clearable
  19. size="small"
  20. style="width: 140px"
  21. @keyup.enter.native="handleQuery"
  22. />
  23. </el-form-item>
  24. <el-form-item label="支付方式:" prop="payType">
  25. <el-select v-model="queryParams.payType" style="width: 160px" placeholder="请选择支付方式" clearable size="small">
  26. <el-option label="现金支付" :value="1"/>
  27. <el-option label="微信" :value="2"/>
  28. <el-option label="支付宝" :value="3"/>
  29. </el-select>
  30. </el-form-item>
  31. <el-form-item label="支付状态:" prop="orderFlag">
  32. <el-select v-model="queryParams.orderFlag" style="width: 160px" placeholder="请选择支付状态" clearable size="small">
  33. <el-option label="未支付" :value="0"/>
  34. <el-option label="支付等待中" :value="1"/>
  35. <el-option label="支付失败" :value="2"/>
  36. <el-option label="卡充值失败" :value="3"/>
  37. <el-option label="支付成功" :value="4"/>
  38. <el-option label="取消支付" :value="5"/>
  39. <el-option label="已成功" :value="6"/>
  40. </el-select>
  41. </el-form-item>
  42. <el-form-item label="支付金额:" prop="Money">
  43. <el-input-number
  44. v-model="queryParams.startMoney"
  45. clearable
  46. size="small"
  47. type="number"
  48. style="width: 140px"
  49. @keyup.enter.native="handleQuery"></el-input-number> ~
  50. <el-input-number
  51. v-model="queryParams.endMoney"
  52. placeholder=""
  53. clearable
  54. size="small"
  55. type="number"
  56. style="width: 140px"
  57. @keyup.enter.native="handleQuery"></el-input-number>
  58. </el-form-item>
  59. <el-form-item label="支付时间:">
  60. <el-date-picker
  61. style="margin-top:5px;"
  62. v-model="dateRange"
  63. size="small"
  64. value-format="yyyy-MM-dd HH:mm:ss"
  65. type="datetimerange"
  66. range-separator="-"
  67. start-placeholder="开始日期"
  68. end-placeholder="结束日期"
  69. ></el-date-picker>
  70. </el-form-item>
  71. <el-form-item>
  72. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  73. <el-button type="primary" icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  74. <el-button
  75. type="warning"
  76. plain
  77. icon="el-icon-download"
  78. size="mini"
  79. :loading="exportLoading"
  80. @click="handleExport"
  81. v-hasPermi="['system:admin:export']"
  82. >导出</el-button>
  83. </el-form-item>
  84. </el-form>
  85. <el-table v-loading="loading" :data="adminList" height="calc(100vh - 10vh - 170px)">
  86. <el-table-column label="姓名" align="center" prop="userName" show-overflow-tooltip />
  87. <el-table-column label="手机号" align="center" prop="userPhone" show-overflow-tooltip />
  88. <el-table-column label="充值金额" align="center" prop="money" show-overflow-tooltip />
  89. <el-table-column label="支付状态" align="center" prop="orderFlag" show-overflow-tooltip >
  90. <template slot-scope="scope">
  91. <span v-if="scope.row.orderFlag == 0" style="color:#909399">未支付</span>
  92. <span v-if="scope.row.orderFlag == 1" style="color:#000000">支付等待中</span>
  93. <span v-if="scope.row.orderFlag == 2" style="color:#E6A23C">支付失败</span>
  94. <span v-if="scope.row.orderFlag == 3" style="color:#F56C6C">卡充值失败</span>
  95. <span v-if="scope.row.orderFlag == 4" style="color:#409EFF">支付成功</span>
  96. <span v-if="scope.row.orderFlag == 5" style="color:#303133">取消支付</span>
  97. <span v-if="scope.row.orderFlag == 6" style="color:#67C23A">已成功</span>
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="到账金额" align="center" prop="realMoney" show-overflow-tooltip />
  101. <el-table-column label="支付方式" align="center" prop="payType" show-overflow-tooltip >
  102. <template slot-scope="scope">
  103. <span>{{ scope.row.payType == 1 ? '现金支付':scope.row.payType ==2 ? '微信':scope.row.payType ==3 ? '支付宝': '' }}</span>
  104. </template>
  105. </el-table-column>
  106. <el-table-column label="充值场景" align="center" prop="scene" show-overflow-tooltip >
  107. <template slot-scope="scope">
  108. <span v-if="scope.row.scene == 1" style="color:#dda8eb">后台充值</span>
  109. <span v-if="scope.row.scene == 2" style="color:#E6A23C">游客充值</span>
  110. <span v-if="scope.row.scene == 3" style="color:#67C23A">ERPapp充值</span>
  111. <span v-if="scope.row.scene == 6" style="color:#00dd88e0">公众号充值</span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="充值渠道" align="center" prop="channelName" show-overflow-tooltip />
  115. <el-table-column label="时间" align="center" prop="createTime" show-overflow-tooltip >
  116. <template slot-scope="scope">
  117. <span>{{ parseTime(scope.row.createTime) }}</span>
  118. </template>
  119. </el-table-column>
  120. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
  121. <template slot-scope="scope" >
  122. <el-button v-if="scope.row.orderFlag ==3"
  123. size="small"
  124. type="primary"
  125. @click="handleUpdate(scope.row)"
  126. v-hasPermi="['system:admin:edit']"
  127. >变更状态</el-button>
  128. </template>
  129. </el-table-column>
  130. </el-table>
  131. <!-- 修改订单状态对话框 -->
  132. <!-- <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :before-close="cancel" :close-on-click-modal="false">
  133. <el-form ref="form" :model="form" :rules="rules" label-width="120px" >
  134. <el-form-item label="支付状态标识" prop="orderFlag">
  135. <el-input v-model="form.orderFlag" placeholder="支付状态标识" @input="onInput()"/>
  136. </el-form-item>
  137. </el-form>
  138. <div slot="footer" class="dialog-footer">
  139. <el-button type="primary" @click="submitForm">确 定</el-button>
  140. <el-button @click="cancel">取 消</el-button>
  141. </div>
  142. </el-dialog> -->
  143. <pagination
  144. v-show="total>0"
  145. :total="total"
  146. :page.sync="queryParams.current"
  147. :limit.sync="queryParams.size"
  148. @pagination="getList"
  149. />
  150. </div>
  151. </template>
  152. <script>
  153. import { listDetal, exportDetail, updataChannel } from "@/api/recharge/detailed";
  154. export default {
  155. name: "admin",
  156. data() {
  157. return {
  158. // 导出遮罩层
  159. exportLoading: false,
  160. // 显示搜索条件
  161. showSearch: true,
  162. // 总条数
  163. total: 0,
  164. // 参数表格数据
  165. adminList: [],
  166. // 弹出层标题
  167. title: "",
  168. // 是否显示弹出层
  169. open: false,
  170. // 日期范围
  171. dateRange: [],
  172. // 查询参数
  173. queryParams: {
  174. current: 1,
  175. size: 10,
  176. userName: undefined,
  177. payType: undefined,
  178. topChannelName: undefined,
  179. startMoney: undefined,
  180. endMoney: undefined,
  181. },
  182. // 表单参数
  183. form: {},
  184. // 表单校验
  185. rules: {
  186. name: [
  187. { required: true, message: "渠道名称不能为空", trigger: "blur" }
  188. ],
  189. aliasName: [
  190. { required: true, message: "渠道标识不能为空", trigger: "blur" }
  191. ],
  192. }
  193. };
  194. },
  195. created() {
  196. this.getList();
  197. },
  198. methods: {
  199. //强制el-input刷新
  200. onInput(){
  201. this.$forceUpdate();
  202. },
  203. /** 查询参数列表 */
  204. getList() {
  205. this.loading = true;
  206. listDetal(this.addDateRange(this.queryParams,this.dateRange,'section')).then(response => {
  207. this.adminList = response.data.records;
  208. this.total = response.data.total;
  209. this.loading = false;
  210. }
  211. );
  212. },
  213. // 取消按钮
  214. cancel() {
  215. this.open = false;
  216. this.reset();
  217. },
  218. // 表单重置
  219. reset() {
  220. this.form = {
  221. ids: undefined,
  222. name: undefined,
  223. topChannelName: undefined,
  224. };
  225. this.resetForm("form");
  226. },
  227. /** 搜索按钮操作 */
  228. handleQuery() {
  229. this.queryParams.current = 1;
  230. this.getList();
  231. },
  232. /** 修改按钮操作 */
  233. handleUpdate(row) {
  234. Object.assign(this.form, row.id ? this.adminList.find(val=>val.id === row.id) : this.adminList.find(val=>val.id === this.ids[0]))
  235. updataChannel(this.form).then(response => {
  236. this.msgSuccess("修改成功");
  237. this.getList();
  238. });
  239. },
  240. /** 重置按钮操作 */
  241. resetQuery() {
  242. this.dateRange = [];
  243. this.queryParams.startMoney = undefined;
  244. this.queryParams.endMoney = undefined;
  245. this.queryParams.startTime = undefined;
  246. this.queryParams.endTime = undefined;
  247. this.queryParams.payType = undefined;
  248. this.queryParams.userName = undefined;
  249. this.queryParams.userPhone = undefined;
  250. this.queryParams.orderFlag = undefined;
  251. this.resetForm("queryForm");
  252. this.handleQuery();
  253. },
  254. /** 导出按钮操作 */
  255. handleExport() {
  256. let queryParams = {...this.queryParams};
  257. delete queryParams.current
  258. delete queryParams.size
  259. this.exportLoading = true;
  260. exportDetail(queryParams).then(response =>{
  261. this.exportLoading = false;
  262. localStorage.setItem('fileExportId', response.msg)
  263. this.$router.push({path:'/recharge/fileExport'})
  264. })
  265. // this.$confirm('是否确认导出数据?', "警告", {
  266. // confirmButtonText: "确定",
  267. // cancelButtonText: "取消",
  268. // type: "warning"
  269. // }).then(() => {
  270. // this.exportLoading = true;
  271. // return exportDetail(queryParams);
  272. // }).then(res => {
  273. // this.downloadBlob(res)
  274. // this.exportLoading = false;
  275. // }).catch(() => {
  276. // this.exportLoading = false;
  277. // });
  278. }
  279. // exportDetail(queryParams).then(res => {
  280. // this.$router.push({path:'/recharge/detailed'})
  281. // localStorage.setItem('fileExportId', msg)
  282. // // // this.downloadBlob(res)
  283. // // this.exportLoading = false;
  284. // }).catch(() => {
  285. // // this.exportLoading = false;
  286. // });
  287. // // exportDetail(queryParams).then(response =>{
  288. // // this.$router.push({path:'/recharge/detailed'})
  289. // // localStorage.setItem('fileExportId', msg)
  290. // // }).catch(err =>{
  291. // // })
  292. // // localStorage.setItem("timeout","大于10s")
  293. // // this.$confirm('是否确认导出数据?', "警告", {
  294. // // confirmButtonText: "确定",
  295. // // cancelButtonText: "取消",
  296. // // type: "warning"
  297. // // }).then(() => {
  298. // // this.exportLoading = true;
  299. // // return exportDetail(queryParams);
  300. // // }).then(res => {
  301. // // // this.downloadBlob(res)
  302. // // this.exportLoading = false;
  303. // // }).catch(() => {
  304. // // this.exportLoading = false;
  305. // // });
  306. // },
  307. }
  308. };
  309. </script>