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.

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