You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

560 lines
17 KiB

  1. <script>
  2. import {queryQuoteDetailBomTree} from "@/api/quote/quoteDetailBomTree";
  3. export default {
  4. name: "quoteDetailRouting",
  5. props:{
  6. quoteDetail:{
  7. type:Object,
  8. required:true
  9. },
  10. },
  11. model:{
  12. prop: "quoteDetail",
  13. event: "update"
  14. },
  15. data(){
  16. return{
  17. isAllBom:false,
  18. dataList:[],
  19. treeData:[],
  20. columns: [
  21. {
  22. userId: this.$store.state.user.name,
  23. functionId: 5011,
  24. serialNumber: '5011Table5OperationNo',
  25. tableId: "5011Table5",
  26. tableName: "报价工艺信息",
  27. columnProp: 'operationNo',
  28. headerAlign: "center",
  29. align: "center",
  30. columnLabel: '工序号',
  31. columnHidden: false,
  32. columnImage: false,
  33. columnSortable: false,
  34. sortLv: 0,
  35. status: true,
  36. fixed: '',
  37. columnWidth: 60,
  38. },{
  39. userId: this.$store.state.user.name,
  40. functionId: 5011,
  41. serialNumber: '5011Table5OperationName',
  42. tableId: "5011Table5",
  43. tableName: "报价工艺信息",
  44. columnProp: 'operationName',
  45. headerAlign: "center",
  46. align: "left",
  47. columnLabel: '工序名称',
  48. columnHidden: false,
  49. columnImage: false,
  50. columnSortable: false,
  51. sortLv: 0,
  52. status: true,
  53. fixed: '',
  54. columnWidth: 120,
  55. },{
  56. userId: this.$store.state.user.name,
  57. functionId: 5011,
  58. serialNumber: '5011Table5PartNo',
  59. tableId: "5011Table5",
  60. tableName: "报价工艺信息",
  61. columnProp: 'partNo',
  62. headerAlign: "center",
  63. align: "left",
  64. columnLabel: '物料编码',
  65. columnHidden: false,
  66. columnImage: false,
  67. columnSortable: false,
  68. sortLv: 0,
  69. status: true,
  70. fixed: '',
  71. columnWidth: 100,
  72. },{
  73. userId: this.$store.state.user.name,
  74. functionId: 5011,
  75. serialNumber: '5011Table5PartDesc',
  76. tableId: "5011Table5",
  77. tableName: "报价工艺信息",
  78. columnProp: 'partDesc',
  79. headerAlign: "center",
  80. align: "left",
  81. columnLabel: '物料描述',
  82. columnHidden: false,
  83. columnImage: false,
  84. columnSortable: false,
  85. sortLv: 0,
  86. status: true,
  87. fixed: '',
  88. columnWidth: 200,
  89. },{
  90. userId: this.$store.state.user.name,
  91. functionId: 5011,
  92. serialNumber: '5011Table5Version',
  93. tableId: "5011Table5",
  94. tableName: "报价工艺信息",
  95. columnProp: 'version',
  96. headerAlign: "center",
  97. align: "center",
  98. columnLabel: '版本',
  99. columnHidden: false,
  100. columnImage: false,
  101. columnSortable: false,
  102. sortLv: 0,
  103. status: true,
  104. fixed: '',
  105. columnWidth: 80,
  106. },{
  107. userId: this.$store.state.user.name,
  108. functionId: 5011,
  109. serialNumber: '5011Table5AlternativeNo',
  110. tableId: "5011Table5",
  111. tableName: "报价工艺信息",
  112. columnProp: 'alternativeNo',
  113. headerAlign: "center",
  114. align: "left",
  115. columnLabel: '替代编码',
  116. columnHidden: false,
  117. columnImage: false,
  118. columnSortable: false,
  119. sortLv: 0,
  120. status: true,
  121. fixed: '',
  122. columnWidth: 100,
  123. },{
  124. userId: this.$store.state.user.name,
  125. functionId: 5011,
  126. serialNumber: '5011Table5AlternativeDesc',
  127. tableId: "5011Table5",
  128. tableName: "报价工艺信息",
  129. columnProp: 'alternativeDesc',
  130. headerAlign: "center",
  131. align: "left",
  132. columnLabel: '替代描述',
  133. columnHidden: false,
  134. columnImage: false,
  135. columnSortable: false,
  136. sortLv: 0,
  137. status: true,
  138. fixed: '',
  139. columnWidth: 120,
  140. },{
  141. userId: this.$store.state.user.name,
  142. functionId: 5011,
  143. serialNumber: '5011Table5WorkCenterNo',
  144. tableId: "5011Table5",
  145. tableName: "报价工艺信息",
  146. columnProp: 'workCenterNo',
  147. headerAlign: "center",
  148. align: "left",
  149. columnLabel: '加工中心编码',
  150. columnHidden: false,
  151. columnImage: false,
  152. columnSortable: false,
  153. sortLv: 0,
  154. status: true,
  155. fixed: '',
  156. columnWidth: 100,
  157. },{
  158. userId: this.$store.state.user.name,
  159. functionId: 5011,
  160. serialNumber: '5011Table5WorkCenterDesc',
  161. tableId: "5011Table5",
  162. tableName: "报价工艺信息",
  163. columnProp: 'workCenterDesc',
  164. headerAlign: "center",
  165. align: "left",
  166. columnLabel: '加工中心名称',
  167. columnHidden: false,
  168. columnImage: false,
  169. columnSortable: false,
  170. sortLv: 0,
  171. status: true,
  172. fixed: '',
  173. columnWidth: 200,
  174. },{
  175. userId: this.$store.state.user.name,
  176. functionId: 5011,
  177. serialNumber: '5011Table5WorkCenterCost',
  178. tableId: "5011Table5",
  179. tableName: "报价工艺信息",
  180. columnProp: 'workCenterCost',
  181. headerAlign: "center",
  182. align: "left",
  183. columnLabel: '加工中心成本',
  184. columnHidden: false,
  185. columnImage: false,
  186. columnSortable: false,
  187. sortLv: 0,
  188. status: true,
  189. fixed: '',
  190. columnWidth: 100,
  191. },{
  192. userId: this.$store.state.user.name,
  193. functionId: 5011,
  194. serialNumber: '5011Table5EfficiencyFactor',
  195. tableId: "5011Table5",
  196. tableName: "报价工艺信息",
  197. columnProp: 'efficiencyFactor',
  198. headerAlign: "center",
  199. align: "right",
  200. columnLabel: '效率%',
  201. columnHidden: false,
  202. columnImage: false,
  203. columnSortable: false,
  204. sortLv: 0,
  205. status: true,
  206. fixed: '',
  207. columnWidth: 100,
  208. },{
  209. userId: this.$store.state.user.name,
  210. functionId: 5011,
  211. serialNumber: '5011Table5MachRunFactor',
  212. tableId: "5011Table5",
  213. tableName: "报价工艺信息",
  214. columnProp: 'machRunFactor',
  215. headerAlign: "center",
  216. align: "right",
  217. columnLabel: '机器单位产出',
  218. columnHidden: false,
  219. columnImage: false,
  220. columnSortable: false,
  221. sortLv: 0,
  222. status: true,
  223. fixed: '',
  224. columnWidth: 100,
  225. },{
  226. userId: this.$store.state.user.name,
  227. functionId: 5011,
  228. serialNumber: '5011Table5MachSetupTime',
  229. tableId: "5011Table5",
  230. tableName: "报价工艺信息",
  231. columnProp: 'machSetupTime',
  232. headerAlign: "center",
  233. align: "right",
  234. columnLabel: '调机时间',
  235. columnHidden: false,
  236. columnImage: false,
  237. columnSortable: false,
  238. sortLv: 0,
  239. status: true,
  240. fixed: '',
  241. columnWidth: 100,
  242. },{
  243. userId: this.$store.state.user.name,
  244. functionId: 5011,
  245. serialNumber: '5011Table5RunTimeDesc',
  246. tableId: "5011Table5",
  247. tableName: "报价工艺信息",
  248. columnProp: 'runTimeDesc',
  249. headerAlign: "center",
  250. align: "center",
  251. columnLabel: '产出单位',
  252. columnHidden: false,
  253. columnImage: false,
  254. columnSortable: false,
  255. sortLv: 0,
  256. status: true,
  257. fixed: '',
  258. columnWidth: 100,
  259. },{
  260. userId: this.$store.state.user.name,
  261. functionId: 5011,
  262. serialNumber: '5011Table5LaborRunFactor',
  263. tableId: "5011Table5",
  264. tableName: "报价工艺信息",
  265. columnProp: 'laborRunFactor',
  266. headerAlign: "center",
  267. align: "right",
  268. columnLabel: '人工单位产出',
  269. columnHidden: false,
  270. columnImage: false,
  271. columnSortable: false,
  272. sortLv: 0,
  273. status: true,
  274. fixed: '',
  275. columnWidth: 120,
  276. },{
  277. userId: this.$store.state.user.name,
  278. functionId: 5011,
  279. serialNumber: '5011Table5LaborSetupTime',
  280. tableId: "5011Table5",
  281. tableName: "报价工艺信息",
  282. columnProp: 'laborSetupTime',
  283. headerAlign: "center",
  284. align: "right",
  285. columnLabel: '人工调机时间',
  286. columnHidden: false,
  287. columnImage: false,
  288. columnSortable: false,
  289. sortLv: 0,
  290. status: true,
  291. fixed: '',
  292. columnWidth: 100,
  293. },{
  294. userId: this.$store.state.user.name,
  295. functionId: 5011,
  296. serialNumber: '5011Table5CrewSize',
  297. tableId: "5011Table5",
  298. tableName: "报价工艺信息",
  299. columnProp: 'crewSize',
  300. headerAlign: "center",
  301. align: "right",
  302. columnLabel: '生产过程人数',
  303. columnHidden: false,
  304. columnImage: false,
  305. columnSortable: false,
  306. sortLv: 0,
  307. status: true,
  308. fixed: '',
  309. columnWidth: 100,
  310. },{
  311. userId: this.$store.state.user.name,
  312. functionId: 5011,
  313. serialNumber: '5011Table5SetupCrewSize',
  314. tableId: "5011Table5",
  315. tableName: "报价工艺信息",
  316. columnProp: 'setupCrewSize',
  317. headerAlign: "center",
  318. align: "right",
  319. columnLabel: '调机过程人数',
  320. columnHidden: false,
  321. columnImage: false,
  322. columnSortable: false,
  323. sortLv: 0,
  324. status: true,
  325. fixed: '',
  326. columnWidth: 100,
  327. },{
  328. userId: this.$store.state.user.name,
  329. functionId: 5011,
  330. serialNumber: '5011Table5LaborClassNo',
  331. tableId: "5011Table5",
  332. tableName: "报价工艺信息",
  333. columnProp: 'laborClassNo',
  334. headerAlign: "center",
  335. align: "left",
  336. columnLabel: '人员等级',
  337. columnHidden: false,
  338. columnImage: false,
  339. columnSortable: false,
  340. sortLv: 0,
  341. status: true,
  342. fixed: '',
  343. columnWidth: 100,
  344. },{
  345. userId: this.$store.state.user.name,
  346. functionId: 5011,
  347. serialNumber: '5011Table5SetupLaborClassNo',
  348. tableId: "5011Table5",
  349. tableName: "报价工艺信息",
  350. columnProp: 'setupLaborClassNo',
  351. headerAlign: "center",
  352. align: "left",
  353. columnLabel: '调机过程中人员等级',
  354. columnHidden: false,
  355. columnImage: false,
  356. columnSortable: false,
  357. sortLv: 0,
  358. status: true,
  359. fixed: '',
  360. columnWidth: 140,
  361. },{
  362. userId: this.$store.state.user.name,
  363. functionId: 5011,
  364. serialNumber: '5011Table5LaborClassCost',
  365. tableId: "5011Table5",
  366. tableName: "报价工艺信息",
  367. columnProp: 'laborClassCost',
  368. headerAlign: "center",
  369. align: "left",
  370. columnLabel: '人员等级成本',
  371. columnHidden: false,
  372. columnImage: false,
  373. columnSortable: false,
  374. sortLv: 0,
  375. status: true,
  376. fixed: '',
  377. columnWidth: 120,
  378. },{
  379. userId: this.$store.state.user.name,
  380. functionId: 5011,
  381. serialNumber: '5011Table5SetupLaborClassCost',
  382. tableId: "5011Table5",
  383. tableName: "报价工艺信息",
  384. columnProp: 'setupLaborClassCost',
  385. headerAlign: "center",
  386. align: "left",
  387. columnLabel: '调机人员等级成本',
  388. columnHidden: false,
  389. columnImage: false,
  390. columnSortable: false,
  391. sortLv: 0,
  392. status: true,
  393. fixed: '',
  394. columnWidth: 120,
  395. },{
  396. userId: this.$store.state.user.name,
  397. functionId: 5011,
  398. serialNumber: '5011Table5MachineCost',
  399. tableId: "5011Table5",
  400. tableName: "报价工艺信息",
  401. columnProp: 'machineCost',
  402. headerAlign: "center",
  403. align: "right",
  404. columnLabel: '单位机器成本',
  405. columnHidden: false,
  406. columnImage: false,
  407. columnSortable: false,
  408. sortLv: 0,
  409. status: true,
  410. fixed: '',
  411. columnWidth: 140,
  412. },{
  413. userId: this.$store.state.user.name,
  414. functionId: 5011,
  415. serialNumber: '5011Table5MachineCost',
  416. tableId: "5011Table5",
  417. tableName: "报价工艺信息",
  418. columnProp: 'unitManufacturingCosts',
  419. headerAlign: "center",
  420. align: "right",
  421. columnLabel: '单位制造成本',
  422. columnHidden: false,
  423. columnImage: false,
  424. columnSortable: false,
  425. sortLv: 0,
  426. status: true,
  427. fixed: '',
  428. columnWidth: 140,
  429. },{
  430. userId: this.$store.state.user.name,
  431. functionId: 5011,
  432. serialNumber: '5011Table5LaborCosts',
  433. tableId: "5011Table5",
  434. tableName: "报价工艺信息",
  435. columnProp: 'laborCosts',
  436. headerAlign: "center",
  437. align: "right",
  438. columnLabel: '单位人工成本',
  439. columnHidden: false,
  440. columnImage: false,
  441. columnSortable: false,
  442. sortLv: 0,
  443. status: true,
  444. fixed: '',
  445. columnWidth: 140,
  446. },{
  447. userId: this.$store.state.user.name,
  448. functionId: 5011,
  449. serialNumber: '5011Table5QuoteUnitCost',
  450. tableId: "5011Table5",
  451. tableName: "报价工艺信息",
  452. columnProp: 'quoteUnitCost',
  453. headerAlign: "center",
  454. align: "right",
  455. columnLabel: '单位报价成本',
  456. columnHidden: false,
  457. columnImage: false,
  458. columnSortable: false,
  459. sortLv: 0,
  460. status: true,
  461. fixed: 'right',
  462. columnWidth: 120,
  463. },
  464. ],
  465. props:{
  466. children: 'list',
  467. label: (data,node)=>{
  468. return `${data.partNo}-${data.engChgLevel}-${data.alternativeNo}-${data.bomType}`;
  469. },
  470. },
  471. queryTreeLoading:false,
  472. }
  473. },
  474. methods:{
  475. handleQueryQuoteDetailBomTree(){
  476. let params = {
  477. id: this.quoteDetail.id,
  478. }
  479. this.queryTreeLoading = true;
  480. queryQuoteDetailBomTree(params).then(({data})=>{
  481. if (data && data.code === 0){
  482. this.treeData = data.rows;
  483. if (this.treeData.length > 0){
  484. this.$nextTick(()=>{
  485. this.$refs.tree.setCurrentKey(this.treeData[0].id);
  486. })
  487. }
  488. this.queryTreeLoading = false;
  489. }else {
  490. this.$message.warning(data.msg);
  491. this.queryTreeLoading = false;
  492. }
  493. }).catch((error)=>{
  494. this.$message.error(error);
  495. })
  496. },
  497. nodeClick(data){
  498. },
  499. },
  500. created() {
  501. if (this.quoteDetail && this.quoteDetail.id){
  502. this.handleQueryQuoteDetailBomTree();
  503. }
  504. },
  505. watch:{
  506. 'quoteDetail.id'(newVal,oldVal){
  507. this.handleQueryQuoteDetailBomTree();
  508. },
  509. }
  510. }
  511. </script>
  512. <template>
  513. <div>
  514. <div style="margin-bottom: 10px">
  515. <el-link style="margin-right: 20px">切换版本</el-link>
  516. <el-checkbox v-model="isAllBom">全级Routing结构</el-checkbox>
  517. </div>
  518. <el-container>
  519. <el-aside width="300px" v-loading="queryTreeLoading">
  520. <el-tree
  521. :data="treeData"
  522. :props="props"
  523. :default-expand-all="true"
  524. :expand-on-click-node="false"
  525. node-key="id"
  526. highlight-current
  527. @node-click="nodeClick" ref="tree">
  528. </el-tree>
  529. </el-aside>
  530. <el-main style="padding: 0">
  531. <el-table :data="dataList" border style="width: 100%" :height="420">
  532. <el-table-column
  533. v-for="(item,index) in columns" :key="index"
  534. :sortable="item.columnSortable"
  535. :prop="item.columnProp"
  536. :header-align="item.headerAlign"
  537. :show-overflow-tooltip="item.showOverflowTooltip"
  538. :align="item.align"
  539. :fixed="item.fixed===''?false:item.fixed"
  540. :min-width="item.columnWidth"
  541. :label="item.columnLabel">
  542. <template slot-scope="scope">
  543. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  544. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  545. </template>
  546. </el-table-column>
  547. </el-table>
  548. </el-main>
  549. </el-container>
  550. </div>
  551. </template>
  552. <style scoped>
  553. </style>