Commit f0074077 by cwq0219

订单列表,订单详情

1 parent 70162590
......@@ -85,7 +85,7 @@
</table>
<table class="finnance_table">
<tr>
<td colspan="7" class="finnance_table_title">订单分账详情
<td colspan="7" class="finnance_table_title">订单分账详情
<div style="float:right; font-size:14px;">分账规则:此笔订单按<strong>{{shopProfitTypeOpts[detail.shopProfitType]}}</strong>分成方法计算。</div>
</td>
</tr>
......@@ -143,10 +143,10 @@
</tr>
</table>
<p style="text-align:left;">
<el-button type="primary" @click="close({ tagName: '/financeDetail' })">返回</el-button>
<el-button type="primary" @click="handleClose">返回</el-button>
</p>
</div>
</d2-container>
</template>
......@@ -173,33 +173,25 @@ export default {
1: '价格敏感型',
2: '价格不敏感型'
},
storeData: [{
name: 'xx'
},{
name: 'xx'
},{
name: 'xx'
},{
name: 'xx'
},{
name: 'xx'
}],
detail: {},
shopProfitTypeOpts: {
'1': '毛利',
'2': '收入'
},
}
}
},
mounted() {
this.detail = this.$route.params.detail
console.log()
},
methods: {
...mapActions({ close: 'd2admin/page/close' }),
handleClose() {
this.close({ tagName: '/financeList' })
this.$router.push({ name: 'financeList' })
this.close({ tagName: '/financeDetail' })
}
}
}
......@@ -207,7 +199,7 @@ export default {
<style lang="scss" scoped>
.finnance_detail{
padding: 20px;
}
.finnance_table_wrap{
padding: 20px;
......@@ -217,10 +209,10 @@ export default {
.finnance_table {
box-sizing: border-box;
width: 100%;
background: #fff;
border-collapse: collapse;
&:first-of-type{
&>tr>td{
border-top: 1px solid #ccc;
......@@ -261,5 +253,5 @@ export default {
height: 100%
}
}
</style>
......@@ -11,7 +11,7 @@
<el-form-item label="交易流水:">{{detail.outTradeNo}}</el-form-item>
<el-form-item label="支付状态:">{{payStatusOpts[detail.payStatus]}}</el-form-item>
<el-form-item label="收款凭证:">
<img class="order-img" src="https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3101694723,748884042&fm=26&gp=0.jpg"/>
<img class="order-img" :src="detail.payVoucher"/>
</el-form-item>
</el-form>
</div>
......@@ -39,53 +39,61 @@
<div class="form_table_gp">
<h4>订单商品</h4>
<el-table
:data="detail.goods"
:data="detail.subOrderList"
border
header-cell-style="text-align:center; background-color:#fafafa"
show-summary
:summary-method="getSummaries"
style="width: 100%">
<el-table-column
prop="goodsInfo.goodsCode"
:prop="detail.upgradeFlag === 'Y' ? 'upgradeGoodsCode' : 'baseGoodsCode'"
align="center"
label="商品编号">
</el-table-column>
<el-table-column
prop="goodsInfo.goodsName"
:prop="detail.upgradeFlag === 'Y' ? 'upgradeGoodsName' : 'baseGoodsName'"
align="center"
label="商品名称">
</el-table-column>
<el-table-column
prop="goodsInfo.goodsTypeName"
:prop="detail.upgradeFlag === 'Y' ? 'upgradeGoodsTypeName' : 'baseGoodsTypeName'"
align="center"
label="商品分类">
</el-table-column>
<el-table-column
prop="goodsInfo.brandMerchantName"
:prop="detail.upgradeFlag === 'Y' ? 'upgradeBrandMerchantName' : 'baseBrandMerchantName'"
align="center"
label="品牌商">
</el-table-column>
<el-table-column
prop="sellPrice"
:prop="detail.upgradeFlag === 'Y' ? 'upgradePrice' : 'baseRetailPrice'"
align="center"
label="商品售价">
</el-table-column>
<el-table-column
prop="discount"
prop="upgradeDiscount"
align="center"
label="优惠折扣">
<template slot-scope="scope">
<span v-if="detail.upgradeFlag === 'Y'">{{scope.row.upgradeDiscount === '10' ? '无' : scope.row.upgradeDiscount}}</span>
<span v-else>0</span>
</template>
</el-table-column>
<el-table-column
prop="nums"
align="center"
label="数量(件)">
<template>
<span>1件</span>
</template>
</el-table-column>
<el-table-column
prop="actualMoney"
prop="totalPrice"
align="center"
label="支付金额">
<template slot-scope="scope">
<span>¥{{scope.row.actualMoney || 0}}</span>
<span v-if="detail.upgradeFlag === 'Y'">¥{{scope.row.totalPrice || 0}}</span>
<span v-else>0</span>
</template>
</el-table-column>
</el-table>
......@@ -118,7 +126,7 @@
</el-table>
</div>
<p style="text-align:left;">
<el-button type="primary" @click="close({ tagName: '/orderDetail' })">返回</el-button>
<el-button type="primary" @click="handleClose">返回</el-button>
</p>
</div>
......@@ -172,18 +180,18 @@ export default {
methods: {
...mapActions({ close: 'd2admin/page/close' }),
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
if (rowIndex === 1) {
if (columnIndex === 0) {
return [1, 6]
} else {
return [1, 1]
}
}
},
getTotalNums() {
return this.detail.goods.reduce((prev, item) => prev + item.nums, 0)
},
// arraySpanMethod({ row, column, rowIndex, columnIndex }) {
// if (rowIndex === 1) {
// if (columnIndex === 0) {
// return [1, 6]
// } else {
// return [1, 1]
// }
// }
// },
// getTotalNums() {
// return this.detail.subOrderList.reduce((prev, item) => prev + item.nums, 0)
// },
getSummaries(param) {
const { columns, data } = param
const sums = []
......@@ -196,33 +204,21 @@ export default {
}
if (index === 1) {
sums[index] = this.getTotalNums()
sums[index] = this.detail.subOrderList.length + '件'
return
}
if (index === 2) {
sums[index] = `¥${this.detail.totalPrice}`
return
}
return
const values = data.map(item => Number(item[column.property]))
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] += ' 元'
} else {
sums[index] = 'N/A'
sums[index] = this.detail.upgradeFlag === 'Y' ? `¥${this.detail.totalPrice}` : '¥0'
}
})
return sums
},
handleClose() {
this.close({ tagName: '/orderList' })
this.$router.push({ name: 'orderList' })
this.close({ tagName: '/orderDetail' })
}
}
}
......
......@@ -30,9 +30,8 @@
</d2-table-header>
<el-table
:data="tableData"
border
:highlight-current-row="true">
<el-table-column type="expand">
border>
<!-- <el-table-column type="expand">
<template slot-scope="props">
<div v-if="props.row.goods" class="product_list">
<div class="product_item" v-for="(item, index) in props.row.goods" :key="index">
......@@ -44,23 +43,39 @@
</div>
</div>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column
type="index"
label="序号"
:index="index => index + (page.pageNum - 1) * page.pageSize + 1"
align="center">
</el-table-column>
<el-table-column
label="订单编号"
align="center"
width="150"
prop="orderCode">
</el-table-column>
<el-table-column
label="订单时间"
align="center"
width="150"
prop="orderTimeStr">
</el-table-column>
<el-table-column
label="客户姓名"
align="center"
prop="customerName">
</el-table-column>
<el-table-column
label="升级状态"
align="center"
prop="upgradeFlag">
<template slot-scope="scope">
<span>{{scope.row.upgradeFlag ? upgradeOpts[scope.row.upgradeFlag] : '待升级'}}</span>
</template>
</el-table-column>
<el-table-column
label="订单状态"
align="center"
prop="status">
......@@ -69,19 +84,58 @@
</template>
</el-table-column>
<el-table-column
label="客户姓名"
label="商品名称"
align="center"
prop="customerName">
prop="subOrderList">
<template slot-scope="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index">
<p v-if="item.upgradeGoodsId">{{item.upgradeGoodsName}}</p>
<p v-else>{{item.baseGoodsName}}</p>
</span>
</template>
</el-table-column>
<el-table-column
label="订单总价"
label="商品单价"
align="center"
prop="subOrderList">
<template slot-scope="scope">
<span v-for="(item, index) in scope.row.subOrderList" :key="index">
<p v-if="item.upgradeGoodsId">¥ {{item.upgradeShopPrice}}</p>
<p v-else>¥ {{item.baseShopPrice}}</p>
</span>
</template>
</el-table-column>
<el-table-column
label="总价"
align="center"
prop="totalPrice">
<template slot-scope="scope">
<span>¥{{scope.row.totalPrice}}</span>
<span>¥ {{scope.row.totalPrice}}</span>
</template>
</el-table-column>
<el-table-column
label="流量来源"
align="center"
width="170"
prop="merchantName">
</el-table-column>
<el-table-column
label="服务门店"
align="center"
width="170"
prop="sellerMerchantName">
</el-table-column>
<el-table-column
label="推荐人"
align="center"
prop="employeeName">
</el-table-column>
<el-table-column
label="转化员"
align="center"
prop="sellerName">
</el-table-column>
<el-table-column
label="操作"
align="center">
<template slot-scope="scope">
......@@ -124,6 +178,10 @@ export default {
// 5: '已退款',
6: '已完成'
},
upgradeOpts: {
'Y': '已升级',
'N': '不升级'
},
showFormData: [{
label: '订单状态',
name: 'status',
......@@ -308,6 +366,7 @@ export default {
},
// 查看详情
handleDetail(data) {
console.log(data.row)
this.close({ tagName: '/orderDetail' })
this.$router.push({
name: 'orderDetail',
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!