questionnaire.html 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>筛选类型</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <meta name="renderer" content="webkit" />
  8. <meta http-equiv="Cache-Control" content="no-siteapp" />
  9. <meta name="keywords" content="筛选类型" />
  10. <meta name="description" content="筛选类型" />
  11. <link rel="shortcut icon" href="../../../favicon.ico" />
  12. <link rel="stylesheet" type="text/css" href="../../../css/bootstrap.min.css" />
  13. <link rel="stylesheet" type="text/css" href="../../../css/cross.css" />
  14. <link rel="stylesheet" type="text/css" href="../../../css/style.min.css" />
  15. <link href="../../../plugins/toastr/toastr.min.css" rel="stylesheet" />
  16. <link rel="stylesheet" href="../css/questionnaire.css" />
  17. <link rel="stylesheet" type="text/css" href="../../../css/element-ui.css" />
  18. <!-- <link rel="stylesheet" type="text/css" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css" /> -->
  19. </head>
  20. <body>
  21. <div class="ui-grid" id="app" style="align-items: flex-start" v-cloak>
  22. <div class="flex-box-item ptb20">
  23. <!--<div class="prompt-text">请认真填写本页面,方便医生进行综合评估【厦门i健康】</div>-->
  24. <div class="single-choice-question">
  25. <div class="question-title">问卷题目</div>
  26. <div class="question-content">
  27. <div v-if="screeningType == 'aa9bd609fd8b492296f6a34849b76520'" class="question-list">
  28. <!-- 大肠癌筛查OB -->
  29. <div class="pt10 pb5 pr10" v-for="(item,index) in questionList" :key="item.field">
  30. <div class="question-name">
  31. {{index + 1}}、{{item.label}}
  32. <span class="required-icon" v-if="item.required">*</span>
  33. </div>
  34. <div class="daan-list" v-if="item.type== 'input'">
  35. <textarea class="wenjuan-textarea" rows="1" v-model="answer[item.field]"></textarea>
  36. </div>
  37. <div class="daan-list" v-if="item.type =='radio'">
  38. <el-radio-group v-model="answer[item.field]">
  39. <el-radio :label="el.value" v-for="(el,i) in item.options" style="display: block; margin-left: 0" :key="i">{{el.label}}</el-radio>
  40. </el-radio-group>
  41. </div>
  42. <div class="daan-list" v-if="item.type =='checkbox'">
  43. <el-checkbox-group v-model="answer[item.field]">
  44. <el-checkbox :label="el.value" v-for="(el,i) in item.options" style="display: block; margin-left: 0" :key="i">{{el.label}}</el-checkbox>
  45. </el-checkbox-group>
  46. </div>
  47. </div>
  48. </div>
  49. <ul class="question-list" v-else>
  50. <li v-for="(qst,key,index) in questions">
  51. <p class="question-name" v-text="key+'、'+qst.question.title"></p>
  52. <div class="daan-list" v-if="qst.question.questionType!=2">
  53. <lable class="label-block" v-for="opt in qst.option" @click="selectItem(qst.question,opt,index)">
  54. <span class="pull-right" v-text="(opt.score || 0)+'分'" v-if="qst.isThird!=3"></span>
  55. <template v-if="qst.isThird==3&&qst.question.thirdKey=='sex'">
  56. <input
  57. :type="qst.questionType==1?'checkbox':'radio'"
  58. :checked="opt.thirdValue == sex"
  59. :name="'ques'+index+screeningType+(qst.questionType==1?'[]':'')"
  60. value="1" />
  61. <i></i>
  62. <span v-text="opt.content"></span>
  63. </template>
  64. <template v-if="qst.isThird==3&&qst.question.thirdKey=='acs'">
  65. <input
  66. :type="qst.questionType==1?'checkbox':'radio'"
  67. :checked="opt.thirdValue == (ascvdShow?ascvdShow:ascvdS1)"
  68. id="myInput1"
  69. :name="'ques'+index+screeningType+(qst.questionType==1?'[]':'')"
  70. value="1" />
  71. <i></i>
  72. <span v-text="opt.content"></span>
  73. </template>
  74. <template v-if="qst.isThird==3&&qst.question.thirdKey=='myocardialInfarct'">
  75. <input
  76. :type="qst.questionType==1?'checkbox':'radio'"
  77. :checked="opt.thirdValue == (ascvdShow?ascvdShow:ascvdS2)"
  78. id="myInput2"
  79. :name="'ques'+index+screeningType+(qst.questionType==1?'[]':'')"
  80. value="1" />
  81. <i></i>
  82. <span v-text="opt.content"></span>
  83. </template>
  84. <template v-if="qst.isThird==3&&qst.question.thirdKey=='ischemicStroke'">
  85. <input
  86. :type="qst.questionType==1?'checkbox':'radio'"
  87. :checked="opt.thirdValue == (ascvdShow?ascvdShow:ascvdS3)"
  88. id="myInput3"
  89. :name="'ques'+index+screeningType+(qst.questionType==1?'[]':'')"
  90. value="1" />
  91. <i></i>
  92. <span v-text="opt.content"></span>
  93. </template>
  94. <template v-if="qst.isThird==3&&qst.question.thirdKey=='smoke'">
  95. <input
  96. :type="qst.questionType==1?'checkbox':'radio'"
  97. :checked="opt.thirdValue == smoke"
  98. id="myInput3"
  99. :name="'ques'+index+screeningType+(qst.questionType==1?'[]':'')"
  100. value="1" />
  101. <i></i>
  102. <span v-text="opt.content"></span>
  103. </template>
  104. <template v-if="qst.isThird==3&&qst.question.thirdKey=='isCkd34'">
  105. <input
  106. :type="qst.questionType==1?'checkbox':'radio'"
  107. :checked="opt.thirdValue == isCkd34"
  108. id="myInput3"
  109. :name="'ques'+index+screeningType+(qst.questionType==1?'[]':'')"
  110. value="1" />
  111. <i></i>
  112. <span v-text="opt.content"></span>
  113. </template>
  114. <template v-if="qst.isThird==3&&qst.question.thirdKey=='diabetes'">
  115. <input
  116. :type="qst.questionType==1?'checkbox':'radio'"
  117. :checked="opt.thirdValue == diabetes"
  118. id="myInput3"
  119. :name="'ques'+index+screeningType+(qst.questionType==1?'[]':'')"
  120. value="1" />
  121. <i></i>
  122. <span v-text="opt.content"></span>
  123. </template>
  124. <template v-if="qst.isThird==3&&qst.question.thirdKey=='hypertension'">
  125. <input
  126. :type="qst.questionType==1?'checkbox':'radio'"
  127. :checked="opt.thirdValue == hypertension"
  128. id="myInput3"
  129. :name="'ques'+index+screeningType+(qst.questionType==1?'[]':'')"
  130. value="1" />
  131. <i></i>
  132. <span v-text="opt.content"></span>
  133. </template>
  134. <template v-if="qst.isThird==3&&qst.question.thirdKey=='seriousMedicalHistory'">
  135. <input
  136. :type="qst.questionType==1?'checkbox':'radio'"
  137. :checked="opt.thirdValue == (ascvdShow?ascvdShow:ascvdS4)"
  138. id="myInput4"
  139. :name="'ques'+index+screeningType+(qst.questionType==1?'[]':'')"
  140. value="1" />
  141. <i></i>
  142. <span v-text="opt.content"></span>
  143. </template>
  144. <template
  145. v-if="qst.question.thirdKey!='sex'&&qst.question.thirdKey!='acs'&&qst.question.thirdKey!='myocardialInfarct'&&qst.question.thirdKey!='ischemicStroke'&&qst.question.thirdKey!='smoke'&&qst.question.thirdKey!='isCkd34'&&qst.question.thirdKey!='hypertension'&&qst.question.thirdKey!='diabetes'&&qst.question.thirdKey!='seriousMedicalHistory'">
  146. <input
  147. :type="qst.questionType==1||qst.question.questionType?'checkbox':'radio'"
  148. v-if="qst.question.thirdKey!='sex'"
  149. :name="'ques'+index+screeningType+(qst.questionType==1?'[]':'')"
  150. value="1" />
  151. <i></i>
  152. <span v-text="opt.content"></span>
  153. </template>
  154. </lable>
  155. </div>
  156. <div v-else>
  157. <template
  158. v-if="(qst.isThird=='3' && qst.question.thirdKey == 'assessTime')||(qst.question.thirdKey == 'createDate'&&screeningTitle=='大肠癌筛查问卷(OB筛查)')||(qst.question.thirdKey == 'createDate'&&screeningTitle=='脑卒中风险评估(冠心病、脑卒中、肾病)')">
  159. <div style="padding-left: 20px">
  160. <el-date-picker
  161. v-model="qst.question.content"
  162. type="datetime"
  163. format="yyyy-MM-dd HH:mm"
  164. value-format="yyyy-MM-dd HH:mm"
  165. placeholder="选择日期时间"
  166. @change="changeContent(qst.question,qst.question.content)"></el-date-picker>
  167. </div>
  168. </template>
  169. <template v-else>
  170. <div
  171. class="daan-list"
  172. v-if="qst.isThird==3 && (qst.question.thirdKey == 'assessDoctor' || qst.question.thirdKey == 'assessOrgId'||(!shaowas&&qst.question.thirdKey == 'bmi'))">
  173. <textarea class="wenjuan-textarea" disabled rows="2" v-model="qst.question.content"></textarea>
  174. </div>
  175. <div class="daan-list" v-else-if="qst.question.thirdKey != 'bmi'">
  176. <textarea class="wenjuan-textarea" @keyup="changeContent(qst.question,qst.question.content,1)" @four rows="2" v-model="qst.question.content"></textarea>
  177. </div>
  178. <div class="daan-list" v-if="(shaowas&&qst.question.thirdKey == 'bmi')">
  179. <textarea class="wenjuan-textarea" disabled rows="2" v-model="shaowas"></textarea>
  180. </div>
  181. </template>
  182. </div>
  183. </li>
  184. </ul>
  185. </div>
  186. </div>
  187. </div>
  188. <div class="w-250">
  189. <div class="base-info">
  190. <p class="f-16 mb0">基本信息</p>
  191. <div :class="`flex-box ${noswitch?'':'right-triangle'}`">
  192. <span class="w-70">类型</span>
  193. <a class="flex-box-item" :alt="screeningTitle" v-text="screeningTitle" @click="goBack">--</a>
  194. </div>
  195. <div :class="`flex-box ${noswitch?'':'right-triangle'}`">
  196. <span class="w-70">对象</span>
  197. <a class="flex-box-item" :alt="screeningResidentsName" v-text="screeningResidentsName" @click="goBack(1)">--</a>
  198. </div>
  199. <div class="flex-box">
  200. <span class="w-70">筛查人员</span>
  201. <div class="flex-box-item c-999" v-text="doctorInfo.name"></div>
  202. </div>
  203. <div class="flex-box" style="align-items: flex-start">
  204. <span class="w-70">体征记录</span>
  205. <div class="flex-box-item" v-if="tizhongRecord.value1 || tizhongRecord.value2">
  206. <p v-if="tizhongRecord.value1">
  207. 体重
  208. <input type="number" step="0.1" readonly="readonly" :value="tizhongRecord.value1" />
  209. kg
  210. </p>
  211. <p class="mb0" v-if="tizhongRecord.value2">
  212. 身高
  213. <input type="number" step="0.1" readonly="readonly" :value="tizhongRecord.value2" />
  214. cm
  215. </p>
  216. </div>
  217. <div class="flex-box-item" v-else>暂无体征</div>
  218. </div>
  219. </div>
  220. <div class="completion-of-progress">
  221. <p class="f16 mb0">完成情况</p>
  222. <div class="canvas-box">
  223. <canvas-progress :progress="progress" ref="progress"></canvas-progress>
  224. <p class="progress-number">
  225. <span>已完成</span>
  226. </p>
  227. </div>
  228. </div>
  229. <div class="btn-group-bottom">
  230. <button class="btn submit-btn" @click="save">提交</button>
  231. <button class="btn btn-exit" @click="signOut">退出</button>
  232. </div>
  233. </div>
  234. </div>
  235. <script type="text/javascript" src="../../../plugins/echarts/3.8.5/echarts.min.js"></script>
  236. <script src="../../../js/vue.js" type="text/javascript" charset="utf-8"></script>
  237. <script src="../../../js/jquery-2.2.4.js" type="text/javascript" charset="utf-8"></script>
  238. <script src="../../../component/common/event-bus.js"></script>
  239. <script src="../../../js/element-ui.js" type="text/javascript" charset="utf-8"></script>
  240. <!-- <script src="https://unpkg.com/element-ui/lib/index.js" type="text/javascript" charset="utf-8"></script> -->
  241. <script src="../../../js/underscore.js" type="text/javascript" charset="utf-8"></script>
  242. <script src="../../../js/es6-promise.js" type="text/javascript" charset="utf-8"></script>
  243. <script src="../../../plugins/toastr/toastr.min.js"></script>
  244. <script type="text/javascript" src="../../../plugins/layer/layer.min.js"></script>
  245. <script src="../../../js/util.js" type="text/javascript" charset="utf-8"></script>
  246. <script src="../../../api/http-request.js" type="text/javascript" charset="utf-8"></script>
  247. <script type="text/javascript" src="../../../api/jbsc-api.js"></script>
  248. <script type="text/javascript" src="../component/canvas-progress.js"></script>
  249. <script type="text/javascript" src="../js/questionList.js"></script>
  250. <script type="text/javascript">
  251. var httpData = GetRequest()
  252. var docInfo = JSON.parse(window.localStorage.getItem('docInfo'))
  253. var question = new Vue({
  254. el: '#app',
  255. data: {
  256. //数据结果
  257. progress: 0,
  258. selectArr: [],
  259. screeningTitle: decodeURI(httpData['fliter_title']),
  260. screeningType: httpData['fliter_code'],
  261. screeningResidents: httpData['resident_code'],
  262. screeningResidentsName: decodeURI(httpData['resident_name']),
  263. sex: decodeURI(httpData['sex']),
  264. age: decodeURI(httpData['age']),
  265. doctorInfo: { code: docInfo.code },
  266. surveyStatus: httpData['surveyStatus'] || '',
  267. idCard: httpData['idcard'],
  268. mobile: httpData['mobile'],
  269. questions: [],
  270. tizhongRecord: {},
  271. labelType: 5, //问卷筛查labelType=5
  272. isAgain: httpData['isAgain'] || 0,
  273. ascvdShow: '',
  274. ascvdS1: '',
  275. ascvdS2: '',
  276. ascvdS3: '',
  277. ascvdS4: '',
  278. shaowas: '',
  279. smoke: '',
  280. isCkd34: '',
  281. hypertension: '',
  282. diabetes: '',
  283. questionList: [],
  284. noswitch: httpData['noswitch'],
  285. dictData: [
  286. {
  287. name: 'obScreen_isMerge',
  288. field: 'isMerge'
  289. },
  290. {
  291. name: 'obScreen_eduState',
  292. field: 'eduState'
  293. },
  294. {
  295. name: 'obScreen_jobState',
  296. field: 'jobState'
  297. },
  298. {
  299. name: 'obScreen_ksDrugName1',
  300. field: 'ksDrugName1'
  301. }
  302. ],
  303. answer: {},
  304. progress1: 0
  305. },
  306. mounted: function () {
  307. var vm = this
  308. if (this.screeningType == 'aa9bd609fd8b492296f6a34849b76520') this.getDictData()
  309. else {
  310. this.getHealth()
  311. this.getQuestion()
  312. }
  313. this.getDoctorInfo()
  314. },
  315. methods: {
  316. getDictData() {
  317. var vm = this
  318. httpRequest.post('doctor/patient_label_info/patient', { data: { patient: this.screeningResidents } }).then(function (res) {
  319. // vm.patientInfo = res.data
  320. var data = res.data
  321. vm.answer = {
  322. belongCommunity: docInfo.hospitalName,
  323. doctorName: docInfo.name,
  324. doctorPhoneNo: docInfo.mobile,
  325. userName: data.name,
  326. idNoType: '身份证',
  327. idNo: data.idcard,
  328. phoneNo: data.mobile,
  329. age: data.age,
  330. sex: data.sex + '',
  331. hujiAddress: data.address,
  332. hujiAddressJiedao: data.address,
  333. juzhuAddress: data.address,
  334. juzhuAddressJiedao: data.address,
  335. ksDrugName1: [],
  336. createDate: new Date().format('yyyy-MM-dd hh:mm:ss')
  337. }
  338. })
  339. this.questionList = questionList
  340. var vm = this
  341. this.dictData.forEach(function (item) {
  342. jbscAPI.getDictDataByName(item.name).then(function (res) {
  343. var index = vm.questionList.findIndex(function (el) {
  344. return el.field == item.field
  345. })
  346. vm.questionList[index].options = res.list.map(function (el) {
  347. return {
  348. label: el.value,
  349. value: el.code
  350. }
  351. })
  352. vm.$forceUpdate()
  353. })
  354. })
  355. },
  356. getInitData() {
  357. var vm = this
  358. httpRequest.get('doctor/screen/physicalList', { data: { patient: vm.screeningResidents } }).then(function (res) {
  359. var data = res.data
  360. if (res.status == 200 && data) {
  361. for (var i in vm.questions) {
  362. if (vm.questions[i].question.thirdKey == 'height' && data.height) {
  363. vm.questions[i].question.content = data.height + ''
  364. vm.changeContent(vm.questions[i].question, data.height + '')
  365. }
  366. if (vm.questions[i].question.thirdKey == 'weight' && data.weight) {
  367. vm.questions[i].question.content = data.weight + ''
  368. vm.changeContent(vm.questions[i].question, data.weight + '')
  369. }
  370. if (vm.questions[i].question.thirdKey == 'bmi') {
  371. if (data.height && data.weight) {
  372. var w = data.weight
  373. var h = data.height / 100
  374. var s = (w / (h * h)).toFixed(2)
  375. vm.questions[i].question.content = s
  376. vm.shaowas = s
  377. vm.changeContent(vm.questions[i].question, s + '')
  378. } else {
  379. vm.questions[i].question.content = ''
  380. vm.shaowas = ''
  381. vm.changeContent(vm.questions[i].question, '')
  382. }
  383. }
  384. if (vm.questions[i].question.thirdKey == 'systolicPressure' && data.systolicPressure) {
  385. vm.questions[i].question.content = data.systolicPressure + ''
  386. vm.changeContent(vm.questions[i].question, data.systolicPressure + '')
  387. }
  388. if (vm.questions[i].question.thirdKey == 'diastolicPressure' && data.diastolicPressure) {
  389. vm.questions[i].question.content = data.diastolicPressure + ''
  390. vm.changeContent(vm.questions[i].question, data.diastolicPressure + '')
  391. }
  392. if (vm.questions[i].question.thirdKey == 'totalCholesterol' && data.totalCholesterol) {
  393. vm.questions[i].question.content = data.totalCholesterol + ''
  394. vm.changeContent(vm.questions[i].question, data.totalCholesterol + '')
  395. }
  396. if (vm.questions[i].question.thirdKey == 'hdlc' && data.HDL) {
  397. vm.questions[i].question.content = data.HDL + ''
  398. vm.changeContent(vm.questions[i].question, data.HDL + '')
  399. }
  400. if (vm.questions[i].question.thirdKey == 'ldlc' && data.LDL) {
  401. vm.questions[i].question.content = data.LDL + ''
  402. vm.changeContent(vm.questions[i].question, data.LDL + '')
  403. }
  404. // if (vm.questions[i].question.thirdKey == 'ckd34' && data.height) {
  405. // vm.questions[i].question.content = data.height + ''
  406. // vm.changeContent(vm.questions[i].question, data.LDL + '')
  407. // }
  408. if (vm.questions[i].question.title == '既往有心肌梗死病史' && data.AMI) {
  409. var index = data.AMI == 1 ? 0 : data.AMI == 2 ? 1 : ''
  410. vm.selectItem(vm.questions[i].question, vm.questions[i].option[Number(index)])
  411. }
  412. if (vm.questions[i].question.title == '缺血性脑卒中病史' && data.CerebralIschemicStroke) {
  413. var index = data.CerebralIschemicStroke == 1 ? 0 : data.CerebralIschemicStroke == 2 ? 1 : ''
  414. vm.selectItem(vm.questions[i].question, vm.questions[i].option[Number(index)])
  415. }
  416. if (vm.questions[i].question.title == '高血压' && data.hypertension) {
  417. var index = data.hypertension == 1 ? 0 : data.hypertension == 2 ? 1 : ''
  418. vm.selectItem(vm.questions[i].question, vm.questions[i].option[index])
  419. }
  420. if (vm.questions[i].question.title == '糖尿病' && data.Diabetes) {
  421. var index = data.Diabetes == 1 ? 0 : data.Diabetes == 2 ? 1 : ''
  422. vm.selectItem(vm.questions[i].question, vm.questions[i].option[Number(index)])
  423. }
  424. if (vm.questions[i].question.title == '吸烟' && (data.smoke || data.smoke == 0)) {
  425. var index = data.smoke == 1 ? 0 : data.smoke == 0 ? 1 : ''
  426. vm.selectItem(vm.questions[i].question, vm.questions[i].option[Number(index)])
  427. }
  428. }
  429. vm.$forceUpdate()
  430. }
  431. httpRequest.get('doctor/screen/checkUpList', { data: { patient: vm.screeningResidents } }).then(function (res) {
  432. var obj = res.data
  433. if (res.status == 200 && obj) {
  434. for (var i in vm.questions) {
  435. if (vm.questions[i].question.thirdKey == 'hdlc' && !vm.questions[i].question.content) {
  436. vm.questions[i].question.content = obj.hdlc
  437. vm.changeContent(vm.questions[i].question, obj.hdlc)
  438. }
  439. if (vm.questions[i].question.thirdKey == 'ldlc' && !vm.questions[i].question.content) {
  440. vm.questions[i].question.content = obj.ldlc
  441. vm.changeContent(vm.questions[i].question, obj.ldlc + '')
  442. }
  443. if (vm.questions[i].question.thirdKey == 'totalCholesterol' && !vm.questions[i].question.content) {
  444. vm.questions[i].question.content = obj.totalCholesterol
  445. vm.changeContent(vm.questions[i].question, obj.totalCholesterol + '')
  446. }
  447. if (vm.questions[i].question.thirdKey == 'diastolicPressure' && !vm.questions[i].question.content) {
  448. vm.questions[i].question.content = obj.diastolicPressure
  449. vm.changeContent(vm.questions[i].question, obj.diastolicPressure + '')
  450. }
  451. if (vm.questions[i].question.thirdKey == 'systolicPressure' && !vm.questions[i].question.content) {
  452. vm.questions[i].question.content = obj.systolicPressure
  453. vm.changeContent(vm.questions[i].question, obj.systolicPressure + '')
  454. }
  455. }
  456. }
  457. // var data = res.data
  458. // if (!vm.form.totalCholesterol) {
  459. // vm.form.totalCholesterol = data.totalCholesterol
  460. // }
  461. // if (!vm.form.hdlc) {
  462. // vm.form.hdlc = data.hdlc
  463. // }
  464. // if (!vm.form.ldlc) {
  465. // vm.form.ldlc = data.ldlc
  466. // }
  467. // if (!vm.form.systolicPressure) {
  468. // vm.form.systolicPressure = data.systolicPressure
  469. // }
  470. // if (!vm.diastolicPressure) {
  471. // vm.form.diastolicPressure = data.diastolicPressure
  472. // }
  473. vm.$forceUpdate()
  474. })
  475. })
  476. },
  477. getDoctorInfo: function () {
  478. var vm = this
  479. var data = {
  480. code: vm.doctorInfo.code
  481. }
  482. jbscAPI.doctorBaseinfo(data).then(function (res) {
  483. if (res.status == 200) {
  484. vm.doctorInfo = res.data
  485. } else {
  486. top.layer.msg(res.msg, { icon: 5 })
  487. }
  488. })
  489. },
  490. //计算选中个数,组装成后台接收格式
  491. selectItem: function (qst, select, num) {
  492. var vm = this
  493. var isFlag = 1
  494. if (qst.title == '抗栓药物其他名称' && vm.screeningTitle == '大肠癌筛查问卷(OB筛查)') {
  495. vm.selectArr.forEach(function (item, index) {
  496. if (item.thirdKey == 'ksDrugName1') {
  497. item.options.forEach(function (v, i) {
  498. if (v.comment == '其他') {
  499. isFlag = 0
  500. return false
  501. }
  502. })
  503. }
  504. })
  505. // 如果没有勾选“其他”选项,提示并返回
  506. if (isFlag) {
  507. qst.content = '' // 清空当前输入的内容
  508. this.$message.error('请先勾选抗栓药物名称的其他选项')
  509. return false
  510. }
  511. }
  512. if (vm.ascvdShow) {
  513. if (select.thirdKey == 'acs' || select.thirdKey == 'myocardialInfarct' || select.thirdKey == 'ischemicStroke' || select.thirdKey == 'seriousMedicalHistory') {
  514. return false
  515. }
  516. }
  517. var data = {
  518. qstCode: qst.code,
  519. type: qst.questionType,
  520. content: qst.content,
  521. thirdKey: qst.thirdKey
  522. }
  523. var options = []
  524. var ls = []
  525. var lsTo = []
  526. if (select) {
  527. if (qst.questionType == '1') {
  528. // 处理多选题
  529. if (!qst.selectedOptions) {
  530. qst.selectedOptions = []
  531. }
  532. var optionIndex = qst.selectedOptions.findIndex(item => item.optionCode == select.code)
  533. if (optionIndex > -1) {
  534. // 如果已经选中,则取消选择
  535. qst.selectedOptions.splice(optionIndex, 1)
  536. } else {
  537. // 如果未选中,则添加选项
  538. qst.selectedOptions.push({
  539. optionCode: select.code,
  540. comment: select.content,
  541. score: select.score,
  542. thirdKey: select.thirdKey,
  543. thirdValue: select.thirdValue
  544. })
  545. }
  546. options = qst.selectedOptions // 将选中的所有选项赋值给options
  547. } else {
  548. options = [
  549. {
  550. optionCode: select.code,
  551. comment: select.content,
  552. score: select.score,
  553. thirdKey: select.thirdKey,
  554. thirdValue: select.thirdValue
  555. }
  556. ]
  557. }
  558. if (select.thirdKey == 'ascvd' && select.thirdValue == 0) {
  559. this.ascvdShow = '0'
  560. vm.spliceFunction()
  561. for (var i in this.questions) {
  562. if (
  563. this.questions[i].question.thirdKey == 'acs' ||
  564. this.questions[i].question.thirdKey == 'myocardialInfarct' ||
  565. this.questions[i].question.thirdKey == 'ischemicStroke' ||
  566. this.questions[i].question.thirdKey == 'seriousMedicalHistory'
  567. ) {
  568. var s = this.questions[i].option[1]
  569. var v = this.questions[i].question
  570. ls.push({
  571. qstCode: v.code,
  572. type: v.questionType,
  573. thirdKey: v.thirdKey,
  574. options: [
  575. {
  576. optionCode: s.code,
  577. comment: s.content,
  578. score: s.score,
  579. thirdKey: s.thirdKey,
  580. thirdValue: s.thirdValue
  581. }
  582. ]
  583. })
  584. }
  585. }
  586. document.getElementById('myInput1').disabled = true
  587. document.getElementById('myInput2').disabled = true
  588. document.getElementById('myInput3').disabled = true
  589. document.getElementById('myInput4').disabled = true
  590. } else if (select.thirdKey == 'ascvd' && select.thirdValue == 1) {
  591. this.ascvdShow = ''
  592. this.ascvdS1 = ''
  593. this.ascvdS2 = ''
  594. this.ascvdS3 = ''
  595. this.ascvdS4 = ''
  596. document.getElementById('myInput1').disabled = false
  597. document.getElementById('myInput2').disabled = false
  598. document.getElementById('myInput3').disabled = false
  599. document.getElementById('myInput4').disabled = false
  600. ls = []
  601. vm.spliceFunction()
  602. }
  603. if (select.thirdKey == 'acs') {
  604. vm.ascvdS1 = select.thirdValue
  605. }
  606. if (select.thirdKey == 'myocardialInfarct') {
  607. vm.ascvdS2 = select.thirdValue
  608. }
  609. if (select.thirdKey == 'ischemicStroke') {
  610. vm.ascvdS3 = select.thirdValue
  611. }
  612. if (select.thirdKey == 'seriousMedicalHistory') {
  613. vm.ascvdS4 = select.thirdValue
  614. }
  615. if (select.thirdKey == 'smoke') {
  616. vm.smoke = select.thirdValue
  617. }
  618. if (select.thirdKey == 'isCkd34') {
  619. vm.isCkd34 = select.thirdValue
  620. console.log('kkkkkkkkkkkkkkkkkkkkkkkkkk88888888888',select)
  621. }
  622. if (select.thirdKey == 'hypertension') {
  623. vm.hypertension = select.thirdValue
  624. }
  625. if (select.thirdKey == 'diabetes') {
  626. vm.diabetes = select.thirdValue
  627. }
  628. }
  629. if ((num && qst.thirdKey == 'weight') || qst.thirdKey == 'height') {
  630. var weight = ''
  631. var height = ''
  632. for (var i in vm.questions) {
  633. if (vm.questions[i].question.thirdKey == 'weight') {
  634. weight = vm.questions[i].question.content
  635. }
  636. if (vm.questions[i].question.thirdKey == 'height') {
  637. height = vm.questions[i].question.content
  638. }
  639. }
  640. var w = qst.thirdKey == 'weight' ? qst.content : weight
  641. var h = qst.thirdKey == 'height' ? qst.content : height / 100
  642. var s = (w / (h * h)).toFixed(2)
  643. vm.selectArr.forEach(function (v, i) {
  644. if (v.thirdKey == 'bmi') {
  645. vm.selectArr.splice(i, 1)
  646. }
  647. })
  648. for (var i in vm.questions) {
  649. if (vm.questions[i].question.thirdKey == 'bmi') {
  650. lsTo.push({
  651. qstCode: vm.questions[i].question.code,
  652. type: vm.questions[i].question.questionType,
  653. content: s,
  654. thirdKey: vm.questions[i].question.thirdKey,
  655. options: []
  656. })
  657. vm.shaowas = s
  658. // if(w && h) {
  659. // vm.shaowas = s
  660. // }
  661. // console.log(vm.questions[i].question.content,"0809")
  662. // vm.questions[i].question.content = ''
  663. // console.log(vm.questions[i].question.content,"00000---")
  664. }
  665. }
  666. }
  667. data.options = options
  668. var oldLen = this.selectArr.length
  669. this.selectArr =
  670. _.filter(this.selectArr, function (o) {
  671. return o.qstCode != data.qstCode
  672. }) || []
  673. this.selectArr = this.selectArr.concat(lsTo)
  674. this.selectArr = this.selectArr.concat(ls)
  675. this.selectArr.push(data)
  676. var len = this.selectArr.length
  677. // var questions=Object.values(this.questions)
  678. var questions = _.toArray(this.questions)
  679. var allLen = questions.length
  680. var progress = len === allLen ? 100 : (len / allLen) * 100
  681. if (select && select.thirdKey == 'ascvd') {
  682. this.$refs.progress.dataFunction(progress)
  683. } else {
  684. this.progress = progress
  685. }
  686. },
  687. spliceFunction: function () {
  688. var vm = this
  689. vm.selectArr.forEach(function (v, i) {
  690. if (v.thirdKey == 'acs') {
  691. vm.selectArr.splice(i, 1)
  692. }
  693. })
  694. vm.selectArr.forEach(function (v, i) {
  695. if (v.thirdKey == 'myocardialInfarct') {
  696. vm.selectArr.splice(i, 1)
  697. }
  698. })
  699. vm.selectArr.forEach(function (v, i) {
  700. if (v.thirdKey == 'ischemicStroke') {
  701. vm.selectArr.splice(i, 1)
  702. }
  703. })
  704. vm.selectArr.forEach(function (v, i) {
  705. if (v.thirdKey == 'seriousMedicalHistory') {
  706. vm.selectArr.splice(i, 1)
  707. }
  708. })
  709. },
  710. signOut: function () {
  711. var index = top.layer.getFrameIndex(window.name) //先得到当前iframe层的索引
  712. var current = top.layer.confirm(
  713. '问卷还未提交,确定要关闭?',
  714. {
  715. btn: ['关闭', '取消'] //按钮
  716. },
  717. function () {
  718. top.layer.closeAll() //再执行关闭
  719. },
  720. function () {
  721. top.layer.close(current) //再执行关闭
  722. }
  723. )
  724. },
  725. changeContent: function (qst, content, num) {
  726. if (!content) return
  727. this.selectItem(qst, '', num)
  728. },
  729. getQuestion: function () {
  730. var vm = this
  731. var data = {
  732. surveyTemplateCode: vm.screeningType
  733. }
  734. jbscAPI.getAllQuestions(data).then(function (res) {
  735. if (res.status == 200) {
  736. for (var i in res.data) {
  737. if (res.data[i].isThird == 3) {
  738. if (res.data[i].question.questionType == '1') {
  739. res.data[i].question.selectedOptions = [] // 初始化多选项的数组
  740. }
  741. if (res.data[i].question.thirdKey == 'assessTime') {
  742. res.data[i].question.content = new Date()
  743. }
  744. if (res.data[i].option.length != 0) {
  745. res.data[i].question.thirdKey = res.data[i].option[0].thirdKey
  746. }
  747. if (res.data[i].question.thirdKey == 'assessDoctor') {
  748. res.data[i].question.content = docInfo.name
  749. }
  750. if (res.data[i].question.thirdKey == 'assessOrgId') {
  751. res.data[i].question.content = docInfo.hospitalName
  752. }
  753. if (res.data[i].question.thirdKey == 'name') {
  754. res.data[i].question.content = vm.screeningResidentsName
  755. }
  756. if (res.data[i].question.thirdKey == 'sex') {
  757. res.data[i].question.content = vm.sex
  758. }
  759. if (res.data[i].question.thirdKey == 'age') {
  760. res.data[i].question.content = vm.age
  761. }
  762. }
  763. if (res.data[i].question.thirdKey == 'belongCommunity') {
  764. res.data[i].question.content = docInfo.hospitalName
  765. }
  766. if (res.data[i].question.thirdKey == 'doctorName') {
  767. res.data[i].question.content = docInfo.name
  768. }
  769. if (res.data[i].question.thirdKey == 'doctorPhoneNo') {
  770. res.data[i].question.content = docInfo.mobile
  771. }
  772. if (res.data[i].question.thirdKey == 'userName') {
  773. res.data[i].question.content = decodeURI(httpData.resident_name)
  774. }
  775. if (res.data[i].question.thirdKey == 'idNo') {
  776. res.data[i].question.content = httpData.idcard
  777. }
  778. if (res.data[i].question.thirdKey == 'phoneNo') {
  779. res.data[i].question.content = httpData.mobile
  780. }
  781. if (res.data[i].question.thirdKey == 'assessDoctor') {
  782. res.data[i].question.content = docInfo.name
  783. }
  784. if (res.data[i].question.thirdKey == 'assessOrgId') {
  785. res.data[i].question.content = docInfo.hospitalName
  786. }
  787. if (res.data[i].question.thirdKey == 'age') {
  788. res.data[i].question.content = httpData.age
  789. }
  790. if (res.data[i].question.title == '性别') {
  791. var index = vm.sex == 1 ? '0' : '1'
  792. vm.selectItem(res.data[i].question, res.data[i].option[index])
  793. }
  794. if (res.data[i].question.thirdKey == 'createDate') {
  795. res.data[i].question.content = new Date().format('yyyy-MM-dd hh:mm:ss')
  796. }
  797. if (res.data[i].question.thirdKey == 'assessTime') {
  798. res.data[i].question.content = new Date().format('yyyy-MM-dd hh:mm:ss')
  799. }
  800. if (res.data[i].question.thirdKey == 'sex' && (vm.screeningTitle == '大肠癌筛查问卷(OB筛查)' || vm.screeningTitle == '脑卒中风险评估(冠心病、脑卒中、肾病)')) {
  801. var index = vm.sex == 1 ? '0' : '1'
  802. vm.selectItem(res.data[i].question, res.data[i].option[index])
  803. }
  804. }
  805. vm.questions = res.data
  806. for (var i in res.data) {
  807. if (res.data[i].isThird == 3) {
  808. if (res.data[i].question.thirdKey == 'assessTime') {
  809. vm.changeContent(res.data[i].question, new Date().format('yyyy-MM-dd HH:mm'))
  810. }
  811. if (res.data[i].question.thirdKey == 'assessDoctor') {
  812. vm.changeContent(res.data[i].question, docInfo.name)
  813. }
  814. if (res.data[i].question.thirdKey == 'assessOrgId') {
  815. vm.changeContent(res.data[i].question, docInfo.hospitalName)
  816. }
  817. if (res.data[i].question.thirdKey == 'name') {
  818. vm.changeContent(res.data[i].question, vm.screeningResidentsName)
  819. }
  820. if (res.data[i].question.thirdKey == 'age') {
  821. vm.changeContent(res.data[i].question, vm.age)
  822. }
  823. if (res.data[i].question.thirdKey == 'sex') {
  824. var index = vm.sex == 1 ? '0' : '1'
  825. vm.selectItem(res.data[i].question, res.data[i].option[index])
  826. }
  827. }
  828. }
  829. vm.$forceUpdate()
  830. }
  831. })
  832. },
  833. getHealth: function () {
  834. var vm = this
  835. jbscAPI
  836. .listMedical({
  837. patient: vm.screeningResidents,
  838. pageIndex: 1,
  839. pageSize: 1
  840. })
  841. .then(function (v) {
  842. if (v.status == 200) {
  843. if (v.list[0]) {
  844. jbscAPI
  845. .findMedicalDetail({
  846. medicalNo: v.list[0].medicalNo
  847. })
  848. .then(function (res) {
  849. if (res.status == 200) {
  850. var data = res.medical_detail
  851. for (var i in vm.questions) {
  852. if (vm.questions[i].question.thirdKey == 'height') {
  853. vm.questions[i].question.content = data.height
  854. vm.changeContent(vm.questions[i].question, data.height)
  855. }
  856. if (vm.questions[i].question.thirdKey == 'weight') {
  857. vm.questions[i].question.content = data.weight
  858. vm.changeContent(vm.questions[i].question, data.weight)
  859. }
  860. if (vm.questions[i].question.thirdKey == 'bmi') {
  861. if (data.height && data.weight) {
  862. var w = data.weight
  863. var h = data.height / 100
  864. var s = (w / (h * h)).toFixed(2)
  865. vm.questions[i].question.content = s
  866. vm.shaowas = s
  867. vm.changeContent(vm.questions[i].question, s)
  868. }
  869. }
  870. if (vm.questions[i].question.thirdKey == 'systolicPressure') {
  871. vm.questions[i].question.content = data.bloodPressureRigthU
  872. vm.changeContent(vm.questions[i].question, data.bloodPressureRigthU)
  873. }
  874. if (vm.questions[i].question.thirdKey == 'diastolicPressure') {
  875. vm.questions[i].question.content = data.bloodPressureRigthD
  876. vm.changeContent(vm.questions[i].question, data.bloodPressureRigthD)
  877. }
  878. if (vm.questions[i].question.thirdKey == 'bpU') {
  879. vm.questions[i].question.content = data.bloodPressureLeftU || data.bloodPressureRigthU
  880. vm.changeContent(vm.questions[i].question, data.bloodPressureLeftU || data.bloodPressureRigthU)
  881. }
  882. if (vm.questions[i].question.thirdKey == 'bpD') {
  883. vm.questions[i].question.content = data.bloodPressureLeftD || data.bloodPressureRigthD
  884. vm.changeContent(vm.questions[i].question, data.bloodPressureLeftD || data.bloodPressureRigthD)
  885. }
  886. if (vm.questions[i].question.thirdKey == 'glycolatedHemoglobin') {
  887. vm.questions[i].question.content = data.glycolatedHemoglobin
  888. vm.changeContent(vm.questions[i].question, data.glycolatedHemoglobin)
  889. }
  890. if (vm.questions[i].question.thirdKey == 'fbg') {
  891. vm.questions[i].question.content = data.fastingPlasmaGlucoseL
  892. vm.changeContent(vm.questions[i].question, data.fastingPlasmaGlucoseL)
  893. }
  894. if (vm.questions[i].question.thirdKey == 'bloodPotassium') {
  895. vm.questions[i].question.content = data.renalFunctionBloodPotassium
  896. vm.changeContent(vm.questions[i].question, data.renalFunctionBloodPotassium)
  897. }
  898. if (vm.questions[i].question.thirdKey == 'renalFunctionCreatinine') {
  899. vm.questions[i].question.content = data.renalFunctionCreatinine
  900. vm.changeContent(vm.questions[i].question, data.renalFunctionCreatinine)
  901. }
  902. if (vm.questions[i].question.thirdKey == 'ckd34') {
  903. if (data.renalFunctionCreatinine) {
  904. var ckd34 = (((140 - vm.age) * data.weight) / (0.818 * data.renalFunctionCreatinine)).toFixed(2)
  905. vm.questions[i].question.content = ckd34
  906. vm.selectItem(vm.questions[i - 1].question, vm.questions[i - 1].option[0])
  907. vm.changeContent(vm.questions[i].question, ckd34)
  908. } else {
  909. vm.selectItem(vm.questions[i - 1].question, vm.questions[i - 1].option[1])
  910. // vm.questions[i].question.content = '1'
  911. vm.changeContent(vm.questions[i].question, '1')
  912. vm.questions[i].question.content = ''
  913. }
  914. }
  915. }
  916. if (vm.screeningType == '6bcd306aaafb4e4381071346d86fadbb1') {
  917. // 如果是ascvd筛查再调用第三方接口
  918. vm.getInitData()
  919. }
  920. }
  921. })
  922. vm.$forceUpdate()
  923. } else {
  924. var data = {
  925. patient: vm.screeningResidents
  926. }
  927. jbscAPI.getHealth(data).then(function (res) {
  928. if (res.status == 200) {
  929. vm.tizhongRecord =
  930. _.find(res.data, function (o) {
  931. return o.type == '3'
  932. }) || {}
  933. for (var i in vm.questions) {
  934. if (vm.questions[i].question.thirdKey == 'height') {
  935. vm.questions[i].question.content = vm.tizhongRecord.value2
  936. vm.changeContent(vm.questions[i].question, vm.tizhongRecord.value2)
  937. }
  938. if (vm.questions[i].question.thirdKey == 'weight') {
  939. vm.questions[i].question.content = vm.tizhongRecord.value1
  940. vm.changeContent(vm.questions[i].question, vm.tizhongRecord.value1)
  941. }
  942. if (vm.questions[i].question.thirdKey == 'systolicPressure') {
  943. vm.questions[i].question.content = res.data.xy.value1
  944. vm.changeContent(vm.questions[i].question, res.data.xy.value1)
  945. }
  946. if (vm.questions[i].question.thirdKey == 'diastolicPressure') {
  947. vm.questions[i].question.content = res.data.xy.value2
  948. vm.changeContent(vm.questions[i].question, res.data.xy.value2)
  949. }
  950. if (vm.questions[i].question.thirdKey == 'bmi') {
  951. if (vm.tizhongRecord.value2 && vm.tizhongRecord.value1) {
  952. var w = vm.tizhongRecord.value1
  953. var h = vm.tizhongRecord.value2 / 100
  954. var s = (w / (h * h)).toFixed(2)
  955. vm.questions[i].question.content = s
  956. vm.shaowas = s
  957. vm.changeContent(vm.questions[i].question, s)
  958. }
  959. }
  960. }
  961. } else {
  962. top.layer.msg(res.msg, { icon: 5 })
  963. }
  964. vm.$forceUpdate()
  965. })
  966. }
  967. }
  968. })
  969. },
  970. save: function () {
  971. var vm = this
  972. var flag=0
  973. if (vm.progress != 100) {
  974. top.layer.msg('问卷还未全部填写', { icon: 5 })
  975. return
  976. }
  977. vm.selectArr.forEach(function (v) {
  978. if (v.thirdKey == 'assessTime') {
  979. v.content = new Date(v.content).format('yyyy-MM-dd HH:mm')
  980. }
  981. if (v.thirdKey == 'isCkd34') {
  982. if (v.options[0].thirdValue == '0') {
  983. vm.selectArr.forEach(function (it) {
  984. if (it.thirdKey == 'ckd34') {
  985. it.content = ''
  986. }
  987. })
  988. }
  989. if (v.options[0].thirdValue == '1') {
  990. vm.selectArr.forEach(function (it) {
  991. if (it.thirdKey == 'ckd34'&&(typeof it.content == "undefined"||it.content =='')) {
  992. flag=1
  993. }
  994. })
  995. }
  996. }
  997. })
  998. if(flag){
  999. top.layer.msg('问卷还未全部填写', { icon: 5 })
  1000. return
  1001. }
  1002. var loadding = top.layer.load(0, { shade: false }) //0代表加载的风格,支持0-2
  1003. var data
  1004. if (vm.screeningType == 'aa9bd609fd8b492296f6a34849b76520') {
  1005. var formData = JSON.parse(JSON.stringify(this.answer))
  1006. formData.ksDrugName1 = (formData.ksDrugName1 ?? []).join(',')
  1007. data = {
  1008. patientCode: vm.screeningResidents,
  1009. labelType: vm.labelType,
  1010. isAgain: vm.isAgain,
  1011. source: 1,
  1012. jsonData: JSON.stringify({
  1013. surveyCode: vm.screeningType,
  1014. surveyData: formData
  1015. })
  1016. }
  1017. } else {
  1018. data = {
  1019. patientCode: vm.screeningResidents,
  1020. labelType: vm.labelType,
  1021. isAgain: vm.isAgain,
  1022. source: 1,
  1023. surveyStatus: vm.surveyStatus,
  1024. jsonData: JSON.stringify({
  1025. surveyCode: vm.screeningType,
  1026. questions: vm.selectArr
  1027. })
  1028. }
  1029. }
  1030. jbscAPI.saveAnswer(data).then(function (res) {
  1031. top.layer.close(loadding)
  1032. if (res.status == 200) {
  1033. if (vm.screeningType == 'aa9bd609fd8b492296f6a34849b76520' || vm.questions[1].isThird == 3) {
  1034. top.layer.open({
  1035. type: 2,
  1036. // offset: ['100px'], //右下角弹出
  1037. area: ['568px', '100%'],
  1038. shade: 0.5,
  1039. title: '查看筛选结果',
  1040. fixed: true, //不固定
  1041. maxmin: true,
  1042. closeBtn: 1,
  1043. shift: 5,
  1044. shadeClose: false, //点击遮罩关闭层
  1045. content: '../../jbsc/html/view_screening_results.html?resultCode=' + res.data,
  1046. end: function () {
  1047. var index = top.layer.getFrameIndex(window.name) //先得到当前iframe层的索引
  1048. parent.eventBuss.$emit('guan_results', index)
  1049. }
  1050. })
  1051. } else {
  1052. top.layer.open({
  1053. type: 2,
  1054. area: ['820px', '648px'],
  1055. shade: 0.5,
  1056. title: '筛选统计',
  1057. fixed: true, //不固定
  1058. maxmin: true,
  1059. closeBtn: 1,
  1060. shift: 5,
  1061. shadeClose: false, //点击遮罩关闭层
  1062. content: '../../jbsc/html/filter_result.html?code=' + res.data + '&filter_type=' + vm.screeningType
  1063. })
  1064. }
  1065. } else {
  1066. top.layer.msg(res.msg, { icon: 5 })
  1067. }
  1068. })
  1069. },
  1070. // 返回选择居民或者问卷类型
  1071. goBack: function (number) {
  1072. if (this.noswitch) {
  1073. return
  1074. }
  1075. var vm = this
  1076. if (vm.isAgain) {
  1077. var content
  1078. if (number == 1) {
  1079. content = '再次筛查无法选择居民'
  1080. } else {
  1081. content = '再次筛查无法选择问卷类型'
  1082. }
  1083. top.layer.msg(content, { icon: 5 })
  1084. return
  1085. }
  1086. var content = '../../jbsc/html/filter_type.html?isReLoad=1'
  1087. if (number === 1) {
  1088. //选择居民
  1089. content += '&goDenizen=1&fliter_code=' + vm.screeningType + '&fliter_title=' + vm.screeningTitle
  1090. }
  1091. layer.open({
  1092. type: 2,
  1093. offset: 'rb', //右下角弹出
  1094. id: 'filter_type',
  1095. background: 'transparent',
  1096. area: ['280px', '100%'],
  1097. shade: 0.5,
  1098. title: false,
  1099. fixed: true, //不固定
  1100. maxmin: false,
  1101. closeBtn: 0,
  1102. shift: 5,
  1103. shadeClose: true, //点击遮罩关闭层
  1104. content: content
  1105. })
  1106. }
  1107. },
  1108. watch: {
  1109. screeningType: function () {
  1110. $('.daan-list input').attr('checked', false)
  1111. },
  1112. answer: {
  1113. handler(nv) {
  1114. var vm = this
  1115. if (nv.isFuyongks) {
  1116. var obj = this.questionList.find(function (el) {
  1117. return el.field == 'ksDrugName1'
  1118. })
  1119. obj.required = nv.isFuyongks == 1 ? true : false
  1120. }
  1121. if (nv.isEndoscopy) {
  1122. var obj1 = this.questionList.find(function (el) {
  1123. return el.field == 'endoscopyTime'
  1124. })
  1125. var obj2 = this.questionList.find(function (el) {
  1126. return el.field == 'endoscopyResult'
  1127. })
  1128. var obj3 = this.questionList.find(function (el) {
  1129. return el.field == 'endoscopyHospitalName'
  1130. })
  1131. obj1.required = nv.isEndoscopy == 1 ? true : false
  1132. obj2.required = nv.isEndoscopy == 1 ? true : false
  1133. obj3.required = nv.isEndoscopy == 1 ? true : false
  1134. }
  1135. var all = 0
  1136. var have = 0
  1137. this.questionList.forEach(function (item) {
  1138. if (item.required) {
  1139. all++
  1140. if (item.field == 'ksDrugName1' && vm.answer.ksDrugName1 && vm.answer.ksDrugName1.length > 0) {
  1141. have++
  1142. } else if (item.field != 'ksDrugName1' && vm.answer[item.field]) {
  1143. have++
  1144. }
  1145. }
  1146. })
  1147. var progress = Math.floor((have / all) * 100)
  1148. if (progress != vm.progress1) {
  1149. vm.$refs.progress.dataFunction(progress)
  1150. vm.progress1 = progress
  1151. }
  1152. if (progress == 100) {
  1153. vm.progress = progress
  1154. }
  1155. this.$forceUpdate()
  1156. },
  1157. deep: true
  1158. }
  1159. }
  1160. })
  1161. </script>
  1162. </body>
  1163. </html>