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.

785 lines
63 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <script>
  2. import {
  3. deleteQuotationDetail,
  4. insertQuotationDetail,
  5. searchQuotationDetailPageByHeaderId, updateQuotationDetail
  6. } from "../../../../api/quotation/quotationHeader";
  7. import {getProjectPart, getProjectPartList} from "../../../../api/project/project";
  8. import ToolQuotation from "./quotationDetail/toolQuotation.vue";
  9. import PropertyTemplates from "./quotationDetail/propertyTemplates.vue";
  10. import CostPrice from "./quotationDetail/costPrice.vue";
  11. import BillOfMateriel from "./quotationDetail/billOfMateriel.vue";
  12. import {Decimal} from "decimal.js";
  13. import {searchQuoteBomHeader, searchQuoteBomList} from "../../../../api/quotation/quoteOfBom";
  14. import QuoteRouting from "./quotationDetail/quoteRouting.vue";
  15. import {searchQuoteRoutingHeader} from "../../../../api/quotation/quoteOfRouting";
  16. export default {
  17. name:'quoteDetail',
  18. components: {QuoteRouting, BillOfMateriel, CostPrice, PropertyTemplates, ToolQuotation},
  19. props:{
  20. header:{
  21. type:Object,
  22. request:true,
  23. }
  24. },
  25. watch:{
  26. header:function (){
  27. this.initData()
  28. }
  29. },
  30. data(){
  31. const validateProductNo = (rule, value, callback) =>{
  32. if (this.quotationDetailFlag !== true && this.quotationLeadIntoDetailFlag !== true){
  33. return;
  34. }
  35. if (value === '' || value === null || value === undefined){
  36. callback(new Error(' '))
  37. return
  38. }
  39. let params = {...this.projectPartData}
  40. params.testPartNo = value
  41. getProjectPart(params).then(({data})=>{
  42. if (data && data.rows.length === 1){
  43. callback()
  44. return
  45. }
  46. this.projectPartData.testPartNo = undefined;
  47. this.$message.error("产品编码不存在!")
  48. callback(new Error(" "))
  49. }).catch((error)=>{
  50. this.projectPartData.testPartNo = undefined
  51. callback(new Error(' '))
  52. })
  53. };
  54. return{
  55. index:'',
  56. insertQuotationDetailLoading:false,
  57. projectPartDialogFlag:false,
  58. quotationLeadIntoDetailFlag:false,
  59. initQuotationDetailLoading:false,
  60. quotationDetailFlag:false,
  61. editQuotationDetailLoading:false,
  62. no: 1,//当前页
  63. size: 20,//每页条数
  64. total: 0,//总条数
  65. tableData:[],
  66. projectPartTable:[],
  67. projectPartDetailList: [
  68. {
  69. userId: this.$store.state.user.name,
  70. functionId: 102001,
  71. serialNumber: '102001Table3TestPartNo',
  72. tableId: '102001Table3',
  73. tableName: '项目物料表',
  74. columnProp: 'testPartNo',
  75. headerAlign: 'center',
  76. align: 'center',
  77. columnLabel: '产品编码',
  78. columnHidden: false,
  79. columnImage: false,
  80. columnSortable: false,
  81. sortLv: 0,
  82. status: true,
  83. fixed: '',
  84. columnWidth: 150
  85. },
  86. {
  87. userId: this.$store.state.user.name,
  88. functionId: 102001,
  89. serialNumber: '102001Table3PartDesc',
  90. tableId: '102001Table3',
  91. tableName: '项目物料表',
  92. columnProp: 'partDesc',
  93. headerAlign: 'center',
  94. align: 'center',
  95. columnLabel: '产品名称',
  96. columnHidden: false,
  97. columnImage: false,
  98. columnSortable: false,
  99. sortLv: 0,
  100. status: true,
  101. fixed: '',
  102. columnWidth: 120
  103. },{
  104. userId: this.$store.state.user.name,
  105. functionId: 102001,
  106. serialNumber: '102001Table3PartSpec',
  107. tableId: '102001Table3',
  108. tableName: '项目物料表',
  109. columnProp: 'partSpec',
  110. headerAlign: 'center',
  111. align: 'center',
  112. columnLabel: '产品规格',
  113. columnHidden: false,
  114. columnImage: false,
  115. columnSortable: false,
  116. sortLv: 0,
  117. status: true,
  118. fixed: '',
  119. columnWidth: 120
  120. },{
  121. userId: this.$store.state.user.name,
  122. functionId: 102001,
  123. serialNumber: '102001Table3PartTypeDesc',
  124. tableId: '102001Table3',
  125. tableName: '项目物料表',
  126. columnProp: 'partTypeDesc',
  127. headerAlign: 'center',
  128. align: 'center',
  129. columnLabel: '产品类型',
  130. columnHidden: false,
  131. columnImage: false,
  132. columnSortable: false,
  133. sortLv: 0,
  134. status: true,
  135. fixed: '',
  136. columnWidth: 120
  137. },{
  138. userId: this.$store.state.user.name,
  139. functionId: 102001,
  140. serialNumber: '102001Table3CodeNo',
  141. tableId: '102001Table3',
  142. tableName: '项目物料表',
  143. columnProp: 'codeNo',
  144. headerAlign: 'center',
  145. align: 'center',
  146. columnLabel: '模板编码',
  147. columnHidden: false,
  148. columnImage: false,
  149. columnSortable: false,
  150. sortLv: 0,
  151. status: true,
  152. fixed: '',
  153. columnWidth: 120
  154. },{
  155. userId: this.$store.state.user.name,
  156. functionId: 102001,
  157. serialNumber: '102001Table3CodeDesc',
  158. tableId: '102001Table3',
  159. tableName: '项目物料表',
  160. columnProp: 'codeDesc',
  161. headerAlign: 'center',
  162. align: 'center',
  163. columnLabel: '模板名称',
  164. columnHidden: false,
  165. columnImage: false,
  166. columnSortable: false,
  167. sortLv: 0,
  168. status: true,
  169. fixed: '',
  170. columnWidth: 120
  171. }
  172. ],
  173. //报价明细新增对象
  174. quotationDetail: {
  175. quotationDetailId: undefined,//主键
  176. quotationHeaderId: undefined,//父编号
  177. site: this.$store.state.user.site,// 工厂编号
  178. productNo: undefined,//产品编码
  179. productDesc: undefined,//产品名称
  180. quotationDetailQuantity: 1,//报价数量
  181. internalInquiryNo: undefined,//内部询价单号
  182. itemNo:0,//序号
  183. quotationDetailStatus: "草稿",//报价状态
  184. taxRate: 13,//税率
  185. remark: undefined,//备注
  186. flag:false
  187. },
  188. projectPartData:{
  189. site:this.$store.state.user.site,
  190. testPartNo:undefined,// 项目编号
  191. partDesc:undefined,// 项目名称
  192. },
  193. fullscreen:false,
  194. // 报价明细 参数列表
  195. quotationDetailColumns: [
  196. {label: "productDesc", value: "产品名称"},
  197. {label: "quotationDetailQuantity", value: "报价数量"},
  198. {label: "internalInquiryNo", value: "内部询价单号"},
  199. {label: "quotationDetailStatus", value: "报价状态"},
  200. {label: "itemNo", value: "序号"},
  201. {label: "adjustPartCost", value: "调整后的材料成本"},
  202. {label: "adjustMachineCost", value: "调整后的机器成本"},
  203. {label: "adjustFabricateCost", value: "调整后的制造费用"},
  204. {label: "adjustLabourCost", value: "调整后人的工成本"},
  205. {label: "adjustToolCost", value: "调整后的工具成本"},
  206. {label: "detailManageCost", value: "管理成本"},
  207. {label: "detailOtherCost", value: "其他成本"},
  208. {label: "detailProfitRate", value: "利润率"},
  209. {label: "finalUntaxedPrice", value: "最终去税价格"},
  210. ],
  211. // 报价详情表单校验
  212. quotationDetailRules: {
  213. productNo: [{required: true,validator:validateProductNo,trigger: 'change'}],
  214. productDesc: [{required: true, message: ' ', trigger: ['change','blur']}],
  215. quotationDetailStatus: [{required: true, message: ' ', trigger: 'change'}],
  216. internalInquiryNo: [{required: true, message: ' ', trigger: ['change','blur']}],
  217. itemNo:[{required: true, message: ' ', trigger: ['change','blur']}],
  218. quotationDetailQuantity: [{required: true, message: ' ', trigger: ['change','blur']}],
  219. },
  220. activeName:'bom',
  221. }
  222. },
  223. methods:{
  224. // 报价详情size 改变
  225. detailSizeChange(val) {
  226. this.size = val;
  227. this.initData();
  228. },
  229. // 报价详情 页码
  230. detailCurrentChange(val) {
  231. this.no = val;
  232. this.initData();
  233. },
  234. // 查询报价明细
  235. initData() {
  236. let params = {
  237. no: this.no,
  238. size: this.size,
  239. quotationHeaderId: this.header.quotationHeaderId
  240. }
  241. this.tableData = [];
  242. this.initQuotationDetailLoading = true;
  243. searchQuotationDetailPageByHeaderId(params).then(({data}) => {
  244. this.initQuotationDetailLoading = false;
  245. if (data && data.code === 200) {
  246. this.tableData = data.data.records;
  247. this.total = data.data.total;
  248. }else {
  249. this.tableData = [];
  250. this.total = 0;
  251. }
  252. }).catch((error)=>{
  253. this.initQuotationDetailLoading = false;
  254. })
  255. },
  256. // 修改 报价详情
  257. editQuotationDetail(row,index) {
  258. if (index < 10){
  259. this.index = "00"+index;
  260. }else if (index%10 <= 10){
  261. this.index = "0"+index;
  262. }else if (index%100 <= 10){
  263. this.index = index
  264. }
  265. this.quotationDetail = JSON.parse(JSON.stringify(row));
  266. this.quotationDetailFlag = true;
  267. },
  268. // 删除 报价明细
  269. deleteQuotationDetailData(row){
  270. this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
  271. confirmButtonText: '确定',
  272. cancelButtonText: '取消',
  273. type: 'warning'
  274. }).then(() => {
  275. deleteQuotationDetail(row).then(({data})=>{
  276. if (data.code === 200){
  277. this.initData();
  278. this.$message.success(data.msg);
  279. }else {
  280. this.$message.error(data.msg);
  281. }
  282. })
  283. })
  284. },
  285. openInsertQuotationDetail() {
  286. this.quotationDetail.quotationHeaderId = this.header.quotationHeaderId;
  287. this.quotationDetail.internalInquiryNo = this.header.internalInquiryNo;
  288. },
  289. closeInsertQuotationDetail() {
  290. this.$refs['insertQuotationDetailForm'].resetFields();
  291. this.resetQuotationDetail();
  292. },
  293. resetQuotationDetail(){
  294. this.quotationDetail = {
  295. quotationDetailId: undefined,//主键
  296. quotationHeaderId: undefined,//父编号
  297. site: this.$store.state.user.site,// 工厂编号
  298. productNo: undefined,//产品编码
  299. productDesc: undefined,//产品名称
  300. quotationDetailQuantity: 1,//报价数量
  301. internalInquiryNo: undefined,//内部询价单号
  302. itemNo:0,//序号
  303. quotationDetailStatus: "草稿",//报价状态
  304. taxRate: 13,//税率
  305. remark: undefined,//备注
  306. flag:false
  307. };
  308. },
  309. insertQuotationDetailBtn() {
  310. this.$refs['insertQuotationDetailForm'].validate((validate, objects) => {
  311. if (validate) {
  312. this.insertQuotationDetailLoading = true;
  313. insertQuotationDetail(this.quotationDetail).then(({data}) => {
  314. this.insertQuotationDetailLoading = false;
  315. if (data.code === 200) {
  316. // 保存成功后
  317. if (this.quotationDetail.flag) {
  318. this.$nextTick(()=>{
  319. this.quotationDetail = JSON.parse(JSON.stringify(data.data));
  320. })
  321. this.quotationDetailFlag = true;
  322. }else {
  323. this.quotationLeadIntoDetailFlag = false;
  324. }
  325. this.initData();
  326. this.$message.success(data.msg);
  327. } else {
  328. this.$message.error(data.msg);
  329. }
  330. }).catch((error)=>{
  331. this.insertQuotationDetailLoading = false;
  332. })
  333. } else {
  334. this.rulesValidateLabel(objects, this.quotationDetailColumns);
  335. }
  336. })
  337. },
  338. // 校验处理
  339. rulesValidateLabel(objects, labels) {
  340. for (let filed in objects) {
  341. for (let i = 0; i < labels.length; i++) {
  342. let quotationToolColumn = labels[i];
  343. if (quotationToolColumn.label === filed) {
  344. this.$message.warning(quotationToolColumn.value+"为空或填写不正确");
  345. return
  346. }
  347. }
  348. }
  349. },
  350. closeProjectPartDialog(){
  351. this.projectPartData = {
  352. site:this.$store.state.user.site,
  353. testPartNo:undefined,// 项目编号
  354. partDesc:undefined,// 项目名称
  355. }
  356. this.projectPartTable = [];
  357. },
  358. openProjectPartDialog(){
  359. this.getProjectPartList();
  360. },
  361. getProjectPartList(){
  362. let params = {...this.projectPartData}
  363. params.projectId = this.header.projectId
  364. getProjectPartList(params).then(({data})=>{
  365. if (data && data.code === 0){
  366. this.projectPartTable = data.rows;
  367. }
  368. })
  369. },
  370. // 项目物料双击事件
  371. dblClickProjectPartTable(row){
  372. this.quotationDetail.productNo = row.testPartNo;
  373. this.quotationDetail.productDesc = row.partDesc;
  374. this.projectPartDialogFlag = false;
  375. },
  376. closeDetailEditDialog(){
  377. this.activeName = 'bom'
  378. this.fullscreen = false;
  379. this.resetQuotationDetail();
  380. this.$refs.cost.restCostForm()
  381. // 关闭新增弹框
  382. this.quotationLeadIntoDetailFlag = false;
  383. },
  384. openQuotationDetail(){
  385. this.$nextTick(()=>{
  386. this.$refs.property.getPropertyTemplatesItem();// 属性
  387. this.$refs.tool.initQuotationToolData();//刀具
  388. this.searchQuoteBomList();//bom
  389. this.searchQuoteRoutingHeader();// routing
  390. })
  391. },
  392. searchQuoteRoutingHeader(){
  393. let params = {
  394. site:this.$store.state.user.site,
  395. quoteDetailId:this.quotationDetail.quotationDetailId,
  396. testPartNo:this.quotationDetail.productNo
  397. }
  398. searchQuoteRoutingHeader(params).then(({data})=>{
  399. if (data && data.code === 0){
  400. let row = data.row
  401. let arr = [];
  402. if (row){
  403. arr[0] = row.version;
  404. arr[1] = row.routingType;
  405. arr[2] = row.alternativeNo;
  406. }
  407. this.$refs.routing.setSelectRouting(arr);
  408. }else {
  409. this.$message.warning(data.msg)
  410. }
  411. }).catch((error)=>{
  412. this.$message.error(error)
  413. })
  414. },
  415. searchQuoteBomList(){
  416. let params = {
  417. site:this.$store.state.user.site,
  418. quoteDetailId:this.quotationDetail.quotationDetailId,
  419. testPartNo:this.quotationDetail.productNo
  420. }
  421. searchQuoteBomHeader(params).then(({data})=>{
  422. if (data && data.code === 0){
  423. let row = data.row
  424. let arr = [];
  425. if (row){
  426. arr[0] = row.version;
  427. arr[1] = row.bomType;
  428. arr[2] = row.alternativeNo;
  429. }
  430. this.$refs.bom.setSelectBom(arr);
  431. }else {
  432. this.$message.warning(data.msg)
  433. }
  434. }).catch((error)=>{
  435. this.$message.error(error)
  436. })
  437. },
  438. saveQuotationDetail(){
  439. if (!this.$refs.cost.ruleCostForm()) {
  440. return
  441. }
  442. let params = this.$refs.cost.getQuotationDetail();
  443. this.editQuotationDetailLoading = true;
  444. updateQuotationDetail(params).then(({data}) => {
  445. this.editQuotationDetailLoading = false;
  446. if (data.code === 200) {
  447. this.quotationDetailFlag = false;
  448. this.initData();
  449. this.$message.success(data.msg);
  450. } else {
  451. this.$message.warning(data.msg);
  452. }
  453. }).catch((error)=>{
  454. this.$message.error(error);
  455. this.editQuotationDetailLoading = false;
  456. })
  457. // this.$message.success(this.$refs.cost.getQuotationDetail())
  458. // this.quotationDetailFlag = false;
  459. },
  460. tabClick(tab){
  461. if (this.activeName === 'cost'){
  462. this.setQuoteCost();
  463. }
  464. },
  465. setQuoteCost(){
  466. let bomCost = new Decimal(this.$refs.bom.getQuoteBomCost()).mul(new Decimal(this.quotationDetail.quotationDetailQuantity))
  467. let toolCost = new Decimal(this.$refs.tool.getQuotationToolList()).mul(new Decimal(this.quotationDetail.quotationDetailQuantity))
  468. let packCost = new Decimal(this.$refs.property.getPackInfoCost()).mul(new Decimal(this.quotationDetail.quotationDetailQuantity))
  469. let shippingCost = new Decimal(this.$refs.property.getShippingInfoCost()).mul(new Decimal(this.quotationDetail.quotationDetailQuantity))
  470. this.$nextTick(()=>{
  471. this.$refs.cost
  472. .setCost(bomCost,0,0,0,toolCost,
  473. packCost,shippingCost)
  474. })
  475. },
  476. editQuotationDetailStatus(row,status){
  477. let params = JSON.parse(JSON.stringify(row))
  478. params.quotationDetailStatus = status;
  479. updateQuotationDetail(params).then(({data}) => {
  480. if (data.code === 200) {
  481. this.initData();
  482. this.$message.success(data.msg);
  483. } else {
  484. this.$message.warning(data.msg);
  485. }
  486. }).catch((error)=>{
  487. this.$message.error(error);
  488. })
  489. }
  490. },
  491. }
  492. </script>
  493. <template>
  494. <div>
  495. <div style="margin-bottom: 10px;padding-left: 10px">
  496. <el-button type="primary" @click="quotationLeadIntoDetailFlag = true">新增</el-button>
  497. </div>
  498. <el-table v-loading="initQuotationDetailLoading" element-loading-text = "数据正在加载中"
  499. element-loading-spinner = "el-icon-loading" :data="tableData" height="360px" stripe border
  500. :header-cell-style="{background:'rgba(23,179,163)',color:'#fff'}">
  501. <el-table-column
  502. label="操作"
  503. fixed
  504. width="120" align="center">
  505. <template slot-scope="{row,$index}">
  506. <el-link style="cursor: pointer" v-if="row.quotationDetailStatus !== '下达'" @click="editQuotationDetailStatus(row,'下达')">下达</el-link>
  507. <el-link style="cursor: pointer" @click="editQuotationDetail(row,$index+1)">编辑</el-link>
  508. <el-link style="cursor: pointer" @click="deleteQuotationDetailData(row)">删除</el-link>
  509. </template>
  510. </el-table-column>
  511. <el-table-column
  512. header-align="center"
  513. label="序号"
  514. width="55"
  515. align="right"
  516. type="index">
  517. </el-table-column>
  518. <el-table-column show-overflow-tooltip
  519. label="产品编码" prop="productNo"
  520. width="140" align="center">
  521. </el-table-column>
  522. <el-table-column show-overflow-tooltip
  523. header-align="center"
  524. label="产品名称" prop="productDesc"
  525. width="120" align="left">
  526. </el-table-column>
  527. <el-table-column show-overflow-tooltip header-align="center"
  528. label="报价数量" prop="quotationDetailQuantity"
  529. width="80" align="right">
  530. </el-table-column>
  531. <el-table-column label="计算后成本" align="center">
  532. <el-table-column show-overflow-tooltip
  533. label="材料成本" prop="computePartCost"
  534. width="120" align="right" header-align="center">
  535. </el-table-column>
  536. <el-table-column show-overflow-tooltip
  537. label="机器成本" prop="computeMachineCost"
  538. width="120" align="right" header-align="center">
  539. </el-table-column>
  540. <el-table-column show-overflow-tooltip
  541. label="人工成本" prop="computeLabourCost"
  542. width="120" align="right" header-align="center">
  543. </el-table-column>
  544. <el-table-column show-overflow-tooltip
  545. label="制造费用" prop="computeFabricateCost"
  546. width="120" align="right" header-align="center">
  547. </el-table-column>
  548. <el-table-column show-overflow-tooltip
  549. label="工具成本" prop="computeToolCost"
  550. width="120" align="right" header-align="center">
  551. </el-table-column>
  552. </el-table-column>
  553. <el-table-column label="调整后成本" align="center">
  554. <el-table-column show-overflow-tooltip
  555. label="材料成本" prop="adjustPartCost"
  556. width="120" align="right" header-align="center">
  557. </el-table-column>
  558. <el-table-column show-overflow-tooltip
  559. label="机器成本" prop="adjustMachineCost"
  560. width="120" align="right" header-align="center">
  561. </el-table-column>
  562. <el-table-column show-overflow-tooltip
  563. label="人工成本" prop="adjustLabourCost"
  564. width="120" align="right" header-align="center">
  565. </el-table-column>
  566. <el-table-column show-overflow-tooltip
  567. label="制造费用" prop="adjustFabricateCost"
  568. width="120" align="right" header-align="center">
  569. </el-table-column>
  570. <el-table-column show-overflow-tooltip
  571. label="工具成本" prop="adjustToolCost"
  572. width="120" align="right" header-align="center">
  573. </el-table-column>
  574. </el-table-column>
  575. <el-table-column show-overflow-tooltip
  576. label="其他成本" prop="detailOtherCost"
  577. width="120" align="right" header-align="center">
  578. </el-table-column>
  579. <el-table-column show-overflow-tooltip
  580. label="管理成本" prop="detailManageCost"
  581. width="120" align="right" header-align="center">
  582. </el-table-column>
  583. <el-table-column show-overflow-tooltip
  584. label="总成本" prop="detailTotalCost"
  585. width="120" align="right" header-align="center">
  586. </el-table-column>
  587. <el-table-column show-overflow-tooltip
  588. label="利润率%" prop="detailProfitRate"
  589. width="80" align="right" header-align="center">
  590. </el-table-column>
  591. <el-table-column show-overflow-tooltip
  592. label="利润额" prop="detailProfitAmount"
  593. width="120" align="right" header-align="center">
  594. </el-table-column>
  595. <el-table-column show-overflow-tooltip
  596. label="未税单价" prop="finalUntaxedPrice"
  597. width="120" align="right" header-align="center">
  598. </el-table-column>
  599. <el-table-column show-overflow-tooltip
  600. label="未税总价" prop="systemComputeAmount"
  601. width="120" align="right" header-align="center">
  602. </el-table-column>
  603. <el-table-column show-overflow-tooltip
  604. label="税率%" prop="taxRate"
  605. width="90" align="right" header-align="center">
  606. </el-table-column>
  607. <el-table-column show-overflow-tooltip
  608. label="含税单价" prop="finalTaxedPrice"
  609. width="120" align="right" header-align="center">
  610. </el-table-column>
  611. <el-table-column show-overflow-tooltip
  612. label="含税总价" prop="systemComputePrice"
  613. width="120" align="right" header-align="center">
  614. </el-table-column>
  615. <el-table-column show-overflow-tooltip
  616. label="状态" prop="quotationDetailStatus"
  617. width="80" align="center">
  618. </el-table-column>
  619. <el-table-column show-overflow-tooltip
  620. label="备注" prop="remark"
  621. width="80" align="left" header-align="center">
  622. </el-table-column>
  623. <el-table-column show-overflow-tooltip
  624. label="询价单号" prop="internalInquiryNo"
  625. width="160" align="center">
  626. </el-table-column>
  627. <el-table-column show-overflow-tooltip
  628. label="报价次数" prop="quotationDetailCount"
  629. width="80" align="right" header-align="center">
  630. </el-table-column>
  631. <div slot="empty">
  632. <svg height="180" node-id="1" sillyvg="true" template-height="1024" template-width="1024" version="1.1" viewBox="0 0 1024 1024" width="1024" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><defs node-id="115"><linearGradient gradientUnits="userSpaceOnUse" id="未命名的渐变_28" node-id="5" spreadMethod="pad" x1="26305.36" x2="26384.72" y1="-42886.72" y2="-42888.098"><stop offset="0" stop-color="#98d6fa"/><stop offset="1" stop-color="#47b0f1"/></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="未命名的渐变_28-2" node-id="8" spreadMethod="pad" x1="26305.36" x2="26384.72" y1="-42886.72" y2="-42888.098"><stop offset="0" stop-color="#98d6fa"/><stop offset="1" stop-color="#47b0f1"/></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="未命名的渐变_3" node-id="9" spreadMethod="pad" x1="198806.11" x2="199736.11" y1="-228966.97" y2="-228966.97"><stop offset="0" stop-color="#fff5de"/><stop offset="1" stop-color="#fbd2ac"/></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="未命名的渐变_28-3" node-id="12" spreadMethod="pad" x1="15798.319" x2="15845.487" y1="-23888.906" y2="-23889.418"><stop offset="0" stop-color="#98d6fa"/><stop offset="1" stop-color="#47b0f1"/></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="未命名的渐变_28-4" node-id="13" spreadMethod="pad" x1="10883.409" x2="10916.618" y1="-16576.174" y2="-16576.527"><stop offset="0" stop-color="#98d6fa"/><stop offset="1" stop-color="#47b0f1"/></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="未命名的渐变_28-5" node-id="14" spreadMethod="pad" x1="10883.409" x2="10916.618" y1="-16576.174" y2="-16576.527"><stop offset="0" stop-color="#98d6fa"/><stop offset="1" stop-color="#47b0f1"/></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="未命名的渐变_28-6" node-id="15" spreadMethod="pad" x1="7478.883" x2="7501.544" y1="-11524.333" y2="-11524.578"><stop offset="0" stop-color="#98d6fa"/><stop offset="1" stop-color="#47b0f1"/></linearGradient><linearGradient gradientTransform="matrix(269.22 47.47 27.01 -153.15 -82548.68 133303.42)" gradientUnits="userSpaceOnUse" id="未命名的渐变_28-7" node-id="16" spreadMethod="pad" x1="213.04" x2="213.68" y1="931.65" y2="931.72"><stop offset="0" stop-color="#98d6fa"/><stop offset="1" stop-color="#47b0f1"/></linearGradient><linearGradient gradientTransform="matrix(50.26 -50.26 -135.69 -135.69 115943.22 138005.55)" gradientUnits="userSpaceOnUse" id="未命名的渐变_13" node-id="17" spreadMethod="pad" x1="213.03" x2="213.21" y1="932.64" y2="932.57"><stop offset="0.03" stop-color="#afdef9"/><stop offset="1" stop-color="#7cc9f9"/></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="未命名的渐变_28-8" node-id="20" spreadMethod="pad" x1="43370.684" x2="43480.617" y1="-201779.2" y2="-201831.23"><stop offset="0" stop-color="#98d6fa"/><stop offset="1" stop-color="#47b0f1"/></linearGradient><linearGradient gradientTransform="matrix(64.64 -31.53 -95 -194.77 74960.15 188980.58)" gradientUnits="userSpaceOnUse" id="未命名的渐变_13-2" node-id="21" spreadMethod="pad" x1="212.15" x2="212.28" y1="932.39" y2="932.32"><stop offset="0.03" stop-color="#afdef9"/><stop offset="1" stop-color="#7cc9f9"/></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="未命名的渐变_28-9" node-id="22" spreadMethod="pad" x1="23507.504" x2="23531.85" y1="-226021.66" y2="-226160.14"><stop offset="0" stop-color="#98d6fa"/><stop offset="1" stop-color="#47b0f1"/></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="未命名的渐变_13-3" node-id="23" spreadMethod="pad" x1="15016.36" x2="15028.444" y1="-178656.97" y2="-178643.53"><stop offset="0.03" stop-color="#afdef9"/><stop offset="1" stop-color="#7cc9f9"/></linearGradient><linearGradient gradientUnits="userSpaceOnUse" id="未命名的渐变_28-10" node-id="24" spreadMethod="pad" x1="8457.1875" x2="8441.035" y1="-33805.3" y2="-33833.215"><stop offset="0" stop-color="#98d6fa"/><stop offset="1" stop-color=
  633. <p><span>暂无数据</span></p>
  634. </div>
  635. </el-table>
  636. <el-pagination style="margin-top: 0px"
  637. @size-change="detailSizeChange"
  638. @current-change="detailCurrentChange"
  639. :current-page="no"
  640. :page-sizes="[20, 50, 100, 200, 500]"
  641. :page-size="size"
  642. :total="total"
  643. layout="total,sizes, prev, pager, next, jumper">
  644. </el-pagination>
  645. <el-dialog title="新增报价明细" v-drag @open="openInsertQuotationDetail" @close="closeInsertQuotationDetail"
  646. :visible.sync="quotationLeadIntoDetailFlag" width="40%" :close-on-click-modal="false">
  647. <el-form :model="quotationDetail" ref="insertQuotationDetailForm" :rules="quotationDetailRules"
  648. label-position="top">
  649. <el-row :gutter="10">
  650. <el-col :span="8">
  651. <el-form-item label="产品编码" prop="productNo">
  652. <span slot="label" style="" @click="projectPartDialogFlag = true"><a>产品编码</a></span>
  653. <el-input v-model="quotationDetail.productNo" clearable/>
  654. </el-form-item>
  655. </el-col>
  656. <el-col :span="14">
  657. <el-form-item label="产品名称" prop="productDesc">
  658. <el-input v-model="quotationDetail.productDesc" disabled clearable/>
  659. </el-form-item>
  660. </el-col>
  661. </el-row>
  662. <el-row>
  663. <el-col :span="8">
  664. <el-form-item label="报价数量" prop="quotationDetailQuantity">
  665. <el-input-number style="width: 100%;margin-top: -5px;" :min="1" v-model="quotationDetail.quotationDetailQuantity" :controls="false"></el-input-number>
  666. </el-form-item>
  667. </el-col>
  668. </el-row>
  669. <el-row>
  670. <el-col :span="22">
  671. <el-form-item label="">
  672. <el-checkbox v-model="quotationDetail.flag">保存进入报价界面</el-checkbox>
  673. </el-form-item>
  674. </el-col>
  675. </el-row>
  676. <el-row>
  677. <el-col :span="22">
  678. <el-form-item label="备注" style="display: block;min-height: 80px" prop="remark">
  679. <el-input type="textarea" resize="none" v-model="quotationDetail.remark" :autosize="{minRows: 3, maxRows: 3}"
  680. style="min-height: 80px"/>
  681. </el-form-item>
  682. </el-col>
  683. </el-row>
  684. </el-form>
  685. <div slot="footer" class="dialog-footer" style="margin-top: 20px">
  686. <el-button type="primary" :loading="insertQuotationDetailLoading" @click="insertQuotationDetailBtn"> </el-button>
  687. <el-button @click="quotationLeadIntoDetailFlag = false"> </el-button>
  688. </div>
  689. </el-dialog>
  690. <el-dialog v-drag :fullscreen="fullscreen" :visible.sync="quotationDetailFlag" @open="openQuotationDetail" @close="closeDetailEditDialog"
  691. width="60%" top="10vh" :close-on-click-modal="false">
  692. <div slot="title" class="medium">
  693. <div>
  694. <span class="el-dialog__title">报价单号 {{this.header.quotationNo+"-"+this.header.versionCode+"-"+index}}</span>
  695. <span style="float: right;margin-right: 30px;cursor:pointer;" @click="fullscreen = !fullscreen">
  696. <svg v-if="!fullscreen" t="1710144122404" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4774" width="16" height="16"><path d="M145.066667 85.333333h153.6c25.6 0 42.666667-17.066667 42.666666-42.666666S324.266667 0 298.666667 0H34.133333C25.6 0 17.066667 8.533333 8.533333 17.066667 0 25.6 0 34.133333 0 42.666667v256c0 25.6 17.066667 42.666667 42.666667 42.666666s42.666667-17.066667 42.666666-42.666666V145.066667l230.4 230.4c17.066667 17.066667 42.666667 17.066667 59.733334 0 17.066667-17.066667 17.066667-42.666667 0-59.733334L145.066667 85.333333z m170.666666 563.2L162.133333 802.133333l-76.8 76.8V725.333333C85.333333 699.733333 68.266667 682.666667 42.666667 682.666667s-42.666667 17.066667-42.666667 42.666666v256c0 25.6 17.066667 42.666667 42.666667 42.666667h256c25.6 0 42.666667-17.066667 42.666666-42.666667s-17.066667-42.666667-42.666666-42.666666H145.066667l76.8-76.8 153.6-153.6c17.066667-17.066667 17.066667-42.666667 0-59.733334-17.066667-17.066667-42.666667-17.066667-59.733334 0z m665.6 34.133334c-25.6 0-42.666667 17.066667-42.666666 42.666666v153.6l-76.8-76.8-153.6-153.6c-17.066667-17.066667-42.666667-17.066667-59.733334 0-17.066667 17.066667-17.066667 42.666667 0 59.733334l153.6 153.6 76.8 76.8H725.333333c-25.6 0-42.666667 17.066667-42.666666 42.666666s17.066667 42.666667 42.666666 42.666667h256c25.6 0 42.666667-17.066667 42.666667-42.666667v-256c0-25.6-17.066667-42.666667-42.666667-42.666666z m0-682.666667h-256c-25.6 0-42.666667 17.066667-42.666666 42.666667s17.066667 42.666667 42.666666 42.666666h153.6l-76.8 76.8-153.6 153.6c-17.066667 17.066667-17.066667 42.666667 0 59.733334 17.066667 17.066667 42.666667 17.066667 59.733334 0l153.6-153.6 76.8-76.8v153.6c0 25.6 17.066667 42.666667 42.666666 42.666666s42.666667-17.066667 42.666667-42.666666v-256c0-25.6-17.066667-42.666667-42.666667-42.666667z" fill="#8a8a8a" p-id="4775"></path></svg>
  697. <svg v-else t="1710143735808" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4603" width="16" height="16"><path d="M354.133333 682.666667H256v-42.666667h170.666667v170.666667H384v-98.133334L243.2 853.333333l-29.866667-29.866666L354.133333 682.666667z m358.4 0l140.8 140.8-29.866666 29.866666-140.8-140.8V810.666667h-42.666667v-170.666667h170.666667v42.666667h-98.133334zM354.133333 384L213.333333 243.2l29.866667-29.866667L384 354.133333V256h42.666667v170.666667H256V384h98.133333z m358.4 0H810.666667v42.666667h-170.666667V256h42.666667v98.133333L823.466667 213.333333l29.866666 29.866667L712.533333 384z" fill="#444444" p-id="4604"></path></svg>
  698. </span>
  699. </div>
  700. </div>
  701. <el-form :rules="quotationDetailRules" style="margin-top: 5px" ref="quotationDetailForm"
  702. :model="quotationDetail" label-width="80px" :inline="true" label-position="top">
  703. <el-form-item label="产品编码" prop="productNo">
  704. <el-input clearable disabled style="width: 160px" v-model="quotationDetail.productNo"/>
  705. </el-form-item>
  706. <el-form-item label="产品名称" prop="productDesc">
  707. <el-input clearable disabled style="width: 200px" v-model="quotationDetail.productDesc"/>
  708. </el-form-item>
  709. <el-form-item label="报价数量" prop="quotationDetailQuantity">
  710. <el-input-number disabled style="width: 100%;margin-top: -5px;" :min="1" v-model="quotationDetail.quotationDetailQuantity" :controls="false"></el-input-number>
  711. </el-form-item>
  712. <el-form-item label="备注" style="display: block;min-height: 90px;width: 60%">
  713. <el-input type="textarea" resize="none" disabled v-model="quotationDetail.remark" :autosize="{minRows: 3, maxRows: 3}"
  714. style="min-height: 80px" />
  715. </el-form-item>
  716. </el-form>
  717. <el-tabs v-model="activeName" @tab-click="tabClick" :style="{height:`${fullscreen?740:500}px`}" border stripe>
  718. <el-tab-pane name="bom" label="材料">
  719. <bill-of-materiel ref="bom" v-if="quotationDetailFlag" :height="fullscreen?655:415" :detail="quotationDetail"></bill-of-materiel>
  720. </el-tab-pane>
  721. <el-tab-pane name="routing" label="工艺">
  722. <quote-routing ref="routing" v-if="quotationDetailFlag" :height="fullscreen?655:415" :detail="quotationDetail"></quote-routing>
  723. </el-tab-pane>
  724. <el-tab-pane name="tool" label="工具">
  725. <tool-quotation ref="tool" v-if="quotationDetailFlag" :height="fullscreen?660:420" :detail="quotationDetail"></tool-quotation>
  726. </el-tab-pane>
  727. <el-tab-pane name="property" label="成品属性">
  728. <property-templates ref="property" v-if="quotationDetailFlag" :height="fullscreen?660:420" :detail="quotationDetail" ></property-templates>
  729. </el-tab-pane>
  730. <el-tab-pane name="cost" label="成本&价格">
  731. <cost-price ref="cost" v-if="quotationDetailFlag" :height="fullscreen?660:420" :detail="quotationDetail"></cost-price>
  732. </el-tab-pane>
  733. </el-tabs>
  734. <div slot="footer" style="padding-top: 10px">
  735. <el-button type="primary" :loading="editQuotationDetailLoading" @click="saveQuotationDetail"> </el-button>
  736. <el-button @click=" quotationDetailFlag= false"> </el-button>
  737. </div>
  738. </el-dialog>
  739. <el-dialog v-drag title="产品列表" @close="closeProjectPartDialog" @open="openProjectPartDialog"
  740. :visible.sync="projectPartDialogFlag">
  741. <!--搜索条件-->
  742. <el-form :model="projectPartData" ref="projectPartDataForm" :inline="true" label-position="top">
  743. <el-form-item label="产品编号" prop="toolNo">
  744. <el-input v-model="projectPartData.testPartNo" clearable/>
  745. </el-form-item>
  746. <el-form-item label="产品名称" prop="toolDescription">
  747. <el-input v-model="projectPartData.partDesc" clearable/>
  748. </el-form-item>
  749. <el-form-item label=" ">
  750. <el-button @click="getProjectPartList" type="primary"> </el-button>
  751. </el-form-item>
  752. </el-form>
  753. <el-table height="300px" stripe border width="30%" @row-dblclick="dblClickProjectPartTable"
  754. :data="projectPartTable" ref="projectPartDataTable" :style="{marginTop:'10px'}">
  755. <el-table-column
  756. v-for="(item,index) in projectPartDetailList" :key="index"
  757. :sortable="item.columnSortable"
  758. :prop="item.columnProp"
  759. :header-align="item.headerAlign"
  760. :show-overflow-tooltip="item.showOverflowTooltip"
  761. :align="item.align"
  762. :fixed="item.fixed===''?false:item.fixed"
  763. :min-width="item.columnWidth"
  764. :label="item.columnLabel">
  765. <template slot-scope="scope">
  766. <span v-if="!item.columnHidden">{{scope.row[item.columnProp]}}</span>
  767. <span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
  768. </template>
  769. </el-table-column>
  770. </el-table>
  771. </el-dialog>
  772. </div>
  773. </template>
  774. <style scoped>
  775. .el-input-number /deep/ .el-input__inner{
  776. text-align: right;
  777. padding-right: 5px !important;
  778. }
  779. </style>