inquiryVerificationList.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. methods: {
  20. onRefresh() {
  21. this.queryParams.pageNum = 1;
  22. this.getList();
  23. },
  24. getList() {
  25. uni.$u.api.inquiryVerificationList(this.queryParams, {
  26. type: this.type,
  27. }).then(res => {
  28. if (this.queryParams.pageNum === 1) {
  29. this.list = res.rows;
  30. } else {
  31. this.list = this.list.concat(res.rows);
  32. }
  33. this.total = res.total;
  34. })
  35. },
  36. loadMore(){
  37. if (this.list.length >= this.total) {
  38. uni.$u.toast('没有更多了');
  39. return;
  40. }
  41. this.queryParams.pageNum++;
  42. this.getList();
  43. },
  44. formtterStatus(status) {
  45. if(this.type == 1){
  46. return status == '1' ? '待询价' : '询价完成'
  47. }
  48. if(this.type == 2){
  49. return status == '1' ? '待核价' : '核价完成'
  50. }
  51. },
  52. handleClick(item) {
  53. this.editInfo = item;
  54. this.$nextTick(() => {
  55. this.$refs.addInquiryDialog.showDialog();
  56. })
  57. },
  58. handleInquirySuccess() {
  59. this.$refs.addInquiryDialog.closeDialog();
  60. },
  61. handleInquiryCancel() {
  62. this.queryParams.pageNum = 1;
  63. this.getList();
  64. this.$refs.addInquiryDialog.closeDialog();
  65. },
  66. }
  67. }