index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. <template>
  2. <div class="ele-body">
  3. <el-card v-loading="loading" shadow="never">
  4. <task-search @search="reload"></task-search>
  5. <!-- <taskDialog-search></taskDialog-search> -->
  6. <el-tabs v-model="tabValue" type="card" @tab-click="handleTabClick">
  7. <el-tab-pane label="我的任务" name="1"></el-tab-pane>
  8. <el-tab-pane label="全部任务" name="2"></el-tab-pane>
  9. </el-tabs>
  10. </el-card>
  11. <ele-pro-table
  12. ref="table"
  13. :columns="columns"
  14. :datasource="datasource"
  15. :pageSize="20"
  16. cache-key="workOrderTable"
  17. class="my_pro_table"
  18. row-key="id"
  19. >
  20. <template v-slot:assignCode="{ row }">
  21. <el-link
  22. :underline="false"
  23. type="primary"
  24. @click="details('assign', row)"
  25. >{{ row.assignCode }}
  26. </el-link>
  27. </template>
  28. <template v-slot:workOrderCode="{ row }">
  29. <el-link
  30. :underline="false"
  31. type="primary"
  32. @click="details('assign', row)"
  33. >{{ row.workOrderCode }}
  34. </el-link>
  35. </template>
  36. <template v-slot:action="{ row }">
  37. <el-link
  38. :underline="false"
  39. type="primary"
  40. @click="details('report', row)"
  41. >报工
  42. </el-link>
  43. <el-link
  44. :underline="false"
  45. type="primary"
  46. @click="viewRecords(row.id)"
  47. >修改记录
  48. </el-link>
  49. </template>
  50. </ele-pro-table>
  51. <modifyDialog ref="modifyRef" />
  52. <Ddtails ref="detailsRef" @success="reload" />
  53. </div>
  54. </template>
  55. <script>
  56. import TaskSearch from './components/task-search.vue';
  57. import Ddtails from './components/Ddtails.vue';
  58. import modifyDialog from '@/views/taskList/components/modifyDialog.vue';
  59. import {
  60. pageByCurrentUser,
  61. pageByCurrentUserLeader,
  62. listUpdateRealTimeRecord
  63. } from '@/api/workOrderList';
  64. export default {
  65. components: { TaskSearch, Ddtails,modifyDialog },
  66. data() {
  67. return {
  68. loading: false,
  69. tabValue: '1',
  70. statusOpt: [
  71. { label: '待生产', value: 4 },
  72. { label: '生产中', value: 5 },
  73. { label: '待下达', value: 8 }
  74. ]
  75. };
  76. },
  77. computed: {
  78. // 表格列配置
  79. columns() {
  80. return [
  81. {
  82. columnKey: 'index',
  83. label: '序号',
  84. type: 'index',
  85. width: 55,
  86. align: 'center',
  87. showOverflowTooltip: true,
  88. fixed: 'left'
  89. },
  90. {
  91. slot: 'assignCode',
  92. prop: 'assignCode',
  93. label: '任务编码',
  94. align: 'center',
  95. showOverflowTooltip: true,
  96. width: 210
  97. },
  98. {
  99. slot: 'workOrderCode',
  100. prop: 'workOrderCode',
  101. label: '生产订单编码',
  102. align: 'center',
  103. showOverflowTooltip: true,
  104. width: 210
  105. },
  106. {
  107. prop: 'mesWorkOrderCode',
  108. label: '生产工单编码',
  109. align: 'center',
  110. showOverflowTooltip: true,
  111. width: 210
  112. },
  113. {
  114. prop: 'productionPlanCode',
  115. label: '计划编号',
  116. align: 'center',
  117. showOverflowTooltip: true,
  118. width: 170
  119. },
  120. {
  121. prop: 'assigneeType',
  122. label: '执行类型',
  123. align: 'center',
  124. showOverflowTooltip: true,
  125. width: 120,
  126. formatter: (row) => {
  127. if (!row.assigneeType) return '';
  128. return row.assigneeType.desc;
  129. }
  130. },
  131. {
  132. prop: 'assigneeName',
  133. label: '执行对象名称',
  134. align: 'center',
  135. showOverflowTooltip: true,
  136. width: 180
  137. },
  138. {
  139. prop: 'workCenterName',
  140. label: '工作中心',
  141. align: 'center',
  142. width: 180,
  143. showOverflowTooltip: true
  144. },
  145. {
  146. prop: 'assignTeamName',
  147. label: '班组名称',
  148. align: 'center',
  149. showOverflowTooltip: true,
  150. width: 180
  151. },
  152. {
  153. prop: 'taskName',
  154. label: '工序名称',
  155. align: 'center',
  156. showOverflowTooltip: true,
  157. width: 150
  158. },
  159. {
  160. prop: 'produceRoutingName',
  161. label: '工艺路线',
  162. align: 'center',
  163. showOverflowTooltip: true,
  164. width: 170
  165. },
  166. {
  167. prop: 'productCode',
  168. label: '产品编码',
  169. align: 'center',
  170. showOverflowTooltip: true,
  171. width: 170
  172. },
  173. {
  174. prop: 'productName',
  175. label: '产品名称',
  176. align: 'center',
  177. showOverflowTooltip: true,
  178. width: 200
  179. },
  180. {
  181. prop: 'productionCodes',
  182. label: '生产编号',
  183. align: 'center',
  184. showOverflowTooltip: true,
  185. width: 170
  186. },
  187. {
  188. prop: 'brandNo',
  189. label: '牌号',
  190. align: 'center',
  191. showOverflowTooltip: true,
  192. width: 170
  193. },
  194. {
  195. prop: 'batchNo',
  196. label: '批次号',
  197. align: 'center',
  198. width: 100,
  199. showOverflowTooltip: true
  200. },
  201. {
  202. prop: 'model',
  203. label: '型号',
  204. align: 'center',
  205. width: 200,
  206. showOverflowTooltip: true
  207. },
  208. {
  209. prop: 'formingNum',
  210. label: '要求生产数量',
  211. align: 'center',
  212. showOverflowTooltip: true,
  213. width: 110
  214. },
  215. {
  216. prop: 'formingWeight',
  217. label: '要求生产重量',
  218. align: 'center',
  219. showOverflowTooltip: true,
  220. width: 110,
  221. slot: 'formingWeight'
  222. },
  223. {
  224. prop: 'planStartTime',
  225. label: '计划开始时间',
  226. align: 'center',
  227. showOverflowTooltip: true,
  228. width: 180
  229. },
  230. {
  231. prop: 'planCompleteTime',
  232. label: '计划结束时间',
  233. align: 'center',
  234. showOverflowTooltip: true,
  235. width: 180
  236. },
  237. {
  238. prop: 'startTime',
  239. label: '任务开始时间',
  240. align: 'center',
  241. showOverflowTooltip: true,
  242. width: 180
  243. },
  244. {
  245. prop: 'endTime',
  246. label: '任务结束时间',
  247. align: 'center',
  248. showOverflowTooltip: true,
  249. width: 180
  250. },
  251. {
  252. prop: 'firstTaskName',
  253. label: '首工序',
  254. align: 'center',
  255. width: 180,
  256. showOverflowTooltip: true
  257. },
  258. {
  259. prop: 'createTime',
  260. label: '创建时间',
  261. align: 'center',
  262. showOverflowTooltip: true,
  263. width: 180
  264. },
  265. {
  266. prop:'statusText',
  267. label: '状态',
  268. align: 'center',
  269. // formatter: (row) => {
  270. // const obj = this.statusOpt.find((i) => i.value == row.status);
  271. // return obj && obj.label;
  272. // },
  273. width: 120
  274. },
  275. {
  276. prop: 'customerName',
  277. label: '客户名称',
  278. align: 'center',
  279. showOverflowTooltip: true,
  280. width: 180
  281. },
  282. {
  283. prop: 'serialNo',
  284. label: '客户代号',
  285. align: 'center',
  286. showOverflowTooltip: true,
  287. width: 180
  288. },
  289. {
  290. prop: 'simpleName',
  291. label: '客户简称',
  292. align: 'center',
  293. showOverflowTooltip: true,
  294. width: 180
  295. },
  296. {
  297. columnKey: 'action',
  298. label: '操作',
  299. width: 150,
  300. align: 'center',
  301. resizable: false,
  302. fixed: 'right',
  303. slot: 'action'
  304. }
  305. ];
  306. }
  307. },
  308. created() {},
  309. mounted() {
  310. },
  311. methods: {
  312. handleTabClick(e) {
  313. this.tabValue = e.name;
  314. this.reload();
  315. },
  316. /* 表格数据源 */
  317. datasource({ page, limit, where }) {
  318. let api =
  319. this.tabValue === '1' ? pageByCurrentUser : pageByCurrentUserLeader;
  320. return api({
  321. ...where,
  322. pageNum: page,
  323. size: limit
  324. });
  325. },
  326. reload(where) {
  327. this.$refs.table.reload({ page: 1, where });
  328. },
  329. details(type, row) {
  330. let currentRow = {
  331. assignCode: row.assignCode,
  332. workOrderCode: row.workOrderCode,
  333. productionPlanCode: row.productionPlanCode,
  334. produceRoutingName: row.produceRoutingName,
  335. formingNum: row.formingNum,
  336. assignTeamName: row.assignTeamName,
  337. formingWeight: row.formingWeight,
  338. planStartTime: row.planStartTime,
  339. planCompleteTime: row.planCompleteTime,
  340. startTime: row.startTime,
  341. firstTaskId: row.firstTaskId,
  342. endTime: row.endTime,
  343. taskName: row.taskName,
  344. firstTaskName: row.firstTaskName,
  345. assigneeType: row.assigneeType ? row.assigneeType.desc : '',
  346. assigneeName: row.assigneeName,
  347. weight: row.weight,
  348. quantity: row.quantity,
  349. durationText:row.durationText,
  350. apsAssigneeId: row.id
  351. };
  352. let form = {
  353. realEndTime: row.realEndTime,
  354. realStartTime: row.realStartTime,
  355. unqualifiedWeight: row.unqualifiedWeight,
  356. unqualifiedQuantity: row.unqualifiedQuantity,
  357. qualifiedWeight: row.qualifiedWeight,
  358. remark: row.assigneeRemark,
  359. qualifiedQuantity: row.qualifiedQuantity,
  360. }
  361. this.$refs.detailsRef.open(type, currentRow,form);
  362. },
  363. viewRecords(apsAssigneeId){
  364. listUpdateRealTimeRecord(apsAssigneeId).then(res => {
  365. if (res && res.length > 0){
  366. this.$refs.modifyRef.open(res)
  367. }else{
  368. this.$message.warning('暂无修改历史记录数据')
  369. }
  370. }).catch((err)=>{
  371. this.$message.error(err.message)
  372. })
  373. }
  374. }
  375. };
  376. </script>
  377. <style lang="scss" scoped>
  378. .ele-body {
  379. height: 100%;
  380. .my_pro_table {
  381. height: calc(100% - 136px);
  382. }
  383. }
  384. ::v-deep .el-table {
  385. height: calc(100% - 96px);
  386. }
  387. </style>