You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
271 lines
5.8 KiB
271 lines
5.8 KiB
<template>
|
|
<view>
|
|
<topnav title="选择护工" @tohome="tohome"></topnav>
|
|
<view class="tjcarer">
|
|
<view class="pageTitle">系统推荐</view>
|
|
<view class="carerBox" style="height: 450rpx;">
|
|
<block v-for="(item,index) in carerdatatj">
|
|
<carerinfo :info="item" type="tjlist" :index="index" isCheck="1" @change='bindChange'>
|
|
</carerinfo>
|
|
</block>
|
|
</view>
|
|
</view>
|
|
<view class="allCarer">
|
|
<view class="pageTitle gdtitle">
|
|
手动选择护工
|
|
<input type="text" class="searchBoxInput" placeholder="请输入关键字姓名电话等" @input='bindKeyWord' :value="keyWord"
|
|
@confirm="loadData(1)"></input>
|
|
</view>
|
|
<view class="carerBox">
|
|
<block v-for="(item,index) in carerdata">
|
|
<carerinfo :info="item" type="list" :index="index" isCheck="1" @change='bindChange'></carerinfo>
|
|
</block>
|
|
</view>
|
|
</view>
|
|
<view class="bottom" @click="bindConfirm">
|
|
<text class="bottomText">确定</text>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
var util = require("../../../../utils/util.js");
|
|
export default {
|
|
data() {
|
|
return {
|
|
tabsarr: [{
|
|
title: "全部",
|
|
checked: true,
|
|
value: ""
|
|
}, {
|
|
title: "工作中",
|
|
checked: false,
|
|
value: "1"
|
|
}, {
|
|
title: "空闲中",
|
|
checked: false,
|
|
value: "2"
|
|
}],
|
|
currentPage: 1,
|
|
carerdata: [],
|
|
host: "",
|
|
projectid: "",
|
|
keyWord: "",
|
|
activeKey: "",
|
|
carerdatatj: [],
|
|
selectItem: []
|
|
|
|
}
|
|
},
|
|
onLoad: function(options) {
|
|
this.host = util.HOST;
|
|
},
|
|
onShow: function() {
|
|
var p = uni.getStorageSync('currentProject');
|
|
|
|
console.log(p)
|
|
if (util.isNull(p)) {
|
|
uni.navigateTo({
|
|
url: '/pages/selectHospital/selectHospital'
|
|
});
|
|
} else {
|
|
this.projectid = p.id;
|
|
}
|
|
this.loadData(1);
|
|
this.loadDataTJ();
|
|
},
|
|
onReady() {},
|
|
onReachBottom: function(e) {
|
|
this.loadData(this.currentPage + 1);
|
|
},
|
|
onPullDownRefresh: function(e) {
|
|
this.loadData(this.currentPage + 1);
|
|
},
|
|
methods: {
|
|
tohome:function(){
|
|
uni.navigateTo({
|
|
url:"../../../../pages/index/index"
|
|
})
|
|
},
|
|
tabChange: function(val) {
|
|
|
|
|
|
},
|
|
bindItemClick: function(o) {
|
|
uni.navigateTo({
|
|
url: "../carerinfo/carerinfo?id=" + o.item.id
|
|
})
|
|
},
|
|
bindConfirm: function(e) {
|
|
uni.navigateBack({
|
|
|
|
})
|
|
},
|
|
bindChange: function(o) {
|
|
var that = this;
|
|
uni.removeStorageSync("selectCarer");
|
|
console.log(that.carerdata[o.index])
|
|
var _carerdatatj = that.carerdatatj;
|
|
var _carerdata = that.carerdata;
|
|
for (var m of _carerdatatj)
|
|
m.checked = false
|
|
for (var m of _carerdata)
|
|
m.checked = false
|
|
|
|
that.selectItem = o.item;
|
|
if (o.type == "list") {
|
|
_carerdata[o.index].checked = true;
|
|
} else {
|
|
_carerdatatj[o.index].checked = true;
|
|
}
|
|
that.carerdatatj = _carerdatatj;
|
|
that.carerdata = _carerdata;
|
|
uni.setStorageSync("selectCarer", o.item);
|
|
|
|
},
|
|
loadDataTJ: function() {
|
|
var that = this;
|
|
util.request({
|
|
bindThis: that,
|
|
api: 'manager/get-project-paramedics/' + that.projectid,
|
|
customLoading: false,
|
|
data: {
|
|
project_id: that.projectid,
|
|
page: 1,
|
|
page_size: 2
|
|
},
|
|
utilSuccess: function(r) {
|
|
var res = r.data; // 服务器总条数 < 每页条数, 会将第一页的条数重新返回
|
|
for (var m of res) {
|
|
m.checked = false;
|
|
}
|
|
that.setData({
|
|
carerdatatj: res
|
|
});
|
|
},
|
|
utilFail: function(res) {}
|
|
});
|
|
},
|
|
bindKeyWord:function(e){
|
|
this.keyWord = e.detail.value;
|
|
},
|
|
loadData: function(page) {
|
|
var that = this;
|
|
util.request({
|
|
bindThis: that,
|
|
api: 'manager/get-project-paramedics/' + that.projectid,
|
|
customLoading: false,
|
|
data: {
|
|
project_id: that.projectid,
|
|
page: page,
|
|
page_size: 5,
|
|
keyword: that.keyWord
|
|
},
|
|
utilSuccess: function(r) {
|
|
uni.stopPullDownRefresh();
|
|
var res = r.data; // 服务器总条数 < 每页条数, 会将第一页的条数重新返回
|
|
console.log(res)
|
|
var hasNoMore = that.carerdata.length < 5 && page > 1;
|
|
if (hasNoMore || res.length == 0 && page > 1) {
|
|
// 已加载到最后一页
|
|
uni.showToast({
|
|
title: '已加载到最后一页',
|
|
icon: 'none'
|
|
});
|
|
return;
|
|
}
|
|
|
|
var carerdata = that.carerdata;
|
|
var _res = [];
|
|
|
|
for (var m of res) {
|
|
m.checked = false;
|
|
}
|
|
|
|
if (page == 1) {
|
|
carerdata = res;
|
|
} else {
|
|
carerdata.push(...res);
|
|
}
|
|
|
|
that.setData({
|
|
currentPage: page,
|
|
carerdata: carerdata
|
|
});
|
|
},
|
|
utilFail: function(res) {
|
|
uni.stopPullDownRefresh();
|
|
util.alert(res);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
page {
|
|
padding-top: 160rpx;
|
|
padding-bottom: 120rpx;
|
|
}
|
|
|
|
.carerBox {
|
|
background: #FFFFFF;
|
|
padding: 20rpx 30rpx;
|
|
margin-top: 30rpx;
|
|
}
|
|
|
|
.tjcarer {
|
|
position: fixed;
|
|
top: 160rpx;
|
|
left: 0rpx;
|
|
width: 750rpx;
|
|
z-index: 9;
|
|
background: #f2f2f2;
|
|
}
|
|
|
|
.allCarer {
|
|
background: #f2f2f2;
|
|
margin-top: 580rpx;
|
|
position: relative;
|
|
}
|
|
|
|
.gdtitle {
|
|
position: fixed;
|
|
top: 620rpx;
|
|
left: 0rpx;
|
|
padding: 30rpx 30rpx;
|
|
background: #f2f2f2;
|
|
width: 750rpx;
|
|
z-index: 9;
|
|
display: flex;
|
|
}
|
|
|
|
.bottomText {
|
|
font-family: SourceHanSansCN-Medium;
|
|
font-size: 32rpx;
|
|
color: #FFFFFF;
|
|
letter-spacing: 0;
|
|
}
|
|
|
|
.bottom {
|
|
background: #0DC99E;
|
|
height: 90rpx;
|
|
width: 100%;
|
|
align-items: center;
|
|
display: flex;
|
|
justify-content: center;
|
|
position: fixed;
|
|
bottom: 0;
|
|
left: 0;
|
|
}
|
|
.searchBoxInput{
|
|
margin-left: 20rpx;
|
|
color: #000;
|
|
border: #00A7B7 2rpx solid;
|
|
width: 400rpx;
|
|
flex:none !important;
|
|
padding: 5rpx 10rpx;
|
|
}
|
|
</style>
|