血透系统pad前端

order_form.vue 14KB

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