2023-3-27
This commit is contained in:
@@ -4,7 +4,7 @@ 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://192.168.3.9:8085"'
|
// BASE_API: '"http://192.168.3.9:8085"'
|
||||||
// BASE_API: '"http://127.0.0.1:8085"'
|
// BASE_API: '"http://127.0.0.1:8085"'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -30,6 +30,14 @@ export function deliveryOrder(data) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function newDeliveryOrder(data) {
|
||||||
|
return request({
|
||||||
|
url: '/oms/OmsOrder/update/deliveryNew',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export function getOrderDetail(id) {
|
export function getOrderDetail(id) {
|
||||||
return request({
|
return request({
|
||||||
url: '/oms/OmsOrder/' + id,
|
url: '/oms/OmsOrder/' + id,
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ export function orderData(params) {
|
|||||||
|
|
||||||
export function exportExcel(params) {
|
export function exportExcel(params) {
|
||||||
return request({
|
return request({
|
||||||
|
baseURL: '/api',
|
||||||
url: '/oms/OmsOrder/exportExcel2',
|
url: '/oms/OmsOrder/exportExcel2',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
responseType: 'blob', // 表明返回服务器返回的数据类型
|
responseType: 'blob', // 表明返回服务器返回的数据类型
|
||||||
|
|||||||
@@ -1,7 +1,13 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { Message, MessageBox } from 'element-ui'
|
import {
|
||||||
|
Message,
|
||||||
|
MessageBox
|
||||||
|
} from 'element-ui'
|
||||||
import store from '../store'
|
import store from '../store'
|
||||||
import { getToken,get } from '@/utils/auth'
|
import {
|
||||||
|
getToken,
|
||||||
|
get
|
||||||
|
} from '@/utils/auth'
|
||||||
|
|
||||||
// 创建axios实例
|
// 创建axios实例
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
@@ -13,16 +19,16 @@ const service = axios.create({
|
|||||||
service.interceptors.request.use(config => {
|
service.interceptors.request.use(config => {
|
||||||
if (store.getters.token) {
|
if (store.getters.token) {
|
||||||
let test = config.data;
|
let test = config.data;
|
||||||
if(test){
|
if (test) {
|
||||||
config.data['access_token']= getToken()
|
config.data['access_token'] = getToken()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (get('storeId') && 'undefined'!=get('storeId')){
|
if (get('storeId') && 'undefined' != get('storeId')) {
|
||||||
config.headers['storeid'] = get('storeId')
|
config.headers['storeid'] = get('storeId')
|
||||||
}
|
}
|
||||||
|
|
||||||
config.headers['Authorization'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
config.headers['Authorization'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||||
}else{
|
} else {
|
||||||
config.headers['client_id'] = 'app';
|
config.headers['client_id'] = 'app';
|
||||||
config.headers['client_secret'] = 'app';
|
config.headers['client_secret'] = 'app';
|
||||||
}
|
}
|
||||||
@@ -40,29 +46,42 @@ service.interceptors.response.use(
|
|||||||
* code为非200是抛错 可结合自己业务进行修改
|
* code为非200是抛错 可结合自己业务进行修改
|
||||||
*/
|
*/
|
||||||
const res = response.data
|
const res = response.data
|
||||||
if (res.code !== 200 && !res.access_token) {
|
const statusCode = response.status
|
||||||
console.log(res);
|
|
||||||
|
console.log("response>>>>", response);
|
||||||
|
|
||||||
|
if (statusCode !== 200) {
|
||||||
Message({
|
Message({
|
||||||
message: res.msg,
|
message: res.msg || response.message || 'Error',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
duration: 3 * 1000
|
showClose: true,
|
||||||
|
duration: 5 * 1000
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// 401:未登录;
|
// 401:未登录;
|
||||||
if (res.code === 401||res.code === 403) {
|
if (statusCode === 401 || statusCode === 403) {
|
||||||
MessageBox.confirm('你已被登出,可以取消继续留在该页面,或者重新登录', '确定登出', {
|
MessageBox.confirm('你已被登出,可以取消继续留在该页面,或者重新登录', '确定登出', {
|
||||||
confirmButtonText: '重新登录',
|
confirmButtonText: '重新登录',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
store.dispatch('FedLogOut').then(() => {
|
store.dispatch('FedLogOut').then(() => {
|
||||||
location.reload()// 为了重新实例化vue-router对象 避免bug
|
location.reload() // 为了重新实例化vue-router对象 避免bug
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return Promise.reject('error')
|
return Promise.reject('error')
|
||||||
} else {
|
} else {
|
||||||
return response.data
|
if (!res.success && res.success !== null && res.success !== undefined) {
|
||||||
|
Message({
|
||||||
|
message: res.msg || 'Error',
|
||||||
|
type: 'error',
|
||||||
|
showClose: true,
|
||||||
|
duration: 5 * 1000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return res
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
|
|||||||
@@ -239,7 +239,8 @@
|
|||||||
closeOrder,
|
closeOrder,
|
||||||
deleteOrder,
|
deleteOrder,
|
||||||
orderData,
|
orderData,
|
||||||
exportExcel
|
exportExcel,
|
||||||
|
newDeliveryOrder
|
||||||
} from '@/api/order';
|
} from '@/api/order';
|
||||||
import {
|
import {
|
||||||
formatDate
|
formatDate
|
||||||
@@ -544,14 +545,22 @@
|
|||||||
this.closeOrder.orderIds = [row.id];
|
this.closeOrder.orderIds = [row.id];
|
||||||
},
|
},
|
||||||
handleDeliveryOrder(index, row) {
|
handleDeliveryOrder(index, row) {
|
||||||
let listItem = this.covertOrder(row);
|
// let listItem = this.covertOrder(row);
|
||||||
console.log("listItem", listItem)
|
// console.log("listItem", listItem)
|
||||||
this.$router.push({
|
// this.$router.push({
|
||||||
path: '/oms/deliverOrderList',
|
// path: '/oms/deliverOrderList',
|
||||||
query: {
|
// query: {
|
||||||
list: [listItem]
|
// list: [listItem]
|
||||||
}
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
let idList = []
|
||||||
|
|
||||||
|
idList.push({
|
||||||
|
orderId: row.id
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.sendGoods("是否确认发货", idList);
|
||||||
},
|
},
|
||||||
handleViewLogistics(index, row) {
|
handleViewLogistics(index, row) {
|
||||||
this.logisticsDialogVisible = true;
|
this.logisticsDialogVisible = true;
|
||||||
@@ -769,6 +778,48 @@
|
|||||||
// 批量发货
|
// 批量发货
|
||||||
doBatch() {
|
doBatch() {
|
||||||
|
|
||||||
|
if (this.multipleSelection.length == 0) {
|
||||||
|
this.$message({
|
||||||
|
message: '暂无数据可导出!',
|
||||||
|
type: 'warning',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
return
|
||||||
|
}
|
||||||
|
let idList = []
|
||||||
|
|
||||||
|
this.multipleSelection.forEach(row => {
|
||||||
|
idList.push({
|
||||||
|
orderId: row.id
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
this.sendGoods("是否确认批量发货?", idList);
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
// 发货
|
||||||
|
sendGoods(str, idList) {
|
||||||
|
|
||||||
|
this.$confirm(str, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
newDeliveryOrder(idList).then(response => {
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '发货成功!'
|
||||||
|
});
|
||||||
|
this.getList();
|
||||||
|
this.orderDatas(this.listQuery.status);
|
||||||
|
});
|
||||||
|
}).catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消发货'
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 导出
|
// 导出
|
||||||
doExport() {
|
doExport() {
|
||||||
@@ -781,24 +832,24 @@
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: 'Loading',
|
||||||
|
spinner: 'el-icon-loading',
|
||||||
|
background: 'rgba(0, 0, 0, 0.7)'
|
||||||
|
})
|
||||||
|
|
||||||
// const loading = this.$loading({
|
const data = {
|
||||||
// lock: true,
|
status: this.listQuery.status == null ? "" : this.listQuery.status,
|
||||||
// text: 'Loading',
|
orderSn: this.listQuery.orderSn == null ? "" : this.listQuery.orderSn,
|
||||||
// spinner: 'el-icon-loading',
|
receiverPhone: this.listQuery.receiverPhone == null ? "" : this.listQuery.receiverPhone,
|
||||||
// background: 'rgba(0, 0, 0, 0.7)'
|
createTimeStart: this.listQuery.createTimeStart == null ? "" : this.listQuery.createTimeStart,
|
||||||
// })
|
createTimeEnd: this.listQuery.createTimeEnd == null ? "" : this.listQuery.createTimeEnd,
|
||||||
this.listQuery = {
|
|
||||||
status: 0,
|
|
||||||
orderSn: '00382',
|
|
||||||
receiverPhone: '',
|
|
||||||
createTimeStart: '',
|
|
||||||
createTimeEnd: ''
|
|
||||||
}
|
}
|
||||||
exportExcel(this.listQuery).then((resp) => {
|
exportExcel(data).then((resp) => {
|
||||||
// loading.close()
|
loading.close()
|
||||||
const blob = new Blob([resp], {
|
const blob = new Blob([resp], {
|
||||||
type: 'application/vnd.ms-excel;charset=utf-8'
|
type: 'application/vnd.ms-excel;charset=UTF-8'
|
||||||
})
|
})
|
||||||
const fileName = '订单列表' + '.xls'
|
const fileName = '订单列表' + '.xls'
|
||||||
const elink = document.createElement('a')
|
const elink = document.createElement('a')
|
||||||
@@ -810,7 +861,7 @@
|
|||||||
URL.revokeObjectURL(elink.href)
|
URL.revokeObjectURL(elink.href)
|
||||||
document.body.removeChild(elink)
|
document.body.removeChild(elink)
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
// loading.close()
|
loading.close()
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -400,6 +400,14 @@
|
|||||||
},
|
},
|
||||||
// 导出
|
// 导出
|
||||||
doExport() {
|
doExport() {
|
||||||
|
if (this.list.length == 0) {
|
||||||
|
this.$message({
|
||||||
|
message: '暂无数据可导出!',
|
||||||
|
type: 'warning',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
const loading = this.$loading({
|
const loading = this.$loading({
|
||||||
lock: true,
|
lock: true,
|
||||||
@@ -407,7 +415,14 @@
|
|||||||
spinner: 'el-icon-loading',
|
spinner: 'el-icon-loading',
|
||||||
background: 'rgba(0, 0, 0, 0.7)'
|
background: 'rgba(0, 0, 0, 0.7)'
|
||||||
})
|
})
|
||||||
exportExcel(this.listQuery).then((resp) => {
|
|
||||||
|
const data = {
|
||||||
|
status: this.listQuery.status == null ? "" : this.listQuery.status,
|
||||||
|
receiverPhone: this.listQuery.receiverPhone == null ? "" : this.listQuery.receiverPhone,
|
||||||
|
valueszd: this.listQuery.valueszd == null ? "" : this.listQuery.valueszd,
|
||||||
|
valueqhd: this.listQuery.valueqhd == null ? "" : this.listQuery.valueqhd,
|
||||||
|
}
|
||||||
|
exportExcel(data).then((resp) => {
|
||||||
loading.close()
|
loading.close()
|
||||||
const blob = new Blob([resp], {
|
const blob = new Blob([resp], {
|
||||||
type: 'application/vnd.ms-excel'
|
type: 'application/vnd.ms-excel'
|
||||||
|
|||||||
Reference in New Issue
Block a user