byLog.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <div class="log">
  3. <div class="log-main">
  4. <div class="log-row" v-for="(item,index) of data" :key="index">
  5. <div class="log-time"><i class="el-icon-time"></i> {{item.createTime}}</div>
  6. <div class="log-user"><i class="el-icon-user"></i> {{item.optUser}}</div>
  7. <div class="log-act"><i class="el-icon-setting"></i> {{item.optName}}</div>
  8. <div class="log-desc" v-html="item.optDesc"></div>
  9. </div>
  10. </div>
  11. <div class="log-page">
  12. <el-pagination
  13. background
  14. layout="prev, pager, next"
  15. @current-change="handleCurrentChange"
  16. :current-page="page.pageNo"
  17. :page-size="page.pageSize"
  18. :total="page.total">
  19. </el-pagination>
  20. </div>
  21. </div>
  22. </template>
  23. <script lang="ts">
  24. import { Component, Prop, Vue, Watch } from "vue-property-decorator";
  25. import VueViews from '@/benyun/compVue/VueViews'
  26. @Component
  27. export default class ByLog extends VueViews {
  28. config:any={}
  29. data:Array<any>=[];
  30. load=false;
  31. formValue:any;
  32. page = {
  33. pageNo: 1, //当前页
  34. pageSize: 20, //每页条数
  35. total: 0 //总条数
  36. }
  37. created(){
  38. if(this.propConfig){
  39. this.setConfig(this.propConfig)
  40. }
  41. }
  42. mounted(){
  43. this.request();
  44. if(this.parentValue){
  45. this.setBillValue(this.parentValue);
  46. }
  47. }
  48. resertPage(){
  49. this.page={
  50. pageNo: 1, //当前页
  51. pageSize: 20, //每页条数
  52. total: 0 //总条数
  53. }
  54. }
  55. setBillValue(v:any){
  56. this.formValue = v;
  57. }
  58. handleCurrentChange(v:number){
  59. this.page.pageNo = v;
  60. this.request();
  61. }
  62. request(){
  63. if(!this.requestConfig || !this.requestConfig.url){
  64. return
  65. }
  66. if(!this.formValue || !this.formValue.orderNumber){
  67. return
  68. }
  69. let parame = (this as any).$lodash.cloneDeep(this.requestConfig);
  70. parame.params={
  71. docId:this.formValue.orderNumber,
  72. pageNo:this.page.pageNo,
  73. pageSize:this.page.pageSize
  74. }
  75. parame.success = (res:any) => {
  76. this.load = false;
  77. if(res.data && res.data.records){
  78. this.data = res.data.records;
  79. }
  80. this.page.pageNo = res.data.current;
  81. this.page.total = res.data.total;
  82. }
  83. parame.fail = () => {
  84. this.load = false;
  85. }
  86. this.load = true;
  87. this.requestHandle(parame);
  88. }
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. .log{
  93. width: 100%;
  94. height: 100%;
  95. box-sizing: border-box;
  96. padding: 0 16px;
  97. .log-row{
  98. width: 100%;
  99. display: flex;
  100. flex-flow: wrap;
  101. font-size: 14px;
  102. padding: 16px 0;
  103. border-bottom: dotted 1px #CCC;
  104. .log-time{
  105. width: 170px;
  106. color: #666;
  107. }
  108. .log-user{
  109. width: 120px;
  110. padding-right: 8px;
  111. overflow: hidden;
  112. white-space: nowrap;
  113. text-overflow: ellipsis;
  114. color: #666;
  115. }
  116. .log-act{
  117. width: 130px;
  118. padding-right: 8px;
  119. overflow: hidden;
  120. white-space: nowrap;
  121. color: #666;
  122. text-overflow: ellipsis;
  123. }
  124. .log-desc{
  125. // min-width: 150px;
  126. width: 100%;
  127. font-size: 12px;
  128. padding-top: 8px;
  129. // display: flex;
  130. // flex-wrap: wrap;
  131. }
  132. }
  133. .log-main{
  134. height: calc(100% - 50px);
  135. overflow-y: auto;
  136. }
  137. .log-page{
  138. height:50px;
  139. display: flex;
  140. align-items: flex-end;
  141. flex-direction: column;
  142. justify-content: center;
  143. }
  144. }
  145. </style>
  146. <style lang="scss">
  147. .log-desc{
  148. .mData{
  149. font-style: italic;
  150. }
  151. .mCode{
  152. font-size: 14px;
  153. font-weight: 700;
  154. }
  155. .mNum,.mPrice{
  156. font-size: 14px;
  157. font-weight: 700;
  158. color: #F00;
  159. }
  160. .mCont{
  161. font-size: 14px;
  162. font-weight: 700;
  163. }
  164. }
  165. </style>