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

drugStockInOrderDetailPrint.vue 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs='crumbs'></bread-crumb>
  5. <el-button size="small" icon="el-icon-printer" @click="printThisPage" type="primary">打印
  6. </el-button>
  7. </div>
  8. <div class="app-container ">
  9. <div id="dialysis-print-box">
  10. <div class="dialysis-print-order" v-for="(it,index) in tableList" :key="index">
  11. <div style="font-size:22px;font-weight:bold;text-align:center;margin-top:40px">{{ orgName }}</div>
  12. <div class="order-title" style="font-size:18px;padding-top:0;">药品入库登记表</div>
  13. <div style="float: left;margin-bottom: 1px;">单据编号:{{it.warehousing_order}}</div>
  14. <div style="float: right;margin-bottom: 1px;">{{getDateTwo()}}</div>
  15. <table class="print-table" border="1">
  16. <tbody>
  17. <tr>
  18. <td width="80">药品名称</td>
  19. <td style="line-height:18px;" width="80">注册证号/批准文号/备案凭证号</td>
  20. <td style="line-height:18px;" width="100">规格<br>型号</td>
  21. <td style="line-height:18px;" width="80">生产<br>厂商</td>
  22. <td style="line-height:18px;" width="80">经销商</td>
  23. <td style="line-height:18px;" width="80">进货价</td>
  24. <td style="line-height:18px;" width="80">入库<br>数量</td>
  25. <td style="line-height:18px;" width="80">单位</td>
  26. <td style="line-height:18px;" width="60">总价</td>
  27. <td style="line-height:18px;" width="80">批号</td>
  28. <td style="line-height:18px;" width="120">生产日期</td>
  29. <td style="line-height:18px;" width="120">有效日期</td>
  30. <td style="line-height:18px;" width="120">入库日期</td>
  31. <td style="line-height:18px;" width="60">质检<br>意见</td>
  32. <td style="line-height:18px;" width="60">验收<br>结论</td>
  33. </tr>
  34. <tr v-for="(item,i) in it.child" :key="i">
  35. <td style="line-height: 18px">
  36. <span v-if="item.drug_id != 0">{{item.drug_name}}</span>
  37. </td>
  38. <td style="line-height: 18px">{{ item.batch_number }}</td>
  39. <td style="line-height: 18px">
  40. <span v-if="item.drug_id != 0">{{item.dose}}{{item.dose_unit}}*{{item.min_number}}{{item.min_unit}}/{{item.max_unit}}</span>
  41. </td>
  42. <td style="line-height: 18px">{{ getManufacturer(item.manufacturer) }}</td>
  43. <td style="line-height: 18px">{{ getDeatl(item.dealer) }}</td>
  44. <td style="line-height:18px">
  45. {{item.price}}
  46. </td>
  47. <td style="line-height: 18px">
  48. <span>{{ item.warehousing_count }}</span>
  49. </td>
  50. <td style="line-height: 18px">
  51. <span>{{item.max_unit}}</span>
  52. </td>
  53. <td style="line-height:18px">
  54. <span>{{(item.warehousing_count * item.price).toFixed(2)}}</span>
  55. </td>
  56. <td style="line-height:18px">{{ item.batch_number }}</td>
  57. <td style="line-height:18px">{{ getTime(item.product_date,'{y}-{m}-{d}')}}</td>
  58. <td style="line-height:18px">{{ getTime(item.expiry_date,'{y}-{m}-{d}')}}</td>
  59. <td style="line-height:18px">{{ getTime(it.ctime,'{y}-{m}-{d}')}}</td>
  60. <td style="line-height:18px">正常<br>入库</td>
  61. <td style="line-height:18px">合格</td>
  62. </tr>
  63. <tr>
  64. <td>合计</td>
  65. <td colspan="7" style="text-align:center"></td>
  66. <td style="text-align:center">{{getAllPrince(it.id).toFixed(2)}}</td>
  67. <td colspan="6" style="text-align:center"></td>
  68. </tr>
  69. </tbody>
  70. </table>
  71. <div style="display:flex;margin-top:1px;float:right;" v-if="orgId == 10024">
  72. <div style="width:50px;">审批:</div><div style="width:100px;"></div>
  73. <div style="width:50px;">会计:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
  74. <div style="width:50px;">审核:</div><div style="width:100px;"><span v-if='orgId == 10024'>徐立琼</span></div>
  75. <div style="width:70px;">制单人:</div><div style="width:100px;">{{ getXuserName(it.creater) }}</div>
  76. </div>
  77. <div style="display:flex;margin-top:1px;float:right;" v-if="orgId !=10024">
  78. <div style="width:50px;">审批:</div><div style="width:100px;"></div>
  79. <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
  80. <div style="width:50px;">会计:</div><div style="width:100px;"></div>
  81. <div style="width:70px;">制单人:</div><div style="width:100px;">{{ getXuserName(it.creater) }}</div>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. </template>
  88. <script>
  89. import { GetAllConfig,getPrintStockGood } from '@/api/stock'
  90. import { getDataConfig } from '@/utils/data'
  91. import { jsGetAge, uParseTime } from '@/utils/tools'
  92. import BreadCrumb from '@/xt_pages/components/bread-crumb'
  93. import print from 'print-js'
  94. import {getDrugWarehouseInfoList,getDrugOrderInPrint} from "@/api/drug/drug_stock";
  95. import {getBaseDrugLibList} from '@/api/data'
  96. import { fetchAllAdminUsers } from "@/api/doctor";
  97. export default {
  98. name: 'dialysisPrintOrder',
  99. components: {
  100. BreadCrumb
  101. },
  102. data() {
  103. return {
  104. crumbs: [
  105. { path: false, name: '出入库明细' },
  106. { path: false, name: '打印单' }
  107. ],
  108. isEdit: 0,
  109. checked: false,
  110. signAndWeighBoxPatients: "sign-and-weigh-box-patients",
  111. goodType: [],
  112. goodInfo: [],
  113. manufacturer: [],
  114. dealer: [],
  115. Warehouse: {
  116. loading: false,
  117. warehouseDate: [],
  118. tableCurrentIndex: ""
  119. },
  120. WarehouseInfo: {
  121. loading: false,
  122. warehouseInfoDate: [],
  123. warehouse: {}
  124. },
  125. allPrice:0,
  126. start_time:"",
  127. end_time:"",
  128. list:[],
  129. is_use:"",
  130. is_charge:"",
  131. is_inject:"",
  132. page:1,
  133. limit:10000,
  134. keywords:"",
  135. orgName:'',
  136. orgId:'',
  137. adminUserOptions:[],
  138. tableList:[],
  139. manufacturerList:[],
  140. warehouseList:[]
  141. }
  142. },
  143. methods: {
  144. getTime(val) {
  145. if(val < 0){
  146. return ""
  147. }
  148. if(val == ""){
  149. return ""
  150. }else {
  151. return uParseTime(val, '{y}-{m}-{d}')
  152. }
  153. },
  154. getDateOne(){
  155. return "入库日期: "+this.start_time +"~"+this.end_time
  156. },
  157. getDateTwo(){
  158. var ptime = Math.round(new Date().getTime() / 1000)
  159. return "打印单日期:"+uParseTime(ptime, '{y}-{m}-{d}')
  160. },
  161. getTime(value, temp) {
  162. if (value == 0) {
  163. return ''
  164. }
  165. if (value != undefined) {
  166. return uParseTime(value, temp)
  167. }
  168. return ''
  169. },
  170. printThisPage() {
  171. var ptime = Math.round(new Date().getTime() / 1000)
  172. this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}')
  173. const style = '@media print {.dialysis-print-order{width:960px;margin:0 auto}.dialysis-print-order .order-yy-name{margin:auto;text-align:center;font-size:20px;letter-spacing:5px}.dialysis-print-order .order-title{margin:auto;font-weight:600;text-align:center;font-size:22px;padding:10px 20px 20px 20px} .dialysis-print-order .table-box{width:100%;line-height:23px;font-size:14px}.dialysis-print-order .print-table{width:100%;text-align:center;border-collapse:collapse;line-height:25px;font-size:14px}.dialysis-print-order .print-table-no{width:100%;text-align:center;border-collapse:collapse;font-size:14px}.dialysis-print-order .under-line{border-bottom:1px solid #999;width:95%;text-align:center;margin-left:2px}.dialysis-print-order .title-box{text-align:center;font-size:16px;border:1px solid #666}.dialysis-print-order .radio-lebel-box{font-weight:400;cursor:pointer}.dialysis-print-order .radio-no{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.dialysis-print-order .radio-inner{white-space:nowrap;cursor:pointer;outline:0;display:inline-block;line-height:1;position:relative;vertical-align:middle}.dialysis-print-order .radio-fang{display:inline-block;position:relative;border:1px solid #000;box-sizing:border-box;width:14px;height:14px;background-color:#fff;z-index:1;transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.dialysis-print-order .is-checked-radio::after{content:"√";font-size:15px}}.dialysis-print-order .print-table-no tr td { padding: 8px 5px; line-height: 25px; }.es-img{height: 20px; }.advice-name{text-align: left;}.advice-children{display:flex;} .dialysis-print-order .print-table tr td{padding: 1px 5px;} .print-template-two tr {line-height: 30px;} .title-box-pro{border: 0 #fff;line-height: 40px;height: 40px;text-align: left;padding-left: 10px !important;} .text-align-left{text-align: left !important;padding-left:10px !important;font-size: 14px !important;line-height: 25px;}'
  174. printJS({
  175. printable: 'dialysis-print-box',
  176. type: 'html',
  177. style: style,
  178. scanStyles: false
  179. })
  180. },
  181. getUnit(id){
  182. var name = ""
  183. for(let i=0;i<this.goodUnit.length;i++){
  184. if(this.goodUnit[i].id == id){
  185. name = this.goodUnit[i].name
  186. }
  187. }
  188. return name
  189. },
  190. GetOrderDetail: function(order_id) {
  191. const params = {
  192. id: order_id
  193. };
  194. getDrugWarehouseInfoList(params).then(response => {
  195. if (response.data.state == 0) {
  196. this.$message.error(response.data.msg);
  197. return false;
  198. } else {
  199. for (let i = 0; i < response.data.data.info.length; i++) {
  200. this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
  201. }
  202. console.log("数据源",this.WarehouseInfo.warehouseInfoDate)
  203. var total_price = 0
  204. for(let i=0;i<this.WarehouseInfo.warehouseInfoDate.length;i++){
  205. total_price += this.WarehouseInfo.warehouseInfoDate[i].warehousing_count * this.WarehouseInfo.warehouseInfoDate[i].price
  206. }
  207. console.log("total_price",total_price)
  208. this.allPrice = total_price
  209. this.WarehouseInfo.warehouse = response.data.data.warehousing;
  210. }
  211. });
  212. },
  213. getList() {
  214. let params = {
  215. page: this.page,
  216. limit: this.limit,
  217. keyword: this.keywords,
  218. is_use: this.is_use,
  219. is_charge: this.is_charge,
  220. is_inject: this.is_inject
  221. }
  222. getBaseDrugLibList(params).then(response => {
  223. if (response.data.state == 0) {
  224. this.$message.error(response.data.msg)
  225. return false
  226. } else {
  227. this.total = response.data.data.total
  228. this.list = []
  229. for (let i = 0; i < response.data.data.list.length; i++) {
  230. this.list.push(response.data.data.list[i])
  231. }
  232. for(let j=0;j<this.list.length;j++){
  233. this.list[j].manufacturer_name = ""
  234. }
  235. for(let i=0;i<this.list.length;i++){
  236. for(let j=0;j<this.manufacturer.length;j++){
  237. if(this.list[i].manufacturer == this.manufacturer[j].id){
  238. this.list[i].manufacturer_name = this.manufacturer[j].manufacturer_name
  239. }
  240. }
  241. }
  242. console.log("list222222",this.list)
  243. }
  244. })
  245. },
  246. getUnit(id){
  247. var name = ""
  248. for(let i=0;i<this.list.length;i++){
  249. if(this.list[i].id == id){
  250. name = this.list[i].min_unit
  251. }
  252. }
  253. return name
  254. },
  255. getManufacturer(id){
  256. let name = ""
  257. for(let i=0;i<this.manufacturerList.length;i++){
  258. if(id == this.manufacturerList[i].id){
  259. name = this.manufacturerList[i].manufacturer_name
  260. }
  261. }
  262. return name
  263. },
  264. GetConfigInfo: function() {
  265. GetAllConfig().then(response => {
  266. if (response.data.state == 0) {
  267. this.$message.error(response.data.msg);
  268. return false;
  269. } else {
  270. this.manufacturer = response.data.data.manufacturer;
  271. this.dealer = response.data.data.dealer
  272. this.getList()
  273. }
  274. });
  275. },
  276. fetchAllAdminUsers() {
  277. fetchAllAdminUsers().then(response => {
  278. console.log(response);
  279. if (response.data.state == 1) {
  280. this.adminUserOptions = response.data.data.users;
  281. var alen = this.adminUserOptions.length;
  282. for (let index = 0; index < alen; index++) {
  283. if (this.adminUserOptions[index].user_type == 2) {
  284. // this.doctorOptions.push(this.adminUserOptions[index]);
  285. }
  286. }
  287. }
  288. });
  289. },
  290. getXuserName(id) {
  291. if (id <= 0) {
  292. return "";
  293. }
  294. var name = "";
  295. if (
  296. this.adminUserOptions == null ||
  297. typeof this.adminUserOptions.length === "undefined"
  298. ) {
  299. return name;
  300. }
  301. var leng = this.adminUserOptions.length;
  302. if (leng == 0) {
  303. return name;
  304. }
  305. for (let index = 0; index < leng; index++) {
  306. if (this.adminUserOptions[index].id == id) {
  307. name = this.adminUserOptions[index].name;
  308. break;
  309. }
  310. }
  311. return name;
  312. },
  313. getDrugOrderInPrint(order_id){
  314. const params = {
  315. id:order_id
  316. };
  317. getDrugOrderInPrint(params).then(response=>{
  318. if(response.data.state == 1){
  319. var info = response.data.data.info
  320. console.log("info22233444444",info)
  321. var warehousing = response.data.data.warehousing
  322. console.log("hhhhshdfh",warehousing)
  323. this.warehouseList = warehousing
  324. for(let i=0;i<info.length;i++){
  325. info[i].child = []
  326. for(let j=0;j<warehousing.length;j++){
  327. if(info[i].id == warehousing[j].warehousing_id){
  328. info[i].child.push(warehousing[j])
  329. }
  330. }
  331. }
  332. console.log("infor2222",info)
  333. this.tableList = info
  334. var manufacturerList = response.data.data.manufacturerList
  335. console.log("manufacturerList",manufacturerList)
  336. this.manufacturerList = manufacturerList
  337. }
  338. })
  339. },
  340. getAllPrince(id){
  341. var count = 0
  342. for(let i=0;i<this.warehouseList.length;i++){
  343. if(id == this.warehouseList[i].warehousing_id){
  344. count +=this.warehouseList[i].warehousing_count * this.warehouseList[i].price
  345. }
  346. }
  347. return count
  348. },
  349. getDeatl(id){
  350. var dealer_name = ""
  351. for(let i=0;i<this.dealer.length;i++){
  352. if(id == this.dealer[i].id){
  353. dealer_name = this.dealer[i].dealer_name
  354. }
  355. }
  356. return dealer_name
  357. }
  358. },
  359. created() {
  360. this.orgName = this.$store.getters.xt_user.org.org_name;
  361. this.orgId = this.$store.getters.xt_user.org.id;
  362. this.fetchAllAdminUsers()
  363. this.GetConfigInfo()
  364. const order_id = this.$route.query.id;
  365. this.getList()
  366. this.getDrugOrderInPrint(order_id)
  367. }
  368. }
  369. </script>
  370. <style>
  371. .dialysis-print-order {
  372. width: 960px;
  373. margin: 0 auto
  374. }
  375. .dialysis-print-order .order-yy-name {
  376. margin: auto;
  377. text-align: center;
  378. font-size: 20px;
  379. letter-spacing: 5px;
  380. }
  381. .dialysis-print-order .order-title {
  382. margin: auto;
  383. font-weight: 600;
  384. text-align: center;
  385. font-size: 22px;
  386. padding: 10px 20px 20px 20px;
  387. }
  388. .dialysis-print-order .table-box {
  389. width: 100%;
  390. line-height: 23px;
  391. font-size: 14px;
  392. }
  393. .dialysis-print-order .print-table {
  394. width: 100%;
  395. text-align: center;
  396. border-collapse: collapse;
  397. line-height: 40px;
  398. font-size: 14px;
  399. }
  400. .dialysis-print-order .print-table-no {
  401. width: 100%;
  402. text-align: center;
  403. border-collapse: collapse;
  404. font-size: 14px;
  405. }
  406. .dialysis-print-order .under-line {
  407. border-bottom: 1px solid #999;
  408. width: 95%;
  409. text-align: center;
  410. margin-left: 2px;
  411. }
  412. .dialysis-print-order .title-box {
  413. text-align: center;
  414. font-size: 16px;
  415. }
  416. .dialysis-print-order .radio-lebel-box {
  417. font-weight: 400;
  418. cursor: pointer;
  419. }
  420. .dialysis-print-order .radio-no {
  421. opacity: 0;
  422. outline: none;
  423. position: absolute;
  424. margin: 0;
  425. width: 0;
  426. height: 0;
  427. z-index: -1;
  428. }
  429. .dialysis-print-order .radio-inner {
  430. white-space: nowrap;
  431. cursor: pointer;
  432. outline: none;
  433. display: inline-block;
  434. line-height: 1;
  435. position: relative;
  436. vertical-align: middle;
  437. }
  438. .dialysis-print-order .radio-fang {
  439. display: inline-block;
  440. position: relative;
  441. border: 1px solid #000;
  442. box-sizing: border-box;
  443. width: 14px;
  444. height: 14px;
  445. background-color: #fff;
  446. z-index: 1;
  447. transition: border-color .25s cubic-bezier(.71, -.46, .29, 1.46), background-color .25s cubic-bezier(.71, -.46, .29, 1.46);
  448. }
  449. .dialysis-print-order .is-checked-radio::after {
  450. content: "√";
  451. font-size: 15px;
  452. }
  453. .dialysis-print-order .print-table-no tr td {
  454. padding: 8px 5px;
  455. line-height: 25px;
  456. }
  457. .dialysis-print-order .print-table tr td {
  458. padding: 1px 1px;
  459. /*line-height: 25px;*/
  460. }
  461. .es-img {
  462. height: 25px;
  463. }
  464. .advice-name {
  465. text-align: left;
  466. }
  467. .advice-children {
  468. display: flex;
  469. }
  470. .title-box-pro {
  471. border: 0 #fff;
  472. line-height: 25px;
  473. height: 25px;
  474. text-align: left;
  475. padding-left: 10px !important;
  476. }
  477. .title-box-pro-tr {
  478. border: 0 #fff;
  479. }
  480. .text-align-left {
  481. text-align: left !important;
  482. padding-left: 10px !important;
  483. font-size: 14px !important;
  484. line-height: 25px;
  485. }
  486. .print-table-tr-new td {
  487. line-height: 20px !important;
  488. }
  489. .border-top-solid {
  490. border: solid 1px #000;
  491. }
  492. .print-template-two tr {
  493. line-height: 30px;
  494. }
  495. </style>