inquiryVerificationList.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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(item) {
  45. // 按当前用户是否已出价显示:后端返回 currentUserCompleted(有 myPrice 即已出价)
  46. const completed = item.currentUserCompleted === true || (item.myPrice != null && item.myPrice !== '');
  47. if (this.type == 1) {
  48. return completed ? '询价完成' : '待询价';
  49. }
  50. if (this.type == 2) {
  51. return completed ? '核价完成' : '待核价';
  52. }
  53. },
  54. handleClick(item) {
  55. this.editInfo = item;
  56. this.editInfo.price = item.myPrice
  57. this.editInfo.remark = item.myRemark
  58. this.$nextTick(() => {
  59. this.$refs.addInquiryDialog.showDialog();
  60. })
  61. },
  62. handleInquirySuccess() {
  63. this.$refs.addInquiryDialog.closeDialog();
  64. },
  65. handleInquiryCancel() {
  66. this.queryParams.pageNum = 1;
  67. this.getList();
  68. this.$refs.addInquiryDialog.closeDialog();
  69. },
  70. }
  71. }