-
+
-
+
-
+
-
+
-
+
-
+
@@ -180,7 +187,11 @@ export default {
dataForm: {
key: ''
},
- reverse: false,
+ traces:[], // 物流轨迹
+ tracesShow:false,
+ currentSheet:{},
+
+ reverse: true,
activities: [ ],
deliverData: [], // 物流信息
@@ -189,15 +200,18 @@ export default {
dataListSelections: [],
// addOrUpdateVisible: false,
query: {
- orderId: 0,
+ orderSn: 0,
ordertype:null
},
changeAddVisible: false,
orderDetails:{},
addressForm:{
- province:null,
- city:null,
- county:null,
+ provinceCode:null, //省份串码
+ provinceName:null,
+ cityCode:null, //市区串码
+ cityName:null,
+ countyCode:null, //省份串码
+ countyName:null,
name:'',
tel:'',
addressXX:''
@@ -224,44 +238,103 @@ export default {
addressXX: [
{ required: true, message: '请输入详细地址信息', trigger: 'blur' }
],
- }
+ },
+ sheetList:[], // 面单列表
}
},
components: {
AddOrUpdate
},
activated() {
- this.query.orderId = this.$route.query.orderId;
+ this.query.orderSn = this.$route.query.orderSn;
this.query.ordertype = this.$route.query.ordertype;
- console.log(this.$route.query.orderId)
+ console.log(this.$route.query.orderSn)
this.getData()
+ // this.getOrderSheetList()
},
- methods: {
- cityChange(e){
- // console.log('修改了市',e)
- this.addressForm.county = null
- this.countyEntity = this.cityEntity.cityList.find((val,index,arr)=>{
+ methods: {
+ drawerHandleClose(){
+ console.log('关闭')
+ this.traces = []
+ this.tracesShow = false
+ this.currentSheet = {}
+ },
+ // 获取某一快递的物流进度
+ seeSheetDetails(item){
+ console.log('正在查询快递进度',item)
+ this.currentSheet = item
+ let loading = this.$loading({
+ lock: true,
+ text: '正在获取物流信息...',
+ spinner: 'el-icon-loading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ });
+ var mobileLeng = this.orderDetails.consignee.consigneeMobile.length
+ this.$http({
+ url: this.$http.adornUrl('/book/buyOrder/queryExpress'),
+ method: 'get',
+ params: this.$http.adornParams({
+ 'expressOrderSn': item.expressOrderSn,
+ 'expressCompanyCode': item.expressCompanyCode,
+ 'customerName': this.orderDetails.consignee.consigneeMobile.substring(mobileLeng-4, mobileLeng)
+ })
+ }).then(({ data }) => {
+ if(data.code == 0){
+ if(data.result.traces.length > 0){
+ this.traces = data.result.traces
+ this.tracesShow = true
+ console.log(data,'data')
+ loading.close()
+ }else{
+ this.$message('暂无物流信息哦~');
+ loading.close()
+ }
+ }
+
+ }).catch(({e}) => {
+ console.log(e,'e')
+ loading.close()
+ })
+ },
+ countyChange(e){
+ console.log(e,'countyName')
+ this.countyEntity.countyList.find((val,index,arr)=>{
+ this.addressForm.countyName = val.countyName
return val.regionCode == e
})
- // console.log('对应的city数组',this.countyEntity)
+ console.log('this.addressForm.countyName', this.addressForm)
+ },
+ cityChange(e){
+ // console.log('修改了市',e)
+ this.addressForm.countyCode = null
+ this.countyEntity = this.cityEntity.cityList.find((val,index,arr)=>{
+ this.addressForm.cityName = val.cityName
+ return val.regionCode == e
+ })
+ console.log(' this.addressForm.cityName', this.addressForm.cityName)
},
provinceChange(e){
// console.log('修改了省份',e)
- this.addressForm.city = null;
- this.addressForm.county = null
+ this.addressForm.cityCode = null;
+ this.addressForm.countyCode = null
this.cityEntity = this.provinceEntity.find((val,index,arr)=>{
+ this.addressForm.provinceName = val.provName
return val.regionCode == e
})
- // console.log('对应的city数组',this.cityEntity)
+ console.log('this.addressForm.provinceName',this.addressForm.provinceName)
},
changeAddHandleClose(){
this.changeAddVisible = false
- this.addressForm.province = null
- this.addressForm.city = null;
- this.addressForm.county = null
+ this.addressForm.provinceCode = null
+ this.addressForm.cityCode = null;
+ this.addressForm.countyCode = null
+ this.addressForm.provinceName = null
+ this.addressForm.cityName = null;
+ this.addressForm.countyName = null
this.provinceEntity = []
this.cityEntity = []
this.countyEntity = []
+ this.$refs['addressFormRef'].clearValidate()
this.$nextTick(() => {
this.addressForm.name = ''
this.addressForm.tel = ''
@@ -282,74 +355,116 @@ export default {
console.log('获取地址三级列表', data)
if(data.code == 0){
this.provinceEntity = data.provinceEntity
+ this.addressForm.addressXX = this.orderDetails.consignee.address
+ this.addressForm.provinceCode = this.orderDetails.consignee.provinceCode
+ this.addressForm.cityCode = this.orderDetails.consignee.cityCode
+ this.addressForm.countyCode = this.orderDetails.consignee.countyCode
+ this.addressForm.provinceName = this.orderDetails.consignee.provinceCode
+ this.addressForm.cityName = this.orderDetails.consignee.cityCode
+ this.addressForm.countyName = this.orderDetails.consignee.countyCode
+ this.addressForm.name = this.orderDetails.consignee.consigneeName
+ this.addressForm.tel = this.orderDetails.consignee.consigneeMobile
+ console.log(this.provinceEntity,'this.provinceEntity')
+ this.cityEntity = this.provinceEntity.find((val,index,arr)=>{
+ return val.regionCode == this.addressForm.provinceCode
+ })
+ this.countyEntity = this.cityEntity.cityList.find((val,index,arr)=>{
+ return val.regionCode == this.addressForm.cityCode
+ })
}
}).catch( e => {
console.log(e,'e')
- })
- // this.changeAddVisible = true
+ })
+ this.changeAddVisible = true
console.log('显示修改收货地址')
},
// 修改收货信息
changeAddress(){
this.$refs['addressFormRef'].validate((valid) => {
- if (valid) {
+ if (valid) {
console.log('修改收货地址')
+ this.$http({
+ url: this.$http.adornUrl('/book/buyOrder/modifyConsigneeAddress'),
+ method: 'post',
+ data: this.$http.adornData({
+ 'orderSn': this.query.orderSn,
+ // 'province': this.addressForm.provinceName,
+ // 'city': this.addressForm.cityName,
+ // 'county': this.addressForm.countyName,
+ 'address': this.addressForm.addressXX,
+ 'consigneeName': this.addressForm.name,
+ 'consigneeMobile': this.addressForm.tel,
+ "provinceCode": this.addressForm.provinceCode,
+ "cityCode": this.addressForm.cityCode,
+ "countyCode": this.addressForm.countyCode,
+ //'orderId': this.addressForm.orderId
+
+ })
+ }).then(({ data }) => {
+ console.log('修改地址返回值', data)
+ this.$message.success('修改地址成功!')
+ this.changeAddHandleClose()
+ this.getData()
+
+ }).catch( e => {
+ console.log(e,'e')
+ })
} else {
return false;
}
});
},
- // 获取地址数据三级联动
- // 获取 物流
- getdeliverDetails(){
- let loading = this.$loading({
- lock: true,
- text: '正在获取物流信息...',
- spinner: 'el-icon-loading',
- background: 'rgba(0, 0, 0, 0.7)'
- });
- this.$http({
- url: this.$http.adornUrl('/book/buyOrder/queryFMS'),
- method: 'post',
- params: this.$http.adornParams({
- 'orderId': this.query.orderId
+
+ // 获取订单下的快递单
+ getOrderSheetList(){
+ this.$http({
+ url: this.$http.adornUrl('/express/getPrintTemplateList'),
+ method: 'get',
+ params: this.$http.adornParams({
+ 'expressOrderSn': this.query.orderSn,
})
+ /// data: {}
}).then(({ data }) => {
- if(data && data.code === 0){
- if(data.rntStr != []){
- this.activities = data.rntStr
- // console.log(this.activities)
- }else{
- this.activities = []
- }
- loading.close()
- }else{
- loading.close()
- return this.$message.error('物流获取失败,请重试')
-
- }
- }).catch(({e}) => {
- loading.close()
- console.log(e,'e')
+ console.log(data.result,'面单列表')
+ if (data && data.code === 0) {
+ this.sheetList = data.result.data
+ // this.MDtotalPage = data.result.totalDataSize
+ } else {
+ // this.PrintSheetList = []
+ // this.totalPage = 0
+ }
})
-
- },
+ },
// 获取数据列表
getData() {
this.dataListLoading = true
this.$http({
// url: this.$http.adornUrl(`/book/buyOrder/appGetOrderInfo/${this.query.ordertype}`),
- url: this.$http.adornUrl(`/book/buyOrder/getOrderDetail/`),
+ url: this.$http.adornUrl(`/book/buyOrder/orderDetail`),
method: 'get',
params: this.$http.adornParams({
- 'orderId': this.query.orderId,
+ 'orderSn': this.query.orderSn,
})
}).then(({ data }) => {
if (data && data.code === 0) {
- this.orderDetails = data.detail
- if(this.query.ordertype != 0){ // 不是待付款订单时
- this.getdeliverDetails()
- }
+ console.log(data.result,'data.result')
+ this.orderDetails = data.result
+ if(this.orderDetails.goodsList.length > 0){
+ console.log('存在商品数据', this.orderDetails.goodsList.length)
+ var ids = []
+ ids.push(this.orderDetails.goodsList[0].expressInfo.expressOrderSn)
+ this.sheetList.push(this.orderDetails.goodsList[0].expressInfo)
+ for (let index = 0; index < this.orderDetails.goodsList.length; index++) {
+ if (!ids.includes(this.orderDetails.goodsList[index].expressInfo.expressOrderSn)) {
+ ids.push(this.orderDetails.goodsList[index].expressInfo.expressOrderSn)
+ this.sheetList.push(this.orderDetails.goodsList[index].expressInfo)}
+ console.log(this.orderDetails.goodsList[index].expressInfo.expressOrderSn,'expressOrderSn')
+ }
+ console.log(ids,this.sheetList,'this.sheetList')
+ }
+ // if(this.query.ordertype != 0){ // 不是待付款订单时
+ // this.getdeliverDetails()
+ // }
} else {
this.orderDetails = {}
return this.$message.error('商品详情获取失败,请重试')
@@ -363,7 +478,7 @@ export default {
},
// 去发货
godeliver() {
- this.orderList[0] = this.query.orderId
+ this.orderList[0] = this.query.orderSn
this.setDeliverVisible = true
}
},
@@ -457,10 +572,11 @@ ul.list {
content: "\e740";
}
-.el-timeline-item:first-child {
+.el-timeline-item:first-child {
.el-timeline-item__node {
background-color: rgb(11, 189, 135);
}
+ color: rgb(11, 189, 135) !important;
}
.el-timeline-item {
diff --git a/src/views/modules/order/deliver-detail.vue b/src/views/modules/order/deliver-detail.vue
index 379b280..6e97e8e 100644
--- a/src/views/modules/order/deliver-detail.vue
+++ b/src/views/modules/order/deliver-detail.vue
@@ -97,7 +97,7 @@ export default {
return this.$message.error('获取失败,请重新尝试')
}
}).catch(() => {
-
+ return this.$message.error('获取失败,请重新尝试')
})
},
beforeCloseDialog() {
diff --git a/src/views/modules/order/orderbeizhu-add-or-update.vue b/src/views/modules/order/orderbeizhu-add-or-update.vue
index dd41b4c..3c82e85 100644
--- a/src/views/modules/order/orderbeizhu-add-or-update.vue
+++ b/src/views/modules/order/orderbeizhu-add-or-update.vue
@@ -22,7 +22,11 @@ export default {
orderId:{
type: Number,
value: null
- },
+ },
+ orderSn:{
+ type: String,
+ value: ''
+ },
},
data() {
return {
@@ -36,19 +40,22 @@ export default {
beforeCloseDialog() {
this.$emit('closeDialog', false)
},
- init (id) {
+ init (sn,id) {
this.orderId = id || 0
+ this.orderSn = sn || 0
this.visible = true
this.$nextTick(() => {
- if (this.orderId) {
+ if (this.orderSn) {
this.$http({
- url: this.$http.adornUrl(`/book/buyOrder/info/${this.orderId}`),
+ url: this.$http.adornUrl('/book/buyOrder/orderDetail'),
method: 'get',
- params: this.$http.adornParams()
+ params: this.$http.adornParams({
+ 'orderSn': this.orderSn,
+ })
}).then(({data}) => {
if (data && data.code === 0) {
- console.log(data.buyOrder)
- this.dataForm.remark = data.buyOrder.remark
+ console.log(data.result)
+ this.dataForm.remark = data.result.remark
// console.log(this.dataForm.remark)
}
})
diff --git a/src/views/modules/order/orderdeliver-split.vue b/src/views/modules/order/orderdeliver-split.vue
index 824b6e6..522a7ad 100644
--- a/src/views/modules/order/orderdeliver-split.vue
+++ b/src/views/modules/order/orderdeliver-split.vue
@@ -30,10 +30,11 @@
-
![]()
-
-
{{ products.productName }}
-
+
![]()
+
+
{{ products.productName }}
+
快递信息:{{products.expressInfo.expressCompany}}-{{products.expressInfo.expressOrderSn}}
+
@@ -41,7 +42,9 @@
× {{ products.quantity }}
-
+
+
+