123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513 |
- <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" v-for="(it,index) in tableList" :key="index">
- <div class="order-yy-name" style="font-size:22px;font-weight:bold;letter-spacing:0px;margin-top:40px">{{orgName}}</div>
- <div class="order-title" style="font-weight:500;font-size:18px;">药品出库登记表</div>
-
- <div style="float: left;margin-bottom: 1px;">单据编号:{{it.warehouse_out_order_number}}</div>
- <div style="float: right;margin-bottom: 1px;">{{getDateTwo()}}</div>
-
- <table class="print-table" border="1">
- <tbody>
- <tr>
- <td style="line-height: 50px" width="230">药品名称</td>
- <td style="line-height: 50px" width="230">规格型号</td>
- <td style="line-height: 50px" width="80">出货数量</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="80">生产日期</td>
- <td style="line-height: 50px" width="80">有效日期</td>
- </tr>
-
- <tr v-for="(item,i) in it.child" :key="i">
- <td style="line-height: 50px">
- <span v-if="item.drug_id != 0">{{item.drug_name}}</span>
- </td>
- <td style="line-height: 50px">
- <span v-if="item.drug_id != 0">{{item.dose}}{{item.dose_unit}}*{{item.min_number}}{{item.min_unit}}/{{item.max_unit}}</span>
- </td>
- <td style="line-height: 50px">
- {{item.count}}
- </td>
- <td style="line-height: 50px">
- <span>{{item.count_unit}}</span>
- </td>
- <td style="line-height:50px">
- {{item.last_price}}
- </td>
- <td style="line-height:50px">
- {{(item.count * item.last_price).toFixed(2)}}
- </td>
- <td>{{item.batch_number}}</td>
- <td>{{(getTime(item.product_date))}}</td>
- <td>{{(getTime(item.expiry_date))}}</td>
- </tr>
- <tr>
- <td style="line-height:50px">合计</td>
- <td colspan="7"></td>
- <td>{{getAllPrince(it.id).toFixed(2)}}</td>
- </tr>
- </tbody>
- </table>
-
-
- <div v-if="orgId != 10024" style="display:flex;margin-top:1px;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 v-if="orgId == 10024" style="display:flex;margin-top:1px;float:right;">
- <div style="width:50px;">科室:</div><div style="width:60px;"></div>
- <div style="width:70px;">领料人:</div><div style="width:60px;"></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 { getDrugWarehouseOutInfo,getDrugWarehouseOrderInfo,getDrugOutOrderDetailPrint } from '@/api/drug/drug_stock'
- import {getBaseDrugLibList} from '@/api/data'
- export default {
- name: 'dialysisPrintOrder',
- components: {
- BreadCrumb
-
- },
- data() {
- return {
- crumbs: [
- { path: false, name: '出入库明细' },
- { path: false, name: '打印单' }
- ],
- isEdit: 0,
- checked: false,
- signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
- goodType: [],
- goodInfo: [],
- manufacturer: [],
- dealer: [],
-
- warehousingOutInfo: {
- loading: false,
- warehousingOutData: [],
- info: {}
- },
- allPrice:0,
- start_time:"",
- end_time:"",
- list:[],
- is_use:"",
- is_charge:"",
- is_inject:"",
- page:1,
- limit:10000,
- keywords:"",
- orgId:'',
- orgName:"",
- drugOrderList:[],
- manufactureList:[],
- tableList:[],
- loading:false,
- warehouseList:[]
- }
- },
- methods: {
- 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;font-weight:bold;}.dialysis-print-order .order-title{margin:auto;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
- },
- GetOrderDetail: function(order_id) {
- const params = {
- 'id': order_id
- };
- getDrugWarehouseOutInfo(params).then(response => {
- if (response.data.state == 0) {
-
- this.$message.error(response.data.msg);
- return false
- } else {
- for (let i = 0; i < response.data.data.list.length; i++) {
- this.warehousingOutInfo.warehousingOutData.push(response.data.data.list[i])
- }
- var total_price = 0;
- for(let i=0;i<this.warehousingOutInfo.warehousingOutData.length;i++){
- total_price += this.warehousingOutInfo.warehousingOutData[i].count * this.warehousingOutInfo.warehousingOutData[i].price
- }
- this.allPrice = total_price;
- this.warehousingOutInfo.info = response.data.data.info;
- this.handleSpanTempArr()
- }
- })
- },
- getList() {
- let params = {
- page: this.page,
- limit: this.limit,
- keyword: this.keywords,
- is_use: this.is_use,
- is_charge: this.is_charge,
- is_inject: this.is_inject
- };
- getBaseDrugLibList(params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false
- } else {
- this.total = response.data.data.total;
- this.list = [];
- for (let i = 0; i < response.data.data.list.length; i++) {
- this.list.push(response.data.data.list[i])
- }
- console.log("list222222",this.list)
- }
- })
- },
- getUnit(id){
- var name = "";
- for(let i=0;i<this.list.length;i++){
- if(this.list[i].id == id){
- name = this.list[i].min_unit
- }
- }
- return name
- },
- handleSpanTempArr(){
- this.tempArr = [];
-
- for (let i = 0; i < this.warehousingOutInfo.warehousingOutData.length; i++) {
- if (i === 0) {
- this.tempArr.push(1);
- this.pos = 0
- } else {
- // 判断当前元素与上一个元素是否相同
- if (this.warehousingOutInfo.warehousingOutData[i].drug_id === this.warehousingOutInfo.warehousingOutData[i - 1].drug_id) {
- this.tempArr[this.pos] += 1;
- this.tempArr.push(0)
- } else {
- this.tempArr.push(1);
- this.pos = i
- }
- }
- }
-
- let sameRowArr = [], sIdx = 0;
- this.warehousingOutInfo.warehousingOutData.forEach((item, index) => {
- item.index = index;
- if (index === 0) {
- sameRowArr.push([index])
- } else {
- if (item.drug_id === this.warehousingOutInfo.warehousingOutData[index - 1].drug_id) {
- sameRowArr[sIdx].push(index)
- } else {
- sIdx = sIdx + 1;
- sameRowArr.push([index])
- }
- }
- });
- this.sameRowArr = sameRowArr
- },
- getDrugWarehouseOrderInfo(){
- getDrugWarehouseOrderInfo().then(response=>{
- if(response.data.state == 1){
- var list = response.data.data.list
- console.log("入库单详情",list)
- this.drugOrderList = list
- }
- })
- },
- getNumber(id){
- var number = ""
- for(let i=0;i<this.drugOrderList.length;i++){
- if(id == this.drugOrderList[i].drug_id){
- number = this.drugOrderList[i].number
- }
- }
- return number
- },
- getProductDate(id){
- var product_date = ""
- for(let i=0;i<this.drugOrderList.length;i++){
- if(id == this.drugOrderList[i].drug_id){
- product_date = this.drugOrderList[i].product_date
- }
- }
- return this.getTime(product_date)
- },
- getExpiryDate(id){
- var expiry_date = ""
- for(let i=0;i<this.drugOrderList.length;i++){
- if(id == this.drugOrderList[i].drug_id){
- expiry_date = this.drugOrderList[i].expiry_date
- }
- }
- return this.getTime(expiry_date)
- },
- getTime(val) {
- if(val < 0){
- return ""
- }
- if(val == ""){
- return ""
- }else {
- return uParseTime(val, '{y}-{m}-{d}')
- }
- },
-
- getDrugOutOrderDetailPrint(order_id){
- var params = {
- id:order_id
- }
- getDrugOutOrderDetailPrint(params).then(response=>{
- if(response.data.state ==1){
- var info = response.data.data.info
- console.log("info",info)
- var warehousing = response.data.data.warehousing
- console.log("ware2232",warehousing)
- this.warehouseList = warehousing
- for(let i=0;i<info.length;i++){
- info[i].child = []
- for(let j=0;j<warehousing.length;j++){
- if(info[i].id == warehousing[j].warehouse_out_id){
- info[i].child.push(warehousing[j])
- }
- }
- }
-
- var manufacturerList = response.data.data.manufacturerList
- console.log("manufacturelist",manufacturerList)
- this.manufactureList = manufacturerList
- console.log("列表",info)
- this.tableList = info
- this.loading = false
- }
- })
- },
- getAllPrince(id){
- var count = 0
- for(let i=0;i<this.warehouseList.length;i++){
- if(id == this.warehouseList[i].warehouse_out_id){
- count +=this.warehouseList[i].count * this.warehouseList[i].last_price
- }
- }
- return count
- }
- },
- created() {
- this.orgName = this.$store.getters.xt_user.org.org_name;
- const order_id = this.$route.query.id;
- this.orgId = this.$store.getters.xt_user.org.id;
- this.getDrugOutOrderDetailPrint(order_id)
- }
-
- }
- </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>
|