inquiryVerificationList.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. export default {
  2. props: {
  3. type: {
  4. type: Number,
  5. default: 1
  6. }
  7. },
  8. data() {
  9. return {
  10. list: [],
  11. editInfo: {},
  12. queryParams: {
  13. pageSize: 10,
  14. pageNum: 1,
  15. },
  16. total: 0,
  17. }
  18. },
  19. mounted() {
  20. this.getList();
  21. },
  22. methods: {
  23. getList() {
  24. uni.$u.api.inquiryVerificationList(this.queryParams, {
  25. type: this.type,
  26. }).then(res => {
  27. if (this.queryParams.pageNum === 1) {
  28. this.list = res.rows;
  29. } else {
  30. this.list = this.list.concat(res.rows);
  31. }
  32. this.total = res.total;
  33. })
  34. },
  35. loadMore(){
  36. if (this.list.length >= this.total) {
  37. uni.$u.toast('没有更多了');
  38. return;
  39. }
  40. this.queryParams.pageNum++;
  41. this.getList();
  42. },
  43. formtterStatus(status) {
  44. switch (status) {
  45. case '1':
  46. return this.type == '1' ? '待询价' : '待核价';
  47. case '2':
  48. return this.type == '1' ? '询价完成' : '核价完成';
  49. }
  50. },
  51. handleClick(item) {
  52. this.editInfo = item;
  53. this.$refs.addInquiryDialog.showDialog();
  54. },
  55. handleInquirySuccess() {
  56. this.$refs.addInquiryDialog.closeDialog();
  57. },
  58. handleInquiryCancel() {
  59. this.queryParams.pageNum = 1;
  60. this.getList();
  61. this.$refs.addInquiryDialog.closeDialog();
  62. },
  63. }
  64. }