submitRecipe copy.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. <template>
  2. <div class="recipe">
  3. <Popup
  4. @cancle="closePopup"
  5. width="60%"
  6. title="处置方案"
  7. :showDialog.sync="show"
  8. distanceTop="3vh"
  9. :showBtns="false"
  10. :showBody="false"
  11. >
  12. <div slot="body">
  13. <div class="recipe-priview flex flex-col-top">
  14. <div class="left-table">
  15. <div class="table-body">
  16. <div class="table-title">治疗意见</div>
  17. <div
  18. :class="['table-tr flex flex-row-left flex-row-top',recipeItem.pid==item.pid?'table-tr-active':'']"
  19. v-for="(item,index) in recipes"
  20. :key="index"
  21. @click="leftChange(item)"
  22. >
  23. <div class="flex-center" v-if="item.recipeType==1">中药处方{{index+1}}</div>
  24. <div class="flex-center" v-if="item.recipeType==2">中药制剂处方</div>
  25. <div class="flex-center" v-if="item.recipeType==3">适宜技术处方</div>
  26. <div class="flex-center">{{item.lumpSum}}元</div>
  27. <div>
  28. <img src="~@/assets/new-icon/close.png" alt @click.self="deleteItem(index)" />
  29. </div>
  30. </div>
  31. <div :class="['table-tr flex flex-row-left flex-row-top']">
  32. <div class="flex-center">合计金额</div>
  33. <div class="flex-center">{{totalCount}}元</div>
  34. <div></div>
  35. </div>
  36. </div>
  37. <!-- 安全合理用药审查报告 -->
  38. <div class="report" v-if="false">
  39. <h3>安全合理用药审查报告</h3>
  40. <div class="patiens-msg mr-t10" v-if="rationalMed.length>0">
  41. <div class="p">
  42. <!-- {{item.matname}}({{item.matbzjj}}) -->
  43. <!-- <div class="patiens-name">{{item.matname}}</div> -->
  44. <div class="patiens-cate">超剂量药品:</div>
  45. <div class="patiens-desc" v-for="(item,index) in rationalMed10" :key="index">
  46. <span v-if="item.showDose">
  47. <span class="matname">{{item.matname}}</span>
  48. <span style="color:red;">({{item.matmindosage}}-{{item.matmaxdosage}})</span>
  49. </span>
  50. </div>
  51. </div>
  52. <div class="p" v-if="rationalMed2.length>0">
  53. <div class="patiens-cate">慎忌禁用药:</div>
  54. <div class="patiens-desc" v-for="(item,index) in rationalMed2" :key="index">
  55. <span v-if="item.matsjj">
  56. <span class="matname">{{item.matname}}</span>
  57. ({{item.matsjj}})
  58. </span>
  59. </div>
  60. </div>
  61. <div class="p" v-if="rationalMed3.length>0">
  62. <div class="patiens-cate">孕妇慎忌禁:</div>
  63. <div class="patiens-desc" v-for="(item,index) in rationalMed3" :key="index">
  64. <span v-if="item.matyfsjj">
  65. <span class="matname">{{item.matname}}</span>
  66. <span :style="{color:item.matyfsj==3?'red':''}">({{item.matyfsjj |fyfsjj}})</span>
  67. </span>
  68. </div>
  69. </div>
  70. <div class="p" v-if="rationalMed4.length>0">
  71. <div class="patiens-cate">服药饮食禁忌:</div>
  72. <div class="patiens-desc" v-for="(item,index) in rationalMed4" :key="index">
  73. <span v-if="item.matysjj">
  74. <span class="matname">{{item.matname}}</span>
  75. ({{item.matysjj?item.matysjj:'无'}})
  76. </span>
  77. </div>
  78. </div>
  79. <div class="p" v-if="rationalMed5.length>0">
  80. <div class="patiens-cate">药物毒性说明:</div>
  81. <div class="patiens-desc" v-for="(item,index) in rationalMed5" :key="index">
  82. <span v-if="item.matdxsm">
  83. <span class="matname" style="color:red;">{{item.matname}}</span>
  84. ({{item.matdxsm?item.matdxsm:'无'}})
  85. </span>
  86. </div>
  87. </div>
  88. <div class="p" v-if="rationalMed6.length>0">
  89. <div class="patiens-cate">病证用药禁忌:</div>
  90. <div class="patiens-desc" v-for="(item,index) in rationalMed6" :key="index">
  91. <span v-if="item.matbzjj">
  92. <span class="matname">{{item.matname}}</span>
  93. ({{item.matbzjj?item.matbzjj:'无'}})
  94. </span>
  95. </div>
  96. </div>
  97. <div class="p" v-if="rationalMed7.length>0">
  98. <div class="patiens-cate">十八反:</div>
  99. <div class="patiens-desc" v-for="(item,index) in rationalMed7" :key="index">
  100. <!-- <span v-if='item.matsbf'>{{fsbf(item.matsbf,item.matname)}}</span> -->
  101. <span v-if="item.matsbf">
  102. <span style="color:red;">{{item.matname}}</span>
  103. 反{{item.matsbf}}
  104. </span>
  105. </div>
  106. </div>
  107. <div class="p" v-if="rationalMed8.length>0">
  108. <div class="patiens-cate">十九畏:</div>
  109. <div class="patiens-desc" v-for="(item,index) in rationalMed8" :key="index">
  110. <!-- <span v-if="item.matsjw">{{fsjw(item.matsjw,item.matname)}}</span> -->
  111. <span v-if="item.matsjw">
  112. <span style="color:red;">{{item.matname}}</span>
  113. 畏{{item.matsjw}}
  114. </span>
  115. </div>
  116. </div>
  117. <div class="p" v-if="rationalMed9.length>0">
  118. <div class="patiens-cate">用药不宜:</div>
  119. <div class="patiens-desc" v-for="(item,index) in rationalMed9" :key="index">
  120. <span v-if="item.matby">{{fmatby(item.matby,item.matname) }}</span>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. <!-- <div style="text-align:center;margin-top:10px;" v-if="recipeItem.showSign">
  126. <el-button size="small" type="primary" @click="signToRecipt">双签名</el-button>
  127. </div>-->
  128. </div>
  129. <!-- 右侧处方笺 -->
  130. <div class="right-pad">
  131. <!-- 中药处方 -->
  132. <div v-if="recipeItem.recipeType==1">
  133. <chineseMedicinePad ref="chineseM" :recipeData="recipeItem"></chineseMedicinePad>
  134. </div>
  135. <!-- 中药制剂 -->
  136. <div v-if="recipeItem.recipeType==2">
  137. <chineseMadePad :recipeData="recipeItem"></chineseMadePad>
  138. </div>
  139. <!-- 适宜技术处方 -->
  140. <div v-if="recipeItem.recipeType==3">
  141. <suitMadePad :recipeData="recipeItem"></suitMadePad>
  142. </div>
  143. </div>
  144. </div>
  145. <div class="flex-center btns">
  146. <el-button size="small" @click="closePopup">取消</el-button>
  147. <el-button size="small" type="primary" @click="sureToSubmit">确认并提交</el-button>
  148. </div>
  149. </div>
  150. </Popup>
  151. </div>
  152. </template>
  153. <script>
  154. import { addRecipe, updateRecipe } from "@/api/diagnosis.js";
  155. import { mapGetters } from "vuex";
  156. import Popup from "@/components/Propup.vue";
  157. import chineseMedicinePad from "@/components/ui/chineseMedicinePad.vue";
  158. import chineseMadePad from "@/components/ui/chineseMadePad.vue";
  159. import suitMadePad from "@/components/ui/suitMadePad.vue";
  160. export default {
  161. components: {
  162. Popup,
  163. chineseMedicinePad,
  164. chineseMadePad,
  165. suitMadePad
  166. },
  167. props: {
  168. show: {
  169. type: Boolean,
  170. default: false
  171. },
  172. priviewData: {
  173. type: Object,
  174. default: () => {
  175. return {};
  176. }
  177. }
  178. },
  179. data() {
  180. return {
  181. showDialog: false,
  182. recipes: [], // 处方数据
  183. recipeItem: {}, // 右侧显示处方
  184. rationalMed: [],
  185. rationalMed1: [],
  186. rationalMed2: [],
  187. rationalMed3: [],
  188. rationalMed4: [],
  189. rationalMed5: [],
  190. rationalMed6: [],
  191. rationalMed7: [],
  192. rationalMed8: [],
  193. rationalMed9: [],
  194. rationalMed10: []
  195. };
  196. },
  197. watch: {
  198. show() {
  199. this.showDialog = this.show;
  200. },
  201. priviewData: {
  202. deep: true,
  203. handler: function() {
  204. if (!this.show) return;
  205. if (Object.keys(this.priviewData).length == 0) return;
  206. this.dealPriviewData();
  207. }
  208. }
  209. },
  210. computed: {
  211. totalCount() {
  212. let total = 0;
  213. this.recipes.forEach(item => {
  214. total += item.lumpSum;
  215. });
  216. return total.toFixed(2);
  217. },
  218. ...mapGetters(["getPatiensInfo", "getuserinfo", "getDrugInfo", "getIsSee"])
  219. },
  220. created() {
  221. this.showDialog = this.show;
  222. this.dealPriviewData();
  223. },
  224. methods: {
  225. signToRecipt() {
  226. this.recipes.forEach(item => {
  227. if (item.pid == this.recipeItem.pid) {
  228. item.showSign = false;
  229. // this.recipeItem = item
  230. this.$set(this.recipeItem, "showSign", false);
  231. }
  232. });
  233. this.$forceUpdate();
  234. this.$refs.chineseM.showSign = true;
  235. },
  236. closePopup() {
  237. this.showDialog = !this.showDialog;
  238. // this.priviewData = {}
  239. this.recipes = []; // 处方数据
  240. this.recipeItem = {}; // 右侧显示处方
  241. this.$emit("update:show", this.showDialog);
  242. this.$emit("cancle", 1);
  243. },
  244. // 处理数据
  245. dealPriviewData() {
  246. // 中药处方
  247. if (this.priviewData.tcmPrescriptionFormVos.length > 0) {
  248. this.priviewData.tcmPrescriptionFormVos.forEach((item, index) => {
  249. item.showSign = true;
  250. item.recipeType = 1;
  251. this.recipes.push(item);
  252. if (index == 0) {
  253. this.getSvaeMed(item);
  254. }
  255. });
  256. }
  257. // 中药制剂
  258. if (this.priviewData.zhongyaozhijiFormVo) {
  259. if (this.priviewData.zhongyaozhijiFormVo.pid) {
  260. this.priviewData.zhongyaozhijiFormVo.recipeType = 2;
  261. this.recipes.push(this.priviewData.zhongyaozhijiFormVo);
  262. }
  263. }
  264. // 适宜技术处方
  265. if (this.priviewData.shiyijishuFormVo) {
  266. if (this.priviewData.shiyijishuFormVo.pid) {
  267. this.priviewData.shiyijishuFormVo.recipeType = 3;
  268. this.recipes.push(this.priviewData.shiyijishuFormVo);
  269. }
  270. }
  271. this.recipeItem = this.recipes[0];
  272. },
  273. // 删除处方
  274. deleteItem(index) {
  275. this.$confirm("此操作将删除当前处方, 是否继续?", "提示", {
  276. confirmButtonText: "确定",
  277. cancelButtonText: "取消",
  278. type: "warning"
  279. })
  280. .then(() => {
  281. if (index == 0 && this.recipes.length == 1) {
  282. this.deleteRawData(this.recipes[index].recipeType, index);
  283. this.recipes.splice(index, 1);
  284. this.closePopup();
  285. return;
  286. }
  287. if (this.recipes[index].pid == this.recipeItem.pid) {
  288. this.deleteRawData(this.recipes[index].recipeType, index);
  289. this.recipes.splice(index, 1);
  290. this.recipeItem = this.recipes[0];
  291. } else {
  292. this.deleteRawData(this.recipes[index].recipeType, index);
  293. this.recipes.splice(index, 1);
  294. }
  295. })
  296. .catch(() => {});
  297. },
  298. // 左侧切换处方
  299. leftChange(item) {
  300. this.recipeItem = item;
  301. this.$refs.chineseM.showSign = !item.showSign;
  302. this.getSvaeMed(item);
  303. },
  304. // 获取安全合理用药信息
  305. getSvaeMed(data) {
  306. let father = this.$parent;
  307. data.prescriptiondetails.forEach(item1 => {
  308. if (item1.drugid.indexOf("-") != -1) {
  309. father.getRationalMed(item1.drugid);
  310. } else {
  311. father.getRationalMedForPlat(item1.drugid);
  312. }
  313. });
  314. setTimeout(() => {
  315. this.rationalMed = this.$parent.rationalMed;
  316. this.rationalMed1 = this.$parent.rationalMed1;
  317. this.rationalMed2 = this.$parent.rationalMed2;
  318. this.rationalMed3 = this.$parent.rationalMed3;
  319. this.rationalMed4 = this.$parent.rationalMed4;
  320. this.rationalMed5 = this.$parent.rationalMed5;
  321. this.rationalMed6 = this.$parent.rationalMed6;
  322. this.rationalMed7 = this.$parent.rationalMed7;
  323. this.rationalMed8 = this.$parent.rationalMed8;
  324. this.rationalMed9 = this.$parent.rationalMed9;
  325. this.rationalMed10 = this.$parent.rationalMed10;
  326. }, 200);
  327. },
  328. // 同时删除 缓存内保存的 提交数据
  329. deleteRawData(type, index) {
  330. let data = JSON.parse(sessionStorage.getItem("priviewRawData"));
  331. let zhongyao = data.zhongyao;
  332. let zhongchengyao = data.zhongchengyao;
  333. let technology = data.technology;
  334. if (type == 1) {
  335. zhongyao.splice(index, 1);
  336. }
  337. if (type == 2) {
  338. zhongchengyao = {};
  339. }
  340. if (type == 3) {
  341. technology = {};
  342. }
  343. sessionStorage.setItem(
  344. "priviewRawData",
  345. JSON.stringify({
  346. zhongchengyao,
  347. technology,
  348. zhongyao
  349. })
  350. );
  351. },
  352. sureToSubmit() {
  353. let data = JSON.parse(sessionStorage.getItem("priviewRawData"));
  354. let zhongyao = data.zhongyao;
  355. let zhongchengyao = data.zhongchengyao;
  356. let technology = data.technology;
  357. if (
  358. this.$route.query.recipeType &&
  359. this.$route.query.recipeType == "edit"
  360. ) {
  361. this.updateRecipe(zhongyao, zhongchengyao, technology);
  362. } else {
  363. this.addRecipe(zhongyao, zhongchengyao, technology);
  364. }
  365. },
  366. // 提交处方
  367. async addRecipe(zhongyao, zhongchengyao, technology) {
  368. const loading = this.$loading({
  369. lock: true,
  370. text: "正在提交",
  371. spinner: "el-icon-loading",
  372. background: "rgba(0, 0, 0, 0.7)"
  373. });
  374. let params = {
  375. recordid: this.getPatiensInfo.pid,
  376. technology: technology,
  377. zhongchengyao: zhongchengyao,
  378. zhongyao: zhongyao
  379. };
  380. let res = await addRecipe(params).catch(err => {
  381. loading.close();
  382. });
  383. if (res.ResultCode == 0) {
  384. this.$message.success("提交成功");
  385. if (this.$route.query.from && this.$route.query.from == "validation") {
  386. setTimeout(() => {
  387. loading.close();
  388. this.$router.back();
  389. }, 3000);
  390. } else {
  391. setTimeout(() => {
  392. loading.close();
  393. this.$router.push({
  394. path: "/index/recipe"
  395. });
  396. }, 3000);
  397. }
  398. sessionStorage.setItem("priviewRawData", "");
  399. sessionStorage.removeItem("prescr" + this.getPatiensInfo.pid);
  400. } else {
  401. }
  402. },
  403. // 审核不通过 修改处方
  404. async updateRecipe(zhongyao, zhongchengyao, technology) {
  405. const loading = this.$loading({
  406. lock: true,
  407. text: "正在修改",
  408. spinner: "el-icon-loading",
  409. background: "rgba(0, 0, 0, 0.7)"
  410. });
  411. let params = {
  412. recordid: this.$route.query.recordsId,
  413. technology: technology,
  414. zhongchengyao: zhongchengyao,
  415. zhongyao: zhongyao
  416. };
  417. let res = await updateRecipe(params).catch(err => {
  418. loading.close();
  419. });
  420. if (res.ResultCode == 0) {
  421. this.$message.success("修改成功");
  422. setTimeout(() => {
  423. loading.close();
  424. this.$router.push({
  425. path: "/index/recipe"
  426. });
  427. }, 3000);
  428. sessionStorage.setItem("priviewRawData", "");
  429. } else {
  430. }
  431. }
  432. }
  433. };
  434. </script>
  435. <style scoped lang="scss">
  436. @import "~@/style/common.scss";
  437. .recipe-priview {
  438. // height: 400px;
  439. height: 70vh;
  440. .right-pad {
  441. width: 420px;
  442. // background: red;
  443. height: 100%;
  444. overflow-y: auto;
  445. overflow-x: hidden;
  446. }
  447. .report {
  448. margin-top: 40px;
  449. height: 400px;
  450. overflow: auto;
  451. background: rgba($color: #d7d7d7, $alpha: 0.3);
  452. padding: 10px;
  453. box-sizing: border-box;
  454. h3 {
  455. text-align: center;
  456. }
  457. }
  458. .left-table {
  459. flex: 1;
  460. // height: 100%;
  461. overflow: auto;
  462. margin-right: 10px;
  463. .table-body {
  464. border: 1px solid #d7d7d7;
  465. border-bottom: 0;
  466. }
  467. .table-title {
  468. font-size: 15px;
  469. font-weight: 600;
  470. text-align: center;
  471. padding: 8px;
  472. color: #fff;
  473. background: #5386f6;
  474. }
  475. .table-tr {
  476. border-bottom: 1px solid #d7d7d7;
  477. cursor: default;
  478. // line-height: 30px;;
  479. font-size: 14px;
  480. height: 33px;
  481. div:nth-child(1) {
  482. flex: 1;
  483. border-right: 1px solid #d7d7d7;
  484. }
  485. div:nth-child(2) {
  486. flex: 1;
  487. border-right: 1px solid #d7d7d7;
  488. color: red;
  489. }
  490. div:nth-child(3) {
  491. width: 30px;
  492. display: flex;
  493. align-items: center;
  494. justify-content: center;
  495. img {
  496. width: 60%;
  497. }
  498. }
  499. }
  500. .table-tr:last-child {
  501. div:nth-child(1) {
  502. font-weight: 600;
  503. }
  504. }
  505. .table-tr-active {
  506. background: #d7d7d7;
  507. }
  508. }
  509. }
  510. .btns {
  511. margin-top: 10px;
  512. }
  513. .patiens-msg {
  514. font-size: 14px;
  515. font-family: PingFang SC;
  516. font-weight: 400;
  517. color: #333333;
  518. .p {
  519. margin-bottom: 5px;
  520. cursor: default;
  521. .patiens-name {
  522. color: #5386f6;
  523. font-weight: bold;
  524. font-size: 16px;
  525. }
  526. .patiens-desc {
  527. display: inline-block;
  528. .matname {
  529. color: #5386f6;
  530. }
  531. }
  532. .patiens-cate {
  533. font-weight: bold;
  534. }
  535. }
  536. }
  537. </style>