plm前端
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.

924 lines
31 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
9 months ago
1 year ago
1 year ago
10 months ago
1 year ago
10 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
10 months ago
1 year ago
10 months ago
1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
10 months ago
1 year ago
9 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
10 months ago
1 year ago
9 months ago
1 year ago
10 months ago
1 year ago
9 months ago
1 year ago
1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
9 months ago
1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
10 months ago
1 year ago
10 months ago
1 year ago
1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
10 months ago
1 year ago
10 months 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 {updateQuoteDetailRouting} from "../../../../../api/quote/quoteDetailRouting";
  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: "left",
  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: "left",
  71. columnLabel: '物料编码',
  72. columnHidden: false,
  73. columnImage: false,
  74. columnSortable: false,
  75. sortLv: 0,
  76. status: true,
  77. fixed: '',
  78. columnWidth: 120,
  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: "left",
  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: "left",
  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: "left",
  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: "left",
  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: "left",
  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: '5011Table5MachRunFactor',
  223. tableId: "5011Table5",
  224. tableName: "报价工艺信息",
  225. columnProp: 'machRunFactor',
  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: '5011Table5CrewSize',
  241. tableId: "5011Table5",
  242. tableName: "报价工艺信息",
  243. columnProp: 'crewSize',
  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: '5011Table5LaborClassNo',
  259. tableId: "5011Table5",
  260. tableName: "报价工艺信息",
  261. columnProp: 'laborClassNo',
  262. headerAlign: "center",
  263. align: "left",
  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: '5011Table5LaborSetupTime',
  277. tableId: "5011Table5",
  278. tableName: "报价工艺信息",
  279. columnProp: 'laborSetupTime',
  280. headerAlign: "center",
  281. align: "right",
  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: '5011Table5LaborRunFactor',
  295. tableId: "5011Table5",
  296. tableName: "报价工艺信息",
  297. columnProp: 'laborRunFactor',
  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: 120,
  308. },
  309. {
  310. userId: this.$store.state.user.name,
  311. functionId: 5011,
  312. serialNumber: '5011Table5RunTimeDesc',
  313. tableId: "5011Table5",
  314. tableName: "报价工艺信息",
  315. columnProp: 'runTimeDesc',
  316. headerAlign: "center",
  317. align: "center",
  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: '5011Table5EfficiencyFactor',
  331. tableId: "5011Table5",
  332. tableName: "报价工艺信息",
  333. columnProp: 'efficiencyFactor',
  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: 100,
  344. },
  345. {
  346. userId: this.$store.state.user.name,
  347. functionId: 5011,
  348. serialNumber: '5011Table5ShrinkageFactor',
  349. tableId: "5011Table5",
  350. tableName: "报价工艺信息",
  351. columnProp: 'shrinkageFactor',
  352. headerAlign: "center",
  353. align: "right",
  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: '5011Table5LaborClassCost',
  367. tableId: "5011Table5",
  368. tableName: "报价工艺信息",
  369. columnProp: 'laborClassCost',
  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: 120,
  380. },
  381. {
  382. userId: this.$store.state.user.name,
  383. functionId: 5011,
  384. serialNumber: '5011Table5SetupLaborClassCost',
  385. tableId: "5011Table5",
  386. tableName: "报价工艺信息",
  387. columnProp: 'setupLaborClassCost',
  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: 120,
  398. },
  399. {
  400. userId: this.$store.state.user.name,
  401. functionId: 5011,
  402. serialNumber: '5011Table5WorkCenterCost',
  403. tableId: "5011Table5",
  404. tableName: "报价工艺信息",
  405. columnProp: 'workCenterCost',
  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: '5011Table5TotalMachCost',
  421. tableId: "5011Table5",
  422. tableName: "报价工艺信息",
  423. columnProp: 'totalMachCost',
  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: 140,
  434. },
  435. {
  436. userId: this.$store.state.user.name,
  437. functionId: 5011,
  438. serialNumber: '5011Table5TotalLaborCost',
  439. tableId: "5011Table5",
  440. tableName: "报价工艺信息",
  441. columnProp: 'totalLaborCost',
  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: 140,
  452. },{
  453. userId: this.$store.state.user.name,
  454. functionId: 5011,
  455. serialNumber: '5011Table5TotalCost',
  456. tableId: "5011Table5",
  457. tableName: "报价工艺信息",
  458. columnProp: 'totalCost',
  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: 'right',
  468. columnWidth: 120,
  469. },
  470. ],
  471. props:{
  472. children: 'list',
  473. label: (data,node)=>{
  474. return `${data.partNo}-${data.engChgLevel}-${data.alternativeNo}-${data.bomType}`;
  475. },
  476. },
  477. queryTreeLoading:false,
  478. versionVisible:false,
  479. versionList:[],
  480. alternativeList:[],
  481. routing:{
  482. },
  483. quoteDetailRouting:{
  484. },
  485. quoteDetailRoutingVisible:false,
  486. rules:{
  487. workCenterCost:[
  488. { required: true, message: '请输入加工中心成本', trigger: ['blur','change'] },
  489. ],
  490. setupLaborClassCost:[
  491. { required: true, message: '请输入人工成本-调机', trigger: ['blur','change'] },
  492. ],
  493. laborClassCost:[
  494. { required: true, message: '请输入人工成本-生产', trigger: ['blur','change'] },
  495. ],
  496. shrinkageFactor:[
  497. { required: true, message: '请输入损耗率', trigger: ['blur','change'] },
  498. ],
  499. },
  500. changeLoading:false,
  501. // 导出相关
  502. exportName: '报价工艺信息' + this.dayjs().format('YYYYMMDDHHmmss'),
  503. }
  504. },
  505. methods:{
  506. handleQueryQuoteDetailBomTree(){
  507. let params = {
  508. id: this.quoteDetail.id,
  509. }
  510. this.queryTreeLoading = true;
  511. queryQuoteDetailBomTree(params).then(({data})=>{
  512. if (data && data.code === 0){
  513. this.treeData = data.rows;
  514. if (this.treeData.length > 0){
  515. this.$nextTick(()=>{
  516. this.$refs.tree.setCurrentKey(this.treeData[0].id);
  517. this.handleQueryDetailRouting();
  518. })
  519. }
  520. this.queryTreeLoading = false;
  521. }else {
  522. this.$message.warning(data.msg);
  523. this.queryTreeLoading = false;
  524. }
  525. }).catch((error)=>{
  526. this.$message.error(error);
  527. })
  528. },
  529. nodeClick(data){
  530. this.handleQueryDetailRouting();
  531. },
  532. handleQueryDetailRouting(){
  533. let node = this.$refs.tree.getCurrentNode();
  534. let params = {
  535. treeId:node.id,
  536. quoteDetailId: this.quoteDetail.id,
  537. isAllRouting: this.isAllRouting,
  538. }
  539. this.queryLoading = true;
  540. queryQuoteDetailRouting(params).then(({data})=>{
  541. if (data && data.code === 0){
  542. this.dataList = data.rows;
  543. }else {
  544. this.$message.warning(data.msg);
  545. }
  546. this.queryLoading = false;
  547. }).catch((error)=>{
  548. this.$message.error(error);
  549. this.queryLoading = false;
  550. })
  551. },
  552. handleChangeVersion(){
  553. let node = this.$refs.tree.getCurrentNode();
  554. if (this.treeData.length === 0){
  555. this.$message.warning("未维护BOM结构")
  556. return;
  557. }
  558. if (node){
  559. this.routing = {
  560. partNo: node.partNo,
  561. buNo: node.buNo,
  562. site: node.site,
  563. routingType: node.bomType,
  564. routingRevision: node.engChgLevel,
  565. alternativeNo: node.alternativeNo,
  566. }
  567. }
  568. this.handleQueryVersionList();
  569. this.versionVisible = true;
  570. },
  571. versionRowStyle({row}){
  572. if (row.routingRevision === this.routing.routingRevision && row.routingType === this.routing.routingType){
  573. return { 'background-color': '#E8F7F6' };
  574. }
  575. },
  576. handleQueryVersionList(){
  577. let node = this.$refs.tree.getCurrentNode();
  578. let params = {
  579. treeId: node.id,
  580. }
  581. queryQuoteDetailRoutingVersion(params).then(({data})=>{
  582. if (data && data.code === 0){
  583. this.versionList = data.rows;
  584. this.handleQueryAlternativeList();
  585. }else {
  586. this.$message.warning(data.msg);
  587. }
  588. }).catch((error)=>{
  589. this.$message.error(error);
  590. })
  591. },
  592. handleQueryAlternativeList(){
  593. let params = {
  594. ...this.routing,
  595. }
  596. queryQuoteDetailRoutingAlternative(params).then(({data})=>{
  597. if (data && data.code === 0){
  598. this.alternativeList = data.rows;
  599. }else {
  600. this.$message.warning(data.msg);
  601. }
  602. }).catch((error)=>{
  603. this.$message.error(error);
  604. })
  605. },
  606. versionRowClick(row){
  607. this.routing.routingType = row.routingType;
  608. this.routing.routingRevision = row.routingRevision;
  609. this.handleQueryAlternativeList();
  610. },
  611. alternativeRowStyle({row}){
  612. if (this.dataList.length > 0){
  613. if (this.routing.alternativeNo === row.alternativeNo && this.routing.routingRevision === row.routingRevision && this.routing.routingType === row.routingType){
  614. return { 'background-color': '#E8F7F6' };
  615. }
  616. }
  617. },
  618. changeRouting(row){
  619. if (this.$refs.tree.getCurrentNode().parentId === 0 || this.$refs.tree.getCurrentNode().parentId === null || this.$refs.tree.getCurrentNode().parentId === undefined){
  620. this.$confirm('确认切换Routing版本吗,切换后将重新覆盖工具信息,请确认!','提示',{
  621. type: 'warning',
  622. confirmButtonText: '确定',
  623. cancelButtonText: '取消',
  624. }).then(()=>{
  625. this.handleChangeRouting(row);
  626. })
  627. }else {
  628. this.handleChangeRouting(row);
  629. }
  630. },
  631. handleChangeRouting(row){
  632. let params = {
  633. quoteId: this.quoteDetail.quoteId,
  634. quoteDetailId: this.quoteDetail.id,
  635. quoteDetailItemNo:this.quoteDetail.itemNo,
  636. versionNo: this.quoteDetail.versionNo,
  637. site: row.site,
  638. partNo: row.partNo,
  639. buNo: "*",
  640. quoteNo: this.quoteDetail.quoteNo,
  641. routingType: row.routingType,
  642. routingRevision: row.routingRevision,
  643. alternativeNo: row.alternativeNo,
  644. treeId: this.$refs.tree.getCurrentNode().id,
  645. createBy: this.$store.state.user.name,
  646. }
  647. this.changeLoading = true;
  648. changeQuoteDetailRoutingChange(params).then(({data})=>{
  649. this.changeLoading = false;
  650. if (data && data.code === 0){
  651. this.$message.success(data.msg);
  652. this.versionVisible = false;
  653. this.handleQueryDetailRouting();
  654. }else {
  655. this.$message.warning(data.msg);
  656. }
  657. }).catch((error)=>{
  658. this.changeLoading = false;
  659. this.$message.error(error)
  660. })
  661. },
  662. handleJumpToRouting(row){
  663. if (this.$router.resolve('part-routingManagement').resolved.name === '404') {
  664. this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',});
  665. } else {
  666. this.$emit('close')
  667. let params = {
  668. name: "part-routingManagement",
  669. params: {
  670. type:'quote',
  671. partNo:row.partNo,
  672. routingType:row.routingType,
  673. routingRevision:row.routingRevision,
  674. alternativeNo:row.alternativeNo,
  675. }
  676. }
  677. this.$router.push(params)
  678. }
  679. },
  680. handleUpdateQuoteDetailRouting(row){
  681. this.quoteDetailRouting = {...row}
  682. this.quoteDetailRoutingVisible = true;
  683. },
  684. saveQuoteDetailRouting(){
  685. this.$refs.quoteDetailRoutingForm.validate((valid,obj) => {
  686. if (valid){
  687. let params = {
  688. ...this.quoteDetailRouting,
  689. }
  690. updateQuoteDetailRouting(params).then(({data})=>{
  691. if (data && data.code === 0){
  692. this.$message.success(data.msg);
  693. this.handleQueryDetailRouting();
  694. this.quoteDetailRoutingVisible = false;
  695. }else {
  696. this.$message.warning(data.msg);
  697. }
  698. }).catch((error)=>{
  699. this.$message.error(error);
  700. })
  701. }else {
  702. let i = 1;
  703. for (let item in obj){
  704. this.$message.error(obj[item][0].message);
  705. if (i === 1){
  706. return
  707. }
  708. i++;
  709. }
  710. }
  711. })
  712. },
  713. // 导出相关方法
  714. exportFields() {
  715. let json = "{"
  716. this.columns.forEach((item, index) => {
  717. if (index === this.columns.length - 1) {
  718. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  719. } else {
  720. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  721. }
  722. })
  723. json += "}"
  724. return eval("(" + json + ")")
  725. },
  726. createExportData() {
  727. return this.dataList;
  728. }
  729. },
  730. created() {
  731. if (this.quoteDetail && this.quoteDetail.id){
  732. this.handleQueryQuoteDetailBomTree();
  733. }
  734. },
  735. watch:{
  736. 'quoteDetail.id'(newVal,oldVal){
  737. this.handleQueryQuoteDetailBomTree();
  738. },
  739. isAllRouting(newVal,oldVal){
  740. this.handleQueryDetailRouting();
  741. },
  742. }
  743. }
  744. </script>
  745. <template>
  746. <div>
  747. <div style="margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center;">
  748. <div>
  749. <template v-if="isAuth('5011:detail:tab2:check')">
  750. <el-link style="margin-right: 20px;cursor:pointer;" @click="handleChangeVersion" v-if="quoteDetail.status === '草稿'">切换版本</el-link>
  751. </template>
  752. <!-- <el-checkbox v-model="isAllRouting">全级Routing结构</el-checkbox>-->
  753. </div>
  754. <download-excel
  755. :fields="exportFields()"
  756. :data="dataList"
  757. type="xls"
  758. :name="exportName"
  759. :fetch="createExportData"
  760. worksheet="工艺信息"
  761. class="el-button el-button--primary el-button--mini">
  762. 导出
  763. </download-excel>
  764. </div>
  765. <el-container>
  766. <el-aside width="300px" style="max-height:420px" v-loading="queryTreeLoading">
  767. <el-tree
  768. :data="treeData"
  769. :props="props"
  770. :default-expand-all="true"
  771. :expand-on-click-node="false"
  772. node-key="id"
  773. highlight-current
  774. @node-click="nodeClick" ref="tree">
  775. </el-tree>
  776. </el-aside>
  777. <el-main style="padding: 0">
  778. <el-table :data="dataList" v-loading="queryLoading" border style="width: 100%" :height="420">
  779. <el-table-column label="操作" fixed="left" align="center" width="80px" v-if="quoteDetail.status === '草稿'">
  780. <template slot-scope="scope">
  781. <template v-if="isAuth('5011:detail:tab2:update')">
  782. <a @click="handleUpdateQuoteDetailRouting(scope.row)">编辑</a>
  783. </template>
  784. </template>
  785. </el-table-column>
  786. <el-table-column
  787. v-for="(item,index) in columns" :key="index"
  788. :sortable="item.columnSortable"
  789. :prop="item.columnProp"
  790. :header-align="item.headerAlign"
  791. :show-overflow-tooltip="item.showOverflowTooltip"
  792. :align="item.align"
  793. :fixed="item.fixed===''?false:item.fixed"
  794. :min-width="item.columnWidth"
  795. :label="item.columnLabel">
  796. <template slot-scope="scope">
  797. <template v-if="item.columnProp === 'partNo'">
  798. <el-link @click="handleJumpToRouting(scope.row)">{{ scope.row[item.columnProp] }}</el-link>
  799. </template>
  800. <template v-else>
  801. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  802. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  803. </template>
  804. </template>
  805. </el-table-column>
  806. </el-table>
  807. </el-main>
  808. </el-container>
  809. <el-dialog title="切换版本" :visible.sync="versionVisible" width="1000px" v-drag :close-on-click-modal="false" append-to-body>
  810. <el-table v-loading="changeLoading" :data="versionList" :row-style="versionRowStyle" ref="routingVersionTable" style="margin-top: 8px" border :height="240" @row-click="versionRowClick">
  811. <el-table-column label="物料编码" prop="partNo" header-align="center" align="center" show-overflow-tooltip min-width="140"/>
  812. <el-table-column label="物料名称" prop="partDesc" header-align="center" align="left" show-overflow-tooltip min-width="200"/>
  813. <el-table-column label="版本" prop="routingRevision" header-align="center" align="center" show-overflow-tooltip min-width="60"/>
  814. <el-table-column label="类型" prop="routingType" header-align="center" align="center" show-overflow-tooltip min-width="100"/>
  815. </el-table>
  816. <el-table v-loading="changeLoading" :data="alternativeList" :row-style="alternativeRowStyle" ref="routingAlternativeTable" border :height="240" style="margin-top: 8px">
  817. <el-table-column label="物料编码" prop="partNo" header-align="center" align="center" show-overflow-tooltip min-width="140"/>
  818. <el-table-column label="物料名称" prop="partDesc" header-align="center" align="left" show-overflow-tooltip min-width="200"/>
  819. <el-table-column label="版本" prop="routingRevision" header-align="center" align="center" show-overflow-tooltip min-width="60"/>
  820. <el-table-column label="替代编码" prop="alternativeNo" header-align="center" align="left" show-overflow-tooltip min-width="60"/>
  821. <el-table-column label="类型" prop="routingType" header-align="center" align="center" show-overflow-tooltip min-width="100"/>
  822. <el-table-column label="操作" min-width="80" header-align="center" align="center">
  823. <template slot-scope="{row,$index}">
  824. <a @click="changeRouting(row)">选择</a>
  825. </template>
  826. </el-table-column>
  827. </el-table>
  828. </el-dialog>
  829. <el-dialog title="工序信息" top="23vh" v-drag :visible.sync="quoteDetailRoutingVisible" width="500px" append-to-body :close-on-click-modal="false">
  830. <el-form label-position="top" ref="quoteDetailRoutingForm" :model="quoteDetailRouting" :rules="rules" label-width="100px">
  831. <el-row :gutter="10">
  832. <el-col :span="8">
  833. <el-form-item label="物料编码">
  834. <el-input v-model="quoteDetailRouting.partNo" disabled></el-input>
  835. </el-form-item>
  836. </el-col>
  837. <el-col :span="16">
  838. <el-form-item label="物料名称">
  839. <el-input v-model="quoteDetailRouting.partDesc" disabled></el-input>
  840. </el-form-item>
  841. </el-col>
  842. </el-row>
  843. <el-row :gutter="10">
  844. <el-col :span="8">
  845. <el-form-item label="工序编码">
  846. <el-input v-model="quoteDetailRouting.operationNo" disabled></el-input>
  847. </el-form-item>
  848. </el-col>
  849. <el-col :span="16">
  850. <el-row :gutter="5">
  851. <el-col :span="19">
  852. <el-form-item label="工序名称">
  853. <el-input v-model="quoteDetailRouting.operationName" disabled></el-input>
  854. </el-form-item>
  855. </el-col>
  856. <el-col :span="5">
  857. <el-form-item label="损耗率%" prop="shrinkageFactor" :show-message="false">
  858. <el-input-number :min="0" :controls="false" :step="0" v-model="quoteDetailRouting.shrinkageFactor"></el-input-number>
  859. </el-form-item>
  860. </el-col>
  861. </el-row>
  862. </el-col>
  863. </el-row>
  864. <el-row :gutter="10">
  865. <el-col :span="8">
  866. <el-form-item label="单位机器成本" prop="workCenterCost" :show-message="false">
  867. <el-row :gutter="5">
  868. <el-col :span="14">
  869. <el-input v-model="quoteDetailRouting.workCenterNo" disabled></el-input>
  870. </el-col>
  871. <el-col :span="10">
  872. <el-input-number :min="0" :controls="false" :step="0" v-model="quoteDetailRouting.workCenterCost"></el-input-number>
  873. </el-col>
  874. </el-row>
  875. </el-form-item>
  876. </el-col>
  877. <el-col :span="8">
  878. <el-form-item label="单位人工成本-调机" prop="setupLaborClassCost" :show-message="false">
  879. <el-row :gutter="5">
  880. <el-col :span="14">
  881. <el-input v-model="quoteDetailRouting.setupLaborClassNo" disabled></el-input>
  882. </el-col>
  883. <el-col :span="10">
  884. <el-input-number :min="0" :controls="false" :step="0" v-model="quoteDetailRouting.setupLaborClassCost"></el-input-number>
  885. </el-col>
  886. </el-row>
  887. </el-form-item>
  888. </el-col>
  889. <el-col :span="8">
  890. <el-form-item label="单位人工成本-生产" prop="laborClassCost" :show-message="false">
  891. <el-row :gutter="5">
  892. <el-col :span="14">
  893. <el-input v-model="quoteDetailRouting.laborClassNo" disabled></el-input>
  894. </el-col>
  895. <el-col :span="10">
  896. <el-input-number :min="0" :controls="false" :step="0" v-model="quoteDetailRouting.laborClassCost"></el-input-number>
  897. </el-col>
  898. </el-row>
  899. </el-form-item>
  900. </el-col>
  901. </el-row>
  902. </el-form>
  903. <el-footer style="text-align: center;line-height: 30px;height: 30px">
  904. <el-button type="primary" @click="saveQuoteDetailRouting"> </el-button>
  905. <el-button type="primary" @click="quoteDetailRoutingVisible = false"> </el-button>
  906. </el-footer>
  907. </el-dialog>
  908. </div>
  909. </template>
  910. <style scoped>
  911. </style>