|
|
@ -1,9 +1,354 @@ |
|
|
|
// subpages/addResi/pages/addResi/addResi.js
|
|
|
|
import api from "../../../../utils/api" |
|
|
|
import {$wuxSelect} from '../../../../components/dist/index' |
|
|
|
import { |
|
|
|
dictlist, |
|
|
|
getHouseType, getOldPeopleDetailById, |
|
|
|
getVeteranDetailById, getVolunteerDetailById, publicWelfarePost, |
|
|
|
residentEnsureHouse, residentSpecial, residentTenant, |
|
|
|
residentUnemployed, residentUnitedFront, specialSupport |
|
|
|
} from "../../../../utils/statisticsApi"; |
|
|
|
|
|
|
|
const app = getApp() |
|
|
|
Page({ |
|
|
|
data: { |
|
|
|
formController: [], |
|
|
|
ensureHouseFlagOpen: false, |
|
|
|
unemployedFlagOpen: false, |
|
|
|
veteranFlagOpen: false, |
|
|
|
unitedFrontFlagOpen: false, |
|
|
|
volunteerFlagOpen: false, |
|
|
|
specialSupportFlagOpen: false, |
|
|
|
tenantFlagOpen: false, |
|
|
|
specialCrowdFlagOpen: false, |
|
|
|
oldPeopleFlagOpen: false, |
|
|
|
publicWelfareFlagOpen: false, |
|
|
|
residentTypeForm: { |
|
|
|
ensureHouseFlag: [ |
|
|
|
{ |
|
|
|
type: 'select', |
|
|
|
value: "", |
|
|
|
valueIndex: -1, |
|
|
|
label: '住房性质', |
|
|
|
optionsKey: 'label', |
|
|
|
valueKey: 'value', |
|
|
|
options: [], // 字典获取
|
|
|
|
key: 'housingNature' |
|
|
|
}, { |
|
|
|
type: 'input', |
|
|
|
value: '', |
|
|
|
label: '保障类型', |
|
|
|
key: 'securityType' |
|
|
|
}, { |
|
|
|
type: 'date', |
|
|
|
value: "", |
|
|
|
label: '发证日期', |
|
|
|
key: 'certificateDate' |
|
|
|
}, { |
|
|
|
type: 'input', |
|
|
|
value: '', |
|
|
|
label: '补贴编号', |
|
|
|
key: 'subsidyNum' |
|
|
|
}, { |
|
|
|
type: 'input', |
|
|
|
value: '', |
|
|
|
label: '补贴金额', |
|
|
|
afterText: "元", |
|
|
|
key: 'subsidyAmount' |
|
|
|
}, { |
|
|
|
type: 'input', |
|
|
|
value: '', |
|
|
|
label: '房东姓名', |
|
|
|
key: 'landlordName' |
|
|
|
}, { |
|
|
|
type: 'input', |
|
|
|
value: '', |
|
|
|
label: '房东证件号', |
|
|
|
key: 'landlordIdNum' |
|
|
|
}, { |
|
|
|
type: 'date', |
|
|
|
value: "", |
|
|
|
label: '通知书领取日期', |
|
|
|
key: 'notificationRcvDate' |
|
|
|
}, |
|
|
|
], |
|
|
|
unemployedFlag: [ |
|
|
|
{ |
|
|
|
type: 'input', |
|
|
|
value: '', |
|
|
|
label: '原工作单位', |
|
|
|
key: 'originWorkUnit' |
|
|
|
}, { |
|
|
|
type: 'date', |
|
|
|
value: '', |
|
|
|
label: '失业时间', |
|
|
|
key: 'unemploymentTime' |
|
|
|
}, { |
|
|
|
type: 'input', |
|
|
|
value: '', |
|
|
|
label: '失业证号', |
|
|
|
key: 'unemploymentNum' |
|
|
|
}, { |
|
|
|
type: 'input', |
|
|
|
value: '', |
|
|
|
label: '再就业优惠证号', |
|
|
|
key: 'employmentNum' |
|
|
|
}, { |
|
|
|
type: 'input', |
|
|
|
value: '', |
|
|
|
label: '技术特长', |
|
|
|
key: 'specialSkill' |
|
|
|
}, { |
|
|
|
type: 'select', |
|
|
|
value: "", |
|
|
|
valueIndex: -1, |
|
|
|
label: '失业原因', |
|
|
|
optionsKey: 'label', |
|
|
|
valueKey: 'value', |
|
|
|
options: [], // 字典获取
|
|
|
|
key: 'unemploymentReason' |
|
|
|
}, { |
|
|
|
type: 'select', |
|
|
|
value: "", |
|
|
|
valueIndex: -1, |
|
|
|
label: '是否就业困难对象', |
|
|
|
optionsKey: 'label', |
|
|
|
valueKey: 'value', |
|
|
|
options: [{ |
|
|
|
value: 1, |
|
|
|
label: '是' |
|
|
|
}, { |
|
|
|
value: 0, |
|
|
|
label: '否' |
|
|
|
}], |
|
|
|
key: 'employmentHardFlag' |
|
|
|
}, { |
|
|
|
type: 'select', |
|
|
|
value: "", |
|
|
|
valueIndex: -1, |
|
|
|
label: '劳动能力就业愿望', |
|
|
|
optionsKey: 'label', |
|
|
|
valueKey: 'value', |
|
|
|
options: [], // 字典获取
|
|
|
|
key: 'employmentWish' |
|
|
|
}, |
|
|
|
], |
|
|
|
veteranFlag: [ |
|
|
|
{ |
|
|
|
type: 'date', |
|
|
|
value: '', |
|
|
|
label: '入伍时间', |
|
|
|
key: 'joinArmyTime' |
|
|
|
}, { |
|
|
|
type: 'date', |
|
|
|
value: '', |
|
|
|
label: '退伍时间', |
|
|
|
key: 'leaveArmyTime' |
|
|
|
}, { |
|
|
|
type: 'input', |
|
|
|
value: '', |
|
|
|
label: '服役单位', |
|
|
|
key: 'serviceUnit' |
|
|
|
}, { |
|
|
|
type: 'input', |
|
|
|
value: '', |
|
|
|
label: '接收单位', |
|
|
|
key: 'receiveUnit' |
|
|
|
}, { |
|
|
|
type: 'input', |
|
|
|
value: '', |
|
|
|
label: '待安置补助金', |
|
|
|
afterText: '元', |
|
|
|
key: 'settlementAmount' |
|
|
|
}, { |
|
|
|
type: 'input', |
|
|
|
value: '', |
|
|
|
label: '培训状况', |
|
|
|
key: 'trainDesc' |
|
|
|
}, { |
|
|
|
type: 'input', |
|
|
|
value: '', |
|
|
|
label: '现就业情况', |
|
|
|
key: 'employmentSituation' |
|
|
|
}, { |
|
|
|
type: 'select', |
|
|
|
value: "", |
|
|
|
valueIndex: -1, |
|
|
|
label: '是否办理公益性岗位', |
|
|
|
optionsKey: 'label', |
|
|
|
valueKey: 'value', |
|
|
|
options: [{ |
|
|
|
value: 1, |
|
|
|
label: '是' |
|
|
|
}, { |
|
|
|
value: 0, |
|
|
|
label: '否' |
|
|
|
}], |
|
|
|
key: 'pubWelfareJobFlag' |
|
|
|
}, |
|
|
|
], |
|
|
|
unitedFrontFlag: [ |
|
|
|
{ |
|
|
|
type: 'input', |
|
|
|
value: '', |
|
|
|
label: '职务', |
|
|
|
key: 'duty' |
|
|
|
}, { |
|
|
|
type: 'input', |
|
|
|
value: '', |
|
|
|
label: '探亲情况', |
|
|
|
key: 'visitation' |
|
|
|
} |
|
|
|
], |
|
|
|
volunteerFlag: [ |
|
|
|
{ |
|
|
|
type: 'checkbox', |
|
|
|
value: '', |
|
|
|
label: '志愿者类别', |
|
|
|
key: 'volunteerCategory' |
|
|
|
}, { |
|
|
|
type: 'textarea', |
|
|
|
value: '', |
|
|
|
maxlength: 120, |
|
|
|
label: '备注', |
|
|
|
key: 'volunteerRemark' |
|
|
|
}, |
|
|
|
], |
|
|
|
specialSupportFlag: [ |
|
|
|
{ |
|
|
|
type: 'select', |
|
|
|
value: "", |
|
|
|
valueIndex: -1, |
|
|
|
label: '特扶类别', |
|
|
|
optionsKey: 'label', |
|
|
|
valueKey: 'value', |
|
|
|
options: [ |
|
|
|
{ |
|
|
|
value: '1', |
|
|
|
label: '失独' |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: '2', |
|
|
|
label: '伤残' |
|
|
|
} |
|
|
|
], // 字典
|
|
|
|
key: 'specialSupportType', |
|
|
|
masterControl: true |
|
|
|
}, { |
|
|
|
type: 'input', |
|
|
|
value: "", |
|
|
|
label: '子女姓名', |
|
|
|
key: 'childName', |
|
|
|
showFlag: '2', |
|
|
|
hide: true |
|
|
|
}, { |
|
|
|
type: 'select', |
|
|
|
value: "", |
|
|
|
valueIndex: -1, |
|
|
|
label: '子女性别', |
|
|
|
optionsKey: 'label', |
|
|
|
valueKey: 'value', |
|
|
|
options: [ |
|
|
|
{ |
|
|
|
value: '1', |
|
|
|
label: '男' |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: '2', |
|
|
|
label: '女' |
|
|
|
} |
|
|
|
], // 字典
|
|
|
|
key: 'childGender' |
|
|
|
}, { |
|
|
|
type: 'date', |
|
|
|
value: "", |
|
|
|
label: '子女死亡日期', |
|
|
|
key: 'childDeathDate', |
|
|
|
showFlag: '1', |
|
|
|
hide: true |
|
|
|
}, { |
|
|
|
type: 'select', |
|
|
|
value: "", |
|
|
|
valueIndex: -1, |
|
|
|
label: '伤残类别', |
|
|
|
optionsKey: 'label', |
|
|
|
valueKey: 'value', |
|
|
|
options: [], // 字典
|
|
|
|
key: 'childDisabilityCategoryCode', |
|
|
|
showFlag: '2', |
|
|
|
hide: true |
|
|
|
}, { |
|
|
|
type: 'select', |
|
|
|
value: "", |
|
|
|
valueIndex: -1, |
|
|
|
label: '伤残等级', |
|
|
|
optionsKey: 'label', |
|
|
|
valueKey: 'value', |
|
|
|
options: [], // 字典
|
|
|
|
key: 'childDisabilityLevel', |
|
|
|
showFlag: '2', |
|
|
|
hide: true |
|
|
|
}, { |
|
|
|
type: 'textarea', |
|
|
|
value: '', |
|
|
|
maxlength: 120, |
|
|
|
label: '备注', |
|
|
|
key: 'remark' |
|
|
|
}, |
|
|
|
], |
|
|
|
tenantFlag: [ |
|
|
|
{ |
|
|
|
type: 'date', |
|
|
|
value: "", |
|
|
|
label: '合同开始时间', |
|
|
|
key: 'contractStartDate' |
|
|
|
}, { |
|
|
|
type: 'date', |
|
|
|
value: "", |
|
|
|
label: '合同结束时间', |
|
|
|
key: 'contractEndDate' |
|
|
|
},], |
|
|
|
specialCrowdFlag: [ |
|
|
|
{ |
|
|
|
type: 'select', |
|
|
|
value: "", |
|
|
|
valueIndex: -1, |
|
|
|
label: '人群类别', |
|
|
|
optionsKey: 'label', |
|
|
|
valueKey: 'value', |
|
|
|
options: [], // 字典
|
|
|
|
key: 'specialCategoryCode' |
|
|
|
}], |
|
|
|
oldPeopleFlag: [ |
|
|
|
{ |
|
|
|
type: 'input', |
|
|
|
value: '', |
|
|
|
label: '高龄补助', |
|
|
|
afterText: '元', |
|
|
|
key: 'oldSubsidy' |
|
|
|
}], |
|
|
|
publicWelfareFlag: [ |
|
|
|
{ |
|
|
|
type: 'date', |
|
|
|
value: "", |
|
|
|
label: '入职时间', |
|
|
|
key: 'hireData' |
|
|
|
}, { |
|
|
|
type: 'checkbox', |
|
|
|
value: "", |
|
|
|
valueIndex: -1, |
|
|
|
label: '岗位类型', |
|
|
|
optionsKey: 'label', |
|
|
|
valueKey: 'value', |
|
|
|
options: [], // 字典
|
|
|
|
key: 'postTypes' |
|
|
|
}, { |
|
|
|
type: '', |
|
|
|
value: "", |
|
|
|
key: 'userId' |
|
|
|
}], |
|
|
|
}, |
|
|
|
residentTypeFormCell: [], |
|
|
|
nation: [], |
|
|
|
education: [], |
|
|
|
marriageList: [], |
|
|
@ -37,7 +382,7 @@ Page({ |
|
|
|
unitedFrontFlag: 0, |
|
|
|
petitionOfficerFlag: "", |
|
|
|
volunteerFlag: 0, |
|
|
|
bereavedPersonFlag: 0, |
|
|
|
specialSupportFlag: 0, |
|
|
|
tenantFlag: 0, |
|
|
|
floatingFlag: 0, |
|
|
|
specialCrowdFlag: 0, |
|
|
@ -87,18 +432,18 @@ Page({ |
|
|
|
residentCategory: [ |
|
|
|
{title: '党员', value: 'partyFlag'}, |
|
|
|
{title: '低保人员', value: 'subsistenceAllowanceFlag'}, |
|
|
|
{ title: '保障房人员', value: 'ensureHouseFlag'}, |
|
|
|
{ title: '失业人员', value: 'unemployedFlag'}, |
|
|
|
{title: '保障房人员', value: 'ensureHouseFlag', isForm: true}, |
|
|
|
{title: '失业人员', value: 'unemployedFlag', isForm: true}, |
|
|
|
{title: '育龄妇女', value: 'fertileWomanFlag'}, |
|
|
|
{ title: '退役军人', value: 'veteranFlag'}, |
|
|
|
{ title: '统战人员', value: 'unitedFrontFlag'}, |
|
|
|
{title: '退役军人', value: 'veteranFlag', isForm: true}, |
|
|
|
{title: '统战人员', value: 'unitedFrontFlag', isForm: true}, |
|
|
|
{title: '信访人员', value: 'petitionOfficerFlag'}, |
|
|
|
{ title: '志愿者', value: 'volunteerFlag' }, |
|
|
|
{ title: '特扶人员', value: 'bereavedPersonFlag' }, |
|
|
|
{ title: '租户', value: 'tenantFlag'}, |
|
|
|
{title: '志愿者', value: 'volunteerFlag', isForm: true}, |
|
|
|
{title: '特扶人员', value: 'specialSupportFlag', isForm: true}, |
|
|
|
{title: '租户', value: 'tenantFlag', isForm: true}, |
|
|
|
{title: '流动人口', value: 'floatingFlag'}, |
|
|
|
{ title: '特殊人群', value: 'specialCrowdFlag' }, |
|
|
|
{ title: '老年人', value: 'oldPeopleFlag'}, |
|
|
|
{title: '特殊人群', value: 'specialCrowdFlag', isForm: true}, |
|
|
|
{title: '老年人', value: 'oldPeopleFlag', isForm: true}, |
|
|
|
{title: '空巢老人', value: 'emptyNesterFlag'}, |
|
|
|
{title: '独居老人', value: 'liveAloneFlag'}, |
|
|
|
{title: '失能老人', value: 'disabledFlag'}, |
|
|
@ -106,10 +451,12 @@ Page({ |
|
|
|
{title: '残疾', value: 'disabilityFlag'}, |
|
|
|
{title: '大病', value: 'seriousIllnessFlag'}, |
|
|
|
{title: '慢病', value: 'chronicDiseaseFlag'}, |
|
|
|
{ title: '公益岗人员', value: 'publicWelfareFlag' } |
|
|
|
{title: '公益岗人员', value: 'publicWelfareFlag', isForm: true} |
|
|
|
], |
|
|
|
residentCategorySty: '', |
|
|
|
categoryInfo:'' |
|
|
|
categoryInfo: '', |
|
|
|
isShowDynamicForms: false, |
|
|
|
dynamicTitle: " ", |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
@ -182,11 +529,18 @@ Page({ |
|
|
|
let result = this.data.residentCategory.filter(item => categoryInfo[item.value] === 1); |
|
|
|
let residentCategorySty = result.map(item => item.title); |
|
|
|
let categoryInfoArr = result.map(item => item.value); |
|
|
|
this.setDynamicForm(result) |
|
|
|
|
|
|
|
wx.showLoading({ |
|
|
|
title: '加载中...', |
|
|
|
}); |
|
|
|
|
|
|
|
let form = this.data.form |
|
|
|
for (let i in categoryInfoArr) { |
|
|
|
form[categoryInfoArr[i]] = 1 |
|
|
|
} |
|
|
|
this.setData({ |
|
|
|
form |
|
|
|
}) |
|
|
|
this.setDataAsync({ |
|
|
|
'form.name': name, |
|
|
|
'form.birthday': birthday, |
|
|
@ -678,6 +1032,7 @@ Page({ |
|
|
|
options: than.data.residentCategory, |
|
|
|
onChange: (value, index, options) => { |
|
|
|
console.log('onChange', value, index, options) |
|
|
|
|
|
|
|
const matchingLabels = value.map(valueToFind => { |
|
|
|
const matchedItem = than.data.residentCategory.find(item => item.value === valueToFind); |
|
|
|
return matchedItem ? matchedItem.title : null; |
|
|
@ -702,6 +1057,11 @@ Page({ |
|
|
|
title3: index.map((n) => options[n].title), |
|
|
|
form: updatedForm |
|
|
|
}) |
|
|
|
let residentTypeFormCell = [] |
|
|
|
index.forEach(item => { |
|
|
|
residentTypeFormCell.push(this.data.residentCategory[item]) |
|
|
|
}) |
|
|
|
this.setDynamicForm(residentTypeFormCell) |
|
|
|
console.log(this.data.form); |
|
|
|
}, |
|
|
|
}) |
|
|
@ -754,7 +1114,19 @@ Page({ |
|
|
|
this.showToast('请填写联系电话') |
|
|
|
return |
|
|
|
} |
|
|
|
const parm = {...this.data.form} |
|
|
|
const parm = { |
|
|
|
...this.data.form, |
|
|
|
ensureHouseDto: this.data.ensureHouseFlagOpen ? this.getValue(this.data.residentTypeForm.ensureHouseFlag) : undefined, |
|
|
|
unemployedDto: this.data.unemployedFlagOpen ? this.getValue(this.data.residentTypeForm.unemployedFlag) : undefined, |
|
|
|
veteranDto: this.data.veteranFlagOpen ? this.getValue(this.data.residentTypeForm.veteranFlag) : undefined, |
|
|
|
unitedFrontDto: this.data.unitedFrontFlagOpen ? this.getValue(this.data.residentTypeForm.unitedFrontFlag) : undefined, |
|
|
|
volunteerDto: this.data.volunteerFlagOpen ? this.getValue(this.data.residentTypeForm.volunteerFlag) : undefined, |
|
|
|
specialSupportDto: this.data.specialSupportFlagOpen ? this.getValue(this.data.residentTypeForm.specialSupportFlag) : undefined, |
|
|
|
tenantDto: this.data.tenantFlagOpen ? this.getValue(this.data.residentTypeForm.tenantFlag) : undefined, |
|
|
|
specialDto: this.data.specialCrowdFlagOpen ? this.getValue(this.data.residentTypeForm.specialCrowdFlag) : undefined, |
|
|
|
oldPeopleDto: this.data.oldPeopleFlagOpen ? this.getValue(this.data.residentTypeForm.oldPeopleFlag) : undefined, |
|
|
|
postDto: this.data.publicWelfareFlagOpen ? this.getValue(this.data.residentTypeForm.publicWelfareFlag) : undefined, |
|
|
|
} |
|
|
|
console.log(this.data.formType); |
|
|
|
if (this.data.formType == 'edit') { |
|
|
|
parm.resiId = this.data.resiId |
|
|
@ -807,5 +1179,190 @@ Page({ |
|
|
|
wx.navigateTo({ |
|
|
|
url: '/subpages/addhouse/pages/addhouse/addhouse', |
|
|
|
}) |
|
|
|
}, |
|
|
|
closeDynamicForms() { |
|
|
|
this.setData({ |
|
|
|
isShowDynamicForms: false |
|
|
|
}) |
|
|
|
}, |
|
|
|
okDynamicForms(e) { |
|
|
|
console.log(e) |
|
|
|
let residentTypeForm = this.data.residentTypeForm |
|
|
|
residentTypeForm[this.data.currentFormController] = e.detail |
|
|
|
this.setData({ |
|
|
|
residentTypeForm |
|
|
|
}) |
|
|
|
}, |
|
|
|
setDynamicForm(data) { |
|
|
|
let residentTypeFormCell = data.filter(item => item.isForm) |
|
|
|
let values = residentTypeFormCell.map(item => item.value) |
|
|
|
// 保障房人员
|
|
|
|
if (values.includes('ensureHouseFlag')) { |
|
|
|
this.getHouseTypes() |
|
|
|
} |
|
|
|
// 失业人员
|
|
|
|
if (values.includes('unemployedFlag')) { |
|
|
|
// 失业原因
|
|
|
|
this.getDictData('unemployment_reason', 'unemploymentReason') |
|
|
|
// 愿望
|
|
|
|
this.getDictData('career_goals', 'employmentWish') |
|
|
|
} |
|
|
|
// 志愿者
|
|
|
|
if (values.includes('volunteerFlag')) { |
|
|
|
// 志愿者类别
|
|
|
|
this.getDictData('VOLUNTEER_CATEGORY', 'volunteerCategory') |
|
|
|
} |
|
|
|
// 特扶
|
|
|
|
if (values.includes('specialSupportFlag')) { |
|
|
|
//获取伤残类别字典
|
|
|
|
this.getDictData('disability_category_code', 'childDisabilityCategoryCode') |
|
|
|
// 获取伤残等级字典
|
|
|
|
this.getDictData('disability_level', 'childDisabilityLevel') |
|
|
|
} |
|
|
|
|
|
|
|
// 特殊人群
|
|
|
|
if (values.includes('specialCrowdFlag')) { |
|
|
|
//人群类别
|
|
|
|
this.getDictData('special_resident_category', 'specialCategoryCode') |
|
|
|
} |
|
|
|
// 公益岗人员
|
|
|
|
if (values.includes('specialCrowdFlag')) { |
|
|
|
//岗位类型
|
|
|
|
this.getDictData('public_welfare_post_type', 'postTypes') |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.setData({residentTypeFormCell}) |
|
|
|
// residentTypeForm
|
|
|
|
}, |
|
|
|
async openDynamicForms(e) { |
|
|
|
var data = {} |
|
|
|
let formtype = e.currentTarget.dataset.formtype |
|
|
|
let id = this.data.resiId |
|
|
|
if (formtype === 'ensureHouseFlag') { |
|
|
|
let res = await residentEnsureHouse(id) |
|
|
|
data = res.data |
|
|
|
} |
|
|
|
if (formtype === 'unemployedFlag') { |
|
|
|
let res = await residentUnemployed(id) |
|
|
|
data = res.data |
|
|
|
} |
|
|
|
if (formtype === 'veteranFlag') { |
|
|
|
let res = await getVeteranDetailById(id) |
|
|
|
data = res.data |
|
|
|
} |
|
|
|
if (formtype === 'unitedFrontFlag') { |
|
|
|
let res = await residentUnitedFront(id) |
|
|
|
data = res.data |
|
|
|
} |
|
|
|
if (formtype === 'volunteerFlag') { |
|
|
|
let res = await getVolunteerDetailById(id) |
|
|
|
data = res.data |
|
|
|
} |
|
|
|
if (formtype === 'specialSupportFlag') { |
|
|
|
let res = await specialSupport(id) |
|
|
|
data = res.data |
|
|
|
} |
|
|
|
if (formtype === 'tenantFlag') { |
|
|
|
let res = await residentTenant(id) |
|
|
|
data = res.data |
|
|
|
} |
|
|
|
if (formtype === 'specialCrowdFlag') { |
|
|
|
let res = await residentSpecial(id) |
|
|
|
data = res.data |
|
|
|
} |
|
|
|
if (formtype === 'oldPeopleFlag') { |
|
|
|
let res = await getOldPeopleDetailById(id) |
|
|
|
data = res.data |
|
|
|
} |
|
|
|
if (formtype === 'publicWelfareFlag') { |
|
|
|
let res = await publicWelfarePost(id) |
|
|
|
data = res.data |
|
|
|
} |
|
|
|
let residentTypeForm = this.data.residentTypeForm |
|
|
|
residentTypeForm[formtype].forEach(item => { |
|
|
|
if(item.key === 'userId') { |
|
|
|
item.value = id |
|
|
|
} |
|
|
|
for (let i in data) { |
|
|
|
if (item.key === i) { |
|
|
|
item.value = data[item.key] |
|
|
|
if (data[item.key]) { |
|
|
|
console.log(data[item.key], 'data[item.key]') |
|
|
|
if (item.type === 'date') { |
|
|
|
item.value = data[item.key].split(' ')[0] |
|
|
|
} |
|
|
|
if (item.type === 'checkbox') { |
|
|
|
let arr = [] |
|
|
|
let value = data[item.key].split(',') |
|
|
|
value.forEach(item2 => { |
|
|
|
arr.push(...item.options.filter(item3 => item3.value === item2)) |
|
|
|
}) |
|
|
|
item.selected = arr.map(item => item.label).join(',') |
|
|
|
} |
|
|
|
if (item.type === 'select') { |
|
|
|
let options = item.options.map(item2 => item2[item.valueKey]) |
|
|
|
item.valueIndex = options.indexOf(item.value) |
|
|
|
if (item.masterControl) { |
|
|
|
residentTypeForm[formtype].forEach(item3 => { |
|
|
|
if (item3.showFlag) { |
|
|
|
if (item3.showFlag === item.value) { |
|
|
|
item3.hide = false |
|
|
|
} else { |
|
|
|
item3.hide = true |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
item.valueIndex = -1 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
this.setData({ |
|
|
|
residentTypeForm, |
|
|
|
[formtype + 'Open']: true, |
|
|
|
dynamicFormsTitle: '填写' + e.currentTarget.dataset.title, |
|
|
|
currentFormController: formtype, |
|
|
|
formController: this.data.residentTypeForm[e.currentTarget.dataset.formtype], |
|
|
|
isShowDynamicForms: true |
|
|
|
}) |
|
|
|
console.log(this.data) |
|
|
|
}, |
|
|
|
// 获取住房性质
|
|
|
|
getHouseTypes() { |
|
|
|
getHouseType({formCode: "resi_base_info"}).then(res => { |
|
|
|
console.log(res.data) |
|
|
|
this.setPickerOptions('housingNature', res.data) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
getDictData(dictType, formName) { |
|
|
|
dictlist({'dictType': dictType}).then(res => { |
|
|
|
this.setPickerOptions(formName, res.data) |
|
|
|
}); |
|
|
|
}, |
|
|
|
setPickerOptions(key, options) { |
|
|
|
let residentTypeForm = this.data.residentTypeForm |
|
|
|
for (let item in residentTypeForm) { |
|
|
|
residentTypeForm[item].forEach(item2 => { |
|
|
|
if (item2.key === key) { |
|
|
|
item2.options = options |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
this.setData({residentTypeForm}) |
|
|
|
}, |
|
|
|
getValue(arry) { |
|
|
|
let obj = {} |
|
|
|
arry.forEach(item => { |
|
|
|
if (item.type === 'date' && item.value != '') { |
|
|
|
item.value = item.value + ' 00:00:00' |
|
|
|
} |
|
|
|
obj[item.key] = item.value |
|
|
|
}) |
|
|
|
return obj |
|
|
|
}, |
|
|
|
}) |