Commit caa0dde8 authored by xiejb's avatar xiejb

对接多个数据源订单接口和订单商品清单接口

parent 38e0321c
...@@ -8,6 +8,15 @@ export function getMyOrderList(params) { ...@@ -8,6 +8,15 @@ export function getMyOrderList(params) {
loading: true loading: true
}) })
} }
// 多选订单列表
export function getMoreMyOrderList(params) {
return fetch({
url: '/CompanyOrderLife/queryOrder',
method: 'post',
data: params,
loading: true
})
}
// 获取订单详情 // 获取订单详情
export function getMyOrderDetail(params) { export function getMyOrderDetail(params) {
return fetch({ return fetch({
......
<template> <template>
<div class="goods-info"> <div class="goods-info">
<div v-if="detailData.goodsInfos.length !== 0" class="goods-info-details"> <div v-if="detailData.length !== 0" class="goods-info-details">
<!-- <van-pull-refresh v-model="refreshing" @refresh="onRefresh"> <!-- <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-list <van-list
v-model="loading" v-model="loading"
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
finished-text="没有更多了" finished-text="没有更多了"
@load="onLoad" @load="onLoad"
> --> > -->
<div class="list" v-for="(item, index) in detailData.goodsInfos" :key="index"> <div class="list" v-for="(item, index) in detailData" :key="index">
<!-- <goods-info-detail :item="item"></goods-info-detail> --> <!-- <goods-info-detail :item="item"></goods-info-detail> -->
<goods-info-list-item :item="item"></goods-info-list-item> <goods-info-list-item :item="item"></goods-info-list-item>
</div> </div>
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
<!-- </van-list> <!-- </van-list>
</van-pull-refresh> --> </van-pull-refresh> -->
</div> </div>
<van-empty v-if="detailData.goodsInfos.length === 0" description="暂无更多数据" /> <van-empty v-if="detailData.length === 0" description="暂无更多数据" />
<div class="goods-sum"> <div class="goods-sum">
<div class="sum-number-detail">{{detailData.goodsInfos.length}} 个商品</div> <div class="sum-number-detail">{{detailData.length}} 个商品</div>
<div class="sum-amount">金额总计:<span style="font-size: 16PX;">{{orderTotalAmount}}</span></div> <div class="sum-amount">金额总计:<span style="font-size: 16PX;">{{orderTotalAmount}}</span></div>
</div> </div>
...@@ -56,10 +56,7 @@ export default { ...@@ -56,10 +56,7 @@ export default {
copy: require("@/assets/img/u533.svg"), copy: require("@/assets/img/u533.svg"),
}, },
orderItem: this.$route.query, orderItem: this.$route.query,
detailData: { detailData: [],
goodsInfos: [],
orderTotalAmount: '0'
},
moreSearchInfo: { moreSearchInfo: {
goodsCode: '', // 商品编号 goodsCode: '', // 商品编号
goodsName: '', // 商品名称 goodsName: '', // 商品名称
...@@ -68,14 +65,20 @@ export default { ...@@ -68,14 +65,20 @@ export default {
} }
}; };
}, },
props: {
totalAmount: {
type: String,
default: '0.00'
}
},
computed: { computed: {
// 总价格 // 总价格
orderTotalAmount () { orderTotalAmount () {
if (this.detailData.orderTotalAmount) { // if (this.detailData.orderTotalAmount) {
return AmountNumFormat(this.detailData.orderTotalAmount) // return AmountNumFormat(this.detailData.orderTotalAmount)
} else { // } else {
return '0.00' return this.orderItem.orderTotalAmount
} // }
} }
}, },
mounted() { mounted() {
...@@ -174,13 +177,10 @@ export default { ...@@ -174,13 +177,10 @@ export default {
'supplierId': [] 'supplierId': []
} }
getMyOrderDetail(params).then(res => { getMyOrderDetail(params).then(res => {
this.detailData = { this.detailData = []
goodsInfos: [],
orderTotalAmount: '0'
}
if (res.code === 200 && res.data && res.data.code === '00000' && if (res.code === 200 && res.data && res.data.code === '00000' &&
res.data.entity && res.data.entity.orderList && res.data.entity.orderList.length > 0) { res.data.entity && res.data.entity.detailList && res.data.entity.detailList.length > 0) {
this.detailData = res.data.entity.orderList[0] this.detailData = res.data.entity.detailList
// let array = [] // let array = []
// for (var i = 0; i < 10; i++) { // for (var i = 0; i < 10; i++) {
// array.push(this.detailData.goodsInfos[0]) // array.push(this.detailData.goodsInfos[0])
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<script> <script>
// 引入接口 // 引入接口
import { getMyOrderList } from '@/api/myOrder' import { getMyOrderList, getMoreMyOrderList } from '@/api/myOrder'
import orderListItem from './orderListItem.vue' import orderListItem from './orderListItem.vue'
import {getFormateDate} from '@/utils/common' import {getFormateDate} from '@/utils/common'
import { valid } from 'semver' import { valid } from 'semver'
...@@ -101,7 +101,7 @@ export default { ...@@ -101,7 +101,7 @@ export default {
type: Object, type: Object,
default: () => { default: () => {
return { return {
supplier: '', // 供应商 supplier: {}, // 供应商
consignor: [], // 货主 consignor: [], // 货主
goods: '', // 商品 goods: '', // 商品
client: '', // 客户 client: '', // 客户
...@@ -198,23 +198,30 @@ export default { ...@@ -198,23 +198,30 @@ export default {
'sourceDb': 'SHYY', // 数据来源 'sourceDb': 'SHYY', // 数据来源
'sourceOrderNo': '', // 来源订单号(网上订单号) 'sourceOrderNo': '', // 来源订单号(网上订单号)
'sourceSystem': '', // 订单来源 来源订单号和订单来源必须同时不为空 'sourceSystem': '', // 订单来源 来源订单号和订单来源必须同时不为空
'userSiteId': '1372122312286081024',
'supplierId': [ 'supplierId': [
] // 供应商(部门)编码 ] // 供应商(部门)编码
} }
// let data2 = {"clientID":["3168"],"goodsCode":"","goodsDesc":"","goodsId":"","goodsName":"","goodsSpec":"","isInoivce":"","isWeb":"","manufacturer":"","mdmClientCode":"","order":"","orderDate":"","orderId":"19958468","orderNo":"","orderStatusCode":"110","orderType":"","pageNum":1,"pageSize":10,"shippingAdress":"","sort":"","sourceDb":"SHYY","sourceOrderNo":"","sourceSystem":"","supplierId":["305"],"startDate":"","endDate":"","userSiteId":"1372122450039607296"} let dict = {
getMyOrderList(data).then(rt => { 'list': [
if (rt.data.code === '00000') { data
],
'endDate': _this.moreSearchInfo.time.end, // 结束时间
'startDate': _this.moreSearchInfo.time.start, // 开始时间
'pageNum': _this.currentPage,
'pageSize': _this.pageSize
}
getMoreMyOrderList(dict).then(rt => {
if (rt.code === '1') {
if (_this.isRefreshing) { if (_this.isRefreshing) {
_this.orderList = rt.data.entity.orderList _this.orderList = rt.data
} else if (rt.data || rt.data.length > 0) { } else if (rt.data || rt.data.length > 0) {
_this.orderList = _this.orderList.concat(rt.data.entity.orderList) _this.orderList = _this.orderList.concat(rt.data)
} }
// 重置刷新提示 // 重置刷新提示
_this.isRefreshing = false _this.isRefreshing = false
// 重置加载更多提示 // 重置加载更多提示
_this.isLoading = false _this.isLoading = false
if (rt.data.entity.orderList.length < 10) { if (rt.data.length < 10) {
_this.finished = true _this.finished = true
} else { } else {
// 加载成功后下一页自增1 // 加载成功后下一页自增1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment