safeStorageInspect.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view class="content">
  3. <view class="search-bar">
  4. <u--form :model="searchForm" ref="searchForm">
  5. <u-form-item label="仓房名称:" prop="storehouseName" label-width="80px">
  6. <u--input v-model="searchForm.storehouseName"></u--input>
  7. <u-button type="primary" text="查询" class="btn" @tap="search"></u-button>
  8. <u-button text="重置" class="btn" @tap="reset"></u-button>
  9. </u-form-item>
  10. </u--form>
  11. </view>
  12. <uni-table border stripe emptyText="暂无更多数据" :loading="this.loading">
  13. <!-- 表头行 -->
  14. <uni-tr>
  15. <uni-th align="center">序号</uni-th>
  16. <uni-th align="center">库区名称</uni-th>
  17. <uni-th align="center">仓房名称</uni-th>
  18. <uni-th align="center">货位名称</uni-th>
  19. <uni-th align="center">粮食品种</uni-th>
  20. <uni-th align="center">收获年度</uni-th>
  21. <uni-th align="center">检查日期</uni-th>
  22. <uni-th align="center" width="200">操作</uni-th>
  23. </uni-tr>
  24. <!-- 表格数据行 -->
  25. <uni-tr v-for="(item, index) in tableData" :key="item.id">
  26. <uni-td align="center">{{ index + 1 }}</uni-td>
  27. <uni-td align="center">{{ item.orgName }}</uni-td>
  28. <uni-td align="center">{{ item.storehouseName }}</uni-td>
  29. <uni-td align="center">{{ item.warehouseName }}</uni-td>
  30. <uni-td align="center">{{ item.grainVarietyName }}</uni-td>
  31. <uni-td align="center">{{ item.harvestYear }}</uni-td>
  32. <uni-td align="center">{{ item.inspectionDate }}</uni-td>
  33. <uni-td align="center">
  34. <view class="opts">
  35. <u-button text="查看" @tap="view(item)" class="btn"></u-button>
  36. <u-button v-if="couldEdit(item)" text="修改" @tap="edit(item)" class="btn"></u-button>
  37. </view>
  38. </uni-td>
  39. </uni-tr>
  40. </uni-table>
  41. <uni-pagination show-icon="true" :total="pageInfo.total" :current="pageInfo.current" class="pagination"
  42. @change="paginationChang"></uni-pagination>
  43. </view>
  44. </template>
  45. <script>
  46. import simpleList from '@/components/simple-list/index'
  47. import {
  48. getList,
  49. } from '@/api/safeStorageInspect.js'
  50. import {
  51. server_host
  52. } from '@/config/system'
  53. import {
  54. errorMsg, isNull
  55. } from '@/utils/tools'
  56. export default {
  57. mixins: [simpleList],
  58. data() {
  59. return {
  60. editPath: '/pages/safeStorageInspect/safeStorageInspectEdit',
  61. searchForm: {
  62. storehouseName: null,
  63. },
  64. }
  65. },
  66. methods: {
  67. getListFun() {
  68. return getList
  69. },
  70. couldEdit(data) {
  71. return isNull(data.storehouseName) && isNull(data.warehouseName) && isNull(data.inspector) && isNull(data.inspectionDate)
  72. },
  73. }
  74. }
  75. </script>
  76. <style scoped lang="scss">
  77. .content {
  78. padding: 10px;
  79. .btn {
  80. width: 100px;
  81. margin-left: 5px;
  82. }
  83. .tip {
  84. color: red;
  85. }
  86. .exports {
  87. margin-bottom: 10px;
  88. }
  89. }
  90. .msg {
  91. padding-left: 10px;
  92. }
  93. .opts {
  94. width: 100%;
  95. display: flex;
  96. justify-content: center;
  97. align-items: center;
  98. }
  99. .search-bar {}
  100. </style>