fill-price-detail.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <template id="fill-price-detail">
  2. <el-dialog :visible.sync="edit.visible" width="20%" title="订单详情">
  3. <div>
  4. <el-table :data="list" border v-loading="loading" size="small" style="margin-bottom: 15px;">
  5. <el-table-column prop="id" width="80" label="ID"></el-table-column>
  6. <el-table-column label="用户信息" width="200">
  7. <template slot-scope="scope">
  8. <com-image style="float: left;margin-right: 5px;" mode="aspectFill"
  9. :src="scope.row.avatar_url"></com-image>
  10. <div>{{scope.row.nickname}}</div>
  11. <div>{{scope.row.user_level_name}}</div>
  12. </template>
  13. </el-table-column>
  14. <el-table-column label="收益" prop="price">
  15. </el-table-column>
  16. <el-table-column label="收益类型">
  17. <template slot-scope="scope">
  18. <div v-if="scope.row.type==1">平级奖</div>
  19. <div v-if="scope.row.type==0">货款</div>
  20. </template>
  21. </el-table-column>
  22. <el-table-column label="发放时间" prop="created_at"></el-table-column>
  23. </el-table>
  24. </div>
  25. </el-dialog>
  26. </template>
  27. <script>
  28. Vue.component('fill-price-detail', {
  29. template: '#fill-price-detail',
  30. props: {
  31. value: {
  32. type: Boolean,
  33. default: false
  34. },
  35. log_id: {
  36. type: Number,
  37. default: 0
  38. }
  39. },
  40. data() {
  41. return {
  42. loading: false,
  43. edit: {
  44. visible: false
  45. },
  46. list: [],
  47. }
  48. },
  49. mounted() {
  50. console.log(this.log_id)
  51. },
  52. watch: {
  53. value() {
  54. if (this.value) {
  55. this.edit.visible = true;
  56. this.loadDetail(this.log_id)
  57. }
  58. }
  59. ,
  60. 'edit.visible'() {
  61. if (!this.edit.visible) {
  62. this.editCancel();
  63. }
  64. }
  65. },
  66. methods: {
  67. loadDetail(log_id) {
  68. this.loading = true;
  69. let params = {
  70. r: 'cloud-stock-two/order/fill-price-detail',
  71. log_id: log_id
  72. };
  73. request({
  74. params: params,
  75. method: 'get',
  76. }).then(e => {
  77. this.loading = false;
  78. if (e.data.code == 0) {
  79. this.list = e.data.data.list;
  80. } else {
  81. this.$message.error(e.data.msg);
  82. }
  83. }).catch(e => {
  84. });
  85. },
  86. editCancel() {
  87. console.log('关闭');
  88. this.$emit('input', false);
  89. },
  90. }
  91. });
  92. </script>