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.

1571 lines
53 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 month 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
12 months ago
1 year ago
12 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 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
12 months ago
1 year ago
12 months ago
1 year ago
1 year ago
12 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
5 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
5 months ago
1 year ago
1 year ago
1 year ago
5 months ago
1 year ago
5 months ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
12 months ago
1 year ago
1 year ago
1 month 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
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 month ago
1 year ago
1 month ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
9 months ago
12 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 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
12 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 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
12 months ago
1 year ago
1 year ago
1 year ago
  1. <script>
  2. import {
  3. againQuoteDetail,
  4. deleteQuoteDetail,
  5. queryQuoteDetail,
  6. saveQuoteDetail,
  7. updateQuoteDetail,
  8. updateQuoteDetailEntry,
  9. updateQuoteDetailShowFlag
  10. } from "../../../../api/quote/quoteDetail";
  11. import {queryQuoteGroupDetail} from "../../../../api/quote/quoteGroupDetail";
  12. import {getProjectPartList} from "../../../../api/project/project";
  13. import QuoteDetailCost from "./primary/quoteDetailCost.vue";
  14. import QuoteDetailTool from "./primary/quoteDetailTool.vue";
  15. import QuoteDetailBom from "./primary/quoteDetailBom.vue";
  16. import QuoteDetailRouting from "./primary/quoteDetailRouting.vue";
  17. import QuoteDetailOtherCost from "./primary/quoteDetailOtherCost.vue";
  18. import DictDataSelect from "../../sys/dict-data-select.vue";
  19. import QuoteDetailTest from "./primary/quoteDetailTest.vue";
  20. import QuoteDetailOther from "./primary/quoteDetailOther.vue";
  21. export default {
  22. name: "quoteDetail",
  23. components: {
  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. quoteGroupDetail:{
  47. type:Object,
  48. },
  49. saveAuth:{
  50. type:Boolean,
  51. default:true
  52. },
  53. isExport:{
  54. type:Boolean,
  55. default:false
  56. },
  57. },
  58. data(){
  59. return{
  60. exportLoading: false,
  61. quoteDetail:{
  62. id:null,
  63. partNo:'',
  64. partDesc:'',
  65. projectNo:'',
  66. projectDesc:'',
  67. buNo: '*',
  68. qty:null,
  69. quoteCount:1,
  70. partCost:0,
  71. adjustPartCost:0,
  72. labourCost:0,
  73. adjustLabourCost:0,
  74. fabricateCost:0,
  75. adjustFabricateCost:0,
  76. toolCost:0,
  77. adjustToolCost:0,
  78. machineCost:0,
  79. adjustMachineCost:0,
  80. otherCost:0,
  81. manageCost:0,
  82. totalCost:0,
  83. profitRate:0,
  84. profitAmount:0,
  85. totalPrice:0,
  86. unitPrice:0,
  87. taxRate:13,
  88. taxTotalPrice:0,
  89. taxUnitPrice:0,
  90. quoteTotalCost:0,
  91. quoteProfitRate:0,
  92. quoteProfitAmount:0,
  93. quoteTotalPrice:0,
  94. quoteUnitPrice:0,
  95. quoteTaxRate:0,
  96. quoteTaxTotalPrice:0,
  97. quoteTaxUnitPrice:0,
  98. currency1:undefined,
  99. finalTransactionPrice:null,
  100. currency2:undefined,
  101. exchangeRate1:undefined,
  102. exchangeRate2:undefined,
  103. currencyTotalCost1:0,
  104. currencyTotalCost2:0,
  105. quoteCurrencyTotalCost1:0,
  106. quoteCurrencyTotalCost2:0,
  107. // moq:'Standard 250K',
  108. moq:'',
  109. calculatedItems:'工具,测试,其他,包装,运输',
  110. testCost:0,
  111. adjustTestCost:0,
  112. elseCost:0,
  113. adjustElseCost:0,
  114. remark:'',
  115. showFlag:'N',
  116. },
  117. saveQuoteDetail:{
  118. },
  119. dataEntryVisible: false,
  120. dataEntryLoading: false,
  121. dataEntryForm: {
  122. finalTransactionPrice: null,
  123. remark: ''
  124. },
  125. dataList:[],
  126. saveLoading:false,
  127. queryLoading:false,
  128. saveVisible:false,
  129. showModalFlag:false,
  130. showFlagChecked:false,
  131. saveQuoteDetailRules:{
  132. partNo: [{required: true, message: '请输入物料编码', trigger: ['blur','change']}],
  133. partDesc: [{required: true, message: '请输入物料名称', trigger: ['blur','change']}],
  134. qty: [{required: true, message: '请输入数量', trigger: ['blur','change']}],
  135. currency1: [{required: true, message: '请选择币种', trigger: ['blur','change']}],
  136. },
  137. columns: [
  138. {
  139. userId: this.$store.state.user.name,
  140. functionId: 5011,
  141. serialNumber: '5011Table2PartNo',
  142. tableId: '5011Table2',
  143. tableName: '报价详情信息表',
  144. columnProp: 'plmPartNo',
  145. headerAlign: 'center',
  146. align: 'left',
  147. columnLabel: 'PLM物料编码',
  148. columnHidden: false,
  149. columnImage: false,
  150. columnSortable: false,
  151. sortLv: 0,
  152. status: true,
  153. fixed: '',
  154. columnWidth: 120
  155. },
  156. {
  157. userId: this.$store.state.user.name,
  158. functionId: 5011,
  159. serialNumber: '5011Table2PartNo',
  160. tableId: '5011Table2',
  161. tableName: '报价详情信息表',
  162. columnProp: 'ifsPartNo',
  163. headerAlign: 'center',
  164. align: 'left',
  165. columnLabel: 'IFS物料编码',
  166. columnHidden: false,
  167. columnImage: false,
  168. columnSortable: false,
  169. sortLv: 0,
  170. status: true,
  171. fixed: '',
  172. columnWidth: 120
  173. },
  174. {
  175. userId: this.$store.state.user.name,
  176. functionId: 5011,
  177. serialNumber: '5011Table2PartDesc',
  178. tableId: '5011Table2',
  179. tableName: '报价详情信息表',
  180. columnProp: 'partDesc',
  181. headerAlign: 'center',
  182. align: 'left',
  183. columnLabel: '物料名称',
  184. columnHidden: false,
  185. columnImage: false,
  186. columnSortable: false,
  187. sortLv: 0,
  188. status: true,
  189. fixed: '',
  190. columnWidth: 240
  191. },
  192. {
  193. userId: this.$store.state.user.name,
  194. functionId: 5011,
  195. serialNumber: '5011Table2QuoteTaxRate',
  196. tableId: '5011Table2',
  197. tableName: '报价详情信息表',
  198. columnProp: 'customerPartNo',
  199. headerAlign: 'center',
  200. align: 'right',
  201. columnLabel: '客户物料编码',
  202. columnHidden: false,
  203. columnImage: false,
  204. columnSortable: false,
  205. sortLv: 0,
  206. status: true,
  207. fixed: '',
  208. columnWidth: 90
  209. },
  210. {
  211. userId: this.$store.state.user.name,
  212. functionId: 5011,
  213. serialNumber: '5011Table2Qty',
  214. tableId: '5011Table2',
  215. tableName: '报价详情信息表',
  216. columnProp: 'qty',
  217. headerAlign: 'center',
  218. align: 'right',
  219. columnLabel: 'MOQ',
  220. columnHidden: false,
  221. columnImage: false,
  222. columnSortable: false,
  223. sortLv: 0,
  224. status: true,
  225. fixed: '',
  226. columnWidth: 100
  227. },
  228. {
  229. userId: this.$store.state.user.name,
  230. functionId: 5011,
  231. serialNumber: '5011Table2QuoteProfitRate',
  232. tableId: '5011Table2',
  233. tableName: '报价详情信息表',
  234. columnProp: 'quoteProfitRate',
  235. headerAlign: 'center',
  236. align: 'right',
  237. columnLabel: 'VA%',
  238. columnHidden: false,
  239. columnImage: false,
  240. columnSortable: false,
  241. sortLv: 0,
  242. status: true,
  243. fixed: '',
  244. columnWidth: 60
  245. },
  246. // {
  247. // userId: this.$store.state.user.name,
  248. // functionId: 5011,
  249. // serialNumber: '5011Table2QuoteTaxRate',
  250. // tableId: '5011Table2',
  251. // tableName: '报价详情信息表',
  252. // columnProp: 'quoteTaxRate',
  253. // headerAlign: 'center',
  254. // align: 'right',
  255. // columnLabel: 'Margin%',
  256. // columnHidden: false,
  257. // columnImage: false,
  258. // columnSortable: false,
  259. // sortLv: 0,
  260. // status: true,
  261. // fixed: '',
  262. // columnWidth: 60
  263. // },
  264. {
  265. userId: this.$store.state.user.name,
  266. functionId: 5011,
  267. serialNumber: '5011Table2QuoteProfitAmount',
  268. tableId: '5011Table2',
  269. tableName: '报价详情信息表',
  270. columnProp: 'quoteProfitAmount',
  271. headerAlign: 'center',
  272. align: 'right',
  273. columnLabel: 'Contribution%',
  274. columnHidden: false,
  275. columnImage: false,
  276. columnSortable: false,
  277. sortLv: 0,
  278. status: true,
  279. fixed: '',
  280. columnWidth: 100
  281. },
  282. {
  283. userId: this.$store.state.user.name,
  284. functionId: 5011,
  285. serialNumber: '5011Table2Qty',
  286. tableId: '5011Table2',
  287. tableName: '报价详情信息表',
  288. columnProp: 'currencyDesc2',
  289. headerAlign: 'center',
  290. align: 'right',
  291. columnLabel: '币种',
  292. columnHidden: false,
  293. columnImage: false,
  294. columnSortable: false,
  295. sortLv: 0,
  296. status: true,
  297. fixed: '',
  298. columnWidth: 100
  299. },
  300. {
  301. userId: this.$store.state.user.name,
  302. functionId: 5011,
  303. serialNumber: '5011Table2Qty',
  304. tableId: '5011Table2',
  305. tableName: '报价详情信息表',
  306. columnProp: 'currencyTotalCost2',
  307. headerAlign: 'center',
  308. align: 'right',
  309. columnLabel: '含税单价',
  310. columnHidden: false,
  311. columnImage: false,
  312. columnSortable: false,
  313. sortLv: 0,
  314. status: true,
  315. fixed: '',
  316. columnWidth: 100
  317. },
  318. {
  319. userId: this.$store.state.user.name,
  320. functionId: 5011,
  321. serialNumber: '5011Table2Qty',
  322. tableId: '5011Table2',
  323. tableName: '报价详情信息表',
  324. columnProp: 'unitPriceRate',
  325. headerAlign: 'center',
  326. align: 'right',
  327. columnLabel: '未税单价',
  328. columnHidden: false,
  329. columnImage: false,
  330. columnSortable: false,
  331. sortLv: 0,
  332. status: true,
  333. fixed: '',
  334. columnWidth: 100
  335. },
  336. {
  337. userId: this.$store.state.user.name,
  338. functionId: 5011,
  339. serialNumber: '5011Table2Remark',
  340. tableId: '5011Table2',
  341. tableName: '报价详情信息表',
  342. columnProp: 'remark',
  343. headerAlign: 'center',
  344. align: 'left',
  345. columnLabel: '备注',
  346. columnHidden: false,
  347. columnImage: false,
  348. columnSortable: false,
  349. sortLv: 0,
  350. status: true,
  351. fixed: '',
  352. columnWidth: 120
  353. },
  354. {
  355. userId: this.$store.state.user.name,
  356. functionId: 5011,
  357. serialNumber: '5011Table2AdjustPartCost',
  358. tableId: '5011Table2',
  359. tableName: '报价详情信息表',
  360. columnProp: 'adjustPartCost',
  361. headerAlign: 'center',
  362. align: 'right',
  363. columnLabel: '材料成本',
  364. columnHidden: false,
  365. columnImage: false,
  366. columnSortable: false,
  367. sortLv: 0,
  368. status: true,
  369. fixed: '',
  370. columnWidth: 130
  371. },
  372. {
  373. userId: this.$store.state.user.name,
  374. functionId: 5011,
  375. serialNumber: '5011Table2AdjustLabourCost',
  376. tableId: '5011Table2',
  377. tableName: '报价详情信息表',
  378. columnProp: 'adjustLabourCost',
  379. headerAlign: 'center',
  380. align: 'right',
  381. columnLabel: '人工成本',
  382. columnHidden: false,
  383. columnImage: false,
  384. columnSortable: false,
  385. sortLv: 0,
  386. status: true,
  387. fixed: '',
  388. columnWidth: 120
  389. },
  390. // {
  391. // userId: this.$store.state.user.name,
  392. // functionId: 5011,
  393. // serialNumber: '5011Table2AdjustMachineCost',
  394. // tableId: '5011Table2',
  395. // tableName: '报价详情信息表',
  396. // columnProp: 'adjustMachineCost',
  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. {
  409. userId: this.$store.state.user.name,
  410. functionId: 5011,
  411. serialNumber: '5011Table2AdjustToolCost',
  412. tableId: '5011Table2',
  413. tableName: '报价详情信息表',
  414. columnProp: 'adjustToolCost',
  415. headerAlign: 'center',
  416. align: 'right',
  417. columnLabel: '工具成本',
  418. columnHidden: false,
  419. columnImage: false,
  420. columnSortable: false,
  421. sortLv: 0,
  422. status: true,
  423. fixed: '',
  424. columnWidth: 120
  425. },
  426. {
  427. userId: this.$store.state.user.name,
  428. functionId: 5011,
  429. serialNumber: '5011Table2AdjustTestCost',
  430. tableId: '5011Table2',
  431. tableName: '报价详情信息表',
  432. columnProp: 'adjustTestCost',
  433. headerAlign: 'center',
  434. align: 'right',
  435. columnLabel: '测试成本',
  436. columnHidden: false,
  437. columnImage: false,
  438. columnSortable: false,
  439. sortLv: 0,
  440. status: true,
  441. fixed: '',
  442. columnWidth: 120
  443. },
  444. {
  445. userId: this.$store.state.user.name,
  446. functionId: 5011,
  447. serialNumber: '5011Table2PackCost',
  448. tableId: '5011Table2',
  449. tableName: '报价详情信息表',
  450. columnProp: 'packCost',
  451. headerAlign: 'center',
  452. align: 'right',
  453. columnLabel: '包装成本',
  454. columnHidden: false,
  455. columnImage: false,
  456. columnSortable: false,
  457. sortLv: 0,
  458. status: true,
  459. fixed: '',
  460. columnWidth: 120
  461. },
  462. {
  463. userId: this.$store.state.user.name,
  464. functionId: 5011,
  465. serialNumber: '5011Table2ShippingCost',
  466. tableId: '5011Table2',
  467. tableName: '报价详情信息表',
  468. columnProp: 'shippingCost',
  469. headerAlign: 'center',
  470. align: 'right',
  471. columnLabel: '运输成本',
  472. columnHidden: false,
  473. columnImage: false,
  474. columnSortable: false,
  475. sortLv: 0,
  476. status: true,
  477. fixed: '',
  478. columnWidth: 120
  479. },
  480. {
  481. userId: this.$store.state.user.name,
  482. functionId: 5011,
  483. serialNumber: '5011Table2AdjustElseCost',
  484. tableId: '5011Table2',
  485. tableName: '报价详情信息表',
  486. columnProp: 'adjustElseCost',
  487. headerAlign: 'center',
  488. align: 'right',
  489. columnLabel: '其他成本',
  490. columnHidden: false,
  491. columnImage: false,
  492. columnSortable: false,
  493. sortLv: 0,
  494. status: true,
  495. fixed: '',
  496. columnWidth: 120
  497. },
  498. {
  499. userId: this.$store.state.user.name,
  500. functionId: 5011,
  501. serialNumber: '5011Table2TotalCost',
  502. tableId: '5011Table2',
  503. tableName: '报价详情信息表',
  504. columnProp: 'totalCost',
  505. headerAlign: 'center',
  506. align: 'right',
  507. columnLabel: '总成本',
  508. columnHidden: false,
  509. columnImage: false,
  510. columnSortable: false,
  511. sortLv: 0,
  512. status: true,
  513. fixed: '',
  514. columnWidth: 80
  515. },
  516. {
  517. userId: this.$store.state.user.name,
  518. functionId: 5011,
  519. serialNumber: '5011Table2FinalTransactionPrice',
  520. tableId: '5011Table2',
  521. tableName: '报价详情信息表',
  522. columnProp: 'finalTransactionPrice',
  523. headerAlign: 'center',
  524. align: 'right',
  525. columnLabel: '最终交易价',
  526. columnHidden: false,
  527. columnImage: false,
  528. columnSortable: false,
  529. sortLv: 0,
  530. status: true,
  531. fixed: '',
  532. columnWidth: 80
  533. },
  534. {
  535. userId: this.$store.state.user.name,
  536. functionId: 5011,
  537. serialNumber: '5011Table2QuoteTaxTotalPrice',
  538. tableId: '5011Table2',
  539. tableName: '报价详情信息表',
  540. columnProp: 'quoteTaxTotalPrice',
  541. headerAlign: 'center',
  542. align: 'right',
  543. columnLabel: 'Price ¥(ex VAT)',
  544. columnHidden: false,
  545. columnImage: false,
  546. columnSortable: false,
  547. sortLv: 0,
  548. status: true,
  549. fixed: '',
  550. columnWidth: 100
  551. },
  552. {
  553. userId: this.$store.state.user.name,
  554. functionId: 5011,
  555. serialNumber: '5011Table2Qty',
  556. tableId: '5011Table2',
  557. tableName: '报价详情信息表',
  558. columnProp: 'unitPrice',
  559. headerAlign: 'center',
  560. align: 'right',
  561. columnLabel: '未税单价',
  562. columnHidden: false,
  563. columnImage: false,
  564. columnSortable: false,
  565. sortLv: 0,
  566. status: true,
  567. fixed: '',
  568. columnWidth: 100
  569. },
  570. {
  571. userId: this.$store.state.user.name,
  572. functionId: 5011,
  573. serialNumber: '5011Table2Qty',
  574. tableId: '5011Table2',
  575. tableName: '报价详情信息表',
  576. columnProp: 'taxRate',
  577. headerAlign: 'center',
  578. align: 'right',
  579. columnLabel: '税率',
  580. columnHidden: false,
  581. columnImage: false,
  582. columnSortable: false,
  583. sortLv: 0,
  584. status: true,
  585. fixed: '',
  586. columnWidth: 100
  587. },
  588. {
  589. userId: this.$store.state.user.name,
  590. functionId: 5011,
  591. serialNumber: '5011Table2Qty',
  592. tableId: '5011Table2',
  593. tableName: '报价详情信息表',
  594. columnProp: 'exchangeRate1',
  595. headerAlign: 'center',
  596. align: 'right',
  597. columnLabel: '其他税率',
  598. columnHidden: false,
  599. columnImage: false,
  600. columnSortable: false,
  601. sortLv: 0,
  602. status: true,
  603. fixed: '',
  604. columnWidth: 100
  605. },
  606. {
  607. userId: this.$store.state.user.name,
  608. functionId: 5011,
  609. serialNumber: '5011Table2Qty',
  610. tableId: '5011Table2',
  611. tableName: '报价详情信息表',
  612. columnProp: 'taxUnitPrice',
  613. headerAlign: 'center',
  614. align: 'right',
  615. columnLabel: '含税单价(CNY)',
  616. columnHidden: false,
  617. columnImage: false,
  618. columnSortable: false,
  619. sortLv: 0,
  620. status: true,
  621. fixed: '',
  622. columnWidth: 100
  623. },
  624. {
  625. userId: this.$store.state.user.name,
  626. functionId: 5011,
  627. serialNumber: '5011Table2Qty',
  628. tableId: '5011Table2',
  629. tableName: '报价详情信息表',
  630. columnProp: 'exchangeRate2',
  631. headerAlign: 'center',
  632. align: 'right',
  633. columnLabel: '汇率',
  634. columnHidden: false,
  635. columnImage: false,
  636. columnSortable: false,
  637. sortLv: 0,
  638. status: true,
  639. fixed: '',
  640. columnWidth: 100
  641. },
  642. {
  643. userId: this.$store.state.user.name,
  644. functionId: 5011,
  645. serialNumber: '5011Table2Qty',
  646. tableId: '5011Table2',
  647. tableName: '报价详情信息表',
  648. columnProp: 'unitPrice',
  649. headerAlign: 'center',
  650. align: 'right',
  651. columnLabel: '未税单价(CNY)',
  652. columnHidden: false,
  653. columnImage: false,
  654. columnSortable: false,
  655. sortLv: 0,
  656. status: true,
  657. fixed: '',
  658. columnWidth: 100
  659. },
  660. ],
  661. partVisible:false,
  662. activeName:'bom',
  663. projectPart:{
  664. },
  665. projectPartList:[],
  666. pageNo:1,
  667. pageSize:20,
  668. pageTotal:0,
  669. partQueryLoading:false,
  670. projectPartColumns:[
  671. {
  672. userId: this.$store.state.user.name,
  673. functionId: 5011,
  674. serialNumber: '5011Table3TestPartNo',
  675. tableId: '5011Table3',
  676. tableName: '项目物料表',
  677. columnProp: 'testPartNo',
  678. headerAlign: 'center',
  679. align: 'left',
  680. columnLabel: '物料编码',
  681. columnHidden: false,
  682. columnImage: false,
  683. columnSortable: false,
  684. sortLv: 0,
  685. status: true,
  686. fixed: '',
  687. columnWidth: 150
  688. },
  689. {
  690. userId: this.$store.state.user.name,
  691. functionId: 5011,
  692. serialNumber: '5011Table3PartDesc',
  693. tableId: '5011Table3',
  694. tableName: '项目物料表',
  695. columnProp: 'partDesc',
  696. headerAlign: 'center',
  697. align: 'left',
  698. columnLabel: '物料名称',
  699. columnHidden: false,
  700. columnImage: false,
  701. columnSortable: false,
  702. sortLv: 0,
  703. status: true,
  704. fixed: '',
  705. columnWidth: 160
  706. },
  707. {
  708. userId: this.$store.state.user.name,
  709. functionId: 5011,
  710. serialNumber: '5011Table3FinalPartNo',
  711. tableId: '5011Table3',
  712. tableName: '项目物料表',
  713. columnProp: 'finalPartNo',
  714. headerAlign: 'center',
  715. align: 'left',
  716. columnLabel: 'IFS物料编码',
  717. columnHidden: false,
  718. columnImage: false,
  719. columnSortable: false,
  720. sortLv: 0,
  721. status: true,
  722. fixed: '',
  723. columnWidth: 150
  724. },
  725. {
  726. userId: this.$store.state.user.name,
  727. functionId: 5011,
  728. serialNumber: '5011Table3CustomerPartNo',
  729. tableId: '5011Table3',
  730. tableName: '项目物料表',
  731. columnProp: 'customerPartNo',
  732. headerAlign: 'center',
  733. align: 'left',
  734. columnLabel: '客户物料编码',
  735. columnHidden: false,
  736. columnImage: false,
  737. columnSortable: false,
  738. sortLv: 0,
  739. status: true,
  740. fixed: '',
  741. columnWidth: 150
  742. },
  743. {
  744. userId: this.$store.state.user.name,
  745. functionId: 5011,
  746. serialNumber: '5011Table3Type',
  747. tableId: '5011Table3',
  748. tableName: '项目物料表',
  749. columnProp: 'type',
  750. headerAlign: 'center',
  751. align: 'left',
  752. columnLabel: '制造类型',
  753. columnHidden: false,
  754. columnImage: false,
  755. columnSortable: false,
  756. sortLv: 0,
  757. status: true,
  758. fixed: '',
  759. columnWidth: 120
  760. },
  761. {
  762. userId: this.$store.state.user.name,
  763. functionId: 5011,
  764. serialNumber: '5011Table3UmId',
  765. tableId: '5011Table3',
  766. tableName: '项目物料表',
  767. columnProp: 'umId',
  768. headerAlign: 'center',
  769. align: 'left',
  770. columnLabel: '单位',
  771. columnHidden: false,
  772. columnImage: false,
  773. columnSortable: false,
  774. sortLv: 0,
  775. status: true,
  776. fixed: '',
  777. columnWidth: 100
  778. },
  779. ],
  780. exportData:[],
  781. exportName: '报价条目明细'+this.dayjs().format('YYYYMMDDHHmmss'),
  782. exportHeader: ["报价条目明细"],
  783. exportFooter: [],
  784. againVisible:false,
  785. againRow:{},
  786. // 平铺视图(不传 quoteGroupDetail 时)内部维护的 quoteGroupDetailId → currentQuoteDetailItemNo 映射
  787. internalDefaultItemNoMap: {},
  788. }
  789. },
  790. methods:{
  791. handleSaveQuoteDetail(row){
  792. this.$nextTick(()=>{
  793. if (this.$refs.handleSaveQuoteDetailClick){
  794. this.$refs.saveQuoteDetailForm.clearValidate();
  795. }
  796. })
  797. if (row){
  798. this.saveQuoteDetail = {
  799. ...row
  800. }
  801. // 设置勾选状态
  802. this.showFlagChecked = row.showFlag === 'Y'
  803. }else {
  804. this.saveQuoteDetail = {
  805. ...this.quoteDetail,
  806. createBy:this.$store.state.user.name,
  807. status:'草稿',
  808. active:'Y',
  809. qty:1,
  810. isDetail:false,
  811. }
  812. if (this.quoteGroupDetail){
  813. this.saveQuoteDetail.partNo = this.quoteGroupDetail.partNo
  814. this.saveQuoteDetail.partDesc = this.quoteGroupDetail.partDesc
  815. }
  816. this.$nextTick(()=>{
  817. this.saveQuoteDetail.projectNo = this.quote.projectNo
  818. })
  819. // 新建时默认不勾选
  820. this.showFlagChecked = false
  821. }
  822. this.saveQuoteDetail.showModalFlag = false
  823. this.activeName = 'bom';
  824. this.saveVisible = true;
  825. this.showModalFlag = false;
  826. },
  827. handleDetail(row){
  828. this.saveQuoteDetail = {
  829. ...row
  830. }
  831. this.saveQuoteDetail.showModalFlag = true
  832. // 设置勾选状态
  833. this.showFlagChecked = row.showFlag === 'Y'
  834. this.activeName = 'bom';
  835. this.saveVisible = true;
  836. this.showModalFlag = true;
  837. },
  838. handleDataEntry() {
  839. this.dataEntryForm = {
  840. finalTransactionPrice: this.saveQuoteDetail.finalTransactionPrice,
  841. remark: this.saveQuoteDetail.remark || ''
  842. }
  843. this.dataEntryVisible = true
  844. },
  845. submitDataEntry() {
  846. this.dataEntryLoading = true
  847. const params = {
  848. id: this.saveQuoteDetail.id,
  849. finalTransactionPrice: this.dataEntryForm.finalTransactionPrice,
  850. remark: this.dataEntryForm.remark,
  851. updateBy: this.$store.state.user.name
  852. }
  853. updateQuoteDetailEntry(params).then(({data}) => {
  854. if (data && data.code === 0) {
  855. this.$message.success('操作成功')
  856. this.saveQuoteDetail.finalTransactionPrice = params.finalTransactionPrice
  857. this.saveQuoteDetail.remark = params.remark
  858. this.dataEntryVisible = false
  859. this.handleQueryQuoteDetail()
  860. } else {
  861. this.$message.error(data.msg)
  862. }
  863. }).finally(() => {
  864. this.dataEntryLoading = false
  865. })
  866. },
  867. handleShowFlagChange(val){
  868. // 勾选变化时直接更新数据库,只修改show_flag字段
  869. if (!this.saveQuoteDetail.id) {
  870. return
  871. }
  872. const newShowFlag = val ? 'Y' : 'N'
  873. const params = {
  874. id: this.saveQuoteDetail.id,
  875. showFlag: newShowFlag
  876. }
  877. updateQuoteDetailShowFlag(params).then(({data}) => {
  878. if (data && data.code === 0) {
  879. this.saveQuoteDetail.showFlag = newShowFlag
  880. this.$message.success('更新成功')
  881. // 刷新列表
  882. this.handleQueryQuoteDetail()
  883. } else {
  884. this.$message.warning(data.msg)
  885. // 恢复勾选状态
  886. this.showFlagChecked = !val
  887. }
  888. }).catch((error) => {
  889. this.$message.error(error)
  890. // 恢复勾选状态
  891. this.showFlagChecked = !val
  892. })
  893. },
  894. handleDeleteQuoteDetail(row){
  895. this.$confirm('确认删除该条报价明细吗?', '提示', {
  896. confirmButtonText: '确定',
  897. cancelButtonText: '取消',
  898. type: 'warning'
  899. }).then(() => {
  900. let params = {
  901. id: row.id,
  902. }
  903. deleteQuoteDetail(params).then(({data}) => {
  904. if (data && data.code === 0) {
  905. this.$message.success(data.msg);
  906. this.handleQueryQuoteDetail();
  907. // 通知父组件刷新主信息
  908. console.log('emit refresh-quote-info event (delete), quoteId:', this.quote.id)
  909. this.$emit('refresh-quote-info', this.quote.id)
  910. } else {
  911. this.$message.warning(data.msg);
  912. }
  913. }).catch((error) => {
  914. this.$message.error(error);
  915. })
  916. }).catch(() => {
  917. })
  918. },
  919. handlePartNoBlur(){
  920. let params = {
  921. site:this.$store.state.user.site,
  922. testPartNo:this.saveQuoteDetail.partNo,
  923. projectId: this.quote.projectNo,
  924. no:1,
  925. size:20,
  926. }
  927. getProjectPartList(params).then(({data})=>{
  928. if (data && data.code === 0){
  929. if (data.rows && data.rows.length === 1){
  930. this.dblClickProjectPartTable(data.rows[0])
  931. }else {
  932. this.saveQuoteDetail.partDesc = ''
  933. }
  934. }
  935. })
  936. },
  937. handleQueryQuoteDetail(){
  938. let params = {
  939. quoteId: this.quote.id,
  940. }
  941. if (this.quoteGroupDetail){
  942. params.quoteGroupDetailId=this.quoteGroupDetail.id;
  943. } else {
  944. // 平铺模式:同步加载各报价明细组的默认条目映射,用于删除保护
  945. this.loadGroupDetailMap();
  946. }
  947. this.queryLoading = true;
  948. queryQuoteDetail(params).then(({data})=>{
  949. if (data && data.code === 0){
  950. this.dataList = data.rows
  951. }else {
  952. this.$message.warning(data.msg);
  953. }
  954. this.queryLoading = false;
  955. }).catch((error)=>{
  956. this.$message.error(error);
  957. this.queryLoading = false;
  958. })
  959. },
  960. // 平铺模式下加载 quoteGroupDetail 映射,用于判断哪些条目行是默认报价行(不允许删除)
  961. loadGroupDetailMap() {
  962. if (!this.quote.id) {
  963. this.internalDefaultItemNoMap = {}
  964. return
  965. }
  966. queryQuoteGroupDetail({ quoteId: this.quote.id }).then(({ data }) => {
  967. if (data && data.code === 0 && data.rows) {
  968. const map = {}
  969. data.rows.forEach(group => {
  970. if (group.currentQuoteDetailItemNo) {
  971. map[group.id] = group.currentQuoteDetailItemNo
  972. }
  973. })
  974. this.internalDefaultItemNoMap = map
  975. } else {
  976. this.internalDefaultItemNoMap = {}
  977. }
  978. }).catch(() => {
  979. this.internalDefaultItemNoMap = {}
  980. })
  981. },
  982. handleSaveQuoteDetailClick(){
  983. this.$refs.saveQuoteDetailForm.validate((valid,obj) => {
  984. if (valid){
  985. if (this.saveQuoteDetail.id){
  986. this.handleUpdate();
  987. }else {
  988. this.handleSave();
  989. }
  990. }else {
  991. let i = 1;
  992. for (let key in obj) {
  993. this.$message.error(obj[key][0].message);
  994. if (i === 1){
  995. return
  996. }
  997. i++;
  998. }
  999. }
  1000. })
  1001. },
  1002. handleSave(){
  1003. console.log('handleSave 被调用, quote.id:', this.quote.id)
  1004. let params = {
  1005. ...this.saveQuoteDetail,
  1006. quoteId: this.quote.id,
  1007. quoteNo:this.quote.quoteNo,
  1008. site:this.quote.site,
  1009. buNo:this.quote.buNo,
  1010. versionNo:this.quote.versionNo,
  1011. createBy:this.saveQuoteDetail.createBy,
  1012. active:'Y',
  1013. status:'草稿',
  1014. internalInquiryNo:this.quote.insideInquiryNo,
  1015. }
  1016. if (this.quoteGroupDetail){
  1017. params.quoteGroupDetailId=this.quoteGroupDetail.id;
  1018. }
  1019. this.saveLoading = true;
  1020. saveQuoteDetail(params).then(({data})=>{
  1021. if (data && data.code === 0){
  1022. this.$message.success(data.msg);
  1023. this.handleQueryQuoteDetail();
  1024. if (this.saveQuoteDetail.isDetail){
  1025. this.saveQuoteDetail = {
  1026. ...data.row,
  1027. }
  1028. }else {
  1029. this.saveVisible = false;
  1030. }
  1031. // 通知父组件刷新主信息
  1032. console.log('emit refresh-quote-info event (save), quoteId:', this.quote.id)
  1033. this.$emit('refresh-quote-info', this.quote.id)
  1034. }else {
  1035. this.$message.warning(data.msg);
  1036. }
  1037. this.saveLoading = false
  1038. }).catch((error)=>{
  1039. this.$message.error(error);
  1040. this.saveLoading = false
  1041. })
  1042. },
  1043. handleUpdate(){
  1044. let params = {
  1045. ...this.saveQuoteDetail,
  1046. updateBy:this.$store.state.user.name,
  1047. }
  1048. updateQuoteDetail(params).then(({data})=>{
  1049. if (data && data.code === 0){
  1050. this.$message.success(data.msg);
  1051. this.handleQueryQuoteDetail();
  1052. this.saveVisible = false;
  1053. // 通知父组件刷新主信息
  1054. console.log('emit refresh-quote-info event (update), quoteId:', this.quote.id)
  1055. this.$emit('refresh-quote-info', this.quote.id)
  1056. }else {
  1057. this.$message.warning(data.msg);
  1058. }
  1059. }).catch((error)=>{
  1060. this.$message.error(error);
  1061. })
  1062. },
  1063. handleClickTab(tab){
  1064. if (this.activeName === 'routing'){
  1065. this.$refs.routing.handleQueryQuoteDetailBomTree()
  1066. }else if (this.activeName === 'tool'){
  1067. this.$refs.tool.handleQueryQuoteDetailTool();
  1068. }
  1069. },
  1070. handleAgainQuoteDetail(row){
  1071. this.againRow = row;
  1072. this.againVisible = true;
  1073. },
  1074. againQuoteDetail(){
  1075. this.$refs.againForm.validate((valid,obj) => {
  1076. if (valid){
  1077. this.queryLoading = true;
  1078. this.saveLoading = true;
  1079. againQuoteDetail(this.againRow).then(({data})=>{
  1080. if (data && data.code === 0){
  1081. this.againVisible = false
  1082. this.handleQueryQuoteDetail();
  1083. this.$message.success(data.msg);
  1084. }else {
  1085. this.$message.warning(data.msg);
  1086. }
  1087. this.queryLoading = false;
  1088. this.saveLoading = false;
  1089. }).catch((error)=>{
  1090. this.$message.error(error);
  1091. this.queryLoading = false;
  1092. this.saveLoading = false;
  1093. })
  1094. }else {
  1095. let i = 1;
  1096. for (let key in obj) {
  1097. this.$message.error(obj[key][0].message);
  1098. if (i === 1){
  1099. return
  1100. }
  1101. i++;
  1102. }
  1103. }
  1104. })
  1105. },
  1106. handleQueryPartList(){
  1107. this.projectPart = {
  1108. testPartNo:this.saveQuoteDetail.partNo,
  1109. partDesc:'',
  1110. finalPartNo:'',
  1111. customerPartNo:'',
  1112. site:this.$store.state.user.site,
  1113. }
  1114. this.partVisible = true;
  1115. this.getProjectPartList();
  1116. },
  1117. getProjectPartList(){
  1118. let params = {
  1119. ...this.projectPart,
  1120. no:this.pageNo,
  1121. size:this.pageSize,
  1122. }
  1123. params.projectId = this.quote.projectNo
  1124. this.partQueryLoading = true;
  1125. getProjectPartList(params).then(({data})=>{
  1126. if (data && data.code === 0){
  1127. this.projectPartList = data.rows;
  1128. this.pageTotal = data.total;
  1129. }
  1130. this.partQueryLoading = false;
  1131. }).catch((error)=>{
  1132. this.partQueryLoading = false;
  1133. })
  1134. },
  1135. handleSizeChange(val){
  1136. this.pageSize = val;
  1137. this.getProjectPartList();
  1138. },
  1139. handleCurrentChange(val){
  1140. this.pageNo = val;
  1141. this.getProjectPartList();
  1142. },
  1143. dblClickProjectPartTable(row){
  1144. this.saveQuoteDetail.partNo = row.testPartNo;
  1145. this.saveQuoteDetail.partDesc = row.partDesc;
  1146. this.partVisible = false;
  1147. },
  1148. handleClose(){
  1149. this.$emit('close');
  1150. this.saveVisible = false;
  1151. }, startDownload() {
  1152. this.exportLoading = true
  1153. },
  1154. finishDownload() {
  1155. this.exportLoading = false
  1156. },
  1157. fields() {
  1158. let json = "{"
  1159. this.columns.forEach((item, index) => {
  1160. if (index === this.columns.length - 1) {
  1161. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1162. } else {
  1163. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1164. }
  1165. })
  1166. json += "}"
  1167. return eval("(" + json + ")")
  1168. },
  1169. createExportData() {
  1170. return this.dataList;
  1171. },
  1172. toPartMenu (partNo) {
  1173. if (this.$router.resolve(`/part-partInformation`).resolved.name === '404') {
  1174. this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',})
  1175. } else {
  1176. this.$router.push({name:`part-partInformation`,params:{partNo:partNo},})
  1177. }
  1178. },
  1179. formatDecimal(value) {
  1180. const num = parseFloat(value);
  1181. return !isNaN(num) ? num.toFixed(4) : value;
  1182. },
  1183. handleSetDefaultQuoteRow(row) {
  1184. if (!this.isAuth('5011:group:current')) {
  1185. return;
  1186. }
  1187. const oldVal = this.quoteGroupDetail.currentQuoteDetailItemNo;
  1188. this.quoteGroupDetail.currentQuoteDetailItemNo = row.itemNo;
  1189. // 直接触发emit事件
  1190. this.$emit('currentQuoteDetailItemNo', oldVal);
  1191. },
  1192. // 判断某行是否为默认报价行(不允许删除)
  1193. // 单组视图(quoteGroupDetail 已传入):对比 quoteGroupDetail.currentQuoteDetailItemNo
  1194. // 平铺视图(quoteGroupDetail 未传):对比内部加载的 internalDefaultItemNoMap
  1195. isDefaultQuoteRow(row) {
  1196. if (this.quoteGroupDetail) {
  1197. return this.quoteGroupDetail.currentQuoteDetailItemNo === row.itemNo;
  1198. }
  1199. const defaultItemNo = this.internalDefaultItemNoMap[row.quoteGroupDetailId]
  1200. return defaultItemNo != null && defaultItemNo === row.itemNo;
  1201. },
  1202. },
  1203. watch:{
  1204. quote(newVal,oldVal){
  1205. if (newVal.id){
  1206. // 只有当 quote.id 真正变化时才重新查询,避免重复查询
  1207. if (newVal.id !== (oldVal && oldVal.id)) {
  1208. this.quoteDetail.profitRate = this.quote.markup
  1209. this.quoteDetail.quoteProfitRate = this.quote.markup
  1210. this.handleQueryQuoteDetail();
  1211. }
  1212. }else {
  1213. this.dataList = [];
  1214. }
  1215. },
  1216. "saveQuoteDetail.partNo"(newVal,oldVal){
  1217. if (newVal){
  1218. this.saveQuoteDetail.partNo = newVal.toUpperCase();
  1219. }
  1220. },
  1221. partVisible(newVal,oldVal){
  1222. if (newVal === false){
  1223. this.partQueryLoading = false
  1224. this.pageNo = 1;
  1225. this.projectPartList = [];
  1226. }
  1227. },
  1228. quoteGroupDetail(newVal,oldVal){
  1229. if (newVal){
  1230. this.quoteDetail.profitRate = this.quote.markup
  1231. this.quoteDetail.quoteProfitRate = this.quote.markup
  1232. this.handleQueryQuoteDetail();
  1233. }
  1234. },
  1235. // 'quoteGroupDetail.currentQuoteDetailItemNo'(newVal,oldVal){
  1236. // // console.log(this.quoteGroupDetail)
  1237. // // emit事件触发修改
  1238. // if (this.quoteGroupDetail && this.quoteGroupDetail.currentQuoteDetailItemNo){
  1239. // this.$emit('currentQuoteDetailItemNo',oldVal);
  1240. // }
  1241. // }
  1242. },
  1243. created() {
  1244. this.quoteDetail.profitRate = this.quote.markup
  1245. this.quoteDetail.quoteProfitRate = this.quote.markup
  1246. // 只有当 quote.id 存在时才查询,避免和 watch 重复查询
  1247. if (this.quote.id) {
  1248. this.handleQueryQuoteDetail();
  1249. }
  1250. }
  1251. }
  1252. </script>
  1253. <template>
  1254. <div>
  1255. <template v-if="saveAuth">
  1256. <el-button type="primary" v-if="!authFlag" :disabled="quote.status === '已完成' || !quote.status" @click="handleSaveQuoteDetail(null)">新增</el-button>
  1257. </template>
  1258. <template v-if="isExport">
  1259. <download-excel
  1260. :fields="fields()"
  1261. :data="exportData"
  1262. type="xls"
  1263. :name="exportName"
  1264. :header="exportHeader"
  1265. :footer="exportFooter"
  1266. :fetch="createExportData"
  1267. :before-generate="startDownload"
  1268. :before-finish="finishDownload"
  1269. worksheet="导出信息"
  1270. :class="['el-button', 'el-button--primary', 'el-button--medium', {'is-loading': exportLoading}]">
  1271. <i v-if="exportLoading" class="el-icon-loading"></i>
  1272. <span>{{ '导出' }}</span>
  1273. </download-excel>
  1274. </template>
  1275. <el-table v-loading="queryLoading" border :data="dataList" style="width: 100%;margin-top: 5px" :height="height">
  1276. <el-table-column width="80" align="center" label="默认报价行" v-if="quoteGroupDetail && (quoteGroupDetail.status === '草稿' || quoteGroupDetail.status === '审批中')">
  1277. <template slot-scope="{row}">
  1278. <div style="cursor: pointer;">
  1279. <el-radio
  1280. class="radio"
  1281. :label="row.itemNo"
  1282. :disabled="!isAuth('5011:group:current')"
  1283. v-model="quoteGroupDetail.currentQuoteDetailItemNo"
  1284. @click.native.prevent="handleSetDefaultQuoteRow(row)"
  1285. ></el-radio>
  1286. </div>
  1287. </template>
  1288. </el-table-column>
  1289. <el-table-column type="index" width="55" align="center" label="序号"></el-table-column>
  1290. <el-table-column
  1291. v-for="(item,index) in columns" :key="index"
  1292. :sortable="item.columnSortable"
  1293. :prop="item.columnProp"
  1294. :header-align="item.headerAlign"
  1295. :show-overflow-tooltip="item.showOverflowTooltip"
  1296. :align="item.align"
  1297. :fixed="item.fixed === ''?false:item.fixed"
  1298. :min-width="item.columnWidth"
  1299. :label="item.columnLabel">
  1300. <template slot-scope="scope">
  1301. <template v-if="item.columnProp === 'unitPriceRate'">
  1302. {{ formatDecimal(scope.row.unitPriceRate) }}
  1303. </template>
  1304. <template v-else-if="!quoteGroupDetail && item.columnProp === 'plmPartNo'">
  1305. <el-link style="cursor:pointer;" v-if="!item.columnHidden" @click="toPartMenu(scope.row.plmPartNo)"> {{ scope.row[item.columnProp] }}</el-link>
  1306. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  1307. </template>
  1308. <template v-else>
  1309. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  1310. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  1311. style="width: 100px; height: 80px"/></span>
  1312. </template>
  1313. </template>
  1314. </el-table-column>
  1315. <el-table-column label="操作" v-if="!authFlag" fixed="right" align="center" width="160">
  1316. <template slot-scope="{row,$index}">
  1317. <template v-if="isAuth('5011:detail:update')">
  1318. <a type="text" v-if="row.status === '草稿' || row.status === '审批中'" @click="handleSaveQuoteDetail(row)">编辑</a>
  1319. </template>
  1320. <template v-if="isAuth('5011:detail:remove')">
  1321. <a type="text" v-if="(row.status === '草稿' || row.status === '审批中') && !isDefaultQuoteRow(row)" @click="handleDeleteQuoteDetail(row)">删除</a>
  1322. </template>
  1323. <template v-if="isAuth('5011:detail:again')">
  1324. <!-- <a type="text" v-if="row.status !== '已完成'" @click="againQuoteDetail(row)">复制明细</a>-->
  1325. <a type="text" v-if="row.status !== '已完成'" @click="handleAgainQuoteDetail(row)">复制明细</a>
  1326. </template>
  1327. <template v-if="isAuth('5011:detail:detail')">
  1328. <a type="text" @click="handleDetail(row)">详情</a>
  1329. </template>
  1330. </template>
  1331. </el-table-column>
  1332. </el-table>
  1333. <el-dialog :title="`报价明细`" top="10vh" v-drag :visible.sync="saveVisible" append-to-body :width="`${saveQuoteDetail.id?1200:600}px`" :close-on-click-modal="false">
  1334. <el-form :model="saveQuoteDetail" ref="saveQuoteDetailForm" :rules="saveQuoteDetailRules" label-position="top" v-if="!saveQuoteDetail.id">
  1335. <el-row :gutter="20">
  1336. <el-col :span="8">
  1337. <el-form-item label="物料编码" prop="partNo" :show-message="false">
  1338. <span slot="label" v-if="!quoteGroupDetail">
  1339. <a @click="handleQueryPartList">物料编码</a>
  1340. </span>
  1341. <el-input v-model="saveQuoteDetail.partNo" :disabled="quoteGroupDetail" @change="handlePartNoBlur"></el-input>
  1342. </el-form-item>
  1343. </el-col>
  1344. <el-col :span="16">
  1345. <el-form-item label="物料名称" prop="partDesc" :show-message="false">
  1346. <el-input v-model="saveQuoteDetail.partDesc" disabled></el-input>
  1347. </el-form-item>
  1348. </el-col>
  1349. <el-col :span="8">
  1350. <el-form-item label="MOQ" prop="qty" :show-message="false">
  1351. <el-input-number style="width: 100%;" v-model="saveQuoteDetail.qty" :min="1" :step="0" :precision="0" :controls="false"></el-input-number>
  1352. </el-form-item>
  1353. </el-col>
  1354. <el-col :span="8">
  1355. <el-form-item label="币种" prop="currency1" :show-message="false">
  1356. <dict-data-select style="width: 100%" dict-type="plm_customer_information_customer_customer_currency" v-model="saveQuoteDetail.currency1"></dict-data-select>
  1357. </el-form-item>
  1358. </el-col>
  1359. </el-row>
  1360. <el-row :gutter="20">
  1361. <el-col :span="8">
  1362. <el-form-item label="" :show-message="false">
  1363. <el-checkbox v-model="saveQuoteDetail.isDetail">保存进入报价页面</el-checkbox>
  1364. </el-form-item>
  1365. </el-col>
  1366. <el-col :span="24">
  1367. <el-form-item label="备注" class="auto" :show-message="false">
  1368. <el-input type="textarea" v-model="saveQuoteDetail.remark" :autosize="{minRows: 3, maxRows: 3}"></el-input>
  1369. </el-form-item>
  1370. </el-col>
  1371. </el-row>
  1372. </el-form>
  1373. <el-form v-else :model="saveQuoteDetail" ref="saveQuoteDetailForm" :rules="saveQuoteDetailRules" label-position="top">
  1374. <el-row :gutter="20">
  1375. <el-col :span="4">
  1376. <el-form-item label="物料编码" prop="partNo" :show-message="false">
  1377. <el-input v-model="saveQuoteDetail.partNo" disabled></el-input>
  1378. </el-form-item>
  1379. </el-col>
  1380. <el-col :span="6">
  1381. <el-form-item label="物料名称" prop="partDesc" :show-message="false">
  1382. <el-input v-model="saveQuoteDetail.partDesc" disabled></el-input>
  1383. </el-form-item>
  1384. </el-col>
  1385. <el-col :span="2">
  1386. <el-form-item label="MOQ" prop="qty" :show-message="false">
  1387. <el-input-number v-model="saveQuoteDetail.qty" style="width: 100%;" :controls="false" :disabled="showModalFlag||saveQuoteDetail.status === '已完成'"></el-input-number>
  1388. </el-form-item>
  1389. </el-col>
  1390. <el-col :span="3">
  1391. <el-form-item label="币种" prop="currency1" :show-message="false">
  1392. <dict-data-select :disabled="showModalFlag||saveQuoteDetail.status === '已完成'" style="width: 100%" dict-type="plm_customer_information_customer_customer_currency" v-model="saveQuoteDetail.currency1"></dict-data-select>
  1393. </el-form-item>
  1394. </el-col>
  1395. <el-col :span="3">
  1396. <el-form-item label="最终交易价" :show-message="false">
  1397. <el-input-number v-model="saveQuoteDetail.finalTransactionPrice" :controls="false" :disabled="showModalFlag||saveQuoteDetail.status === '已完成'" style="width: 100%"></el-input-number>
  1398. </el-form-item>
  1399. </el-col>
  1400. <el-col :span="4">
  1401. <el-form-item label=" " :show-message="false">
  1402. <el-checkbox v-model="showFlagChecked" :disabled="showModalFlag" @change="handleShowFlagChange">询价申请中展示该条目行</el-checkbox>
  1403. </el-form-item>
  1404. </el-col>
  1405. <el-col :span="2">
  1406. <el-form-item label=" " :show-message="false">
  1407. <el-button v-if="saveQuoteDetail.id && isAuth('5011:detail:dataEntry')" type="warning" @click="handleDataEntry">数据录入</el-button> </el-form-item>
  1408. </el-col>
  1409. </el-row>
  1410. <el-row :gutter="20">
  1411. <el-col :span="24">
  1412. <el-form-item label="备注" class="auto" :show-message="false">
  1413. <el-input type="textarea" resize="none" :autosize="{minRows: 3, maxRows: 3}" v-model="saveQuoteDetail.remark" :disabled="showModalFlag||saveQuoteDetail.status === '已完成'"></el-input>
  1414. </el-form-item>
  1415. </el-col>
  1416. </el-row>
  1417. </el-form>
  1418. <el-tabs v-model="activeName" v-if="saveQuoteDetail.id" @tab-click="handleClickTab">
  1419. <el-tab-pane label="材料" name="bom">
  1420. <quote-detail-bom v-if="saveVisible && activeName === 'bom'" @close="handleClose" v-model:quoteDetail="saveQuoteDetail"></quote-detail-bom>
  1421. </el-tab-pane>
  1422. <el-tab-pane label="工艺" name="routing">
  1423. <quote-detail-routing ref="routing" v-if="saveVisible && activeName === 'routing'" @close="handleClose" v-model:quoteDetail="saveQuoteDetail"></quote-detail-routing>
  1424. </el-tab-pane>
  1425. <el-tab-pane label="工具" name="tool">
  1426. <quote-detail-tool ref="tool" v-if="saveVisible && activeName === 'tool'" v-model:quoteDetail="saveQuoteDetail"></quote-detail-tool>
  1427. </el-tab-pane>
  1428. <el-tab-pane label="测试" name="test">
  1429. <quote-detail-test v-if="saveVisible && activeName === 'test'" v-model:quoteDetail="saveQuoteDetail"></quote-detail-test>
  1430. </el-tab-pane>
  1431. <el-tab-pane label="包装&运输" name="otherCost">
  1432. <quote-detail-other-cost v-if="saveVisible && activeName === 'otherCost'" v-model:quoteDetail="saveQuoteDetail"></quote-detail-other-cost>
  1433. </el-tab-pane>
  1434. <el-tab-pane label="其他" name="other">
  1435. <quote-detail-other v-if="saveVisible && activeName === 'other'" v-model:quoteDetail="saveQuoteDetail"></quote-detail-other>
  1436. </el-tab-pane>
  1437. <el-tab-pane label="成本&价格" name="cost">
  1438. <quote-detail-cost v-if="saveVisible && activeName === 'cost'" ref="cost" v-model:quoteDetail="saveQuoteDetail"></quote-detail-cost>
  1439. </el-tab-pane>
  1440. </el-tabs>
  1441. <div slot="footer" class="dialog-footer">
  1442. <el-button type="primary" v-if="!this.showModalFlag&&(saveQuoteDetail.status === '草稿' || saveQuoteDetail.status === '审批中')" :loading="saveLoading" @click="handleSaveQuoteDetailClick"> </el-button>
  1443. <el-button @click="saveVisible = false"> </el-button>
  1444. </div>
  1445. </el-dialog>
  1446. <el-dialog title="数据录入" v-drag :visible.sync="dataEntryVisible" append-to-body width="500px" :close-on-click-modal="false">
  1447. <el-form :model="dataEntryForm" label-position="top">
  1448. <el-form-item label="最终交易价">
  1449. <el-input-number v-model="dataEntryForm.finalTransactionPrice" :controls="false" style="width: 100%" placeholder="请输入最终交易价"></el-input-number>
  1450. </el-form-item>
  1451. <el-form-item label="备注">
  1452. <el-input type="textarea" v-model="dataEntryForm.remark" :rows="3" resize="none" placeholder="请输入备注"></el-input>
  1453. </el-form-item>
  1454. </el-form>
  1455. <div style="height:35px;margin-top: 55px;text-align:center">
  1456. <el-button type="primary" :loading="dataEntryLoading" @click="submitDataEntry"> </el-button>
  1457. <el-button @click="dataEntryVisible = false"> </el-button>
  1458. </div>
  1459. </el-dialog>
  1460. <el-dialog v-drag title="物料信息" append-to-body :close-on-click-modal="false" :visible.sync="partVisible">
  1461. <!--搜索条件-->
  1462. <el-form :model="projectPart" ref="projectPartDataForm" :inline="true" label-position="top">
  1463. <el-form-item label="物料编码" prop="testPartNo">
  1464. <el-input v-model="projectPart.testPartNo" clearable/>
  1465. </el-form-item>
  1466. <el-form-item label="物料名称" prop="partDesc">
  1467. <el-input v-model="projectPart.partDesc" clearable/>
  1468. </el-form-item>
  1469. <el-form-item label="IFS物料编码" prop="finalPartNo">
  1470. <el-input v-model="projectPart.finalPartNo" clearable/>
  1471. </el-form-item>
  1472. <el-form-item label="客户物料编码" prop="customerPartNo">
  1473. <el-input v-model="projectPart.customerPartNo" clearable/>
  1474. </el-form-item>
  1475. <el-form-item label=" ">
  1476. <el-button @click="getProjectPartList" type="primary"> </el-button>
  1477. </el-form-item>
  1478. </el-form>
  1479. <el-table height="300px" v-loading="partQueryLoading" stripe border @row-dblclick="dblClickProjectPartTable" :data="projectPartList" ref="projectPartDataTable" :style="{marginTop:'10px'}">
  1480. <el-table-column
  1481. v-for="(item,index) in projectPartColumns" :key="index"
  1482. :sortable="item.columnSortable"
  1483. :prop="item.columnProp"
  1484. :header-align="item.headerAlign"
  1485. :show-overflow-tooltip="item.showOverflowTooltip"
  1486. :align="item.align"
  1487. :fixed="item.fixed===''?false:item.fixed"
  1488. :min-width="item.columnWidth"
  1489. :label="item.columnLabel">
  1490. <template slot-scope="scope">
  1491. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  1492. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  1493. </template>
  1494. </el-table-column>
  1495. </el-table>
  1496. <el-pagination style="margin-top: 0"
  1497. @size-change="handleSizeChange"
  1498. @current-change="handleCurrentChange"
  1499. :current-page="pageNo"
  1500. :page-sizes="[20, 50, 100, 200, 500]"
  1501. :page-size="pageSize"
  1502. :total="pageTotal"
  1503. layout="total,sizes, prev, pager, next, jumper">
  1504. </el-pagination>
  1505. </el-dialog>
  1506. <el-dialog title="复制明细" v-drag append-to-body :close-on-click-modal="false" :visible.sync="againVisible" width="400px">
  1507. <el-form :model="againRow" label-position="top" ref="againForm" :rules="saveQuoteDetailRules">
  1508. <el-row :gutter="10">
  1509. <el-col :span="8">
  1510. <el-form-item label="物料编码" prop="partNo" :show-message="false">
  1511. <el-input v-model="againRow.partNo" disabled @change="handlePartNoBlur"></el-input>
  1512. </el-form-item>
  1513. </el-col>
  1514. <el-col :span="16">
  1515. <el-form-item label="物料名称" prop="partDesc" :show-message="false">
  1516. <el-input v-model="againRow.partDesc" disabled></el-input>
  1517. </el-form-item>
  1518. </el-col>
  1519. <el-col :span="8">
  1520. <el-form-item label="MOQ" prop="qty" :show-message="false">
  1521. <el-input-number style="width: 100%;" v-model="againRow.qty" :min="1" :step="0" :precision="0" :controls="false"></el-input-number>
  1522. </el-form-item>
  1523. </el-col>
  1524. <el-col :span="8">
  1525. <el-form-item label="币种" prop="currency1" :show-message="false">
  1526. <dict-data-select style="width: 100%" dict-type="plm_customer_information_customer_customer_currency" v-model="againRow.currency1"></dict-data-select>
  1527. </el-form-item>
  1528. </el-col>
  1529. </el-row>
  1530. </el-form>
  1531. <div slot="footer" class="dialog-footer">
  1532. <el-button type="primary" :loading="saveLoading" @click="againQuoteDetail"> </el-button>
  1533. <el-button @click="againVisible = false"> </el-button>
  1534. </div>
  1535. </el-dialog>
  1536. <!-- <part-table v-if="saveVisible" v-model="partVisible" :is-page="true" :part-no="saveQuoteDetail.partNo" @dblclick="handleDblClick"></part-table>-->
  1537. <!-- <project-part-table v-if="saveVisible" v-model="partVisible" :project-no="saveQuoteDetail.projectNo" :part-no="saveQuoteDetail.partNo" @dblclick="handleDblClick"></project-part-table>-->
  1538. </div>
  1539. </template>
  1540. <style scoped>
  1541. .el-table /deep/ .cell{
  1542. height: auto;
  1543. line-height: 1.5;
  1544. }
  1545. .auto /deep/ .el-form-item__content{
  1546. height: auto;
  1547. line-height: 1.5;
  1548. }
  1549. .radio /deep/ .el-radio__label{
  1550. display: none;
  1551. }
  1552. </style>