添加订单列表查询接口

main
jinna 2 years ago
parent fd540fee0a
commit 8b6b9de9ea
  1. 7
      src/api/order/order.js
  2. 91
      src/views/order/index.vue

@ -11,3 +11,10 @@ export const getWuliuInfo = (param) => {
params: param, params: param,
}); });
}; };
export const getOrderList = (query) => {
return request({
url: "/api/blade-desk/order/page",
method: "get",
params: query,
});
};

@ -45,15 +45,17 @@
<template slot-scope="{ row }" slot="menu"> <template slot-scope="{ row }" slot="menu">
<el-button size="small" @click="handleDetail(row)">查看详情</el-button> <el-button size="small" @click="handleDetail(row)">查看详情</el-button>
<!-- <el-button size="small" @click="handleDelete(row)">删除</el-button> --> <!-- <el-button size="small" @click="handleDelete(row)">删除</el-button> -->
<el-button :disabled='row.orderStatus == 1' size="small" @click="handleSend(row)">发货</el-button> <el-button :disabled='row.status == 1 || row.status == 2' size="small" @click="handleSend(row)">发货</el-button>
</template> </template>
<!-- <template slot-scope="scope" slot="sleepingPosture"> <!-- <template slot-scope="scope" slot="sleepingPosture">
<div v-show="scope.row.sleepingPosture == 1">仰睡</div> <div v-show="scope.row.sleepingPosture == 1">仰睡</div>
<div v-show="scope.row.sleepingPosture == 2">侧睡</div> <div v-show="scope.row.sleepingPosture == 2">侧睡</div>
</template> --> </template> -->
<template slot-scope="scope" slot="orderStatus"> <template slot-scope="scope" slot="status">
<div v-show="scope.row.orderStatus == 1">已发货</div> <div v-show="scope.row.status == 1">待付款</div>
<div v-show="scope.row.orderStatus == 0">未发货</div> <div v-show="scope.row.status == 2">待发货</div>
<div v-show="scope.row.status == 3">待收货</div>
<div v-show="scope.row.status == 4">已完成</div>
</template> </template>
<template slot-scope="scope" slot="menuLeft"> <template slot-scope="scope" slot="menuLeft">
<el-button type="danger" size="small" @click="deleteItem" <el-button type="danger" size="small" @click="deleteItem"
@ -96,10 +98,14 @@
<template slot="label">订单状态</template> <template slot="label">订单状态</template>
<div> <div>
{{ {{
checkaccept.orderStatus == 1 checkaccept.status == 1
? "已发货" ? "待付款"
: checkaccept.orderStatus == 0 : checkaccept.status == 2
? "未发货" ? "待发货"
: checkaccept.status == 3
? "待收货"
: checkaccept.status == 4
? "已完成"
: "" : ""
}} }}
</div> </div>
@ -154,7 +160,7 @@ import {
deleteList, deleteList,
detailList, detailList,
} from "@/api/statistics/statistics"; } from "@/api/statistics/statistics";
import {getWuliuInfo} from "@/api/order/order" import {getWuliuInfo,getOrderList} from "@/api/order/order"
// import { getToken } from "@/util/auth"; // import { getToken } from "@/util/auth";
import md5 from "js-md5"; import md5 from "js-md5";
export default { export default {
@ -251,7 +257,7 @@ export default {
}, },
{ {
label: "姓名", label: "姓名",
prop: "username", prop: "buyerName",
align: "center", align: "center",
overHidden:true, overHidden:true,
width:80, width:80,
@ -260,7 +266,7 @@ export default {
label: "手机", label: "手机",
overHidden:true, overHidden:true,
width:150, width:150,
prop: "phone", prop: "buyerPhone",
align: "center", align: "center",
}, },
{ {
@ -278,7 +284,7 @@ export default {
{ {
label: "订单状态", label: "订单状态",
slot:true, slot:true,
prop: "orderStatus", prop: "status",
align: "center", align: "center",
} }
], ],
@ -611,10 +617,10 @@ export default {
this.activities[0].status = this.activities[0].status == '在途' ? '运输中' : this.activities[0].status this.activities[0].status = this.activities[0].status == '在途' ? '运输中' : this.activities[0].status
this.activities[0].color = '#0bbd87' this.activities[0].color = '#0bbd87'
console.log(this.activities) console.log(this.activities)
// getWuliuInfo(param).then(res =>{ getWuliuInfo(param).then(res =>{
// console.log(res) console.log(res)
// this.activities = res.data.data this.activities = res.data.data
// }) })
}, },
selectionChange(data) { selectionChange(data) {
this.selectionList = data; this.selectionList = data;
@ -688,33 +694,22 @@ export default {
}, },
onLoad() { onLoad() {
let params = {}; let params = {};
// 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 : ''
// }
if (!this.form.timeArr) {
params = {
username: this.form.username ? this.form.username : "",
phone: this.form.phonenumber ? this.form.phonenumber : "",
pillowHardness: this.form.hardness ? this.form.hardness : "",
pillowMaterial: this.form.material ? this.form.material : "",
ageRange: this.form.ageRange ? this.form.ageRange : "",
};
} else {
params = { params = {
username: this.form.username ? this.form.username : "", buyerName:this.form.name ? this.form.name : '',
phone: this.form.phonenumber ? this.form.phonenumber : "", buyerPhone:this.form.phonenumber ? this.form.phonenumber : '',
pillowHardness: this.form.hardness ? this.form.hardness : "", orderNo:this.form.orderNumber ? this.form.orderNumber : ''
pillowMaterial: this.form.material ? this.form.material : "",
ageRange: this.form.ageRange ? this.form.ageRange : "",
startTime: this.form.timeArr[0],
endTime: this.form.timeArr[1],
};
} }
console.log("par", params); console.log("par", params);
getOrderList({
current: this.page.currentPage,
size: this.page.pageSize,
...params
}).then(res =>{
console.log(res)
this.loading = false;
this.data = res.data.data.records;
this.page.total = res.data.data.total;
})
// getList({ // getList({
// current: this.page.currentPage, // current: this.page.currentPage,
@ -726,14 +721,14 @@ export default {
// this.data = res.data.data.records; // this.data = res.data.data.records;
// this.page.total = res.data.data.total; // this.page.total = res.data.data.total;
// }); // });
this.data = [ // this.data = [
{username:'张大仙',phone:'13201241125',orderNo:'321456789520',position:'山东省青岛市市南区香港中路',orderStatus:'0'}, // {username:'',phone:'13201241125',orderNo:'321456789520',position:'',orderStatus:'0'},
{username:'张伟',phone:'13201241125',orderNo:'321456789520',position:'山东省青岛市市南区香港中路',orderStatus:'1'}, // {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'}, // {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; // this.loading = false;
}, },
addRegister() { addRegister() {
this.$router.push({ path: "/register/add", query: { type: "add" } }); this.$router.push({ path: "/register/add", query: { type: "add" } });

Loading…
Cancel
Save