123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <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.productionNo">
- <van-icon name="coupon-o" />
-
- {{ item.productionNo }}
- </p>
- <p class="projectName">
- <van-icon name="location-o" />
- {{ item.orderName }}
- </p>
- <p>
- <van-tag type="primary" size="medium" class="van-tag">
- {{ item.production ? (item.production === 'REPORT' ? '报告' : (item.production === 'STATEMENT' ? '意见书' :
- '复评函'
- )) : '订单' }}
- </van-tag>
- <van-tag type="primary" size="medium" class="van-tag" v-if="item.currentNodeName">{{ item.currentNodeName }}</van-tag>
- <van-tag type="success" size="medium" class="van-tag">{{ item.clienteleName }}</van-tag>
- <van-tag type="success" :color="item.repertoryState === '未入库' ? '#969799' : ''" size="medium" class="van-tag">{{ item.repertoryState }}</van-tag>
- <van-tag type="success" :color="!item.delivery ? '#969799' : ''" size="medium" class="van-tag">{{ item.delivery ? '已送达' : '未送达' }}</van-tag>
- <van-tag type="success" :color="item.edeclareResult === null ? '#969799' : ''" size="medium" class="van-tag">{{ item.edeclareResult==null ? '未申报' : item.edeclareResult }}</van-tag>
- </p>
- </div>
- </van-list>
- </van-pull-refresh>
- <van-back-top right="10vw" bottom="10vh" />
- </div>
- </template>
- <script>
- import { myOrder } from '@/api/major';
- export default {
- data() {
- return {
- loading: false,
- listData: [],
- finished: false,
- listQuery: {
- // 当前页数
- current: 1,
- // 查询关键字
- keyword: null,
- },
- };
- },
- created() {
- this.getMyOrder();
- },
- methods: {
- onClickLeft() {
- history.back();
- },
- // 大中型待办列表刷新
- 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.orderName,
- productionType: item.production ? (item.production === 'REPORT' ? '报告' : (item.production === 'STATEMENT' ? '意见书' : '复评函' )) : '订单',
- productionNo: item.productionNo,
- nodeName: item.currentNodeName,
- clientManager: item.clientManager,
- principal: item.principal,
- realAmount: item.realAmount,
- invoiceAmount: item.invoiceAmount,
- clienteleName: item.clienteleName,
- clienteleSubName: item.clienteleSubName,
- clienteleContactName: item.clienteleContactName,
- bailor: item.bailor,
- owner: item.owner,
- repertoryState: item.repertoryState,
- delivery: item.delivery ? '已送达' : '未送达',
- deliveryDate: item.deliveryDate,
- mdeclareResult: item.mdeclareResult==null ? '未申报' : item.mdeclareResult,
- edeclareResult: item.edeclareResult==null ? '未申报' : item.edeclareResult,
- }
- this.$router.push({
- path: `/index/major/detail`,
- query: {
- item: JSON.stringify(detailInfo),
- },
- });
- },
- },
- };
- </script>
- <style scoped>
- .card {
- background-color: white;
- border-radius: 12px;
- box-shadow: 2px 2px 2px 2px rgba(0, 0, 0, 0.1);
- padding: 16px;
- margin: 10px;
- }
- .productionNo {
- width: 100%;
- font-size: 14px;
- }
- .projectName {
- width: 100%;
- /* overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis; */
- }
- .van-tag {
- margin: 2px;
- }
- </style>
|