order.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-user-info');
  4. ComponentHelper::loadComponentView('com-list-page');
  5. ComponentHelper::loadComponentView('com-list-table');
  6. ?>
  7. <com-list-page :crumbs="crumbs" id="application">
  8. <com-list-table
  9. ref="table"
  10. :api-params="apiParams"
  11. :search-list="searchList"
  12. :list-params-verify-fun="listParamsVerifyFun"
  13. @select-change="selectChange"
  14. >
  15. <el-table-column prop="id" label="日志ID" align="center"></el-table-column>
  16. <el-table-column prop="id" label="操作人" align="center">
  17. <template slot-scope="scope">
  18. <com-user-info :user="scope.row.operator_user" :is-to-user-detail="scope.row.operator_user_type == 2" v-if="scope.row.operator_user_type != 6"></com-user-info>
  19. <template v-else>系统</template>
  20. </template>
  21. </el-table-column>
  22. <el-table-column prop="operator_user_type_text" label="操作人类型" align="center"></el-table-column>
  23. <el-table-column prop="order_id" label="订单ID" align="center"></el-table-column>
  24. <el-table-column label="订单号" align="center" width="180">
  25. <template slot-scope="scope">
  26. {{ scope.row.order.order_no }}
  27. </template>
  28. </el-table-column>
  29. <el-table-column label="行为" align="center" width="500">
  30. <template slot-scope="scope">
  31. <el-tooltip class="item" effect="dark" :content="scope.row.desc" placement="top">
  32. <div>{{ scope.row.desc }}</div>
  33. </el-tooltip>
  34. </template>
  35. </el-table-column>
  36. <el-table-column prop="created_at_text" label="操作时间" align="center"></el-table-column>
  37. <el-table-column prop="ip_text" label="IP" align="center"></el-table-column>
  38. </com-list-table>
  39. </com-list-page>
  40. <script>
  41. const application = new Vue({
  42. el: '#application',
  43. data() {
  44. return {
  45. uid: 0,
  46. name: '',
  47. levelList: [],
  48. btnLoad: false,
  49. operatorUserTypeOptions: <?= $operatorUserTypeOptions ?>,
  50. behaviorOptions: <?= $behaviorOptions ?>,
  51. operatorUserIdPlaceholder: '操作人'
  52. }
  53. },
  54. computed: {
  55. apiParams() {
  56. return {
  57. r: 'mall/logs/order'
  58. }
  59. },
  60. crumbs() {
  61. return [
  62. {
  63. title: '订单',
  64. },
  65. {
  66. title: '订单日志',
  67. }
  68. ]
  69. },
  70. searchList() {
  71. return [
  72. {
  73. key: 'operator_user_type',
  74. title: '操作人类型',
  75. type: 'select',
  76. placeholder: '请选择操作人类型',
  77. options: this.operatorUserTypeOptions,
  78. valueKey: {
  79. label: 'label',
  80. value: 'value',
  81. },
  82. },
  83. {
  84. key: 'operator_user_keyword',
  85. title: this.operatorUserIdPlaceholder,
  86. type: 'text',
  87. },
  88. {
  89. key: 'order_id',
  90. title: '订单ID',
  91. type: 'text',
  92. },
  93. {
  94. key: 'order_no',
  95. title: '订单号',
  96. type: 'text',
  97. },
  98. {
  99. key: 'behavior',
  100. title: '行为',
  101. type: 'select',
  102. placeholder: '请选择',
  103. options: this.behaviorOptions,
  104. valueKey: {
  105. label: 'label',
  106. value: 'value',
  107. },
  108. },
  109. {
  110. key: 'created_at',
  111. title: '操作日期',
  112. type: 'date-time-range'
  113. },
  114. ]
  115. }
  116. },
  117. created() {
  118. },
  119. methods: {
  120. selectChange(key, value) {
  121. if (key === 'operator_user_type') {
  122. if (value == 2) {
  123. this.operatorUserIdPlaceholder = '操作人ID或手机号'
  124. } else if(value == 1) {
  125. this.operatorUserIdPlaceholder = '操作人账号'
  126. } else {
  127. this.operatorUserIdPlaceholder = '操作人'
  128. }
  129. }
  130. },
  131. listParamsVerifyFun(params) {
  132. if (!isEmpty(params.operator_user_keyword) && isEmpty(params.operator_user_type)) {
  133. this.$message.error('请选择操作人类型')
  134. return false
  135. }
  136. return true
  137. }
  138. }
  139. })
  140. </script>
  141. <style>
  142. @media screen and (max-width: 1500px) {
  143. #app {
  144. min-width: 1270px;
  145. }
  146. }
  147. </style>