123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335 |
- <template>
- <div class="main-contain">
- <div class="position">
- <bread-crumb :crumbs="crumbs"></bread-crumb>
- <el-row style="float:right;">
- <el-col :span="24">
- <el-button size="small" icon="el-icon-printer" type="primary" @click="printAction">打印</el-button>
- </el-col>
- </el-row>
- </div>
- <div class="app-container" style="background-color: white;">
- <div id="print_content">
- <div class="print_main_content">
- <div class="order_title_panl">
- <span class="main_title">耗材入库登记单</span>
- </div>
- <div style="text-align:right;margin-bottom:20px;font-size: 18px;">
- 打印时间:{{time_now}}
- </div>
- <div class="table_panel">
- <table class="table">
- <thead>
- <tr>
- <td width="80">耗材名称</td>
- <td width="80">注册证号/批准文号/备案凭证号</td>
- <td width="80">规格型号</td>
- <td width="80">生产厂商</td>
- <td width="80">单位</td>
- <td width="80">进货价</td>
- <td width="80">入库数量</td>
- <td width="80">总价</td>
- <td width="80">批号</td>
- <td width="80">生产日期</td>
- <td width="80">有效日期</td>
- <td width="80">质检意见</td>
- <td width="80">验收结论</td>
- </tr>
- </thead>
- <tbody>
- <tr v-for='(item,index) in WarehouseInfo.warehouseInfoDate' :key="index">
- <td><span v-if="item.good_id != 0">{{getTypeNameOne(item.good_id)}}</span></td>
- <td></td>
- <td><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
- <td>{{ getManufacturer(item.manufacturer) }}</td>
- <td><span v-if="item.good_id!=0">{{getUnit(item.good_id)}}</span></td>
- <td>{{item.price}}</td>
- <td>{{item.warehousing_count}}</td>
- <td>{{(item.warehousing_count*item.price).toFixed(2)}}</td>
- <td>{{ item.number }}</td>
- <td>{{ item.product_date | parseTime("{y}-{m}-{d}") }}</td>
- <td>{{ item.expiry_date | parseTime("{y}-{m}-{d}") }}</td>
- <td></td>
- <td></td>
- </tr>
- <tr>
- <td>合计</td>
- <td colspan="11"></td>
- <td>{{allPrice.toFixed(2)}}</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>
- </div>
- </template>
-
- <script>
- import BreadCrumb from '@/xt_pages/components/bread-crumb'
- import {
- GetAllConfig,
- getWarehouseInfoList,
- getGoodInfoList
- } from "@/api/stock";
- import print from 'print-js'
- const moment = require('moment')
- export default {
- components:{
- BreadCrumb
- },
- data(){
- return{
- crumbs: [
- { path: false, name: '库存管理' },
- { path: false, name: '耗材管理' },
- { path: false, name: '入库单打印' },
- ],
- isEdit: 0,
- checked: false,
- signAndWeighBoxPatients: "sign-and-weigh-box-patients",
- goodType: [],
- goodInfo: [],
- manufacturer: [],
- dealer: [],
- Warehouse: {
- loading: false,
- warehouseDate: [],
- tableCurrentIndex: ""
- },
-
- WarehouseInfo: {
- loading: false,
- warehouseInfoDate: [],
- warehouse: {}
- },
- time_now:moment(new Date()).add('year',0).format("YYYY-MM-DD"),
- allPrice:0,
- page: 1,
- limit: 10000,
- keyword: "",
- is_use:"",
- good_kind:"",
- is_charge:"",
- list:[]
- }
- },
- methods:{
- printAction: function() {
- 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; } }'
- printJS({
- printable: 'print_content',
- type: 'html',
- documentTitle: ' ',
- style: style,
- scanStyles: false
- })
- },
-
- GetConfigInfo: function() {
- GetAllConfig().then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- this.manufacturer = response.data.data.manufacturer;
- this.dealer = response.data.data.dealer;
- this.goodInfo = response.data.data.goodInfo;
- this.goodType = response.data.data.goodType;
- }
- });
- },
-
- GetOrderDetail: function(order_id) {
- const params = {
- id: order_id
- };
- getWarehouseInfoList(params).then(response => {
- if (response.data.state == 0) {
- this.$message.error(response.data.msg);
- return false;
- } else {
- var obj = ""
- for (let i = 0; i < response.data.data.info.length; i++) {
- this.WarehouseInfo.warehouseInfoDate.push(response.data.data.info[i]);
- }
- this.WarehouseInfo.warehouse = response.data.data.warehousing;
- var total_price = 0
- for(let i=0;i<this.WarehouseInfo.warehouseInfoDate.length;i++){
- total_price += this.WarehouseInfo.warehouseInfoDate[i].warehousing_count * this.WarehouseInfo.warehouseInfoDate[i].price
- }
- this.allPrice = total_price
- console.log("total_price",total_price)
- console.log("数据222222222",this.WarehouseInfo.warehouseInfoDate)
- }
- });
- },
-
- getSpecificationName: function(id) {
- let name = "";
- for (let i = 0; i < this.goodInfo.length; i++) {
- if (this.goodInfo[i].id == id) {
- name = this.goodInfo[i].specification_name;
- }
- }
- return name;
- },
- getTypeName: function(id) {
- let name = "";
- for (let i = 0; i < this.goodType.length; i++) {
- if (this.goodType[i].id == id) {
- name = this.goodType[i].type_name;
- }
- }
- return name;
- },
- getTypeNameOne:function(id){
- let name = "";
- for (let i = 0; i < this.goodInfo.length; i++) {
- if (this.goodInfo[i].id == id) {
- name = this.goodInfo[i].good_name;
- }
- }
- return name;
- },
- getList() {
- this.goodInfo.loading = true
- let params = {
- page: this.page,
- limit: this.limit,
- keyword: this.keywords,
- is_use:this.is_use,
- good_kind:this.good_kind,
- is_charge: this.is_charge,
- }
- getGoodInfoList(params).then(response => {
- if (response.data.state == 0) {
-
- this.$message.error(response.data.msg)
- return false
- } else {
- this.list = []
- for (let i = 0; i < response.data.data.list.length; i++) {
- this.list.push(response.data.data.list[i])
- }
- console.log("list22222",this.list)
- }
- })
- },
- getUnit(id){
- var name = ""
- for(let i=0;i<this.list.length;i++){
- if(id == this.list[i].id){
- name = this.list[i].good_unit
- }
- }
- return this.getGoodUnit(name)
- },
- getGoodUnit(id){
- for (let i = 0; i <this.$store.getters.good_unit.length; i++ ){
- if(id == this.$store.getters.good_unit[i].id){
-
- return this.$store.getters.good_unit[i].name
- }
- }
- return ""
- },
- getManufacturer(id){
- let name = ''
- this.manufacturer.map(item => {
- if(item.id == id){
- name = item.manufacturer_name
- }
- })
- return name
- }
- },
- created(){
-
- const order_id = this.$route.query.id;
- this.GetConfigInfo();
- this.GetOrderDetail(order_id);
- this.getList()
- }
- }
- </script>
-
-
- <style rel="stylesheet/scss" lang="scss" scoped>
- .print_main_content {
- background-color: white;
- max-width: 1500px;
- 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: 18px;
- padding: 15px 5px;
- }
- }
- }
- tbody {
- tr {
- td {
- border: 1px solid;
- text-align: center;
- font-size: 18px;
- 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;
- }
- }
- }
- }
- }
- }
- }
- }
- }
- </style>
|