血透系统pad前端

DoubleDialog.vue 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. <template>
  2. <div>
  3. <div class="Dialog">
  4. <div class="DialogTit">
  5. <span @click="close()" class="iconfont">&#xe6e9;</span>
  6. <h1 class="name">双人核对</h1>
  7. <span :style="doubleReview.creater == 0 || doubleReview.modifier == 0 ? '':'visibility:hidden'" @click="commitInfo" class="success" >保存</span>
  8. </div>
  9. <div style="height: 8rem" class="DialogContent choose">
  10. <el-form
  11. :inline="true"
  12. class="demo-form-inline doubleForm"
  13. :model="doubleReview"
  14. label-width="3.5rem"
  15. >
  16. <el-form-item label="透析物品核查 :">
  17. <el-radio v-model="doubleReview.dialysis_item_check" label="1"
  18. >正确</el-radio
  19. >
  20. <el-radio v-model="doubleReview.dialysis_item_check" label="2"
  21. >错误</el-radio
  22. >
  23. </el-form-item>
  24. <el-form-item label="差错描述 :" label-width="3.5rem">
  25. <el-input
  26. class="doubleInput"
  27. v-model="doubleReview.dialysis_item_desc"
  28. ></el-input>
  29. </el-form-item>
  30. </el-form>
  31. <el-form
  32. :inline="true"
  33. class="demo-form-inline doubleForm"
  34. :model="doubleReview"
  35. label-width="3.5rem"
  36. >
  37. <el-form-item label="透析参数核查 :">
  38. <el-radio v-model="doubleReview.dialysis_parameter_check" label="1"
  39. >正确</el-radio
  40. >
  41. <el-radio v-model="doubleReview.dialysis_parameter_check" label="2"
  42. >错误</el-radio
  43. >
  44. </el-form-item>
  45. <el-form-item label="差错描述 :" label-width="3.5rem">
  46. <el-input
  47. class="doubleInput"
  48. v-model="doubleReview.dialysis_parameter_desc"
  49. ></el-input>
  50. </el-form-item>
  51. </el-form>
  52. <el-form
  53. :inline="true"
  54. class="demo-form-inline doubleForm"
  55. :model="doubleReview"
  56. label-width="3.5rem"
  57. >
  58. <el-form-item label="血管通路核查 :">
  59. <!--<el-radio-group v-model="form.appetite">-->
  60. <!--<el-radio label="正确"></el-radio>-->
  61. <!--<el-radio label="整改"></el-radio>-->
  62. <!--</el-radio-group>-->
  63. <el-radio
  64. v-model="doubleReview.vascular_access_verification"
  65. label="1"
  66. >正确</el-radio
  67. >
  68. <el-radio
  69. v-model="doubleReview.vascular_access_verification"
  70. label="2"
  71. >错误</el-radio
  72. >
  73. </el-form-item>
  74. <el-form-item label="差错描述 :" label-width="3.5rem">
  75. <el-input
  76. class="doubleInput"
  77. v-model="doubleReview.vascular_access_desc"
  78. ></el-input>
  79. </el-form-item>
  80. </el-form>
  81. <el-form
  82. :inline="true"
  83. class="demo-form-inline doubleForm"
  84. :model="doubleReview"
  85. label-width="3.5rem"
  86. >
  87. <el-form-item label="管道连接核查 :">
  88. <!--<el-radio-group v-model="form.condition">-->
  89. <el-radio v-model="doubleReview.pipeline_connection_check" label="1"
  90. >正确</el-radio
  91. >
  92. <el-radio v-model="doubleReview.pipeline_connection_check" label="2"
  93. >错误</el-radio
  94. >
  95. <!--</el-radio-group>-->
  96. </el-form-item>
  97. <el-form-item label="差错描述 :" label-width="3.5rem">
  98. <el-input
  99. class="doubleInput"
  100. v-model="doubleReview.pipeline_connection_desc"
  101. ></el-input>
  102. </el-form-item>
  103. </el-form>
  104. <div class="item">
  105. <h2 class="name">核对时间</h2>
  106. <div class="content">
  107. <span
  108. class="text"
  109. style="width: 3.5rem"
  110. @click="selectCheckTimeAction"
  111. >{{ check_time_str }}</span
  112. >
  113. <span class="iconfont">&#xe6f9;</span>
  114. </div>
  115. </div>
  116. <el-form
  117. :inline="true"
  118. class="demo-form-inline doubleForm"
  119. :model="doubleReview"
  120. label-width="3.5rem"
  121. >
  122. <p style="margin: 10px 0 10px 13px;" v-if="doubleReview.creater != 0">
  123. {{ getFirstCheckDesc() }}
  124. </p>
  125. <p
  126. style="margin: 10px 0 10px 13px;"
  127. v-if="doubleReview.modifier != 0"
  128. >
  129. {{ getScondCheckDesc() }}
  130. </p>
  131. </el-form>
  132. <!-- <div class="button">
  133. <button @click="commitInfo" class="submitButton">提交</button>
  134. </div>-->
  135. <!--<div class="footer">-->
  136. <!--处方医生:黄梦燕 医生-->
  137. <!--</div>-->
  138. </div>
  139. <!-- <div class="footer">
  140. 处方医生:黄梦燕 护士
  141. </div>-->
  142. </div>
  143. <mt-datetime-picker
  144. ref="start_time_picker"
  145. type="datetime"
  146. @confirm="didSelectCheckTime"
  147. v-model="check_time"
  148. ></mt-datetime-picker>
  149. </div>
  150. </template>
  151. <script>
  152. import { commitDoubleCheck } from "@/api/dialysis";
  153. import { Toast } from "vant";
  154. import { uParseTime } from "@/utils/tools";
  155. import { parseTime } from "@/utils";
  156. export default {
  157. name: "DoubleDialog",
  158. data() {
  159. return {
  160. admin_users: [],
  161. first_check_isShow: false,
  162. second_check_isShow: false,
  163. first_check_desc: "",
  164. second_check_desc: "",
  165. doubleReview: {
  166. dialysis_item_check: "1",
  167. dialysis_parameter_check: "1",
  168. vascular_access_verification: "1",
  169. pipeline_connection_check: "1",
  170. dialysis_item_desc: "",
  171. dialysis_parameter_desc: "",
  172. vascular_access_desc: "",
  173. pipeline_connection_desc: "",
  174. collator: "",
  175. creater: 0,
  176. modifier: 0,
  177. created_time: 0,
  178. updated_time: 0,
  179. check_time: 0,
  180. first_check_time: 0
  181. },
  182. check_time: new Date(),
  183. check_time_str: "",
  184. patient: {
  185. id: 0
  186. },
  187. doctor: "",
  188. record_date: ""
  189. };
  190. },
  191. props: {
  192. record: {
  193. type: Object,
  194. default: () => {
  195. return { id: 0 };
  196. }
  197. },
  198. patient_prop: {
  199. type: Object
  200. },
  201. admin_users_prop: {
  202. type: Array
  203. }
  204. },
  205. created() {
  206. console.log(new Date());
  207. this.admin_users = this.admin_users_prop;
  208. if (this.record.id == "") {
  209. this.doubleReview.dialysis_item_check = "1";
  210. this.doubleReview.dialysis_parameter_check = "1";
  211. this.doubleReview.vascular_access_verification = "1";
  212. this.doubleReview.pipeline_connection_check = "1";
  213. this.doubleReview.dialysis_item_desc = "";
  214. this.doubleReview.dialysis_parameter_desc = "";
  215. this.doubleReview.vascular_access_desc = "";
  216. this.doubleReview.pipeline_connection_desc = "";
  217. } else {
  218. this.doubleReview.dialysis_item_check =
  219. this.record.dialysis_item_check + "";
  220. this.doubleReview.dialysis_parameter_check =
  221. this.record.dialysis_parameter_check + "";
  222. this.doubleReview.vascular_access_verification =
  223. this.record.vascular_access_verification + "";
  224. this.doubleReview.pipeline_connection_check =
  225. this.record.pipeline_connection_check + "";
  226. this.doubleReview.dialysis_item_desc = this.record.dialysis_item_desc;
  227. this.doubleReview.dialysis_parameter_desc = this.record.dialysis_parameter_desc;
  228. this.doubleReview.vascular_access_desc = this.record.vascular_access_desc;
  229. this.doubleReview.pipeline_connection_desc = this.record.pipeline_connection_desc;
  230. this.doubleReview.created_time = this.record.created_time;
  231. this.doubleReview.creater = this.record.creater;
  232. this.doubleReview.updated_time = this.record.updated_time;
  233. this.doubleReview.modifier = this.record.modifier;
  234. this.doubleReview.check_time = this.record.check_time;
  235. this.doubleReview.first_check_time = this.record.first_check_time;
  236. }
  237. var date = this.$route.query && this.$route.query.date;
  238. date *= 1000;
  239. var newDate = new Date(date);
  240. var y = newDate.getFullYear();
  241. var m = newDate.getMonth() + 1;
  242. var d = newDate.getDate();
  243. if (isNaN(y) || isNaN(m) || isNaN(d)) {
  244. newDate = new Date();
  245. y = newDate.getFullYear();
  246. m = newDate.getMonth() + 1;
  247. d = newDate.getDate();
  248. }
  249. this.record_date =
  250. y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d);
  251. // this.patient.id = this.patient_prop.id
  252. },
  253. methods: {
  254. didSelectCheckTime: function(time) {
  255. this.check_time_str = parseTime(time, "{y}-{m}-{d} {h}:{i}" + ":00");
  256. },
  257. selectCheckTimeAction: function() {
  258. this.$refs.start_time_picker.open();
  259. },
  260. checkInf: function() {},
  261. // initData(doubleReview, patient, doctor) {
  262. // //上层传值
  263. // this.patient = patient;
  264. // this.doubleReview = doubleReview;
  265. // this.doctor = doctor;
  266. // },
  267. commitInfo: function() {
  268. Toast.loading({ forbidClick: true, duration: 0 });
  269. let ParamsQuery = this.doubleReview;
  270. // ParamsQuery["patient"] = this.patient.id
  271. ParamsQuery["patient"] = this.$route.query.patient_id;
  272. ParamsQuery["record_date"] = this.record_date;
  273. ParamsQuery["check_time"] = this.check_time_str;
  274. commitDoubleCheck(ParamsQuery).then(response => {
  275. if (response.data.state == 0) {
  276. // this.$toast({message: response.data.msg});
  277. Toast.fail(response.data.msg);
  278. return false;
  279. } else {
  280. Toast.success("提交成功");
  281. this.doubleReview.creater = response.data.data.doubleCheck.creater;
  282. this.doubleReview.check_time =
  283. response.data.data.doubleCheck.check_time;
  284. this.doubleReview.first_check_time =
  285. response.data.data.doubleCheck.first_check_time;
  286. this.doubleReview.modifier = response.data.data.doubleCheck.modifier;
  287. for (const key in response.data.data.doubleCheck) {
  288. this.record[key] = response.data.data.doubleCheck[key];
  289. }
  290. this.$emit("did_update", response.data.data.doubleCheck);
  291. }
  292. }).catch(error => {
  293. Toast.fail("请求失败")
  294. });
  295. },
  296. close: function() {
  297. this.$emit("close");
  298. },
  299. getFirstCheckDesc: function() {
  300. if (
  301. this.doubleReview.first_check_time > 0 &&
  302. this.doubleReview.check_time > 0
  303. ) {
  304. if (this.doubleReview.first_check_time < this.doubleReview.check_time) {
  305. let time = uParseTime(
  306. this.doubleReview.first_check_time,
  307. "{y}-{m}-{d} {h}:{i}"
  308. );
  309. if (this.doubleReview.creater <= 0) {
  310. return "";
  311. }
  312. var desc = "";
  313. if (
  314. this.admin_users == null ||
  315. typeof this.admin_users.length == "undefined"
  316. ) {
  317. return "";
  318. }
  319. var leng = this.admin_users.length;
  320. if (leng == 0) {
  321. return "";
  322. }
  323. for (let index = 0; index < leng; index++) {
  324. if (this.admin_users[index].id == this.doubleReview.creater) {
  325. let name = this.admin_users[index].name;
  326. desc = "首次核对人员:" + name + " 首次核对时间:" + time;
  327. break;
  328. }
  329. }
  330. return desc;
  331. } else {
  332. let time = uParseTime(
  333. this.doubleReview.check_time,
  334. "{y}-{m}-{d} {h}:{i}"
  335. );
  336. if (this.doubleReview.modifier <= 0) {
  337. return "";
  338. }
  339. var desc = "";
  340. if (
  341. this.admin_users == null ||
  342. typeof this.admin_users.length == "undefined"
  343. ) {
  344. return "";
  345. }
  346. var leng = this.admin_users.length;
  347. if (leng == 0) {
  348. return "";
  349. }
  350. for (let index = 0; index < leng; index++) {
  351. if (this.admin_users[index].id == this.doubleReview.modifier) {
  352. let name = this.admin_users[index].name;
  353. desc = "首次核对人员:" + name + " 首次核对时间:" + time;
  354. break;
  355. }
  356. }
  357. return desc;
  358. }
  359. } else {
  360. let time = uParseTime(
  361. this.doubleReview.first_check_time,
  362. "{y}-{m}-{d} {h}:{i}"
  363. );
  364. if (this.doubleReview.creater <= 0) {
  365. return "";
  366. }
  367. var desc = "";
  368. if (
  369. this.admin_users == null ||
  370. typeof this.admin_users.length == "undefined"
  371. ) {
  372. return "";
  373. }
  374. var leng = this.admin_users.length;
  375. if (leng == 0) {
  376. return "";
  377. }
  378. for (let index = 0; index < leng; index++) {
  379. if (this.admin_users[index].id == this.doubleReview.creater) {
  380. let name = this.admin_users[index].name;
  381. desc = "首次核对人员:" + name + " 首次核对时间:" + time;
  382. break;
  383. }
  384. }
  385. return desc;
  386. }
  387. },
  388. getScondCheckDesc: function() {
  389. if (
  390. this.doubleReview.first_check_time > 0 &&
  391. this.doubleReview.check_time > 0
  392. ) {
  393. if (this.doubleReview.first_check_time < this.doubleReview.check_time) {
  394. let time = uParseTime(
  395. this.doubleReview.check_time,
  396. "{y}-{m}-{d} {h}:{i}"
  397. );
  398. if (this.doubleReview.modifier <= 0) {
  399. return "";
  400. }
  401. var desc = "";
  402. if (
  403. this.admin_users == null ||
  404. typeof this.admin_users.length == "undefined"
  405. ) {
  406. return desc;
  407. }
  408. var leng = this.admin_users.length;
  409. if (leng == 0) {
  410. return desc;
  411. }
  412. for (let index = 0; index < leng; index++) {
  413. if (this.admin_users[index].id == this.doubleReview.modifier) {
  414. let name = this.admin_users[index].name;
  415. desc = "第二次核对人员:" + name + " 第二次核对时间:" + time;
  416. break;
  417. }
  418. }
  419. return desc;
  420. } else {
  421. let time = uParseTime(
  422. this.doubleReview.first_check_time,
  423. "{y}-{m}-{d} {h}:{i}"
  424. );
  425. if (this.doubleReview.creater <= 0) {
  426. return "";
  427. }
  428. var desc = "";
  429. if (
  430. this.admin_users == null ||
  431. typeof this.admin_users.length == "undefined"
  432. ) {
  433. return desc;
  434. }
  435. var leng = this.admin_users.length;
  436. if (leng == 0) {
  437. return desc;
  438. }
  439. for (let index = 0; index < leng; index++) {
  440. if (this.admin_users[index].id == this.doubleReview.creater) {
  441. let name = this.admin_users[index].name;
  442. desc = "第二次核对人员:" + name + " 第二次核对时间:" + time;
  443. break;
  444. }
  445. }
  446. return desc;
  447. }
  448. } else {
  449. let time = uParseTime(
  450. this.doubleReview.check_time,
  451. "{y}-{m}-{d} {h}:{i}"
  452. );
  453. if (this.doubleReview.modifier <= 0) {
  454. return "";
  455. }
  456. var desc = "";
  457. if (
  458. this.admin_users == null ||
  459. typeof this.admin_users.length == "undefined"
  460. ) {
  461. return desc;
  462. }
  463. var leng = this.admin_users.length;
  464. if (leng == 0) {
  465. return desc;
  466. }
  467. for (let index = 0; index < leng; index++) {
  468. if (this.admin_users[index].id == this.doubleReview.modifier) {
  469. let name = this.admin_users[index].name;
  470. desc = "第二次核对人员:" + name + " 第二次核对时间:" + time;
  471. break;
  472. }
  473. }
  474. return desc;
  475. }
  476. },
  477. getDate: function(val) {
  478. return parseTime(val, "{y}-{m}-{d} {h}:{i}");
  479. }
  480. },
  481. mounted() {
  482. if (this.record.id == 0) {
  483. this.check_time_str = parseTime(
  484. this.check_time,
  485. "{y}-{m}-{d} {h}:{i}" + ":00"
  486. );
  487. } else {
  488. if (this.record.modifier == 0) {
  489. this.check_time_str = parseTime(
  490. this.check_time,
  491. "{y}-{m}-{d} {h}:{i}" + ":00"
  492. );
  493. } else {
  494. this.check_time_str = parseTime(
  495. this.record.check_time,
  496. "{y}-{m}-{d} {h}:{i}" + ":00"
  497. );
  498. }
  499. }
  500. }
  501. };
  502. </script>
  503. <style style="stylesheet/scss" lang="scss" scoped>
  504. .choose {
  505. .demo-form-inline {
  506. border-bottom: 1px #e5e5e5 solid;
  507. .el-form-item {
  508. margin-bottom: 0;
  509. padding: 0.2rem 0.2rem;
  510. margin-right: 0;
  511. }
  512. p {
  513. color: $title-color;
  514. }
  515. }
  516. .button {
  517. text-align: center;
  518. margin-top: 1rem;
  519. .submitButton {
  520. width: 3rem;
  521. height: 0.8rem;
  522. line-height: 0.8rem;
  523. background: $main-color;
  524. color: #fff;
  525. font-size: 0.3rem;
  526. text-align: center;
  527. border-radius: 6px;
  528. }
  529. }
  530. }
  531. </style>
  532. <style lang="scss">
  533. .doubleForm {
  534. .el-radio__inner {
  535. @media only screen and (min-width: 768px) {
  536. width: 26px;
  537. height: 26px;
  538. margin-bottom: 4px;
  539. }
  540. }
  541. }
  542. .el-radio__input {
  543. @media only screen and (min-width: 768px) {
  544. margin-top: -6px;
  545. }
  546. }
  547. .demo-form-inline {
  548. p {
  549. font-size: 0.45rem;
  550. }
  551. }
  552. .doubleInput {
  553. .el-input__inner {
  554. font-size: 0.45rem;
  555. }
  556. }
  557. </style>