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.

819 lines
26 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
5 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <script>
  2. import {queryQuoteDetailBomTree} from "@/api/quote/quoteDetailBomTree";
  3. import {
  4. queryQuoteDetailRouting,
  5. queryQuoteDetailRoutingAlternative, changeQuoteDetailRoutingChange,
  6. queryQuoteDetailRoutingVersion
  7. } from "@/api/quote/quoteDetailRouting";
  8. import {updateColumnSize} from "../../../../../api/table";
  9. export default {
  10. name: "quoteDetailRouting",
  11. props:{
  12. quoteDetail:{
  13. type:Object,
  14. required:true
  15. },
  16. },
  17. model:{
  18. prop: "quoteDetail",
  19. event: "update"
  20. },
  21. data(){
  22. return{
  23. isAllRouting:false,
  24. dataList:[],
  25. queryLoading:false,
  26. treeData:[],
  27. columns: [
  28. {
  29. userId: this.$store.state.user.name,
  30. functionId: 5011,
  31. serialNumber: '5011Table5OperationNo',
  32. tableId: "5011Table5",
  33. tableName: "报价工艺信息",
  34. columnProp: 'operationNo',
  35. headerAlign: "center",
  36. align: "center",
  37. columnLabel: '工序号',
  38. columnHidden: false,
  39. columnImage: false,
  40. columnSortable: false,
  41. sortLv: 0,
  42. status: true,
  43. fixed: '',
  44. columnWidth: 60,
  45. },{
  46. userId: this.$store.state.user.name,
  47. functionId: 5011,
  48. serialNumber: '5011Table5OperationName',
  49. tableId: "5011Table5",
  50. tableName: "报价工艺信息",
  51. columnProp: 'operationName',
  52. headerAlign: "center",
  53. align: "center",
  54. columnLabel: '工序名称',
  55. columnHidden: false,
  56. columnImage: false,
  57. columnSortable: false,
  58. sortLv: 0,
  59. status: true,
  60. fixed: '',
  61. columnWidth: 120,
  62. },{
  63. userId: this.$store.state.user.name,
  64. functionId: 5011,
  65. serialNumber: '5011Table5PartNo',
  66. tableId: "5011Table5",
  67. tableName: "报价工艺信息",
  68. columnProp: 'partNo',
  69. headerAlign: "center",
  70. align: "center",
  71. columnLabel: '物料编码',
  72. columnHidden: false,
  73. columnImage: false,
  74. columnSortable: false,
  75. sortLv: 0,
  76. status: true,
  77. fixed: '',
  78. columnWidth: 100,
  79. },{
  80. userId: this.$store.state.user.name,
  81. functionId: 5011,
  82. serialNumber: '5011Table5PartDesc',
  83. tableId: "5011Table5",
  84. tableName: "报价工艺信息",
  85. columnProp: 'partDesc',
  86. headerAlign: "center",
  87. align: "center",
  88. columnLabel: '物料描述',
  89. columnHidden: false,
  90. columnImage: false,
  91. columnSortable: false,
  92. sortLv: 0,
  93. status: true,
  94. fixed: '',
  95. columnWidth: 200,
  96. },{
  97. userId: this.$store.state.user.name,
  98. functionId: 5011,
  99. serialNumber: '5011Table5Version',
  100. tableId: "5011Table5",
  101. tableName: "报价工艺信息",
  102. columnProp: 'routingRevision',
  103. headerAlign: "center",
  104. align: "center",
  105. columnLabel: '版本',
  106. columnHidden: false,
  107. columnImage: false,
  108. columnSortable: false,
  109. sortLv: 0,
  110. status: true,
  111. fixed: '',
  112. columnWidth: 80,
  113. },{
  114. userId: this.$store.state.user.name,
  115. functionId: 5011,
  116. serialNumber: '5011Table5AlternativeNo',
  117. tableId: "5011Table5",
  118. tableName: "报价工艺信息",
  119. columnProp: 'alternativeNo',
  120. headerAlign: "center",
  121. align: "center",
  122. columnLabel: '替代编码',
  123. columnHidden: false,
  124. columnImage: false,
  125. columnSortable: false,
  126. sortLv: 0,
  127. status: true,
  128. fixed: '',
  129. columnWidth: 100,
  130. },{
  131. userId: this.$store.state.user.name,
  132. functionId: 5011,
  133. serialNumber: '5011Table5WorkCenterNo',
  134. tableId: "5011Table5",
  135. tableName: "报价工艺信息",
  136. columnProp: 'workCenterNo',
  137. headerAlign: "center",
  138. align: "center",
  139. columnLabel: '加工中心编码',
  140. columnHidden: false,
  141. columnImage: false,
  142. columnSortable: false,
  143. sortLv: 0,
  144. status: true,
  145. fixed: '',
  146. columnWidth: 100,
  147. },{
  148. userId: this.$store.state.user.name,
  149. functionId: 5011,
  150. serialNumber: '5011Table5WorkCenterDesc',
  151. tableId: "5011Table5",
  152. tableName: "报价工艺信息",
  153. columnProp: 'workCenterDesc',
  154. headerAlign: "center",
  155. align: "center",
  156. columnLabel: '加工中心名称',
  157. columnHidden: false,
  158. columnImage: false,
  159. columnSortable: false,
  160. sortLv: 0,
  161. status: true,
  162. fixed: '',
  163. columnWidth: 200,
  164. },
  165. {
  166. userId: this.$store.state.user.name,
  167. functionId: 5011,
  168. serialNumber: '5011Table5MachSetupTime',
  169. tableId: "5011Table5",
  170. tableName: "报价工艺信息",
  171. columnProp: 'machSetupTime',
  172. headerAlign: "center",
  173. align: "right",
  174. columnLabel: '机器调机时间',
  175. columnHidden: false,
  176. columnImage: false,
  177. columnSortable: false,
  178. sortLv: 0,
  179. status: true,
  180. fixed: '',
  181. columnWidth: 100,
  182. },
  183. {
  184. userId: this.$store.state.user.name,
  185. functionId: 5011,
  186. serialNumber: '5011Table5SetupCrewSize',
  187. tableId: "5011Table5",
  188. tableName: "报价工艺信息",
  189. columnProp: 'setupCrewSize',
  190. headerAlign: "center",
  191. align: "right",
  192. columnLabel: '调机过程人数',
  193. columnHidden: false,
  194. columnImage: false,
  195. columnSortable: false,
  196. sortLv: 0,
  197. status: true,
  198. fixed: '',
  199. columnWidth: 100,
  200. },
  201. {
  202. userId: this.$store.state.user.name,
  203. functionId: 5011,
  204. serialNumber: '5011Table5SetupLaborClassNo',
  205. tableId: "5011Table5",
  206. tableName: "报价工艺信息",
  207. columnProp: 'setupLaborClassNo',
  208. headerAlign: "center",
  209. align: "center",
  210. columnLabel: '调机时人员等级',
  211. columnHidden: false,
  212. columnImage: false,
  213. columnSortable: false,
  214. sortLv: 0,
  215. status: true,
  216. fixed: '',
  217. columnWidth: 140,
  218. },
  219. {
  220. userId: this.$store.state.user.name,
  221. functionId: 5011,
  222. serialNumber: '5011Table5MachCycleTime',
  223. tableId: "5011Table5",
  224. tableName: "报价工艺信息",
  225. columnProp: 'machCycleTime',
  226. headerAlign: "center",
  227. align: "right",
  228. columnLabel: '机器处理时间',
  229. columnHidden: false,
  230. columnImage: false,
  231. columnSortable: false,
  232. sortLv: 0,
  233. status: true,
  234. fixed: '',
  235. columnWidth: 100,
  236. },
  237. {
  238. userId: this.$store.state.user.name,
  239. functionId: 5011,
  240. serialNumber: '5011Table5MachRunFactor',
  241. tableId: "5011Table5",
  242. tableName: "报价工艺信息",
  243. columnProp: 'machRunFactor',
  244. headerAlign: "center",
  245. align: "right",
  246. columnLabel: '机器单位产出',
  247. columnHidden: false,
  248. columnImage: false,
  249. columnSortable: false,
  250. sortLv: 0,
  251. status: true,
  252. fixed: '',
  253. columnWidth: 100,
  254. },
  255. {
  256. userId: this.$store.state.user.name,
  257. functionId: 5011,
  258. serialNumber: '5011Table5CrewSize',
  259. tableId: "5011Table5",
  260. tableName: "报价工艺信息",
  261. columnProp: 'crewSize',
  262. headerAlign: "center",
  263. align: "right",
  264. columnLabel: '生产过程人数',
  265. columnHidden: false,
  266. columnImage: false,
  267. columnSortable: false,
  268. sortLv: 0,
  269. status: true,
  270. fixed: '',
  271. columnWidth: 100,
  272. },
  273. {
  274. userId: this.$store.state.user.name,
  275. functionId: 5011,
  276. serialNumber: '5011Table5LaborClassNo',
  277. tableId: "5011Table5",
  278. tableName: "报价工艺信息",
  279. columnProp: 'laborClassNo',
  280. headerAlign: "center",
  281. align: "center",
  282. columnLabel: '人员等级',
  283. columnHidden: false,
  284. columnImage: false,
  285. columnSortable: false,
  286. sortLv: 0,
  287. status: true,
  288. fixed: '',
  289. columnWidth: 100,
  290. },
  291. {
  292. userId: this.$store.state.user.name,
  293. functionId: 5011,
  294. serialNumber: '5011Table5LaborSetupTime',
  295. tableId: "5011Table5",
  296. tableName: "报价工艺信息",
  297. columnProp: 'laborSetupTime',
  298. headerAlign: "center",
  299. align: "right",
  300. columnLabel: '人工调机时间',
  301. columnHidden: false,
  302. columnImage: false,
  303. columnSortable: false,
  304. sortLv: 0,
  305. status: true,
  306. fixed: '',
  307. columnWidth: 100,
  308. },
  309. {
  310. userId: this.$store.state.user.name,
  311. functionId: 5011,
  312. serialNumber: '5011Table5LaborCycleTime',
  313. tableId: "5011Table5",
  314. tableName: "报价工艺信息",
  315. columnProp: 'laborCycleTime',
  316. headerAlign: "center",
  317. align: "right",
  318. columnLabel: '人工处理时间',
  319. columnHidden: false,
  320. columnImage: false,
  321. columnSortable: false,
  322. sortLv: 0,
  323. status: true,
  324. fixed: '',
  325. columnWidth: 100,
  326. },
  327. {
  328. userId: this.$store.state.user.name,
  329. functionId: 5011,
  330. serialNumber: '5011Table5LaborRunFactor',
  331. tableId: "5011Table5",
  332. tableName: "报价工艺信息",
  333. columnProp: 'laborRunFactor',
  334. headerAlign: "center",
  335. align: "right",
  336. columnLabel: '人工单位产出',
  337. columnHidden: false,
  338. columnImage: false,
  339. columnSortable: false,
  340. sortLv: 0,
  341. status: true,
  342. fixed: '',
  343. columnWidth: 120,
  344. },
  345. {
  346. userId: this.$store.state.user.name,
  347. functionId: 5011,
  348. serialNumber: '5011Table5RunTimeDesc',
  349. tableId: "5011Table5",
  350. tableName: "报价工艺信息",
  351. columnProp: 'runTimeDesc',
  352. headerAlign: "center",
  353. align: "center",
  354. columnLabel: '产出单位',
  355. columnHidden: false,
  356. columnImage: false,
  357. columnSortable: false,
  358. sortLv: 0,
  359. status: true,
  360. fixed: '',
  361. columnWidth: 100,
  362. },
  363. {
  364. userId: this.$store.state.user.name,
  365. functionId: 5011,
  366. serialNumber: '5011Table5EfficiencyFactor',
  367. tableId: "5011Table5",
  368. tableName: "报价工艺信息",
  369. columnProp: 'efficiencyFactor',
  370. headerAlign: "center",
  371. align: "right",
  372. columnLabel: '效率%',
  373. columnHidden: false,
  374. columnImage: false,
  375. columnSortable: false,
  376. sortLv: 0,
  377. status: true,
  378. fixed: '',
  379. columnWidth: 100,
  380. },
  381. {
  382. userId: this.$store.state.user.name,
  383. functionId: 5011,
  384. serialNumber: '5011Table5ResourceNum',
  385. tableId: "5011Table5",
  386. tableName: "报价工艺信息",
  387. columnProp: 'resourceNum',
  388. headerAlign: "center",
  389. align: "right",
  390. columnLabel: '机台数量',
  391. columnHidden: false,
  392. columnImage: false,
  393. columnSortable: false,
  394. sortLv: 0,
  395. status: true,
  396. fixed: '',
  397. columnWidth: 100,
  398. },
  399. {
  400. userId: this.$store.state.user.name,
  401. functionId: 5011,
  402. serialNumber: '5011Table5LaborClassCost',
  403. tableId: "5011Table5",
  404. tableName: "报价工艺信息",
  405. columnProp: 'laborClassCost',
  406. headerAlign: "center",
  407. align: "right",
  408. columnLabel: '单位人工成本-生产',
  409. columnHidden: false,
  410. columnImage: false,
  411. columnSortable: false,
  412. sortLv: 0,
  413. status: true,
  414. fixed: '',
  415. columnWidth: 120,
  416. },
  417. {
  418. userId: this.$store.state.user.name,
  419. functionId: 5011,
  420. serialNumber: '5011Table5SetupLaborClassCost',
  421. tableId: "5011Table5",
  422. tableName: "报价工艺信息",
  423. columnProp: 'setupLaborClassCost',
  424. headerAlign: "center",
  425. align: "right",
  426. columnLabel: '单位人工成本-调机',
  427. columnHidden: false,
  428. columnImage: false,
  429. columnSortable: false,
  430. sortLv: 0,
  431. status: true,
  432. fixed: '',
  433. columnWidth: 120,
  434. },
  435. {
  436. userId: this.$store.state.user.name,
  437. functionId: 5011,
  438. serialNumber: '5011Table5WorkCenterCost',
  439. tableId: "5011Table5",
  440. tableName: "报价工艺信息",
  441. columnProp: 'workCenterCost',
  442. headerAlign: "center",
  443. align: "right",
  444. columnLabel: '单位机器成本',
  445. columnHidden: false,
  446. columnImage: false,
  447. columnSortable: false,
  448. sortLv: 0,
  449. status: true,
  450. fixed: '',
  451. columnWidth: 120,
  452. },
  453. {
  454. userId: this.$store.state.user.name,
  455. functionId: 5011,
  456. serialNumber: '5011Table5ManuCost',
  457. tableId: "5011Table5",
  458. tableName: "报价工艺信息",
  459. columnProp: 'manuCost',
  460. headerAlign: "center",
  461. align: "right",
  462. columnLabel: '单位制造费用成本',
  463. columnHidden: false,
  464. columnImage: false,
  465. columnSortable: false,
  466. sortLv: 0,
  467. status: true,
  468. fixed: '',
  469. columnWidth: 120,
  470. },
  471. {
  472. userId: this.$store.state.user.name,
  473. functionId: 5011,
  474. serialNumber: '5011Table5TotalMachCost',
  475. tableId: "5011Table5",
  476. tableName: "报价工艺信息",
  477. columnProp: 'totalMachCost',
  478. headerAlign: "center",
  479. align: "right",
  480. columnLabel: '机器成本',
  481. columnHidden: false,
  482. columnImage: false,
  483. columnSortable: false,
  484. sortLv: 0,
  485. status: true,
  486. fixed: '',
  487. columnWidth: 140,
  488. },{
  489. userId: this.$store.state.user.name,
  490. functionId: 5011,
  491. serialNumber: '5011Table5TotalManCost',
  492. tableId: "5011Table5",
  493. tableName: "报价工艺信息",
  494. columnProp: 'totalManCost',
  495. headerAlign: "center",
  496. align: "right",
  497. columnLabel: '制造成本',
  498. columnHidden: false,
  499. columnImage: false,
  500. columnSortable: false,
  501. sortLv: 0,
  502. status: true,
  503. fixed: '',
  504. columnWidth: 140,
  505. },{
  506. userId: this.$store.state.user.name,
  507. functionId: 5011,
  508. serialNumber: '5011Table5TotalLaborCost',
  509. tableId: "5011Table5",
  510. tableName: "报价工艺信息",
  511. columnProp: 'totalLaborCost',
  512. headerAlign: "center",
  513. align: "right",
  514. columnLabel: '人工成本',
  515. columnHidden: false,
  516. columnImage: false,
  517. columnSortable: false,
  518. sortLv: 0,
  519. status: true,
  520. fixed: '',
  521. columnWidth: 140,
  522. },{
  523. userId: this.$store.state.user.name,
  524. functionId: 5011,
  525. serialNumber: '5011Table5TotalCost',
  526. tableId: "5011Table5",
  527. tableName: "报价工艺信息",
  528. columnProp: 'totalCost',
  529. headerAlign: "center",
  530. align: "right",
  531. columnLabel: '成本小计',
  532. columnHidden: false,
  533. columnImage: false,
  534. columnSortable: false,
  535. sortLv: 0,
  536. status: true,
  537. fixed: 'right',
  538. columnWidth: 120,
  539. },
  540. ],
  541. props:{
  542. children: 'list',
  543. label: (data,node)=>{
  544. return `${data.partNo}-${data.engChgLevel}-${data.alternativeNo}-${data.bomType}`;
  545. },
  546. },
  547. queryTreeLoading:false,
  548. versionVisible:false,
  549. versionList:[],
  550. alternativeList:[],
  551. routing:{
  552. }
  553. }
  554. },
  555. methods:{
  556. handleColumnResize(newWidth, oldWidth, column, event){
  557. let inData= this.columnList.filter(item => item.columnProp === column.property)[0]
  558. inData.columnWidth=newWidth
  559. updateColumnSize(inData).then(({data}) => {
  560. if (data.code === 0) {
  561. console.log("栏位宽度保存成功!")
  562. }
  563. })
  564. },
  565. handleQueryQuoteDetailBomTree(){
  566. let params = {
  567. id: this.quoteDetail.id,
  568. queryType: 'routing'
  569. }
  570. this.queryTreeLoading = true;
  571. queryQuoteDetailBomTree(params).then(({data})=>{
  572. if (data && data.code === 0){
  573. this.treeData = data.rows;
  574. if (this.treeData.length > 0){
  575. this.$nextTick(()=>{
  576. this.$refs.tree.setCurrentKey(this.treeData[0].id);
  577. this.handleQueryDetailRouting();
  578. })
  579. }
  580. this.queryTreeLoading = false;
  581. }else {
  582. this.$message.warning(data.msg);
  583. this.queryTreeLoading = false;
  584. }
  585. }).catch((error)=>{
  586. this.$message.error(error);
  587. })
  588. },
  589. nodeClick(data){
  590. this.handleQueryDetailRouting();
  591. },
  592. handleQueryDetailRouting(){
  593. let node = this.$refs.tree.getCurrentNode();
  594. let params = {
  595. treeId:node.id,
  596. quoteDetailId: this.quoteDetail.id,
  597. isAllRouting: this.isAllRouting,
  598. }
  599. this.queryLoading = true;
  600. queryQuoteDetailRouting(params).then(({data})=>{
  601. if (data && data.code === 0){
  602. this.dataList = data.rows;
  603. }else {
  604. this.$message.warning(data.msg);
  605. }
  606. this.queryLoading = false;
  607. }).catch((error)=>{
  608. this.$message.error(error);
  609. this.queryLoading = false;
  610. })
  611. },
  612. handleChangeVersion(){
  613. let node = this.$refs.tree.getCurrentNode();
  614. if (this.treeData.length === 0){
  615. this.$message.warning("未维护BOM结构")
  616. return;
  617. }
  618. if (node){
  619. this.routing = {
  620. partNo: node.partNo,
  621. buNo: node.buNo,
  622. site: node.site,
  623. routingType: node.bomType,
  624. routingRevision: node.engChgLevel,
  625. alternativeNo: node.alternativeNo,
  626. }
  627. }
  628. this.handleQueryVersionList();
  629. this.versionVisible = true;
  630. },
  631. versionRowStyle({row}){
  632. if (row.routingRevision === this.routing.routingRevision && row.routingType === this.routing.routingType){
  633. return { 'background-color': '#E8F7F6' };
  634. }
  635. },
  636. handleQueryVersionList(){
  637. let node = this.$refs.tree.getCurrentNode();
  638. let params = {
  639. treeId: node.id,
  640. }
  641. queryQuoteDetailRoutingVersion(params).then(({data})=>{
  642. if (data && data.code === 0){
  643. this.versionList = data.rows;
  644. this.handleQueryAlternativeList();
  645. }else {
  646. this.$message.warning(data.msg);
  647. }
  648. }).catch((error)=>{
  649. this.$message.error(error);
  650. })
  651. },
  652. handleQueryAlternativeList(){
  653. let params = {
  654. ...this.routing,
  655. }
  656. queryQuoteDetailRoutingAlternative(params).then(({data})=>{
  657. if (data && data.code === 0){
  658. this.alternativeList = data.rows;
  659. }else {
  660. this.$message.warning(data.msg);
  661. }
  662. }).catch((error)=>{
  663. this.$message.error(error);
  664. })
  665. },
  666. versionRowClick(row){
  667. this.routing.routingType = row.routingType;
  668. this.routing.routingRevision = row.routingRevision;
  669. this.handleQueryAlternativeList();
  670. },
  671. alternativeRowStyle({row}){
  672. if (this.dataList.length > 0){
  673. if (this.routing.alternativeNo === row.alternativeNo && this.routing.routingRevision === row.routingRevision && this.routing.routingType === row.routingType){
  674. return { 'background-color': '#E8F7F6' };
  675. }
  676. }
  677. },
  678. changeRouting(row){
  679. let params = {
  680. quoteId: this.quoteDetail.quoteId,
  681. quoteDetailId: this.quoteDetail.id,
  682. quoteDetailItemNo:this.quoteDetail.itemNo,
  683. versionNo: this.quoteDetail.versionNo,
  684. site: row.site,
  685. partNo: row.partNo,
  686. buNo: "*",
  687. quoteNo: this.quoteDetail.quoteNo,
  688. routingType: row.routingType,
  689. routingRevision: row.routingRevision,
  690. alternativeNo: row.alternativeNo,
  691. treeId: this.$refs.tree.getCurrentNode().id,
  692. createBy: this.$store.state.user.name,
  693. }
  694. changeQuoteDetailRoutingChange(params).then(({data})=>{
  695. if (data && data.code === 0){
  696. this.$message.success(data.msg);
  697. this.versionVisible = false;
  698. this.handleQueryDetailRouting();
  699. }else {
  700. this.$message.warning(data.msg);
  701. }
  702. }).catch((error)=>{
  703. this.$message.error(error)
  704. })
  705. },
  706. handleJumpToRouting(row){
  707. if (this.$router.resolve('part-routingManagement').resolved.name === '404') {
  708. this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',});
  709. } else {
  710. this.$emit('close')
  711. let params = {
  712. name: "part-routingManagement",
  713. params: {
  714. type:'quote',
  715. partNo:row.partNo,
  716. routingType:row.routingType,
  717. routingRevision:row.routingRevision,
  718. alternativeNo:row.alternativeNo,
  719. }
  720. }
  721. this.$router.push(params)
  722. }
  723. }
  724. },
  725. created() {
  726. if (this.quoteDetail && this.quoteDetail.id){
  727. // routing 如果报价单是2020的版本 则不显示单个工艺的成本信息
  728. if (this.quoteDetail.costModel && this.quoteDetail.costModel === '2020'){
  729. this.columns = this.columns.filter(item => item.columnProp !== 'totalMachCost' && item.columnProp !== 'totalLaborCost' && item.columnProp !== 'totalManCost' && item.columnProp !== 'totalCost');
  730. }
  731. this.handleQueryQuoteDetailBomTree();
  732. }
  733. },
  734. watch:{
  735. 'quoteDetail.id'(newVal,oldVal){
  736. this.handleQueryQuoteDetailBomTree();
  737. },
  738. isAllRouting(newVal,oldVal){
  739. this.handleQueryDetailRouting();
  740. },
  741. }
  742. }
  743. </script>
  744. <template>
  745. <div>
  746. <div style="margin-bottom: 10px">
  747. <el-link style="margin-right: 20px;cursor:pointer;" @click="handleChangeVersion" v-if="quoteDetail.status === '草稿'">切换版本</el-link>
  748. <el-checkbox v-model="isAllRouting">全级Routing结构</el-checkbox>
  749. </div>
  750. <el-container>
  751. <el-aside width="300px" v-loading="queryTreeLoading">
  752. <el-tree
  753. :data="treeData"
  754. :props="props"
  755. :default-expand-all="true"
  756. :expand-on-click-node="false"
  757. node-key="id"
  758. highlight-current
  759. @node-click="nodeClick" ref="tree">
  760. </el-tree>
  761. </el-aside>
  762. <el-main style="padding: 0">
  763. <el-table :data="dataList" v-loading="queryLoading" border style="width: 100%" :height="420" @header-dragend="handleColumnResize">
  764. <el-table-column
  765. v-for="(item,index) in columns" :key="index"
  766. :sortable="item.columnSortable"
  767. :prop="item.columnProp"
  768. :header-align="item.headerAlign"
  769. :show-overflow-tooltip="item.showOverflowTooltip"
  770. :align="item.align"
  771. :fixed="item.fixed===''?false:item.fixed"
  772. :min-width="item.columnWidth"
  773. :label="item.columnLabel">
  774. <template slot-scope="scope">
  775. <template v-if="item.columnProp === 'partNo'">
  776. <el-link @click="handleJumpToRouting(scope.row)">{{ scope.row[item.columnProp] }}</el-link>
  777. </template>
  778. <template v-else>
  779. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  780. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  781. </template>
  782. </template>
  783. </el-table-column>
  784. </el-table>
  785. </el-main>
  786. </el-container>
  787. <el-dialog title="切换版本" :visible.sync="versionVisible" width="1000px" v-drag :close-on-click-modal="false" append-to-body>
  788. <el-table :data="versionList" :row-style="versionRowStyle" ref="routingVersionTable" style="margin-top: 8px" border :height="240" @row-click="versionRowClick">
  789. <el-table-column label="物料编码" prop="partNo" header-align="center" align="center" show-overflow-tooltip min-width="140"/>
  790. <el-table-column label="物料描述" prop="partDesc" header-align="center" align="center" show-overflow-tooltip min-width="200"/>
  791. <el-table-column label="版本" prop="routingRevision" header-align="center" align="center" show-overflow-tooltip min-width="60"/>
  792. <el-table-column label="类型" prop="routingType" header-align="center" align="center" show-overflow-tooltip min-width="100"/>
  793. </el-table>
  794. <el-table :data="alternativeList" :row-style="alternativeRowStyle" @header-dragend="handleColumnResize" ref="routingAlternativeTable" border :height="240" style="margin-top: 8px">
  795. <el-table-column label="物料编码" prop="partNo" header-align="center" align="center" show-overflow-tooltip min-width="140"/>
  796. <el-table-column label="物料描述" prop="partDesc" header-align="center" align="center" show-overflow-tooltip min-width="200"/>
  797. <el-table-column label="版本" prop="routingRevision" header-align="center" align="center" show-overflow-tooltip min-width="60"/>
  798. <el-table-column label="替代编码" prop="alternativeNo" header-align="center" align="center" show-overflow-tooltip min-width="60"/>
  799. <el-table-column label="类型" prop="routingType" header-align="center" align="center" show-overflow-tooltip min-width="100"/>
  800. <el-table-column label="操作" min-width="80" header-align="center" align="center">
  801. <template slot-scope="{row,$index}">
  802. <a @click="changeRouting(row)">选择</a>
  803. </template>
  804. </el-table-column>
  805. </el-table>
  806. </el-dialog>
  807. </div>
  808. </template>
  809. <style scoped>
  810. </style>