|
@@ -1,16 +1,21 @@
|
|
|
|
|
|
<template>
|
|
<template>
|
|
<div class='m-container'>
|
|
<div class='m-container'>
|
|
- <h2><div class="squrt"></div>商品类型管理</h2>
|
|
|
|
|
|
+ <h2>
|
|
|
|
+ <div class="squrt"></div>商品分类管理
|
|
|
|
+ </h2>
|
|
<div class="m-core">
|
|
<div class="m-core">
|
|
- <div class='newBand' @click="openTypes('create')">添加</div>
|
|
|
|
|
|
+ <div class='newBand'
|
|
|
|
+ @click="openTypes('create')">添加</div>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<div class="tableWrap">
|
|
<div class="tableWrap">
|
|
- <el-table :data='tableList' :header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
|
- <el-table-column align='center' prop="name"
|
|
|
|
|
|
+ <el-table :data='tableList'
|
|
|
|
+ :header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
|
+ <el-table-column align='center'
|
|
|
|
+ prop="name"
|
|
label="分类名称">
|
|
label="分类名称">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column align='center'
|
|
|
|
|
|
+ <el-table-column align='center'
|
|
label="声部属性">
|
|
label="声部属性">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
{{ scope.row.subjectName | joinArray(',') }}
|
|
{{ scope.row.subjectName | joinArray(',') }}
|
|
@@ -19,8 +24,10 @@
|
|
<el-table-column align='center'
|
|
<el-table-column align='center'
|
|
label="操作">
|
|
label="操作">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <el-button @click="openTypes('update', scope.row)" type="text">修改</el-button>
|
|
|
|
- <el-button @click="onTypesDelOpeation(scope.row)" type="text">删除</el-button>
|
|
|
|
|
|
+ <el-button @click="openTypes('update', scope.row)"
|
|
|
|
+ type="text">修改</el-button>
|
|
|
|
+ <el-button @click="onTypesDelOpeation(scope.row)"
|
|
|
|
+ type="text">删除</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -31,33 +38,42 @@
|
|
@pagination="getList" />
|
|
@pagination="getList" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- <el-dialog :title="formTitle[formActionTitle]" :visible.sync="typeStatus"
|
|
|
|
- @close="onFormClose('ruleForm')" width="500px">
|
|
|
|
- <el-form :model="form" :rules="rules" ref="ruleForm">
|
|
|
|
- <el-form-item label="商品分类名称" prop="name" :label-width="formLabelWidth">
|
|
|
|
- <el-input v-model="form.name" autocomplete="off"></el-input>
|
|
|
|
|
|
+ <el-dialog :title="formTitle[formActionTitle]"
|
|
|
|
+ :visible.sync="typeStatus"
|
|
|
|
+ @close="onFormClose('ruleForm')"
|
|
|
|
+ width="500px">
|
|
|
|
+ <el-form :model="form"
|
|
|
|
+ :rules="rules"
|
|
|
|
+ ref="ruleForm">
|
|
|
|
+ <el-form-item label="商品分类名称"
|
|
|
|
+ prop="name"
|
|
|
|
+ :label-width="formLabelWidth">
|
|
|
|
+ <el-input v-model="form.name"
|
|
|
|
+ autocomplete="off"></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="声部属性" v-if="form.classGroupType != 'MIX'"
|
|
|
|
- prop="subjectIds" :label-width="formLabelWidth">
|
|
|
|
- <el-select v-model="form.subjectIds" multiple>
|
|
|
|
- <el-option-group
|
|
|
|
- v-for="group in subjectList"
|
|
|
|
- :key="group.label"
|
|
|
|
- :label="group.label">
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in group.options"
|
|
|
|
- :key="item.value"
|
|
|
|
- :label="item.label"
|
|
|
|
- :value="item.value">
|
|
|
|
- </el-option>
|
|
|
|
- </el-option-group>
|
|
|
|
|
|
+ <el-form-item label="声部属性"
|
|
|
|
+ v-if="form.classGroupType != 'MIX'"
|
|
|
|
+ prop="subjectIds"
|
|
|
|
+ :label-width="formLabelWidth">
|
|
|
|
+ <el-select v-model="form.subjectIds"
|
|
|
|
+ multiple>
|
|
|
|
+ <el-option-group v-for="group in subjectList"
|
|
|
|
+ :key="group.label"
|
|
|
|
+ :label="group.label">
|
|
|
|
+ <el-option v-for="item in group.options"
|
|
|
|
+ :key="item.value"
|
|
|
|
+ :label="item.label"
|
|
|
|
+ :value="item.value">
|
|
|
|
+ </el-option>
|
|
|
|
+ </el-option-group>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<span slot="footer"
|
|
<span slot="footer"
|
|
class="dialog-footer">
|
|
class="dialog-footer">
|
|
<el-button @click="typeStatus = false">取 消</el-button>
|
|
<el-button @click="typeStatus = false">取 消</el-button>
|
|
- <el-button type="primary" @click="onTypesSubmit('ruleForm')">确 定</el-button>
|
|
|
|
|
|
+ <el-button type="primary"
|
|
|
|
+ @click="onTypesSubmit('ruleForm')">确 定</el-button>
|
|
</span>
|
|
</span>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
</div>
|
|
</div>
|
|
@@ -99,12 +115,12 @@ export default {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- mounted() {
|
|
|
|
|
|
+ mounted () {
|
|
this.getList()
|
|
this.getList()
|
|
this.getSubjectTree()
|
|
this.getSubjectTree()
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- onTypesDelOpeation(row) {
|
|
|
|
|
|
+ onTypesDelOpeation (row) {
|
|
categoryUpSetDel({ id: row.id }).then(res => {
|
|
categoryUpSetDel({ id: row.id }).then(res => {
|
|
this.messageTips('删除', res)
|
|
this.messageTips('删除', res)
|
|
})
|
|
})
|
|
@@ -113,7 +129,7 @@ export default {
|
|
this.$refs[formName].validate((valid) => {
|
|
this.$refs[formName].validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
if (this.formActionTitle == 'create') {
|
|
if (this.formActionTitle == 'create') {
|
|
- if(this.form.id) { // 判断有没有Id,如果有则删除
|
|
|
|
|
|
+ if (this.form.id) { // 判断有没有Id,如果有则删除
|
|
delete this.form.id
|
|
delete this.form.id
|
|
}
|
|
}
|
|
categoryUpSet(this.form).then(res => {
|
|
categoryUpSet(this.form).then(res => {
|
|
@@ -129,9 +145,9 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
-
|
|
|
|
- messageTips(title, res) {
|
|
|
|
- if(res.code == 200) {
|
|
|
|
|
|
+
|
|
|
|
+ messageTips (title, res) {
|
|
|
|
+ if (res.code == 200) {
|
|
this.$message({
|
|
this.$message({
|
|
message: title + '成功',
|
|
message: title + '成功',
|
|
type: 'success'
|
|
type: 'success'
|
|
@@ -142,14 +158,14 @@ export default {
|
|
this.$message.error(res.msg)
|
|
this.$message.error(res.msg)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- getList () {
|
|
|
|
|
|
+ getList () {
|
|
categoryListTree({
|
|
categoryListTree({
|
|
delFlag: 0,
|
|
delFlag: 0,
|
|
rows: this.pageInfo.limit,
|
|
rows: this.pageInfo.limit,
|
|
page: this.pageInfo.page
|
|
page: this.pageInfo.page
|
|
}).then(res => {
|
|
}).then(res => {
|
|
let result = res.data
|
|
let result = res.data
|
|
- if(res.code == 200) {
|
|
|
|
|
|
+ if (res.code == 200) {
|
|
result.rows.forEach(row => {
|
|
result.rows.forEach(row => {
|
|
let subjectname = [],
|
|
let subjectname = [],
|
|
subjectIds = []
|
|
subjectIds = []
|
|
@@ -165,7 +181,7 @@ export default {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- openTypes(type, row) {
|
|
|
|
|
|
+ openTypes (type, row) {
|
|
this.typeStatus = true
|
|
this.typeStatus = true
|
|
this.formActionTitle = type
|
|
this.formActionTitle = type
|
|
// 修改的时候赋值
|
|
// 修改的时候赋值
|
|
@@ -186,13 +202,13 @@ export default {
|
|
}
|
|
}
|
|
this.$refs[formName].resetFields()
|
|
this.$refs[formName].resetFields()
|
|
},
|
|
},
|
|
- getSubjectTree() { // 获取声部列表
|
|
|
|
|
|
+ getSubjectTree () { // 获取声部列表
|
|
subjectListTree({
|
|
subjectListTree({
|
|
delFlag: 0,
|
|
delFlag: 0,
|
|
rows: 9999
|
|
rows: 9999
|
|
}).then(res => {
|
|
}).then(res => {
|
|
let result = res.data
|
|
let result = res.data
|
|
- if(res.code == 200) {
|
|
|
|
|
|
+ if (res.code == 200) {
|
|
let tempArray = []
|
|
let tempArray = []
|
|
result.rows.forEach((item, index) => {
|
|
result.rows.forEach((item, index) => {
|
|
let subject = []
|
|
let subject = []
|
|
@@ -202,7 +218,7 @@ export default {
|
|
label: s.name
|
|
label: s.name
|
|
})
|
|
})
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+
|
|
tempArray[index] = {
|
|
tempArray[index] = {
|
|
label: item.name,
|
|
label: item.name,
|
|
options: subject
|
|
options: subject
|
|
@@ -220,13 +236,15 @@ export default {
|
|
background: #14928a;
|
|
background: #14928a;
|
|
border-color: #14928a;
|
|
border-color: #14928a;
|
|
color: #fff;
|
|
color: #fff;
|
|
- &:hover, &:active, &:focus {
|
|
|
|
|
|
+ &:hover,
|
|
|
|
+ &:active,
|
|
|
|
+ &:focus {
|
|
background: #14928a;
|
|
background: #14928a;
|
|
border-color: #14928a;
|
|
border-color: #14928a;
|
|
- color: #FFF;
|
|
|
|
|
|
+ color: #fff;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-.el-date-editor.el-input{
|
|
|
|
|
|
+.el-date-editor.el-input {
|
|
width: 100% !important;
|
|
width: 100% !important;
|
|
}
|
|
}
|
|
.el-select {
|
|
.el-select {
|