刘翔宇-旅管家 4 years ago
parent 1377a29959
commit 0fa8f492ae

@ -100,9 +100,12 @@
<view class=""> <view class="">
<view class="book-box-timerow"> <view class="book-box-timerow">
<block v-for="(item,index) in common_user" :key="index"> <block v-for="(item,index) in common_user" :key="index">
<view class="book-box-row-timeitem" :class="{'book-box-row-timeitem-on':item.checked}" @click="handleCommonUser(item)"> <view class="book-box-row-timeitem"
:class="{'book-box-row-timeitem-on':item.checked}"
@click="handleCommonUser(item)">
<view v-if="item.checked" class="book-box-row-timeitem-status"> <view v-if="item.checked" class="book-box-row-timeitem-status">
<u-icon name="checkmark" color="#fff" size="20rpx" v-if="item.checked"> <u-icon name="checkmark" color="#fff" size="20rpx"
v-if="item.checked">
</u-icon> </u-icon>
</view> </view>
<view>{{item.name}}</view> <view>{{item.name}}</view>
@ -189,7 +192,8 @@
</u-radio> </u-radio>
</u-radio-group> --> </u-radio-group> -->
<u-cell-group :border="false"> <u-cell-group :border="false">
<u-cell @click="showCards" :title="card_type_names" :isLink="true" arrow-direction="down"></u-cell> <u-cell @click="showCards" :title="card_type_names" :isLink="true"
arrow-direction="down"></u-cell>
</u-cell-group> </u-cell-group>
</u-form-item> </u-form-item>
<u-form-item label="证件号码" labelWidth="80" prop="from.idcard" required> <u-form-item label="证件号码" labelWidth="80" prop="from.idcard" required>
@ -231,7 +235,8 @@
</u-radio> </u-radio>
</u-radio-group> --> </u-radio-group> -->
<u-cell-group :border="false"> <u-cell-group :border="false">
<u-cell @click="showCard" :title="card_type_name" :isLink="true" arrow-direction="down"></u-cell> <u-cell @click="showCard" :title="card_type_name" :isLink="true" arrow-direction="down">
</u-cell>
</u-cell-group> </u-cell-group>
<!-- <u-input placeholder="身份证" disabled @click="showCard" v-model="formUser.card_type"></u-input> --> <!-- <u-input placeholder="身份证" disabled @click="showCard" v-model="formUser.card_type"></u-input> -->
</u-form-item> </u-form-item>
@ -239,12 +244,12 @@
<u-input placeholder="请输入证件号码" v-model="formUser.idcard"></u-input> <u-input placeholder="请输入证件号码" v-model="formUser.idcard"></u-input>
</u-form-item> </u-form-item>
<u-form-item label="行动不便者" labelWidth="80" prop="is_disability" ref="is_disability"> <u-form-item label="行动不便者" labelWidth="80" prop="is_disability" ref="is_disability">
<u-radio-group v-model="formUser.is_disability"> <u-radio-group v-model="formUser.is_disability">
<u-radio width="100%" activeColor="#EF9525" v-for="(item, index) in disabilitys" <u-radio width="100%" activeColor="#EF9525" v-for="(item, index) in disabilitys"
:key="index" :name=item.idx :label="item.name"> :key="index" :name=item.idx :label="item.name">
</u-radio> </u-radio>
<!-- <u-checkbox activeColor="#EF9525" label="乘坐轮椅等行动不便者" v-model="specialtype" name='1' shape="circle"></u-checkbox> --> <!-- <u-checkbox activeColor="#EF9525" label="乘坐轮椅等行动不便者" v-model="specialtype" name='1' shape="circle"></u-checkbox> -->
</u-radio-group> </u-radio-group>
</u-form-item> </u-form-item>
<u-form-item label="手机号" labelWidth="80" prop="from.mobile" ref="mobile"> <u-form-item label="手机号" labelWidth="80" prop="from.mobile" ref="mobile">
@ -257,8 +262,10 @@
</view> </view>
</u-popup> </u-popup>
<u-picker :show="cardshow" @cancel="cancel" @confirm="confirmCard" ref="uPicker" :columns="cardLists" keyName="label"></u-picker> <u-picker :show="cardshow" @cancel="cancel" @confirm="confirmCard" ref="uPicker" :columns="cardLists"
<u-picker :show="cardshows" @cancel="cancels" @confirm="confirmCards" ref="uPickers" :columns="cardLists" keyName="label"></u-picker> keyName="label"></u-picker>
<u-picker :show="cardshows" @cancel="cancels" @confirm="confirmCards" ref="uPickers" :columns="cardLists"
keyName="label"></u-picker>
@ -272,7 +279,8 @@
<view class="mpopup-content" style="margin-top: 60rpx;"> <view class="mpopup-content" style="margin-top: 60rpx;">
<scroll-view scroll-y="true" :style="[{height:scrollheight}]"> <scroll-view scroll-y="true" :style="[{height:scrollheight}]">
<!-- <rich-text :nodes="currentNotice.content"></rich-text> --> <!-- <rich-text :nodes="currentNotice.content"></rich-text> -->
<view class="htmls" style="line-height: 50rpx;text-indent: 2em;" v-html="currentNotice.content"></view> <view class="htmls" style="line-height: 50rpx;text-indent: 2em;" v-html="currentNotice.content">
</view>
</scroll-view> </scroll-view>
<view style="margin-top: 40rpx;"></view> <view style="margin-top: 40rpx;"></view>
@ -282,7 +290,8 @@
</u-popup> </u-popup>
<u-popup :show="successshow" customStyle="width:600rpx;height:300rpx;text-align:center" :round="10" mode="center" width="600rpx" height="150rpx"> <u-popup :show="successshow" customStyle="width:600rpx;height:300rpx;text-align:center" :round="10"
mode="center" width="600rpx" height="150rpx">
<view class=""> <view class="">
<view class="successBox"> <view class="successBox">
<!-- <u-icon name="checkmark-circle" size="90" color="#EF9525"></u-icon> --> <!-- <u-icon name="checkmark-circle" size="90" color="#EF9525"></u-icon> -->
@ -310,23 +319,23 @@
const date = d.getDate() const date = d.getDate()
return { return {
successshow: false, successshow: false,
time:3, time: 3,
showInfo: false, showInfo: false,
currentNotice: {}, currentNotice: {},
maxheight:"", maxheight: "",
scrollheight:"", scrollheight: "",
notice: [{ notice: [{
title: "预约须知", title: "预约须知",
content: "预约须知的内容" content: "预约须知的内容"
}, { }, {
title: "批量上传帮助", title: "批量上传帮助",
content: "<p>1.批量上传EXCEL的以xlsx结尾</p><p>2.第一列为标题列 姓名 手机号 证件号 行动不便者</p><p>3.文件是从微信聊天记录中选取或者微信文件传输助手</p><img src='@host@/export.png?v=1.1' style='width:100%'/>" content: "<p>1.批量上传EXCEL的以xlsx结尾</p><p>2.第一行为标题行 姓名 手机号 证件号 行动不便者</p><p>3.文件是从微信聊天记录中选取或者微信文件传输助手</p><img src='@host@/export.png?v=1.1' style='width:100%'/>"
}], }],
specialtype:false, specialtype: false,
specialid:0, specialid: 0,
common_user:[], common_user: [],
t:null, t: null,
timer:null, timer: null,
form: { form: {
date: "", date: "",
rule_id: "", rule_id: "",
@ -385,40 +394,43 @@
config: {}, config: {},
info: {}, info: {},
editIndex: -1, editIndex: -1,
disabilitys:[{ disabilitys: [{
idx: 0, idx: 0,
name: '否' name: '否'
},
{
idx: 1,
name: '是'
}],
cardshow:false,
cardshows:false,
card_type_name:"身份证",
card_type_names:"身份证",
// cardLists:['','','','',''],
cardLists: [[{
value: 1,
label: '身份证'
},
{
value: 3,
label: '港澳台居民居住证'
},
{
value: 2,
label: '护照'
},
{
value: 4,
label: '台胞证'
}, },
{ {
value: 5, idx: 1,
label: '港澳证' name: '是'
} }
]], ],
cardshow: false,
cardshows: false,
card_type_name: "身份证",
card_type_names: "身份证",
// cardLists:['','','','',''],
cardLists: [
[{
value: 1,
label: '身份证'
},
{
value: 3,
label: '港澳台居民居住证'
},
{
value: 2,
label: '护照'
},
{
value: 4,
label: '台胞证'
},
{
value: 5,
label: '港澳证'
}
]
],
} }
}, },
@ -454,8 +466,8 @@
}, true); }, true);
that.loadCommonUser(); that.loadCommonUser();
that.maxheight = wx.getSystemInfoSync().windowHeight*0.6 + "px" that.maxheight = wx.getSystemInfoSync().windowHeight * 0.6 + "px"
that.scrollheight = wx.getSystemInfoSync().windowHeight*0.6*0.7 + "px" that.scrollheight = wx.getSystemInfoSync().windowHeight * 0.6 * 0.7 + "px"
}, },
onHide() { onHide() {
clearInterval(this.t) clearInterval(this.t)
@ -467,52 +479,52 @@
clearTimeout(this.timer) clearTimeout(this.timer)
}, },
methods: { methods: {
confirmCards(e){ confirmCards(e) {
this.card_type_names = e.value[0].label this.card_type_names = e.value[0].label
this.form.card_type = e.value[0].value this.form.card_type = e.value[0].value
this.cardshows = false this.cardshows = false
}, },
cancel(){ cancel() {
this.cardshow = false this.cardshow = false
}, },
cancels(){ cancels() {
this.cardshows = false this.cardshows = false
}, },
showCards(){ showCards() {
this.cardshows = true this.cardshows = true
}, },
confirmCard(e){ confirmCard(e) {
this.card_type_name = e.value[0].label this.card_type_name = e.value[0].label
this.formUser.card_type = e.value[0].value this.formUser.card_type = e.value[0].value
this.cardshow = false this.cardshow = false
}, },
showCard(){ showCard() {
this.cardshow = true this.cardshow = true
}, },
goHome(){ goHome() {
uni.switchTab({ uni.switchTab({
url: "/pages/index/index" url: "/pages/index/index"
}) })
}, },
radioChange(val){ radioChange(val) {
console.log(val) console.log(val)
this.specialtype = !this.specialtype; this.specialtype = !this.specialtype;
if(this.specialtype){ if (this.specialtype) {
this.specialid = val[0] this.specialid = val[0]
}else{ } else {
this.specialid = 0 this.specialid = 0
} }
// if(this.$refs.radio.currentValue){ // if(this.$refs.radio.currentValue){
// this.specialtype = val; // this.specialtype = val;
// } // }
}, },
loadCommonUser(){ loadCommonUser() {
var that = this; var that = this;
this.util.request({ this.util.request({
api: '/api/mobile/visit/address-book', api: '/api/mobile/visit/address-book',
utilSuccess: function(res) { utilSuccess: function(res) {
for(var m of res){ for (var m of res) {
m.checked = false m.checked = false
} }
that.common_user = res; that.common_user = res;
@ -523,14 +535,14 @@
} }
}) })
}, },
handleCommonUser(obj){ handleCommonUser(obj) {
obj.checked = !obj.checked obj.checked = !obj.checked
if(obj.checked){ if (obj.checked) {
this.form.details_list.push(obj) this.form.details_list.push(obj)
}else{ } else {
for(var i=0;i<this.form.details_list.length;i++){ for (var i = 0; i < this.form.details_list.length; i++) {
if(this.form.details_list[i].name==obj.name){ if (this.form.details_list[i].name == obj.name) {
this.form.details_list.splice(i,1) this.form.details_list.splice(i, 1)
} }
} }
@ -569,7 +581,7 @@
console.log(res); console.log(res);
that.info = res; that.info = res;
that.notice[0].content = (that.type == 'user' ? res.person_notice : res.team_notice) that.notice[0].content = (that.type == 'user' ? res.person_notice : res.team_notice)
that.notice[0].content = that.notice[0].content.replace(/\<p/gi,"<p class='richp'"); that.notice[0].content = that.notice[0].content.replace(/\<p/gi, "<p class='richp'");
}, },
utilFail: function(res) { utilFail: function(res) {
@ -721,21 +733,31 @@
"token": uni.getStorageSync("userInfo_token").token "token": uni.getStorageSync("userInfo_token").token
}, },
success(res) { success(res) {
var jsonlist = JSON.parse(res.data) console.log(res);
for (var m of jsonlist) { if (res.data.indexOf("err") > -1) {
var err = JSON.parse(res.data);
_that.form.details_list.push({ _that.util.toast("导入失败,原因‘" + err.errmsg + "’请查看批量导入说明");
name: m.name,
idcard: m.idcard, } else {
mobile: m.mobile, var jsonlist = JSON.parse(res.data);
card_type: 1, for (var m of jsonlist) {
is_disability:0 _that.form.details_list.push({
}) name: m.name,
idcard: m.idcard,
mobile: m.mobile,
card_type: 1,
is_disability: 0
})
}
} }
uni.hideLoading(); },
fail(error) {
console.log(error);
} }
}) })
console.log('上传到服务器') uni.hideLoading();
} }
} }
}) })
@ -768,7 +790,7 @@
// }) // })
// return false; // return false;
// } // }
if(!this.util.isNull(this.formUser.mobile)){ if (!this.util.isNull(this.formUser.mobile)) {
if (!this.util.phoneRegex.test(this.formUser.mobile)) { if (!this.util.phoneRegex.test(this.formUser.mobile)) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
@ -1014,8 +1036,8 @@
this.showAdd = true this.showAdd = true
}, },
delUser(index) { delUser(index) {
for(var i=0;i<this.common_user.length;i++){ for (var i = 0; i < this.common_user.length; i++) {
if(this.form.details_list[index].name == this.common_user[i].name){ if (this.form.details_list[index].name == this.common_user[i].name) {
this.common_user[i].checked = false; this.common_user[i].checked = false;
} }
} }
@ -1135,10 +1157,12 @@
padding-bottom: 25rpx; padding-bottom: 25rpx;
border-bottom: 2px solid #F7F6F4; border-bottom: 2px solid #F7F6F4;
} }
.commonuser .book-box-row-timeitem{
width:160rpx; .commonuser .book-box-row-timeitem {
width: 160rpx;
text-align: center; text-align: center;
} }
// .mpopup{ // .mpopup{
// max-height: 400rpx; // max-height: 400rpx;
// // overflow-y: scroll; // // overflow-y: scroll;
@ -1149,6 +1173,7 @@
} }
.box-card-content {} .box-card-content {}
.successBox { .successBox {
.iconfont { .iconfont {
@ -1173,24 +1198,27 @@
} }
.pinkBtn { .pinkBtn {
width: 50%; width: 50%;
background-image: linear-gradient(45deg, #EF9525 0%, #EF9525 100%); background-image: linear-gradient(45deg, #EF9525 0%, #EF9525 100%);
border-radius: 44rpx; border-radius: 44rpx;
font-size: 30rpx; font-size: 30rpx;
font-weight: 500; font-weight: 500;
color: #FFFFFF; color: #FFFFFF;
text-align: center; text-align: center;
line-height: 70rpx; line-height: 70rpx;
margin:30rpx auto; margin: 30rpx auto;
} }
.richp{
margin-bottom:10rpx; .richp {
margin-bottom: 10rpx;
} }
.u-radio-group{
.u-radio-group {
flex-wrap: wrap; flex-wrap: wrap;
} }
.u-radio-group .u-radio{
margin-bottom:10rpx; .u-radio-group .u-radio {
margin-right:10rpx margin-bottom: 10rpx;
margin-right: 10rpx
} }
</style> </style>

Loading…
Cancel
Save