| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <template>
- <view class="app-content">
- <view class="main-view">
- <block v-if="!$util.isEmpty(list.data)">
- <t-table :headerBackgroundColor="'#F0F2F6'">
- <t-tr header>
- <t-th>时间</t-th>
- <t-th>事项</t-th>
- <t-th>变动</t-th>
- <t-th>最终</t-th>
- <t-th>操作人</t-th>
- </t-tr>
- <view v-for="(item, index) in list.data" :key="index">
- <t-tr>
- <t-td align="center" color="info"><view >{{ item.addTime.substr(5,11) }}</view></t-td>
- <t-td align="center" color="info"><view >{{ item.event }}</view></t-td>
- <t-td align="center" color="info"><view >{{item.io==1?'+':'-'}}{{ item.changeNum }}</view></t-td>
- <t-td align="center" color="info"><view >{{ item.num }}</view></t-td>
- <t-td align="center" color="info"><view >{{ item.staffName }}</view></t-td>
- </t-tr>
- </view>
- </t-table>
- </block>
- <block v-else>
- <AppWrapperEmpty title="暂无数据" :is-empty="$util.isEmpty(list.data)" />
- </block>
- </view>
- </view>
- </template>
- <script>
- import AppWrapperEmpty from "@/components/app-wrapper-empty";
- import { getBookOnChangeList } from '@/api/book'
- import list from '@/mixins/list'
- export default {
- name: "bookChange",
- components: {
- AppWrapperEmpty
- },
- mixins:[list],
- data() {
- return {
- };
- },
- methods: {
- async init(){
- let id = this.option.id?this.option.id:0
- let customId = this.option.customId?this.option.customId:0
- let itemId = this.option.itemId?this.option.itemId:0
- let itemName = this.option.itemName?this.option.itemName:''
- let customName = this.option.customName?this.option.customName:''
- uni.setNavigationBarTitle({title: customName+' 的 '+itemName})
- const res = await getBookOnChangeList({ page:this.list.page,relateSecondId:id,customId:customId,itemId:itemId})
- if (this.$util.isEmpty(res.data.list)){
- this.completes(res)
- return
- }
- this.completes(res)
- }
- },
- async onPullDownRefresh() {
- this.resetList();
- await this.init()
- uni.stopPullDownRefresh();
- },
- async onReachBottom() {
- if (!this.list.finished) {
- await this.init()
- uni.stopPullDownRefresh();;
- } else {
- uni.stopPullDownRefresh();
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- </style>
|