Browse Source

2023-3-4

完善订单列表
master
guoxing 2 years ago
parent
commit
c753039b19
  1. 4
      mallplusui-web-admin/config/dev.env.js
  2. 1370
      mallplusui-web-admin/src/router/index.js
  3. 2
      mallplusui-web-admin/src/styles/index.scss
  4. 13
      mallplusui-web-admin/src/views/oms/order/deliverOrderList.vue
  5. 229
      mallplusui-web-admin/src/views/oms/order/index1.vue
  6. 333
      mallplusui-web-admin/src/views/oms/order/orderDetail.vue

4
mallplusui-web-admin/config/dev.env.js

@ -4,6 +4,6 @@ const prodEnv = require('./prod.env')
module.exports = merge(prodEnv, { module.exports = merge(prodEnv, {
NODE_ENV: '"development"', NODE_ENV: '"development"',
// BASE_API: '"http://mall.yyundong.com/adminapi"', BASE_API: '"http://mall.yyundong.com/adminapi"',
BASE_API: '"http://127.0.0.1:8085"' // BASE_API: '"http://127.0.0.1:8085"'
}) })

1370
mallplusui-web-admin/src/router/index.js

File diff suppressed because it is too large

2
mallplusui-web-admin/src/styles/index.scss

@ -131,7 +131,7 @@ a:hover {
} }
//操作栏样式 //操作栏样式
.operate-container { .operate-container {
margin-top: 20px; // margin-top: 20px;
} }
.operate-container .btn-add { .operate-container .btn-add {

13
mallplusui-web-admin/src/views/oms/order/deliverOrderList.vue

@ -6,20 +6,20 @@
</el-card> </el-card>
<div class="table-container"> <div class="table-container">
<el-table ref="deliverOrderTable" <el-table ref="deliverOrderTable"
style="width: 100%;" style="margin-left: 20px;width: 95%;"
:data="list" border> :data="list" border>
<el-table-column label="订单编号" width="180" align="center"> <el-table-column label="订单编号" width="200" align="center">
<template slot-scope="scope">{{scope.row.orderSn}}</template> <template slot-scope="scope">{{scope.row.orderSn}}</template>
</el-table-column> </el-table-column>
<el-table-column label="收货人" width="180" align="center"> <el-table-column label="收货人" width="120" align="center">
<template slot-scope="scope">{{scope.row.receiverName}}</template> <template slot-scope="scope">{{scope.row.receiverName}}</template>
</el-table-column> </el-table-column>
<el-table-column label="手机号码" width="160" align="center"> <el-table-column label="手机号码" width="160" align="center">
<template slot-scope="scope">{{scope.row.receiverPhone}}</template> <template slot-scope="scope">{{scope.row.receiverPhone}}</template>
</el-table-column> </el-table-column>
<el-table-column label="邮政编码" width="160" align="center"> <!-- <el-table-column label="邮政编码" width="160" align="center">
<template slot-scope="scope">{{scope.row.receiverPostCode}}</template> <template slot-scope="scope">{{scope.row.receiverPostCode}}</template>
</el-table-column> </el-table-column> -->
<el-table-column label="收货地址" align="center"> <el-table-column label="收货地址" align="center">
<template slot-scope="scope">{{scope.row.address}}</template> <template slot-scope="scope">{{scope.row.address}}</template>
</el-table-column> </el-table-column>
@ -36,7 +36,7 @@
</el-select> </el-select>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="物流单号" width="180" align="center"> <el-table-column label="物流单号" width="200" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input size="small" v-model="scope.row.deliverySn"></el-input> <el-input size="small" v-model="scope.row.deliverySn"></el-input>
</template> </template>
@ -62,6 +62,7 @@
}, },
created(){ created(){
this.list= this.$route.query.list; this.list= this.$route.query.list;
console.log("list", this.list)
}, },
methods:{ methods:{
cancel(){ cancel(){

229
mallplusui-web-admin/src/views/oms/order/index1.vue

@ -26,19 +26,19 @@
待收货 待收货
</span> </span>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="4"> <!-- <el-tab-pane name="4">
<span slot="label"> <span slot="label">
<i class="el-icon-document"></i> <i class="el-icon-document"></i>
待评价 待评价
</span> </span>
</el-tab-pane> </el-tab-pane> -->
<el-tab-pane name="5"> <el-tab-pane name="5">
<span slot="label"> <span slot="label">
<i class="el-icon-circle-check"></i> <i class="el-icon-circle-check"></i>
交易完成 交易完成
</span> </span>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="13"> <!-- <el-tab-pane name="13">
<span slot="label"> <span slot="label">
<i class="el-icon-back"></i> <i class="el-icon-back"></i>
申请退款 申请退款
@ -49,7 +49,7 @@
<i class="el-icon-finished"></i> <i class="el-icon-finished"></i>
已退款 已退款
</span> </span>
</el-tab-pane> </el-tab-pane> -->
<el-tab-pane name="15"> <el-tab-pane name="15">
<span slot="label"> <span slot="label">
<i class="el-icon-circle-close"></i> <i class="el-icon-circle-close"></i>
@ -62,28 +62,38 @@
<div> <div>
<i class="el-icon-search"></i> <i class="el-icon-search"></i>
<span>筛选搜索</span> <span>筛选搜索</span>
<el-button style="float:right" type="primary" @click="handleSearchList()" size="small">查询搜索</el-button> <el-button style="float:right" type="primary" @click="handleSearchList()" size="small">查询搜索
<el-button style="float:right;margin-right: 15px" @click="handleResetSearch()" size="small">重置</el-button> </el-button>
<el-button style="float:right;margin-right: 15px" @click="handleResetSearch()" size="small">重置
</el-button>
</div> </div>
<div style="margin-top: 15px"> <div style="margin-top: 15px">
<el-form :inline="true" :model="listQuery" size="small" label-width="140px"> <el-form :inline="true" :model="listQuery" size="small" label-width="140px">
<el-form-item label="输入搜索:"><el-input v-model="listQuery.id" class="input-width" placeholder="编号"></el-input></el-form-item> <el-form-item label="输入搜索:">
<el-form-item label="订单分类:"> <el-input v-model="listQuery.id" class="input-width" placeholder="编号"></el-input>
</el-form-item>
<!-- <el-form-item label="订单分类:">
<el-select v-model="listQuery.orderType" class="input-width" placeholder="全部" clearable> <el-select v-model="listQuery.orderType" class="input-width" placeholder="全部" clearable>
<el-option v-for="item in orderTypeOptions" :key="item.value" :label="item.label" :value="item.value"></el-option> <el-option v-for="item in orderTypeOptions" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item> -->
<el-form-item label="提交时间:"> <el-form-item label="提交时间:">
<el-date-picker class="input-width" v-model="listQuery.createTime" value-format="yyyy-MM-dd" type="date" placeholder="请选择时间"></el-date-picker> <el-date-picker class="input-width" v-model="listQuery.createTime" value-format="yyyy-MM-dd"
type="date" placeholder="请选择时间"></el-date-picker>
</el-form-item>
<el-form-item label="收货信息 :">
<el-input v-model="listQuery.receiverPhone" class="input-width" placeholder="收货人电话">
</el-input>
</el-form-item> </el-form-item>
<el-form-item label="收货信息 :"><el-input v-model="listQuery.receiverPhone" class="input-width" placeholder="收货人电话"></el-input></el-form-item>
<el-form-item label="订单来源:"> <!-- <el-form-item label="订单来源:">
<el-select v-model="listQuery.sourceType" class="input-width" placeholder="全部" clearable> <el-select v-model="listQuery.sourceType" class="input-width" placeholder="全部" clearable>
<el-option v-for="item in sourceTypeOptions" :key="item.value" :label="item.label" :value="item.value"></el-option> <el-option v-for="item in sourceTypeOptions" :key="item.value" :label="item.label"
:value="item.value"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item> -->
</el-form> </el-form>
</div> </div>
</el-card> </el-card>
@ -109,20 +119,35 @@
<i class="el-icon-tickets"></i> <i class="el-icon-tickets"></i>
<span>数据列表</span> <span>数据列表</span>
</el-card> </el-card>
<!-- <div class="batch-operate-container">
<el-checkbox v-model="printChecked" @change="batchSelection"
style="margin-left:23px; margin-right: 20px;"></el-checkbox>
<el-select v-model="batchHandle" @change="handlePrintOption" clearable placeholder="批量操作"
class="filter-item" style="width: 130px; margin-right: 8px;">
<el-option v-for="item in handleOptions" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
<el-select v-model="batchExport" @change="handleExportOption" clearable placeholder="批量导出"
class="filter-item" style="width: 130px">
<el-option v-for="item in exportOptions" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</div> -->
<div class="table-container"> <div class="table-container">
<el-table ref="orderTable" :data="list" style="width: 100%;" @selection-change="handleSelectionChange" v-loading="listLoading" border> <el-table ref="orderTable" :data="list" style="width: 100%;" @selection-change="handleSelectionChange"
v-loading="listLoading" border>
<el-table-column type="selection" width="60" align="center"></el-table-column> <el-table-column type="selection" width="60" align="center"></el-table-column>
<el-table-column label="编号" width="80" align="center"> <el-table-column label="编号" width="80" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.id }} {{ scope.row.id }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="订单编号" width="180" align="center"> <el-table-column label="订单编号" width="200" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.orderSn }} {{ scope.row.orderSn }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="商品" width="180" align="center"> <el-table-column label="商品" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.goodsName }} {{ scope.row.goodsName }}
</template> </template>
@ -132,7 +157,7 @@
{{ scope.row.createTime | formatCreateTime }} {{ scope.row.createTime | formatCreateTime }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="用户账号" align="center"> <el-table-column label="用户账号" width="180" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.memberUsername }} {{ scope.row.memberUsername }}
</template> </template>
@ -152,7 +177,7 @@
{{ scope.row.payType | formatPayType }} {{ scope.row.payType | formatPayType }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="订单来源" width="120" align="center"> <!-- <el-table-column label="订单来源" width="120" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.sourceType | formatSourceType }} {{ scope.row.sourceType | formatSourceType }}
</template> </template>
@ -161,7 +186,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.orderType | formatOrderType }} {{ scope.row.orderType | formatOrderType }}
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column label="订单状态" width="120" align="center"> <el-table-column label="订单状态" width="120" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
@ -171,46 +196,44 @@
<el-table-column label="操作" width="200" align="center"> <el-table-column label="操作" width="200" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" @click="handleViewOrder(scope.$index, scope.row)">查看订单</el-button> <el-button size="mini" @click="handleViewOrder(scope.$index, scope.row)">查看订单</el-button>
<el-button size="mini" @click="handleCloseOrder(scope.$index, scope.row)" v-show="scope.row.status === 14">关闭订单</el-button> <!-- <el-button size="mini" @click="handleCloseOrder(scope.$index, scope.row)"
<el-button size="mini" @click="handleDeliveryOrder(scope.$index, scope.row)" v-show="scope.row.status === 2">订单发货</el-button> v-show="scope.row.status === 14">关闭订单</el-button> -->
<el-button size="mini" @click="handleViewLogistics(scope.$index, scope.row)" v-show="scope.row.status > 2 || scope.row.status < 9">订单跟踪</el-button> <el-button size="mini" @click="handleDeliveryOrder(scope.$index, scope.row)"
<el-button size="mini" type="danger" @click="handleDeleteOrder(scope.$index, scope.row)" v-show="scope.row.status === 15">删除订单</el-button> v-show="scope.row.status === 2">订单发货</el-button>
<!-- <el-button size="mini" @click="handleViewLogistics(scope.$index, scope.row)"
v-show="scope.row.status > 2 || scope.row.status < 9">订单跟踪</el-button> -->
<!-- <el-button size="mini" type="danger" @click="handleDeleteOrder(scope.$index, scope.row)"
v-show="scope.row.status === 15">删除订单</el-button> -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
</div> </div>
<div class="batch-operate-container">
<el-checkbox v-model="printChecked" @change="batchSelection" style="margin-right: 20px;"></el-checkbox>
<el-select v-model="batchHandle" @change="handlePrintOption" clearable placeholder="批量操作" class="filter-item" style="width: 130px; margin-right: 8px;">
<el-option v-for="item in handleOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
<el-select v-model="batchExport" @change="handleExportOption" clearable placeholder="批量导出" class="filter-item" style="width: 130px">
<el-option v-for="item in exportOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
<div class="pagination-container"> <div class="pagination-container">
<el-pagination <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
background layout="total, sizes,prev, pager, next,jumper" :current-page.sync="listQuery.pageNum"
@size-change="handleSizeChange" :page-size="listQuery.pageSize" :page-sizes="[5, 10, 15]" :total="total"></el-pagination>
@current-change="handleCurrentChange"
layout="total, sizes,prev, pager, next,jumper"
:current-page.sync="listQuery.pageNum"
:page-size="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
:total="total"
></el-pagination>
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import checkPermission from '@/utils/permission'; import checkPermission from '@/utils/permission';
import { formatTime } from '@/utils/index'; import {
import { fetchList, closeOrder, deleteOrder, orderData } from '@/api/order'; formatTime
import { formatDate } from '@/utils/date'; } from '@/utils/index';
import LogisticsDialog from '@/views/oms/order/components/logisticsDialog'; import {
const defaultListQuery = { fetchList,
closeOrder,
deleteOrder,
orderData
} from '@/api/order';
import {
formatDate
} from '@/utils/date';
import LogisticsDialog from '@/views/oms/order/components/logisticsDialog';
const defaultListQuery = {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
orderSn: null, orderSn: null,
@ -219,15 +242,17 @@ const defaultListQuery = {
orderType: null, orderType: null,
sourceType: null, sourceType: null,
createTime: null createTime: null
}; };
export default { export default {
name: 'orderList', name: 'orderList',
components: { LogisticsDialog }, components: {
LogisticsDialog
},
data() { data() {
return { return {
delLoading: false, delLoading: false,
status: '-9', status: '0',
orderType: '0', orderType: '0',
createTime: '', createTime: '',
checkList: [], checkList: [],
@ -246,8 +271,7 @@ export default {
content: null, content: null,
orderIds: [] orderIds: []
}, },
statusOptions: [ statusOptions: [{
{
label: '待付款', label: '待付款',
value: 12 value: 12
}, },
@ -276,8 +300,7 @@ export default {
value: 15 value: 15
} }
], ],
orderTypeOptions: [ orderTypeOptions: [{
{
label: '正常订单', label: '正常订单',
value: 1 value: 1
}, },
@ -306,8 +329,7 @@ export default {
value: 5 value: 5
} }
], ],
sourceTypeOptions: [ sourceTypeOptions: [{
{
label: '小程序订单', label: '小程序订单',
value: 1 value: 1
}, },
@ -324,8 +346,7 @@ export default {
value: 3 value: 3
} }
], ],
operateOptions: [ operateOptions: [{
{
label: '批量发货', label: '批量发货',
value: 1 value: 1
}, },
@ -340,8 +361,23 @@ export default {
], ],
logisticsDialogVisible: false, logisticsDialogVisible: false,
handleOptions: [{ value: '', label: '批量操作' }, { value: '0', label: '批量打印' }], handleOptions: [{
exportOptions: [{ value: '', label: '批量导出' }, { value: '0', label: '导出全部' }, { value: '1', label: '导出选中' }], value: '',
label: '批量操作'
}, {
value: '0',
label: '批量打印'
}],
exportOptions: [{
value: '',
label: '批量导出'
}, {
value: '0',
label: '导出全部'
}, {
value: '1',
label: '导出选中'
}],
caculateInfo: { caculateInfo: {
orderCount: 0, orderCount: 0,
orderPay: 0, orderPay: 0,
@ -360,7 +396,7 @@ export default {
let date = new Date(time); let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd hh:mm:ss'); return formatDate(date, 'yyyy-MM-dd hh:mm:ss');
}, },
formatPayType(value) {//0->1->2-> formatPayType(value) { //0->1->2->
if (value === 1) { if (value === 1) {
return '支付宝'; return '支付宝';
} else if (value === 2) { } else if (value === 2) {
@ -371,7 +407,7 @@ export default {
return '积分兑换'; return '积分兑换';
} }
}, },
formatSourceType(value) {//0->PC1->app formatSourceType(value) { //0->PC1->app
if (value === 4) { if (value === 4) {
return '小程序'; return '小程序';
} else if (value === 2) { } else if (value === 2) {
@ -399,7 +435,7 @@ export default {
return '积分订单'; return '积分订单';
} }
}, },
formatStatus(value) {//0->1->2->3->4->5-> formatStatus(value) { //0->1->2->3->4->5->
if (value === 12) { if (value === 12) {
return '待付款'; return '待付款';
} }
@ -439,6 +475,7 @@ export default {
this.listQuery.status = tab.name; this.listQuery.status = tab.name;
this.getList(); this.getList();
this.orderDatas(tab.name); this.orderDatas(tab.name);
console.log("tab", tab)
}, },
handleResetSearch() { handleResetSearch() {
this.listQuery = Object.assign({}, defaultListQuery); this.listQuery = Object.assign({}, defaultListQuery);
@ -451,7 +488,12 @@ export default {
this.multipleSelection = val; this.multipleSelection = val;
}, },
handleViewOrder(index, row) { handleViewOrder(index, row) {
this.$router.push({ path: '/oms/orderDetail', query: { id: row.id } }); this.$router.push({
path: '/oms/orderDetail',
query: {
id: row.id
}
});
}, },
handleCloseOrder(index, row) { handleCloseOrder(index, row) {
this.closeOrder.dialogVisible = true; this.closeOrder.dialogVisible = true;
@ -459,12 +501,18 @@ export default {
}, },
handleDeliveryOrder(index, row) { handleDeliveryOrder(index, row) {
let listItem = this.covertOrder(row); let listItem = this.covertOrder(row);
this.$router.push({ path: '/oms/deliverOrderList', query: { list: [listItem] } }); console.log("listItem", listItem)
this.$router.push({
path: '/oms/deliverOrderList',
query: {
list: [listItem]
}
});
}, },
handleViewLogistics(index, row) { handleViewLogistics(index, row) {
this.logisticsDialogVisible = true; this.logisticsDialogVisible = true;
}, },
handleDeleteOrder(index, row) {// handleDeleteOrder(index, row) { //
let id = []; let id = [];
id.push(row.id); id.push(row.id);
this.deleteOrder(id); this.deleteOrder(id);
@ -494,7 +542,12 @@ export default {
}); });
return; return;
} }
this.$router.push({ path: '/oms/deliverOrderList', query: { list: list } }); this.$router.push({
path: '/oms/deliverOrderList',
query: {
list: list
}
});
} else if (this.operateType === 2) { } else if (this.operateType === 2) {
// //
this.closeOrder.orderIds = []; this.closeOrder.orderIds = [];
@ -511,11 +564,13 @@ export default {
this.deleteOrder(ids); this.deleteOrder(ids);
} }
}, },
//
handleSizeChange(val) { handleSizeChange(val) {
this.listQuery.pageNum = 1; this.listQuery.pageNum = 1;
this.listQuery.pageSize = val; this.listQuery.pageSize = val;
this.getList(); this.getList();
}, },
//
handleCurrentChange(val) { handleCurrentChange(val) {
this.listQuery.pageNum = val; this.listQuery.pageNum = val;
this.getList(); this.getList();
@ -545,14 +600,20 @@ export default {
}, },
getList() { getList() {
this.listLoading = true; this.listLoading = true;
if (this.listQuery.status == 0)
this.listQuery.status = null
console.log("listQuery", this.listQuery)
fetchList(this.listQuery).then(response => { fetchList(this.listQuery).then(response => {
this.listLoading = false; this.listLoading = false;
console.log("list", response.data.records)
this.list = response.data.records; this.list = response.data.records;
this.total = response.data.total; this.total = response.data.total;
}); });
}, },
orderDatas(status) { orderDatas(status) {
orderData({ status: status }).then(response => { orderData({
status: status
}).then(response => {
this.caculateInfo = response.data; this.caculateInfo = response.data;
}); });
}, },
@ -576,7 +637,8 @@ export default {
}); });
}, },
covertOrder(order) { covertOrder(order) {
let address = order.receiverProvince + order.receiverCity + order.receiverRegion + order.receiverDetailAddress; let address = order.receiverProvince + order.receiverCity + order.receiverRegion + order
.receiverDetailAddress;
let listItem = { let listItem = {
orderId: order.id, orderId: order.id,
orderSn: order.orderSn, orderSn: order.orderSn,
@ -707,11 +769,11 @@ export default {
return row.id !== 1; return row.id !== 1;
} }
} }
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.container { .container {
height: calc(100% - 80px); height: calc(100% - 80px);
position: absolute; position: absolute;
overflow: auto; overflow: auto;
@ -722,10 +784,12 @@ export default {
color: #909399; color: #909399;
border-top: 1px solid #f0f0f0; border-top: 1px solid #f0f0f0;
padding: 20px 10px; padding: 20px 10px;
.caculate-title { .caculate-title {
display: inline-block; display: inline-block;
margin-right: 50px; margin-right: 50px;
} }
.caculate-num { .caculate-num {
font-size: 20px; font-size: 20px;
color: #ff4949; color: #ff4949;
@ -735,9 +799,9 @@ export default {
.el-table th { .el-table th {
background-color: #fafafa; background-color: #fafafa;
} }
} }
.footer-contains { .footer-contains {
position: absolute; position: absolute;
display: -ms-flexbox; display: -ms-flexbox;
display: flex; display: flex;
@ -749,10 +813,10 @@ export default {
width: 100%; width: 100%;
z-index: 999; z-index: 999;
padding: 0 20px 0 13px; padding: 0 20px 0 13px;
} }
/*打印单样式编辑*/ /*打印单样式编辑*/
.order-list { .order-list {
/* height: 297mm;*/ /* height: 297mm;*/
margin: 0 auto; margin: 0 auto;
width: 210mm; width: 210mm;
@ -764,19 +828,22 @@ export default {
font-weight: bolder; font-weight: bolder;
text-align: center; text-align: center;
} }
.order-info { .order-info {
span { span {
display: inline-block; display: inline-block;
padding: 0 0 10px 0; padding: 0 0 10px 0;
font-size: 3mm; font-size: 3mm;
} }
span.info { span.info {
width: 60mm; width: 60mm;
} }
} }
.el-table--small th, .el-table--small th,
.el-table--small td { .el-table--small td {
padding: 4px 0; padding: 4px 0;
} }
} }
</style> </style>

333
mallplusui-web-admin/src/views/oms/order/orderDetail.vue

@ -73,11 +73,7 @@
<el-col :span="4" class="table-cell">{{order.integration}}</el-col> <el-col :span="4" class="table-cell">{{order.integration}}</el-col>
<el-col :span="4" class="table-cell">{{order.growth}}</el-col> <el-col :span="4" class="table-cell">{{order.growth}}</el-col>
<el-col :span="4" class="table-cell"> <el-col :span="4" class="table-cell">
<el-popover <el-popover placement="top-start" title="活动信息" width="200" trigger="hover"
placement="top-start"
title="活动信息"
width="200"
trigger="hover"
:content="order.promotionInfo"> :content="order.promotionInfo">
<span slot="reference">{{order.promotionInfo | formatLongText}}</span> <span slot="reference">{{order.promotionInfo | formatLongText}}</span>
</el-popover> </el-popover>
@ -92,24 +88,21 @@
<el-row> <el-row>
<el-col :span="6" class="table-cell-title">收货人</el-col> <el-col :span="6" class="table-cell-title">收货人</el-col>
<el-col :span="6" class="table-cell-title">手机号码</el-col> <el-col :span="6" class="table-cell-title">手机号码</el-col>
<el-col :span="6" class="table-cell-title">邮政编码</el-col> <el-col :span="6" class="table-cell-title">所在地区</el-col>
<el-col :span="6" class="table-cell-title">收货地址</el-col> <el-col :span="6" class="table-cell-title">取货地点</el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="6" class="table-cell">{{order.receiverName}}</el-col> <el-col :span="6" class="table-cell">{{order.receiverName}}</el-col>
<el-col :span="6" class="table-cell">{{order.receiverPhone}}</el-col> <el-col :span="6" class="table-cell">{{order.receiverPhone}}</el-col>
<el-col :span="6" class="table-cell">{{order.receiverPostCode}}</el-col> <el-col :span="6" class="table-cell">{{order.receiverRegion}}</el-col>
<el-col :span="6" class="table-cell">{{order | formatAddress}}</el-col> <el-col :span="6" class="table-cell">{{order.receiverDetailAddress}}</el-col>
</el-row> </el-row>
</div> </div>
<div style="margin-top: 20px"> <div style="margin-top: 20px">
<svg-icon icon-class="marker" style="color: #606266"></svg-icon> <svg-icon icon-class="marker" style="color: #606266"></svg-icon>
<span class="font-small">商品信息</span> <span class="font-small">商品信息</span>
</div> </div>
<el-table <el-table ref="orderItemTable" :data="order.orderItemList" style="width: 100%;margin-top: 20px" border>
ref="orderItemTable"
:data="order.orderItemList"
style="width: 100%;margin-top: 20px" border>
<el-table-column label="商品图片" width="120" align="center"> <el-table-column label="商品图片" width="120" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<img :src="scope.row.productPic" style="height: 80px"> <img :src="scope.row.productPic" style="height: 80px">
@ -189,9 +182,7 @@
<svg-icon icon-class="marker" style="color: #606266"></svg-icon> <svg-icon icon-class="marker" style="color: #606266"></svg-icon>
<span class="font-small">操作信息</span> <span class="font-small">操作信息</span>
</div> </div>
<el-table style="margin-top: 20px;width: 100%" <el-table style="margin-top: 20px;width: 100%" ref="orderHistoryTable" :data="order.historyList" border>
ref="orderHistoryTable"
:data="order.historyList" border>
<el-table-column label="操作者" width="120" align="center"> <el-table-column label="操作者" width="120" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.operateMan}} {{scope.row.operateMan}}
@ -220,12 +211,8 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-card> </el-card>
<el-dialog title="修改收货人信息" <el-dialog title="修改收货人信息" :visible.sync="receiverDialogVisible" width="40%">
:visible.sync="receiverDialogVisible" <el-form :model="receiverInfo" ref="receiverInfoForm" label-width="150px">
width="40%">
<el-form :model="receiverInfo"
ref="receiverInfoForm"
label-width="150px">
<el-form-item label="收货人姓名:"> <el-form-item label="收货人姓名:">
<el-input v-model="receiverInfo.receiverName" style="width: 200px"></el-input> <el-input v-model="receiverInfo.receiverName" style="width: 200px"></el-input>
</el-form-item> </el-form-item>
@ -238,10 +225,8 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="所在区域:"> <el-form-item label="所在区域:">
<v-distpicker :province="receiverInfo.receiverProvince" <v-distpicker :province="receiverInfo.receiverProvince" :city="receiverInfo.receiverCity"
:city="receiverInfo.receiverCity" :area="receiverInfo.receiverRegion" @selected="onSelectRegion"></v-distpicker>
:area="receiverInfo.receiverRegion"
@selected="onSelectRegion"></v-distpicker>
</el-form-item> </el-form-item>
<el-form-item label="详细地址:"> <el-form-item label="详细地址:">
<el-input v-model="receiverInfo.receiverDetailAddress" type="textarea" rows="3"> <el-input v-model="receiverInfo.receiverDetailAddress" type="textarea" rows="3">
@ -253,9 +238,7 @@
<el-button type="primary" @click="handleUpdateReceiverInfo"> </el-button> <el-button type="primary" @click="handleUpdateReceiverInfo"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="修改费用信息" <el-dialog title="修改费用信息" :visible.sync="moneyDialogVisible" width="40%">
:visible.sync="moneyDialogVisible"
width="40%">
<div class="table-layout"> <div class="table-layout">
<el-row> <el-row>
<el-col :span="6" class="table-cell-title">商品合计</el-col> <el-col :span="6" class="table-cell-title">商品合计</el-col>
@ -266,7 +249,8 @@
<el-row> <el-row>
<el-col :span="6" class="table-cell">{{order.totalAmount}}</el-col> <el-col :span="6" class="table-cell">{{order.totalAmount}}</el-col>
<el-col :span="6" class="table-cell"> <el-col :span="6" class="table-cell">
<el-input v-model.number="moneyInfo.freightAmount" size="mini"><template slot="prepend"></template></el-input> <el-input v-model.number="moneyInfo.freightAmount" size="mini"><template
slot="prepend"></template></el-input>
</el-col> </el-col>
<el-col :span="6" class="table-cell">-{{order.couponAmount}}</el-col> <el-col :span="6" class="table-cell">-{{order.couponAmount}}</el-col>
<el-col :span="6" class="table-cell">-{{order.integrationAmount}}</el-col> <el-col :span="6" class="table-cell">-{{order.integrationAmount}}</el-col>
@ -280,13 +264,15 @@
<el-row> <el-row>
<el-col :span="6" class="table-cell">-{{order.promotionAmount}}</el-col> <el-col :span="6" class="table-cell">-{{order.promotionAmount}}</el-col>
<el-col :span="6" class="table-cell"> <el-col :span="6" class="table-cell">
<el-input v-model.number="moneyInfo.discountAmount" size="mini"><template slot="prepend">-</template></el-input> <el-input v-model.number="moneyInfo.discountAmount" size="mini"><template
slot="prepend">-</template></el-input>
</el-col> </el-col>
<el-col :span="6" class="table-cell"> <el-col :span="6" class="table-cell">
<span class="color-danger">{{order.totalAmount+moneyInfo.freightAmount}}</span> <span class="color-danger">{{order.totalAmount+moneyInfo.freightAmount}}</span>
</el-col> </el-col>
<el-col :span="6" class="table-cell"> <el-col :span="6" class="table-cell">
<span class="color-danger">{{order.payAmount+moneyInfo.freightAmount-moneyInfo.discountAmount}}</span> <span
class="color-danger">{{order.payAmount+moneyInfo.freightAmount-moneyInfo.discountAmount}}</span>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
@ -295,12 +281,8 @@
<el-button type="primary" @click="handleUpdateMoneyInfo"> </el-button> <el-button type="primary" @click="handleUpdateMoneyInfo"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="发送站内信" <el-dialog title="发送站内信" :visible.sync="messageDialogVisible" width="40%">
:visible.sync="messageDialogVisible" <el-form :model="message" ref="receiverInfoForm" label-width="150px">
width="40%">
<el-form :model="message"
ref="receiverInfoForm"
label-width="150px">
<el-form-item label="标题:"> <el-form-item label="标题:">
<el-input v-model="message.title" style="width: 200px"></el-input> <el-input v-model="message.title" style="width: 200px"></el-input>
</el-form-item> </el-form-item>
@ -314,11 +296,8 @@
<el-button type="primary" @click="handleSendMessage"> </el-button> <el-button type="primary" @click="handleSendMessage"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="关闭订单" <el-dialog title="关闭订单" :visible.sync="closeDialogVisible" width="40%">
:visible.sync="closeDialogVisible" <el-form :model="closeInfo" label-width="150px">
width="40%">
<el-form :model="closeInfo"
label-width="150px">
<el-form-item label="操作备注:"> <el-form-item label="操作备注:">
<el-input v-model="closeInfo.note" type="textarea" rows="3"> <el-input v-model="closeInfo.note" type="textarea" rows="3">
</el-input> </el-input>
@ -329,11 +308,8 @@
<el-button type="primary" @click="handleCloseOrder"> </el-button> <el-button type="primary" @click="handleCloseOrder"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="备注订单" <el-dialog title="备注订单" :visible.sync="markOrderDialogVisible" width="40%">
:visible.sync="markOrderDialogVisible" <el-form :model="markInfo" label-width="150px">
width="40%">
<el-form :model="markInfo"
label-width="150px">
<el-form-item label="操作备注:"> <el-form-item label="操作备注:">
<el-input v-model="markInfo.note" type="textarea" rows="3"> <el-input v-model="markInfo.note" type="textarea" rows="3">
</el-input> </el-input>
@ -348,39 +324,64 @@
</div> </div>
</template> </template>
<script> <script>
import {getOrderDetail,updateReceiverInfo,updateMoneyInfo,closeOrder,updateOrderNote,deleteOrder} from '@/api/order'; import {
getOrderDetail,
updateReceiverInfo,
updateMoneyInfo,
closeOrder,
updateOrderNote,
deleteOrder
} from '@/api/order';
import LogisticsDialog from '@/views/oms/order/components/logisticsDialog'; import LogisticsDialog from '@/views/oms/order/components/logisticsDialog';
import {formatDate} from '@/utils/date'; import {
formatDate
} from '@/utils/date';
import VDistpicker from 'v-distpicker'; import VDistpicker from 'v-distpicker';
const defaultReceiverInfo = { const defaultReceiverInfo = {
orderId:null, orderId: null,
receiverName:null, receiverName: null,
receiverPhone:null, receiverPhone: null,
receiverPostCode:null, receiverPostCode: null,
receiverDetailAddress:null, receiverDetailAddress: null,
receiverProvince:null, receiverProvince: null,
receiverCity:null, receiverCity: null,
receiverRegion:null, receiverRegion: null,
status:null status: null
}; };
export default { export default {
name: 'orderDetail', name: 'orderDetail',
components: { VDistpicker, LogisticsDialog}, components: {
VDistpicker,
LogisticsDialog
},
data() { data() {
return { return {
id: null, id: null,
order: {}, order: {},
receiverDialogVisible:false, receiverDialogVisible: false,
receiverInfo:Object.assign({},defaultReceiverInfo), receiverInfo: Object.assign({}, defaultReceiverInfo),
moneyDialogVisible:false, moneyDialogVisible: false,
moneyInfo:{orderId:null, freightAmount:0, discountAmount:0,status:null}, moneyInfo: {
messageDialogVisible:false, orderId: null,
message: {title:null, content:null}, freightAmount: 0,
closeDialogVisible:false, discountAmount: 0,
closeInfo:{note:null,id:null}, status: null
markOrderDialogVisible:false, },
markInfo:{note:null}, messageDialogVisible: false,
logisticsDialogVisible:false message: {
title: null,
content: null
},
closeDialogVisible: false,
closeInfo: {
note: null,
id: null
},
markOrderDialogVisible: false,
markInfo: {
note: null
},
logisticsDialogVisible: false
} }
}, },
created() { created() {
@ -391,42 +392,42 @@
}, },
filters: { filters: {
formatNull(value) { formatNull(value) {
if(value===undefined||value===null||value===''){ if (value === undefined || value === null || value === '') {
return '暂无'; return '暂无';
}else{ } else {
return value; return value;
} }
}, },
formatLongText(value) { formatLongText(value) {
if(value===undefined||value===null||value===''){ if (value === undefined || value === null || value === '') {
return '暂无'; return '暂无';
}else if(value.length>8){ } else if (value.length > 8) {
return value.substr(0, 8) + '...'; return value.substr(0, 8) + '...';
}else{ } else {
return value; return value;
} }
}, },
formatPayType(value) {//0->1->2-> 3 formatPayType(value) { //0->1->2-> 3
if (value === 1) { if (value === 1) {
return '支付宝'; return '支付宝';
} else if (value === 2) { } else if (value === 2) {
return '微信'; return '微信';
} else if (value === 3){ } else if (value === 3) {
return '余额支付'; return '余额支付';
} else if (value === 5){ } else if (value === 5) {
return '积分兑换'; return '积分兑换';
} }
}, },
formatSourceType(value) {//0->PC1->app formatSourceType(value) { //0->PC1->app
if (value === 4) { if (value === 4) {
return '小程序'; return '小程序';
} else if (value === 2){ } else if (value === 2) {
return 'h5订单'; return 'h5订单';
}else if (value === 0){ } else if (value === 0) {
return 'PC订单'; return 'PC订单';
}else if (value === 1){ } else if (value === 1) {
return 'android订单'; return 'android订单';
}else if (value === 5){ } else if (value === 5) {
return 'ios订单'; return 'ios订单';
} }
}, },
@ -435,11 +436,11 @@
return '拼团订单'; return '拼团订单';
} else if (value === 3) { } else if (value === 3) {
return '团购订单'; return '团购订单';
} else if (value === 6){ } else if (value === 6) {
return '秒杀订单'; return '秒杀订单';
}else if (value === 1) { } else if (value === 1) {
return '普通订单'; return '普通订单';
}else if (value === 4) { } else if (value === 4) {
return '砍价订单'; return '砍价订单';
} else if (value === 5) { } else if (value === 5) {
return '积分订单'; return '积分订单';
@ -448,10 +449,11 @@
} }
}, },
formatAddress(order) { formatAddress(order) {
let str = order.receiverProvince; // let str = order.receiverProvince;
if (order.receiverCity != null) { // if (order.receiverCity != null) {
str += " " + order.receiverCity; // str += " " + order.receiverCity;
} // }
let str = "";
str += " " + order.receiverRegion; str += " " + order.receiverRegion;
str += " " + order.receiverDetailAddress; str += " " + order.receiverDetailAddress;
return str; return str;
@ -459,9 +461,10 @@
formatStatus(value) { formatStatus(value) {
if (value === 12) { if (value === 12) {
return '待付款'; return '待付款';
}if (value === 1) { }
if (value === 1) {
return '支付成功,没有回掉'; return '支付成功,没有回掉';
}else if (value === 2) { } else if (value === 2) {
return '待发货'; return '待发货';
} else if (value === 3) { } else if (value === 3) {
return '待收货'; return '待收货';
@ -490,14 +493,14 @@
formatPayStatus(value) { formatPayStatus(value) {
if (value === 0) { if (value === 0) {
return '未支付'; return '未支付';
} else if(value===4){ } else if (value === 4) {
return '已退款'; return '已退款';
}else{ } else {
return '已支付'; return '已支付';
} }
}, },
formatDeliverStatus(value) { formatDeliverStatus(value) {
if (value === 0||value === 1) { if (value === 0 || value === 1) {
return '未发货'; return '未发货';
} else { } else {
return '已发货'; return '已发货';
@ -510,27 +513,27 @@
return '赠品'; return '赠品';
} }
}, },
formatProductAttr(value){ formatProductAttr(value) {
if(value==null){ if (value == null) {
return ''; return '';
}else{ } else {
let attr = JSON.parse(value); let attr = JSON.parse(value);
let result=''; let result = '';
for(let i=0;i<attr.length;i++){ for (let i = 0; i < attr.length; i++) {
result+=attr[i].key; result += attr[i].key;
result+=":"; result += ":";
result+=attr[i].value; result += attr[i].value;
result+=";"; result += ";";
} }
return result; return result;
} }
} }
}, },
methods: { methods: {
onSelectRegion(data){ onSelectRegion(data) {
this.receiverInfo.receiverProvince=data.province.value; this.receiverInfo.receiverProvince = data.province.value;
this.receiverInfo.receiverCity=data.city.value; this.receiverInfo.receiverCity = data.city.value;
this.receiverInfo.receiverRegion=data.area.value; this.receiverInfo.receiverRegion = data.area.value;
}, },
formatTime(time) { formatTime(time) {
if (time == null || time === '') { if (time == null || time === '') {
@ -549,33 +552,33 @@
} else if (value === 3) { } else if (value === 3) {
// //
return 4; return 4;
}else { } else {
// //
return 1; return 1;
} }
}, },
showUpdateReceiverDialog(){ showUpdateReceiverDialog() {
this.receiverDialogVisible=true; this.receiverDialogVisible = true;
this.receiverInfo={ this.receiverInfo = {
orderId:this.order.id, orderId: this.order.id,
receiverName:this.order.receiverName, receiverName: this.order.receiverName,
receiverPhone:this.order.receiverPhone, receiverPhone: this.order.receiverPhone,
receiverPostCode:this.order.receiverPostCode, receiverPostCode: this.order.receiverPostCode,
receiverDetailAddress:this.order.receiverDetailAddress, receiverDetailAddress: this.order.receiverDetailAddress,
receiverProvince:this.order.receiverProvince, receiverProvince: this.order.receiverProvince,
receiverCity:this.order.receiverCity, receiverCity: this.order.receiverCity,
receiverRegion:this.order.receiverRegion, receiverRegion: this.order.receiverRegion,
status:this.order.status status: this.order.status
} }
}, },
handleUpdateReceiverInfo(){ handleUpdateReceiverInfo() {
this.$confirm('是否要修改收货信息?', '提示', { this.$confirm('是否要修改收货信息?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
updateReceiverInfo(this.receiverInfo).then(response=>{ updateReceiverInfo(this.receiverInfo).then(response => {
this.receiverDialogVisible=false; this.receiverDialogVisible = false;
this.$message({ this.$message({
type: 'success', type: 'success',
message: '修改成功!' message: '修改成功!'
@ -586,21 +589,21 @@
}); });
}); });
}, },
showUpdateMoneyDialog(){ showUpdateMoneyDialog() {
this.moneyDialogVisible=true; this.moneyDialogVisible = true;
this.moneyInfo.orderId=this.order.id; this.moneyInfo.orderId = this.order.id;
this.moneyInfo.freightAmount=this.order.freightAmount; this.moneyInfo.freightAmount = this.order.freightAmount;
this.moneyInfo.discountAmount=this.order.discountAmount; this.moneyInfo.discountAmount = this.order.discountAmount;
this.moneyInfo.status=this.order.status; this.moneyInfo.status = this.order.status;
}, },
handleUpdateMoneyInfo(){ handleUpdateMoneyInfo() {
this.$confirm('是否要修改费用信息?', '提示', { this.$confirm('是否要修改费用信息?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
updateMoneyInfo(this.moneyInfo).then(response=>{ updateMoneyInfo(this.moneyInfo).then(response => {
this.moneyDialogVisible=false; this.moneyDialogVisible = false;
this.$message({ this.$message({
type: 'success', type: 'success',
message: '修改成功!' message: '修改成功!'
@ -611,40 +614,40 @@
}); });
}); });
}, },
showMessageDialog(){ showMessageDialog() {
this.messageDialogVisible=true; this.messageDialogVisible = true;
this.message.title=null; this.message.title = null;
this.message.content=null; this.message.content = null;
}, },
handleSendMessage(){ handleSendMessage() {
this.$confirm('是否要发送站内信?', '提示', { this.$confirm('是否要发送站内信?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.messageDialogVisible=false; this.messageDialogVisible = false;
this.$message({ this.$message({
type: 'success', type: 'success',
message: '发送成功!' message: '发送成功!'
}); });
}); });
}, },
showCloseOrderDialog(){ showCloseOrderDialog() {
this.closeDialogVisible=true; this.closeDialogVisible = true;
this.closeInfo.note=null; this.closeInfo.note = null;
this.closeInfo.id=this.id; this.closeInfo.id = this.id;
}, },
handleCloseOrder(){ handleCloseOrder() {
this.$confirm('是否要关闭?', '提示', { this.$confirm('是否要关闭?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
let params = new URLSearchParams(); let params = new URLSearchParams();
params.append("ids",[this.closeInfo.id]); params.append("ids", [this.closeInfo.id]);
params.append("note",this.closeInfo.note); params.append("note", this.closeInfo.note);
closeOrder(params).then(response=>{ closeOrder(params).then(response => {
this.closeDialogVisible=false; this.closeDialogVisible = false;
this.$message({ this.$message({
type: 'success', type: 'success',
message: '订单关闭成功!' message: '订单关闭成功!'
@ -655,23 +658,23 @@
}); });
}); });
}, },
showMarkOrderDialog(){ showMarkOrderDialog() {
this.markOrderDialogVisible=true; this.markOrderDialogVisible = true;
this.markInfo.id=this.id; this.markInfo.id = this.id;
this.closeOrder.note=null; this.closeOrder.note = null;
}, },
handleMarkOrder(){ handleMarkOrder() {
this.$confirm('是否要备注订单?', '提示', { this.$confirm('是否要备注订单?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
let params = new URLSearchParams(); let params = new URLSearchParams();
params.append("id",this.markInfo.id); params.append("id", this.markInfo.id);
params.append("note",this.markInfo.note); params.append("note", this.markInfo.note);
params.append("status",this.order.status); params.append("status", this.order.status);
updateOrderNote(params).then(response=>{ updateOrderNote(params).then(response => {
this.markOrderDialogVisible=false; this.markOrderDialogVisible = false;
this.$message({ this.$message({
type: 'success', type: 'success',
message: '订单备注成功!' message: '订单备注成功!'
@ -682,15 +685,15 @@
}); });
}); });
}, },
handleDeleteOrder(){ handleDeleteOrder() {
this.$confirm('是否要进行该删除操作?', '提示', { this.$confirm('是否要进行该删除操作?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
let params = new URLSearchParams(); let params = new URLSearchParams();
params.append("ids",[this.id]); params.append("ids", [this.id]);
deleteOrder(params).then(response=>{ deleteOrder(params).then(response => {
this.$message({ this.$message({
message: '删除成功!', message: '删除成功!',
type: 'success', type: 'success',
@ -700,8 +703,8 @@
}); });
}) })
}, },
showLogisticsDialog(){ showLogisticsDialog() {
this.logisticsDialogVisible=true; this.logisticsDialogVisible = true;
} }
} }
} }
@ -753,5 +756,3 @@
color: #303133; color: #303133;
} }
</style> </style>

Loading…
Cancel
Save