|
|
@@ -6,6 +6,9 @@
|
|
|
margin-right: 6px;
|
|
|
}
|
|
|
}
|
|
|
+ .el-input-number .el-input__inner{
|
|
|
+ text-align: left;
|
|
|
+ }
|
|
|
</style>
|
|
|
<template>
|
|
|
<section class="content">
|
|
|
@@ -43,12 +46,7 @@
|
|
|
<el-button type="primary" @click="getData" size="mini"
|
|
|
>搜索</el-button
|
|
|
>
|
|
|
- <!-- <el-button
|
|
|
- type="info"
|
|
|
- size="mini"
|
|
|
- @click="handleAdd"
|
|
|
- >重置</el-button
|
|
|
- > -->
|
|
|
+
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
plain
|
|
|
@@ -56,6 +54,11 @@
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
>添加学校</el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ size="mini"
|
|
|
+ @click="del(-1)"
|
|
|
+ >批量删除</el-button>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -64,21 +67,39 @@
|
|
|
v-loading="loading"
|
|
|
:data="list"
|
|
|
style="width: 100%; margin-top: 10px"
|
|
|
- height="68vh"
|
|
|
- >
|
|
|
- <el-table-column align="center" prop="name" label="学校名称" />
|
|
|
+ height="55vh"
|
|
|
+ @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55"></el-table-column>
|
|
|
+ <el-table-column prop="name" label="学校名称" />
|
|
|
<!-- <el-table-column align="center" prop="phone" label="地区" /> -->
|
|
|
<el-table-column label="联系人" prop='contacts'></el-table-column>
|
|
|
<el-table-column label="联系人电话" prop='contacts_phone'></el-table-column>
|
|
|
- <el-table-column align="center" prop="ctime" label="创建时间" />
|
|
|
+ <el-table-column label="服务时长" prop='service_date'></el-table-column>
|
|
|
+ <el-table-column label="教师上限" prop='teacher_limit'></el-table-column>
|
|
|
+ <el-table-column label="学生上限" prop='students_limit'></el-table-column>
|
|
|
+ <el-table-column label="状态" prop=''>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span v-if='scope.row.service_status'>有效</span>
|
|
|
+ <span v-else>失效</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" prop="ctime" label="入驻时间" />
|
|
|
<el-table-column align="center" prop="date" label="操作" width="320">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button @click="addClass(scope.row.id)" size="mini" type="primary" plain
|
|
|
>添加班级</el-button
|
|
|
>
|
|
|
- <el-button @click="edit(scope.row)" size="mini" type="info" plain
|
|
|
- >编辑</el-button
|
|
|
- >
|
|
|
+ <el-dropdown @command="command=>handleCommand(command,scope.row)">
|
|
|
+ <el-button type="primary" @click="edit(scope.row)" size="mini" style="margin: 0 5px;">
|
|
|
+ 编辑<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-dropdown-menu slot="dropdown">
|
|
|
+ <el-dropdown-item command="1">一键复制</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="2" v-if='scope.row.service_status'>停用</el-dropdown-item>
|
|
|
+ <el-dropdown-item command="2" v-else>启用</el-dropdown-item>
|
|
|
+ <!-- <el-dropdown-item command="3">续期</el-dropdown-item> -->
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </el-dropdown>
|
|
|
<el-button @click="del(scope.row.id)" size="mini" type="info" plain
|
|
|
>删除</el-button
|
|
|
>
|
|
|
@@ -162,6 +183,23 @@
|
|
|
placeholder="请输入联系电话"
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="服务时长" prop="service_date">
|
|
|
+ <el-date-picker style="width: 100%;"
|
|
|
+ v-model="form.service_date"
|
|
|
+ type="date"
|
|
|
+ placeholder="选择日期"
|
|
|
+ format="yyyy 年 MM 月 dd 日"
|
|
|
+ value-format="yyyy-MM-dd">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="学生上限" prop="students_limit">
|
|
|
+ <el-input-number style="width: 100%;" v-model="form.students_limit" controls-position="right"
|
|
|
+ :min="1" :max="10000"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="教师上限" prop="teacher_limit">
|
|
|
+ <el-input-number style="width: 100%;" v-model="form.teacher_limit" controls-position="right"
|
|
|
+ :min="1" :max="10000"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="submitForm">保存</el-button>
|
|
|
@@ -222,6 +260,8 @@
|
|
|
<el-button @click="open = false">取 消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <textarea id='input' style="position: absolute;z-index: -1;"></textarea>
|
|
|
</section>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -245,11 +285,49 @@ export default {
|
|
|
open: false,
|
|
|
open2: false,
|
|
|
gradeList: [],
|
|
|
- rules: {}
|
|
|
+ rules: {},
|
|
|
+ ids:''
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- del(id) {
|
|
|
+ handleCommand(command,info){
|
|
|
+ if(command == 1){
|
|
|
+ this.copytext="ID:"+info.id+"\n学校名称:"+info.name
|
|
|
+ this.copy()
|
|
|
+ }else if(command == 2){
|
|
|
+ let form={...info}
|
|
|
+ form.service_status=Number(!form.service_status)
|
|
|
+ this.$api.editSchool(form).then((res) => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ this.msgSuccess("修改成功!");
|
|
|
+ this.getData();
|
|
|
+ } else {
|
|
|
+ this.msgError(res.data.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ copy(){
|
|
|
+ var input = document.getElementById("input");
|
|
|
+ input.value = this.copytext; // 要复制的文本框的内容
|
|
|
+ input.select(); // 选中文本
|
|
|
+ document.execCommand("copy");
|
|
|
+ this.msgSuccess("复制成功");
|
|
|
+ },
|
|
|
+ handleSelectionChange(val) {
|
|
|
+ const ids=[]
|
|
|
+ val.forEach(item=>{
|
|
|
+ ids.push(item.id)
|
|
|
+ })
|
|
|
+ this.ids=ids.join(',')
|
|
|
+ },
|
|
|
+ del(id) {
|
|
|
+ if(id==-1 && this.ids){
|
|
|
+ id=this.ids
|
|
|
+ }else{
|
|
|
+ this.msgInfo('请选择删除的数据');
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$confirm("确认删除?", "提示", {
|
|
|
type: "warning",
|
|
|
}).then(() => {
|
|
|
@@ -291,7 +369,9 @@ export default {
|
|
|
handleAdd() {
|
|
|
this.open = true;
|
|
|
this.title = "新增学校";
|
|
|
- this.form = {};
|
|
|
+ this.form = {
|
|
|
+ service_status:1
|
|
|
+ };
|
|
|
},
|
|
|
addClass(id){
|
|
|
this.open2 = true;
|