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.

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