添加
This commit is contained in:
@@ -3,64 +3,67 @@
|
||||
<div class="pad-l32">
|
||||
<div class="item">
|
||||
<span class="label"><span class="tips">*</span>类型</span>
|
||||
<div class="value" @click="selectClick('houselivingStatus', 'livingStatus')">
|
||||
<span :class="form.livingStatus === '' ? 'color-999' : ''">{{ $dict.getLabel('houselivingStatus', form.livingStatus) || '请选择'}}</span>
|
||||
<div class="value" @click="selectClick('appSpecialTypeFive', 'userType')">
|
||||
<span :class="form.userType === '' ? 'color-999' : ''">{{ $dict.getLabel('appSpecialTypeFive', form.userType) || '请选择'}}</span>
|
||||
<u-icon name="arrow-right" color="#cccccc" size="14"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="label"><span class="tips">*</span>姓名</span>
|
||||
<div class="value">
|
||||
<u-input type="text" placeholder="请输入" v-model="form.houseArea" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="15" :clearable="false" />
|
||||
|
||||
<u-input type="text" placeholder="请输入" v-model="form.name" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="15" :clearable="false" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="label"><span class="tips">*</span>身份证号</span>
|
||||
<div class="value">
|
||||
<u-input type="idcard" placeholder="请输入" v-model="form.houseArea" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="15" :clearable="false" />
|
||||
<u-input type="text" placeholder="请输入" v-model="form.idNumber" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="18" :clearable="false" @input="changeIdNumber"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="label"><span class="tips">*</span>性别</span>
|
||||
<div class="value" @click="selectClick('houselivingStatus', 'livingStatus')">
|
||||
<span :class="form.livingStatus === '' ? 'color-999' : ''">{{ $dict.getLabel('houselivingStatus', form.livingStatus) || '请选择'}}</span>
|
||||
<u-icon name="arrow-right" color="#cccccc" size="14"/>
|
||||
<div class="value">
|
||||
<u-input placeholder="请输入" v-model="form.gender" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="15" :clearable="false" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="label"><span class="tips">*</span>出生日期</span>
|
||||
<div class="value" @click="selectTime('startDate')">
|
||||
<span :class="form.startDate === '' ? 'color-999' : ''">{{ $dateFormat(form.startDate,'YYYY-MM-DD') || '请选择' }}</span>
|
||||
<u-icon name="arrow-right" color="#cccccc" size="14"/>
|
||||
<div class="value">
|
||||
|
||||
<u-input type="text" placeholder="请输入" v-model="form.birth" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="19" :clearable="false" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="label"><span class="tips">*</span>联系电话</span>
|
||||
<div class="value">
|
||||
<u-input type="number" placeholder="请输入" v-model="form.houseArea" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="11" :clearable="false" />
|
||||
<u-input type="number" placeholder="请输入" v-model="form.phone" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="11" :clearable="false" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="label"><span class="tips">*</span>所属区域</span>
|
||||
<div class="value">
|
||||
<u-input type="text" placeholder="请输入" v-model="form.houseArea" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="15"/>
|
||||
<AiAreaPicker v-model="form.areaId" :areaId="user.areaId" @select="areaSelect" :name.sync="form.areaName">
|
||||
<span class="label" v-if="form.areaName">{{ form.areaName }}</span>
|
||||
<span v-else>请选择</span>
|
||||
<u-icon name="arrow-right" color="#666" size="24" style="margin-left:4px;"/>
|
||||
</AiAreaPicker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="label"><span class="tips">*</span>详细地址</span>
|
||||
<div class="value">
|
||||
<u-input type="text" placeholder="请输入" v-model="form.houseArea" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="15"/>
|
||||
<u-input type="text" placeholder="请输入" v-model="form.address" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item">
|
||||
<span class="label"><span class="tips">*</span>所属网格</span>
|
||||
<div class="value">
|
||||
<u-input type="text" placeholder="请输入" v-model="form.houseArea" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" :maxlength="15"/>
|
||||
<u-input type="text" placeholder="请输入" v-model="form.girdName" input-align="right" placeholder-style="color:#999;font-size:16px;" height="48" :clearable="false"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div v-for="(item, index) in tableData[tableIndex].list" :key="index">
|
||||
<div v-if="this.form.userType != ''">
|
||||
<div v-for="(item, index) in tableData[this.form.userType].list" :key="index">
|
||||
|
||||
<div class="item" v-if="item.type == 'input'">
|
||||
<span class="label"><span class="tips"></span>{{item.label}}</span>
|
||||
@@ -87,84 +90,79 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer" @click="submit">
|
||||
<div class="btn">保存</div>
|
||||
</div>
|
||||
|
||||
<u-picker mode="time" v-model="dateShow" :params="deteParams" start-year="2010" @confirm="dateConfirm">请选择</u-picker>
|
||||
<u-select v-model="showSelect" :list="selectList" label-name="dictName" value-name="dictValue" @confirm="confirmRelation"/>
|
||||
<u-select v-model="showSelect" :list="selectList" label-name="dictName" value-name="dictValue" @confirm="confirmSelect"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import {mapActions, mapState} from 'vuex'
|
||||
import AiAreaPicker from '../../components/AiAreaPicker.vue'
|
||||
|
||||
export default {
|
||||
components: { AiAreaPicker },
|
||||
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
userType: '',
|
||||
name: '',
|
||||
idNumber: '',
|
||||
gender: '',
|
||||
birth: '',
|
||||
phone: '',
|
||||
areaName: '',
|
||||
address: '',
|
||||
girdName: '',
|
||||
areaId: '',
|
||||
sex: ''
|
||||
},
|
||||
dateShow: false,
|
||||
deteParams: {year: true, month: true, day: true, hour: false, minute: false, second: false},
|
||||
showSelect: false,
|
||||
selectDict: '',
|
||||
selectName: '',
|
||||
|
||||
tableIndex: 4,
|
||||
tableIndex: 0,
|
||||
tableData: [
|
||||
{
|
||||
list: [ // 精神病人
|
||||
{
|
||||
label: '是否累犯',
|
||||
type: 'select',
|
||||
dict: 'shouseholdRelation',
|
||||
formDbName: 'shouseholdRelation'
|
||||
},
|
||||
{
|
||||
label: '原罪名',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus'
|
||||
},
|
||||
{
|
||||
label: '服刑场所',
|
||||
label: '家庭年收入',
|
||||
type: 'input',
|
||||
formDbName: 'value'
|
||||
formDbName: 'income'
|
||||
},
|
||||
{
|
||||
label: '危险性评估',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus',
|
||||
},
|
||||
{
|
||||
label: '安置情况',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus',
|
||||
},
|
||||
{
|
||||
label: '安置时间',
|
||||
label: '发病日期',
|
||||
type: 'time',
|
||||
formDbName: 'houselivingStatus',
|
||||
formDbName: 'sickTime'
|
||||
},
|
||||
{
|
||||
label: '衔接情况',
|
||||
label: '监护人姓名',
|
||||
type: 'input',
|
||||
formDbName: 'helpName'
|
||||
},
|
||||
{
|
||||
label: '监护人联系方式',
|
||||
type: 'input',
|
||||
formDbName: 'helpPhone',
|
||||
},
|
||||
{
|
||||
label: '目前危险等级',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus',
|
||||
dict: 'appSpecialDengerLevel',
|
||||
formDbName: 'level',
|
||||
},
|
||||
{
|
||||
label: '衔接时间',
|
||||
type: 'time',
|
||||
formDbName: 'houselivingStatus',
|
||||
},
|
||||
{
|
||||
label: '是否重新犯罪',
|
||||
label: '治疗情况',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus',
|
||||
dict: 'appSpecialCure',
|
||||
formDbName: 'situation',
|
||||
},
|
||||
]
|
||||
},
|
||||
@@ -178,26 +176,26 @@ export default {
|
||||
{
|
||||
label: '婚姻情况',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus'
|
||||
dict: 'appSpecialMarriage',
|
||||
formDbName: 'marriage'
|
||||
},
|
||||
{
|
||||
label: '身体状况',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus'
|
||||
dict: 'appSpecialHealth',
|
||||
formDbName: 'health'
|
||||
},
|
||||
{
|
||||
label: '残疾类型',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus'
|
||||
dict: 'appSpecialDisableType',
|
||||
formDbName: 'type'
|
||||
},
|
||||
{
|
||||
label: '残疾级别',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus'
|
||||
dict: 'appSpecialDisableLevel',
|
||||
formDbName: 'level'
|
||||
},
|
||||
]
|
||||
},
|
||||
@@ -206,35 +204,35 @@ export default {
|
||||
{
|
||||
label: '具体罪名',
|
||||
type: 'input',
|
||||
formDbName: 'charge'
|
||||
formDbName: 'crime'
|
||||
},
|
||||
{
|
||||
label: '矫正类别',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus'
|
||||
dict: 'appSpecialChangeType',
|
||||
formDbName: 'type'
|
||||
},
|
||||
{
|
||||
label: '矫正开始日期',
|
||||
type: 'time',
|
||||
formDbName: 'houselivingStatus',
|
||||
formDbName: 'startTime',
|
||||
},
|
||||
{
|
||||
label: '矫正结束日期',
|
||||
type: 'time',
|
||||
formDbName: 'houselivingStatus',
|
||||
formDbName: 'endTime',
|
||||
},
|
||||
{
|
||||
label: '是否建立矫正小组',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus',
|
||||
dict: 'isCreateGroup',
|
||||
formDbName: 'isCreateGroup',
|
||||
},
|
||||
{
|
||||
label: '是否托管',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus',
|
||||
dict: 'isRelease',
|
||||
formDbName: 'isRelease',
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -243,41 +241,41 @@ export default {
|
||||
{
|
||||
label: '初次发现日期',
|
||||
type: 'time',
|
||||
formDbName: 'houselivingStatus',
|
||||
formDbName: 'firstTime',
|
||||
},
|
||||
{
|
||||
label: '吸毒状态',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus',
|
||||
dict: 'appSpecialDrug',
|
||||
formDbName: 'status',
|
||||
},
|
||||
{
|
||||
label: '戒毒情况',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
dict: 'appSpecialDebug',
|
||||
formDbName: 'houselivingStatus',
|
||||
},
|
||||
{
|
||||
label: '管控情况',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus',
|
||||
dict: 'appSpecialControl',
|
||||
formDbName: 'control',
|
||||
},
|
||||
{
|
||||
label: '管控人姓名',
|
||||
type: 'input',
|
||||
formDbName: 'name'
|
||||
formDbName: 'controlName'
|
||||
},
|
||||
{
|
||||
label: '管控人联系方式',
|
||||
type: 'input',
|
||||
formDbName: 'phone'
|
||||
formDbName: 'controlPhone'
|
||||
},
|
||||
{
|
||||
label: '有无犯罪史',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus'
|
||||
formDbName: 'crime'
|
||||
},
|
||||
]
|
||||
},
|
||||
@@ -287,64 +285,66 @@ export default {
|
||||
label: '是否累犯',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus'
|
||||
formDbName: 'isSecond'
|
||||
},
|
||||
{
|
||||
label: '原罪名',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus'
|
||||
dict: 'appSpecialCrime',
|
||||
formDbName: 'crime'
|
||||
},
|
||||
{
|
||||
label: '服刑场所',
|
||||
type: 'input',
|
||||
formDbName: 'houselivingStatus'
|
||||
formDbName: 'place'
|
||||
},
|
||||
{
|
||||
label: '危险性评估',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus'
|
||||
dict: 'appSpecialDenger',
|
||||
formDbName: 'denger'
|
||||
},
|
||||
{
|
||||
label: '安置情况',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus'
|
||||
dict: 'appSpecialPlacement',
|
||||
formDbName: 'placement'
|
||||
},
|
||||
{
|
||||
label: '安置时间',
|
||||
type: 'time',
|
||||
formDbName: 'houselivingStatus'
|
||||
formDbName: 'placeTime'
|
||||
},
|
||||
{
|
||||
label: '衔接情况',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus'
|
||||
dict: 'appSpecialSituation',
|
||||
formDbName: 'situation'
|
||||
},
|
||||
{
|
||||
label: '衔接时间',
|
||||
type: 'time',
|
||||
formDbName: 'houselivingStatus'
|
||||
formDbName: 'situationTime'
|
||||
},
|
||||
{
|
||||
label: '是否重新犯罪',
|
||||
type: 'select',
|
||||
dict: 'houselivingStatus',
|
||||
formDbName: 'houselivingStatus'
|
||||
formDbName: 'isRepeat'
|
||||
},
|
||||
]
|
||||
}
|
||||
],
|
||||
selectList: []
|
||||
selectList: [],
|
||||
}
|
||||
},
|
||||
computed: {...mapState(['user'])},
|
||||
computed: {
|
||||
...mapState(['user']),
|
||||
},
|
||||
created() {
|
||||
this.$dict.load('householdRelation', 'houselivingStatus', 'houseLeaseSituation', 'houseUseStatus',
|
||||
'isFilingCertificateStatus', 'communityBuildingType', 'yesOrNo', 'BulidResidentType').then(() => {
|
||||
// this.getDetail()
|
||||
this.$dict.load('appSpecialSituation', 'appSpecialPlacement', 'appSpecialDenger', 'appSpecialCrime',
|
||||
'appSpecialControl', 'appSpecialDebug', 'appSpecialDrug', 'appSpecialChangeType','appSpecialCure','appSpecialDengerLevel',
|
||||
'appSpecialDisableLevel','appSpecialDisableType','appSpecialHealth','appSpecialMarriage','appSpecialTypeFive').then(() => {
|
||||
})
|
||||
},
|
||||
onShow() {
|
||||
@@ -352,26 +352,74 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
changeIdNumber() {
|
||||
if(this.form.idNumber.length == 18){
|
||||
var people = this.$idCardNoUtil.getIdCardInfo(this.form.idNumber)
|
||||
this.form.birth = people.birthday
|
||||
this.form.gender = people.gender
|
||||
|
||||
let reg = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
|
||||
if (!reg.test(this.form.idNumber)) {
|
||||
return this.$u.toast('请输入正确的身份证号码')
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
submit() {
|
||||
this.$http.post(`app/appcommunityform/update`, this.form).then(res => {
|
||||
if (res?.code == 0) {
|
||||
if(this.userType === ''){
|
||||
return this.$u.toast('请选择类型')
|
||||
}
|
||||
if(!this.form.name){
|
||||
return this.$u.toast('请输入姓名')
|
||||
}
|
||||
if(!this.form.idNumber){
|
||||
return this.$u.toast('请输入身份证号')
|
||||
}
|
||||
if(!this.form.phone){
|
||||
return this.$u.toast('请输入联系电话')
|
||||
}
|
||||
if(!this.form.areaName){
|
||||
return this.$u.toast('请选择区域')
|
||||
}
|
||||
if(!this.form.address){
|
||||
return this.$u.toast('请输入详细地址')
|
||||
}
|
||||
if(!this.form.girdName){
|
||||
return this.$u.toast('请选择网格')
|
||||
}
|
||||
|
||||
var urlList = ['app/appspecialmental/addOrUpdate', 'app/appspecialdisabled/addOrUpdate', 'app/appspecialdisabled/addOrUpdate',
|
||||
'app/appspecialdisabled/addOrUpdate', 'app/appspecialdisabled/addOrUpdate']
|
||||
|
||||
this.$http.post(urlList[this.form.userType], this.form).then(res => {
|
||||
if(res.code == 0) {
|
||||
this.$u.toast('提交成功')
|
||||
uni.$emit('specialPeopleList')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({})
|
||||
uni.navigateBack()
|
||||
}, 600)
|
||||
}
|
||||
})
|
||||
},
|
||||
areaSelect(e){
|
||||
console.log(e);
|
||||
this.form.areaId = e
|
||||
},
|
||||
|
||||
selectClick(dictName, formName) {
|
||||
console.log(dictName)
|
||||
this.selectList = this.$dict.getDict(dictName)
|
||||
this.dictName = dictName
|
||||
this.selectName = formName
|
||||
this.showSelect = true
|
||||
},
|
||||
confirmSelect(e) {
|
||||
this.form[this.selectName] = e[0].value
|
||||
|
||||
if(this.selectName == 'userType'){
|
||||
this.tableData[this.form.userType].list.map((item) => {
|
||||
this.form[item.formDbName] = ''
|
||||
})
|
||||
}
|
||||
},
|
||||
selectTime(formName) {
|
||||
this.selectName = formName
|
||||
|
||||
Reference in New Issue
Block a user