|
@@ -3,7 +3,7 @@
|
|
|
<view class="phone-navBar-box">
|
|
|
<view @click="goUpPage" class="nav-bar-icon"></view>
|
|
|
<text class="nav-bar-title">家政人员</text>
|
|
|
- <uni-icons class="nav-bar-right-icon bar-ml10" type="search" size="20"></uni-icons>
|
|
|
+ <uni-icons class="nav-bar-right-icon bar-ml10" type="search" @click="searchBtn" size="20"></uni-icons>
|
|
|
</view>
|
|
|
<v-tabs v-model="current" :tabs="tabs" :scroll="false" @change="changeTab" field="name"
|
|
|
class="admin-tab-box"></v-tabs>
|
|
@@ -12,7 +12,7 @@
|
|
|
<text>{{leixing}}</text>
|
|
|
<icon class="select-jt-default" />
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
<view class="kc-bind-scroll-view scroll-top-border" v-if="current ==0">
|
|
|
<uni-list class="admin-list-box">
|
|
|
<uni-list-item v-for="item in list" class="admin-list-item-box">
|
|
@@ -26,7 +26,8 @@
|
|
|
<view class="ks-totalTm kc-fenlei">
|
|
|
<icon class="phone-fenlei-icon" />分类:{{item.kcClassifyName}}
|
|
|
</view>
|
|
|
- <button class="item-view-btn" type="primary" size="mini" @click.stop="toAdd(item)">添加</button>
|
|
|
+ <button class="item-view-btn" type="primary" size="mini"
|
|
|
+ @click.stop="toAdd(item)">绑定</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -56,7 +57,8 @@
|
|
|
</view>
|
|
|
<common-dialog ref="commonDialogRef" :title="deleteTitle" :content="deleteConcent"
|
|
|
@confirm-btn="deleteQuerenBtn"></common-dialog>
|
|
|
- <kechengLeixingVue ref="kclxRef" @select="handleSelectLeixing" @reset="handleResetLeixing"></kechengLeixingVue>
|
|
|
+ <kechengLeixingVue ref="kclxRef" @select="handleSelectLeixing" @reset="handleResetLeixing"></kechengLeixingVue>
|
|
|
+ <searchVue ref="searchRef" @search-btn="handleSearchFromBtn"></searchVue>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
@@ -73,20 +75,25 @@
|
|
|
} from "@/api/jiazheng.js";
|
|
|
import commonDialog from '@/components/dialog/commonDialog.vue';
|
|
|
import kechengLeixingVue from "./common/kechengLeixing.vue";
|
|
|
+ import searchVue from "./common/search2.vue";
|
|
|
+ import {
|
|
|
+ debounce
|
|
|
+ } from "@/utils/common";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
leixing: '全部类型',
|
|
|
leixingList: [],
|
|
|
- selectClassify:null,
|
|
|
+ selectClassify: null,
|
|
|
kcClassifyId: 0,
|
|
|
id: '',
|
|
|
+ name: '',
|
|
|
current: 0,
|
|
|
list: [],
|
|
|
- listYx: [],
|
|
|
- deleteTitle :'删除',
|
|
|
- kcId :'',
|
|
|
- deleteConcent :'你确定要执行这个操作吗',
|
|
|
+ listYx: [],
|
|
|
+ deleteTitle: '删除',
|
|
|
+ kcId: '',
|
|
|
+ deleteConcent: '你确定要执行这个操作吗',
|
|
|
tabs: [{
|
|
|
id: 1,
|
|
|
name: '未绑定课程',
|
|
@@ -102,7 +109,8 @@
|
|
|
},
|
|
|
components: {
|
|
|
commonDialog,
|
|
|
- kechengLeixingVue
|
|
|
+ kechengLeixingVue,
|
|
|
+ searchVue
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
this.id = options.id
|
|
@@ -110,23 +118,30 @@
|
|
|
this.getKechengClassify()
|
|
|
},
|
|
|
methods: {
|
|
|
+ searchBtn() {
|
|
|
+ this.$refs.searchRef.handleShow()
|
|
|
+ },
|
|
|
|
|
|
- handleResetLeixing() {
|
|
|
+ handleSearchFromBtn(textD) {
|
|
|
+ this.name = textD;
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ handleResetLeixing() {
|
|
|
this.selectClassify = null;
|
|
|
this.leixing = '全部类型';
|
|
|
this.getList()
|
|
|
},
|
|
|
- handleSelectLeixing(item) {
|
|
|
+ handleSelectLeixing(item) {
|
|
|
this.leixing = item.lable;
|
|
|
this.selectClassify = item;
|
|
|
this.getList()
|
|
|
},
|
|
|
- clickAlltype(){
|
|
|
+ clickAlltype() {
|
|
|
this.$refs.kclxRef.showPopup({
|
|
|
- data: this.leixingList
|
|
|
+ data: this.leixingList
|
|
|
})
|
|
|
},
|
|
|
- getKechengClassify(){
|
|
|
+ getKechengClassify() {
|
|
|
getAdminClassify().then(res => {
|
|
|
res.data.children.forEach(item => {
|
|
|
item.checked = false;
|
|
@@ -135,27 +150,30 @@
|
|
|
})
|
|
|
},
|
|
|
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 {
|
|
|
- uni.showToast({
|
|
|
- title: '添加失败',
|
|
|
- icon: 'success'
|
|
|
- });
|
|
|
- return false
|
|
|
+ debounce(()=>{
|
|
|
+ let req = {
|
|
|
+ kcIds: [data.kcId],
|
|
|
+ id: this.id
|
|
|
}
|
|
|
- })
|
|
|
+ jiazhengKcAdd(req).then(res => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.getList()
|
|
|
+ uni.showToast({
|
|
|
+ title: '添加成功',
|
|
|
+ icon: 'success'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ title: '添加失败',
|
|
|
+ icon: 'success'
|
|
|
+ });
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },500)
|
|
|
+
|
|
|
},
|
|
|
- deleteQuerenBtn(){
|
|
|
+ deleteQuerenBtn() {
|
|
|
let req = {
|
|
|
kcId: this.kcId,
|
|
|
id: this.id
|
|
@@ -199,6 +217,7 @@
|
|
|
let req = {
|
|
|
id: this.id,
|
|
|
"kcClassifyId": this.selectClassify && this.selectClassify.id || 0,
|
|
|
+ name:this.name
|
|
|
}
|
|
|
kcSelectList(req).then(res => {
|
|
|
if (res.code == 0) {
|