index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <div class="ele-body">
  3. <el-card shadow="never" v-loading="loading">
  4. <order-search @search="reload" ref="searchRef"> </order-search>
  5. <ele-pro-table
  6. ref="table"
  7. :columns="columns"
  8. :datasource="datasource"
  9. :cache-key="cacheKeyUrl"
  10. @columns-change="handleColumnChange"
  11. >
  12. <template v-slot:Weight="{ row }">
  13. <span>{{ row.weight | weightFilter }}</span>
  14. </template>
  15. <template v-slot:SlottingType="{ row }">
  16. {{ getDictValue('开槽类型', row.slottingType + '') }}
  17. </template>
  18. <!-- <template v-slot:Status="{ row }">
  19. {{ hangingStatus(row.status) }}
  20. </template> -->
  21. <!-- 操作列 -->
  22. <template v-slot:action="{ row }">
  23. <el-link
  24. type="primary"
  25. :underline="false"
  26. icon="el-icon-truck"
  27. @click="confirm(row)"
  28. v-if="row.status == 0"
  29. >
  30. 任务下发
  31. </el-link>
  32. </template>
  33. </ele-pro-table>
  34. </el-card>
  35. </div>
  36. </template>
  37. <script>
  38. // import { getList, releaseWorkOrder } from '@/api/workOrder/index.js';
  39. import OrderSearch from './components/order-search.vue';
  40. import dictMixins from '@/mixins/dictMixins';
  41. import { hangingStatus } from '@/utils/util';
  42. import {
  43. getPutMeshWorkOrderByPage,
  44. issuedPutMeshWorkOrder
  45. } from '@/api/mergePutMesh/mergePutMesh';
  46. import tabMixins from '@/mixins/tableColumnsMixin';
  47. export default {
  48. components: {
  49. OrderSearch
  50. },
  51. mixins: [dictMixins, tabMixins],
  52. data() {
  53. return {
  54. visible: false,
  55. loading: false,
  56. releasParams: {
  57. teamId: '',
  58. id: ''
  59. },
  60. current: null,
  61. cacheKeyUrl: '79025f25-aps-hangingWorkOrder',
  62. columnsVersion:1
  63. };
  64. },
  65. computed: {
  66. // 表格列配置
  67. columns() {
  68. const num = this.columnsVersion;
  69. return [
  70. {
  71. columnKey: 'index',
  72. label: '序号',
  73. type: 'index',
  74. width: 55,
  75. align: 'center',
  76. showOverflowTooltip: true,
  77. fixed: 'left'
  78. },
  79. {
  80. prop: 'weight',
  81. label: '等级',
  82. align: 'center',
  83. slot: 'Weight'
  84. },
  85. {
  86. prop: 'height',
  87. label: '高度',
  88. align: 'center'
  89. },
  90. {
  91. prop: 'length',
  92. label: '长1+长2+长3',
  93. align: 'center'
  94. },
  95. {
  96. prop: 'productName',
  97. label: '产品名称',
  98. align: 'center'
  99. },
  100. {
  101. prop: 'allowance',
  102. label: '余量',
  103. align: 'center'
  104. },
  105. {
  106. prop: 'moCount',
  107. label: '模数',
  108. align: 'center'
  109. },
  110. {
  111. prop: 'blockCount',
  112. label: '片1+片2+片3',
  113. align: 'center'
  114. },
  115. {
  116. prop: 'slottingType',
  117. label: '开槽类型',
  118. align: 'center',
  119. slot: 'SlottingType'
  120. },
  121. {
  122. prop: 'taskTime',
  123. label: '任务日期',
  124. align: 'center'
  125. },
  126. {
  127. prop: 'issuedTime',
  128. label: '下发日期',
  129. align: 'center'
  130. },
  131. {
  132. prop: 'teamName',
  133. label: '班组',
  134. align: 'center'
  135. },
  136. {
  137. prop: 'status',
  138. label: '状态',
  139. align: 'center',
  140. formatter: (row, column, cellValue) => {
  141. return hangingStatus(cellValue);
  142. }
  143. },
  144. {
  145. prop: 'remark',
  146. label: '完结原因',
  147. align: 'center'
  148. },
  149. {
  150. prop: 'customerName',
  151. label: '客户名称',
  152. align: 'center',
  153. showOverflowTooltip: true
  154. },
  155. {
  156. prop: 'serialNo',
  157. label: '客户代号',
  158. align: 'center',
  159. showOverflowTooltip: true
  160. },
  161. {
  162. prop: 'simpleName',
  163. label: '客户简称',
  164. align: 'center',
  165. showOverflowTooltip: true
  166. },
  167. {
  168. columnKey: 'action',
  169. label: '操作',
  170. width: 120,
  171. align: 'center',
  172. resizable: false,
  173. fixed: 'right',
  174. slot: 'action',
  175. showOverflowTooltip: true
  176. }
  177. ];
  178. }
  179. },
  180. created() {
  181. this.requestDict('开槽类型');
  182. },
  183. filters: {
  184. weightFilter(value) {
  185. let weight = '';
  186. switch (value) {
  187. case 1:
  188. weight = 'A';
  189. break;
  190. case 2:
  191. weight = 'B';
  192. break;
  193. case 3:
  194. weight = 'C';
  195. break;
  196. }
  197. return weight;
  198. }
  199. },
  200. methods: {
  201. /* 表格数据源 */
  202. datasource({ page, limit, where }) {
  203. return getPutMeshWorkOrderByPage({
  204. pageNum: page,
  205. size: limit,
  206. ...where
  207. });
  208. },
  209. // 下达
  210. toRelease(row) {
  211. this.current = row;
  212. this.visible = true;
  213. },
  214. // 下达
  215. confirm(row) {
  216. this.$confirm('确认下发选中的任务吗?', '提示', {
  217. confirmButtonText: '确定',
  218. cancleButtonText: '取消',
  219. type: 'warning'
  220. })
  221. .then(async () => {
  222. const res = await issuedPutMeshWorkOrder({
  223. id: [row.id],
  224. status: 1
  225. });
  226. this.$message.success('任务下发成功!');
  227. this.reload();
  228. })
  229. .catch(() => {});
  230. },
  231. /* 刷新表格 */
  232. reload(where) {
  233. console.log(where,'where')
  234. this.$nextTick(() => {
  235. this.$refs.table.reload({ page: 1, where });
  236. });
  237. }
  238. }
  239. };
  240. </script>
  241. <style lang="scss" scoped></style>