Elizabeth's proactive approach involves introducing urinal toilet attachment , an ingenious concept that optimizes space and functionality.

callPrescription.vue 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414
  1. <template>
  2. <el-dialog
  3. :title="name"
  4. :visible.sync="isLastOrNextVisible"
  5. @close="hide"
  6. width="1010px"
  7. class="callPrescription"
  8. :modal-append-to-body="false"
  9. >
  10. <el-date-picker
  11. v-model="start_time"
  12. prefix-icon="el-icon-date"
  13. @change="changeTime"
  14. :editable="false"
  15. style="width: 150px;"
  16. type="date"
  17. placeholder="选择日期时间"
  18. align="right"
  19. format="yyyy-MM-dd"
  20. value-format="yyyy-MM-dd"
  21. ></el-date-picker>
  22. <span class>-</span>
  23. <el-date-picker
  24. v-model="end_time"
  25. prefix-icon="el-icon-date"
  26. @change="changeEndTime"
  27. :editable="false"
  28. style="width: 150px;"
  29. type="date"
  30. placeholder="选择日期时间"
  31. align="right"
  32. format="yyyy-MM-dd"
  33. value-format="yyyy-MM-dd"
  34. ></el-date-picker>
  35. <div v-for="(item,index) in allPrescription" :key="index">
  36. <div class="quote" v-if="item.prescriptions.length > 0">引用 {{getTime(item.record_date, '{y}年{m}月{d}日')}} 的处方</div>
  37. <el-checkbox-group v-model="item.check_group">
  38. <div v-for="(subItem,index2) in item.prescriptions" :key="index2">
  39. <el-checkbox style="margin:10px 0;" :label="subItem.id">{{'处方' + (index2+ 1)}}</el-checkbox>
  40. <el-table v-if="subItem.type == 1" :data="subItem.doctor_advice" border style="width: 99%;"
  41. :row-style="{ color: '#303133' }"
  42. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
  43. <el-table-column align="center" type="index" width="60" label="序号"></el-table-column>
  44. <el-table-column align="center" prop="drug_name" width="160" label="名称">
  45. <template slot-scope="scope">
  46. <span>{{ scope.row.advice_name }}</span>
  47. </template>
  48. </el-table-column>
  49. <el-table-column align="center" prop="single_dose" width="90" label="单次用量">
  50. <template slot-scope="scope">
  51. <div>{{scope.row.single_dose}}{{scope.row.single_dose_unit}}</div>
  52. </template>
  53. </el-table-column>
  54. <el-table-column align="center" prop="delivery_way" width="100" label="用法">
  55. <template slot-scope="scope">
  56. {{scope.row.delivery_way}}
  57. </template>
  58. </el-table-column>
  59. <el-table-column align="center" prop="execution_frequency" width="100" label="频率">
  60. <template slot-scope="scope">
  61. {{scope.row.execution_frequency}}
  62. </template>
  63. </el-table-column>
  64. <el-table-column align="center" prop="day" width="60" label="天数">
  65. <template slot-scope="scope">
  66. {{scope.row.day}}
  67. </template>
  68. </el-table-column>
  69. <el-table-column align="center" prop="prescribing_number" width="100" label="总量">
  70. <template slot-scope="scope">
  71. <div>{{scope.row.prescribing_number}} {{scope.row.prescribing_number_unit}}</div>
  72. </template>
  73. </el-table-column>
  74. <el-table-column align="center" prop="retail_price" width="80" label="单价">
  75. <template slot-scope="scope">
  76. <div>{{scope.row.price}}元</div>
  77. </template>
  78. </el-table-column>
  79. <el-table-column align="center" prop="remark" label="备注">
  80. <template slot-scope="scope">
  81. <div>{{scope.row.remark}}</div>
  82. </template>
  83. </el-table-column>
  84. </el-table>
  85. <el-table v-if="subItem.type == 2" :data="subItem.project" border style="width: 99%;"
  86. :row-style="{ color: '#303133' }"
  87. :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)',color: '#606266'}" highlight-current-row>
  88. <el-table-column align="center" type="index" width="60" label="序号"></el-table-column>
  89. <el-table-column align="center" prop="project_name" width="160" label="名称">
  90. <template slot-scope="scope">
  91. <span>{{ scope.row.type == 2?scope.row.project.project_name:scope.row.good_info.good_name}}</span>
  92. </template>
  93. </el-table-column>
  94. <el-table-column align="center" prop="statistical_classification" width="100" label="组">
  95. <template slot-scope="scope">{{scope.row.type == 2 ?getGroup(scope.row.statistical_classification):"耗材"}}</template>
  96. </el-table-column>
  97. <el-table-column align="center" prop="single_dose" width="90" label="单次用量">
  98. <template slot-scope="scope">
  99. <!--<el-input v-model="scope.row.single_dose" placeholder=""></el-input>-->
  100. <span>{{ scope.row.single_dose }}</span>
  101. </template>
  102. </el-table-column>
  103. <el-table-column align="center" prop="delivery_way" width="100" label="用法">
  104. <template slot-scope="scope">
  105. <!--<el-input v-model="scope.row.delivery_way" placeholder=""></el-input>-->
  106. <span>{{ scope.row.delivery_way }}</span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column align="center" prop="execution_frequency" width="100" label="频率">
  110. <template slot-scope="scope">
  111. <!--<el-input v-model="scope.row.execution_frequency" placeholder=""></el-input>-->
  112. <span>{{ scope.row.execution_frequency }}</span>
  113. </template>
  114. </el-table-column>
  115. <el-table-column align="center" prop="number_days" width="70" label="天数">
  116. <template slot-scope="scope">
  117. <!--<el-input v-model="scope.row.number_days" placeholder=""></el-input>-->
  118. <span>{{ scope.row.number_days }}</span>
  119. </template>
  120. </el-table-column>
  121. <el-table-column align="center" prop="total" width="70" label="总量">
  122. <template slot-scope="scope">
  123. <div>{{ scope.row.count }}{{scope.row.unit}}</div>
  124. </template>
  125. </el-table-column>
  126. <el-table-column align="center" prop="name" width="60" label="单价">
  127. <template slot-scope="scope">
  128. <!--<el-input v-model="scope.row.price" placeholder="" readonly></el-input>-->
  129. <span>{{ scope.row.price }}</span>
  130. </template>
  131. </el-table-column>
  132. <el-table-column align="center" prop="name" label="备注">
  133. <template slot-scope="scope">
  134. <!--<el-input v-model="scope.row.remark" :title="scope.row.remark"></el-input>-->
  135. <span>{{ scope.row.remark }}</span>
  136. </template>
  137. </el-table-column>
  138. </el-table>
  139. </div>
  140. </el-checkbox-group>
  141. </div>
  142. <div slot="footer" class="dialog-footer">
  143. <el-button @click="isLastOrNextVisible = false">取 消</el-button>
  144. <el-button type="primary" @click="save">保存</el-button>
  145. </div>
  146. </el-dialog>
  147. </template>
  148. <script>
  149. import { uParseTime } from '@/utils/tools'
  150. import { getDictionaryDataConfig} from "@/utils/data";
  151. import {
  152. getCallHisPrescription
  153. } from '@/api/his/his'
  154. export default {
  155. name: "callPrescription",
  156. data() {
  157. return {
  158. start_time:"",
  159. end_time:"",
  160. srcPrescriptions:[],
  161. name:"",
  162. request_record_date:'',
  163. patient_id:0,
  164. allPrescription: [],
  165. isLastOrNextVisible: false,
  166. }
  167. }, methods: {
  168. changeTime(){
  169. let params={
  170. patient_id:this.patient_id,
  171. start_time: this.start_time,
  172. end_time:this.end_time,
  173. p_type:2,
  174. };
  175. this.GetCallHisPrescription(params)
  176. },changeEndTime(){
  177. let params={
  178. patient_id:this.patient_id,
  179. start_time: this.start_time,
  180. end_time:this.end_time,
  181. p_type:2,
  182. };
  183. this.GetCallHisPrescription(params)
  184. },
  185. GetCallHisPrescription(params){
  186. getCallHisPrescription(params).then(response => {
  187. if (response.data.state == 1) {
  188. this.allPrescription = response.data.data.prescriptions;
  189. for (let i = 0; i < this.allPrescription.length; i++){
  190. this.allPrescription[i].check_group = []
  191. }
  192. this.request_record_date = uParseTime(response.data.data.prescriptions[0].record_date, '{y}-{m}-{d}')
  193. } else {
  194. this.$message.error(response.data.msg)
  195. }
  196. })
  197. },
  198. save() {
  199. let replace_one = [];
  200. let replace_two = [];
  201. let checkGroup = [];
  202. let allPrescriptions = [];
  203. let targetPrescriptions = [];
  204. let prescriptions = [];
  205. for (let i = 0; i < this.allPrescription.length; i++) {
  206. for (let a = 0; a < this.allPrescription[i].check_group.length; a++) {
  207. checkGroup.push(this.allPrescription[i].check_group[a])
  208. }
  209. for (let a = 0; a < this.allPrescription[i].prescriptions.length; a++) {
  210. allPrescriptions.push(this.allPrescription[i].prescriptions[a])
  211. }
  212. }
  213. for (let i = 0; i < allPrescriptions.length; i++){
  214. for (let a = 0; a < checkGroup.length; a++){
  215. if(allPrescriptions[i].id == checkGroup[a]){
  216. targetPrescriptions.push(allPrescriptions[i])
  217. }
  218. }
  219. }
  220. for (let i = 0; i < targetPrescriptions.length; i++) {
  221. var prescription = targetPrescriptions[i];
  222. for (let b = 0; b < prescription.doctor_advice.length; b++) {
  223. console.log(prescription.doctor_advice[b].drug.is_special_diseases)
  224. if (prescription.med_type == "14" && prescription.doctor_advice[b].drug.is_special_diseases != 1) {
  225. prescription.doctor_advice.splice(b--,1)
  226. }
  227. }
  228. for (let b = 0; b < prescription.project.length; b++) {
  229. if(prescription.project[b].type == 2){
  230. if (prescription.med_type == "14" && prescription.project[b].project.disease_directory != 1) {
  231. prescription.project.splice(b--,1)
  232. }
  233. }else if(prescription.project[b].type == 3){
  234. if (prescription.med_type == "14" && prescription.project[b].good_info.is_special_diseases != 1) {
  235. prescription.project.splice(b--,1)
  236. }
  237. }
  238. }
  239. }
  240. if (targetPrescriptions.length > 0) {
  241. for (let i = 0; i < targetPrescriptions.length; i++) {
  242. var prescription = targetPrescriptions[i];
  243. let tempAdvice = [];
  244. let tempProject = [];
  245. let tempAddition = [];
  246. for (let b = 0; b < prescription.doctor_advice.length; b++) {
  247. let index = b + 1
  248. let obj = {
  249. advice_id: 0,
  250. drug_name: prescription.doctor_advice[b].advice_name,
  251. single_dose: prescription.doctor_advice[b].single_dose,
  252. delivery_way: prescription.doctor_advice[b].delivery_way,
  253. execution_frequency: prescription.doctor_advice[b].execution_frequency,
  254. // retail_price: prescription.doctor_advice[b].price.toString(),
  255. remark: prescription.doctor_advice[b].remark,
  256. day:prescription.doctor_advice[b].day,
  257. prescribing_number:prescription.doctor_advice[b].prescribing_number.toString(),
  258. single_dose_unit:prescription.doctor_advice[b].single_dose_unit,
  259. prescribing_number_unit:prescription.doctor_advice[b].prescribing_number_unit,
  260. medical_insurance_number:prescription.doctor_advice[b].med_list_codg,
  261. id:prescription.doctor_advice[b].drug_id,
  262. drug:prescription.doctor_advice[b].drug,
  263. groupno: index,
  264. hosp_appr_flag:"1",
  265. };
  266. if (obj.prescribing_number_unit == prescription.doctor_advice[b].drug.min_unit){
  267. obj['retail_price'] = prescription.doctor_advice[b].drug.min_price
  268. } else if(obj.prescribing_number_unit == prescription.doctor_advice[b].drug.max_unit){
  269. obj['retail_price'] = prescription.doctor_advice[b].drug.retail_price
  270. } else {
  271. obj['retail_price'] = prescription.doctor_advice[b].drug.min_price
  272. }
  273. tempAdvice.push(obj)
  274. }
  275. for (let b = 0; b < prescription.project.length; b++) {
  276. let obj = {
  277. id: 0,
  278. project_id: prescription.project[b].project_id,
  279. project_name: prescription.project[b].project.project_name,
  280. statistical_classification: prescription.project[b].project.statistical_classification,
  281. single_dose: prescription.project[b].single_dose,
  282. delivery_way: prescription.project[b].delivery_way,
  283. execution_frequency: prescription.project[b].execution_frequency,
  284. number_days: prescription.project[b].day,
  285. total:prescription.project[b].count,
  286. remark:prescription.project[b].remark,
  287. unit: prescription.project[b].unit,
  288. type: prescription.project[b].type
  289. // medical_code:prescription.project[b].project.medical_code,
  290. };
  291. if(prescription.project[b].type == 2){
  292. obj['statistical_classification'] = prescription.project[b].project.statistical_classification
  293. obj['medical_code'] = prescription.project[b].project.medical_code
  294. obj['project_name'] = prescription.project[b].project.project_name
  295. obj['price'] = prescription.project[b].project.price
  296. }else if(prescription.project[b].type == 3){
  297. obj['statistical_classification'] = ""
  298. obj['medical_code'] = prescription.project[b].good_info.medical_insurance_number
  299. obj['project_name'] = prescription.project[b].good_info.good_name
  300. obj['price'] = prescription.project[b].good_info.packing_price
  301. }
  302. tempProject.push(obj)
  303. }
  304. let obj = {
  305. id: 0,
  306. advices: tempAdvice,
  307. project: tempProject,
  308. addition:tempAddition,
  309. type:prescription.type,
  310. order_status:0,
  311. };
  312. prescriptions.push(obj)
  313. }
  314. }
  315. if(this.srcPrescriptions.length == 1){
  316. if(this.srcPrescriptions[0].advices.length == 0 && this.srcPrescriptions[0].project.length == 0){
  317. this.srcPrescriptions = [];
  318. this.srcPrescriptions = prescriptions;
  319. this.$emit('call', this.srcPrescriptions)
  320. }else{
  321. this.srcPrescriptions = this.srcPrescriptions.concat(prescriptions);
  322. this.$emit('call', this.srcPrescriptions)
  323. }
  324. }else{
  325. this.srcPrescriptions = this.srcPrescriptions.concat(prescriptions);
  326. this.$emit('call', this.srcPrescriptions)
  327. }
  328. },show(name,id,end_time, start_time,srcPrescriptions,prescriptions){
  329. this.srcPrescriptions = srcPrescriptions;
  330. this.start_time = start_time;
  331. this.end_time = end_time;
  332. this.patient_id = id;
  333. this.name = '处方调用' + '('+name +')';
  334. this.allPrescription = prescriptions;
  335. for (let i = 0; i < this.allPrescription.length; i++){
  336. this.allPrescription[i].check_group = []
  337. }
  338. this.isLastOrNextVisible = true
  339. },close(){
  340. this.isLastOrNextVisible = false
  341. },hide(){
  342. this.$emit('callCancel')
  343. },getTime(time, template){
  344. return uParseTime(time,template)
  345. }, getGroup(id){
  346. var name = "";
  347. var statistics_category = getDictionaryDataConfig('system','statistics_category');
  348. for(let i=0;i<statistics_category.length;i++){
  349. if(id == statistics_category[i].id){
  350. name = statistics_category[i].name
  351. }
  352. }
  353. return name
  354. }, getDictionaryDataConfig(module, filed_name) {
  355. return getDictionaryDataConfig(module, filed_name)
  356. },
  357. }
  358. }
  359. </script>
  360. <style lang="scss">
  361. .callPrescription{
  362. .el-dialog__body{
  363. padding:0px 20px 30px;
  364. }
  365. .quote{
  366. margin-top: 10px;
  367. font-size: 14px;
  368. }
  369. }
  370. </style>