血透系统pad前端

order_form.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. <template>
  2. <div v-if="visibility">
  3. <div v-if="sub_dialog_key == 0" class="Dialog">
  4. <div class="DialogTit">
  5. <div class="back" @click="backAction">
  6. <span class="iconfont">&#xe720;</span>返回
  7. </div>
  8. <h1 class="name">{{ dialog_title }}</h1>
  9. <span class="success" @click="comfirmAction">保存</span>
  10. </div>
  11. <div class="DialogContent choose advice-top">
  12. <div class="content clearfix">
  13. <div class="newContent">
  14. <div class="cell">
  15. <label>医嘱名称</label>
  16. <input class="inputBox" style="width:96%" v-model="order.title" />
  17. <!-- <el-input v-model="order.title"></el-input> -->
  18. </div>
  19. <div class="cell">
  20. <label>药品规格</label>
  21. <!--<input class="inputBox" style="width:62.5%" v-model="order.advice_desc">-->
  22. <input
  23. class="inputBox"
  24. style="width:60%"
  25. v-model="order.advice_desc"
  26. />
  27. <input
  28. type="text"
  29. placeholder="单位"
  30. readonly
  31. class="inputBox"
  32. style="width:35%"
  33. v-model="order.drug_spec_unit"
  34. @focus="selectDrugSpecUnitAction"
  35. />
  36. </div>
  37. <div class="cell">
  38. <label>开药数量</label>
  39. <input
  40. type="number"
  41. class="inputBox"
  42. style="width:60%"
  43. v-model="order.prescribing_number"
  44. />
  45. <input
  46. type="text"
  47. placeholder="单位"
  48. readonly
  49. class="inputBox"
  50. style="width:35%"
  51. v-model="order.prescribing_number_unit"
  52. @focus="selectPrescribingNumUnitAction"
  53. />
  54. </div>
  55. <div class="cell">
  56. <label>单次用量</label>
  57. <input
  58. type="number"
  59. class="inputBox"
  60. style="width:62.5%"
  61. v-model="order.single_dose"
  62. />
  63. <input
  64. type="text"
  65. placeholder="单位"
  66. readonly
  67. class="inputBox"
  68. style="width:35%"
  69. v-model="order.single_dose_unit"
  70. @focus="selectSingleDoseAction"
  71. />
  72. </div>
  73. <div class="cell" v-show="order.parent_id == 0">
  74. <label>给药途径</label>
  75. <el-input
  76. placeholder="选择给药途径"
  77. readonly
  78. :disabled="mode == 3"
  79. v-model="order.delivery_way"
  80. @focus="selectDeliveryWayAction"
  81. ></el-input>
  82. </div>
  83. <div class="cell" v-show="order.parent_id == 0">
  84. <label>执行频率</label>
  85. <el-input
  86. placeholder="选择执行频率"
  87. readonly
  88. :disabled="mode == 3"
  89. v-model="order.execution_frequency"
  90. @focus="selectExecFrequencyAction"
  91. ></el-input>
  92. </div>
  93. <div class="cell" v-show="order.parent_id == 0">
  94. <label>医嘱嘱托</label>
  95. <input
  96. class="inputBox"
  97. style="width:100%"
  98. v-model="order.remark"
  99. />
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. </div>
  105. <single-option-dialog
  106. :visibility="sub_dialog_key == 1"
  107. title="用量单位"
  108. @did-selected="didSelectSingleDoseUnit"
  109. @back="didCloseSingleOptionDialog"
  110. :options="single_dose_unit_options"
  111. option_key="id"
  112. option_label_key="name"
  113. ></single-option-dialog>
  114. <single-option-dialog
  115. :visibility="sub_dialog_key == 5"
  116. title="药品规格"
  117. @did-selected="didSelectDrugSpecUnit"
  118. @back="didCloseSingleOptionDialog"
  119. :options="drug_spec_unit_options"
  120. option_key="id"
  121. option_label_key="name"
  122. ></single-option-dialog>
  123. <single-option-dialog
  124. :visibility="sub_dialog_key == 2"
  125. title="开药数量单位"
  126. @did-selected="didSelectPrescribingNumUnit"
  127. @back="didCloseSingleOptionDialog"
  128. :options="prescribing_number_unit_options"
  129. option_key="id"
  130. option_label_key="name"
  131. ></single-option-dialog>
  132. <single-option-dialog
  133. :visibility="sub_dialog_key == 3"
  134. title="给药途径"
  135. @did-selected="didSelectDeliveryWay"
  136. @back="didCloseSingleOptionDialog"
  137. :options="delivery_way_options"
  138. option_key="id"
  139. option_label_key="name"
  140. ></single-option-dialog>
  141. <single-option-dialog
  142. :visibility="sub_dialog_key == 4"
  143. title="执行频率"
  144. @did-selected="didSelectExecFrequency"
  145. @back="didCloseSingleOptionDialog"
  146. :options="execution_frequency_options"
  147. option_key="id"
  148. option_label_key="name"
  149. ></single-option-dialog>
  150. </div>
  151. </template>
  152. <script>
  153. import SingleOptionDialog from "./single_option_dialog";
  154. import { Toast } from "vant";
  155. export default {
  156. name: "OrderForm",
  157. components: {
  158. SingleOptionDialog
  159. },
  160. props: {
  161. drug_spec_unit_options: {
  162. type: Array,
  163. default: function() {
  164. return [];
  165. }
  166. },
  167. delivery_way_options: {
  168. type: Array,
  169. default: function() {
  170. return [];
  171. }
  172. },
  173. execution_frequency_options: {
  174. type: Array,
  175. default: function() {
  176. return [];
  177. }
  178. },
  179. single_dose_unit_options: {
  180. type: Array,
  181. default: function() {
  182. return [];
  183. }
  184. },
  185. prescribing_number_unit_options: {
  186. type: Array,
  187. default: function() {
  188. return [];
  189. }
  190. }
  191. },
  192. data() {
  193. return {
  194. visibility: false,
  195. sub_dialog_key: 0,
  196. mode: 1,
  197. order: {
  198. title: "",
  199. advice_desc: "",
  200. drug_spec: "",
  201. drug_spec_unit: "",
  202. delivery_way: "",
  203. execution_frequency: "",
  204. single_dose: "",
  205. single_dose_unit: "",
  206. prescribing_number: "",
  207. prescribing_number_unit: "",
  208. remark: "",
  209. // 在新增子药才用到的字段
  210. parent_id: 0, // 父医嘱ID
  211. start_time: "",
  212. record_time: ""
  213. }
  214. };
  215. },
  216. computed: {
  217. dialog_title: function() {
  218. if (this.mode == 1) {
  219. return "新增医嘱内容";
  220. } else if (this.mode == 2) {
  221. return "修改医嘱内容";
  222. } else {
  223. return "新增子药";
  224. }
  225. }
  226. },
  227. methods: {
  228. showWithNew: function() {
  229. this.mode = 1;
  230. this.visibility = true;
  231. this.order.title = "";
  232. this.order.advice_desc = "";
  233. this.order.drug_spec = "";
  234. this.order.drug_spec_unit = "";
  235. this.order.delivery_way = "";
  236. this.order.execution_frequency = "";
  237. this.order.single_dose = "";
  238. this.order.single_dose_unit = "";
  239. this.order.prescribing_number = "";
  240. this.order.prescribing_number_unit = "";
  241. this.order.remark = "";
  242. },
  243. showWithEdit: function(order) {
  244. this.mode = 2;
  245. this.visibility = true;
  246. this.order.title = order.title;
  247. this.order.advice_desc = order.advice_desc;
  248. this.order.drug_spec = order.drug_spec;
  249. this.order.drug_spec_unit = order.drug_spec_unit;
  250. this.order.delivery_way = order.delivery_way;
  251. this.order.execution_frequency = order.execution_frequency;
  252. this.order.single_dose = order.single_dose;
  253. this.order.single_dose_unit = order.single_dose_unit;
  254. this.order.prescribing_number = order.prescribing_number;
  255. this.order.prescribing_number_unit = order.prescribing_number_unit;
  256. this.order.remark = order.remark;
  257. },
  258. showWithNewSubDrug: function(
  259. parent_id,
  260. parent_record_time,
  261. parent_start_time,
  262. parent_delivery_way,
  263. parent_execution_frequency
  264. ) {
  265. this.mode = 3;
  266. this.visibility = true;
  267. this.order.parent_id = parent_id;
  268. this.order.record_time = parent_record_time;
  269. this.order.start_time = parent_start_time;
  270. this.order.title = "";
  271. this.order.advice_desc = "";
  272. this.order.remark = "";
  273. this.order.drug_spec = "";
  274. this.order.drug_spec_unit = "";
  275. this.order.delivery_way =
  276. parent_delivery_way == undefined || parent_delivery_way == null
  277. ? ""
  278. : parent_delivery_way;
  279. this.order.execution_frequency =
  280. parent_execution_frequency == undefined ||
  281. parent_execution_frequency == null
  282. ? ""
  283. : parent_execution_frequency;
  284. this.order.single_dose = "";
  285. this.order.single_dose_unit = "";
  286. this.order.prescribing_number = "";
  287. this.order.prescribing_number_unit = "";
  288. },
  289. dismiss: function() {
  290. this.visibility = false;
  291. this.sub_dialog_key = 0;
  292. },
  293. backAction: function() {
  294. this.visibility = false;
  295. this.sub_dialog_key = 0;
  296. this.$emit("back");
  297. },
  298. comfirmAction: function() {
  299. if (this.order.title.length == 0) {
  300. Toast.fail("请填写医嘱名称");
  301. return;
  302. }
  303. if (this.mode == 1) {
  304. this.$emit("did-create-new", {
  305. title: this.order.title,
  306. advice_desc: this.order.advice_desc,
  307. delivery_way: this.order.delivery_way,
  308. execution_frequency: this.order.execution_frequency,
  309. single_dose: this.order.single_dose,
  310. single_dose_unit: this.order.single_dose_unit,
  311. prescribing_number: this.order.prescribing_number,
  312. prescribing_number_unit: this.order.prescribing_number_unit,
  313. remark: this.order.remark,
  314. drug_spec: this.order.drug_spec,
  315. drug_spec_unit: this.order.drug_spec_unit
  316. });
  317. } else if (this.mode == 2) {
  318. this.$emit("did-modify", {
  319. title: this.order.title,
  320. advice_desc: this.order.advice_desc,
  321. drug_spec: this.order.drug_spec,
  322. drug_spec_unit: this.order.drug_spec_unit,
  323. delivery_way: this.order.delivery_way,
  324. execution_frequency: this.order.execution_frequency,
  325. single_dose: this.order.single_dose,
  326. single_dose_unit: this.order.single_dose_unit,
  327. prescribing_number: this.order.prescribing_number,
  328. prescribing_number_unit: this.order.prescribing_number_unit,
  329. remark: this.order.remark
  330. });
  331. } else if (this.mode == 3) {
  332. this.$emit("did-create-subdrug", {
  333. parent_id: this.order.parent_id,
  334. record_time: this.order.record_time,
  335. start_time: this.order.start_time,
  336. title: this.order.title,
  337. advice_desc: this.order.advice_desc,
  338. drug_spec: this.order.drug_spec,
  339. drug_spec_unit: this.order.drug_spec_unit,
  340. delivery_way: this.order.delivery_way,
  341. execution_frequency: this.order.execution_frequency,
  342. single_dose: this.order.single_dose,
  343. single_dose_unit: this.order.single_dose_unit,
  344. prescribing_number: this.order.prescribing_number,
  345. prescribing_number_unit: this.order.prescribing_number_unit
  346. });
  347. }
  348. },
  349. selectSingleDoseAction: function() {
  350. this.sub_dialog_key = 1;
  351. },
  352. didSelectSingleDoseUnit: function(index) {
  353. this.didCloseSingleOptionDialog();
  354. if (index == -1) {
  355. this.order.single_dose_unit = "";
  356. } else {
  357. this.order.single_dose_unit = this.single_dose_unit_options[index].name;
  358. }
  359. },
  360. selectDrugSpecUnitAction: function() {
  361. this.sub_dialog_key = 5;
  362. },
  363. didSelectDrugSpecUnit: function(index) {
  364. if (index == -1) {
  365. this.order.drug_spec_unit = "";
  366. } else {
  367. this.order.drug_spec_unit = this.drug_spec_unit_options[index].name;
  368. }
  369. this.didCloseSingleOptionDialog();
  370. },
  371. selectPrescribingNumUnitAction: function() {
  372. this.sub_dialog_key = 2;
  373. },
  374. didSelectPrescribingNumUnit: function(index) {
  375. this.didCloseSingleOptionDialog();
  376. if (index == -1) {
  377. this.order.prescribing_number_unit = "";
  378. } else {
  379. this.order.prescribing_number_unit = this.prescribing_number_unit_options[
  380. index
  381. ].name;
  382. }
  383. },
  384. selectDeliveryWayAction: function() {
  385. this.sub_dialog_key = 3;
  386. },
  387. didSelectDeliveryWay: function(index) {
  388. this.didCloseSingleOptionDialog();
  389. if (index == -1) {
  390. this.order.delivery_way = "";
  391. return;
  392. }
  393. this.order.delivery_way = this.delivery_way_options[index].name;
  394. },
  395. selectExecFrequencyAction: function() {
  396. this.sub_dialog_key = 4;
  397. },
  398. didSelectExecFrequency: function(index) {
  399. this.didCloseSingleOptionDialog();
  400. if (index == -1) {
  401. this.order.execution_frequency = "";
  402. return;
  403. }
  404. this.order.execution_frequency = this.execution_frequency_options[
  405. index
  406. ].name;
  407. },
  408. didCloseSingleOptionDialog: function() {
  409. this.sub_dialog_key = 0;
  410. }
  411. }
  412. };
  413. </script>
  414. <style style="stylesheet/scss" lang="scss" scoped>
  415. .content {
  416. .cell {
  417. @media only screen and (max-width: 415px) {
  418. height: 2.4rem;
  419. }
  420. float: left;
  421. width: 4.5rem;
  422. margin: 0.35rem 0.3rem 0.1rem 0.4rem;
  423. label {
  424. display: block;
  425. height: 0.9rem;
  426. line-height: 0.9rem;
  427. color: $title-color;
  428. font-size: 0.45rem;
  429. }
  430. .el-input__inner {
  431. font-size: 0.32rem;
  432. }
  433. select {
  434. width: 100%;
  435. padding: 0.2rem 0;
  436. border: 1px $border-color solid;
  437. border-radius: 2px;
  438. padding-left: 5px;
  439. }
  440. .inputBox {
  441. border: 1px $border-color solid;
  442. border-radius: 4px;
  443. padding: 0.14rem 0;
  444. padding-left: 5px;
  445. }
  446. .textarea {
  447. width: 100%;
  448. height: 1.22rem;
  449. border: 1px $border-color solid;
  450. border-radius: 2px;
  451. padding-left: 5px;
  452. }
  453. }
  454. .doctor-name {
  455. line-height: 0.7rem;
  456. font-size: 0.35rem;
  457. margin-left: 0.4rem;
  458. }
  459. }
  460. </style>
  461. <style lang="scss">
  462. .content {
  463. .newContent {
  464. overflow: hidden;
  465. }
  466. .cell {
  467. .inputBox {
  468. @media only screen and (max-width: 767px) {
  469. padding: 0.34rem 0 !important;
  470. padding-left: 5px !important;
  471. font-size: 0.42rem !important;
  472. }
  473. }
  474. .el-input__inner {
  475. font-size: 0.45rem;
  476. }
  477. }
  478. }
  479. </style>