提交 3d63519c 编写于 作者: chendeli's avatar chendeli

商品管理ui

上级 b03a8146
此差异已折叠。
...@@ -40,14 +40,19 @@ ...@@ -40,14 +40,19 @@
<el-col :span="6" style="text-align: right"> <el-col :span="6" style="text-align: right">
<el-button type="primary" size="small" @click="batchOpt(3)">批量导入</el-button> <el-button type="primary" size="small" @click="batchOpt(3)">批量导入</el-button>
<el-button type="primary" size="small" @click="createShop">新建单个商品</el-button> <el-button type="primary" size="small" @click="edit('add')">新建单个商品</el-button>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<el-table :data="tableData" class="item-table" style="width: 100%;margin-top: 10px;"> <el-table :data="tableData" class="item-table" style="width: 100%;margin-top: 10px;" @selection-change="handleSelectionChange">
<el-table-column prop="id" label="商品ID" min-width="100" align="center"></el-table-column> <el-table-column
<el-table-column prop="name" label="商品名称" min-width="100" align="center"></el-table-column> type="selection"
fixed
width="55">
</el-table-column>
<el-table-column prop="id" label="商品ID" width="120" align="center"></el-table-column>
<el-table-column prop="name" label="商品名称" min-width="140" align="center"></el-table-column>
<el-table-column prop="type" label="商品类型" min-width="100" align="center"> <el-table-column prop="type" label="商品类型" min-width="100" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.type | dynamicFlagStatus }}</span> <span>{{ scope.row.type | dynamicFlagStatus }}</span>
...@@ -67,12 +72,12 @@ ...@@ -67,12 +72,12 @@
<el-table-column prop="num" label="价格" min-width="120" align="center"> <el-table-column prop="num" label="价格" min-width="120" align="center">
111 111
</el-table-column> </el-table-column>
<el-table-column prop="createdTime" label="发布时间" min-width="100" align="center"> <el-table-column prop="createdTime" label="发布时间" width="150" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ scope.row.createdTime | liveDateFilter }}</span> <span>{{ scope.row.createdTime | liveDateFilter }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" min-width="370" align="center"> <el-table-column label="操作" min-width="370" align="center" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<el-button @click="edit(scope.row)" type="text" size="small">编辑</el-button> <el-button @click="edit(scope.row)" type="text" size="small">编辑</el-button>
...@@ -121,7 +126,7 @@ ...@@ -121,7 +126,7 @@
:before-remove="beforeRemove" :before-remove="beforeRemove"
multiple multiple
:limit="3" :limit="3"
:on-exceed="handleExceed"
:file-list="fileList"> :file-list="fileList">
<i class="el-icon-upload"></i>上传 <i class="el-icon-upload"></i>上传
</el-upload> </el-upload>
...@@ -156,6 +161,7 @@ ...@@ -156,6 +161,7 @@
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
}, },
fileList:[],
totalRows: 0, totalRows: 0,
tableData: [ tableData: [
{} {}
...@@ -177,6 +183,12 @@ ...@@ -177,6 +183,12 @@
// this.searchList(); // this.searchList();
}, },
methods: { methods: {
handlePreview(){},
handleRemove(){},
beforeRemove(){},
handleSelectionChange(){
},
//批量 上下架操作 //批量 上下架操作
batchOpt(type){ batchOpt(type){
if(type == 3){//批量导入 if(type == 3){//批量导入
...@@ -184,9 +196,14 @@ ...@@ -184,9 +196,14 @@
} }
}, },
edit(row){ edit(row){
///create-good let url = ''
if(row == 'add'){
url = `/create-good?id=add`
}else{
url = `/create-good?id=${row.id}`
}
this.$router.push({ this.$router.push({
path: `/create-good` path: url
}) })
}, },
...@@ -251,18 +268,6 @@ ...@@ -251,18 +268,6 @@
searchList() { searchList() {
openLoading(this); openLoading(this);
let params = this.searchForm; let params = this.searchForm;
/* getRangeList(params).then((res) => {
closeLoading(this);
if(res.code == "000000") {
this.tableData = res.data.circleList;
this.totalRows = res.data.count;
} else {
this.tableData = [];
}
}).catch((error) => {
this.$message.error("请重试");
})*/
}, },
resetForm() { resetForm() {
...@@ -273,95 +278,8 @@ ...@@ -273,95 +278,8 @@
}; };
this.searchList(); this.searchList();
}, },
//新建店铺
createShop() {
this.$router.push({
path: `/create-good`
})
},
//上线
publishRange(row) {
this.$confirm(`确定上线“${row.name}”吗?`, '', {
confirmButtonText: '上线',
cancelButtonText: '取消',
type: 'warning',
customClass: 'range-make-box',
}).then(() => {
// confirm
this.updateStatus(row.id, "30");
}).catch(() => {
// cancel
// this.$message.error("上线失败");
});
},
//下线
unPublishRange(row) {
this.$confirm(`确定下线“${row.name}”吗?`, '', {
confirmButtonText: '下线',
cancelButtonText: '取消',
type: 'warning',
customClass: 'range-make-box',
}).then(() => {
this.updateStatus(row.id, "40");
// confirm
}).catch(() => {
// cancel
});
},
// 更新圈子状态(上线,下线)
updateStatus(id, status){
let params = {"id": id, "status": status};
updateRangeStatus(params).then((res) => {
closeLoading(this);
if(res.code == "000000") {
if(status == "40"){
this.$message.success("下线成功");
} else if(status == "30") {
this.$message.success("上线成功");
}else if(status == "50") {
this.$message.success("解散成功");
}
this.searchList();
} else {
if(status == "40"){
this.$message.error("下线失败,请重试");
} else if(status == "30") {
this.$message.error("上线失败,请重试");
}else if(status == "50") {
this.$message.error("解散失败,请重试");
}
}
}).catch((error) => {
if(status == "40"){
this.$message.error("下线失败,请重试");
} else if(status == "30") {
this.$message.error("上线失败,请重试");
}else if(status == "50") {
this.$message.error("解散失败,请重试");
}
})
},
//店铺管理
shopManage(row) {
this.$router.push({
path: '/role-manage?id=' + row.id,
})
},
//编辑
editShop(row) {
let enterType = 2;//1:add 2 edit
this.$router.push({
path: `/create-range?enterType`,
query:{
id:row.id,
enterType:enterType,
roleType: row.roleId
}
})
},
handleSizeChange(val) { handleSizeChange(val) {
this.searchForm.pageSize = val; this.searchForm.pageSize = val;
this.searchForm.pageNo = 1; this.searchForm.pageNo = 1;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册