yyw提交
This commit is contained in:
parent
7e3a5fed04
commit
cfc9870314
45
resources/frontend/package-lock.json
generated
45
resources/frontend/package-lock.json
generated
@ -1203,7 +1203,6 @@
|
||||
"version": "7.23.9",
|
||||
"resolved": "https://registry.npmmirror.com/@babel/runtime/-/runtime-7.23.9.tgz",
|
||||
"integrity": "sha512-0CX6F+BI2s9dkUqr08KFrAIZgNFj75rdBU/DjCyYLIaV/quFjkk6T+EJ2LkZHyZTbEV4L5p97mNkUsHl2wLFAw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"regenerator-runtime": "^0.14.0"
|
||||
},
|
||||
@ -1211,8 +1210,7 @@
|
||||
"regenerator-runtime": {
|
||||
"version": "0.14.1",
|
||||
"resolved": "https://registry.npmmirror.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
|
||||
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==",
|
||||
"dev": true
|
||||
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw=="
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -1390,6 +1388,21 @@
|
||||
"integrity": "sha512-2LuNTFBIO0m7kKIQvvPHN6UE63VjpmL9rnEEaOOaiSPbZK+zUOYIzBAWcED+3XYzhYsd/0mD57VdxAEqqV52CQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@riophae/vue-treeselect": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmmirror.com/@riophae/vue-treeselect/-/vue-treeselect-0.4.0.tgz",
|
||||
"integrity": "sha512-J4atYmBqXQmiPFK/0B5sXKjtnGc21mBJEiyKIDZwk0Q9XuynVFX6IJ4EpaLmUgL5Tve7HAS7wkiGGSti6Uaxcg==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.3.1",
|
||||
"babel-helper-vue-jsx-merge-props": "^2.0.3",
|
||||
"easings-css": "^1.0.0",
|
||||
"fuzzysearch": "^1.0.3",
|
||||
"is-promise": "^2.1.0",
|
||||
"lodash": "^4.0.0",
|
||||
"material-colors": "^1.2.6",
|
||||
"watch-size": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"@samverschueren/stream-to-observable": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmmirror.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.1.tgz",
|
||||
@ -4278,6 +4291,11 @@
|
||||
"integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==",
|
||||
"dev": true
|
||||
},
|
||||
"easings-css": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/easings-css/-/easings-css-1.0.0.tgz",
|
||||
"integrity": "sha512-7Uq7NdazNfVtr0RNmPAys8it0zKCuaqxJStYKEl72D3j4gbvXhhaM7iWNbqhA4C94ygCye6VuyhzBRQC4szeBg=="
|
||||
},
|
||||
"easy-stack": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/easy-stack/-/easy-stack-1.0.1.tgz",
|
||||
@ -5448,6 +5466,11 @@
|
||||
"integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==",
|
||||
"dev": true
|
||||
},
|
||||
"fuzzysearch": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmmirror.com/fuzzysearch/-/fuzzysearch-1.0.3.tgz",
|
||||
"integrity": "sha512-s+kNWQuI3mo9OALw0HJ6YGmMbLqEufCh2nX/zzV5CrICQ/y4AwPxM+6TIiF9ItFCHXFCyM/BfCCmN57NTIJuPg=="
|
||||
},
|
||||
"gensync": {
|
||||
"version": "1.0.0-beta.2",
|
||||
"resolved": "https://registry.npmmirror.com/gensync/-/gensync-1.0.0-beta.2.tgz",
|
||||
@ -6247,8 +6270,7 @@
|
||||
"is-promise": {
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmmirror.com/is-promise/-/is-promise-2.2.2.tgz",
|
||||
"integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==",
|
||||
"dev": true
|
||||
"integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ=="
|
||||
},
|
||||
"is-regex": {
|
||||
"version": "1.1.4",
|
||||
@ -6882,8 +6904,7 @@
|
||||
"lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz",
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||
"dev": true
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||
},
|
||||
"lodash.debounce": {
|
||||
"version": "4.0.8",
|
||||
@ -7111,6 +7132,11 @@
|
||||
"semver": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"material-colors": {
|
||||
"version": "1.2.6",
|
||||
"resolved": "https://registry.npmmirror.com/material-colors/-/material-colors-1.2.6.tgz",
|
||||
"integrity": "sha512-6qE4B9deFBIa9YSpOc9O0Sgc43zTeVYbgDT5veRKSlB2+ZuHNoVVxA1L/ckMUayV9Ay9y7Z/SZCLcGteW9i7bg=="
|
||||
},
|
||||
"mdn-data": {
|
||||
"version": "2.0.14",
|
||||
"resolved": "https://registry.npmmirror.com/mdn-data/-/mdn-data-2.0.14.tgz",
|
||||
@ -9996,6 +10022,11 @@
|
||||
"resolved": "https://registry.npmmirror.com/vuex/-/vuex-3.6.2.tgz",
|
||||
"integrity": "sha512-ETW44IqCgBpVomy520DT5jf8n0zoCac+sxWnn+hMe/CzaSejb/eVw2YToiXYX+Ex/AuHHia28vWTq4goAexFbw=="
|
||||
},
|
||||
"watch-size": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/watch-size/-/watch-size-2.0.0.tgz",
|
||||
"integrity": "sha512-M92R89dNoTPWyCD+HuUEDdhaDnh9jxPGOwlDc0u51jAgmjUvzqaEMynXSr3BaWs+QdHYk4KzibPy1TFtjLmOZQ=="
|
||||
},
|
||||
"watchpack": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmmirror.com/watchpack/-/watchpack-2.4.0.tgz",
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
"lint": "vue-cli-service lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@riophae/vue-treeselect": "^0.4.0",
|
||||
"axios": "^0.21.1",
|
||||
"core-js": "^3.6.5",
|
||||
"dayjs": "^1.11.12",
|
||||
|
||||
8
resources/frontend/src/api/rankingData.js
vendored
8
resources/frontend/src/api/rankingData.js
vendored
@ -29,11 +29,17 @@ export function storeDetail(params) {
|
||||
// 商品种类列表
|
||||
export function goods_types(params) {
|
||||
return http({
|
||||
url: "/api/goods_types",
|
||||
url: "/api/goodsTypes/tree",
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
}
|
||||
export function goods_types_detail(id) {
|
||||
return http({
|
||||
url: `/api/goods_types/${id}`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
// 商品种类列表删除
|
||||
export function Delgoods_types(id) {
|
||||
return http({
|
||||
|
||||
193
resources/frontend/src/components/selectTree.vue
Normal file
193
resources/frontend/src/components/selectTree.vue
Normal file
@ -0,0 +1,193 @@
|
||||
<template>
|
||||
<div class="tree_select">
|
||||
<el-select
|
||||
v-model="valueId"
|
||||
ref="selectEl"
|
||||
:filterable="filterable"
|
||||
:clearable="clearable"
|
||||
@clear="clearHandle"
|
||||
:filter-method="selectFilterData"
|
||||
:size="size">
|
||||
<el-option :value="valueId" :label="valueTitle">
|
||||
<el-tree
|
||||
id="tree-option"
|
||||
ref="selectTree"
|
||||
:accordion="accordion"
|
||||
:data="options"
|
||||
:props="props"
|
||||
:node-key="props.value"
|
||||
:expand-on-click-node="false"
|
||||
:default-expanded-keys="defaultExpandedKey"
|
||||
:filter-node-method="filterNode"
|
||||
@node-click="handleNodeClick">
|
||||
</el-tree>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'SelectTree',
|
||||
props: {
|
||||
/* 配置项 */
|
||||
props: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
value: 'id', // ID字段名
|
||||
label: 'title', // 显示名称
|
||||
children: 'children' // 子级字段名
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 选项列表数据(树形结构的对象数组) */
|
||||
options: {
|
||||
type: Array,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
/* 初始值 */
|
||||
value: {
|
||||
type: [Number, String],
|
||||
default: () => {
|
||||
return null
|
||||
}
|
||||
},
|
||||
/* 可清空选项 */
|
||||
clearable: {
|
||||
type: Boolean,
|
||||
default: () => {
|
||||
return true
|
||||
}
|
||||
},
|
||||
/* 自动收起 */
|
||||
accordion: {
|
||||
type: Boolean,
|
||||
default: () => {
|
||||
return false
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 下拉选项框的大小,默认最小
|
||||
*/
|
||||
size: {
|
||||
type: String,
|
||||
default: () => {
|
||||
return 'small'
|
||||
}
|
||||
},
|
||||
// 是否可以搜索
|
||||
filterable: Boolean
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
valueId: this.value, // 初始值
|
||||
valueTitle: '',
|
||||
defaultExpandedKey: []
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.$nextTick(function () {
|
||||
this.initHandle()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 初始化值
|
||||
initHandle () {
|
||||
if (this.valueId) {
|
||||
this.valueTitle = this.$refs.selectTree.getNode(this.valueId).data[this.props.label] // 初始化显示
|
||||
this.$refs.selectTree.setCurrentKey(this.valueId) // 设置默认选中
|
||||
this.defaultExpandedKey = [this.valueId] // 设置默认展开
|
||||
console.log(this.valueTitle)
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
const scrollWrap = document.querySelectorAll('.el-scrollbar .el-select-dropdown__wrap')[0]
|
||||
const scrollBar = document.querySelectorAll('.el-scrollbar .el-scrollbar__bar')
|
||||
scrollWrap.style.cssText = 'margin: 0px; max-height: none; overflow: hidden;'
|
||||
scrollBar.forEach(ele => {
|
||||
ele.style.width = 0
|
||||
})
|
||||
})
|
||||
},
|
||||
// 切换选项
|
||||
handleNodeClick (node) {
|
||||
this.valueTitle = node[this.props.label]
|
||||
this.valueId = node[this.props.value]
|
||||
this.$emit('getValue', this.valueId)
|
||||
this.defaultExpandedKey = []
|
||||
// 选中后失去焦点,隐藏下拉框
|
||||
this.$refs.selectEl.blur()
|
||||
// 把数据还原
|
||||
this.selectFilterData('')
|
||||
},
|
||||
/**
|
||||
* 下拉框搜索
|
||||
*/
|
||||
selectFilterData (val) {
|
||||
this.$refs.selectTree.filter(val)
|
||||
},
|
||||
/**
|
||||
* 过滤节点
|
||||
*/
|
||||
filterNode (value, data) {
|
||||
if (!value) return true
|
||||
return data.label.indexOf(value) !== -1
|
||||
},
|
||||
// 清除选中
|
||||
clearHandle () {
|
||||
this.valueTitle = ''
|
||||
this.valueId = null
|
||||
this.defaultExpandedKey = []
|
||||
this.clearSelected()
|
||||
this.$emit('getValue', null)
|
||||
},
|
||||
/* 清空选中样式 */
|
||||
clearSelected () {
|
||||
const allNode = document.querySelectorAll('#tree-option .el-tree-node')
|
||||
allNode.forEach((element) => element.classList.remove('is-current'))
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
/**
|
||||
* 监听绑定的值变化
|
||||
*/
|
||||
value () {
|
||||
this.valueId = this.value
|
||||
this.initHandle()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .el-select .el-input .el-input__inner {
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.el-scrollbar .el-scrollbar__view .el-select-dropdown__item {
|
||||
height: auto;
|
||||
max-height: 274px;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.el-select-dropdown__item.selected {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
ul li >>> .el-tree .el-tree-node__content {
|
||||
height: auto;
|
||||
padding: 0 20px;
|
||||
}
|
||||
|
||||
::v-deep .el-tree-node__content:hover,
|
||||
::v-deep .el-tree-node__content:active,
|
||||
::v-deep .is-current > div:first-child,
|
||||
::v-deep .el-tree-node__content:focus {
|
||||
background-color: #F5F7FA;
|
||||
color: #409EFF;
|
||||
}
|
||||
</style>
|
||||
@ -1,11 +1,10 @@
|
||||
<template>
|
||||
<div class="conent">
|
||||
<!-- 新增按钮 -->
|
||||
<el-button type="primary" @click="handAdd">新增</el-button>
|
||||
|
||||
<!-- 列表 -->
|
||||
<div class="table" style="margin-top: 10px">
|
||||
<el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%"
|
||||
<div class="pageBox">
|
||||
<el-card>
|
||||
<div class="opaBox">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handAdd">新增</el-button>
|
||||
</div>
|
||||
<el-table border ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column prop="name" label="商品品牌"> </el-table-column>
|
||||
<el-table-column prop="" label="操作">
|
||||
@ -15,15 +14,18 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<!-- 分页功能 -->
|
||||
<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">
|
||||
<div class="page-pagination">
|
||||
<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>
|
||||
</el-card>
|
||||
|
||||
<!-- 新增品牌对话框 -->
|
||||
<el-dialog title="新增品牌" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
|
||||
@ -54,132 +56,126 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
Brand_goods_types,
|
||||
DelBrand_goods_types,
|
||||
AddBrandgoods_types,
|
||||
editBrand_types,
|
||||
} from "../../api/rankingData";
|
||||
import { Brand_goods_types, DelBrand_goods_types, AddBrandgoods_types, editBrand_types } from "@/api/rankingData"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id: "", //每一项的id
|
||||
id: '', //每一项的id
|
||||
tableData: [],
|
||||
multipleSelection: [],
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false,
|
||||
form: {
|
||||
kindName: "", //种类名
|
||||
kindName: '', //种类名
|
||||
},
|
||||
form1: {
|
||||
kindName1: "", //种类名
|
||||
kindName1: '', //种类名
|
||||
},
|
||||
formLabelWidth: "120px",
|
||||
formLabelWidth1: "120px",
|
||||
formLabelWidth: '120px',
|
||||
formLabelWidth1: '120px',
|
||||
newKind: [],
|
||||
Paginationdata: {}, //分页相关数据
|
||||
current_page: 1, //当前页
|
||||
per_page: 15, //每页显示数量
|
||||
};
|
||||
per_page: 15 //每页显示数量
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getGoods_types();
|
||||
this.getGoods_types()
|
||||
},
|
||||
methods: {
|
||||
// 复选框按钮
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
this.multipleSelection = val
|
||||
},
|
||||
//分页功能
|
||||
handleSizeChange(val) {
|
||||
//当前条数
|
||||
this.per_page = val;
|
||||
this.getGoods_types();
|
||||
this.per_page = val
|
||||
this.getGoods_types()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
//当前页
|
||||
this.current_page = val;
|
||||
this.getGoods_types();
|
||||
this.current_page = val
|
||||
this.getGoods_types()
|
||||
},
|
||||
// 新增
|
||||
handAdd() {
|
||||
this.form.kindName = "";
|
||||
this.dialogFormVisible = true;
|
||||
this.form.kindName = ""
|
||||
this.dialogFormVisible = true
|
||||
},
|
||||
// 确认新增
|
||||
addSubmit() {
|
||||
var string;
|
||||
string = this.form.kindName.replace(/\s/g, ",").split(",");
|
||||
string = this.form.kindName.replace(/\s/g, ",").split(",")
|
||||
AddBrandgoods_types({
|
||||
names: string,
|
||||
names: string
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "添加成功",
|
||||
});
|
||||
this.getGoods_types();
|
||||
});
|
||||
this.dialogFormVisible = false;
|
||||
message: "添加成功"
|
||||
})
|
||||
this.getGoods_types()
|
||||
})
|
||||
this.dialogFormVisible = false
|
||||
},
|
||||
// 编辑
|
||||
handEdit(id, item) {
|
||||
this.id = id;
|
||||
this.form1.kindName1 = item.name;
|
||||
this.dialogFormVisible1 = true;
|
||||
this.id = id
|
||||
this.form1.kindName1 = item.name
|
||||
this.dialogFormVisible1 = true
|
||||
},
|
||||
// 编辑确定按钮
|
||||
EditSubmit() {
|
||||
editBrand_types(this.id, {
|
||||
name: this.form1.kindName1,
|
||||
name: this.form1.kindName1
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "编辑成功",
|
||||
});
|
||||
this.getGoods_types();
|
||||
});
|
||||
this.dialogFormVisible1 = false;
|
||||
message: "编辑成功"
|
||||
})
|
||||
this.getGoods_types()
|
||||
})
|
||||
this.dialogFormVisible1 = false
|
||||
},
|
||||
// 删除
|
||||
handdel(id) {
|
||||
this.$confirm("确定删除此条商品品牌吗?", "确认删除", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
DelBrand_goods_types(id).then((res) => {
|
||||
this.getGoods_types();
|
||||
});
|
||||
this.getGoods_types()
|
||||
})
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "删除成功!",
|
||||
});
|
||||
message: "删除成功!"
|
||||
})
|
||||
.catch(() => {
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: "info",
|
||||
message: "已取消删除",
|
||||
});
|
||||
});
|
||||
message: "已取消删除"
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取列表
|
||||
getGoods_types() {
|
||||
let page = {
|
||||
page: this.current_page,
|
||||
per_page: this.per_page,
|
||||
};
|
||||
per_page: this.per_page
|
||||
}
|
||||
Brand_goods_types(page).then((res) => {
|
||||
this.tableData = res.data.data;
|
||||
this.Paginationdata = res.data.meta;
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
this.tableData = res.data.data
|
||||
this.Paginationdata = res.data.meta
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.block {
|
||||
margin-top: 20px;
|
||||
.opaBox{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -54,9 +54,7 @@
|
||||
</div>
|
||||
|
||||
<el-card>
|
||||
<div class="echartBox" id="myEchart">
|
||||
|
||||
</div>
|
||||
<div class="echartBox" id="myEchart"></div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
@ -70,7 +68,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
time_type: 'day',
|
||||
time_type: 'thirty',
|
||||
timeTypeList: [
|
||||
{ label: '自然日', value: 'day' },
|
||||
{ label: '自然周', value: 'week' },
|
||||
@ -100,8 +98,8 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getInitList() {
|
||||
let time = this.getDayTime()
|
||||
this.dayValue = this.startTime = this.endTime = time
|
||||
this.dayValue = this.endTime = dayjs().format('YYYY-MM-DD')
|
||||
this.startTime = dayjs().subtract(30, 'day').format('YYYY-MM-DD')
|
||||
this.fetchData()
|
||||
},
|
||||
changeTimeType() {
|
||||
|
||||
@ -106,6 +106,14 @@ export default {
|
||||
{ label: '近30天', value: 'thirty' },
|
||||
{ label: '自定义', value: 'custom' }
|
||||
],
|
||||
TIMETYPE: {
|
||||
'day': '自然日',
|
||||
'week': '自然周',
|
||||
'month': '自然月',
|
||||
'seven': '近7天',
|
||||
'thirty': '近30天',
|
||||
'custom': '自定义'
|
||||
},
|
||||
dayValue: '',
|
||||
monthValue: '',
|
||||
customValue: [],
|
||||
@ -239,6 +247,7 @@ export default {
|
||||
message: '暂无数据',
|
||||
type: 'error'
|
||||
})
|
||||
this.downloadLoading = false
|
||||
return
|
||||
}
|
||||
import('@/util/Export2Excel').then(excel => {
|
||||
@ -246,10 +255,11 @@ export default {
|
||||
const filterVal = ['name', 'title', 'external_sku_id', 'goods_total', 'goods_total_amount']
|
||||
const list = res.data.data.data
|
||||
const data = this.formatJson(filterVal, list)
|
||||
let date = this.startTime == this.endTime ? this.startTime : this.startTime + '-' + this.endTime
|
||||
excel.export_json_to_excel({
|
||||
header: tHeader,
|
||||
data,
|
||||
filename: 'sku销售统计数据',
|
||||
filename: 'sku销售统计数据【' + this.TIMETYPE[this.time_type] + date + '】',
|
||||
autoWidth: this.autoWidth,
|
||||
bookType: this.bookType
|
||||
})
|
||||
|
||||
@ -91,6 +91,14 @@ export default {
|
||||
{ label: '近30天', value: 'thirty' },
|
||||
{ label: '自定义', value: 'custom' }
|
||||
],
|
||||
TIMETYPE: {
|
||||
'day': '自然日',
|
||||
'week': '自然周',
|
||||
'month': '自然月',
|
||||
'seven': '近7天',
|
||||
'thirty': '近30天',
|
||||
'custom': '自定义'
|
||||
},
|
||||
dayValue: '',
|
||||
monthValue: '',
|
||||
customValue: [],
|
||||
@ -203,11 +211,12 @@ export default {
|
||||
const tHeader = ['类型名称', '库存', '可售库存', '未发货数', '未发货数', '总销量', '总销售金额']
|
||||
const filterVal = ['type_name', 'stock', 'sale_stock', 'shipping_num', 'unshipping_num', 'goods_total', 'goods_total_amount']
|
||||
const list = this.saleList
|
||||
let date = this.startTime == this.endTime ? this.startTime : this.startTime + '-' + this.endTime
|
||||
const data = this.formatJson(filterVal, list)
|
||||
excel.export_json_to_excel({
|
||||
header: tHeader,
|
||||
data,
|
||||
filename: 'sku销售统计数据',
|
||||
filename: 'sku销售统计数据【' + this.TIMETYPE[this.time_type] + date + '】',
|
||||
autoWidth: this.autoWidth,
|
||||
bookType: this.bookType
|
||||
})
|
||||
|
||||
@ -30,17 +30,22 @@
|
||||
<el-input placeholder="商品编码" v-model="form.goods_code" :disabled="disabled"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品种类:">
|
||||
<el-select v-model="form.type_id" placeholder="商品种类" filterable :disabled="disabled">
|
||||
<!-- <el-select v-model="form.type_id" placeholder="商品种类" filterable :disabled="disabled">
|
||||
<el-option v-for="item in cate" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-select> -->
|
||||
<treeselect
|
||||
:options="treeList"
|
||||
placeholder="请选择分类"
|
||||
style="width: 250px;"
|
||||
v-model="form.type_id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品品牌:">
|
||||
<!-- <el-form-item label="商品品牌:">
|
||||
<el-select v-model="form.brand_id" placeholder="商品品牌" filterable :disabled="disabled">
|
||||
<el-option v-for="item in brand" :key="item.id" :label="item.name" :value="item.id">
|
||||
<el-option v-for="item in brandList" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
</div>
|
||||
<div v-for="(item, i) in skus" :key="i" class="skuBox">
|
||||
<div class="tit">规格{{ i + 1 }}</div>
|
||||
@ -90,16 +95,20 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addGoods, goodsList, imgUpload } from "../../../api/goods.js";
|
||||
import { goods_types, Brand_goods_types } from "../../../api/rankingData.js";
|
||||
import { addGoods, goodsList, imgUpload } from '@/api/goods.js'
|
||||
import { goods_types, Brand_goods_types } from '@/api/rankingData.js'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
export default {
|
||||
components: { Treeselect },
|
||||
data() {
|
||||
return {
|
||||
lid: "", // 选择的商品列表id
|
||||
gid: "", // 商品id
|
||||
brand: [], // 品牌列表
|
||||
cate: [], // 种类列表
|
||||
goodschoose: [], // 商品列表
|
||||
lid: "",
|
||||
gid: "",
|
||||
brandList: [],
|
||||
treeList: [],
|
||||
goodschoose: [],
|
||||
// 规格列表
|
||||
skus: [],
|
||||
// 增加商品表单
|
||||
@ -107,7 +116,7 @@ export default {
|
||||
goods_id: "",
|
||||
title: "",
|
||||
img_url: "",
|
||||
type_id: "",
|
||||
type_id: null, // Treeselect组件要求空值为null
|
||||
brand_id: "",
|
||||
goods_code: "",
|
||||
},
|
||||
@ -127,23 +136,14 @@ export default {
|
||||
},
|
||||
],
|
||||
file: [],
|
||||
disabled: false,
|
||||
};
|
||||
disabled: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let page = {
|
||||
per_page: 999,
|
||||
};
|
||||
// 获取商品种类
|
||||
goods_types(page).then((res) => {
|
||||
this.cate = res.data.data;
|
||||
});
|
||||
// 获取商品品牌
|
||||
Brand_goods_types(page).then((res) => {
|
||||
this.brand = res.data.data;
|
||||
});
|
||||
this.handleList();
|
||||
this.handleAdd();
|
||||
this.getGoods_types()
|
||||
this.getGoodsBrand()
|
||||
this.handleList()
|
||||
this.handleAdd()
|
||||
},
|
||||
watch: {
|
||||
lid: {
|
||||
@ -161,6 +161,19 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getGoods_types() {
|
||||
let params = {
|
||||
parent_id: 0
|
||||
}
|
||||
goods_types(params).then((res) => {
|
||||
this.treeList = JSON.parse(JSON.stringify(res.data.data).replace(/name/g, "label"))
|
||||
})
|
||||
},
|
||||
getGoodsBrand() {
|
||||
Brand_goods_types({per_page: 999}).then((res) => {
|
||||
this.brandList = res.data.data
|
||||
})
|
||||
},
|
||||
//图片上传
|
||||
handleAvatarSuccess(res, files) {
|
||||
let formData = new FormData();
|
||||
@ -196,8 +209,9 @@ export default {
|
||||
const updata = {
|
||||
...goods,
|
||||
goods_id: this.lid,
|
||||
skus: skus,
|
||||
};
|
||||
skus: skus
|
||||
}
|
||||
updata.type_id = updata.type_id || ''
|
||||
addGoods(updata).then((res) => {
|
||||
if (res.statusText === "OK") {
|
||||
this.$message({
|
||||
@ -206,7 +220,7 @@ export default {
|
||||
});
|
||||
this.$router.push("/GOODS_LIST");
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
// 增加一个商品规格
|
||||
handleAdd() {
|
||||
|
||||
@ -143,10 +143,7 @@ export default {
|
||||
item_num: 1,
|
||||
}],
|
||||
},
|
||||
skus: [{
|
||||
'id': '',
|
||||
'title': ''
|
||||
}],
|
||||
skus: [],
|
||||
remoteLoading: false
|
||||
};
|
||||
},
|
||||
|
||||
@ -27,17 +27,18 @@
|
||||
<el-input placeholder="商品编码" v-model="goodsData.goods.goods_code"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="商品种类:">
|
||||
<el-select v-model="goodsData.goods.type_id" placeholder="商品种类" filterable>
|
||||
<el-option v-for="item in cate" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<treeselect
|
||||
:options="treeList"
|
||||
placeholder="请选择分类"
|
||||
style="width: 216px;"
|
||||
v-model="goodsData.goods.type_id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="商品品牌:">
|
||||
<!-- <el-form-item label="商品品牌:">
|
||||
<el-select v-model="goodsData.goods.brand_id" placeholder="商品品牌" filterable>
|
||||
<el-option v-for="item in brand" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
</div>
|
||||
<div>
|
||||
<el-form-item label="商品规格:">
|
||||
@ -98,13 +99,17 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { checkGoods, goodsList, updateGoods, imgUpload } from "../../api/goods.js";
|
||||
import { goods_types, Brand_goods_types } from "../../api/rankingData.js";
|
||||
import { checkGoods, goodsList, updateGoods, imgUpload } from '@/api/goods.js'
|
||||
import { goods_types, Brand_goods_types } from '@/api/rankingData.js'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
export default {
|
||||
components: { Treeselect },
|
||||
data() {
|
||||
return {
|
||||
brand: [], // 品牌列表
|
||||
cate: [], // 种类列表
|
||||
treeList: [], // 种类列表
|
||||
goodschoose: [], // 商品列表
|
||||
skuId: 0, // 商品id
|
||||
// 增加商品表单
|
||||
@ -120,7 +125,7 @@ export default {
|
||||
goods: {
|
||||
img_url: "",
|
||||
title: "",
|
||||
type_id: "",
|
||||
type_id: null,
|
||||
brand_id: "",
|
||||
goods_code: "",
|
||||
}
|
||||
@ -145,6 +150,19 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
getGoods_types() {
|
||||
let params = {
|
||||
parent_id: 0
|
||||
}
|
||||
goods_types(params).then((res) => {
|
||||
this.treeList = JSON.parse(JSON.stringify(res.data.data).replace(/name/g, "label"))
|
||||
})
|
||||
},
|
||||
getGoodsBrand() {
|
||||
Brand_goods_types({per_page: 999}).then((res) => {
|
||||
this.brandList = res.data.data
|
||||
})
|
||||
},
|
||||
//图片上传
|
||||
handleAvatarSuccess(res, files) {
|
||||
let formData = new FormData();
|
||||
@ -201,7 +219,8 @@ export default {
|
||||
// 商品列表页进入带数据表单
|
||||
getGoodsSkuData() {
|
||||
checkGoods(this.skuId).then((res) => {
|
||||
this.goodsData = res.data.data;
|
||||
this.goodsData = res.data.data
|
||||
this.goodsData.goods.type_id = this.goodsData.goods.type_id || null
|
||||
});
|
||||
},
|
||||
// 编辑确认请求
|
||||
@ -209,7 +228,7 @@ export default {
|
||||
let goods = {
|
||||
title: this.goodsData.goods.title,
|
||||
img_url: this.goodsData.goods.img_url,
|
||||
type_id: this.goodsData.goods.type_id,
|
||||
type_id: this.goodsData.goods.type_id || '',
|
||||
brand_id: this.goodsData.goods.brand_id,
|
||||
goods_code: this.goodsData.goods.goods_code,
|
||||
};
|
||||
@ -251,17 +270,8 @@ export default {
|
||||
this.skuId = parseInt(this.$route.query.id);
|
||||
},
|
||||
mounted() {
|
||||
let page = {
|
||||
per_page: 999,
|
||||
};
|
||||
// 获取商品种类
|
||||
goods_types(page).then((res) => {
|
||||
this.cate = res.data.data;
|
||||
});
|
||||
// 获取商品品牌
|
||||
Brand_goods_types(page).then((res) => {
|
||||
this.brand = res.data.data;
|
||||
});
|
||||
this.getGoods_types()
|
||||
this.getGoodsBrand()
|
||||
this.handleList();
|
||||
this.getGoodsSkuData();
|
||||
}
|
||||
|
||||
@ -9,10 +9,11 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<span>商品种类:</span>
|
||||
<el-select v-model="form.type_id" placeholder="商品种类" clearable>
|
||||
<el-option v-for="item in cate" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<treeselect
|
||||
:options="treeList"
|
||||
placeholder="请选择分类"
|
||||
style="width: 220px;"
|
||||
v-model="form.type_id" />
|
||||
</div>
|
||||
<div class="row">
|
||||
<span>商品品牌:</span>
|
||||
@ -375,12 +376,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from "axios";
|
||||
import { goods_types, Brand_goods_types } from "../../api/rankingData.js"
|
||||
import { goods, update, singleUpdate, getStockNum } from "../../api/goods"
|
||||
import { orderRest } from "../../api/shop"
|
||||
import axios from 'axios'
|
||||
import { goods_types, Brand_goods_types } from '@/api/rankingData.js'
|
||||
import { goods, update, singleUpdate, getStockNum } from '@/api/goods'
|
||||
import { orderRest } from "@/api/shop"
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
export default {
|
||||
components: { Treeselect },
|
||||
data() {
|
||||
return {
|
||||
editPriceId: '', //参考售价的id
|
||||
@ -392,7 +396,7 @@
|
||||
other_num: 0, // 其它数量
|
||||
radio: '', // 损耗选择的原因
|
||||
brand: [], // 品牌列表
|
||||
cate: [], // 种类列表
|
||||
treeList: [], // 种类列表
|
||||
loading: true,
|
||||
tableData: [], // 商品列表
|
||||
shopsData: [], //店铺传参数组
|
||||
@ -418,7 +422,7 @@
|
||||
form: {
|
||||
external_sku_id: '',
|
||||
goods_title: '', // 商品名称
|
||||
type_id: '', // 商品种类id
|
||||
type_id: null, // 商品种类id
|
||||
brand_id: '', // 商品品牌id
|
||||
sku_title: '', // 商品规格
|
||||
status: '', // 商品状态
|
||||
@ -542,6 +546,7 @@
|
||||
// 返回对象
|
||||
return _newPar
|
||||
}
|
||||
newObj.type_id = newObj.type_id || ''
|
||||
goods(newObj).then((res) => {
|
||||
this.tableData = res.data.data
|
||||
this.tableData = this.tableData.map((item) => {
|
||||
@ -561,7 +566,7 @@
|
||||
this.form = {
|
||||
external_sku_id: '',
|
||||
goods_title: '', // 商品名称
|
||||
type_id: '', // 商品种类id
|
||||
type_id: null, // 商品种类id
|
||||
brand_id: '', // 商品品牌id
|
||||
sku_title: '', // 商品规格
|
||||
status: '' // 商品状态
|
||||
@ -958,7 +963,7 @@
|
||||
per_page: 99999
|
||||
}
|
||||
goods_types(param).then((res) => {
|
||||
this.cate = res.data.data
|
||||
this.treeList = JSON.parse(JSON.stringify(res.data.data).replace(/name/g, "label"))
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
@ -1,188 +1,202 @@
|
||||
<template>
|
||||
<div class="conent">
|
||||
<!-- 新增按钮 -->
|
||||
<el-button type="primary" @click="handAdd">新增</el-button>
|
||||
|
||||
<!-- 列表 -->
|
||||
<div class="table" style="margin-top: 10px">
|
||||
<el-table v-loading="loading" ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%"
|
||||
@selection-change="handleSelectionChange">
|
||||
<div class="pageBox">
|
||||
<el-card>
|
||||
<div class="opaBox">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
||||
</div>
|
||||
<el-table :data="tableData" border v-loading="loading" row-key="id" :tree-props="{children: 'children', hasChildren: 'hasChildren'}" style="width: 100%">
|
||||
<el-table-column prop="name" label="商品种类"></el-table-column>
|
||||
<el-table-column prop="" label="是否显示">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.show" active-text="是" inactive-text="否" :active-value="1" :inactive-value="0" disabled></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="primary" @click="handEdit(scope.row.id, scope.row)">编辑</el-button>
|
||||
<el-button type="danger" @click="handdel(scope.row.id)">删除</el-button>
|
||||
<el-button icon="el-icon-plus" @click="addSubType(scope.row)">添加子分类</el-button>
|
||||
<el-button type="primary" @click="handleEdit(scope.row.id, scope.row)">编辑</el-button>
|
||||
<el-button type="danger" @click="handleDel(scope.row.id)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<!-- 分页功能 -->
|
||||
<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>
|
||||
|
||||
<!-- 新增种类对话框 -->
|
||||
<el-dialog title="新增" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
|
||||
<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-card>
|
||||
|
||||
<!-- 编辑 -->
|
||||
<el-dialog title="编辑" :visible.sync="dialogFormVisible1" :close-on-click-modal="false">
|
||||
<el-form :model="form1">
|
||||
<el-form-item label="编辑种类" :label-width="formLabelWidth1">
|
||||
<el-input v-model="form1.kindName1" autocomplete="off"></el-input>
|
||||
<el-dialog :title="curId ? '编辑' : '新增'" :visible.sync="dialogVisible" width="500px">
|
||||
<el-form label-width="100px">
|
||||
<!-- <el-form-item label="父级分类:">
|
||||
<el-select v-model="curInfo.parent_name" placeholder="请选择父级分类" clearable @change="changeSelect">
|
||||
<el-option style="height: auto;" :value="curInfo.parent_id">
|
||||
<el-tree
|
||||
:data="tableData"
|
||||
:props="defaultProps"
|
||||
@node-click="handleNodeClick">
|
||||
</el-tree>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="父级分类:">
|
||||
<!-- <select-tree
|
||||
:value="curInfo.parent_id"
|
||||
:options="tableData"
|
||||
:props="defaultProps"
|
||||
@getValue="getValue">
|
||||
</select-tree> -->
|
||||
<treeselect
|
||||
:options="treeList"
|
||||
placeholder="请选择分类"
|
||||
v-model="curInfo.parent_id" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分类名称:">
|
||||
<el-input v-model="curInfo.name" clearable style="width: 300px;"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否显示:">
|
||||
<el-switch v-model="curInfo.show" active-text="是" inactive-text="否" :active-value="1" :inactive-value="0"></el-switch>
|
||||
</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>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="commitType" :loading="btnLoading">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
goods_types,
|
||||
Delgoods_types,
|
||||
Addgoods_types,
|
||||
editGoods_types,
|
||||
} from "../../api/rankingData";
|
||||
import { goods_types, Delgoods_types, Addgoods_types, editGoods_types, goods_types_detail } from "@/api/rankingData"
|
||||
// import selectTree from '@/components/selectTree'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
|
||||
export default {
|
||||
components: { Treeselect },
|
||||
data() {
|
||||
return {
|
||||
id: "", //每一项的id
|
||||
loading: true,
|
||||
btnLoading: false,
|
||||
tableData: [],
|
||||
multipleSelection: [],
|
||||
dialogFormVisible: false,
|
||||
dialogFormVisible1: false,
|
||||
form: {
|
||||
kindName: "", //种类名
|
||||
dialogVisible: false,
|
||||
curInfo: {
|
||||
parent_id: null,
|
||||
name: '',
|
||||
show: 1
|
||||
},
|
||||
form1: {
|
||||
kindName1: "", //种类名
|
||||
curId: 0,
|
||||
defaultProps: {
|
||||
value: 'id',
|
||||
label: 'name',
|
||||
children: 'children'
|
||||
},
|
||||
formLabelWidth: "120px",
|
||||
formLabelWidth1: "120px",
|
||||
newKind: [],
|
||||
Paginationdata: {}, //分页相关数据
|
||||
current_page: 1, //当前页
|
||||
per_page: 15, //每页显示数量
|
||||
};
|
||||
treeList: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getGoods_types();
|
||||
this.getGoods_types()
|
||||
},
|
||||
methods: {
|
||||
// 复选框按钮
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
|
||||
//分页功能
|
||||
handleSizeChange(val) {
|
||||
//当前条数
|
||||
this.per_page = val;
|
||||
this.getGoods_types();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
//当前页
|
||||
this.current_page = val;
|
||||
this.getGoods_types();
|
||||
},
|
||||
// 新增
|
||||
handAdd() {
|
||||
this.form.kindName = "";
|
||||
this.dialogFormVisible = true;
|
||||
handleAdd() {
|
||||
this.curInfo = {
|
||||
id: 0,
|
||||
parent_id: null,
|
||||
name: '',
|
||||
show: 1
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
// 确认新增
|
||||
addSubmit() {
|
||||
var string;
|
||||
string = this.form.kindName.replace(/\s/g, ",").split(",");
|
||||
Addgoods_types({
|
||||
names: string,
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "添加成功",
|
||||
});
|
||||
this.getGoods_types();
|
||||
});
|
||||
this.dialogFormVisible = false;
|
||||
addSubType(row) {
|
||||
this.curInfo = {
|
||||
id: 0,
|
||||
parent_id: row.id,
|
||||
name: '',
|
||||
show: 1
|
||||
}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
// 编辑
|
||||
handEdit(id, item) {
|
||||
this.id = id;
|
||||
this.form1.kindName1 = item.name;
|
||||
this.dialogFormVisible1 = true;
|
||||
handleEdit(id, item) {
|
||||
this.id = id
|
||||
this.curInfo = JSON.parse(JSON.stringify(item))
|
||||
if(item.parent_id) {
|
||||
goods_types_detail(item.parent_id).then((res) => {
|
||||
this.dialogVisible = true
|
||||
})
|
||||
} else {
|
||||
this.curInfo.parent_id = null
|
||||
this.dialogVisible = true
|
||||
}
|
||||
},
|
||||
// 编辑确定按钮
|
||||
EditSubmit() {
|
||||
editGoods_types(this.id, {
|
||||
name: this.form1.kindName1,
|
||||
}).then((res) => {
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "编辑成功",
|
||||
});
|
||||
this.getGoods_types();
|
||||
});
|
||||
this.dialogFormVisible1 = false;
|
||||
commitType() {
|
||||
this.btnLoading = true
|
||||
let params = {
|
||||
...this.curInfo
|
||||
}
|
||||
params.parent_id = params.parent_id || 0
|
||||
if(this.curInfo.id) {
|
||||
editGoods_types(this.curInfo.id, params).then((res) => {
|
||||
this.btnLoading = false
|
||||
this.$message({ type: 'success', message: '编辑成功' })
|
||||
this.getGoods_types()
|
||||
this.dialogVisible = false
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
})
|
||||
} else {
|
||||
Addgoods_types(params).then((res) => {
|
||||
this.btnLoading = false
|
||||
this.$message({ type: 'success', message: '添加成功' })
|
||||
this.getGoods_types()
|
||||
this.dialogVisible = false
|
||||
}).catch(() => {
|
||||
this.btnLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
// 删除
|
||||
handdel(id) {
|
||||
handleDel(id) {
|
||||
this.$confirm("确定删除此条商品种类吗?", "确认删除", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(() => {
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
Delgoods_types(id).then((res) => {
|
||||
this.getGoods_types();
|
||||
});
|
||||
this.$message({
|
||||
type: "success",
|
||||
message: "删除成功!",
|
||||
});
|
||||
this.$message({ type: 'success', message: '删除成功!' })
|
||||
this.getGoods_types()
|
||||
})
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message({
|
||||
type: "info",
|
||||
message: "已取消删除",
|
||||
});
|
||||
});
|
||||
},
|
||||
// 获取列表
|
||||
getGoods_types() {
|
||||
let page = {
|
||||
page: this.current_page,
|
||||
per_page: this.per_page,
|
||||
};
|
||||
parent_id: 0
|
||||
}
|
||||
goods_types(page).then((res) => {
|
||||
this.tableData = res.data.data;
|
||||
this.Paginationdata = res.data.meta;
|
||||
});
|
||||
this.loading = false;
|
||||
this.tableData = res.data.data
|
||||
this.treeList = JSON.parse(JSON.stringify(res.data.data).replace(/name/g, "label"))
|
||||
console.log(this.treeList)
|
||||
})
|
||||
this.loading = false
|
||||
},
|
||||
handleNodeClick(row) {
|
||||
this.curInfo.parent_name = row.name
|
||||
this.curInfo.parent_id = row.id
|
||||
},
|
||||
};
|
||||
changeSelect(row) {
|
||||
if(!row) {
|
||||
this.curInfo.parent_name = ''
|
||||
this.curInfo.parent_id = ''
|
||||
}
|
||||
},
|
||||
getValue(row) {
|
||||
console.log(row)
|
||||
this.curInfo.parent_id = row ? row : ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.block {
|
||||
margin-top: 20px;
|
||||
.opaBox{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -53,6 +53,14 @@
|
||||
<el-table-column prop="refund_amount" label="退款金额" />
|
||||
<el-table-column prop="refund_shipping_amount" label="用户申请退运费金额" />
|
||||
<el-table-column prop="reason" label="退款原因" />
|
||||
<el-table-column prop="description" label="描述" />
|
||||
<el-table-column label="退款图片" width="220">
|
||||
<template slot-scope="scope">
|
||||
<div class="imgBox" v-if="scope.row.image_list">
|
||||
<el-image v-for="(it, i) in scope.row.image_list" :key="i" :src="it" :preview-src-list="scope.row.image_list" class="img"></el-image>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="apply_type" label="申请类型" />
|
||||
<el-table-column label="售后单状态">
|
||||
<template slot-scope="scope">
|
||||
@ -187,4 +195,12 @@ export default {
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.imgBox{
|
||||
.img{
|
||||
width: 55px;
|
||||
height: 55px;
|
||||
border-radius: 4px;
|
||||
margin: 3px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="conent">
|
||||
<div class="table" style="margin-top: 10px">
|
||||
<el-table v-loading="loading" :data="tableData" style="width: 100%">
|
||||
<div class="pageBox">
|
||||
<el-card>
|
||||
<el-table border v-loading="loading" :data="tableData" style="width: 100%">
|
||||
<el-table-column prop="name" label="店铺名称"></el-table-column>
|
||||
<el-table-column prop="ship.expires_at" label="授权过期时间点"></el-table-column>
|
||||
<el-table-column prop="ship.owner_id" label="商家店铺id"></el-table-column>
|
||||
@ -26,7 +26,7 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
|
||||
<!-- 发货信息 -->
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
<template>
|
||||
<div class="conent">
|
||||
<!-- 新增按钮 -->
|
||||
<el-button type="success" @click="handAdd">新增</el-button>
|
||||
<el-button type="primary" @click="syncShopStock('all')">同步所有店铺库存</el-button>
|
||||
<div class="pageBox">
|
||||
<el-card>
|
||||
<div class="opaBox">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handAdd">新增</el-button>
|
||||
<el-button type="primary" icon="el-icon-refresh" @click="syncShopStock('all')">同步所有店铺库存</el-button>
|
||||
</div>
|
||||
|
||||
<div class="table" style="margin-top: 10px">
|
||||
<el-table v-loading="loading" :data="tableData" style="width: 100%">
|
||||
<el-table border v-loading="loading" :data="tableData" style="width: 100%">
|
||||
<el-table-column prop="name" label="店铺名称">
|
||||
</el-table-column>
|
||||
<el-table-column prop="plat_id" label="所属平台"></el-table-column>
|
||||
@ -17,40 +18,38 @@
|
||||
</el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<el-table-column label="操作" width="280">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="danger" v-if="scope.row.status === '未授权'" size="small"><a :href="scope.row.authUrl"
|
||||
<el-button type="danger" v-if="scope.row.status === '未授权'" size="mini"><a :href="scope.row.authUrl"
|
||||
target="_blank" rel="noopener noreferrer">授权</a>
|
||||
</el-button>
|
||||
|
||||
<div v-if="scope.row.status === '已授权'">
|
||||
<el-button type="success" :disabled="true" size="small">{{ scope.row.status }}</el-button>
|
||||
<el-button @click="download(scope.row)" size="small">下载商品</el-button>
|
||||
<el-button type="primary" v-if="scope.row.status === '已授权'" size="small"
|
||||
<el-button type="success" :disabled="true" size="mini">{{ scope.row.status }}</el-button>
|
||||
<el-button @click="download(scope.row)" size="mini">下载商品</el-button>
|
||||
<el-button type="primary" v-if="scope.row.status === '已授权'" size="mini"
|
||||
@click="syncShopStock(scope.row.id)">同步库存</el-button>
|
||||
</div>
|
||||
<div v-if="scope.row.status === '重新授权'">
|
||||
<el-button type="danger" target="_blank" size="small">
|
||||
<el-button type="danger" target="_blank" size="mini">
|
||||
<a :href="scope.row.authUrl" rel="noopener noreferrer">重新授权</a>
|
||||
</el-button>
|
||||
<el-button @click="download(scope.row)" size="small">下载商品</el-button>
|
||||
<el-button @click="download(scope.row)" size="mini">下载商品</el-button>
|
||||
</div>
|
||||
|
||||
<div v-if="scope.row.status === '无需授权'">
|
||||
<el-button type="success" :disabled="true" size="small">{{ scope.row.status }}</el-button>
|
||||
<el-button type="success" :disabled="true" size="mini">{{ scope.row.status }}</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<!-- 分页功能 -->
|
||||
<div class="block">
|
||||
<div class="page-pagination">
|
||||
<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>
|
||||
</el-card>
|
||||
|
||||
<!-- 新增店铺 -->
|
||||
<el-dialog title="新增店铺" :visible.sync="dialogFormVisible" :close-on-click-modal="false" width="20%">
|
||||
@ -222,7 +221,7 @@ a {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.block {
|
||||
margin-top: 20px;
|
||||
.opaBox{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<el-input v-model="filter.title" clearable></el-input>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span>商品编号:</span>
|
||||
<span>规格编码:</span>
|
||||
<el-input v-model="filter.external_sku_id" clearable></el-input>
|
||||
</div>
|
||||
<div class="row">
|
||||
@ -34,7 +34,8 @@
|
||||
</div>
|
||||
<el-table v-loading="loading" :data="supplierList" style="width: 100%" border>
|
||||
<el-table-column prop="id" label="ID" width="80" align="center" />
|
||||
<el-table-column prop="goods_sku.title" label="商品标题" />
|
||||
<el-table-column prop="goods_sku.name" label="商品标题" />
|
||||
<el-table-column prop="goods_sku.external_sku_id" label="规格编码" />
|
||||
<el-table-column prop="sku_id" label="skuID" />
|
||||
<el-table-column prop="day" label="日期" />
|
||||
<el-table-column prop="inventory" label="盘点库存" />
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<el-input v-model="filter.title" clearable></el-input>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span>商品编号:</span>
|
||||
<span>规格编码:</span>
|
||||
<el-input v-model="filter.external_sku_id" clearable></el-input>
|
||||
</div>
|
||||
<div class="row">
|
||||
@ -34,9 +34,9 @@
|
||||
</div>
|
||||
<el-table v-loading="loading" :data="supplierList" style="width: 100%" border>
|
||||
<el-table-column prop="id" label="ID" width="80" align="center" />
|
||||
<el-table-column prop="goods_sku.title" label="商品标题" />
|
||||
<el-table-column prop="sku_id" label="skuID" />
|
||||
<el-table-column prop="goods_sku.name" label="商品标题" />
|
||||
<el-table-column prop="external_sku_id" label="规格编码" />
|
||||
<el-table-column prop="sku_id" label="skuID" />
|
||||
<el-table-column prop="num" label="数量" />
|
||||
<el-table-column prop="cost" label="成本" />
|
||||
<el-table-column prop="buyer_name" label="采购人姓名" />
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<el-input v-model="filter.title" clearable></el-input>
|
||||
</div>
|
||||
<div class="row">
|
||||
<span>商品编号:</span>
|
||||
<span>规格编码:</span>
|
||||
<el-input v-model="filter.external_sku_id" clearable></el-input>
|
||||
</div>
|
||||
<div class="row">
|
||||
@ -34,12 +34,12 @@
|
||||
</div>
|
||||
<el-table v-loading="loading" :data="procureList" style="width: 100%" border>
|
||||
<el-table-column prop="sku_id" label="商品id" width="80" align="center" />
|
||||
<el-table-column prop="goods_sku.title" label="商品标题" />
|
||||
<el-table-column prop="external_sku_id" label="商品编号" />
|
||||
<el-table-column prop="goods_sku.name" label="商品标题" />
|
||||
<el-table-column prop="external_sku_id" label="规格编码" />
|
||||
<el-table-column prop="num" label="采购数量" />
|
||||
<el-table-column prop="cost" label="采购成本" />
|
||||
<el-table-column prop="buyer_name" label="采购人名称" />
|
||||
<el-table-column prop="status" label="状态" />
|
||||
<!-- <el-table-column prop="status" label="状态" /> -->
|
||||
<el-table-column prop="expire_time" label="保质期时间" />
|
||||
<el-table-column prop="supplier_name" label="供应商">
|
||||
<template slot-scope="scope">
|
||||
@ -119,6 +119,8 @@
|
||||
|
||||
<script>
|
||||
import { getPurchaseLog, addPurchaseLog, updatePurchaseLog } from "@/api/supplyChain"
|
||||
import axios from "axios"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -217,7 +219,7 @@ export default {
|
||||
if(this.fileList.length) {
|
||||
this.commitloading = true
|
||||
const params = new FormData();
|
||||
params.append("lossFile", this.fileList[0].raw)
|
||||
params.append("purchaseFile", this.fileList[0].raw)
|
||||
let token = localStorage.getItem("token")
|
||||
axios.post("/api/purchase_record/purchase_import", params, {
|
||||
headers: {
|
||||
|
||||
@ -10,9 +10,10 @@
|
||||
<el-table-column prop="company_name" label="供应商ID" />
|
||||
<el-table-column prop="address" label="地址" />
|
||||
<el-table-column prop="link_tel" label="联系方式" align="center" />
|
||||
<el-table-column prop="supply_type" label="供应品类" />
|
||||
<el-table-column prop="payment_account" label="支付账户" />
|
||||
<el-table-column prop="agent_name" label="代理名称" />
|
||||
<el-table-column prop="agent_id" label="代理人id" />
|
||||
<el-table-column prop="agent_name" label="开发维护人" />
|
||||
<!-- <el-table-column prop="agent_id" label="代理人id" /> -->
|
||||
<el-table-column prop="created_at" label="创建时间" align="center" />
|
||||
<el-table-column label="操作" width="180" align="center">
|
||||
<template slot-scope="scope">
|
||||
@ -34,7 +35,7 @@
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog :title="gysInfo.id ? '编辑' : '新增供应商'" :visible.sync="dialogVisible" width="500px">
|
||||
<el-dialog :title="gysInfo.id ? '编辑' : '新增'" :visible.sync="dialogVisible" width="500px">
|
||||
<el-form label-width="100px">
|
||||
<el-form-item label="供应商名称">
|
||||
<el-input v-model="gysInfo.supplier_name" clearable></el-input>
|
||||
@ -48,6 +49,9 @@
|
||||
<el-form-item label="联系方式">
|
||||
<el-input v-model="gysInfo.link_tel" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应品类">
|
||||
<el-input v-model="gysInfo.supply_type" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="支付方式">
|
||||
<el-input v-model="gysInfo.payment_account" clearable></el-input>
|
||||
</el-form-item>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user