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.

199 lines
5.0 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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: 'approveQty',
  103. headerAlign: 'center',
  104. align: 'center',
  105. columnLabel: '检验通过数量',
  106. columnWidth: '120',
  107. columnHidden: false,
  108. columnSortable: false,
  109. fixed: false
  110. },
  111. {
  112. columnProp: 'status',
  113. headerAlign: 'center',
  114. align: 'center',
  115. columnLabel: '验货状态',
  116. columnWidth: '100',
  117. columnHidden: false,
  118. columnSortable: false,
  119. fixed: false
  120. },
  121. {
  122. columnProp: 'inspectResult',
  123. headerAlign: 'center',
  124. align: 'center',
  125. columnLabel: '验货结果',
  126. columnWidth: '100',
  127. columnHidden: false,
  128. columnSortable: false,
  129. fixed: false
  130. }
  131. ]
  132. }
  133. },
  134. methods: {
  135. // 初始化组件的参数(模仿 com_logisticsPoList.vue 的 init 模式)
  136. init(inData) {
  137. this.searchData = JSON.parse(JSON.stringify(inData))
  138. this.pageIndex = 1
  139. this.searchTable()
  140. },
  141. // 查询数据
  142. searchTable() {
  143. if (!this.searchData.orderNo) {
  144. this.dataList = []
  145. this.totalPage = 0
  146. return
  147. }
  148. this.dataListLoading = true
  149. const params = {
  150. ...this.searchData,
  151. page: this.pageIndex,
  152. limit: this.pageSize
  153. }
  154. getInspectionByPODetail(params).then(({ data }) => {
  155. if (data && data.code === 0) {
  156. this.dataList = data.page.list || []
  157. this.pageIndex = data.page.currPage
  158. this.pageSize = data.page.pageSize
  159. this.totalPage = data.page.totalCount
  160. } else {
  161. this.dataList = []
  162. this.totalPage = 0
  163. }
  164. this.dataListLoading = false
  165. }).catch(() => {
  166. this.dataListLoading = false
  167. this.dataList = []
  168. this.totalPage = 0
  169. })
  170. },
  171. // 每页数
  172. sizeChangeHandle(val) {
  173. this.pageSize = val
  174. this.pageIndex = 1
  175. this.searchTable()
  176. },
  177. // 当前页
  178. currentChangeHandle(val) {
  179. this.pageIndex = val
  180. this.searchTable()
  181. }
  182. }
  183. }
  184. </script>
  185. <style scoped lang="scss">
  186. .rq .auto /deep/ .el-form-item__content {
  187. height: auto;
  188. line-height: 1.5;
  189. }
  190. </style>