|
@@ -4,7 +4,7 @@
|
|
|
<uni-nav-bar color="#ffffff" left-icon="left" title="健康档案" :background-color="backgroundColor" :border="false" statusBar='true' fixed="true" @clickLeft="getBackFn">
|
|
|
</uni-nav-bar>
|
|
|
</view>
|
|
|
- <uni-forms ref="form" :model="datainfo">
|
|
|
+ <uni-forms ref="form" :model="datainfo" :rules="rules">
|
|
|
<view class="cbox">
|
|
|
<view class="chmain">
|
|
|
<view class="plr6">
|
|
@@ -14,13 +14,11 @@
|
|
|
<image :src="baseUrl+datainfo.front" class="img" v-if="datainfo.front"></image>
|
|
|
<image :src="cardz" class="img" v-else></image>
|
|
|
<view class="tit">拍摄人像面</view>
|
|
|
- <!-- <view class="tit">身份证正面</view> -->
|
|
|
</view>
|
|
|
<view class="carbox" @click="getaddImage('back')">
|
|
|
<image :src="baseUrl+datainfo.back" class="img" v-if="datainfo.back"></image>
|
|
|
<image :src="cardf" class="img" v-else></image>
|
|
|
<view class="tit">拍摄国徽面</view>
|
|
|
- <!-- <view class="tit">身份证反面</view> -->
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="mb4">
|
|
@@ -28,69 +26,116 @@
|
|
|
<view class="cardtip">如果识别错误,可尝试再次拍照。</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <uni-forms-item label="身份证号" required name="phonenumber">
|
|
|
+ <uni-forms-item label="身份证号" required name="residentIdCard">
|
|
|
<view class="flexc">
|
|
|
- <uni-easyinput disabled v-model="datainfo.phonenumber" :inputBorder='false' placeholder="自动识别" />
|
|
|
+ <uni-easyinput :disabled="isdisabled" v-model="datainfo.residentIdCard" :inputBorder='false' placeholder="自动识别" />
|
|
|
</view>
|
|
|
</uni-forms-item>
|
|
|
- <uni-forms-item label="姓名" required name="phonenumber">
|
|
|
+ <uni-forms-item label="姓名" required name="residentName">
|
|
|
<view class="flexc">
|
|
|
- <uni-easyinput disabled v-model="datainfo.phonenumber" :inputBorder='false' placeholder="自动识别" />
|
|
|
+ <uni-easyinput :disabled="isdisabled" v-model="datainfo.residentName" :inputBorder='false' placeholder="自动识别" />
|
|
|
</view>
|
|
|
</uni-forms-item>
|
|
|
- <uni-forms-item label="性别" required name="phonenumber">
|
|
|
+ <uni-forms-item label="性别" required name="residentGender">
|
|
|
<view class="flexc">
|
|
|
- <uni-easyinput disabled v-model="datainfo.phonenumber" :inputBorder='false' placeholder="自动识别" />
|
|
|
+ <view class="flex1"></view>
|
|
|
+ <uni-data-checkbox :map="map" :disabled="isdisabled" selectedColor="#0156FE" selectedTextColor="#272727" :value="datainfo.residentGender" :localdata="xbList" />
|
|
|
</view>
|
|
|
</uni-forms-item>
|
|
|
- <uni-forms-item label="家庭地址" required name="phonenumber">
|
|
|
+ <uni-forms-item label="手机号码" required name="residentPhone">
|
|
|
<view class="flexc">
|
|
|
- <uni-easyinput disabled v-model="datainfo.phonenumber" :inputBorder='false' placeholder="自动识别" />
|
|
|
+ <uni-easyinput :disabled="isdisabled" v-model="datainfo.residentPhone" :inputBorder='false' placeholder="请输入手机号码" />
|
|
|
</view>
|
|
|
</uni-forms-item>
|
|
|
- <picker range-key='dictLabel' :value="syqxidx" :range="sexs" @change='bindDateChange'>
|
|
|
- <uni-forms-item label="与户主关系" required name="phonenumber">
|
|
|
- <view class="flexc ml10">
|
|
|
- <view class="flex1 txr f13" :class="datainfo.iszc?'co27':'coa'">{{datainfo.iszc?'是':'选择与户主关系'}}</view>
|
|
|
+ <uni-forms-item label="居住门户" name="portalId">
|
|
|
+ <w-select
|
|
|
+ style="margin-left: 20rpx;"
|
|
|
+ v-model="chooseValue"
|
|
|
+ :list='fwlist'
|
|
|
+ valueName='label'
|
|
|
+ keyName="value"
|
|
|
+ :chosevalue="datainfo.detailedAddress"
|
|
|
+ :filterable='filterable'
|
|
|
+ @change='getchange'
|
|
|
+ >
|
|
|
+ </w-select>
|
|
|
+ </uni-forms-item>
|
|
|
+ <!-- <uni-forms-item label="家庭地址" required name="detailedAddress">
|
|
|
+ <view class="flexc">
|
|
|
+ <uni-easyinput disabled v-model="datainfo.detailedAddress" :inputBorder='false' placeholder="自动识别" />
|
|
|
+ </view>
|
|
|
+ </uni-forms-item> -->
|
|
|
+ <picker range-key='dictLabel' :disabled="isdisabled" :value="sfhzidx" :range="sfList" @change='bindDateChange'>
|
|
|
+ <uni-forms-item label="是否户主" required name="isHouseholder">
|
|
|
+ <view class="flexc mh35">
|
|
|
+ <view class="flex1 txr f13 co27" v-if="datainfo.isHouseholder&&!sfhz">{{statusFormats(datainfo.isHouseholder,sfList,'sfhz')}}</view>
|
|
|
+ <view class="flex1 txr f13" v-else :class="sfhz?'co27':'coa'">{{sfhz||"请选择是/否"}}</view>
|
|
|
+
|
|
|
</view>
|
|
|
</uni-forms-item>
|
|
|
</picker>
|
|
|
- <picker range-key='dictLabel' :value="syqxidx" :range="sexs" @change='bindDateChange'>
|
|
|
- <uni-forms-item label="是否党员" required name="phonenumber">
|
|
|
- <view class="flexc ml10">
|
|
|
- <view class="flex1 txr f13" :class="datainfo.iszc?'co27':'coa'">{{datainfo.iszc?'是':'请选择是/否'}}</view>
|
|
|
+ <picker range-key='dictLabel' :disabled="isdisabled" :value="hzgxidx" :range="hzgxList" @change='bindDateChangea'>
|
|
|
+ <uni-forms-item label="与户主关系" required name="residentRelationship">
|
|
|
+ <view class="flexc mh35">
|
|
|
+ <view class="flex1 txr f13 co27" v-if="datainfo.residentRelationship&&!hzgx">{{statusFormats(datainfo.residentRelationship,hzgxList,'hzgx')}}</view>
|
|
|
+ <view class="flex1 txr f13" v-else :class="hzgx?'co27':'coa'">{{hzgx||"请选择与户主关系"}}</view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </uni-forms-item>
|
|
|
+ </picker>
|
|
|
+ <picker range-key='dictLabel' :disabled="isdisabled" :value="sfzhidx" :range="sfList" @change='bindDateChangeb'>
|
|
|
+ <uni-forms-item label="是否租户" required name="isTenant">
|
|
|
+ <view class="flexc mh35">
|
|
|
+ <view class="flex1 txr f13 co27" v-if="datainfo.isTenant&&!sfzh">{{statusFormats(datainfo.isTenant,sfList,'sfzh')}}</view>
|
|
|
+ <view class="flex1 txr f13" v-else :class="sfzh?'co27':'coa'">{{sfzh||"请选择是/否"}}</view>
|
|
|
+
|
|
|
</view>
|
|
|
</uni-forms-item>
|
|
|
</picker>
|
|
|
- <picker range-key='dictLabel' :value="syqxidx" :range="sexs" @change='bindDateChange'>
|
|
|
+ <picker range-key='dictLabel' :disabled="isdisabled" :value="rymmidx" :range="rymmList" @change='bindDateChangec'>
|
|
|
+ <uni-forms-item label="人员面貌" required name="residentAppearance">
|
|
|
+ <view class="flexc mh35">
|
|
|
+ <view class="flex1 txr f13 co27" v-if="datainfo.residentAppearance&&!rymm">{{statusFormats(datainfo.residentAppearance,rymmList,'rymm')}}</view>
|
|
|
+ <view class="flex1 txr f13" v-else :class="rymm?'co27':'coa'">{{rymm||"请选择人员面貌"}}</view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </uni-forms-item>
|
|
|
+ </picker>
|
|
|
+ <!-- <picker range-key='dictLabel' :value="syqxidx" :range="sexs" @change='bindDateChange'>
|
|
|
<uni-forms-item label="特殊类型" name="phonenumber">
|
|
|
<view class="flexc ml10">
|
|
|
<view class="flex1 txr f13" :class="datainfo.iszc?'co27':'coa'">{{datainfo.iszc?'是':'如有五保户等特殊类型,请选择'}}</view>
|
|
|
</view>
|
|
|
</uni-forms-item>
|
|
|
- </picker>
|
|
|
- <uni-forms-item label="兴趣爱好" name="phonenumber">
|
|
|
+ </picker> -->
|
|
|
+ <uni-forms-item label="工作单位" name="residentEmployer">
|
|
|
+ <view class="flexc">
|
|
|
+ <uni-easyinput :disabled="isdisabled" v-model="datainfo.residentEmployer" :inputBorder='false' placeholder="请输入工作单位" />
|
|
|
+ </view>
|
|
|
+ </uni-forms-item>
|
|
|
+ <uni-forms-item label="兴趣爱好" name="hobby">
|
|
|
<view class="flexc ml10">
|
|
|
- <uni-easyinput type="textarea" autoHeight v-model="text" :inputBorder='false' placeholder="请输入兴趣爱好" />
|
|
|
+ <uni-easyinput type="textarea" :disabled="isdisabled" autoHeight v-model="datainfo.hobby" :inputBorder='false' placeholder="请输入兴趣爱好" />
|
|
|
</view>
|
|
|
</uni-forms-item>
|
|
|
|
|
|
<uni-forms-item label="上传头像" name="phonenumber">
|
|
|
- <view class="flexe mt10">
|
|
|
- <view class="addimgs">
|
|
|
- <view class="assimg">
|
|
|
- <image :src="aphoto" class="img"></image>
|
|
|
- <image :src="rdelimg" class="delimg" @click="getDelFn"></image>
|
|
|
+ <view class="addimgs">
|
|
|
+ <block v-if="phofile&&phofile.length">
|
|
|
+ <view class="assimg" v-for="(ite,idx) in phofile" :key="idx" @click="getPreview(idx,phofile)">
|
|
|
+ <image :src="baseUrl+ite" class="img"></image>
|
|
|
+ <image :src="rdelimg" class="delimg" @click.stop="getDelFn(idx,'fm')"></image>
|
|
|
</view>
|
|
|
- </view>
|
|
|
- <view class="addbox">
|
|
|
+ </block>
|
|
|
+ <view class="addbox" @click="getaddImage">
|
|
|
<image :src="aphoto"></image>
|
|
|
- <view>添加头图</view>
|
|
|
+ <view>添加图片</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view>
|
|
|
</uni-forms-item>
|
|
|
</view>
|
|
|
- <view class="rhbtn mt30 bga" @click="getNext">提交</view>
|
|
|
+ <view class="rhbtn mt30 bga" @click="getEditFn" v-if="isdisabled">修改</view>
|
|
|
+ <view class="rhbtn mt30 bga" @click="getSubmit" v-else>提交</view>
|
|
|
</view>
|
|
|
</uni-forms>
|
|
|
|
|
@@ -101,15 +146,15 @@
|
|
|
|
|
|
<script>
|
|
|
import config from '@/config'
|
|
|
- import {
|
|
|
- checkPermi,
|
|
|
- checkRole
|
|
|
- } from "@/utils/permission"; // 权限判断函数
|
|
|
- import {
|
|
|
- uploadIdentify
|
|
|
- } from '@/utils/common.js'
|
|
|
+ import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
|
|
|
+ import {uploadIdentify,uploadmore} from '@/utils/common.js'
|
|
|
+ import {houseInfolistNoPage} from "@/api/work/work.js"
|
|
|
+ import {residentInfoAdd,residentInfoPut,residentInfoDet} from "@/api/work/people.js"
|
|
|
+ import {getDictionaryFn} from "@/api/system/user.js"
|
|
|
+ import {selectValueKey} from "@/utils/common.js"
|
|
|
+ import wSelect from "@/work/components/w-select/w-select.vue"
|
|
|
export default {
|
|
|
- components: {},
|
|
|
+ components: {wSelect},
|
|
|
data() {
|
|
|
return {
|
|
|
cardz:require('@/health/static/health/cardz.png'),
|
|
@@ -121,26 +166,65 @@
|
|
|
nvaHeight:44,
|
|
|
backgroundColor: "transparent",
|
|
|
datainfo: {
|
|
|
- sex:0,
|
|
|
- realName: '',
|
|
|
- idCard: '',
|
|
|
- address: '',
|
|
|
- expirationDate: '',
|
|
|
- phonenumber: '',
|
|
|
- front: '',
|
|
|
- back: '',
|
|
|
+ // "residentId":"",//居住人员主键
|
|
|
+ "houseId":"",//关联房屋信息表的house_id
|
|
|
+ // "userId":"",//关联sys_user表中user_id
|
|
|
+ "detailedAddress":"",//居住人员的详细门牌号
|
|
|
+ "residentName":"",//居住人员姓名
|
|
|
+ "residentIdCard":"",//居住人员身份证号码,18位
|
|
|
+ "residentBirthday":"",//居住人员出生日期
|
|
|
+ // "yearsOld":"",//年龄
|
|
|
+ "residentPhone":"",//居住人员手机号
|
|
|
+ "residentGender":1,//居住人员性别:1-男,2-女
|
|
|
+ "residentRelationship":"",//居住人员与户主的关系,如父子、夫妻等
|
|
|
+ "isHouseholder":"",//是否是户主 N不是 Y是
|
|
|
+ "isTenant":"",//是否是租户:Y-是,N-否
|
|
|
+ "residentEmployer":"",//居住人员工作单位
|
|
|
+ "residentAppearance":""//居住人员面貌,如党员、群众等
|
|
|
},
|
|
|
- syqxidx:'',
|
|
|
- sexs: [{
|
|
|
- text: '男',
|
|
|
- value: 0
|
|
|
- }, {
|
|
|
- text: '女',
|
|
|
- value: 1
|
|
|
- }],
|
|
|
+ rules:{
|
|
|
+ residentIdCard: {rules: [{required: true,errorMessage: '请输入身份证号码' }]},
|
|
|
+ residentName: {rules: [{required: true,errorMessage: '请输入姓名' }]},
|
|
|
+ residentGender: {rules: [{required: true,errorMessage: '请选择性别' }]},
|
|
|
+ houseId: {rules: [{required: true,errorMessage: '请选择居住门户' }]},
|
|
|
+ detailedAddress: {rules: [{required: true,errorMessage: '请输入居住地址' }]},
|
|
|
+ isHouseholder: {rules: [{required: true,errorMessage: '请选择是否户主' }]},
|
|
|
+ // residentRelationship: {rules: [{required: true,errorMessage: '请选择与户主关系' }]},
|
|
|
+ // isTenant: {rules: [{required: true,errorMessage: '请选择是否租户' }]},
|
|
|
+ // residentAppearance: {rules: [{required: true,errorMessage: '请选择人员面貌' }]},
|
|
|
+ residentPhone: {rules: [{required: true,errorMessage: '请输入手机号'}, {pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,errorMessage:'请输入正确的手机号码'}]},
|
|
|
+ },
|
|
|
+ sfhz:"",
|
|
|
+ hzgx:"",
|
|
|
+ sfzh:"",
|
|
|
+ rymm:"",
|
|
|
+ sfhzidx:0,
|
|
|
+ hzgxidx:0,
|
|
|
+ sfzhidx:0,
|
|
|
+ rymmidx:0,
|
|
|
+ sfhzidx:0,
|
|
|
+ list:[],
|
|
|
+ sfList:[],
|
|
|
+ hzgxList:[],
|
|
|
+ rymmList:[],
|
|
|
+ xbList:[],
|
|
|
+ phofile:[],
|
|
|
+ fwlist:[],
|
|
|
+ isdisabled:false,
|
|
|
+ ptype:'add',
|
|
|
+ filterable:true,
|
|
|
+ chooseValue:'',
|
|
|
+ map:{text:'dictLabel',value:'dictValue'}
|
|
|
}
|
|
|
},
|
|
|
- onLoad: function() {
|
|
|
+ onLoad: function(e) {
|
|
|
+ if(e.id){
|
|
|
+ this.id=e.id;
|
|
|
+ this.ptype="edit";
|
|
|
+ this.isdisabled=true;
|
|
|
+ this.getDetail()
|
|
|
+ }
|
|
|
+ this.init()
|
|
|
uni.getSystemInfo({
|
|
|
success: (e) => {
|
|
|
this.nvaHeight = Number(e.statusBarHeight)+44;
|
|
@@ -158,6 +242,84 @@
|
|
|
methods: {
|
|
|
checkPermi,
|
|
|
checkRole,
|
|
|
+ getEditFn(){
|
|
|
+ this.isdisabled=false;
|
|
|
+ },
|
|
|
+ statusFormats(data, list,type) {
|
|
|
+ var aite=selectValueKey(list, data);
|
|
|
+ if(type=='sfhz'){
|
|
|
+ this.sfhzidx=aite.key
|
|
|
+ }else if(type=='hzgx'){
|
|
|
+ this.hzgxidx=aite.key;
|
|
|
+ }else if(type=='sfzh'){
|
|
|
+ this.sfzhidx=aite.key;
|
|
|
+ }else if(type=='rymm'){
|
|
|
+ this.rymmidx=aite.key;
|
|
|
+ }
|
|
|
+ return aite.actions;
|
|
|
+ },
|
|
|
+ getchange(e){
|
|
|
+ this.datainfo.houseId=e.value;
|
|
|
+ this.datainfo.detailedAddress=e.label;
|
|
|
+ },
|
|
|
+ init(){
|
|
|
+ houseInfolistNoPage().then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+ this.fwlist= res.rows.map(v => {
|
|
|
+ return {
|
|
|
+ label: v.detailedAddress,
|
|
|
+ value: v.houseId,
|
|
|
+ location: v.location
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 是否
|
|
|
+ getDictionaryFn('sys_yes_no').then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+ this.sfList = res.data.map(v => {
|
|
|
+ return {
|
|
|
+ dictLabel: v.dictLabel,
|
|
|
+ dictValue: v.dictValue
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //户主关系
|
|
|
+ getDictionaryFn('relationship_householder').then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+ this.hzgxList = res.data.map(v => {
|
|
|
+ return {
|
|
|
+ dictLabel: v.dictLabel,
|
|
|
+ dictValue: v.dictValue
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //人员面貌
|
|
|
+ getDictionaryFn('affiliation_personnel').then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+ this.rymmList = res.data.map(v => {
|
|
|
+ return {
|
|
|
+ dictLabel: v.dictLabel,
|
|
|
+ dictValue: v.dictValue
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ //性别
|
|
|
+ getDictionaryFn('gender').then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+ this.xbList = res.data.map(v => {
|
|
|
+ return {
|
|
|
+ dictLabel: v.dictLabel,
|
|
|
+ dictValue: Number(v.dictValue)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
getBackFn(){
|
|
|
uni.navigateBack({
|
|
|
delta:1
|
|
@@ -165,73 +327,193 @@
|
|
|
},
|
|
|
bindDateChange(e){
|
|
|
var val=e.detail.value;
|
|
|
- // this.datainfo.applicationBank=this.sdyhlist[val].value;
|
|
|
- // this.applicationBank=this.sdyhlist[val].label;
|
|
|
+ this.datainfo.isHouseholder=this.sfList[val].dictValue;
|
|
|
+ this.sfhz=this.sfList[val].dictLabel;
|
|
|
+ },
|
|
|
+ bindDateChangea(e){
|
|
|
+ var val=e.detail.value;
|
|
|
+ this.datainfo.residentRelationship=this.hzgxList[val].dictValue;
|
|
|
+ this.hzgx=this.hzgxList[val].dictLabel;
|
|
|
+ },
|
|
|
+ bindDateChangeb(e){
|
|
|
+ var val=e.detail.value;
|
|
|
+ this.datainfo.isTenant=this.sfList[val].dictValue;
|
|
|
+ this.sfzh=this.sfList[val].dictLabel;
|
|
|
+ },
|
|
|
+ bindDateChangec(e){
|
|
|
+ var val=e.detail.value;
|
|
|
+ this.datainfo.residentAppearance=this.rymmList[val].dictValue;
|
|
|
+ this.rymm=this.rymmList[val].dictLabel;
|
|
|
},
|
|
|
- getaddImage(e) {
|
|
|
+ getDetail(){
|
|
|
+ residentInfoDet(this.id).then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+ this.datainfo=res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getSubmit(){
|
|
|
+ var that=this;
|
|
|
+ this.$refs.form.validate().then(res => {
|
|
|
+ var params=JSON.parse(JSON.stringify(this.datainfo))
|
|
|
+ // var phofile=JSON.parse(JSON.stringify(this.phofile))
|
|
|
+ // if(phofile&&phofile.length){
|
|
|
+ // params.equipmentPhotos=this.phofile.join(',');
|
|
|
+ // }
|
|
|
+ // if(!params.assetId){
|
|
|
+ // this.$toast('请选择资产类型')
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ // if(!params.equipmentName){
|
|
|
+ // this.$toast('请输入资产名称')
|
|
|
+ // return
|
|
|
+ // }
|
|
|
+ if(!params.detailedAddress){
|
|
|
+ this.$toast('请选择居住门户')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let _IDRe18 =
|
|
|
+ /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
|
|
|
+ let _IDre15 = /^([1-6][1-9]|50)\d{4}\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}$/
|
|
|
+ // 校验身份证:
|
|
|
+ if (params.residentIdCard&&!_IDRe18.test(params.residentIdCard) && !_IDre15.test(params.residentIdCard)) {
|
|
|
+ this.$toast("请输入正确身份证号")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(this.ptype=='add'){
|
|
|
+ residentInfoAdd(params).then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+ this.$toast("新增成功")
|
|
|
+ setTimeout(function(){
|
|
|
+ uni.$emit("residentInfoList")
|
|
|
+ uni.navigateBack({
|
|
|
+ delta:1
|
|
|
+ })
|
|
|
+ },1500)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ residentInfoPut(params).then(res=>{
|
|
|
+ if(res.code==200){
|
|
|
+ this.$toast("修改成功")
|
|
|
+ setTimeout(function(){
|
|
|
+ uni.$emit("residentInfoList")
|
|
|
+ uni.navigateBack({
|
|
|
+ delta:1
|
|
|
+ })
|
|
|
+ },1500)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getPreview(idx,arr) {
|
|
|
+ var newArr=[];
|
|
|
+ arr.forEach(ite=>{
|
|
|
+ var ds=this.baseUrl+ite
|
|
|
+ newArr.push(ds)
|
|
|
+ })
|
|
|
+ uni.previewImage({
|
|
|
+ urls: newArr,
|
|
|
+ current:idx,
|
|
|
+ success: function(data) {},
|
|
|
+ fail: function(err) {}
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getDelFn(idx,type){
|
|
|
+ var that=this;
|
|
|
+ uni.showModal({
|
|
|
+ title: '确认删除',
|
|
|
+ content: "是否确认删除",
|
|
|
+ cancelText: '取消',
|
|
|
+ confirmText: '确认',
|
|
|
+ success: function(res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ that.phofile.splice(idx,1)
|
|
|
+ } else if (res.cancel) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getaddImage(type){
|
|
|
+ if(this.isdisabled){
|
|
|
+ return
|
|
|
+ }
|
|
|
let that = this;
|
|
|
- // var rs=['D:\\idcard.png']
|
|
|
- // if(rs&&rs.length>0){
|
|
|
- // var obj={
|
|
|
- // type:e,
|
|
|
- // // url:baseUrl+rs.join(',')
|
|
|
- // url:rs.join(',')
|
|
|
- // }
|
|
|
- // that.getOcrIdCard(obj)
|
|
|
- // }
|
|
|
- // return
|
|
|
- let file = [],
|
|
|
- count = 9
|
|
|
+ let file =[],count=9
|
|
|
uni.chooseImage({
|
|
|
- count: 1,
|
|
|
- success: function(res) {
|
|
|
- let img = res.tempFilePaths;
|
|
|
- if (img.length + file.length > count) {
|
|
|
+ success:function(res){
|
|
|
+ let img= res.tempFilePaths;
|
|
|
+ if(img.length + file.length > count){
|
|
|
uni.showToast({
|
|
|
- title: '最多上传' + count + '张图片',
|
|
|
+ title: '最多上传'+count+'张图片',
|
|
|
icon: 'none',
|
|
|
duration: 2000
|
|
|
})
|
|
|
- } else {
|
|
|
+ }else{
|
|
|
let imglen = res.tempFilePaths.length;
|
|
|
var fuwufile = [];
|
|
|
- uploadIdentify('/common/upload', img, 0, 0, 0, imglen, fuwufile, function(rs) {
|
|
|
- var resurl = rs[0];
|
|
|
- if (e == 'front') {
|
|
|
- that.datainfo.front = resurl.fileName;
|
|
|
- } else {
|
|
|
- that.datainfo.back = resurl.fileName;
|
|
|
- }
|
|
|
- if (rs && rs.length > 0) {
|
|
|
- var obj = {
|
|
|
- type: e,
|
|
|
- url: resurl.urlOnline
|
|
|
- }
|
|
|
- that.getOcrIdCard(obj)
|
|
|
- }
|
|
|
- })
|
|
|
+ uploadmore('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
|
|
|
+ that.phofile = that.phofile.concat(rs);
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- getOcrIdCard(obj) {
|
|
|
- var params = {
|
|
|
- image: obj.url,
|
|
|
- idCardSide: obj.type
|
|
|
- }
|
|
|
- getOcrIdCard(params).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- var datainfo = res.data;
|
|
|
- if (obj.type == 'front') {
|
|
|
- this.datainfo.realName = datainfo.realName;
|
|
|
- this.datainfo.idCard = datainfo.idCard;
|
|
|
- this.datainfo.address = datainfo.address;
|
|
|
- } else {
|
|
|
- this.datainfo.expirationDate = datainfo.expirationDate
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ // getaddImage(e) {
|
|
|
+ // let that = this;
|
|
|
+ // let file = [],
|
|
|
+ // count = 9
|
|
|
+ // uni.chooseImage({
|
|
|
+ // count: 1,
|
|
|
+ // success: function(res) {
|
|
|
+ // let img = res.tempFilePaths;
|
|
|
+ // if (img.length + file.length > count) {
|
|
|
+ // uni.showToast({
|
|
|
+ // title: '最多上传' + count + '张图片',
|
|
|
+ // icon: 'none',
|
|
|
+ // duration: 2000
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // let imglen = res.tempFilePaths.length;
|
|
|
+ // var fuwufile = [];
|
|
|
+ // uploadIdentify('/common/upload', img, 0, 0, 0, imglen, fuwufile, function(rs) {
|
|
|
+ // var resurl = rs[0];
|
|
|
+ // if (e == 'front') {
|
|
|
+ // that.datainfo.front = resurl.fileName;
|
|
|
+ // } else {
|
|
|
+ // that.datainfo.back = resurl.fileName;
|
|
|
+ // }
|
|
|
+ // if (rs && rs.length > 0) {
|
|
|
+ // var obj = {
|
|
|
+ // type: e,
|
|
|
+ // url: resurl.urlOnline
|
|
|
+ // }
|
|
|
+ // that.getOcrIdCard(obj)
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // },
|
|
|
+ // getOcrIdCard(obj) {
|
|
|
+ // var params = {
|
|
|
+ // image: obj.url,
|
|
|
+ // idCardSide: obj.type
|
|
|
+ // }
|
|
|
+ // getOcrIdCard(params).then(res => {
|
|
|
+ // if (res.code == 200) {
|
|
|
+ // var datainfo = res.data;
|
|
|
+ // if (obj.type == 'front') {
|
|
|
+ // this.datainfo.realName = datainfo.realName;
|
|
|
+ // this.datainfo.idCard = datainfo.idCard;
|
|
|
+ // this.datainfo.address = datainfo.address;
|
|
|
+ // } else {
|
|
|
+ // this.datainfo.expirationDate = datainfo.expirationDate
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -240,6 +522,8 @@
|
|
|
</style>
|
|
|
<style lang="scss" scoped>
|
|
|
.bga{background-color: #46CB99;}
|
|
|
+.check /deep/ .select-wrap{border: none;width: 100%;}
|
|
|
+.mh35{min-height: 70rpx;display: flex;align-items: center;}
|
|
|
.check /deep/ .uni-forms-item{min-height: 106rpx;box-sizing: border-box;display: flex;align-items: center;margin-bottom: 0;border-bottom: 2rpx solid #E6E6E6;padding:10rpx 0;}
|
|
|
// .check .cbox /deep/ .uni-forms-item:last-child{border: none;}
|
|
|
.check /deep/ .uni-forms-item__label{font-weight: bold;font-size: 26rpx;color: #222327;flex: 0 0 auto;width: auto !important;}
|