<template>
|
<view class="content">
|
<view class="row regis-info">
|
<text class="info-title">拜访日期: </text>
|
<!-- <view class="regis-info-date">
|
<uni-datetime-picker v-model="vistime"></uni-datetime-picker>
|
</view> -->
|
<e-picker mode="dateTime" :style="{color:vistimeColor}" class="select_vistime" @change="vistimeChange">{{vistime||'请选择拜访日期'}}</e-picker>
|
<!-- <input class="input" type="text" v-model="vistime" placeholder="请选择拜访日期" placeholder-class="placeholder" /> -->
|
</view>
|
<view class="row regis-info">
|
<text class="info-title"><!-- <span style="color: red;">* --></span>客户名称: </text>
|
<picker @change="ynameSelect" :range="ynameArray" class="yname-select">
|
<label :style="{color:ynameArrayTypeColor}" v-model="yname">{{ ynameArrayType }}</label>
|
</picker>
|
<!-- <input class="input" type="text" v-model="yname" placeholder="请输客户名称" placeholder-class="placeholder" /> -->
|
</view>
|
<view class="row regis-info">
|
<text class="info-title"><!-- <span style="color: red;">* --></span>客户类型: </text>
|
<picker @change="typeSelect" :range="typeArray" class="type-select">
|
<label :style="{color:typeArrayTypeColor}" v-model="typeArrayType">{{ typeArrayType }}</label>
|
</picker>
|
<!-- <input class="input" type="text" v-model="type" placeholder="请输客户类型" placeholder-class="placeholder" /> -->
|
</view>
|
<view class="row regis-info">
|
<text class="info-title"><!-- <span style="color: red;">* --></span>联系电话: </text>
|
<input class="input" type="text" v-model="phone" placeholder="请输入联系电话" placeholder-class="placeholder" />
|
</view>
|
<view class="row regis-info">
|
<text class="info-title"><!-- <span style="color: red;">* --></span>客户地址: </text>
|
<input class="input" type="text" v-model="address" placeholder="请输入客户地址" placeholder-class="placeholder" />
|
</view>
|
<view class="row regis-info">
|
<text class="info-title"><!-- <span style="color: red;">* --></span>营业信息: </text>
|
<input class="input" type="text" v-model="information" placeholder="请输入营业信息" placeholder-class="placeholder" />
|
</view>
|
<view class="row regis-info-desc">
|
<text class="info-title"><!-- <span style="color: red;">* --></span>备注: </text>
|
<input class="input" type="text" v-model="remark" placeholder="请输入备注" placeholder-class="placeholder" />
|
</view>
|
<button class="btn" @click="confirm">上传</button>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default{
|
data () {
|
return {
|
ynameArrayTypeColor:"#808080",
|
typeArrayTypeColor:"#808080",
|
vistimeColor:"#808080",
|
vistime:"",
|
ynumber:"",
|
yname:"",
|
type:"",
|
phone:"",
|
address:"",
|
information:"",
|
remark:"",
|
display:'none',
|
display1:'none',
|
display2:'none',
|
display3:'none',
|
pathUrl: this.$store.state.piAPI + "",
|
// pathUrl: "http://localhost:89",
|
tenantArr:[],
|
ynameArray:[],
|
ynameArrayIndex:0,
|
ynameArrayType:'请选择客户',
|
typeArray:["学校","医院","小区"],
|
typeArrayIndex:0,
|
typeArrayType:'请选择客户类型'
|
}
|
},
|
onLoad() {
|
//进入页面后查询客户信息
|
this.getTenantList();
|
},
|
methods: {
|
//日期选择
|
vistimeChange(e) {
|
this.vistime = e.substr(0,e.length-3);
|
//修改颜色
|
this.vistimeColor = "#000000";
|
},
|
|
|
//获取客户信息
|
getTenantList(){
|
var that = this;
|
uni.request({
|
url: this.pathUrl + '/blade-system/tenant/page',
|
method:'GET',
|
success: (res) => {
|
that.tenantArr = res.data.data.records;
|
if(that.tenantArr.length>0 ){
|
for (var i = 0; i < that.tenantArr.length; i++) {
|
if(that.tenantArr[i].tenantName!=""){
|
that.ynameArray.push(that.tenantArr[i].tenantName);
|
}
|
}
|
}
|
}
|
});
|
},
|
|
//客户名称下拉改变事件
|
ynameSelect(e) {
|
var that = this;
|
this.ynameArrayIndex = e.target.value;
|
this.ynameArrayType=this.ynameArray[this.ynameArrayIndex];
|
//获取id
|
for (var i = 0; i < that.tenantArr.length; i++) {
|
if(that.tenantArr[i].tenantName==that.ynameArrayType){
|
that.ynumber = that.tenantArr[i].id;
|
that.yname = that.tenantArr[i].tenantName;
|
that.linkman = that.tenantArr[i].linkman;
|
that.phone = that.tenantArr[i].contactNumber;
|
that.address = that.tenantArr[i].address;
|
that.type = that.tenantArr[i].type;
|
if(that.tenantArr[i].type=="1"){
|
that.typeArrayType = '学校';
|
this.typeArrayTypeColor = "#000000";
|
}
|
if(that.tenantArr[i].type=="2"){
|
that.typeArrayType = '医院';
|
this.typeArrayTypeColor = "#000000";
|
}
|
if(that.tenantArr[i].type=="3"){
|
that.typeArrayType = '小区';
|
this.typeArrayTypeColor = "#000000";
|
}
|
}
|
}
|
//修改样式
|
this.ynameArrayTypeColor = "#000000";
|
|
},
|
|
//客户类型下拉改变事件
|
typeSelect(e){
|
var that = this;
|
this.typeArrayIndex = e.target.value;
|
this.typeArrayType=this.typeArray[this.typeArrayIndex];
|
if(that.typeArrayType == '学校'){
|
that.type = 1;
|
}
|
if(that.typeArrayType =='医院'){
|
that.type = 2;
|
}
|
if(that.typeArrayType =='小区'){
|
that.type = 3;
|
}
|
//修改样式
|
this.typeArrayTypeColor = "#000000";
|
},
|
|
|
//提交修改
|
confirm(){
|
uni.request({
|
url: this.pathUrl + '/visitrecord/visitrecord/save',
|
method:'POST',
|
data:{
|
// "visitrecord":
|
// {
|
"vistime":this.vistime,
|
"snumber":this.$store.state.puserID,
|
"yname":this.yname,
|
"ynumber":this.ynumber,
|
"type":this.type,
|
"phone":this.phone,
|
"address":this.address,
|
"information":this.information,
|
"remark":this.remark,
|
// }
|
},
|
success: (res) => {
|
if(res.data.code==200){
|
uni.showToast({
|
title: '提交成功!',
|
duration: 2000
|
});
|
}
|
}
|
});
|
}
|
}
|
}
|
</script>
|
|
<style>
|
.regis-info {
|
width: 100%;
|
height: 100rpx;
|
position: relative;
|
left: 20rpx;
|
border-bottom: 1px solid rgba(128,128,128,0.1);
|
}
|
|
.regis-info-desc {
|
width: 100%;
|
height: 100rpx;
|
position: relative;
|
left: 20rpx;
|
}
|
|
.regis-info-desc input{
|
position: relative;
|
left: 112rpx;
|
top: 27rpx;
|
letter-spacing: 1rpx;
|
}
|
|
.info-title{
|
letter-spacing: 1rpx;
|
float: left;
|
line-height: 100rpx;
|
font-weight: 530;
|
}
|
|
.regis-info input{
|
position: relative;
|
left: 45rpx;
|
top: 27rpx;
|
letter-spacing: 1rpx;
|
}
|
|
.btn{
|
position: relative;
|
top: 40rpx;
|
background-color: #007AFF;
|
width: 180rpx;
|
height: 180rpx;
|
border-radius: 100rpx;
|
line-height:180rpx;
|
color: #FFFFFF;
|
letter-spacing: 2rpx;
|
}
|
|
.regis-info-date{
|
position: relative;
|
top: 7rpx;
|
left: 20rpx;
|
}
|
|
.yname-select{
|
position: relative;
|
left: 45rpx;
|
top: 28rpx;
|
}
|
|
.type-select{
|
position: relative;
|
left: 45rpx;
|
top: 28rpx;
|
}
|
|
.select_vistime {
|
position: relative;
|
left: 45rpx;
|
top: 28rpx;
|
}
|
</style>
|