2022.8.6
This commit is contained in:
parent
b9ee4638d5
commit
a8234cdbba
2
resources/frontend/package-lock.json
generated
2
resources/frontend/package-lock.json
generated
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "hello-world",
|
"name": "ERP系统",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
"axios": "^0.21.1",
|
"axios": "^0.21.1",
|
||||||
"core-js": "^3.6.5",
|
"core-js": "^3.6.5",
|
||||||
"echarts": "^5.3.2",
|
"echarts": "^5.3.2",
|
||||||
"element-ui": "^2.15.8",
|
"element-ui": "^2.15.6",
|
||||||
"js-cookie": "^3.0.1",
|
"js-cookie": "^3.0.1",
|
||||||
"nprogress": "^0.2.0",
|
"nprogress": "^0.2.0",
|
||||||
"vue": "^2.6.11",
|
"vue": "^2.6.11",
|
||||||
|
|||||||
@ -1,19 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<router-view/>
|
<router-view />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { getToken } from '@/util/auth'
|
import { getToken } from "@/util/auth";
|
||||||
export default {
|
export default {
|
||||||
created () {
|
created() {
|
||||||
if (!getToken()) {
|
if (!getToken()) {
|
||||||
this.$router.push({ name: 'logo' })
|
this.$router.push({ name: "logo" });
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss"></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
101
resources/frontend/src/api/rankingData.js
vendored
101
resources/frontend/src/api/rankingData.js
vendored
@ -7,7 +7,7 @@
|
|||||||
* @FilePath: /glxt/src/api/rankingData.js
|
* @FilePath: /glxt/src/api/rankingData.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import http from '@/util/http.js'
|
import http from "@/util/http.js";
|
||||||
// export function rankingData(data) {
|
// export function rankingData(data) {
|
||||||
// // 传递参数
|
// // 传递参数
|
||||||
// return http({
|
// return http({
|
||||||
@ -17,92 +17,91 @@ import http from '@/util/http.js'
|
|||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
|
|
||||||
export function postadd (params) {
|
export function postadd(params) {
|
||||||
// 传递id
|
// 传递id
|
||||||
return http({
|
return http({
|
||||||
url: '/api/admin/auth/login', // 传递id
|
url: "/api/admin/auth/login", // 传递id
|
||||||
method: 'post',
|
method: "post",
|
||||||
params: params
|
params: params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 列表
|
// 列表
|
||||||
export function store_list (params) {
|
export function store_list(params) {
|
||||||
return http({
|
return http({
|
||||||
url: '/api/admin/shopGroups',
|
url: "/api/admin/shopGroups",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: params
|
params: params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function storeDetail (params) {
|
export function storeDetail(params) {
|
||||||
return http({
|
return http({
|
||||||
url: '/storess/show',
|
url: "/storess/show",
|
||||||
method: 'get',
|
method: "get",
|
||||||
params: params
|
params: params,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 鲜花项目接口从这里开始
|
// 鲜花项目接口从这里开始
|
||||||
// 商品种类列表
|
// 商品种类列表
|
||||||
export function goods_types (data) {
|
export function goods_types(data) {
|
||||||
return http({
|
return http({
|
||||||
url: '/api/goods_types',
|
url: "/api/goods_types",
|
||||||
method: 'get',
|
method: "get",
|
||||||
data
|
data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 商品种类列表删除
|
// 商品种类列表删除
|
||||||
export function Delgoods_types (id) {
|
export function Delgoods_types(id) {
|
||||||
return http({
|
return http({
|
||||||
url: `/api/goods_types/${id}`,
|
url: `/api/goods_types/${id}`,
|
||||||
method: 'delete'
|
method: "delete",
|
||||||
|
});
|
||||||
})
|
|
||||||
}
|
}
|
||||||
// 新增种类
|
// 新增种类
|
||||||
export function Addgoods_types (data) {
|
export function Addgoods_types(data) {
|
||||||
return http({
|
return http({
|
||||||
url: '/api/goods_types/',
|
url: "/api/goods_types/",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data
|
data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 编辑种类
|
// 编辑种类
|
||||||
export function editGoods_types (id, data) {
|
export function editGoods_types(id, data) {
|
||||||
return http({
|
return http({
|
||||||
url: `/api/goods_types/${id}`,
|
url: `/api/goods_types/${id}`,
|
||||||
method: 'patch',
|
method: "patch",
|
||||||
data
|
data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 商品品牌列表
|
// 商品品牌列表
|
||||||
export function Brand_goods_types (data) {
|
export function Brand_goods_types(data) {
|
||||||
return http({
|
return http({
|
||||||
url: '/api/goods_brands',
|
url: "/api/goods_brands",
|
||||||
method: 'get',
|
method: "get",
|
||||||
data
|
data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 商品品牌列表删除
|
// 商品品牌列表删除
|
||||||
export function DelBrand_goods_types (id) {
|
export function DelBrand_goods_types(id) {
|
||||||
return http({
|
return http({
|
||||||
url: `/api/goods_brands/${id}`,
|
url: `/api/goods_brands/${id}`,
|
||||||
method: 'delete'
|
method: "delete",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 新增品牌
|
// 新增品牌
|
||||||
export function AddBrandgoods_types (data) {
|
export function AddBrandgoods_types(data) {
|
||||||
return http({
|
return http({
|
||||||
url: '/api/goods_brands',
|
url: "/api/goods_brands",
|
||||||
method: 'post',
|
method: "post",
|
||||||
data
|
data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
// 编辑品牌
|
// 编辑品牌
|
||||||
export function editBrand_types (id, data) {
|
export function editBrand_types(id, data) {
|
||||||
return http({
|
return http({
|
||||||
url: `/api/goods_brands/${id}`,
|
url: `/api/goods_brands/${id}`,
|
||||||
method: 'patch',
|
method: "patch",
|
||||||
data
|
data,
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
5
resources/frontend/src/util/http.js
vendored
5
resources/frontend/src/util/http.js
vendored
@ -28,7 +28,7 @@ instance.interceptors.request.use(
|
|||||||
// config.headers['content-type'] = 'application/json'
|
// config.headers['content-type'] = 'application/json'
|
||||||
config.headers.Authorization = 'Bearer ' + getToken() // 请求头
|
config.headers.Authorization = 'Bearer ' + getToken() // 请求头
|
||||||
NProgress.start()
|
NProgress.start()
|
||||||
console.log(config, '1111') // for debug
|
// console.log(config, '1111') // for debug
|
||||||
|
|
||||||
return config
|
return config
|
||||||
},
|
},
|
||||||
@ -45,14 +45,13 @@ instance.interceptors.response.use(
|
|||||||
NProgress.done()
|
NProgress.done()
|
||||||
const res = response.status
|
const res = response.status
|
||||||
// 对响应数据做点什么
|
// 对响应数据做点什么
|
||||||
console.log(response, '33333') // for debug
|
// console.log(response, '33333') // for debug
|
||||||
if (res === 200 || res === 201) {
|
if (res === 200 || res === 201) {
|
||||||
return response
|
return response
|
||||||
} else {
|
} else {
|
||||||
Message({
|
Message({
|
||||||
message: 'Error',
|
message: 'Error',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,148 +1,154 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="conent">
|
||||||
<el-card>
|
<!-- 新增按钮 -->
|
||||||
<el-button type="primary"
|
<div class="btn">
|
||||||
@click="handAdd">新增</el-button>
|
<el-button type="primary" @click="handAdd">新增</el-button>
|
||||||
<el-table ref="multipleTable"
|
</div>
|
||||||
|
<!-- 列表 -->
|
||||||
|
<div class="table">
|
||||||
|
<el-table
|
||||||
|
ref="multipleTable"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
tooltip-effect="dark"
|
tooltip-effect="dark"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@selection-change="handleSelectionChange">
|
@selection-change="handleSelectionChange"
|
||||||
<el-table-column type="selection"
|
>
|
||||||
width="55">
|
<el-table-column type="selection" width="55"> </el-table-column>
|
||||||
</el-table-column>
|
<el-table-column prop="name" label="商品品牌"> </el-table-column>
|
||||||
<el-table-column prop="name"
|
<el-table-column prop="" label="操作">
|
||||||
label="商品种类">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop=""
|
|
||||||
label="操作">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="primary"
|
<el-button type="primary" @click="handEdit(scope.row.id, scope.row)"
|
||||||
@click="handEdit(scope.row.id,scope.row)">编辑</el-button>
|
>编辑</el-button
|
||||||
<el-button type="danger"
|
>
|
||||||
@click="handdel(scope.row.id)">删除</el-button>
|
<el-button type="danger" @click="handdel(scope.row.id)"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</div>
|
||||||
<el-pagination @size-change="handleSizeChange"
|
|
||||||
@current-change="handleCurrentChange"
|
|
||||||
:current-page="page"
|
|
||||||
:page-sizes="[10, 20, 30, 40]"
|
|
||||||
:page-size="per_page"
|
|
||||||
:total="total"
|
|
||||||
layout="total, sizes, prev, pager, next, jumper">
|
|
||||||
</el-pagination>
|
|
||||||
<!-- 新增种类对话框 -->
|
<!-- 新增种类对话框 -->
|
||||||
<el-dialog title="新增种类"
|
<el-dialog title="新增种类" :visible.sync="dialogFormVisible">
|
||||||
:visible.sync="dialogFormVisible">
|
|
||||||
<el-form :model="form">
|
<el-form :model="form">
|
||||||
<el-form-item label="商品种类"
|
<el-form-item label="商品种类" :label-width="formLabelWidth">
|
||||||
:label-width="formLabelWidth">
|
<el-input v-model="form.kindName" autocomplete="off"></el-input>
|
||||||
<el-input v-model="form.kindName"
|
|
||||||
autocomplete="off"></el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer"
|
<div slot="footer" class="dialog-footer">
|
||||||
class="dialog-footer">
|
|
||||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||||
<el-button type="primary"
|
<el-button type="primary" @click="addSubmit">确 定</el-button>
|
||||||
@click="addSubmit">确 定</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 编辑 -->
|
<!-- 编辑 -->
|
||||||
<el-dialog title="编辑"
|
<el-dialog title="编辑" :visible.sync="dialogFormVisible1">
|
||||||
:visible.sync="dialogFormVisible1">
|
|
||||||
<el-form :model="form1">
|
<el-form :model="form1">
|
||||||
<el-form-item label="编辑种类"
|
<el-form-item label="编辑种类" :label-width="formLabelWidth1">
|
||||||
:label-width="formLabelWidth1">
|
<el-input v-model="form1.kindName1" autocomplete="off"></el-input>
|
||||||
<el-input v-model="form1.kindName1"
|
|
||||||
autocomplete="off"></el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer"
|
<div slot="footer" class="dialog-footer">
|
||||||
class="dialog-footer">
|
|
||||||
<el-button @click="dialogFormVisible1 = false">取 消</el-button>
|
<el-button @click="dialogFormVisible1 = false">取 消</el-button>
|
||||||
<el-button type="primary"
|
<el-button type="primary" @click="EditSubmit">确 定</el-button>
|
||||||
@click="EditSubmit">确 定</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 分页功能 -->
|
||||||
|
<div class="block">
|
||||||
|
<el-pagination
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
:current-page="current_page"
|
||||||
|
:page-sizes="[15, 50, 100]"
|
||||||
|
:page-size="per_page"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="Paginationdata.total"
|
||||||
|
>
|
||||||
|
</el-pagination>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
Brand_goods_types,
|
// Brand_goods_types,
|
||||||
DelBrand_goods_types,
|
DelBrand_goods_types,
|
||||||
AddBrandgoods_types,
|
AddBrandgoods_types,
|
||||||
editBrand_types,
|
editBrand_types,
|
||||||
} from '../../api/rankingData'
|
} from "../../api/rankingData";
|
||||||
|
import axios from "axios";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
id: '', //每一项的id
|
id: "", //每一项的id
|
||||||
page: 1,
|
|
||||||
per_page: 15,
|
|
||||||
tableData: [],
|
tableData: [],
|
||||||
multipleSelection: [],
|
multipleSelection: [],
|
||||||
currentPage4: 4,
|
|
||||||
dialogFormVisible: false,
|
dialogFormVisible: false,
|
||||||
dialogFormVisible1: false,
|
dialogFormVisible1: false,
|
||||||
form: {
|
form: {
|
||||||
kindName: '', //种类名
|
kindName: "", //种类名
|
||||||
},
|
},
|
||||||
form1: {
|
form1: {
|
||||||
kindName1: '', //种类名
|
kindName1: "", //种类名
|
||||||
},
|
},
|
||||||
formLabelWidth: '120px',
|
formLabelWidth: "120px",
|
||||||
formLabelWidth1: '120px',
|
formLabelWidth1: "120px",
|
||||||
newKind: [],
|
newKind: [],
|
||||||
}
|
Paginationdata: {}, //分页相关数据
|
||||||
|
current_page: 1, //当前页
|
||||||
|
per_page: 15, //每页显示数量
|
||||||
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getGoods_types()
|
this.getGoods_types();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 复选框按钮
|
// 复选框按钮
|
||||||
handleSelectionChange(val) {
|
handleSelectionChange(val) {
|
||||||
console.log(val)
|
console.log(val);
|
||||||
this.multipleSelection = val
|
this.multipleSelection = val;
|
||||||
},
|
},
|
||||||
// 分页
|
//分页功能
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
console.log(`每页 ${val} 条`)
|
//当前条数
|
||||||
|
this.per_page = val;
|
||||||
|
console.log(1111, val);
|
||||||
|
this.getGoods_types();
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
console.log(`当前页: ${val}`)
|
//当前页
|
||||||
|
this.current_page = val;
|
||||||
|
console.log(2222, val);
|
||||||
|
this.getGoods_types();
|
||||||
},
|
},
|
||||||
// 新增
|
// 新增
|
||||||
handAdd() {
|
handAdd() {
|
||||||
this.form.kindName = ''
|
this.form.kindName = "";
|
||||||
this.dialogFormVisible = true
|
this.dialogFormVisible = true;
|
||||||
},
|
},
|
||||||
// 确认新增
|
// 确认新增
|
||||||
addSubmit() {
|
addSubmit() {
|
||||||
var string
|
var string;
|
||||||
string = this.form.kindName.replace(/\s/g, ',').split(',')
|
string = this.form.kindName.replace(/\s/g, ",").split(",");
|
||||||
console.log(string, 'lkkkk')
|
console.log(string, "lkkkk");
|
||||||
AddBrandgoods_types({
|
AddBrandgoods_types({
|
||||||
names: string,
|
names: string,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: "success",
|
||||||
message: '添加成功',
|
message: "添加成功",
|
||||||
})
|
});
|
||||||
this.getGoods_types()
|
this.getGoods_types();
|
||||||
})
|
});
|
||||||
this.dialogFormVisible = false
|
this.dialogFormVisible = false;
|
||||||
},
|
},
|
||||||
// 编辑
|
// 编辑
|
||||||
handEdit(id, item) {
|
handEdit(id, item) {
|
||||||
this.id = id
|
this.id = id;
|
||||||
console.log('item', item)
|
console.log("item", item);
|
||||||
this.form1.kindName1 = item.name
|
this.form1.kindName1 = item.name;
|
||||||
this.dialogFormVisible1 = true
|
this.dialogFormVisible1 = true;
|
||||||
},
|
},
|
||||||
// 编辑确定按钮
|
// 编辑确定按钮
|
||||||
EditSubmit() {
|
EditSubmit() {
|
||||||
@ -150,50 +156,93 @@ export default {
|
|||||||
name: this.form1.kindName1,
|
name: this.form1.kindName1,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: "success",
|
||||||
message: '编辑成功',
|
message: "编辑成功",
|
||||||
})
|
});
|
||||||
this.getGoods_types()
|
this.getGoods_types();
|
||||||
})
|
});
|
||||||
this.dialogFormVisible1 = false
|
this.dialogFormVisible1 = false;
|
||||||
},
|
},
|
||||||
// 删除
|
// 删除
|
||||||
handdel(id) {
|
handdel(id) {
|
||||||
this.$confirm('确定删除此条商品种类吗?', '确认删除', {
|
this.$confirm("确定删除此条商品种类吗?", "确认删除", {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: "取消",
|
||||||
type: 'warning',
|
type: "warning",
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
DelBrand_goods_types(id).then((res) => {
|
DelBrand_goods_types(id).then((res) => {
|
||||||
this.getGoods_types()
|
this.getGoods_types();
|
||||||
})
|
});
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: "success",
|
||||||
message: '删除成功!',
|
message: "删除成功!",
|
||||||
})
|
});
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'info',
|
type: "info",
|
||||||
message: '已取消删除',
|
message: "已取消删除",
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
// 获取列表
|
// 获取列表
|
||||||
getGoods_types() {
|
getGoods_types() {
|
||||||
Brand_goods_types({
|
// Brand_goods_types({
|
||||||
page: this.page,
|
// // page: this.current_page,
|
||||||
|
// // per_page: this.per_page,
|
||||||
|
// data: {
|
||||||
|
// page: this.current_page,
|
||||||
|
// per_page: this.per_page,
|
||||||
|
// },
|
||||||
|
// }).then((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
// this.tableData = res.data.data;
|
||||||
|
// this.Paginationdata = res.data.data.length;
|
||||||
|
// });
|
||||||
|
axios
|
||||||
|
.get("/api/goods_brands", {
|
||||||
|
headers: {
|
||||||
|
Authorization:
|
||||||
|
"Bearer w1rr6IsxZIud46dIrGIivNAroFpqN52sSpXhk3azpPq2ZTbUXhgKTOLheoRm",
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
page: this.current_page,
|
||||||
per_page: this.per_page,
|
per_page: this.per_page,
|
||||||
}).then((res) => {
|
},
|
||||||
console.log('res=>>>>>>>>', res)
|
|
||||||
this.tableData = res.data.data
|
|
||||||
this.total = res.data.data.length
|
|
||||||
})
|
})
|
||||||
|
.then((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
this.tableData = res.data.data;
|
||||||
|
this.Paginationdata = res.data.meta;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="scss" scoped>
|
||||||
|
.conent {
|
||||||
|
width: 100%;
|
||||||
|
min-height: calc(100vh - 200px);
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
height: 104px;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.el-button {
|
||||||
|
width: 114px;
|
||||||
|
height: 44px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.table {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.block {
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,153 +1,156 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="conent">
|
||||||
<el-card>
|
<!-- 新增按钮 -->
|
||||||
<el-button type="primary"
|
<div class="btn">
|
||||||
@click="handAdd">新增</el-button>
|
<el-button type="primary" @click="handAdd">新增</el-button>
|
||||||
<el-table ref="multipleTable"
|
</div>
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<div class="table">
|
||||||
|
<el-table
|
||||||
|
ref="multipleTable"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
tooltip-effect="dark"
|
tooltip-effect="dark"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@selection-change="handleSelectionChange">
|
@selection-change="handleSelectionChange"
|
||||||
<el-table-column type="selection"
|
>
|
||||||
width="55">
|
<el-table-column type="selection" width="55"> </el-table-column>
|
||||||
</el-table-column>
|
<el-table-column prop="name" label="商品种类"> </el-table-column>
|
||||||
<el-table-column prop="name"
|
<el-table-column prop="" label="操作">
|
||||||
label="商品种类">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop=""
|
|
||||||
label="操作">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="primary"
|
<el-button type="primary" @click="handEdit(scope.row.id, scope.row)"
|
||||||
@click="handEdit(scope.row.id,scope.row)">编辑</el-button>
|
>编辑</el-button
|
||||||
<el-button type="danger"
|
>
|
||||||
@click="handdel(scope.row.id)">删除</el-button>
|
<el-button type="danger" @click="handdel(scope.row.id)"
|
||||||
|
>删除</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</div>
|
||||||
<el-pagination @size-change="handleSizeChange"
|
|
||||||
|
<!-- 新增种类对话框 -->
|
||||||
|
<el-dialog title="新增" :visible.sync="dialogFormVisible">
|
||||||
|
<el-form :model="form">
|
||||||
|
<el-form-item label="商品种类" :label-width="formLabelWidth">
|
||||||
|
<el-input v-model="form.kindName" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="addSubmit">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 编辑 -->
|
||||||
|
<el-dialog title="编辑" :visible.sync="dialogFormVisible1">
|
||||||
|
<el-form :model="form1">
|
||||||
|
<el-form-item label="编辑种类" :label-width="formLabelWidth1">
|
||||||
|
<el-input v-model="form1.kindName1" autocomplete="off"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogFormVisible1 = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="EditSubmit">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 分页功能 -->
|
||||||
|
<div class="block">
|
||||||
|
<el-pagination
|
||||||
|
@size-change="handleSizeChange"
|
||||||
@current-change="handleCurrentChange"
|
@current-change="handleCurrentChange"
|
||||||
:current-page="page"
|
:current-page="current_page"
|
||||||
|
:page-sizes="[15, 50, 100]"
|
||||||
:page-size="per_page"
|
:page-size="per_page"
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
:total="total">
|
:total="Paginationdata.total"
|
||||||
|
>
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
<!-- 新增种类对话框 -->
|
|
||||||
<el-dialog title="新增"
|
|
||||||
:visible.sync="dialogFormVisible">
|
|
||||||
<el-form :model="form">
|
|
||||||
<el-form-item label="商品种类"
|
|
||||||
:label-width="formLabelWidth">
|
|
||||||
<el-input v-model="form.kindName"
|
|
||||||
autocomplete="off"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer"
|
|
||||||
class="dialog-footer">
|
|
||||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
|
||||||
<el-button type="primary"
|
|
||||||
@click="addSubmit">确 定</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
|
||||||
<!-- 编辑 -->
|
|
||||||
<el-dialog title="编辑"
|
|
||||||
:visible.sync="dialogFormVisible1">
|
|
||||||
<el-form :model="form1">
|
|
||||||
<el-form-item label="编辑种类"
|
|
||||||
:label-width="formLabelWidth1">
|
|
||||||
<el-input v-model="form1.kindName1"
|
|
||||||
autocomplete="off"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer"
|
|
||||||
class="dialog-footer">
|
|
||||||
<el-button @click="dialogFormVisible1 = false">取 消</el-button>
|
|
||||||
<el-button type="primary"
|
|
||||||
@click="EditSubmit">确 定</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
goods_types,
|
// goods_types,
|
||||||
Delgoods_types,
|
Delgoods_types,
|
||||||
Addgoods_types,
|
Addgoods_types,
|
||||||
editGoods_types,
|
editGoods_types,
|
||||||
} from '../../api/rankingData'
|
} from "../../api/rankingData";
|
||||||
|
import axios from "axios";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
id: '', //每一项的id
|
id: "", //每一项的id
|
||||||
page: 1, //开始页
|
|
||||||
per_page: 10, //一页多少数据
|
|
||||||
total: 1,
|
|
||||||
tableData: [],
|
tableData: [],
|
||||||
multipleSelection: [],
|
multipleSelection: [],
|
||||||
currentPage4: 4,
|
|
||||||
dialogFormVisible: false,
|
dialogFormVisible: false,
|
||||||
dialogFormVisible1: false,
|
dialogFormVisible1: false,
|
||||||
form: {
|
form: {
|
||||||
kindName: '', //种类名
|
kindName: "", //种类名
|
||||||
},
|
},
|
||||||
form1: {
|
form1: {
|
||||||
kindName1: '', //种类名
|
kindName1: "", //种类名
|
||||||
},
|
},
|
||||||
formLabelWidth: '120px',
|
formLabelWidth: "120px",
|
||||||
formLabelWidth1: '120px',
|
formLabelWidth1: "120px",
|
||||||
newKind: [],
|
newKind: [],
|
||||||
}
|
Paginationdata: {}, //分页相关数据
|
||||||
|
current_page: 1, //当前页
|
||||||
|
per_page: 15, //每页显示数量
|
||||||
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getGoods_types()
|
this.getGoods_types();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 复选框按钮
|
// 复选框按钮
|
||||||
handleSelectionChange(val) {
|
handleSelectionChange(val) {
|
||||||
console.log(val)
|
console.log(val);
|
||||||
this.multipleSelection = val
|
this.multipleSelection = val;
|
||||||
},
|
},
|
||||||
// 分页
|
|
||||||
|
//分页功能
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
console.log(`每页 ${val} 条`)
|
//当前条数
|
||||||
this.per_page = val
|
this.per_page = val;
|
||||||
this.page = 1
|
console.log(1111, val);
|
||||||
this.getGoods_types()
|
this.getGoods_types();
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
console.log(`当前页: ${val}`)
|
//当前页
|
||||||
this.page = val
|
this.current_page = val;
|
||||||
this.getGoods_types()
|
console.log(2222, val);
|
||||||
|
this.getGoods_types();
|
||||||
},
|
},
|
||||||
// 新增
|
// 新增
|
||||||
handAdd() {
|
handAdd() {
|
||||||
this.form.kindName = ''
|
this.form.kindName = "";
|
||||||
this.dialogFormVisible = true
|
this.dialogFormVisible = true;
|
||||||
},
|
},
|
||||||
// 确认新增
|
// 确认新增
|
||||||
addSubmit() {
|
addSubmit() {
|
||||||
var string
|
var string;
|
||||||
string = this.form.kindName.replace(/\s/g, ',').split(',')
|
string = this.form.kindName.replace(/\s/g, ",").split(",");
|
||||||
console.log(string, 'lkkkk')
|
console.log(string, "lkkkk");
|
||||||
Addgoods_types({
|
Addgoods_types({
|
||||||
names: string,
|
names: string,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: "success",
|
||||||
message: '添加成功',
|
message: "添加成功",
|
||||||
})
|
});
|
||||||
this.getGoods_types()
|
this.getGoods_types();
|
||||||
})
|
});
|
||||||
this.dialogFormVisible = false
|
this.dialogFormVisible = false;
|
||||||
},
|
},
|
||||||
// 编辑
|
// 编辑
|
||||||
handEdit(id, item) {
|
handEdit(id, item) {
|
||||||
this.id = id
|
this.id = id;
|
||||||
console.log('item', item)
|
console.log("item", item);
|
||||||
this.form1.kindName1 = item.name
|
this.form1.kindName1 = item.name;
|
||||||
this.dialogFormVisible1 = true
|
this.dialogFormVisible1 = true;
|
||||||
},
|
},
|
||||||
// 编辑确定按钮
|
// 编辑确定按钮
|
||||||
EditSubmit() {
|
EditSubmit() {
|
||||||
@ -155,52 +158,90 @@ export default {
|
|||||||
name: this.form1.kindName1,
|
name: this.form1.kindName1,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: "success",
|
||||||
message: '编辑成功',
|
message: "编辑成功",
|
||||||
})
|
});
|
||||||
this.getGoods_types()
|
this.getGoods_types();
|
||||||
})
|
});
|
||||||
this.dialogFormVisible1 = false
|
this.dialogFormVisible1 = false;
|
||||||
},
|
},
|
||||||
// 删除
|
// 删除
|
||||||
handdel(id) {
|
handdel(id) {
|
||||||
this.$confirm('确定删除此条商品种类吗?', '确认删除', {
|
this.$confirm("确定删除此条商品种类吗?", "确认删除", {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: "确定",
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: "取消",
|
||||||
type: 'warning',
|
type: "warning",
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
Delgoods_types(id).then((res) => {
|
Delgoods_types(id).then((res) => {
|
||||||
this.getGoods_types()
|
this.getGoods_types();
|
||||||
})
|
});
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: "success",
|
||||||
message: '删除成功!',
|
message: "删除成功!",
|
||||||
})
|
});
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'info',
|
type: "info",
|
||||||
message: '已取消删除',
|
message: "已取消删除",
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
// 获取列表
|
// 获取列表
|
||||||
getGoods_types() {
|
getGoods_types() {
|
||||||
goods_types({
|
// goods_types({
|
||||||
page: this.page,
|
// page: this.page,
|
||||||
|
// per_page: this.per_page,
|
||||||
|
// }).then((res) => {
|
||||||
|
// console.log('res=>>>>>>>>', res)
|
||||||
|
// this.tableData = res.data.data
|
||||||
|
// this.total = res.data.data.length
|
||||||
|
// this.page = res.meta.current_page
|
||||||
|
// this.per_page = res.meta.per_page
|
||||||
|
// })
|
||||||
|
axios
|
||||||
|
.get("/api/goods_types", {
|
||||||
|
headers: {
|
||||||
|
Authorization:
|
||||||
|
"Bearer w1rr6IsxZIud46dIrGIivNAroFpqN52sSpXhk3azpPq2ZTbUXhgKTOLheoRm",
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
page: this.current_page,
|
||||||
per_page: this.per_page,
|
per_page: this.per_page,
|
||||||
}).then((res) => {
|
},
|
||||||
console.log('res=>>>>>>>>', res)
|
|
||||||
this.tableData = res.data.data
|
|
||||||
this.total = res.data.data.length
|
|
||||||
this.page = res.meta.current_page
|
|
||||||
this.per_page = res.meta.per_page
|
|
||||||
})
|
})
|
||||||
|
.then((res) => {
|
||||||
|
// console.log(res);
|
||||||
|
this.tableData = res.data.data;
|
||||||
|
this.Paginationdata = res.data.meta;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.conent {
|
||||||
|
width: 100%;
|
||||||
|
min-height: calc(100vh - 200px);
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
height: 104px;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.el-button {
|
||||||
|
width: 114px;
|
||||||
|
height: 44px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.table {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
<style>
|
.block {
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -112,7 +112,7 @@ export default {
|
|||||||
// table构造
|
// table构造
|
||||||
$route: {
|
$route: {
|
||||||
handler: function (val) {
|
handler: function (val) {
|
||||||
console.log(val, 99999)
|
// console.log(val, 99999)
|
||||||
this.titie = val.matched
|
this.titie = val.matched
|
||||||
this.head = val.name
|
this.head = val.name
|
||||||
this.levelData.push({ name: val.name, path: val.path })
|
this.levelData.push({ name: val.name, path: val.path })
|
||||||
|
|||||||
@ -50,11 +50,13 @@ export default {
|
|||||||
type: "error",
|
type: "error",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
let token = localStorage.getItem("token");
|
||||||
axios
|
axios
|
||||||
.post("/api/auth/login", this.form, {
|
.post("/api/auth/login", this.form, {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization:
|
Authorization:
|
||||||
"Bearer w1rr6IsxZIud46dIrGIivNAroFpqN52sSpXhk3azpPq2ZTbUXhgKTOLheoRm",
|
"Bearer w1rr6IsxZIud46dIrGIivNAroFpqN52sSpXhk3azpPq2ZTbUXhgKTOLheoRm",
|
||||||
|
token: token,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|||||||
192
resources/frontend/src/views/shuju/record.vue
Normal file
192
resources/frontend/src/views/shuju/record.vue
Normal file
@ -0,0 +1,192 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-card class="box-card">
|
||||||
|
<div class="goods"
|
||||||
|
style="margin:20px">
|
||||||
|
<el-form ref="form"
|
||||||
|
:inline="true"
|
||||||
|
:model="form">
|
||||||
|
<el-form-item label="查询类别:">
|
||||||
|
<el-select v-model="form.name1"
|
||||||
|
placeholder="全部">
|
||||||
|
<el-option v-for="item in options"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商品编号">
|
||||||
|
<el-input v-model="input"
|
||||||
|
placeholder="输入商品编号"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商品名称">
|
||||||
|
<el-input v-model="input"
|
||||||
|
placeholder="输入商品名称"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商品种类:">
|
||||||
|
<el-select v-model="form.name1"
|
||||||
|
placeholder="输入商品种类">
|
||||||
|
<el-option v-for="item in options"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商品规格:">
|
||||||
|
<el-select v-model="form.name1"
|
||||||
|
placeholder="输入商品规格">
|
||||||
|
<el-option v-for="item in options"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="商品品牌:">
|
||||||
|
<el-select v-model="form.name1"
|
||||||
|
placeholder="输入商品品牌">
|
||||||
|
<el-option v-for="item in options"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="操作时间:">
|
||||||
|
<el-date-picker v-model="value1"
|
||||||
|
type="datetimerange"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="起"
|
||||||
|
end-placeholder="止"
|
||||||
|
align="right">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary">查询</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
<el-card style="margin-top:30px"
|
||||||
|
class="box-card">
|
||||||
|
<div>
|
||||||
|
<span></span>
|
||||||
|
<span>历史记录</span>
|
||||||
|
<span>(共800条)</span>
|
||||||
|
<span>——玫瑰花</span>
|
||||||
|
</div>
|
||||||
|
<el-table :data="tableData"
|
||||||
|
style="width: 100%">
|
||||||
|
<el-table-column prop="date"
|
||||||
|
label="序号"
|
||||||
|
width="180">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="name"
|
||||||
|
label="时间"
|
||||||
|
width="180">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="address"
|
||||||
|
label="类别">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="address"
|
||||||
|
label="操作前">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="address"
|
||||||
|
label="操作后">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="address"
|
||||||
|
label="操作人">
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
<el-pagination @size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
:current-page="currentPage4"
|
||||||
|
:page-sizes="[100, 200, 300, 400]"
|
||||||
|
:page-size="100"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="400">
|
||||||
|
</el-pagination>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
value: '选项1',
|
||||||
|
label: '黄金糕',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '选项2',
|
||||||
|
label: '双皮奶',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '选项3',
|
||||||
|
label: '蚵仔煎',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '选项4',
|
||||||
|
label: '龙须面',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '选项5',
|
||||||
|
label: '北京烤鸭',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
tableData: [
|
||||||
|
{
|
||||||
|
date: '2016-05-02',
|
||||||
|
name: '王小虎',
|
||||||
|
address: '上海市普陀区金沙江路 1518 弄',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-04',
|
||||||
|
name: '王小虎',
|
||||||
|
address: '上海市普陀区金沙江路 1517 弄',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-01',
|
||||||
|
name: '王小虎',
|
||||||
|
address: '上海市普陀区金沙江路 1519 弄',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-03',
|
||||||
|
name: '王小虎',
|
||||||
|
address: '上海市普陀区金沙江路 1516 弄',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
currentPage4: 4,
|
||||||
|
form: {
|
||||||
|
name1: '',
|
||||||
|
name2: '',
|
||||||
|
name3: '',
|
||||||
|
name4: '',
|
||||||
|
name5: '',
|
||||||
|
name6: '',
|
||||||
|
},
|
||||||
|
input: '',
|
||||||
|
value1: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleSizeChange(val) {
|
||||||
|
console.log(`每页 ${val} 条`)
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
console.log(`当前页: ${val}`)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
</style>
|
||||||
@ -1,164 +1,163 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<!-- 筛选框 -->
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<div class="goods"
|
<div class="goods" style="margin: 20px">
|
||||||
style="margin:20px">
|
<el-form ref="form" :inline="true" :model="form">
|
||||||
<el-form ref="form"
|
|
||||||
:inline="true"
|
|
||||||
:model="form">
|
|
||||||
<el-form-item label="查询类别:">
|
<el-form-item label="查询类别:">
|
||||||
<el-select v-model="form.name1"
|
<el-select v-model="form.name1" placeholder="全部">
|
||||||
placeholder="全部">
|
<el-option
|
||||||
<el-option v-for="item in options"
|
v-for="item in options"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value">
|
:value="item.value"
|
||||||
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="操作用户">
|
<el-form-item label="操作用户">
|
||||||
<el-select v-model="form.name2"
|
<el-select v-model="form.name2" placeholder="输入操作用户">
|
||||||
placeholder="输入操作用户">
|
<el-option
|
||||||
<el-option v-for="item in options"
|
v-for="item in options"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.value">
|
:value="item.value"
|
||||||
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="操作时间:">
|
<el-form-item label="操作时间:">
|
||||||
<el-date-picker v-model="value1"
|
<el-date-picker
|
||||||
|
v-model="value1"
|
||||||
type="datetimerange"
|
type="datetimerange"
|
||||||
range-separator="至"
|
range-separator="至"
|
||||||
start-placeholder="起"
|
start-placeholder="起"
|
||||||
end-placeholder="止"
|
end-placeholder="止"
|
||||||
align="right">
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary">查询</el-button>
|
<el-button type="primary">查询</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card style="margin-top:30px"
|
|
||||||
class="box-card">
|
<!-- 表格 -->
|
||||||
<div>
|
<el-card style="margin-top: 30px" class="box-card">
|
||||||
<span></span>
|
<el-table :data="tableData" style="width: 100%">
|
||||||
<span>历史记录</span>
|
<el-table-column prop="id" label="序号"> </el-table-column>
|
||||||
<span>(共800条)</span>
|
<el-table-column prop="created_at" label="时间"> </el-table-column>
|
||||||
<span>——玫瑰花</span>
|
<el-table-column prop="target_field" label="类别"> </el-table-column>
|
||||||
</div>
|
<el-table-column prop="before_update" label="操作前"> </el-table-column>
|
||||||
<el-table :data="tableData"
|
<el-table-column prop="after_update" label="操作后"> </el-table-column>
|
||||||
style="width: 100%">
|
<el-table-column prop="user.name" label="操作人"> </el-table-column>
|
||||||
<el-table-column prop="date"
|
|
||||||
label="序号"
|
|
||||||
width="180">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="name"
|
|
||||||
label="时间"
|
|
||||||
width="180">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="address"
|
|
||||||
label="类别">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="address"
|
|
||||||
label="操作前">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="address"
|
|
||||||
label="操作后">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="address"
|
|
||||||
label="操作人">
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-pagination @size-change="handleSizeChange"
|
|
||||||
|
<!-- 分页功能 -->
|
||||||
|
<div class="block">
|
||||||
|
<el-pagination
|
||||||
|
@size-change="handleSizeChange"
|
||||||
@current-change="handleCurrentChange"
|
@current-change="handleCurrentChange"
|
||||||
:current-page="currentPage4"
|
:current-page="current_page"
|
||||||
:page-sizes="[100, 200, 300, 400]"
|
:page-sizes="[15, 50, 100]"
|
||||||
:page-size="100"
|
:page-size="per_page"
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
:total="400">
|
:total="Paginationdata.total"
|
||||||
|
>
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import axios from "axios";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
value: '选项1',
|
value: "选项1",
|
||||||
label: '黄金糕',
|
label: "黄金糕",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '选项2',
|
value: "选项2",
|
||||||
label: '双皮奶',
|
label: "双皮奶",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '选项3',
|
value: "选项3",
|
||||||
label: '蚵仔煎',
|
label: "蚵仔煎",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '选项4',
|
value: "选项4",
|
||||||
label: '龙须面',
|
label: "龙须面",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '选项5',
|
value: "选项5",
|
||||||
label: '北京烤鸭',
|
label: "北京烤鸭",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
tableData: [
|
|
||||||
{
|
|
||||||
date: '2016-05-02',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1518 弄',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
date: '2016-05-04',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1517 弄',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
date: '2016-05-01',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1519 弄',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
date: '2016-05-03',
|
|
||||||
name: '王小虎',
|
|
||||||
address: '上海市普陀区金沙江路 1516 弄',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
currentPage4: 4,
|
|
||||||
form: {
|
form: {
|
||||||
name1: '',
|
name1: "",
|
||||||
name2: '',
|
name2: "",
|
||||||
name3: '',
|
name3: "",
|
||||||
name4: '',
|
name4: "",
|
||||||
name5: '',
|
name5: "",
|
||||||
name6: '',
|
name6: "",
|
||||||
},
|
},
|
||||||
input: '',
|
input: "",
|
||||||
value1: '',
|
value1: "",
|
||||||
}
|
|
||||||
|
tableData: [], //列表数据
|
||||||
|
Paginationdata: {}, //分页相关数据
|
||||||
|
current_page: 1, //当前页
|
||||||
|
per_page: 15, //每页显示数量
|
||||||
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//请求列表数据
|
||||||
|
getList() {
|
||||||
|
axios
|
||||||
|
.get("/api/logs", {
|
||||||
|
headers: {
|
||||||
|
Authorization:
|
||||||
|
"Bearer w1rr6IsxZIud46dIrGIivNAroFpqN52sSpXhk3azpPq2ZTbUXhgKTOLheoRm",
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
page: this.current_page,
|
||||||
|
per_page: this.per_page,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.tableData = res.data.data;
|
||||||
|
this.Paginationdata = res.data.meta;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
//分页功能
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
console.log(`每页 ${val} 条`)
|
//当前条数
|
||||||
|
this.per_page = val;
|
||||||
|
// console.log(1111, val);
|
||||||
|
this.getList();
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
console.log(`当前页: ${val}`)
|
//当前页
|
||||||
|
this.current_page = val;
|
||||||
|
// console.log(2222, val);
|
||||||
|
this.getList();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
mounted() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
.block {
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,115 +1,177 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="conent">
|
||||||
<el-button type="primary"
|
<!-- 新增按钮 -->
|
||||||
@click="handAdd">新增</el-button>
|
<div class="btn">
|
||||||
<el-table :data="tableData"
|
<el-button type="primary" @click="handAdd">新增</el-button>
|
||||||
border
|
</div>
|
||||||
style="width: 100%">
|
|
||||||
<el-table-column prop="id"
|
<div class="table">
|
||||||
label="ID"
|
<el-table :data="tableData" style="width: 100%">
|
||||||
width="180">
|
<el-table-column prop="id" label="ID" width="180"> </el-table-column>
|
||||||
|
<el-table-column prop="name" label="店铺名称" width="180">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="name"
|
<el-table-column prop="plat_id" label="所属平台"> </el-table-column>
|
||||||
label="店铺名称"
|
<el-table-column prop="address" label="操作">
|
||||||
width="180">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="plat_id"
|
|
||||||
label="所属平台">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="address"
|
|
||||||
label="操作">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="primary"
|
<el-button type="primary" @click="handEdit(scope.row.id, scope.row)"
|
||||||
@click="handEdit(scope.row.id,scope.row)">编辑</el-button>
|
>编辑</el-button
|
||||||
<el-button type="danger"
|
>
|
||||||
@click="handdel(scope.row.id)">授权</el-button>
|
<el-button type="danger" @click="handdel(scope.row.id)"
|
||||||
|
>授权</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- 新增店铺 -->
|
<!-- 新增店铺 -->
|
||||||
<el-dialog title="新增店铺"
|
<el-dialog title="新增店铺" :visible.sync="dialogFormVisible">
|
||||||
:visible.sync="dialogFormVisible">
|
|
||||||
<el-form :model="form">
|
<el-form :model="form">
|
||||||
<el-form-item label="店铺名称">
|
<el-form-item label="店铺名称">
|
||||||
<el-input v-model="form.name"
|
<el-input v-model="form.name" placeholder="输入店铺名称"></el-input>
|
||||||
placeholder="输入店铺名称"></el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="店铺平台">
|
<el-form-item label="店铺平台">
|
||||||
<el-select v-model="form.plat_id"
|
<el-select v-model="form.plat_id" placeholder="输入店铺平台">
|
||||||
placeholder="输入店铺平台">
|
<el-option
|
||||||
<el-option v-for="(item,index) in storeId"
|
v-for="(item, index) in storeId"
|
||||||
:key="index"
|
:key="index"
|
||||||
:label="item"
|
:label="item"
|
||||||
:value="index">
|
:value="index"
|
||||||
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer"
|
<div slot="footer" class="dialog-footer">
|
||||||
class="dialog-footer">
|
|
||||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||||
<el-button type="primary"
|
<el-button type="primary" @click="addSubmit">确 定</el-button>
|
||||||
@click="addSubmit">确 定</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 分页功能 -->
|
||||||
|
<div class="block">
|
||||||
|
<el-pagination
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
:current-page="current_page"
|
||||||
|
:page-sizes="[15, 50, 100]"
|
||||||
|
:page-size="per_page"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="Paginationdata.total"
|
||||||
|
>
|
||||||
|
</el-pagination>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { shopListId, shopAdd, storeList } from '../../api/shop'
|
import { shopListId, shopAdd } from "../../api/shop";
|
||||||
|
import axios from "axios";
|
||||||
export default {
|
export default {
|
||||||
name: 'GlxtStore',
|
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialogFormVisible: false,
|
dialogFormVisible: false,
|
||||||
form: {
|
form: {
|
||||||
name: '',
|
name: "",
|
||||||
plat_id: '',
|
plat_id: "",
|
||||||
},
|
},
|
||||||
storeId: [], // 店铺id
|
storeId: [], // 店铺id
|
||||||
tableData: [],
|
tableData: [],
|
||||||
}
|
Paginationdata: {}, //分页相关数据
|
||||||
|
current_page: 1, //当前页
|
||||||
|
per_page: 15, //每页显示数量
|
||||||
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 获取平台
|
// 获取平台
|
||||||
shopListId().then((res) => {
|
shopListId().then((res) => {
|
||||||
this.storeId = res.data.data
|
this.storeId = res.data.data;
|
||||||
})
|
});
|
||||||
// 展示店铺列表
|
// 展示店铺列表
|
||||||
this.getStoreList()
|
this.getStoreList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 点击新增
|
// 点击新增
|
||||||
handAdd() {
|
handAdd() {
|
||||||
this.form.name = ''
|
this.form.name = "";
|
||||||
this.form.plat_id = ''
|
this.form.plat_id = "";
|
||||||
this.dialogFormVisible = true
|
this.dialogFormVisible = true;
|
||||||
},
|
},
|
||||||
// 新增商品
|
// 新增商品
|
||||||
addSubmit() {
|
addSubmit() {
|
||||||
const datas = this.form
|
const datas = this.form;
|
||||||
shopAdd(datas).then((res) => {
|
shopAdd(datas).then((res) => {
|
||||||
if (res.status == 200) {
|
if (res.status == 200) {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: "success",
|
||||||
message: '添加成功',
|
message: "添加成功",
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
})
|
this.getStoreList();
|
||||||
this.dialogFormVisible = false
|
});
|
||||||
this.getStoreList()
|
this.dialogFormVisible = false;
|
||||||
},
|
},
|
||||||
// 店铺列表
|
// 店铺列表
|
||||||
getStoreList() {
|
getStoreList() {
|
||||||
storeList().then((res) => {
|
// storeList().then((res) => {
|
||||||
this.tableData = res.data.data
|
// this.tableData = res.data.data;
|
||||||
console.log(res, 'kkk')
|
// console.log(res, "kkk");
|
||||||
|
// });
|
||||||
|
axios
|
||||||
|
.get("/api/shops", {
|
||||||
|
headers: {
|
||||||
|
Authorization:
|
||||||
|
"Bearer w1rr6IsxZIud46dIrGIivNAroFpqN52sSpXhk3azpPq2ZTbUXhgKTOLheoRm",
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
page: this.current_page,
|
||||||
|
per_page: this.per_page,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
this.tableData = res.data.data;
|
||||||
|
this.Paginationdata = res.data.meta;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//分页功能
|
||||||
|
handleSizeChange(val) {
|
||||||
|
//当前条数
|
||||||
|
this.per_page = val;
|
||||||
|
// console.log(1111, val);
|
||||||
|
this.getStoreList();
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
//当前页
|
||||||
|
this.current_page = val;
|
||||||
|
// console.log(2222, val);
|
||||||
|
this.getStoreList();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.conent {
|
||||||
|
width: 100%;
|
||||||
|
min-height: calc(100vh - 200px);
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
height: 104px;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
.el-button {
|
||||||
|
width: 114px;
|
||||||
|
height: 44px;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.table {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
.block {
|
||||||
|
margin-top: 30px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
权限管理(废弃)
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@ -1,45 +1,176 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="conent">
|
<div class="conent">
|
||||||
|
<!-- 新增按钮 -->
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<el-button type="primary">新增</el-button>
|
<el-button type="primary" @click="dialogVisible2 = true">新增</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 点击新增弹出表单 -->
|
||||||
|
<div class="from">
|
||||||
|
<el-dialog title="新增角色" :visible.sync="dialogVisible2" width="30%">
|
||||||
|
<div>
|
||||||
|
<el-form label-width="80px">
|
||||||
|
<el-form-item label="角色名称">
|
||||||
|
<el-input v-model="newrole"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<div class="from-btn">
|
||||||
|
<el-button type="danger" @click="dialogVisible2 = false"
|
||||||
|
>取消</el-button
|
||||||
|
>
|
||||||
|
<el-button @click="onSubmit">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 角色表单 -->
|
||||||
<div class="table">
|
<div class="table">
|
||||||
<el-table :data="tableList" style="width: 100%">
|
<el-table :data="tableList" style="width: 100%">
|
||||||
<el-table-column prop="id" label="ID" width="400"> </el-table-column>
|
<el-table-column prop="id" label="ID"> </el-table-column>
|
||||||
<el-table-column prop="name" label="角色名称" width="400">
|
<el-table-column prop="name" label="角色名称"> </el-table-column>
|
||||||
</el-table-column>
|
<el-table-column prop="name" label="权限内容"> </el-table-column>
|
||||||
<el-table-column prop="guard_name" label="权限内容" width="400">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作">
|
<el-table-column label="操作">
|
||||||
<el-button>编辑</el-button>
|
<template slot-scope="scope">
|
||||||
|
<el-button @click="onEdit(scope.row)">编辑</el-button>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 点击编辑弹出权限框 -->
|
||||||
|
<el-dialog title="编辑权限" :visible.sync="dialogVisible" width="30%">
|
||||||
|
<el-tree
|
||||||
|
:data="Role_Permission"
|
||||||
|
show-checkbox
|
||||||
|
:default-expand-all="false"
|
||||||
|
node-key="id"
|
||||||
|
ref="tree"
|
||||||
|
highlight-current
|
||||||
|
:props="defaultProps"
|
||||||
|
v-model="permissionIds"
|
||||||
|
>
|
||||||
|
</el-tree>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="getCheckedKeys">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
export default {
|
export default {
|
||||||
name: "GlxtUsers",
|
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
id: "", //点击角色的id
|
||||||
tableList: [], //列表数据
|
tableList: [], //列表数据
|
||||||
|
newrole: "", //添加角色框input
|
||||||
|
dialogVisible: false, //编辑按钮打开表单变量
|
||||||
|
dialogVisible2: false, //新增按钮打开表单变量
|
||||||
|
permissionIds: [], //复选框选中权限的ID
|
||||||
|
allpermissionIds: {}, //id数组添加进对象
|
||||||
|
Role_Permission: [], //权限列表数据
|
||||||
|
defaultProps: {
|
||||||
|
children: "children",
|
||||||
|
label: "name",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.getroleList();
|
||||||
|
this.getJurisdiction();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
//角色表单数据请求
|
//角色表单数据请求
|
||||||
axios({
|
getroleList() {
|
||||||
method: "get",
|
axios
|
||||||
params: {},
|
.get("/api/roles", {
|
||||||
url: "http://doc.ii090.com/mock/267/api/users",
|
headers: {
|
||||||
}).then((res) => {
|
Authorization:
|
||||||
|
"Bearer w1rr6IsxZIud46dIrGIivNAroFpqN52sSpXhk3azpPq2ZTbUXhgKTOLheoRm",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
this.tableList = res.data.data;
|
this.tableList = res.data.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
//角色权限请求
|
||||||
|
getJurisdiction() {
|
||||||
|
axios
|
||||||
|
.get("/api/permissions", {
|
||||||
|
headers: {
|
||||||
|
Authorization:
|
||||||
|
"Bearer w1rr6IsxZIud46dIrGIivNAroFpqN52sSpXhk3azpPq2ZTbUXhgKTOLheoRm",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
this.Role_Permission = res.data.data;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 点击新增
|
||||||
|
onSubmit() {
|
||||||
|
let roleName = {
|
||||||
|
name: this.newrole,
|
||||||
|
};
|
||||||
|
axios
|
||||||
|
.post("/api/roles", roleName, {
|
||||||
|
headers: {
|
||||||
|
Authorization:
|
||||||
|
"Bearer w1rr6IsxZIud46dIrGIivNAroFpqN52sSpXhk3azpPq2ZTbUXhgKTOLheoRm",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
this.dialogVisible2 = false;
|
||||||
|
this.getroleList();
|
||||||
|
if (res.status == 201) {
|
||||||
|
this.$message({
|
||||||
|
message: "角色添加成功!",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 点击编辑
|
||||||
|
onEdit(row) {
|
||||||
|
this.dialogVisible = true;
|
||||||
|
// console.log(row.id);
|
||||||
|
this.id = row.id;
|
||||||
|
},
|
||||||
|
|
||||||
|
//编辑权限确认
|
||||||
|
getCheckedKeys() {
|
||||||
|
let id = this.id; //选中角色的ID
|
||||||
|
|
||||||
|
this.permissionIds = this.$refs.tree.getCheckedKeys(); //选中权限的ID
|
||||||
|
// console.log(this.permissionIds);
|
||||||
|
this.allpermissionIds = {
|
||||||
|
permissionIds: this.permissionIds,
|
||||||
|
};
|
||||||
|
// console.log(this.allpermissionIds);
|
||||||
|
|
||||||
|
axios
|
||||||
|
.post(`/api/roles/${id}/permissions`, this.allpermissionIds, {
|
||||||
|
headers: {
|
||||||
|
Authorization:
|
||||||
|
"Bearer w1rr6IsxZIud46dIrGIivNAroFpqN52sSpXhk3azpPq2ZTbUXhgKTOLheoRm",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
if (res.status === 200) {
|
||||||
|
this.dialogVisible = false;
|
||||||
|
this.$message({
|
||||||
|
message: "权限修改成功!",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -62,4 +193,10 @@ export default {
|
|||||||
.table {
|
.table {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.from-btn {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
align-content: center;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -91,7 +91,7 @@
|
|||||||
@current-change="handleCurrentChange"
|
@current-change="handleCurrentChange"
|
||||||
:current-page="current_page"
|
:current-page="current_page"
|
||||||
:page-sizes="[15, 50, 100]"
|
:page-sizes="[15, 50, 100]"
|
||||||
:page-size="15"
|
:page-size="per_page"
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
:total="Paginationdata.total"
|
:total="Paginationdata.total"
|
||||||
>
|
>
|
||||||
@ -114,7 +114,7 @@ export default {
|
|||||||
name: "",
|
name: "",
|
||||||
password: "",
|
password: "",
|
||||||
password_confirmation: "",
|
password_confirmation: "",
|
||||||
role_name: "超级管理员",
|
role_name: "",
|
||||||
},
|
},
|
||||||
edit_from: {
|
edit_from: {
|
||||||
// 编辑返回默认数据
|
// 编辑返回默认数据
|
||||||
@ -125,7 +125,7 @@ export default {
|
|||||||
name: "",
|
name: "",
|
||||||
password: "",
|
password: "",
|
||||||
password_confirmation: "",
|
password_confirmation: "",
|
||||||
role_name: "超级管理员",
|
role_name: "",
|
||||||
},
|
},
|
||||||
Paginationdata: {}, //分页相关数据
|
Paginationdata: {}, //分页相关数据
|
||||||
current_page: 1, //当前页
|
current_page: 1, //当前页
|
||||||
@ -140,18 +140,17 @@ export default {
|
|||||||
//用户表单数据请求
|
//用户表单数据请求
|
||||||
getList() {
|
getList() {
|
||||||
axios
|
axios
|
||||||
.get("api/users",{
|
.get("api/users", {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization:
|
Authorization:
|
||||||
"Bearer w1rr6IsxZIud46dIrGIivNAroFpqN52sSpXhk3azpPq2ZTbUXhgKTOLheoRm",
|
"Bearer w1rr6IsxZIud46dIrGIivNAroFpqN52sSpXhk3azpPq2ZTbUXhgKTOLheoRm",
|
||||||
},
|
},
|
||||||
params:{
|
params: {
|
||||||
page:this.current_page,
|
page: this.current_page,
|
||||||
per_page:this.per_page,
|
per_page: this.per_page,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res);
|
|
||||||
this.tableList = res.data.data;
|
this.tableList = res.data.data;
|
||||||
this.Paginationdata = res.data.meta;
|
this.Paginationdata = res.data.meta;
|
||||||
});
|
});
|
||||||
@ -180,7 +179,7 @@ export default {
|
|||||||
//点击编辑
|
//点击编辑
|
||||||
openEdit(e) {
|
openEdit(e) {
|
||||||
this.editVisible = true;
|
this.editVisible = true;
|
||||||
console.log(e.id);
|
// console.log(e.id);
|
||||||
let id = e.id;
|
let id = e.id;
|
||||||
this.id = e.id;
|
this.id = e.id;
|
||||||
// 请求id对应数据
|
// 请求id对应数据
|
||||||
@ -192,7 +191,6 @@ export default {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res.data.data);
|
|
||||||
this.edit_from = res.data.data;
|
this.edit_from = res.data.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -220,13 +218,15 @@ export default {
|
|||||||
},
|
},
|
||||||
//分页功能
|
//分页功能
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
this.current_page = val;
|
//当前条数
|
||||||
console.log(this.current_page);
|
this.per_page = val;
|
||||||
|
// console.log(1111, val);
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
handleCurrentChange(val) {
|
handleCurrentChange(val) {
|
||||||
this.per_page = val;
|
//当前页
|
||||||
console.log(this.per_page);
|
this.current_page = val;
|
||||||
|
// console.log(2222, val);
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,22 +1,27 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<div class="goods"
|
<div class="goods" style="margin: 20px">
|
||||||
style="margin:20px">
|
<div
|
||||||
<div class="add-item-info"
|
class="add-item-info"
|
||||||
style="margin-bottom:10px;margin-left:52px">
|
style="margin-bottom: 10px; margin-left: 52px"
|
||||||
|
>
|
||||||
<div>
|
<div>
|
||||||
<div style="font-size:14px;">商品列表:</div>
|
<div style="font-size: 14px">商品列表:</div>
|
||||||
<el-select v-model="lid"
|
<el-select v-model="lid" placeholder="选择商品">
|
||||||
placeholder="选择商品">
|
<el-option
|
||||||
<el-option v-for="item in goodschoose"
|
v-for="item in goodschoose"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.title"
|
:label="item.title"
|
||||||
:value="item.id">
|
:value="item.id"
|
||||||
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<span style="font-size:14px;">商品图片:</span>
|
<span style="font-size: 14px"
|
||||||
|
>商品图片:
|
||||||
|
<UploadTem />
|
||||||
|
</span>
|
||||||
<!-- <UploadTem @urlimg='hanleurlimg'
|
<!-- <UploadTem @urlimg='hanleurlimg'
|
||||||
:number="2"
|
:number="2"
|
||||||
:file='file' /> -->
|
:file='file' /> -->
|
||||||
@ -35,154 +40,150 @@
|
|||||||
class="el-icon-plus avatar-uploader-icon"></i>
|
class="el-icon-plus avatar-uploader-icon"></i>
|
||||||
</el-upload> -->
|
</el-upload> -->
|
||||||
</div>
|
</div>
|
||||||
<el-form ref="form"
|
<el-form ref="form" :inline="true" :model="form">
|
||||||
:inline="true"
|
|
||||||
:model="form">
|
|
||||||
<div>
|
<div>
|
||||||
<el-form-item label="商品名称:">
|
<el-form-item label="商品名称:">
|
||||||
<el-input placeholder="商品名称"
|
<el-input placeholder="商品名称" v-model="form.title"></el-input>
|
||||||
v-model="form.title"></el-input>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品编码:">
|
<el-form-item label="商品编码:">
|
||||||
<el-input placeholder="商品编码"
|
<el-input
|
||||||
v-model="form.goods_code"></el-input>
|
placeholder="商品编码"
|
||||||
|
v-model="form.goods_code"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品种类:">
|
<el-form-item label="商品种类:">
|
||||||
<el-select v-model="form.type_id"
|
<el-select v-model="form.type_id" placeholder="商品种类">
|
||||||
placeholder="商品种类">
|
<el-option
|
||||||
<el-option v-for="item in cate"
|
v-for="item in cate"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id">
|
:value="item.id"
|
||||||
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品品牌:">
|
<el-form-item label="商品品牌:">
|
||||||
<el-select v-model="form.brand_id"
|
<el-select v-model="form.brand_id" placeholder="商品品牌">
|
||||||
placeholder="商品品牌">
|
<el-option
|
||||||
<el-option v-for="item in brand"
|
v-for="item in brand"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id">
|
:value="item.id"
|
||||||
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
<div v-for="(item,i) in skus"
|
<div v-for="(item, i) in skus" :key="i">
|
||||||
:key="i">
|
<span style="margin-right: -15px">{{ i + 1 }}.</span>
|
||||||
<span style="margin-right:-15px">{{i+1}}.</span>
|
|
||||||
<el-form-item label="商品规格:">
|
<el-form-item label="商品规格:">
|
||||||
<el-input placeholder="商品规格"
|
<el-input
|
||||||
v-model="skus[i].title"></el-input>
|
placeholder="商品规格"
|
||||||
|
v-model="skus[i].title"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<span class="addto"
|
<span class="addto" v-if="!gid" @click="handleAdd()">+</span>
|
||||||
v-if="!gid"
|
|
||||||
@click="handleAdd()">+</span>
|
|
||||||
<el-form-item label="规格编码:">
|
<el-form-item label="规格编码:">
|
||||||
<el-input v-model="skus[i].sku_code"
|
<el-input v-model="skus[i].sku_code" placeholder="商品编码">
|
||||||
placeholder="商品编码">
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品状态:">
|
<el-form-item label="商品状态:">
|
||||||
<el-select v-model="skus[i].status"
|
<el-select v-model="skus[i].status" placeholder="下架(默认)">
|
||||||
placeholder="下架(默认)">
|
<el-option
|
||||||
<el-option v-for="item in options"
|
v-for="item in options"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.id">
|
:value="item.id"
|
||||||
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div>
|
<div>
|
||||||
<el-form-item label="商品数量:">
|
<el-form-item label="商品数量:">
|
||||||
<el-input v-model="skus[i].num"
|
<el-input v-model="skus[i].num" placeholder="商品数量">
|
||||||
placeholder="商品数量">
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品成本:">
|
<el-form-item label="商品成本:">
|
||||||
<el-input v-model="skus[i].cost"
|
<el-input v-model="skus[i].cost" placeholder="商品成本">
|
||||||
placeholder="商品成本">
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-button type="primary"
|
<el-button type="primary" @click="handleDelete(i)"
|
||||||
@click="handleDelete(i)">删除</el-button>
|
>删除</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary"
|
<el-button type="primary" @click="handleSave()">保存</el-button>
|
||||||
@click="handleSave()">保存</el-button>
|
|
||||||
<el-button plain>取消</el-button>
|
<el-button plain>取消</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import UploadTem from '../../../components/upload/index.vue'
|
import UploadTem from "../../../components/upload/index.vue";
|
||||||
import {
|
import {
|
||||||
addGoods,
|
addGoods,
|
||||||
checkGoods,
|
checkGoods,
|
||||||
goodsList,
|
goodsList,
|
||||||
updateGoods,
|
updateGoods,
|
||||||
} from '../../../api/goods.js'
|
} from "../../../api/goods.js";
|
||||||
import { goods_types, Brand_goods_types } from '../../../api/rankingData.js'
|
import { goods_types, Brand_goods_types } from "../../../api/rankingData.js";
|
||||||
|
import axios from "axios";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
UploadTem,
|
UploadTem,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
gallery: '',
|
gallery: "",
|
||||||
imageUrl: '',
|
imageUrl: "",
|
||||||
lid: '', // 选择的商品列表id
|
lid: "", // 选择的商品列表id
|
||||||
gid: '', // 商品id
|
gid: "", // 商品id
|
||||||
brand: [], // 品牌列表
|
brand: [], // 品牌列表
|
||||||
cate: [], // 种类列表
|
cate: [], // 种类列表
|
||||||
goodschoose: [], // 商品列表
|
goodschoose: [], // 商品列表
|
||||||
// 规格列表
|
// 规格列表
|
||||||
skus: [
|
skus: [
|
||||||
{
|
{
|
||||||
title: '',
|
title: "",
|
||||||
sku_code: '',
|
sku_code: "",
|
||||||
status: '',
|
status: "",
|
||||||
num: '',
|
num: "",
|
||||||
cost: '',
|
cost: "",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
// 增加商品表单
|
// 增加商品表单
|
||||||
form: {
|
form: {
|
||||||
goods_id: '',
|
goods_id: "",
|
||||||
title: '',
|
title: "",
|
||||||
img_url: 'abc.jpg',
|
img_url: "https://cn.vuejs.org/images/logo.svg",
|
||||||
type_id: '',
|
type_id: "",
|
||||||
brand_id: '',
|
brand_id: "",
|
||||||
goods_code: '',
|
goods_code: "",
|
||||||
},
|
},
|
||||||
// 商品状态
|
// 商品状态
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
id: '1',
|
id: "1",
|
||||||
label: '在售',
|
label: "在售",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '2',
|
id: "2",
|
||||||
label: '预警',
|
label: "预警",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '0',
|
id: "0",
|
||||||
label: '下架',
|
label: "下架",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
file: [],
|
file: [],
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
@ -191,9 +192,9 @@ export default {
|
|||||||
if (newVal) {
|
if (newVal) {
|
||||||
this.goodschoose.forEach((item) => {
|
this.goodschoose.forEach((item) => {
|
||||||
if (item.id == newVal) {
|
if (item.id == newVal) {
|
||||||
this.form = { ...item }
|
this.form = { ...item };
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deep: true, // 深度监听
|
deep: true, // 深度监听
|
||||||
@ -203,126 +204,162 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 查看一个商品
|
// 查看一个商品
|
||||||
handleUpdate() {
|
handleUpdate() {
|
||||||
this.gid = this.$route.query
|
this.gid = this.$route.query;
|
||||||
if (this.gid.id) {
|
if (this.gid.id) {
|
||||||
checkGoods(this.gid.id).then((res) => {
|
checkGoods(this.gid.id).then((res) => {
|
||||||
console.log(res.data.data, 'oooppuu')
|
console.log(res.data.data, "oooppuu");
|
||||||
const data = res.data.data
|
const data = res.data.data;
|
||||||
const sku = this.skus[0]
|
const sku = this.skus[0];
|
||||||
const list = {}
|
const list = {};
|
||||||
Object.keys(data).map((key) => {
|
Object.keys(data).map((key) => {
|
||||||
Object.keys(sku).map((i) => {
|
Object.keys(sku).map((i) => {
|
||||||
if (key == i) {
|
if (key == i) {
|
||||||
list[i] = data[key]
|
list[i] = data[key];
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 商品列表
|
// 商品列表
|
||||||
handleList() {
|
handleList() {
|
||||||
goodsList().then((res) => {
|
goodsList().then((res) => {
|
||||||
this.goodschoose = res.data.data
|
this.goodschoose = res.data.data;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
// 保存,增加一个商品
|
// 保存,增加一个商品
|
||||||
handleSave() {
|
handleSave() {
|
||||||
if (this.gid) {
|
const goods = this.form;
|
||||||
const goods = this.form
|
const sku2 = this.skus[0];
|
||||||
const sku = this.skus[0]
|
const skus = [];
|
||||||
|
skus.push(sku2);
|
||||||
|
// console.log(goods, skus);
|
||||||
|
|
||||||
const updata = {
|
const updata = {
|
||||||
...goods,
|
...goods,
|
||||||
...sku,
|
|
||||||
goods_id: this.lid,
|
goods_id: this.lid,
|
||||||
}
|
skus: skus,
|
||||||
console.log(updata, '24235345')
|
};
|
||||||
// updateGoods(updata, this.gid).then((res) => {
|
// console.log(updata);
|
||||||
// console.log(res, '66666666')
|
|
||||||
// })
|
axios
|
||||||
} else {
|
.post("/api/goods", updata, {
|
||||||
const datas = {
|
headers: {
|
||||||
...this.form,
|
Authorization:
|
||||||
skus: this.skus,
|
"Bearer w1rr6IsxZIud46dIrGIivNAroFpqN52sSpXhk3azpPq2ZTbUXhgKTOLheoRm",
|
||||||
}
|
|
||||||
addGoods(datas)
|
|
||||||
.then((res) => {
|
|
||||||
if (res.data.httpCode == 200) {
|
|
||||||
this.$message({
|
|
||||||
type: 'success',
|
|
||||||
message: '添加成功',
|
|
||||||
})
|
|
||||||
this.updateForm()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((e) => {
|
|
||||||
this.$message({
|
|
||||||
type: 'error',
|
|
||||||
message: e.response.data.errorMessage.goods_code[0],
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
if (res.statusText === "OK") {
|
||||||
|
this.$message({
|
||||||
|
message: "商品添加成功!",
|
||||||
|
type: "success",
|
||||||
|
});
|
||||||
|
this.updateForm();
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
message: "商品添加失败!",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// if (this.gid) {
|
||||||
|
// const goods = this.form;
|
||||||
|
// const sku = this.skus[0];
|
||||||
|
// const updata = {
|
||||||
|
// ...goods,
|
||||||
|
// ...sku,
|
||||||
|
// goods_id: this.lid,
|
||||||
|
// };
|
||||||
|
// console.log(updata);
|
||||||
|
// } else {
|
||||||
|
// console.log(1111);
|
||||||
|
// const datas = {
|
||||||
|
// ...this.form,
|
||||||
|
// skus: this.skus,
|
||||||
|
// };
|
||||||
|
|
||||||
|
// addGoods(datas)
|
||||||
|
// .then((res) => {
|
||||||
|
// console.log("请求发起");
|
||||||
|
// if (res.data.httpCode == 200) {
|
||||||
|
// this.$message({
|
||||||
|
// type: "success",
|
||||||
|
// message: "添加成功",
|
||||||
|
// });
|
||||||
|
// this.updateForm();
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// .catch((e) => {
|
||||||
|
// this.$message({
|
||||||
|
// type: "error",
|
||||||
|
// message: e.response.data.errorMessage.goods_code[0],
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
|
||||||
// 修改成功后重置表单
|
// 修改成功后重置表单
|
||||||
updateForm() {
|
updateForm() {
|
||||||
this.form = {
|
this.form = {
|
||||||
title: '',
|
title: "",
|
||||||
img_url: 'abc.jpg',
|
img_url: "abc.jpg",
|
||||||
type_id: '',
|
type_id: "",
|
||||||
brand_id: '',
|
brand_id: "",
|
||||||
goods_code: '',
|
goods_code: "",
|
||||||
}
|
};
|
||||||
this.skus = [
|
this.skus = [
|
||||||
{
|
{
|
||||||
title: '',
|
title: "",
|
||||||
sku_code: '',
|
sku_code: "",
|
||||||
status: '',
|
status: "",
|
||||||
num: '',
|
num: "",
|
||||||
cost: '',
|
cost: "",
|
||||||
},
|
},
|
||||||
]
|
];
|
||||||
},
|
},
|
||||||
// 增加一个商品规格
|
// 增加一个商品规格
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.skus.push({
|
this.skus.push({
|
||||||
title: '',
|
title: "",
|
||||||
sku_code: '',
|
sku_code: "",
|
||||||
status: '',
|
status: "",
|
||||||
num: '',
|
num: "",
|
||||||
cost: '',
|
cost: "",
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
// 删除一个商品规格
|
// 删除一个商品规格
|
||||||
handleDelete(index) {
|
handleDelete(index) {
|
||||||
this.skus.splice(index, 1)
|
this.skus.splice(index, 1);
|
||||||
},
|
},
|
||||||
hanleurlimg(val) {
|
hanleurlimg(val) {
|
||||||
console.log(val, '=+++++++++')
|
console.log(val, "=+++++++++");
|
||||||
},
|
},
|
||||||
// 上传商品图片
|
// 上传商品图片
|
||||||
successUpload(file, fileList) {
|
successUpload(file, fileList) {
|
||||||
console.log(file, fileList, 5555)
|
console.log(file, fileList, 5555);
|
||||||
},
|
},
|
||||||
errorUpload(file, fileList) {
|
errorUpload(file, fileList) {
|
||||||
console.log(file, fileList, 5555)
|
console.log(file, fileList, 5555);
|
||||||
},
|
},
|
||||||
// 移除商品图片
|
// 移除商品图片
|
||||||
removeUpload() {},
|
removeUpload() {},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.gid = this.$route.query
|
this.gid = this.$route.query;
|
||||||
// 获取商品种类
|
// 获取商品种类
|
||||||
goods_types().then((res) => {
|
goods_types().then((res) => {
|
||||||
this.cate = res.data.data
|
this.cate = res.data.data;
|
||||||
})
|
});
|
||||||
// 获取商品品牌
|
// 获取商品品牌
|
||||||
Brand_goods_types().then((res) => {
|
Brand_goods_types().then((res) => {
|
||||||
this.brand = res.data.data
|
this.brand = res.data.data;
|
||||||
})
|
});
|
||||||
this.handleList()
|
this.handleList();
|
||||||
this.handleUpdate()
|
this.handleUpdate();
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
@ -1,192 +1,163 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 商品管理页面 -->
|
<!-- 商品管理页面 -->
|
||||||
<div>
|
<div>
|
||||||
|
<!-- 条件筛选板块 -->
|
||||||
<el-card class="box-card">
|
<el-card class="box-card">
|
||||||
<div class="goods"
|
<div class="goods" style="margin: 20px">
|
||||||
style="margin:20px">
|
<el-form ref="form" :inline="true" :model="form">
|
||||||
<el-form ref="form"
|
|
||||||
:inline="true"
|
|
||||||
:model="form">
|
|
||||||
<el-form-item label="商品名称:">
|
<el-form-item label="商品名称:">
|
||||||
<el-input v-model="form.goods_title"
|
<el-input v-model="form.goods_title" placeholder="商品名称">
|
||||||
placeholder="商品名称">
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品种类:">
|
<el-form-item label="商品种类:">
|
||||||
<el-select v-model="form.type_id"
|
<el-select v-model="form.type_id" placeholder="商品种类">
|
||||||
placeholder="商品种类">
|
<el-option
|
||||||
<el-option v-for="item in cate"
|
v-for="item in cate"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id">
|
:value="item.id"
|
||||||
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品规格:">
|
<el-form-item label="商品规格:">
|
||||||
<el-input v-model="form.sku_title"
|
<el-input v-model="form.sku_title" placeholder="商品规格">
|
||||||
placeholder="商品规格">
|
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品品牌:">
|
<el-form-item label="商品品牌:">
|
||||||
<el-select v-model="form.brand_id"
|
<el-select v-model="form.brand_id" placeholder="商品品牌">
|
||||||
placeholder="商品品牌">
|
<el-option
|
||||||
<el-option v-for="item in brand"
|
v-for="item in brand"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
:value="item.id">
|
:value="item.id"
|
||||||
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品库存:">
|
<el-form-item label="商品库存:">
|
||||||
<el-input v-model="form.keyword_type"
|
<el-input v-model="form.keyword_type" placeholder="商品库存">
|
||||||
placeholder="商品库存">
|
|
||||||
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品状态:">
|
<el-form-item label="商品状态:">
|
||||||
<el-select v-model="form.status"
|
<el-select v-model="form.status" placeholder="商品状态">
|
||||||
placeholder="商品状态">
|
<el-option
|
||||||
<el-option v-for="item in options"
|
v-for="item in options"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
:value="item.id">
|
:value="item.id"
|
||||||
|
>
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="创建时间:">
|
<el-form-item label="创建时间:">
|
||||||
<el-date-picker v-model="timer"
|
<el-date-picker
|
||||||
|
v-model="timer"
|
||||||
type="datetimerange"
|
type="datetimerange"
|
||||||
range-separator="至"
|
range-separator="至"
|
||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期"
|
end-placeholder="结束日期"
|
||||||
align="right"
|
align="right"
|
||||||
value-format="yyyy-MM-DD hh:mm:ss">
|
value-format="yyyy-MM-DD hh:mm:ss"
|
||||||
|
>
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary"
|
<el-button type="primary" @click="handleChoose">筛选</el-button>
|
||||||
@click="handleChoose">筛选</el-button>
|
<el-button plain @click="handleReChoose">重置筛选</el-button>
|
||||||
<el-button plain
|
|
||||||
@click="handleReChoose">重置筛选</el-button>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card class="box-card1"
|
<el-card class="box-card1" style="margin-top: 30px">
|
||||||
style="margin-top:30px">
|
|
||||||
<div>
|
<div>
|
||||||
<!-- 表格头部操作 -->
|
<!-- 表格头部操作 -->
|
||||||
<div>
|
<div>
|
||||||
<span>
|
<span> 全部商品(共{{ total }}条) </span>
|
||||||
全部商品(共800条)
|
|
||||||
</span>
|
|
||||||
<div class="btn">
|
<div class="btn">
|
||||||
<el-button type="primary"
|
<el-button type="primary" plain @click="addNewgoods"
|
||||||
plain
|
>新建商品</el-button
|
||||||
@click="addNewgoods">新建商品</el-button>
|
>
|
||||||
<el-button type="primary"
|
<el-button type="primary" @click="update()" plain>上新</el-button>
|
||||||
@click="update()"
|
<el-button type="primary" plain>库存盘点</el-button>
|
||||||
plain>上新</el-button>
|
<el-button type="primary" plain @click="handleImport"
|
||||||
<el-button type="primary"
|
>导入商品</el-button
|
||||||
plain>库存盘点</el-button>
|
>
|
||||||
<el-button type="primary"
|
<el-button type="primary" plain @click="handleExport"
|
||||||
plain
|
>表格导出</el-button
|
||||||
@click="handleImport">导入商品</el-button>
|
>
|
||||||
<el-button type="primary"
|
|
||||||
plain
|
|
||||||
@click="handleExport">表格导出</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
<el-table ref="multipleTable"
|
<el-table
|
||||||
|
ref="multipleTable"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
border
|
|
||||||
class="table"
|
class="table"
|
||||||
tooltip-effect="dark"
|
tooltip-effect="dark"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@selection-change="handleSelectionChange">
|
@selection-change="handleSelectionChange"
|
||||||
<el-table-column type="selection"
|
>
|
||||||
width="55">
|
<el-table-column type="selection" width="55"> </el-table-column>
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="商品信息">
|
<el-table-column label="商品信息">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div>{{ scope.row.goods.img_url}}</div>
|
<div>{{ scope.row.goods.img_url }}</div>
|
||||||
<div>{{ scope.row.goods.title}}</div>
|
<div>{{ scope.row.goods.title }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="品类">
|
<el-table-column label="品类">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div>{{ scope.row.goods.type?scope.row.goods.type.name:''}}</div>
|
<div>
|
||||||
|
{{ scope.row.goods.type ? scope.row.goods.type.name : "" }}
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="规格"
|
<el-table-column label="规格" prop="title"> </el-table-column>
|
||||||
prop="title">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="品牌">
|
<el-table-column label="品牌">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div>{{ scope.row.goods.brand?scope.row.goods.brand.name:''}}</div>
|
<div>
|
||||||
|
{{ scope.row.goods.brand ? scope.row.goods.brand.name : "" }}
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="two_days_ago_num"
|
<el-table-column prop="two_days_ago_num" sortable label="2天前库存">
|
||||||
sortable
|
|
||||||
label="2天前库存">
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="yesterday_num"
|
<el-table-column prop="yesterday_num" sortable label="1天前库存">
|
||||||
sortable
|
|
||||||
label="1天前库存">
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column sortable
|
<el-table-column sortable label="今日到货">
|
||||||
label="今日到货">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div>
|
<div>
|
||||||
<div v-if="true">
|
<div v-if="true">
|
||||||
<el-input v-model="input"></el-input>
|
<el-input v-model="input"></el-input>
|
||||||
</div>
|
</div>
|
||||||
<div>{{ scope.row.daily!=null?scope.row.daily.arrived_today_num:0}}</div>
|
<div>
|
||||||
|
{{
|
||||||
|
scope.row.daily != null
|
||||||
|
? scope.row.daily.arrived_today_num
|
||||||
|
: 0
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="cost"
|
<el-table-column prop="cost" sortable label="成本">
|
||||||
sortable
|
|
||||||
label="成本">
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="isShow">
|
<div v-if="isShow">
|
||||||
<el-input v-model="input"></el-input>
|
<el-input v-model="input"></el-input>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="reference_price"
|
<el-table-column prop="reference_price" sortable label="参考售价">
|
||||||
sortable
|
|
||||||
label="参考售价">
|
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="num"
|
<el-table-column prop="num" sortable label="总量"> </el-table-column>
|
||||||
sortable
|
<el-table-column prop="reserve" sortable label="预留量">
|
||||||
label="总量">
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="reserve"
|
<el-table-column prop="name" sortable label="店铺订单">
|
||||||
sortable
|
|
||||||
label="预留量">
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<!-- <el-table-column prop="name"
|
<el-table-column sortable label="损耗">
|
||||||
sortable
|
|
||||||
label="店铺订单">
|
|
||||||
</el-table-column> -->
|
|
||||||
<el-table-column sortable
|
|
||||||
label="损耗">
|
|
||||||
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<el-popover width="200" placement="right" trigger="hover">
|
||||||
<el-popover width="200"
|
|
||||||
placement="right"
|
|
||||||
trigger="hover">
|
|
||||||
<div class="detail">
|
<div class="detail">
|
||||||
<span>损耗:</span>
|
<span>损耗:</span>
|
||||||
<el-input></el-input>
|
<el-input></el-input>
|
||||||
@ -204,180 +175,170 @@
|
|||||||
<el-button type="primary">保存</el-button>
|
<el-button type="primary">保存</el-button>
|
||||||
<el-button>取消</el-button>
|
<el-button>取消</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="loss"
|
<div class="loss" slot="reference">
|
||||||
slot="reference">{{ scope.row.daily?scope.row.daily.arrived_loss_num:0}}</div>
|
{{ scope.row.daily ? scope.row.daily.arrived_loss_num : 0 }}
|
||||||
|
</div>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="stock"
|
<el-table-column prop="stock" sortable label="库存">
|
||||||
sortable
|
|
||||||
label="库存">
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="address"
|
<el-table-column prop="address" sortable label="库存盘点">
|
||||||
sortable
|
|
||||||
label="库存盘点">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div>{{ scope.row.daily?scope.row.daily.inventory:0}}</div>
|
<div>{{ scope.row.daily ? scope.row.daily.inventory : 0 }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status"
|
<el-table-column prop="status" label="状态"> </el-table-column>
|
||||||
label="状态">
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作">
|
<el-table-column label="操作">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div>
|
<div>
|
||||||
<el-button type="text">库存</el-button>
|
<el-button type="text">库存</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="text"
|
<el-button type="text" @click="handleEdit(scope.row.id)"
|
||||||
@click="handleEdit(scope.row.id)">编辑</el-button>
|
>编辑</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="text">记录</el-button>
|
<el-button type="text">记录</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
<el-button type="primary">确定</el-button>
|
<el-button type="primary">确定</el-button>
|
||||||
</el-card>
|
</el-card>
|
||||||
<div class="page-pagination">
|
|
||||||
<el-pagination :total="total"
|
|
||||||
class="mt-4"
|
|
||||||
:current-page="form.page"
|
|
||||||
:page-size="form.per_page"
|
|
||||||
@current-change="handleCurrentChange"
|
|
||||||
@size-change="handleSizeChange"
|
|
||||||
layout="total, prev, pager, next, jumper">
|
|
||||||
</el-pagination>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { goods } from '../../api/goods'
|
import axios from "axios";
|
||||||
import { goods_types, Brand_goods_types } from '../../api/rankingData.js'
|
import { goods } from "../../api/goods";
|
||||||
|
import { goods_types, Brand_goods_types } from "../../api/rankingData.js";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
total: 0, // 总条数
|
total: 0, // 总条数
|
||||||
timer: '', // 筛选的时间
|
timer: "", // 筛选的时间
|
||||||
radio: '', // 损耗选择的原因
|
radio: "", // 损耗选择的原因
|
||||||
brand: [], // 品牌列表
|
brand: [], // 品牌列表
|
||||||
cate: [], // 种类列表
|
cate: [], // 种类列表
|
||||||
isShow: false, // 点击上新显示输入框
|
isShow: false, // 点击上新显示输入框
|
||||||
tableData: [], // 商品列表
|
tableData: [], // 商品列表
|
||||||
// 商品状态
|
|
||||||
options: [
|
options: [
|
||||||
{
|
{
|
||||||
id: '1',
|
id: "1",
|
||||||
label: '在售',
|
label: "在售",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '2',
|
id: "2",
|
||||||
label: '预警',
|
label: "预警",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: '0',
|
id: "0",
|
||||||
label: '下架',
|
label: "下架",
|
||||||
},
|
},
|
||||||
],
|
], // 商品状态
|
||||||
|
|
||||||
// 请求商品列表的参数
|
// 请求商品列表的参数
|
||||||
form: {
|
form: {
|
||||||
goods_title: '', // 商品名称
|
goods_title: "", // 商品名称
|
||||||
type_id: '', // 商品种类id
|
type_id: "", // 商品种类id
|
||||||
brand_id: '', // 商品品牌id
|
brand_id: "", // 商品品牌id
|
||||||
sku_title: '', // 商品规格
|
sku_title: "", // 商品规格
|
||||||
status: '', // 商品状态
|
status: "", // 商品状态
|
||||||
keyword_type: '', // 库存
|
keyword_type: "", // 库存
|
||||||
keyword_value: '',
|
keyword_value: "",
|
||||||
page: 1,
|
page: 1,
|
||||||
per_page: 5,
|
per_page: 5,
|
||||||
},
|
},
|
||||||
input: '',
|
input: "",
|
||||||
value1: '',
|
value1: "",
|
||||||
currentPage4: 4,
|
};
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
list() {
|
||||||
|
axios.get("/api/goods").then((res) => {
|
||||||
|
console.log("我是商品", res);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
// 列表编辑
|
// 列表编辑
|
||||||
handleEdit(id) {
|
handleEdit(id) {
|
||||||
this.$router.push('/addgoods?id=' + id)
|
this.$router.push("/addgoods?id=" + id);
|
||||||
},
|
},
|
||||||
// 获取商品列表
|
// 获取商品列表
|
||||||
getList() {
|
getList() {
|
||||||
this.form.keyword_value = this.timer[0] + '-' + this.timer[1]
|
this.form.keyword_value = this.timer[0] + "-" + this.timer[1];
|
||||||
const forms = { ...this.form }
|
const forms = { ...this.form };
|
||||||
console.log(forms, 'opopo')
|
// console.log(forms, 'opopo')
|
||||||
goods(forms).then((res) => {
|
goods(forms).then((res) => {
|
||||||
this.tableData = res.data.data
|
console.log(res);
|
||||||
console.log(res, 111)
|
this.tableData = res.data.data;
|
||||||
|
// console.log(res, 111)
|
||||||
// console.log(this.tableData, 'ppp')
|
// console.log(this.tableData, 'ppp')
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
// 筛选
|
// 筛选
|
||||||
handleChoose() {
|
handleChoose() {
|
||||||
this.getList()
|
this.getList();
|
||||||
},
|
},
|
||||||
// 分页-当前页改变
|
// 分页-当前页改变
|
||||||
handleCurrentChange(e) {
|
handleCurrentChange(e) {
|
||||||
this.form.page = e
|
this.form.page = e;
|
||||||
this.handleChoose()
|
this.handleChoose();
|
||||||
},
|
},
|
||||||
// 分页
|
// 分页
|
||||||
handleSizeChange(e) {
|
handleSizeChange(e) {
|
||||||
this.form.per_page = e
|
this.form.per_page = e;
|
||||||
this.getList()
|
this.getList();
|
||||||
},
|
},
|
||||||
// 重置筛选
|
// 重置筛选
|
||||||
handleReChoose() {
|
handleReChoose() {
|
||||||
this.form = {
|
this.form = {
|
||||||
goods_title: '', // 商品名称
|
goods_title: "", // 商品名称
|
||||||
type_id: '', // 商品种类id
|
type_id: "", // 商品种类id
|
||||||
brand_id: '', // 商品品牌id
|
brand_id: "", // 商品品牌id
|
||||||
sku_title: '', // 商品规格
|
sku_title: "", // 商品规格
|
||||||
status: '', // 商品状态
|
status: "", // 商品状态
|
||||||
keyword_type: '',
|
keyword_type: "",
|
||||||
}
|
};
|
||||||
this.timer = ''
|
this.timer = "";
|
||||||
},
|
},
|
||||||
|
|
||||||
// 导入商品
|
// 导入商品
|
||||||
handleImport() {},
|
handleImport() {},
|
||||||
// 导出商品
|
// 导出商品
|
||||||
handleExport() {},
|
handleExport() {},
|
||||||
|
|
||||||
// 点击上新
|
// 点击上新
|
||||||
update() {
|
update() {
|
||||||
this.isShow = true
|
this.isShow = true;
|
||||||
console.log(this.isShow, 8888)
|
console.log(this.isShow, 8888);
|
||||||
},
|
},
|
||||||
// 复选框按钮
|
// 复选框按钮
|
||||||
handleSelectionChange(val) {
|
handleSelectionChange(val) {
|
||||||
console.log(val)
|
console.log(val);
|
||||||
this.multipleSelection = val
|
this.multipleSelection = val;
|
||||||
},
|
},
|
||||||
// 新增商品
|
// 新增商品跳转
|
||||||
addNewgoods() {
|
addNewgoods() {
|
||||||
this.$router.push({ path: '/addgoods' })
|
this.$router.push("/index/yingyeting/addgoods");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 获取商品种类
|
// 获取商品种类
|
||||||
goods_types().then((res) => {
|
goods_types().then((res) => {
|
||||||
this.cate = res.data.data
|
this.cate = res.data.data;
|
||||||
})
|
});
|
||||||
// 获取商品品牌
|
// 获取商品品牌
|
||||||
Brand_goods_types().then((res) => {
|
Brand_goods_types().then((res) => {
|
||||||
this.brand = res.data.data
|
this.brand = res.data.data;
|
||||||
})
|
});
|
||||||
// 获取商品列表
|
// 获取商品列表
|
||||||
this.getList()
|
this.getList();
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="css" scoped>
|
<style lang="css" scoped>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user