123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <template>
- <div>
- <BackBar title="我的订单-资产" lefttext="返回" />
- <van-search v-model="listQuery.keyWord" placeholder="请输入搜索关键词" @search="onSearch()" />
- <van-pull-refresh v-model="loading" @refresh="onRefresh()">
- <van-list v-model:loading="loading" :finished="finished" finished-text="还没有订单" @load="getMyOrder()">
- <div class="card" v-for="item in listData" :key="item.id" @click="toDetail(item)">
- <h3>
- <van-icon name="link-o" />
- {{ item.orderId }}
- </h3>
- <p class="productionNo" v-if="item.statementNo || item.reportNo">
- <van-icon name="coupon-o" />
-
- {{ item.statementNo }}
- <!-- 产品号都不为空才显示中间的分割空格, 以保持页面间距统一 -->
- <span v-if="item.statementNo && item.reportNo"> </span>
- {{ item.reportNo }}
- </p>
- <p class="projectName">
- <van-icon name="location-o" />
- {{ item.reportName || item.statementName || item.name }}
- </p>
- <p>
- <van-tag type="primary" size="medium" class="van-tag">{{ item.currentNodeName }}</van-tag>
- <van-tag type="success" size="medium" class="van-tag">{{ item.clientManagerName }}</van-tag>
- <van-tag color="#969799" size="medium" class="van-tag">{{ item.created }}</van-tag>
- </p>
- </div>
- </van-list>
- </van-pull-refresh>
- <van-back-top right="10vw" bottom="10vh" />
- </div>
- </template>
- <script>
- import { mapStores } from 'pinia';
- import { useUserStore } from '@/stores/useUserStore';
- import { myOrder } from '@/api/assets';
- export default {
- data() {
- return {
- loading: false,
- listData: [],
- finished: false,
- listQuery: {
- // 当前页数
- current: 1,
- // 查询关键字
- keyWord: null,
- clientManagerId: null,
- },
- };
- },
- computed: {
- ...mapStores(useUserStore),
- },
- created() {
- this.listQuery.clientManagerId = this.userStore.userInfo.id;
- this.getMyOrder();
- },
- methods: {
- // 列表刷新
- onRefresh() {
- this.listQuery.current = 1;
- this.finished = false;
- this.listData = [];
- this.getMyOrder();
- },
- // 列表关键字搜索
- onSearch() {
- this.listQuery.current = 1;
- this.finished = false;
- this.listData = [];
- this.getMyOrder();
- },
- // 获取我的订单
- getMyOrder() {
- this.loading = true;
- myOrder(this.listQuery).then((res) => {
- if (res.code == 200) {
- if (res.data.records) {
- this.listData = this.listData.concat(res.data.records);
- }
- // 判断是否还有下一页
- if (res.data.pages > this.listQuery.current) {
- // 服务端返回的总页数大于当前页数, 将当前页数+1
- this.listQuery.current++;
- } else {
- // 反之停止加载
- this.finished = true;
- }
- }
- this.loading = false;
- });
- },
- toDetail(item) {
- const detailInfo = {
- orderId: item.orderId,
- name: item.name,
- statementNo: item.statementNo,
- reportNo: item.reportNo,
- assetsBusinessGener: item.assetsBusinessGener,
- customerName: item.customerName,
- customerSubName: item.customerSubName,
- bailor: item.bailor,
- bailorContactTel: item.bailorContactTel,
- currentNodeName: item.currentNodeName,
- handlerName: item.handlerName,
- principalName: item.principalName,
- clientManagerName: item.clientManagerName,
- estimatedValue: item.estimatedValue,
- productionShouldAmount: item.productionShouldAmount,
- productionRealAmount: item.productionRealAmount,
- invoiceRealAmount: item.invoiceRealAmount,
- reportDelivery: item.reportDelivery ? '已送达' : '未送达',
- };
- this.$router.push({
- path: `/index/assets/detail`,
- query: {
- item: JSON.stringify(detailInfo),
- },
- });
- },
- },
- };
- </script>
- <style scoped>
- .card {
- background-color: white;
- border-radius: 5px;
- padding: 16px;
- margin: 10px;
- }
- .productionNo {
- width: 100%;
- font-size: 14px;
- }
- .projectName {
- width: 100%;
- }
- .van-tag {
- margin: 2px;
- }
- </style>
|