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

medical_print.vue 25KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <el-row style="float:right;">
  6. <el-col :span="24">
  7. <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
  8. </el-col>
  9. </el-row>
  10. </div>
  11. <div class="app-container" style="background-color: white;">
  12. <div id="print_content">
  13. <div class="print_main_content">
  14. <div class="order_title_panl">
  15. <span class="main_title">{{ $store.getters.xt_user.org.org_name }}医护排班表</span>
  16. </div>
  17. <div style="text-align:right;margin-bottom:20px;font-size: 18px;">
  18. 打印时间:{{ getNowFormatDate() }}
  19. </div>
  20. <div class="table_panel">
  21. <table class="table">
  22. <thead>
  23. <tr>
  24. <td width="120">医护姓名</td>
  25. <td width="120">周一<br />({{ weekArr[0] }})</td>
  26. <td width="120">周二<br />({{ weekArr[1] }})</td>
  27. <td width="120">周三<br />({{ weekArr[2] }})</td>
  28. <td width="120">周四<br />({{ weekArr[3] }})</td>
  29. <td width="120">周五<br />({{ weekArr[4] }})</td>
  30. <td width="120">周六<br />({{ weekArr[5] }})</td>
  31. <td width="120">周日<br />({{ weekArr[6] }})</td>
  32. <td width="120">调休<br /></td>
  33. <td width="120">加班<br /></td>
  34. <td width="120">累计时数<br /></td>
  35. <td width="120">公休<br /></td>
  36. </tr>
  37. </thead>
  38. <tbody>
  39. <tr v-for='(item,index) in tableData' :key="index">
  40. <td>{{ item.user_name }}</td>
  41. <td>{{ getClass(item.user_name,1) }}</td>
  42. <td>{{ getClass(item.user_name,2) }}</td>
  43. <td>{{ getClass(item.user_name,3) }}</td>
  44. <td>{{ getClass(item.user_name,4) }}</td>
  45. <td>{{ getClass(item.user_name,5) }}</td>
  46. <td>{{ getClass(item.user_name,6) }}</td>
  47. <td>{{ getClass(item.user_name,0) }}</td>
  48. <td></td>
  49. <td></td>
  50. <td></td>
  51. <td></td>
  52. </tr>
  53. </tbody>
  54. </table>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. </div>
  60. </template>
  61. <script>
  62. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  63. import print from 'print-js'
  64. import { getDoctorList,getScheduleByDoctorId } from '@/api/doctorSchedule'
  65. export default {
  66. components:{
  67. BreadCrumb
  68. },
  69. data(){
  70. return{
  71. crumbs: [
  72. { path: false, name: '医护排班' },
  73. { path: false, name: '排班打印' }
  74. ],
  75. start_time:"",
  76. end_time:"",
  77. doctorlist:[],
  78. tableData:[],
  79. arrZero:[],
  80. arrOne:[],
  81. arrTwo:[],
  82. arrThree:[],
  83. arrFour:[],
  84. arrFive:[],
  85. arrSix:[],
  86. arrSeven:[],
  87. typevalue:0,
  88. doctorTableData:[],
  89. nurseTableData:[]
  90. }
  91. },
  92. methods:{
  93. printAction: function() {
  94. const style = '@media print { .print_main_content { background-color: white; width:960px; margin:0 auto; padding: 0 0 20px 0; } .order_title_panl { text-align: center; } .main_title { font-size: 18px; line-height: 40px; font-weight: 500; } .table_panel { } .table { width: 100%; border: 1px solid; border-collapse: collapse; padding: 2px; } thead tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 15px 5px; } tbody tr td { border: 1px solid; text-align: center; font-size: 16px; padding: 10px 5px; white-space: pre-line;} .proj { padding: 5px 0; text-align: left; } .proj_title { font-size: 16px; font-weight: 500; line-height: 25px; } .proj_item { font-size: 15px; line-height: 20px; } .zone_name { font-weight: 500; } }'
  95. printJS({
  96. printable: 'print_content',
  97. type: 'html',
  98. documentTitle: ' ',
  99. style: style,
  100. scanStyles: false
  101. })
  102. },
  103. getDoctorList(){
  104. getDoctorList().then(response=>{
  105. var list = response.data.data.list
  106. this.doctorlist = list
  107. this.getScheduleByDoctorId()
  108. //
  109. var doctorlist = response.data.data.doctorlist
  110. let arr = []
  111. for(let i=0;i<doctorlist.length;i++){
  112. if(doctorlist[i].sort == 0){
  113. doctorlist[i].sort = ""
  114. }
  115. }
  116. console.log('doctorlist',doctorlist)
  117. this.doctorTableData = doctorlist
  118. var nurselist = response.data.data.nurselist
  119. for(let i=0;i<nurselist.length;i++){
  120. if(nurselist[i].sort == 0){
  121. nurselist[i].sort = ""
  122. }
  123. }
  124. this.nurseTableData = nurselist
  125. })
  126. },
  127. //获取本周的所有排班列表
  128. getScheduleByDoctorId(){
  129. const params = {
  130. start_time:this.start_time,
  131. end_time:this.end_time,
  132. doctor_id:this.typevalue,
  133. }
  134. console.log("parasm",params)
  135. getScheduleByDoctorId(params).then(response=>{
  136. if(response.data.state == 1){
  137. var staffList = response.data.data.staffList
  138. console.log("stafflist",staffList)
  139. var sevenStr = ""
  140. var oneStr = ""
  141. var twoStr = ""
  142. var threeStr = ""
  143. var fourStr = ""
  144. var fiveStr = ""
  145. var sixStr = ""
  146. for(let i=0;i<staffList.length;i++){
  147. if(staffList[i].schedule_week == 0){
  148. staffList[i].class_index = 0
  149. var arr = []
  150. this.arrZero.push(staffList[i].class_name)
  151. for(let i=0;i<this.arrZero.length;i++){
  152. if(this.arrZero[i]!=''){
  153. arr.push(this.arrZero[i])
  154. }
  155. }
  156. var countedNames = arr.reduce(function (allNames, name) {
  157. if (name in allNames) {
  158. allNames[name]++;
  159. }
  160. else {
  161. allNames[name] = 1;
  162. }
  163. return allNames;
  164. }, {});
  165. let objKey = Object.keys(countedNames)
  166. let objVal = Object.values(countedNames)
  167. var zeroStr = ''
  168. objKey.map((item,index) => {
  169. let objVal = Object.values(countedNames)
  170. zeroStr += item + objVal[index] + '\n'
  171. })
  172. sevenStr = zeroStr
  173. }
  174. if(staffList[i].schedule_week == 1){
  175. staffList[i].class_index = 1
  176. var arr = []
  177. this.arrOne.push(staffList[i].class_name)
  178. for(let i=0;i<this.arrOne.length;i++){
  179. if(this.arrOne[i]!=''){
  180. arr.push(this.arrOne[i])
  181. }
  182. }
  183. var countedNames = arr.reduce(function (allNames, name) {
  184. if (name in allNames) {
  185. allNames[name]++;
  186. }
  187. else {
  188. allNames[name] = 1;
  189. }
  190. return allNames;
  191. }, {});
  192. let objKey = Object.keys(countedNames)
  193. let objVal = Object.values(countedNames)
  194. let strOne = ''
  195. objKey.map((item,index) => {
  196. let objVal = Object.values(countedNames)
  197. strOne += item + objVal[index] + '\n'
  198. })
  199. oneStr = strOne
  200. }
  201. if(staffList[i].schedule_week == 2){
  202. staffList[i].class_index = 2
  203. var arr = []
  204. this.arrTwo.push(staffList[i].class_name)
  205. for(let i=0;i<this.arrTwo.length;i++){
  206. if(this.arrTwo[i]!=''){
  207. arr.push(this.arrTwo[i])
  208. }
  209. }
  210. var countedNames = arr.reduce(function (allNames, name) {
  211. if (name in allNames) {
  212. allNames[name]++;
  213. }
  214. else {
  215. allNames[name] = 1;
  216. }
  217. return allNames;
  218. }, {});
  219. let objKey = Object.keys(countedNames)
  220. let objVal = Object.values(countedNames)
  221. let strTwo = ''
  222. objKey.map((item,index) => {
  223. let objVal = Object.values(countedNames)
  224. strTwo += item + objVal[index] + '\n'
  225. })
  226. twoStr = strTwo
  227. }
  228. if(staffList[i].schedule_week == 3){
  229. staffList[i].class_index = 3
  230. var arr = []
  231. this.arrThree.push(staffList[i].class_name)
  232. for(let i=0;i<this.arrThree.length;i++){
  233. if(this.arrThree[i]!=''){
  234. arr.push(this.arrThree[i])
  235. }
  236. }
  237. var countedNames = arr.reduce(function (allNames, name) {
  238. if (name in allNames) {
  239. allNames[name]++;
  240. }
  241. else {
  242. allNames[name] = 1;
  243. }
  244. return allNames;
  245. }, {});
  246. let objKey = Object.keys(countedNames)
  247. let objVal = Object.values(countedNames)
  248. let strThree = ''
  249. objKey.map((item,index) => {
  250. let objVal = Object.values(countedNames)
  251. strThree += item + objVal[index] + '\n'
  252. })
  253. threeStr = strThree
  254. }
  255. if(staffList[i].schedule_week == 4){
  256. staffList[i].class_index = 4
  257. var arr = []
  258. this.arrFour.push(staffList[i].class_name)
  259. for(let i=0;i<this.arrFour.length;i++){
  260. if(this.arrFour[i]!=''){
  261. arr.push(this.arrFour[i])
  262. }
  263. }
  264. var countedNames = arr.reduce(function (allNames, name) {
  265. if (name in allNames) {
  266. allNames[name]++;
  267. }
  268. else {
  269. allNames[name] = 1;
  270. }
  271. return allNames;
  272. }, {});
  273. let objKey = Object.keys(countedNames)
  274. let objVal = Object.values(countedNames)
  275. let strFour = ''
  276. objKey.map((item,index) => {
  277. let objVal = Object.values(countedNames)
  278. strFour += item + objVal[index] + '\n'
  279. })
  280. fourStr = strFour
  281. }
  282. if(staffList[i].schedule_week == 5){
  283. staffList[i].class_index = 5
  284. var arr = []
  285. this.arrFive.push(staffList[i].class_name)
  286. for(let i=0;i<this.arrFive.length;i++){
  287. if(this.arrFive[i]!=''){
  288. arr.push(this.arrFive[i])
  289. }
  290. }
  291. var countedNames = arr.reduce(function (allNames, name) {
  292. if (name in allNames) {
  293. allNames[name]++;
  294. }
  295. else {
  296. allNames[name] = 1;
  297. }
  298. return allNames;
  299. }, {});
  300. let objKey = Object.keys(countedNames)
  301. let objVal = Object.values(countedNames)
  302. let strFive = ''
  303. objKey.map((item,index) => {
  304. let objVal = Object.values(countedNames)
  305. strFive += item + objVal[index] + '\n'
  306. })
  307. fiveStr = strFive
  308. }
  309. if(staffList[i].schedule_week == 6){
  310. staffList[i].class_index = 6
  311. var arr = []
  312. this.arrSix.push(staffList[i].class_name)
  313. for(let i=0;i<this.arrSix.length;i++){
  314. if(this.arrSix[i]!=''){
  315. arr.push(this.arrSix[i])
  316. }
  317. }
  318. var countedNames = arr.reduce(function (allNames, name) {
  319. if (name in allNames) {
  320. allNames[name]++;
  321. }
  322. else {
  323. allNames[name] = 1;
  324. }
  325. return allNames;
  326. }, {});
  327. let objKey = Object.keys(countedNames)
  328. let objVal = Object.values(countedNames)
  329. let strSix = ''
  330. objKey.map((item,index) => {
  331. let objVal = Object.values(countedNames)
  332. strSix += item + objVal[index] + '\n'
  333. })
  334. sixStr = strSix
  335. }
  336. }
  337. let tempArr = [], newArr = []
  338. for (let i = 0; i < staffList.length; i++) {
  339. if (tempArr.indexOf(staffList[i].user_name) === -1) {
  340. newArr.push({
  341. user_name: staffList[i].user_name,
  342. admin_user_id:staffList[i].admin_user_id,
  343. user_type:staffList[i].doctor_type,
  344. is_sort:staffList[i].is_sort,
  345. sort:staffList[i].sort,
  346. list: [{class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes}]
  347. })
  348. tempArr.push(staffList[i].user_name);
  349. } else {
  350. for (let j = 0; j < newArr.length; j++) {
  351. if (newArr[j].user_name == staffList[i].user_name) {
  352. newArr[j].list.push({class_name:staffList[i].class_name,admin_user_id:staffList[i].admin_user_id,schedule_week:staffList[i].schedule_week,user_type:staffList[i].doctor_type,class_attributes:staffList[i].class_attributes})
  353. }
  354. }
  355. }
  356. }
  357. let arr = [...newArr]
  358. let newNurse = []
  359. let newDoctor = []
  360. arr.map(item => {
  361. if(item.user_type == 2){
  362. newDoctor.push(item)
  363. }
  364. if(item.user_type == 3){
  365. newNurse.push(item)
  366. }
  367. })
  368. if(this.typevalue == 0){
  369. //护士
  370. newNurse.sort(this.compare('admin_user_id'))
  371. let newNurseTableData = []
  372. this.nurseTableData.map(item => {
  373. if(item.is_sort == 1){
  374. newNurseTableData.push(item)
  375. }
  376. })
  377. newNurseTableData.sort(this.compare('admin_user_id'))
  378. newNurseTableData.map((item,index) => {
  379. if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
  380. }else{
  381. newNurse.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
  382. }
  383. })
  384. newNurse.sort(this.compare('sort'))
  385. //医生
  386. newDoctor.sort(this.compare('admin_user_id'))
  387. let newDoctorTableData = []
  388. this.doctorTableData.map(item => {
  389. if(item.is_sort == 1){
  390. newDoctorTableData.push(item)
  391. }
  392. })
  393. newDoctorTableData.sort(this.compare('admin_user_id'))
  394. newDoctorTableData.map((item,index) => {
  395. if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
  396. }else{
  397. newDoctor.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
  398. }
  399. })
  400. newDoctor.sort(this.compare('sort'))
  401. let arr2 = []
  402. arr2.push({class_name:oneStr,schedule_week:1})
  403. arr2.push({class_name:twoStr,schedule_week:2})
  404. arr2.push({class_name:threeStr,schedule_week:3})
  405. arr2.push({class_name:fourStr,schedule_week:4})
  406. arr2.push({class_name:fiveStr,schedule_week:5})
  407. arr2.push({class_name:sixStr,schedule_week:6})
  408. arr2.push({class_name:zeroStr,schedule_week:0})
  409. var obj = {}
  410. obj.admin_user_id = "1000000"
  411. obj.user_name = "合计"
  412. obj.user_type = 10
  413. obj.list = arr2
  414. arr.push(obj)
  415. let data = []
  416. data.push(...newNurse)
  417. data.push(...newDoctor)
  418. data.push(obj)
  419. this.tableData = data
  420. }
  421. if(this.typevalue == 2){
  422. newDoctor.sort(this.compare('admin_user_id'))
  423. let newDoctorTableData = []
  424. this.doctorTableData.map(item => {
  425. if(item.is_sort == 1){
  426. newDoctorTableData.push(item)
  427. }
  428. })
  429. newDoctorTableData.sort(this.compare('admin_user_id'))
  430. newDoctorTableData.map((item,index) => {
  431. if (newDoctor[index] && item.admin_user_id == newDoctor[index].admin_user_id) {
  432. }else{
  433. newDoctor.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
  434. }
  435. })
  436. newDoctor.sort(this.compare('sort'))
  437. let arr2 = []
  438. arr2.push({class_name:oneStr,schedule_week:1})
  439. arr2.push({class_name:twoStr,schedule_week:2})
  440. arr2.push({class_name:threeStr,schedule_week:3})
  441. arr2.push({class_name:fourStr,schedule_week:4})
  442. arr2.push({class_name:fiveStr,schedule_week:5})
  443. arr2.push({class_name:sixStr,schedule_week:6})
  444. arr2.push({class_name:zeroStr,schedule_week:0})
  445. var obj = {}
  446. obj.admin_user_id = "1000000"
  447. obj.user_name = "合计"
  448. obj.user_type = 10
  449. obj.list = arr2
  450. newDoctor.push(obj)
  451. this.tableData = newDoctor
  452. }
  453. if(this.typevalue == 3){
  454. newNurse.sort(this.compare('admin_user_id'))
  455. let newNurseTableData = []
  456. this.nurseTableData.map(item => {
  457. if(item.is_sort == 1){
  458. newNurseTableData.push(item)
  459. }
  460. })
  461. newNurseTableData.sort(this.compare('admin_user_id'))
  462. newNurseTableData.map((item,index) => {
  463. if (newNurse[index] && item.admin_user_id == newNurse[index].admin_user_id) {
  464. }else{
  465. newNurse.splice(index, 0, {user_name: item.user_name, admin_user_id: item.admin_user_id, list: [],user_type:item.user_type,is_sort:item.is_sort,sort:item.sort})
  466. }
  467. })
  468. newNurse.sort(this.compare('sort'))
  469. let arr2 = []
  470. arr2.push({class_name:oneStr,schedule_week:1})
  471. arr2.push({class_name:twoStr,schedule_week:2})
  472. arr2.push({class_name:threeStr,schedule_week:3})
  473. arr2.push({class_name:fourStr,schedule_week:4})
  474. arr2.push({class_name:fiveStr,schedule_week:5})
  475. arr2.push({class_name:sixStr,schedule_week:6})
  476. arr2.push({class_name:zeroStr,schedule_week:0})
  477. var obj = {}
  478. obj.admin_user_id = "1000000"
  479. obj.user_name = "合计"
  480. obj.user_type = 10
  481. obj.list = arr2
  482. newNurse.push(obj)
  483. this.tableData = newNurse
  484. }
  485. }
  486. })
  487. },
  488. getClass(name,index){
  489. if(name != undefined){
  490. let newClass = '';
  491. this.tableData.map(item => {
  492. if(item.user_name == name){
  493. if(item.list){
  494. item.list.map(it => {
  495. if(it.schedule_week == index){
  496. newClass = it.class_name
  497. }
  498. })
  499. }
  500. }
  501. })
  502. if(newClass && newClass.indexOf("(") > -1){
  503. let num = newClass.indexOf("(")
  504. let a = newClass.slice(0, num) + '\n' + newClass.slice(num)
  505. return a
  506. }else if(newClass && newClass.indexOf("(") > -1) {
  507. let num = newClass.indexOf("(")
  508. let a = newClass.slice(0, num) + '\n' + newClass.slice(num)
  509. return a
  510. }else{
  511. return newClass
  512. }
  513. }
  514. },
  515. getNowFormatDate() {
  516. var date = new Date();
  517. var seperator1 = "-";
  518. var year = date.getFullYear();
  519. var month = date.getMonth() + 1;
  520. var strDate = date.getDate();
  521. if (month >= 1 && month <= 9) {
  522. month = "0" + month;
  523. }
  524. if (strDate >= 0 && strDate <= 9) {
  525. strDate = "0" + strDate;
  526. }
  527. var currentdate = year + seperator1 + month + seperator1 + strDate;
  528. return currentdate;
  529. },
  530. compare(property){
  531. return function(a,b){
  532. var value1 = a[property];
  533. var value2 = b[property];
  534. return value2 - value1;
  535. }
  536. },
  537. },
  538. created(){
  539. var starttime = this.$route.query.starttime
  540. this.start_time = starttime
  541. var endtime = this.$route.query.endtime
  542. this.end_time = endtime
  543. this.weekArr = this.$route.query.weekArr.split(',')
  544. this.typevalue = parseInt(this.$route.query.typeValue)
  545. //获取该机构所有医护人员
  546. this.getDoctorList()
  547. }
  548. }
  549. </script>
  550. <style rel="stylesheet/scss" lang="scss" scoped>
  551. .print_main_content {
  552. background-color: white;
  553. max-width: 1500px;
  554. margin: 0 auto;
  555. padding: 0 0 20px 0;
  556. .order_title_panl {
  557. text-align: center;
  558. .main_title {
  559. font-size: 18px;
  560. line-height: 40px;
  561. font-weight: 500;
  562. }
  563. }
  564. .table_panel {
  565. .table {
  566. width: 100%;
  567. border: 1px solid;
  568. border-collapse: collapse;
  569. padding: 2px;
  570. thead {
  571. tr {
  572. td {
  573. border: 1px solid;
  574. text-align: center;
  575. font-size: 18px;
  576. padding: 15px 5px;
  577. }
  578. }
  579. }
  580. tbody {
  581. tr {
  582. td {
  583. border: 1px solid;
  584. text-align: center;
  585. font-size: 18px;
  586. padding: 10px 5px;
  587. white-space: pre-line;
  588. .proj {
  589. padding: 5px 0;
  590. text-align: left;
  591. .proj_title {
  592. font-size: 16px;
  593. font-weight: 500;
  594. line-height: 25px;
  595. }
  596. .proj_item {
  597. font-size: 15px;
  598. line-height: 20px;
  599. .zone_name {
  600. font-weight: 500;
  601. }
  602. }
  603. }
  604. }
  605. }
  606. }
  607. }
  608. }
  609. }
  610. </style>