questionnaire.html 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173
  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)" 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. }
  621. if (select.thirdKey == 'hypertension') {
  622. vm.hypertension = select.thirdValue
  623. }
  624. if (select.thirdKey == 'diabetes') {
  625. vm.diabetes = select.thirdValue
  626. }
  627. }
  628. if ((num && qst.thirdKey == 'weight') || qst.thirdKey == 'height') {
  629. var weight = ''
  630. var height = ''
  631. for (var i in vm.questions) {
  632. if (vm.questions[i].question.thirdKey == 'weight') {
  633. weight = vm.questions[i].question.content
  634. }
  635. if (vm.questions[i].question.thirdKey == 'height') {
  636. height = vm.questions[i].question.content
  637. }
  638. }
  639. var w = qst.thirdKey == 'weight' ? qst.content : weight
  640. var h = qst.thirdKey == 'height' ? qst.content : height / 100
  641. var s = (w / (h * h)).toFixed(2)
  642. vm.selectArr.forEach(function (v, i) {
  643. if (v.thirdKey == 'bmi') {
  644. vm.selectArr.splice(i, 1)
  645. }
  646. })
  647. for (var i in vm.questions) {
  648. if (vm.questions[i].question.thirdKey == 'bmi') {
  649. lsTo.push({
  650. qstCode: vm.questions[i].question.code,
  651. type: vm.questions[i].question.questionType,
  652. content: s,
  653. thirdKey: vm.questions[i].question.thirdKey,
  654. options: []
  655. })
  656. vm.shaowas = s
  657. // if(w && h) {
  658. // vm.shaowas = s
  659. // }
  660. // console.log(vm.questions[i].question.content,"0809")
  661. // vm.questions[i].question.content = ''
  662. // console.log(vm.questions[i].question.content,"00000---")
  663. }
  664. }
  665. }
  666. data.options = options
  667. var oldLen = this.selectArr.length
  668. this.selectArr =
  669. _.filter(this.selectArr, function (o) {
  670. return o.qstCode != data.qstCode
  671. }) || []
  672. this.selectArr = this.selectArr.concat(lsTo)
  673. this.selectArr = this.selectArr.concat(ls)
  674. this.selectArr.push(data)
  675. var len = this.selectArr.length
  676. // var questions=Object.values(this.questions)
  677. var questions = _.toArray(this.questions)
  678. var allLen = questions.length
  679. var progress = len === allLen ? 100 : (len / allLen) * 100
  680. if (select && select.thirdKey == 'ascvd') {
  681. this.$refs.progress.dataFunction(progress)
  682. } else {
  683. this.progress = progress
  684. }
  685. },
  686. spliceFunction: function () {
  687. var vm = this
  688. vm.selectArr.forEach(function (v, i) {
  689. if (v.thirdKey == 'acs') {
  690. vm.selectArr.splice(i, 1)
  691. }
  692. })
  693. vm.selectArr.forEach(function (v, i) {
  694. if (v.thirdKey == 'myocardialInfarct') {
  695. vm.selectArr.splice(i, 1)
  696. }
  697. })
  698. vm.selectArr.forEach(function (v, i) {
  699. if (v.thirdKey == 'ischemicStroke') {
  700. vm.selectArr.splice(i, 1)
  701. }
  702. })
  703. vm.selectArr.forEach(function (v, i) {
  704. if (v.thirdKey == 'seriousMedicalHistory') {
  705. vm.selectArr.splice(i, 1)
  706. }
  707. })
  708. },
  709. signOut: function () {
  710. var index = top.layer.getFrameIndex(window.name) //先得到当前iframe层的索引
  711. var current = top.layer.confirm(
  712. '问卷还未提交,确定要关闭?',
  713. {
  714. btn: ['关闭', '取消'] //按钮
  715. },
  716. function () {
  717. top.layer.closeAll() //再执行关闭
  718. },
  719. function () {
  720. top.layer.close(current) //再执行关闭
  721. }
  722. )
  723. },
  724. changeContent: function (qst, content, num) {
  725. if (!content) return
  726. this.selectItem(qst, '', num)
  727. },
  728. getQuestion: function () {
  729. var vm = this
  730. var data = {
  731. surveyTemplateCode: vm.screeningType
  732. }
  733. jbscAPI.getAllQuestions(data).then(function (res) {
  734. if (res.status == 200) {
  735. for (var i in res.data) {
  736. if (res.data[i].isThird == 3) {
  737. if (res.data[i].question.questionType == '1') {
  738. res.data[i].question.selectedOptions = [] // 初始化多选项的数组
  739. }
  740. if (res.data[i].question.thirdKey == 'assessTime') {
  741. res.data[i].question.content = new Date()
  742. }
  743. if (res.data[i].option.length != 0) {
  744. res.data[i].question.thirdKey = res.data[i].option[0].thirdKey
  745. }
  746. if (res.data[i].question.thirdKey == 'assessDoctor') {
  747. res.data[i].question.content = docInfo.name
  748. }
  749. if (res.data[i].question.thirdKey == 'assessOrgId') {
  750. res.data[i].question.content = docInfo.hospitalName
  751. }
  752. if (res.data[i].question.thirdKey == 'name') {
  753. res.data[i].question.content = vm.screeningResidentsName
  754. }
  755. if (res.data[i].question.thirdKey == 'sex') {
  756. res.data[i].question.content = vm.sex
  757. }
  758. if (res.data[i].question.thirdKey == 'age') {
  759. res.data[i].question.content = vm.age
  760. }
  761. }
  762. if (res.data[i].question.thirdKey == 'belongCommunity') {
  763. res.data[i].question.content = docInfo.hospitalName
  764. }
  765. if (res.data[i].question.thirdKey == 'doctorName') {
  766. res.data[i].question.content = docInfo.name
  767. }
  768. if (res.data[i].question.thirdKey == 'doctorPhoneNo') {
  769. res.data[i].question.content = docInfo.mobile
  770. }
  771. if (res.data[i].question.thirdKey == 'userName') {
  772. res.data[i].question.content = decodeURI(httpData.resident_name)
  773. }
  774. if (res.data[i].question.thirdKey == 'idNo') {
  775. res.data[i].question.content = httpData.idcard
  776. }
  777. if (res.data[i].question.thirdKey == 'phoneNo') {
  778. res.data[i].question.content = httpData.mobile
  779. }
  780. if (res.data[i].question.thirdKey == 'assessDoctor') {
  781. res.data[i].question.content = docInfo.name
  782. }
  783. if (res.data[i].question.thirdKey == 'assessOrgId') {
  784. res.data[i].question.content = docInfo.hospitalName
  785. }
  786. if (res.data[i].question.thirdKey == 'age') {
  787. res.data[i].question.content = httpData.age
  788. }
  789. if (res.data[i].question.title == '性别') {
  790. var index = vm.sex == 1 ? '0' : '1'
  791. vm.selectItem(res.data[i].question, res.data[i].option[index])
  792. }
  793. if (res.data[i].question.thirdKey == 'createDate') {
  794. res.data[i].question.content = new Date().format('yyyy-MM-dd hh:mm:ss')
  795. }
  796. if (res.data[i].question.thirdKey == 'assessTime') {
  797. res.data[i].question.content = new Date().format('yyyy-MM-dd hh:mm:ss')
  798. }
  799. if (res.data[i].question.thirdKey == 'sex' && (vm.screeningTitle == '大肠癌筛查问卷(OB筛查)' || vm.screeningTitle == '脑卒中风险评估(冠心病、脑卒中、肾病)')) {
  800. var index = vm.sex == 1 ? '0' : '1'
  801. vm.selectItem(res.data[i].question, res.data[i].option[index])
  802. }
  803. }
  804. vm.questions = res.data
  805. for (var i in res.data) {
  806. if (res.data[i].isThird == 3) {
  807. if (res.data[i].question.thirdKey == 'assessTime') {
  808. vm.changeContent(res.data[i].question, new Date().format('yyyy-MM-dd HH:mm'))
  809. }
  810. if (res.data[i].question.thirdKey == 'assessDoctor') {
  811. vm.changeContent(res.data[i].question, docInfo.name)
  812. }
  813. if (res.data[i].question.thirdKey == 'assessOrgId') {
  814. vm.changeContent(res.data[i].question, docInfo.hospitalName)
  815. }
  816. if (res.data[i].question.thirdKey == 'name') {
  817. vm.changeContent(res.data[i].question, vm.screeningResidentsName)
  818. }
  819. if (res.data[i].question.thirdKey == 'age') {
  820. vm.changeContent(res.data[i].question, vm.age)
  821. }
  822. if (res.data[i].question.thirdKey == 'sex') {
  823. var index = vm.sex == 1 ? '0' : '1'
  824. vm.selectItem(res.data[i].question, res.data[i].option[index])
  825. }
  826. }
  827. }
  828. vm.$forceUpdate()
  829. }
  830. })
  831. },
  832. getHealth: function () {
  833. var vm = this
  834. jbscAPI
  835. .listMedical({
  836. patient: vm.screeningResidents,
  837. pageIndex: 1,
  838. pageSize: 1
  839. })
  840. .then(function (v) {
  841. if (v.status == 200) {
  842. if (v.list[0]) {
  843. jbscAPI
  844. .findMedicalDetail({
  845. medicalNo: v.list[0].medicalNo
  846. })
  847. .then(function (res) {
  848. if (res.status == 200) {
  849. var data = res.medical_detail
  850. for (var i in vm.questions) {
  851. if (vm.questions[i].question.thirdKey == 'height') {
  852. vm.questions[i].question.content = data.height
  853. vm.changeContent(vm.questions[i].question, data.height)
  854. }
  855. if (vm.questions[i].question.thirdKey == 'weight') {
  856. vm.questions[i].question.content = data.weight
  857. vm.changeContent(vm.questions[i].question, data.weight)
  858. }
  859. if (vm.questions[i].question.thirdKey == 'bmi') {
  860. if (data.height && data.weight) {
  861. var w = data.weight
  862. var h = data.height / 100
  863. var s = (w / (h * h)).toFixed(2)
  864. vm.questions[i].question.content = s
  865. vm.shaowas = s
  866. vm.changeContent(vm.questions[i].question, s)
  867. }
  868. }
  869. if (vm.questions[i].question.thirdKey == 'systolicPressure') {
  870. vm.questions[i].question.content = data.bloodPressureRigthU
  871. vm.changeContent(vm.questions[i].question, data.bloodPressureRigthU)
  872. }
  873. if (vm.questions[i].question.thirdKey == 'diastolicPressure') {
  874. vm.questions[i].question.content = data.bloodPressureRigthD
  875. vm.changeContent(vm.questions[i].question, data.bloodPressureRigthD)
  876. }
  877. if (vm.questions[i].question.thirdKey == 'bpU') {
  878. vm.questions[i].question.content = data.bloodPressureLeftU || data.bloodPressureRigthU
  879. vm.changeContent(vm.questions[i].question, data.bloodPressureLeftU || data.bloodPressureRigthU)
  880. }
  881. if (vm.questions[i].question.thirdKey == 'bpD') {
  882. vm.questions[i].question.content = data.bloodPressureLeftD || data.bloodPressureRigthD
  883. vm.changeContent(vm.questions[i].question, data.bloodPressureLeftD || data.bloodPressureRigthD)
  884. }
  885. if (vm.questions[i].question.thirdKey == 'glycolatedHemoglobin') {
  886. vm.questions[i].question.content = data.glycolatedHemoglobin
  887. vm.changeContent(vm.questions[i].question, data.glycolatedHemoglobin)
  888. }
  889. if (vm.questions[i].question.thirdKey == 'fbg') {
  890. vm.questions[i].question.content = data.fastingPlasmaGlucoseL
  891. vm.changeContent(vm.questions[i].question, data.fastingPlasmaGlucoseL)
  892. }
  893. if (vm.questions[i].question.thirdKey == 'bloodPotassium') {
  894. vm.questions[i].question.content = data.renalFunctionBloodPotassium
  895. vm.changeContent(vm.questions[i].question, data.renalFunctionBloodPotassium)
  896. }
  897. if (vm.questions[i].question.thirdKey == 'renalFunctionCreatinine') {
  898. vm.questions[i].question.content = data.renalFunctionCreatinine
  899. vm.changeContent(vm.questions[i].question, data.renalFunctionCreatinine)
  900. }
  901. if (vm.questions[i].question.thirdKey == 'ckd34') {
  902. if (data.renalFunctionCreatinine) {
  903. var ckd34 = (((140 - vm.age) * data.weight) / (0.818 * data.renalFunctionCreatinine)).toFixed(2)
  904. vm.questions[i].question.content = ckd34
  905. vm.selectItem(vm.questions[i - 1].question, vm.questions[i - 1].option[0])
  906. vm.changeContent(vm.questions[i].question, ckd34)
  907. } else {
  908. vm.selectItem(vm.questions[i - 1].question, vm.questions[i - 1].option[1])
  909. // vm.questions[i].question.content = '1'
  910. vm.changeContent(vm.questions[i].question, '1')
  911. vm.questions[i].question.content = ''
  912. }
  913. }
  914. }
  915. if (vm.screeningType == '6bcd306aaafb4e4381071346d86fadbb1') {
  916. // 如果是ascvd筛查再调用第三方接口
  917. vm.getInitData()
  918. }
  919. }
  920. })
  921. vm.$forceUpdate()
  922. } else {
  923. var data = {
  924. patient: vm.screeningResidents
  925. }
  926. jbscAPI.getHealth(data).then(function (res) {
  927. if (res.status == 200) {
  928. vm.tizhongRecord =
  929. _.find(res.data, function (o) {
  930. return o.type == '3'
  931. }) || {}
  932. for (var i in vm.questions) {
  933. if (vm.questions[i].question.thirdKey == 'height') {
  934. vm.questions[i].question.content = vm.tizhongRecord.value2
  935. vm.changeContent(vm.questions[i].question, vm.tizhongRecord.value2)
  936. }
  937. if (vm.questions[i].question.thirdKey == 'weight') {
  938. vm.questions[i].question.content = vm.tizhongRecord.value1
  939. vm.changeContent(vm.questions[i].question, vm.tizhongRecord.value1)
  940. }
  941. if (vm.questions[i].question.thirdKey == 'systolicPressure') {
  942. vm.questions[i].question.content = res.data.xy.value1
  943. vm.changeContent(vm.questions[i].question, res.data.xy.value1)
  944. }
  945. if (vm.questions[i].question.thirdKey == 'diastolicPressure') {
  946. vm.questions[i].question.content = res.data.xy.value2
  947. vm.changeContent(vm.questions[i].question, res.data.xy.value2)
  948. }
  949. if (vm.questions[i].question.thirdKey == 'bmi') {
  950. if (vm.tizhongRecord.value2 && vm.tizhongRecord.value1) {
  951. var w = vm.tizhongRecord.value1
  952. var h = vm.tizhongRecord.value2 / 100
  953. var s = (w / (h * h)).toFixed(2)
  954. vm.questions[i].question.content = s
  955. vm.shaowas = s
  956. vm.changeContent(vm.questions[i].question, s)
  957. }
  958. }
  959. }
  960. } else {
  961. top.layer.msg(res.msg, { icon: 5 })
  962. }
  963. vm.$forceUpdate()
  964. })
  965. }
  966. }
  967. })
  968. },
  969. save: function () {
  970. var vm = this
  971. if (vm.progress != 100) {
  972. top.layer.msg('问卷还未全部填写', { icon: 5 })
  973. return
  974. }
  975. var loadding = top.layer.load(0, { shade: false }) //0代表加载的风格,支持0-2
  976. vm.selectArr.forEach(function (v) {
  977. if (v.thirdKey == 'assessTime') {
  978. v.content = new Date(v.content).format('yyyy-MM-dd HH:mm')
  979. }
  980. if (v.thirdKey == 'isCkd34') {
  981. if (v.options[0].thirdValue == '0') {
  982. vm.selectArr.forEach(function (it) {
  983. if (it.thirdKey == 'ckd34') {
  984. it.content = ''
  985. }
  986. })
  987. }
  988. }
  989. })
  990. var data
  991. if (vm.screeningType == 'aa9bd609fd8b492296f6a34849b76520') {
  992. var formData = JSON.parse(JSON.stringify(this.answer))
  993. formData.ksDrugName1 = (formData.ksDrugName1 ?? []).join(',')
  994. data = {
  995. patientCode: vm.screeningResidents,
  996. labelType: vm.labelType,
  997. isAgain: vm.isAgain,
  998. source: 1,
  999. jsonData: JSON.stringify({
  1000. surveyCode: vm.screeningType,
  1001. surveyData: formData
  1002. })
  1003. }
  1004. } else {
  1005. data = {
  1006. patientCode: vm.screeningResidents,
  1007. labelType: vm.labelType,
  1008. isAgain: vm.isAgain,
  1009. source: 1,
  1010. surveyStatus: vm.surveyStatus,
  1011. jsonData: JSON.stringify({
  1012. surveyCode: vm.screeningType,
  1013. questions: vm.selectArr
  1014. })
  1015. }
  1016. }
  1017. jbscAPI.saveAnswer(data).then(function (res) {
  1018. top.layer.close(loadding)
  1019. if (res.status == 200) {
  1020. if (vm.screeningType == 'aa9bd609fd8b492296f6a34849b76520' || vm.questions[1].isThird == 3) {
  1021. top.layer.open({
  1022. type: 2,
  1023. // offset: ['100px'], //右下角弹出
  1024. area: ['568px', '100%'],
  1025. shade: 0.5,
  1026. title: '查看筛选结果',
  1027. fixed: true, //不固定
  1028. maxmin: true,
  1029. closeBtn: 1,
  1030. shift: 5,
  1031. shadeClose: false, //点击遮罩关闭层
  1032. content: '../../jbsc/html/view_screening_results.html?resultCode=' + res.data,
  1033. end: function () {
  1034. var index = top.layer.getFrameIndex(window.name) //先得到当前iframe层的索引
  1035. parent.eventBuss.$emit('guan_results', index)
  1036. }
  1037. })
  1038. } else {
  1039. top.layer.open({
  1040. type: 2,
  1041. area: ['820px', '648px'],
  1042. shade: 0.5,
  1043. title: '筛选统计',
  1044. fixed: true, //不固定
  1045. maxmin: true,
  1046. closeBtn: 1,
  1047. shift: 5,
  1048. shadeClose: false, //点击遮罩关闭层
  1049. content: '../../jbsc/html/filter_result.html?code=' + res.data + '&filter_type=' + vm.screeningType
  1050. })
  1051. }
  1052. } else {
  1053. top.layer.msg(res.msg, { icon: 5 })
  1054. }
  1055. })
  1056. },
  1057. // 返回选择居民或者问卷类型
  1058. goBack: function (number) {
  1059. if (this.noswitch) {
  1060. return
  1061. }
  1062. var vm = this
  1063. if (vm.isAgain) {
  1064. var content
  1065. if (number == 1) {
  1066. content = '再次筛查无法选择居民'
  1067. } else {
  1068. content = '再次筛查无法选择问卷类型'
  1069. }
  1070. top.layer.msg(content, { icon: 5 })
  1071. return
  1072. }
  1073. var content = '../../jbsc/html/filter_type.html?isReLoad=1'
  1074. if (number === 1) {
  1075. //选择居民
  1076. content += '&goDenizen=1&fliter_code=' + vm.screeningType + '&fliter_title=' + vm.screeningTitle
  1077. }
  1078. layer.open({
  1079. type: 2,
  1080. offset: 'rb', //右下角弹出
  1081. id: 'filter_type',
  1082. background: 'transparent',
  1083. area: ['280px', '100%'],
  1084. shade: 0.5,
  1085. title: false,
  1086. fixed: true, //不固定
  1087. maxmin: false,
  1088. closeBtn: 0,
  1089. shift: 5,
  1090. shadeClose: true, //点击遮罩关闭层
  1091. content: content
  1092. })
  1093. }
  1094. },
  1095. watch: {
  1096. screeningType: function () {
  1097. $('.daan-list input').attr('checked', false)
  1098. },
  1099. answer: {
  1100. handler(nv) {
  1101. var vm = this
  1102. if (nv.isFuyongks) {
  1103. var obj = this.questionList.find(function (el) {
  1104. return el.field == 'ksDrugName1'
  1105. })
  1106. obj.required = nv.isFuyongks == 1 ? true : false
  1107. }
  1108. if (nv.isEndoscopy) {
  1109. var obj1 = this.questionList.find(function (el) {
  1110. return el.field == 'endoscopyTime'
  1111. })
  1112. var obj2 = this.questionList.find(function (el) {
  1113. return el.field == 'endoscopyResult'
  1114. })
  1115. var obj3 = this.questionList.find(function (el) {
  1116. return el.field == 'endoscopyHospitalName'
  1117. })
  1118. obj1.required = nv.isEndoscopy == 1 ? true : false
  1119. obj2.required = nv.isEndoscopy == 1 ? true : false
  1120. obj3.required = nv.isEndoscopy == 1 ? true : false
  1121. }
  1122. var all = 0
  1123. var have = 0
  1124. this.questionList.forEach(function (item) {
  1125. if (item.required) {
  1126. all++
  1127. if (item.field == 'ksDrugName1' && vm.answer.ksDrugName1 && vm.answer.ksDrugName1.length > 0) {
  1128. have++
  1129. } else if (item.field != 'ksDrugName1' && vm.answer[item.field]) {
  1130. have++
  1131. }
  1132. }
  1133. })
  1134. var progress = Math.floor((have / all) * 100)
  1135. if (progress != vm.progress1) {
  1136. vm.$refs.progress.dataFunction(progress)
  1137. vm.progress1 = progress
  1138. }
  1139. if (progress == 100) {
  1140. vm.progress = progress
  1141. }
  1142. this.$forceUpdate()
  1143. },
  1144. deep: true
  1145. }
  1146. }
  1147. })
  1148. </script>
  1149. </body>
  1150. </html>