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.

1216 lines
39 KiB

1 year ago
1 year ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
9 months ago
1 year ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
1 year ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
8 months ago
10 months ago
1 year ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
8 months ago
9 months ago
1 year ago
9 months ago
1 year ago
11 months ago
1 year ago
1 year ago
9 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
9 months ago
9 months ago
1 year ago
1 year 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
1 year ago
1 year ago
1 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 {
  3. updateQuoteDetail
  4. } from "../../../../api/quote/quoteDetail";
  5. import {getProjectPartList} from "../../../../api/project/project";
  6. import QuoteDetailCost from "./primary/quoteDetailCost.vue";
  7. import QuoteDetailTool from "./primary/quoteDetailTool.vue";
  8. import QuoteDetailBom from "./primary/quoteDetailBom.vue";
  9. import QuoteDetailRouting from "./primary/quoteDetailRouting.vue";
  10. import QuoteDetailOtherCost from "./primary/quoteDetailOtherCost.vue";
  11. import DictDataSelect from "../../sys/dict-data-select.vue";
  12. import QuoteDetailTest from "./primary/quoteDetailTest.vue";
  13. import QuoteDetailOther from "./primary/quoteDetailOther.vue";
  14. import {
  15. queryQuoteGroupDetail,
  16. removeQuoteGroupDetail,
  17. saveQuoteGroupDetail, updateCurrentQuoteGroupDetailItemNo
  18. } from "../../../../api/quote/quoteGroupDetail";
  19. import QuoteDetail from "./quoteDetail.vue";
  20. export default {
  21. name: "quoteGroupDetail",
  22. components: {
  23. QuoteDetail,
  24. QuoteDetailOther,
  25. QuoteDetailTest,
  26. DictDataSelect,
  27. QuoteDetailOtherCost,
  28. QuoteDetailRouting,
  29. QuoteDetailBom,
  30. QuoteDetailTool,
  31. QuoteDetailCost,
  32. },
  33. props:{
  34. quote:{
  35. type:Object,
  36. required:true
  37. },
  38. height:{
  39. type:[Number,String],
  40. default:300
  41. },
  42. authFlag:{
  43. type:Boolean,
  44. default:false
  45. }
  46. },
  47. data(){
  48. return{
  49. quoteDetail:{
  50. id:null,
  51. partNo:'',
  52. partDesc:'',
  53. projectNo:'',
  54. projectDesc:'',
  55. buNo: '*',
  56. qty:null,
  57. quoteCount:1,
  58. partCost:0,
  59. adjustPartCost:0,
  60. labourCost:0,
  61. adjustLabourCost:0,
  62. fabricateCost:0,
  63. adjustFabricateCost:0,
  64. toolCost:0,
  65. adjustToolCost:0,
  66. machineCost:0,
  67. adjustMachineCost:0,
  68. otherCost:0,
  69. manageCost:0,
  70. totalCost:0,
  71. profitRate:0,
  72. profitAmount:0,
  73. totalPrice:0,
  74. unitPrice:0,
  75. taxRate:13,
  76. taxTotalPrice:0,
  77. taxUnitPrice:0,
  78. quoteTotalCost:0,
  79. quoteProfitRate:0,
  80. quoteProfitAmount:0,
  81. quoteTotalPrice:0,
  82. quoteUnitPrice:0,
  83. quoteTaxRate:0,
  84. quoteTaxTotalPrice:0,
  85. quoteTaxUnitPrice:0,
  86. currency1:undefined,
  87. currency2:undefined,
  88. exchangeRate1:undefined,
  89. exchangeRate2:undefined,
  90. currencyTotalCost1:0,
  91. currencyTotalCost2:0,
  92. quoteCurrencyTotalCost1:0,
  93. quoteCurrencyTotalCost2:0,
  94. // moq:'Standard 250K',
  95. moq:'',
  96. calculatedItems:'工具,测试,其他,包装,运输',
  97. testCost:0,
  98. adjustTestCost:0,
  99. elseCost:0,
  100. adjustElseCost:0,
  101. remark:'',
  102. },
  103. saveQuoteDetail:{
  104. },
  105. dataList:[],
  106. saveLoading:false,
  107. queryLoading:false,
  108. saveVisible:false,
  109. saveQuoteDetailRules:{
  110. partNo: [{required: true, message: '请输入物料编码', trigger: ['blur','change']}],
  111. partDesc: [{required: true, message: '请输入物料名称', trigger: ['blur','change']}],
  112. qty: [{required: true, message: '请输入数量', trigger: ['blur','change']}],
  113. currency1: [{required: true, message: '请选择币种', trigger: ['blur','change']}],
  114. },
  115. columns: [
  116. {
  117. userId: this.$store.state.user.name,
  118. functionId: 5011,
  119. serialNumber: '5011Table2PLMPartNo',
  120. tableId: '5011Table2',
  121. tableName: '报价详情信息表',
  122. columnProp: 'plmPartNo',
  123. headerAlign: 'center',
  124. align: 'left',
  125. columnLabel: 'PLM物料编码',
  126. columnHidden: false,
  127. columnImage: false,
  128. columnSortable: false,
  129. sortLv: 0,
  130. status: true,
  131. fixed: '',
  132. columnWidth: 120
  133. },
  134. {
  135. userId: this.$store.state.user.name,
  136. functionId: 5011,
  137. serialNumber: '5011Table2PartNo',
  138. tableId: '5011Table2',
  139. tableName: '报价详情信息表',
  140. columnProp: 'ifsPartNo',
  141. headerAlign: 'center',
  142. align: 'left',
  143. columnLabel: 'IFS物料编码',
  144. columnHidden: false,
  145. columnImage: false,
  146. columnSortable: false,
  147. sortLv: 0,
  148. status: true,
  149. fixed: '',
  150. columnWidth: 120
  151. },
  152. {
  153. userId: this.$store.state.user.name,
  154. functionId: 5011,
  155. serialNumber: '5011Table2PartDesc',
  156. tableId: '5011Table2',
  157. tableName: '报价详情信息表',
  158. columnProp: 'partDesc',
  159. headerAlign: 'center',
  160. align: 'left',
  161. columnLabel: '物料名称',
  162. columnHidden: false,
  163. columnImage: false,
  164. columnSortable: false,
  165. sortLv: 0,
  166. status: true,
  167. fixed: '',
  168. columnWidth: 240
  169. },
  170. {
  171. userId: this.$store.state.user.name,
  172. functionId: 5011,
  173. serialNumber: '5011Table2Qty',
  174. tableId: '5011Table2',
  175. tableName: '报价详情信息表',
  176. columnProp: 'qty',
  177. headerAlign: 'center',
  178. align: 'right',
  179. columnLabel: 'MOQ',
  180. columnHidden: false,
  181. columnImage: false,
  182. columnSortable: false,
  183. sortLv: 0,
  184. status: true,
  185. fixed: '',
  186. columnWidth: 100
  187. },
  188. {
  189. userId: this.$store.state.user.name,
  190. functionId: 5011,
  191. serialNumber: '5011Table2AdjustPartCost',
  192. tableId: '5011Table2',
  193. tableName: '报价详情信息表',
  194. columnProp: 'adjustPartCost',
  195. headerAlign: 'center',
  196. align: 'right',
  197. columnLabel: '材料成本',
  198. columnHidden: false,
  199. columnImage: false,
  200. columnSortable: false,
  201. sortLv: 0,
  202. status: true,
  203. fixed: '',
  204. columnWidth: 130
  205. },
  206. {
  207. userId: this.$store.state.user.name,
  208. functionId: 5011,
  209. serialNumber: '5011Table2AdjustLabourCost',
  210. tableId: '5011Table2',
  211. tableName: '报价详情信息表',
  212. columnProp: 'adjustLabourCost',
  213. headerAlign: 'center',
  214. align: 'right',
  215. columnLabel: '人工成本',
  216. columnHidden: false,
  217. columnImage: false,
  218. columnSortable: false,
  219. sortLv: 0,
  220. status: true,
  221. fixed: '',
  222. columnWidth: 120
  223. },
  224. {
  225. userId: this.$store.state.user.name,
  226. functionId: 5011,
  227. serialNumber: '5011Table2AdjustMachineCost',
  228. tableId: '5011Table2',
  229. tableName: '报价详情信息表',
  230. columnProp: 'adjustMachineCost',
  231. headerAlign: 'center',
  232. align: 'right',
  233. columnLabel: '机器成本',
  234. columnHidden: false,
  235. columnImage: false,
  236. columnSortable: false,
  237. sortLv: 0,
  238. status: true,
  239. fixed: '',
  240. columnWidth: 120
  241. },
  242. {
  243. userId: this.$store.state.user.name,
  244. functionId: 5011,
  245. serialNumber: '5011Table2AdjustToolCost',
  246. tableId: '5011Table2',
  247. tableName: '报价详情信息表',
  248. columnProp: 'adjustToolCost',
  249. headerAlign: 'center',
  250. align: 'right',
  251. columnLabel: '工具成本',
  252. columnHidden: false,
  253. columnImage: false,
  254. columnSortable: false,
  255. sortLv: 0,
  256. status: true,
  257. fixed: '',
  258. columnWidth: 120
  259. },
  260. {
  261. userId: this.$store.state.user.name,
  262. functionId: 5011,
  263. serialNumber: '5011Table2AdjustTestCost',
  264. tableId: '5011Table2',
  265. tableName: '报价详情信息表',
  266. columnProp: 'adjustTestCost',
  267. headerAlign: 'center',
  268. align: 'right',
  269. columnLabel: '测试成本',
  270. columnHidden: false,
  271. columnImage: false,
  272. columnSortable: false,
  273. sortLv: 0,
  274. status: true,
  275. fixed: '',
  276. columnWidth: 120
  277. },
  278. {
  279. userId: this.$store.state.user.name,
  280. functionId: 5011,
  281. serialNumber: '5011Table2AdjustElseCost',
  282. tableId: '5011Table2',
  283. tableName: '报价详情信息表',
  284. columnProp: 'adjustElseCost',
  285. headerAlign: 'center',
  286. align: 'right',
  287. columnLabel: '其他成本',
  288. columnHidden: false,
  289. columnImage: false,
  290. columnSortable: false,
  291. sortLv: 0,
  292. status: true,
  293. fixed: '',
  294. columnWidth: 120
  295. },
  296. {
  297. userId: this.$store.state.user.name,
  298. functionId: 5011,
  299. serialNumber: '5011Table2TotalCost',
  300. tableId: '5011Table2',
  301. tableName: '报价详情信息表',
  302. columnProp: 'totalCost',
  303. headerAlign: 'center',
  304. align: 'right',
  305. columnLabel: '总成本',
  306. columnHidden: false,
  307. columnImage: false,
  308. columnSortable: false,
  309. sortLv: 0,
  310. status: true,
  311. fixed: '',
  312. columnWidth: 80
  313. },
  314. {
  315. userId: this.$store.state.user.name,
  316. functionId: 5011,
  317. serialNumber: '5011Table2QuoteProfitRate',
  318. tableId: '5011Table2',
  319. tableName: '报价详情信息表',
  320. columnProp: 'quoteProfitRate',
  321. headerAlign: 'center',
  322. align: 'right',
  323. columnLabel: 'VA%',
  324. columnHidden: false,
  325. columnImage: false,
  326. columnSortable: false,
  327. sortLv: 0,
  328. status: true,
  329. fixed: '',
  330. columnWidth: 80
  331. },
  332. {
  333. userId: this.$store.state.user.name,
  334. functionId: 5011,
  335. serialNumber: '5011Table2QuoteProfitAmount',
  336. tableId: '5011Table2',
  337. tableName: '报价详情信息表',
  338. columnProp: 'quoteProfitAmount',
  339. headerAlign: 'center',
  340. align: 'right',
  341. columnLabel: 'Contribution%',
  342. columnHidden: false,
  343. columnImage: false,
  344. columnSortable: false,
  345. sortLv: 0,
  346. status: true,
  347. fixed: '',
  348. columnWidth: 100
  349. },
  350. {
  351. userId: this.$store.state.user.name,
  352. functionId: 5011,
  353. serialNumber: '5011Table2QuoteTaxRate',
  354. tableId: '5011Table2',
  355. tableName: '报价详情信息表',
  356. columnProp: 'quoteTaxRate',
  357. headerAlign: 'center',
  358. align: 'right',
  359. columnLabel: 'Margin%',
  360. columnHidden: false,
  361. columnImage: false,
  362. columnSortable: false,
  363. sortLv: 0,
  364. status: true,
  365. fixed: '',
  366. columnWidth: 80
  367. },
  368. {
  369. userId: this.$store.state.user.name,
  370. functionId: 5011,
  371. serialNumber: '5011Table2QuoteTaxTotalPrice',
  372. tableId: '5011Table2',
  373. tableName: '报价详情信息表',
  374. columnProp: 'quoteTaxTotalPrice',
  375. headerAlign: 'center',
  376. align: 'right',
  377. columnLabel: 'Price ¥(ex VAT)',
  378. columnHidden: false,
  379. columnImage: false,
  380. columnSortable: false,
  381. sortLv: 0,
  382. status: true,
  383. fixed: '',
  384. columnWidth: 100
  385. },
  386. {
  387. userId: this.$store.state.user.name,
  388. functionId: 5011,
  389. serialNumber: '5011Table2Qty',
  390. tableId: '5011Table2',
  391. tableName: '报价详情信息表',
  392. columnProp: 'unitPrice',
  393. headerAlign: 'center',
  394. align: 'right',
  395. columnLabel: '未税单价(CNY)',
  396. columnHidden: false,
  397. columnImage: false,
  398. columnSortable: false,
  399. sortLv: 0,
  400. status: true,
  401. fixed: '',
  402. columnWidth: 100
  403. },
  404. {
  405. userId: this.$store.state.user.name,
  406. functionId: 5011,
  407. serialNumber: '5011Table2Qty',
  408. tableId: '5011Table2',
  409. tableName: '报价详情信息表',
  410. columnProp: 'taxRate',
  411. headerAlign: 'center',
  412. align: 'right',
  413. columnLabel: '税率',
  414. columnHidden: false,
  415. columnImage: false,
  416. columnSortable: false,
  417. sortLv: 0,
  418. status: true,
  419. fixed: '',
  420. columnWidth: 100
  421. },
  422. {
  423. userId: this.$store.state.user.name,
  424. functionId: 5011,
  425. serialNumber: '5011Table2Qty',
  426. tableId: '5011Table2',
  427. tableName: '报价详情信息表',
  428. columnProp: 'exchangeRate1',
  429. headerAlign: 'center',
  430. align: 'right',
  431. columnLabel: '其他税率',
  432. columnHidden: false,
  433. columnImage: false,
  434. columnSortable: false,
  435. sortLv: 0,
  436. status: true,
  437. fixed: '',
  438. columnWidth: 100
  439. },
  440. {
  441. userId: this.$store.state.user.name,
  442. functionId: 5011,
  443. serialNumber: '5011Table2Qty',
  444. tableId: '5011Table2',
  445. tableName: '报价详情信息表',
  446. columnProp: 'taxUnitPrice',
  447. headerAlign: 'center',
  448. align: 'right',
  449. columnLabel: '含税单价(CNY)',
  450. columnHidden: false,
  451. columnImage: false,
  452. columnSortable: false,
  453. sortLv: 0,
  454. status: true,
  455. fixed: '',
  456. columnWidth: 100
  457. },
  458. {
  459. userId: this.$store.state.user.name,
  460. functionId: 5011,
  461. serialNumber: '5011Table2Qty',
  462. tableId: '5011Table2',
  463. tableName: '报价详情信息表',
  464. columnProp: 'unitPriceRate',
  465. headerAlign: 'center',
  466. align: 'right',
  467. columnLabel: '未税单价',
  468. columnHidden: false,
  469. columnImage: false,
  470. columnSortable: false,
  471. sortLv: 0,
  472. status: true,
  473. fixed: '',
  474. columnWidth: 100
  475. },
  476. {
  477. userId: this.$store.state.user.name,
  478. functionId: 5011,
  479. serialNumber: '5011Table2Qty',
  480. tableId: '5011Table2',
  481. tableName: '报价详情信息表',
  482. columnProp: 'currencyDesc2',
  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: 100
  493. },
  494. {
  495. userId: this.$store.state.user.name,
  496. functionId: 5011,
  497. serialNumber: '5011Table2Qty',
  498. tableId: '5011Table2',
  499. tableName: '报价详情信息表',
  500. columnProp: 'exchangeRate2',
  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: 100
  511. },
  512. // {
  513. // userId: this.$store.state.user.name,
  514. // functionId: 5011,
  515. // serialNumber: '5011Table2Qty',
  516. // tableId: '5011Table2',
  517. // tableName: '报价详情信息表',
  518. // columnProp: 'unitPrice',
  519. // headerAlign: 'center',
  520. // align: 'right',
  521. // columnLabel: '未税单价(CNY)',
  522. // columnHidden: false,
  523. // columnImage: false,
  524. // columnSortable: false,
  525. // sortLv: 0,
  526. // status: true,
  527. // fixed: '',
  528. // columnWidth: 100
  529. // },
  530. {
  531. userId: this.$store.state.user.name,
  532. functionId: 5011,
  533. serialNumber: '5011Table2Qty',
  534. tableId: '5011Table2',
  535. tableName: '报价详情信息表',
  536. columnProp: 'currencyTotalCost2',
  537. headerAlign: 'center',
  538. align: 'right',
  539. columnLabel: '含税单价',
  540. columnHidden: false,
  541. columnImage: false,
  542. columnSortable: false,
  543. sortLv: 0,
  544. status: true,
  545. fixed: '',
  546. columnWidth: 100
  547. },
  548. {
  549. userId: this.$store.state.user.name,
  550. functionId: 5011,
  551. serialNumber: '5011Table2Remark',
  552. tableId: '5011Table2',
  553. tableName: '报价详情信息表',
  554. columnProp: 'remark',
  555. headerAlign: 'center',
  556. align: 'left',
  557. columnLabel: '备注',
  558. columnHidden: false,
  559. columnImage: false,
  560. columnSortable: false,
  561. sortLv: 0,
  562. status: true,
  563. fixed: '',
  564. columnWidth: 120
  565. },
  566. ],
  567. partVisible:false,
  568. activeName:'bom',
  569. projectPart:{
  570. },
  571. projectPartList:[],
  572. pageNo:1,
  573. pageSize:20,
  574. pageTotal:0,
  575. partQueryLoading:false,
  576. projectPartColumns:[
  577. {
  578. userId: this.$store.state.user.name,
  579. functionId: 5011,
  580. serialNumber: '5011Table3TestPartNo',
  581. tableId: '5011Table3',
  582. tableName: '项目物料表',
  583. columnProp: 'testPartNo',
  584. headerAlign: 'center',
  585. align: 'left',
  586. columnLabel: '物料编码',
  587. columnHidden: false,
  588. columnImage: false,
  589. columnSortable: false,
  590. sortLv: 0,
  591. status: true,
  592. fixed: '',
  593. columnWidth: 150
  594. },
  595. {
  596. userId: this.$store.state.user.name,
  597. functionId: 5011,
  598. serialNumber: '5011Table3PartDesc',
  599. tableId: '5011Table3',
  600. tableName: '项目物料表',
  601. columnProp: 'partDesc',
  602. headerAlign: 'center',
  603. align: 'left',
  604. columnLabel: '物料名称',
  605. columnHidden: false,
  606. columnImage: false,
  607. columnSortable: false,
  608. sortLv: 0,
  609. status: true,
  610. fixed: '',
  611. columnWidth: 160
  612. },
  613. {
  614. userId: this.$store.state.user.name,
  615. functionId: 5011,
  616. serialNumber: '5011Table3FinalPartNo',
  617. tableId: '5011Table3',
  618. tableName: '项目物料表',
  619. columnProp: 'finalPartNo',
  620. headerAlign: 'center',
  621. align: 'left',
  622. columnLabel: 'IFS物料编码',
  623. columnHidden: false,
  624. columnImage: false,
  625. columnSortable: false,
  626. sortLv: 0,
  627. status: true,
  628. fixed: '',
  629. columnWidth: 150
  630. },
  631. {
  632. userId: this.$store.state.user.name,
  633. functionId: 5011,
  634. serialNumber: '5011Table3CustomerPartNo',
  635. tableId: '5011Table3',
  636. tableName: '项目物料表',
  637. columnProp: 'customerPartNo',
  638. headerAlign: 'center',
  639. align: 'left',
  640. columnLabel: '客户物料编码',
  641. columnHidden: false,
  642. columnImage: false,
  643. columnSortable: false,
  644. sortLv: 0,
  645. status: true,
  646. fixed: '',
  647. columnWidth: 150
  648. },
  649. {
  650. userId: this.$store.state.user.name,
  651. functionId: 5011,
  652. serialNumber: '5011Table3Type',
  653. tableId: '5011Table3',
  654. tableName: '项目物料表',
  655. columnProp: 'type',
  656. headerAlign: 'center',
  657. align: 'left',
  658. columnLabel: '制造类型',
  659. columnHidden: false,
  660. columnImage: false,
  661. columnSortable: false,
  662. sortLv: 0,
  663. status: true,
  664. fixed: '',
  665. columnWidth: 120
  666. },
  667. {
  668. userId: this.$store.state.user.name,
  669. functionId: 5011,
  670. serialNumber: '5011Table3UmId',
  671. tableId: '5011Table3',
  672. tableName: '项目物料表',
  673. columnProp: 'umId',
  674. headerAlign: 'center',
  675. align: 'left',
  676. columnLabel: '单位',
  677. columnHidden: false,
  678. columnImage: false,
  679. columnSortable: false,
  680. sortLv: 0,
  681. status: true,
  682. fixed: '',
  683. columnWidth: 100
  684. },
  685. ],
  686. drawerVisible: false,
  687. quoteGroupDetail:{
  688. id:-1,
  689. },
  690. }
  691. },
  692. methods:{
  693. handleSaveQuoteDetail(row){
  694. this.$nextTick(()=>{
  695. if (this.$refs.handleSaveQuoteDetailClick){
  696. this.$refs.saveQuoteDetailForm.clearValidate();
  697. }
  698. })
  699. if (row){
  700. this.saveQuoteDetail = {
  701. ...row
  702. }
  703. }else {
  704. this.saveQuoteDetail = {
  705. ...this.quoteDetail,
  706. createBy:this.$store.state.user.name,
  707. status:'草稿',
  708. active:'Y',
  709. qty:1,
  710. isDetail:false,
  711. }
  712. this.$nextTick(()=>{
  713. this.saveQuoteDetail.projectNo = this.quote.projectNo
  714. })
  715. }
  716. this.activeName = 'bom';
  717. this.saveVisible = true;
  718. },
  719. handleDeleteQuoteDetail(row){
  720. this.$alert('确认删除该条报价明细吗?', '提示', {
  721. confirmButtonText: '确定',
  722. cancelButtonText: '取消',
  723. type: 'warning'
  724. }).then(() => {
  725. let params = {
  726. id: row.id,
  727. }
  728. removeQuoteGroupDetail(params).then(({data}) => {
  729. if (data && data.code === 0) {
  730. this.$message.success(data.msg);
  731. this.handleQueryQuoteDetail();
  732. } else {
  733. this.$message.warning(data.msg);
  734. }
  735. }).catch((error) => {
  736. this.$message.error(error);
  737. })
  738. }).catch(() => {
  739. })
  740. },
  741. handlePartNoBlur(){
  742. let params = {
  743. site:this.$store.state.user.site,
  744. testPartNo:this.saveQuoteDetail.partNo,
  745. projectId: this.quote.projectNo,
  746. no:1,
  747. size:20,
  748. }
  749. getProjectPartList(params).then(({data})=>{
  750. if (data && data.code === 0){
  751. if (data.rows && data.rows.length === 1){
  752. this.dblClickProjectPartTable(data.rows[0])
  753. }else {
  754. this.saveQuoteDetail.partDesc = ''
  755. }
  756. }
  757. })
  758. },
  759. handleQueryQuoteDetail(val){
  760. let params = {
  761. quoteId: this.quote.id,
  762. }
  763. if (!val){
  764. this.queryLoading = true;
  765. }
  766. queryQuoteGroupDetail(params).then(({data})=>{
  767. if (data && data.code === 0){
  768. this.dataList = data.rows
  769. }else {
  770. this.$message.warning(data.msg);
  771. }
  772. this.queryLoading = false;
  773. }).catch((error)=>{
  774. this.$message.error(error);
  775. this.queryLoading = false;
  776. })
  777. },
  778. handleSaveQuoteDetailClick(){
  779. this.$refs.saveQuoteDetailForm.validate((valid,obj) => {
  780. if (valid){
  781. if (this.saveQuoteDetail.id){
  782. this.handleUpdate();
  783. }else {
  784. this.handleSave();
  785. }
  786. }else {
  787. let i = 1;
  788. for (let key in obj) {
  789. this.$message.error(obj[key][0].message);
  790. if (i === 1){
  791. return
  792. }
  793. i++;
  794. }
  795. }
  796. })
  797. },
  798. handleSave(){
  799. let params = {
  800. ...this.saveQuoteDetail,
  801. quoteId: this.quote.id,
  802. quoteNo:this.quote.quoteNo,
  803. site:this.quote.site,
  804. buNo:this.quote.buNo,
  805. versionNo:this.quote.versionNo,
  806. createBy:this.saveQuoteDetail.createBy,
  807. active:'Y',
  808. status:'草稿',
  809. internalInquiryNo:this.quote.insideInquiryNo,
  810. }
  811. this.saveLoading = true;
  812. saveQuoteGroupDetail(params).then(({data})=>{
  813. if (data && data.code === 0){
  814. this.$message.success(data.msg);
  815. this.handleQueryQuoteDetail();
  816. if (this.saveQuoteDetail.isDetail){
  817. this.saveQuoteDetail = {
  818. ...data.row,
  819. }
  820. }else {
  821. this.saveVisible = false;
  822. }
  823. }else {
  824. this.$message.warning(data.msg);
  825. }
  826. this.saveLoading = false
  827. }).catch((error)=>{
  828. this.$message.error(error);
  829. this.saveLoading = false
  830. })
  831. },
  832. handleUpdate(){
  833. let params = {
  834. ...this.saveQuoteDetail,
  835. updateBy:this.$store.state.user.name,
  836. }
  837. updateQuoteDetail(params).then(({data})=>{
  838. if (data && data.code === 0){
  839. this.$message.success(data.msg);
  840. this.handleQueryQuoteDetail();
  841. this.saveVisible = false;
  842. }else {
  843. this.$message.warning(data.msg);
  844. }
  845. }).catch((error)=>{
  846. this.$message.error(error);
  847. })
  848. },
  849. handleClickTab(tab){
  850. if (this.activeName === 'routing'){
  851. this.$refs.routing.handleQueryQuoteDetailBomTree()
  852. }else if (this.activeName === 'tool'){
  853. this.$refs.tool.handleQueryQuoteDetailTool();
  854. }
  855. },
  856. handleQueryPartList(){
  857. this.projectPart = {
  858. testPartNo:this.saveQuoteDetail.partNo,
  859. partDesc:'',
  860. finalPartNo:'',
  861. customerPartNo:'',
  862. site:this.$store.state.user.site,
  863. }
  864. this.partVisible = true;
  865. this.getProjectPartList();
  866. },
  867. getProjectPartList(){
  868. let params = {
  869. ...this.projectPart,
  870. partType:'Manufactured',
  871. no:this.pageNo,
  872. size:this.pageSize,
  873. }
  874. params.projectId = this.quote.projectNo
  875. this.partQueryLoading = true;
  876. getProjectPartList(params).then(({data})=>{
  877. if (data && data.code === 0){
  878. this.projectPartList = data.rows;
  879. this.pageTotal = data.total;
  880. }
  881. this.partQueryLoading = false;
  882. }).catch((error)=>{
  883. this.partQueryLoading = false;
  884. })
  885. },
  886. handleSizeChange(val){
  887. this.pageSize = val;
  888. this.getProjectPartList();
  889. },
  890. handleCurrentChange(val){
  891. this.pageNo = val;
  892. this.getProjectPartList();
  893. },
  894. dblClickProjectPartTable(row){
  895. this.saveQuoteDetail.partNo = row.testPartNo;
  896. this.saveQuoteDetail.partDesc = row.partDesc;
  897. this.partVisible = false;
  898. },
  899. handleQueryQuoteDetailByDetailId(row){
  900. this.quoteGroupDetail = {
  901. ...row
  902. }
  903. this.drawerVisible = true;
  904. },
  905. rowStyle({row}){
  906. if (row.id === this.quoteGroupDetail.id){
  907. return {background:'#E8F7F6'}
  908. }
  909. },
  910. quoteGroupDetailRowClick(row){
  911. this.quoteGroupDetail = {
  912. ...row
  913. }
  914. },
  915. handleCurrentQuoteDetailItemNo(val){
  916. updateCurrentQuoteGroupDetailItemNo(this.quoteGroupDetail).then(({data})=>{
  917. if (data && data.code === 0){
  918. // this.$message.success(data.msg);
  919. this.handleQueryQuoteDetail(true);
  920. }else {
  921. this.$message.warning(data.msg);
  922. this.quoteGroupDetail.currentQuoteDetailItemNo = val;
  923. }
  924. }).catch((error)=>{
  925. this.$message.error(error);
  926. this.quoteGroupDetail.currentQuoteDetailItemNo = val;
  927. })
  928. },
  929. handleClose(){
  930. this.drawerVisible = false;
  931. this.saveVisible = false;
  932. },
  933. toPartMenu (partNo) {
  934. if (this.$router.resolve(`/part-partInformation`).resolved.name === '404') {
  935. this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',})
  936. } else {
  937. this.$router.push({name:`part-partInformation`,params:{partNo:partNo},})
  938. }
  939. },
  940. },
  941. watch:{
  942. quote(newVal,oldVal){
  943. if (newVal.id){
  944. this.quoteDetail.profitRate = this.quote.markup
  945. this.quoteDetail.quoteProfitRate = this.quote.markup
  946. this.handleQueryQuoteDetail();
  947. }else {
  948. this.dataList = [];
  949. }
  950. },
  951. "saveQuoteDetail.partNo"(newVal,oldVal){
  952. if (newVal){
  953. this.saveQuoteDetail.partNo = newVal.toUpperCase();
  954. }
  955. },
  956. partVisible(newVal,oldVal){
  957. if (newVal === false){
  958. this.partQueryLoading = false
  959. this.pageNo = 1;
  960. this.projectPartList = [];
  961. }
  962. }
  963. }
  964. }
  965. </script>
  966. <template>
  967. <div>
  968. <template v-if="isAuth('5011:group:save')">
  969. <el-button type="primary" v-if="!authFlag" :disabled="quote.status === '下达' || !quote.status" @click="handleSaveQuoteDetail(null)">新增</el-button>
  970. </template>
  971. <el-table v-loading="queryLoading" border :data="dataList" style="width: 100%;margin-top: 5px" :height="height">
  972. <el-table-column type="index" width="55" align="center" label="序号"></el-table-column>
  973. <el-table-column
  974. v-for="(item,index) in columns" :key="index"
  975. :sortable="item.columnSortable"
  976. :prop="item.columnProp"
  977. :header-align="item.headerAlign"
  978. :show-overflow-tooltip="item.showOverflowTooltip"
  979. :align="item.align"
  980. :fixed="item.fixed === ''?false:item.fixed"
  981. :min-width="item.columnWidth"
  982. :label="item.columnLabel">
  983. <template slot-scope="scope">
  984. <template v-if="item.columnProp === 'plmPartNo'">
  985. <el-link style="cursor:pointer;" v-if="!item.columnHidden" @click="toPartMenu(scope.row.plmPartNo)"> {{ scope.row[item.columnProp] }}</el-link>
  986. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  987. </template>
  988. <template v-else>
  989. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  990. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  991. style="width: 100px; height: 80px"/></span>
  992. </template>
  993. </template>
  994. </el-table-column>
  995. <el-table-column label="操作" v-if="!authFlag" fixed="right" align="center" width="120">
  996. <template slot-scope="{row,$index}">
  997. <template v-if="isAuth('5011:group:remove')">
  998. <a type="text" v-if="row.status === '草稿'" @click="handleDeleteQuoteDetail(row)">删除</a>
  999. </template>
  1000. <template v-if="isAuth('5011:group:list')">
  1001. <a @click="handleQueryQuoteDetailByDetailId(row)">条目明细</a>
  1002. </template>
  1003. </template>
  1004. </el-table-column>
  1005. </el-table>
  1006. <el-dialog :title="`报价明细`" top="10vh" v-drag :visible.sync="saveVisible" append-to-body :width="`${saveQuoteDetail.id?1200:600}px`" :close-on-click-modal="false">
  1007. <el-form :model="saveQuoteDetail" ref="saveQuoteDetailForm" :rules="saveQuoteDetailRules" label-position="top" v-if="!saveQuoteDetail.id">
  1008. <el-row :gutter="20">
  1009. <el-col :span="8">
  1010. <el-form-item label="物料编码" prop="partNo" :show-message="false">
  1011. <span slot="label">
  1012. <a @click="handleQueryPartList">物料编码</a>
  1013. </span>
  1014. <el-input v-model="saveQuoteDetail.partNo" @change="handlePartNoBlur"></el-input>
  1015. </el-form-item>
  1016. </el-col>
  1017. <el-col :span="16">
  1018. <el-form-item label="物料名称" prop="partDesc" :show-message="false">
  1019. <el-input v-model="saveQuoteDetail.partDesc" disabled></el-input>
  1020. </el-form-item>
  1021. </el-col>
  1022. <el-col :span="8">
  1023. <el-form-item label="MOQ" prop="qty" :show-message="false">
  1024. <el-input-number style="width: 100%;" v-model="saveQuoteDetail.qty" :min="1" :step="0" :precision="0" :controls="false"></el-input-number>
  1025. </el-form-item>
  1026. </el-col>
  1027. <el-col :span="8">
  1028. <el-form-item label="币种" prop="currency1" :show-message="false">
  1029. <dict-data-select style="width: 100%" v-if="saveVisible" dict-type="plm_customer_information_customer_customer_currency" v-model="saveQuoteDetail.currency1"></dict-data-select>
  1030. </el-form-item>
  1031. </el-col>
  1032. </el-row>
  1033. <el-row :gutter="20">
  1034. <el-col :span="8">
  1035. <el-form-item label="" :show-message="false">
  1036. <el-checkbox v-model="saveQuoteDetail.isDetail">保存进入报价页面</el-checkbox>
  1037. </el-form-item>
  1038. </el-col>
  1039. <el-col :span="24">
  1040. <el-form-item label="备注" class="auto" :show-message="false">
  1041. <el-input type="textarea" v-model="saveQuoteDetail.remark" :autosize="{minRows: 3, maxRows: 3}"></el-input>
  1042. </el-form-item>
  1043. </el-col>
  1044. </el-row>
  1045. </el-form>
  1046. <el-form v-else :model="saveQuoteDetail" ref="saveQuoteDetailForm" :rules="saveQuoteDetailRules" label-position="top">
  1047. <el-row :gutter="20">
  1048. <el-col :span="4">
  1049. <el-form-item label="物料编码" prop="partNo" :show-message="false">
  1050. <el-input v-model="saveQuoteDetail.partNo" disabled></el-input>
  1051. </el-form-item>
  1052. </el-col>
  1053. <el-col :span="6">
  1054. <el-form-item label="物料名称" prop="partDesc" :show-message="false">
  1055. <el-input v-model="saveQuoteDetail.partDesc" disabled></el-input>
  1056. </el-form-item>
  1057. </el-col>
  1058. <el-col :span="3">
  1059. <el-form-item label="MOQ" prop="qty" :show-message="false">
  1060. <el-input-number v-model="saveQuoteDetail.qty" style="width: 100%;" :controls="false" :disabled="saveQuoteDetail.status === '下达'"></el-input-number>
  1061. </el-form-item>
  1062. </el-col>
  1063. <el-col :span="3">
  1064. <el-form-item label="币种" prop="currency1" :show-message="false">
  1065. <dict-data-select :disabled="saveQuoteDetail.status === '下达'" style="width: 100%" dict-type="plm_customer_information_customer_customer_currency" v-model="saveQuoteDetail.currency1"></dict-data-select>
  1066. </el-form-item>
  1067. </el-col>
  1068. </el-row>
  1069. <el-row :gutter="20">
  1070. <el-col :span="16">
  1071. <el-form-item label="备注" class="auto" :show-message="false">
  1072. <el-input type="textarea" resize="none" :autosize="{minRows: 3, maxRows: 3}" v-model="saveQuoteDetail.remark" :disabled="saveQuoteDetail.status === '下达'"></el-input>
  1073. </el-form-item>
  1074. </el-col>
  1075. </el-row>
  1076. </el-form>
  1077. <el-tabs v-model="activeName" v-if="saveQuoteDetail.id" @tab-click="handleClickTab">
  1078. <el-tab-pane label="材料" name="bom">
  1079. <quote-detail-bom v-if="saveVisible" @close="handleClose" v-model:quoteDetail="saveQuoteDetail"></quote-detail-bom>
  1080. </el-tab-pane>
  1081. <el-tab-pane label="工艺" name="routing">
  1082. <quote-detail-routing ref="routing" v-if="saveVisible" @close="handleClose" v-model:quoteDetail="saveQuoteDetail"></quote-detail-routing>
  1083. </el-tab-pane>
  1084. <el-tab-pane label="工具" name="tool">
  1085. <quote-detail-tool ref="tool" v-if="saveVisible" v-model:quoteDetail="saveQuoteDetail"></quote-detail-tool>
  1086. </el-tab-pane>
  1087. <el-tab-pane label="测试" name="test">
  1088. <quote-detail-test v-if="saveVisible" v-model:quoteDetail="saveQuoteDetail"></quote-detail-test>
  1089. </el-tab-pane>
  1090. <el-tab-pane label="包装&运输" name="otherCost">
  1091. <quote-detail-other-cost v-if="saveVisible" v-model:quoteDetail="saveQuoteDetail"></quote-detail-other-cost>
  1092. </el-tab-pane>
  1093. <el-tab-pane label="其他" name="other">
  1094. <quote-detail-other v-if="saveVisible" v-model:quoteDetail="saveQuoteDetail"></quote-detail-other>
  1095. </el-tab-pane>
  1096. <el-tab-pane label="成本&价格" name="cost">
  1097. <quote-detail-cost v-if="saveVisible" ref="cost" v-model:quoteDetail="saveQuoteDetail"></quote-detail-cost>
  1098. </el-tab-pane>
  1099. </el-tabs>
  1100. <div slot="footer" class="dialog-footer">
  1101. <el-button type="primary" v-if="saveQuoteDetail.status === '草稿'" :loading="saveLoading" @click="handleSaveQuoteDetailClick"> </el-button>
  1102. <el-button @click="saveVisible = false"> </el-button>
  1103. </div>
  1104. </el-dialog>
  1105. <el-dialog v-drag title="物料信息" append-to-body :close-on-click-modal="false" :visible.sync="partVisible">
  1106. <!--搜索条件-->
  1107. <el-form :model="projectPart" ref="projectPartDataForm" :inline="true" label-position="top">
  1108. <el-form-item label="物料编码" prop="testPartNo">
  1109. <el-input v-model="projectPart.testPartNo" clearable/>
  1110. </el-form-item>
  1111. <el-form-item label="物料名称" prop="partDesc">
  1112. <el-input v-model="projectPart.partDesc" clearable/>
  1113. </el-form-item>
  1114. <el-form-item label="IFS物料编码" prop="finalPartNo">
  1115. <el-input v-model="projectPart.finalPartNo" clearable/>
  1116. </el-form-item>
  1117. <el-form-item label="客户物料编码" prop="customerPartNo">
  1118. <el-input v-model="projectPart.customerPartNo" clearable/>
  1119. </el-form-item>
  1120. <el-form-item label=" ">
  1121. <el-button @click="getProjectPartList" type="primary"> </el-button>
  1122. </el-form-item>
  1123. </el-form>
  1124. <el-table height="300px" v-loading="partQueryLoading" stripe border @row-dblclick="dblClickProjectPartTable" :data="projectPartList" ref="projectPartDataTable" :style="{marginTop:'10px'}">
  1125. <el-table-column
  1126. v-for="(item,index) in projectPartColumns" :key="index"
  1127. :sortable="item.columnSortable"
  1128. :prop="item.columnProp"
  1129. :header-align="item.headerAlign"
  1130. :show-overflow-tooltip="item.showOverflowTooltip"
  1131. :align="item.align"
  1132. :fixed="item.fixed===''?false:item.fixed"
  1133. :min-width="item.columnWidth"
  1134. :label="item.columnLabel">
  1135. <template slot-scope="scope">
  1136. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  1137. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  1138. </template>
  1139. </el-table-column>
  1140. </el-table>
  1141. <el-pagination style="margin-top: 0"
  1142. @size-change="handleSizeChange"
  1143. @current-change="handleCurrentChange"
  1144. :current-page="pageNo"
  1145. :page-sizes="[20, 50, 100, 200, 500]"
  1146. :page-size="pageSize"
  1147. :total="pageTotal"
  1148. layout="total,sizes, prev, pager, next, jumper">
  1149. </el-pagination>
  1150. </el-dialog>
  1151. <el-dialog title="报价明细" v-drag :visible.sync="drawerVisible" top="10vh" width="1200px" append-to-body :close-on-click-modal="false">
  1152. <el-table v-loading="queryLoading"
  1153. @row-click="quoteGroupDetailRowClick" :row-style="rowStyle" border :data="dataList" style="width: 100%;margin-top: 5px;" :height="'30vh'">
  1154. <el-table-column type="index" width="55" align="center" label="序号"></el-table-column>
  1155. <el-table-column
  1156. v-for="(item,index) in columns" :key="index"
  1157. :sortable="item.columnSortable"
  1158. :prop="item.columnProp"
  1159. :header-align="item.headerAlign"
  1160. :show-overflow-tooltip="item.showOverflowTooltip"
  1161. :align="item.align"
  1162. :fixed="item.fixed === ''?false:item.fixed"
  1163. :min-width="item.columnWidth"
  1164. :label="item.columnLabel">
  1165. <template slot-scope="scope">
  1166. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  1167. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  1168. style="width: 100px; height: 80px"/></span>
  1169. </template>
  1170. </el-table-column>
  1171. </el-table>
  1172. <quote-detail
  1173. v-if="drawerVisible"
  1174. style="margin-top: 20px"
  1175. :save-auth="isAuth('5011:detail:save')"
  1176. @close="handleClose"
  1177. :quote="quote"
  1178. :quote-group-detail="quoteGroupDetail"
  1179. :auth-flag="false"
  1180. :height="'33vh'"
  1181. @currentQuoteDetailItemNo="handleCurrentQuoteDetailItemNo">
  1182. </quote-detail>
  1183. <div slot="footer" class="dialog-footer">
  1184. <el-button @click="drawerVisible = false"> </el-button>
  1185. </div>
  1186. </el-dialog>
  1187. <!-- <part-table v-if="saveVisible" v-model="partVisible" :is-page="true" :part-no="saveQuoteDetail.partNo" @dblclick="handleDblClick"></part-table>-->
  1188. <!-- <project-part-table v-if="saveVisible" v-model="partVisible" :project-no="saveQuoteDetail.projectNo" :part-no="saveQuoteDetail.partNo" @dblclick="handleDblClick"></project-part-table>-->
  1189. </div>
  1190. </template>
  1191. <style scoped>
  1192. .el-table /deep/ .cell{
  1193. height: auto;
  1194. line-height: 1.5;
  1195. }
  1196. .auto /deep/ .el-form-item__content{
  1197. height: auto;
  1198. line-height: 1.5;
  1199. }
  1200. </style>