list.php 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <div id="app" v-cloak>
  2. <el-card shadow="never" style="border:0;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  3. <div slot="header">
  4. <div>
  5. <span>手续费未成功</span>
  6. </div>
  7. </div>
  8. <div class="table-body">
  9. <!-- 查询 -->
  10. <el-form
  11. :inline="true"
  12. :model="searchData"
  13. size="mini"
  14. >
  15. <el-row>
  16. <el-form-item label="批次号/订单号">
  17. <el-input v-model="searchData.keyword"></el-input>
  18. </el-form-item>
  19. </el-row>
  20. <el-row>
  21. <el-form-item>
  22. <el-button type="primary" @click="onSubmit">查询</el-button>
  23. <el-button @click="resetForm">重置</el-button>
  24. </el-form-item>
  25. </el-row>
  26. </el-form>
  27. <!-- 订单信息 -->
  28. <template>
  29. <el-table ref="multipleTable" :data="list" @selection-change="handleSelectionChange" v-loading="listLoading">
  30. <!-- 空数据 -->
  31. <template slot="empty">
  32. <el-empty description="暂无记录"></el-empty>
  33. </template>
  34. <el-table-column type="selection"></el-table-column>
  35. <el-table-column prop="id" align="center" label="ID"></el-table-column>
  36. <el-table-column prop="batch_num" align="center" label="batch_num"></el-table-column>
  37. <el-table-column prop="order_sn" align="center" label="order_sn"></el-table-column>
  38. <el-table-column prop="error" align="center" label="error"></el-table-column>
  39. <el-table-column prop="created_at" align="center" label="创建时间">
  40. <template slot-scope="scope">
  41. {{ scope.row.created_at|dateTimeFormat('Y-m-d H:i:s') }}
  42. </template>
  43. </el-table-column>
  44. <el-table-column prop="right_btn" label="操作" align="center">
  45. <template slot-scope="scope">
  46. <el-button
  47. type="text"
  48. @click="subSuccess(scope.row.id)"
  49. >成功</el-button>
  50. <el-button
  51. type="text"
  52. @click="subFail(scope.row.id)"
  53. >失败</el-button>
  54. </template>
  55. </el-table-column>
  56. </el-table>
  57. </template>
  58. <!-- 分页 -->
  59. <el-row type="flex" class="page" justify="end" style="margin-top: 20px;">
  60. <el-pagination @current-change="pagination" background layout="prev, pager, next" :page-count="pageCount" v-if="list"></el-pagination>
  61. </el-row>
  62. </div>
  63. </el-card>
  64. </div>
  65. <script>
  66. const app = new Vue({
  67. el: '#app',
  68. data() {
  69. return {
  70. searchData: {
  71. keyword: undefined,
  72. },
  73. list: [],
  74. pageCount: 0,
  75. page: 1,
  76. currentPage: null,
  77. listLoading: false,
  78. }
  79. },
  80. methods: {
  81. handleSelectionChange(val) {
  82. this.select_order = val
  83. },
  84. // 全选
  85. allSelect() {
  86. if (this.checked) {
  87. this.goods_list.forEach(function(item, index) {
  88. if (!item.storage) {
  89. item.is_select = true
  90. }
  91. })
  92. } else {
  93. this.goods_list.forEach(function(item, index) {
  94. item.is_select = false
  95. })
  96. }
  97. },
  98. //搜索
  99. onSubmit() {
  100. this.page = 1
  101. this.getList()
  102. },
  103. pagination(currentPage) {
  104. this.page = currentPage
  105. this.getList()
  106. },
  107. getList() {
  108. this.listLoading = true;
  109. let params = {
  110. r: 'avoid-tax/sokabe/list',
  111. page: this.page,
  112. limit: 20
  113. }
  114. params = Object.assign(params, this.searchData)
  115. request({
  116. params: params,
  117. method: 'get',
  118. }).then(e => {
  119. if (e.data.code === 0) {
  120. this.list = e.data.data.list
  121. this.pageCount = e.data.data.page_count
  122. this.currentPage = e.data.data.pagination.current_page
  123. } else {
  124. this.$message.error(e.data.msg)
  125. }
  126. this.listLoading = false
  127. }).catch(e => {
  128. this.listLoading = false
  129. })
  130. },
  131. resetForm() {
  132. this.searchData = {
  133. keyword: undefined
  134. }
  135. },
  136. subSuccess(id) {
  137. this.$confirm('是否确定重新提交?', '提示', {
  138. confirmButtonText: '确定',
  139. cancelButtonText: '取消',
  140. type: 'warning'
  141. }).then(() => {
  142. this.queryBookLoad = true
  143. request({
  144. params: {
  145. r: 'avoid-tax/sokabe/sub-success',
  146. id: id,
  147. }
  148. }).then(e => {
  149. if (e.data.code == 0) {
  150. this.$message.success('操作成功')
  151. this.queryBookLoad = false
  152. } else {
  153. this.$message.error(e.data.msg)
  154. }
  155. }).catch()
  156. }).catch()
  157. },
  158. subFail(id) {
  159. this.$confirm('是否确定重新提交?', '提示', {
  160. confirmButtonText: '确定',
  161. cancelButtonText: '取消',
  162. type: 'warning'
  163. }).then(() => {
  164. this.queryBookLoad = true
  165. request({
  166. params: {
  167. r: 'avoid-tax/sokabe/sub-fail',
  168. id: id,
  169. }
  170. }).then(e => {
  171. if (e.data.code == 0) {
  172. this.$message.success('操作成功')
  173. this.queryBookLoad = false
  174. } else {
  175. this.$message.error(e.data.msg)
  176. }
  177. }).catch()
  178. }).catch()
  179. },
  180. },
  181. mounted: function() {
  182. this.page = getQuery('page') ? getQuery('page') : 1
  183. this.getList()
  184. }
  185. });
  186. </script>
  187. <style>
  188. .notice {
  189. border: 1px solid rgb(250, 236, 216);
  190. background: rgb(253, 246, 236);
  191. margin-top: 10px;
  192. padding: 10px;
  193. border-radius: 5px;
  194. }
  195. .notice li + li {
  196. margin-top: 5px;
  197. }
  198. </style>