|
@@ -6,10 +6,12 @@
|
|
|
</view>
|
|
|
<v-tabs v-model="current" :tabs="tabs" :scroll="false" @change="changeTab" field="name"
|
|
|
class="admin-tab-box"></v-tabs>
|
|
|
- <uni-list v-if="current ==1" class="jz-scroll-view">
|
|
|
+ <uni-list v-if="current ==0" class="jz-scroll-view">
|
|
|
<uni-list-item v-for="item in list" class="jz-list-item-box">
|
|
|
<template v-slot:body>
|
|
|
-
|
|
|
+ <view class="card-head-row">
|
|
|
+ <button type="default" class="phone-green-btn bz-tel-btn" @click.stop="toAdd(item)">添加</button>
|
|
|
+ </view>
|
|
|
<view @click="lookUserInfo(item)" class="card-body-row">
|
|
|
<view class="card-img-box">
|
|
|
<img :src="item.pic" v-if="item.pic">
|
|
@@ -25,14 +27,13 @@
|
|
|
</template>
|
|
|
</uni-list-item>
|
|
|
</uni-list>
|
|
|
- <uni-list v-if="current ==2" class="jz-scroll-view">
|
|
|
- <view class="jz-new-btn-box">
|
|
|
- <button type="default" class="phone-green-btn" @click="addJiazhengRenyuan">新增人员</button>
|
|
|
- </view>
|
|
|
-
|
|
|
- <uni-list-item v-for="item in list" class="jz-list-item-box">
|
|
|
+ <uni-list v-if="current ==1" class="jz-scroll-view">
|
|
|
+ <uni-list-item v-for="item in listYx" class="jz-list-item-box">
|
|
|
<template v-slot:body>
|
|
|
-
|
|
|
+ <view class="card-head-row">
|
|
|
+ <button type="default" class="phone-green-btn bz-tel-btn"
|
|
|
+ @click.stop="toDelete(item)">删除</button>
|
|
|
+ </view>
|
|
|
<view @click="lookUserInfo(item)" class="card-body-row">
|
|
|
<view class="card-img-box">
|
|
|
<img :src="item.pic" v-if="item.pic">
|
|
@@ -56,7 +57,10 @@
|
|
|
ref
|
|
|
} from "vue";
|
|
|
import {
|
|
|
- kcSelectList
|
|
|
+ kcSelectList,
|
|
|
+ jiazhengKcList,
|
|
|
+ jiazhengKcAdd,
|
|
|
+ jiazhengKcDelete
|
|
|
} from "@/api/jiazheng.js";
|
|
|
import commonDialog from '@/components/dialog/commonDialog.vue';
|
|
|
|
|
@@ -65,8 +69,9 @@
|
|
|
return {
|
|
|
kcClassifyId: 0,
|
|
|
id: '',
|
|
|
- current: 1,
|
|
|
- list:[],
|
|
|
+ current: 0,
|
|
|
+ list: [],
|
|
|
+ listYx: [],
|
|
|
tabs: [{
|
|
|
id: 1,
|
|
|
name: '未绑定课程',
|
|
@@ -88,19 +93,54 @@
|
|
|
this.getList()
|
|
|
},
|
|
|
methods: {
|
|
|
- changeTab(data){
|
|
|
- console.log('data',data);
|
|
|
+ toAdd(data) {
|
|
|
+ let req = {
|
|
|
+ kcIds: [data.kcId],
|
|
|
+ id: this.id
|
|
|
+ }
|
|
|
+ jiazhengKcAdd(req).then(res => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.getList()
|
|
|
+ uni.showToast({
|
|
|
+ title: '添加成功',
|
|
|
+ icon: 'success'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- goUpPage() {
|
|
|
- if (this.pageInfo.from == 'banzheng') {
|
|
|
- uni.redirectTo({
|
|
|
- url: "/pages/admin/banzheng/list"
|
|
|
- })
|
|
|
+ toDelete(data) {
|
|
|
+ let req = {
|
|
|
+ kcId: data.kcId,
|
|
|
+ id: this.id
|
|
|
+ }
|
|
|
+ jiazhengKcDelete(req).then(res => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.getYxList()
|
|
|
+ uni.showToast({
|
|
|
+ title: '删除成功',
|
|
|
+ icon: 'success'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ changeTab(data) {
|
|
|
+ this.current = data
|
|
|
+ if (this.current == 0) {
|
|
|
+ this.getList()
|
|
|
} else {
|
|
|
- uni.redirectTo({
|
|
|
- url: "/pages/admin/Jiazheng/index"
|
|
|
- })
|
|
|
+ this.getYxList()
|
|
|
}
|
|
|
+
|
|
|
+ console.log('data', data);
|
|
|
+ },
|
|
|
+ goUpPage() {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: "/pages/admin/Jiazheng/index"
|
|
|
+ })
|
|
|
},
|
|
|
getList() {
|
|
|
let req = {
|
|
@@ -115,6 +155,18 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ getYxList() {
|
|
|
+ let req = {
|
|
|
+ id: this.id,
|
|
|
+ }
|
|
|
+ jiazhengKcList(req).then(res => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.listYx = res.data
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|