<template>
	<div style="">
		<el-row >
				<el-form :model="total" label-width="100px" inline="" class="totalForm">
					<el-col :span="5">	
						<el-form-item label="数量合计">
						    <el-input v-model="total.totalAmount" size="small" style="width: 100px"></el-input>
						</el-form-item>
					</el-col>
					<el-col :span="5">		
						<el-form-item label="重量合计">
						    <el-input v-model="total.totalWeight" size="small" style="width: 120px"></el-input>
						</el-form-item>
					</el-col>	
				</el-form>	
			</el-row>
	</div>
</template>
<script>
	import axios from '@/axios';
	export default {
		props:["childParam","childUrl"],
		data(){
			return {
				total:{
					totalAmount:'',
					totalWeight:''
					
				}
			}
		},
		mounted() {
			//this.getTotalData()
		},
		methods: {
			getTotalData(){
				axios.get(this.childUrl, this.childParam).then(response => {
					if (response.data.code == 0) {
						if (response.data.data[0] === null) {
							this.total = {
											totalAmount:0,
											totalWeight:0
										};
							
						}else{
							this.total = response.data.data[0]
						}
						

					} else {
						this.$message({
							type: 'error',
							message: '操作失败；' + response.data.msg,
						});
					}
				});
			}
		}
	}
</script>
<style>
	.totalForm{
		margin-top:5px;
		margin-left: 30px
	}
</style>