Commit 52c0826d by lixiaomin

店铺和商品列表按钮v-if改成v-show

parent b9840196
File added
......@@ -191,3 +191,35 @@ export function updateSpecState(ids,state,shopId,goodsId) {
method: "get",
});
}
// 店铺开始营业
export function shopOpen(id) {
return request({
url: "/system/shop/open/" + id,
method: "get",
});
}
// 店铺关闭营业
export function shopClose(id) {
return request({
url: "/system/shop/close/" + id,
method: "get",
});
}
// 店铺恢复营业
export function shopRestore(id) {
return request({
url: "/system/shop/restore/" + id,
method: "get",
});
}
// 店铺设置默认
export function shopDefault(id) {
return request({
url: "/system/shop/default/" + id,
method: "get",
});
}
......@@ -72,14 +72,14 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="handleUpdateState(scope.row)"
v-if="authBtn(['1'], scope.row.state)" v-hasPermi="['system:goods:finish']">已完成编程</el-button>
v-show="authBtn(['1'], scope.row.state)" v-hasPermi="['system:goods:finish']">已完成编程</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-if="authBtn(['1', '2', '3', '4'], scope.row.state)" v-hasPermi="['system:goods:remove']">删除</el-button>
<el-button size="mini" type="text" v-if="authBtn(['2', '4'], scope.row.state)"
v-show="authBtn(['1', '2', '3', '4'], scope.row.state)" v-hasPermi="['system:goods:remove']">删除</el-button>
<el-button size="mini" type="text" v-show="authBtn(['2', '4'], scope.row.state)"
@click="putShopOffShop(scope.row.id, true)" v-hasPermi="['system:goods:up']">上架</el-button>
<el-button size="mini" type="text" v-if="authBtn(['3'], scope.row.state)"
<el-button size="mini" type="text" v-show="authBtn(['3'], scope.row.state)"
@click="putShopOffShop(scope.row.id)" v-hasPermi="['system:goods:down']">下架</el-button>
<el-button size="mini" type="text" v-if="authBtn(['5'], scope.row.state)" @click="restGoods(scope.row)"
<el-button size="mini" type="text" v-show="authBtn(['5'], scope.row.state)" @click="restGoods(scope.row)"
v-hasPermi="['system:goods:recover']">恢复
</el-button>
</template>
......
......@@ -69,7 +69,7 @@
</el-table-column>
<el-table-column width="200" label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="text" v-if="authBtn(['2','3','4','5','6','7','10','13','14'], scope.row.state)"
<el-button size="mini" type="text" v-show="authBtn(['2','3','4','5','6','7','10','13','14'], scope.row.state)"
@click="refundClick(scope.row)" v-hasPermi="['system:order:refund']">退款</el-button>
</template>
</el-table-column>
......
......@@ -80,17 +80,17 @@
<template slot-scope="scope">
<el-button v-show="scope.row.state !=3" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['system:shop:remove']">删除</el-button>
<el-button size="mini" type="text" v-if="authBtn([1], scope.row.state)"
@click="setShopState(scope.row, 2, 'setState')" v-hasPermi="['system:shop:suspended']">
<el-button size="mini" type="text" v-show="authBtn([1], scope.row.state)"
@click="shopClose(scope.row)" v-hasPermi="['system:shop:suspended']">
暂停营业</el-button>
<el-button size="mini" type="text" v-if="authBtn([2], scope.row.state)"
@click="setShopState(scope.row, 1, 'setState')" v-hasPermi="['system:shop:start']">开始营业</el-button>
<el-button size="mini" type="text" v-if="authBtn([3], scope.row.state)"
@click="setShopState(scope.row, 1, 'setState')" v-hasPermi="['system:shop:restart']">恢复营业</el-button>
<el-button v-show="scope.row.isDefault==0" size="mini" type="text" @click="setShopState(scope.row)" v-hasPermi="['system:shop:default']">设为默认</el-button>
<el-button size="mini" type="text" v-if="authBtn([0], scope.row.state)"
<el-button size="mini" type="text" v-show="authBtn([2], scope.row.state)"
@click="shopOpen(scope.row)" v-hasPermi="['system:shop:start']">开始营业</el-button>
<el-button size="mini" type="text" v-show="authBtn([3], scope.row.state)"
@click="shopRestore(scope.row)" v-hasPermi="['system:shop:restart']">恢复营业</el-button>
<el-button v-show="scope.row.isDefault==0" size="mini" type="text" @click="shopDefault(scope.row)" v-hasPermi="['system:shop:default']">设为默认</el-button>
<el-button size="mini" type="text" v-show="authBtn([0], scope.row.state)"
@click="testFinish(scope.row)" v-hasPermi="['system:shop:testFinish']">测试完成</el-button>
<el-button size="mini" type="text" v-if="authBtn([2], scope.row.state)"
<el-button size="mini" type="text" v-show="authBtn([2], scope.row.state)"
@click="testStart(scope.row)" v-hasPermi="['system:shop:testStart']">开始测试</el-button>
</template>
</el-table-column>
......@@ -102,7 +102,7 @@
</template>
<script>
import {listShop,delShop,updateShop,getShopCity,testFinish,testStart} from "@/api/system/shop";
import {listShop,delShop,updateShop,getShopCity,testFinish,testStart,shopOpen,shopClose,shopRestore,shopDefault} from "@/api/system/shop";
import SetShop from './setShop';
import piovince from '@/utils/piovince'
export default {
......@@ -253,21 +253,37 @@ export default {
openSet(id) {
this.$refs.setShop.openModal(id)
},
setShopState(data, state, type) {
let params = { ...data }
if (type == 'setState') {
params.state = state;
params.isDelete = '0';
} else {
params.isDefault = 1
shopOpen(row){
shopOpen(row.id).then(res => {
if(res.code="200"){
this.$modal.msgSuccess("操作成功!");
this.getList();
}
updateShop(params).then(res => {
})
},
shopClose(row){
shopClose(row.id).then(res => {
if(res.code="200"){
this.$modal.msgSuccess("操作成功!");
this.getList();
}
})
},
shopRestore(row){
shopRestore(row.id).then(res => {
if(res.code="200"){
this.$modal.msgSuccess("操作成功!");
this.getList();
}
})
},
shopDefault(row){
shopDefault(row.id).then(res => {
if(res.code="200"){
this.$modal.msgSuccess("操作成功!");
this.getList();
}
})
},
//测试完成
testFinish(row){
......
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