questionnaire.html 53 KB

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