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.

1739 lines
58 KiB

1 year ago
7 months ago
1 year ago
1 year ago
7 months ago
1 year ago
1 year ago
7 months ago
1 year ago
7 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
9 months ago
1 year ago
1 year ago
1 year ago
7 months ago
7 months ago
1 year ago
1 year ago
10 months ago
1 year ago
10 months ago
1 year ago
7 months ago
1 year ago
2 months ago
2 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
7 months ago
1 year ago
1 year ago
7 months ago
1 year ago
10 months ago
1 year ago
10 months ago
1 year ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
7 months ago
1 year ago
1 year ago
7 months ago
2 months ago
1 year ago
7 months ago
2 months ago
1 year ago
7 months ago
1 year ago
7 months ago
1 year ago
7 months ago
1 year ago
7 months ago
1 year ago
1 year ago
7 months ago
1 year ago
7 months ago
1 year ago
1 year ago
7 months ago
1 year ago
9 months ago
1 year ago
9 months 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
7 months ago
7 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, queryQuotePageByAnyField,
  7. queryQuoteRoleUser,
  8. removeQuote,
  9. saveQuote,
  10. updateQuote,
  11. updateQuoteStatus,
  12. quoteEditStatus
  13. } from "../../../api/quote/quote";
  14. import QuoteDetail from "./detail/quoteDetail.vue";
  15. import ChooseList from '@/views/modules/common/Chooselist';
  16. import {queryCustomer} from "../../../api/customer/customerInformation";
  17. import DictDataSelect from "../sys/dict-data-select.vue";
  18. import {queryProjectByCustomer} from "../../../api/project/project";
  19. import quotationCustomerContact from "../quotation/sellForQuotation/quotationCustomerContact.vue";
  20. import CustomerInfo from "../quotation/sellForQuotation/customerInfo.vue";
  21. import OssComponents from "../oss/ossComponents.vue";
  22. import quotationProjectInformation from "../quotation/sellForQuotation/quotationProjectInformation.vue";
  23. import {
  24. quotationInformationSearchByAnyField,
  25. searchQuotationByQuotationNo
  26. } from "../../../api/quotation/quotationInformation";
  27. import PriceCheckProperties from "../quotation/priceCheckProperties.vue";
  28. import ApprovalInformation from "../changeManagement/approvalInformation.vue";
  29. import {getPriceCheckPropertiesList} from "../../../api/quotation/priceCheckProperties";
  30. import {getApprovalList, getNodeAuthority, checkSuperAdmin} from "../../../api/changeManagement/changeManagement";
  31. import QuoteGroupDetail from "./detail/quoteGroupDetail.vue";
  32. import {submitChange} from "../../../api/quote/quote";
  33. import {queryQuoteDetail} from "../../../api/quote/quoteDetail";
  34. import FilterSearch from "../../common/filterSearch.vue";
  35. import {queryQuoteGroupDetail} from "../../../api/quote/quoteGroupDetail";
  36. export default {
  37. name: "quote",
  38. components: {
  39. FilterSearch,
  40. QuoteGroupDetail,
  41. ApprovalInformation, PriceCheckProperties,
  42. quotationProjectInformation, OssComponents, CustomerInfo, quotationCustomerContact,
  43. DictDataSelect,
  44. QuoteDetail,
  45. ChooseList,
  46. QuoteTable, QuoteSearch
  47. },
  48. props:{
  49. isMenu:{
  50. type:Boolean,
  51. default:true,
  52. },
  53. projectNo:{
  54. type:String,
  55. },
  56. height:{
  57. type:[Number,String],
  58. default:'35vh'
  59. }
  60. },
  61. menuId:5011,
  62. data(){
  63. return{
  64. total: 0,
  65. no:1,
  66. size: 20,
  67. quote:{
  68. id: null,
  69. site:"",
  70. quoteNo: "",
  71. customerInquiryNo: "",
  72. insideInquiryNo: "",
  73. buNo: "",
  74. buId: null,
  75. versionNo: "",
  76. status:'',
  77. quoteVersionNo: "",
  78. customerNo: "",
  79. customerDesc: "",
  80. projectNo: "",
  81. projectDesc: "",
  82. finalCustomerNo: "",
  83. finalCustomerDesc:"",
  84. currency: "",
  85. quoteDate: "",
  86. quoter: "",
  87. quoterName: "",
  88. purchase: "",
  89. purchaseName: "",
  90. remark: "",
  91. createBy: "",
  92. createDate: "",
  93. updateBy: "",
  94. updateDate: "",
  95. application: "",
  96. annualDemand: "",
  97. costModel: "UFIDA",
  98. markup:0,
  99. chipPrice:'',
  100. },
  101. quoteForm:{
  102. },
  103. saveQuote:{
  104. },
  105. dataList:[],
  106. columns: [
  107. {
  108. userId: this.$store.state.user.name,
  109. functionId: 5011,
  110. serialNumber: '5011Table1QuoteVersionNo',
  111. tableId: '5011Table1',
  112. tableName: '报价信息表',
  113. columnProp: 'quoteVersionNo',
  114. headerAlign: 'center',
  115. align: 'center',
  116. columnLabel: '报价单号',
  117. columnHidden: false,
  118. columnImage: false,
  119. columnSortable: false,
  120. sortLv: 0,
  121. status: true,
  122. fixed: '',
  123. columnWidth: 180
  124. },
  125. {
  126. userId: this.$store.state.user.name,
  127. functionId: 5011,
  128. serialNumber: '5011Table1PlmPartNo',
  129. tableId: '5011Table1',
  130. tableName: '报价信息表',
  131. columnProp: 'plmPartNo',
  132. headerAlign: 'center',
  133. align: 'left',
  134. columnLabel: 'PLM物料编码',
  135. columnHidden: false,
  136. columnImage: false,
  137. columnSortable: false,
  138. sortLv: 0,
  139. status: true,
  140. fixed: '',
  141. columnWidth: 120
  142. },
  143. {
  144. userId: this.$store.state.user.name,
  145. functionId: 5011,
  146. serialNumber: '5011Table1IfsPartNo',
  147. tableId: '5011Table1',
  148. tableName: '报价信息表',
  149. columnProp: 'ifsPartNo',
  150. headerAlign: 'center',
  151. align: 'left',
  152. columnLabel: 'IFS物料编码',
  153. columnHidden: false,
  154. columnImage: false,
  155. columnSortable: false,
  156. sortLv: 0,
  157. status: true,
  158. fixed: '',
  159. columnWidth: 120
  160. },
  161. {
  162. userId: this.$store.state.user.name,
  163. functionId: 5011,
  164. serialNumber: '5011Table1PartDesc',
  165. tableId: '5011Table1',
  166. tableName: '报价信息表',
  167. columnProp: 'partDesc',
  168. headerAlign: 'center',
  169. align: 'left',
  170. columnLabel: '物料名称',
  171. columnHidden: false,
  172. columnImage: false,
  173. columnSortable: false,
  174. sortLv: 0,
  175. status: true,
  176. fixed: '',
  177. columnWidth: 200
  178. },
  179. {
  180. userId: this.$store.state.user.name,
  181. functionId: 5011,
  182. serialNumber: '5011Table1CustomerNo',
  183. tableId: '5011Table1',
  184. tableName: '报价信息表',
  185. columnProp: 'customerNo',
  186. headerAlign: 'center',
  187. align: 'center',
  188. columnLabel: '客户编码',
  189. columnHidden: false,
  190. columnImage: false,
  191. columnSortable: false,
  192. sortLv: 0,
  193. status: true,
  194. fixed: '',
  195. columnWidth: 120
  196. },
  197. {
  198. userId: this.$store.state.user.name,
  199. functionId: 5011,
  200. serialNumber: '5011Table1CustomerDesc',
  201. tableId: '5011Table1',
  202. tableName: '报价信息表',
  203. columnProp: 'customerDesc',
  204. headerAlign: 'center',
  205. align: 'left',
  206. columnLabel: '客户名称',
  207. columnHidden: false,
  208. columnImage: false,
  209. columnSortable: false,
  210. sortLv: 0,
  211. status: true,
  212. fixed: '',
  213. columnWidth: 120
  214. },
  215. {
  216. userId: this.$store.state.user.name,
  217. functionId: 5011,
  218. serialNumber: '5011Table1ProjectNo',
  219. tableId: '5011Table1',
  220. tableName: '报价信息表',
  221. columnProp: 'projectNo',
  222. headerAlign: 'center',
  223. align: 'left',
  224. columnLabel: '项目号',
  225. columnHidden: false,
  226. columnImage: false,
  227. columnSortable: false,
  228. sortLv: 0,
  229. status: true,
  230. fixed: '',
  231. columnWidth: 120
  232. },
  233. {
  234. userId: this.$store.state.user.name,
  235. functionId: 5011,
  236. serialNumber: '5011Table1ProjectDesc',
  237. tableId: '5011Table1',
  238. tableName: '报价信息表',
  239. columnProp: 'projectDesc',
  240. headerAlign: 'center',
  241. align: 'left',
  242. columnLabel: '项目名称',
  243. columnHidden: false,
  244. columnImage: false,
  245. columnSortable: false,
  246. sortLv: 0,
  247. status: true,
  248. fixed: '',
  249. columnWidth: 120
  250. },
  251. {
  252. userId: this.$store.state.user.name,
  253. functionId: 5011,
  254. serialNumber: '5011Table1QuoterName',
  255. tableId: '5011Table1',
  256. tableName: '报价信息表',
  257. columnProp: 'quoterName',
  258. headerAlign: 'center',
  259. align: 'left',
  260. columnLabel: '报价专员',
  261. columnHidden: false,
  262. columnImage: false,
  263. columnSortable: false,
  264. sortLv: 0,
  265. status: true,
  266. fixed: '',
  267. columnWidth: 120
  268. },
  269. {
  270. userId: this.$store.state.user.name,
  271. functionId: 5011,
  272. serialNumber: '5011Table1PurchaseName',
  273. tableId: '5011Table1',
  274. tableName: '报价信息表',
  275. columnProp: 'purchaseName',
  276. headerAlign: 'center',
  277. align: 'left',
  278. columnLabel: '采购专员',
  279. columnHidden: false,
  280. columnImage: false,
  281. columnSortable: false,
  282. sortLv: 0,
  283. status: true,
  284. fixed: '',
  285. columnWidth: 120
  286. },
  287. {
  288. userId: this.$store.state.user.name,
  289. functionId: 5011,
  290. serialNumber: '5011Table1Status',
  291. tableId: '5011Table1',
  292. tableName: '报价信息表',
  293. columnProp: 'status',
  294. headerAlign: 'center',
  295. align: 'center',
  296. columnLabel: '状态',
  297. columnHidden: false,
  298. columnImage: false,
  299. columnSortable: false,
  300. sortLv: 0,
  301. status: true,
  302. fixed: '',
  303. columnWidth: 120
  304. },
  305. {
  306. userId: this.$store.state.user.name,
  307. functionId: 5011,
  308. serialNumber: '5011Table1NodeName',
  309. tableId: '5011Table1',
  310. tableName: '报价信息表',
  311. columnProp: 'nodeName',
  312. headerAlign: 'center',
  313. align: 'center',
  314. columnLabel: '当前审批节点',
  315. columnHidden: false,
  316. columnImage: false,
  317. columnSortable: false,
  318. sortLv: 0,
  319. status: true,
  320. fixed: '',
  321. columnWidth: 120
  322. },
  323. {
  324. userId: this.$store.state.user.name,
  325. functionId: 5011,
  326. serialNumber: '5011Table1ApprovalUsername',
  327. tableId: '5011Table1',
  328. tableName: '报价信息表',
  329. columnProp: 'approvalUsername',
  330. headerAlign: 'center',
  331. align: 'center',
  332. columnLabel: '当前审批人',
  333. columnHidden: false,
  334. columnImage: false,
  335. columnSortable: false,
  336. sortLv: 0,
  337. status: true,
  338. fixed: '',
  339. columnWidth: 120
  340. },
  341. {
  342. userId: this.$store.state.user.name,
  343. functionId: 5011,
  344. serialNumber: '5011Table1QuoteDate',
  345. tableId: '5011Table1',
  346. tableName: '报价信息表',
  347. columnProp: 'quoteDate',
  348. headerAlign: 'center',
  349. align: 'center',
  350. columnLabel: '报价日期',
  351. columnHidden: false,
  352. columnImage: false,
  353. columnSortable: false,
  354. sortLv: 0,
  355. status: true,
  356. fixed: '',
  357. columnWidth: 100
  358. },
  359. {
  360. userId: this.$store.state.user.name,
  361. functionId: 5011,
  362. serialNumber: '5011Table1CustomerInquiryNo',
  363. tableId: '5011Table1',
  364. tableName: '报价信息表',
  365. columnProp: 'customerInquiryNo',
  366. headerAlign: 'center',
  367. align: 'center',
  368. columnLabel: '客户询价单号',
  369. columnHidden: false,
  370. columnImage: false,
  371. columnSortable: false,
  372. sortLv: 0,
  373. status: true,
  374. fixed: '',
  375. columnWidth: 120
  376. },
  377. {
  378. userId: this.$store.state.user.name,
  379. functionId: 5011,
  380. serialNumber: '5011Table1InsideInquiryNo',
  381. tableId: '5011Table1',
  382. tableName: '报价信息表',
  383. columnProp: 'insideInquiryNo',
  384. headerAlign: 'center',
  385. align: 'center',
  386. columnLabel: '内部询价单号',
  387. columnHidden: false,
  388. columnImage: false,
  389. columnSortable: false,
  390. sortLv: 0,
  391. status: true,
  392. fixed: '',
  393. columnWidth: 120
  394. },
  395. {
  396. userId: this.$store.state.user.name,
  397. functionId: 5011,
  398. serialNumber: '5011Table1CreateBy',
  399. tableId: '5011Table1',
  400. tableName: '报价信息表',
  401. columnProp: 'createBy',
  402. headerAlign: 'center',
  403. align: 'center',
  404. columnLabel: '创建人',
  405. columnHidden: false,
  406. columnImage: false,
  407. columnSortable: false,
  408. sortLv: 0,
  409. status: true,
  410. fixed: '',
  411. columnWidth: 120
  412. },
  413. {
  414. userId: this.$store.state.user.name,
  415. functionId: 5011,
  416. serialNumber: '5011Table1CreateDate',
  417. tableId: '5011Table1',
  418. tableName: '报价信息表',
  419. columnProp: 'createDate',
  420. headerAlign: 'center',
  421. align: 'center',
  422. columnLabel: '创建时间',
  423. columnHidden: false,
  424. columnImage: false,
  425. columnSortable: false,
  426. sortLv: 0,
  427. status: true,
  428. fixed: '',
  429. columnWidth: 130
  430. },
  431. {
  432. userId: this.$store.state.user.name,
  433. functionId: 5011,
  434. serialNumber: '5011Table1UpdateBy',
  435. tableId: '5011Table1',
  436. tableName: '报价信息表',
  437. columnProp: 'updateBy',
  438. headerAlign: 'center',
  439. align: 'center',
  440. columnLabel: '更新人',
  441. columnHidden: false,
  442. columnImage: false,
  443. columnSortable: false,
  444. sortLv: 0,
  445. status: true,
  446. fixed: '',
  447. columnWidth: 120
  448. },
  449. {
  450. userId: this.$store.state.user.name,
  451. functionId: 5011,
  452. serialNumber: '5011Table1UpdateDate',
  453. tableId: '5011Table1',
  454. tableName: '报价信息表',
  455. columnProp: 'updateDate',
  456. headerAlign: 'center',
  457. align: 'center',
  458. columnLabel: '更新时间',
  459. columnHidden: false,
  460. columnImage: false,
  461. columnSortable: false,
  462. sortLv: 0,
  463. status: true,
  464. fixed: '',
  465. columnWidth: 130
  466. },
  467. ],
  468. searchLoading: false,
  469. saveVisible: false,
  470. saveLoading: false,
  471. activeName:'detail2',
  472. // OA审批相关
  473. superAdmin: false,
  474. rejectVisible: false,
  475. rejectOpinion: '',
  476. plmQuoteDetailArr: [],
  477. defaultQuoteDetailRow: null, // 默认报价行数据
  478. userBuList: [],
  479. saveRules: {
  480. buId:[{required: true, message: '请选择BU', trigger: ['blur','change']}],
  481. customerNo:[{required: true, message: '请输入客户编码', trigger: ['blur','change']}],
  482. customerDesc:[{required: true, message: '请输入客户名称', trigger: ['blur','change']}],
  483. projectNo:[{required: true, message: '请输入项目编码', trigger: ['blur','change']}],
  484. projectDesc:[{required: true, message: '请输入项目名称', trigger: ['blur','change']}],
  485. currency:[{required: true, message: '请输入币种', trigger: ['blur','change']}],
  486. quoteDate:[{required: true, message: '请选择报价日期', trigger: ['blur','change']}],
  487. quoter:[{required: true, message: '请输入报价专员', trigger: ['blur','change']}],
  488. },
  489. customerVisible:false,
  490. projectVisible:false,
  491. quoterVisible:false,
  492. purchaseVisible:false,
  493. filterVisible:false,
  494. isFilterSearch: false,
  495. filterSearchData: {},
  496. currentQuote:{
  497. },
  498. userVisible:false,
  499. userTitle:'人员信息',
  500. user:{
  501. username:'',
  502. userDisplay:'',
  503. active:'',
  504. buId:null,
  505. roleNo:'',
  506. },
  507. userDataList:[],
  508. tagNo:undefined,
  509. insideInquiryVisible:false,
  510. detailFlag:false,
  511. ossColumns:[
  512. {
  513. userId: this.$store.state.user.name,
  514. functionId: 5011,
  515. serialNumber: '5011Table2FileName',
  516. tableId: '5011Table2',
  517. tableName: '文件信息表',
  518. columnProp: 'fileName',
  519. headerAlign: 'center',
  520. align: 'left',
  521. columnLabel: '文件名称',
  522. columnHidden: false,
  523. columnImage: false,
  524. columnSortable: false,
  525. sortLv: 0,
  526. status: true,
  527. fixed: '',
  528. columnWidth: 140
  529. },
  530. {
  531. userId: this.$store.state.user.name,
  532. functionId: 5011,
  533. serialNumber: '5011Table2FileRemark',
  534. tableId: '5011Table2',
  535. tableName: '文件信息表',
  536. columnProp: 'fileRemark',
  537. headerAlign: 'center',
  538. align: 'left',
  539. columnLabel: '备注',
  540. columnHidden: false,
  541. columnImage: false,
  542. columnSortable: false,
  543. sortLv: 0,
  544. status: true,
  545. fixed: '',
  546. columnWidth: 240
  547. },
  548. {
  549. userId: this.$store.state.user.name,
  550. functionId: 5011,
  551. serialNumber: '5011Table2CreateDate',
  552. tableId: '5011Table2',
  553. tableName: '文件信息表',
  554. columnProp: 'createDate',
  555. headerAlign: 'center',
  556. align: 'center',
  557. columnLabel: '上传时间',
  558. columnHidden: false,
  559. columnImage: false,
  560. columnSortable: false,
  561. sortLv: 0,
  562. status: true,
  563. fixed: '',
  564. columnWidth: 140
  565. },
  566. {
  567. userId: this.$store.state.user.name,
  568. functionId: 5011,
  569. serialNumber: '5011Table2CreatedBy',
  570. tableId: '5011Table2',
  571. tableName: '文件信息表',
  572. columnProp: 'createBy',
  573. headerAlign: 'center',
  574. align: 'center',
  575. columnLabel: '上传人',
  576. columnHidden: false,
  577. columnImage: false,
  578. columnSortable: false,
  579. sortLv: 0,
  580. status: true,
  581. fixed: '',
  582. columnWidth: 140
  583. }
  584. ],
  585. insideInquiry:{
  586. },
  587. insideInquiryList:[],
  588. priceCheckPropertiesList:[],
  589. approvalList:[],
  590. exportData: [],
  591. exportName: '项目报价'+this.dayjs().format('YYYYMMDDHHmmss'),
  592. exportHeader: ["项目报价"],
  593. exportFooter: [],
  594. searchIndex:0,
  595. // OA审批相关
  596. submitLoading: false,
  597. }
  598. },
  599. methods:{
  600. handleSearch(index){
  601. let params = {
  602. ...this.quoteForm,
  603. no: this.no,
  604. size: this.size,
  605. }
  606. this.searchLoading = true
  607. queryQuotePage(params).then(({data})=>{
  608. if (data && data.code === 0){
  609. this.dataList = data.rows
  610. this.total = data.total
  611. // 加载每个报价的明细首条数据
  612. this.loadQuoteDetailInfo()
  613. if (this.dataList[0] !== undefined) {
  614. this.handleSelect(this.dataList[0])
  615. } else {
  616. this.currentQuote = {}
  617. }
  618. // if (index !== undefined){
  619. // this.handleSelect(this.dataList[index])
  620. // }
  621. }else {
  622. this.$message.error(data.msg)
  623. }
  624. this.searchLoading = false
  625. }).catch(error=>{
  626. this.$message.error(error)
  627. this.searchLoading = false
  628. })
  629. this.isFilterSearch = false
  630. },
  631. loadQuoteDetailInfo(){
  632. // 批量加载每个报价的首条明细数据
  633. this.dataList.forEach(quote => {
  634. queryQuoteGroupDetail({quoteId: quote.id}).then(({data}) => {
  635. if (data && data.code === 0 && data.rows && data.rows.length > 0) {
  636. const firstDetail = data.rows[0]
  637. // 使用$set确保响应式更新
  638. this.$set(quote, 'plmPartNo', firstDetail.plmPartNo)
  639. this.$set(quote, 'ifsPartNo', firstDetail.ifsPartNo)
  640. this.$set(quote, 'partDesc', firstDetail.partDesc)
  641. } else {
  642. // 如果没有明细数据,清空这三个字段
  643. this.$set(quote, 'plmPartNo', '')
  644. this.$set(quote, 'ifsPartNo', '')
  645. this.$set(quote, 'partDesc', '')
  646. }
  647. }).catch(() => {
  648. // 忽略错误,只是显示为空
  649. })
  650. })
  651. },
  652. // 刷新指定报价的首条明细信息
  653. handleRefreshQuoteInfo(quoteId){
  654. console.log('刷新报价明细信息, quoteId:', quoteId)
  655. // 直接重新查询当前页数据,这样可以确保数据同步
  656. this.handleSearch()
  657. },
  658. // ========== OA审批相关方法 ==========
  659. // 校验是否为超级管理员
  660. checkSuperAdmin() {
  661. checkSuperAdmin().then(({data}) => {
  662. this.superAdmin = data.superAdmin
  663. })
  664. },
  665. // 判断当前用户是否是审批人
  666. isApprovalUser() {
  667. if (this.superAdmin) return true
  668. if (!this.currentQuote.approvalUsername) return false
  669. return this.currentQuote.approvalUsername.split(';').includes(this.$store.state.user.name)
  670. },
  671. // 获取流程的配置权限
  672. async getNodeAuthority() {
  673. let tempData = {
  674. site: this.currentQuote.site,
  675. stepId: this.currentQuote.stepId,
  676. menuId: this.$route.meta.menuId
  677. }
  678. await getNodeAuthority(tempData).then(({data}) => {
  679. if (data && data.code === 0) {
  680. this.plmQuoteDetailArr = data.rows.plm_quote_detail || []
  681. }
  682. })
  683. },
  684. // 获取默认报价行的条目明细数据
  685. async getDefaultQuoteDetailRow() {
  686. // 1. 先获取第一个报价明细行(QuoteGroupDetail)
  687. let groupParams = {
  688. quoteId: this.currentQuote.id,
  689. site: this.currentQuote.site,
  690. }
  691. const groupRes = await queryQuoteGroupDetail(groupParams)
  692. if (!groupRes.data || groupRes.data.code !== 0 || !groupRes.data.rows || groupRes.data.rows.length === 0) {
  693. this.defaultQuoteDetailRow = null
  694. return
  695. }
  696. const firstGroupDetail = groupRes.data.rows[0]
  697. // 2. 根据 quoteGroupDetailId 和 currentQuoteDetailItemNo 获取对应的条目明细
  698. let detailParams = {
  699. quoteGroupDetailId: firstGroupDetail.id,
  700. site: this.currentQuote.site,
  701. }
  702. const detailRes = await queryQuoteDetail(detailParams)
  703. if (!detailRes.data || detailRes.data.code !== 0 || !detailRes.data.rows || detailRes.data.rows.length === 0) {
  704. this.defaultQuoteDetailRow = null
  705. return
  706. }
  707. // 3. 如果设置了 currentQuoteDetailItemNo,则按 itemNo 匹配,否则取第一条
  708. const currentItemNo = firstGroupDetail.currentQuoteDetailItemNo
  709. if (currentItemNo) {
  710. this.defaultQuoteDetailRow = detailRes.data.rows.find(row => row.itemNo === currentItemNo) || detailRes.data.rows[0]
  711. } else {
  712. this.defaultQuoteDetailRow = detailRes.data.rows[0]
  713. }
  714. },
  715. // 同意提交
  716. agreeSubmit() {
  717. // 校验默认报价行的必填字段
  718. if (this.plmQuoteDetailArr && this.plmQuoteDetailArr.length > 0 && this.defaultQuoteDetailRow) {
  719. for (let i = 0; i < this.plmQuoteDetailArr.length; i++) {
  720. const field = this.plmQuoteDetailArr[i]
  721. if (field.required === 'Y' && !this.defaultQuoteDetailRow[field.fieldId] && this.defaultQuoteDetailRow[field.fieldId] !== 0) {
  722. this.$message.warning(field.fieldName + '不能为空!')
  723. return
  724. }
  725. }
  726. }
  727. this.$confirm('是否确认提交?', '提示', {
  728. confirmButtonText: '确定',
  729. cancelButtonText: '取消',
  730. type: 'warning'
  731. }).then(() => {
  732. this.submitLoading = true
  733. let params = {
  734. ...this.currentQuote,
  735. userName: this.$store.state.user.name,
  736. nodeConclusion: 'Y',
  737. menuId: this.$route.meta.menuId
  738. }
  739. submitChange(params).then(({data}) => {
  740. if (data && data.code === 0) {
  741. this.$message({message: '操作成功', type: 'success'})
  742. this.saveVisible = false
  743. this.handleSearch()
  744. } else {
  745. this.$alert(data.msg, '错误', {
  746. confirmButtonText: '确定'
  747. })
  748. }
  749. this.submitLoading = false
  750. }).catch((error) => {
  751. this.$message.error(error)
  752. this.submitLoading = false
  753. })
  754. })
  755. },
  756. // 驳回提交
  757. rejectSubmit() {
  758. // 校验默认报价行的必填字段
  759. if (this.plmQuoteDetailArr && this.plmQuoteDetailArr.length > 0 && this.defaultQuoteDetailRow) {
  760. for (let i = 0; i < this.plmQuoteDetailArr.length; i++) {
  761. const field = this.plmQuoteDetailArr[i]
  762. if (field.required === 'Y' && !this.defaultQuoteDetailRow[field.fieldId] && this.defaultQuoteDetailRow[field.fieldId] !== 0) {
  763. this.$message.warning('默认报价行的' + field.fieldName + '不能为空!')
  764. return
  765. }
  766. }
  767. }
  768. this.$confirm('是否确认驳回?', '提示', {
  769. confirmButtonText: '确定',
  770. cancelButtonText: '取消',
  771. type: 'warning'
  772. }).then(() => {
  773. this.submitLoading = true
  774. let params = {
  775. ...this.currentQuote,
  776. userName: this.$store.state.user.name,
  777. nodeConclusion: 'N',
  778. rejectOpinion: this.rejectOpinion,
  779. menuId: this.$route.meta.menuId
  780. }
  781. submitChange(params).then(({data}) => {
  782. if (data && data.code === 0) {
  783. this.$message({message: '操作成功', type: 'success'})
  784. this.rejectVisible = false
  785. this.saveVisible = false
  786. this.handleSearch()
  787. } else {
  788. this.$alert(data.msg, '错误', {
  789. confirmButtonText: '确定'
  790. })
  791. }
  792. this.submitLoading = false
  793. }).catch((error) => {
  794. this.$message.error(error)
  795. this.submitLoading = false
  796. })
  797. })
  798. },
  799. // 关闭驳回表单
  800. closeRejectForm() {
  801. this.rejectOpinion = ''
  802. this.rejectVisible = false
  803. },
  804. // ========== OA审批相关方法结束 ==========
  805. handleSelect(row){
  806. if (row){
  807. this.currentQuote = {...row}
  808. } else {
  809. this.currentQuote = {}
  810. }
  811. },
  812. async handleSave(row){
  813. this.$nextTick(()=>{
  814. if (this.$refs.saveForm){
  815. this.$refs.saveForm.clearValidate();
  816. }
  817. })
  818. if (row){
  819. this.saveQuote = {
  820. ...row
  821. }
  822. // 如果是审批中状态,获取权限配置和默认报价行数据
  823. if (row.status === '审批中') {
  824. await this.getNodeAuthority()
  825. await this.getDefaultQuoteDetailRow()
  826. }
  827. }else {
  828. this.saveQuote = {
  829. ...this.quote,
  830. buNo:'*',
  831. site:this.$store.state.user.site
  832. }
  833. this.$nextTick(()=>{
  834. this.saveQuote.buId = this.userBuList.length > 0? this.userBuList[0].id:null;
  835. })
  836. }
  837. this.saveVisible = true
  838. },
  839. handleSizeChange(size){
  840. this.size = size
  841. if ( this.isFilterSearch === false){
  842. this.handleSearch()
  843. } else {
  844. this.searchByAnyField(this.filterSearchData)
  845. }
  846. },
  847. handlePageChange(no) {
  848. this.no = no
  849. if ( this.isFilterSearch === false){
  850. this.handleSearch()
  851. } else {
  852. this.searchByAnyField(this.filterSearchData)
  853. }
  854. },
  855. handleQueryBu(){
  856. let params = {
  857. username: this.$store.state.user.name,
  858. }
  859. // getSiteAndBuByUserName(params).then(({data}) => {
  860. // if (data && data.code === 0) {
  861. // this.userBuList = data.rows
  862. // }else {
  863. // this.$message.warning(data.msg)
  864. // }
  865. // }).catch((error)=>{
  866. // this.$message.error(error)
  867. // })
  868. },
  869. handleSaveOrUpdateQuote(){
  870. this.$refs.saveForm.validate((valid,obj) => {
  871. if (valid){
  872. if (this.saveQuote.id){
  873. this.handleUpdateQuote();
  874. }else {
  875. this.handleSaveQuote();
  876. }
  877. }else {
  878. let i = 1;
  879. for (let key in obj){
  880. this.$message.warning(obj[key][0].message)
  881. if (i === 1){
  882. return
  883. }
  884. i++;
  885. }
  886. }
  887. })
  888. },
  889. handleSaveQuote(){
  890. let params = {
  891. ...this.saveQuote,
  892. status: '草稿',
  893. action: 'Y',
  894. createBy: this.$store.state.user.name,
  895. }
  896. this.saveLoading = true
  897. saveQuote(params).then(({data})=>{
  898. if (data && data.code === 0){
  899. this.saveVisible = false
  900. this.quoteForm.quoteVersionNo = data.quoteVersionNo
  901. this.$message.success(data.msg)
  902. }else {
  903. this.$message.warning(data.msg)
  904. }
  905. this.handleSearch(0);
  906. this.saveLoading = false
  907. }).catch((error)=>{
  908. this.$message.error(error)
  909. this.saveLoading = false
  910. })
  911. },
  912. handleUpdateQuote(){
  913. let params = {
  914. ...this.saveQuote,
  915. updateBy: this.$store.state.user.name,
  916. }
  917. this.saveLoading = true
  918. updateQuote(params).then(({data})=>{
  919. if (data && data.code === 0){
  920. this.saveVisible = false
  921. this.currentQuote = {
  922. ...this.currentQuote
  923. }
  924. this.$message.success(data.msg)
  925. }else {
  926. this.$message.warning(data.msg)
  927. }
  928. this.handleSearch();
  929. this.saveLoading = false
  930. }).catch((error)=>{
  931. this.$message.error(error)
  932. this.saveLoading = false
  933. })
  934. },
  935. handleRemove(row){
  936. this.$confirm('确认删除该报价信息吗?', '提示', {
  937. confirmButtonText: '确定',
  938. cancelButtonText: '取消',
  939. type: 'warning'
  940. }).then(() => {
  941. this.handleRemoveQuote(row)
  942. }).catch(() => {
  943. })
  944. },
  945. handleUpdateStatus(row){
  946. let params = {
  947. ...row
  948. }
  949. updateQuoteStatus(params).then(({data})=>{
  950. if (data && data.code === 0){
  951. this.$message.success(data.msg)
  952. this.handleSearch();
  953. this.currentQuote = {
  954. ...row
  955. }
  956. }else {
  957. this.$message.warning(data.msg)
  958. }
  959. }).catch((error)=>{
  960. this.$message.error(error)
  961. })
  962. },
  963. handleQueryById(row){
  964. this.saveQuote = {
  965. ...row
  966. }
  967. this.detailFlag = true;
  968. this.saveVisible = true;
  969. },
  970. handleRemoveQuote(row){
  971. let params = {
  972. id: row.id,
  973. }
  974. removeQuote(params).then(({data})=>{
  975. if (data && data.code === 0){
  976. this.$message.success(data.msg)
  977. if (row.id === this.currentQuote.id){
  978. this.handleSearch(0);
  979. }else {
  980. this.handleSearch();
  981. }
  982. }else {
  983. this.$message.warning(data.msg)
  984. }
  985. }).catch((error)=>{
  986. this.$message.error(error)
  987. })
  988. },
  989. customerNoBlur(){
  990. let params = {
  991. site:this.$store.state.user.site,
  992. customerNo:this.saveQuote.customerNo
  993. }
  994. queryCustomer(params).then(({data})=>{
  995. if (data && data.code === 0 ) {
  996. if (data.rows && data.rows.length === 1){
  997. this.saveQuote.customerDesc = data.rows[0].customerDesc
  998. }else {
  999. this.saveQuote.customerDesc = ''
  1000. }
  1001. }else {
  1002. this.$message.warning(data.msg)
  1003. }
  1004. }).catch((error)=>{
  1005. this.$message.error(error)
  1006. })
  1007. },
  1008. projectNoBlur(){
  1009. let params = {
  1010. site:this.$store.state.user.site,
  1011. customerId:this.saveQuote.customerNo,
  1012. projectId:this.saveQuote.projectNo
  1013. }
  1014. queryProjectByCustomer(params).then(({data})=>{
  1015. if (data && data.code === 0 ){
  1016. if (data.rows && data.rows.length === 1){
  1017. this.saveQuote.projectDesc = data.rows[0].projectName
  1018. this.saveQuote.finalCustomerNo = data.rows[0].finalCustomerId
  1019. this.saveQuote.finalCustomerDesc = data.rows[0].finalCustomerName
  1020. }else {
  1021. this.saveQuote.projectDesc = ''
  1022. this.saveQuote.finalCustomerNo = ''
  1023. this.saveQuote.finalCustomerDesc = ''
  1024. }
  1025. }else {
  1026. this.$message.warning(data.msg)
  1027. }
  1028. }).catch((error)=>{
  1029. this.$message.error(error)
  1030. })
  1031. },
  1032. handleRowClick(row){
  1033. this.currentQuote = {...row}
  1034. },
  1035. userDblClick(row){
  1036. if (this.quoterVisible){
  1037. this.saveQuote.quoter = row.username
  1038. this.quoterVisible = false
  1039. }else if (this.purchaseVisible){
  1040. this.saveQuote.purchase = row.username
  1041. this.purchaseVisible = false
  1042. }
  1043. this.userVisible = false
  1044. },
  1045. handleQuoterClick(){
  1046. this.userTitle = '报价专员'
  1047. this.user.username = this.saveQuote.quoter
  1048. this.user.userDisplay = ''
  1049. this.user.active = ''
  1050. this.user.buId = this.saveQuote.buId
  1051. this.user.roleNo = 'QUOTER'
  1052. this.quoterVisible = true
  1053. this.handleQueryQuoteRoleUser();
  1054. this.userVisible = true
  1055. },
  1056. handlePurchaseClick(){
  1057. this.userTitle = '采购专员'
  1058. this.user.username = this.saveQuote.purchase
  1059. this.user.userDisplay = ''
  1060. this.user.active = ''
  1061. this.user.buId = this.saveQuote.buId
  1062. this.user.roleNo = 'PURCHASE'
  1063. this.purchaseVisible = true
  1064. this.handleQueryQuoteRoleUser();
  1065. this.userVisible = true
  1066. },
  1067. handleQueryQuoteRoleUser(){
  1068. let params = {
  1069. ...this.user,
  1070. }
  1071. this.userDataList = []
  1072. queryQuoteRoleUser(params).then(({data})=>{
  1073. if (data && data.code === 0){
  1074. this.userDataList = data.rows
  1075. }else {
  1076. this.$message.warning(data.msg)
  1077. }
  1078. }).catch((error)=>{
  1079. this.$message.error(error)
  1080. })
  1081. },
  1082. getBaseList(val){
  1083. this.tagNo = val
  1084. this.$nextTick(() => {
  1085. let strVal = ''
  1086. let conSql = ''
  1087. if (val === 102) {
  1088. strVal = this.saveQuote.customerNo
  1089. }
  1090. if (val === 104) {
  1091. strVal = this.saveQuote.projectNo
  1092. conSql = " and customer_id = '" + this.saveQuote.customerNo + "'"
  1093. }
  1094. if (val === 2000) {
  1095. strVal = this.saveQuote.purchase
  1096. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  1097. }
  1098. if (val === 2002) {
  1099. strVal = this.saveQuote.quoter
  1100. conSql = " and b.site = '" + this.$store.state.user.site + "'"
  1101. }
  1102. this.$refs.baseList.init(val, strVal, conSql)
  1103. })
  1104. },
  1105. getBaseData(val){
  1106. switch (this.tagNo){
  1107. case 102:
  1108. if (this.saveQuote.customerNo !== val.Customer_no) {
  1109. this.saveQuote.projectNo = '';
  1110. this.saveQuote.projectDesc = '';
  1111. }
  1112. this.saveQuote.customerNo = val.Customer_no
  1113. this.saveQuote.customerDesc = val.Customer_desc
  1114. break;
  1115. case 104:
  1116. this.saveQuote.projectNo = val.project_id
  1117. this.saveQuote.projectDesc = val.project_name
  1118. break;
  1119. case 2000:
  1120. this.saveQuote.purchase = val.username
  1121. this.saveQuote.purchaseName = val.user_display
  1122. break
  1123. case 2002:
  1124. this.saveQuote.quoter = val.username
  1125. this.saveQuote.quoterName = val.user_display
  1126. break;
  1127. }
  1128. },
  1129. handleQueryByIds(){
  1130. let params = {
  1131. ids:this.$route.params.ids,
  1132. no:this.no,
  1133. size:this.size,
  1134. createBy:this.$store.state.user.name,
  1135. }
  1136. queryQuotePage(params).then(({data})=>{
  1137. if (data && data.code === 0){
  1138. this.dataList = data.rows
  1139. this.total = data.total
  1140. if (this.total > 0){
  1141. this.currentQuote = {...this.dataList[0]}
  1142. }else {
  1143. this.currentQuote = {}
  1144. }
  1145. }else {
  1146. this.$message.error(data.msg)
  1147. }
  1148. this.searchLoading = false
  1149. }).catch(error=>{
  1150. this.$message.error(error)
  1151. this.searchLoading = false
  1152. })
  1153. },
  1154. handleInquiryBlur(){
  1155. let params = {
  1156. site:this.$store.state.user.site,
  1157. quotationNo:this.saveQuote.insideInquiryNo,
  1158. }
  1159. searchQuotationByQuotationNo(params).then(({data}) => {
  1160. if (data && data.code === 0){
  1161. if (data.data.length === 1){
  1162. this.dblclickInsideInquiry(data.data[0])
  1163. }
  1164. }
  1165. })
  1166. },
  1167. handleAgainQuote(row){
  1168. let params = {
  1169. id: row.id,
  1170. createBy: this.$store.state.user.name,
  1171. }
  1172. this.queryLoading = true
  1173. againQuote(params).then(({data}) => {
  1174. if (data && data.code === 0) {
  1175. this.$message.success(data.msg)
  1176. this.handleSearch();
  1177. } else {
  1178. this.$message.warning(data.msg)
  1179. this.queryLoading = false
  1180. }
  1181. }).catch((error) => {
  1182. this.$message.error(error)
  1183. this.queryLoading = false
  1184. })
  1185. },
  1186. clearModalData(field){
  1187. this.$set(this.saveQuote,field,'')
  1188. },
  1189. handleQueryInquiry(){
  1190. this.insideInquiry = {
  1191. site:this.$store.state.user.site,
  1192. quotationNo:this.saveQuote.insideInquiryNo,
  1193. quotationBatchNo:'',
  1194. quotationItemNo:'',
  1195. testPartNo:'',
  1196. projectName:'',
  1197. finalCustomerName:'',
  1198. quoterName:'',
  1199. partName:'',
  1200. quotationStatus:'审批中',
  1201. }
  1202. this.searchInsideInquiry();
  1203. this.insideInquiryVisible = true
  1204. },
  1205. dblclickInsideInquiry(row){
  1206. this.saveQuote.insideInquiryNo = row.quotationNo
  1207. this.saveQuote.customerNo = row.customerNo
  1208. this.saveQuote.customerDesc = row.customerDesc
  1209. this.saveQuote.projectNo = row.projectId
  1210. this.saveQuote.projectDesc = row.projectName
  1211. this.saveQuote.quoter = row.quoter
  1212. this.saveQuote.quoterName = row.quoterName
  1213. this.saveQuote.finalCustomerNo = row.finalCustomerId
  1214. this.saveQuote.finalCustomerDesc = row.finalCustomerName
  1215. this.saveQuote.purchase = row.tracker
  1216. this.saveQuote.purchaseName = row.trackerName
  1217. this.insideInquiryVisible = false
  1218. },
  1219. searchInsideInquiry(){
  1220. searchQuotationByQuotationNo(this.insideInquiry).then(({data}) => {
  1221. if (data && data.code === 0){
  1222. this.insideInquiryList = data.data;
  1223. }
  1224. })
  1225. },
  1226. getPriceCheckProperties() {
  1227. if (!this.currentQuote && !this.currentQuote.insideInquiryNo){
  1228. this.priceCheckPropertiesList = []
  1229. return
  1230. }
  1231. let params = {
  1232. site: this.saveQuote.site,
  1233. quotationNo: this.currentQuote.insideInquiryNo
  1234. }
  1235. getPriceCheckPropertiesList(params).then(({data}) => {
  1236. if (data && data.code === 0) {
  1237. this.priceCheckPropertiesList = data.rows
  1238. } else {
  1239. this.$message.warning(data.msg)
  1240. }
  1241. }).catch((error) => {
  1242. this.$message.error(error)
  1243. })
  1244. },
  1245. // 查询审批信息
  1246. getApprovalList () {
  1247. let tempData = {
  1248. site: this.$store.state.user.site,
  1249. menuId: this.$route.meta.menuId,
  1250. documentNo: this.currentQuote.quoteVersionNo
  1251. }
  1252. getApprovalList(tempData).then(({data}) => {
  1253. if (data && data.code === 0) {
  1254. this.approvalList = data.rows
  1255. } else {
  1256. this.approvalList = []
  1257. }
  1258. })
  1259. },
  1260. fields() {
  1261. let json = "{"
  1262. this.columns.forEach((item, index) => {
  1263. if (index === this.columns.length - 1) {
  1264. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\""
  1265. } else {
  1266. json += "\"" + item.columnLabel + "\"" + ":" + "\"" + item.columnProp + "\"" + ","
  1267. }
  1268. })
  1269. json += "}"
  1270. return eval("(" + json + ")")
  1271. },
  1272. createExportData() {
  1273. return this.dataList;
  1274. },
  1275. searchByAnyField(params){
  1276. params.site = this.$store.state.user.site
  1277. params.no = this.no
  1278. params.size = this.size
  1279. params.userId = this.$store.state.user.id.toString()
  1280. queryQuotePageByAnyField(params).then(({data})=>{
  1281. if (data && data.code === 0){
  1282. this.dataList = data.page.list
  1283. this.total = data.page.totalCount
  1284. // 加载每个报价的明细首条数据
  1285. this.loadQuoteDetailInfo()
  1286. }else {
  1287. this.$message.warning(data.msg)
  1288. }
  1289. }).catch((error)=>{
  1290. this.$message.error(error)
  1291. })
  1292. this.filterSearchData = params
  1293. this.isFilterSearch = true
  1294. this.filterVisible = false
  1295. },
  1296. // 下达(首次提交到OA)
  1297. handleEditStatus(row) {
  1298. this.$confirm('是否确认下达?', '提示', {
  1299. confirmButtonText: '确定',
  1300. cancelButtonText: '取消',
  1301. type: 'warning'
  1302. }).then(() => {
  1303. this.submitLoading = true
  1304. let params = {
  1305. ...row,
  1306. userName: this.$store.state.user.name,
  1307. menuId: this.$route.meta.menuId
  1308. }
  1309. quoteEditStatus(params).then(({data}) => {
  1310. if (data && data.code === 0) {
  1311. this.$message({message: '操作成功', type: 'success'})
  1312. this.handleSearch()
  1313. } else {
  1314. this.$alert(data.msg, '错误', {
  1315. confirmButtonText: '确定'
  1316. })
  1317. }
  1318. this.submitLoading = false
  1319. }).catch((error) => {
  1320. this.$message.error(error)
  1321. this.submitLoading = false
  1322. })
  1323. })
  1324. },
  1325. },
  1326. created() {
  1327. this.checkSuperAdmin() // 校验超级管理员
  1328. // 如果是从OA系统跳转来的(tokenLogin),不在created中查询,由activated处理
  1329. if (this.isMenu && this.searchIndex === 0 && this.$route.params.type !== 'tokenLogin'){
  1330. this.quoteForm = {
  1331. ...this.quote,
  1332. site: this.$store.state.user.site,
  1333. createBy: this.$store.state.user.name,
  1334. }
  1335. this.handleQueryBu();// 查询 BU
  1336. this.handleSearch(0);// 查询报价信息
  1337. }
  1338. this.searchIndex++;
  1339. },
  1340. watch:{
  1341. 'quoteForm.customerNo'(newVal, oldVal){
  1342. this.quoteForm.customerNo = newVal.toUpperCase()
  1343. },
  1344. 'quoteForm.projectNo'(newVal, oldVal){
  1345. this.quoteForm.projectNo = newVal.toUpperCase()
  1346. },
  1347. 'quoteForm.quoteNo'(newVal, oldVal){
  1348. this.quoteForm.quoteNo = newVal.toUpperCase()
  1349. },
  1350. 'saveQuote.customerNo'(newVal, oldVal){
  1351. if (newVal){
  1352. this.saveQuote.customerNo = newVal.toUpperCase()
  1353. }else {
  1354. this.saveQuote.customerDesc = ''
  1355. this.saveQuote.projectNo = ''
  1356. this.saveQuote.projectDesc = ''
  1357. }
  1358. },
  1359. 'saveQuote.projectNo'(newVal, oldVal){
  1360. if (newVal){
  1361. this.saveQuote.projectNo = newVal.toUpperCase()
  1362. this.projectNoBlur();
  1363. }else {
  1364. this.saveQuote.projectDesc = ''
  1365. this.saveQuote.finalCustomerNo = ''
  1366. this.saveQuote.finalCustomerDesc = ''
  1367. }
  1368. },
  1369. 'saveQuote.quoter'(newVal, oldVal){
  1370. if (!newVal){
  1371. this.saveQuote.quoterName = ''
  1372. }
  1373. },
  1374. 'saveQuote.purchase'(newVal, oldVal){
  1375. if (!newVal){
  1376. this.saveQuote.purchaseName = ''
  1377. }
  1378. },
  1379. saveVisible(newVal, oldVal){
  1380. if (newVal === false){
  1381. this.detailFlag = false;
  1382. }
  1383. },
  1384. 'saveQuote.currency'(newVal, oldVal){
  1385. this.saveQuote.currency = newVal.toUpperCase()
  1386. },
  1387. 'currentQuote'(newVal, oldVal){
  1388. if (newVal && this.isMenu){
  1389. this.getPriceCheckProperties();
  1390. this.getApprovalList();
  1391. }
  1392. },
  1393. projectNo(newVal, oldVal){
  1394. if (newVal && !this.isMenu){
  1395. this.quoteForm.projectNo = newVal.toUpperCase()
  1396. this.quoteForm.site = this.$store.state.user.site
  1397. this.handleSearch(0);
  1398. }else {
  1399. this.dataList = []
  1400. this.total = 0
  1401. this.no = 1
  1402. }
  1403. },
  1404. },
  1405. activated() {
  1406. if (!this.isMenu){
  1407. return
  1408. }
  1409. if (this.$route.params.ids){
  1410. this.handleQueryByIds();
  1411. } else if (this.$route.params.type === 'tokenLogin') {
  1412. // 从OA系统跳转过来
  1413. if (this.$route.params.docNo) {
  1414. this.quoteForm = {
  1415. ...this.quote,
  1416. site: this.$store.state.user.site,
  1417. quoteVersionNo: this.$route.params.docNo,
  1418. }
  1419. }
  1420. this.handleSearch(0);
  1421. } else if (this.$route.params.type === 'project'){
  1422. this.quoteForm = {
  1423. ...this.quote,
  1424. site: this.$store.state.user.site,
  1425. quoteVersionNo: this.$route.params.quoteVersionNo,
  1426. }
  1427. this.handleSearch(0);
  1428. }
  1429. }
  1430. }
  1431. </script>
  1432. <template>
  1433. <div>
  1434. <download-excel v-if="!isMenu"
  1435. :fields="fields()"
  1436. :data="exportData"
  1437. type="xls"
  1438. :name="exportName"
  1439. :header="exportHeader"
  1440. :footer="exportFooter"
  1441. :fetch="createExportData"
  1442. worksheet="导出信息"
  1443. class="el-button el-button--primary el-button--medium">
  1444. {{ '导出' }}
  1445. </download-excel>
  1446. <quote-search v-if="isMenu" v-model:quote="quoteForm" @filterSearch="filterVisible = true" @search="handleSearch" @save="handleSave"></quote-search>
  1447. <quote-table v-loading="searchLoading"
  1448. :current-row="currentQuote"
  1449. :columns="columns"
  1450. style="margin-top: 5px"
  1451. :is-menu="isMenu"
  1452. @save="handleSave"
  1453. @remove="handleRemove"
  1454. @rowClick="handleRowClick"
  1455. @updateStatus="handleUpdateStatus"
  1456. @queryById="handleQueryById"
  1457. @againQuote="handleAgainQuote"
  1458. @editStatus="handleEditStatus"
  1459. :data-list="dataList"
  1460. :height="height">
  1461. </quote-table>
  1462. <el-pagination @size-change="handleSizeChange"
  1463. @current-change="handlePageChange"
  1464. :current-page="no"
  1465. :page-sizes="[20, 50, 100, 200, 500]"
  1466. :page-size="size"
  1467. :total="total"
  1468. layout="total,sizes, prev, pager, next, jumper">
  1469. </el-pagination>
  1470. <el-tabs v-if="isMenu" v-model="activeName" type="border-card" style="margin-top: 0;" class="customer-tab">
  1471. <el-tab-pane v-if="isAuth('5011:pane:quoteGroupDetail')" label="报价明细" name="detail">
  1472. <quote-group-detail :quote="currentQuote" :auth-flag="false" :height="'28vh'" @refresh-quote-info="handleRefreshQuoteInfo"></quote-group-detail>
  1473. </el-tab-pane>
  1474. <el-tab-pane v-if="isAuth('5011:pane:quoteDetail')" label="条目明细" name="detail2">
  1475. <quote-detail v-if="activeName === 'detail2'" :save-auth="false" :is-export="true" :quote="currentQuote" :auth-flag="false" :height="'30vh'" @refresh-quote-info="handleRefreshQuoteInfo"></quote-detail>
  1476. </el-tab-pane>
  1477. <el-tab-pane v-if="isAuth('5011:pane:quotationProjectInformation')" label="项目信息" name="quotation_project_information">
  1478. <quotation-project-information height="31vh" :quotation-header="currentQuote"></quotation-project-information>
  1479. </el-tab-pane>
  1480. <el-tab-pane v-if="isAuth('5011:pane:customerInfo')" label="客户信息" name="quotation_customer_information">
  1481. <customer-info height="31vh" :project="currentQuote"></customer-info>
  1482. </el-tab-pane>
  1483. <el-tab-pane v-if="isAuth('5011:pane:quotationCustomerContact')" label="客户联系人" name="quotation_customer_contact">
  1484. <quotation-customer-contact height="28vh" :quotation-header="currentQuote"></quotation-customer-contact>
  1485. </el-tab-pane>
  1486. <el-tab-pane v-if="isAuth('5011:pane:ossComponents1')" label="报价-附件信息" name="quote_oss">
  1487. <oss-components
  1488. :save-visible="isAuth('5011:tab6:save')"
  1489. :download-visible="isAuth('5011:tab6:download')"
  1490. :remove-visible="isAuth('5011:tab6:remove')"
  1491. :preview-visible="isAuth('5011:tab6:preview')"
  1492. label="报价单号"
  1493. height="28vh"
  1494. :columns="ossColumns"
  1495. :order-ref1="currentQuote.site?currentQuote.site:''"
  1496. :order-ref2="currentQuote.quoteVersionNo?currentQuote.quoteVersionNo:''">
  1497. </oss-components>
  1498. </el-tab-pane>
  1499. <el-tab-pane v-if="isAuth('5011:pane:priceCheckProperties')" label="询价-基本信息" name="request">
  1500. <price-check-properties ref="tabProperties"
  1501. v-model:data-list="priceCheckPropertiesList"
  1502. height="31vh"></price-check-properties>
  1503. </el-tab-pane>
  1504. <el-tab-pane v-if="isAuth('5011:pane:ossComponents2')" label="询价-附件信息" name="oss">
  1505. <oss-components
  1506. :save-visible="isAuth('102001001:tab6:save')"
  1507. :download-visible="isAuth('102001001:tab6:download')"
  1508. :remove-visible="isAuth('102001001:tab6:remove')"
  1509. :preview-visible="isAuth('102001001:tab6:preview')"
  1510. label="询价单号"
  1511. height="28vh"
  1512. :columns="ossColumns"
  1513. :order-ref1="currentQuote.site"
  1514. :order-ref2="currentQuote.insideInquiryNo?currentQuote.insideInquiryNo.split('-')[0]:''">
  1515. </oss-components>
  1516. </el-tab-pane>
  1517. <!-- 审批信息 -->
  1518. <el-tab-pane v-if="isAuth('5011:pane:approvalInformation')" label="审批信息" name="approvalInformation">
  1519. <approval-information ref="approvalTable" v-model:data-list="approvalList" :height="300"></approval-information>
  1520. </el-tab-pane>
  1521. </el-tabs>
  1522. <el-dialog :title="saveQuote.id? '报价信息:'+ saveQuote.quoteVersionNo : '报价信息'" v-drag :close-on-click-modal="false" :visible.sync="saveVisible" width="500px" >
  1523. <el-form ref="saveForm" :model="saveQuote" :rules="saveRules" label-position="top" label-width="100px">
  1524. <el-row :gutter="10">
  1525. <el-col :span="8">
  1526. <el-form-item label="内部询价单号" prop="insideInquiryNo" :show-message="false">
  1527. <span slot="label" v-if="!detailFlag">
  1528. <a @click="handleQueryInquiry">内部询价单号</a>
  1529. </span>
  1530. <el-input v-model="saveQuote.insideInquiryNo" readonly @change="handleInquiryBlur" :disabled="detailFlag"></el-input>
  1531. </el-form-item>
  1532. </el-col>
  1533. <el-col :span="8">
  1534. <el-form-item label="报价日期" prop="quoteDate" :show-message="false">
  1535. <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>
  1536. </el-form-item>
  1537. </el-col>
  1538. <el-col :span="8">
  1539. <el-form-item label="客户询价单号" prop="customerInquiryNo" :show-message="false">
  1540. <el-input v-model="saveQuote.customerInquiryNo" :disabled="detailFlag"></el-input>
  1541. </el-form-item>
  1542. </el-col>
  1543. </el-row>
  1544. <el-row :gutter="10">
  1545. <el-col :span="8">
  1546. <el-form-item label="客户编码" prop="customerNo" :show-message="false">
  1547. <span slot="label" v-if="!detailFlag">
  1548. <a @click="getBaseList(102)">客户编码</a>
  1549. </span>
  1550. <el-input v-model="saveQuote.customerNo" :disabled="detailFlag" @change="customerNoBlur"></el-input>
  1551. </el-form-item>
  1552. </el-col>
  1553. <el-col :span="16">
  1554. <el-form-item label="客户描述" prop="customerDesc" :show-message="false">
  1555. <el-input v-model="saveQuote.customerDesc" disabled></el-input>
  1556. </el-form-item>
  1557. </el-col>
  1558. </el-row>
  1559. <el-row :gutter="10">
  1560. <el-col :span="8">
  1561. <el-form-item label="项目号" prop="projectNo" :show-message="false">
  1562. <span slot="label" v-if="saveQuote.customerNo && !detailFlag">
  1563. <a @click="getBaseList(104)">项目号</a>
  1564. </span>
  1565. <el-input v-model="saveQuote.projectNo" :disabled="!saveQuote.customerNo || detailFlag"></el-input>
  1566. </el-form-item>
  1567. </el-col>
  1568. <el-col :span="16">
  1569. <el-form-item label="项目描述" prop="projectDesc" :show-message="false">
  1570. <el-input v-model="saveQuote.projectDesc" disabled></el-input>
  1571. </el-form-item>
  1572. </el-col>
  1573. </el-row>
  1574. <el-row :gutter="10">
  1575. <el-col :span="8">
  1576. <el-form-item label="终端客户编码" prop="finalCustomerNo" :show-message="false">
  1577. <el-input v-model="saveQuote.finalCustomerNo" disabled></el-input>
  1578. </el-form-item>
  1579. </el-col>
  1580. <el-col :span="16">
  1581. <el-form-item label="终端客户描述" prop="finalCustomerDesc" :show-message="false">
  1582. <el-input v-model="saveQuote.finalCustomerDesc" disabled></el-input>
  1583. </el-form-item>
  1584. </el-col>
  1585. </el-row>
  1586. <el-row :gutter="10">
  1587. <el-col :span="8">
  1588. <el-form-item label="报价专员" prop="quoter" :show-message="false">
  1589. <a slot="label" v-if="!detailFlag" @click="getBaseList(2002)">报价专员</a>
  1590. <el-input v-model="saveQuote.quoterName" readonly :disabled="detailFlag">
  1591. <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>
  1592. </el-input>
  1593. </el-form-item>
  1594. </el-col>
  1595. <el-col :span="8">
  1596. <el-form-item label="采购专员" prop="purchase" :show-message="false">
  1597. <a slot="label" v-if="!detailFlag" @click="getBaseList(2000)">采购专员</a>
  1598. <el-input v-model="saveQuote.purchaseName" readonly :disabled="detailFlag">
  1599. <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>
  1600. </el-input>
  1601. </el-form-item>
  1602. </el-col>
  1603. <el-col :span="8">
  1604. <el-form-item label=" " prop="purchase" :show-message="false">
  1605. <el-checkbox v-model="saveQuote.annualSales" :disabled="detailFlag" true-label="Y" false-label="N">项目年销售额>100M</el-checkbox>
  1606. </el-form-item>
  1607. </el-col>
  1608. <el-col :span="24">
  1609. <el-form-item label="备注" prop="remark" class="auto" :show-message="false">
  1610. <el-input v-model="saveQuote.remark" :disabled="detailFlag" :rows="3" type="textarea"></el-input>
  1611. </el-form-item>
  1612. </el-col>
  1613. </el-row>
  1614. </el-form>
  1615. <div slot="footer" class="dialog-footer">
  1616. <el-button type="primary" v-if="!detailFlag" @click="handleSaveOrUpdateQuote"> </el-button>
  1617. <el-button @click="saveVisible = false"> </el-button>
  1618. <template v-if="saveQuote.status === '审批中' && isApprovalUser()">
  1619. <el-button v-if="isAuth('5011:submit')" type="primary" :loading="submitLoading" @click="agreeSubmit">同意</el-button>
  1620. <el-button v-if="isAuth('5011:reject') && currentQuote.isReject === 'Y'" type="primary" @click="rejectVisible = true">驳回</el-button>
  1621. </template>
  1622. </div>
  1623. </el-dialog>
  1624. <!-- 驳回意见弹窗 -->
  1625. <el-dialog title="驳回" top="30vh" :close-on-click-modal="false" v-drag :visible.sync="rejectVisible" width="500px" append-to-body>
  1626. <el-form label-position="top">
  1627. <el-form-item label="驳回意见" class="auto">
  1628. <el-input type="textarea" v-model="rejectOpinion" :rows="3"></el-input>
  1629. </el-form-item>
  1630. </el-form>
  1631. <el-footer style="text-align:center;height: 30px;line-height: 30px;">
  1632. <el-button type="primary" :loading="submitLoading" @click="rejectSubmit">确定</el-button>
  1633. <el-button type="primary" @click="closeRejectForm">取消</el-button>
  1634. </el-footer>
  1635. </el-dialog>
  1636. <el-dialog title="询价申请" v-drag :visible.sync="insideInquiryVisible" width="1000px" modal-append-to-body :close-on-click-modal="false">
  1637. <el-form label-position="top"
  1638. :model="insideInquiry"
  1639. size="mini">
  1640. <el-row :gutter="10">
  1641. <el-col :span="3">
  1642. <el-form-item label="询价单号">
  1643. <el-input v-model="insideInquiry.quotationNo" clearable/>
  1644. </el-form-item>
  1645. </el-col>
  1646. <el-col :span="3">
  1647. <el-form-item label="申请批次号">
  1648. <el-input v-model="insideInquiry.quotationBatchNo" clearable></el-input>
  1649. </el-form-item>
  1650. </el-col>
  1651. <el-col :span="3">
  1652. <el-form-item label="序号">
  1653. <el-input v-model="insideInquiry.quotationItemNo" clearable></el-input>
  1654. </el-form-item>
  1655. </el-col>
  1656. <el-col :span="3">
  1657. <el-form-item label="项目名称">
  1658. <el-input v-model="insideInquiry.projectName" clearable></el-input>
  1659. </el-form-item>
  1660. </el-col>
  1661. <el-col :span="3">
  1662. <el-form-item label="直接客户名称">
  1663. <el-input v-model="insideInquiry.finalCustomerName" clearable></el-input>
  1664. </el-form-item>
  1665. </el-col>
  1666. <el-col :span="3">
  1667. <el-form-item label="报价专员">
  1668. <el-input v-model="insideInquiry.quoterName" clearable></el-input>
  1669. </el-form-item>
  1670. </el-col>
  1671. <el-col :span="3">
  1672. <el-form-item label="状态">
  1673. <el-select v-model="insideInquiry.quotationStatus" style="width:100%">
  1674. <el-option label="全部" value=""></el-option>
  1675. <el-option label="草稿" value="草稿"></el-option>
  1676. <el-option label="审批中" value="审批中"></el-option>
  1677. <el-option label="已完成" value="已完成"></el-option>
  1678. </el-select>
  1679. </el-form-item>
  1680. </el-col>
  1681. <el-col :span="2">
  1682. <el-form-item label=" ">
  1683. <el-button type="primary" style="padding: 3px 12px" @click="searchInsideInquiry">查询</el-button>
  1684. </el-form-item>
  1685. </el-col>
  1686. </el-row>
  1687. </el-form>
  1688. <el-table :data="insideInquiryList" height="300" stripe border @row-dblclick="dblclickInsideInquiry">
  1689. <el-table-column prop="quotationNo" header-align="center" min-width="120" label="询价单号"/>
  1690. <el-table-column prop="quotationBatchNo" header-align="center" label="询价批次号"/>
  1691. <el-table-column width="60" align="center" header-align="center" prop="quotationItemNo" label="询价序号"/>
  1692. <el-table-column prop="projectName" header-align="center" label="项目名称"/>
  1693. <el-table-column prop="quotationStatus" header-align="center" label="状态"/>
  1694. <el-table-column label="报价专员" header-align="center" prop="quoterName"/>
  1695. <el-table-column label="直接客户编码" header-align="center" prop="finalCustomerId"/>
  1696. <el-table-column label="直接客户名称" header-align="center" prop="finalCustomerName"/>
  1697. </el-table>
  1698. <el-footer style="height:30px;margin-top: 20px;text-align:center">
  1699. <el-button type="primary" @click="insideInquiryVisible = false">关闭</el-button>
  1700. </el-footer>
  1701. </el-dialog>
  1702. <choose-list ref="baseList" @getBaseData="getBaseData"></choose-list>
  1703. <filter-search :visible.sync="filterVisible" ref="filter-search" @search="searchByAnyField"></filter-search>
  1704. </div>
  1705. </template>
  1706. <style scoped>
  1707. .auto /deep/ .el-form-item__content{
  1708. height: auto;
  1709. line-height: 1.5;
  1710. }
  1711. </style>