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.

1058 lines
33 KiB

2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
  1. <script>
  2. import ProjectPartTable from "../../../../components/selector/table/projectPartTable.vue";
  3. import {queryProjectPart} from "../../../../api/project/projectPart";
  4. import {
  5. deleteQuoteDetail,
  6. queryQuoteDetail, queryQuoteDetailYield,
  7. saveQuoteDetail,
  8. updateQuoteDetail
  9. } from "../../../../api/quote/quoteDetail";
  10. import QuoteDetailCost from "./primary/quoteDetailCost.vue";
  11. import QuoteDetailTool from "./primary/quoteDetailTool.vue";
  12. import QuoteDetailBom from "./primary/quoteDetailBom.vue";
  13. import QuoteDetailRouting from "./primary/quoteDetailRouting.vue";
  14. import QuoteDetailOther from "./primary/quoteDetailOther.vue";
  15. export default {
  16. name: "quoteDetail",
  17. components: {QuoteDetailOther, QuoteDetailRouting, QuoteDetailBom, QuoteDetailTool, QuoteDetailCost, ProjectPartTable},
  18. props:{
  19. quote:{
  20. type:Object,
  21. required:true
  22. },
  23. height:{
  24. type:[Number,String],
  25. default:300
  26. },
  27. },
  28. data(){
  29. return{
  30. quoteDetail:{
  31. id:null,
  32. partNo:'',
  33. partDesc:'',
  34. projectNo:'',
  35. projectDesc:'',
  36. qty:null,
  37. quoteCount:1,
  38. partCost:0,
  39. adjustPartCost:0,
  40. labourCost:0,
  41. adjustLabourCost:0,
  42. fabricateCost:0,
  43. adjustFabricateCost:0,
  44. toolCost:0,
  45. adjustToolCost:0,
  46. machineCost:0,
  47. adjustMachineCost:0,
  48. otherCost:0,
  49. manageCost:0,
  50. totalCost:0,
  51. profitRate:0,
  52. profitAmount:0,
  53. totalPrice:0,
  54. unitPrice:0,
  55. taxRate:13,
  56. taxTotalPrice:0,
  57. taxUnitPrice:0,
  58. remark:'',
  59. },
  60. saveQuoteDetail:{
  61. },
  62. dataList:[],
  63. saveLoading:false,
  64. queryLoading:false,
  65. saveVisible:false,
  66. saveQuoteDetailRules:{
  67. partNo: [{required: true, message: '请输入物料编码', trigger: ['blur','change']}],
  68. partDesc: [{required: true, message: '请输入物料名称', trigger: ['blur','change']}],
  69. qty: [{required: true, message: '请输入数量', trigger: ['blur','change']}],
  70. },
  71. columns: [
  72. {
  73. userId: this.$store.state.user.name,
  74. functionId: 5011,
  75. serialNumber: '5011Table2PartNo',
  76. tableId: '5011Table2',
  77. tableName: '报价详情信息表',
  78. columnProp: 'partNo',
  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. {
  91. userId: this.$store.state.user.name,
  92. functionId: 5011,
  93. serialNumber: '5011Table2PartDesc',
  94. tableId: '5011Table2',
  95. tableName: '报价详情信息表',
  96. columnProp: 'partDesc',
  97. headerAlign: 'center',
  98. align: 'left',
  99. columnLabel: '物料名称',
  100. columnHidden: false,
  101. columnImage: false,
  102. columnSortable: false,
  103. sortLv: 0,
  104. status: true,
  105. fixed: '',
  106. columnWidth: 200
  107. },
  108. {
  109. userId: this.$store.state.user.name,
  110. functionId: 5011,
  111. serialNumber: '5011Table2Qty',
  112. tableId: '5011Table2',
  113. tableName: '报价详情信息表',
  114. columnProp: 'qty',
  115. headerAlign: 'center',
  116. align: 'right',
  117. columnLabel: '报价数量',
  118. columnHidden: false,
  119. columnImage: false,
  120. columnSortable: false,
  121. sortLv: 0,
  122. status: true,
  123. fixed: '',
  124. columnWidth: 100
  125. },
  126. {
  127. userId: this.$store.state.user.name,
  128. functionId: 5011,
  129. serialNumber: '5011Table2PartCost',
  130. tableId: '5011Table2',
  131. tableName: '报价详情信息表',
  132. columnProp: 'partCost',
  133. headerAlign: 'center',
  134. align: 'right',
  135. columnLabel: '计算后材料成本',
  136. columnHidden: false,
  137. columnImage: false,
  138. columnSortable: false,
  139. sortLv: 0,
  140. status: true,
  141. fixed: '',
  142. columnWidth: 120
  143. },{
  144. userId: this.$store.state.user.name,
  145. functionId: 5011,
  146. serialNumber: '5011Table2MachineCost',
  147. tableId: '5011Table2',
  148. tableName: '报价详情信息表',
  149. columnProp: 'machineCost',
  150. headerAlign: 'center',
  151. align: 'right',
  152. columnLabel: '计算后机器成本',
  153. columnHidden: false,
  154. columnImage: false,
  155. columnSortable: false,
  156. sortLv: 0,
  157. status: true,
  158. fixed: '',
  159. columnWidth: 120
  160. },{
  161. userId: this.$store.state.user.name,
  162. functionId: 5011,
  163. serialNumber: '5011Table2LabourCost',
  164. tableId: '5011Table2',
  165. tableName: '报价详情信息表',
  166. columnProp: 'labourCost',
  167. headerAlign: 'center',
  168. align: 'right',
  169. columnLabel: '计算后人工成本',
  170. columnHidden: false,
  171. columnImage: false,
  172. columnSortable: false,
  173. sortLv: 0,
  174. status: true,
  175. fixed: '',
  176. columnWidth: 120
  177. },
  178. {
  179. userId: this.$store.state.user.name,
  180. functionId: 5011,
  181. serialNumber: '5011Table2FabricateCost',
  182. tableId: '5011Table2',
  183. tableName: '报价详情信息表',
  184. columnProp: 'fabricateCost',
  185. headerAlign: 'center',
  186. align: 'right',
  187. columnLabel: '计算后制造费用',
  188. columnHidden: false,
  189. columnImage: false,
  190. columnSortable: false,
  191. sortLv: 0,
  192. status: true,
  193. fixed: '',
  194. columnWidth: 120
  195. },
  196. {
  197. userId: this.$store.state.user.name,
  198. functionId: 5011,
  199. serialNumber: '5011Table2tToolCost',
  200. tableId: '5011Table2',
  201. tableName: '报价详情信息表',
  202. columnProp: 'toolCost',
  203. headerAlign: 'center',
  204. align: 'right',
  205. columnLabel: '计算后工具成本',
  206. columnHidden: false,
  207. columnImage: false,
  208. columnSortable: false,
  209. sortLv: 0,
  210. status: true,
  211. fixed: '',
  212. columnWidth: 120
  213. },
  214. {
  215. userId: this.$store.state.user.name,
  216. functionId: 5011,
  217. serialNumber: '5011Table2AdjustPartCost',
  218. tableId: '5011Table2',
  219. tableName: '报价详情信息表',
  220. columnProp: 'adjustPartCost',
  221. headerAlign: 'center',
  222. align: 'right',
  223. columnLabel: '调整后材料成本',
  224. columnHidden: false,
  225. columnImage: false,
  226. columnSortable: false,
  227. sortLv: 0,
  228. status: true,
  229. fixed: '',
  230. columnWidth: 120
  231. },
  232. {
  233. userId: this.$store.state.user.name,
  234. functionId: 5011,
  235. serialNumber: '5011Table2BomUnYield',
  236. tableId: '5011Table2',
  237. tableName: '报价详情信息表',
  238. columnProp: 'bomUnYield',
  239. headerAlign: 'center',
  240. align: 'right',
  241. columnLabel: 'BOM Unyield',
  242. columnHidden: false,
  243. columnImage: false,
  244. columnSortable: false,
  245. sortLv: 0,
  246. status: true,
  247. fixed: '',
  248. columnWidth: 120
  249. },
  250. {
  251. userId: this.$store.state.user.name,
  252. functionId: 5011,
  253. serialNumber: '5011Table2AdjustBomUnYield',
  254. tableId: '5011Table2',
  255. tableName: '报价详情信息表',
  256. columnProp: 'adjustBomUnYield',
  257. headerAlign: 'center',
  258. align: 'right',
  259. columnLabel: '调整的BOM Unyield',
  260. columnHidden: false,
  261. columnImage: false,
  262. columnSortable: false,
  263. sortLv: 0,
  264. status: true,
  265. fixed: '',
  266. columnWidth: 130
  267. },
  268. {
  269. userId: this.$store.state.user.name,
  270. functionId: 5011,
  271. serialNumber: '5011Table2AdjustMachineCost',
  272. tableId: '5011Table2',
  273. tableName: '报价详情信息表',
  274. columnProp: 'adjustMachineCost',
  275. headerAlign: 'center',
  276. align: 'right',
  277. columnLabel: '调整后机器成本',
  278. columnHidden: false,
  279. columnImage: false,
  280. columnSortable: false,
  281. sortLv: 0,
  282. status: true,
  283. fixed: '',
  284. columnWidth: 120
  285. },
  286. {
  287. userId: this.$store.state.user.name,
  288. functionId: 5011,
  289. serialNumber: '5011Table2AdjustLabourCost',
  290. tableId: '5011Table2',
  291. tableName: '报价详情信息表',
  292. columnProp: 'adjustLabourCost',
  293. headerAlign: 'center',
  294. align: 'right',
  295. columnLabel: '调整后人工成本',
  296. columnHidden: false,
  297. columnImage: false,
  298. columnSortable: false,
  299. sortLv: 0,
  300. status: true,
  301. fixed: '',
  302. columnWidth: 120
  303. },
  304. {
  305. userId: this.$store.state.user.name,
  306. functionId: 5011,
  307. serialNumber: '5011Table2AdjustFabricateCost',
  308. tableId: '5011Table2',
  309. tableName: '报价详情信息表',
  310. columnProp: 'adjustFabricateCost',
  311. headerAlign: 'center',
  312. align: 'right',
  313. columnLabel: '调整后制造费用',
  314. columnHidden: false,
  315. columnImage: false,
  316. columnSortable: false,
  317. sortLv: 0,
  318. status: true,
  319. fixed: '',
  320. columnWidth: 120
  321. },{
  322. userId: this.$store.state.user.name,
  323. functionId: 5011,
  324. serialNumber: '5011Table2AdjustToolCost',
  325. tableId: '5011Table2',
  326. tableName: '报价详情信息表',
  327. columnProp: 'adjustToolCost',
  328. headerAlign: 'center',
  329. align: 'right',
  330. columnLabel: '调整后工具成本',
  331. columnHidden: false,
  332. columnImage: false,
  333. columnSortable: false,
  334. sortLv: 0,
  335. status: true,
  336. fixed: '',
  337. columnWidth: 120
  338. },
  339. {
  340. userId: this.$store.state.user.name,
  341. functionId: 5011,
  342. serialNumber: '5011Table2OtherCost',
  343. tableId: '5011Table2',
  344. tableName: '报价详情信息表',
  345. columnProp: 'otherCost',
  346. headerAlign: 'center',
  347. align: 'right',
  348. columnLabel: '其他成本',
  349. columnHidden: false,
  350. columnImage: false,
  351. columnSortable: false,
  352. sortLv: 0,
  353. status: true,
  354. fixed: '',
  355. columnWidth: 120
  356. },{
  357. userId: this.$store.state.user.name,
  358. functionId: 5011,
  359. serialNumber: '5011Table2ManageCost',
  360. tableId: '5011Table2',
  361. tableName: '报价详情信息表',
  362. columnProp: 'manageCost',
  363. headerAlign: 'center',
  364. align: 'right',
  365. columnLabel: '管理成本',
  366. columnHidden: false,
  367. columnImage: false,
  368. columnSortable: false,
  369. sortLv: 0,
  370. status: true,
  371. fixed: '',
  372. columnWidth: 120
  373. },{
  374. userId: this.$store.state.user.name,
  375. functionId: 5011,
  376. serialNumber: '5011Table2TotalCost',
  377. tableId: '5011Table2',
  378. tableName: '报价详情信息表',
  379. columnProp: 'totalCost',
  380. headerAlign: 'center',
  381. align: 'right',
  382. columnLabel: '总成本',
  383. columnHidden: false,
  384. columnImage: false,
  385. columnSortable: false,
  386. sortLv: 0,
  387. status: true,
  388. fixed: '',
  389. columnWidth: 120
  390. },{
  391. userId: this.$store.state.user.name,
  392. functionId: 5011,
  393. serialNumber: '5011Table2ProfitRate',
  394. tableId: '5011Table2',
  395. tableName: '报价详情信息表',
  396. columnProp: 'profitRate',
  397. headerAlign: 'center',
  398. align: 'right',
  399. columnLabel: '利润率%',
  400. columnHidden: false,
  401. columnImage: false,
  402. columnSortable: false,
  403. sortLv: 0,
  404. status: true,
  405. fixed: '',
  406. columnWidth: 120
  407. },{
  408. userId: this.$store.state.user.name,
  409. functionId: 5011,
  410. serialNumber: '5011Table2ProfitAmount',
  411. tableId: '5011Table2',
  412. tableName: '报价详情信息表',
  413. columnProp: 'profitAmount',
  414. headerAlign: 'center',
  415. align: 'right',
  416. columnLabel: '利润额',
  417. columnHidden: false,
  418. columnImage: false,
  419. columnSortable: false,
  420. sortLv: 0,
  421. status: true,
  422. fixed: '',
  423. columnWidth: 120
  424. },{
  425. userId: this.$store.state.user.name,
  426. functionId: 5011,
  427. serialNumber: '5011Table2UnitPrice',
  428. tableId: '5011Table2',
  429. tableName: '报价详情信息表',
  430. columnProp: 'unitPrice',
  431. headerAlign: 'center',
  432. align: 'right',
  433. columnLabel: '未税单价',
  434. columnHidden: false,
  435. columnImage: false,
  436. columnSortable: false,
  437. sortLv: 0,
  438. status: true,
  439. fixed: '',
  440. columnWidth: 120
  441. },{
  442. userId: this.$store.state.user.name,
  443. functionId: 5011,
  444. serialNumber: '5011Table2TotalPrice',
  445. tableId: '5011Table2',
  446. tableName: '报价详情信息表',
  447. columnProp: 'totalPrice',
  448. headerAlign: 'center',
  449. align: 'right',
  450. columnLabel: '未税总价',
  451. columnHidden: false,
  452. columnImage: false,
  453. columnSortable: false,
  454. sortLv: 0,
  455. status: true,
  456. fixed: '',
  457. columnWidth: 120
  458. },
  459. {
  460. userId: this.$store.state.user.name,
  461. functionId: 5011,
  462. serialNumber: '5011Table2TaxRate',
  463. tableId: '5011Table2',
  464. tableName: '报价详情信息表',
  465. columnProp: 'taxRate',
  466. headerAlign: 'center',
  467. align: 'right',
  468. columnLabel: '税率%',
  469. columnHidden: false,
  470. columnImage: false,
  471. columnSortable: false,
  472. sortLv: 0,
  473. status: true,
  474. fixed: '',
  475. columnWidth: 120
  476. },{
  477. userId: this.$store.state.user.name,
  478. functionId: 5011,
  479. serialNumber: '5011Table2TaxUnitPrice',
  480. tableId: '5011Table2',
  481. tableName: '报价详情信息表',
  482. columnProp: 'taxUnitPrice',
  483. headerAlign: 'center',
  484. align: 'right',
  485. columnLabel: '含税单价',
  486. columnHidden: false,
  487. columnImage: false,
  488. columnSortable: false,
  489. sortLv: 0,
  490. status: true,
  491. fixed: '',
  492. columnWidth: 120
  493. },
  494. {
  495. userId: this.$store.state.user.name,
  496. functionId: 5011,
  497. serialNumber: '5011Table2TaxTotalPrice',
  498. tableId: '5011Table2',
  499. tableName: '报价详情信息表',
  500. columnProp: 'taxTotalPrice',
  501. headerAlign: 'center',
  502. align: 'right',
  503. columnLabel: '含税总价',
  504. columnHidden: false,
  505. columnImage: false,
  506. columnSortable: false,
  507. sortLv: 0,
  508. status: true,
  509. fixed: '',
  510. columnWidth: 120
  511. },
  512. {
  513. userId: this.$store.state.user.name,
  514. functionId: 5011,
  515. serialNumber: '5011Table2ProcessTime',
  516. tableId: '5011Table2',
  517. tableName: '报价详情信息表',
  518. columnProp: 'processTime',
  519. headerAlign: 'center',
  520. align: 'right',
  521. columnLabel: '处理时间',
  522. columnHidden: false,
  523. columnImage: false,
  524. columnSortable: false,
  525. sortLv: 0,
  526. status: true,
  527. fixed: '',
  528. columnWidth: 120
  529. },
  530. {
  531. userId: this.$store.state.user.name,
  532. functionId: 5011,
  533. serialNumber: '5011Table2Yield',
  534. tableId: '5011Table2',
  535. tableName: '报价详情信息表',
  536. columnProp: 'yield',
  537. headerAlign: 'center',
  538. align: 'right',
  539. columnLabel: 'Yield',
  540. columnHidden: false,
  541. columnImage: false,
  542. columnSortable: false,
  543. sortLv: 0,
  544. status: true,
  545. fixed: '',
  546. columnWidth: 120
  547. },
  548. {
  549. userId: this.$store.state.user.name,
  550. functionId: 5011,
  551. serialNumber: '5011Table2BomYield',
  552. tableId: '5011Table2',
  553. tableName: '报价详情信息表',
  554. columnProp: 'bomYield',
  555. headerAlign: 'center',
  556. align: 'right',
  557. columnLabel: 'BOM Yield',
  558. columnHidden: false,
  559. columnImage: false,
  560. columnSortable: false,
  561. sortLv: 0,
  562. status: true,
  563. fixed: '',
  564. columnWidth: 120
  565. },
  566. {
  567. userId: this.$store.state.user.name,
  568. functionId: 5011,
  569. serialNumber: '5011Table2ParentAttritionRate',
  570. tableId: '5011Table2',
  571. tableName: '报价详情信息表',
  572. columnProp: 'parentAttritionRate',
  573. headerAlign: 'center',
  574. align: 'right',
  575. columnLabel: '母件损耗率',
  576. columnHidden: false,
  577. columnImage: false,
  578. columnSortable: false,
  579. sortLv: 0,
  580. status: true,
  581. fixed: '',
  582. columnWidth: 120
  583. },
  584. {
  585. userId: this.$store.state.user.name,
  586. functionId: 5011,
  587. serialNumber: '5011Table2ChildAttritionRate',
  588. tableId: '5011Table2',
  589. tableName: '报价详情信息表',
  590. columnProp: 'childAttritionRate',
  591. headerAlign: 'center',
  592. align: 'right',
  593. columnLabel: '子件损耗率',
  594. columnHidden: false,
  595. columnImage: false,
  596. columnSortable: false,
  597. sortLv: 0,
  598. status: true,
  599. fixed: '',
  600. columnWidth: 120
  601. },
  602. {
  603. userId: this.$store.state.user.name,
  604. functionId: 5011,
  605. serialNumber: '5011Table2Status',
  606. tableId: '5011Table2',
  607. tableName: '报价详情信息表',
  608. columnProp: 'status',
  609. headerAlign: 'center',
  610. align: 'center',
  611. columnLabel: '状态',
  612. columnHidden: false,
  613. columnImage: false,
  614. columnSortable: false,
  615. sortLv: 0,
  616. status: true,
  617. fixed: '',
  618. columnWidth: 120
  619. },
  620. {
  621. userId: this.$store.state.user.name,
  622. functionId: 5011,
  623. serialNumber: '5011Table2CreateBy',
  624. tableId: '5011Table2',
  625. tableName: '报价详情信息表',
  626. columnProp: 'createBy',
  627. headerAlign: 'center',
  628. align: 'left',
  629. columnLabel: '创建人',
  630. columnHidden: false,
  631. columnImage: false,
  632. columnSortable: false,
  633. sortLv: 0,
  634. status: true,
  635. fixed: '',
  636. columnWidth: 120
  637. },
  638. {
  639. userId: this.$store.state.user.name,
  640. functionId: 5011,
  641. serialNumber: '5011Table2CreateDate',
  642. tableId: '5011Table2',
  643. tableName: '报价详情信息表',
  644. columnProp: 'createDate',
  645. headerAlign: 'center',
  646. align: 'center',
  647. columnLabel: '创建日期',
  648. columnHidden: false,
  649. columnImage: false,
  650. columnSortable: false,
  651. sortLv: 0,
  652. status: true,
  653. fixed: '',
  654. columnWidth: 120
  655. },
  656. {
  657. userId: this.$store.state.user.name,
  658. functionId: 5011,
  659. serialNumber: '5011Table2UpdateBy',
  660. tableId: '5011Table2',
  661. tableName: '报价详情信息表',
  662. columnProp: 'updateBy',
  663. headerAlign: 'center',
  664. align: 'left',
  665. columnLabel: '更新人',
  666. columnHidden: false,
  667. columnImage: false,
  668. columnSortable: false,
  669. sortLv: 0,
  670. status: true,
  671. fixed: '',
  672. columnWidth: 120
  673. },
  674. {
  675. userId: this.$store.state.user.name,
  676. functionId: 5011,
  677. serialNumber: '5011Table2UpdateDate',
  678. tableId: '5011Table2',
  679. tableName: '报价详情信息表',
  680. columnProp: 'updateDate',
  681. headerAlign: 'center',
  682. align: 'center',
  683. columnLabel: '更新日期',
  684. columnHidden: false,
  685. columnImage: false,
  686. columnSortable: false,
  687. sortLv: 0,
  688. status: true,
  689. fixed: '',
  690. columnWidth: 120
  691. },
  692. {
  693. userId: this.$store.state.user.name,
  694. functionId: 5011,
  695. serialNumber: '5011Table2Remark',
  696. tableId: '5011Table2',
  697. tableName: '报价详情信息表',
  698. columnProp: 'remark',
  699. headerAlign: 'center',
  700. align: 'left',
  701. columnLabel: '备注',
  702. columnHidden: false,
  703. columnImage: false,
  704. columnSortable: false,
  705. sortLv: 0,
  706. status: true,
  707. fixed: '',
  708. columnWidth: 120
  709. },
  710. {
  711. userId: this.$store.state.user.name,
  712. functionId: 5011,
  713. serialNumber: '5011Table2InternalInquiryNo',
  714. tableId: '5011Table2',
  715. tableName: '报价详情信息表',
  716. columnProp: 'internalInquiryNo',
  717. headerAlign: 'center',
  718. align: 'left',
  719. columnLabel: '询价单号',
  720. columnHidden: false,
  721. columnImage: false,
  722. columnSortable: false,
  723. sortLv: 0,
  724. status: true,
  725. fixed: '',
  726. columnWidth: 120
  727. },
  728. ],
  729. projectPartVisible:false,
  730. activeName:'bom',
  731. }
  732. },
  733. methods:{
  734. handleSaveQuoteDetail(row){
  735. this.$nextTick(()=>{
  736. if (this.$refs.handleSaveQuoteDetailClick){
  737. this.$refs.saveQuoteDetailForm.clearValidate();
  738. }
  739. })
  740. if (row){
  741. this.saveQuoteDetail = {
  742. ...row
  743. }
  744. }else {
  745. this.saveQuoteDetail = {
  746. ...this.quoteDetail,
  747. createBy:this.$store.state.user.name,
  748. status:'草稿',
  749. active:'Y',
  750. qty:1,
  751. isDetail:false,
  752. }
  753. this.$nextTick(()=>{
  754. this.saveQuoteDetail.projectNo = this.quote.projectNo
  755. })
  756. }
  757. this.activeName = 'bom';
  758. this.saveVisible = true;
  759. },
  760. handleDetail(row){
  761. this.saveQuoteDetail = {
  762. ...row
  763. }
  764. this.activeName = 'bom';
  765. this.saveVisible = true;
  766. },
  767. handleDeleteQuoteDetail(row){
  768. this.$alert('确认删除该条报价明细吗?', '提示', {
  769. confirmButtonText: '确定',
  770. cancelButtonText: '取消',
  771. type: 'warning'
  772. }).then(() => {
  773. let params = {
  774. id: row.id,
  775. }
  776. deleteQuoteDetail(params).then(({data}) => {
  777. if (data && data.code === 0) {
  778. this.$message.success(data.msg);
  779. this.handleQueryQuoteDetail();
  780. } else {
  781. this.$message.warning(data.msg);
  782. }
  783. }).catch((error) => {
  784. this.$message.error(error);
  785. })
  786. }).catch(() => {
  787. })
  788. },
  789. handleDblClick(row){
  790. this.saveQuoteDetail.partId = row.id;
  791. this.saveQuoteDetail.partNo = row.partNo;
  792. this.saveQuoteDetail.partDesc = row.partDesc;
  793. this.projectPartVisible = false;
  794. },
  795. handlePartNoBlur(){
  796. let params = {
  797. partNo: this.saveQuoteDetail.partNo,
  798. projectNo: this.quote.projectNo,
  799. }
  800. queryProjectPart(params).then(({data})=>{
  801. if (data && data.code === 0){
  802. if (data.rows.length === 1){
  803. this.saveQuoteDetail.partId = data.rows[0].id;
  804. this.saveQuoteDetail.partDesc = data.rows[0].partDesc;
  805. }else {
  806. this.saveQuoteDetail.partId = undefined;
  807. this.saveQuoteDetail.partDesc = '';
  808. }
  809. }else {
  810. this.$message.warning(data.msg);
  811. }
  812. }).catch((error)=>{
  813. this.$message.error(error);
  814. })
  815. },
  816. handleQueryQuoteDetail(){
  817. let params = {
  818. quoteId: this.quote.id,
  819. }
  820. this.queryLoading = true;
  821. queryQuoteDetail(params).then(({data})=>{
  822. if (data && data.code === 0){
  823. this.dataList = data.rows
  824. }else {
  825. this.$message.warning(data.msg);
  826. }
  827. this.queryLoading = false;
  828. }).catch((error)=>{
  829. this.$message.error(error);
  830. this.queryLoading = false;
  831. })
  832. },
  833. handleSaveQuoteDetailClick(){
  834. this.$refs.saveQuoteDetailForm.validate((valid,obj) => {
  835. if (valid){
  836. if (this.saveQuoteDetail.id){
  837. this.handleUpdate();
  838. }else {
  839. this.handleSave();
  840. }
  841. }else {
  842. }
  843. })
  844. },
  845. handleSave(){
  846. let params = {
  847. ...this.saveQuoteDetail,
  848. quoteId: this.quote.id,
  849. quoteNo:this.quote.quoteNo,
  850. site:this.quote.site,
  851. buNo:this.quote.buNo,
  852. versionNo:this.quote.versionNo,
  853. createBy:this.saveQuoteDetail.createBy,
  854. active:'Y',
  855. status:'草稿',
  856. internalInquiryNo:this.quote.insideInquiryNo,
  857. }
  858. this.saveLoading = true;
  859. saveQuoteDetail(params).then(({data})=>{
  860. if (data && data.code === 0){
  861. this.$message.success(data.msg);
  862. this.handleQueryQuoteDetail();
  863. if (this.saveQuoteDetail.isDetail){
  864. this.saveQuoteDetail = {
  865. ...data.row,
  866. }
  867. }else {
  868. this.saveVisible = false;
  869. }
  870. }else {
  871. this.$message.warning(data.msg);
  872. }
  873. this.saveLoading = false
  874. }).catch((error)=>{
  875. this.$message.error(error);
  876. this.saveLoading = false
  877. })
  878. },
  879. handleUpdate(){
  880. let params = {
  881. ...this.saveQuoteDetail,
  882. updateBy:this.$store.state.user.name,
  883. }
  884. updateQuoteDetail(params).then(({data})=>{
  885. if (data && data.code === 0){
  886. this.$message.success(data.msg);
  887. this.handleQueryQuoteDetail();
  888. this.saveVisible = false;
  889. }else {
  890. this.$message.warning(data.msg);
  891. }
  892. }).catch((error)=>{
  893. this.$message.error(error);
  894. })
  895. },
  896. handleComputeYield(row){
  897. let params = {
  898. id: row.id,
  899. }
  900. queryQuoteDetailYield(params).then(({data})=>{
  901. if (data && data.code === 0){
  902. this.$message.success(data.msg);
  903. this.handleQueryQuoteDetail();
  904. }else {
  905. this.$message.warning(data.msg);
  906. }
  907. }).catch((error)=>{
  908. this.$message.error(error);
  909. })
  910. }
  911. },
  912. watch:{
  913. quote(newVal,oldVal){
  914. if (newVal.id){
  915. this.handleQueryQuoteDetail();
  916. }else {
  917. this.dataList = [];
  918. }
  919. },
  920. }
  921. }
  922. </script>
  923. <template>
  924. <div>
  925. <el-button type="primary" :disabled="quote.status === '下达'" @click="handleSaveQuoteDetail(null)">新增</el-button>
  926. <el-table v-loading="queryLoading" border :data="dataList" style="width: 100%;margin-top: 5px" :height="height">
  927. <el-table-column type="index" width="55" align="center" label="序号"></el-table-column>
  928. <el-table-column
  929. v-for="(item,index) in columns" :key="index"
  930. :sortable="item.columnSortable"
  931. :prop="item.columnProp"
  932. :header-align="item.headerAlign"
  933. :show-overflow-tooltip="item.showOverflowTooltip"
  934. :align="item.align"
  935. :fixed="item.fixed === ''?false:item.fixed"
  936. :min-width="item.columnWidth"
  937. :label="item.columnLabel">
  938. <template slot-scope="scope">
  939. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  940. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  941. style="width: 100px; height: 80px"/></span>
  942. </template>
  943. </el-table-column>
  944. <el-table-column label="操作" fixed="right" align="center" width="120">
  945. <template slot-scope="{row,$index}">
  946. <a type="text" v-if="row.status === '草稿'" @click="handleComputeYield(row)">计算</a>
  947. <a type="text" v-if="row.status === '草稿'" @click="handleSaveQuoteDetail(row)">编辑</a>
  948. <a type="text" v-if="row.status === '草稿'" @click="handleDeleteQuoteDetail(row)">删除</a>
  949. <a type="text" v-if="row.status === '下达'" @click="handleDetail(row)">详情</a>
  950. </template>
  951. </el-table-column>
  952. </el-table>
  953. <el-dialog :title="`报价明细`" top="10vh" v-drag :visible.sync="saveVisible" append-to-body :width="`${saveQuoteDetail.id?1200:600}px`" :close-on-click-modal="false">
  954. <el-form :model="saveQuoteDetail" ref="saveQuoteDetailForm" :rules="saveQuoteDetailRules" label-position="top" v-if="!saveQuoteDetail.id">
  955. <el-row :gutter="20">
  956. <el-col :span="8">
  957. <el-form-item label="物料名称" prop="partNo" :show-message="false">
  958. <span slot="label">
  959. <a @click="projectPartVisible = true">物料名称</a>
  960. </span>
  961. <el-input v-model="saveQuoteDetail.partNo" @blur="handlePartNoBlur"></el-input>
  962. </el-form-item>
  963. </el-col>
  964. <el-col :span="16">
  965. <el-form-item label="物料描述" prop="partDesc" :show-message="false">
  966. <el-input v-model="saveQuoteDetail.partDesc" disabled></el-input>
  967. </el-form-item>
  968. </el-col>
  969. <el-col :span="8">
  970. <el-form-item label="报价数量" prop="qty" :show-message="false">
  971. <el-input-number style="width: 100%;" v-model="saveQuoteDetail.qty" :min="1" :step="0" :precision="0" :controls="false"></el-input-number>
  972. </el-form-item>
  973. </el-col>
  974. </el-row>
  975. <el-row :gutter="20">
  976. <el-col :span="8">
  977. <el-form-item label="" :show-message="false">
  978. <el-checkbox v-model="saveQuoteDetail.isDetail">保存进入报价页面</el-checkbox>
  979. </el-form-item>
  980. </el-col>
  981. <el-col :span="24">
  982. <el-form-item label="备注" class="auto" :show-message="false">
  983. <el-input type="textarea" v-model="saveQuoteDetail.remark" :autosize="{minRows: 3, maxRows: 3}"></el-input>
  984. </el-form-item>
  985. </el-col>
  986. </el-row>
  987. </el-form>
  988. <el-form v-else :model="saveQuoteDetail" ref="saveQuoteDetailForm" :rules="saveQuoteDetailRules" label-position="top">
  989. <el-row :gutter="20">
  990. <el-col :span="4">
  991. <el-form-item label="物料名称" prop="partNo" :show-message="false">
  992. <el-input v-model="saveQuoteDetail.partNo" disabled></el-input>
  993. </el-form-item>
  994. </el-col>
  995. <el-col :span="6">
  996. <el-form-item label="物料描述" prop="partDesc" :show-message="false">
  997. <el-input v-model="saveQuoteDetail.partDesc" disabled></el-input>
  998. </el-form-item>
  999. </el-col>
  1000. <el-col :span="3">
  1001. <el-form-item label="报价数量" prop="qty" :show-message="false">
  1002. <el-input-number v-model="saveQuoteDetail.qty" style="width: 100%;" :controls="false" disabled></el-input-number>
  1003. </el-form-item>
  1004. </el-col>
  1005. </el-row>
  1006. <el-row :gutter="20">
  1007. <el-col :span="16">
  1008. <el-form-item label="备注" class="auto" :show-message="false">
  1009. <el-input type="textarea" resize="none" :autosize="{minRows: 3, maxRows: 3}" v-model="saveQuoteDetail.remark" disabled></el-input>
  1010. </el-form-item>
  1011. </el-col>
  1012. </el-row>
  1013. </el-form>
  1014. <el-tabs v-model="activeName" v-if="saveQuoteDetail.id">
  1015. <el-tab-pane label="材料" name="bom">
  1016. <quote-detail-bom v-if="saveVisible" v-model:quoteDetail="saveQuoteDetail"></quote-detail-bom>
  1017. </el-tab-pane>
  1018. <el-tab-pane label="工艺" name="routing">
  1019. <quote-detail-routing v-if="saveVisible" v-model:quoteDetail="saveQuoteDetail"></quote-detail-routing>
  1020. </el-tab-pane>
  1021. <el-tab-pane label="工具" name="tool">
  1022. <quote-detail-tool v-if="saveVisible" v-model:quoteDetail="saveQuoteDetail"></quote-detail-tool>
  1023. </el-tab-pane>
  1024. <el-tab-pane label="其他成本" name="other">
  1025. <quote-detail-other v-if="saveVisible" v-model:quoteDetail="saveQuoteDetail"></quote-detail-other>
  1026. </el-tab-pane>
  1027. <el-tab-pane label="成本&价格" name="cost">
  1028. <quote-detail-cost v-model:quoteDetail="saveQuoteDetail"></quote-detail-cost>
  1029. </el-tab-pane>
  1030. </el-tabs>
  1031. <div slot="footer" class="dialog-footer">
  1032. <el-button type="primary" v-if="saveQuoteDetail.status === '草稿'" :loading="saveLoading" @click="handleSaveQuoteDetailClick"> </el-button>
  1033. <el-button @click="saveVisible = false"> </el-button>
  1034. </div>
  1035. </el-dialog>
  1036. <project-part-table v-if="saveVisible" v-model="projectPartVisible" :project-no="saveQuoteDetail.projectNo" :part-no="saveQuoteDetail.partNo" @dblclick="handleDblClick"></project-part-table>
  1037. </div>
  1038. </template>
  1039. <style scoped>
  1040. .el-table /deep/ .cell{
  1041. height: auto;
  1042. line-height: 1.5;
  1043. }
  1044. .auto /deep/ .el-form-item__content{
  1045. height: auto;
  1046. line-height: 1.5;
  1047. }
  1048. </style>