血透系统pad前端

modify_order_form.vue 12KB

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