xuechunyuan 2 years ago
commit 7a9519574a
  1. 33
      src/api/order/order.js
  2. 89
      src/views/order/index.vue

@ -18,3 +18,36 @@ export const getOrderList = (query) => {
params: query,
});
};
export const exportList = (query) => {
return request({
url: "/api/blade-desk/order/export",
method: "get",
params: query,
responseType: "blob",
});
};
export const getComPanyList = (query) => {
return request({
url: "/api/blade-system/dict-biz/get-logistics-companies",
method: "get",
params: query,
});
};
export const getDetail = (query) => {
return request({
url: "/api/blade-desk/order/detail",
method: "get",
params: query,
});
};
export const confirmgoods = (data) => {
return request({
url: "/api/blade-desk/order/updateLogistics",
method: "post",
data,
});
};

@ -45,7 +45,7 @@
<template slot-scope="{ row }" slot="menu">
<el-button size="small" @click="handleDetail(row)">查看详情</el-button>
<!-- <el-button size="small" @click="handleDelete(row)">删除</el-button> -->
<el-button :disabled='row.status == 1 || row.status == 2' size="small" @click="handleSend(row)">发货</el-button>
<el-button :disabled='row.status == 1 || row.status == 3 || row.status == 4' size="small" @click="handleSend(row)">发货</el-button>
</template>
<!-- <template slot-scope="scope" slot="sleepingPosture">
<div v-show="scope.row.sleepingPosture == 1">仰睡</div>
@ -58,9 +58,9 @@
<div v-show="scope.row.status == 4">已完成</div>
</template>
<template slot-scope="scope" slot="menuLeft">
<el-button type="danger" size="small" @click="deleteItem"
<!-- <el-button type="danger" size="small" @click="deleteItem"
>删除</el-button
>
> -->
<el-button type="primary" size="small" @click="exportData"
>导出</el-button
>
@ -78,11 +78,11 @@
<el-descriptions :column="2" class="margin-top" size="small" border>
<el-descriptions-item>
<template slot="label">姓名</template>
<div>{{ checkaccept.username }}</div>
<div>{{ checkaccept.buyerName }}</div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">手机</template>
<div>{{ checkaccept.phone }}</div>
<div>{{ checkaccept.buyerPhone }}</div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">订单编号</template>
@ -92,7 +92,7 @@
<template slot="label">
<div>地址</div>
</template>
<div style="width: 158px">{{ checkaccept.position }}</div>
<div style="width: 158px">{{ checkaccept.address }}</div>
</el-descriptions-item>
<el-descriptions-item>
<template slot="label">订单状态</template>
@ -114,7 +114,7 @@
<div class="number_box" v-show="diaType == 'send'">
<p>请选择快递公司</p>
<el-select v-model="company">
<el-option v-for="item in companyData" :key="item.value" :value="item.value" :label="item.label"></el-option>
<el-option v-for="item in companyData" :key="item.dictKey" :value="item.dictKey" :label="item.dictValue"></el-option>
</el-select>
</div>
<div class="number_box" v-show="diaType == 'send'">
@ -142,7 +142,7 @@
</el-timeline>
</div>
<span slot="footer" class="dialog-footer" v-show="diaType == 'send'">
<el-button type="primary" @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="handlieConfirm"> </el-button>
</span>
<span slot="footer" class="dialog-footer" v-show="isShowInfo">
<el-button type="primary" @click="dialogVisible = false"> </el-button>
@ -156,11 +156,10 @@
// import {getBaseList,getTypeList} from "@/api/base"
import {
getList,
exportList,
deleteList,
detailList,
} from "@/api/statistics/statistics";
import {getWuliuInfo,getOrderList} from "@/api/order/order"
import {getWuliuInfo,getOrderList,exportList,getComPanyList,getDetail} from "@/api/order/order"
// import { getToken } from "@/util/auth";
import md5 from "js-md5";
export default {
@ -495,7 +494,9 @@ export default {
{value:'shentong',label:'申通'},
{value:'zhongtong',label:'中通'},
],
company:''
companyList:[],
company:'',
orderId:''
};
},
computed: {
@ -514,8 +515,19 @@ export default {
// this.getWinData();
// this.getTypeData();
this.onLoad();
this.getCompany()
},
methods: {
getCompany(){
getComPanyList().then(res =>{
console.log(res)
this.companyData = res.data.data
})
},
//
handlieConfirm(){
// confirmgoods()
},
sizeChange(pageSize) {
this.page.pageSize = pageSize;
this.onLoad();
@ -542,14 +554,10 @@ export default {
this.isShowInfo = false
this.diaTitle = '发货'
this.diaType="send"
detailList({ id: row.id }).then((res) => {
this.orderId = row.id;
getDetail({ id: row.id }).then((res) => {
console.log(res);
this.checkaccept = res.data.data;
this.checkaccept.position =
this.checkaccept.province +
this.checkaccept.city +
this.checkaccept.district +
this.checkaccept.detail;
});
},
//
@ -658,10 +666,6 @@ export default {
this.onLoad(this.page);
},
searchChange(params, done) {
console.log(params)
this.form = params
console.log(this.form);
this.query = this.form;
this.page.currentPage = 1;
this.onLoad(this.page, this.form);
@ -710,49 +714,16 @@ export default {
this.data = res.data.data.records;
this.page.total = res.data.data.total;
})
// getList({
// current: this.page.currentPage,
// size: this.page.pageSize,
// ...params,
// }).then((res) => {
// console.log("res==>", res);
// this.loading = false;
// this.data = res.data.data.records;
// this.page.total = res.data.data.total;
// });
// this.data = [
// {username:'',phone:'13201241125',orderNo:'321456789520',position:'',orderStatus:'0'},
// {username:'',phone:'13201241125',orderNo:'321456789520',position:'',orderStatus:'1'},
// {username:'',phone:'13201241125',orderNo:'321456789520',position:'',orderStatus:'0'},
// {username:'',phone:'13201241125',orderNo:'321456789520',position:'',orderStatus:'0'},
// {username:'',phone:'13201241125',orderNo:'321456789520',position:'',orderStatus:'0'},
// ]
// this.loading = false;
},
addRegister() {
this.$router.push({ path: "/register/add", query: { type: "add" } });
},
exportData() {
let params = {};
if (!this.form.timeArr) {
params = {
username: this.form.name ? this.form.name : "",
phone: this.form.phonenumber ? this.form.phonenumber : "",
pillowHardness: this.form.hardness ? this.form.hardness : "",
pillowMaterial: this.form.material ? this.form.material : "",
ageRange: this.form.age ? this.form.age : "",
};
} else {
params = {
username: this.form.name ? this.form.name : "",
phone: this.form.phonenumber ? this.form.phonenumber : "",
pillowHardness: this.form.hardness ? this.form.hardness : "",
pillowMaterial: this.form.material ? this.form.material : "",
ageRange: this.form.age ? this.form.age : "",
startTime: this.form.timeArr[0],
endTime: this.form.timeArr[1],
};
params = {
buyerName:this.form.name ? this.form.name : '',
buyerPhone:this.form.phonenumber ? this.form.phonenumber : '',
orderNo:this.form.orderNumber ? this.form.orderNumber : ''
}
exportList(params).then((res) => {
console.log(res);
@ -764,7 +735,7 @@ export default {
return;
}
let blob = new Blob([res.data]); //response.data
let downloadFilename = "统计" + ".xlsx"; //
let downloadFilename = "订单" + ".xlsx"; //
if (window.navigator && window.navigator.msSaveOrOpenBlob) {
//ie
window.navigator.msSaveOrOpenBlob(blob, downloadFilename);

Loading…
Cancel
Save