后台产品新增上下架功能

This commit is contained in:
2026-04-01 16:47:45 +08:00
parent d31f7ecb76
commit 5344f6deeb
12 changed files with 251 additions and 11 deletions

View File

@@ -48,3 +48,12 @@ export const update = (row) => {
})
}
export const applyStatus = (id) => {
return request({
url: '/common/tourism-spot/applyStatus',
method: 'post',
params: {
id,
}
})
}

View File

@@ -48,3 +48,12 @@ export const update = (row) => {
})
}
export const applyStatus = (id) => {
return request({
url: '/common/merchant-store/applyStatus',
method: 'post',
params: {
id,
}
})
}

View File

@@ -48,3 +48,13 @@ export const update = (row) => {
})
}
export const applyStatus = (id) => {
return request({
url: '/common/news-content/applyStatus',
method: 'post',
params: {
id,
}
})
}

View File

@@ -48,3 +48,12 @@ export const update = (row) => {
})
}
export const applyStatus = (id) => {
return request({
url: '/common/tour-product/applyStatus',
method: 'post',
params: {
id,
}
})
}

View File

@@ -1,5 +1,7 @@
import request from '@/axios';
export const getList = (current, size, params) => {
return request({
url: '/mall/directMall/page',
@@ -48,3 +50,12 @@ export const update = (row) => {
})
}
export function applyStatus(id) {
return request({
url: '/mall/product/applyStatus',
method: 'post',
params: {
id,
}
})
}

View File

@@ -48,3 +48,12 @@ export const update = (row) => {
})
}
export function applyStatus(id) {
return request({
url: '/mall/product/applyStatus',
method: 'post',
params: {
id,
}
})
}

View File

@@ -32,12 +32,20 @@
<!-- @click="handleExport">导 出-->
<!-- </el-button>-->
</template>
<template #menu="{ row }">
<el-button type="text"
icon="el-icon-circle-check"
@click.stop="toggleStatus(row)"> {{ row.status === 1 ? '下架' : '上架' }}
</el-button>
</template>
</avue-crud>
</basic-container>
</template>
<script>
import {getList, getDetail, add, update, remove} from "@/api/common/culturalTourismSpot";
import {getList, getDetail, add, update, remove , applyStatus} from "@/api/common/culturalTourismSpot";
import option from "@/option/common/culturalTourismSpot";
import {mapGetters} from "vuex";
import {exportBlob} from "@/api/common";
@@ -216,7 +224,30 @@
this.loading = false;
this.selectionClear();
});
}
},
toggleStatus(row){
let status = row.status === 1 ? '下架' : '上架';
this.$confirm("确定将" + row.spotName +status + "吗?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return applyStatus(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
}
};
</script>

View File

@@ -32,12 +32,20 @@
<!-- @click="handleExport">导 出-->
<!-- </el-button>-->
</template>
<template #menu="{ row }">
<el-button type="text"
icon="el-icon-circle-check"
@click.stop="toggleStatus(row)"> {{ row.status === 1 ? '下架' : '上架' }}
</el-button>
</template>
</avue-crud>
</basic-container>
</template>
<script>
import {getList, getDetail, add, update, remove} from "@/api/common/merchantFlagshipStore";
import {getList, getDetail, add, update, remove , applyStatus} from "@/api/common/merchantFlagshipStore";
import option from "@/option/common/merchantFlagshipStore";
import {mapGetters} from "vuex";
import {exportBlob} from "@/api/common";
@@ -227,6 +235,28 @@
});
},
toggleStatus(row){
let status = row.status === 1 ? '下架' : '上架';
this.$confirm("确定将" + row.storeName +status + "吗?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return applyStatus(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
}
};
</script>

View File

@@ -32,12 +32,21 @@
<!-- @click="handleExport">导 出-->
<!-- </el-button>-->
</template>
<template #menu="{ row }">
<el-button type="text"
icon="el-icon-circle-check"
@click.stop="toggleStatus(row)"> {{ row.status === 1 ? '下架' : '上架' }}
</el-button>
</template>
</avue-crud>
</basic-container>
</template>
<script>
import {getList, getDetail, add, update, remove} from "@/api/common/newsContent";
import {getList, getDetail, add, update, remove , applyStatus} from "@/api/common/newsContent";
import option from "@/option/common/newsContent";
import {mapGetters} from "vuex";
import {exportBlob} from "@/api/common";
@@ -254,7 +263,29 @@
this.loading = false;
this.selectionClear();
});
}
},
toggleStatus(row){
let status = row.status === 1 ? '下架' : '上架';
this.$confirm("确定将" + row.title +status + "吗?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return applyStatus(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
}
};
</script>

View File

@@ -32,12 +32,21 @@
<!-- @click="handleExport">导 出-->
<!-- </el-button>-->
</template>
<template #menu="{ row }">
<el-button type="text"
icon="el-icon-circle-check"
@click.stop="toggleStatus(row)"> {{ row.status === 1 ? '下架' : '上架' }}
</el-button>
</template>
</avue-crud>
</basic-container>
</template>
<script>
import {getList, getDetail, add, update, remove} from "@/api/common/tourProduct";
import {getList, getDetail, add, update, remove , applyStatus} from "@/api/common/tourProduct";
import option from "@/option/common/tourProduct";
import {mapGetters} from "vuex";
import {exportBlob} from "@/api/common";
@@ -219,7 +228,29 @@
this.loading = false;
this.selectionClear();
});
}
},
toggleStatus(row){
let status = row.status === 1 ? '下架' : '上架';
this.$confirm("确定将" + row.productName + status + "吗?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return applyStatus(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
}
};
</script>

View File

@@ -32,12 +32,19 @@
<!-- @click="handleExport">导 出-->
<!-- </el-button>-->
</template>
<template #menu="{ row }">
<el-button type="text"
icon="el-icon-circle-check"
@click.stop="toggleStatus(row)"> {{ row.status === 1 ? '下架' : '上架' }}
</el-button>
</template>
</avue-crud>
</basic-container>
</template>
<script>
import {getList, getDetail, add, update, remove} from "@/api/mall/ecosystemProduct";
import {getList, getDetail, add, update, remove , applyStatus} from "@/api/mall/ecosystemProduct";
import option from "@/option/mall/ecosystemProduct";
import {mapGetters} from "vuex";
import {exportBlob} from "@/api/common";
@@ -216,7 +223,28 @@
this.loading = false;
this.selectionClear();
});
}
},
toggleStatus(row){
let status = row.status === 1 ? '下架' : '上架';
this.$confirm("确定将" + row.productName +status + "吗?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return applyStatus(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
}
};
</script>

View File

@@ -32,12 +32,21 @@
@click="handleExport">导 出
</el-button>
</template>
<template #menu="{ row }">
<el-button type="text"
icon="el-icon-circle-check"
@click.stop="toggleStatus(row)"> {{ row.status === 1 ? '下架' : '上架' }}
</el-button>
</template>
</avue-crud>
</basic-container>
</template>
<script>
import {getList, getDetail, add, update, remove} from "@/api/mall/directMall";
import {getList, getDetail, add, update, remove , applyStatus} from "@/api/mall/directMall";
import option from "@/option/mall/directMall";
import {mapGetters} from "vuex";
import {exportBlob} from "@/api/common";
@@ -216,7 +225,30 @@
this.loading = false;
this.selectionClear();
});
}
},
toggleStatus(row){
let status = row.status === 1 ? '下架' : '上架';
this.$confirm("确定将" + row.productName +status + "吗?", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
return applyStatus(row.id);
})
.then(() => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
});
},
}
};
</script>