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.

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