应用层PC端前端服务

payList.vue 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
  4. <el-form-item label="申请人" prop="ipaddr">
  5. <el-input v-model="queryParams.ipaddr" placeholder="请输入登录地址" clearable @keyup.enter.native="handleQuery" />
  6. </el-form-item>
  7. <el-form-item label="提交人" prop="userName">
  8. <el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable
  9. @keyup.enter.native="handleQuery" />
  10. </el-form-item>
  11. <el-form-item>
  12. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  13. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  14. </el-form-item>
  15. </el-form>
  16. <el-table v-loading="loading" :data="dataList" style="width: 100%;">
  17. <el-table-column label="序号" type="index" align="center">
  18. <template slot-scope="scope">
  19. <span>{{ (pageNum - 1) * pageSize + scope.$index + 1 }}</span>
  20. </template>
  21. </el-table-column>
  22. <el-table-column label="案件编号" align="center" prop="caseNum" :show-overflow-tooltip="true" />
  23. <el-table-column label="案件标的" align="center" prop="caseSubjectAmount" :show-overflow-tooltip="true" />
  24. <el-table-column label="立案日期" align="center" prop="registerDate" />
  25. <el-table-column label="仲裁方式" align="center" prop="arbitratMethodName" :show-overflow-tooltip="true" />
  26. <el-table-column label="案件状态" align="center" prop="caseStatusName" />
  27. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  28. <template slot-scope="scope">
  29. <el-button size="mini" type="text" icon="el-icon-view" @click="confirmation(scope.row)"
  30. v-hasPermi="['monitor:online:forceLogout']" style="margin-right: 10px;">查看缴费清单</el-button>
  31. <el-popconfirm title="是否确认缴费" @confirm="payStatus(scope.row)">
  32. <el-button slot="reference" size="mini" type="text" icon="el-icon-bank-card"
  33. v-hasPermi="['monitor:online:forceLogout']">缴费</el-button>
  34. </el-popconfirm>
  35. </template>
  36. </el-table-column>
  37. </el-table>
  38. <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
  39. <el-form ref="form" :model="form" :rules="rules" label-width="150px" :disabled="true">
  40. <el-form-item label="案件编号:" prop="caseNum">
  41. <el-input v-model="form.caseNum" placeholder="" />
  42. </el-form-item>
  43. <el-form-item label="申请人:" prop="applicant">
  44. <el-input v-model="form.applicant" placeholder="" />
  45. </el-form-item>
  46. <el-form-item label="案件标的:" prop="caseSubjectAmount">
  47. <el-input-number v-model="form.caseSubjectAmount" controls-position="right" :min="0" />
  48. </el-form-item>
  49. <el-form-item label="案件应缴费用:" prop="feePayable">
  50. <el-input-number v-model="form.feePayable" controls-position="right" :min="0" />
  51. </el-form-item>
  52. <el-form-item label="案件实缴费用:" prop="paidExpenses">
  53. <el-input-number v-model="form.paidExpenses" controls-position="right" :min="0" />
  54. </el-form-item>
  55. <el-form-item label="被申请人:" prop="respondent">
  56. <el-input v-model="form.Respondent" placeholder="" />
  57. </el-form-item>
  58. <el-form-item label="申请人仲裁诉求:" prop="arbitratClaims">
  59. <el-input v-model="form.arbitratClaims" placeholder="" />
  60. </el-form-item>
  61. <el-form-item label="案件状态:" prop="caseStatusName">
  62. <el-input v-model="form.caseStatusName" placeholder="" />
  63. </el-form-item>
  64. </el-form>
  65. <div slot="footer" class="dialog-footer">
  66. <!-- <el-button type="primary" @click="submitForm">确 定</el-button> -->
  67. <el-button @click="cancel">取 消</el-button>
  68. </div>
  69. </el-dialog>
  70. <el-dialog :title="payTitle" :visible.sync="openPay" v-if="openPay" width="800px" append-to-body>
  71. <el-descriptions title="订单信息">
  72. <el-descriptions-item label="案件编号:">{{ form.caseNum }}</el-descriptions-item>
  73. <el-descriptions-item label="申请人:">{{ form.applicant }}</el-descriptions-item>
  74. <el-descriptions-item label="案件标的:">{{ form.caseSubjectAmount }}</el-descriptions-item>
  75. <el-descriptions-item label="案件应缴费用:">{{ form.feePayable }}</el-descriptions-item>
  76. <el-descriptions-item label="被申请人:">{{ form.respondent }}</el-descriptions-item>
  77. <el-descriptions-item label="申请人仲裁诉求:">{{ form.arbitratClaims }}</el-descriptions-item>
  78. <el-descriptions-item label="案件状态:">{{ form.caseStatusName }}</el-descriptions-item>
  79. </el-descriptions>
  80. <div class="payType">
  81. <span>请选择支付方式:</span>
  82. <i class="iconfont icon-weixinzhifu" @click="pay(0)"></i>
  83. <i class="iconfont icon-zhifubao" @click="pay(1)"></i>
  84. </div>
  85. <div class="payImg">
  86. <div id="qrcodeImg"></div>
  87. </div>
  88. <div class="payTitle">{{ payMain }}</div>
  89. <div slot="footer" class="dialog-footer">
  90. <el-button @click="payCancel">取 消</el-button>
  91. </div>
  92. </el-dialog>
  93. <pagination v-show="total > 0" :total="total" :page.sync="pageNum" :limit.sync="pageSize" @pagination="getList" />
  94. </div>
  95. </template>
  96. <script>
  97. import { caseApplicationList, caseApplicationDetail, casePay } from "@/api/pay/pay";
  98. import QRCode from 'qrcodejs2';
  99. export default {
  100. name: "payList",
  101. data() {
  102. return {
  103. // 付款二维码
  104. paySrc: "",
  105. // 遮罩层
  106. loading: false,
  107. // 总条数
  108. total: 0,
  109. // 表格数据
  110. list: [],
  111. pageNum: 1,
  112. pageSize: 10,
  113. // 弹出层标题
  114. title: "",
  115. payTitle: "",
  116. // 是否显示弹出层
  117. open: false,
  118. openPay: false,
  119. // 查询参数
  120. queryParams: {
  121. caseStatus: 2,
  122. pageNum: 1,
  123. pageSize: 10
  124. },
  125. // 弹出层内容
  126. form: {},
  127. // 校验表单
  128. rules: {
  129. },
  130. dataList: [],
  131. // 支付文字
  132. payMain: "",
  133. // 支付元素显示
  134. payFlag: false,
  135. // 案件id,案件实付金额
  136. payForm: {}
  137. };
  138. },
  139. created() {
  140. this.getList();
  141. },
  142. methods: {
  143. // 生成二维码
  144. qrcode(url) { // 前端根据 URL 生成微信支付二维码
  145. document.getElementById("qrcodeImg").innerHTML = "";
  146. return new QRCode('qrcodeImg', {
  147. width: 200,
  148. height: 200,
  149. text: url,
  150. colorDark: '#000',
  151. colorLight: '#fff'
  152. });
  153. },
  154. // 取消按钮
  155. cancel() {
  156. this.open = false;
  157. },
  158. payCancel() {
  159. this.openPay = false;
  160. },
  161. /** 查看缴费清单 */
  162. confirmation(val) {
  163. this.getDetail({ id: val.id })
  164. this.open = true;
  165. this.title = "缴费清单";
  166. },
  167. payStatus(val) {
  168. this.getDetail({ id: val.id })
  169. this.openPay = true;
  170. this.payMain = "";
  171. this.payTitle = "缴费确认";
  172. // console.log(")))))))))))))))))))))))))", val);
  173. },
  174. // 提交表单
  175. submitForm() { },
  176. /** 查询案件列表 */
  177. getList() {
  178. this.loading = true;
  179. caseApplicationList(this.queryParams).then(response => {
  180. this.dataList = response.rows;
  181. this.dataList.forEach(item => {
  182. if (item.caseStatus == 1) {
  183. item.caseStatusName = '待缴费'
  184. }
  185. if (item.arbitratMethod == "1") {
  186. item.arbitratMethodName = '视频仲裁'
  187. } else if (item.arbitratMethod == "2") {
  188. item.arbitratMethodName = '书面仲裁'
  189. }
  190. });
  191. this.total = response.total;
  192. this.loading = false;
  193. });
  194. },
  195. /** 查询详情 */
  196. getDetail(parms) {
  197. caseApplicationDetail(parms).then(res => {
  198. if (res.data.caseStatus == 1) {
  199. res.data.caseStatusName = '待缴费'
  200. }
  201. this.form = res.data;
  202. this.payForm.feePayable = res.data.feePayable;
  203. this.payForm.caseId = res.data.id
  204. })
  205. },
  206. // 支付
  207. pay(val) {
  208. if (this.payForm.feePayable == 0 || !this.payForm.feePayable) {
  209. this.$message({
  210. message: '此案件无需缴费',
  211. type: 'error'
  212. });
  213. return
  214. }
  215. let payType = ""
  216. if (val == 0) {
  217. payType = "wxpay"
  218. this.payMain = "请使用微信扫二维码支付"
  219. } else if (val == 1) {
  220. payType = "alipay"
  221. this.payMain = "请使用支付宝扫二维码支付"
  222. }
  223. casePay({
  224. totalFee: this.payForm.feePayable * 100,
  225. caseId: this.payForm.caseId,
  226. tradeType: "native",
  227. platform: payType
  228. }).then(res => {
  229. this.paySrc = res.data.code_url
  230. this.qrcode(this.paySrc)
  231. })
  232. },
  233. /** 搜索按钮操作 */
  234. handleQuery() {
  235. // this.pageNum = 1;
  236. // this.getList();
  237. },
  238. /** 重置按钮操作 */
  239. resetQuery() {
  240. // this.resetForm("queryForm");
  241. // this.handleQuery();
  242. },
  243. }
  244. };
  245. </script>
  246. <style scoped lang="scss">
  247. .payType {
  248. height: 80px;
  249. line-height: 80px;
  250. .icon-weixinzhifu {
  251. font-size: 24px;
  252. color: #27a56f;
  253. margin-right: 15px;
  254. }
  255. .icon-zhifubao {
  256. font-size: 24px;
  257. color: #1d76cc;
  258. }
  259. }
  260. .payImg {
  261. width: 100%;
  262. display: flex;
  263. justify-content: center;
  264. }
  265. .payTitle {
  266. margin-top: 20px;
  267. width: 100%;
  268. text-align: center;
  269. }
  270. </style>