血透系统pad前端

DoubleDialog.vue 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  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 @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. });
  293. },
  294. close: function() {
  295. this.$emit("close");
  296. },
  297. getFirstCheckDesc: function() {
  298. if (
  299. this.doubleReview.first_check_time > 0 &&
  300. this.doubleReview.check_time > 0
  301. ) {
  302. if (this.doubleReview.first_check_time < this.doubleReview.check_time) {
  303. let time = uParseTime(
  304. this.doubleReview.first_check_time,
  305. "{y}-{m}-{d} {h}:{i}"
  306. );
  307. if (this.doubleReview.creater <= 0) {
  308. return "";
  309. }
  310. var desc = "";
  311. if (
  312. this.admin_users == null ||
  313. typeof this.admin_users.length == "undefined"
  314. ) {
  315. return "";
  316. }
  317. var leng = this.admin_users.length;
  318. if (leng == 0) {
  319. return "";
  320. }
  321. for (let index = 0; index < leng; index++) {
  322. if (this.admin_users[index].id == this.doubleReview.creater) {
  323. let name = this.admin_users[index].name;
  324. desc = "首次核对人员:" + name + " 首次核对时间:" + time;
  325. break;
  326. }
  327. }
  328. return desc;
  329. } else {
  330. let time = uParseTime(
  331. this.doubleReview.check_time,
  332. "{y}-{m}-{d} {h}:{i}"
  333. );
  334. if (this.doubleReview.modifier <= 0) {
  335. return "";
  336. }
  337. var desc = "";
  338. if (
  339. this.admin_users == null ||
  340. typeof this.admin_users.length == "undefined"
  341. ) {
  342. return "";
  343. }
  344. var leng = this.admin_users.length;
  345. if (leng == 0) {
  346. return "";
  347. }
  348. for (let index = 0; index < leng; index++) {
  349. if (this.admin_users[index].id == this.doubleReview.modifier) {
  350. let name = this.admin_users[index].name;
  351. desc = "首次核对人员:" + name + " 首次核对时间:" + time;
  352. break;
  353. }
  354. }
  355. return desc;
  356. }
  357. } else {
  358. let time = uParseTime(
  359. this.doubleReview.first_check_time,
  360. "{y}-{m}-{d} {h}:{i}"
  361. );
  362. if (this.doubleReview.creater <= 0) {
  363. return "";
  364. }
  365. var desc = "";
  366. if (
  367. this.admin_users == null ||
  368. typeof this.admin_users.length == "undefined"
  369. ) {
  370. return "";
  371. }
  372. var leng = this.admin_users.length;
  373. if (leng == 0) {
  374. return "";
  375. }
  376. for (let index = 0; index < leng; index++) {
  377. if (this.admin_users[index].id == this.doubleReview.creater) {
  378. let name = this.admin_users[index].name;
  379. desc = "首次核对人员:" + name + " 首次核对时间:" + time;
  380. break;
  381. }
  382. }
  383. return desc;
  384. }
  385. },
  386. getScondCheckDesc: function() {
  387. if (
  388. this.doubleReview.first_check_time > 0 &&
  389. this.doubleReview.check_time > 0
  390. ) {
  391. if (this.doubleReview.first_check_time < this.doubleReview.check_time) {
  392. let time = uParseTime(
  393. this.doubleReview.check_time,
  394. "{y}-{m}-{d} {h}:{i}"
  395. );
  396. if (this.doubleReview.modifier <= 0) {
  397. return "";
  398. }
  399. var desc = "";
  400. if (
  401. this.admin_users == null ||
  402. typeof this.admin_users.length == "undefined"
  403. ) {
  404. return desc;
  405. }
  406. var leng = this.admin_users.length;
  407. if (leng == 0) {
  408. return desc;
  409. }
  410. for (let index = 0; index < leng; index++) {
  411. if (this.admin_users[index].id == this.doubleReview.modifier) {
  412. let name = this.admin_users[index].name;
  413. desc = "第二次核对人员:" + name + " 第二次核对时间:" + time;
  414. break;
  415. }
  416. }
  417. return desc;
  418. } else {
  419. let time = uParseTime(
  420. this.doubleReview.first_check_time,
  421. "{y}-{m}-{d} {h}:{i}"
  422. );
  423. if (this.doubleReview.creater <= 0) {
  424. return "";
  425. }
  426. var desc = "";
  427. if (
  428. this.admin_users == null ||
  429. typeof this.admin_users.length == "undefined"
  430. ) {
  431. return desc;
  432. }
  433. var leng = this.admin_users.length;
  434. if (leng == 0) {
  435. return desc;
  436. }
  437. for (let index = 0; index < leng; index++) {
  438. if (this.admin_users[index].id == this.doubleReview.creater) {
  439. let name = this.admin_users[index].name;
  440. desc = "第二次核对人员:" + name + " 第二次核对时间:" + time;
  441. break;
  442. }
  443. }
  444. return desc;
  445. }
  446. } else {
  447. let time = uParseTime(
  448. this.doubleReview.check_time,
  449. "{y}-{m}-{d} {h}:{i}"
  450. );
  451. if (this.doubleReview.modifier <= 0) {
  452. return "";
  453. }
  454. var desc = "";
  455. if (
  456. this.admin_users == null ||
  457. typeof this.admin_users.length == "undefined"
  458. ) {
  459. return desc;
  460. }
  461. var leng = this.admin_users.length;
  462. if (leng == 0) {
  463. return desc;
  464. }
  465. for (let index = 0; index < leng; index++) {
  466. if (this.admin_users[index].id == this.doubleReview.modifier) {
  467. let name = this.admin_users[index].name;
  468. desc = "第二次核对人员:" + name + " 第二次核对时间:" + time;
  469. break;
  470. }
  471. }
  472. return desc;
  473. }
  474. },
  475. getDate: function(val) {
  476. return parseTime(val, "{y}-{m}-{d} {h}:{i}");
  477. }
  478. },
  479. mounted() {
  480. if (this.record.id == 0) {
  481. this.check_time_str = parseTime(
  482. this.check_time,
  483. "{y}-{m}-{d} {h}:{i}" + ":00"
  484. );
  485. } else {
  486. if (this.record.modifier == 0) {
  487. this.check_time_str = parseTime(
  488. this.check_time,
  489. "{y}-{m}-{d} {h}:{i}" + ":00"
  490. );
  491. } else {
  492. this.check_time_str = parseTime(
  493. this.record.check_time,
  494. "{y}-{m}-{d} {h}:{i}" + ":00"
  495. );
  496. }
  497. }
  498. }
  499. };
  500. </script>
  501. <style style="stylesheet/scss" lang="scss" scoped>
  502. .choose {
  503. .demo-form-inline {
  504. border-bottom: 1px #e5e5e5 solid;
  505. .el-form-item {
  506. margin-bottom: 0;
  507. padding: 0.2rem 0.2rem;
  508. margin-right: 0;
  509. }
  510. p {
  511. color: $title-color;
  512. }
  513. }
  514. .button {
  515. text-align: center;
  516. margin-top: 1rem;
  517. .submitButton {
  518. width: 3rem;
  519. height: 0.8rem;
  520. line-height: 0.8rem;
  521. background: $main-color;
  522. color: #fff;
  523. font-size: 0.3rem;
  524. text-align: center;
  525. border-radius: 6px;
  526. }
  527. }
  528. }
  529. </style>
  530. <style lang="scss">
  531. .doubleForm {
  532. .el-radio__inner {
  533. @media only screen and (min-width: 768px) {
  534. width: 26px;
  535. height: 26px;
  536. margin-bottom: 4px;
  537. }
  538. }
  539. }
  540. .el-radio__input {
  541. @media only screen and (min-width: 768px) {
  542. margin-top: -6px;
  543. }
  544. }
  545. .demo-form-inline {
  546. p {
  547. font-size: 0.45rem;
  548. }
  549. }
  550. .doubleInput {
  551. .el-input__inner {
  552. font-size: 0.45rem;
  553. }
  554. }
  555. </style>