常用人预约

master
lion 3 years ago
parent c227e83911
commit f57f65bccf

@ -59,6 +59,35 @@
v-if="type=='user'">每单限购{{list.person_max_count}}同一身份证当天限购1张</text>
<text class="box-tips-txt"
v-if="type=='team'">{{list.team_min_count}}人以上可团体预约一个团体最多{{list.team_max_count}}</text>
</view>
<view>
<view class="box-card-content">
<view class="book-box" style="padding-top: 20rpx;">
<view class="book-box-card">
<view class="book-box-title">
常用人
</view>
<view class="">
<view class="book-box-timerow">
<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 v-if="item.checked" class="book-box-row-timeitem-status">
<u-icon name="checkmark" color="#fff" size="20rpx" v-if="item.checked">
</u-icon>
</view>
<view>{{item.name}}</view>
<!-- <view>{{item.datef}}</view> -->
</view>
</block>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="box-visitor">
<block v-for="(item,index) in form.details_list" :key="index">
@ -189,7 +218,8 @@
isEdit: false,
isEditIndex: 0,
showInfo: false,
list: {},
list: {},
common_user:[],
form: {
unit: "",
leader: "",
@ -207,7 +237,8 @@
mobile: ""
},
type: "user",
rules: [],
rules: [],
details_rule: {
name: [{
required: true,
@ -264,9 +295,41 @@
that.util.getUserInfo(function(r) {
that.form.mobile = r.mobile;
}, true);
}, true);
that.loadCommonUser()
},
methods: {
methods: {
loadCommonUser(){
var that = this;
this.util.request({
api: '/api/mobile/activity/address-book',
utilSuccess: function(res) {
for(var m of res){
m.checked = false
}
that.common_user = res;
},
utilFail: function(res) {
}
})
},
handleCommonUser(obj){
obj.checked = !obj.checked
if(obj.checked){
this.form.details_list.push(obj)
}else{
for(var i=0;i<this.form.details_list.length;i++){
if(this.form.details_list[i].name==obj.name){
this.form.details_list.splice(i,1)
}
}
}
},
tothere() {
uni.openLocation({
latitude: parseFloat(this.list.latitude),
@ -289,7 +352,12 @@
}
this.showAdd = true
},
delUser(index) {
delUser(index) {
for(var i=0;i<this.common_user.length;i++){
if(this.form.details_list[index].name == this.common_user[i].name){
this.common_user[i].checked = false;
}
}
this.form.details_list.splice(index, 1);
},
closeInfo() {
@ -587,6 +655,10 @@
color: #351C1B;
padding-bottom: 25rpx;
border-bottom: 2px solid #F7F6F4;
}
.book-box-row-timeitem {
width:160rpx;
text-align: center;
}
.box-card-content {}

@ -89,6 +89,35 @@
<text class="box-tips-txt" v-if="type=='user'">{{maxCount}}1</text>
<text class="box-tips-txt"
v-if="type=='team'">{{minCount}}人以上可团体预约一个团体最多{{maxCount}}</text>
</view>
<view class="commonuser">
<view class="box-card-content">
<view class="book-box" style="padding-top: 20rpx;">
<view class="book-box-card">
<view class="book-box-title">
常用人
</view>
<view class="">
<view class="book-box-timerow">
<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 v-if="item.checked" class="book-box-row-timeitem-status">
<u-icon name="checkmark" color="#fff" size="20rpx" v-if="item.checked">
</u-icon>
</view>
<view>{{item.name}}</view>
<!-- <view>{{item.datef}}</view> -->
</view>
</block>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="box-visitor">
<block v-for="(item,index) in form.details_list" :key="index">
@ -258,7 +287,8 @@
content: "<p>1.批量上传EXCEL的以xlsx结尾</p><p>2.第一列为标题列 姓名 手机号 证件号</p><p>3.文件是从微信聊天记录中选取或者微信文件传输助手</p><img src='@host@/export.png' style='width:100%'/>"
}],
specialtype:false,
specialid:0,
specialid:0,
common_user:[],
form: {
date: "",
rule_id: "",
@ -355,7 +385,9 @@
that.util.getUserInfo(function(r) {
that.user = r;
that.form.mobile = r.mobile;
}, true);
}, true);
that.loadCommonUser();
},
@ -371,6 +403,38 @@
// if(this.$refs.radio.currentValue){
// this.specialtype = val;
// }
},
loadCommonUser(){
var that = this;
this.util.request({
api: '/api/mobile/visit/address-book',
utilSuccess: function(res) {
for(var m of res){
m.checked = false
}
that.common_user = res;
console.log(that.common_user)
},
utilFail: function(res) {
}
})
},
handleCommonUser(obj){
obj.checked = !obj.checked
if(obj.checked){
this.form.details_list.push(obj)
}else{
for(var i=0;i<this.form.details_list.length;i++){
if(this.form.details_list[i].name==obj.name){
this.form.details_list.splice(i,1)
}
}
}
},
loadConfig() {
@ -418,7 +482,9 @@
this.notice[type].content = this.notice[type].content.replace("@host@", this.util.HOST);
this.currentNotice = this.notice[type];
},
submitOrder() {
submitOrder() {
console.log(this.form);
this.form.date = this.currentDate.date;
this.form.rule_id = this.currentTime.id;
if(this.specialid){
@ -672,7 +738,8 @@
}
}
return day
},
},
handleDate(index) {
var nt = this.$moment().format("yyyy-MM-DD");
let list = this.listDatePrice;
@ -828,7 +895,12 @@
this.editIndex = -1;
this.showAdd = true
},
delUser(index) {
delUser(index) {
for(var i=0;i<this.common_user.length;i++){
if(this.form.details_list[index].name == this.common_user[i].name){
this.common_user[i].checked = false;
}
}
this.form.details_list.splice(index, 1);
}
}
@ -944,6 +1016,10 @@
color: #351C1B;
padding-bottom: 25rpx;
border-bottom: 2px solid #F7F6F4;
}
.commonuser .book-box-row-timeitem{
width:160rpx;
text-align: center;
}
.box-card-content {}

Loading…
Cancel
Save