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.

846 lines
28 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 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
11 months ago
1 year ago
11 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
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <script>
  2. import ProjectPartTable from "../../../../components/selector/table/projectPartTable.vue";
  3. import {queryProjectPart} from "../../../../api/project/projectPart";
  4. import {
  5. againQuoteDetail,
  6. deleteQuoteDetail,
  7. queryQuoteDetail, queryQuoteDetailYield,
  8. saveQuoteDetail,
  9. updateQuoteDetail
  10. } from "../../../../api/quote/quoteDetail";
  11. import QuoteDetailCost from "./primary/quoteDetailCost.vue";
  12. import QuoteDetailTool from "./primary/quoteDetailTool.vue";
  13. import QuoteDetailBom from "./primary/quoteDetailBom.vue";
  14. import QuoteDetailRouting from "./primary/quoteDetailRouting.vue";
  15. import QuoteDetailOther from "./primary/quoteDetailOther.vue";
  16. import PartTable from "../../../../components/selector/table/partTable.vue";
  17. import {handleQueryPart} from "../../../../api/part/partInformation";
  18. import {updateColumnSize} from "../../../../api/table";
  19. import QuoteDetailCalculation from "./primary/quoteDetailCalculation.vue";
  20. export default {
  21. name: "quoteDetail",
  22. components: {
  23. QuoteDetailCalculation,
  24. PartTable,
  25. QuoteDetailOther, QuoteDetailRouting, QuoteDetailBom, QuoteDetailTool, QuoteDetailCost, ProjectPartTable},
  26. props:{
  27. quote:{
  28. type:Object,
  29. required:true
  30. },
  31. height:{
  32. type:[Number,String],
  33. default:300
  34. },
  35. authFlag:{
  36. type:Boolean,
  37. default:false
  38. },
  39. quoteGroupDetail:{
  40. type:Object,
  41. },
  42. saveAuth:{
  43. type:Boolean,
  44. default:true
  45. },
  46. },
  47. data(){
  48. return{
  49. quoteDetail:{
  50. id:null,
  51. partNo:'',
  52. partDesc:'',
  53. projectNo:'',
  54. projectDesc:'',
  55. qty:null,
  56. quoteCount:1,
  57. partCost:0,
  58. adjustPartCost:0,
  59. labourCost:0,
  60. adjustLabourCost:0,
  61. fabricateCost:0,
  62. adjustFabricateCost:0,
  63. toolCost:0,
  64. adjustToolCost:0,
  65. machineCost:0,
  66. adjustMachineCost:0,
  67. otherCost:0,
  68. manageCost:0,
  69. totalCost:0,
  70. profitRate:0,
  71. profitAmount:0,
  72. totalPrice:0,
  73. unitPrice:0,
  74. taxRate:13,
  75. taxTotalPrice:0,
  76. taxUnitPrice:0,
  77. quoteTotalCost:0,
  78. quoteProfitRate:0,
  79. quoteProfitAmount:0,
  80. quoteTotalPrice:0,
  81. quoteUnitPrice:0,
  82. quoteTaxRate:0,
  83. quoteTaxTotalPrice:0,
  84. quoteTaxUnitPrice:0,
  85. currency1:undefined,
  86. currency2:undefined,
  87. exchangeRate1:undefined,
  88. exchangeRate2:undefined,
  89. currencyTotalCost1:0,
  90. currencyTotalCost2:0,
  91. quoteCurrencyTotalCost1:0,
  92. quoteCurrencyTotalCost2:0,
  93. moq:'Standard 250K',
  94. type:'Standard TP',
  95. costModel:'UFIDA',
  96. remark:'',
  97. },
  98. saveQuoteDetail:{
  99. },
  100. dataList:[],
  101. saveLoading:false,
  102. queryLoading:false,
  103. saveVisible:false,
  104. saveQuoteDetailRules:{
  105. partNo: [{required: true, message: '请输入物料编码', trigger: ['blur','change']}],
  106. partDesc: [{required: true, message: '请输入物料名称', trigger: ['blur','change']}],
  107. qty: [{required: true, message: '请输入数量', trigger: ['blur','change']}],
  108. type: [{required: true, message: '请选择TP类型', trigger: ['blur','change']}],
  109. costModel: [{required: true, message: '请选择Cost Model', trigger: ['blur','change']}],
  110. },
  111. columns: [
  112. {
  113. userId: this.$store.state.user.name,
  114. functionId: 5011,
  115. serialNumber: '5011Table2CostModel',
  116. tableId: '5011Table2',
  117. tableName: '报价详情信息表',
  118. columnProp: 'costModel',
  119. headerAlign: 'center',
  120. align: 'center',
  121. columnLabel: 'Cost Model',
  122. columnHidden: false,
  123. columnImage: false,
  124. columnSortable: false,
  125. sortLv: 0,
  126. status: true,
  127. fixed: '',
  128. columnWidth: 120
  129. },
  130. {
  131. userId: this.$store.state.user.name,
  132. functionId: 5011,
  133. serialNumber: '5011Table2PartNo',
  134. tableId: '5011Table2',
  135. tableName: '报价详情信息表',
  136. columnProp: 'partNo',
  137. headerAlign: 'center',
  138. align: 'center',
  139. columnLabel: '物料编码',
  140. columnHidden: false,
  141. columnImage: false,
  142. columnSortable: false,
  143. sortLv: 0,
  144. status: true,
  145. fixed: '',
  146. columnWidth: 120
  147. },
  148. {
  149. userId: this.$store.state.user.name,
  150. functionId: 5011,
  151. serialNumber: '5011Table2PartDesc',
  152. tableId: '5011Table2',
  153. tableName: '报价详情信息表',
  154. columnProp: 'partDesc',
  155. headerAlign: 'center',
  156. align: 'center',
  157. columnLabel: '物料名称',
  158. columnHidden: false,
  159. columnImage: false,
  160. columnSortable: false,
  161. sortLv: 0,
  162. status: true,
  163. fixed: '',
  164. columnWidth: 320
  165. },
  166. {
  167. userId: this.$store.state.user.name,
  168. functionId: 5011,
  169. serialNumber: '5011Table2Qty',
  170. tableId: '5011Table2',
  171. tableName: '报价详情信息表',
  172. columnProp: 'qty',
  173. headerAlign: 'center',
  174. align: 'center',
  175. columnLabel: '报价数量',
  176. columnHidden: false,
  177. columnImage: false,
  178. columnSortable: false,
  179. sortLv: 0,
  180. status: true,
  181. fixed: '',
  182. columnWidth: 100
  183. },
  184. {
  185. userId: this.$store.state.user.name,
  186. functionId: 5011,
  187. serialNumber: '5011Table2AdjustBomUnYield',
  188. tableId: '5011Table2',
  189. tableName: '报价详情信息表',
  190. columnProp: 'adjustBomUnYield',
  191. headerAlign: 'center',
  192. align: 'right',
  193. columnLabel: '报价成本',
  194. columnHidden: false,
  195. columnImage: false,
  196. columnSortable: false,
  197. sortLv: 0,
  198. status: true,
  199. fixed: '',
  200. columnWidth: 130
  201. },
  202. {
  203. userId: this.$store.state.user.name,
  204. functionId: 5011,
  205. serialNumber: '5011Table2AdjustLabourCost',
  206. tableId: '5011Table2',
  207. tableName: '报价详情信息表',
  208. columnProp: 'adjustLabourCost',
  209. headerAlign: 'center',
  210. align: 'right',
  211. columnLabel: 'DL',
  212. columnHidden: false,
  213. columnImage: false,
  214. columnSortable: false,
  215. sortLv: 0,
  216. status: true,
  217. fixed: '',
  218. columnWidth: 120
  219. },
  220. {
  221. userId: this.$store.state.user.name,
  222. functionId: 5011,
  223. serialNumber: '5011Table2AdjustFabricateCost',
  224. tableId: '5011Table2',
  225. tableName: '报价详情信息表',
  226. columnProp: 'adjustFabricateCost',
  227. headerAlign: 'center',
  228. align: 'right',
  229. columnLabel: 'VOH',
  230. columnHidden: false,
  231. columnImage: false,
  232. columnSortable: false,
  233. sortLv: 0,
  234. status: true,
  235. fixed: '',
  236. columnWidth: 120
  237. },
  238. {
  239. userId: this.$store.state.user.name,
  240. functionId: 5011,
  241. serialNumber: '5011Table2AdjustMachineCost',
  242. tableId: '5011Table2',
  243. tableName: '报价详情信息表',
  244. columnProp: 'adjustMachineCost',
  245. headerAlign: 'center',
  246. align: 'right',
  247. columnLabel: 'FOH',
  248. columnHidden: false,
  249. columnImage: false,
  250. columnSortable: false,
  251. sortLv: 0,
  252. status: true,
  253. fixed: '',
  254. columnWidth: 120
  255. }
  256. ,{
  257. userId: this.$store.state.user.name,
  258. functionId: 5011,
  259. serialNumber: '5011Table2TotalCost',
  260. tableId: '5011Table2',
  261. tableName: '报价详情信息表',
  262. columnProp: 'totalCost',
  263. headerAlign: 'center',
  264. align: 'right',
  265. columnLabel: 'Total Cost(RMB.KCT)',
  266. columnHidden: false,
  267. columnImage: false,
  268. columnSortable: false,
  269. sortLv: 0,
  270. status: true,
  271. fixed: '',
  272. columnWidth: 140
  273. },
  274. {
  275. userId: this.$store.state.user.name,
  276. functionId: 5011,
  277. serialNumber: '5011Table2QuoteProfitRate',
  278. tableId: '5011Table2',
  279. tableName: '报价详情信息表',
  280. columnProp: 'quoteProfitRate',
  281. headerAlign: 'center',
  282. align: 'right',
  283. columnLabel: 'markup(%)',
  284. columnHidden: false,
  285. columnImage: false,
  286. columnSortable: false,
  287. sortLv: 0,
  288. status: true,
  289. fixed: '',
  290. columnWidth: 140
  291. },
  292. {
  293. userId: this.$store.state.user.name,
  294. functionId: 5011,
  295. serialNumber: '5011Table2Weighted',
  296. tableId: '5011Table2',
  297. tableName: '报价详情信息表',
  298. columnProp: 'weighted',
  299. headerAlign: 'center',
  300. align: 'right',
  301. columnLabel: 'Weighted TP for MOQ>250K(USD/KCT)',
  302. columnHidden: false,
  303. columnImage: false,
  304. columnSortable: false,
  305. sortLv: 0,
  306. status: true,
  307. fixed: '',
  308. columnWidth: 260
  309. },
  310. {
  311. userId: this.$store.state.user.name,
  312. functionId: 5011,
  313. serialNumber: '5011Table2Weighted2',
  314. tableId: '5011Table2',
  315. tableName: '报价详情信息表',
  316. columnProp: 'weighted2',
  317. headerAlign: 'center',
  318. align: 'right',
  319. columnLabel: 'Weighted TP for MOQ>5M(USD/KCT)',
  320. columnHidden: false,
  321. columnImage: false,
  322. columnSortable: false,
  323. sortLv: 0,
  324. status: true,
  325. fixed: '',
  326. columnWidth: 260
  327. },
  328. {
  329. userId: this.$store.state.user.name,
  330. functionId: 5011,
  331. serialNumber: '5011Table2Weighted',
  332. tableId: '5011Table2',
  333. tableName: '报价详情信息表',
  334. columnProp: 'weighted',
  335. headerAlign: 'center',
  336. align: 'right',
  337. columnLabel: 'Standard TP for MOQ>250K(USD/KCT)',
  338. columnHidden: false,
  339. columnImage: false,
  340. columnSortable: false,
  341. sortLv: 0,
  342. status: true,
  343. fixed: '',
  344. columnWidth: 260
  345. },
  346. {
  347. userId: this.$store.state.user.name,
  348. functionId: 5011,
  349. serialNumber: '5011Table2Weighted2',
  350. tableId: '5011Table2',
  351. tableName: '报价详情信息表',
  352. columnProp: 'weighted2',
  353. headerAlign: 'center',
  354. align: 'right',
  355. columnLabel: 'Standard TP for MOQ>5M(USD/KCT)',
  356. columnHidden: false,
  357. columnImage: false,
  358. columnSortable: false,
  359. sortLv: 0,
  360. status: true,
  361. fixed: '',
  362. columnWidth: 260
  363. },
  364. {
  365. userId: this.$store.state.user.name,
  366. functionId: 5011,
  367. serialNumber: '5011Table2Remark',
  368. tableId: '5011Table2',
  369. tableName: '报价详情信息表',
  370. columnProp: 'remark',
  371. headerAlign: 'center',
  372. align: 'center',
  373. columnLabel: '备注',
  374. columnHidden: false,
  375. columnImage: false,
  376. columnSortable: false,
  377. sortLv: 0,
  378. status: true,
  379. fixed: '',
  380. columnWidth: 200
  381. },
  382. ],
  383. partVisible:false,
  384. activeName:'bom',
  385. }
  386. },
  387. methods:{
  388. handleColumnResize(newWidth, oldWidth, column, event){
  389. let inData= this.columnList.filter(item => item.columnProp === column.property)[0]
  390. inData.columnWidth=newWidth
  391. updateColumnSize(inData).then(({data}) => {
  392. if (data.code === 0) {
  393. console.log("栏位宽度保存成功!")
  394. }
  395. })
  396. },
  397. handleSaveQuoteDetail(row){
  398. this.$nextTick(()=>{
  399. if (this.$refs.handleSaveQuoteDetailClick){
  400. this.$refs.saveQuoteDetailForm.clearValidate();
  401. }
  402. })
  403. if (row){
  404. this.saveQuoteDetail = {
  405. ...row
  406. }
  407. }else {
  408. this.saveQuoteDetail = {
  409. ...this.quoteDetail,
  410. createBy:this.$store.state.user.name,
  411. status:'草稿',
  412. active:'Y',
  413. qty:1,
  414. isDetail:false,
  415. }
  416. if (this.quoteGroupDetail){
  417. this.saveQuoteDetail.partId = this.quoteGroupDetail.partId
  418. this.saveQuoteDetail.partNo = this.quoteGroupDetail.partNo
  419. this.saveQuoteDetail.partDesc = this.quoteGroupDetail.partDesc
  420. }
  421. this.$nextTick(()=>{
  422. this.saveQuoteDetail.projectNo = this.quote.projectNo
  423. })
  424. }
  425. this.activeName = 'bom';
  426. this.saveVisible = true;
  427. },
  428. handleDetail(row){
  429. this.saveQuoteDetail = {
  430. ...row
  431. }
  432. this.activeName = 'bom';
  433. this.saveVisible = true;
  434. },
  435. handleDeleteQuoteDetail(row){
  436. this.$alert('确认删除该条报价明细吗?', '提示', {
  437. confirmButtonText: '确定',
  438. cancelButtonText: '取消',
  439. type: 'warning'
  440. }).then(() => {
  441. let params = {
  442. id: row.id,
  443. }
  444. deleteQuoteDetail(params).then(({data}) => {
  445. if (data && data.code === 0) {
  446. this.$message.success(data.msg);
  447. this.handleQueryQuoteDetail();
  448. } else {
  449. this.$message.warning(data.msg);
  450. }
  451. }).catch((error) => {
  452. this.$message.error(error);
  453. })
  454. }).catch(() => {
  455. })
  456. },
  457. handleDblClick(row){
  458. this.saveQuoteDetail.partId = row.id;
  459. this.saveQuoteDetail.partNo = row.partNo;
  460. this.saveQuoteDetail.partDesc = row.partDesc;
  461. this.partVisible = false;
  462. },
  463. handlePartNoBlur(){
  464. let params = {
  465. userName: this.$store.state.user.name,
  466. partNo: this.saveQuoteDetail.partNo,
  467. }
  468. handleQueryPart(params).then(({data})=>{
  469. if (data && data.code === 0){
  470. if (data.rows.length === 1){
  471. this.saveQuoteDetail.partId = data.rows[0].id;
  472. this.saveQuoteDetail.partNo = data.rows[0].partNo;
  473. this.saveQuoteDetail.partDesc = data.rows[0].partDesc;
  474. }else {
  475. this.saveQuoteDetail.partId = undefined;
  476. this.saveQuoteDetail.partDesc = '';
  477. }
  478. }else {
  479. this.$message.warning(data.msg);
  480. }
  481. }).catch((error)=>{
  482. this.$message.error(error);
  483. })
  484. },
  485. handleQueryQuoteDetail(){
  486. let params = {
  487. quoteId: this.quote.id,
  488. }
  489. if (this.quoteGroupDetail){
  490. params.quoteGroupDetailId=this.quoteGroupDetail.id;
  491. }
  492. this.queryLoading = true;
  493. queryQuoteDetail(params).then(({data})=>{
  494. if (data && data.code === 0){
  495. this.dataList = data.rows
  496. }else {
  497. this.$message.warning(data.msg);
  498. }
  499. this.queryLoading = false;
  500. }).catch((error)=>{
  501. this.$message.error(error);
  502. this.queryLoading = false;
  503. })
  504. },
  505. handleSaveQuoteDetailClick(){
  506. // this.$refs.cost.handleValidate();
  507. this.$refs.saveQuoteDetailForm.validate((valid,obj) => {
  508. if (valid){
  509. if (this.saveQuoteDetail.id){
  510. this.handleUpdate();
  511. }else {
  512. this.handleSave();
  513. }
  514. }else {
  515. let i = 1;
  516. for (let item in obj){
  517. this.$message.error(obj[item][0].message);
  518. if (i === 1){
  519. return
  520. }
  521. i++;
  522. }
  523. }
  524. })
  525. },
  526. handleSave(){
  527. let params = {
  528. ...this.saveQuoteDetail,
  529. quoteId: this.quote.id,
  530. quoteNo:this.quote.quoteNo,
  531. site:this.quote.site,
  532. buNo:this.quote.buNo,
  533. versionNo:this.quote.versionNo,
  534. createBy:this.saveQuoteDetail.createBy,
  535. active:'Y',
  536. status:'草稿',
  537. internalInquiryNo:this.quote.insideInquiryNo,
  538. }
  539. if (this.quoteGroupDetail){
  540. params.quoteGroupDetailId=this.quoteGroupDetail.id;
  541. }
  542. this.saveLoading = true;
  543. saveQuoteDetail(params).then(({data})=>{
  544. if (data && data.code === 0){
  545. this.$message.success(data.msg);
  546. this.handleQueryQuoteDetail();
  547. if (this.saveQuoteDetail.isDetail){
  548. this.saveQuoteDetail = {
  549. ...data.row,
  550. }
  551. }else {
  552. this.saveVisible = false;
  553. }
  554. }else {
  555. this.$message.warning(data.msg);
  556. }
  557. this.saveLoading = false
  558. }).catch((error)=>{
  559. this.$message.error(error);
  560. this.saveLoading = false
  561. })
  562. },
  563. handleUpdate(){
  564. let params = {
  565. ...this.saveQuoteDetail,
  566. updateBy:this.$store.state.user.name,
  567. }
  568. updateQuoteDetail(params).then(({data})=>{
  569. if (data && data.code === 0){
  570. this.$message.success(data.msg);
  571. this.handleQueryQuoteDetail();
  572. this.saveVisible = false;
  573. }else {
  574. this.$message.warning(data.msg);
  575. }
  576. }).catch((error)=>{
  577. this.$message.error(error);
  578. })
  579. },
  580. handleComputeYield(row){
  581. let params = {
  582. id: row.id,
  583. }
  584. queryQuoteDetailYield(params).then(({data})=>{
  585. if (data && data.code === 0){
  586. this.$message.success(data.msg);
  587. this.handleQueryQuoteDetail();
  588. }else {
  589. this.$message.warning(data.msg);
  590. }
  591. }).catch((error)=>{
  592. this.$message.error(error);
  593. })
  594. },
  595. handleClickTab(tab){
  596. if (this.activeName === 'routing'){
  597. this.$refs.routing.handleQueryQuoteDetailBomTree()
  598. }
  599. },
  600. againQuoteDetail(row){
  601. let params = {
  602. ...row
  603. }
  604. againQuoteDetail(params).then(({data})=>{
  605. if (data && data.code === 0){
  606. this.handleQueryQuoteDetail();
  607. this.$message.success(data.msg);
  608. }else {
  609. this.$message.warning(data.msg);
  610. }
  611. }).catch((error)=>{
  612. this.$message.error(error);
  613. })
  614. },
  615. handleClose(){
  616. this.$emit('close');
  617. this.saveVisible = false
  618. },
  619. },
  620. watch:{
  621. quote(newVal,oldVal){
  622. if (newVal.id){
  623. this.quoteDetail.profitRate = this.quote.markup
  624. this.quoteDetail.quoteProfitRate = this.quote.markup
  625. this.handleQueryQuoteDetail();
  626. }else {
  627. this.dataList = [];
  628. }
  629. },
  630. "saveQuoteDetail.partNo"(newVal,oldVal){
  631. if (newVal){
  632. this.saveQuoteDetail.partNo = newVal.toUpperCase();
  633. }
  634. },
  635. quoteGroupDetail(newVal,oldVal){
  636. if (newVal){
  637. this.quoteDetail.profitRate = this.quote.markup
  638. this.quoteDetail.quoteProfitRate = this.quote.markup
  639. this.handleQueryQuoteDetail();
  640. }
  641. },
  642. 'quoteGroupDetail.currentQuoteDetailItemNo'(newVal,oldVal){
  643. // console.log(this.quoteGroupDetail)
  644. // emit事件触发修改
  645. if (this.quoteGroupDetail && newVal){
  646. this.$emit('currentQuoteDetailItemNo',oldVal);
  647. }
  648. }
  649. },
  650. created() {
  651. this.quoteDetail.profitRate = this.quote.markup
  652. this.quoteDetail.quoteProfitRate = this.quote.markup
  653. this.handleQueryQuoteDetail();
  654. }
  655. }
  656. </script>
  657. <template>
  658. <div class="rq">
  659. <template v-if="saveAuth">
  660. <el-button type="primary" v-if="!authFlag" :disabled="quote.status === '下达' || !quote.status" @click="handleSaveQuoteDetail(null)">新增</el-button>
  661. </template>
  662. <el-table v-loading="queryLoading" border :data="dataList" style="width: 100%;margin-top: 5px" :height="height" @header-dragend="handleColumnResize">
  663. <el-table-column width="80" align="center" label="默认报价行" v-if="quoteGroupDetail && quoteGroupDetail.status === '草稿'">
  664. <template slot-scope="{row}">
  665. <el-radio
  666. class="radio"
  667. :label="row.itemNo"
  668. v-model="quoteGroupDetail.currentQuoteDetailItemNo"
  669. ></el-radio>
  670. </template>
  671. </el-table-column>·
  672. <el-table-column type="index" width="55" align="center" label="序号"></el-table-column>
  673. <el-table-column
  674. v-for="(item,index) in columns" :key="index"
  675. :sortable="item.columnSortable"
  676. :prop="item.columnProp"
  677. :header-align="item.headerAlign"
  678. :show-overflow-tooltip="item.showOverflowTooltip"
  679. :align="item.align"
  680. :fixed="item.fixed === ''?false:item.fixed"
  681. :min-width="item.columnWidth"
  682. :label="item.columnLabel">
  683. <template slot-scope="scope">
  684. <template v-if="item.columnLabel === 'Weighted TP for MOQ>250K(USD/KCT)' || item.columnLabel === 'Weighted TP for MOQ>5M(USD/KCT)'">
  685. <span v-if="scope.row.type && scope.row.type === 'Weighted TP'"> {{scope.row[item.columnProp] }}</span>
  686. </template>
  687. <template v-else-if="item.columnLabel === 'Standard TP for MOQ>250K(USD/KCT)' || item.columnLabel === 'Standard TP for MOQ>5M(USD/KCT)'">
  688. <span v-if="!scope.row.type || scope.row.type === 'Standard TP'">{{scope.row[item.columnProp] }}</span>
  689. </template>
  690. <template v-else>
  691. <span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
  692. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]"
  693. style="width: 100px; height: 80px"/></span>
  694. </template>
  695. </template>
  696. </el-table-column>
  697. <el-table-column label="操作" v-if="!authFlag" fixed="right" align="center" width="120">
  698. <template slot-scope="{row,$index}">
  699. <a type="text" v-if="row.status === '草稿'" @click="handleSaveQuoteDetail(row)">编辑</a>
  700. <a type="text" v-if="row.status === '草稿'" @click="handleDeleteQuoteDetail(row)">删除</a>
  701. <!-- <a type="text" v-if="row.status !== '下达'" @click="againQuoteDetail(row)">重新报价</a>-->
  702. <a type="text" v-if="row.status === '下达'" @click="handleDetail(row)">详情</a>
  703. </template>
  704. </el-table-column>
  705. </el-table>
  706. <el-dialog :title="`报价明细`" top="10vh" v-drag :visible.sync="saveVisible" append-to-body :width="`${saveQuoteDetail.id?1200:600}px`" :close-on-click-modal="false">
  707. <el-form :model="saveQuoteDetail" ref="saveQuoteDetailForm" :rules="saveQuoteDetailRules" label-position="top" v-if="!saveQuoteDetail.id">
  708. <el-row :gutter="20">
  709. <el-col :span="8">
  710. <el-form-item label="物料编码" prop="partNo" :show-message="false">
  711. <span slot="label" v-if="!quoteGroupDetail">
  712. <a @click="partVisible = true">物料编码</a>
  713. </span>
  714. <el-input v-model="saveQuoteDetail.partNo" :disabled="quoteGroupDetail" @blur="handlePartNoBlur"></el-input>
  715. </el-form-item>
  716. </el-col>
  717. <el-col :span="16">
  718. <el-form-item label="物料描述" prop="partDesc" :show-message="false">
  719. <el-input v-model="saveQuoteDetail.partDesc" disabled></el-input>
  720. </el-form-item>
  721. </el-col>
  722. <el-col :span="8">
  723. <el-form-item label="报价数量" prop="qty" :show-message="false">
  724. <el-input-number style="width: 100%;" v-model="saveQuoteDetail.qty" :min="1" :step="0" :precision="0" :controls="false"></el-input-number>
  725. </el-form-item>
  726. </el-col>
  727. <el-col :span="6">
  728. <el-form-item label="TP类型" prop="type" :show-message="false">
  729. <el-select v-model="saveQuoteDetail.type" placeholder="请选择" style="width: 100%;">
  730. <el-option label="Standard TP" value="Standard TP"></el-option>
  731. <el-option label="Weighted TP" value="Weighted TP"></el-option>
  732. </el-select>
  733. </el-form-item>
  734. </el-col>
  735. <el-col :span="6">
  736. <el-form-item label="Cost Model" prop="costModel" :show-message="false">
  737. <el-select v-model="saveQuoteDetail.costModel" style="width: 100%;">
  738. <el-option label="2020" value="2020"></el-option>
  739. <el-option label="UFIDA" value="UFIDA"></el-option>
  740. </el-select>
  741. </el-form-item>
  742. </el-col>
  743. </el-row>
  744. <el-row :gutter="20">
  745. <el-col :span="8">
  746. <el-form-item label="" :show-message="false">
  747. <el-checkbox v-model="saveQuoteDetail.isDetail">保存进入报价页面</el-checkbox>
  748. </el-form-item>
  749. </el-col>
  750. <el-col :span="24">
  751. <el-form-item label="备注" class="auto" :show-message="false">
  752. <el-input type="textarea" v-model="saveQuoteDetail.remark" :autosize="{minRows: 3, maxRows: 3}"></el-input>
  753. </el-form-item>
  754. </el-col>
  755. </el-row>
  756. </el-form>
  757. <el-form v-else :model="saveQuoteDetail" ref="saveQuoteDetailForm" :rules="saveQuoteDetailRules" label-position="top">
  758. <el-row :gutter="20">
  759. <el-col :span="4">
  760. <el-form-item label="物料编码" prop="partNo" :show-message="false">
  761. <el-input v-model="saveQuoteDetail.partNo" disabled></el-input>
  762. </el-form-item>
  763. </el-col>
  764. <el-col :span="6">
  765. <el-form-item label="物料描述" prop="partDesc" :show-message="false">
  766. <el-input v-model="saveQuoteDetail.partDesc" disabled></el-input>
  767. </el-form-item>
  768. </el-col>
  769. <el-col :span="3">
  770. <el-form-item label="报价数量" prop="qty" :show-message="false">
  771. <el-input-number v-model="saveQuoteDetail.qty" style="width: 100%;" :controls="false" :disabled="saveQuoteDetail.status === '下达'"></el-input-number>
  772. </el-form-item>
  773. </el-col>
  774. <el-col :span="3">
  775. <el-form-item label="TP类型" prop="type" :show-message="false">
  776. <el-select v-model="saveQuoteDetail.type" placeholder="请选择" style="width: 100%;">
  777. <el-option label="Standard TP" value="Standard TP"></el-option>
  778. <el-option label="Weighted TP" value="Weighted TP"></el-option>
  779. </el-select>
  780. </el-form-item>
  781. </el-col>
  782. <el-col :span="3">
  783. <el-form-item label="Cost Model" prop="costModel" :show-message="false">
  784. <el-select v-model="saveQuoteDetail.costModel" style="width: 100%;">
  785. <el-option label="2020" value="2020"></el-option>
  786. <el-option label="UFIDA" value="UFIDA"></el-option>
  787. </el-select>
  788. </el-form-item>
  789. </el-col>
  790. </el-row>
  791. <el-row :gutter="20">
  792. <el-col :span="19">
  793. <el-form-item label="备注" class="auto" :show-message="false">
  794. <el-input type="textarea" resize="none" :autosize="{minRows: 3, maxRows: 3}" v-model="saveQuoteDetail.remark" :disabled="saveQuoteDetail.status === '下达'"></el-input>
  795. </el-form-item>
  796. </el-col>
  797. </el-row>
  798. </el-form>
  799. <el-tabs v-model="activeName" v-if="saveQuoteDetail.id" @tab-click="handleClickTab">
  800. <el-tab-pane label="材料" name="bom">
  801. <quote-detail-bom v-if="saveVisible" @close="handleClose" v-model:quoteDetail="saveQuoteDetail"></quote-detail-bom>
  802. </el-tab-pane>
  803. <el-tab-pane label="工艺" name="routing">
  804. <quote-detail-routing ref="routing" v-if="saveVisible" @close="handleClose" v-model:quoteDetail="saveQuoteDetail"></quote-detail-routing>
  805. </el-tab-pane>
  806. <el-tab-pane label="工具" name="tool">
  807. <quote-detail-tool v-if="saveVisible" v-model:quoteDetail="saveQuoteDetail"></quote-detail-tool>
  808. </el-tab-pane>
  809. <el-tab-pane label="其他成本" name="other">
  810. <quote-detail-other v-if="saveVisible" v-model:quoteDetail="saveQuoteDetail"></quote-detail-other>
  811. </el-tab-pane>
  812. <el-tab-pane label="成本&价格" name="cost">
  813. <quote-detail-cost v-if="saveVisible" ref="cost" v-model:quoteDetail="saveQuoteDetail"></quote-detail-cost>
  814. </el-tab-pane>
  815. <el-tab-pane label="2020 Rate" name="rate" v-if="saveQuoteDetail.costModel === '2020'">
  816. <quote-detail-calculation v-if="activeName === 'rate'" v-model:quote-detail="saveQuoteDetail"></quote-detail-calculation>
  817. </el-tab-pane>
  818. </el-tabs>
  819. <div slot="footer" class="dialog-footer">
  820. <el-button type="primary" v-if="saveQuoteDetail.status === '草稿'" :loading="saveLoading" @click="handleSaveQuoteDetailClick"> </el-button>
  821. <el-button @click="saveVisible = false"> </el-button>
  822. </div>
  823. </el-dialog>
  824. <part-table v-if="saveVisible" v-model="partVisible" :is-page="true" :part-no="saveQuoteDetail.partNo" @dblclick="handleDblClick"></part-table>
  825. <!-- <project-part-table v-if="saveVisible" v-model="partVisible" :project-no="saveQuoteDetail.projectNo" :part-no="saveQuoteDetail.partNo" @dblclick="handleDblClick"></project-part-table>-->
  826. </div>
  827. </template>
  828. <style scoped>
  829. .auto /deep/ .el-form-item__content{
  830. height: auto;
  831. line-height: 1.5;
  832. }
  833. .radio /deep/ .el-radio__label{
  834. display: none;
  835. }
  836. </style>