pull/6/head
dwj 7 months ago
parent d72f9a90fd
commit 7fea894a2f

@ -180,80 +180,292 @@
</el-row> </el-row>
</div> </div>
<div style="margin-top: 20px"> <div style="margin-top: 20px">
<!-- 使用 svg-icon 组件展示一个图标设置图标类名为 "marker"并指定图标颜色 -->
<svg-icon icon-class="marker" style="color: #606266"></svg-icon> <svg-icon icon-class="marker" style="color: #606266"></svg-icon>
<!-- 展示一段文本应用 "font-small" 类名用于设置较小字体样式文本内容为 "操作信息" -->
<span class="font-small">操作信息</span> <span class="font-small">操作信息</span>
</div> </div>
<!-- 使用 el-table 组件展示表格数据设置了一些样式属性引用以及绑定数据等 -->
<el-table style="margin-top: 20px;width: 100%" <el-table style="margin-top: 20px;width: 100%"
ref="orderHistoryTable" ref="orderHistoryTable"
:data="order.historyList" border> :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}}
</template> </template>
</el-table-column> </el-table-column>
<!-- 定义表格列展示 "操作时间" 信息设置列宽度文本对齐方式通过调用 formatTime 方法格式化时间后展示 -->
<el-table-column label="操作时间" width="160" align="center"> <el-table-column label="操作时间" width="160" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{formatTime(scope.row.createTime)}} {{formatTime(scope.row.createTime)}}
</template> </template>
</el-table-column> </el-table-column>
<!-- 定义表格列展示 "订单状态" 信息设置列宽度文本对齐方式通过管道符调用 formatStatus 过滤器对状态进行格式化后展示 -->
<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.orderStatus | formatStatus}} {{scope.row.orderStatus | formatStatus}}
</template> </template>
</el-table-column> </el-table-column>
<!-- 定义表格列展示 "付款状态" 信息设置列宽度文本对齐方式通过管道符调用 formatPayStatus 过滤器对付款状态进行格式化后展示 -->
<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.orderStatus | formatPayStatus}} {{scope.row.orderStatus | formatPayStatus}}
</template> </template>
</el-table-column> </el-table-column>
<!-- 定义表格列展示 "发货状态" 信息设置列宽度文本对齐方式通过管道符调用 formatDeliverStatus 过滤器对发货状态进行格式化后展示 -->
<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.orderStatus | formatDeliverStatus}} {{scope.row.orderStatus | formatDeliverStatus}}
</template> </template>
</el-table-column> </el-table-column>
<!-- 定义表格列展示 "备注" 信息设置文本对齐方式通过插槽作用域获取对应行的备注数据展示 -->
<el-table-column label="备注" align="center"> <el-table-column label="备注" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{scope.row.note}} {{scope.row.note}}
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!-- 使用 el-card 组件包裹内容此处 el-card 结束标签在后面代码中未完整展示但推测是用于布局和样式统一等作用 -->
<el-card>
<!-- el-dialog 组件用于创建一个对话框用于修改收货人信息设置对话框标题绑定可见性以及宽度等属性 -->
<el-dialog title="修改收货人信息"
:visible.sync="receiverDialogVisible"
width="40%">
<!-- el-form 组件用于创建表单绑定数据模型为 receiverInfo设置表单引用以及标签宽度等属性 -->
<el-form :model="receiverInfo"
ref="receiverInfoForm"
label-width="150px">
<!-- el-form-item 组件用于定义表单中的一项此处展示 "收货人姓名" 输入框 -->
<el-form-item label="收货人姓名:">
<el-input v-model="receiverInfo.receiverName" style="width: 200px"></el-input>
</el-form-item>
<!-- 类似上述展示 "手机号码" 输入框 -->
<el-form-item label="手机号码:">
<el-input v-model="receiverInfo.receiverPhone" style="width: 200px">
</el-input>
</el-form-item>
<!-- 展示 "邮政编码" 输入框 -->
<el-form-item label="邮政编码:">
<el-input v-model="receiverInfo.receiverPostCode" style="width: 200px">
</el-input>
</el-form-item>
<!-- 使用 v-distpicker 组件可能是用于地区选择的第三方组件绑定省份城市地区数据并监听 selected 事件 -->
<el-form-item label="所在区域:">
<v-distpicker :province="receiverInfo.receiverProvince"
:city="receiverInfo.receiverCity"
:area="receiverInfo.receiverRegion"
@selected="onSelectRegion"></v-distpicker>
</el-form-item>
<!-- 展示 "详细地址" 输入框设置为文本域类型指定行数 -->
<el-form-item label="详细地址:">
<el-input v-model="receiverInfo.receiverDetailAddress" type="textarea" rows="3">
</el-input>
</el-form-item>
</el-form>
<!-- 在对话框的 footer 插槽中定义两个按钮一个用于取消点击隐藏对话框一个用于确定点击调用 handleUpdateReceiverInfo 方法 -->
<span slot="footer" class="dialog-footer">
<el-button @click="receiverDialogVisible = false"> </el-button>
<el-button type="primary" @click="handleUpdateReceiverInfo"> </el-button>
</span>
</el-dialog>
<!-- 另一个 el-dialog 组件用于修改费用信息同样设置标题可见性绑定和宽度等属性 -->
<el-dialog title="修改费用信息"
:visible.sync="moneyDialogVisible"
width="40%">
<!-- 内部使用类名为 "table-layout" div 进行布局通过多个 el-row el-col 组合展示费用相关信息表格形式 -->
<div class="table-layout">
<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-row>
<el-row>
<el-col :span="6" class="table-cell">{{order.totalAmount}}</el-col>
<el-col :span="6" class="table-cell">
<el-input v-model.number="moneyInfo.freightAmount" size="mini"><template slot="prepend"></template></el-input>
</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-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-row>
<el-row>
<el-col :span="6" class="table-cell">-{{order.promotionAmount}}</el-col>
<el-col :span="6" class="table-cell">
<el-input v-model.number="moneyInfo.discountAmount" size="mini"><template slot="prepend">-</template></el-input>
</el-col>
<el-col :span="6" class="table-cell">
<span class="color-danger">{{order.totalAmount+moneyInfo.freightAmount}}</span>
</el-col>
<el-col :span="6" class="table-cell">
<span class="color-danger">{{order.payAmount+moneyInfo.freightAmount-moneyInfo.discountAmount}}</span>
</el-col>
</el-row>
</div>
<!-- 在对话框的 footer 插槽中同样定义取消和确定按钮确定按钮点击调用 handleUpdateMoneyInfo 方法 -->
<span slot="footer" class="dialog-footer">
<el-button @click="moneyDialogVisible = false"> </el-button>
<el-button type="primary" @click="handleUpdateMoneyInfo"> </el-button>
</span>
</el-dialog>
<!-- el-dialog 组件用于发送站内信设置相关属性 -->
<el-dialog title="发送站内信"
:visible.sync="messageDialogVisible"
width="40%">
<el-form :model="message"
ref="receiverInfoForm"
label-width="150px">
<el-form-item label="标题:">
<el-input v-model="message.title" style="width: 200px"></el-input>
</el-form-item>
<el-form-item label="内容:">
<el-input v-model="message.content" type="textarea" rows="3">
</el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="messageDialogVisible = false"> </el-button>
<el-button type="primary" @click="handleSendMessage"> </el-button>
</span>
</el-dialog>
<!-- el-dialog 组件用于关闭订单设置相关属性 -->
<el-dialog title="关闭订单"
:visible.sync="closeDialogVisible"
width="40%">
<el-form :model="closeInfo"
label-width="150px">
<el-form-item label="操作备注:">
<el-input v-model="closeInfo.note" type="textarea" rows="3">
</el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="closeDialogVisible = false"> </el-button>
<el-button type="primary" @click="handleCloseOrder"> </el-button>
</span>
</el-dialog>
<!-- el-dialog 组件用于备注订单设置相关属性 -->
<el-dialog title="备注订单"
:visible.sync="markOrderDialogVisible"
width="40%">
<el-form :model="markInfo"
label-width="150px">
<el-form-item label="操作备注:">
<el-input v-model="markInfo.note" type="textarea" rows="3">
</el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="markOrderDialogVisible = false"> </el-button>
<el-button type="primary" @click="handleMarkOrder"> </el-button>
</span>
</el-dialog>
<!-- 使用 logistics-dialog 组件自定义组件双向绑定 visible 属性推测用于控制显示隐藏 -->
<logistics-dialog v-model="logisticsDialogVisible"></logistics-dialog>
</el-card> </el-card>
</div>
</template>
<div style="margin-top: 20px">
<!-- 使用 svg-icon 组件展示一个图标设置图标类名为 "marker"并指定图标颜色 -->
<svg-icon icon-class="marker" style="color: #606266"></svg-icon>
<!-- 展示一段文本应用 "font-small" 类名用于设置较小字体样式文本内容为 "操作信息" -->
<span class="font-small">操作信息</span>
</div>
<!-- 使用 el-table 组件展示表格数据设置了一些样式属性引用以及绑定数据等 -->
<el-table style="margin-top: 20px;width: 100%"
ref="orderHistoryTable"
:data="order.historyList" border>
<!-- 定义表格列展示 "操作者" 信息设置列宽度文本对齐方式并通过插槽作用域获取对应行数据展示 -->
<el-table-column label="操作者" width="120" align="center">
<template slot-scope="scope">
{{scope.row.operateMan}}
</template>
</el-table-column>
<!-- 定义表格列展示 "操作时间" 信息设置列宽度文本对齐方式通过调用 formatTime 方法格式化时间后展示 -->
<el-table-column label="操作时间" width="160" align="center">
<template slot-scope="scope">
{{formatTime(scope.row.createTime)}}
</template>
</el-table-column>
<!-- 定义表格列展示 "订单状态" 信息设置列宽度文本对齐方式通过管道符调用 formatStatus 过滤器对状态进行格式化后展示 -->
<el-table-column label="订单状态" width="120" align="center">
<template slot-scope="scope">
{{scope.row.orderStatus | formatStatus}}
</template>
</el-table-column>
<!-- 定义表格列展示 "付款状态" 信息设置列宽度文本对齐方式通过管道符调用 formatPayStatus 过滤器对付款状态进行格式化后展示 -->
<el-table-column label="付款状态" width="120" align="center">
<template slot-scope="scope">
{{scope.row.orderStatus | formatPayStatus}}
</template>
</el-table-column>
<!-- 定义表格列展示 "发货状态" 信息设置列宽度文本对齐方式通过管道符调用 formatDeliverStatus 过滤器对发货状态进行格式化后展示 -->
<el-table-column label="发货状态" width="120" align="center">
<template slot-scope="scope">
{{scope.row.orderStatus | formatDeliverStatus}}
</template>
</el-table-column>
<!-- 定义表格列展示 "备注" 信息设置文本对齐方式通过插槽作用域获取对应行的备注数据展示 -->
<el-table-column label="备注" align="center">
<template slot-scope="scope">
{{scope.row.note}}
</template>
</el-table-column>
</el-table>
<!-- 使用 el-card 组件包裹内容此处 el-card 结束标签在后面代码中未完整展示但推测是用于布局和样式统一等作用 -->
<el-card>
<!-- el-dialog 组件用于创建一个对话框用于修改收货人信息设置对话框标题绑定可见性以及宽度等属性 -->
<el-dialog title="修改收货人信息" <el-dialog title="修改收货人信息"
:visible.sync="receiverDialogVisible" :visible.sync="receiverDialogVisible"
width="40%"> width="40%">
<!-- el-form 组件用于创建表单绑定数据模型为 receiverInfo设置表单引用以及标签宽度等属性 -->
<el-form :model="receiverInfo" <el-form :model="receiverInfo"
ref="receiverInfoForm" ref="receiverInfoForm"
label-width="150px"> label-width="150px">
<!-- el-form-item 组件用于定义表单中的一项此处展示 "收货人姓名" 输入框 -->
<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>
<!-- 类似上述展示 "手机号码" 输入框 -->
<el-form-item label="手机号码:"> <el-form-item label="手机号码:">
<el-input v-model="receiverInfo.receiverPhone" style="width: 200px"> <el-input v-model="receiverInfo.receiverPhone" style="width: 200px">
</el-input> </el-input>
</el-form-item> </el-form-item>
<!-- 展示 "邮政编码" 输入框 -->
<el-form-item label="邮政编码:"> <el-form-item label="邮政编码:">
<el-input v-model="receiverInfo.receiverPostCode" style="width: 200px"> <el-input v-model="receiverInfo.receiverPostCode" style="width: 200px">
</el-input> </el-input>
</el-form-item> </el-form-item>
<!-- 使用 v-distpicker 组件可能是用于地区选择的第三方组件绑定省份城市地区数据并监听 selected 事件 -->
<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" :area="receiverInfo.receiverRegion"
@selected="onSelectRegion"></v-distpicker> @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">
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 在对话框的 footer 插槽中定义两个按钮一个用于取消点击隐藏对话框一个用于确定点击调用 handleUpdateReceiverInfo 方法 -->
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="receiverDialogVisible = false"> </el-button> <el-button @click="receiverDialogVisible = false"> </el-button>
<el-button type="primary" @click="handleUpdateReceiverInfo"> </el-button> <el-button type="primary" @click="handleUpdateReceiverInfo"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 另一个 el-dialog 组件用于修改费用信息同样设置标题可见性绑定和宽度等属性 -->
<el-dialog title="修改费用信息" <el-dialog title="修改费用信息"
:visible.sync="moneyDialogVisible" :visible.sync="moneyDialogVisible"
width="40%"> width="40%">
<!-- 内部使用类名为 "table-layout" div 进行布局通过多个 el-row el-col 组合展示费用相关信息表格形式 -->
<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>
@ -288,11 +500,13 @@
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<!-- 在对话框的 footer 插槽中同样定义取消和确定按钮确定按钮点击调用 handleUpdateMoneyInfo 方法 -->
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="moneyDialogVisible = false"> </el-button> <el-button @click="moneyDialogVisible = false"> </el-button>
<el-button type="primary" @click="handleUpdateMoneyInfo"> </el-button> <el-button type="primary" @click="handleUpdateMoneyInfo"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- el-dialog 组件用于发送站内信设置相关属性 -->
<el-dialog title="发送站内信" <el-dialog title="发送站内信"
:visible.sync="messageDialogVisible" :visible.sync="messageDialogVisible"
width="40%"> width="40%">
@ -312,6 +526,7 @@
<el-button type="primary" @click="handleSendMessage"> </el-button> <el-button type="primary" @click="handleSendMessage"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- el-dialog 组件用于关闭订单设置相关属性 -->
<el-dialog title="关闭订单" <el-dialog title="关闭订单"
:visible.sync="closeDialogVisible" :visible.sync="closeDialogVisible"
width="40%"> width="40%">
@ -327,6 +542,7 @@
<el-button type="primary" @click="handleCloseOrder"> </el-button> <el-button type="primary" @click="handleCloseOrder"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- el-dialog 组件用于备注订单设置相关属性 -->
<el-dialog title="备注订单" <el-dialog title="备注订单"
:visible.sync="markOrderDialogVisible" :visible.sync="markOrderDialogVisible"
width="40%"> width="40%">
@ -342,177 +558,19 @@
<el-button type="primary" @click="handleMarkOrder"> </el-button> <el-button type="primary" @click="handleMarkOrder"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 使用 logistics-dialog 组件自定义组件双向绑定 visible 属性推测用于控制显示隐藏 -->
<logistics-dialog v-model="logisticsDialogVisible"></logistics-dialog> <logistics-dialog v-model="logisticsDialogVisible"></logistics-dialog>
</el-card>
</div> </div>
</template> </template>
<script> <script>
import {getOrderDetail,updateReceiverInfo,updateMoneyInfo,closeOrder,updateOrderNote,deleteOrder} from '@/api/order'; {
import LogisticsDialog from '@/views/oms/order/components/logisticsDialog'; // Vue
import {formatDate} from '@/utils/date';
import VDistpicker from 'v-distpicker';
const defaultReceiverInfo = {
orderId:null,
receiverName:null,
receiverPhone:null,
receiverPostCode:null,
receiverDetailAddress:null,
receiverProvince:null,
receiverCity:null,
receiverRegion:null,
status:null
};
export default {
name: 'orderDetail',
components: { VDistpicker, LogisticsDialog},
data() {
return {
id: null,
order: {},
receiverDialogVisible:false,
receiverInfo:Object.assign({},defaultReceiverInfo),
moneyDialogVisible:false,
moneyInfo:{orderId:null, freightAmount:0, discountAmount:0,status:null},
messageDialogVisible:false,
message: {title:null, content:null},
closeDialogVisible:false,
closeInfo:{note:null,id:null},
markOrderDialogVisible:false,
markInfo:{note:null},
logisticsDialogVisible:false
}
},
created() {
this.id = this.list = this.$route.query.id;
getOrderDetail(this.id).then(response => {
this.order = response.data;
});
},
filters: {
formatNull(value) {
if(value===undefined||value===null||value===''){
return '暂无';
}else{
return value;
}
},
formatLongText(value) {
if(value===undefined||value===null||value===''){
return '暂无';
}else if(value.length>8){
return value.substr(0, 8) + '...';
}else{
return value;
}
},
formatPayType(value) {
if (value === 1) {
return '支付宝';
} else if (value === 2) {
return '微信';
} else {
return '未支付';
}
},
formatSourceType(value) {
if (value === 1) {
return 'APP订单';
} else {
return 'PC订单';
}
},
formatOrderType(value) {
if (value === 1) {
return '秒杀订单';
} else {
return '正常订单';
}
},
formatAddress(order) {
let str = order.receiverProvince;
if (order.receiverCity != null) {
str += " " + order.receiverCity;
}
str += " " + order.receiverRegion;
str += " " + order.receiverDetailAddress;
return str;
},
formatStatus(value) {
if (value === 1) {
return '待发货';
} else if (value === 2) {
return '已发货';
} else if (value === 3) {
return '已完成';
} else if (value === 4) {
return '已关闭';
} else if (value === 5) {
return '无效订单';
} else {
return '待付款';
}
},
formatPayStatus(value) {
if (value === 0) {
return '未支付';
} else if(value===4){
return '已退款';
}else{
return '已支付';
}
},
formatDeliverStatus(value) {
if (value === 0||value === 1) {
return '未发货';
} else {
return '已发货';
}
},
formatProductAttr(value){
if(value==null){
return '';
}else{
let attr = JSON.parse(value);
let result='';
for(let i=0;i<attr.length;i++){
result+=attr[i].key;
result+=":";
result+=attr[i].value;
result+=";";
}
return result;
}
}
},
methods: {
onSelectRegion(data){
this.receiverInfo.receiverProvince=data.province.value;
this.receiverInfo.receiverCity=data.city.value;
this.receiverInfo.receiverRegion=data.area.value;
},
formatTime(time) {
if (time == null || time === '') {
return '';
}
let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
},
formatStepStatus(value) {
if (value === 1) {
//
return 2;
} else if (value === 2) {
//
return 3;
} else if (value === 3) {
//
return 4;
}else {
//
return 1;
}
},
showUpdateReceiverDialog() { showUpdateReceiverDialog() {
// receiverDialogVisible true
this.receiverDialogVisible = true; this.receiverDialogVisible = true;
// receiverInfo this.order
this.receiverInfo = { this.receiverInfo = {
orderId: this.order.id, orderId: this.order.id,
receiverName: this.order.receiverName, receiverName: this.order.receiverName,
@ -526,17 +584,24 @@
} }
}, },
handleUpdateReceiverInfo() { handleUpdateReceiverInfo() {
//
this.$confirm('是否要修改收货信息?', '提示', { this.$confirm('是否要修改收货信息?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
// updateReceiverInfo receiverInfo
// then
updateReceiverInfo(this.receiverInfo).then(response => { updateReceiverInfo(this.receiverInfo).then(response => {
// receiverDialogVisible false
this.receiverDialogVisible = false; this.receiverDialogVisible = false;
//
this.$message({ this.$message({
type: 'success', type: 'success',
message: '修改成功!' message: '修改成功!'
}); });
// getOrderDetail id
// this.order
getOrderDetail(this.id).then(response => { getOrderDetail(this.id).then(response => {
this.order = response.data; this.order = response.data;
}); });
@ -544,24 +609,35 @@
}); });
}, },
showUpdateMoneyDialog() { showUpdateMoneyDialog() {
// moneyDialogVisible true
this.moneyDialogVisible = true; this.moneyDialogVisible = true;
// moneyInfo orderId id
this.moneyInfo.orderId = this.order.id; this.moneyInfo.orderId = this.order.id;
// moneyInfo freightAmount
this.moneyInfo.freightAmount = this.order.freightAmount; this.moneyInfo.freightAmount = this.order.freightAmount;
// moneyInfo discountAmount
this.moneyInfo.discountAmount = this.order.discountAmount; this.moneyInfo.discountAmount = this.order.discountAmount;
// moneyInfo status
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 moneyInfo
// then
updateMoneyInfo(this.moneyInfo).then(response => { updateMoneyInfo(this.moneyInfo).then(response => {
// moneyDialogVisible false
this.moneyDialogVisible = false; this.moneyDialogVisible = false;
//
this.$message({ this.$message({
type: 'success', type: 'success',
message: '修改成功!' message: '修改成功!'
}); });
// getOrderDetail this.order
getOrderDetail(this.id).then(response => { getOrderDetail(this.id).then(response => {
this.order = response.data; this.order = response.data;
}); });
@ -569,17 +645,23 @@
}); });
}, },
showMessageDialog() { showMessageDialog() {
// messageDialogVisible true
this.messageDialogVisible = true; this.messageDialogVisible = true;
// message title null
this.message.title = null; this.message.title = null;
// message content 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(() => {
// messageDialogVisible false
this.messageDialogVisible = false; this.messageDialogVisible = false;
//
this.$message({ this.$message({
type: 'success', type: 'success',
message: '发送成功!' message: '发送成功!'
@ -587,25 +669,37 @@
}); });
}, },
showCloseOrderDialog() { showCloseOrderDialog() {
// closeDialogVisible true
this.closeDialogVisible = true; this.closeDialogVisible = true;
// closeInfo note null
this.closeInfo.note = null; this.closeInfo.note = null;
// closeInfo id id id
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(() => {
// URLSearchParams
let params = new URLSearchParams(); let params = new URLSearchParams();
// params "ids" id
params.append("ids", [this.closeInfo.id]); params.append("ids", [this.closeInfo.id]);
// params "note" closeInfo note
params.append("note", this.closeInfo.note); params.append("note", this.closeInfo.note);
// closeOrder
// then
closeOrder(params).then(response => { closeOrder(params).then(response => {
// closeDialogVisible false
this.closeDialogVisible = false; this.closeDialogVisible = false;
//
this.$message({ this.$message({
type: 'success', type: 'success',
message: '订单关闭成功!' message: '订单关闭成功!'
}); });
// getOrderDetail this.order
getOrderDetail(this.id).then(response => { getOrderDetail(this.id).then(response => {
this.order = response.data; this.order = response.data;
}); });
@ -613,26 +707,39 @@
}); });
}, },
showMarkOrderDialog() { showMarkOrderDialog() {
// markOrderDialogVisible true
this.markOrderDialogVisible = true; this.markOrderDialogVisible = true;
// markInfo id id
this.markInfo.id = this.id; this.markInfo.id = this.id;
// closeOrder markInfo note null
this.closeOrder.note = null; this.closeOrder.note = null;
}, },
handleMarkOrder() { handleMarkOrder() {
//
this.$confirm('是否要备注订单?', '提示', { this.$confirm('是否要备注订单?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
// URLSearchParams
let params = new URLSearchParams(); let params = new URLSearchParams();
// params "id" markInfo id id
params.append("id", this.markInfo.id); params.append("id", this.markInfo.id);
// params "note" markInfo note
params.append("note", this.markInfo.note); params.append("note", this.markInfo.note);
// params "status"
params.append("status", this.order.status); params.append("status", this.order.status);
// updateOrderNote
// then
updateOrderNote(params).then(response => { updateOrderNote(params).then(response => {
// markOrderDialogVisible false
this.markOrderDialogVisible = false; this.markOrderDialogVisible = false;
//
this.$message({ this.$message({
type: 'success', type: 'success',
message: '订单备注成功!' message: '订单备注成功!'
}); });
// getOrderDetail this.order
getOrderDetail(this.id).then(response => { getOrderDetail(this.id).then(response => {
this.order = response.data; this.order = response.data;
}); });
@ -640,75 +747,114 @@
}); });
}, },
handleDeleteOrder() { handleDeleteOrder() {
//
this.$confirm('是否要进行该删除操作?', '提示', { this.$confirm('是否要进行该删除操作?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
// URLSearchParams
let params = new URLSearchParams(); let params = new URLSearchParams();
// params "ids" id id
params.append("ids", [this.id]); params.append("ids", [this.id]);
// deleteOrder
// then
deleteOrder(params).then(response => { deleteOrder(params).then(response => {
// 1000 1
this.$message({ this.$message({
message: '删除成功!', message: '删除成功!',
type: 'success', type: 'success',
duration: 1000 duration: 1000
}); });
// 使this.$router
this.$router.back(); this.$router.back();
}); });
}) })
}, },
showLogisticsDialog() { showLogisticsDialog() {
// logisticsDialogVisible true
this.logisticsDialogVisible = true; this.logisticsDialogVisible = true;
} }
} }
}
</script> </script>
<style scoped> <style scoped>
/* 定义类名为 detail-container 的样式规则,用于设置某个容器的样式 */
.detail-container { .detail-container {
/* 设置宽度为页面宽度的 80% */
width: 80%; width: 80%;
/* 设置内边距,上下左右均为 20 像素 */
padding: 20px 20px 20px 20px; padding: 20px 20px 20px 20px;
/* 设置外边距,上下为 20 像素,左右自动居中 */
margin: 20px auto; margin: 20px auto;
} }
/* 定义类名为 operate-container 的样式规则,用于设置操作相关容器的样式 */
.operate-container { .operate-container {
/* 设置背景颜色 */
background: #F2F6FC; background: #F2F6FC;
/* 设置高度为 80 像素 */
height: 80px; height: 80px;
/* 设置外边距,上外边距为 -20 像素,左右外边距为 -20 像素,下外边距为 0 像素 */
margin: -20px -20px 0; margin: -20px -20px 0;
/* 设置行高为 80 像素,用于垂直居中内容 */
line-height: 80px; line-height: 80px;
} }
/* 定义类名为 operate-button-container 的样式规则,用于设置操作按钮容器的样式 */
.operate-button-container { .operate-button-container {
/* 让容器向右浮动 */
float: right; float: right;
/* 设置右外边距为 20 像素 */
margin-right: 20px margin-right: 20px
} }
/* 定义类名为 table-layout 的样式规则,可能用于设置表格布局相关的样式 */
.table-layout { .table-layout {
/* 设置上外边距为 20 像素 */
margin-top: 20px; margin-top: 20px;
/* 设置左边框样式,为 1 像素宽的实线,颜色为 #DCDFE6 */
border-left: 1px solid #DCDFE6; border-left: 1px solid #DCDFE6;
/* 设置上边框样式,为 1 像素宽的实线,颜色为 #DCDFE6 */
border-top: 1px solid #DCDFE6; border-top: 1px solid #DCDFE6;
} }
/* 定义类名为 table-cell 的样式规则,可能用于设置表格单元格的样式 */
.table-cell { .table-cell {
/* 设置高度为 60 像素 */
height: 60px; height: 60px;
/* 设置行高为 40 像素,用于控制单元格内文本的垂直对齐等 */
line-height: 40px; line-height: 40px;
/* 设置右边框样式,为 1 像素宽的实线,颜色为 #DCDFE6 */
border-right: 1px solid #DCDFE6; border-right: 1px solid #DCDFE6;
/* 设置下边框样式,为 1 像素宽的实线,颜色为 #DCDFE6 */
border-bottom: 1px solid #DCDFE6; border-bottom: 1px solid #DCDFE6;
/* 设置内边距为 10 像素 */
padding: 10px; padding: 10px;
/* 设置字体大小为 14 像素 */
font-size: 14px; font-size: 14px;
/* 设置字体颜色 */
color: #606266; color: #606266;
/* 设置文本水平居中 */
text-align: center; text-align: center;
/* 当内容超出单元格范围时,隐藏超出部分 */
overflow: hidden; overflow: hidden;
} }
/* 定义类名为 table-cell-title 的样式规则,可能用于设置表格标题单元格的样式 */
.table-cell-title { .table-cell-title {
/* 设置右边框样式,为 1 像素宽的实线,颜色为 #DCDFE6 */
border-right: 1px solid #DCDFE6; border-right: 1px solid #DCDFE6;
/* 设置下边框样式,为 1 像素宽的实线,颜色为 #DCDFE6 */
border-bottom: 1px solid #DCDFE6; border-bottom: 1px solid #DCDFE6;
/* 设置内边距为 10 像素 */
padding: 10px; padding: 10px;
/* 设置背景颜色 */
background: #F2F6FC; background: #F2F6FC;
/* 设置文本水平居中 */
text-align: center; text-align: center;
/* 设置字体大小为 14 像素 */
font-size: 14px; font-size: 14px;
/* 设置字体颜色 */
color: #303133; color: #303133;
} }
</style> </style>

Loading…
Cancel
Save