residentdetail.vue 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250
  1. <template>
  2. <view class="vac-form">
  3. <!-- 展示内容 -->
  4. <uni-forms :modelValue="formData" label-width="110">
  5. <!-- 基本信息 -->
  6. <uni-group title="基本信息" top="0">
  7. <uni-forms-item required label="身份证号">
  8. <view class="form_zhan" :class="formData.idCard?'':'nodata'">{{formData.idCard||'暂无信息'}}</view>
  9. </uni-forms-item>
  10. <uni-forms-item required label="姓名">
  11. <view class="form_zhan" :class="formData.userName?'':'nodata'">{{formData.userName||'暂无信息'}}
  12. </view>
  13. </uni-forms-item>
  14. <uni-forms-item label="年龄">
  15. <view class="form_zhan" :class="formData.age?'':'nodata'">{{formData.age||'暂无信息'}}</view>
  16. </uni-forms-item>
  17. <uni-forms-item label="性别">
  18. <view class="form_zhan" :class="formData.gender?'':'nodata'">{{formData.gender||'暂无信息'}}</view>
  19. </uni-forms-item>
  20. <uni-forms-item label="联系号码">
  21. <view class="form_zhan" :class="formData.phoneNum?'':'nodata'">{{formData.phoneNum||'暂无信息'}}
  22. </view>
  23. </uni-forms-item>
  24. <uni-forms-item label="人员分类">
  25. <view class="form_zhan" :class="keyIndustries?'':'nodata'">{{keyIndustries||'暂无信息'}}</view>
  26. </uni-forms-item>
  27. </uni-group>
  28. <!-- 户籍信息 -->
  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'">{{formData.nowIn||'暂无信息'}}
  37. </view>
  38. </uni-forms-item>
  39. </view>
  40. <!-- 居住地 -->
  41. <view>
  42. <!-- 新增的 -->
  43. <!-- 多个现居地 -->
  44. <view v-for="(item,idx) in formData.czrkJzdzList" style="padding: 10rpx 0;">
  45. <view class="npd15">
  46. <uni-forms-item label="现居地">
  47. <view class="form_zhan" :class="!item.province&&!item.city&&!item.region&&!item.town&&!item.village?'nodata':''">
  48. {{!item.province&&!item.city&&!item.region&&!item.town&&!item.village?'暂无信息':item.province + item.city + item.region+ item.town + item.village}}</view>
  49. </uni-forms-item>
  50. <uni-forms-item label="详细地址" label-position="top">
  51. <view class="form_zhan form_right" :class="item.nowIn?'':'nodata'">{{item.nowIn||'暂无信息'}}</view>
  52. </uni-forms-item>
  53. </view>
  54. </view>
  55. </view>
  56. <view class="npd15">
  57. <uni-forms-item label="户主">
  58. <view class="form_zhan" :class="formData.houseType?'':'nodata'">{{formData.houseType||'暂无信息'}}
  59. </view>
  60. </uni-forms-item>
  61. <uni-forms-item label="户编号">
  62. <view class="form_zhan" :class="formData.code?'':'nodata'">{{formData.code||'暂无信息'}}</view>
  63. </uni-forms-item>
  64. <uni-forms-item label="与户主关系">
  65. <view class="form_zhan" :class="formData.yhzgx?'':'nodata'">{{formData.yhzgx||'暂无信息'}}
  66. </view>
  67. </uni-forms-item>
  68. <!-- 网格 -->
  69. <uni-forms-item label="网格">
  70. <view class="form_zhan" :class="formData.gridName?'':'nodata'">{{formData.gridName||'暂无信息'}}</view>
  71. </uni-forms-item>
  72. <!-- <uni-forms-item label="工作单位">
  73. <view class="form_zhan" :class="formData.workUnit?'':'nodata'">{{formData.workUnit||'暂无信息'}}
  74. </view>
  75. </uni-forms-item> -->
  76. <uni-forms-item label="备注" label-position="top">
  77. <view class="form_zhan form_right" :class="formData.remark?'':'nodata'">{{formData.remark||'暂无信息'}}</view>
  78. </uni-forms-item>
  79. </view>
  80. </view>
  81. <!-- 操作信息 -->
  82. <uni-group title="操作信息">
  83. <uni-forms-item label="操作人员">
  84. <view class="form_zhan" :class="formData.updateBy?'':'nodata'">{{formData.updateBy||'暂无信息'}}
  85. </view>
  86. </uni-forms-item>
  87. <uni-forms-item label="操作日期" v-if="formData.updateTime">
  88. <view class="form_zhan" :class="formData.updateTime?'':'nodata'">{{rTime('YYYY-mm-dd',formData.updateTime)||'暂无信息'}}</view>
  89. </uni-forms-item>
  90. <uni-forms-item label="操作日期" v-else>
  91. <view class="form_zhan" :class="formData.createTime?'':'nodata'">{{rTime('YYYY-mm-dd',formData.createTime)||'暂无信息'}}</view>
  92. </uni-forms-item>
  93. </uni-group>
  94. </uni-forms>
  95. </view>
  96. </template>
  97. <script>
  98. // import senSetPicker from '../../_components/picker/dateTimePicker.vue'
  99. // import hUploadImage from '../../_components/hUploadImage.vue'
  100. // import selectMuPicker from '../../_components/picker/selectMutilPicker.vue'
  101. // import selectPicker from '../../_components/picker/selectPicker.vue'
  102. // import hModal from '../../_components/hModal.vue'
  103. // import dataTimePicke from '../../_components/picker/dataTimePicke.vue'
  104. // import areaP from '../../_components/picker/areaP.vue'
  105. // import pickRegions from '@/components/pick-regions/pick-regions.vue'
  106. // import uniPopup from '@/components/uni-popup/uni-popup.vue'
  107. // import uniPopupDialog from '@/components/uni-popup/uni-popup-dialog.vue'
  108. import hostUrl from "@/util/url";
  109. let {
  110. host,
  111. imgDomain
  112. } = hostUrl
  113. export default {
  114. components: {
  115. // uniPopup,
  116. // uniPopupDialog,
  117. // pickRegions,
  118. // senSetPicker,
  119. // hUploadImage,
  120. // selectPicker,
  121. // hModal,
  122. // selectMuPicker,
  123. // dataTimePicke,
  124. // areaP
  125. },
  126. data() {
  127. return {
  128. delimg: require("@/static/image/del.png"),
  129. delfalg: false,
  130. birAddress: '',
  131. jiciOption: [], // 剂次选项
  132. curItem: {},
  133. curIndex: 0,
  134. noClick: true, // $noMultipleClicks变量
  135. defaultRegion: ['安徽省', '安庆市', '潜山市'], // 初始值必须为空,否则更换默认值时不能生效
  136. searchRegion: [],
  137. formData: {
  138. "id": '',
  139. 'villageTowns': '',
  140. 'village': '',
  141. 'birthday': '',
  142. 'age': '',
  143. 'code': '',
  144. 'villagerGroup': '',
  145. 'houseTypeValue': 1,
  146. 'houseType': '',
  147. 'domicile': '',
  148. 'province': '',
  149. 'city': '',
  150. 'region': '',
  151. 'userName': '',
  152. 'genderIndex': 0,
  153. 'idCard': '',
  154. 'phoneNum': '',
  155. 'keyIndustries': '',
  156. "isVaccinationValue": 0,
  157. "isVaccination": "是",
  158. // "vaccinationPlace": null,
  159. // "contraindication": null,
  160. // "suspend": "",
  161. "death": "",
  162. "lostInMissing": "",
  163. "shouldBe": "",
  164. "other": "",
  165. // "nowIn": "安徽省安庆市潜山市现居地",
  166. 'nowIn': '',
  167. "remark": "",
  168. "status": "",
  169. "createBy": null,
  170. "createTime": null,
  171. "updateBy": null,
  172. "updateTime": null,
  173. "isDel": null,
  174. // "urlArr":[], // 禁忌症文件上传地址
  175. // 'url': [],//提交的数据
  176. // "suspendUrlArr": [], // 暂缓接种附件
  177. // 'suspendUrl': [],// 提交的数据
  178. // "otherUrlArr": [], // 其他附件
  179. // 'otherUrl': [],// 提交的数据
  180. // "vaccineInfoUserList": [{
  181. // "vaccineName": "",
  182. // "vaccinationTime": "",
  183. // "vaccinationPlace": "",
  184. // "jici": "",
  185. // 'progressValue': 1,
  186. // "progress": "未完成",
  187. // 'urlArr': [],// 附件
  188. // 'isDel': 'N'
  189. // }],
  190. // "code": "123",
  191. // "crowd_classification": "人群分类"
  192. },
  193. areaList: [],
  194. inputValue: '',
  195. shixian: false,
  196. imageValue: {},
  197. sexRange: [{
  198. "value": 0,
  199. "text": "男"
  200. }, {
  201. "value": 1,
  202. "text": "女"
  203. }], // 性别
  204. isUPN: [{
  205. "value": 0,
  206. "text": "是"
  207. }, {
  208. "value": 1,
  209. "text": "否"
  210. }], // 是否户主
  211. vaccination: [{
  212. "value": 0,
  213. "text": "是"
  214. }, {
  215. "value": 1,
  216. "text": "否"
  217. }], // 是否接种
  218. vacPro: [{
  219. "value": 0,
  220. "text": "已完成"
  221. }, {
  222. "value": 1,
  223. "text": "未完成"
  224. }], // 接种进度
  225. vacTitle: [], // 疫苗名称
  226. birthplace: [], // 户籍地
  227. trades: [], // 重点行业
  228. contraindication: [], // 禁忌症
  229. othersOption: [], // 其他原因
  230. moratorium: [], // 暂缓接种
  231. vacTimes: [], // 接种疫苗剂次
  232. vacArea: [], // 疫苗接种地点
  233. modalContent: '',
  234. delvalue: '', //删除原因
  235. peopleclass: [], //人员分类,
  236. keyIndustries: '',
  237. deletelist: [], //删除字典
  238. edidflag: true,
  239. codefalg:false, //
  240. }
  241. },
  242. methods: {
  243. getClose() {
  244. this.delfalg = false
  245. },
  246. rTime(format,date) {
  247. date=new Date(date);
  248. const dataItem = {
  249. 'Y+': date.getFullYear().toString(),
  250. 'm+': (date.getMonth() + 1).toString(),
  251. 'd+': date.getDate().toString(),
  252. 'H+': date.getHours().toString(),
  253. 'M+': date.getMinutes().toString(),
  254. 'S+': date.getSeconds().toString(),
  255. };
  256. Object.keys(dataItem).forEach((item) => {
  257. const ret = new RegExp(`(${item})`).exec(format);
  258. if (ret) {
  259. format = format.replace(ret[1], ret[1].length === 1 ? dataItem[item] : dataItem[item].padStart(ret[1].length, '0'));
  260. }
  261. });
  262. return format;
  263. },
  264. takePhoto() {
  265. console.log('---------')
  266. var that = this
  267. uni.chooseImage({
  268. count: 1,
  269. sourceType: 'camera',
  270. success(res) {
  271. var file = res.tempFilePaths[0]
  272. that.ocrParse(file)
  273. }
  274. })
  275. },
  276. ocrParse(filePath) {
  277. var url = host + '/boman-file/ocrIdCard'
  278. var token = uni.getStorageSync('token')
  279. // var token = "df057579-73c8-4bdd-8312-f64db8efd699"
  280. uni.showLoading()
  281. uni.uploadFile({
  282. url: url,
  283. filePath: filePath,
  284. name: 'file',
  285. header: {
  286. // 'Content-type': 'multipart/form-data',
  287. 'Authorization': token
  288. },
  289. success: res => {
  290. uni.hideLoading()
  291. console.log(JSON.stringify(res))
  292. var data = JSON.parse(res.data)
  293. this.formData.idCard = data.data.id
  294. this.formData.userName = data.data.name
  295. this.formData.age = this.getAge(data.data.birth)
  296. this.formData.gender = data.data.gender
  297. if (this.formData.gender == '男') {
  298. this.formData.genderIndex = 0
  299. } else {
  300. this.formData.genderIndex = 1
  301. }
  302. },
  303. fail: err => {
  304. uni.hideLoading();
  305. console.log(JSON.stringify(err))
  306. uni.showToast({
  307. title: err.errMsg,
  308. icon: "none"
  309. })
  310. }
  311. })
  312. },
  313. isVaccinationChange(e) {
  314. console.log('isVaccinationChange ' + JSON.stringify(e))
  315. console.log(this.formData.isVaccinationValue)
  316. },
  317. vacTimeChange(e) {
  318. var curItem = this.formData.vaccineInfoUserList[this.curIndex]
  319. this.$set(curItem, 'vaccinationTime', e)
  320. },
  321. submit() {
  322. if (!this.formData.idCard) {
  323. uni.showToast({
  324. title: '请输入身份证号码',
  325. icon: "none"
  326. })
  327. return
  328. }
  329. if (!this.formData.userName) {
  330. uni.showToast({
  331. title: '请输入姓名',
  332. icon: "none"
  333. })
  334. return
  335. }
  336. // if(!this.formData.code){
  337. // uni.showToast({
  338. // title: '请输入户编号',
  339. // icon: "none"
  340. // })
  341. // return
  342. // }
  343. if (!this.birAddress) {
  344. uni.showToast({
  345. title: '请选择户籍地址',
  346. icon: "none"
  347. })
  348. return
  349. }
  350. if (this.formData.houseTypeValue == 0) {
  351. this.formData.houseType = '是'
  352. //户主
  353. } else {
  354. this.formData.houseType = '否'
  355. }
  356. if (this.formData.genderIndex == 0) {
  357. this.formData.gender = '男'
  358. } else {
  359. this.formData.gender = '女'
  360. }
  361. var tempArr = []
  362. // console.log(JSON.stringify(this.formData))
  363. if (this.formData.id) {
  364. this.$http.post('boman-web-core/core/ryrl/editRlry', this.formData).then(res => {
  365. if (res.code == 200) {
  366. uni.navigateTo({
  367. url: '/add/pages/addvacfrom/submit'
  368. })
  369. } else {
  370. uni.showToast({
  371. title: res.msg,
  372. icon: "none"
  373. })
  374. }
  375. })
  376. } else {
  377. this.$http.post('boman-web-core/core/ryrl/addRlry', this.formData).then(res => {
  378. if (res.code == 200) {
  379. uni.navigateTo({
  380. url: '/add/pages/addvacfrom/submit'
  381. })
  382. // uni.showToast({
  383. // title: '提交成功',
  384. // icon: "none"
  385. // })
  386. // setTimeout(function() {
  387. // uni.navigateBack()
  388. // }, 1000)
  389. } else {
  390. uni.showToast({
  391. title: res.msg,
  392. icon: "none"
  393. })
  394. }
  395. })
  396. }
  397. },
  398. // 修改
  399. getUpdateFn() {
  400. this.edidflag = false
  401. },
  402. //删除
  403. getDeletFn() {
  404. this.delfalg = true;
  405. },
  406. deletSure() {
  407. var that = this;
  408. var params = {
  409. id: this.formData.id,
  410. deleteReason: this.delvalue
  411. }
  412. this.$http.get('boman-web-core/core/czrk/deleteCzrk', params).then(res => {
  413. if (res.code == 200) {
  414. uni.showToast({
  415. title: '删除成功',
  416. icon: "none"
  417. })
  418. setTimeout(function() {
  419. uni.navigateBack()
  420. }, 1000)
  421. } else {
  422. this.delfalg = false;
  423. uni.showToast({
  424. title: res.msg,
  425. icon: "none"
  426. })
  427. }
  428. })
  429. },
  430. delete() {
  431. // this.$http.post('boman-web-core/core/ryrl/editRlry', this.formData).then(res=>{
  432. // if(res.code == 200 ) {
  433. // uni.showToast({
  434. // title: '提交成功',
  435. // icon: "none"
  436. // })
  437. // setTimeout(function() {
  438. // uni.navigateBack()
  439. // }, 1000)
  440. // }
  441. // })
  442. },
  443. regionPickerChange(region) {
  444. this.searchRegion = region
  445. console.log(this.searchRegion, 'searchRegion')
  446. var codeArray = this.searchRegion.map(item => item ? item.code : undefined)
  447. var nameArray = this.searchRegion.map(item => item ? item.name : undefined)
  448. this.formData.province = nameArray[0]
  449. this.formData.city = nameArray[1]
  450. this.formData.region = nameArray[2]
  451. },
  452. uploadFile(filePath, type) {
  453. var that = this
  454. uni.showLoading()
  455. var url = host + '/boman-file/upload'
  456. var token = uni.getStorageSync('token')
  457. // var token = "df057579-73c8-4bdd-8312-f64db8efd699"
  458. uni.uploadFile({
  459. url: url,
  460. filePath: filePath,
  461. name: 'file',
  462. header: {
  463. // 'Content-type': 'multipart/form-data',
  464. 'Authorization': token
  465. },
  466. success: res => {
  467. uni.hideLoading()
  468. console.log(JSON.stringify(res))
  469. var data = JSON.parse(res.data)
  470. var imgUrl = data.data.url
  471. console.log('imgUrl ' + imgUrl)
  472. // var regexp = new RegExp("((http|ftp|https)://)(([a-zA-Z0-9\._-]+\.[a-zA-Z]{2,6})|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,4})*/?", "g");
  473. // imgUrl = imgUrl.replace(regexp, imgDomain + '/');
  474. console.log('imgUrl ' + imgUrl)
  475. if (type == 'url') { // 禁忌症附件
  476. that.formData.urlArr.push(imgUrl)
  477. } else if (type == 'suspendUrl') { // 暂缓接种附件
  478. that.formData.suspendUrlArr.push(imgUrl)
  479. } else if (type == 'otherUrl') { // 其他附件
  480. that.formData.otherUrlArr.push(imgUrl)
  481. } else if (type == 'vacUrl') { // 接种信息每行的附件
  482. var curItem = that.formData.vaccineInfoUserList[that.curIndex]
  483. console.log('--------curItem ' + JSON.stringify(curItem))
  484. curItem.urlArr.push(imgUrl)
  485. that.$set(curItem, 'urlArr', curItem.urlArr)
  486. }
  487. console.log('=========' + JSON.stringify(that.formData))
  488. },
  489. fail: err => {
  490. uni.hideLoading();
  491. console.log(JSON.stringify(err))
  492. uni.showToast({
  493. title: err.errMsg,
  494. icon: "none"
  495. })
  496. }
  497. })
  498. },
  499. chooseImg(type, index) {
  500. console.log('type ' + type + ' index ' + index)
  501. var that = this
  502. if (index) {
  503. that.curIndex = index
  504. console.log('curIndex ' + that.curIndex)
  505. }
  506. var count = 1
  507. // if (type == 'company') {
  508. // count = 9
  509. // }
  510. uni.chooseImage({
  511. count: count,
  512. sizeType: ['original', 'compressed'],
  513. sourceType: ['album', 'camera'],
  514. success: function(res) {
  515. console.log("res.tempFilePaths", res.tempFilePaths)
  516. for (let i = 0; i < res.tempFilePaths.length; i++) {
  517. let imgSrc = res.tempFilePaths[i]
  518. that.uploadFile(imgSrc, type)
  519. }
  520. }
  521. })
  522. },
  523. removeImg(index, type) {
  524. if (type == 'url') { // 禁忌症附件
  525. this.formData.urlArr.splice(index, 1)
  526. } else if (type == 'suspendUrl') { // 暂缓接种附件
  527. this.formData.suspendUrlArr.splice(index, 1)
  528. } else if (type == 'otherUrl') { // 其他附件
  529. this.formData.otherUrlArr.splice(index, 1)
  530. } else if (type == 'vacUrl') { //接种附件
  531. var curItem = this.formData.vaccineInfoUserList[this.curIndex]
  532. curItem.urlArr.splice(index, 1)
  533. }
  534. },
  535. getOthersOption() {
  536. this.$http.get('system/dict/data/type/other_status').then(res => {
  537. if (res.code == 200) {
  538. this.othersOption = res.data.map(v => {
  539. return {
  540. label: v.dictLabel,
  541. vlaue: v.dictValue,
  542. children: v.children
  543. }
  544. })
  545. console.log('othersOption ' + JSON.stringify(this.othersOption))
  546. }
  547. })
  548. },
  549. /* 获取疫苗名称 */
  550. getVacTitle() {
  551. this.$http.get('system/dict/data/type/vaccine_name').then(res => {
  552. if (res.code == 200) {
  553. this.vacTitle = res.data.map(v => {
  554. return {
  555. label: v.dictLabel,
  556. vlaue: v.dictValue,
  557. children: v.children
  558. }
  559. })
  560. // 如果是“编辑”模式,根据每行的疫苗厂商,设置剂次选项
  561. if (this.formData.id) {
  562. for (var i = 0; i < this.formData.vaccineInfoUserList.length; i++) {
  563. var curItem = this.formData.vaccineInfoUserList[i]
  564. console.log('------curItem ' + JSON.stringify(curItem))
  565. for (var j = 0; j < this.vacTitle.length; j++) {
  566. var item = this.vacTitle[j]
  567. console.log('======item ' + JSON.stringify(item))
  568. if (item.label == curItem.vaccineName) {
  569. this.$set(curItem, 'jiciOption', item.children)
  570. }
  571. }
  572. }
  573. }
  574. console.log('vacTitle ' + JSON.stringify(this.vacTitle))
  575. }
  576. })
  577. },
  578. /* 获取户籍地 */
  579. getBirthplace() {
  580. this.$http.get('boman-web-core/administrativeInfo/treeSelect').then(res => {
  581. if (res.code == 200) {
  582. this.birthplace = res.data
  583. }
  584. })
  585. },
  586. /* 重点行业 */
  587. getTrade() {
  588. this.$http.get('system/dict/data/type/key_trades').then(res => {
  589. if (res.code == 200) {
  590. this.trades = res.data.map(v => {
  591. return {
  592. label: v.dictLabel,
  593. vlaue: v.dictValue
  594. }
  595. })
  596. }
  597. })
  598. },
  599. /* 禁忌症 */
  600. getContraindication() {
  601. this.$http.get('system/dict/data/type/contraindication').then(res => {
  602. if (res.code == 200) {
  603. this.contraindication = res.data.map(v => {
  604. return {
  605. label: v.dictLabel,
  606. vlaue: v.dictValue
  607. }
  608. })
  609. }
  610. })
  611. },
  612. /* 获取暂缓接种 */
  613. getMonVac() {
  614. this.$http.get('system/dict/data/type/moratorium_on_vaccination').then(res => {
  615. if (res.code == 200) {
  616. this.moratorium = res.data.map(v => {
  617. return {
  618. label: v.dictLabel,
  619. vlaue: v.dictValue
  620. }
  621. })
  622. }
  623. })
  624. },
  625. /* 获取疫苗剂次 */
  626. getVacDictValue(val) {
  627. let url = '/system/dict/data/type/' + val
  628. this.$http.get(url).then(res => {
  629. if (res.code == 200) {
  630. this.vacTimes = res.data
  631. }
  632. })
  633. },
  634. /* 获取接种地点 */
  635. getVacArea() {
  636. this.$http.get('/system/dict/data/type/vaccination_site').then(res => {
  637. console.log(res)
  638. if (res.code == 200) {
  639. this.vacArea = res.data.map(v => {
  640. return {
  641. label: v.dictLabel,
  642. vlaue: v.dictValue
  643. }
  644. })
  645. }
  646. })
  647. },
  648. /* 初始化 */
  649. init() {
  650. this.getPeopleClass();
  651. // this.getBirthplace();
  652. // this.getDelectList();
  653. },
  654. // 回显数据字典
  655. selectDictLabel(datas, value) {
  656. var actions = [];
  657. Object.keys(datas).some((key) => {
  658. if (datas[key].dictValue == ('' + value)) {
  659. actions.push(datas[key].dictLabel);
  660. return true;
  661. }
  662. })
  663. return actions.join('');
  664. },
  665. getDetail() {
  666. this.$http.get('boman-web-core/core/ryrl/getById/' + this.formData.id).then(res => {
  667. if (res.code == 200) {
  668. this.init()
  669. this.formData = res.data;
  670. if (this.formData.houseType == '是') {
  671. this.formData.houseTypeValue = 0
  672. } else {
  673. this.formData.houseTypeValue = 1;
  674. this.formData.houseType = '否'
  675. }
  676. if (this.formData.gender == '男') {
  677. this.formData.genderIndex = 0
  678. } else {
  679. this.formData.genderIndex = 1
  680. }
  681. if (this.formData.isVaccination == '是') {
  682. this.formData.isVaccinationValue = 0
  683. } else {
  684. this.formData.isVaccinationValue = 1
  685. }
  686. this.birAddress = ''
  687. if (this.formData.province) {
  688. this.birAddress += this.formData.province
  689. }
  690. if (this.formData.city) {
  691. this.birAddress += this.formData.city
  692. }
  693. if (this.formData.region) {
  694. this.birAddress += this.formData.region
  695. }
  696. if (this.formData.villageTowns) {
  697. this.birAddress += this.formData.villageTowns
  698. }
  699. if (this.formData.village) {
  700. this.birAddress += this.formData.village
  701. }
  702. if (this.formData.villagerGroup) {
  703. this.birAddress += this.formData.villagerGroup
  704. }
  705. }
  706. })
  707. },
  708. getDelectList() {
  709. // 删除显示
  710. var tthat = this;
  711. this.$http.get('system/dict/data/type/people_status').then(res => {
  712. if (res.code == 200) {
  713. this.delvalue = res.data[0].dictValue
  714. this.deletelist = res.data.map(v => {
  715. return {
  716. label: v.dictLabel,
  717. value: v.dictValue
  718. }
  719. })
  720. }
  721. })
  722. },
  723. getDeltab(e) {
  724. this.delvalue = e;
  725. },
  726. // 人员分类
  727. getPeopleClass() {
  728. var that = this;
  729. this.$http.get('system/dict/data/type/renyuanfenlei').then(res => {
  730. if (res.code == 200) {
  731. if (that.formData.keyIndustries) {
  732. that.keyIndustries = that.selectDictLabel(res.data, that.formData.keyIndustries)
  733. }
  734. this.peopleclass = res.data.map(v => {
  735. return {
  736. label: v.dictLabel,
  737. value: v.dictValue
  738. }
  739. })
  740. }
  741. })
  742. },
  743. // 显示人员分类
  744. showPropleSelect() {
  745. // if (this.formData.id != undefined && this.formData.id != "") {
  746. // return
  747. // }
  748. // this.curIndex = index
  749. this.$refs.peopleselet.show()
  750. },
  751. peopleChange(e) {
  752. var label = e[0].label;
  753. this.keyIndustries = e[0].label;
  754. this.formData.keyIndustries = e[0].value;
  755. },
  756. /* 上传后端获取身份证信息 */
  757. getIdcardInfo(val) {
  758. if (this.formData == undefined) {
  759. return
  760. }
  761. if (this.formData.idCard == undefined || this.formData.idCard == '') {
  762. return
  763. }
  764. this.$http.post('boman-web-core/core/info/findHjInfo', {
  765. idCard: this.formData.idCard
  766. }).then(res => {
  767. if (res.code == 200) {
  768. this.formData.userName = res.data.userName
  769. this.formData.age = res.data.age
  770. this.formData.gender = res.data.gender
  771. this.formData.id = res.data.id
  772. if (this.formData.gender == '男') {
  773. this.formData.genderIndex = 0
  774. } else {
  775. this.formData.genderIndex = 1
  776. }
  777. }
  778. })
  779. },
  780. // 疫苗选择组件
  781. showVacPicker(index) {
  782. if (this.formData.id != undefined && this.formData.id != "") {
  783. return
  784. }
  785. this.curIndex = index
  786. this.$refs.vacselet.show()
  787. },
  788. /* 成功选择疫苗 */
  789. vacNameChange(e) {
  790. console.log(JSON.stringify(e))
  791. var curItem = this.formData.vaccineInfoUserList[this.curIndex]
  792. console.log('------' + JSON.stringify(curItem))
  793. var label = e[0].label
  794. for (var i = 0; i < this.vacTitle.length; i++) {
  795. var item = this.vacTitle[i]
  796. console.log('0000000' + JSON.stringify(item))
  797. if (label == item.label) {
  798. this.$set(curItem, 'vaccineName', label)
  799. this.$set(curItem, 'jiciOption', item.children)
  800. this.$set(curItem, 'vaccineNum', item.children.length)
  801. }
  802. }
  803. console.log('======' + JSON.stringify(this.formData.vaccineInfoUserList[this.curIndex]))
  804. },
  805. // 剂次选择组件
  806. showJiciPicker(index) {
  807. if (this.formData.id != undefined && this.formData.id != "") {
  808. return
  809. }
  810. this.curIndex = index
  811. var curItem = this.formData.vaccineInfoUserList[this.curIndex]
  812. console.log('curItem ' + JSON.stringify(curItem))
  813. // this.jiciOption = curItem.jiciOption
  814. this.jiciOption = curItem.jiciOption.map(v => {
  815. return {
  816. label: v.dictLabel,
  817. vlaue: v.dictValue
  818. }
  819. })
  820. console.log('jiciOption ' + JSON.stringify(this.jiciOption))
  821. this.$refs.jici_select.show()
  822. },
  823. jiciChange(e) {
  824. console.log(JSON.stringify(e[0]))
  825. var curItem = this.formData.vaccineInfoUserList[this.curIndex]
  826. console.log('curItem ' + JSON.stringify(curItem))
  827. this.$set(curItem, 'jici', e[0].label)
  828. var selectedIndex
  829. for (var i = 0; i < curItem.jiciOption.length; i++) {
  830. var item = curItem.jiciOption[i]
  831. console.log('item ' + JSON.stringify(item))
  832. if (item.dictLabel == curItem.jici) {
  833. selectedIndex = i
  834. }
  835. }
  836. if (selectedIndex == curItem.jiciOption.length - 1) { // 位置为最后一剂次,设置已完成
  837. this.$set(curItem, 'progressValue', 0)
  838. } else {
  839. this.$set(curItem, 'progressValue', 1)
  840. }
  841. },
  842. showOthersPicker(index) {
  843. this.curIndex = index
  844. this.$refs.others_selet.show();
  845. },
  846. /* 其他 */
  847. othersChange(e) {
  848. console.log(JSON.stringify(e[0]))
  849. this.formData.other = e[0].label
  850. },
  851. /* 户籍地选择组件 */
  852. showbirPicker() {
  853. this.$refs.birselet.show()
  854. },
  855. /* 成功选择户籍 */
  856. birRegion(e) {
  857. console.log('---------' + JSON.stringify(e))
  858. this.formData.villageTowns = e[1].label
  859. this.formData.village = e[2].label
  860. this.formData.villagerGroup = e[3].label
  861. this.birAddress = this.formData.villageTowns + this.formData.village + this.formData.villagerGroup
  862. },
  863. /* 出生日期组件 */
  864. showDatePicker() {
  865. this.$refs.setpicker.show();
  866. },
  867. /* 重点行业选择组件 */
  868. showTrdesSelect() {
  869. this.$refs.tredselet.show();
  870. },
  871. /* 成功选择行业 */
  872. trdesChange(e) {
  873. this.formData.keyIndustries = e[0].label
  874. },
  875. /* 接种时间组件 */
  876. showVacTime(index) {
  877. if (this.formData.id != undefined && this.formData.id != "") {
  878. return
  879. }
  880. this.curIndex = index
  881. this.$refs.vacTime.show();
  882. },
  883. /* 禁忌症组件 */
  884. showMonList() {
  885. this.$refs.con_selet.show();
  886. },
  887. /* 成功选择禁忌症 */
  888. conChange(e) {
  889. console.log(JSON.stringify(e))
  890. this.formData.contraindication = e[0].label
  891. },
  892. /* 暂缓接种组件 */
  893. showWaitList() {
  894. this.$refs.mor_selet.show();
  895. },
  896. /* 成功选择暂缓原由 */
  897. morChange(e) {
  898. this.formData.suspend = e[0].label
  899. },
  900. /* 接种地点组件 */
  901. showVacArea(index) {
  902. if (this.formData.id != undefined && this.formData.id != "") {
  903. return
  904. }
  905. this.curIndex = index
  906. this.$refs.vacareaselet.show();
  907. },
  908. /* 成功选择接种地点 */
  909. vacAreaChange(e) {
  910. console.log(JSON.stringify(e[0]))
  911. var curItem = this.formData.vaccineInfoUserList[this.curIndex]
  912. this.$set(curItem, 'vaccinationPlace', e[0].label)
  913. },
  914. /* 省市区组件 */
  915. showArea() {
  916. this.$refs.area.show();
  917. },
  918. // quxiaobutton() {
  919. // this.shixian = false;
  920. // },
  921. // quedingbutton (bangdingyear,bangdingmonth,bangdingday){
  922. // this.shixian = false;
  923. // this.inputValue = bangdingyear + "-" + bangdingmonth + "-" + bangdingday;
  924. // },
  925. /* 添加接种信息 */
  926. addInfo(item) {
  927. if (this.formData.vaccineInfoUserList.length >= 3) {
  928. this.modalContent = '最多可添加三次接种信息'
  929. this.$refs.h_modal.show()
  930. return false
  931. }
  932. let obj = {
  933. "vaccineName": "",
  934. "vaccinationTime": "",
  935. "vaccinationPlace": "",
  936. "jici": "",
  937. 'progressValue': 1,
  938. "progress": "未完成",
  939. 'urlArr': [], // 附件
  940. 'isDel': 'N'
  941. }
  942. this.formData.vaccineInfoUserList.push(obj)
  943. console.log(this.formData.vaccineInfoUserList)
  944. },
  945. delVacInfoDialog(item, index) {
  946. this.curItem = item
  947. this.curIndex = index
  948. this.$refs.delPopup.open()
  949. },
  950. /* 删除接种信息 */
  951. delConfirm(done) {
  952. done()
  953. if (this.formData.vaccineInfoUserList.length <= 1) {
  954. this.modalContent = '至少需要填写一次接种信息'
  955. this.$refs.h_modal.show()
  956. return false
  957. }
  958. // this.formData.vaccineInfoUserList.splice(index,1)
  959. this.$set(this.formData.vaccineInfoUserList[this.curIndex], 'isDel', 'Y')
  960. },
  961. getAge(strAge) {
  962. var birArr = strAge.split("-");
  963. var birYear = birArr[0];
  964. var birMonth = birArr[1];
  965. var birDay = birArr[2];
  966. d = new Date();
  967. var nowYear = d.getFullYear();
  968. var nowMonth = d.getMonth() + 1; //记得加1
  969. var nowDay = d.getDate();
  970. var returnAge;
  971. if (birArr == null) {
  972. return false
  973. };
  974. var d = new Date(birYear, birMonth - 1, birDay);
  975. if (d.getFullYear() == birYear && (d.getMonth() + 1) == birMonth && d.getDate() == birDay) {
  976. if (nowYear == birYear) {
  977. returnAge = 0; //
  978. } else {
  979. var ageDiff = nowYear - birYear; //
  980. if (ageDiff > 0) {
  981. if (nowMonth == birMonth) {
  982. var dayDiff = nowDay - birDay; //
  983. if (dayDiff < 0) {
  984. returnAge = ageDiff - 1;
  985. } else {
  986. returnAge = ageDiff;
  987. }
  988. } else {
  989. var monthDiff = nowMonth - birMonth; //
  990. if (monthDiff < 0) {
  991. returnAge = ageDiff - 1;
  992. } else {
  993. returnAge = ageDiff;
  994. }
  995. }
  996. } else {
  997. return "出生日期晚于今天,数据有误"; //返回-1 表示出生日期输入错误 晚于今天
  998. }
  999. }
  1000. return returnAge;
  1001. } else {
  1002. return ("输入的日期格式错误!");
  1003. }
  1004. }
  1005. },
  1006. onLoad(option) {
  1007. if (option.id) {
  1008. this.formData.id = option.id;
  1009. this.getDetail()
  1010. }
  1011. },
  1012. }
  1013. </script>
  1014. <style>
  1015. .vac-form textarea {
  1016. display: block;
  1017. padding:16rpx 36rpx;
  1018. font-size: 28rpx;
  1019. box-sizing: border-box;
  1020. }
  1021. </style>
  1022. <style scoped lang="scss">
  1023. // 新修改的
  1024. .npd15{padding:6px 15px;background-color: #FFFFFF;}
  1025. .addtit{/* #ifndef APP-NVUE */
  1026. display: flex;
  1027. /* #endif */
  1028. flex-direction: row;
  1029. align-items: center;
  1030. padding-left: 15px;
  1031. height: 40px;
  1032. background-color: $uni-bg-color-grey;
  1033. font-weight: normal;
  1034. color: $uni-text-color;}
  1035. .addbox{position: fixed;left: 0;right: 0;bottom: 0;background: #F2F2F2;padding: 20rpx 34rpx;z-index: 1;background: #ffffff;box-shadow: 0 14rpx 40rpx 12rpx rgba(218, 218, 218, 1);}
  1036. .submit_btn {
  1037. width: 100%;
  1038. height: 96rpx;
  1039. background: #00B034;
  1040. border-radius: 6rpx;
  1041. font-size: 34rpx;
  1042. }
  1043. .submit_btns {
  1044. background: #EA2929;
  1045. width: 684rpx;
  1046. height: 98rpx;
  1047. border-radius: 6rpx;
  1048. font-size: 34rpx;
  1049. margin-top: 20rpx;
  1050. }
  1051. .bgbox {
  1052. position: fixed;
  1053. left: 0;
  1054. right: 0;
  1055. top: 0;
  1056. bottom: 0;
  1057. background: rgba(0, 0, 0, 0.2);
  1058. z-index: 3;
  1059. }
  1060. .delbox {
  1061. width: 580rpx;
  1062. background: #FFFFFF;
  1063. border-radius: 14px;
  1064. position: fixed;
  1065. top: 50%;
  1066. left: 80rpx;
  1067. right: 80rpx;
  1068. padding: 48rpx 34rpx 72rpx;
  1069. box-sizing: border-box;
  1070. z-index: 5;
  1071. margin-top: -210rpx;
  1072. .deltit {
  1073. font-size: 28rpx;
  1074. font-weight: bold;
  1075. color: #343434;
  1076. text-align: center;
  1077. line-height: 40rpx;
  1078. }
  1079. .del_img {
  1080. width: 34rpx;
  1081. height: 34rpx;
  1082. position: absolute;
  1083. right: 34rpx;
  1084. top: 44rpx;
  1085. }
  1086. .del_btn {
  1087. width: 100%;
  1088. height: 76rpx;
  1089. background: #00B034;
  1090. border-radius: 6rpx;
  1091. font-size: 28rpx;
  1092. font-weight: bold;
  1093. color: #FFFFFF;
  1094. text-align: center;
  1095. line-height: 76rpx;
  1096. }
  1097. .del_list {
  1098. display: flex;
  1099. padding: 60rpx 0 40rpx;
  1100. flex-wrap: wrap;
  1101. .del_lista {
  1102. width: 132rpx;
  1103. height: 64rpx;
  1104. background: #CACACA;
  1105. border-radius: 32rpx;
  1106. font-size: 26rpx;
  1107. font-weight: 500;
  1108. color: #FFFFFF;
  1109. text-align: center;
  1110. line-height: 64rpx;
  1111. margin: 0 20rpx 20rpx 0;
  1112. &.act {
  1113. background-color: #019FE8;
  1114. }
  1115. }
  1116. }
  1117. }
  1118. .form_zhan {
  1119. flex: 1;
  1120. width: 100%;
  1121. display: flex;
  1122. box-sizing: border-box;
  1123. min-height: 72rpx;
  1124. flex-direction: row;
  1125. align-items: center;
  1126. font-size: 28rpx;
  1127. color: #343434;
  1128. &.nodata {
  1129. color: #999999;
  1130. }
  1131. &.form_right{background-color: rgb(242, 242, 242);height: 120rpx;padding: 10rpx;align-items: flex-start;}
  1132. }
  1133. .pick-line {
  1134. width: 100%;
  1135. height: 100%;
  1136. display: flex;
  1137. flex-direction: row;
  1138. align-items: center;
  1139. padding-left: 20rpx;
  1140. }
  1141. .from_image {
  1142. width: 30rpx;
  1143. height: 30rpx;
  1144. }
  1145. .delPop {
  1146. z-index: 2;
  1147. top: -10rpx;
  1148. right: -10rpx;
  1149. .circleRed {
  1150. width: 40rpx;
  1151. height: 40rpx;
  1152. background-color: red;
  1153. border-radius: 50%;
  1154. &::after,
  1155. &::before {
  1156. content: '';
  1157. width: 25rpx;
  1158. height: 5rpx;
  1159. position: absolute;
  1160. background-color: white;
  1161. top: 50%;
  1162. left: 50%;
  1163. // transform-origin:center;
  1164. }
  1165. &::after {
  1166. transform: translate(-50%, -50%) rotate(45deg);
  1167. }
  1168. &::before {
  1169. transform: translate(-50%, -50%) rotate(-45deg);
  1170. }
  1171. }
  1172. }
  1173. .img-add {
  1174. width: 120rpx;
  1175. height: 120rpx;
  1176. margin: 10rpx 3% 10rpx 0;
  1177. border-radius: 10rpx;
  1178. overflow: hidden;
  1179. background-color: #f7f7f7;
  1180. display: flex;
  1181. flex-direction: column;
  1182. justify-content: center;
  1183. .add {
  1184. padding-top: 0rpx;
  1185. display: flex;
  1186. flex-direction: column;
  1187. align-items: center;
  1188. image {}
  1189. .font {
  1190. color: #8a8a8a;
  1191. font-size: 26rpx;
  1192. }
  1193. }
  1194. }
  1195. </style>