You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

184 lines
4.6 KiB

  1. <template>
  2. <div class="customer-css">
  3. <!-- 数据表格 -->
  4. <el-table
  5. ref="table"
  6. :height="searchData.height"
  7. :data="dataList"
  8. border
  9. v-loading="dataListLoading"
  10. style="width: 100%;">
  11. <el-table-column
  12. v-for="(item,index) in columnList" :key="index"
  13. :sortable="item.columnSortable"
  14. :prop="item.columnProp"
  15. :header-align="item.headerAlign"
  16. :show-overflow-tooltip="item.showOverflowTooltip"
  17. :align="item.align"
  18. :fixed="item.fixed==''?false:item.fixed"
  19. :min-width="item.columnWidth"
  20. :label="item.columnLabel">
  21. <template slot-scope="scope">
  22. <span v-if="!item.columnHidden"> {{scope.row[item.columnProp]}}</span>
  23. </template>
  24. </el-table-column>
  25. </el-table>
  26. <!-- 分页 -->
  27. <el-pagination style="margin-top: 0px"
  28. @size-change="sizeChangeHandle"
  29. @current-change="currentChangeHandle"
  30. :current-page="pageIndex"
  31. :page-sizes="[20, 50, 100, 200]"
  32. :page-size="pageSize"
  33. :total="totalPage"
  34. layout="total, sizes, prev, pager, next, jumper">
  35. </el-pagination>
  36. </div>
  37. </template>
  38. <script>
  39. import { getInspectionByPODetail } from '@/api/order/poOrder.js'
  40. export default {
  41. name: 'InspectionDetailList',
  42. data() {
  43. return {
  44. dataList: [],
  45. searchData: {
  46. site: this.$store.state.user.site,
  47. orderNo: '',
  48. itemNo: null,
  49. height: '300',
  50. page: 1,
  51. limit: 20
  52. },
  53. pageIndex: 1,
  54. pageSize: 20,
  55. totalPage: 0,
  56. dataListLoading: false,
  57. columnList: [
  58. {
  59. columnProp: 'requestNo',
  60. headerAlign: 'center',
  61. align: 'center',
  62. columnLabel: '申请单号',
  63. columnWidth: '140',
  64. columnHidden: false,
  65. columnSortable: false,
  66. showOverflowTooltip: true,
  67. fixed: false
  68. },
  69. {
  70. columnProp: 'partNo',
  71. headerAlign: 'center',
  72. align: 'center',
  73. columnLabel: '产品编码',
  74. columnWidth: '120',
  75. columnHidden: false,
  76. columnSortable: false,
  77. showOverflowTooltip: true,
  78. fixed: false
  79. },
  80. {
  81. columnProp: 'partDesc',
  82. headerAlign: 'center',
  83. align: 'left',
  84. columnLabel: '产品名称',
  85. columnWidth: '200',
  86. columnHidden: false,
  87. columnSortable: false,
  88. showOverflowTooltip: true,
  89. fixed: false
  90. },
  91. {
  92. columnProp: 'inspectQty',
  93. headerAlign: 'center',
  94. align: 'center',
  95. columnLabel: '验货数量',
  96. columnWidth: '100',
  97. columnHidden: false,
  98. columnSortable: false,
  99. fixed: false
  100. },
  101. {
  102. columnProp: 'status',
  103. headerAlign: 'center',
  104. align: 'center',
  105. columnLabel: '验货状态',
  106. columnWidth: '100',
  107. columnHidden: false,
  108. columnSortable: false,
  109. fixed: false
  110. },
  111. {
  112. columnProp: 'inspectResult',
  113. headerAlign: 'center',
  114. align: 'center',
  115. columnLabel: '验货结果',
  116. columnWidth: '100',
  117. columnHidden: false,
  118. columnSortable: false,
  119. fixed: false
  120. }
  121. ]
  122. }
  123. },
  124. methods: {
  125. // 初始化组件的参数(模仿 com_logisticsPoList.vue 的 init 模式)
  126. init(inData) {
  127. this.searchData = JSON.parse(JSON.stringify(inData))
  128. this.pageIndex = 1
  129. this.searchTable()
  130. },
  131. // 查询数据
  132. searchTable() {
  133. this.dataListLoading = true
  134. const params = {
  135. ...this.searchData,
  136. page: this.pageIndex,
  137. limit: this.pageSize
  138. }
  139. getInspectionByPODetail(params).then(({ data }) => {
  140. if (data && data.code === 0) {
  141. this.dataList = data.page.list || []
  142. this.pageIndex = data.page.currPage
  143. this.pageSize = data.page.pageSize
  144. this.totalPage = data.page.totalCount
  145. } else {
  146. this.dataList = []
  147. this.totalPage = 0
  148. }
  149. this.dataListLoading = false
  150. }).catch(() => {
  151. this.dataListLoading = false
  152. this.dataList = []
  153. this.totalPage = 0
  154. })
  155. },
  156. // 每页数
  157. sizeChangeHandle(val) {
  158. this.pageSize = val
  159. this.pageIndex = 1
  160. this.searchTable()
  161. },
  162. // 当前页
  163. currentChangeHandle(val) {
  164. this.pageIndex = val
  165. this.searchTable()
  166. }
  167. }
  168. }
  169. </script>
  170. <style scoped lang="scss">
  171. .rq .auto /deep/ .el-form-item__content {
  172. height: auto;
  173. line-height: 1.5;
  174. }
  175. </style>