|
@@ -31,6 +31,14 @@ Page({
|
|
|
peopleNum: 1,
|
|
|
causeMatterName: '',
|
|
|
},
|
|
|
+ // 保存用户填写的最后信息
|
|
|
+ formInfo: {
|
|
|
+ visitorPhone: '',
|
|
|
+ visitorUnit: '',
|
|
|
+ carnum: '',
|
|
|
+ peopleNum: 1,
|
|
|
+ causeMatterName: '',
|
|
|
+ },
|
|
|
// 事由
|
|
|
causeMatterList: [
|
|
|
/*{
|
|
@@ -172,7 +180,7 @@ Page({
|
|
|
historyPagNum: 1, //当前页数
|
|
|
historyPageSize: 0, //总页数
|
|
|
isHistory: true,
|
|
|
- historyList: []
|
|
|
+ historyList: [],
|
|
|
},
|
|
|
onLoad() {
|
|
|
my.hideBackHome();
|
|
@@ -200,6 +208,7 @@ Page({
|
|
|
'remainingInfo.visitorUnit': app.data.userInfo.visitorUnit || '',
|
|
|
carnum: app.data.userInfo.carnum || '',
|
|
|
'remainingInfo.causeMatterName': visitReasonList.length > 0 ? visitReasonList[0] : '',
|
|
|
+ 'formInfo.causeMatterName': visitReasonList.length > 0 ? visitReasonList[0] : '',
|
|
|
})
|
|
|
console.log(visitReasonList)
|
|
|
// ⾃然⼈⻛险评分查询
|
|
@@ -231,11 +240,11 @@ Page({
|
|
|
try {
|
|
|
let params = {
|
|
|
data : {
|
|
|
- certNo: "362330199801077198",
|
|
|
- sn: "118D002000500012",
|
|
|
-
|
|
|
// "certNo": this.data.remainingInfo.visitorIdCard,
|
|
|
// sn: app.globalData.sn,
|
|
|
+
|
|
|
+ "certNo": "362330199801077198",
|
|
|
+ sn: "118D002000500012",
|
|
|
},
|
|
|
pageNum: historyPagNum ? historyPagNum : 1,
|
|
|
pageSize: 2
|
|
@@ -334,6 +343,7 @@ Page({
|
|
|
item.info2.isSel = false
|
|
|
if (index == idx) {
|
|
|
this.setData({
|
|
|
+ carnum: item.info1.carnum,
|
|
|
remainingInfo: {
|
|
|
...this.data.remainingInfo,
|
|
|
...item.info1
|
|
@@ -356,10 +366,57 @@ Page({
|
|
|
}
|
|
|
return item; // 其他项保持不变
|
|
|
});
|
|
|
+ this.setData({
|
|
|
+ historyList: items,
|
|
|
+ }); // 更新数据状态
|
|
|
+ },
|
|
|
+ // 选择访客 单独控制
|
|
|
+ selInfo1: function (e){
|
|
|
+ let visitReasonList = (app.globalData.snDisposition.visitReason || '业务拜访/会议邀请/施工单位/其他事项').split('/')
|
|
|
+ const idx = e.currentTarget.dataset.index; // 获取被点击项的下标
|
|
|
+ const items = this.data.historyList.map((item,index) => {
|
|
|
+ if (index == idx) {
|
|
|
+ if(!item.info1.isSel){
|
|
|
+ this.setData({
|
|
|
+ carnum: item.info1.carnum,
|
|
|
+ remainingInfo:{
|
|
|
+ ...this.data.remainingInfo,
|
|
|
+ ...item.info1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ this.defaultFormInfo()
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ info1:{
|
|
|
+ ...item.info1,
|
|
|
+ isSel: !item.info1.isSel // 切换选中状态
|
|
|
+ }
|
|
|
+ };
|
|
|
+ }
|
|
|
+ return item; // 其他项保持不变
|
|
|
+ });
|
|
|
this.setData({
|
|
|
historyList: items
|
|
|
}); // 更新数据状态
|
|
|
},
|
|
|
+ defaultFormInfo(){
|
|
|
+ console.log(this.data.formInfo)
|
|
|
+ this.setData({
|
|
|
+ carnum: this.data.formInfo.carnum || '',
|
|
|
+ remainingInfo:{
|
|
|
+ ...this.data.formInfo
|
|
|
+ // 'visitorPhone': app.data.userInfo.phone || app.data.inputPhone,
|
|
|
+ // 'visitorName': app.data.userInfo.xm,
|
|
|
+ // 'visitorIdCard': app.data.userInfo.sfzh,
|
|
|
+ // 'avatar': app.data.userInfo.avatar,
|
|
|
+ // 'idCardPhoto': app.data.userInfo.idCardPhoto,
|
|
|
+ // 'visitorUnit': app.data.userInfo.visitorUnit || '',
|
|
|
+ // 'causeMatterName': visitReasonList.length > 0 ? visitReasonList[0] : '',
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 选择受访人 单独控制
|
|
|
selInfo2: function (e){
|
|
|
const idx = e.currentTarget.dataset.index; // 获取被点击项的下标
|
|
@@ -384,14 +441,12 @@ Page({
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
- // console.log(item)
|
|
|
return item; // 其他项保持不变
|
|
|
});
|
|
|
this.setData({
|
|
|
historyList: items
|
|
|
}); // 更新数据状态
|
|
|
},
|
|
|
-
|
|
|
backEnter(){
|
|
|
this.setData({
|
|
|
isHistory: !this.data.isHistory,
|
|
@@ -434,7 +489,6 @@ Page({
|
|
|
return
|
|
|
}
|
|
|
let decrypted = JSON.parse(decryptedData.decrypted)
|
|
|
- // console.log(222, decrypted);
|
|
|
if (!decrypted.result) {
|
|
|
app.globalData.riskResult = 1
|
|
|
} else if (decrypted.resultInfo.personFxpfjx && decrypted.resultInfo.personFxpfjx[4] == 1) {
|
|
@@ -498,9 +552,41 @@ Page({
|
|
|
let type = e.target.dataset.type
|
|
|
let val = e.detail.value
|
|
|
let key = `remainingInfo.${type}`
|
|
|
+ let formKey = `formInfo.${type}`
|
|
|
this.setData({
|
|
|
[key]: val,
|
|
|
+ [formKey]: val
|
|
|
})
|
|
|
+
|
|
|
+ console.log(this.data.historyList)
|
|
|
+ if(this.data.historyList.length>0){
|
|
|
+ this.data.historyList.forEach(item=>{
|
|
|
+ item.info1.isSel = false
|
|
|
+ })
|
|
|
+
|
|
|
+ this.setData({
|
|
|
+ historyList: this.data.historyList
|
|
|
+ })
|
|
|
+
|
|
|
+ // let array = this.data.historyList.map(item=>{
|
|
|
+ // console.log(item)
|
|
|
+ // if(item.info1.isSel){
|
|
|
+ // return {
|
|
|
+ // ...item,
|
|
|
+ // info1:{
|
|
|
+ // ...item.info1,
|
|
|
+ // isSel: !item.info1.isSel
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }else{
|
|
|
+
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+
|
|
|
+ // this.setData({
|
|
|
+ // historyList: array
|
|
|
+ // })
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
// 事由
|
|
@@ -522,6 +608,7 @@ Page({
|
|
|
let item = e.currentTarget.dataset.item
|
|
|
this.setData({
|
|
|
'remainingInfo.causeMatterName': item,
|
|
|
+ 'formInfo.causeMatterName': item,
|
|
|
isShowCauseMatter: false
|
|
|
})
|
|
|
},
|