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.

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