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

callPrescription.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  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.project.project_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">{{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:1,
  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:1,
  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. if (targetPrescriptions.length > 0) {
  221. for (let i = 0; i < targetPrescriptions.length; i++) {
  222. var prescription = targetPrescriptions[i];
  223. let tempAdvice = [];
  224. let tempProject = [];
  225. let tempAddition = [];
  226. for (let b = 0; b < prescription.doctor_advice.length; b++) {
  227. let obj = {
  228. advice_id: 0,
  229. drug_name: prescription.doctor_advice[b].advice_name,
  230. single_dose: prescription.doctor_advice[b].single_dose,
  231. delivery_way: prescription.doctor_advice[b].delivery_way,
  232. execution_frequency: prescription.doctor_advice[b].execution_frequency,
  233. retail_price: prescription.doctor_advice[b].price.toString(),
  234. remark: prescription.doctor_advice[b].remark,
  235. day:prescription.doctor_advice[b].day,
  236. prescribing_number:prescription.doctor_advice[b].prescribing_number.toString(),
  237. single_dose_unit:prescription.doctor_advice[b].single_dose_unit,
  238. prescribing_number_unit:prescription.doctor_advice[b].prescribing_number_unit,
  239. medical_insurance_number:prescription.doctor_advice[b].med_list_codg,
  240. id:prescription.doctor_advice[b].drug_id
  241. };
  242. tempAdvice.push(obj)
  243. }
  244. for (let b = 0; b < prescription.project.length; b++) {
  245. let obj = {
  246. id: 0,
  247. project_id: prescription.project[b].project_id,
  248. project_name: prescription.project[b].project.project_name,
  249. statistical_classification: prescription.project[b].project.statistical_classification,
  250. single_dose: prescription.project[b].single_dose,
  251. delivery_way: prescription.project[b].delivery_way,
  252. execution_frequency: prescription.project[b].execution_frequency,
  253. number_days: prescription.project[b].day,
  254. total:prescription.project[b].count,
  255. price:prescription.project[b].price,
  256. remark:prescription.project[b].remark,
  257. medical_code:prescription.project[b].project.medical_code,
  258. };
  259. tempProject.push(obj)
  260. }
  261. let obj = {
  262. id: 0,
  263. advices: tempAdvice,
  264. project: tempProject,
  265. addition:tempAddition,
  266. type:prescription.type,
  267. order_status:0,
  268. };
  269. prescriptions.push(obj)
  270. }
  271. }
  272. if(this.srcPrescriptions.length == 1){
  273. if(this.srcPrescriptions[0].advices.length == 0 && this.srcPrescriptions[0].project.length == 0){
  274. this.srcPrescriptions = [];
  275. this.srcPrescriptions = prescriptions;
  276. this.$emit('call', this.srcPrescriptions)
  277. }else{
  278. this.srcPrescriptions = this.srcPrescriptions.concat(prescriptions);
  279. this.$emit('call', this.srcPrescriptions)
  280. }
  281. }else{
  282. this.srcPrescriptions = this.srcPrescriptions.concat(prescriptions);
  283. this.$emit('call', this.srcPrescriptions)
  284. }
  285. },show(name,id,end_time, start_time,srcPrescriptions,prescriptions){
  286. this.srcPrescriptions = srcPrescriptions;
  287. this.start_time = start_time;
  288. this.end_time = end_time;
  289. this.patient_id = id;
  290. this.name = '处方调用' + '('+name +')';
  291. this.allPrescription = prescriptions;
  292. for (let i = 0; i < this.allPrescription.length; i++){
  293. this.allPrescription[i].check_group = []
  294. }
  295. this.isLastOrNextVisible = true
  296. },close(){
  297. this.isLastOrNextVisible = false
  298. },hide(){
  299. this.$emit('callCancel')
  300. },getTime(time, template){
  301. return uParseTime(time,template)
  302. }, getGroup(id){
  303. var name = "";
  304. var statistics_category = getDictionaryDataConfig('system','statistics_category');
  305. for(let i=0;i<statistics_category.length;i++){
  306. if(id == statistics_category[i].id){
  307. name = statistics_category[i].name
  308. }
  309. }
  310. return name
  311. }, getDictionaryDataConfig(module, filed_name) {
  312. return getDictionaryDataConfig(module, filed_name)
  313. },
  314. }
  315. }
  316. </script>
  317. <style lang="scss">
  318. .callPrescription{
  319. .el-dialog__body{
  320. padding:0px 20px 30px;
  321. }
  322. .quote{
  323. margin-top: 10px;
  324. font-size: 14px;
  325. }
  326. }
  327. </style>