balance-query2.vue 2.64 KB
<template>
	<div class="container resource close-left-menu contaNEW">
		<div class="pop-banner clearfix">
			<div class="operate-btns">
				<a href="javascript:history.go(-1)" class="fbtn fb-return">返回</a>
				<a href="javascript:;" class="fbtn fb-download" @click='download'>导出</a>
			</div>
			<h3 class="current-module">库存结存金额分析</h3>
		</div>

		 <table class="itable itable-thead-13px itable-td-long-text">
	        <thead id="t_header">
	          <tr>
	           <th class="w50">序号</th>
	           <th class="w140">商品名称</th>
	           <th class="w140">规格</th>
	           <th class="w70">单位</th>
	           <th class="w120">生产厂商</th>
	           <th class="w120">注册证号</th>
	           <th class="w120">单价</th>
	           <th class="w120">总金额</th>
	          </tr>
	       </thead>
	       <tbody>
	       	<tr v-for='item in goodsList'>
		         <td>{{$index+1}}</td>
		         <td class="t-left pr10">{{item.goodsname}}</td>
		         <td class="pr10">{{item.goodsspec}}</td>
		         <td>{{item.unit}}</td>
		         <td class="t-left pr10">{{item.producer}}</td>
		         <td class="t-left pr10">{{item.registkey}}</td>
		         <td class="t-right pr10">{{item.saleprice| numDigit 2}}</td>
		         <td class="t-right">{{item.sumprice| numDigit 2}}</td>
		    </tr>
	       </tbody>
	      </table> 
	      <pagination
	      @page-change="getGoodS(false)"
	      :class="['m-20-0']"
	      :page-no.sync="search.page"
	      :total-pages.sync="search.totalPages"
	      ></pagination>
	</div>
</template>
<script>
	
	module.exports = {
		data: function() {
			return {
				goodsList:[],
				search: {
					page:1,
					totalPages:0,
					pageSize:50,
					total:0,
				},

			}
		},
		methods: {
			getData: function(flag) {
				var self = this;
				
				if(flag){
					this.search.page=1;
				}

				Ajax.post('/billType/getmfmedstockbalancedetails',self.search)
					.then(function(response) {
							var data=response.data.data;
							if(response.data.errorCode==0){
								self.$set('goodsList',data.list);
								self.search.totalPages = data.totalPages;
              					self.search.total = data.total;
							}else{
								layer.msg(response.data.message);
							}
					});

			},
			download:function(){
				var self= this;

				Ajax.post('/billType/exportmfmedstockbalancedetail')
					.then(function(response) {
							var data=response.data.data;
							if(response.data.errorCode>0){
								layer.msg(response.data.message);
							}else{
								window.open(response.data);
							}
					});
			}

		},
		route: {
			activate: function() {
				this.getData();
			}
		},
	}
</script>