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.

1323 lines
42 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
10 months ago
1 year ago
10 months ago
1 year ago
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <script>
  2. import QuoteSearch from "./primary/quoteSearch.vue";
  3. import QuoteTable from "./primary/quoteTable.vue";
  4. import {
  5. againQuote,
  6. queryQuotePage,
  7. queryQuoteRoleUser,
  8. removeQuote,
  9. saveQuote,
  10. updateQuote,
  11. updateQuoteStatus
  12. } from "../../../api/quote/quote";
  13. import QuoteDetail from "./detail/quoteDetail.vue";
  14. import ChooseList from '@/views/modules/common/Chooselist';
  15. import {queryCustomer} from "../../../api/customer/customerInformation";
  16. import DictDataSelect from "../sys/dict-data-select.vue";
  17. import {queryProjectByCustomer} from "../../../api/project/project";
  18. import quotationCustomerContact from "../quotation/sellForQuotation/quotationCustomerContact.vue";
  19. import CustomerInfo from "../quotation/sellForQuotation/customerInfo.vue";
  20. import OssComponents from "../oss/ossComponents.vue";
  21. import quotationProjectInformation from "../quotation/sellForQuotation/quotationProjectInformation.vue";
  22. import {searchQuotationByQuotationNo} from "../../../api/quotation/quotationInformation";
  23. import PriceCheckProperties from "../quotation/priceCheckProperties.vue";
  24. import ApprovalInformation from "../changeManagement/approvalInformation.vue";
  25. import {getPriceCheckPropertiesList} from "../../../api/quotation/priceCheckProperties";
  26. import {getApprovalList} from "../../../api/changeManagement/changeManagement";
  27. import QuoteGroupDetail from "./detail/quoteGroupDetail.vue";
  28. export default {
  29. name: "quote",
  30. components: {
  31. QuoteGroupDetail,
  32. ApprovalInformation, PriceCheckProperties,
  33. quotationProjectInformation, OssComponents, CustomerInfo, quotationCustomerContact,
  34. DictDataSelect,
  35. QuoteDetail,
  36. ChooseList,
  37. QuoteTable, QuoteSearch
  38. },
  39. props:{
  40. isMenu:{
  41. type:Boolean,
  42. default:true,
  43. },
  44. projectNo:{
  45. type:String,
  46. },
  47. height:{
  48. type:[Number,String],
  49. default:'35vh'
  50. }
  51. },
  52. menuId:5011,
  53. data(){
  54. return{
  55. total: 0,
  56. no:1,
  57. size: 20,
  58. quote:{
  59. id: null,
  60. site:"",
  61. quoteNo: "",
  62. customerInquiryNo: "",
  63. insideInquiryNo: "",
  64. buNo: "",
  65. buId: null,
  66. versionNo: "",
  67. status:'',
  68. quoteVersionNo: "",
  69. customerNo: "",
  70. customerDesc: "",
  71. projectNo: "",
  72. projectDesc: "",
  73. finalCustomerNo: "",
  74. finalCustomerDesc:"",
  75. currency: "",
  76. quoteDate: "",
  77. quoter: "",
  78. quoterName: "",
  79. purchase: "",
  80. purchaseName: "",
  81. remark: "",
  82. createBy: "",
  83. createDate: "",
  84. updateBy: "",
  85. updateDate: "",
  86. application: "",
  87. annualDemand: "",
  88. costModel: "UFIDA",
  89. markup:0,
  90. chipPrice:'',
  91. },
  92. quoteForm:{
  93. },
  94. saveQuote:{
  95. },
  96. dataList:[],
  97. columns: [
  98. {
  99. userId: this.$store.state.user.name,
  100. functionId: 5011,
  101. serialNumber: '5011Table1QuoteVersionNo',
  102. tableId: '5011Table1',
  103. tableName: '报价信息表',
  104. columnProp: 'quoteVersionNo',
  105. headerAlign: 'center',
  106. align: 'center',
  107. columnLabel: '报价单号',
  108. columnHidden: false,
  109. columnImage: false,
  110. columnSortable: false,
  111. sortLv: 0,
  112. status: true,
  113. fixed: '',
  114. columnWidth: 180
  115. },
  116. {
  117. userId: this.$store.state.user.name,
  118. functionId: 5011,
  119. serialNumber: '5011Table1QuoteDate',
  120. tableId: '5011Table1',
  121. tableName: '报价信息表',
  122. columnProp: 'quoteDate',
  123. headerAlign: 'center',
  124. align: 'center',
  125. columnLabel: '报价日期',
  126. columnHidden: false,
  127. columnImage: false,
  128. columnSortable: false,
  129. sortLv: 0,
  130. status: true,
  131. fixed: '',
  132. columnWidth: 100
  133. },
  134. {
  135. userId: this.$store.state.user.name,
  136. functionId: 5011,
  137. serialNumber: '5011Table1CustomerNo',
  138. tableId: '5011Table1',
  139. tableName: '报价信息表',
  140. columnProp: 'customerNo',
  141. headerAlign: 'center',
  142. align: 'center',
  143. columnLabel: '客户编码',
  144. columnHidden: false,
  145. columnImage: false,
  146. columnSortable: false,
  147. sortLv: 0,
  148. status: true,
  149. fixed: '',
  150. columnWidth: 120
  151. },
  152. {
  153. userId: this.$store.state.user.name,
  154. functionId: 5011,
  155. serialNumber: '5011Table1CustomerDesc',
  156. tableId: '5011Table1',
  157. tableName: '报价信息表',
  158. columnProp: 'customerDesc',
  159. headerAlign: 'center',
  160. align: 'left',
  161. columnLabel: '客户名称',
  162. columnHidden: false,
  163. columnImage: false,
  164. columnSortable: false,
  165. sortLv: 0,
  166. status: true,
  167. fixed: '',
  168. columnWidth: 120
  169. },
  170. {
  171. userId: this.$store.state.user.name,
  172. functionId: 5011,
  173. serialNumber: '5011Table1ProjectNo',
  174. tableId: '5011Table1',
  175. tableName: '报价信息表',
  176. columnProp: 'projectNo',
  177. headerAlign: 'center',
  178. align: 'left',
  179. columnLabel: '项目编码',
  180. columnHidden: false,
  181. columnImage: false,
  182. columnSortable: false,
  183. sortLv: 0,
  184. status: true,
  185. fixed: '',
  186. columnWidth: 120
  187. },
  188. {
  189. userId: this.$store.state.user.name,
  190. functionId: 5011,
  191. serialNumber: '5011Table1ProjectDesc',
  192. tableId: '5011Table1',
  193. tableName: '报价信息表',
  194. columnProp: 'projectDesc',
  195. headerAlign: 'center',
  196. align: 'left',
  197. columnLabel: '项目名称',
  198. columnHidden: false,
  199. columnImage: false,
  200. columnSortable: false,
  201. sortLv: 0,
  202. status: true,
  203. fixed: '',
  204. columnWidth: 120
  205. },
  206. {
  207. userId: this.$store.state.user.name,
  208. functionId: 5011,
  209. serialNumber: '5011Table1QuoterName',
  210. tableId: '5011Table1',
  211. tableName: '报价信息表',
  212. columnProp: 'quoterName',
  213. headerAlign: 'center',
  214. align: 'left',
  215. columnLabel: '报价专员',
  216. columnHidden: false,
  217. columnImage: false,
  218. columnSortable: false,
  219. sortLv: 0,
  220. status: true,
  221. fixed: '',
  222. columnWidth: 120
  223. },
  224. {
  225. userId: this.$store.state.user.name,
  226. functionId: 5011,
  227. serialNumber: '5011Table1PurchaseName',
  228. tableId: '5011Table1',
  229. tableName: '报价信息表',
  230. columnProp: 'purchaseName',
  231. headerAlign: 'center',
  232. align: 'left',
  233. columnLabel: '采购专员',
  234. columnHidden: false,
  235. columnImage: false,
  236. columnSortable: false,
  237. sortLv: 0,
  238. status: true,
  239. fixed: '',
  240. columnWidth: 120
  241. },
  242. {
  243. userId: this.$store.state.user.name,
  244. functionId: 5011,
  245. serialNumber: '5011Table1Status',
  246. tableId: '5011Table1',
  247. tableName: '报价信息表',
  248. columnProp: 'status',
  249. headerAlign: 'center',
  250. align: 'center',
  251. columnLabel: '状态',
  252. columnHidden: false,
  253. columnImage: false,
  254. columnSortable: false,
  255. sortLv: 0,
  256. status: true,
  257. fixed: '',
  258. columnWidth: 120
  259. },
  260. {
  261. userId: this.$store.state.user.name,
  262. functionId: 5011,
  263. serialNumber: '5011Table1CustomerInquiryNo',
  264. tableId: '5011Table1',
  265. tableName: '报价信息表',
  266. columnProp: 'customerInquiryNo',
  267. headerAlign: 'center',
  268. align: 'center',
  269. columnLabel: '客户询价单号',
  270. columnHidden: false,
  271. columnImage: false,
  272. columnSortable: false,
  273. sortLv: 0,
  274. status: true,
  275. fixed: '',
  276. columnWidth: 120
  277. },
  278. {
  279. userId: this.$store.state.user.name,
  280. functionId: 5011,
  281. serialNumber: '5011Table1InsideInquiryNo',
  282. tableId: '5011Table1',
  283. tableName: '报价信息表',
  284. columnProp: 'insideInquiryNo',
  285. headerAlign: 'center',
  286. align: 'center',
  287. columnLabel: '内部询价单号',
  288. columnHidden: false,
  289. columnImage: false,
  290. columnSortable: false,
  291. sortLv: 0,
  292. status: true,
  293. fixed: '',
  294. columnWidth: 120
  295. },
  296. {
  297. userId: this.$store.state.user.name,
  298. functionId: 5011,
  299. serialNumber: '5011Table1CreateBy',
  300. tableId: '5011Table1',
  301. tableName: '报价信息表',
  302. columnProp: 'createBy',
  303. headerAlign: 'center',
  304. align: 'center',
  305. columnLabel: '创建人',
  306. columnHidden: false,
  307. columnImage: false,
  308. columnSortable: false,
  309. sortLv: 0,
  310. status: true,
  311. fixed: '',
  312. columnWidth: 120
  313. },
  314. {
  315. userId: this.$store.state.user.name,
  316. functionId: 5011,
  317. serialNumber: '5011Table1CreateDate',
  318. tableId: '5011Table1',
  319. tableName: '报价信息表',
  320. columnProp: 'createDate',
  321. headerAlign: 'center',
  322. align: 'center',
  323. columnLabel: '创建时间',
  324. columnHidden: false,
  325. columnImage: false,
  326. columnSortable: false,
  327. sortLv: 0,
  328. status: true,
  329. fixed: '',
  330. columnWidth: 130
  331. },
  332. {
  333. userId: this.$store.state.user.name,
  334. functionId: 5011,
  335. serialNumber: '5011Table1UpdateBy',
  336. tableId: '5011Table1',
  337. tableName: '报价信息表',
  338. columnProp: 'updateBy',
  339. headerAlign: 'center',
  340. align: 'center',
  341. columnLabel: '更新人',
  342. columnHidden: false,
  343. columnImage: false,
  344. columnSortable: false,
  345. sortLv: 0,
  346. status: true,
  347. fixed: '',
  348. columnWidth: 120
  349. },
  350. {
  351. userId: this.$store.state.user.name,
  352. functionId: 5011,
  353. serialNumber: '5011Table1UpdateDate',
  354. tableId: '5011Table1',
  355. tableName: '报价信息表',
  356. columnProp: 'updateDate',
  357. headerAlign: 'center',
  358. align: 'center',
  359. columnLabel: '更新时间',
  360. columnHidden: false,
  361. columnImage: false,
  362. columnSortable: false,
  363. sortLv: 0,
  364. status: true,
  365. fixed: '',
  366. columnWidth: 130
  367. },
  368. ],
  369. searchLoading: false,
  370. saveVisible: false,
  371. saveLoading: false,
  372. activeName:'detail',
  373. userBuList: [],
  374. saveRules: {
  375. buId:[{required: true, message: '请选择BU', trigger: ['blur','change']}],
  376. customerNo:[{required: true, message: '请输入客户编码', trigger: ['blur','change']}],
  377. customerDesc:[{required: true, message: '请输入客户名称', trigger: ['blur','change']}],
  378. projectNo:[{required: true, message: '请输入项目编码', trigger: ['blur','change']}],
  379. projectDesc:[{required: true, message: '请输入项目名称', trigger: ['blur','change']}],
  380. currency:[{required: true, message: '请输入币种', trigger: ['blur','change']}],
  381. quoteDate:[{required: true, message: '请选择报价日期', trigger: ['blur','change']}],
  382. quoter:[{required: true, message: '请输入报价专员', trigger: ['blur','change']}],
  383. },
  384. customerVisible:false,
  385. projectVisible:false,
  386. quoterVisible:false,
  387. purchaseVisible:false,
  388. currentQuote:{
  389. },
  390. userVisible:false,
  391. userTitle:'人员信息',
  392. user:{
  393. username:'',
  394. userDisplay:'',
  395. active:'',
  396. buId:null,
  397. roleNo:'',
  398. },
  399. userDataList:[],
  400. tagNo:undefined,
  401. insideInquiryVisible:false,
  402. detailFlag:false,
  403. ossColumns:[
  404. {
  405. userId: this.$store.state.user.name,
  406. functionId: 5011,
  407. serialNumber: '5011Table2FileName',
  408. tableId: '5011Table2',
  409. tableName: '文件信息表',
  410. columnProp: 'fileName',
  411. headerAlign: 'center',
  412. align: 'left',
  413. columnLabel: '文件名称',
  414. columnHidden: false,
  415. columnImage: false,
  416. columnSortable: false,
  417. sortLv: 0,
  418. status: true,
  419. fixed: '',
  420. columnWidth: 140
  421. },
  422. {
  423. userId: this.$store.state.user.name,
  424. functionId: 5011,
  425. serialNumber: '5011Table2FileRemark',
  426. tableId: '5011Table2',
  427. tableName: '文件信息表',
  428. columnProp: 'fileRemark',
  429. headerAlign: 'center',
  430. align: 'left',
  431. columnLabel: '备注',
  432. columnHidden: false,
  433. columnImage: false,
  434. columnSortable: false,
  435. sortLv: 0,
  436. status: true,
  437. fixed: '',
  438. columnWidth: 240
  439. },
  440. {
  441. userId: this.$store.state.user.name,
  442. functionId: 5011,
  443. serialNumber: '5011Table2CreateDate',
  444. tableId: '5011Table2',
  445. tableName: '文件信息表',
  446. columnProp: 'createDate',
  447. headerAlign: 'center',
  448. align: 'center',
  449. columnLabel: '上传时间',
  450. columnHidden: false,
  451. columnImage: false,
  452. columnSortable: false,
  453. sortLv: 0,
  454. status: true,
  455. fixed: '',
  456. columnWidth: 140
  457. },
  458. {
  459. userId: this.$store.state.user.name,
  460. functionId: 5011,
  461. serialNumber: '5011Table2CreatedBy',
  462. tableId: '5011Table2',
  463. tableName: '文件信息表',
  464. columnProp: 'createBy',
  465. headerAlign: 'center',
  466. align: 'center',
  467. columnLabel: '上传人',
  468. columnHidden: false,
  469. columnImage: false,
  470. columnSortable: false,
  471. sortLv: 0,
  472. status: true,
  473. fixed: '',
  474. columnWidth: 140
  475. }
  476. ],
  477. insideInquiry:{
  478. },
  479. insideInquiryList:[],
  480. priceCheckPropertiesList:[],
  481. approvalList:[],
  482. exportData: [],
  483. exportName: '项目报价'+this.dayjs().format('YYYYMMDDHHmmss'),
  484. exportHeader: ["项目报价"],
  485. exportFooter: [],
  486. searchIndex:0,
  487. }
  488. },
  489. methods:{
  490. handleSearch(index){
  491. let params = {
  492. ...this.quoteForm,
  493. no: this.no,
  494. size: this.size,
  495. }
  496. this.searchLoading = true
  497. queryQuotePage(params).then(({data})=>{
  498. if (data && data.code === 0){
  499. this.dataList = data.rows
  500. this.total = data.total
  501. if (this.dataList[0] !== undefined){
  502. this.handleSelect(this.dataList[0])
  503. }
  504. // if (index !== undefined){
  505. // this.handleSelect(this.dataList[index])
  506. // }
  507. }else {
  508. this.$message.error(data.msg)
  509. }
  510. this.searchLoading = false
  511. }).catch(error=>{
  512. this.$message.error(error)
  513. this.searchLoading = false
  514. })
  515. },
  516. handleSelect(row){
  517. if (row){
  518. this.currentQuote = {...row}
  519. }else {
  520. this.currentQuote = {}
  521. }
  522. },
  523. handleSave(row){
  524. this.$nextTick(()=>{
  525. if (this.$refs.saveForm){
  526. this.$refs.saveForm.clearValidate();
  527. }
  528. })
  529. if (row){
  530. this.saveQuote = {
  531. ...row
  532. }
  533. }else {
  534. this.saveQuote = {
  535. ...this.quote,
  536. buNo:'*',
  537. site:this.$store.state.user.site
  538. }
  539. this.$nextTick(()=>{
  540. this.saveQuote.buId = this.userBuList.length > 0? this.userBuList[0].id:null;
  541. })
  542. }
  543. this.saveVisible = true
  544. },
  545. handleSizeChange(size){
  546. this.size = size
  547. this.handleSearch();
  548. },
  549. handlePageChange(no) {
  550. this.no = no
  551. this.handleSearch();
  552. },
  553. handleQueryBu(){
  554. let params = {
  555. username: this.$store.state.user.name,
  556. }
  557. // getSiteAndBuByUserName(params).then(({data}) => {
  558. // if (data && data.code === 0) {
  559. // this.userBuList = data.rows
  560. // }else {
  561. // this.$message.warning(data.msg)
  562. // }
  563. // }).catch((error)=>{
  564. // this.$message.error(error)
  565. // })
  566. },
  567. handleSaveOrUpdateQuote(){
  568. this.$refs.saveForm.validate((valid,obj) => {
  569. if (valid){
  570. if (this.saveQuote.id){
  571. this.handleUpdateQuote();
  572. }else {
  573. this.handleSaveQuote();
  574. }
  575. }else {
  576. let i = 1;
  577. for (let key in obj){
  578. this.$message.warning(obj[key][0].message)
  579. if (i === 1){
  580. return
  581. }
  582. i++;
  583. }
  584. }
  585. })
  586. },
  587. handleSaveQuote(){
  588. let params = {
  589. ...this.saveQuote,
  590. status: '草稿',
  591. action: 'Y',
  592. createBy: this.$store.state.user.name,
  593. }
  594. this.saveLoading = true
  595. saveQuote(params).then(({data})=>{
  596. if (data && data.code === 0){
  597. this.saveVisible = false
  598. this.quoteForm.quoteVersionNo = data.quoteVersionNo
  599. this.$message.success(data.msg)
  600. }else {
  601. this.$message.warning(data.msg)
  602. }
  603. this.handleSearch(0);
  604. this.saveLoading = false
  605. }).catch((error)=>{
  606. this.$message.error(error)
  607. this.saveLoading = false
  608. })
  609. },
  610. handleUpdateQuote(){
  611. let params = {
  612. ...this.saveQuote,
  613. updateBy: this.$store.state.user.name,
  614. }
  615. this.saveLoading = true
  616. updateQuote(params).then(({data})=>{
  617. if (data && data.code === 0){
  618. this.saveVisible = false
  619. this.currentQuote = {
  620. ...this.currentQuote
  621. }
  622. this.$message.success(data.msg)
  623. }else {
  624. this.$message.warning(data.msg)
  625. }
  626. this.handleSearch();
  627. this.saveLoading = false
  628. }).catch((error)=>{
  629. this.$message.error(error)
  630. this.saveLoading = false
  631. })
  632. },
  633. handleRemove(row){
  634. this.$confirm('确认删除该报价信息吗?', '提示', {
  635. confirmButtonText: '确定',
  636. cancelButtonText: '取消',
  637. type: 'warning'
  638. }).then(() => {
  639. this.handleRemoveQuote(row)
  640. }).catch(() => {
  641. })
  642. },
  643. handleUpdateStatus(row){
  644. let params = {
  645. ...row
  646. }
  647. updateQuoteStatus(params).then(({data})=>{
  648. if (data && data.code === 0){
  649. this.$message.success(data.msg)
  650. this.handleSearch();
  651. this.currentQuote = {
  652. ...row
  653. }
  654. }else {
  655. this.$message.warning(data.msg)
  656. }
  657. }).catch((error)=>{
  658. this.$message.error(error)
  659. })
  660. },
  661. handleQueryById(row){
  662. this.saveQuote = {
  663. ...row
  664. }
  665. this.detailFlag = true;
  666. this.saveVisible = true;
  667. },
  668. handleRemoveQuote(row){
  669. let params = {
  670. id: row.id,
  671. }
  672. removeQuote(params).then(({data})=>{
  673. if (data && data.code === 0){
  674. this.$message.success(data.msg)
  675. if (row.id === this.currentQuote.id){
  676. this.handleSearch(0);
  677. }else {
  678. this.handleSearch();
  679. }
  680. }else {
  681. this.$message.warning(data.msg)
  682. }
  683. }).catch((error)=>{
  684. this.$message.error(error)
  685. })
  686. },
  687. customerNoBlur(){
  688. let params = {
  689. site:this.$store.state.user.site,
  690. customerNo:this.saveQuote.customerNo
  691. }
  692. queryCustomer(params).then(({data})=>{
  693. if (data && data.code === 0 ) {
  694. if (data.rows && data.rows.length === 1){
  695. this.saveQuote.customerDesc = data.rows[0].customerDesc
  696. }else {
  697. this.saveQuote.customerDesc = ''
  698. }
  699. }else {
  700. this.$message.warning(data.msg)
  701. }
  702. }).catch((error)=>{
  703. this.$message.error(error)
  704. })
  705. },
  706. projectNoBlur(){
  707. let params = {
  708. site:this.$store.state.user.site,
  709. customerId:this.saveQuote.customerNo,
  710. projectId:this.saveQuote.projectNo
  711. }
  712. queryProjectByCustomer(params).then(({data})=>{
  713. if (data && data.code === 0 ){
  714. if (data.rows && data.rows.length === 1){
  715. this.saveQuote.projectDesc = data.rows[0].projectName
  716. this.saveQuote.finalCustomerNo = data.rows[0].finalCustomerId
  717. this.saveQuote.finalCustomerDesc = data.rows[0].finalCustomerName
  718. }else {
  719. this.saveQuote.projectDesc = ''
  720. this.saveQuote.finalCustomerNo = ''
  721. this.saveQuote.finalCustomerDesc = ''
  722. }
  723. }else {
  724. this.$message.warning(data.msg)
  725. }
  726. }).catch((error)=>{
  727. this.$message.error(error)
  728. })
  729. },
  730. handleRowClick(row){
  731. this.currentQuote = {...row}
  732. },
  733. userDblClick(row){
  734. if (this.quoterVisible){
  735. this.saveQuote.quoter = row.username
  736. this.quoterVisible = false
  737. }else if (this.purchaseVisible){
  738. this.saveQuote.purchase = row.username
  739. this.purchaseVisible = false
  740. }
  741. this.userVisible = false
  742. },
  743. handleQuoterClick(){
  744. this.userTitle = '报价专员'
  745. this.user.username = this.saveQuote.quoter
  746. this.user.userDisplay = ''
  747. this.user.active = ''
  748. this.user.buId = this.saveQuote.buId
  749. this.user.roleNo = 'QUOTER'
  750. this.quoterVisible = true
  751. this.handleQueryQuoteRoleUser();
  752. this.userVisible = true
  753. },
  754. handlePurchaseClick(){
  755. this.userTitle = '采购专员'
  756. this.user.username = this.saveQuote.purchase
  757. this.user.userDisplay = ''
  758. this.user.active = ''
  759. this.user.buId = this.saveQuote.buId
  760. this.user.roleNo = 'PURCHASE'
  761. this.purchaseVisible = true
  762. this.handleQueryQuoteRoleUser();
  763. this.userVisible = true
  764. },
  765. handleQueryQuoteRoleUser(){
  766. let params = {
  767. ...this.user,
  768. }
  769. this.userDataList = []
  770. queryQuoteRoleUser(params).then(({data})=>{
  771. if (data && data.code === 0){
  772. this.userDataList = data.rows
  773. }else {
  774. this.$message.warning(data.msg)
  775. }
  776. }).catch((error)=>{
  777. this.$message.error(error)
  778. })
  779. },
  780. getBaseList(val){
  781. this.tagNo = val
  782. this.$nextTick(() => {
  783. let strVal = ''
  784. let conSql = ''
  785. if (val === 102) {
  786. strVal = this.saveQuote.customerNo
  787. }
  788. if (val === 104) {
  789. strVal = this.saveQuote.projectNo
  790. conSql = " and customer_id = '" + this.saveQuote.customerNo + "'"
  791. }
  792. if (val === 2000) {
  793. strVal = this.saveQuote.purchase
  794. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  795. }
  796. if (val === 2002) {
  797. strVal = this.saveQuote.quoter
  798. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  799. }
  800. this.$refs.baseList.init(val, strVal, conSql)
  801. })
  802. },
  803. getBaseData(val){
  804. switch (this.tagNo){
  805. case 102:
  806. if (this.saveQuote.customerNo !== val.Customer_no) {
  807. this.saveQuote.projectNo = '';
  808. this.saveQuote.projectDesc = '';
  809. }
  810. this.saveQuote.customerNo = val.Customer_no
  811. this.saveQuote.customerDesc = val.Customer_desc
  812. break;
  813. case 104:
  814. this.saveQuote.projectNo = val.project_id
  815. this.saveQuote.projectDesc = val.project_name
  816. break;
  817. case 2000:
  818. this.saveQuote.purchase = val.username
  819. this.saveQuote.purchaseName = val.user_display
  820. break
  821. case 2002:
  822. this.saveQuote.quoter = val.username
  823. this.saveQuote.quoterName = val.user_display
  824. break;
  825. }
  826. },
  827. handleQueryByIds(){
  828. let params = {
  829. ids:this.$route.params.ids,
  830. no:this.no,
  831. size:this.size,
  832. createBy:this.$store.state.user.name,
  833. }
  834. queryQuotePage(params).then(({data})=>{
  835. if (data && data.code === 0){
  836. this.dataList = data.rows
  837. this.total = data.total
  838. if (this.total > 0){
  839. this.currentQuote = {...this.dataList[0]}
  840. }else {
  841. this.currentQuote = {}
  842. }
  843. }else {
  844. this.$message.error(data.msg)
  845. }
  846. this.searchLoading = false
  847. }).catch(error=>{
  848. this.$message.error(error)
  849. this.searchLoading = false
  850. })
  851. },
  852. handleInquiryBlur(){
  853. let params = {
  854. site:this.$store.state.user.site,
  855. quotationNo:this.saveQuote.insideInquiryNo,
  856. }
  857. searchQuotationByQuotationNo(params).then(({data}) => {
  858. if (data && data.code === 0){
  859. if (data.data.length === 1){
  860. this.dblclickInsideInquiry(data.data[0])
  861. }
  862. }
  863. })
  864. },
  865. handleAgainQuote(row){
  866. let params = {
  867. id: row.id,
  868. createBy: this.$store.state.user.name,
  869. }
  870. this.queryLoading = true
  871. againQuote(params).then(({data}) => {
  872. if (data && data.code === 0) {
  873. this.$message.success(data.msg)
  874. this.handleSearch();
  875. } else {
  876. this.$message.warning(data.msg)
  877. this.queryLoading = false
  878. }
  879. }).catch((error) => {
  880. this.$message.error(error)
  881. this.queryLoading = false
  882. })
  883. },
  884. clearModalData(field){
  885. this.$set(this.saveQuote,field,'')
  886. },
  887. handleQueryInquiry(){
  888. this.insideInquiry = {
  889. site:this.$store.state.user.site,
  890. quotationNo:this.saveQuote.insideInquiryNo,
  891. quotationBatchNo:'',
  892. quotationItemNo:'',
  893. testPartNo:'',
  894. partName:'',
  895. quotationStatus:'审批中',
  896. }
  897. this.searchInsideInquiry();
  898. this.insideInquiryVisible = true
  899. },
  900. dblclickInsideInquiry(row){
  901. this.saveQuote.insideInquiryNo = row.quotationNo
  902. this.saveQuote.customerNo = row.customerNo
  903. this.saveQuote.customerDesc = row.customerDesc
  904. this.saveQuote.projectNo = row.projectId
  905. this.saveQuote.projectDesc = row.projectName
  906. this.saveQuote.quoter = row.quoter
  907. this.saveQuote.quoterName = row.quoterName
  908. this.saveQuote.finalCustomerNo = row.finalCustomerId
  909. this.saveQuote.finalCustomerDesc = row.finalCustomerName
  910. this.saveQuote.purchase = row.tracker
  911. this.saveQuote.purchaseName = row.trackerName
  912. this.insideInquiryVisible = false
  913. },
  914. searchInsideInquiry(){
  915. searchQuotationByQuotationNo(this.insideInquiry).then(({data}) => {
  916. if (data && data.code === 0){
  917. this.insideInquiryList = data.data;
  918. }
  919. })
  920. },
  921. getPriceCheckProperties() {
  922. if (!this.currentQuote && !this.currentQuote.insideInquiryNo){
  923. this.priceCheckPropertiesList = []
  924. return
  925. }
  926. let params = {
  927. site: this.saveQuote.site,
  928. quotationNo: this.currentQuote.insideInquiryNo
  929. }
  930. getPriceCheckPropertiesList(params).then(({data}) => {
  931. if (data && data.code === 0) {
  932. this.priceCheckPropertiesList = data.rows
  933. } else {
  934. this.$message.warning(data.msg)
  935. }
  936. }).catch((error) => {
  937. this.$message.error(error)
  938. })
  939. },
  940. // 查询审批信息
  941. getApprovalList () {
  942. let tempData = {
  943. site: this.$store.state.user.site,
  944. menuId: this.$route.meta.menuId,
  945. documentNo: this.currentQuote.quoteVersionNo
  946. }
  947. getApprovalList(tempData).then(({data}) => {
  948. if (data && data.code === 0) {
  949. this.approvalList = data.rows
  950. } else {
  951. this.approvalList = []
  952. }
  953. })
  954. },
  955. fields() {
  956. let json = "{"
  957. this.columns.forEach((item, index) => {
  958. if (index === this.columns.length - 1) {
  959. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  960. } else {
  961. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  962. }
  963. })
  964. json += "}"
  965. return eval("(" + json + ")")
  966. },
  967. createExportData() {
  968. return this.dataList;
  969. },
  970. },
  971. created() {
  972. if (this.isMenu && this.searchIndex === 0){
  973. this.quoteForm = {
  974. ...this.quote,
  975. site: this.$store.state.user.site,
  976. createBy: this.$store.state.user.name,
  977. }
  978. this.handleQueryBu();// 查询 BU
  979. this.handleSearch(0);// 查询报价信息
  980. }
  981. this.searchIndex++;
  982. },
  983. watch:{
  984. 'quoteForm.customerNo'(newVal, oldVal){
  985. this.quoteForm.customerNo = newVal.toUpperCase()
  986. },
  987. 'quoteForm.projectNo'(newVal, oldVal){
  988. this.quoteForm.projectNo = newVal.toUpperCase()
  989. },
  990. 'quoteForm.quoteNo'(newVal, oldVal){
  991. this.quoteForm.quoteNo = newVal.toUpperCase()
  992. },
  993. 'saveQuote.customerNo'(newVal, oldVal){
  994. if (newVal){
  995. this.saveQuote.customerNo = newVal.toUpperCase()
  996. }else {
  997. this.saveQuote.customerDesc = ''
  998. this.saveQuote.projectNo = ''
  999. this.saveQuote.projectDesc = ''
  1000. }
  1001. },
  1002. 'saveQuote.projectNo'(newVal, oldVal){
  1003. if (newVal){
  1004. this.saveQuote.projectNo = newVal.toUpperCase()
  1005. this.projectNoBlur();
  1006. }else {
  1007. this.saveQuote.projectDesc = ''
  1008. this.saveQuote.finalCustomerNo = ''
  1009. this.saveQuote.finalCustomerDesc = ''
  1010. }
  1011. },
  1012. 'saveQuote.quoter'(newVal, oldVal){
  1013. if (!newVal){
  1014. this.saveQuote.quoterName = ''
  1015. }
  1016. },
  1017. 'saveQuote.purchase'(newVal, oldVal){
  1018. if (!newVal){
  1019. this.saveQuote.purchaseName = ''
  1020. }
  1021. },
  1022. saveVisible(newVal, oldVal){
  1023. if (newVal === false){
  1024. this.detailFlag = false;
  1025. }
  1026. },
  1027. 'saveQuote.currency'(newVal, oldVal){
  1028. this.saveQuote.currency = newVal.toUpperCase()
  1029. },
  1030. 'currentQuote'(newVal, oldVal){
  1031. if (newVal && this.isMenu){
  1032. this.getPriceCheckProperties();
  1033. this.getApprovalList();
  1034. }
  1035. },
  1036. projectNo(newVal, oldVal){
  1037. if (newVal && !this.isMenu){
  1038. this.quoteForm.projectNo = newVal.toUpperCase()
  1039. this.quoteForm.site = this.$store.state.user.site
  1040. this.handleSearch(0);
  1041. }else {
  1042. this.dataList = []
  1043. this.total = 0
  1044. this.no = 1
  1045. }
  1046. },
  1047. },
  1048. activated() {
  1049. if (!this.isMenu){
  1050. return
  1051. }
  1052. if (this.$route.params.ids){
  1053. this.handleQueryByIds();
  1054. }else if (this.$route.params.type === 'project'){
  1055. this.quoteForm = {
  1056. ...this.quote,
  1057. site: this.$store.state.user.site,
  1058. quoteVersionNo: this.$route.params.quoteVersionNo,
  1059. }
  1060. this.handleSearch(0);
  1061. }
  1062. }
  1063. }
  1064. </script>
  1065. <template>
  1066. <div>
  1067. <download-excel v-if="!isMenu"
  1068. :fields="fields()"
  1069. :data="exportData"
  1070. type="xls"
  1071. :name="exportName"
  1072. :header="exportHeader"
  1073. :footer="exportFooter"
  1074. :fetch="createExportData"
  1075. worksheet="导出信息"
  1076. class="el-button el-button--primary el-button--medium">
  1077. {{ '导出' }}
  1078. </download-excel>
  1079. <quote-search v-if="isMenu" v-model:quote="quoteForm" @search="handleSearch" @save="handleSave"></quote-search>
  1080. <quote-table v-loading="searchLoading"
  1081. :current-row="currentQuote"
  1082. :columns="columns"
  1083. style="margin-top: 5px"
  1084. :is-menu="isMenu"
  1085. @save="handleSave"
  1086. @remove="handleRemove"
  1087. @rowClick="handleRowClick"
  1088. @updateStatus="handleUpdateStatus"
  1089. @queryById="handleQueryById"
  1090. @againQuote="handleAgainQuote"
  1091. :data-list="dataList"
  1092. :height="height">
  1093. </quote-table>
  1094. <el-pagination @size-change="handleSizeChange"
  1095. @current-change="handlePageChange"
  1096. :current-page="no"
  1097. :page-sizes="[20, 50, 100, 200, 500]"
  1098. :page-size="size"
  1099. :total="total"
  1100. layout="total,sizes, prev, pager, next, jumper">
  1101. </el-pagination>
  1102. <el-tabs v-if="isMenu" v-model="activeName" type="border-card" style="margin-top: 0;" class="customer-tab">
  1103. <el-tab-pane label="报价明细" name="detail">
  1104. <quote-group-detail :quote="currentQuote" :auth-flag="false" :height="'28vh'"></quote-group-detail>
  1105. </el-tab-pane>
  1106. <el-tab-pane label="条目明细" name="detail2">
  1107. <quote-detail v-if="activeName === 'detail2'" :save-auth="false" :quote="currentQuote" :auth-flag="false" :height="'30vh'"></quote-detail>
  1108. </el-tab-pane>
  1109. <el-tab-pane label="项目信息" name="quotation_project_information">
  1110. <quotation-project-information height="31vh" :quotation-header="currentQuote"></quotation-project-information>
  1111. </el-tab-pane>
  1112. <el-tab-pane label="客户信息" name="quotation_customer_information">
  1113. <customer-info height="31vh" :project="currentQuote"></customer-info>
  1114. </el-tab-pane>
  1115. <el-tab-pane label="客户联系人" name="quotation_customer_contact">
  1116. <quotation-customer-contact height="28vh" :quotation-header="currentQuote"></quotation-customer-contact>
  1117. </el-tab-pane>
  1118. <el-tab-pane label="报价-附件信息" name="quote_oss">
  1119. <oss-components
  1120. :save-visible="isAuth('5011:tab6:save')"
  1121. :download-visible="isAuth('5011:tab6:download')"
  1122. :remove-visible="isAuth('5011:tab6:remove')"
  1123. :preview-visible="isAuth('5011:tab6:preview')"
  1124. label="报价单号"
  1125. height="28vh"
  1126. :columns="ossColumns"
  1127. :order-ref1="currentQuote.site?currentQuote.site:''"
  1128. :order-ref2="currentQuote.quoteVersionNo?currentQuote.quoteVersionNo:''">
  1129. </oss-components>
  1130. </el-tab-pane>
  1131. <el-tab-pane label="询价-基本信息" name="request">
  1132. <price-check-properties ref="tabProperties"
  1133. v-model:data-list="priceCheckPropertiesList"
  1134. height="31vh"></price-check-properties>
  1135. </el-tab-pane>
  1136. <el-tab-pane label="询价-附件信息" name="oss">
  1137. <oss-components
  1138. :save-visible="isAuth('102001001:tab6:save')"
  1139. :download-visible="isAuth('102001001:tab6:download')"
  1140. :remove-visible="isAuth('102001001:tab6:remove')"
  1141. :preview-visible="isAuth('102001001:tab6:preview')"
  1142. label="询价单号"
  1143. height="28vh"
  1144. :columns="ossColumns"
  1145. :order-ref1="currentQuote.site"
  1146. :order-ref2="currentQuote.insideInquiryNo?currentQuote.insideInquiryNo.split('-')[0]:''">
  1147. </oss-components>
  1148. </el-tab-pane>
  1149. <!-- 审批信息 -->
  1150. <el-tab-pane label="审批信息" name="approvalInformation">
  1151. <approval-information ref="approvalTable" v-model:data-list="approvalList" :height="300"></approval-information>
  1152. </el-tab-pane>
  1153. </el-tabs>
  1154. <el-dialog :title="saveQuote.id? '报价信息:'+ saveQuote.quoteVersionNo : '报价信息'" v-drag :close-on-click-modal="false" :visible.sync="saveVisible" width="500px" >
  1155. <el-form ref="saveForm" :model="saveQuote" :rules="saveRules" label-position="top" label-width="100px">
  1156. <el-row :gutter="10">
  1157. <el-col :span="8">
  1158. <el-form-item label="内部询价单号" prop="insideInquiryNo" :show-message="false">
  1159. <span slot="label" v-if="!detailFlag">
  1160. <a @click="handleQueryInquiry">内部询价单号</a>
  1161. </span>
  1162. <el-input v-model="saveQuote.insideInquiryNo" readonly @change="handleInquiryBlur" :disabled="detailFlag"></el-input>
  1163. </el-form-item>
  1164. </el-col>
  1165. <el-col :span="8">
  1166. <el-form-item label="报价日期" prop="quoteDate" :show-message="false">
  1167. <el-date-picker style="width: 100%" :disabled="detailFlag" v-model="saveQuote.quoteDate" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd'></el-date-picker>
  1168. </el-form-item>
  1169. </el-col>
  1170. <el-col :span="8">
  1171. <el-form-item label="客户询价单号" prop="customerInquiryNo" :show-message="false">
  1172. <el-input v-model="saveQuote.customerInquiryNo" :disabled="detailFlag"></el-input>
  1173. </el-form-item>
  1174. </el-col>
  1175. </el-row>
  1176. <el-row :gutter="10">
  1177. <el-col :span="8">
  1178. <el-form-item label="客户编码" prop="customerNo" :show-message="false">
  1179. <span slot="label" v-if="!detailFlag">
  1180. <a @click="getBaseList(102)">客户编码</a>
  1181. </span>
  1182. <el-input v-model="saveQuote.customerNo" :disabled="detailFlag" @change="customerNoBlur"></el-input>
  1183. </el-form-item>
  1184. </el-col>
  1185. <el-col :span="16">
  1186. <el-form-item label="客户描述" prop="customerDesc" :show-message="false">
  1187. <el-input v-model="saveQuote.customerDesc" disabled></el-input>
  1188. </el-form-item>
  1189. </el-col>
  1190. </el-row>
  1191. <el-row :gutter="10">
  1192. <el-col :span="8">
  1193. <el-form-item label="项目编码" prop="projectNo" :show-message="false">
  1194. <span slot="label" v-if="saveQuote.customerNo && !detailFlag">
  1195. <a @click="getBaseList(104)">项目编码</a>
  1196. </span>
  1197. <el-input v-model="saveQuote.projectNo" :disabled="!saveQuote.customerNo || detailFlag"></el-input>
  1198. </el-form-item>
  1199. </el-col>
  1200. <el-col :span="16">
  1201. <el-form-item label="项目描述" prop="projectDesc" :show-message="false">
  1202. <el-input v-model="saveQuote.projectDesc" disabled></el-input>
  1203. </el-form-item>
  1204. </el-col>
  1205. </el-row>
  1206. <el-row :gutter="10">
  1207. <el-col :span="8">
  1208. <el-form-item label="终端客户编码" prop="finalCustomerNo" :show-message="false">
  1209. <el-input v-model="saveQuote.finalCustomerNo" disabled></el-input>
  1210. </el-form-item>
  1211. </el-col>
  1212. <el-col :span="16">
  1213. <el-form-item label="终端客户描述" prop="finalCustomerDesc" :show-message="false">
  1214. <el-input v-model="saveQuote.finalCustomerDesc" disabled></el-input>
  1215. </el-form-item>
  1216. </el-col>
  1217. </el-row>
  1218. <el-row :gutter="10">
  1219. <el-col :span="8">
  1220. <el-form-item label="报价专员" prop="quoter" :show-message="false">
  1221. <a slot="label" v-if="!detailFlag" @click="getBaseList(2002)">报价专员</a>
  1222. <el-input v-model="saveQuote.quoterName" readonly :disabled="detailFlag">
  1223. <span slot="suffix" v-show="saveQuote.quoter && !detailFlag" @click="clearModalData('quoter')"><i class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i></span>
  1224. </el-input>
  1225. </el-form-item>
  1226. </el-col>
  1227. <el-col :span="8">
  1228. <el-form-item label="采购专员" prop="purchase" :show-message="false">
  1229. <a slot="label" v-if="!detailFlag" @click="getBaseList(2000)">采购专员</a>
  1230. <el-input v-model="saveQuote.purchaseName" readonly :disabled="detailFlag">
  1231. <span slot="suffix" v-show="saveQuote.purchase && !detailFlag" @click="clearModalData('purchase')"><i class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i></span>
  1232. </el-input>
  1233. </el-form-item>
  1234. </el-col>
  1235. <el-col :span="24">
  1236. <el-form-item label="备注" prop="remark" class="auto" :show-message="false">
  1237. <el-input v-model="saveQuote.remark" :disabled="detailFlag" :rows="3" type="textarea"></el-input>
  1238. </el-form-item>
  1239. </el-col>
  1240. </el-row>
  1241. </el-form>
  1242. <div slot="footer" class="dialog-footer">
  1243. <el-button type="primary" v-if="!detailFlag" @click="handleSaveOrUpdateQuote"> </el-button>
  1244. <el-button @click="saveVisible = false"> </el-button>
  1245. </div>
  1246. </el-dialog>
  1247. <el-dialog title="询价申请" v-drag :visible.sync="insideInquiryVisible" width="1000px" modal-append-to-body :close-on-click-modal="false">
  1248. <el-form label-position="top"
  1249. :model="insideInquiry"
  1250. size="mini">
  1251. <el-row :gutter="10">
  1252. <el-col :span="3">
  1253. <el-form-item label="询价单号">
  1254. <el-input v-model="insideInquiry.quotationNo" clearable/>
  1255. </el-form-item>
  1256. </el-col>
  1257. <el-col :span="3">
  1258. <el-form-item label="申请批次号">
  1259. <el-input v-model="insideInquiry.quotationBatchNo" clearable></el-input>
  1260. </el-form-item>
  1261. </el-col>
  1262. <el-col :span="3">
  1263. <el-form-item label="序号">
  1264. <el-input v-model="insideInquiry.quotationItemNo" clearable></el-input>
  1265. </el-form-item>
  1266. </el-col>
  1267. <el-col :span="3">
  1268. <el-form-item label="状态">
  1269. <el-select v-model="insideInquiry.quotationStatus" style="width:100%">
  1270. <el-option label="全部" value=""></el-option>
  1271. <el-option label="草稿" value="草稿"></el-option>
  1272. <el-option label="审批中" value="审批中"></el-option>
  1273. <el-option label="已完成" value="已完成"></el-option>
  1274. </el-select>
  1275. </el-form-item>
  1276. </el-col>
  1277. <el-col :span="2">
  1278. <el-form-item label=" ">
  1279. <el-button type="primary" style="padding: 3px 12px" @click="searchInsideInquiry">查询</el-button>
  1280. </el-form-item>
  1281. </el-col>
  1282. </el-row>
  1283. </el-form>
  1284. <el-table :data="insideInquiryList" height="300" stripe border @row-dblclick="dblclickInsideInquiry">
  1285. <el-table-column prop="quotationNo" header-align="center" min-width="120" label="询价单号"/>
  1286. <el-table-column prop="quotationBatchNo" header-align="center" label="询价批次号"/>
  1287. <el-table-column width="60" align="center" header-align="center" prop="quotationItemNo" label="询价序号"/>
  1288. <el-table-column prop="projectName" header-align="center" label="项目名称"/>
  1289. <el-table-column prop="quotationStatus" header-align="center" label="状态"/>
  1290. <el-table-column label="终端客户编码" header-align="center" prop="finalCustomerId"/>
  1291. <el-table-column label="终端客户名称" header-align="center" prop="finalCustomerName"/>
  1292. </el-table>
  1293. <el-footer style="height:30px;margin-top: 20px;text-align:center">
  1294. <el-button type="primary" @click="insideInquiryVisible = false">关闭</el-button>
  1295. </el-footer>
  1296. </el-dialog>
  1297. <choose-list ref="baseList" @getBaseData="getBaseData"></choose-list>
  1298. </div>
  1299. </template>
  1300. <style scoped>
  1301. .auto /deep/ .el-form-item__content{
  1302. height: auto;
  1303. line-height: 1.5;
  1304. }
  1305. </style>