订单管理

This commit is contained in:
余同学 2024-12-20 18:17:10 +08:00
parent a069ca5eae
commit 8178a35944
8 changed files with 719 additions and 76 deletions

View File

@ -119,7 +119,8 @@ router.beforeEach((to, from, next) => {
// return filtered; // return filtered;
// }, []); // }, []);
}; };
console.log(data); console.log(data, "用户信息");
sessionStorage.setItem("role", JSON.stringify(data.data.role));
if (data.data.markets?.length > 0) { if (data.data.markets?.length > 0) {
// 存在多个市场 // 存在多个市场
$api.mer_admin $api.mer_admin

View File

@ -7,11 +7,42 @@
* @FilePath: \background-front-end\src\views\common\home.vue * @FilePath: \background-front-end\src\views\common\home.vue
--> -->
<template> <template>
<div class="mod-home"></div> <div class="mod-home">
<el-dialog
title="提示:您的密码过于简单,请您修改密码"
:visible.sync="dialogVisible"
width="30%"
:show-close="false"
:destroy-on-close="true"
:close-on-click-modal="false"
>
<span>这是一段信息</span>
<span slot="footer" class="dialog-footer">
<!-- <el-button @click="dialogVisible = false"> </el-button> -->
<el-button type="primary" @click="dialogVisible = false"
>确定并重新登入</el-button
>
</span>
</el-dialog>
</div>
</template> </template>
<script> <script>
export default {}; export default {
data() {
return {
dialogVisible: false,
};
},
created() {
if (
JSON.parse(sessionStorage.getItem("password")) == "123456" &&
JSON.parse(sessionStorage.getItem("role")) === "ROLE_BRAND_MANAGER"
) {
this.dialogVisible = true;
}
},
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -159,17 +159,6 @@
placeholder="密码" placeholder="密码"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item prop="captcha">
<el-row :gutter="20">
<el-col :span="14">
<el-input v-model="dataForm.captcha" placeholder="验证码">
</el-input>
</el-col>
<el-col :span="10" class="login-captcha">
<img :src="captchaPath" @click="getCaptcha()" alt="" />
</el-col>
</el-row>
</el-form-item> -->
<el-form-item> <el-form-item>
<el-button <el-button
class="login-btn-submit" class="login-btn-submit"
@ -321,6 +310,10 @@ export default {
.then(({ data }) => { .then(({ data }) => {
console.log("data", data); console.log("data", data);
this.$cookie.set("token", data.data.token); this.$cookie.set("token", data.data.token);
sessionStorage.setItem(
"password",
JSON.stringify(this.dataForm.password)
);
this.$router.replace({ name: "home" }); this.$router.replace({ name: "home" });
}) })
.catch((err) => { .catch((err) => {

View File

@ -81,7 +81,12 @@
</el-input> </el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label-width="150px" label="选择商品" prop="targetIds"> <el-form-item
v-if="modalData.usableRange === 'ALL_GOODS'"
label-width="150px"
label="选择商品"
prop="targetIds"
>
<el-input <el-input
style="width: 350px" style="width: 350px"
placeholder="请选择选择商品" placeholder="请选择选择商品"

View File

@ -958,10 +958,10 @@ export default {
let res = await this.$api.mer_admin.getCity(); let res = await this.$api.mer_admin.getCity();
return res.data.data; return res.data.data;
}, },
async getProductCategory() { // async getProductCategory() {
let res = await this.$api.mer_admin.getProductCategory(); // let res = await this.$api.mer_admin.getProductCategory();
return res.data.data; // return res.data.data;
}, // },
async getSaleUnit() { async getSaleUnit() {
let res = await this.$api.mer_admin.getSaleUnit({ let res = await this.$api.mer_admin.getSaleUnit({
shopId: JSON.parse(sessionStorage.getItem("userInfo")).shopId, shopId: JSON.parse(sessionStorage.getItem("userInfo")).shopId,

View File

@ -1,12 +1,509 @@
<template> <template>
<div style="height: calc(100vh - 200px)"> <div>
预售订单 <div v-if="isMerchant" style="height: calc(100vh - 200px)">
<obj-table-plus
ref="oTable"
style="height: 100%"
:tableCols="tableCols"
:tableProp="tableProp"
@query="queryList"
v-model="dataList"
:tableEvent="tableEvent"
:enableAutoQuery="false"
>
<template slot="tableTop">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-row v-if="storeList.length > 1">
<el-col :span="24">
<!-- <el-form-item label="菜市场">
<el-select
@change="getData"
v-model="formInline.marketId"
placeholder="请选择菜市场"
>
<el-option
v-for="item in marketList"
:key="item.marketId"
:label="item.marketName"
:value="item.marketId"
></el-option>
</el-select>
</el-form-item> -->
<el-form-item label="店铺">
<el-select
v-model="formInline.shopId"
placeholder="请选择店铺"
>
<el-option
v-for="item in storeList"
:key="item.shopId"
:label="item.shopName"
:value="item.shopId"
></el-option>
</el-select> </el-form-item
></el-col>
</el-row>
<el-form-item label="订单号">
<el-input
v-model="formInline.name"
placeholder="订单号搜索"
></el-input>
</el-form-item>
<el-form-item label="订单商品">
<el-input
v-model="formInline.name"
placeholder="订单名称搜索"
></el-input>
</el-form-item>
<el-form-item label="定金付款时间">
<el-date-picker
value-format="yyyy-MM-dd HH:mm:ss"
v-model="value1"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="尾款付款时间">
<el-date-picker
value-format="yyyy-MM-dd HH:mm:ss"
v-model="value1"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</el-form-item>
<el-form-item label="配送方式">
<el-select v-model="formInline.name" placeholder="请选择菜市场">
<el-option
v-for="item in [
{ label: '全部', value: '0' },
{ label: '快递', value: '1' },
{ label: '自提', value: '2' },
]"
:key="item.marketId"
:label="item.marketName"
:value="item.marketId"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="$refs.oTable.reload()"
>查询</el-button
>
<el-button type="primary" @click="Reset">重置</el-button>
</el-form-item>
</el-form>
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane
v-for="item in statusList"
:key="item.value"
:label="item.label"
:name="item.value"
></el-tab-pane>
</el-tabs>
<div class="mb-2">
<el-button type="primary" size="small" @click="addProduct"
>批量导出</el-button
>
</div>
</template>
</obj-table-plus>
<!-- 详情 -->
<viewDetails ref="viewDetails"></viewDetails>
</div>
<div style="height: calc(100vh - 200px)" v-else>
<el-empty :image-size="200" description="您不是摊主哦"></el-empty>
</div>
</div> </div>
</template> </template>
<script> <script>
export default {} import { mapState } from "vuex";
import viewDetails from "./popup/view-details.vue";
export default {
components: { viewDetails },
data() {
return {
value1: "",
activeName: "5",
advanceSellStatus: "",
dataList: [],
formInline: {
name: "",
marketId: "",
shopId: "",
},
tableProp: {
"auto-resize": true,
border: true,
height: "auto",
"row-id": "id",
"show-overflow": false,
},
statusList: [
{
label: "全部",
value: "5",
},
{
label: "代付定金",
value: "0",
},
{
label: "代付尾款",
value: "1",
},
{
label: "待发货",
value: "2",
},
{
label: "待收货",
value: "3",
},
{
label: "待评价",
value: "4",
},
{
label: "已完成",
value: "6",
},
{
label: "已取消",
value: "7",
},
{
label: "交易关闭",
value: "8",
},
],
productFilterType: "SALE",
selectList: [],
};
},
created() {
this.formInline = {
marketId: this.marketId,
shopId: this.shopId,
};
this.$nextTick(() => {
this.$refs.oTable.reload();
});
},
methods: {
addProduct() {
this.$refs.addOrUpdate.toggle().add();
},
queryList(pageNo, pageSize) {
let res = {
data: [
{
advanceSellId: "1870015398464876544",
advanceSellStatus: 1,
balancePaymentEndTime: "2024-12-28 00:00:00",
balancePaymentStartTime: "2024-12-25 00:00:00",
brandId: null,
collectionNum: null,
description: "好吃的苹果",
discountActivity: null,
endTime: "2024-12-25 00:00:00",
estimatedEndDeliveryTime: "2025-01-03 00:00:00",
estimatedStartDeliveryTime: "2024-12-31 00:00:00",
favoriteNum: null,
id: "1869660245152923648",
isAdvanceSell: 1,
isDiscount: null,
isRefundEarnestMoney: 1,
keywords: null,
marketId: "1844393110392221696",
maxCostPrice: 10,
maxMarketPrice: 20,
maxSalePrice: 20,
merchantId: "1844397348581253120",
minCostPrice: 5,
minMarketPrice: 10,
minSalePrice: 10,
name: "苹果",
otherAttribute: "[]",
productAttributeList: [
{
attributeName: "重量",
attributeValue: "10斤,20斤",
id: "1869660245454913536",
productId: "1869660245152923648",
},
],
productCategoryId: "31",
productIntroducePhoto: "",
productPhotoList: [
{
id: "1869660245391998976",
isMain: 1,
productId: "1869660245152923648",
sort: null,
url: "https://dmjs.obs.cn-east-3.myhuaweicloud.com/hhsh/20241219/90cb416e636b4e1f99f47e458d0a0fc8.jpg",
},
],
productPlace: "山西省-太原市-小店区",
productSpecificationList: [
{
advanceSellStockNum: 40,
attributeJson:
'[{"attributeName":"重量","attributeValue":"10斤"}]',
attributeList: [
{
attributeName: "重量",
attributeValue: "10斤",
},
],
attributeValue: "10斤",
balancePayment: 3,
costPrice: 5,
earnestMoney: 6,
id: "1869660245517828096",
isAdvanceSell: 1,
isDiscount: null,
isRecommend: 0,
isRecommendIndex: null,
limitCount: 2147483647,
marketPrice: 10,
presalePrice: 9,
productId: "1869660245152923648",
saleNum: 0,
salePrice: 10,
stockNum: 234,
virtualSaleNum: null,
volume: 2,
warnAdvanceSellStockNum: null,
warnStockNum: 50,
weight: 5,
},
{
advanceSellStockNum: 40,
attributeJson:
'[{"attributeName":"重量","attributeValue":"20斤"}]',
attributeList: [
{
attributeName: "重量",
attributeValue: "20斤",
},
],
attributeValue: "20斤",
balancePayment: 7,
costPrice: 10,
earnestMoney: 8,
id: "1869660245517828097",
isAdvanceSell: 1,
isDiscount: null,
isRecommend: 0,
isRecommendIndex: null,
limitCount: 2147483647,
marketPrice: 20,
presalePrice: 15,
productId: "1869660245152923648",
saleNum: 0,
salePrice: 20,
stockNum: 324,
virtualSaleNum: null,
volume: 4,
warnAdvanceSellStockNum: null,
warnStockNum: 50,
weight: 10,
},
],
productUnit: "盒",
productVideo: "",
saleNum: 0,
salePrice: 10,
shelfLife: 60,
shopId: "1844397348614807552",
sort: 999,
specType: 1,
startTime: "2024-12-20 00:00:00",
status: "UP",
stockNum: 558,
tags: null,
volume: 3,
weight: 7.5,
},
],
total: "1",
};
setTimeout(() => {
this.$refs.oTable.complete(res.data, Number(res.total));
}, 1000);
// this.$api.preSale
// .preSaleProducts({
// pageNumber: pageNo,
// pageSize: pageSize,
// ...this.formInline,
// advanceSellStatus: this.advanceSellStatus,
// merchantId: JSON.parse(sessionStorage.getItem("userInfo")).merchantId,
// productQuerySortParam: [],
// })
// .then((res) => {
// console.log(res);
// this.$refs.oTable.complete(
// res.data.data.data,
// Number(res.data.data.total)
// );
// })
// .catch((err) => {
// this.$refs.oTable.complete(false);
// });
},
Reset() {
this.formInline = {
name: "",
marketId: this.marketId,
shopId: this.shopId,
};
this.$refs.oTable.reload();
},
handleClick(e) {
console.log(e.name);
if (e.name == "5") {
this.advanceSellStatus = "";
} else {
this.advanceSellStatus = e.name;
}
this.$refs.oTable.reload();
},
},
computed: {
tableCols() {
return [
// { type: "checkbox", width: "60px", fixed: "left" },
{
type: "seq",
fixed: "left",
width: "60px",
align: "center",
title: "序号",
},
{
title: "订单号",
align: "center",
field: "id",
},
{
title: "订单商品",
field: "productPhotoList",
align: "center",
width: "80px",
type: "jsx",
render: ({ row }) => {
if (row.productPhotoList.length > 0) {
return (
<el-image
preview-src-list={row.productPhotoList.map((item) => {
return item.url;
})}
src={row.productPhotoList[0].url}
></el-image>
);
} else {
return <span>暂无商品图</span>;
}
},
},
{
title: "商品名称",
align: "center",
field: "name",
},
{
title: "规格/数量",
align: "center",
field: "name",
},
{
title: "定金支付时间",
align: "center",
field: "startTime",
type: "jsx",
render: ({ row }) => {
return (
<span>
{row.startTime}{row.endTime}
</span>
);
},
},
{
title: "尾款支付时间",
align: "center",
field: "minSalePrice",
type: "jsx",
render: ({ row }) => {
return (
<span>
{row.balancePaymentStartTime}{row.balancePaymentEndTime}
</span>
);
},
},
{
title: "状态",
align: "center",
field: "status",
type: "jsx",
render: ({ row }) => {
if (row.advanceSellStatus == "0") {
return <span>未开始</span>;
} else if (row.advanceSellStatus == "1") {
return <span>进行中</span>;
} else if (row.advanceSellStatus == "2") {
return <span>已结束</span>;
} else if (row.advanceSellStatus == "3") {
return <span>已关闭</span>;
}
},
},
{
title: "操作",
fixed: "right",
type: "jsx",
align: "center",
width: "100px",
render: ({ row }) => {
let details = () => {
this.$refs.viewDetails.toggle(row).update();
};
return (
<div>
<el-button size="mini" type="primary" onClick={details}>
查看
</el-button>
</div>
);
},
},
];
},
tableEvent() {
return {
"checkbox-all": ({ records, reserves }) => {
this.selectList = [...records, ...reserves];
},
"checkbox-change": ({ records, reserves }) => {
this.selectList = [...records, ...reserves];
},
};
},
...mapState("userData", [
"isMerchant",
"marketList",
"storeList",
"marketId",
"shopId",
]),
},
};
</script> </script>
<style lang="scss" scoped></style> <style lang="scss" scoped></style>

View File

@ -0,0 +1,123 @@
<template>
<div>
<obj-modal
ref="modal"
labelWidth="150px"
:modalConfig="modalConfig"
:modalData="modalData"
:modalHandles="modalHandles"
>
<div slot="dialog__content">
<el-form
:model="ruleForm"
:rules="rules"
ref="ruleForm"
label-width="150px"
class="demo-ruleForm"
>
<!-- <el-form-item label="预售剩余库存:" prop="name">
<span style="font-size: 20px; margin-right: 20px"></span>
<el-input-number
v-model="ruleForm.name"
:min="1"
:max="9999"
:precision="0"
:step="1"
label="请输入数量"
></el-input-number>
<span style="font-size: 20px; margin-left: 14px">时通知我</span>
</el-form-item>
<el-form-item label="通知方式:" prop="value">
<el-radio v-model="ruleForm.value" label="1">系统通知</el-radio>
<el-radio v-model="ruleForm.value" label="2">短信通知</el-radio>
</el-form-item> -->
</el-form>
</div>
</obj-modal>
</div>
</template>
<script>
import { debounce, cloneDeep } from "lodash";
export default {
components: {},
data() {
return {
isAdd: true,
//
modalConfig: {
title: "订单详情",
show: false,
width: "800px",
},
modalData: {},
ruleForm: {
name: "",
value: "1",
},
rules: {
name: [{ required: true, message: "请输入属性名称", trigger: "blur" }],
value: [
{
required: true,
message: "请输入属性内容",
trigger: "blur",
},
],
},
};
},
methods: {
queryTableData(pageNo, pageSize) {},
toggle(e) {
if (this.modalConfig.show == false) {
this.modalConfig.show = true;
} else {
this.modalConfig.show = false;
}
if (e) {
this.init(cloneDeep(e.row));
}
return {
add: (data) => {
this.modalConfig.title = "订单详情";
this.isAdd = true;
},
update: () => {
this.isAdd = false;
},
};
},
init(row) {
this.modalData = row;
},
},
computed: {
modalHandles() {
return [
{
label: "取消",
handle: () => {
this.toggle();
},
},
{
label: "确认",
type: "primary",
// submit: true,
handle: () => {
this.$refs.ruleForm.validate((valid) => {
if (valid) {
this.$emit("getAttribute", this.ruleForm);
this.toggle();
}
});
},
},
];
},
},
asyncComputed: {},
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<div v-if="isShopId" style="height: calc(100vh - 200px)"> <div v-if="isMerchant" style="height: calc(100vh - 200px)">
<obj-table-plus <obj-table-plus
ref="oTable" ref="oTable"
style="height: 100%" style="height: 100%"
@ -13,9 +13,9 @@
> >
<template slot="tableTop"> <template slot="tableTop">
<el-form :inline="true" :model="formInline" class="demo-form-inline"> <el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-row v-if="marketList.length > 0"> <el-row v-if="storeList.length > 1">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="菜市场"> <!-- <el-form-item label="菜市场">
<el-select <el-select
@change="getData" @change="getData"
v-model="formInline.marketId" v-model="formInline.marketId"
@ -28,7 +28,7 @@
:value="item.marketId" :value="item.marketId"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item> -->
<el-form-item label="店铺"> <el-form-item label="店铺">
<el-select <el-select
v-model="formInline.shopId" v-model="formInline.shopId"
@ -43,19 +43,13 @@
</el-select> </el-form-item </el-select> </el-form-item
></el-col> ></el-col>
</el-row> </el-row>
<el-form-item label="商品ID">
<el-input
v-model="formInline.name"
placeholder="商品ID搜索"
></el-input>
</el-form-item>
<el-form-item label="商品名称"> <el-form-item label="商品名称">
<el-input <el-input
v-model="formInline.name" v-model="formInline.name"
placeholder="商品名称搜索" placeholder="商品名称搜索"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="状态"> <!-- <el-form-item label="状态">
<el-select v-model="formInline.status" placeholder="请选择状态"> <el-select v-model="formInline.status" placeholder="请选择状态">
<el-option <el-option
v-for="item in statusList" v-for="item in statusList"
@ -64,7 +58,7 @@
:value="item.value" :value="item.value"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item> -->
<el-form-item> <el-form-item>
<el-button type="primary" @click="$refs.oTable.reload()" <el-button type="primary" @click="$refs.oTable.reload()"
>查询</el-button >查询</el-button
@ -123,6 +117,7 @@
<script> <script>
// import AddDiscount from "./popup/add-discount.vue"; // import AddDiscount from "./popup/add-discount.vue";
// import AddPrice from "./popup/add-price.vue"; // import AddPrice from "./popup/add-price.vue";
import { mapState } from "vuex";
import AddOrUpdate from "./popup/add-or-update.vue"; import AddOrUpdate from "./popup/add-or-update.vue";
import earlyWarning from "./popup/early-warning.vue"; import earlyWarning from "./popup/early-warning.vue";
export default { export default {
@ -137,7 +132,6 @@ export default {
marketId: "", marketId: "",
shopId: "", shopId: "",
}, },
marketList: [],
tableProp: { tableProp: {
"auto-resize": true, "auto-resize": true,
border: true, border: true,
@ -169,43 +163,29 @@ export default {
], ],
productFilterType: "SALE", productFilterType: "SALE",
selectList: [], selectList: [],
isShopId: "",
storeList: [],
}; };
}, },
created() { created() {
if (JSON.parse(sessionStorage.getItem("userInfo")).markets?.length > 0) { this.formInline = {
this.isShopId = true; marketId: this.marketId,
this.formInline.marketId = JSON.parse( shopId: this.shopId,
sessionStorage.getItem("userInfo") };
).markets[0].marketId; this.$nextTick(() => {
this.marketList = JSON.parse(sessionStorage.getItem("userInfo")).markets; this.$refs.oTable.reload();
console.log(this.marketList); });
this.getData();
} else if (JSON.parse(sessionStorage.getItem("userInfo")).shopId) {
(this.formInline.shopId = JSON.parse(
sessionStorage.getItem("userInfo")
).shopId),
(this.isShopId = true);
this.$nextTick(() => {
this.$refs.oTable.reload();
});
} else {
this.isShopId = false;
}
}, },
methods: { methods: {
getData() { // getData() {
this.$api.mer_admin // this.$api.mer_admin
.storeList({ marketId: this.formInline.marketId }) // .storeList({ marketId: this.formInline.marketId })
.then((res) => { // .then((res) => {
this.storeList = res.data.data; // this.storeList = res.data.data;
this.formInline.shopId = res.data.data[0].shopId; // this.formInline.shopId = res.data.data[0].shopId;
this.$nextTick(() => { // this.$nextTick(() => {
this.$refs.oTable.reload(); // this.$refs.oTable.reload();
}); // });
}); // });
}, // },
addProduct() { addProduct() {
this.$refs.addOrUpdate.toggle().add(); this.$refs.addOrUpdate.toggle().add();
}, },
@ -256,8 +236,8 @@ export default {
Reset() { Reset() {
this.formInline = { this.formInline = {
name: "", name: "",
marketId: JSON.parse(sessionStorage.getItem("userInfo")).markets[0] marketId: this.marketId,
.marketId, shopId: this.shopId,
}; };
this.$refs.oTable.reload(); this.$refs.oTable.reload();
}, },
@ -355,6 +335,7 @@ export default {
(item) => item.presalePrice (item) => item.presalePrice
) )
)} )}
</span> </span>
); );
} else { } else {
@ -366,13 +347,14 @@ export default {
(item) => item.presalePrice (item) => item.presalePrice
) )
)} )}
~
{Math.max.apply( {Math.max.apply(
Math, Math,
row.productSpecificationList.map( row.productSpecificationList.map(
(item) => item.presalePrice (item) => item.presalePrice
) )
)} )}{" "}
</span> </span>
); );
} }
@ -402,6 +384,7 @@ export default {
(item) => item.earnestMoney (item) => item.earnestMoney
) )
)} )}
</span> </span>
); );
} else { } else {
@ -412,14 +395,15 @@ export default {
row.productSpecificationList.map( row.productSpecificationList.map(
(item) => item.earnestMoney (item) => item.earnestMoney
) )
)} )}{" "}
~
{Math.max.apply( {Math.max.apply(
Math, Math,
row.productSpecificationList.map( row.productSpecificationList.map(
(item) => item.earnestMoney (item) => item.earnestMoney
) )
)} )}{" "}
</span> </span>
); );
} }
@ -449,6 +433,7 @@ export default {
(item) => item.balancePayment (item) => item.balancePayment
) )
)} )}
</span> </span>
); );
} else { } else {
@ -460,13 +445,14 @@ export default {
(item) => item.balancePayment (item) => item.balancePayment
) )
)} )}
~
{Math.max.apply( {Math.max.apply(
Math, Math,
row.productSpecificationList.map( row.productSpecificationList.map(
(item) => item.balancePayment (item) => item.balancePayment
) )
)} )}
</span> </span>
); );
} }
@ -555,6 +541,13 @@ export default {
}, },
}; };
}, },
...mapState("userData", [
"isMerchant",
"marketList",
"storeList",
"marketId",
"shopId",
]),
}, },
}; };
</script> </script>