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.

1341 lines
43 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
10 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
10 months ago
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
  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. projectName:'',
  895. finalCustomerName:'',
  896. quoterName:'',
  897. partName:'',
  898. quotationStatus:'审批中',
  899. }
  900. this.searchInsideInquiry();
  901. this.insideInquiryVisible = true
  902. },
  903. dblclickInsideInquiry(row){
  904. this.saveQuote.insideInquiryNo = row.quotationNo
  905. this.saveQuote.customerNo = row.customerNo
  906. this.saveQuote.customerDesc = row.customerDesc
  907. this.saveQuote.projectNo = row.projectId
  908. this.saveQuote.projectDesc = row.projectName
  909. this.saveQuote.quoter = row.quoter
  910. this.saveQuote.quoterName = row.quoterName
  911. this.saveQuote.finalCustomerNo = row.finalCustomerId
  912. this.saveQuote.finalCustomerDesc = row.finalCustomerName
  913. this.saveQuote.purchase = row.tracker
  914. this.saveQuote.purchaseName = row.trackerName
  915. this.insideInquiryVisible = false
  916. },
  917. searchInsideInquiry(){
  918. searchQuotationByQuotationNo(this.insideInquiry).then(({data}) => {
  919. if (data && data.code === 0){
  920. this.insideInquiryList = data.data;
  921. }
  922. })
  923. },
  924. getPriceCheckProperties() {
  925. if (!this.currentQuote && !this.currentQuote.insideInquiryNo){
  926. this.priceCheckPropertiesList = []
  927. return
  928. }
  929. let params = {
  930. site: this.saveQuote.site,
  931. quotationNo: this.currentQuote.insideInquiryNo
  932. }
  933. getPriceCheckPropertiesList(params).then(({data}) => {
  934. if (data && data.code === 0) {
  935. this.priceCheckPropertiesList = data.rows
  936. } else {
  937. this.$message.warning(data.msg)
  938. }
  939. }).catch((error) => {
  940. this.$message.error(error)
  941. })
  942. },
  943. // 查询审批信息
  944. getApprovalList () {
  945. let tempData = {
  946. site: this.$store.state.user.site,
  947. menuId: this.$route.meta.menuId,
  948. documentNo: this.currentQuote.quoteVersionNo
  949. }
  950. getApprovalList(tempData).then(({data}) => {
  951. if (data && data.code === 0) {
  952. this.approvalList = data.rows
  953. } else {
  954. this.approvalList = []
  955. }
  956. })
  957. },
  958. fields() {
  959. let json = "{"
  960. this.columns.forEach((item, index) => {
  961. if (index === this.columns.length - 1) {
  962. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  963. } else {
  964. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  965. }
  966. })
  967. json += "}"
  968. return eval("(" + json + ")")
  969. },
  970. createExportData() {
  971. return this.dataList;
  972. },
  973. },
  974. created() {
  975. if (this.isMenu && this.searchIndex === 0){
  976. this.quoteForm = {
  977. ...this.quote,
  978. site: this.$store.state.user.site,
  979. createBy: this.$store.state.user.name,
  980. }
  981. this.handleQueryBu();// 查询 BU
  982. this.handleSearch(0);// 查询报价信息
  983. }
  984. this.searchIndex++;
  985. },
  986. watch:{
  987. 'quoteForm.customerNo'(newVal, oldVal){
  988. this.quoteForm.customerNo = newVal.toUpperCase()
  989. },
  990. 'quoteForm.projectNo'(newVal, oldVal){
  991. this.quoteForm.projectNo = newVal.toUpperCase()
  992. },
  993. 'quoteForm.quoteNo'(newVal, oldVal){
  994. this.quoteForm.quoteNo = newVal.toUpperCase()
  995. },
  996. 'saveQuote.customerNo'(newVal, oldVal){
  997. if (newVal){
  998. this.saveQuote.customerNo = newVal.toUpperCase()
  999. }else {
  1000. this.saveQuote.customerDesc = ''
  1001. this.saveQuote.projectNo = ''
  1002. this.saveQuote.projectDesc = ''
  1003. }
  1004. },
  1005. 'saveQuote.projectNo'(newVal, oldVal){
  1006. if (newVal){
  1007. this.saveQuote.projectNo = newVal.toUpperCase()
  1008. this.projectNoBlur();
  1009. }else {
  1010. this.saveQuote.projectDesc = ''
  1011. this.saveQuote.finalCustomerNo = ''
  1012. this.saveQuote.finalCustomerDesc = ''
  1013. }
  1014. },
  1015. 'saveQuote.quoter'(newVal, oldVal){
  1016. if (!newVal){
  1017. this.saveQuote.quoterName = ''
  1018. }
  1019. },
  1020. 'saveQuote.purchase'(newVal, oldVal){
  1021. if (!newVal){
  1022. this.saveQuote.purchaseName = ''
  1023. }
  1024. },
  1025. saveVisible(newVal, oldVal){
  1026. if (newVal === false){
  1027. this.detailFlag = false;
  1028. }
  1029. },
  1030. 'saveQuote.currency'(newVal, oldVal){
  1031. this.saveQuote.currency = newVal.toUpperCase()
  1032. },
  1033. 'currentQuote'(newVal, oldVal){
  1034. if (newVal && this.isMenu){
  1035. this.getPriceCheckProperties();
  1036. this.getApprovalList();
  1037. }
  1038. },
  1039. projectNo(newVal, oldVal){
  1040. if (newVal && !this.isMenu){
  1041. this.quoteForm.projectNo = newVal.toUpperCase()
  1042. this.quoteForm.site = this.$store.state.user.site
  1043. this.handleSearch(0);
  1044. }else {
  1045. this.dataList = []
  1046. this.total = 0
  1047. this.no = 1
  1048. }
  1049. },
  1050. },
  1051. activated() {
  1052. if (!this.isMenu){
  1053. return
  1054. }
  1055. if (this.$route.params.ids){
  1056. this.handleQueryByIds();
  1057. }else if (this.$route.params.type === 'project'){
  1058. this.quoteForm = {
  1059. ...this.quote,
  1060. site: this.$store.state.user.site,
  1061. quoteVersionNo: this.$route.params.quoteVersionNo,
  1062. }
  1063. this.handleSearch(0);
  1064. }
  1065. }
  1066. }
  1067. </script>
  1068. <template>
  1069. <div>
  1070. <download-excel v-if="!isMenu"
  1071. :fields="fields()"
  1072. :data="exportData"
  1073. type="xls"
  1074. :name="exportName"
  1075. :header="exportHeader"
  1076. :footer="exportFooter"
  1077. :fetch="createExportData"
  1078. worksheet="导出信息"
  1079. class="el-button el-button--primary el-button--medium">
  1080. {{ '导出' }}
  1081. </download-excel>
  1082. <quote-search v-if="isMenu" v-model:quote="quoteForm" @search="handleSearch" @save="handleSave"></quote-search>
  1083. <quote-table v-loading="searchLoading"
  1084. :current-row="currentQuote"
  1085. :columns="columns"
  1086. style="margin-top: 5px"
  1087. :is-menu="isMenu"
  1088. @save="handleSave"
  1089. @remove="handleRemove"
  1090. @rowClick="handleRowClick"
  1091. @updateStatus="handleUpdateStatus"
  1092. @queryById="handleQueryById"
  1093. @againQuote="handleAgainQuote"
  1094. :data-list="dataList"
  1095. :height="height">
  1096. </quote-table>
  1097. <el-pagination @size-change="handleSizeChange"
  1098. @current-change="handlePageChange"
  1099. :current-page="no"
  1100. :page-sizes="[20, 50, 100, 200, 500]"
  1101. :page-size="size"
  1102. :total="total"
  1103. layout="total,sizes, prev, pager, next, jumper">
  1104. </el-pagination>
  1105. <el-tabs v-if="isMenu" v-model="activeName" type="border-card" style="margin-top: 0;" class="customer-tab">
  1106. <el-tab-pane label="报价明细" name="detail">
  1107. <quote-group-detail :quote="currentQuote" :auth-flag="false" :height="'28vh'"></quote-group-detail>
  1108. </el-tab-pane>
  1109. <el-tab-pane label="条目明细" name="detail2">
  1110. <quote-detail v-if="activeName === 'detail2'" :save-auth="false" :is-export="true" :quote="currentQuote" :auth-flag="false" :height="'30vh'"></quote-detail>
  1111. </el-tab-pane>
  1112. <el-tab-pane label="项目信息" name="quotation_project_information">
  1113. <quotation-project-information height="31vh" :quotation-header="currentQuote"></quotation-project-information>
  1114. </el-tab-pane>
  1115. <el-tab-pane label="客户信息" name="quotation_customer_information">
  1116. <customer-info height="31vh" :project="currentQuote"></customer-info>
  1117. </el-tab-pane>
  1118. <el-tab-pane label="客户联系人" name="quotation_customer_contact">
  1119. <quotation-customer-contact height="28vh" :quotation-header="currentQuote"></quotation-customer-contact>
  1120. </el-tab-pane>
  1121. <el-tab-pane label="报价-附件信息" name="quote_oss">
  1122. <oss-components
  1123. :save-visible="isAuth('5011:tab6:save')"
  1124. :download-visible="isAuth('5011:tab6:download')"
  1125. :remove-visible="isAuth('5011:tab6:remove')"
  1126. :preview-visible="isAuth('5011:tab6:preview')"
  1127. label="报价单号"
  1128. height="28vh"
  1129. :columns="ossColumns"
  1130. :order-ref1="currentQuote.site?currentQuote.site:''"
  1131. :order-ref2="currentQuote.quoteVersionNo?currentQuote.quoteVersionNo:''">
  1132. </oss-components>
  1133. </el-tab-pane>
  1134. <el-tab-pane label="询价-基本信息" name="request">
  1135. <price-check-properties ref="tabProperties"
  1136. v-model:data-list="priceCheckPropertiesList"
  1137. height="31vh"></price-check-properties>
  1138. </el-tab-pane>
  1139. <el-tab-pane label="询价-附件信息" name="oss">
  1140. <oss-components
  1141. :save-visible="isAuth('102001001:tab6:save')"
  1142. :download-visible="isAuth('102001001:tab6:download')"
  1143. :remove-visible="isAuth('102001001:tab6:remove')"
  1144. :preview-visible="isAuth('102001001:tab6:preview')"
  1145. label="询价单号"
  1146. height="28vh"
  1147. :columns="ossColumns"
  1148. :order-ref1="currentQuote.site"
  1149. :order-ref2="currentQuote.insideInquiryNo?currentQuote.insideInquiryNo.split('-')[0]:''">
  1150. </oss-components>
  1151. </el-tab-pane>
  1152. <!-- 审批信息 -->
  1153. <el-tab-pane label="审批信息" name="approvalInformation">
  1154. <approval-information ref="approvalTable" v-model:data-list="approvalList" :height="300"></approval-information>
  1155. </el-tab-pane>
  1156. </el-tabs>
  1157. <el-dialog :title="saveQuote.id? '报价信息:'+ saveQuote.quoteVersionNo : '报价信息'" v-drag :close-on-click-modal="false" :visible.sync="saveVisible" width="500px" >
  1158. <el-form ref="saveForm" :model="saveQuote" :rules="saveRules" label-position="top" label-width="100px">
  1159. <el-row :gutter="10">
  1160. <el-col :span="8">
  1161. <el-form-item label="内部询价单号" prop="insideInquiryNo" :show-message="false">
  1162. <span slot="label" v-if="!detailFlag">
  1163. <a @click="handleQueryInquiry">内部询价单号</a>
  1164. </span>
  1165. <el-input v-model="saveQuote.insideInquiryNo" readonly @change="handleInquiryBlur" :disabled="detailFlag"></el-input>
  1166. </el-form-item>
  1167. </el-col>
  1168. <el-col :span="8">
  1169. <el-form-item label="报价日期" prop="quoteDate" :show-message="false">
  1170. <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>
  1171. </el-form-item>
  1172. </el-col>
  1173. <el-col :span="8">
  1174. <el-form-item label="客户询价单号" prop="customerInquiryNo" :show-message="false">
  1175. <el-input v-model="saveQuote.customerInquiryNo" :disabled="detailFlag"></el-input>
  1176. </el-form-item>
  1177. </el-col>
  1178. </el-row>
  1179. <el-row :gutter="10">
  1180. <el-col :span="8">
  1181. <el-form-item label="客户编码" prop="customerNo" :show-message="false">
  1182. <span slot="label" v-if="!detailFlag">
  1183. <a @click="getBaseList(102)">客户编码</a>
  1184. </span>
  1185. <el-input v-model="saveQuote.customerNo" :disabled="detailFlag" @change="customerNoBlur"></el-input>
  1186. </el-form-item>
  1187. </el-col>
  1188. <el-col :span="16">
  1189. <el-form-item label="客户描述" prop="customerDesc" :show-message="false">
  1190. <el-input v-model="saveQuote.customerDesc" disabled></el-input>
  1191. </el-form-item>
  1192. </el-col>
  1193. </el-row>
  1194. <el-row :gutter="10">
  1195. <el-col :span="8">
  1196. <el-form-item label="项目编码" prop="projectNo" :show-message="false">
  1197. <span slot="label" v-if="saveQuote.customerNo && !detailFlag">
  1198. <a @click="getBaseList(104)">项目编码</a>
  1199. </span>
  1200. <el-input v-model="saveQuote.projectNo" :disabled="!saveQuote.customerNo || detailFlag"></el-input>
  1201. </el-form-item>
  1202. </el-col>
  1203. <el-col :span="16">
  1204. <el-form-item label="项目描述" prop="projectDesc" :show-message="false">
  1205. <el-input v-model="saveQuote.projectDesc" disabled></el-input>
  1206. </el-form-item>
  1207. </el-col>
  1208. </el-row>
  1209. <el-row :gutter="10">
  1210. <el-col :span="8">
  1211. <el-form-item label="终端客户编码" prop="finalCustomerNo" :show-message="false">
  1212. <el-input v-model="saveQuote.finalCustomerNo" disabled></el-input>
  1213. </el-form-item>
  1214. </el-col>
  1215. <el-col :span="16">
  1216. <el-form-item label="终端客户描述" prop="finalCustomerDesc" :show-message="false">
  1217. <el-input v-model="saveQuote.finalCustomerDesc" disabled></el-input>
  1218. </el-form-item>
  1219. </el-col>
  1220. </el-row>
  1221. <el-row :gutter="10">
  1222. <el-col :span="8">
  1223. <el-form-item label="报价专员" prop="quoter" :show-message="false">
  1224. <a slot="label" v-if="!detailFlag" @click="getBaseList(2002)">报价专员</a>
  1225. <el-input v-model="saveQuote.quoterName" readonly :disabled="detailFlag">
  1226. <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>
  1227. </el-input>
  1228. </el-form-item>
  1229. </el-col>
  1230. <el-col :span="8">
  1231. <el-form-item label="采购专员" prop="purchase" :show-message="false">
  1232. <a slot="label" v-if="!detailFlag" @click="getBaseList(2000)">采购专员</a>
  1233. <el-input v-model="saveQuote.purchaseName" readonly :disabled="detailFlag">
  1234. <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>
  1235. </el-input>
  1236. </el-form-item>
  1237. </el-col>
  1238. <el-col :span="24">
  1239. <el-form-item label="备注" prop="remark" class="auto" :show-message="false">
  1240. <el-input v-model="saveQuote.remark" :disabled="detailFlag" :rows="3" type="textarea"></el-input>
  1241. </el-form-item>
  1242. </el-col>
  1243. </el-row>
  1244. </el-form>
  1245. <div slot="footer" class="dialog-footer">
  1246. <el-button type="primary" v-if="!detailFlag" @click="handleSaveOrUpdateQuote"> </el-button>
  1247. <el-button @click="saveVisible = false"> </el-button>
  1248. </div>
  1249. </el-dialog>
  1250. <el-dialog title="询价申请" v-drag :visible.sync="insideInquiryVisible" width="1000px" modal-append-to-body :close-on-click-modal="false">
  1251. <el-form label-position="top"
  1252. :model="insideInquiry"
  1253. size="mini">
  1254. <el-row :gutter="10">
  1255. <el-col :span="3">
  1256. <el-form-item label="询价单号">
  1257. <el-input v-model="insideInquiry.quotationNo" clearable/>
  1258. </el-form-item>
  1259. </el-col>
  1260. <el-col :span="3">
  1261. <el-form-item label="申请批次号">
  1262. <el-input v-model="insideInquiry.quotationBatchNo" clearable></el-input>
  1263. </el-form-item>
  1264. </el-col>
  1265. <el-col :span="3">
  1266. <el-form-item label="序号">
  1267. <el-input v-model="insideInquiry.quotationItemNo" clearable></el-input>
  1268. </el-form-item>
  1269. </el-col>
  1270. <el-col :span="3">
  1271. <el-form-item label="项目名称">
  1272. <el-input v-model="insideInquiry.projectName" clearable></el-input>
  1273. </el-form-item>
  1274. </el-col>
  1275. <el-col :span="3">
  1276. <el-form-item label="直接客户名称">
  1277. <el-input v-model="insideInquiry.finalCustomerName" clearable></el-input>
  1278. </el-form-item>
  1279. </el-col>
  1280. <el-col :span="3">
  1281. <el-form-item label="报价专员">
  1282. <el-input v-model="insideInquiry.quoterName" clearable></el-input>
  1283. </el-form-item>
  1284. </el-col>
  1285. <el-col :span="3">
  1286. <el-form-item label="状态">
  1287. <el-select v-model="insideInquiry.quotationStatus" style="width:100%">
  1288. <el-option label="全部" value=""></el-option>
  1289. <el-option label="草稿" value="草稿"></el-option>
  1290. <el-option label="审批中" value="审批中"></el-option>
  1291. <el-option label="已完成" value="已完成"></el-option>
  1292. </el-select>
  1293. </el-form-item>
  1294. </el-col>
  1295. <el-col :span="2">
  1296. <el-form-item label=" ">
  1297. <el-button type="primary" style="padding: 3px 12px" @click="searchInsideInquiry">查询</el-button>
  1298. </el-form-item>
  1299. </el-col>
  1300. </el-row>
  1301. </el-form>
  1302. <el-table :data="insideInquiryList" height="300" stripe border @row-dblclick="dblclickInsideInquiry">
  1303. <el-table-column prop="quotationNo" header-align="center" min-width="120" label="询价单号"/>
  1304. <el-table-column prop="quotationBatchNo" header-align="center" label="询价批次号"/>
  1305. <el-table-column width="60" align="center" header-align="center" prop="quotationItemNo" label="询价序号"/>
  1306. <el-table-column prop="projectName" header-align="center" label="项目名称"/>
  1307. <el-table-column prop="quotationStatus" header-align="center" label="状态"/>
  1308. <el-table-column label="报价专员" header-align="center" prop="quoterName"/>
  1309. <el-table-column label="直接客户编码" header-align="center" prop="finalCustomerId"/>
  1310. <el-table-column label="直接客户名称" header-align="center" prop="finalCustomerName"/>
  1311. </el-table>
  1312. <el-footer style="height:30px;margin-top: 20px;text-align:center">
  1313. <el-button type="primary" @click="insideInquiryVisible = false">关闭</el-button>
  1314. </el-footer>
  1315. </el-dialog>
  1316. <choose-list ref="baseList" @getBaseData="getBaseData"></choose-list>
  1317. </div>
  1318. </template>
  1319. <style scoped>
  1320. .auto /deep/ .el-form-item__content{
  1321. height: auto;
  1322. line-height: 1.5;
  1323. }
  1324. </style>