handover-records.vue 6.1 KB

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