handover-records.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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. v-if="isAuth('prod:transfer:info')"
  91. fixed="right"
  92. header-align="center"
  93. align="center"
  94. width="140"
  95. label="操作">
  96. <template slot-scope="scope">
  97. <el-button type="text" size="small" @click="detailHandle(scope.row.recordId)">查看</el-button>
  98. </template>
  99. </el-table-column>
  100. </el-table>
  101. <el-pagination
  102. @size-change="sizeChangeHandle"
  103. @current-change="currentChangeHandle"
  104. :current-page="pageIndex"
  105. :page-sizes="[10, 20, 50, 100]"
  106. :page-size="pageSize"
  107. :total="totalPage"
  108. layout="total, sizes, prev, pager, next, jumper">
  109. </el-pagination>
  110. <detail v-if="detailVisible" ref="detail"/>
  111. </div>
  112. </template>
  113. <script>
  114. import {getTransferList} from '@/api/task'
  115. import Detail from './handover-records-details'
  116. export default {
  117. name: 'handover-records',
  118. components: {Detail},
  119. data () {
  120. return {
  121. detailVisible: false,
  122. dataForm: {},
  123. dataList: [],
  124. pageIndex: 1,
  125. pageSize: 10,
  126. totalPage: 0,
  127. dataListLoading: false,
  128. dataListSelections: []
  129. }
  130. },
  131. created () {
  132. this.getDataList()
  133. },
  134. methods: {
  135. // 查询
  136. queryPage () {
  137. this.pageIndex = 1
  138. this.getDataList()
  139. },
  140. // 获取数据列表
  141. getDataList () {
  142. this.dataListLoading = true
  143. this.addOrUpdateVisible = false
  144. // 接口调用
  145. let params = {
  146. 'current': this.pageIndex,
  147. 'size': this.pageSize,
  148. 'productName': this.dataForm.name ? this.dataForm.name : null,
  149. 'prodCode': this.dataForm.code ? this.dataForm.code : null
  150. }
  151. getTransferList(params).then(({data}) => {
  152. if (data && data.code === '200') {
  153. this.dataList = data.data.records
  154. this.totalPage = Number(data.data.total)
  155. } else {
  156. this.dataList = []
  157. this.totalPage = 0
  158. }
  159. this.dataListLoading = false
  160. })
  161. },
  162. // 每页数
  163. sizeChangeHandle (val) {
  164. this.pageSize = val
  165. this.pageIndex = 1
  166. this.getDataList()
  167. },
  168. // 当前页
  169. currentChangeHandle (val) {
  170. this.pageIndex = val
  171. this.getDataList()
  172. },
  173. // 多选
  174. selectionChangeHandle (val) {
  175. this.dataListSelections = val
  176. },
  177. // 详情
  178. detailHandle (id) {
  179. this.detailVisible = true
  180. this.$nextTick(() => {
  181. this.$refs.detail.init(id)
  182. })
  183. }
  184. }
  185. }
  186. </script>
  187. <style scoped>
  188. </style>