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.

1007 lines
32 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 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. this.currentQuote = {
  573. ...row,
  574. status: '下达',
  575. }
  576. }else {
  577. this.$message.warning(data.msg)
  578. }
  579. }).catch((error)=>{
  580. this.$message.error(error)
  581. })
  582. })
  583. },
  584. handleQueryById(row){
  585. this.saveQuote = {
  586. ...row
  587. }
  588. this.detailFlag = true;
  589. this.saveVisible = true;
  590. },
  591. handleRemoveQuote(row){
  592. let params = {
  593. id: row.id,
  594. }
  595. removeQuote(params).then(({data})=>{
  596. if (data && data.code === 0){
  597. this.$message.success(data.msg)
  598. if (row.id === this.currentQuote.id){
  599. this.handleSearch(0);
  600. }else {
  601. this.handleSearch();
  602. }
  603. }else {
  604. this.$message.warning(data.msg)
  605. }
  606. }).catch((error)=>{
  607. this.$message.error(error)
  608. })
  609. },
  610. customerNoBlur(){
  611. let params = {
  612. customerNo: this.saveQuote.customerNo,
  613. createBy: this.$store.state.user.name,
  614. }
  615. queryCustomerList(params).then(({data}) => {
  616. if (data && data.code === 0) {
  617. if (data.rows.length === 1){
  618. this.saveQuote.customerDesc = data.rows[0].customerDesc
  619. }else {
  620. this.saveQuote.projectNo = ''
  621. this.saveQuote.projectDesc = ''
  622. this.saveQuote.customerDesc = ''
  623. }
  624. }else {
  625. this.$message.warning(data.message)
  626. }
  627. }).catch((error) => {
  628. this.$message.error(error)
  629. })
  630. },
  631. projectNoBlur(){
  632. let params = {
  633. projectNo: this.saveQuote.projectNo,
  634. customerNo: this.saveQuote.customerNo,
  635. createBy: this.$store.state.user.name,
  636. buId: this.saveQuote.buId,
  637. }
  638. queryProjectList(params).then(({data})=>{
  639. if (data && data.code === 0) {
  640. if (data.rows.length === 1) {
  641. this.saveQuote.projectDesc = data.rows[0].projectDesc
  642. }else {
  643. this.saveQuote.projectDesc = ''
  644. }
  645. }else {
  646. this.$message.warning(data.msg)
  647. }
  648. }).catch((error)=>{
  649. this.$message.error(error)
  650. })
  651. },
  652. handleRowClick(row){
  653. this.currentQuote = {...row}
  654. },
  655. userDblClick(row){
  656. if (this.quoterVisible){
  657. this.saveQuote.quoter = row.username
  658. this.quoterVisible = false
  659. }else if (this.purchaseVisible){
  660. this.saveQuote.purchase = row.username
  661. this.purchaseVisible = false
  662. }
  663. this.userVisible = false
  664. },
  665. handleQuoterClick(){
  666. this.userTitle = '报价专员'
  667. this.user.username = this.saveQuote.quoter
  668. this.user.userDisplay = ''
  669. this.user.active = ''
  670. this.user.buId = this.saveQuote.buId
  671. this.user.roleNo = 'QUOTER'
  672. this.quoterVisible = true
  673. this.handleQueryQuoteRoleUser();
  674. this.userVisible = true
  675. },
  676. handlePurchaseClick(){
  677. this.userTitle = '采购专员'
  678. this.user.username = this.saveQuote.purchase
  679. this.user.userDisplay = ''
  680. this.user.active = ''
  681. this.user.buId = this.saveQuote.buId
  682. this.user.roleNo = 'PURCHASE'
  683. this.purchaseVisible = true
  684. this.handleQueryQuoteRoleUser();
  685. this.userVisible = true
  686. },
  687. handleQueryQuoteRoleUser(){
  688. let params = {
  689. ...this.user,
  690. }
  691. this.userDataList = []
  692. queryQuoteRoleUser(params).then(({data})=>{
  693. if (data && data.code === 0){
  694. this.userDataList = data.rows
  695. }else {
  696. this.$message.warning(data.msg)
  697. }
  698. }).catch((error)=>{
  699. this.$message.error(error)
  700. })
  701. },
  702. getBaseList(val){
  703. this.tagNo = val
  704. this.$nextTick(()=>{
  705. let strVal = ''
  706. if (val === 512){
  707. strVal = this.saveQuote.currency;
  708. this.$refs.baseList.init(val,strVal)
  709. }
  710. })
  711. },
  712. getBaseData(val){
  713. if (this.tagNo === 512){
  714. this.saveQuote.currency = val.Currency
  715. }
  716. },
  717. handleQueryByIds(){
  718. let params = {
  719. ids:this.$route.params.ids,
  720. no:this.no,
  721. size:this.size,
  722. createBy:this.$store.state.user.name,
  723. }
  724. queryQuotePage(params).then(({data})=>{
  725. if (data && data.code === 0){
  726. this.dataList = data.rows
  727. this.total = data.total
  728. if (this.total > 0){
  729. this.currentQuote = {...this.dataList[0]}
  730. }else {
  731. this.currentQuote = {}
  732. }
  733. }else {
  734. this.$message.error(data.msg)
  735. }
  736. this.searchLoading = false
  737. }).catch(error=>{
  738. this.$message.error(error)
  739. this.searchLoading = false
  740. })
  741. },
  742. handleInquiryDblClick(row){
  743. this.saveQuote.insideInquiryNo = row.quotationNo
  744. this.saveQuote.customerNo = row.customerNo
  745. this.saveQuote.customerDesc = row.customerDesc
  746. this.saveQuote.projectNo = row.projectNo
  747. this.saveQuote.projectDesc = row.projectDesc
  748. this.saveQuote.quoter = row.quoter
  749. this.saveQuote.customerInquiryNo = row.customerQuoteNo
  750. this.insideInquiryVisible = false
  751. },
  752. handleInquiryBlur(){
  753. }
  754. },
  755. created() {
  756. this.quoteForm = {
  757. ...this.quote,
  758. createBy: this.$store.state.user.name,
  759. }
  760. this.handleQueryBu();// 查询 BU
  761. this.handleSearch(0);// 查询报价信息
  762. },
  763. watch:{
  764. 'quoteForm.customerNo'(newVal, oldVal){
  765. this.quoteForm.customerNo = newVal.toUpperCase()
  766. },
  767. 'quoteForm.projectNo'(newVal, oldVal){
  768. this.quoteForm.projectNo = newVal.toUpperCase()
  769. },
  770. 'quoteForm.quoteNo'(newVal, oldVal){
  771. this.quoteForm.quoteNo = newVal.toUpperCase()
  772. },
  773. 'saveQuote.customerNo'(newVal, oldVal){
  774. this.saveQuote.customerNo = newVal.toUpperCase()
  775. },
  776. 'saveQuote.projectNo'(newVal, oldVal){
  777. this.saveQuote.projectNo = newVal.toUpperCase()
  778. },
  779. saveVisible(newVal, oldVal){
  780. if (newVal === false){
  781. this.detailFlag = false;
  782. }
  783. },
  784. 'saveQuote.currency'(newVal, oldVal){
  785. this.saveQuote.currency = newVal.toUpperCase()
  786. }
  787. },
  788. activated() {
  789. if (this.$route.params.ids){
  790. this.handleQueryByIds();
  791. }
  792. }
  793. }
  794. </script>
  795. <template>
  796. <div>
  797. <quote-search v-model:quote="quoteForm" @search="handleSearch" @save="handleSave"></quote-search>
  798. <quote-table v-loading="searchLoading"
  799. :current-row="currentQuote"
  800. :columns="columns"
  801. style="margin-top: 5px"
  802. @save="handleSave"
  803. @remove="handleRemove"
  804. @rowClick="handleRowClick"
  805. @updateStatus="handleUpdateStatus"
  806. @queryById="handleQueryById"
  807. :data-list="dataList"
  808. :height="'35vh'">
  809. </quote-table>
  810. <el-pagination @size-change="handleSizeChange"
  811. @current-change="handlePageChange"
  812. :current-page="no"
  813. :page-sizes="[20, 50, 100, 200, 500]"
  814. :page-size="size"
  815. :total="total"
  816. layout="total,sizes, prev, pager, next, jumper">
  817. </el-pagination>
  818. <el-tabs v-model="activeName" >
  819. <el-tab-pane label="报价明细" name="detail">
  820. <quote-detail :quote="currentQuote" :height="'33vh'"></quote-detail>
  821. </el-tab-pane>
  822. </el-tabs>
  823. <el-dialog :title="saveQuote.id? '报价信息:'+ saveQuote.quoteVersionNo : '报价信息'" v-drag :close-on-click-modal="false" :visible.sync="saveVisible" width="500px" >
  824. <el-form ref="saveForm" :model="saveQuote" :rules="saveRules" label-position="top" label-width="100px">
  825. <el-row :gutter="10">
  826. <el-col :span="8">
  827. <el-form-item label="BU" prop="buId" :show-message="false">
  828. <bu-select v-model="saveQuote.buId" :disabled="saveQuote.id > 0"></bu-select>
  829. </el-form-item>
  830. </el-col>
  831. </el-row>
  832. <el-row :gutter="10">
  833. <el-col :span="8">
  834. <el-form-item label="客户询价单号" prop="customerInquiryNo" :show-message="false">
  835. <el-input v-model="saveQuote.customerInquiryNo" :disabled="detailFlag"></el-input>
  836. </el-form-item>
  837. </el-col>
  838. <el-col :span="8">
  839. <el-form-item label="内部询价单号" prop="insideInquiryNo" :show-message="false">
  840. <span slot="label" v-if="saveQuote.id <= 0">
  841. <a @click="insideInquiryVisible = true">内部询价单号</a>
  842. </span>
  843. <el-input v-model="saveQuote.insideInquiryNo" @blur="handleInquiryBlur" :disabled="saveQuote.id > 0"></el-input>
  844. </el-form-item>
  845. </el-col>
  846. </el-row>
  847. <el-row :gutter="10">
  848. <el-col :span="8">
  849. <el-form-item label="客户编码" prop="customerNo" :show-message="false">
  850. <span slot="label" v-if="saveQuote.id <= 0">
  851. <a @click="customerVisible = true">客户编码</a>
  852. </span>
  853. <el-input v-model="saveQuote.customerNo" :disabled="saveQuote.id > 0" @blur="customerNoBlur"></el-input>
  854. </el-form-item>
  855. </el-col>
  856. <el-col :span="16">
  857. <el-form-item label="客户描述" prop="customerDesc" :show-message="false">
  858. <el-input v-model="saveQuote.customerDesc" disabled></el-input>
  859. </el-form-item>
  860. </el-col>
  861. <el-col :span="8">
  862. <el-form-item label="项目编码" prop="projectNo" :show-message="false">
  863. <span slot="label" v-if="saveQuote.customerNo && saveQuote.customerDesc && saveQuote.id <= 0">
  864. <a @click="projectVisible = true" >项目编码</a>
  865. </span>
  866. <el-input v-model="saveQuote.projectNo" :disabled="saveQuote.id > 0" @blur="projectNoBlur"></el-input>
  867. </el-form-item>
  868. </el-col>
  869. <el-col :span="16">
  870. <el-form-item label="项目描述" prop="projectDesc" :show-message="false">
  871. <el-input v-model="saveQuote.projectDesc" disabled></el-input>
  872. </el-form-item>
  873. </el-col>
  874. <el-col :span="8">
  875. <el-form-item label="币种" prop="currency" :show-message="false">
  876. <span slot="label" v-if="!detailFlag">
  877. <a @click="getBaseList(512)">币种</a>
  878. </span>
  879. <el-input v-model="saveQuote.currency" :disabled="detailFlag"></el-input>
  880. </el-form-item>
  881. </el-col>
  882. <el-col :span="8">
  883. <el-form-item label="报价日期" prop="quoteDate" :show-message="false">
  884. <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>
  885. </el-form-item>
  886. </el-col>
  887. </el-row>
  888. <el-row :gutter="10">
  889. <el-col :span="8">
  890. <el-form-item label="报价专员" prop="quoter" :show-message="false">
  891. <span slot="label" v-if="!detailFlag">
  892. <a @click="handleQuoterClick" >报价专员</a>
  893. </span>
  894. <el-input v-model="saveQuote.quoter" :disabled="detailFlag"></el-input>
  895. </el-form-item>
  896. </el-col>
  897. <el-col :span="8">
  898. <el-form-item label="采购专员" prop="purchase" :show-message="false">
  899. <span slot="label" v-if="!detailFlag">
  900. <a @click="handlePurchaseClick" >采购专员</a>
  901. </span>
  902. <el-input v-model="saveQuote.purchase" :disabled="detailFlag"></el-input>
  903. </el-form-item>
  904. </el-col>
  905. <el-col :span="24">
  906. <el-form-item label="备注" prop="remark" class="auto" :show-message="false">
  907. <el-input v-model="saveQuote.remark" :disabled="detailFlag" :rows="3" type="textarea"></el-input>
  908. </el-form-item>
  909. </el-col>
  910. </el-row>
  911. </el-form>
  912. <div slot="footer" class="dialog-footer">
  913. <el-button type="primary" v-if="!detailFlag" @click="handleSaveOrUpdateQuote"> </el-button>
  914. <el-button @click="saveVisible = false"> </el-button>
  915. </div>
  916. </el-dialog>
  917. <el-dialog :title="userTitle" v-drag :visible.sync="userVisible" width="500px" modal-append-to-body :close-on-click-modal="false">
  918. <el-form :model="user" label-position="top">
  919. <el-row :gutter="10">
  920. <el-col :span="6">
  921. <el-form-item label="用户账号" prop="name">
  922. <el-input v-model="user.username"></el-input>
  923. </el-form-item>
  924. </el-col>
  925. <el-col :span="6">
  926. <el-form-item label="用户名" prop="name">
  927. <el-input v-model="user.userDisplay"></el-input>
  928. </el-form-item>
  929. </el-col>
  930. <el-col :span="6">
  931. <el-form-item label="是否在用">
  932. <el-select filterable v-model="user.active" style="width: 100%">
  933. <el-option label="全部" value=""></el-option>
  934. <el-option label="是" value="1"></el-option>
  935. <el-option label="否" value="0"></el-option>
  936. </el-select>
  937. </el-form-item>
  938. </el-col>
  939. <el-col :span="6">
  940. <el-form-item label=" " >
  941. <el-button type="primary" @click="handleQueryQuoteRoleUser">查询</el-button>
  942. </el-form-item>
  943. </el-col>
  944. </el-row>
  945. </el-form>
  946. <el-table
  947. :height="300"
  948. :data="userDataList"
  949. border
  950. @row-dblclick="userDblClick"
  951. style="width: 100%;">
  952. <el-table-column
  953. prop="username"
  954. header-align="center"
  955. align="center"
  956. label="用户账号">
  957. </el-table-column>
  958. <el-table-column
  959. prop="userDisplay"
  960. header-align="center"
  961. align="center"
  962. label="用户名">
  963. </el-table-column>
  964. <el-table-column
  965. prop="status"
  966. header-align="center"
  967. align="center"
  968. label="是否在用">
  969. <template slot-scope="scope">
  970. <span v-if="scope.row.status === 1"></span>
  971. <span v-if="scope.row.status === 0"></span>
  972. </template>
  973. </el-table-column>
  974. </el-table>
  975. </el-dialog>
  976. <el-dialog title="询价申请" v-drag :visible.sync="insideInquiryVisible" width="1000px" modal-append-to-body :close-on-click-modal="false">
  977. <quotes v-if="insideInquiryVisible" :is-component="true" :height="400" @dblclick="handleInquiryDblClick"></quotes>
  978. </el-dialog>
  979. <customer-table ref="customerTable" v-if="saveVisible" v-model="customerVisible" :height="300" @dblclick="customerDblClick" :customer-no="saveQuote.customerNo"></customer-table>
  980. <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>
  981. <choose-list-eam ref="baseList" @getBaseData="getBaseData"></choose-list-eam>
  982. </div>
  983. </template>
  984. <style scoped>
  985. .auto /deep/ .el-form-item__content{
  986. height: auto;
  987. line-height: 1.5;
  988. }
  989. .el-table /deep/ .cell{
  990. height: auto;
  991. line-height: 1.5;
  992. }
  993. </style>