handover-records.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. <!-- 移交记录 -->
  2. <template>
  3. <div>
  4. <el-form :inline="true" :model="dataForm" @keyup.enter.native="queryPage()">
  5. <el-form-item label="名称">
  6. <el-input v-model="dataForm.name" placeholder="名称" clearable/>
  7. </el-form-item>
  8. <el-form-item label="产品编号">
  9. <el-input v-model="dataForm.code" placeholder="产品编号" clearable/>
  10. </el-form-item>
  11. <el-form-item>
  12. <el-button @click="queryPage()">查询</el-button>
  13. </el-form-item>
  14. </el-form>
  15. <el-table
  16. :data="dataList"
  17. border
  18. v-loading="dataListLoading"
  19. style="width: 100%;">
  20. <el-table-column
  21. label="序号"
  22. type="index"
  23. width="50"
  24. align="center">
  25. </el-table-column>
  26. <el-table-column
  27. prop="productName"
  28. header-align="center"
  29. align="center"
  30. width="160"
  31. :show-overflow-tooltip="true"
  32. label="产品名称">
  33. </el-table-column>
  34. <el-table-column
  35. prop="prodCode"
  36. header-align="center"
  37. align="center"
  38. width="160"
  39. :show-overflow-tooltip="true"
  40. label="产品编号">
  41. </el-table-column>
  42. <el-table-column
  43. prop="techName"
  44. header-align="center"
  45. align="center"
  46. width="160"
  47. :show-overflow-tooltip="true"
  48. label="工艺名称">
  49. </el-table-column>
  50. <el-table-column
  51. prop="nodeName"
  52. header-align="center"
  53. align="center"
  54. width="160"
  55. :show-overflow-tooltip="true"
  56. label="工序名称">
  57. </el-table-column>
  58. <el-table-column
  59. prop="transferUserName"
  60. header-align="center"
  61. align="center"
  62. width="120"
  63. :show-overflow-tooltip="true"
  64. label="移交接收人">
  65. </el-table-column>
  66. <el-table-column
  67. prop="creatorName"
  68. header-align="center"
  69. align="center"
  70. min-width="120"
  71. :show-overflow-tooltip="true"
  72. label="移交发起人">
  73. </el-table-column>
  74. <el-table-column
  75. prop="transferExplain"
  76. header-align="center"
  77. align="center"
  78. min-width="160"
  79. :show-overflow-tooltip="true"
  80. label="移交说明">
  81. </el-table-column>
  82. <el-table-column
  83. prop="createTime"
  84. header-align="center"
  85. align="center"
  86. min-width="160"
  87. label="移交时间">
  88. </el-table-column>
  89. <el-table-column
  90. fixed="right"
  91. header-align="center"
  92. align="center"
  93. width="140"
  94. label="操作">
  95. <template slot-scope="scope">
  96. <el-button type="text" size="small" @click="detailHandle(scope.row.recordId)">查看</el-button>
  97. </template>
  98. </el-table-column>
  99. </el-table>
  100. <el-pagination
  101. @size-change="sizeChangeHandle"
  102. @current-change="currentChangeHandle"
  103. :current-page="pageIndex"
  104. :page-sizes="[10, 20, 50, 100]"
  105. :page-size="pageSize"
  106. :total="totalPage"
  107. layout="total, sizes, prev, pager, next, jumper">
  108. </el-pagination>
  109. <detail v-if="detailVisible" ref="detail"/>
  110. </div>
  111. </template>
  112. <script>
  113. import {getTransferList} from '@/api/task'
  114. import Detail from './handover-records-details'
  115. export default {
  116. name: 'handover-records',
  117. components: {Detail},
  118. data () {
  119. return {
  120. detailVisible: false,
  121. dataForm: {},
  122. dataList: [],
  123. pageIndex: 1,
  124. pageSize: 10,
  125. totalPage: 0,
  126. dataListLoading: false,
  127. dataListSelections: []
  128. }
  129. },
  130. created () {
  131. this.getDataList()
  132. },
  133. methods: {
  134. // 查询
  135. queryPage () {
  136. this.pageIndex = 1
  137. this.getDataList()
  138. },
  139. // 获取数据列表
  140. getDataList () {
  141. this.dataListLoading = true
  142. this.addOrUpdateVisible = false
  143. // 接口调用
  144. let params = {
  145. 'current': this.pageIndex,
  146. 'size': this.pageSize,
  147. 'productName': this.dataForm.name ? this.dataForm.name : null,
  148. 'prodCode': this.dataForm.code ? this.dataForm.code : null
  149. }
  150. getTransferList(params).then(({data}) => {
  151. if (data && data.code === '200') {
  152. this.dataList = data.data.records
  153. this.totalPage = Number(data.data.total)
  154. } else {
  155. this.dataList = []
  156. this.totalPage = 0
  157. }
  158. this.dataListLoading = false
  159. })
  160. },
  161. // 每页数
  162. sizeChangeHandle (val) {
  163. this.pageSize = val
  164. this.pageIndex = 1
  165. this.getDataList()
  166. },
  167. // 当前页
  168. currentChangeHandle (val) {
  169. this.pageIndex = val
  170. this.getDataList()
  171. },
  172. // 多选
  173. selectionChangeHandle (val) {
  174. this.dataListSelections = val
  175. },
  176. // 详情
  177. detailHandle (id) {
  178. this.detailVisible = true
  179. this.$nextTick(() => {
  180. this.$refs.detail.init(id)
  181. })
  182. }
  183. }
  184. }
  185. </script>
  186. <style scoped>
  187. </style>