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.

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