Commit b2a670ce authored by lixy's avatar lixy

营地上架、下架

parent 2f686237
...@@ -118,6 +118,17 @@ export function addCampsiteShop(params) { ...@@ -118,6 +118,17 @@ export function addCampsiteShop(params) {
}); });
} }
/**
* 营地上架、下架
* */
export function saleStatus(query) {
return fetch({
url: '/api/campsite/admin/campsiteShop/saleStatus',
method: 'put',
params: query
});
}
/** /**
* 判断营地名称是否已存在 * 判断营地名称是否已存在
* @param id * @param id
......
...@@ -66,9 +66,9 @@ ...@@ -66,9 +66,9 @@
<template scope="scope"> <template scope="scope">
<el-button size="small" type="success" @click="handleUpdate(scope.row)">编辑 <el-button size="small" type="success" @click="handleUpdate(scope.row)">编辑
</el-button> </el-button>
<el-button size="small" type="primary" v-if="scope.row.status==2|| scope.row.status==0" @click="upStatus(scope.row)">上架 <el-button size="small" type="primary" v-if="scope.row.saleState==2|| scope.row.saleState==0" @click="upStatus(scope.row)">上架
</el-button> </el-button>
<el-button size="small" type="warn" v-if="scope.row.status==1" @click="upStatus(scope.row)">下架 <el-button size="small" type="warn" v-if="scope.row.saleState==1" @click="upStatus(scope.row)">下架
</el-button> </el-button>
<el-popover <el-popover
ref="popover5" ref="popover5"
...@@ -120,7 +120,8 @@ ...@@ -120,7 +120,8 @@
} from 'utils/auth'; } from 'utils/auth';
import { import {
getCampsiteList, getCampsiteList,
delCampsiteShop delCampsiteShop,
saleStatus
} from 'api/campsiteManage'; } from 'api/campsiteManage';
import Element1 from "../admin/menu/components/element"; import Element1 from "../admin/menu/components/element";
import ElRow from "element-ui/packages/row/src/row"; import ElRow from "element-ui/packages/row/src/row";
...@@ -212,9 +213,9 @@ import { ...@@ -212,9 +213,9 @@ import {
upStatus(row){ upStatus(row){
let params = { let params = {
id: row.id, id: row.id,
status: row.status==1?2:1 status: row.saleState==1?2:1
}; };
upStatusChange(params).then(response => { saleStatus(params).then(response => {
if (response.status === 200) { if (response.status === 200) {
this.$notify({ this.$notify({
title: '成功', title: '成功',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment