|
@@ -9,25 +9,19 @@
|
|
|
<!-- tabs 部分 -->
|
|
|
<a-layout-content class="todoBody">
|
|
|
<a-tabs default-active-key="wait" @change="tabClick" class="todoPage">
|
|
|
- <!-- 我的申请 -->
|
|
|
+ <!-- 申请 -->
|
|
|
<a-tab-pane key="apply" tab="申请" class="apply">
|
|
|
- <div v-for="item in applyList" :key="item.id">
|
|
|
- <applyTab></applyTab>
|
|
|
- </div>
|
|
|
+ <applyTab ref="ApplyTab"></applyTab>
|
|
|
</a-tab-pane>
|
|
|
|
|
|
- <!-- 我的待办 -->
|
|
|
+ <!-- 待办 -->
|
|
|
<a-tab-pane key="wait" tab="待办" force-render class="wait">
|
|
|
- <div v-for="item in todoList" :key="item.id">
|
|
|
- <waitTab></waitTab>
|
|
|
- </div>
|
|
|
+ <waitTab ref="WaitTab"></waitTab>
|
|
|
</a-tab-pane>
|
|
|
|
|
|
- <!-- 我的已办 -->
|
|
|
+ <!-- 已办 -->
|
|
|
<a-tab-pane key="done" tab="已办" class="done">
|
|
|
- <div v-for="item in doneList" :key="item.id">
|
|
|
- <doneTab></doneTab>
|
|
|
- </div>
|
|
|
+ <doneTab ref="DoneTab"></doneTab>
|
|
|
</a-tab-pane>
|
|
|
</a-tabs>
|
|
|
</a-layout-content>
|
|
@@ -40,7 +34,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getAction } from '@/api/manage'
|
|
|
+// import { getAction } from '@/api/manage'
|
|
|
import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
|
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
import { activitiMixin } from '@/views/activiti/mixins/activitiMixin'
|
|
@@ -140,41 +134,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- created () {
|
|
|
- this.getDataList()
|
|
|
- },
|
|
|
- mounted () {
|
|
|
- this.init()
|
|
|
- },
|
|
|
methods: {
|
|
|
- init () {
|
|
|
- this.getDataList()
|
|
|
- },
|
|
|
loadData () {},
|
|
|
-
|
|
|
- // 拿到 所有列表(待办、已办)
|
|
|
- getDataList () {
|
|
|
- // 待办
|
|
|
- // eslint-disable-next-line no-unused-expressions
|
|
|
- getAction(this.url.todoList, {}).then(res => {
|
|
|
- if (res.success) {
|
|
|
- this.todoList = res.result || []
|
|
|
- this.total = this.data.leading
|
|
|
- console.log('1次 todo.vue 待办列表', this.todoList)
|
|
|
- }
|
|
|
- })
|
|
|
- // 已办
|
|
|
- this.postFormAction(this.url.doneList, this.searchForm).then(res => {
|
|
|
- this.loading = false
|
|
|
- if (res.success) {
|
|
|
- this.doneList = res.result || []
|
|
|
- console.log('1次 todo.vue 已办列表', this.doneList)
|
|
|
- } else {
|
|
|
- this.$message.error(res.message)
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
// 初始化表
|
|
|
forminitial () {
|
|
|
this.form = {
|
|
@@ -191,56 +152,27 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- // tab被点击的回调 原始
|
|
|
+ // 点击tab的回调
|
|
|
tabClick (key) {
|
|
|
console.log(key)
|
|
|
if (key === 'apply') {
|
|
|
- getAction(this.url.list).then(res => {
|
|
|
- if (res.success) {
|
|
|
- this.applyList = res.result || []
|
|
|
- console.log('申请列表:', this.applyList)
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.$refs.ApplyTab) {
|
|
|
+ // 通过点击自己,刷新自己的数据(此处是调用其他页面的方法)
|
|
|
+ // 各自刷新各自的数据,其他tabs通过点击各自按钮,调用方法刷新列表
|
|
|
+ this.$refs.ApplyTab.loadData()
|
|
|
+ }
|
|
|
}
|
|
|
if (key === 'done') {
|
|
|
- getAction(this.url.doneList).then(res => {
|
|
|
- if (res.success) {
|
|
|
- this.doneList = res.result || []
|
|
|
- console.log('已办列表:', this.doneList)
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.$refs.DoneTab) {
|
|
|
+ this.$refs.DoneTab.getDataList()
|
|
|
+ }
|
|
|
}
|
|
|
if (key === 'wait') {
|
|
|
- getAction(this.url.todoList).then(res => {
|
|
|
- if (res.success) {
|
|
|
- this.todoList = res.result || []
|
|
|
- console.log('申请列表:', this.todoList)
|
|
|
- }
|
|
|
- })
|
|
|
+ if (this.$refs.WaitTab) {
|
|
|
+ this.$refs.WaitTab.getDataList()
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- // tab被点击的回调 修改
|
|
|
- // callback (key) {
|
|
|
- // console.log(key)
|
|
|
- // if (key === 'apply') {
|
|
|
- // getAction(this.url.list).then(res => {
|
|
|
- // if (res.success) {
|
|
|
- // this.applyList = res.result || []
|
|
|
- // console.log('1次 todo 申请列表', this.applyList)
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
- // if (key === 'done') {
|
|
|
- // var what1 = [{ applyer: '123123132' }]
|
|
|
- // this.doneList = what1
|
|
|
- // console.log('3次 todo页面 已完成', this.doneList)
|
|
|
- // }
|
|
|
- // if (key === 'wait') {
|
|
|
- // var what2 = [{ applyer: '123123132' }]
|
|
|
- // this.todoList = what2
|
|
|
- // console.log('3次 todo页面 待办', this.todoList)
|
|
|
- // }
|
|
|
- // }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -254,7 +186,6 @@ export default {
|
|
|
.main {
|
|
|
padding: 14px;
|
|
|
/deep/.ant-tabs {
|
|
|
- // background-color: rgb(12, 120, 153);
|
|
|
border-top-left-radius: 40px;
|
|
|
border-top-right-radius: 40px;
|
|
|
}
|