Browse Source

居民新增接口联调

add_resi
mk 1 year ago
parent
commit
a11b812153
  1. 4
      app.json
  2. 2
      project.private.config.json
  3. 2
      subpages/OCRCard/pages/index/index.js
  4. 109
      subpages/addResi/component/expandForm/index.js
  5. 6
      subpages/addResi/component/expandForm/index.wxml
  6. 3
      subpages/addResi/component/expandForm/index.wxss
  7. 132
      subpages/addResi/pages/addResi/addResi.js
  8. 12
      subpages/addResi/pages/addResi/addResi.wxml
  9. 2
      subpages/demandCheck/pages/dissatisfied/searchResi/searchResi.js
  10. 2
      subpages/searchResult/pages/searchResult/searchResult.js
  11. 4
      utils/api.js
  12. 4
      utils/config.js

4
app.json

@ -156,9 +156,7 @@
"getLocation",
"chooseLocation"
],
"navigateToMiniProgramAppIdList": [
"wx50ebeb95943868cd"
],
"networkTimeout": {
"request": 60000
},

2
project.private.config.json

@ -263,5 +263,5 @@
]
}
},
"libVersion": "3.1.5"
"libVersion": "2.19.6"
}

2
subpages/OCRCard/pages/index/index.js

@ -71,7 +71,7 @@ Page({
getTable: async function (type){
let parm ={
searchKey:this.data.keyWord,
name:this.data.keyWord,
pageSize:10,
pageNo:1
}

109
subpages/addResi/component/expandForm/index.js

@ -20,97 +20,16 @@ Component({
* 组件的初始数据
*/
data: {
form:{
// 党员信息
parymemberInfoDto: {
joinTime: null,
positiveTime: null,
partyOrgId: null,
flowFlag: null,
flowActNum: null,
partyJob: null,
duty: null,
retiredFlag: null,
centerFlag: null,
studyNotNeed: null,
joinBranchName: null,
joinCommunityTime: null
},
// 残疾信息
healthDto: {
disabilityCategoryCode: null,
disabilityLevel: null,
disabilityNum: null,
disabilityDesc: null,
guardianFlag: null,
guardianName: null,
guardianMobile:null,
specialSkillFlag: null,
workCapacityFlag: null
},
// 大病信息
seriousIllnessDto: {
illnessCodes: []
},
// 慢病信息
chronicDiseaseDto: {
chronicDiseaseCodes: []
},
// 死亡信息
deathDto: {
deathTime: null
},
// 老年人
oldPeopleDto: {
oldPeopleCategories: [],
resideSituation: null,
oldSubsidy: null
},
// 低保人员
subsistenceAllowanceDto: {
reasons: [],
category:null ,
},
// 退役军人
veteranDto: {
joinArmyTime: null,
leaveArmyTime: null,
serviceUnit: null,
receiveUnit: null,
settlementAmount: null,
trainDesc: null,
employmentSituation: null,
pubWelfareJobFlag: null
},
// 保障房人员
ensureHouseDto: {
liveCommunity: null,
housingNature: null
},
// 统战人员
unitedFrontDto: {
unitedFrontType: null
},
//特扶人员
specialSupportDto: {
specialSupportType: null,//特扶类别
childName: null,//子女姓名
childGender: null,//子女性别
childDeathDate: null,//子女死亡日期
childDisabilityCategoryCode: null,//伤残类别
childDisabilityLevel: null,//伤残等级
},
// 志愿者
volunteerDto: {
volunteerCategory: []
},
},
formType:null
},
// onReady(){
// },
ready: async function () {
console.log(this.data.formList);
if(this.data.formList && this.data.formList.length >0){
this.setData({
formType:this.data.formList[0].formNameP
})
}
},
/**
* 组件的方法列表
@ -134,10 +53,21 @@ Component({
})
},
radioChange(e){
console.log(e);
const selectedIndex =Number( e.detail.value);
let formName = e.currentTarget.dataset.formname;
let formValue = Number(e.detail.value);
let formNameP = e.currentTarget.dataset.formnamep;
this.triggerEvent('changExpandForm',{formName,formNameP,formValue})
this.setData({
'formList': this.data.formList.map(item => {
if (item.formName === formName) {
return { ...item, selectLabel: selectedIndex };
} else {
return item;
}})
})
console.log(this.data.formList);
},
bindinput(e){
let formName = e.currentTarget.dataset.formname;
@ -167,10 +97,11 @@ Component({
},
hideForm(){
this.triggerEvent('hideExpandForm')
this.triggerEvent('hideExpandForm',{formType:this.data.formType})
},
confirm(){
this.triggerEvent('confirmExpandForm')
console.log(this.data.formList);
this.triggerEvent('confirmExpandForm',{formList:this.data.formList,formType:this.data.formType})
},

6
subpages/addResi/component/expandForm/index.wxml

@ -17,9 +17,9 @@
<view class="form_item" wx:if="{{itemP.itemType == 'radio'}}">
<view class="form_item_label">{{itemP.label}}</view>
<radio-group bindchange="radioChange" data-formNameP="{{itemP.formNameP}}" data-formName="{{itemP.formName}}" data-opction="{{itemP.opction}}" class="form_item_input_radio">
<label class="weui-cell weui-check__label" wx:for="{{itemP.opction}}" wx:key="{{itemP.value}}">
<label class="weui-cell weui-check__label" wx:for="{{itemP.opction}}" wx:key="{{itemP.value}}" >
<view class="weui-cell__hd">
<radio value="{{item.value}}" checked="true" />
<radio value="{{item.value}}" checked="{{itemP.selectLabel === 1?true:false}}" />
</view>
<view class="weui-cell__bd">{{item.label}}</view>
</label>
@ -29,7 +29,7 @@
<view class="form_item" wx:if="{{itemP.itemType == 'input'}}">
<view class="form_item_label">{{itemP.label}}</view>
<view class="form_item_input">
<input confirm-type="next" bindblur="bindinput" bindinput="bindinput" value="{{form[itemP.id][itemP.formName]}}" data-formNameP="{{itemP.formNameP}}" data-formName="{{itemP.formName}}" placeholder-class="gray" placeholder="请输入" />
<input confirm-type="next" bindblur="bindinput" bindinput="bindinput" value="{{fitemP.selectLabel}}" data-formNameP="{{itemP.formNameP}}" data-formName="{{itemP.formName}}" placeholder-class="gray" placeholder="请输入" />
</view>
</view>
<!-- 复选框 -->

3
subpages/addResi/component/expandForm/index.wxss

@ -85,8 +85,7 @@
transform: translateX(-50%);
padding: 12rpx 90rpx;
box-sizing: border-box;
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
.bot_btn .bottom_btn{
width: 240rpx;

132
subpages/addResi/pages/addResi/addResi.js

@ -52,7 +52,7 @@ Page({
activeIcon: 'arrow',
},
], //步骤条数据
activeForm: 0,
activeForm: 3,
/** 步骤条状态 */
form: {
baseInfoDto: {
@ -760,50 +760,49 @@ Page({
},
nextStep: async function () {
if (this.data.activeForm === 0) {
// if (!this.data.form.gridId) {
// this.showToast('请选择所在网格')
// return
// }
// if (!this.data.form.villageId) {
// this.showToast('请选择所在小区')
// return
// }
// if (!this.data.form.buildId) {
// this.showToast('请选择所在楼栋')
// return
// }
// if (!this.data.form.unitId) {
// this.showToast('请选择所在单元')
// return
// }
// if (!this.data.form.homeId) {
// this.showToast('请选择所在房屋')
// return
// }
let gridId = this.data.form.resideInfoDtos.filter(obj => !obj.gridId);
let villageId = this.data.form.resideInfoDtos.filter(obj => !obj.villageId);
let buildingId = this.data.form.resideInfoDtos.filter(obj => !obj.buildId);
let unitId = this.data.form.resideInfoDtos.filter(obj => !obj.unitId);
let houseId = this.data.form.resideInfoDtos.filter(obj => !obj.houseId);
if(gridId.length>=1){
this.showToast('请选择所属组织')
return false
}else if (villageId.length>=1){
this.showToast('请选择所在小区')
return false
}else if (buildingId.length>=1){
this.showToast('请选择所在楼栋')
return false
}else if(unitId.length>=1){
this.showToast('请选择所在单元')
}else if(houseId.legnth>= 1){
this.showToast('请选择所在门牌号')
}
this.setData({
activeForm: 1
})
} else if (this.data.activeForm === 1) {
// if (!this.data.form.name) {
// this.showToast('请填写姓名')
// return
// }
// if (!this.data.form.idNum) {
// this.showToast('请填写证件号')
// return
// }
// if (!this.data.form.birthday) {
// this.showToast('请选择出生日期')
// return
// }
// if (!this.data.form.gender) {
// this.showToast('请选择性别')
// return
// }
// if (!this.data.form.mobile) {
// this.showToast('请填写联系电话')
// return
// }
if (!this.data.form.baseInfoDto.name) {
this.showToast('请填写姓名')
return
}
if (!this.data.form.baseInfoDto.idNum) {
this.showToast('请填写证件号')
return
}
if (!this.data.form.baseInfoDto.birthday) {
this.showToast('请选择出生日期')
return
}
if (!this.data.form.baseInfoDto.gender) {
this.showToast('请选择性别')
return
}
if (!this.data.form.baseInfoDto.mobile) {
this.showToast('请填写联系电话')
return
}
this.setData({
activeForm: 2
})
@ -812,12 +811,7 @@ Page({
activeForm: 3
})
}
console.log(this.data.form);
// console.log(this.data.isShowIdNum,this.data.formType != 'edit')
// const parm = {
// ...this.data.form,
@ -863,6 +857,13 @@ Page({
// }
// }
},
showToast(title) {
wx.showToast({
title: title,
duration: 2000,
icon: 'none'
})
},
async getDicts() {
try {
const requests = [
@ -1176,7 +1177,7 @@ Page({
bindPickerChangeGender(e) {
this.setData({
genderName: this.data.dicts.genderList[e.detail.value].label,
"form.gender": this.data.dicts.genderList[e.detail.value].value
"form.baseInfoDto.gender": this.data.dicts.genderList[e.detail.value].value
})
},
bindDateChange(e) {
@ -1317,7 +1318,7 @@ Page({
//**人员标签start */
bindPartyFlag(e){
this.setData({
'form.baseInfoDto.categoryInfo.partyFlag':e.detail.value
'form.baseInfoDto.categoryInfo.partyFlag':Number(e.detail.value)
})
},
bindSpecialCategory(e){
@ -1391,18 +1392,27 @@ Page({
console.log(error, `获取 ${opctionParams.dictType} 字典`);
}
},
hideExpandForm() {
hideExpandForm(e) {
let form = this.data.form;
delete form[e.detail.formType]
console.log(form);
this.setData({
showExpand: false
showExpand: false,
form
})
},
confirmExpandForm() {
confirmExpandForm(e) {
let orgListCopy = this.data.orgList
orgListCopy.forEach(item=>{
if(item.id === e.detail.formType){
item.children = e.detail.formList
}
})
this.setData({
showExpand: false
})
},
changExpandForm(e){
console.log(e);
this.setData({
['form.' + e.detail.formNameP+'.'+ e.detail.formName]:e.detail.formValue
})
@ -1420,7 +1430,23 @@ Page({
delete item.optionsV
})
api.submitResi(form).then(res=>{
console.log(res);
if(res.code === 0){
wx.showToast({
title: '新增成功',
duration: 3000,
success: function () {
setTimeout(() => {
wx.navigateBack({
delta: 1
})
}, 3000)
}
})
}else{
wx.showToast({
title: res.msg,
})
}
})
console.log(this.data.form);
}

12
subpages/addResi/pages/addResi/addResi.wxml

@ -66,7 +66,7 @@
<view class="form_item">
<view class="label ">
<text class="must">*</text>
<view class="title">所在房屋</view>
<view class="title">门牌号</view>
</view>
<view class="input">
<picker bindchange="bindPickerChangeHouse" range-key="label" value="{{index}}" range="{{form.resideInfoDtos[indexP].optionsH}}" data-indexP="{{indexP}}">
@ -538,11 +538,17 @@
<view class="input">
<radio-group class="radio_group" bindchange="bindPartyFlag">
<radio value="0" checked="true" color="#3974f6" />群众
<radio value="1" checked="true" color="#3974f6" />党员
<radio value="2" checked="true" color="#3974f6" />共青团员
<radio value="1" color="#3974f6" />党员
<radio value="2"color="#3974f6" />共青团员
</radio-group>
</view>
</view>
<view wx:if="{{form.baseInfoDto.categoryInfo.partyFlag === 1}}">
<view class="detail" bindtap="showDetailForm" data-title="党员信息" data-dto="parymemberInfoDto">
<text>党员信息</text>
<image src="../../../../images/right.png" mode="" />
</view>
</view>
</view>
<view class="form_card">
<view class="title">

2
subpages/demandCheck/pages/dissatisfied/searchResi/searchResi.js

@ -48,7 +48,7 @@ Page({
loadMoreType: "more",
})
let parm ={
searchKey:this.data.keyWord,
name:this.data.keyWord,
pageSize:this.data.pageSize,
pageNo:this.data.pageNo
}

2
subpages/searchResult/pages/searchResult/searchResult.js

@ -91,7 +91,7 @@ Page({
loadMoreType: "more",
})
let parm ={
searchKey:this.data.keyWord,
name:this.data.keyWord,
pageSize:this.data.pageSize,
pageNo:this.data.pageNo
}

4
utils/api.js

@ -100,7 +100,7 @@ function logout() {
}
// 居民查询
function getResidentBaseInfo(para) {
return fly.post('actual/base/residentBaseInfo/residentSearch', para)
return fly.post('actual/base/residentBaseInfo/page', para)
}
// 房屋查询
function getCommunityHouse(para) {
@ -324,6 +324,6 @@ function updateEvent(parm) {
}
function submitResi(parm) {
return fly.post(`governance/icEventOld/update`,parm)
return fly.post(`actual/base/residentBaseInfo/save`,parm)
}

4
utils/config.js

@ -5,8 +5,8 @@ module.exports = {
};
function BASEURL() {
return 'https://epmet-preview.elinkservice.cn/api/' // 演示环境
// return 'http://192.168.1.144/api/' //测试环境
// return 'https://epmet-preview.elinkservice.cn/api/' // 演示环境
return 'http://192.168.1.144/api/' //测试环境
}

Loading…
Cancel
Save