123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342 |
- <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>
- </tr>
- </thead>
- <tbody>
- <tr v-for='(item,index) in warehousingOutInfo.warehousingOutData' :key="index">
- <td><span v-if="item.good_id != 0">{{getTypeNameOne(item.good_id)}}</span></td>
- <td><span v-if="item.good_id != 0">{{getSpecificationName(item.good_id)}}</span></td>
- <td><span v-if="item.good_id!=0">{{getUnit(item.good_id)}}</span></td>
- <td>{{item.price}}</td>
- <td>{{getOutStockCount(item.good_id) + getWarehouseOutInfoCount(item.warehouse_out_id,item.good_id)}}</td>
- <td>{{((getOutStockCount(item.good_id) +getWarehouseOutInfoCount(item.warehouse_out_id,item.good_id))*item.price).toFixed(2)}}</td>
- </tr>
- <tr>
- <td>合计</td>
- <td colspan="4"></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,getWarehouseOutInfo,GetOutStockTotalCount,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: [],
-
- warehousingOutInfo: {
- loading: false,
- warehousingOutData: [],
- info: {}
- },
- stockCount:[],
- 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:[],
- wareoutList:[],
- }
- },
- 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() {
- 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
- }
- getWarehouseOutInfo(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])
- }
- this.warehousingOutInfo.info = response.data.data.info
- console.log("数据源头9999999999",this.warehousingOutInfo.warehousingOutData)
- var total_price = 0
- for(let i=0;i<this.warehousingOutInfo.warehousingOutData.length;i++){
- total_price += this.getOutStockCount(this.warehousingOutInfo.warehousingOutData[i].good_id)*this.warehousingOutInfo.warehousingOutData[i].price
- }
- this.allPrice = total_price
-
- var wareoutList = response.data.data.wareoutList
- console.log("出库数据",wareoutList)
- this.wareoutList = wareoutList
- }
- })
- },
-
- GetTotalCount(time){
- var params = {
- warehouse_out_time:time
- }
- GetOutStockTotalCount(params).then(response=>{
- if(response.data.state == 1){
- var stockCount = response.data.data.stockCount
- console.log("stockCount",stockCount)
- this.stockCount = stockCount
- }
- })
- },
-
- 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
- },
- getOutStockCount(id){
- var count = 0
- for(let i=0;i<this.stockCount.length;i++){
- if(id == this.stockCount[i].good_id){
- count = this.stockCount[i].count
- }
- }
- return count
- },
- 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 ""
- },
-
- getWarehouseOutInfoCount(warehouse_out_id,good_id){
- var count = 0
- for(let i=0;i<this.wareoutList.length;i++){
- if(warehouse_out_id == this.wareoutList[i].warehouse_out_id && good_id == this.wareoutList[i].good_id){
- count = this.wareoutList[i].count
- }
- }
- return count
- }
-
- },
- created(){
-
- const order_id = this.$route.query.id;
- const warehouse_out_time = this.$route.query.warehouse_out_time
- this.GetConfigInfo()
- this.GetOrderDetail(order_id)
- this.GetTotalCount(warehouse_out_time)
- 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>
|