qualityWorkOrderTable.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <div>
  3. <seek-page :seekList="seekList" @search="search"></seek-page>
  4. <ele-pro-table
  5. ref="table"
  6. row-key="id"
  7. :columns="columns"
  8. :datasource="datasource"
  9. :cache-key="cacheKeyUrl"
  10. autoAmendPage
  11. height="calc(86vh - 230px)"
  12. >
  13. <template v-slot:action="{ row }">
  14. <el-link type="primary" :underline="false" @click="goToDetail(row)">
  15. 详情
  16. </el-link>
  17. </template>
  18. <template v-slot:code="{ row }">
  19. <el-link type="primary" @click="goToDetail(row)">{{
  20. row.code
  21. }}</el-link>
  22. </template>
  23. <template v-slot:toolbar>
  24. <exportButton
  25. fileName="质检工单"
  26. apiUrl="/qms/quality_work_order/exportBatchRecordPage"
  27. :params="params"
  28. ></exportButton
  29. ></template>
  30. </ele-pro-table>
  31. </div>
  32. </template>
  33. <script>
  34. import dictMixins from '@/mixins/dictMixins';
  35. import tableColumnsMixin from '@/mixins/tableColumnsMixin';
  36. import { batchRecordPage } from '@/api/qualityWorkOrder/index.js';
  37. import exportButton from '@/components/upload/exportButton.vue';
  38. export default {
  39. mixins: [dictMixins, tableColumnsMixin],
  40. components: { exportButton },
  41. props: {
  42. tableQuery: {
  43. type: Object,
  44. default: () => {
  45. return {};
  46. }
  47. }
  48. },
  49. data() {
  50. return {
  51. columns: [
  52. {
  53. width: 50,
  54. type: 'index',
  55. columnKey: 'index',
  56. align: 'center',
  57. label: '序号'
  58. },
  59. {
  60. prop: 'code',
  61. label: '质检工单编码',
  62. align: 'center',
  63. minWidth: 110,
  64. showOverflowTooltip: true,
  65. slot: 'code'
  66. },
  67. {
  68. prop: 'name',
  69. label: '质检工单名称',
  70. align: 'center',
  71. showOverflowTooltip: true,
  72. minWidth: 150
  73. },
  74. {
  75. prop: 'sourceCode',
  76. label: '来源单号',
  77. align: 'center',
  78. showOverflowTooltip: true,
  79. minWidth: 150,
  80. formatter: (row) => {
  81. return row.qualityPlanCode
  82. ? row.qualityPlanCode
  83. : row.workOrderCode;
  84. }
  85. },
  86. {
  87. prop: 'qualityType',
  88. label: '类型',
  89. align: 'center',
  90. showOverflowTooltip: true,
  91. minWidth: 150,
  92. formatter: (row) => {
  93. return this.getDictValue('质检计划类型', row.qualityType);
  94. }
  95. },
  96. {
  97. prop: 'qualityMode',
  98. label: '质检方式',
  99. align: 'center',
  100. showOverflowTooltip: true,
  101. minWidth: 150,
  102. formatter: (row) => {
  103. return this.getDictValue('取样类型', `0${row.qualityMode}`);
  104. }
  105. },
  106. {
  107. prop: 'qualityName',
  108. label: '报工人',
  109. align: 'center',
  110. showOverflowTooltip: true,
  111. minWidth: 150
  112. },
  113. {
  114. prop: 'qualityTime',
  115. label: '质检时间',
  116. align: 'center',
  117. showOverflowTooltip: true,
  118. minWidth: 150
  119. },
  120. {
  121. prop: 'status',
  122. label: '状态',
  123. align: 'center',
  124. showOverflowTooltip: true,
  125. minWidth: 150,
  126. formatter: (row) => {
  127. switch (row.status) {
  128. case 0:
  129. return '未报工';
  130. case 1:
  131. return '已报工';
  132. default:
  133. return '已关闭';
  134. }
  135. }
  136. },
  137. {
  138. label: '操作',
  139. columnKey: 'action',
  140. slot: 'action',
  141. showOverflowTooltip: true,
  142. minWidth: 110,
  143. align: 'center',
  144. fixed: 'right'
  145. }
  146. ],
  147. cacheKeyUrl: 'mes-9221130-quality-work-order-table',
  148. params: {}
  149. };
  150. },
  151. computed: {
  152. seekList() {
  153. return [
  154. {
  155. label: '生产工单编码',
  156. value: 'workOrderCode',
  157. type: 'input',
  158. placeholder: '请输入',
  159. labelWidth: 110
  160. },
  161. {
  162. label: '质检工单编码',
  163. value: 'code',
  164. type: 'input',
  165. placeholder: '请输入',
  166. labelWidth: 110
  167. },
  168. {
  169. label: '质检工单名称',
  170. value: 'name',
  171. type: 'input',
  172. placeholder: '请输入',
  173. labelWidth: 110
  174. }
  175. ];
  176. }
  177. },
  178. created() {
  179. this.requestDict('质检计划类型');
  180. this.requestDict('不良品处理类型');
  181. this.requestDict('取样类型');
  182. },
  183. methods: {
  184. // 刷新表格
  185. reload(where = {}) {
  186. this.$refs.table.reload({
  187. where,
  188. ...this.tableQuery
  189. });
  190. },
  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. this.params = body;
  202. return batchRecordPage(body);
  203. },
  204. search(where) {
  205. this.reload(where);
  206. },
  207. goToDetail(row) {
  208. const path = `/page-qms/inspectionWork/details?id=${row.id}&path=&name=工单`;
  209. window.history.pushState(null, '', path);
  210. }
  211. }
  212. };
  213. </script>
  214. <style></style>