|
@@ -0,0 +1,217 @@
|
|
|
+<!-- -->
|
|
|
+<template>
|
|
|
+ <div class="m-container">
|
|
|
+ <h2>
|
|
|
+ <div class="squrt"></div>
|
|
|
+ 声部分类管理
|
|
|
+ </h2>
|
|
|
+ <div class="m-core">
|
|
|
+ <!-- <save-form
|
|
|
+ :inline="true"
|
|
|
+ :model="searchForm"
|
|
|
+ @submit="search"
|
|
|
+ @reset="onReSet"
|
|
|
+ >
|
|
|
+ <el-form-item>
|
|
|
+ <el-input
|
|
|
+ v-model.trim="searchForm.search"
|
|
|
+ clearable
|
|
|
+ @keyup.enter.native="search"
|
|
|
+ placeholder="请输入乐团编号"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-input
|
|
|
+ v-model.trim="searchForm.search"
|
|
|
+ @keyup.enter.native="search"
|
|
|
+ placeholder="请输入乐团编号"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button native-type="submit" type="primary">搜索</el-button>
|
|
|
+ <el-button native-type="reset" type="danger">重置</el-button>
|
|
|
+ </el-form-item> -->
|
|
|
+ <!-- </save-form> -->
|
|
|
+ <div class="tableWrap">
|
|
|
+ <el-table
|
|
|
+ style="width: 100%"
|
|
|
+ :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
|
|
|
+ :data="tableList"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="id"
|
|
|
+ label="分类编号"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="name"
|
|
|
+ label="分类名称"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column align="center" prop="name" label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <el-button type="text" @click="resetSubjectCategory(scope.row)"
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
+ <el-button type="text" @click="removeSubjectCategory(scope.row)"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column align="center" prop="name" label="分类图片">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-image
|
|
|
+ v-if="scope.row.img"
|
|
|
+ style="width: 60px; height: 60px"
|
|
|
+ fit="cover"
|
|
|
+ :src="scope.row.img.split(',')[0]"
|
|
|
+ :previewSrcList="scope.row.img.split(',')"
|
|
|
+ >
|
|
|
+ </el-image>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+ </el-table>
|
|
|
+ <pagination
|
|
|
+ sync
|
|
|
+ :total.sync="rules.total"
|
|
|
+ :page.sync="rules.page"
|
|
|
+ :limit.sync="rules.limit"
|
|
|
+ :page-sizes="rules.page_size"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-dialog
|
|
|
+ title="修改分类"
|
|
|
+ :visible.sync="categoryVisible"
|
|
|
+ width="500px"
|
|
|
+ v-if="categoryVisible"
|
|
|
+ >
|
|
|
+ <el-form :model="form" :inline="true" ref="form">
|
|
|
+ <el-form-item label="分类名称" :rules="{required: true, message: '请输入分类名称', trigger: 'change,blur'}">
|
|
|
+ <el-input v-model="form.name"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="categoryVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitReset"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import axios from "axios";
|
|
|
+import { getToken } from "@/utils/auth";
|
|
|
+import pagination from "@/components/Pagination/index";
|
|
|
+import load from "@/utils/loading";
|
|
|
+import { subjectListTree } from "@/api/specialSetting";
|
|
|
+export default {
|
|
|
+ components: { pagination },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ searchForm: {
|
|
|
+ search: null,
|
|
|
+ },
|
|
|
+ form:{
|
|
|
+ name:null,
|
|
|
+ id:null
|
|
|
+ },
|
|
|
+ tableList: [],
|
|
|
+ organList: [],
|
|
|
+ rules: {
|
|
|
+ // 分页规则
|
|
|
+ limit: 10, // 限制显示条数
|
|
|
+ page: 1, // 当前页
|
|
|
+ total: 0, // 总条数
|
|
|
+ page_size: [10, 20, 40, 50], // 选择限制显示条数
|
|
|
+ },
|
|
|
+ categoryVisible:false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ //生命周期 - 创建完成(可以访问当前this实例)
|
|
|
+ created() {},
|
|
|
+ //生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
+ mounted() {
|
|
|
+ // 获取分部
|
|
|
+
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ getList() {
|
|
|
+ subjectListTree({
|
|
|
+ delFlag: "NO",
|
|
|
+ tenantId: 1,
|
|
|
+ rows: this.rules.limit,
|
|
|
+ page: this.rules.page,
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ // let tempArray = []
|
|
|
+ // result.rows.forEach(item => {
|
|
|
+ // item.inputStatus = false
|
|
|
+ // tempArray.push(item)
|
|
|
+ // })
|
|
|
+ // this.subjectList = tempArray
|
|
|
+ this.tableList = res.data.rows;
|
|
|
+ this.rules.total = res.data.total;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ search() {
|
|
|
+ this.rules.page = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ onReSet() {},
|
|
|
+ resetSubjectCategory(row) {
|
|
|
+ console.log(row)
|
|
|
+ this.form.name = row.name;
|
|
|
+ this.form.id = row.id;
|
|
|
+ this.categoryVisible = true;
|
|
|
+ },
|
|
|
+ removeSubjectCategory(row) {
|
|
|
+ this.$confirm("是否确认删除分类", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ subjectUpset({
|
|
|
+ delFlag: "YES",
|
|
|
+ id: row.id,
|
|
|
+ }).then((res) => {
|
|
|
+ this.messageTips("删除", res);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ messageTips(title, res) {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success(title + "成功");
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ submitReset(){
|
|
|
+ // this.$refs.form.
|
|
|
+ subjectUpset({
|
|
|
+ parentSubjectId: 0,
|
|
|
+ tenantId: 1,
|
|
|
+ name: this.oneTypeName
|
|
|
+ }).then(res => {
|
|
|
+ this.messageTips('添加', res)
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.oneTypeName = null
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang='scss' scoped>
|
|
|
+</style>
|