index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <template>
  2. <div>
  3. <div class="container normal-panel normal-margin flex-between">
  4. <add @onSuccess="onSuccess"></add>
  5. <payment ref="payment" ></payment>
  6. </div>
  7. <div class="container normal-panel">
  8. <el-input style="width:200px;" placeholder="搜索" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'"
  9. v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="listData(param.content.pageNumber = 1)"
  10. size="small" class="input-with-select inline-16 layout_search__panel" clearable>
  11. </el-input>
  12. <tableLayout style="margin-top: 20px" :layout="tablecols" :data="list" :opwidth="200" :custom="true" height="calc(100vh - 340px)" fixedName="operation">
  13. <template v-slot:customcol="scope">
  14. <span v-if="scope.column.columnname === 'ispaid'" >
  15. <span v-if="scope.column.data[scope.column.columnname] == '0'" style="color: #4f7bfd">未付费</span>
  16. <span v-else>已付费</span>
  17. </span>
  18. <span v-else-if="scope.column.columnname === 'amount'" >
  19. <span style="color: red">{{tool.formatAmount(scope.column.data[scope.column.columnname],2)}}</span>
  20. </span>
  21. <span v-else-if="scope.column.columnname === 'operation'" ></span>
  22. <p v-else>{{scope.column.data[scope.column.columnname] || '--'}}</p>
  23. </template>
  24. <template v-slot:opreation="scope">
  25. <el-button type="text" size="mini" class="inline-16" @click="$router.push({path:'/pay_orders_detail',query:{id:scope.data.sys_payorderid}})">详 情</el-button>
  26. <el-popconfirm
  27. title="确定删除该订单吗?"
  28. @confirm="onDel(scope.data)"
  29. >
  30. <el-button slot="reference" type="text" size="mini" v-if="scope.data.ispaid == '0'" >删 除</el-button>
  31. </el-popconfirm>
  32. </template>
  33. </tableLayout>
  34. <div class="container normal-panel" style="text-align:right">
  35. <el-pagination
  36. background
  37. @size-change="handleSizeChange"
  38. @current-change="handleCurrentChange"
  39. :current-page="currentPage"
  40. :page-sizes="[20, 50, 100, 200]"
  41. :page-size="20"
  42. layout="total,sizes, prev, pager, next, jumper"
  43. :total="total">
  44. </el-pagination>
  45. </div>
  46. </div>
  47. </div>
  48. </template>
  49. <script>
  50. import tableLayout from '@/components/table/index2.vue'
  51. import add from './modules/add.vue'
  52. import payment from './modules/payment'
  53. export default {
  54. name: "index",
  55. data() {
  56. return {
  57. param:{
  58. "classname": "system.payorder.payorder",
  59. "method": "list",
  60. "content": {
  61. "pageNumber": 1,
  62. "pageSize": 20,
  63. "where": {
  64. "condition": ""
  65. }
  66. },
  67. },
  68. tablecols:[],
  69. list:[],
  70. total:0,
  71. currentPage:0,
  72. }
  73. },
  74. components:{tableLayout,add,payment},
  75. methods: {
  76. async listData(){
  77. const res = await this.$api.requested(this.param)
  78. console.log(res,'订单列表')
  79. this.list = res.data
  80. this.total = res.total
  81. this.currentPage = res.pageNumber
  82. },
  83. onSuccess(id,orderno){
  84. this.listData()
  85. let that = this
  86. this.$refs.payment.dialogVisible = true
  87. this.$refs.payment.queryAccount(id)
  88. this.$refs.payment.queryData(id)
  89. this.$refs.payment.queryCode(orderno)
  90. this.payChangeFun(function(a) {
  91. a.result = () => {
  92. that.$refs.payment.dialogVisible = false
  93. that.listData()
  94. }
  95. })
  96. },
  97. handleSizeChange(val) {
  98. // console.log(`每页 ${val} 条`);
  99. this.param.content.pageSize = val
  100. this.listData()
  101. },
  102. handleCurrentChange(val) {
  103. // console.log(`当前页: ${val}`);
  104. this.param.content.pageNumber = val
  105. this.listData()
  106. },
  107. async onDel(val){
  108. const res = await this.$api.requested({
  109. "classname": "system.payorder.payorder",
  110. "method": "delete",
  111. "content": {
  112. "sys_payorderid": val.sys_payorderid
  113. },
  114. })
  115. this.tool.showMessage(res,()=>{
  116. this.listData()
  117. })
  118. }
  119. },
  120. mounted() {
  121. this.listData()
  122. },
  123. created() {
  124. this.tablecols = this.tool.tabelCol(this.$route.name).payOrdersTable.tablecols
  125. }
  126. }
  127. </script>
  128. <style scoped>
  129. </style>