Commit 9c23cb70 authored by jiaorz's avatar jiaorz

车型列表添加App显示按钮

parent 65760088
...@@ -132,6 +132,17 @@ export function updateVehicleModel(params) { ...@@ -132,6 +132,17 @@ export function updateVehicleModel(params) {
}); });
} }
/**
* App是否展示
* @param {Object} params
*/
export function updateAppShow(params) {
return fetch({
url: '/vehicle/vehicleModel/bg/updateAppShow',
method: 'post',
data: params
});
}
/* /*
* 新建一条车型数据 * 新建一条车型数据
* */ * */
......
...@@ -84,10 +84,12 @@ ...@@ -84,10 +84,12 @@
<template scope="scope"> <template scope="scope">
<el-button size="small" class="el-button el-button--text el-button--small" @click="handleUpdate(scope.row)">{{vehicleTypeList_btn_edit?'编辑':'查看'}} <el-button size="small" class="el-button el-button--text el-button--small" @click="handleUpdate(scope.row)">{{vehicleTypeList_btn_edit?'编辑':'查看'}}
</el-button> </el-button>
<el-button size="small"class="el-button el-button--text el-button--small" style="color: #6ce26c;" v-if="scope.row.status==2|| scope.row.status==0" @click="upStatus(scope.row)">上架 <el-button size="small" class="el-button el-button--text el-button--small" style="color: #6ce26c;" v-if="scope.row.status==2|| scope.row.status==0" @click="upStatus(scope.row)">上架
</el-button> </el-button>
<el-button size="small" class="el-button el-button--text el-button--small" style="color: #1d90e6" v-if="scope.row.status==1" @click="upStatus(scope.row)">下架 <el-button size="small" class="el-button el-button--text el-button--small" style="color: #1d90e6" v-if="scope.row.status==1" @click="upStatus(scope.row)">下架
</el-button> </el-button>
<el-button class="el-button el-button--text el-button--small" style="color:#1d90e6;" size="small" @click="handlerAppShow(scope.row)" v-if="scope.row.appShow==1">APP展示</el-button>
<el-button class="el-button el-button--text el-button--small" style="color:#1d90e6;" size="small" @click="handlerAppShow(scope.row)" v-if="scope.row.appShow==0">APP不展示</el-button>
<el-button class="el-button el-button--text el-button--small" style="color:red;" size="small" @click="deleteHandler(scope.row)" v-if="vehicleTypeList_btn_del">删除</el-button> <el-button class="el-button el-button--text el-button--small" style="color:red;" size="small" @click="deleteHandler(scope.row)" v-if="vehicleTypeList_btn_del">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -150,7 +152,8 @@ ...@@ -150,7 +152,8 @@
getLabelList, getLabelList,
getLabelByParentId, getLabelByParentId,
upStatusChange, upStatusChange,
updateVehicleModel updateVehicleModel,
updateAppShow
} from 'api/vehicleType'; } from 'api/vehicleType';
import Element1 from "../admin/menu/components/element"; import Element1 from "../admin/menu/components/element";
...@@ -257,6 +260,48 @@ ...@@ -257,6 +260,48 @@
}); });
} }
}); });
},
/**
* 是否在App展示
* @param {Object} row
*/
handlerAppShow(row) {
var text = "";
if (row.appShow == 0) {
text = "确定设置为在App展示吗?";
} else {
text = "确定设置为不在App展示吗?";
}
var status = row.appShow == 0 ? 1 : 0;
var param = {
"id" : row.id,
"appShow" : status
}
this.$confirm(text, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
updateAppShow(param).then(response => {
if (response.status === 200) {
this.$notify({
title: '成功',
message: '设置成功',
type: 'success',
duration: 2000
});
this.bannerDialogVisible = false;
this.getList();
} else {
this.$notify({
title: '设置失败',
message: rsCode.msg[response.code] ? rsCode.msg[response.code] : '操作失败!',
type: 'error',
duration: 2000
});
}
});
})
}, },
/** /**
* 删除 * 删除
......
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