questionnaire.html 53 KB

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