pull/7/head
dwj 3 months ago
parent 3f3d382407
commit c93faf8e2d

@ -1,28 +1,40 @@
<template> 
<template>
<!-- 创建一个类名为 "app-container" div 作为整体页面的容器 -->
<div class="app-container">
<!-- 使用 el-card 组件创建一个卡片式容器设置类名为 "operate-container" 并取消阴影效果用于展示页面相关标题 -->
<el-card class="operate-container" shadow="never">
<!-- 使用一个图标元素el-icon-tickets展示一个图标 -->
<i class="el-icon-tickets"></i>
<!-- 展示一段文本内容为 "发货列表"用于表明该页面主要展示的内容 -->
<span>发货列表</span>
</el-card>
<!-- 创建一个类名为 "table-container" div用于放置展示发货相关信息的表格以及操作按钮等内容 -->
<div class="table-container">
<!-- el-table 组件创建一个表格设置引用名称宽度以及绑定数据等属性同时设置表格显示边框 -->
<el-table ref="deliverOrderTable"
style="width: 100%;"
:data="list" border>
<!-- 定义表格列用于展示订单编号信息设置宽度和文本对齐方式通过插槽作用域获取对应行数据中的订单编号并展示 -->
<el-table-column label="订单编号" width="180" align="center">
<template slot-scope="scope">{{scope.row.orderSn}}</template>
</el-table-column>
<!-- 定义表格列用于展示收货人信息设置宽度和文本对齐方式通过插槽作用域获取对应行数据中的收货人姓名并展示 -->
<el-table-column label="收货人" width="180" align="center">
<template slot-scope="scope">{{scope.row.receiverName}}</template>
</el-table-column>
<!-- 定义表格列用于展示手机号码信息设置宽度和文本对齐方式通过插槽作用域获取对应行数据中的手机号码并展示 -->
<el-table-column label="手机号码" width="160" align="center">
<template slot-scope="scope">{{scope.row.receiverPhone}}</template>
</el-table-column>
<!-- 定义表格列用于展示邮政编码信息设置宽度和文本对齐方式通过插槽作用域获取对应行数据中的邮政编码并展示 -->
<el-table-column label="邮政编码" width="160" align="center">
<template slot-scope="scope">{{scope.row.receiverPostCode}}</template>
</el-table-column>
<!-- 定义表格列用于展示收货地址信息设置文本对齐方式通过插槽作用域获取对应行数据中的收货地址并展示 -->
<el-table-column label="收货地址" align="center">
<template slot-scope="scope">{{scope.row.address}}</template>
</el-table-column>
<!-- 定义表格列用于展示配送方式信息通过插槽作用域在每个单元格内创建一个下拉选择框用于选择物流公司绑定对应行数据中的 deliveryCompany 属性设置占位提示文本和小尺寸样式通过循环 companyOptions 数据动态生成下拉选项 -->
<el-table-column label="配送方式" width="160" align="center">
<template slot-scope="scope">
<el-select placeholder="请选择物流公司"
@ -36,47 +48,67 @@
</el-select>
</template>
</el-table-column>
<!-- 定义表格列用于展示物流单号信息通过插槽作用域在每个单元格内创建一个小尺寸的输入框双向绑定对应行数据中的 deliverySn 属性用于输入物流单号 -->
<el-table-column label="物流单号" width="180" align="center">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.deliverySn"></el-input>
</template>
</el-table-column>
</el-table>
<!-- 创建一个 div设置上边距文本居中对齐用于放置操作按钮 -->
<div style="margin-top: 15px;text-align: center">
<!-- el-button 组件创建一个按钮点击时调用 "cancel" 方法按钮文本为 "取消" -->
<el-button @click="cancel"></el-button>
<!-- el-button 组件创建一个按钮点击时调用 "confirm" 方法按钮类型设置为 "primary"通常表示主要操作按钮样式上可能会突出显示按钮文本为 "确定" -->
<el-button @click="confirm" type="primary">确定</el-button>
</div>
</div>
</div>
</template>
<script>
import {deliveryOrder} from '@/api/order'
// '@/api/order' deliveryOrder
import {deliveryOrder} from '@/api/order';
//
const defaultLogisticsCompanies = ["顺丰快递", "圆通快递", "中通快递", "韵达快递"];
// Vue
export default {
// Vue "deliverOrderList"
name: 'deliverOrderList',
data() {
return {
//
list: [],
// defaultLogisticsCompanies
companyOptions: defaultLogisticsCompanies
}
},
created() {
// this.$route.query "list" list
this.list = this.$route.query.list;
//list
// list list
if (this.list instanceof Array === false) {
this.list = [];
}
},
methods: {
// "cancel" Vue this.$router back
cancel() {
this.$router.back();
},
}
// "confirm"
confirm() {
// 使 $confirm "warning"
this.$confirm('是否要进行发货操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
// "" "deliveryOrder" list
// then Vue this.$router back 使 $message "!"
deliveryOrder(this.list).then(response => {
this.$router.back();
this.$message({
@ -85,6 +117,7 @@
});
});
}).catch(() => {
// "" catch 使 $message ""
this.$message({
type: 'info',
message: '已取消发货'
@ -95,5 +128,3 @@
}
</script>
<style></style>

Loading…
Cancel
Save