acceptsTreatmentDialog.vue 26KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841
  1. <template>
  2. <div>
  3. <div>
  4. <el-dialog
  5. title="接诊评估"
  6. class="newDialog"
  7. :modal = 'false'
  8. :modal-append-to-body="false"
  9. :close-on-click-modal="false"
  10. :visible.sync="isVisibility"
  11. width="854px"
  12. >
  13. <div class="warnTxt" v-if="showTxt != ''">{{ showTxt }}</div>
  14. <el-form
  15. :model="receiveTreatmentAsses"
  16. ref="receiveTreatmentAsses"
  17. label-width="86px"
  18. >
  19. <el-form-item
  20. label="入室方式 : "
  21. :prop="isName('入室方式')"
  22. :rules="isCheckmust('入室方式')"
  23. v-if="isShow('入室方式')"
  24. >
  25. <el-radio-group v-model="receiveTreatmentAsses.way">
  26. <el-radio
  27. v-for="(item, index) in way_arr"
  28. :key="index"
  29. :label="item.id"
  30. >{{ item.name }}
  31. </el-radio>
  32. </el-radio-group>
  33. </el-form-item>
  34. <el-form-item
  35. label="病人意识 : "
  36. v-if="isShow('病人意识')"
  37. :prop="isName('病人意识')"
  38. :rules="isCheckmust('病人意识')"
  39. >
  40. <el-radio-group v-model="receiveTreatmentAsses.consciousness">
  41. <el-radio
  42. v-for="(item, index) in consciousness_arr"
  43. :key="index"
  44. :label="item.id"
  45. >{{ item.name }}
  46. </el-radio>
  47. </el-radio-group>
  48. <!--<el-radio v-model="receiveTreatmentAsses.consciousness" label="1">清醒</el-radio>-->
  49. <!--<el-radio v-model="receiveTreatmentAsses.consciousness" label="2">嗜睡</el-radio>-->
  50. <!--<el-radio v-model="receiveTreatmentAsses.consciousness" label="3">昏迷</el-radio>-->
  51. <!--<el-radio v-model="receiveTreatmentAsses.consciousness" label="4">模糊</el-radio>-->
  52. </el-form-item>
  53. <el-form-item
  54. label="病人食欲 : "
  55. :prop="isName('病人食欲')"
  56. :rules="isCheckmust('病人食欲')"
  57. v-if="isShow('病人食欲')"
  58. >
  59. <el-radio-group v-model="receiveTreatmentAsses.appetite">
  60. <el-radio
  61. v-for="(item, index) in appetite_arr"
  62. :key="index"
  63. :label="item.id"
  64. >{{ item.name }}
  65. </el-radio>
  66. </el-radio-group>
  67. <!--<el-radio v-model="receiveTreatmentAsses.appetite" label="1">正常</el-radio>-->
  68. <!--<el-radio v-model="receiveTreatmentAsses.appetite" label="2">减退</el-radio>-->
  69. <!--<el-radio v-model="receiveTreatmentAsses.appetite" label="3">恶心</el-radio>-->
  70. <!--<el-radio v-model="receiveTreatmentAsses.appetite" label="4">呕吐</el-radio>-->
  71. <!--<el-radio v-model="receiveTreatmentAsses.appetite" label="5">腹泻</el-radio>-->
  72. </el-form-item>
  73. <el-form-item
  74. label="病人情况 : "
  75. prop="condition"
  76. :rules="isCheckmust('病人情况')"
  77. v-if="isShow('病人情况')"
  78. >
  79. <el-radio-group v-model="receiveTreatmentAsses.condition" @change="changeRaido">
  80. <el-radio label="1"
  81. >住院</el-radio
  82. >
  83. <el-radio label="2"
  84. >门诊</el-radio
  85. >
  86. <el-radio label="3"
  87. >手术期</el-radio
  88. >
  89. <el-radio label="4"
  90. >急诊</el-radio
  91. >
  92. </el-radio-group>
  93. </el-form-item>
  94. <el-form-item
  95. label="住院号 : "
  96. :prop="isName('住院号')"
  97. :rules="isCheckmust('住院号')"
  98. v-if="this.receiveTreatmentAsses.condition == '1'"
  99. >
  100. <el-input v-model="receiveTreatmentAsses.admission_number"></el-input>
  101. </el-form-item>
  102. <el-form-item
  103. label="住院科室 : "
  104. :prop="isName('住院科室')"
  105. :rules="isCheckmust('住院科室')"
  106. v-if="isShow('住院科室') && this.receiveTreatmentAsses.condition == '1'"
  107. >
  108. <el-input v-model="receiveTreatmentAsses.his_department"></el-input>
  109. </el-form-item>
  110. <el-form-item
  111. label="住院床位 : "
  112. :prop="isName('住院床位')"
  113. :rules="isCheckmust('住院床位')"
  114. v-if="isShow('住院床位') && this.receiveTreatmentAsses.condition == '1'"
  115. >
  116. <el-input v-model="receiveTreatmentAsses.his_bed"></el-input>
  117. </el-form-item>
  118. <el-form-item
  119. label="诊断:"
  120. :prop="isName('诊断')"
  121. :rules="isCheckmust('诊断')"
  122. v-if="isShow('诊断') && this.receiveTreatmentAsses.condition == '1'"
  123. >
  124. <el-input v-model="receiveTreatmentAsses.diacrisis"></el-input>
  125. </el-form-item>
  126. <el-form-item
  127. label="体位 : "
  128. :prop="isName('体位')"
  129. :rules="isCheckmust('体位')"
  130. v-if="isShow('体位')"
  131. >
  132. <el-radio-group v-model="receiveTreatmentAsses.posture">
  133. <el-radio
  134. v-for="(item, index) in posture_arr"
  135. :key="index"
  136. :label="item.id"
  137. >{{ item.name }}
  138. </el-radio>
  139. </el-radio-group>
  140. </el-form-item>
  141. <el-form-item
  142. label="病情: "
  143. :prop="isName('病情')"
  144. :rules="isCheckmust('病情')"
  145. v-if="isShow('病情')"
  146. >
  147. <el-radio-group v-model="receiveTreatmentAsses.sick_condition">
  148. <el-radio
  149. v-for="(item, index) in sick_condition_arr"
  150. :key="index"
  151. :label="item.id"
  152. >{{ item.name }}
  153. </el-radio>
  154. </el-radio-group>
  155. <!--<el-radio v-model="receiveTreatmentAsses.sick_condition" label="1">一般</el-radio>-->
  156. <!--<el-radio v-model="receiveTreatmentAsses.sick_condition" label="2">严重</el-radio>-->
  157. <!--<el-radio v-model="receiveTreatmentAsses.sick_condition" label="3">危</el-radio>-->
  158. </el-form-item>
  159. <el-form-item
  160. label-width="100px"
  161. label="其他病情 : "
  162. :prop="isName('其他病情')"
  163. :rules="isCheckmust('其他病情')"
  164. v-if="isShow('其他病情')"
  165. >
  166. <el-input
  167. v-model="receiveTreatmentAsses.sick_condition_other"
  168. ></el-input>
  169. </el-form-item>
  170. <el-form-item
  171. label-width="150px"
  172. label="跌倒风险评估评分 : "
  173. :prop="isName('跌倒风险评估评分')"
  174. :rules="isCheckmust('跌倒风险评估评分')"
  175. v-if="isShow('跌倒风险评估评分')"
  176. >
  177. <el-input
  178. v-model="receiveTreatmentAsses.score"
  179. style="width: 100px"
  180. ></el-input>
  181. </el-form-item>
  182. <el-form-item
  183. label="风险程度: "
  184. :prop="isName('风险程度')"
  185. :rules="isCheckmust('风险程度')"
  186. v-if="isShow('风险程度')"
  187. >
  188. <el-radio-group v-model="receiveTreatmentAsses.danger_level">
  189. <el-radio label="1"
  190. >无</el-radio
  191. >
  192. <el-radio label="2"
  193. >低风险</el-radio
  194. >
  195. <el-radio label="3"
  196. >中度风险</el-radio
  197. >
  198. <el-radio label="4"
  199. >高风险</el-radio
  200. >
  201. </el-radio-group>
  202. </el-form-item>
  203. <div style="position: relative;">
  204. <span v-if="isrequired" style="color: red;position: absolute;top: 10px;">*</span>
  205. <el-form-item
  206. label-width="138px"
  207. label="跌倒风险预防措施: "
  208. prop="precautionTwo"
  209. :rules="isCheckmust('跌倒风险预防措施')"
  210. v-if="isShow('跌倒风险预防措施')"
  211. style="display: inline-block;"
  212. >
  213. <!--v-if="isShow('跌倒风险预防措施')" isFalldown prop="precautionTwo" @change="precautionchange" isCheckmust('跌倒风险预防措施')
  214. :prop="isName('跌倒风险预防措施')" :rules="isCheckmust('跌倒风险预防措施')"
  215. [{required: true, message: '请选择跌倒风险预防措施', trigger: 'change'}]-->
  216. <el-checkbox-group v-model="precautionTwo" @change="precautionchange" >
  217. <el-checkbox
  218. v-for="item in precaution_arr"
  219. :label="item.name"
  220. :key="item.id"
  221. >{{ item.name }}</el-checkbox
  222. >
  223. </el-checkbox-group>
  224. </el-form-item>
  225. </div>
  226. <el-form-item
  227. label-width="200px"
  228. label="其他跌倒风险预防措施 : "
  229. :prop="isName('其他跌倒风险预防措施')"
  230. :rules="isCheckmust('其他跌倒风险预防措施')"
  231. v-if="isShow('其他跌倒风险预防措施')"
  232. >
  233. <el-input v-model="receiveTreatmentAsses.precaution_other"></el-input>
  234. </el-form-item>
  235. <el-form-item
  236. label="摄入量: "
  237. :prop="isName('摄入量')"
  238. :rules="isCheckmust('摄入量')"
  239. v-if="isShow('摄入量')"
  240. >
  241. <!--<el-radio v-model="receiveTreatmentAsses.intake" label="1">正常</el-radio>-->
  242. <!--<el-radio v-model="receiveTreatmentAsses.intake" label="2">减少</el-radio>-->
  243. <el-radio-group v-model="receiveTreatmentAsses.intake">
  244. <el-radio
  245. v-for="(item, index) in intake_arr"
  246. :key="index"
  247. :label="item.id"
  248. >{{ item.name }}
  249. </el-radio>
  250. </el-radio-group>
  251. </el-form-item>
  252. <el-form-item
  253. label="营养状况: "
  254. :prop="isName('营养状况')"
  255. :rules="isCheckmust('营养状况')"
  256. v-if="isShow('营养状况')"
  257. >
  258. <!--<el-radio v-model="receiveTreatmentAsses.nutrition" label="1">正常</el-radio>-->
  259. <!--<el-radio v-model="receiveTreatmentAsses.nutrition" label="2">营养不良</el-radio>-->
  260. <el-radio-group v-model="receiveTreatmentAsses.nutrition">
  261. <el-radio
  262. v-for="(item, index) in nutrition_arr"
  263. :key="index"
  264. :label="item.id"
  265. >{{ item.name }}
  266. </el-radio>
  267. </el-radio-group>
  268. </el-form-item>
  269. <el-form-item
  270. label="心理评估: "
  271. :prop="isName('心理评估')"
  272. :rules="isCheckmust('心理评估')"
  273. v-if="isShow('心理评估')"
  274. >
  275. <el-radio-group v-model="receiveTreatmentAsses.psychological_assessment">
  276. <el-radio
  277. label="1"
  278. >正常</el-radio
  279. >
  280. <el-radio
  281. label="2"
  282. >异常</el-radio
  283. >
  284. </el-radio-group>
  285. </el-form-item>
  286. <el-form-item
  287. label-width="150px"
  288. label="心理评估异常情况 : "
  289. :prop="isName('心理评估异常情况')"
  290. :rules="isCheckmust('心理评估异常情况')"
  291. v-if="
  292. isShow('心理评估异常情况') &&
  293. receiveTreatmentAsses.psychological_assessment == 2
  294. "
  295. >
  296. <el-input
  297. v-model="receiveTreatmentAsses.psychological_assessment_other"
  298. ></el-input>
  299. </el-form-item>
  300. <el-form-item
  301. label-width="150px"
  302. label="其他心理评估 : "
  303. :prop="isName('其他心理评估')"
  304. :rules="isCheckmust('其他心理评估')"
  305. v-if="isShow('其他心理评估')"
  306. >
  307. <el-input
  308. v-model="receiveTreatmentAsses.psychological_other"
  309. ></el-input>
  310. </el-form-item>
  311. <el-form-item
  312. label="是否跌倒: "
  313. :prop="isName('是否跌倒')"
  314. :rules="isCheckmust('是否跌倒')"
  315. v-if="isShow('是否跌倒')"
  316. >
  317. <el-radio-group v-model="receiveTreatmentAsses.tumble">
  318. <el-radio label="1">是</el-radio>
  319. <el-radio label="2">否</el-radio>
  320. </el-radio-group>
  321. </el-form-item>
  322. </el-form>
  323. <div slot="footer" class="dialog-footer">
  324. <el-button @click="handleCancle">取 消</el-button>
  325. <!-- v-if="hasPermission"-->
  326. <el-button type="primary" @click="handleComfirm('receiveTreatmentAsses')"
  327. >保 存</el-button
  328. >
  329. </div>
  330. </el-dialog>
  331. <el-dialog
  332. title="提示"
  333. :visible.sync="infoDialogVisible"
  334. width="30%">
  335. <span>
  336. <el-form>
  337. <el-row>
  338. <span>申请日期:</span>
  339. <span>
  340. <el-date-picker
  341. type="datetime"
  342. format="yyyy-MM-dd HH:mm"
  343. value-format="yyyy-MM-dd HH:mm"
  344. placeholder="选择时间"
  345. v-model="selected_date"
  346. ></el-date-picker>
  347. </span>
  348. </el-row>
  349. <el-row>
  350. <span>备注:</span>
  351. <span>
  352. <el-input v-model="remark" style="width:200px"></el-input>
  353. </span>
  354. </el-row>
  355. </el-form>
  356. </span>
  357. <span slot="footer" class="dialog-footer">
  358. <el-button @click="infoDialogVisible = false">取 消</el-button>
  359. <el-button type="primary" @click="saveInformation">确 定</el-button>
  360. </span>
  361. </el-dialog>
  362. </div>
  363. </div>
  364. </template>
  365. <script>
  366. import { postAccepts,saveInformation } from "@/api/dialysis";
  367. import { uParseTime } from "@/utils/tools";
  368. import store from "@/store";
  369. import { getDataConfig } from "@/utils/data";
  370. import { parseTime } from "@/utils";
  371. import request from "@/utils/request";
  372. export default {
  373. name: "acceptsTreatmentDialog",
  374. data() {
  375. return {
  376. isrequired:false,
  377. showTxt: "",
  378. hasPermission: true,
  379. isVisibility: false,
  380. record_date: "",
  381. way_arr: [],
  382. consciousness_arr: [],
  383. appetite_arr: [],
  384. posture_arr: [],
  385. sick_condition_arr: [],
  386. precaution_arr: [],
  387. intake_arr: [],
  388. nutrition_arr: [],
  389. receiveTreatmentAsses: {
  390. way: "1",
  391. consciousness: "1",
  392. appetite: "1",
  393. condition: "1",
  394. posture: "1",
  395. sick_condition: "1",
  396. danger_level: "1",
  397. intake: "1",
  398. nutrition: "1",
  399. psychological_assessment: "1",
  400. psychological_assessment_other: "",
  401. sick_condition_other: "",
  402. score: "",
  403. psychological_other: "",
  404. precaution: "",
  405. precaution_other: "",
  406. admission_number: "",
  407. diacrisis: "",
  408. tumble: "",
  409. his_department: "",
  410. his_bed: "",
  411. falldown:[],
  412. },
  413. precautionTwo: [],
  414. arr:[],
  415. infoDialogVisible:false,
  416. selected_date:"",
  417. remark:""
  418. };
  419. },
  420. methods: {
  421. isShow(name) {
  422. var filedList = store.getters.xt_user.fileds;
  423. for (let i = 0; i < filedList.length; i++) {
  424. if (
  425. filedList[i].module == 2 &&
  426. filedList[i].filed_name_cn == name &&
  427. filedList[i].is_show == 1
  428. ) {
  429. return true;
  430. }
  431. }
  432. return false;
  433. },
  434. show(accepts) {
  435. console.log("accepts333333", accepts);
  436. console.log("入库时方式",this.way_arr)
  437. console.log("体委",this.posture_arr)
  438. if (accepts.id > 0) {
  439. accepts.tumble = accepts.tumble.toString();
  440. }else{
  441. console.log("hh2h3h2h3h32h23h23h32h23h")
  442. // this.receiveTreatmentAsses.way = "1"
  443. // this.receiveTreatmentAsses.posture ="1"
  444. // this.receiveTreatmentAsses.condition = "2"
  445. accepts.way =1
  446. accepts.posture=1
  447. accepts.condition =2
  448. accepts.consciousness = 1
  449. accepts.appetite =1
  450. if(this.$store.getters.xt_user.template_info.org_id== 10293 || this.$store.getters.xt_user.template_info.org_id == 0){
  451. accepts.way =1
  452. accepts.posture = 1
  453. accepts.consciousness =1
  454. accepts.appetite =1
  455. accepts.danger_level=1
  456. console.log("this.precaution_arr",this.precaution_arr)
  457. this.receiveTreatmentAsses.way =1
  458. this.receiveTreatmentAsses.consciousness =2
  459. this.receiveTreatmentAsses.appetite =2
  460. this.receiveTreatmentAsses.posture= 1
  461. this.receiveTreatmentAsses.danger_level=2
  462. this.receiveTreatmentAsses.precaution = 3
  463. var arr = [3,4]
  464. this.precautionTwo.push(...arr)
  465. this.receiveTreatmentAsses.precaution = this.precautionTwo
  466. accepts.precaution= ""
  467. accepts.precaution = "3,4"
  468. }
  469. }
  470. this.accepts = accepts;
  471. console.log("accepts", accepts);
  472. var arr = [];
  473. if (this.accepts.precaution) {
  474. var precaution = this.accepts.precaution.split(",");
  475. for (let i = 0; i < precaution.length; i++) {
  476. for (let j = 0; j < this.precaution_arr.length; j++) {
  477. if (parseInt(precaution[i]) == this.precaution_arr[j].id) {
  478. this.arr.push(this.precaution_arr[j].name);
  479. }
  480. }
  481. }
  482. this.precautionTwo = this.arr;
  483. }
  484. this.getPermission();
  485. for (var index in this.receiveTreatmentAsses) {
  486. if (
  487. index == "condition" ||
  488. index == "danger_level" ||
  489. index == "psychological_assessment"
  490. ) {
  491. this.receiveTreatmentAsses[index] =
  492. this.receiver_treatment_access[index] + "";
  493. } else {
  494. this.receiveTreatmentAsses[index] =
  495. this.receiver_treatment_access[index];
  496. }
  497. }
  498. this.isVisibility = true;
  499. },
  500. hide() {
  501. this.isVisibility = false;
  502. },
  503. handleCancle: function () {
  504. this.isVisibility = false;
  505. },
  506. // 复选框跌倒风险措施
  507. precautionchange(){
  508. if(this.precautionTwo.length>0){
  509. this.$refs.receiveTreatmentAsses.clearValidate('precautionTwo');
  510. }
  511. },
  512. handleComfirm: function (formName) {
  513. // var arr = [];
  514. for (let i = 0; i < this.precaution_arr.length; i++) {
  515. for (let j = 0; j < this.precautionTwo.length; j++) {
  516. if (this.precaution_arr[i].name == this.precautionTwo[j]) {
  517. this.arr.push(this.precaution_arr[i].id);
  518. }
  519. }
  520. }
  521. // this.precautionchange()
  522. var obj = this.arr.join(",");
  523. this.receiveTreatmentAsses.precaution = obj;
  524. let ParamsQuery = this.receiveTreatmentAsses;
  525. console.log("ParamsQuery", ParamsQuery);
  526. ParamsQuery["patient"] = this.patient.id;
  527. ParamsQuery["record_date"] = this.record_date;
  528. //console.log(this.receiver_treatment_access);
  529. ParamsQuery["mode"] = "1";
  530. if (this.receiver_treatment_access.id > 0) {
  531. ParamsQuery["mode"] = "2";
  532. if (
  533. this.$store.getters.xt_user.user.id !=
  534. this.receiver_treatment_access.creater
  535. ) {
  536. ParamsQuery["mode"] = "3";
  537. }
  538. }
  539. console.log("数据", ParamsQuery);
  540. this.$refs[formName].validate((valid) => {
  541. if (valid) {
  542. postAccepts(ParamsQuery).then((response) => {
  543. if (response.data.state == 0) {
  544. this.$message.error(response.data.msg);
  545. if(response.data.code == 600000008){
  546. this.infoDialogVisible = true
  547. }
  548. return false;
  549. } else {
  550. this.$notify({
  551. title: "成功",
  552. message: "提交成功",
  553. type: "success",
  554. duration: 2000,
  555. });
  556. let receive_treatment_asses_resp =
  557. response.data.data.receiveTreatmentAsses;
  558. //pror
  559. var receiver_treatment_access = this.receiver_treatment_access;
  560. for (var index in receive_treatment_asses_resp) {
  561. // receiver_treatment_access[index] = receive_treatment_asses_resp[index];
  562. this.$set(
  563. receiver_treatment_access,
  564. index,
  565. receive_treatment_asses_resp[index]
  566. );
  567. }
  568. this.hide();
  569. }
  570. });
  571. } else {
  572. console.log("error submit!!");
  573. return false;
  574. }
  575. });
  576. },
  577. isName(name) {
  578. let filedList = store.getters.xt_user.fileds;
  579. for (let i = 0; i < filedList.length; i++) {
  580. if (filedList[i].module == 2 && filedList[i].filed_name_cn == name) {
  581. return filedList[i].filed_name;
  582. }
  583. }
  584. },
  585. isCheckmust(name) {
  586. let filedList = store.getters.xt_user.fileds;
  587. for (let i = 0; i < filedList.length; i++) {
  588. if (
  589. filedList[i].module == 2 &&
  590. filedList[i].filed_name_cn == name &&
  591. filedList[i].is_write == 1
  592. ) {
  593. // name == '跌倒风险预防措施' && this.precautionTwo.length<=0
  594. if (name == "风险程度"||name == "病人情况"||name == '心理评估') {
  595. return [
  596. { required: true, message: `请输入${name}`,trigger: ['blur','change'] },
  597. // {
  598. // required: true,
  599. // pattern: /^[1-9]\d*$/,
  600. // message: `请输入${name}`,
  601. // trigger: ['blur','change']
  602. // },
  603. ];
  604. }
  605. else if(name == "跌倒风险预防措施"){
  606. if(this.precautionTwo.length<=0){
  607. this.isrequired=false
  608. return [{ required: true, message: `请输入${name}`,trigger: ['blur','change'] }];
  609. }
  610. this.precautionchange()
  611. this.isrequired=true
  612. // return [{ required: true, message: '',trigger: ['blur','change'] }];
  613. }else{
  614. return [{ required: true, message: `请输入${name}`,trigger: ['blur','change'] }];
  615. }
  616. }
  617. }
  618. },
  619. // isFalldown(name){
  620. // let filedList = store.getters.xt_user.fileds;
  621. // for (let i = 0; i < filedList.length; i++) {
  622. // if (
  623. // filedList[i].module == 2 &&
  624. // filedList[i].filed_name_cn == name &&
  625. // filedList[i].is_write == 1
  626. // ) {
  627. // if (name == "跌倒风险预防措施" && this.precautionTwo.length<=0) {
  628. // return [
  629. // { required: true, message: `请选择${name}`,trigger: ['blur','change'] },
  630. // {
  631. // required: true,
  632. // pattern: /^[1-9]\d*$/,
  633. // message: `请选择${name}`,
  634. // trigger: ['blur','change']
  635. // },
  636. // ];
  637. // }
  638. // }
  639. // }
  640. // },
  641. getPermission() {
  642. request
  643. .get("/api/func_per/get", {
  644. params: {
  645. create_url: "/api/dialysis/accepts?mode=1",
  646. modify_url: "/api/dialysis/accepts?mode=2",
  647. modify_other_url: "/api/dialysis/accepts?mode=3",
  648. module: 2,
  649. },
  650. })
  651. .then((res) => {
  652. // console.log(res);
  653. //console.log("接诊", this.accepts);
  654. if (res.data.state == 0) {
  655. this.hasPermission = false;
  656. } else if (res.data.state == 1) {
  657. if (this.accepts.id != "" && this.accepts.creater != 0) {
  658. //有数据
  659. if (this.accepts.creater == this.$store.getters.xt_user.user.id) {
  660. //创建人是自己
  661. if (res.data.data.is_has_modify == false) {
  662. this.hasPermission = false;
  663. this.showTxt = "你没有修改接诊评估权限";
  664. }
  665. } else {
  666. //创建人不是自己
  667. if (res.data.data.is_has_modify_other == false) {
  668. this.hasPermission = false;
  669. this.showTxt = "你没有修改他人接诊评估权限";
  670. }
  671. }
  672. } else if (this.accepts.id == "" || this.accepts.creater == 0) {
  673. if (res.data.data.is_has_create == false) {
  674. this.hasPermission = false;
  675. this.showTxt = "你没有新增接诊评估权限";
  676. }
  677. }
  678. }
  679. });
  680. },
  681. saveInformation(){
  682. var params = {
  683. selected_date:this.selected_date,
  684. patient_id:this.$route.query.patient_id,
  685. record_date:this.$route.query.date,
  686. module:2,
  687. remark:this.remark,
  688. }
  689. saveInformation(params).then(response=>{
  690. if(response.data.state == 1){
  691. var information = response.data.data.information
  692. this.$message.success("提交成功!")
  693. this.infoDialogVisible = false
  694. }
  695. })
  696. },
  697. changeRaido(val){
  698. console.log("val---",val)
  699. console.log("lastt",this.lastTreat)
  700. if(val ==1){
  701. if(this.lastTreat!=null){
  702. this.receiveTreatmentAsses.admission_number = this.lastTreat.admission_number
  703. }
  704. }else{
  705. if(this.lastTreat!=null){
  706. this.receiveTreatmentAsses.admission_number = ""
  707. }
  708. }
  709. }
  710. },
  711. props: {
  712. receiver_treatment_access: {
  713. // 双人核对
  714. type: Object,
  715. default: () => {
  716. return { id: 0 };
  717. },
  718. },
  719. patient: {
  720. // 患者信息
  721. type: Object,
  722. default: () => {
  723. return { id: 0 };
  724. },
  725. },
  726. lastTreat:{
  727. type: Object,
  728. default: () => {
  729. return { id: 0 };
  730. }
  731. }
  732. },
  733. watch: {
  734. isVisibility(val) {},
  735. "receiver_treatment_access.id": function () {
  736. if (this.receiver_treatment_access.id > 0) {
  737. for (var index in this.receiveTreatmentAsses) {
  738. this.receiveTreatmentAsses[index] =
  739. this.receiver_treatment_access[index];
  740. }
  741. }
  742. },
  743. },
  744. created() {
  745. console.log("lastTreat",this.lastTreat)
  746. if(this.lastTreat!=null){
  747. if(this.receiveTreatmentAsses.condition ==1){
  748. this.receiveTreatmentAsses.admission_number = this.lastTreat.admission_number
  749. this.receiveTreatmentAsses.his_bed = this.lastTreat.his_bed
  750. this.receiveTreatmentAsses.his_department = this.lastTreat.his_department
  751. }
  752. }
  753. // console.log("接诊评估", this.receiver_treatment_access);
  754. var date = this.$route.query && this.$route.query.date;
  755. this.record_date = date
  756. ? uParseTime(date, "{y}-{m}-{d}")
  757. : parseTime(new Date(), "{y}-{m}-{d}");
  758. console.log("this.record_date", this.record_date);
  759. this.way_arr = getDataConfig("hemodialysis", "way");
  760. this.consciousness_arr = getDataConfig("hemodialysis", "consciousness");
  761. this.appetite_arr = getDataConfig("hemodialysis", "appetite");
  762. this.posture_arr = getDataConfig("hemodialysis", "posture");
  763. this.sick_condition_arr = getDataConfig("hemodialysis", "sick_condition");
  764. this.precaution_arr = getDataConfig("hemodialysis", "precaution");
  765. // console.log("风险", this.precaution_arr);
  766. this.intake_arr = getDataConfig("hemodialysis", "intake");
  767. this.nutrition_arr = getDataConfig("hemodialysis", "nutrition");
  768. },
  769. };
  770. </script>
  771. <style scoped>
  772. .warnTxt {
  773. text-align: center;
  774. margin: 0 auto;
  775. background: #faa331;
  776. max-width: 240px;
  777. padding: 10px 20px;
  778. border-radius: 4px;
  779. margin-bottom: 10px;
  780. color: #fff;
  781. }
  782. </style>
  783. <style lang="scss">
  784. .newDialog {
  785. .el-dialog__body {
  786. padding: 10px 20px 30px;
  787. }
  788. }
  789. </style>