export default { props: { type: { type: Number, default: 1 } }, data() { return { list: [], editInfo: {}, queryParams: { pageSize: 10, pageNum: 1, }, total: 0, } }, methods: { onRefresh() { this.queryParams.pageNum = 1; this.getList(); }, getList() { uni.$u.api.inquiryVerificationList(this.queryParams, { type: this.type, }).then(res => { if (this.queryParams.pageNum === 1) { this.list = res.rows; } else { this.list = this.list.concat(res.rows); } this.total = res.total; }) }, loadMore(){ if (this.list.length >= this.total) { uni.$u.toast('没有更多了'); return; } this.queryParams.pageNum++; this.getList(); }, formtterStatus(item) { // 按当前用户是否已出价显示:后端返回 currentUserCompleted(有 myPrice 即已出价) const completed = item.currentUserCompleted === true || (item.myPrice != null && item.myPrice !== ''); if (this.type == 1) { return completed ? '询价完成' : '待询价'; } if (this.type == 2) { return completed ? '核价完成' : '待核价'; } }, handleClick(item) { this.editInfo = item; this.editInfo.price = item.myPrice this.editInfo.remark = item.myRemark this.$nextTick(() => { this.$refs.addInquiryDialog.showDialog(); }) }, handleInquirySuccess() { this.$refs.addInquiryDialog.closeDialog(); }, handleInquiryCancel() { this.queryParams.pageNum = 1; this.getList(); this.$refs.addInquiryDialog.closeDialog(); }, } }