itemCustomBookOnChange.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view class="app-content">
  3. <view class="main-view">
  4. <block v-if="!$util.isEmpty(list.data)">
  5. <t-table :headerBackgroundColor="'#F0F2F6'">
  6. <t-tr header>
  7. <t-th>时间</t-th>
  8. <t-th>事项</t-th>
  9. <t-th>变动</t-th>
  10. <t-th>最终</t-th>
  11. <t-th>操作人</t-th>
  12. </t-tr>
  13. <view v-for="(item, index) in list.data" :key="index">
  14. <t-tr>
  15. <t-td align="center" color="info"><view >{{ item.addTime.substr(5,11) }}</view></t-td>
  16. <t-td align="center" color="info"><view >{{ item.event }}</view></t-td>
  17. <t-td align="center" color="info"><view >{{item.io==1?'+':'-'}}{{ item.changeNum }}</view></t-td>
  18. <t-td align="center" color="info"><view >{{ item.num }}</view></t-td>
  19. <t-td align="center" color="info"><view >{{ item.staffName }}</view></t-td>
  20. </t-tr>
  21. </view>
  22. </t-table>
  23. </block>
  24. <block v-else>
  25. <AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
  26. </block>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import AppWrapperEmpty from "@/components/app-wrapper-empty";
  32. import { getBookOnChangeList } from '@/api/book'
  33. import list from '@/mixins/list'
  34. export default {
  35. name: "bookChange",
  36. components: {
  37. AppWrapperEmpty
  38. },
  39. mixins:[list],
  40. data() {
  41. return {
  42. };
  43. },
  44. methods: {
  45. async init(){
  46. let id = this.option.id?this.option.id:0
  47. let customId = this.option.customId?this.option.customId:0
  48. let itemId = this.option.itemId?this.option.itemId:0
  49. let itemName = this.option.itemName?this.option.itemName:''
  50. let customName = this.option.customName?this.option.customName:''
  51. uni.setNavigationBarTitle({title: customName+' 的 '+itemName})
  52. const res = await getBookOnChangeList({ page:this.list.page,relateSecondId:id,customId:customId,itemId:itemId})
  53. if (this.$util.isEmpty(res.data.list)){
  54. this.completes(res)
  55. return
  56. }
  57. this.completes(res)
  58. }
  59. },
  60. async onPullDownRefresh() {
  61. this.resetList();
  62. await this.init()
  63. uni.stopPullDownRefresh();
  64. },
  65. async onReachBottom() {
  66. if (!this.list.finished) {
  67. await this.init()
  68. uni.stopPullDownRefresh();;
  69. } else {
  70. uni.stopPullDownRefresh();
  71. }
  72. }
  73. };
  74. </script>
  75. <style lang="scss" scoped>
  76. </style>