需求大厅订单查询后台接口对接

This commit is contained in:
donqi 2022-06-28 18:06:26 +08:00
parent 524690b2b4
commit 72eb677974
1 changed files with 52 additions and 8 deletions

View File

@ -50,15 +50,15 @@
<view class="margin-lr-sm margin-bottom-lg"> <view class="margin-lr-sm margin-bottom-lg">
<view v-for="(task, index) in tasks" class="padding bg-white margin-top-sm"> <view v-for="(task, index) in tasks" class="padding bg-white margin-top-sm">
<view class="flex justify-between"> <view class="flex justify-between">
<view class="text-lg text-bold text-cut" style="width: 70%;">{{task.title}}</view> <view class="text-lg text-bold text-cut" style="width: 70%;">{{task.goodsName}}</view>
<view class="text-right"> <view class="text-right">
<view class="text-lg text-price text-red text-bold">{{task.price}}</view> <view class="text-lg text-price text-red text-bold">{{task.totalMoney}}</view>
<view v-if="task.expeditedPrice"> <view v-if="task.expeditedPrice">
<text>加急</text><text class="text-price text-red text-bold">{{task.expeditedPrice}}</text> <text>加急</text><text class="text-price text-red text-bold">{{task.expeditedPrice}}</text>
</view> </view>
</view> </view>
</view> </view>
<view class="flex justify-start"> <view class="flex justify-start" v-if="task.tag">
<view v-for="(tagContent, index1) in task.tag" class='cu-tag margin-right-xs'>{{tagContent}}</view> <view v-for="(tagContent, index1) in task.tag" class='cu-tag margin-right-xs'>{{tagContent}}</view>
</view> </view>
<view class="margin-top-sm"> <view class="margin-top-sm">
@ -68,7 +68,7 @@
</view> </view>
<view class="margin-top-sm"> <view class="margin-top-sm">
<text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-timefill"></text></text> <text class="text-main-color text-lg margin-right-xs"><text class="cuIcon-timefill"></text></text>
<text>{{task.doorTime}}</text> <text>{{task.expectTimeStart + '~' + task.expectTimeEnd}}</text>
</view> </view>
<view class="padding-top-sm flex justify-end"> <view class="padding-top-sm flex justify-end">
<button class="cu-btn bg-main-color margin-right-xs shadow-blur" data-modal="showForwardModal" <button class="cu-btn bg-main-color margin-right-xs shadow-blur" data-modal="showForwardModal"
@ -82,7 +82,8 @@
data-certify-modal="showTakeCertifiedModal" @click="takeTask($event, index)">接单</button> data-certify-modal="showTakeCertifiedModal" @click="takeTask($event, index)">接单</button>
</view> </view>
</view> </view>
</view> </view>
<load-status-bar ref="loadStatusBar" @loadMore="loadMasterOrderPage"></load-status-bar>
<!-- 加价模态框 --> <!-- 加价模态框 -->
<view class="cu-modal" :class="showAddPriceModal?'show':''"> <view class="cu-modal" :class="showAddPriceModal?'show':''">
@ -172,13 +173,20 @@
</view> </view>
</template> </template>
<script> <script>
export default { import loadStatusBar from '@/components/custom-bar/load-status-bar.vue';
export default {
components: {
loadStatusBar
},
data() { data() {
return { return {
tabCur: 0, tabCur: 0,
scrollLeft: 0, scrollLeft: 0,
stickyTop: this.CustomBar, stickyTop: this.CustomBar,
pageNum: 0,
pageSize: 0,
// type: 0=1=order: 0=1= // type: 0=1=order: 0=1=
taskConditions: [{ taskConditions: [{
code: 'area', code: 'area',
@ -220,10 +228,46 @@
}, },
methods: { methods: {
async loadData() { async loadData() {
this.tasks = await this.$api.data('tasks'); // this.tasks = await this.$api.data('tasks');
this.loadMasterOrderPage();
this.takeCertify = await this.$api.data('takeCertify'); this.takeCertify = await this.$api.data('takeCertify');
this.areaList = await this.$api.data('areaList'); this.areaList = await this.$api.data('areaList');
this.categoryList = await this.$api.data('categoryList'); this.categoryList = await this.$api.data('categoryList');
},
async loadMasterOrderPage(params = {}) {
params.pageSize = this.$globalData.initPageSize;
params.pageNum = this.pageNum;
params.orderStatus = 0;
params.workerId = -1;
this.$refs.loadStatusBar.showLoading();
try {
let res = await this.$request.qryMasterOrderPage(params);
if (res && res.rows) {
let rowsLength = res.rows.length;
if (rowsLength === 0) {
this.tasks = [];
} else if (rowsLength > 0) {
this.tasks = this.tasks.concat(res.rows);
// this.pageParams[this.tabCur].pageNum++;
this.pageNum++;
if (rowsLength === this.pageSize) {
this.$refs.loadStatusBar.showLoadMore();
return;
}
}
}
this.$refs.loadStatusBar.showLoadOver();
} catch (e) {
console.error(e)
this.$refs.loadStatusBar.showLoadErr();
}
},
reloadMasterOrderPage(params = {}) {
this.pageNum = 0;
this.tasks = [];
this.$refs.loadStatusBar.showLoadMore();
this.loadMasterOrderPage(params);
}, },
tabSelect(e) { tabSelect(e) {
this.tabCur = e.currentTarget.dataset.id; this.tabCur = e.currentTarget.dataset.id;