123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436 |
- <template>
- <div class="main-contain">
- <div class="position">
- <bread-crumb :crumbs='crumbs'></bread-crumb>
- <el-button :loading="loading" size="small" icon="el-icon-printer" @click="printThisPage" type="primary">打印
- </el-button>
- </div>
- <div class="app-container ">
- <div id="dialysis-print-box">
- <div class="dialysis-print-order">
- <div class="order-yy-name">{{orgname}}</div>
- <div class="order-title">入库单</div>
- <div style="float: left;margin-bottom: 10px;">{{getDateOne()}}</div>
- <div style="float: right;margin-bottom: 10px;">{{getDateTwo()}}</div>
-
- <table class="print-table" border="1">
- <tbody>
- <tr>
- <td style="line-height: 50px" width="50">序号</td>
- <td style="line-height: 50px" width="250">药品名称</td>
- <td style="line-height: 50px" width="250">规格型号</td>
- <td style="line-height: 50px" width="50">单位</td>
- <td style="line-height: 50px" width="80">数量</td>
- <td style="line-height:50px" width="80">单价</td>
- <td style="line-height:50px" width="80">总价</td>
- <td style="line-height: 50px" width="">备 注</td>
- </tr>
-
- <tr v-for="(item,index) in cancelStockDate" :key="item.id">
- <td style="line-height: 50px">
- {{index+1}}
- </td>
- <td style="line-height: 50px">
- <span>{{item.XtBaseDrug.drug_name}}</span>
- </td>
- <td style="line-height: 50px">
- <!-- <span>{{item.drug_spec}}</span> -->
- <span>{{item.XtBaseDrug.dose}}{{item.XtBaseDrug.dose_unit}}*{{item.XtBaseDrug.min_number}}{{item.XtBaseDrug.min_unit}}/{{item.XtBaseDrug.max_unit}}</span>
- </td>
- <td style="line-height: 50px">
- <span>{{item.XtBaseDrug.min_unit}}</span>
- </td>
-
- <td style="line-height: 50px">
- {{getCount(item.drug_id)}}
- </td>
- <td style="line-height:50px">
- {{item.price}}
- </td>
- <td style="line-height:50px">
- {{(getCount(item.drug_id)*item.price).toFixed(2)}}
- </td>
- <td style="line-height: 50px">
- {{item.remark}}
- </td>
- </tr>
- </tbody>
- </table>
- <table class="print-table" border="1">
- <tbody>
- <tr>
- <td width="633" style="line-height: 50px">合计</td>
- <td width="80" style="line-height: 50px">{{getTotal().toFixed(2)}}</td>
- <td></td>
- </tr>
-
- </tbody>
- </table>
-
- <div style="display:flex;margin-top:20px;float:right;">
- <div style="width:50px;">审批:</div><div style="width:100px;"></div>
- <div style="width:80px;">药材主任:</div><div style="width:100px;"></div>
- <div style="width:50px;">会计:</div><div style="width:100px;"></div>
- <div style="width:50px;">审核:</div><div style="width:100px;"></div>
- <div style="width:70px;">制单人:</div><div style="width:100px;"></div>
- </div>
- </div>
-
- </div>
-
- </div>
- </div>
-
- </template>
-
- <script>
- import { getPrintStockGood } from '@/api/stock'
- import { getDataConfig } from '@/utils/data'
- import { jsGetAge, uParseTime } from '@/utils/tools'
- import BreadCrumb from '@/xt_pages/components/bread-crumb'
- import print from 'print-js'
- import { getDrugIndetail,getDrugWarehouseInfoPrint,getDrugCountList} from "@/api/drug/drug_stock"
- export default {
- name: 'dialysisPrintOrder',
- components: {
- BreadCrumb
-
- },
- data() {
- return {
- crumbs: [
- { path: false, name: '出入库明细' },
- { path: false, name: '打印单' }
- ],
- loading: false,
- orgname: '',
- totalPrice: 0,
- stockDatas: [],
- goodUnit: [],
- start_time: this.$route.query.start_time,
- end_time: this.$route.query.end_time,
- order_type:this.$route.query.order_type,
- manufacturer_id:this.$route.query.manufacturer_id,
- keyword:this.$route.query.keyword,
- limit:this.$route.query.limit,
- page:this.$route.query.page,
- cancelStockDate:[],
- minCount:[],
- }
- },
- methods: {
- getDateOne(){
- return "入库日期: "+this.start_time +"~"+this.end_time
- },
- getDateTwo(){
- var ptime = Math.round(new Date().getTime() / 1000)
- return "打印单日期:"+uParseTime(ptime, '{y}-{m}-{d}')
- },
- getTime(value, temp) {
- if (value == 0) {
- return ''
- }
- if (value != undefined) {
- return uParseTime(value, temp)
- }
- return ''
- },
- printThisPage() {
- var ptime = Math.round(new Date().getTime() / 1000)
- this.print_time = uParseTime(ptime, '{y}-{m}-{d} {h}:{i}')
- 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: 0px 0px;} .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;}'
- printJS({
- printable: 'dialysis-print-box',
- type: 'html',
- style: style,
- scanStyles: false
- })
- },
-
- getUnit(id){
- var name = ""
- for(let i=0;i<this.goodUnit.length;i++){
- if(this.goodUnit[i].id == id){
- name = this.goodUnit[i].name
- }
- }
- return name
- },
- getlist(){
- var params = {
- start_time:this.start_time,
- end_time:this.end_time,
- order_type:this.order_type,
- manufacturer_id:this.manufacturer_id,
- keyword:this.searchKey,
- limit:this.limit,
- page:this.page,
- }
- getDrugIndetail(params).then(response=>{
- if(response.data.state == 1){
- var drugInOrder = response.data.data.detail
- console.log("drug3434444",drugInOrder)
-
- let objInfo = {}
- drugInOrder.forEach((item,index)=>{
- let { drug_id } = item
- if(!objInfo[drug_id]){
- objInfo[drug_id] = {
- drug_id,
- child:[],
- drug_name:item.drug_name,
- drug_spec:item.drug_spec,
- min_unit:item.min_unit,
- warehousing_count:0,
- price:item.price,
- remark:item.remark,
- dose:item.dose,
- dose_unit:item.dose_unit,
- min_number:item.min_number,
- max_unit:item.max_unit
- }
- }
- })
- let list = Object.values(objInfo);
- console.log("list22333333",list)
- for(let i=0;i<drugInOrder.length;i++){
- list.map(item=>{
- if(drugInOrder[i].drug_id == item.drug_id){
- item.child.push(drugInOrder[i])
- }
- })
- }
- console.log("list2334444",list)
- for(let i=0;i<list.length;i++){
- for(let j=0;j<list[i].child.length;j++){
- if(list[i].child[j].warehousing_count!=null || list[i].child[j].warehousing_count != "" || list[i].child[j].warehousing_count!=0){
- list[i].warehousing_count += list[i].child[j].warehousing_count
- }
- }
- }
- // console.log("list666666666",list)
- this.cancelStockDate = list
- var total = response.data.data.total
- this.total = total
- }
- })
- },
-
- getTotal(){
- var total = 0
- for(let i=0;i<this.cancelStockDate.length;i++){
- total += this.cancelStockDate[i].price*getCount(this.cancelStockDate[i].drug_id)
- }
- return total
- },
- getDrugWarehouseInfoPrint(){
- var params = {
- start_time:this.start_time,
- end_time:this.end_time,
- order_type:this.order_type,
- }
- console.log("params2222",params)
- getDrugWarehouseInfoPrint(params).then(response=>{
- if(response.data.state == 1){
- var list = response.data.data.list
- console.log("入库单详情",list)
- this.cancelStockDate = list
- }
- })
-
-
- },
- getCount(drug_id){
- var total = 0
- for(let i=0;i<this.minCount.length;i++){
- if(drug_id == this.minCount[i].drug_id){
- total += this.minCount[i].warehousing_count
- }
- }
- return total
- },
- getDrugCountList(){
- var params = {
- keyword: this.keywords,
- start_time:this.start_time,
- end_time:this.end_time,
- }
- console.log("paramsw2ww",params)
- getDrugCountList(params).then(response=>{
- if(response.data.state == 1){
- var minCount = response.data.data.minCount
- console.log("minCount",minCount)
- this.minCount = minCount
-
- }
- })
- },
- },
- created() {
- var xtuser = this.$store.getters.xt_user
- this.orgname = xtuser.org.org_name
- // this.getlist()
-
-
- this.getDrugWarehouseInfoPrint()
- this.getDrugCountList()
-
- }
-
- }
- </script>
-
- <style>
- .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: 40px;
- 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;
- }
-
- .dialysis-print-order .radio-lebel-box {
- font-weight: 400;
- cursor: pointer;
- }
-
- .dialysis-print-order .radio-no {
- opacity: 0;
- outline: none;
- position: absolute;
- margin: 0;
- width: 0;
- height: 0;
- z-index: -1;
- }
-
- .dialysis-print-order .radio-inner {
- white-space: nowrap;
- cursor: pointer;
- outline: none;
- 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;
- }
-
- .dialysis-print-order .print-table tr td {
- padding: 1px 1px;
- /*line-height: 25px;*/
- }
-
- .es-img {
- height: 25px;
- }
-
- .advice-name {
- text-align: left;
- }
-
- .advice-children {
- display: flex;
- }
-
- .title-box-pro {
- border: 0 #fff;
- line-height: 25px;
- height: 25px;
- text-align: left;
- padding-left: 10px !important;
- }
-
- .title-box-pro-tr {
- border: 0 #fff;
- }
-
- .text-align-left {
- text-align: left !important;
- padding-left: 10px !important;
- font-size: 14px !important;
- line-height: 25px;
- }
-
- .print-table-tr-new td {
- line-height: 20px !important;
- }
-
- .border-top-solid {
- border: solid 1px #000;
- }
-
- .print-template-two tr {
- line-height: 30px;
- }
- </style>
|