|
@@ -17,14 +17,15 @@
|
|
</template>
|
|
</template>
|
|
</van-nav-bar>
|
|
</van-nav-bar>
|
|
|
|
|
|
- <van-form>
|
|
|
|
|
|
+ <van-form @submit="save">
|
|
<van-field
|
|
<van-field
|
|
v-model="name"
|
|
v-model="name"
|
|
name="姓名"
|
|
name="姓名"
|
|
label="姓名"
|
|
label="姓名"
|
|
- placeholder="请输入"
|
|
|
|
|
|
+ placeholder="请输入姓名(20个字以内)"
|
|
input-align="right"
|
|
input-align="right"
|
|
required
|
|
required
|
|
|
|
+ :rules="[{ required: true, message: '请输入姓名' }]"
|
|
/>
|
|
/>
|
|
<van-field
|
|
<van-field
|
|
v-model="phone"
|
|
v-model="phone"
|
|
@@ -32,7 +33,9 @@
|
|
label="手机"
|
|
label="手机"
|
|
placeholder="请输入"
|
|
placeholder="请输入"
|
|
input-align="right"
|
|
input-align="right"
|
|
|
|
+ type="tel"
|
|
required
|
|
required
|
|
|
|
+ :rules="[{ required: true, message: '请输入手机号' }]"
|
|
></van-field>
|
|
></van-field>
|
|
<van-cell
|
|
<van-cell
|
|
title="性别"
|
|
title="性别"
|
|
@@ -50,7 +53,7 @@
|
|
:columns="sexData"
|
|
:columns="sexData"
|
|
@cancel="showSex = false"
|
|
@cancel="showSex = false"
|
|
@confirm="onConfirmSex"
|
|
@confirm="onConfirmSex"
|
|
- :default-index="sexIndex"
|
|
|
|
|
|
+ :default-index="0"
|
|
/>
|
|
/>
|
|
</van-popup>
|
|
</van-popup>
|
|
|
|
|
|
@@ -127,14 +130,15 @@
|
|
label="接待信息"
|
|
label="接待信息"
|
|
type="textarea"
|
|
type="textarea"
|
|
placeholder="请输入接待信息"
|
|
placeholder="请输入接待信息"
|
|
|
|
+ input-align="right"
|
|
/>
|
|
/>
|
|
|
|
|
|
<van-row class="bottom">
|
|
<van-row class="bottom">
|
|
<van-col span="12" class="bgGrey" @click="cancel">
|
|
<van-col span="12" class="bgGrey" @click="cancel">
|
|
<van-icon name="close" />取消
|
|
<van-icon name="close" />取消
|
|
</van-col>
|
|
</van-col>
|
|
- <van-col span="12" class="bgRed" @click="save"
|
|
|
|
- ><van-icon name="passed" />保存
|
|
|
|
|
|
+ <van-col span="12" class="bgRed">
|
|
|
|
+ <van-button square icon="success" style="margin-bottom:5px;" type="danger" native-type="submit">保存</van-button>
|
|
</van-col>
|
|
</van-col>
|
|
</van-row>
|
|
</van-row>
|
|
</van-form>
|
|
</van-form>
|
|
@@ -229,6 +233,7 @@ export default {
|
|
that.GetSaClientInfo();
|
|
that.GetSaClientInfo();
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+
|
|
onConfirmSex: function (item, index) {
|
|
onConfirmSex: function (item, index) {
|
|
console.info("onConfirmSex", item);
|
|
console.info("onConfirmSex", item);
|
|
this.sex = item.id;
|
|
this.sex = item.id;
|
|
@@ -242,40 +247,57 @@ export default {
|
|
this.cognizeWay = value;
|
|
this.cognizeWay = value;
|
|
this.showCognizeWay = false;
|
|
this.showCognizeWay = false;
|
|
},
|
|
},
|
|
|
|
+ onConfirm: function (item,index) {
|
|
|
|
+ console.info('onConfirm',item);
|
|
|
|
+ this.visitType=item.name;
|
|
|
|
+ this.showVisitType=false;
|
|
|
|
+ },
|
|
|
|
+ onConfirmIntention:function (value,index) { //意向强度
|
|
|
|
+ console.info('onConfirmIntention',value);
|
|
|
|
+ this.visitIntention=value;
|
|
|
|
+ console.info('onConfirmIntention intention',this.visitIntention);
|
|
|
|
+ this.showintention=false;
|
|
|
|
+ },
|
|
cancel: function () {
|
|
cancel: function () {
|
|
this.$router.go(-1);
|
|
this.$router.go(-1);
|
|
},
|
|
},
|
|
save: function () {
|
|
save: function () {
|
|
let that = this;
|
|
let that = this;
|
|
|
|
+ let namePattern=/^\S{1,20}$/;
|
|
|
|
+ let phonePattern=/^1[3456789]\d{9}$/;
|
|
|
|
+ if(!namePattern.test(this.name)){
|
|
|
|
+ this.$toast("姓名不能超过20字");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if(!phonePattern.test(this.phone)){
|
|
|
|
+ this.$toast("手机格式不正确");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ console.info('sex',this.sex);
|
|
|
|
+ if(this.sex!=0&&this.sex!=1){
|
|
|
|
+ this.$toast("请选择性别");
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
let jsonData = {
|
|
let jsonData = {
|
|
name: that.name,
|
|
name: that.name,
|
|
phone: that.phone,
|
|
phone: that.phone,
|
|
sex: that.sex,
|
|
sex: that.sex,
|
|
|
|
+ visitType:that.visitType,
|
|
remark: that.remark,
|
|
remark: that.remark,
|
|
- credentialsType: that.credentialsType,
|
|
|
|
- credentialsId: that.credentialsId,
|
|
|
|
- nationality: that.nationality,
|
|
|
|
- birth: that.birth,
|
|
|
|
- marry: that.marry,
|
|
|
|
- household: that.household,
|
|
|
|
- post: that.post,
|
|
|
|
- fax: that.fax,
|
|
|
|
- email: that.email,
|
|
|
|
- address: that.address,
|
|
|
|
|
|
+ visitIntention:that.visitIntention,
|
|
cognizeWay: that.cognizeWay,
|
|
cognizeWay: that.cognizeWay,
|
|
- phoneList: that.phoneList,
|
|
|
|
|
|
+ visitRemark: that.visitRemark,
|
|
};
|
|
};
|
|
//console.info("save jsonData", JSON.stringify(jsonData));
|
|
//console.info("save jsonData", JSON.stringify(jsonData));
|
|
let data = {
|
|
let data = {
|
|
userCode: that.$store.state.data.userCode,
|
|
userCode: that.$store.state.data.userCode,
|
|
projectId: that.$store.state.projectId,
|
|
projectId: that.$store.state.projectId,
|
|
- clientId: that.id,
|
|
|
|
jsonData: JSON.stringify(jsonData),
|
|
jsonData: JSON.stringify(jsonData),
|
|
};
|
|
};
|
|
console.info("save", data);
|
|
console.info("save", data);
|
|
//return;
|
|
//return;
|
|
- ModifySaClient(data).then((res) => {
|
|
|
|
- console.info("ModifySaClient", res);
|
|
|
|
|
|
+ AddSaClient(data).then((res) => {
|
|
|
|
+ console.info("AddSaClient", res);
|
|
if (res.result) {
|
|
if (res.result) {
|
|
if (res.msg == null) {
|
|
if (res.msg == null) {
|
|
that.$router.go(-1);
|
|
that.$router.go(-1);
|