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.

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