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.

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