addpeople.vue 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941
  1. <template>
  2. <view class="vac-form">
  3. <!-- 展示内容 -->
  4. <view v-if="edidflag" class="boxa">
  5. <uni-forms :modelValue="formData" label-width="110" class="boxflex1">
  6. <!-- 基本信息 -->
  7. <uni-group title="基本信息" top="0">
  8. <uni-forms-item required label="身份证号">
  9. <view class="form_zhan" :class="formData.idCard?'':'nodata'">{{formData.idCard||'暂无信息'}}</view>
  10. </uni-forms-item>
  11. <uni-forms-item required label="姓名">
  12. <view class="form_zhan" :class="formData.userName?'':'nodata'">{{formData.userName||'暂无信息'}}
  13. </view>
  14. </uni-forms-item>
  15. <uni-forms-item label="年龄">
  16. <view class="form_zhan" :class="formData.age?'':'nodata'">{{formData.age||'暂无信息'}}</view>
  17. </uni-forms-item>
  18. <uni-forms-item label="性别">
  19. <view class="form_zhan" :class="formData.gender?'':'nodata'">{{formData.gender||'暂无信息'}}</view>
  20. </uni-forms-item>
  21. <uni-forms-item label="联系号码">
  22. <view class="form_zhan" :class="formData.phoneNum?'':'nodata'">{{formData.phoneNum||'暂无信息'}}
  23. </view>
  24. </uni-forms-item>
  25. <uni-forms-item label="人员分类">
  26. <view class="form_zhan" :class="keyIndustries?'':'nodata'">{{keyIndustries||'暂无信息'}}</view>
  27. </uni-forms-item>
  28. </uni-group>
  29. <view>
  30. <view class="addtit">户籍信息</view>
  31. <view class="npd15">
  32. <uni-forms-item required label="户籍地址">
  33. <view class="form_zhan" :class="birAddress?'':'nodata'">{{birAddress||'暂无信息'}}</view>
  34. </uni-forms-item>
  35. <uni-forms-item label="详细地址" label-position="top">
  36. <view class="form_zhan form_right" :class="formData.nowIn?'':'nodata'">
  37. {{formData.nowIn||'暂无信息'}}
  38. </view>
  39. </uni-forms-item>
  40. </view>
  41. <!-- 居住地 -->
  42. <view>
  43. <!-- 新增的 -->
  44. <!-- 多个现居地 -->
  45. <view v-for="(item,idx) in placeList" :key="idx">
  46. <view class="npd15">
  47. <!-- 多个现居地 -->
  48. <uni-forms-item required label="现居地">
  49. <view class="form_zhan" v-if="item.province">
  50. {{item.province + (item.city?item.city : '') + (item.region?item.region:'')+ (item.town?item.town:'') + (item.village?item.village:'')}}
  51. </view>
  52. <view class="form_zhan nodata" v-else>暂无信息</view>
  53. </uni-forms-item>
  54. <uni-forms-item label="详细地址" label-position="top">
  55. <view class="form_zhan form_right" :class="item.nowIn?'':'nodata'">
  56. {{item.nowIn||'暂无信息'}}
  57. </view>
  58. </uni-forms-item>
  59. </view>
  60. <view class="nowadd">
  61. <view class="nowaddl" v-if="idx!=0">
  62. <image :src="ndelimg" class="nowaddlimg"></image>
  63. <view class="nowaddltit ea0">删除现居地</view>
  64. </view>
  65. <view style="flex:1"></view>
  66. <view class="nowaddl">
  67. <image :src="naddimg" class="nowaddlimg"></image>
  68. <view class="nowaddltit b0">新增现居地</view>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. <view class="npd15">
  74. <uni-forms-item label="户主">
  75. <view class="form_zhan" :class="formData.houseType?'':'nodata'">
  76. {{formData.houseType||'暂无信息'}}
  77. </view>
  78. </uni-forms-item>
  79. <uni-forms-item required label="户编号">
  80. <view class="form_zhan" :class="formData.code?'':'nodata'">{{formData.code||'暂无信息'}}</view>
  81. </uni-forms-item>
  82. <view class="add_tit">如果不知道户编号,请用户主身份证号(默认是户主身份证号)</view>
  83. <uni-forms-item required label="与户主关系">
  84. <view class="form_zhan" :class="formData.yhzgx?'':'nodata'">{{formData.yhzgx||'暂无信息'}}
  85. </view>
  86. </uni-forms-item>
  87. <!-- 网格 -->
  88. <uni-forms-item label="网格">
  89. <view class="form_zhan" :class="gridadr?'':'nodata'">{{gridadr||'暂无信息'}}</view>
  90. </uni-forms-item>
  91. <!-- 全员核酸 -->
  92. <uni-forms-item required label="全员核酸">
  93. <view class="form_zhan" :class="isNucleicAcidFive?'':'nodata'">{{isNucleicAcidFive||'暂无信息'}}
  94. </view>
  95. </uni-forms-item>
  96. <!-- <uni-forms-item label="工作单位">
  97. <view class="form_zhan" :class="formData.workUnit?'':'nodata'">{{formData.workUnit||'暂无信息'}}
  98. </view>
  99. </uni-forms-item> -->
  100. <uni-forms-item label="备注" label-position="top">
  101. <view class="form_zhan form_right" :class="formData.remark?'':'nodata'">
  102. {{formData.remark||'暂无信息'}}
  103. </view>
  104. </uni-forms-item>
  105. </view>
  106. </view>
  107. <!-- 站位的 -->
  108. <!-- <view style="height: 260rpx;"></view> -->
  109. </uni-forms>
  110. <view class="addbox">
  111. <button class="submit_btn btnb margin0-auto" type="primary" @click="getUpdateFn">修改</button>
  112. <button class="margin0-auto submit_btn btnc" v-if="typesta == 'edit'&&isnrl!=1&&navidx==1" type="primary" @click="getDeletFn">变更</button>
  113. </view>
  114. </view>
  115. <!--修改内容 -->
  116. <view v-else class="boxa">
  117. <uni-forms :modelValue="formData" label-width="110" class="boxflex1">
  118. <!-- 基本信息 -->
  119. <uni-group title="基本信息" top="0">
  120. <uni-forms-item required label="身份证号">
  121. <image src="@/static/image/icon_xz_pz.png" @click="takePhoto"
  122. style="z-index: 100; width: 26px; height: 22px; position: absolute; right: 5px; top: 5px; ">
  123. </image>
  124. <uni-easyinput @blur="getIdcardInfo" :inputBorder="false" style="width: 80%; z-index: 80;"
  125. v-model="formData.idCard" placeholder="请输入身份证号码"></uni-easyinput>
  126. </uni-forms-item>
  127. <uni-forms-item required label="姓名">
  128. <uni-easyinput type="text" :inputBorder="false" v-model="formData.userName" placeholder="请输入姓名">
  129. </uni-easyinput>
  130. </uni-forms-item>
  131. <!-- <uni-forms-item required label="出生日期">
  132. <uni-easyinput :clearable="false" @focus="showDatePicker" type="text" :inputBorder="false" v-model="formData.birthday" placeholder="请选择出生日期"></uni-easyinput>
  133. </uni-forms-item> -->
  134. <uni-forms-item label="年龄">
  135. <uni-easyinput type="number" :inputBorder="false" v-model="formData.age" placeholder="请输入年龄">
  136. </uni-easyinput>
  137. </uni-forms-item>
  138. <uni-forms-item label="性别">
  139. <uni-data-checkbox v-model="formData.genderIndex" :localdata="sexRange"></uni-data-checkbox>
  140. </uni-forms-item>
  141. <uni-forms-item label="联系号码">
  142. <uni-easyinput type="text" :inputBorder="false" v-model="formData.phoneNum"
  143. placeholder="请输入联系号码"></uni-easyinput>
  144. </uni-forms-item>
  145. <uni-forms-item label="人员分类">
  146. <view @click="showPropleSelect" class="pick-line">
  147. <text v-if='keyIndustries'>{{keyIndustries}}</text>
  148. <text v-else style="color: grey;">请选择人员分类</text>
  149. </view>
  150. </uni-forms-item>
  151. </uni-group>
  152. <view>
  153. <view class="addtit">户籍信息</view>
  154. <view class="npd15">
  155. <uni-forms-item required label="户籍地址">
  156. <view @click="showPicker('hj')" class="pick-line">
  157. <text v-if='birAddress'>{{birAddress}}</text>
  158. <text v-else style="color: grey;">请选择户籍地址</text>
  159. </view>
  160. </uni-forms-item>
  161. <uni-forms-item label="详细地址" label-position="top">
  162. <textarea placeholder="请输入详细地址...." v-model="formData.nowIn"
  163. style="width: 100%; background: #F2F2F2;height:112rpx;border-radius: 10rpx;" />
  164. </uni-forms-item>
  165. </view>
  166. <!-- 居住地 -->
  167. <view>
  168. <!-- 多个现居地 -->
  169. <!-- <view class="npd15">
  170. <uni-forms-item required label="现居地">
  171. <pick-regions class="pick-line" :defaultRegion="defaultRegion" @getRegion="regionPickerChange">
  172. <view>
  173. <text
  174. v-if='formData.province'>{{formData.province + formData.city + formData.region}}</text>
  175. <text v-else style="color: grey;">请选择省市区</text>
  176. </view>
  177. </pick-regions>
  178. </uni-forms-item>
  179. <uni-forms-item label="详细地址" label-position="top">
  180. <textarea placeholder="请输入详细地址...." v-model="formData.nowIn"
  181. style="width: 100%;background: #F2F2F2;height: 112rpx;border-radius: 10rpx; " />
  182. </uni-forms-item>
  183. </view>
  184. <view class="nowadd nowr" >
  185. <view class="nowaddl" @click="getAddFn">
  186. <image :src="naddimg" class="nowaddlimg"></image>
  187. <view class="nowaddltit b0">新增现居地</view>
  188. </view>
  189. </view> -->
  190. <!-- 新增的 -->
  191. <!-- 多个现居地 -->
  192. <view v-for="(item,idx) in placeList" :key="idx">
  193. <view class="npd15">
  194. <uni-forms-item required label="现居地">
  195. <view @click="showPicker('xj',idx)" class="pick-line">
  196. <text
  197. v-if='item.province'>{{item.province + (item.city?item.city : '') + (item.region?item.region:'')+ (item.town?item.town:'') + (item.village?item.village:'')}}</text>
  198. <text v-else style="color: grey;">请选择现居地址</text>
  199. </view>
  200. <!-- <pick-regions class="pick-line" :defaultRegion="defaultRegion" @getRegion="regionPickerChange(idx)">
  201. <view>
  202. <text
  203. v-if='item.province'>{{item.province + item.city + item.region}}</text>
  204. <text v-else style="color: grey;">请选择所在区域</text>
  205. </view>
  206. </pick-regions> -->
  207. </uni-forms-item>
  208. <uni-forms-item label="详细地址" label-position="top">
  209. <textarea placeholder="请输入详细地址...." v-model="item.nowIn"
  210. style="width: 100%;background: #F2F2F2;height: 112rpx;border-radius: 10rpx; " />
  211. </uni-forms-item>
  212. </view>
  213. <view class="nowadd">
  214. <view class="nowaddl" @click="getDelFn(idx)" v-if="idx!=0">
  215. <image :src="ndelimg" class="nowaddlimg"></image>
  216. <view class="nowaddltit ea0">删除现居地</view>
  217. </view>
  218. <view style="flex:1"></view>
  219. <view class="nowaddl" @click="getAddFn">
  220. <image :src="naddimg" class="nowaddlimg"></image>
  221. <view class="nowaddltit b0">新增现居地</view>
  222. </view>
  223. </view>
  224. </view>
  225. </view>
  226. <view class="npd15">
  227. <uni-forms-item label="户主">
  228. <uni-data-checkbox v-model="formData.houseTypeValue" @change="changeCode()"
  229. :localdata="isUPN">
  230. </uni-data-checkbox>
  231. </uni-forms-item>
  232. <uni-forms-item required label="户编号">
  233. <!-- disabled -->
  234. <uni-easyinput :inputBorder="false" type="text" v-model="formData.code"
  235. placeholder="请输入户编号">
  236. </uni-easyinput>
  237. </uni-forms-item>
  238. <view class="add_tit">如果不知道户编号,请用户主身份证号(默认是户主身份证号)</view>
  239. <!-- 户主关系 -->
  240. <uni-forms-item required label="与户主关系">
  241. <view @click="showYhzgxSelect" class="pick-line">
  242. <text v-if='formData.yhzgx'>{{formData.yhzgx}}</text>
  243. <text v-else style="color: grey;">请选择与户主关系</text>
  244. </view>
  245. </uni-forms-item>
  246. <!-- 网格 -->
  247. <uni-forms-item label="网格">
  248. <view @click="showGridSelect" class="pick-line">
  249. <text v-if='gridadr'>{{gridadr}}</text>
  250. <text v-else style="color: grey;">请选择网格</text>
  251. </view>
  252. </uni-forms-item>
  253. <!-- 全员核酸 -->
  254. <uni-forms-item required label="全员核酸">
  255. <view @click="showTotalSelect" :class="isNucleicflag?'pick_disable pick-line':'pick-line'">
  256. <text v-if='isNucleicAcidFive'>{{isNucleicAcidFive}}</text>
  257. <text v-else style="color: grey;">是否5天一次核酸检测</text>
  258. </view>
  259. </uni-forms-item>
  260. <!-- <uni-forms-item label="工作单位">
  261. <uni-easyinput type="text" :inputBorder="false" v-model="formData.workUnit"
  262. placeholder="请输入工作单位"></uni-easyinput>
  263. </uni-forms-item> -->
  264. <uni-forms-item label="备注" label-position="top">
  265. <textarea placeholder="请输入备注信息...." v-model="formData.remark"
  266. style="width: 100%;background: #F2F2F2;height: 160rpx;border-radius: 10rpx;" />
  267. </uni-forms-item>
  268. </view>
  269. </view>
  270. <!-- <view style="height:196rpx;"></view> -->
  271. </uni-forms>
  272. <view class="addbox">
  273. <button class="submit_btn btna" type="primary" v-if="typesta == 'edit'&&isnrl!=1"
  274. @click="getSureFn">修改并确认</button>
  275. <button class="submit_btn" type="primary" @click="$noMultipleClicks(submit)">提交</button>
  276. <view class="addbox_txt" @click="checkSelect">
  277. <image :src="selectimg" class="addbox_txta" v-if="selectfalg"></image>
  278. <image :src="noselectimg" class="addbox_txta" v-else></image>
  279. <view class="addbox_txta1">勾选即表示同意<text class="addbox_txt2">《用户服务协议》</text>及<text
  280. class="addbox_txt2">《隐私政策》</text></view>
  281. </view>
  282. </view>
  283. </view>
  284. <!-- 删除弹窗 -->
  285. <view class="bgbox" v-if="delfalg"></view>
  286. <view class="delbox" v-if="delfalg">
  287. <view class="deltit">变更原因</view>
  288. <image :src="delimg" class="del_img" @click="getClose"></image>
  289. <view class="del_list">
  290. <block v-for="(ite,idx) in deletelist" :key="idx">
  291. <view class="del_lista" :class="delvalue==ite.value?'act':''" @click="getDeltab(ite.value)" v-if="ite.value!=1"
  292. >{{ite.label}}</view>
  293. </block>
  294. </view>
  295. <view class="del_btn" @click="deletSure">确认</view>
  296. </view>
  297. <!-- 时间选择器-->
  298. <dataTimePicke ref="setpicker" type="date" toolBarTitle="请选择出生日期"></dataTimePicke>
  299. <!-- 人员分类 -->
  300. <selectPicker ref="peopleselet" :list="peopleclass" title="选择人员分类" @vacChange="peopleChange"></selectPicker>
  301. <!-- 户主关系 -->
  302. <!-- 人员分类 -->
  303. <selectPicker ref="yhzgxselet" :list="yhzgxclass" title="选择与户主关系" @vacChange="yhzgxChange"></selectPicker>
  304. <!-- 户籍地选择 -->
  305. <selectMuPicker ref="birselet" model="muitl-column-auto" :list="birthplace" title="选择户籍地"
  306. @vacChange="birRegion"></selectMuPicker>
  307. <areaP ref="area"></areaP>
  308. <!-- 户籍地选择 -->
  309. <selectMorePicker ref="picker" :title="auiPicker.title" :layer="auiPicker.layer" :titflag='auiPicker.titflag'
  310. :data="auiPicker.data" @callback="pickerCallback"></selectMorePicker>
  311. <!-- 网格选择 -->
  312. <selectGridPicker ref="gridpicke" :title="gridPicker.title" :layer="gridPicker.layer"
  313. :titflag='gridPicker.titflag' :data="gridPicker.data" @callback="gridCallback">
  314. </selectGridPicker>
  315. <!-- 全员核酸 -->
  316. <selectPicker ref="totalselet" :list="totallist" title="请选择" @vacChange="vacTotalChange"></selectPicker>
  317. </view>
  318. </template>
  319. <script>
  320. import selectMuPicker from '@/_components/picker/selectMutilPicker.vue'
  321. import selectMorePicker from '@/_components/picker/selectMorePicker.vue'
  322. import selectGridPicker from '@/_components/picker/selectGridPicker.vue'
  323. import selectPicker from '@/_components/picker/selectPicker.vue'
  324. import dataTimePicke from '@/_components/picker/dataTimePicke.vue'
  325. import areaP from '@/_components/picker/areaP.vue'
  326. import senSetPicker from '@/_components/picker/dateTimePicker.vue'
  327. import hUploadImage from '@/_components/hUploadImage.vue'
  328. import hostUrl from "@/util/url";
  329. import hModal from '@/_components/hModal.vue'
  330. import pickRegions from '@/components/pick-regions/pick-regions.vue' //地址弹窗
  331. import uniPopup from '@/components/uni-popup/uni-popup.vue'
  332. import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
  333. let {
  334. host,
  335. imgDomain
  336. } = hostUrl
  337. export default {
  338. components: {
  339. uniPopup,
  340. uniPopupDialog,
  341. pickRegions,
  342. senSetPicker,
  343. hUploadImage,
  344. selectPicker,
  345. hModal,
  346. selectMuPicker,
  347. dataTimePicke,
  348. areaP,
  349. selectMorePicker,
  350. selectGridPicker
  351. },
  352. data() {
  353. return {
  354. delimg: require("@/static/image/del.png"),
  355. naddimg: require("@/static/image/nowadd.png"),
  356. ndelimg: require("@/static/image/nowdel.png"),
  357. selectimg: require("@/static/image/select.png"),
  358. noselectimg: require("@/static/image/noselect.png"),
  359. placeList: [{
  360. "deptId": 0, //所选居住地最后一级的id
  361. "provinceId": 0, //居住地的省份
  362. "province": "", //居住地的省份
  363. "cityId": 0, //居住地的城市
  364. "city": "", //居住地的城市
  365. "regionId": 0, //居住地的区
  366. "region": "", //居住地的区
  367. "townId": 0, //居住地的镇
  368. "town": "", //居住地的镇
  369. "villageId": 0, //居住地的村
  370. "village": "", //居住地的村
  371. "nowIn": "", //居住地的详细地址
  372. }],
  373. selectfalg: true,
  374. delfalg: false,
  375. birAddress: '',
  376. jiciOption: [], // 剂次选项
  377. curItem: {},
  378. curIndex: 0,
  379. noClick: true, // $noMultipleClicks变量
  380. defaultRegion: ['安徽省', '安庆市', '潜山市'], // 初始值必须为空,否则更换默认值时不能生效
  381. searchRegion: [],
  382. formData: {
  383. "id": '',
  384. 'villageTowns': '',
  385. 'village': '',
  386. 'birthday': '',
  387. 'age': '',
  388. 'code': '',
  389. 'villagerGroup': '',
  390. 'houseTypeValue': 1,
  391. 'houseType': '',
  392. "yhzgx": "", //与户主关系必填
  393. // 'domicile': '',
  394. 'province': '', //户籍地的省份
  395. 'city': '',
  396. 'region': '',
  397. 'userName': '',
  398. 'genderIndex': 0,
  399. 'idCard': '',
  400. 'phoneNum': '',
  401. 'nowIn': '', //户籍地的详细地址
  402. "remark": "",
  403. "czrkJzdzList": [], //详细地址
  404. "deptId": 0, //所选户籍地最后一级的id
  405. "workUnit": "", //工作单位
  406. 'queryType': '', //新增类型
  407. },
  408. areaList: [],
  409. inputValue: '',
  410. shixian: false,
  411. imageValue: {},
  412. sexRange: [{
  413. "value": 0,
  414. "text": "男"
  415. }, {
  416. "value": 1,
  417. "text": "女"
  418. }], // 性别
  419. isUPN: [{
  420. "value": 0,
  421. "text": "是"
  422. }, {
  423. "value": 1,
  424. "text": "否"
  425. }], // 是否户主
  426. vaccination: [{
  427. "value": 0,
  428. "text": "是"
  429. }, {
  430. "value": 1,
  431. "text": "否"
  432. }], // 是否接种
  433. birthplace: [], // 户籍地
  434. delvalue: '', //删除原因
  435. peopleclass: [], //人员分类,
  436. keyIndustries: '',
  437. deletelist: [], //删除字典
  438. edidflag: false,
  439. codefalg: false, //
  440. yhzgxclass: [], //户主关系
  441. yhzgx: '',
  442. auiPicker: {
  443. title: '选择区域',
  444. layer: null,
  445. titflag: false,
  446. data: []
  447. },
  448. gridPicker: {
  449. title: '选择区域',
  450. layer: null,
  451. titflag: false,
  452. data: []
  453. },
  454. showtype: '',
  455. showidx: 0,
  456. peoplelist: [],
  457. typesta: '', //判断新增还是修改,
  458. gridadr: '', //网格显示,
  459. isNucleicAcidFive:'',//全员核酸
  460. totalselet:false,
  461. totallist:[],
  462. familyflag: false, //是否是家庭成员
  463. code: '', //户编号,
  464. optiontype: '',
  465. isnrl:0,
  466. navidx:1,
  467. isNucleicflag:false,//全员核酸 3 禁止操作
  468. }
  469. },
  470. methods: {
  471. // 新增
  472. getAddFn() {
  473. var obj = {
  474. "deptId": 0, //所选居住地最后一级的id
  475. "provinceId": 0, //居住地的省份
  476. "province": "", //居住地的省份
  477. "cityId": 0, //居住地的城市
  478. "city": "", //居住地的城市
  479. "regionId": 0, //居住地的区
  480. "region": "", //居住地的区
  481. "townId": 0, //居住地的镇
  482. "town": "", //居住地的镇
  483. "villageId": 0, //居住地的村
  484. "village": "", //居住地的村
  485. "nowIn": "", //居住地的详细地址
  486. }
  487. this.placeList.push(obj)
  488. },
  489. // 户籍选择
  490. //显示picker多级联动弹窗
  491. showPicker(e, idx) {
  492. // var num=0;
  493. // if(this.showtype==e){
  494. // if(idx&&(this.showidx!=idx)){
  495. // num=1
  496. // }else{
  497. // this.showidx=idx||0
  498. // }
  499. // }else{
  500. // this.showtype=e;//户籍还是什么
  501. // this.showidx=idx||0;
  502. // num=1
  503. // }
  504. this.showtype = e; //户籍还是什么
  505. this.showidx = idx || 0;
  506. this.$refs.picker.open(1).then(function() {
  507. });
  508. },
  509. //picker多级联动回调
  510. pickerCallback(e) {
  511. const that = this;
  512. let result = '';
  513. if (that.showtype == 'hj') {
  514. // 置空
  515. that.formData.provinceId = null;
  516. that.formData.province = null;
  517. that.formData.cityId = null;
  518. that.formData.city = null;
  519. that.formData.regionId = null;
  520. that.formData.region = null;
  521. that.formData.villageTownsId = null;
  522. that.formData.villageTowns = null;
  523. that.formData.villageId = null;
  524. that.formData.village = null;
  525. that.formData.villagerGroupId = null;
  526. that.formData.villagerGroup = null;
  527. e.data.forEach(function(item, index) {
  528. if (index == 0) {
  529. result += item.name;
  530. } else {
  531. result += '/' + item.name;
  532. }
  533. switch (index) {
  534. case 0:
  535. that.formData.provinceId = e.data[0].areaid;
  536. that.formData.province = e.data[0].name;
  537. break;
  538. case 1:
  539. that.formData.cityId = e.data[1].areaid;
  540. that.formData.city = e.data[1].name;
  541. break;
  542. case 2:
  543. that.formData.regionId = e.data[2].areaid;
  544. that.formData.region = e.data[2].name;
  545. break;
  546. case 3:
  547. that.formData.villageTownsId = e.data[3].areaid;
  548. that.formData.villageTowns = e.data[3].name;
  549. break;
  550. case 4:
  551. that.formData.villageId = e.data[4].areaid;
  552. that.formData.village = e.data[4].name;
  553. break;
  554. case 5:
  555. that.formData.villagerGroupId = e.data[5].areaid;
  556. that.formData.villagerGroup = e.data[5].name;
  557. break;
  558. default:
  559. break;
  560. }
  561. });
  562. that.formData.deptId = e.data[e.data.length - 1].areaid
  563. that.birAddress = result;
  564. } else {
  565. var idx = that.showidx;
  566. var params = {}
  567. e.data.forEach(function(item, index) {
  568. switch (index) {
  569. case 0:
  570. params.provinceId = e.data[0].areaid;
  571. params.province = e.data[0].name;
  572. break;
  573. case 1:
  574. params.cityId = e.data[1].areaid;
  575. params.city = e.data[1].name;
  576. break;
  577. case 2:
  578. params.regionId = e.data[2].areaid;
  579. params.region = e.data[2].name;
  580. break;
  581. case 3:
  582. params.townId = e.data[3].areaid;
  583. params.town = e.data[3].name;
  584. break;
  585. case 4:
  586. params.villageId = e.data[4].areaid;
  587. params.village = e.data[4].name;
  588. break;
  589. case 5:
  590. params.villagerGroupId = e.data[5].areaid;
  591. params.villagerGroup = e.data[5].name;
  592. break;
  593. default:
  594. break;
  595. }
  596. });
  597. that.$nextTick(function() {
  598. params.nowIn = this.placeList[idx].nowIn
  599. params.deptId = e.data[e.data.length - 1].areaid
  600. that.placeList.splice(idx, 1, params)
  601. })
  602. }
  603. },
  604. //网格回调
  605. gridCallback(e) {
  606. var that = this;
  607. var result = ''
  608. e.data.forEach(function(item, index) {
  609. if (index == 0) {
  610. result += item.name;
  611. } else {
  612. result += '/' + item.name;
  613. }
  614. })
  615. that.gridadr = result;
  616. that.formData.gridId = e.data[e.data.length - 1].pid
  617. },
  618. getDelFn(idx) {
  619. var that = this;
  620. uni.showModal({
  621. title: '提示',
  622. content: "是否确认删除",
  623. success: function(res) {
  624. if (res.confirm) {
  625. that.placeList.splice(idx, 1)
  626. // console.log('用户点击确定');
  627. } else if (res.cancel) {
  628. // console.log('用户点击取消');
  629. }
  630. }
  631. });
  632. },
  633. getClose() {
  634. this.delfalg = false
  635. },
  636. changeCode() {
  637. if (this.formData.houseTypeValue == 0) {
  638. // if (this.familyflag) {
  639. // this.formData.code = this.formData.idCard;
  640. // return
  641. // }
  642. if (!this.formData.code) {
  643. this.formData.code = this.formData.idCard
  644. }
  645. }
  646. },
  647. takePhoto() {
  648. console.log('---------')
  649. var that = this
  650. uni.chooseImage({
  651. count: 1,
  652. sourceType: 'camera',
  653. success(res) {
  654. var file = res.tempFilePaths[0]
  655. that.ocrParse(file)
  656. }
  657. })
  658. },
  659. ocrParse(filePath) {
  660. var url = host + '/boman-file/ocrIdCard'
  661. var token = uni.getStorageSync('token')
  662. // var token = "df057579-73c8-4bdd-8312-f64db8efd699"
  663. uni.showLoading()
  664. uni.uploadFile({
  665. url: url,
  666. filePath: filePath,
  667. name: 'file',
  668. header: {
  669. // 'Content-type': 'multipart/form-data',
  670. 'Authorization': token
  671. },
  672. success: res => {
  673. uni.hideLoading()
  674. // console.log(JSON.stringify(res))
  675. var data = JSON.parse(res.data)
  676. this.formData.idCard = data.data.id
  677. this.formData.userName = data.data.name
  678. this.formData.age = this.getAge(data.data.birth)
  679. this.formData.gender = data.data.gender
  680. if (this.formData.gender == '男') {
  681. this.formData.genderIndex = 0
  682. } else {
  683. this.formData.genderIndex = 1
  684. }
  685. },
  686. fail: err => {
  687. uni.hideLoading();
  688. // console.log(JSON.stringify(err))
  689. uni.showToast({
  690. title: err.errMsg,
  691. icon: "none"
  692. })
  693. }
  694. })
  695. },
  696. checkSelect() {
  697. this.selectfalg = !this.selectfalg
  698. },
  699. getSureFn() {
  700. if (!this.formData.idCard) {
  701. uni.showToast({
  702. title: '请输入身份证号码',
  703. icon: "none"
  704. })
  705. return
  706. }
  707. let _IDRe18 =
  708. /^([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]$/
  709. 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}$/
  710. // 验证护照号
  711. let _IDreh1 = /^[a-zA-Z]{5,17}$/;
  712. let _IDreh2 = /^[a-zA-Z0-9]{5,17}$/;
  713. /** 港澳通行证验证 */
  714. let _IDreh3 = /^[HMhm]{1}([0-9]{10}|[0-9]{8})$/;
  715. /** 台湾通行证验证 */
  716. let _IDreh4 = /^[0-9]{8}$/;
  717. let _IDreh5 = /^[0-9]{10}$/;
  718. // 校验身份证:
  719. if (_IDRe18.test(this.formData.idCard) || _IDre15.test(this.formData.idCard) || _IDreh1.test(this.formData
  720. .idCard) || _IDreh2.test(this.formData.idCard) || _IDreh3.test(this.formData.idCard) || _IDreh4
  721. .test(this.formData.idCard) || _IDreh5.test(this.formData.idCard)) {
  722. // 校验身份证:
  723. // if( _IDRe18.test( this.formData.idCard ) || _IDre15.test( this.formData.idCard ) ) {
  724. } else {
  725. uni.showToast({
  726. title: '请输入正确的身份证号',
  727. icon: 'none'
  728. })
  729. return
  730. }
  731. // let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
  732. // if (reg.test(this.formData.idCard)) {
  733. // // 获取身份证信息
  734. // } else {
  735. // }
  736. if (!this.formData.userName) {
  737. uni.showToast({
  738. title: '请输入姓名',
  739. icon: "none"
  740. })
  741. return
  742. }
  743. // 验证手机号
  744. let regphone = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
  745. // 座机号
  746. let reg1=/^(0\d{2,3})-?(\d{7,8})$/
  747. if (this.formData.phoneNum && !regphone.test(this.formData.phoneNum)) {
  748. uni.showToast({
  749. title: '请输入正确的联系方式',
  750. icon: "none"
  751. })
  752. return
  753. }
  754. if (!this.birAddress) {
  755. uni.showToast({
  756. title: '请选择户籍地址',
  757. icon: "none"
  758. })
  759. return
  760. }
  761. if (this.formData.houseTypeValue == 0) {
  762. this.formData.houseType = '是'
  763. //户主
  764. } else {
  765. this.formData.houseType = '否'
  766. }
  767. if (this.formData.genderIndex == 0) {
  768. this.formData.gender = '男'
  769. } else {
  770. this.formData.gender = '女'
  771. }
  772. //
  773. var newArr = []
  774. this.placeList.forEach((item, idx) => {
  775. if (item.nowIn || item.province) {
  776. newArr.push(item)
  777. }
  778. })
  779. if (newArr.length < 1) {
  780. uni.showToast({
  781. title: '请填写现居住地',
  782. icon: "none"
  783. })
  784. return
  785. } else {
  786. this.formData.czrkJzdzList = JSON.parse(JSON.stringify(newArr))
  787. }
  788. if (!this.formData.code) {
  789. uni.showToast({
  790. title: '请输入户编号',
  791. icon: "none"
  792. })
  793. return
  794. }
  795. if (!this.formData.yhzgx) {
  796. uni.showToast({
  797. title: '请选择与户主关系',
  798. icon: "none"
  799. })
  800. return
  801. }
  802. if (!this.formData.isNucleicAcidFive) {
  803. uni.showToast({
  804. title: '请选择全员核酸',
  805. icon: "none"
  806. })
  807. return
  808. }
  809. if (!this.selectfalg) {
  810. uni.showToast({
  811. title: '请勾选同意下方协议',
  812. icon: "none"
  813. })
  814. return
  815. }
  816. var tempArr = []
  817. // console.log(JSON.stringify(this.formData))
  818. var form = JSON.parse(JSON.stringify(this.formData))
  819. form.isConfirm = 'Y'
  820. this.$http.post('boman-web-core/core/czrk/editCzrk', form).then(res => {
  821. if (res.code == 200) {
  822. uni.navigateTo({
  823. url: '/add/pages/addvacfrom/submit'
  824. })
  825. } else {
  826. uni.showToast({
  827. title: res.msg,
  828. icon: "none"
  829. })
  830. }
  831. })
  832. },
  833. submit() {
  834. if (!this.formData.idCard) {
  835. uni.showToast({
  836. title: '请输入身份证号码',
  837. icon: "none"
  838. })
  839. return
  840. }
  841. let _IDRe18 =
  842. /^([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]$/
  843. 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}$/
  844. // 验证护照号
  845. let _IDreh1 = /^[a-zA-Z]{5,17}$/;
  846. let _IDreh2 = /^[a-zA-Z0-9]{5,17}$/;
  847. /** 港澳通行证验证 */
  848. let _IDreh3 = /^[HMhm]{1}([0-9]{10}|[0-9]{8})$/;
  849. /** 台湾通行证验证 */
  850. let _IDreh4 = /^[0-9]{8}$/;
  851. let _IDreh5 = /^[0-9]{10}$/;
  852. // 校验身份证:
  853. if (_IDRe18.test(this.formData.idCard) || _IDre15.test(this.formData.idCard) || _IDreh1.test(this.formData
  854. .idCard) || _IDreh2.test(this.formData.idCard) || _IDreh3.test(this.formData.idCard) || _IDreh4
  855. .test(this.formData.idCard) || _IDreh5.test(this.formData.idCard)) {
  856. } else {
  857. uni.showToast({
  858. title: '请输入正确的身份证号',
  859. icon: 'none'
  860. })
  861. return
  862. }
  863. // let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
  864. // if (reg.test(this.formData.idCard)) {
  865. // // 获取身份证信息
  866. // } else {
  867. // }
  868. if (!this.formData.userName) {
  869. uni.showToast({
  870. title: '请输入姓名',
  871. icon: "none"
  872. })
  873. return
  874. }
  875. //验证手机号
  876. let regphone = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/
  877. let reg1=/^(0\d{2,3})-?(\d{7,8})$/
  878. if (this.formData.phoneNum && !regphone.test(this.formData.phoneNum)) {
  879. uni.showToast({
  880. title: '请输入正确的联系方式',
  881. icon: "none"
  882. })
  883. return
  884. }
  885. if (!this.birAddress) {
  886. uni.showToast({
  887. title: '请选择户籍地址',
  888. icon: "none"
  889. })
  890. return
  891. }
  892. if (this.formData.houseTypeValue == 0) {
  893. this.formData.houseType = '是'
  894. //户主
  895. } else {
  896. this.formData.houseType = '否'
  897. }
  898. if (this.formData.genderIndex == 0) {
  899. this.formData.gender = '男'
  900. } else {
  901. this.formData.gender = '女'
  902. }
  903. //
  904. var newArr = []
  905. this.placeList.forEach((item, idx) => {
  906. if (item.nowIn || item.province) {
  907. newArr.push(item)
  908. }
  909. })
  910. if (newArr.length < 1) {
  911. uni.showToast({
  912. title: '请填写现居住地',
  913. icon: "none"
  914. })
  915. return
  916. } else {
  917. this.formData.czrkJzdzList = JSON.parse(JSON.stringify(newArr))
  918. }
  919. if (!this.formData.code) {
  920. uni.showToast({
  921. title: '请输入户编号',
  922. icon: "none"
  923. })
  924. return
  925. }
  926. if (!this.formData.yhzgx) {
  927. uni.showToast({
  928. title: '请选择与户主关系',
  929. icon: "none"
  930. })
  931. return
  932. }
  933. if (!this.formData.isNucleicAcidFive) {
  934. uni.showToast({
  935. title: '请选择全员核酸',
  936. icon: "none"
  937. })
  938. return
  939. }
  940. if (!this.selectfalg) {
  941. uni.showToast({
  942. title: '请勾选同意下方协议',
  943. icon: "none"
  944. })
  945. return
  946. }
  947. var tempArr = []
  948. // console.log(JSON.stringify(this.formData))
  949. var form = JSON.parse(JSON.stringify(this.formData))
  950. form.isConfirm = 'Y'
  951. if (this.typesta == 'edit') {
  952. // 修改
  953. if(this.isnrl==1){
  954. // 未认领
  955. this.$http.post('boman-web-core/core/ryrl/editRlry',form).then(res => {
  956. if (res.code == 200) {
  957. uni.navigateTo({
  958. url: '/add/pages/addvacfrom/submit'
  959. })
  960. } else {
  961. uni.showToast({
  962. title: res.msg,
  963. icon: "none"
  964. })
  965. }
  966. })
  967. }else{
  968. this.$http.post('boman-web-core/core/czrk/editCzrk', form).then(res => {
  969. if (res.code == 200) {
  970. uni.navigateTo({
  971. url: '/add/pages/addvacfrom/submit'
  972. })
  973. } else {
  974. uni.showToast({
  975. title: res.msg,
  976. icon: "none"
  977. })
  978. }
  979. })
  980. }
  981. } else {
  982. // 新增
  983. this.$http.post('boman-web-core/core/czrk/addCzrk', form).then(res => {
  984. if (res.code == 200) {
  985. uni.navigateTo({
  986. url: '/add/pages/addvacfrom/submit'
  987. })
  988. // uni.showToast({
  989. // title: '提交成功',
  990. // icon: "none"
  991. // })
  992. // setTimeout(function() {
  993. // uni.navigateBack()
  994. // }, 1000)
  995. } else {
  996. uni.showToast({
  997. title: res.msg,
  998. icon: "none"
  999. })
  1000. }
  1001. })
  1002. }
  1003. },
  1004. // 修改
  1005. getUpdateFn() {
  1006. this.edidflag = false
  1007. },
  1008. //删除
  1009. getDeletFn() {
  1010. this.delfalg = true;
  1011. },
  1012. deletSure() {
  1013. var that = this;
  1014. if(!this.delvalue){
  1015. uni.showToast({
  1016. title:"请选择变更原因",
  1017. icon:'none'
  1018. })
  1019. return
  1020. }
  1021. var params = {
  1022. id: this.formData.id,
  1023. status: this.delvalue
  1024. }
  1025. this.$http.post('boman-web-core/core/czrk/changeCzrk', params).then(res => {
  1026. if (res.code == 200) {
  1027. uni.showToast({
  1028. title: '变更成功',
  1029. icon: "none"
  1030. })
  1031. setTimeout(function() {
  1032. // 让上个页面进行刷新
  1033. uni.$emit('refreshData');
  1034. uni.navigateBack()
  1035. }, 1000)
  1036. } else {
  1037. this.delfalg = false;
  1038. uni.showToast({
  1039. title: res.msg,
  1040. icon: "none"
  1041. })
  1042. }
  1043. })
  1044. },
  1045. delete() {
  1046. // this.$http.post('boman-web-core/core/ryrl/editRlry', this.formData).then(res=>{
  1047. // if(res.code == 200 ) {
  1048. // uni.showToast({
  1049. // title: '提交成功',
  1050. // icon: "none"
  1051. // })
  1052. // setTimeout(function() {
  1053. // uni.navigateBack()
  1054. // }, 1000)
  1055. // }
  1056. // })
  1057. },
  1058. regionPickerChange(region) {
  1059. this.searchRegion = region
  1060. // console.log(this.searchRegion, 'searchRegion')
  1061. var codeArray = this.searchRegion.map(item => item ? item.code : undefined)
  1062. var nameArray = this.searchRegion.map(item => item ? item.name : undefined)
  1063. this.formData.province = nameArray[0]
  1064. this.formData.city = nameArray[1]
  1065. this.formData.region = nameArray[2]
  1066. },
  1067. /* 获取户籍地 */
  1068. getBirthplace() {
  1069. this.$http.post('boman-system/chinaArea/treeSelect', {
  1070. pid: 0
  1071. }).then(res => {
  1072. this.auiPicker.data = res.data
  1073. })
  1074. },
  1075. /* 初始化 */
  1076. init() {
  1077. // 人员分类
  1078. this.getPeopleClass();
  1079. //地址列表
  1080. this.getBirthplace();
  1081. //删除原因
  1082. this.getDelectList();
  1083. this.gethouseTypeList();
  1084. //网格
  1085. this.getGridplace();
  1086. //全员核酸
  1087. this.getTotalFive()
  1088. },
  1089. // 回显数据字典
  1090. selectDictLabel(datas, value) {
  1091. var actions = [];
  1092. Object.keys(datas).some((key) => {
  1093. if (datas[key].dictValue == ('' + value)) {
  1094. actions.push(datas[key].dictLabel);
  1095. return true;
  1096. }
  1097. })
  1098. return actions.join('');
  1099. },
  1100. getDetail() {
  1101. this.$http.get('boman-web-core/core/czrk/getById/' + this.formData.id).then(res => {
  1102. if (res.code == 200) {
  1103. this.init()
  1104. this.formData = res.data;
  1105. if(res.data.isNucleicAcidFive&&res.data.isNucleicAcidFive=='3'){
  1106. this.isNucleicflag=true
  1107. }else{
  1108. this.isNucleicflag=false
  1109. }
  1110. this.gridadr = res.data.gridName;
  1111. if (this.formData.houseType == '是') {
  1112. this.formData.houseTypeValue = 0
  1113. } else {
  1114. this.formData.houseTypeValue = 1;
  1115. this.formData.houseType = '否'
  1116. }
  1117. if (this.formData.gender == '男') {
  1118. this.formData.genderIndex = 0
  1119. } else {
  1120. this.formData.genderIndex = 1
  1121. }
  1122. if (this.formData.czrkJzdzList && this.formData.czrkJzdzList.length) {
  1123. this.placeList = JSON.parse(JSON.stringify(this.formData.czrkJzdzList))
  1124. }
  1125. // 疫苗
  1126. // if (this.formData.isVaccination == '是') {
  1127. // this.formData.isVaccinationValue = 0
  1128. // } else {
  1129. // this.formData.isVaccinationValue = 1
  1130. // }
  1131. this.birAddress = ''
  1132. if (this.formData.province) {
  1133. this.birAddress += this.formData.province
  1134. }
  1135. if (this.formData.city) {
  1136. this.birAddress += this.formData.city
  1137. }
  1138. if (this.formData.region) {
  1139. this.birAddress += this.formData.region
  1140. }
  1141. if (this.formData.villageTowns) {
  1142. this.birAddress += this.formData.villageTowns
  1143. }
  1144. if (this.formData.village) {
  1145. this.birAddress += this.formData.village
  1146. }
  1147. if (this.formData.villagerGroup) {
  1148. this.birAddress += this.formData.villagerGroup
  1149. }
  1150. }
  1151. })
  1152. },
  1153. getDelectList() {
  1154. // 删除显示
  1155. var that = this;
  1156. this.$http.get('system/dict/data/type/person_type').then(res => {
  1157. if (res.code == 200) {
  1158. // this.delvalue = res.data[0].dictValue
  1159. this.deletelist = res.data.map(v => {
  1160. return {
  1161. label: v.dictLabel,
  1162. value: v.dictValue
  1163. }
  1164. })
  1165. }
  1166. })
  1167. },
  1168. getDeltab(e) {
  1169. this.delvalue = e;
  1170. },
  1171. //gethouseTypeList
  1172. //与户主关系
  1173. gethouseTypeList() {
  1174. //户主关系
  1175. var that = this;
  1176. this.$http.get('boman-system/dict/data/type/yuhuzhuguanxi').then(res => {
  1177. if (res.code == 200) {
  1178. if (that.formData.yhzgx) {
  1179. // that.yhzgx = that.selectDictLabel(res.data, that.formData.yhzgx)
  1180. }
  1181. this.yhzgxclass = res.data.map(v => {
  1182. return {
  1183. label: v.dictLabel,
  1184. value: v.dictValue
  1185. }
  1186. })
  1187. }
  1188. })
  1189. },
  1190. showYhzgxSelect() {
  1191. this.$refs.yhzgxselet.show()
  1192. },
  1193. yhzgxChange(e) {
  1194. var label = e[0].label;
  1195. // this.yhzgx = e[0].label;
  1196. // this.formData.yhzgx = e[0].value;
  1197. this.formData.yhzgx = label;
  1198. },
  1199. getGridplace() {
  1200. var that = this
  1201. this.$http.post('boman-web-core/gridInfo/treeSelect', {
  1202. pid: 0
  1203. }).then(res => {
  1204. that.gridPicker.data = res.data.data || res.data
  1205. })
  1206. },
  1207. getTotalFive() {
  1208. var that = this;
  1209. this.$http.get('system/dict/data/type/nucleic_acid').then(res => {
  1210. if (res.code == 200) {
  1211. if (that.formData.isNucleicAcidFive) {
  1212. that.isNucleicAcidFive = that.selectDictLabel(res.data, that.formData.isNucleicAcidFive)
  1213. }else{
  1214. that.isNucleicAcidFive=res.data[0].dictLabel
  1215. that.formData.isNucleicAcidFive=res.data[0].dictValue
  1216. }
  1217. this.totallist = res.data.map(v => {
  1218. return {
  1219. label: v.dictLabel,
  1220. value: v.dictValue
  1221. }
  1222. })
  1223. }
  1224. })
  1225. },
  1226. showTotalSelect() {
  1227. if(!this.isNucleicflag){
  1228. this.$refs.totalselet.show()
  1229. }
  1230. },
  1231. vacTotalChange(e){
  1232. this.isNucleicAcidFive=e[0].label
  1233. this.formData.isNucleicAcidFive=e[0].value;
  1234. },
  1235. // 网格
  1236. showGridSelect() {
  1237. this.$refs.gridpicke.open().then(function() {
  1238. });
  1239. },
  1240. // 人员分类
  1241. getPeopleClass() {
  1242. var that = this;
  1243. this.$http.get('system/dict/data/type/renyuanfenlei').then(res => {
  1244. if (res.code == 200) {
  1245. if (that.formData.keyIndustries) {
  1246. that.keyIndustries = that.selectDictLabel(res.data, that.formData.keyIndustries)
  1247. }
  1248. that.peoplelist = res.data;
  1249. this.peopleclass = res.data.map(v => {
  1250. return {
  1251. label: v.dictLabel,
  1252. value: v.dictValue
  1253. }
  1254. })
  1255. }
  1256. })
  1257. },
  1258. // 显示人员分类
  1259. showPropleSelect() {
  1260. // if (this.formData.id != undefined && this.formData.id != "") {
  1261. // return
  1262. // }
  1263. // this.curIndex = index
  1264. this.$refs.peopleselet.show()
  1265. },
  1266. peopleChange(e) {
  1267. var label = e[0].label;
  1268. this.keyIndustries = e[0].label;
  1269. this.formData.keyIndustries = e[0].value;
  1270. },
  1271. /* 上传后端获取身份证信息 */
  1272. getIdcardInfo(val) {
  1273. var that = this;
  1274. if (this.formData == undefined) {
  1275. return
  1276. }
  1277. if (this.formData.idCard == undefined || this.formData.idCard == '') {
  1278. return
  1279. }
  1280. // 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
  1281. let _IDRe18 =
  1282. /^([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]$/
  1283. 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}$/
  1284. // 校验身份证:
  1285. if (_IDRe18.test(this.formData.idCard) || _IDre15.test(this.formData.idCard)) {
  1286. // 获取身份证信息
  1287. var idCard = this.formData.idCard
  1288. this.$http.post('boman-web-core/core/czrk/findHjInfo', {
  1289. idCard: this.formData.idCard
  1290. }).then(res => {
  1291. if (res.code == 200) {
  1292. for(var i in res.data){
  1293. if(res.data[i]!=null){
  1294. this.formData[i]=res.data[i]
  1295. }
  1296. }
  1297. // this.formData = res.data
  1298. this.formData.idCard = idCard;
  1299. if (res.data.houseType != '是' && this.familyflag) {
  1300. this.formData.code = this.code
  1301. this.formData.houseTypeValue = 1;
  1302. this.formData.houseType = '否';
  1303. }
  1304. if (res.data.houseType != '是' && this.optiontype == 'house') {
  1305. this.formData.houseTypeValue = 0;
  1306. this.formData.houseType = '是';
  1307. }
  1308. if (this.formData.houseTypeValue == 0 && !this.formData.code) {
  1309. this.formData.code = this.formData.idCard
  1310. }
  1311. this.birAddress = ''
  1312. if (this.formData.province) {
  1313. this.birAddress += this.formData.province
  1314. }
  1315. if (this.formData.city) {
  1316. this.birAddress += this.formData.city
  1317. }
  1318. if (this.formData.region) {
  1319. this.birAddress += this.formData.region
  1320. }
  1321. if (this.formData.villageTowns) {
  1322. this.birAddress += this.formData.villageTowns
  1323. }
  1324. if (this.formData.village) {
  1325. this.birAddress += this.formData.village
  1326. }
  1327. if (this.formData.villagerGroup) {
  1328. this.birAddress += this.formData.villagerGroup
  1329. }
  1330. if (this.formData.gender == '男') {
  1331. this.formData.genderIndex = 0
  1332. } else {
  1333. this.formData.genderIndex = 1
  1334. }
  1335. if (that.formData.keyIndustries) {
  1336. that.keyIndustries = that.selectDictLabel(that.peoplelist, that.formData.keyIndustries)
  1337. } else {
  1338. that.keyIndustries = ''
  1339. }
  1340. if (that.formData.isNucleicAcidFive) {
  1341. that.isNucleicAcidFive = that.selectDictLabel(that.totallist, that.formData.isNucleicAcidFive)
  1342. } else {
  1343. that.isNucleicAcidFive=''
  1344. that.formData.isNucleicAcidFive=''
  1345. }
  1346. if (this.formData.houseType == '是') {
  1347. this.formData.houseTypeValue = 0
  1348. } else {
  1349. this.formData.houseTypeValue = 1;
  1350. this.formData.houseType = '否'
  1351. }
  1352. if (this.formData.czrkJzdzList && this.formData.czrkJzdzList.length) {
  1353. this.placeList = JSON.parse(JSON.stringify(this.formData.czrkJzdzList))
  1354. } else {
  1355. this.placeList = [];
  1356. this.getAddFn()
  1357. }
  1358. }
  1359. })
  1360. } else {
  1361. // 判断是不是护照号
  1362. // 验证护照号
  1363. let _IDreh1 = /^[a-zA-Z]{5,17}$/;
  1364. let _IDreh2 = /^[a-zA-Z0-9]{5,17}$/;
  1365. /** 港澳通行证验证 */
  1366. let _IDreh3 = /^[HMhm]{1}([0-9]{10}|[0-9]{8})$/;
  1367. /** 台湾通行证验证 */
  1368. let _IDreh4 = /^[0-9]{8}$/;
  1369. let _IDreh5 = /^[0-9]{10}$/;
  1370. // 校验身份证:
  1371. if (_IDreh1.test(this.formData.idCard)|| _IDreh2.test(this.formData.idCard) || _IDreh3.test(this.formData.idCard) || _IDreh4.test(this.formData.idCard) || _IDreh5.test(this.formData.idCard)) {
  1372. } else {
  1373. uni.showToast({
  1374. title: '请输入正确的身份证号',
  1375. icon: 'none'
  1376. })
  1377. }
  1378. }
  1379. // let reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
  1380. // if (reg.test(this.formData.idCard)) {
  1381. // } else {
  1382. // uni.showToast({
  1383. // title: '请输入正确的身份证号',
  1384. // icon: 'none'
  1385. // })
  1386. // }
  1387. // this.$http.post('boman-web-core/core/info/findHjInfo', {
  1388. // idCard: this.formData.idCard
  1389. // }).then(res => {
  1390. // if (res.code == 200) {
  1391. // this.formData.userName = res.data.userName
  1392. // this.formData.age = res.data.age
  1393. // this.formData.gender = res.data.gender
  1394. // if (this.formData.gender == '男') {
  1395. // this.formData.genderIndex = 0
  1396. // } else {
  1397. // this.formData.genderIndex = 1
  1398. // }
  1399. // }
  1400. // })
  1401. },
  1402. /* 户籍地选择组件 */
  1403. showbirPicker() {
  1404. this.$refs.birselet.show()
  1405. },
  1406. /* 成功选择户籍 */
  1407. birRegion(e) {
  1408. console.log('---------' + JSON.stringify(e))
  1409. this.formData.villageTowns = e[1].label
  1410. this.formData.village = e[2].label
  1411. this.formData.villagerGroup = e[3].label
  1412. this.birAddress = this.formData.villageTowns + this.formData.village + this.formData.villagerGroup
  1413. },
  1414. /* 出生日期组件 */
  1415. showDatePicker() {
  1416. this.$refs.setpicker.show();
  1417. },
  1418. getAge(strAge) {
  1419. var birArr = strAge.split("-");
  1420. var birYear = birArr[0];
  1421. var birMonth = birArr[1];
  1422. var birDay = birArr[2];
  1423. d = new Date();
  1424. var nowYear = d.getFullYear();
  1425. var nowMonth = d.getMonth() + 1; //记得加1
  1426. var nowDay = d.getDate();
  1427. var returnAge;
  1428. if (birArr == null) {
  1429. return false
  1430. };
  1431. var d = new Date(birYear, birMonth - 1, birDay);
  1432. if (d.getFullYear() == birYear && (d.getMonth() + 1) == birMonth && d.getDate() == birDay) {
  1433. if (nowYear == birYear) {
  1434. returnAge = 0; //
  1435. } else {
  1436. var ageDiff = nowYear - birYear; //
  1437. if (ageDiff > 0) {
  1438. if (nowMonth == birMonth) {
  1439. var dayDiff = nowDay - birDay; //
  1440. if (dayDiff < 0) {
  1441. returnAge = ageDiff - 1;
  1442. } else {
  1443. returnAge = ageDiff;
  1444. }
  1445. } else {
  1446. var monthDiff = nowMonth - birMonth; //
  1447. if (monthDiff < 0) {
  1448. returnAge = ageDiff - 1;
  1449. } else {
  1450. returnAge = ageDiff;
  1451. }
  1452. }
  1453. } else {
  1454. return "出生日期晚于今天,数据有误"; //返回-1 表示出生日期输入错误 晚于今天
  1455. }
  1456. }
  1457. return returnAge;
  1458. } else {
  1459. return ("输入的日期格式错误!");
  1460. }
  1461. }
  1462. },
  1463. onLoad(option) {
  1464. // console.log('onLoad')
  1465. if (option.code) {
  1466. // 添加家庭成员
  1467. this.formData.code = option.code;
  1468. this.formData.houseTypeValue = 1;
  1469. this.formData.houseType = '否';
  1470. this.code = option.code
  1471. this.familyflag = true;
  1472. this.edidflag = false;
  1473. this.typesta = 'add'
  1474. uni.setNavigationBarTitle({
  1475. title: '新增'
  1476. })
  1477. this.init()
  1478. } else if (option.id) {
  1479. //修改
  1480. this.formData.id = option.id;
  1481. this.edidflag = true;
  1482. this.typesta = 'edit'
  1483. this.isnrl=option.isnrl;
  1484. this.navidx=option.navidx
  1485. // 禁止所以的操作
  1486. uni.setNavigationBarTitle({
  1487. title: '修改'
  1488. })
  1489. this.getDetail()
  1490. } else {
  1491. this.edidflag = false;
  1492. this.typesta = 'add'
  1493. uni.setNavigationBarTitle({
  1494. title: '新增'
  1495. })
  1496. this.init();
  1497. if (option.type == 'house') {
  1498. // 新增户主
  1499. this.formData.houseTypeValue = 0;
  1500. this.formData.houseType = '是';
  1501. this.optiontype = option.type
  1502. // 是户主
  1503. return
  1504. }
  1505. uni.showModal({
  1506. title: '提示',
  1507. content: "此页面最好新增户主,如若不知户编号,想新增家庭成员,请到人员信息户籍列表,根据户主身份证查询,再点击查看添加家庭成员",
  1508. success: function(res) {
  1509. if (res.confirm) {} else if (res.cancel) {
  1510. }
  1511. }
  1512. })
  1513. }
  1514. },
  1515. mounted() {
  1516. // if (this.formData.id) { // “编辑”模式下,先获取详情,再获取选项列表
  1517. // this.getDetail()
  1518. // } else { // “新增”模式下,获取选项列表
  1519. // this.init()
  1520. // }
  1521. }
  1522. }
  1523. </script>
  1524. <style>
  1525. .vac-form textarea {
  1526. display: block;
  1527. padding: 16rpx 36rpx;
  1528. font-size: 28rpx;
  1529. box-sizing: border-box;
  1530. }
  1531. </style>
  1532. <style scoped lang="scss">
  1533. // 新修改的
  1534. .add_tit {
  1535. font-size: 22rpx;
  1536. color: #f00;
  1537. margin-bottom: 16rpx;
  1538. }
  1539. .npd15 {
  1540. padding: 15px;
  1541. background-color: #FFFFFF;
  1542. }
  1543. .addtit {
  1544. /* #ifndef APP-NVUE */
  1545. display: flex;
  1546. /* #endif */
  1547. flex-direction: row;
  1548. align-items: center;
  1549. padding-left: 15px;
  1550. height: 40px;
  1551. background-color: $uni-bg-color-grey;
  1552. font-weight: normal;
  1553. color: $uni-text-color;
  1554. }
  1555. .nowadd {
  1556. display: flex;
  1557. align-items: center;
  1558. background: #F2F2F2;
  1559. padding: 0px 15px;
  1560. justify-content: space-between;
  1561. height: 84rpx;
  1562. &.nowr {
  1563. justify-content: flex-end;
  1564. }
  1565. .nowaddl {
  1566. display: flex;
  1567. align-items: center;
  1568. .nowaddlimg {
  1569. width: 32rpx;
  1570. height: 32rpx;
  1571. margin-right: 16rpx;
  1572. }
  1573. .nowaddltit {
  1574. font-size: 28rpx;
  1575. &.ea0 {
  1576. color: #EA0606;
  1577. }
  1578. &.b0 {
  1579. color: #00B034;
  1580. }
  1581. }
  1582. }
  1583. }
  1584. .boxa {
  1585. display: flex;
  1586. flex-direction: column;
  1587. height: 100vh;
  1588. }
  1589. .boxflex1 {
  1590. flex: 1;
  1591. overflow-y: auto;
  1592. }
  1593. .addbox {
  1594. padding: 20rpx 34rpx;
  1595. z-index: 1;
  1596. background: #ffffff;
  1597. box-shadow: 0 14rpx 40rpx 12rpx rgba(218, 218, 218, 1);
  1598. flex: 0 0 auto;
  1599. }
  1600. .submit_btn {
  1601. width: 100%;
  1602. height: 96rpx;
  1603. border-radius: 6rpx;
  1604. font-size: 34rpx;
  1605. }
  1606. .btna {
  1607. background: #009FE8;
  1608. margin-bottom: 20rpx;
  1609. }
  1610. .btnb {
  1611. background: #00B034;
  1612. }
  1613. .btnc {
  1614. margin-top: 20rpx;
  1615. background: #EA2929;
  1616. }
  1617. // .submit_btns {
  1618. // width: 684rpx;
  1619. // height: 98rpx;
  1620. // border-radius: 6rpx;
  1621. // font-size: 34rpx;
  1622. // }
  1623. .bgbox {
  1624. position: fixed;
  1625. left: 0;
  1626. right: 0;
  1627. top: 0;
  1628. bottom: 0;
  1629. background: rgba(0, 0, 0, 0.2);
  1630. z-index: 3;
  1631. }
  1632. .delbox {
  1633. width: 580rpx;
  1634. background: #FFFFFF;
  1635. border-radius: 14px;
  1636. position: fixed;
  1637. top: 50%;
  1638. left: 80rpx;
  1639. right: 80rpx;
  1640. padding: 48rpx 34rpx 72rpx;
  1641. box-sizing: border-box;
  1642. z-index: 5;
  1643. margin-top: -210rpx;
  1644. .deltit {
  1645. font-size: 28rpx;
  1646. font-weight: bold;
  1647. color: #343434;
  1648. text-align: center;
  1649. line-height: 40rpx;
  1650. }
  1651. .del_img {
  1652. width: 34rpx;
  1653. height: 34rpx;
  1654. position: absolute;
  1655. right: 34rpx;
  1656. top: 44rpx;
  1657. }
  1658. .del_btn {
  1659. width: 100%;
  1660. height: 76rpx;
  1661. background: #00B034;
  1662. border-radius: 6rpx;
  1663. font-size: 28rpx;
  1664. font-weight: bold;
  1665. color: #FFFFFF;
  1666. text-align: center;
  1667. line-height: 76rpx;
  1668. }
  1669. .del_list {
  1670. display: flex;
  1671. padding: 60rpx 0 40rpx;
  1672. flex-wrap: wrap;
  1673. .del_lista {
  1674. width: 116rpx;
  1675. height: 64rpx;
  1676. background: #CACACA;
  1677. border-radius: 32rpx;
  1678. font-size: 26rpx;
  1679. font-weight: 500;
  1680. color: #FFFFFF;
  1681. text-align: center;
  1682. line-height: 64rpx;
  1683. margin: 0 10rpx 20rpx 0;
  1684. &.act {
  1685. background-color: #019FE8;
  1686. }
  1687. }
  1688. }
  1689. }
  1690. .form_zhan {
  1691. flex: 1;
  1692. width: 100%;
  1693. display: flex;
  1694. box-sizing: border-box;
  1695. min-height: 72rpx;
  1696. flex-direction: row;
  1697. align-items: center;
  1698. font-size: 28rpx;
  1699. color: #343434;
  1700. &.nodata {
  1701. color: #999999;
  1702. }
  1703. &.form_right {
  1704. background-color: rgb(242, 242, 242);
  1705. height: 120rpx;
  1706. padding: 10rpx;
  1707. align-items: flex-start;
  1708. }
  1709. }
  1710. .pick-line {
  1711. width: 100%;
  1712. height: 100%;
  1713. display: flex;
  1714. flex-direction: row;
  1715. align-items: center;
  1716. padding-left: 20rpx;
  1717. }
  1718. .from_image {
  1719. width: 30rpx;
  1720. height: 30rpx;
  1721. }
  1722. .delPop {
  1723. z-index: 2;
  1724. top: -10rpx;
  1725. right: -10rpx;
  1726. .circleRed {
  1727. width: 40rpx;
  1728. height: 40rpx;
  1729. background-color: red;
  1730. border-radius: 50%;
  1731. &::after,
  1732. &::before {
  1733. content: '';
  1734. width: 25rpx;
  1735. height: 5rpx;
  1736. position: absolute;
  1737. background-color: white;
  1738. top: 50%;
  1739. left: 50%;
  1740. // transform-origin:center;
  1741. }
  1742. &::after {
  1743. transform: translate(-50%, -50%) rotate(45deg);
  1744. }
  1745. &::before {
  1746. transform: translate(-50%, -50%) rotate(-45deg);
  1747. }
  1748. }
  1749. }
  1750. .img-add {
  1751. width: 120rpx;
  1752. height: 120rpx;
  1753. margin: 10rpx 3% 10rpx 0;
  1754. border-radius: 10rpx;
  1755. overflow: hidden;
  1756. background-color: #f7f7f7;
  1757. display: flex;
  1758. flex-direction: column;
  1759. justify-content: center;
  1760. .add {
  1761. padding-top: 0rpx;
  1762. display: flex;
  1763. flex-direction: column;
  1764. align-items: center;
  1765. image {}
  1766. .font {
  1767. color: #8a8a8a;
  1768. font-size: 26rpx;
  1769. }
  1770. }
  1771. }
  1772. .addbox_txt {
  1773. display: flex;
  1774. align-items: center;
  1775. justify-content: center;
  1776. margin-top: 24rpx;
  1777. .addbox_txta {
  1778. width: 28rpx;
  1779. height: 28rpx;
  1780. margin-right: 14rpx;
  1781. }
  1782. .addbox_txta1 {
  1783. font-size: 24rpx;
  1784. color: #666666;
  1785. .addbox_txt2 {
  1786. color: #009FE8;
  1787. }
  1788. }
  1789. }
  1790. .pick_disable{background-color: #f5f7fa;color: #c0c4cc;}
  1791. </style>