|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div style="width: 100%; display: flex">
|
|
|
+ <div v-loading="loading" style="width: 100%; display: flex">
|
|
|
<div class="right-info-box">
|
|
|
<div class="warp_group">
|
|
|
<div class="line_box">
|
|
@@ -22,18 +22,18 @@
|
|
|
<span>操作</span>
|
|
|
</div>
|
|
|
<el-scrollbar style="height: 572px">
|
|
|
- <div v-loading="loading" class="item_attr" @click="tabClass('1',index)" :class="{avtive:num === index}" v-for="(item,index) in first" :key="index">
|
|
|
+ <div v-loading="loading" v-for="(item,index) in first" :class="{avtive:num === index}" :key="index" class="item_attr" @click="tabClass('1',index)">
|
|
|
<div class="item_name_box">
|
|
|
<!-- <img
|
|
|
class="img"
|
|
|
:src="item.picture"
|
|
|
alt=""
|
|
|
/> -->
|
|
|
- <span class="item_name_title">{{item.postion}}</span>
|
|
|
- <span class="item_name_title">{{item.typeName}}</span>
|
|
|
+ <span class="item_name_title">{{ item.postion }}</span>
|
|
|
+ <span class="item_name_title">{{ item.typeName }}</span>
|
|
|
</div>
|
|
|
<div class="item_sort">
|
|
|
- {{item.weight}}
|
|
|
+ {{ item.weight }}
|
|
|
<el-popover trigger="click">
|
|
|
<div class="sort_box">
|
|
|
<el-input v-model.number="sort" size="small" />
|
|
@@ -84,18 +84,18 @@
|
|
|
<span>操作</span>
|
|
|
</div>
|
|
|
<el-scrollbar style="height: 572px">
|
|
|
- <div v-loading="loading" class="item_attr" :class="{avtive:sum === index}" @click="tabClass('2',index)" v-for="(item,index) in second" :key="index">
|
|
|
- <span class="item_name_title">{{item.postion}}</span>
|
|
|
+ <div v-loading="loading" v-for="(item,index) in second" :class="{avtive:sum === index}" :key="index" class="item_attr" @click="tabClass('2',index)">
|
|
|
+ <span class="item_name_title">{{ item.postion }}</span>
|
|
|
<div class="item_name_box">
|
|
|
<img
|
|
|
- class="img"
|
|
|
:src="item.urlPath.split(',')"
|
|
|
+ class="img"
|
|
|
alt=""
|
|
|
- />
|
|
|
- <span class="item_name_title">{{item.typeName}}</span>
|
|
|
+ >
|
|
|
+ <span class="item_name_title">{{ item.typeName }}</span>
|
|
|
</div>
|
|
|
<div class="item_sort">
|
|
|
- {{item.weight}}
|
|
|
+ {{ item.weight }}
|
|
|
<el-popover trigger="click">
|
|
|
<div class="sort_box">
|
|
|
<el-input v-model.number="sort" size="small" />
|
|
@@ -107,14 +107,14 @@
|
|
|
</el-popover>
|
|
|
</div>
|
|
|
<div class="item_handle">
|
|
|
- <el-popover placement="top-start" width="50" content="编辑">
|
|
|
+ <el-popover placement="top-start" width="50" content="编辑">
|
|
|
<span slot="reference" class="handel_icon">
|
|
|
<i class="el-icon-edit" @click="handleUpdate2(item)"/>
|
|
|
</span>
|
|
|
</el-popover>
|
|
|
<el-popover placement="top-start" width="50" content="删除">
|
|
|
<span slot="reference" class="handel_icon">
|
|
|
- <i class="el-icon-delete" @click.stop="handleDelete2(item)"/>
|
|
|
+ <i class="el-icon-delete" @click.stop="handleDelete2(item)"/>
|
|
|
</span>
|
|
|
</el-popover>
|
|
|
</div>
|
|
@@ -141,13 +141,13 @@
|
|
|
<span>操作</span>
|
|
|
</div>
|
|
|
<el-scrollbar style="height: 572px">
|
|
|
- <div v-loading="loading" class="item_attr" v-for="(item,index) in tertiary" :key="index">
|
|
|
+ <div v-loading="loading" v-for="(item,index) in tertiary" :key="index" class="item_attr">
|
|
|
<div class="item_name_box">
|
|
|
- <span class="item_name_title" style="margin-right:20px">{{item.postion}}</span>
|
|
|
- <span class="item_name_title">{{item.typeName}}</span>
|
|
|
+ <span class="item_name_title" style="margin-right:20px">{{ item.postion }}</span>
|
|
|
+ <span class="item_name_title">{{ item.typeName }}</span>
|
|
|
</div>
|
|
|
<div class="item_sort">
|
|
|
- {{item.weight}}
|
|
|
+ {{ item.weight }}
|
|
|
<el-popover trigger="click">
|
|
|
<div class="sort_box">
|
|
|
<el-input v-model.number="sort" size="small" />
|
|
@@ -161,12 +161,12 @@
|
|
|
<div class="item_handle">
|
|
|
<el-popover placement="top-start" width="50" content="编辑">
|
|
|
<span slot="reference" class="handel_icon">
|
|
|
- <i class="el-icon-edit" @click="handleUpdate3(item)"/>
|
|
|
+ <i class="el-icon-edit" @click="handleUpdate3(item)"/>
|
|
|
</span>
|
|
|
</el-popover>
|
|
|
<el-popover placement="top-start" width="50" content="删除">
|
|
|
<span slot="reference" class="handel_icon">
|
|
|
- <i class="el-icon-delete" @click.stop="handleDelete3(item)"/>
|
|
|
+ <i class="el-icon-delete" @click.stop="handleDelete3(item)"/>
|
|
|
</span>
|
|
|
</el-popover>
|
|
|
</div>
|
|
@@ -236,7 +236,7 @@
|
|
|
<el-option v-for="(item,index) in infoList" :key="index" :label="item.typeName" :value="item.id" />
|
|
|
</el-select>
|
|
|
</el-form-item> -->
|
|
|
-
|
|
|
+
|
|
|
<el-form-item label="分类名称" prop="secondName">
|
|
|
<el-input v-model="form2.secondName" placeholder="请输入二级分类" />
|
|
|
</el-form-item>
|
|
@@ -266,7 +266,7 @@
|
|
|
>
|
|
|
<i class="el-icon-plus" />
|
|
|
</el-upload>
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item>
|
|
|
<!-- <el-form-item label="0:否" prop="deleteFlag">
|
|
|
<el-input v-model="form.deleteFlag" placeholder="请输入0:否" />
|
|
|
</el-form-item> -->
|
|
@@ -319,44 +319,44 @@
|
|
|
<script>
|
|
|
import { uploadPath } from '@/api/storage'
|
|
|
import { getToken } from '@/utils/auth'
|
|
|
-import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo } from "@/api/gubi/info";
|
|
|
-import { listSecond, getSecond, delSecond, addSecond, updateSecond, exportSecond } from "@/api/gubi/second";
|
|
|
-import { listThree, getThree, delThree, addThree, updateThree, exportThree } from "@/api/gubi/three";
|
|
|
-import { listTransaction, getTransaction, delTransaction, addTransaction, updateTransaction, exportTransaction, typeList } from "@/api/gubi/transaction";
|
|
|
+import { listInfo, getInfo, delInfo, addInfo, updateInfo, exportInfo } from '@/api/gubi/info'
|
|
|
+import { listSecond, getSecond, delSecond, addSecond, updateSecond, exportSecond } from '@/api/gubi/second'
|
|
|
+import { listThree, getThree, delThree, addThree, updateThree, exportThree } from '@/api/gubi/three'
|
|
|
+import { listTransaction, getTransaction, delTransaction, addTransaction, updateTransaction, exportTransaction, typeList } from '@/api/gubi/transaction'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- selectOneType:{},
|
|
|
- selectTwoType:{},
|
|
|
+ selectOneType: {},
|
|
|
+ selectTwoType: {},
|
|
|
uploadPath,
|
|
|
form: {},
|
|
|
form2: {},
|
|
|
form3: {},
|
|
|
- search: "", //搜索分类
|
|
|
- restaurants: [], //搜索列表
|
|
|
- superList:[], //搜索列表
|
|
|
- arrList:[], //搜索列表
|
|
|
- searchChoose:null, //搜索框搜索对象
|
|
|
- sort: "", //修改排序
|
|
|
+ search: '', // 搜索分类
|
|
|
+ restaurants: [], // 搜索列表
|
|
|
+ superList: [], // 搜索列表
|
|
|
+ arrList: [], // 搜索列表
|
|
|
+ searchChoose: null, // 搜索框搜索对象
|
|
|
+ sort: '', // 修改排序
|
|
|
// first:[],
|
|
|
- first: [], //一级分类列表
|
|
|
- second:[], //二级分类列表
|
|
|
- tertiary:[], //三级分类列表
|
|
|
- num:0, //二级分类
|
|
|
- sum:0, //三级分类
|
|
|
- loading:false,
|
|
|
- // 弹出层标题
|
|
|
- title: "",
|
|
|
- // 是否显示弹出层
|
|
|
- open: false,
|
|
|
-
|
|
|
- // 是否显示弹出层
|
|
|
- open2: false,
|
|
|
- title2: "",
|
|
|
- open3: false,
|
|
|
- title3: "",
|
|
|
- imgsFileList:[]
|
|
|
- };
|
|
|
+ first: [], // 一级分类列表
|
|
|
+ second: [], // 二级分类列表
|
|
|
+ tertiary: [], // 三级分类列表
|
|
|
+ num: 0, // 二级分类
|
|
|
+ sum: 0, // 三级分类
|
|
|
+ loading: false,
|
|
|
+ // 弹出层标题
|
|
|
+ title: '',
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+
|
|
|
+ // 是否显示弹出层
|
|
|
+ open2: false,
|
|
|
+ title2: '',
|
|
|
+ open3: false,
|
|
|
+ title3: '',
|
|
|
+ imgsFileList: []
|
|
|
+ }
|
|
|
},
|
|
|
computed: {
|
|
|
headers() {
|
|
@@ -372,88 +372,87 @@ export default {
|
|
|
methods: {
|
|
|
reset3() {
|
|
|
this.form3 = {
|
|
|
- id:undefined,
|
|
|
- companyId: "",
|
|
|
- typeId: "",
|
|
|
- secondId: "",
|
|
|
- product: "",
|
|
|
- number: "",
|
|
|
- year: "",
|
|
|
- face: "",
|
|
|
- edition: "",
|
|
|
- region: "",
|
|
|
- grade: "",
|
|
|
- highScores: "",
|
|
|
- collection: "",
|
|
|
- introduction: "",
|
|
|
- postion: "",
|
|
|
- status: "0",
|
|
|
- urlPath: "",
|
|
|
- deleteFlag: "",
|
|
|
- gmtCreate: "",
|
|
|
- gmtUpdate: "",
|
|
|
- userId: "",
|
|
|
- adminId: ""
|
|
|
- };
|
|
|
- this.resetForm("form3");
|
|
|
- },
|
|
|
- submitForm3: function() {debugger
|
|
|
+ id: undefined,
|
|
|
+ companyId: '',
|
|
|
+ typeId: '',
|
|
|
+ secondId: '',
|
|
|
+ product: '',
|
|
|
+ number: '',
|
|
|
+ year: '',
|
|
|
+ face: '',
|
|
|
+ edition: '',
|
|
|
+ region: '',
|
|
|
+ grade: '',
|
|
|
+ highScores: '',
|
|
|
+ collection: '',
|
|
|
+ introduction: '',
|
|
|
+ postion: '',
|
|
|
+ status: '0',
|
|
|
+ urlPath: '',
|
|
|
+ deleteFlag: '',
|
|
|
+ gmtCreate: '',
|
|
|
+ gmtUpdate: '',
|
|
|
+ userId: '',
|
|
|
+ adminId: ''
|
|
|
+ }
|
|
|
+ this.resetForm('form3')
|
|
|
+ },
|
|
|
+ submitForm3: function() { debugger
|
|
|
this.form3.secondId = this.selectTwoType.id
|
|
|
- this.$refs["form3"].validate(valid => {
|
|
|
+ this.$refs['form3'].validate(valid => {
|
|
|
if (valid) {
|
|
|
// this.form.urlPath = this.form.urlPath.toString()
|
|
|
if (this.form3.id != undefined) {
|
|
|
updateThree(this.form3).then(response => {
|
|
|
if (response.data) {
|
|
|
- this.msgSuccess("修改成功");
|
|
|
- this.open3 = false;
|
|
|
- this.getList();
|
|
|
+ this.msgSuccess('修改成功')
|
|
|
+ this.open3 = false
|
|
|
+ this.getList()
|
|
|
} else {
|
|
|
- this.msgError(response.msg);
|
|
|
+ this.msgError(response.msg)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
} else {
|
|
|
-
|
|
|
addThree(this.form3).then(response => {
|
|
|
if (response.data) {
|
|
|
- this.msgSuccess("新增成功");
|
|
|
- this.open3 = false;
|
|
|
- this.getList();
|
|
|
+ this.msgSuccess('新增成功')
|
|
|
+ this.open3 = false
|
|
|
+ this.getList()
|
|
|
} else {
|
|
|
- this.msgError(response.msg);
|
|
|
+ this.msgError(response.msg)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
handleAdd3() {
|
|
|
- this.reset3();
|
|
|
- this.open3 = true;
|
|
|
- this.title3 = "添加三级分类";
|
|
|
+ this.reset3()
|
|
|
+ this.open3 = true
|
|
|
+ this.title3 = '添加三级分类'
|
|
|
},
|
|
|
handleUpdate3(row) {
|
|
|
- this.reset3();
|
|
|
+ this.reset3()
|
|
|
this.imgsFileList3 = []
|
|
|
const id = row.id || this.ids.join(',')
|
|
|
getThree(id).then(response => {
|
|
|
this.form3 = response.data.data
|
|
|
- this.open3 = true;
|
|
|
- this.title3 = "修改三级分类";
|
|
|
- });
|
|
|
+ this.open3 = true
|
|
|
+ this.title3 = '修改三级分类'
|
|
|
+ })
|
|
|
},
|
|
|
handleDelete3(row) {
|
|
|
const ids = row.id || this.ids.join(',')
|
|
|
- this.$confirm('是否确认删除分值信息编号为"' + ids + '"的数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return delThree(ids);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.msgSuccess("删除成功");
|
|
|
- }).catch(function() {});
|
|
|
+ this.$confirm('是否确认删除分值信息编号为"' + ids + '"的数据项?', '警告', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(function() {
|
|
|
+ return delThree(ids)
|
|
|
+ }).then(() => {
|
|
|
+ this.getList()
|
|
|
+ this.msgSuccess('删除成功')
|
|
|
+ }).catch(function() {})
|
|
|
},
|
|
|
uploadOverrun: function() {
|
|
|
this.$message({
|
|
@@ -488,182 +487,180 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
handleAdd2() {
|
|
|
- this.reset2();
|
|
|
- this.open2 = true;
|
|
|
- this.title2 = "添加二级分类";
|
|
|
+ this.reset2()
|
|
|
+ this.open2 = true
|
|
|
+ this.title2 = '添加二级分类'
|
|
|
this.imgsFileList = []
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate2(row) {
|
|
|
- this.reset2();
|
|
|
+ this.reset2()
|
|
|
this.imgsFileList = []
|
|
|
const id = row.id || this.ids.join(',')
|
|
|
getSecond(id).then(response => {
|
|
|
- response.data.data.urlPath = response.data.data.urlPath.split(",")
|
|
|
+ response.data.data.urlPath = response.data.data.urlPath.split(',')
|
|
|
for (let i = 0; i < response.data.data.urlPath.length; i++) {
|
|
|
this.imgsFileList.push({
|
|
|
url: response.data.data.urlPath[i]
|
|
|
})
|
|
|
}
|
|
|
this.form2 = response.data.data
|
|
|
- this.open2 = true;
|
|
|
- this.title2 = "修改二级分类";
|
|
|
+ this.open2 = true
|
|
|
+ this.title2 = '修改二级分类'
|
|
|
console.log()
|
|
|
-
|
|
|
-
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
- submitForm2: function() {debugger
|
|
|
+ submitForm2: function() { debugger
|
|
|
this.form2.typeId = this.selectOneType.id
|
|
|
- this.$refs["form2"].validate(valid => {
|
|
|
+ this.$refs['form2'].validate(valid => {
|
|
|
if (valid) {
|
|
|
this.form2.urlPath = this.form2.urlPath.toString()
|
|
|
if (this.form2.id != undefined) {
|
|
|
updateSecond(this.form2).then(response => {
|
|
|
if (response.data) {
|
|
|
- this.msgSuccess("修改成功");
|
|
|
- this.open2 = false;
|
|
|
- this.getList();
|
|
|
+ this.msgSuccess('修改成功')
|
|
|
+ this.open2 = false
|
|
|
+ this.getList()
|
|
|
} else {
|
|
|
- this.msgError(response.msg);
|
|
|
+ this.msgError(response.msg)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
} else {
|
|
|
-
|
|
|
addSecond(this.form2).then(response => {
|
|
|
if (response.data) {
|
|
|
- this.msgSuccess("新增成功");
|
|
|
- this.open2 = false;
|
|
|
- this.getList();
|
|
|
+ this.msgSuccess('新增成功')
|
|
|
+ this.open2 = false
|
|
|
+ this.getList()
|
|
|
} else {
|
|
|
- this.msgError(response.msg);
|
|
|
+ this.msgError(response.msg)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete2(row) {
|
|
|
const ids = row.id || this.ids.join(',')
|
|
|
- this.$confirm('是否确认删除二级分类编号为"' + ids + '"的数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return delSecond(ids);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.msgSuccess("删除成功");
|
|
|
- }).catch(function() {});
|
|
|
+ this.$confirm('是否确认删除二级分类编号为"' + ids + '"的数据项?', '警告', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(function() {
|
|
|
+ return delSecond(ids)
|
|
|
+ }).then(() => {
|
|
|
+ this.getList()
|
|
|
+ this.msgSuccess('删除成功')
|
|
|
+ }).catch(function() {})
|
|
|
},
|
|
|
cancel2() {
|
|
|
- this.open2 = false;
|
|
|
- this.reset2();
|
|
|
- },
|
|
|
- cancel3() {
|
|
|
- this.open3 = false;
|
|
|
- this.reset3();
|
|
|
- },
|
|
|
- reset2() {
|
|
|
+ this.open2 = false
|
|
|
+ this.reset2()
|
|
|
+ },
|
|
|
+ cancel3() {
|
|
|
+ this.open3 = false
|
|
|
+ this.reset3()
|
|
|
+ },
|
|
|
+ reset2() {
|
|
|
this.form2 = {
|
|
|
id: undefined,
|
|
|
companyId: undefined,
|
|
|
typeId: undefined,
|
|
|
secondName: undefined,
|
|
|
postion: undefined,
|
|
|
- status: "0",
|
|
|
+ status: '0',
|
|
|
urlPath: [],
|
|
|
deleteFlag: undefined,
|
|
|
gmtCreate: undefined,
|
|
|
gmtUpdate: undefined,
|
|
|
userId: undefined,
|
|
|
adminId: undefined
|
|
|
- };
|
|
|
- this.resetForm("form2");
|
|
|
- },
|
|
|
- // 取消按钮
|
|
|
- cancel() {
|
|
|
- this.open = false;
|
|
|
- this.reset();
|
|
|
- },
|
|
|
- /** 修改按钮操作 */
|
|
|
- handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
- const id = row.id || this.ids.join(',')
|
|
|
- getInfo(id).then(response => {
|
|
|
- this.form = response.data.data
|
|
|
- this.open = true;
|
|
|
- this.title = "修改一级分类";
|
|
|
- });
|
|
|
- },
|
|
|
- /** 提交按钮 */
|
|
|
- submitForm: function() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- if (this.form.id != undefined) {
|
|
|
- updateInfo(this.form).then(response => {
|
|
|
- if (response.data) {
|
|
|
- this.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- } else {
|
|
|
- this.msgError(response.msg);
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- addInfo(this.form).then(response => {
|
|
|
- if (response.data) {
|
|
|
- this.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- } else {
|
|
|
- this.msgError(response.msg);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
+ }
|
|
|
+ this.resetForm('form2')
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false
|
|
|
+ this.reset()
|
|
|
+ },
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ handleUpdate(row) {
|
|
|
+ this.reset()
|
|
|
+ const id = row.id || this.ids.join(',')
|
|
|
+ getInfo(id).then(response => {
|
|
|
+ this.form = response.data.data
|
|
|
+ this.open = true
|
|
|
+ this.title = '修改一级分类'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm: function() {
|
|
|
+ this.$refs['form'].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.id != undefined) {
|
|
|
+ updateInfo(this.form).then(response => {
|
|
|
+ if (response.data) {
|
|
|
+ this.msgSuccess('修改成功')
|
|
|
+ this.open = false
|
|
|
+ this.getList()
|
|
|
+ } else {
|
|
|
+ this.msgError(response.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ addInfo(this.form).then(response => {
|
|
|
+ if (response.data) {
|
|
|
+ this.msgSuccess('新增成功')
|
|
|
+ this.open = false
|
|
|
+ this.getList()
|
|
|
+ } else {
|
|
|
+ this.msgError(response.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
- });
|
|
|
- },
|
|
|
- /** 删除按钮操作 */
|
|
|
- handleDelete(row) {
|
|
|
- console.log(123)
|
|
|
- const ids = row.id || this.ids.join(',')
|
|
|
- this.$confirm('是否确认删除一级分类编号为"' + ids + '"的数据项?', "警告", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- }).then(function() {
|
|
|
- return delInfo(ids);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.msgSuccess("删除成功");
|
|
|
- }).catch(function() {});
|
|
|
- },
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete(row) {
|
|
|
+ console.log(123)
|
|
|
+ const ids = row.id || this.ids.join(',')
|
|
|
+ this.$confirm('是否确认删除一级分类编号为"' + ids + '"的数据项?', '警告', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(function() {
|
|
|
+ return delInfo(ids)
|
|
|
+ }).then(() => {
|
|
|
+ this.getList()
|
|
|
+ this.msgSuccess('删除成功')
|
|
|
+ }).catch(function() {})
|
|
|
+ },
|
|
|
reset() {
|
|
|
- this.form = {
|
|
|
- id: undefined,
|
|
|
- companyId: undefined,
|
|
|
- typeName: undefined,
|
|
|
- postion: undefined,
|
|
|
- status: "0",
|
|
|
- deleteFlag: undefined,
|
|
|
- gmtCreate: undefined,
|
|
|
- gmtUpdate: undefined,
|
|
|
- userId: undefined,
|
|
|
- adminId: undefined
|
|
|
- };
|
|
|
- this.resetForm("form");
|
|
|
- },
|
|
|
+ this.form = {
|
|
|
+ id: undefined,
|
|
|
+ companyId: undefined,
|
|
|
+ typeName: undefined,
|
|
|
+ postion: undefined,
|
|
|
+ status: '0',
|
|
|
+ deleteFlag: undefined,
|
|
|
+ gmtCreate: undefined,
|
|
|
+ gmtUpdate: undefined,
|
|
|
+ userId: undefined,
|
|
|
+ adminId: undefined
|
|
|
+ }
|
|
|
+ this.resetForm('form')
|
|
|
+ },
|
|
|
handleAdd() {
|
|
|
- this.reset();
|
|
|
- this.open = true;
|
|
|
- this.title = "添加一级分类";
|
|
|
- },
|
|
|
+ this.reset()
|
|
|
+ this.open = true
|
|
|
+ this.title = '添加一级分类'
|
|
|
+ },
|
|
|
// 分类列表
|
|
|
- getList() { //接口方法
|
|
|
- // this.loading = true
|
|
|
+ getList() { // 接口方法
|
|
|
+ debugger
|
|
|
+ this.loading = true
|
|
|
// this.$api.amys.shopGroup.list().then(res => {
|
|
|
// if (res.data && res.status == "00000") {
|
|
|
// this.arrList = this.resFormat(res.data) //搜索一级分类
|
|
@@ -689,20 +686,18 @@ export default {
|
|
|
// }
|
|
|
// this.total = response.data.data.count
|
|
|
// this.loading = false;
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
+ })
|
|
|
},
|
|
|
makeData(val) {
|
|
|
for (let i = 0; i < val.length; i++) {
|
|
|
if (val[i].children) {
|
|
|
for (let j = 0; j < val[i].children.length; j++) {
|
|
|
- let _obj = val[i].children[j]
|
|
|
+ const _obj = val[i].children[j]
|
|
|
_obj.typeName = val[i].children[j].secondName
|
|
|
val[i].children[j] = _obj
|
|
|
if (val[i].children[j].children) {
|
|
|
for (let k = 0; k < val[i].children[j].children.length; k++) {
|
|
|
- let _obj1 = val[i].children[j].children[k]
|
|
|
+ const _obj1 = val[i].children[j].children[k]
|
|
|
_obj1.typeName = val[i].children[j].children[k].typeId
|
|
|
val[i].children[j].children[k] = _obj1
|
|
|
}
|
|
@@ -712,94 +707,94 @@ export default {
|
|
|
}
|
|
|
this.first = val
|
|
|
console.log(this.data)
|
|
|
- this.arrList = this.resFormat(this.first) //搜索一级分类
|
|
|
- this.superList = this.arrList //分类列表
|
|
|
- this.loading = false
|
|
|
- this.restaurants = []; //搜索框列表
|
|
|
- this.listType() //tab切换
|
|
|
- this.searchList(this.first)//搜素框递归查找分类
|
|
|
- },
|
|
|
- // 分类切换
|
|
|
- tabClass(type,index){debugger
|
|
|
- console.log(type,index)
|
|
|
- if(type == '1'){
|
|
|
+ this.arrList = this.resFormat(this.first) // 搜索一级分类
|
|
|
+ this.superList = this.arrList // 分类列表
|
|
|
+ this.loading = false
|
|
|
+ this.restaurants = [] // 搜索框列表
|
|
|
+ this.listType() // tab切换
|
|
|
+ this.searchList(this.first)// 搜素框递归查找分类
|
|
|
+ },
|
|
|
+ // 分类切换
|
|
|
+ tabClass(type, index) { debugger
|
|
|
+ console.log(type, index)
|
|
|
+ if (type == '1') {
|
|
|
this.num = index
|
|
|
this.selectOneType = this.arrList[index]
|
|
|
console.log(this.selectOneType)
|
|
|
- console.log(this.first,'一级分类')
|
|
|
- }else{
|
|
|
+ console.log(this.first, '一级分类')
|
|
|
+ } else {
|
|
|
this.sum = index
|
|
|
- this.selectTwoType = this.second[index]
|
|
|
+ this.selectTwoType = this.second[index]
|
|
|
}
|
|
|
this.listType()
|
|
|
},
|
|
|
- listType(){ //分类查找
|
|
|
+ listType() { // 分类查找
|
|
|
debugger
|
|
|
this.first = this.arrList
|
|
|
- console.log(this.first,'一级分类')
|
|
|
+ console.log(this.first, '一级分类')
|
|
|
this.second = this.first[this.num] && this.first[this.num].children ? this.first[this.num].children: ''
|
|
|
- console.log(this.second,'二级分类')
|
|
|
+ console.log(this.second, '二级分类')
|
|
|
this.tertiary = this.second[this.sum] && this.second[this.sum].children ? this.second[this.sum].children :''
|
|
|
- console.log(this.tertiary,'三级分类')
|
|
|
+ console.log(this.tertiary, '三级分类')
|
|
|
},
|
|
|
- resFormat(arr) { //递归查找一级分类
|
|
|
- return arr.map(item=>{
|
|
|
- item.popover = false;
|
|
|
- if(item.children && item.children.length > 0){
|
|
|
- item.children = this.resFormat(item.children)
|
|
|
+ resFormat(arr) { // 递归查找一级分类
|
|
|
+ return arr.map(item => {
|
|
|
+ item.popover = false
|
|
|
+ if (item.children && item.children.length > 0) {
|
|
|
+ item.children = this.resFormat(item.children)
|
|
|
}
|
|
|
return item
|
|
|
})
|
|
|
},
|
|
|
- //原程搜索分类
|
|
|
+ // 原程搜索分类
|
|
|
querySearchAsync(queryString, cb) {
|
|
|
- var restaurants = this.restaurants;
|
|
|
- var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants;
|
|
|
+ var restaurants = this.restaurants
|
|
|
+ var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants
|
|
|
this.searchChoose = null
|
|
|
- cb(results);
|
|
|
+ cb(results)
|
|
|
},
|
|
|
createStateFilter(queryString) {
|
|
|
console.log(queryString)
|
|
|
return (state) => {
|
|
|
- return state.value.toLowerCase().indexOf(queryString.toLowerCase()) >= 0;
|
|
|
- };
|
|
|
+ return state.value.toLowerCase().indexOf(queryString.toLowerCase()) >= 0
|
|
|
+ }
|
|
|
},
|
|
|
- searchList(arr,value){ //搜索时递归查找分类
|
|
|
+ searchList(arr, value) { // 搜索时递归查找分类
|
|
|
arr.forEach(item => {
|
|
|
- if(value){
|
|
|
+ if (value) {
|
|
|
item.value = `${value} > ${item.title}`
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
item.value = item.title
|
|
|
}
|
|
|
this.restaurants.push(item)
|
|
|
- if(item.children){
|
|
|
- return this.searchList(item.children,item.value)
|
|
|
+ if (item.children) {
|
|
|
+ return this.searchList(item.children, item.value)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
- handleSelect(e) { //搜索
|
|
|
+ handleSelect(e) { // 搜索
|
|
|
this.searchChoose = e
|
|
|
this.getSearch()
|
|
|
},
|
|
|
getSearch() {
|
|
|
let value = null
|
|
|
let id = ''
|
|
|
- if(this.search || this.searchChoose){
|
|
|
+ if (this.search || this.searchChoose) {
|
|
|
value = this.searchChoose
|
|
|
- this.restaurants.forEach(item=>{
|
|
|
- if(item.value === this.search){ //查找列表里和输入搜索框里的信息一样的执行
|
|
|
+ this.restaurants.forEach(item => {
|
|
|
+ if (item.value === this.search) { // 查找列表里和输入搜索框里的信息一样的执行
|
|
|
value = item
|
|
|
}
|
|
|
})
|
|
|
// 第二步 查找对应分类中的id
|
|
|
- if(value){
|
|
|
- if(value.level === 1){
|
|
|
+ if (value) {
|
|
|
+ if (value.level === 1) {
|
|
|
id = value.id
|
|
|
}
|
|
|
- if(value.level > 1){
|
|
|
+ if (value.level > 1) {
|
|
|
id = value.previous
|
|
|
}
|
|
|
- this.arrList = this.parentFormat(this.superList,id)
|
|
|
+ this.arrList = this.parentFormat(this.superList, id)
|
|
|
this.listType()
|
|
|
return
|
|
|
}
|
|
@@ -807,33 +802,33 @@ export default {
|
|
|
this.arrList = this.superList
|
|
|
this.listType()
|
|
|
},
|
|
|
- parentFormat(arr,id){
|
|
|
- console.log(arr,id)
|
|
|
- if(!arr || !id){
|
|
|
- return
|
|
|
+ parentFormat(arr, id) {
|
|
|
+ console.log(arr, id)
|
|
|
+ if (!arr || !id) {
|
|
|
+ return
|
|
|
}
|
|
|
- let arrs = []
|
|
|
+ const arrs = []
|
|
|
// 递归查找上一级
|
|
|
- function des(arr,data){
|
|
|
- arr.forEach(item=>{
|
|
|
- if(item.id === id){
|
|
|
- if(data){
|
|
|
+ function des(arr, data) {
|
|
|
+ arr.forEach(item => {
|
|
|
+ if (item.id === id) {
|
|
|
+ if (data) {
|
|
|
return arrs.push(data)
|
|
|
}
|
|
|
return arrs.push(item)
|
|
|
}
|
|
|
- if(item.children){
|
|
|
- return des(item.children,item)
|
|
|
+ if (item.children) {
|
|
|
+ return des(item.children, item)
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- des(arr,null)
|
|
|
+ des(arr, null)
|
|
|
return arrs
|
|
|
},
|
|
|
- //排序
|
|
|
- editSort() {},
|
|
|
- },
|
|
|
-};
|
|
|
+ // 排序
|
|
|
+ editSort() {}
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
<style>
|
|
|
.el-scrollbar__wrap {
|
|
@@ -841,7 +836,7 @@ export default {
|
|
|
}
|
|
|
</style>
|
|
|
<style scoped>
|
|
|
-
|
|
|
+
|
|
|
.right-info-box {
|
|
|
width: calc(100%);
|
|
|
}
|
|
@@ -849,7 +844,7 @@ export default {
|
|
|
background-color: #fff;
|
|
|
padding: 24px;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.group_card {
|
|
|
background-color: #fff;
|
|
|
padding: 20px;
|
|
@@ -910,7 +905,7 @@ export default {
|
|
|
width: 56px;
|
|
|
height: 28px;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.item_name_title {
|
|
|
font-size: 14px;
|
|
|
margin-left: 5px;
|
|
@@ -930,7 +925,7 @@ export default {
|
|
|
.showIcon:hover {
|
|
|
opacity: 1;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.item_handle {
|
|
|
margin-right: 20px;
|
|
|
width: 35%;
|
|
@@ -944,4 +939,4 @@ export default {
|
|
|
width: 15%;
|
|
|
text-align: center;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|