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.

956 lines
30 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. <script>
  2. import QuoteSearch from "./primary/quoteSearch.vue";
  3. import QuoteTable from "./primary/quoteTable.vue";
  4. import {queryQuotePage, queryQuoteRoleUser, removeQuote, saveQuote, updateQuote} from "../../../api/quote/quote";
  5. import {getSiteAndBuByUserName} from "../../../api/eam/eam";
  6. import CustomerTable from "../../../components/selector/table/customerTable.vue";
  7. import BuSelect from "../../../components/selector/select/BuSelect.vue";
  8. import ProjectTable from "../../../components/selector/table/projectTable.vue";
  9. import {queryCustomerList} from "../../../api/customer/customer";
  10. import {queryProjectList} from "../../../api/project/project";
  11. import QuoteDetail from "./detail/quoteDetail.vue";
  12. import ChooseListEam from "../common/Chooselist_eam.vue";
  13. import Quotes from "./quotes.vue";
  14. export default {
  15. name: "quote",
  16. components: {Quotes, ChooseListEam,QuoteDetail, ProjectTable, BuSelect, CustomerTable, QuoteTable, QuoteSearch},
  17. menuId:5011,
  18. data(){
  19. return{
  20. total: 0,
  21. no:1,
  22. size: 20,
  23. quote:{
  24. id: null,
  25. site:"",
  26. quoteNo: "",
  27. customerInquiryNo: "",
  28. insideInquiryNo: "",
  29. buNo: "",
  30. buId: null,
  31. versionNo: "",
  32. status:'',
  33. quoteVersionNo: "",
  34. customerNo: "",
  35. customerDesc: "",
  36. projectNo: "",
  37. projectDesc: "",
  38. currency: "",
  39. quoteDate: "",
  40. quoter: "",
  41. purchase: "",
  42. remark: "",
  43. createBy: "",
  44. createDate: "",
  45. updateBy: "",
  46. updateDate: "",
  47. },
  48. quoteForm:{
  49. },
  50. saveQuote:{
  51. },
  52. dataList:[],
  53. columns: [
  54. {
  55. userId: this.$store.state.user.name,
  56. functionId: 5011,
  57. serialNumber: '5011Table1BuDesc',
  58. tableId: '5011Table1',
  59. tableName: '报价信息表',
  60. columnProp: 'buDesc',
  61. headerAlign: 'center',
  62. align: 'center',
  63. columnLabel: 'BU',
  64. columnHidden: false,
  65. columnImage: false,
  66. columnSortable: false,
  67. sortLv: 0,
  68. status: true,
  69. fixed: '',
  70. columnWidth: 120
  71. },
  72. {
  73. userId: this.$store.state.user.name,
  74. functionId: 5011,
  75. serialNumber: '5011Table1QuoteVersionNo',
  76. tableId: '5011Table1',
  77. tableName: '报价信息表',
  78. columnProp: 'quoteVersionNo',
  79. headerAlign: 'center',
  80. align: 'center',
  81. columnLabel: '报价单号',
  82. columnHidden: false,
  83. columnImage: false,
  84. columnSortable: false,
  85. sortLv: 0,
  86. status: true,
  87. fixed: '',
  88. columnWidth: 180
  89. },
  90. {
  91. userId: this.$store.state.user.name,
  92. functionId: 5011,
  93. serialNumber: '5011Table1QuoteNo',
  94. tableId: '5011Table1',
  95. tableName: '报价信息表',
  96. columnProp: 'quoteNo',
  97. headerAlign: 'center',
  98. align: 'center',
  99. columnLabel: '报价追溯号',
  100. columnHidden: false,
  101. columnImage: false,
  102. columnSortable: false,
  103. sortLv: 0,
  104. status: true,
  105. fixed: '',
  106. columnWidth: 120
  107. },
  108. {
  109. userId: this.$store.state.user.name,
  110. functionId: 5011,
  111. serialNumber: '5011Table1QuoteDate',
  112. tableId: '5011Table1',
  113. tableName: '报价信息表',
  114. columnProp: 'quoteDate',
  115. headerAlign: 'center',
  116. align: 'center',
  117. columnLabel: '报价日期',
  118. columnHidden: false,
  119. columnImage: false,
  120. columnSortable: false,
  121. sortLv: 0,
  122. status: true,
  123. fixed: '',
  124. columnWidth: 100
  125. },
  126. {
  127. userId: this.$store.state.user.name,
  128. functionId: 5011,
  129. serialNumber: '5011Table1CustomerNo',
  130. tableId: '5011Table1',
  131. tableName: '报价信息表',
  132. columnProp: 'customerNo',
  133. headerAlign: 'center',
  134. align: 'center',
  135. columnLabel: '客户编码',
  136. columnHidden: false,
  137. columnImage: false,
  138. columnSortable: false,
  139. sortLv: 0,
  140. status: true,
  141. fixed: '',
  142. columnWidth: 120
  143. },
  144. {
  145. userId: this.$store.state.user.name,
  146. functionId: 5011,
  147. serialNumber: '5011Table1CustomerDesc',
  148. tableId: '5011Table1',
  149. tableName: '报价信息表',
  150. columnProp: 'customerDesc',
  151. headerAlign: 'center',
  152. align: 'left',
  153. columnLabel: '客户名称',
  154. columnHidden: false,
  155. columnImage: false,
  156. columnSortable: false,
  157. sortLv: 0,
  158. status: true,
  159. fixed: '',
  160. columnWidth: 120
  161. },
  162. {
  163. userId: this.$store.state.user.name,
  164. functionId: 5011,
  165. serialNumber: '5011Table1ProjectNo',
  166. tableId: '5011Table1',
  167. tableName: '报价信息表',
  168. columnProp: 'projectNo',
  169. headerAlign: 'center',
  170. align: 'left',
  171. columnLabel: '项目编码',
  172. columnHidden: false,
  173. columnImage: false,
  174. columnSortable: false,
  175. sortLv: 0,
  176. status: true,
  177. fixed: '',
  178. columnWidth: 200
  179. }, {
  180. userId: this.$store.state.user.name,
  181. functionId: 5011,
  182. serialNumber: '5011Table1ProjectDesc',
  183. tableId: '5011Table1',
  184. tableName: '报价信息表',
  185. columnProp: 'projectDesc',
  186. headerAlign: 'center',
  187. align: 'left',
  188. columnLabel: '项目名称',
  189. columnHidden: false,
  190. columnImage: false,
  191. columnSortable: false,
  192. sortLv: 0,
  193. status: true,
  194. fixed: '',
  195. columnWidth: 200
  196. },
  197. {
  198. userId: this.$store.state.user.name,
  199. functionId: 5011,
  200. serialNumber: '5011Table1QuoterName',
  201. tableId: '5011Table1',
  202. tableName: '报价信息表',
  203. columnProp: 'quoterName',
  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: '5011Table1PurchaseName',
  219. tableId: '5011Table1',
  220. tableName: '报价信息表',
  221. columnProp: 'purchaseName',
  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: '5011Table1Currency',
  237. tableId: '5011Table1',
  238. tableName: '报价信息表',
  239. columnProp: 'currency',
  240. headerAlign: 'center',
  241. align: 'center',
  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: '5011Table1Status',
  255. tableId: '5011Table1',
  256. tableName: '报价信息表',
  257. columnProp: 'status',
  258. headerAlign: 'center',
  259. align: 'center',
  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: '5011Table1CustomerInquiryNo',
  273. tableId: '5011Table1',
  274. tableName: '报价信息表',
  275. columnProp: 'customerInquiryNo',
  276. headerAlign: 'center',
  277. align: 'center',
  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: '5011Table1InsideInquiryNo',
  291. tableId: '5011Table1',
  292. tableName: '报价信息表',
  293. columnProp: 'insideInquiryNo',
  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: '5011Table1CreateBy',
  309. tableId: '5011Table1',
  310. tableName: '报价信息表',
  311. columnProp: 'createBy',
  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: '5011Table1CreateDate',
  327. tableId: '5011Table1',
  328. tableName: '报价信息表',
  329. columnProp: 'createDate',
  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: '5011Table1UpdateBy',
  345. tableId: '5011Table1',
  346. tableName: '报价信息表',
  347. columnProp: 'updateBy',
  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: 120
  358. },
  359. {
  360. userId: this.$store.state.user.name,
  361. functionId: 5011,
  362. serialNumber: '5011Table1UpdateDate',
  363. tableId: '5011Table1',
  364. tableName: '报价信息表',
  365. columnProp: 'updateDate',
  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. searchLoading: false,
  379. saveVisible: false,
  380. saveLoading: false,
  381. activeName:'detail',
  382. userBuList: [],
  383. saveRules: {
  384. buId:[{required: true, message: '请选择BU', trigger: ['blur','change']}],
  385. customerNo:[{required: true, message: '请输入客户编码', trigger: ['blur','change']}],
  386. customerDesc:[{required: true, message: '请输入客户名称', trigger: ['blur','change']}],
  387. projectNo:[{required: true, message: '请输入项目编码', trigger: ['blur','change']}],
  388. projectDesc:[{required: true, message: '请输入项目名称', trigger: ['blur','change']}],
  389. currency:[{required: true, message: '请输入币种', trigger: ['blur','change']}],
  390. quoteDate:[{required: true, message: '请选择报价日期', trigger: ['blur','change']}],
  391. quoter:[{required: true, message: '请输入报价专员', trigger: ['blur','change']}],
  392. purchase:[{required: true, message: '请输入询价专员', trigger: ['blur','change']}],
  393. },
  394. customerVisible:false,
  395. projectVisible:false,
  396. quoterVisible:false,
  397. purchaseVisible:false,
  398. currentQuote:{
  399. },
  400. userVisible:false,
  401. userTitle:'人员信息',
  402. user:{
  403. username:'',
  404. userDisplay:'',
  405. active:'',
  406. buId:null,
  407. roleNo:'',
  408. },
  409. userDataList:[],
  410. tagNo:undefined,
  411. insideInquiryVisible:false,
  412. }
  413. },
  414. methods:{
  415. handleSearch(){
  416. let params = {
  417. ...this.quoteForm,
  418. no: this.no,
  419. size: this.size,
  420. }
  421. this.searchLoading = true
  422. queryQuotePage(params).then(({data})=>{
  423. if (data && data.code === 0){
  424. this.dataList = data.rows
  425. this.total = data.total
  426. if (this.total > 0){
  427. this.currentQuote = {...this.dataList[0]}
  428. }else {
  429. this.currentQuote = {}
  430. }
  431. }else {
  432. this.$message.error(data.msg)
  433. }
  434. this.searchLoading = false
  435. }).catch(error=>{
  436. this.$message.error(error)
  437. this.searchLoading = false
  438. })
  439. },
  440. handleSave(row){
  441. this.$nextTick(()=>{
  442. if (this.$refs.saveForm){
  443. this.$refs.saveForm.clearValidate();
  444. }
  445. })
  446. if (row){
  447. this.saveQuote = {
  448. ...row
  449. }
  450. }else {
  451. this.saveQuote = {
  452. ...this.quote,
  453. }
  454. this.$nextTick(()=>{
  455. this.saveQuote.buId = this.userBuList.length > 0? this.userBuList[0].id:null;
  456. })
  457. }
  458. this.saveVisible = true
  459. },
  460. handleSizeChange(size){
  461. this.size = size
  462. this.handleSearch();
  463. },
  464. handlePageChange(no) {
  465. this.no = no
  466. this.handleSearch();
  467. },
  468. handleQueryBu(){
  469. let params = {
  470. username: this.$store.state.user.name,
  471. }
  472. getSiteAndBuByUserName(params).then(({data}) => {
  473. if (data && data.code === 0) {
  474. this.userBuList = data.rows
  475. }else {
  476. this.$message.warning(data.msg)
  477. }
  478. }).catch((error)=>{
  479. this.$message.error(error)
  480. })
  481. },
  482. handleSaveOrUpdateQuote(){
  483. this.$refs.saveForm.validate((valid,obj) => {
  484. if (valid){
  485. if (this.saveQuote.id){
  486. this.handleUpdateQuote();
  487. }else {
  488. this.handleSaveQuote();
  489. }
  490. }else {
  491. let i = 1;
  492. for (let key in obj){
  493. this.$message.warning(obj[key][0].message)
  494. if (i === 1){
  495. return
  496. }
  497. i++;
  498. }
  499. }
  500. })
  501. },
  502. handleSaveQuote(){
  503. let params = {
  504. ...this.saveQuote,
  505. status: '草稿',
  506. action: 'Y',
  507. createBy: this.$store.state.user.name,
  508. }
  509. this.saveLoading = true
  510. saveQuote(params).then(({data})=>{
  511. if (data && data.code === 0){
  512. this.saveVisible = false
  513. this.$message.success(data.msg)
  514. }else {
  515. this.$message.warning(data.msg)
  516. }
  517. this.handleSearch();
  518. this.saveLoading = false
  519. }).catch((error)=>{
  520. this.$message.error(error)
  521. this.saveLoading = false
  522. })
  523. },
  524. handleUpdateQuote(){
  525. let params = {
  526. ...this.saveQuote,
  527. updateBy: this.$store.state.user.name,
  528. }
  529. this.saveLoading = true
  530. updateQuote(params).then(({data})=>{
  531. if (data && data.code === 0){
  532. this.saveVisible = false
  533. this.$message.success(data.msg)
  534. }else {
  535. this.$message.warning(data.msg)
  536. }
  537. this.handleSearch();
  538. this.saveLoading = false
  539. }).catch((error)=>{
  540. this.$message.error(error)
  541. this.saveLoading = false
  542. })
  543. },
  544. customerDblClick(row){
  545. this.saveQuote.customerNo = row.customerNo
  546. this.saveQuote.customerDesc = row.customerDesc
  547. this.customerVisible = false
  548. },
  549. projectDblClick(row){
  550. this.saveQuote.projectNo = row.projectNo
  551. this.saveQuote.projectDesc = row.projectDesc
  552. this.projectVisible = false
  553. },
  554. handleRemove(row){
  555. this.$alert('确认删除该报价信息吗?', '提示', {
  556. confirmButtonText: '确定',
  557. cancelButtonText: '取消',
  558. type: 'warning'
  559. }).then(() => {
  560. this.handleRemoveQuote(row)
  561. }).catch(() => {
  562. })
  563. },
  564. handleRemoveQuote(row){
  565. let params = {
  566. id: row.id,
  567. }
  568. removeQuote(params).then(({data})=>{
  569. if (data && data.code === 0){
  570. this.$message.success(data.msg)
  571. this.handleSearch();
  572. }else {
  573. this.$message.warning(data.msg)
  574. }
  575. }).catch((error)=>{
  576. this.$message.error(error)
  577. })
  578. },
  579. customerNoBlur(){
  580. let params = {
  581. customerNo: this.saveQuote.customerNo,
  582. createBy: this.$store.state.user.name,
  583. }
  584. queryCustomerList(params).then(({data}) => {
  585. if (data && data.code === 0) {
  586. if (data.rows.length === 1){
  587. this.saveQuote.customerDesc = data.rows[0].customerDesc
  588. }else {
  589. this.saveQuote.projectNo = ''
  590. this.saveQuote.projectDesc = ''
  591. this.saveQuote.customerDesc = ''
  592. }
  593. }else {
  594. this.$message.warning(data.message)
  595. }
  596. }).catch((error) => {
  597. this.$message.error(error)
  598. })
  599. },
  600. projectNoBlur(){
  601. let params = {
  602. projectNo: this.saveQuote.projectNo,
  603. customerNo: this.saveQuote.customerNo,
  604. createBy: this.$store.state.user.name,
  605. buId: this.saveQuote.buId,
  606. }
  607. queryProjectList(params).then(({data})=>{
  608. if (data && data.code === 0) {
  609. if (data.rows.length === 1) {
  610. this.saveQuote.projectDesc = data.rows[0].projectDesc
  611. }else {
  612. this.saveQuote.projectDesc = ''
  613. }
  614. }else {
  615. this.$message.warning(data.msg)
  616. }
  617. }).catch((error)=>{
  618. this.$message.error(error)
  619. })
  620. },
  621. handleRowClick(row){
  622. this.currentQuote = {...row}
  623. },
  624. userDblClick(row){
  625. if (this.quoterVisible){
  626. this.saveQuote.quoter = row.username
  627. this.quoterVisible = false
  628. }else if (this.purchaseVisible){
  629. this.saveQuote.purchase = row.username
  630. this.purchaseVisible = false
  631. }
  632. this.userVisible = false
  633. },
  634. handleQuoterClick(){
  635. this.userTitle = '报价专员'
  636. this.user.username = this.saveQuote.quoter
  637. this.user.userDisplay = ''
  638. this.user.active = ''
  639. this.user.buId = this.saveQuote.buId
  640. this.user.roleNo = 'QUOTER'
  641. this.quoterVisible = true
  642. this.handleQueryQuoteRoleUser();
  643. this.userVisible = true
  644. },
  645. handlePurchaseClick(){
  646. this.userTitle = '采购专员'
  647. this.user.username = this.saveQuote.purchase
  648. this.user.userDisplay = ''
  649. this.user.active = ''
  650. this.user.buId = this.saveQuote.buId
  651. this.user.roleNo = 'PURCHASE'
  652. this.purchaseVisible = true
  653. this.handleQueryQuoteRoleUser();
  654. this.userVisible = true
  655. },
  656. handleQueryQuoteRoleUser(){
  657. let params = {
  658. ...this.user,
  659. }
  660. this.userDataList = []
  661. queryQuoteRoleUser(params).then(({data})=>{
  662. if (data && data.code === 0){
  663. this.userDataList = data.rows
  664. }else {
  665. this.$message.warning(data.msg)
  666. }
  667. }).catch((error)=>{
  668. this.$message.error(error)
  669. })
  670. },
  671. getBaseList(val){
  672. this.tagNo = val
  673. this.$nextTick(()=>{
  674. let strVal = ''
  675. if (val === 512){
  676. strVal = this.saveQuote.currency;
  677. this.$refs.baseList.init(val,strVal)
  678. }
  679. })
  680. },
  681. getBaseData(val){
  682. if (this.tagNo === 512){
  683. this.saveQuote.currency = val.Currency
  684. }
  685. },
  686. handleQueryByIds(){
  687. let params = {
  688. ids:this.$route.params.ids,
  689. no:this.no,
  690. size:this.size,
  691. createBy:this.$store.state.user.name,
  692. }
  693. queryQuotePage(params).then(({data})=>{
  694. if (data && data.code === 0){
  695. this.dataList = data.rows
  696. this.total = data.total
  697. if (this.total > 0){
  698. this.currentQuote = {...this.dataList[0]}
  699. }else {
  700. this.currentQuote = {}
  701. }
  702. }else {
  703. this.$message.error(data.msg)
  704. }
  705. this.searchLoading = false
  706. }).catch(error=>{
  707. this.$message.error(error)
  708. this.searchLoading = false
  709. })
  710. },
  711. handleInquiryDblClick(row){
  712. this.saveQuote.insideInquiryNo = row.quotationNo
  713. this.saveQuote.customerNo = row.customerNo
  714. this.saveQuote.customerDesc = row.customerDesc
  715. this.saveQuote.projectNo = row.projectNo
  716. this.saveQuote.projectDesc = row.projectDesc
  717. this.saveQuote.quoter = row.quoter
  718. this.saveQuote.customerInquiryNo = row.customerQuoteNo
  719. this.insideInquiryVisible = false
  720. }
  721. },
  722. created() {
  723. this.quoteForm = {
  724. ...this.quote,
  725. createBy: this.$store.state.user.name,
  726. }
  727. this.handleQueryBu();// 查询 BU
  728. this.handleSearch();// 查询报价信息
  729. },
  730. watch:{
  731. 'quoteForm.customerNo'(newVal, oldVal){
  732. this.quoteForm.customerNo = newVal.toUpperCase()
  733. },
  734. 'quoteForm.projectNo'(newVal, oldVal){
  735. this.quoteForm.projectNo = newVal.toUpperCase()
  736. },
  737. 'quoteForm.quoteNo'(newVal, oldVal){
  738. this.quoteForm.quoteNo = newVal.toUpperCase()
  739. },
  740. 'saveQuote.customerNo'(newVal, oldVal){
  741. this.saveQuote.customerNo = newVal.toUpperCase()
  742. },
  743. 'saveQuote.projectNo'(newVal, oldVal){
  744. // this.saveQuote.projectNo = newVal.toUpperCase()
  745. },
  746. },
  747. activated() {
  748. if (this.$route.params.ids){
  749. this.handleQueryByIds();
  750. }
  751. }
  752. }
  753. </script>
  754. <template>
  755. <div>
  756. <quote-search v-model:quote="quoteForm" @search="handleSearch" @save="handleSave"></quote-search>
  757. <quote-table v-loading="searchLoading" :current-row="currentQuote" :columns="columns" style="margin-top: 5px"
  758. @save="handleSave" @remove="handleRemove" @rowClick="handleRowClick"
  759. :data-list="dataList" :height="'35vh'">
  760. </quote-table>
  761. <el-pagination @size-change="handleSizeChange"
  762. @current-change="handlePageChange"
  763. :current-page="no"
  764. :page-sizes="[20, 50, 100, 200, 500]"
  765. :page-size="size"
  766. :total="total"
  767. layout="total,sizes, prev, pager, next, jumper">
  768. </el-pagination>
  769. <el-tabs v-model="activeName" >
  770. <el-tab-pane label="报价明细" name="detail">
  771. <quote-detail :quote="currentQuote" :height="'33vh'"></quote-detail>
  772. </el-tab-pane>
  773. </el-tabs>
  774. <el-dialog :title="saveQuote.id? '报价信息:'+ saveQuote.quoteVersionNo : '报价信息'" v-drag :close-on-click-modal="false" :visible.sync="saveVisible" width="500px" >
  775. <el-form ref="saveForm" :model="saveQuote" :rules="saveRules" label-position="top" label-width="100px">
  776. <el-row :gutter="10">
  777. <el-col :span="16">
  778. <el-form-item label="BU" prop="buId" :show-message="false">
  779. <bu-select v-model="saveQuote.buId" :disabled="saveQuote.id > 0"></bu-select>
  780. </el-form-item>
  781. </el-col>
  782. </el-row>
  783. <el-row :gutter="10">
  784. <el-col :span="8">
  785. <el-form-item label="客户询价单号" prop="customerInquiryNo" :show-message="false">
  786. <el-input v-model="saveQuote.customerInquiryNo"></el-input>
  787. </el-form-item>
  788. </el-col>
  789. <el-col :span="8">
  790. <el-form-item label="内部询价单号" prop="insideInquiryNo" :show-message="false">
  791. <span slot="label">
  792. <a @click="insideInquiryVisible = true">内部询价单号</a>
  793. </span>
  794. <el-input v-model="saveQuote.insideInquiryNo"></el-input>
  795. </el-form-item>
  796. </el-col>
  797. </el-row>
  798. <el-row :gutter="10">
  799. <el-col :span="8">
  800. <el-form-item label="客户编码" prop="customerNo" :show-message="false">
  801. <span slot="label">
  802. <a @click="customerVisible = true">客户编码</a>
  803. </span>
  804. <el-input v-model="saveQuote.customerNo" @blur="customerNoBlur"></el-input>
  805. </el-form-item>
  806. </el-col>
  807. <el-col :span="16">
  808. <el-form-item label="客户描述" prop="customerDesc" :show-message="false">
  809. <el-input v-model="saveQuote.customerDesc" disabled></el-input>
  810. </el-form-item>
  811. </el-col>
  812. <el-col :span="8">
  813. <el-form-item label="项目编码" prop="projectNo" :show-message="false">
  814. <span slot="label" v-if="saveQuote.customerNo && saveQuote.customerDesc">
  815. <a @click="projectVisible = true" >项目编码</a>
  816. </span>
  817. <el-input v-model="saveQuote.projectNo" @blur="projectNoBlur"></el-input>
  818. </el-form-item>
  819. </el-col>
  820. <el-col :span="16">
  821. <el-form-item label="项目描述" prop="projectDesc" :show-message="false">
  822. <el-input v-model="saveQuote.projectDesc" disabled></el-input>
  823. </el-form-item>
  824. </el-col>
  825. <el-col :span="8">
  826. <el-form-item label="币种" prop="currency" :show-message="false">
  827. <span slot="label">
  828. <a @click="getBaseList(512)">币种</a>
  829. </span>
  830. <el-input v-model="saveQuote.currency"></el-input>
  831. </el-form-item>
  832. </el-col>
  833. <el-col :span="8">
  834. <el-form-item label="报价日期" prop="quoteDate" :show-message="false">
  835. <el-date-picker style="width: 100%" v-model="saveQuote.quoteDate" type="date" value-format='yyyy-MM-dd' format='yyyy-MM-dd'></el-date-picker>
  836. </el-form-item>
  837. </el-col>
  838. </el-row>
  839. <el-row :gutter="10">
  840. <el-col :span="8">
  841. <el-form-item label="报价专员" prop="quoter" :show-message="false">
  842. <span slot="label">
  843. <a @click="handleQuoterClick" >报价专员</a>
  844. </span>
  845. <el-input v-model="saveQuote.quoter"></el-input>
  846. </el-form-item>
  847. </el-col>
  848. <el-col :span="8">
  849. <el-form-item label="采购专员" prop="purchase" :show-message="false">
  850. <span slot="label">
  851. <a @click="handlePurchaseClick" >采购专员</a>
  852. </span>
  853. <el-input v-model="saveQuote.purchase"></el-input>
  854. </el-form-item>
  855. </el-col>
  856. <el-col :span="24">
  857. <el-form-item label="备注" prop="remark" class="auto" :show-message="false">
  858. <el-input v-model="saveQuote.remark" :rows="3" type="textarea"></el-input>
  859. </el-form-item>
  860. </el-col>
  861. </el-row>
  862. </el-form>
  863. <div slot="footer" class="dialog-footer">
  864. <el-button type="primary" @click="handleSaveOrUpdateQuote"> </el-button>
  865. <el-button @click="saveVisible = false"> </el-button>
  866. </div>
  867. </el-dialog>
  868. <el-dialog :title="userTitle" v-drag :visible.sync="userVisible" width="500px" modal-append-to-body :close-on-click-modal="false">
  869. <el-form :model="user" label-position="top">
  870. <el-row :gutter="10">
  871. <el-col :span="6">
  872. <el-form-item label="用户账号" prop="name">
  873. <el-input v-model="user.username"></el-input>
  874. </el-form-item>
  875. </el-col>
  876. <el-col :span="6">
  877. <el-form-item label="用户名" prop="name">
  878. <el-input v-model="user.userDisplay"></el-input>
  879. </el-form-item>
  880. </el-col>
  881. <el-col :span="6">
  882. <el-form-item label="是否在用">
  883. <el-select filterable v-model="user.active" style="width: 100%">
  884. <el-option label="全部" value=""></el-option>
  885. <el-option label="是" value="1"></el-option>
  886. <el-option label="否" value="0"></el-option>
  887. </el-select>
  888. </el-form-item>
  889. </el-col>
  890. <el-col :span="6">
  891. <el-form-item label=" " >
  892. <el-button type="primary" @click="handleQueryQuoteRoleUser">查询</el-button>
  893. </el-form-item>
  894. </el-col>
  895. </el-row>
  896. </el-form>
  897. <el-table
  898. :height="300"
  899. :data="userDataList"
  900. border
  901. @row-dblclick="userDblClick"
  902. style="width: 100%;">
  903. <el-table-column
  904. prop="username"
  905. header-align="center"
  906. align="center"
  907. label="用户账号">
  908. </el-table-column>
  909. <el-table-column
  910. prop="userDisplay"
  911. header-align="center"
  912. align="center"
  913. label="用户名">
  914. </el-table-column>
  915. <el-table-column
  916. prop="status"
  917. header-align="center"
  918. align="center"
  919. label="是否在用">
  920. <template slot-scope="scope">
  921. <span v-if="scope.row.status === 1"></span>
  922. <span v-if="scope.row.status === 0"></span>
  923. </template>
  924. </el-table-column>
  925. </el-table>
  926. </el-dialog>
  927. <el-dialog title="询价申请" v-drag :visible.sync="insideInquiryVisible" width="1000px" modal-append-to-body :close-on-click-modal="false">
  928. <quotes v-if="insideInquiryVisible" :is-component="true" :height="400" @dblclick="handleInquiryDblClick"></quotes>
  929. </el-dialog>
  930. <customer-table ref="customerTable" v-if="saveVisible" v-model="customerVisible" :height="300" @dblclick="customerDblClick" :customer-no="saveQuote.customerNo"></customer-table>
  931. <project-table ref="projectTable" v-if="saveVisible" v-model="projectVisible" :height="300" @dblclick="projectDblClick" :customer-no="saveQuote.customerNo" :project-no="saveQuote.projectNo" :bu-id="saveQuote.buId"></project-table>
  932. <choose-list-eam ref="baseList" @getBaseData="getBaseData"></choose-list-eam>
  933. </div>
  934. </template>
  935. <style scoped>
  936. .auto /deep/ .el-form-item__content{
  937. height: auto;
  938. line-height: 1.5;
  939. }
  940. .el-table /deep/ .cell{
  941. height: auto;
  942. line-height: 1.5;
  943. }
  944. </style>