血透系统pad前端

modify_order_form.vue 13KB

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