qualityInspection.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <div>
  3. <seek-page :seekList="seekList" @search="search"></seek-page>
  4. <ele-pro-table
  5. ref="table"
  6. :columns="columns"
  7. :datasource="datasource"
  8. :cache-key="cacheKeyUrl"
  9. :needPage="false"
  10. height="calc(86vh - 230px)"
  11. >
  12. <template v-slot:selfCheck="{ row }">
  13. <el-button
  14. type="primary"
  15. v-if="row.status == 2 || row.status == 3"
  16. @click="reportClick(row, 1, 'detail')"
  17. >详情</el-button
  18. >
  19. </template>
  20. <template v-slot:specialInspection="{ row }">
  21. <el-button
  22. type="primary"
  23. v-if="row.status == 3"
  24. @click="reportClick(row, 2, 'detail')"
  25. >详情</el-button
  26. >
  27. </template>
  28. <template v-slot:status="{ row }">
  29. <el-tag v-if="row.status == 0">待自检</el-tag>
  30. <el-tag v-if="row.status == 2">待专检</el-tag>
  31. <el-tag v-if="row.status == 3">已完成</el-tag>
  32. </template>
  33. </ele-pro-table>
  34. <self-inspection-reporting
  35. ref="selfReportingRef"
  36. @refreshData="reload"
  37. ></self-inspection-reporting>
  38. </div>
  39. </template>
  40. <script>
  41. import dictMixins from '@/mixins/dictMixins';
  42. import tableColumnsMixin from '@/mixins/tableColumnsMixin';
  43. import selfInspectionReporting from '@/views/produce/components/qualityInspection/components/selfInspectionReporting.vue';
  44. import { getBatchRecordList } from '@/api/produce/qualityInspection';
  45. import { produceTask } from '@/api/InTheSystem/index';
  46. export default {
  47. mixins: [dictMixins, tableColumnsMixin],
  48. components: {
  49. selfInspectionReporting
  50. },
  51. props: {
  52. tableQuery: {
  53. type: Object,
  54. default: () => {
  55. return {};
  56. }
  57. }
  58. },
  59. data() {
  60. return {
  61. columns: [
  62. {
  63. width: 50,
  64. type: 'index',
  65. columnKey: 'index',
  66. label: '序号',
  67. align: 'center'
  68. },
  69. {
  70. prop: 'name',
  71. label: '名称',
  72. align: 'center',
  73. showOverflowTooltip: true,
  74. minWidth: 150
  75. },
  76. {
  77. prop: 'workstationName',
  78. label: '工位名称',
  79. align: 'center',
  80. showOverflowTooltip: true,
  81. minWidth: 150
  82. },
  83. {
  84. prop: 'deviceName',
  85. label: '设备名称',
  86. align: 'center',
  87. showOverflowTooltip: true,
  88. minWidth: 150
  89. },
  90. {
  91. prop: 'produceTaskName',
  92. label: '工序名称',
  93. align: 'center',
  94. showOverflowTooltip: true,
  95. minWidth: 150
  96. },
  97. {
  98. prop: 'selfCheckUserName',
  99. label: '自检报工人',
  100. align: 'center',
  101. showOverflowTooltip: true,
  102. minWidth: 120
  103. },
  104. {
  105. prop: 'selfCheckTime',
  106. label: '自检时间',
  107. align: 'center',
  108. showOverflowTooltip: true,
  109. minWidth: 120
  110. },
  111. {
  112. prop: 'specialCheckUserName',
  113. label: '专检报工人',
  114. align: 'center',
  115. showOverflowTooltip: true,
  116. minWidth: 120
  117. },
  118. {
  119. prop: 'specialCheckTime',
  120. label: '专检时间',
  121. align: 'center',
  122. showOverflowTooltip: true,
  123. minWidth: 120
  124. },
  125. {
  126. prop: 'status',
  127. slot: 'status',
  128. label: '状态',
  129. align: 'center',
  130. showOverflowTooltip: true,
  131. minWidth: 100
  132. },
  133. {
  134. label: '自检报工',
  135. align: 'center',
  136. width: 150,
  137. fixed: 'right',
  138. slot: 'selfCheck'
  139. },
  140. {
  141. label: '专检报工',
  142. align: 'center',
  143. width: 150,
  144. fixed: 'right',
  145. slot: 'specialInspection'
  146. }
  147. ],
  148. cacheKeyUrl: 'batchRecord-qualityInspection-2025-12-17',
  149. routList: []
  150. };
  151. },
  152. computed: {
  153. seekList() {
  154. return [
  155. {
  156. label: '工序:',
  157. value: 'produceTaskId',
  158. type: 'select',
  159. placeholder: '请选择',
  160. planList: this.routList
  161. }
  162. ];
  163. }
  164. },
  165. created() {
  166. this.getTaskList();
  167. },
  168. methods: {
  169. reload(where = {}) {
  170. this.$refs.table.reload({
  171. where,
  172. ...this.tableQuery
  173. });
  174. },
  175. async getTaskList() {
  176. let params = {
  177. pageNum: 1,
  178. size: -1
  179. };
  180. await produceTask(params).then((res) => {
  181. this.routList = res.list.map((item) => {
  182. return {
  183. label: item.name,
  184. value: item.id
  185. };
  186. });
  187. });
  188. },
  189. search(where) {
  190. this.reload(where);
  191. },
  192. datasource({ page, limit, where, order }) {
  193. // 参数
  194. const body = {
  195. ...where,
  196. ...order,
  197. pageNum: page,
  198. size: limit,
  199. ...this.tableQuery
  200. };
  201. return getBatchRecordList(body);
  202. },
  203. reportClick(row, type, mode) {
  204. this.$refs.selfReportingRef.open(row, type, mode);
  205. }
  206. }
  207. };
  208. </script>
  209. <style></style>