|
@@ -5,23 +5,18 @@
|
|
|
<div class="squrt"></div>课外训练
|
|
|
</h2> -->
|
|
|
<div class="m-core">
|
|
|
- <el-form :inline="true"
|
|
|
+ <save-form :inline="true"
|
|
|
+ @submit="search"
|
|
|
+ @reset="onReSet"
|
|
|
+ :saveKey="'afterSchoolList'"
|
|
|
:model="searchForm">
|
|
|
<el-form-item>
|
|
|
<el-input v-model.trim="searchForm.listSearch"
|
|
|
- @keyup.enter.native="search"
|
|
|
+ @keyup.enter.native="search" clearable
|
|
|
placeholder="请输入标题"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-select placeholder="老师姓名"
|
|
|
- v-model="searchForm.teacherId"
|
|
|
- clearable
|
|
|
- filterable>
|
|
|
- <el-option v-for="(item,index) in teacherList"
|
|
|
- :label="item.realName"
|
|
|
- :value="item.id"
|
|
|
- :key="index"></el-option>
|
|
|
- </el-select>
|
|
|
+ <remoteSearch :commit='"setTeachers"' v-model='searchForm.teacherId' />
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="organIdList">
|
|
|
<el-select class="multiple"
|
|
@@ -29,7 +24,7 @@
|
|
|
filterable
|
|
|
clearable
|
|
|
placeholder="请选择分部">
|
|
|
- <el-option v-for="(item,index) in organList"
|
|
|
+ <el-option v-for="(item,index) in selects.branchs"
|
|
|
:key="index"
|
|
|
:label="item.name"
|
|
|
:value="item.id"></el-option>
|
|
@@ -48,12 +43,10 @@
|
|
|
}"></el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="danger"
|
|
|
- @click="search">搜索</el-button>
|
|
|
- <el-button @click="onReSet"
|
|
|
- type="primary">重置</el-button>
|
|
|
+ <el-button type="danger" native-type="submit">搜索</el-button>
|
|
|
+ <el-button native-type="reset" type="primary">重置</el-button>
|
|
|
</el-form-item>
|
|
|
- </el-form>
|
|
|
+ </save-form>
|
|
|
<div class="tableWrap">
|
|
|
<el-table style="width: 100%"
|
|
|
:header-cell-style="{background:'#EDEEF0',color:'#444'}"
|
|
@@ -106,7 +99,7 @@
|
|
|
@pagination="getList" />
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-dialog title="课外训练详情"
|
|
|
+ <!-- <el-dialog title="课外训练详情"
|
|
|
:visible.sync="afterSchoolVisible"
|
|
|
width="600px">
|
|
|
<el-form :model="visibleForm">
|
|
@@ -144,16 +137,16 @@
|
|
|
style="width:400px"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- </el-dialog>
|
|
|
+ </el-dialog> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import pagination from "@/components/Pagination/index";
|
|
|
+import remoteSearch from '@/components/remote-search'
|
|
|
import { queryPageList } from "@/api/afterSchool";
|
|
|
-import { getTeacher, getEmployeeOrgan } from "@/api/buildTeam";
|
|
|
export default {
|
|
|
- components: { pagination },
|
|
|
+ components: { pagination, remoteSearch },
|
|
|
data () {
|
|
|
return {
|
|
|
searchForm: {
|
|
@@ -169,62 +162,29 @@ export default {
|
|
|
total: 0, // 总条数
|
|
|
page_size: [10, 20, 40, 50] // 选择限制显示条数
|
|
|
},
|
|
|
- teacherList: [],
|
|
|
tableList: [],
|
|
|
- organList: [],
|
|
|
visibleForm: {
|
|
|
- createTime:
|
|
|
- "啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦"
|
|
|
+ createTime: null
|
|
|
},
|
|
|
- afterSchoolVisible: false
|
|
|
};
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created () { },
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted () {
|
|
|
- getTeacher().then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.teacherList = res.data;
|
|
|
- }
|
|
|
- });
|
|
|
- getEmployeeOrgan().then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.organList = res.data;
|
|
|
- }
|
|
|
- });
|
|
|
+ this.$store.dispatch('setBranchs')
|
|
|
// 获取分部
|
|
|
this.init();
|
|
|
},
|
|
|
- activated () {
|
|
|
- this.init();
|
|
|
- },
|
|
|
methods: {
|
|
|
init () {
|
|
|
- var now = new Date();
|
|
|
- var startDate = new Date(
|
|
|
- Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
|
|
|
- )
|
|
|
- .toISOString()
|
|
|
- .slice(0, 10);
|
|
|
- // + " 00:00:00" + " 23:59:59"
|
|
|
- var endDate = new Date(
|
|
|
- Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())
|
|
|
- )
|
|
|
- .toISOString()
|
|
|
- .slice(0, 10);
|
|
|
- this.searchForm.listTimer = [];
|
|
|
- this.searchForm.listTimer.push(startDate);
|
|
|
- this.searchForm.listTimer.push(endDate);
|
|
|
- if (this.$route.query.searchForm) {
|
|
|
- this.$route.query.searchForm instanceof Object
|
|
|
- ? (this.searchForm = this.$route.query.searchForm)
|
|
|
- : (this.searchForm = JSON.parse(this.$route.query.searchForm));
|
|
|
- }
|
|
|
- if (this.$route.query.rules) {
|
|
|
- this.$route.query.rules instanceof Object
|
|
|
- ? (this.rules = this.$route.query.rules)
|
|
|
- : (this.rules = JSON.parse(this.$route.query.rules));
|
|
|
+ if(this.searchForm.listTimer.length <= 0) {
|
|
|
+ let now = new Date();
|
|
|
+ let startDate = new Date(Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())).toISOString().slice(0, 10);
|
|
|
+ let endDate = new Date(Date.UTC(now.getFullYear(), now.getMonth(), now.getDate())).toISOString().slice(0, 10);
|
|
|
+ this.searchForm.listTimer = [];
|
|
|
+ this.searchForm.listTimer.push(startDate);
|
|
|
+ this.searchForm.listTimer.push(endDate);
|
|
|
}
|
|
|
this.getList();
|
|
|
},
|
|
@@ -237,7 +197,7 @@ export default {
|
|
|
}
|
|
|
obj.page = this.rules.page;
|
|
|
obj.rows = this.rules.limit,
|
|
|
- this.searchForm.teacherId ? obj.teacherId = this.searchForm.teacherId : null;
|
|
|
+ this.searchForm.teacherId ? obj.teacherId = this.searchForm.teacherId : null;
|
|
|
this.searchForm.listSearch ? obj.title = this.searchForm.listSearch : null;
|
|
|
this.searchForm.organIdList ? obj.organIdList = this.searchForm.organIdList : null;
|
|
|
queryPageList(obj).then(res => {
|
|
@@ -261,12 +221,7 @@ export default {
|
|
|
this.search();
|
|
|
},
|
|
|
lookDetail (row) {
|
|
|
- // this.afterSchoolVisible = true;
|
|
|
-
|
|
|
- let rules = JSON.stringify(this.rules);
|
|
|
- let searchForm = JSON.stringify(this.searchForm);
|
|
|
- this.$router.push({ path: '/business/afterSchoolDetail', query: { extracurricularExercisesId: row.id, rules, searchForm, title: row.title } })
|
|
|
-
|
|
|
+ this.$router.push({ path: '/business/afterSchoolDetail', query: { extracurricularExercisesId: row.id, title: row.title } })
|
|
|
}
|
|
|
}
|
|
|
};
|