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.

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