文件
mashangyoujiu/Application/Retail/View/Express/see_logistics.html

209 行
8.4 KiB
HTML
可执行文件

<!doctype html>
<html>
<!--[1.7.90]-->
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/vue/element-ui.2.8.2.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/vue/element-ui.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Retail/css/myscroll.css" />
<title>物流信息</title>
<style>
[v-cloak] {
display: none;
}
.el-card .el-form-item {
margin-bottom: 0;
}
.el-select {
width: 100%;
}
</style>
</head>
<body>
<div id="app" v-cloak>
<el-card class="box-card" style="margin: 20px 40px">
<div slot="header" class="clearfix">
<span>物流详情</span>
<el-button style="float: right;" type="danger" size="mini" @click="modifyLogisticsDialog = true">修改物流
</el-button>
</div>
<div>
<el-form label-width="100px" size="mini">
<el-form-item label="订单编号">{{logistics.order_no}}</el-form-item>
<el-form-item label="物流公司">{{logistics.express_name}}</el-form-item>
<el-form-item label="物流单号">{{logistics.nu}}</el-form-item>
</el-form>
</div>
</el-card>
<el-card class="box-card" style="margin: 20px 40px">
<div slot="header" class="clearfix">
<span>收货人信息</span>
</div>
<div>
<el-form label-width="100px" size="mini">
<el-form-item label="姓名">{{logistics.receiving_name}}</el-form-item>
<el-form-item label="电话">{{logistics.receiving_phone}}</el-form-item>
<el-form-item label="地址">{{logistics.receiving_address}}</el-form-item>
</el-form>
</div>
</el-card>
<el-timeline v-if="logistics.data && logistics.data.length" style="margin-right: 40px">
<template v-for="(item,index) in logistics.data">
<el-timeline-item :timestamp="item.ftime" :color="index==0?'#409EFF':'#E4E7ED'" placement="top">
<el-card>
<p :style="index==0?'color:#333':'color:#999'">{{item.context}}</p>
</el-card>
</el-timeline-item>
</template>
</el-timeline>
<p style="padding-left: 40px;" v-else>暂无物流信息</p>
<el-dialog title="选择物流" :visible.sync="modifyLogisticsDialog" width="500px">
<el-form label-width="100px">
<el-form-item label="选择物流">
<el-select v-model="logisticsIndex" placeholder="请选择物流公司" v-load-more="getExpress" clearable
filterable remote :remote-method="searchExpress" @change="changeExpress">
<el-option v-for="(item,index) in expressList" :label="item.kd_name" :key="item.kd_com"
:value="index"></el-option>
</el-select>
</el-form-item>
<el-form-item label="快递单号">
<el-input v-model="express_no" placeholder="请填写快递单号(或用扫码枪扫描条码)">
</el-input>
</el-form-item>
</el-form>
<el-button style="margin-left:100px" @click="confirmChange" type="primary">确认修改
</el-button>
</el-dialog>
</div>
</body>
<script type="text/javascript" src="__PUBLIC__/jquery/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/vue/js/vue2.5.16.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/vue/element-ui.2.8.2.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/js/common.js"></script>
<script>
var app = new Vue({
el: '#app',
data: {
express_no: '',//直接填写快递单号
expressList: [],//快递公司列表
express_page: 0,//快递列表分页
canLoad: true,//是否可以加载
direct_express: {},//直接填写的物流公司
express_keyword: '',//快递公司搜索关键词
bill_id: "{$bill_id}",//bill订单表id
logistics: {$logistics},
modifyLogisticsDialog: false, //修改物流弹窗
logisticsIndex: '' //物流索引
},
methods: {
//提交修改
confirmChange() {
this.$confirm('确认要修改物流,修改后将无法恢复?', '提示', {
type: 'warning'
}).then(() => {
this.sendRequest('Retail/Express/expressNoSave', {
data: {
id: getUrlParam('id'),
expressNo: this.express_no,
expressName: this.direct_express.kd_name,
expressCode: this.direct_express.kd_com
},
success: (response) => {
if (response.status == 1) {
this.$message.success({
message: response.message,
duration: 1000,
onClose: () => {
location.reload()
}
})
} else {
this.$message.error(response.message)
}
}
})
this.modifyLogisticsDialog = false
})
},
//搜索快递公司
searchExpress: function (value) {
this.express_page = 0;
this.express_keyword = value;
this.canLoad = true;
this.getExpress();
},
//直接填写单号选择快递公司
changeExpress(index) {
this.direct_express = JSON.parse(JSON.stringify(this.expressList[index]));
this.logisticsIndex = index
},
// 获取快递公司列表
getExpress() {
if (!this.canLoad) {
return;
}
this.canLoad = false;
var that = this;
var page = this.express_page + 1;
sendRequest({
url: "{:U('getExpress')}",
data: {
page: page,
keyword: that.express_keyword,
},
success: function (res) {
if (res.status == 1) {
if (page != 1) {
that.expressList.push.apply(that.expressList, res.data);
} else {
that.expressList = res.data;
}
that.express_page = page;
that.$nextTick(function () {
if (res.data.length) {
that.canLoad = true;
}
})
}
}
})
},
},
created() {
this.getExpress()
}
});
function sendRequest(options) {
$.ajax({
url: options.url,
data: options.data,
type: 'post',
success: function (res) {
options.success(res);
},
error: function () {
var res = {
status: 0,
msg: '请求发生错误',
};
options.success(res);
}
})
}
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)")
var r = window.location.search.substr(1).match(reg)
if (r != null) return unescape(r[2]); return null
}
</script>
</html>