<template>
  <div id="protectedItems" class="content-main">
    <div id="pdfId" >
      <el-form :inline="true" ref="formInline" :model="formInline" :class="{'demo-form-inline':true,'recordsDetailsTable':true}">
      <!-- <div style="text-align: center;font-size: 20px;font-weight: 600;margin-bottom: 20px;">市级储备粮轮换补贴预算申请表</div>
      <div class="flexBox" style="margin-bottom: 10px;">
        <div style="flex: 1;">单位：{{formInline.orgName}}</div>
        <div style="flex: 1;text-align: center;">
          拨付日期：{{formInline.bfrq}}
        </div>
        <div style="flex: 1;text-align: right;" >
          <span>费率：元/吨.年</span>
          <span>单位：吨/元</span>
        </div>
      </div> -->
	  <table id="summaryData">
	    <thead>
	  			<tr>
	  				<th colspan='8' style="border: none;">
	  				    <div style="text-align: center;font-size: 20px;font-weight: 600;margin-bottom: 20px;">{{formInline.lhnd}}市级储备粮轮换补贴预算申请表</div>	
	  				</th>
	  			</tr>
	  			<tr>
	  				<th colspan='3' style="border: none;">
	  					   <div style="text-align: left;">单位：{{formInline.orgName}}</div>
	  				</th>
	  				<th colspan="3" style="border: none;">
	  					<div style="text-align: left;">拨付日期：{{formInline.bfrq}}</div>
	  				</th>
	  				<th colspan="2" style="border: none;">
	  					<div style="text-align: right;" >
	  					  <span>费率：元/吨.年 单位：吨/元</span>
	  					</div>
	  				</th>
	  			</tr>
	      <tr>
	        <th>
	          承储企业
	        </th> 
	        <th>生产年份</th>
	        <th>粮食品种
	         </th>
	       <th>数量
	        </th>
	        <th>费率</th>
			<th>储存期</th>
			<th>应拨付轮换补贴</th>
			<th>本次预拨金额(70%)</th>
	      </tr>
	    </thead>
		  <tbody>
			  <tr v-for="(item,index) in formInline.detailList">
				  <td>
					<span>{{item.ccqy}}</span>
				  </td>
				  <td>
				  	<span>{{item.scnf}}</span>
				  </td>
				  <td>
				  	<span>{{item.pzmc}}</span>
				  </td>
				  <td>
				  	<span>{{ String(item.sjlhsl).indexOf(".") > -1
								  ? Number(item.sjlhsl).toFixed(3)
								  : item.sjlhsl }}</span>
				  </td>
				  <td>
				  	<span>{{item.fl}}</span>
				  </td>
				  <td>
				  	<span>{{item.ccq}}</span>
				  </td>
				  <td>
				  	<span>{{ String(item.ygbflhbt).indexOf(".") > -1
								  ? Number(item.ygbflhbt).toFixed(2)
								  : item.ygbflhbt }}</span>
				  </td>
				  <td>
				  	<span>{{ String(item.bcybje).indexOf(".") > -1
								  ? Number(item.bcybje).toFixed(2)
								  : item.bcybje }}</span>
				  </td>
			  </tr>
			  <div v-if="type == 'dc'" style="margin-top: 20px;"></div>
			  <tr v-if="type == 'dc' && formInline.ysRemark">
			    <td colspan="1" style="border: none;text-align: center;">
			  	  <div>备注</div>
			    </td>
			    <td colspan="7" style="border: none;text-align: left;">
			  	  <div class="textarap"
			  	  style="white-space: pre-wrap" v-html="formInline.ysRemark">
			  	   </div>
			  	  <!-- <el-input :readonly="type != 'xg'" type="textarea" :rows="2" clearable v-model="formInline.remark" placeholder="请输入"></el-input> -->
			    </td>
			  </tr>
			  <div v-if="type == 'dc'" style="margin-top: 20px;"></div>
			  <tr v-if="type == 'dc'">
			    <td colspan="1" style="border: none;text-align: left;">
					<div style="text-align: right;margin-right: 10px;">
						制表
					 </div>
			    </td>
				<td colspan="1" style="border: none;text-align: left;">
					<div style="display: flex;">
						<div class="inputText"
						style="white-space: pre-wrap" v-html="formInline.tabulator">
						 </div>
						 <div class="inputText"
						 style="white-space: pre-wrap;margin-left: 5px;" v-html="formInline.tabulatorDate">
						  </div>  
					</div>
				</td>
			   <td colspan="1" style="border: none;text-align: left;">
			  	<div style="text-align: right;margin-right: 10px;">
			  		复核
			  	 </div>
			    </td>
			    <td colspan="1" style="border: none;text-align: left;">
			  	  <div style="display: flex;">
			  		  <div class="inputText"
			  		  style="white-space: pre-wrap" v-html="formInline.reviewer">
			  		   </div>
			  		   <div class="inputText"
			  		   style="white-space: pre-wrap;margin-left: 5px;" v-html="formInline.reviewDate">
			  		    </div>
			  	  </div>
			    </td>
			   <td colspan="1" style="border: none;text-align: left;">
			  	<div style="text-align: right;margin-right: 10px;">
			  		财务领导批示
			  	 </div>
			    </td>
			    <td colspan="1" style="border: none;text-align: left;">
			  	<div style="display: flex;">
			  		<div class="inputText"
			  		style="white-space: pre-wrap" v-html="formInline.financeUsername">
			  		 </div>
			  		 <div class="inputText"
			  		 style="white-space: pre-wrap;margin-left: 5px;" v-html="formInline.financeDate">
			  		  </div>
			  	</div>
			    </td>
			   <!-- <td colspan="1" style="border: none;text-align: left;">
			  	
			    </td> -->
			    <td colspan="1" style="border: none;text-align: left;">
			  	<div style="text-align: right;margin-right: 10px;">
			  		单位负责人批示
			  	 </div>
			    </td>
			    <td colspan="1" style="border: none;text-align: left;">
			  	  <div style="display: flex;">
			  		<div class="inputText"
			  		style="white-space: pre-wrap" v-html="formInline.leaderUsername">
			  		 </div>
			  		 <div class="inputText"
			  		 style="white-space: pre-wrap;margin-left: 5px;" v-html="formInline.leaderDate">
			  		  </div>  
			  	  </div>
			    </td>
			  </tr>
		  </tbody>
	  </table>
	  <div v-if="type != 'dc'">
		 <div style="margin-top: 20px;"></div>
		 <div class="areawidth" v-if="type != 'xg' && formInline.ysRemark">
		    <el-form-item label="备注" label-width="80px">
		    <el-input :readonly="type != 'xg'" type="textarea" :rows="2" clearable v-model="formInline.ysRemark" placeholder="请输入"></el-input>
		    </el-form-item>
		  </div> 
		  <div class="areawidth" v-if="type == 'xg'">
		     <el-form-item label="备注" label-width="80px">
		     <el-input :readonly="type != 'xg'" type="textarea" :rows="2" clearable v-model="formInline.ysRemark" placeholder="请输入"></el-input>
		     </el-form-item>
		   </div> 
		 <el-row>
		 	<el-form-item label="制表">
		 	  <el-input style="width: 100px;" readonly v-model="formInline.tabulator" placeholder="请输入"></el-input>
		 	</el-form-item>
		 	<el-form-item label-width="0">
		 	  <el-date-picker
		 	  style="width: 130px;"
		 	  :readonly="type != 'xg'"
		 	   v-model="formInline.tabulatorDate"
		 	   type="date"
		 	   placeholder="选择时间"
		 	   format="yyyy-MM-dd"
		 	   value-format="yyyy-MM-dd">
		 	  </el-date-picker>
		 	</el-form-item>
		 	<el-form-item label="复核">
		 	  <el-input style="width: 100px;" readonly v-model="formInline.reviewer" placeholder="请输入"></el-input>
		 	</el-form-item>
		 	<el-form-item label-width="0">
		 	  <el-date-picker
		 	  style="width: 130px;"
		 	  :readonly="type != 'fh'"
		 	   v-model="formInline.reviewDate"
		 	   type="date"
		 	   placeholder="选择时间"
		 	   format="yyyy-MM-dd"
		 	   value-format="yyyy-MM-dd">
		 	  </el-date-picker>
		 	</el-form-item>
		 	<el-form-item label="财务领导批示">
		 	  <el-input style="width: 100px;" readonly v-model="formInline.financeUsername" placeholder="请输入"></el-input>
		 	</el-form-item>
		 	<el-form-item label-width="0">
		 	  <el-date-picker
		 	  style="width: 130px;"
		 	  :readonly="type != 'cwsh'"
		 	   v-model="formInline.financeDate"
		 	   type="date"
		 	   placeholder="选择时间"
		 	   format="yyyy-MM-dd"
		 	   value-format="yyyy-MM-dd">
		 	  </el-date-picker>
		 	</el-form-item>
		 	<el-form-item label="单位负责人批示">
		 	  <el-input style="width: 100px;" readonly v-model="formInline.leaderUsername" placeholder="请输入"></el-input>
		 	</el-form-item>  
		 	<el-form-item label-width="0">
		 	  <el-date-picker
		 	  style="width: 130px;"
		 	  :readonly="type != 'fzrsh'"
		 	   v-model="formInline.leaderDate"
		 	   type="date"
		 	   placeholder="选择时间"
		 	   format="yyyy-MM-dd"
		 	   value-format="yyyy-MM-dd">
		 	  </el-date-picker>
		 	</el-form-item>
		 </el-row> 
	  </div>
		<div style="text-align: center; margin-top: 20px">
			<el-button v-if="type != 'ck' && type == 'xg' " type="primary" icon="iconfont iconbaocun" @click="saveZc('0','formInline','1')">保存</el-button>
			<el-button v-if="type != 'ck'&& type == 'xg'" type="primary" icon="iconfont icontijiao" @click="saveZc('1','formInline','1')">提交</el-button>
			<el-button type="primary" :loading="stateLoading" @click="saveZc('','formInline','2')" size="small" class="iconfont icongaizhang"
			 v-if="type != 'ck' && type != 'dc' && (formInline.status == '91000401' || formInline.status == '91000300')">复核</el-button>
			 <el-button type="primary" :loading="stateLoading" @click="saveZc('','formInline','3')" size="small" class="iconfont icongaizhang"
			  v-if="type != 'ck' && type != 'dc' && (formInline.status == '91000501' || formInline.status == '91000400')">财务审核</el-button>
			<el-button type="primary" :loading="stateLoading" @click="saveZc('','formInline','4')" size="small" class="iconfont icongaizhang"
			 v-if="type != 'ck' && type != 'dc' && (formInline.status == '91000500')">负责人审核</el-button>
			<el-button type="primary" :loading="stateLoading" @click="saveZc('bh','formInline','')" size="small" class="iconfont iconbohui"
			 v-if="type != 'ck' && type != 'xg' && type != 'dc'">驳回</el-button>
			<el-button
			v-if="type == 'dc'"
			  type="primary"
			  class="iconfont icondaochu11"
			  @click="exportExcel"
			  >导出</el-button
			>
			<el-button @click="cancelClick" type="primary" icon="iconfont iconfanhui">返回</el-button>
		</div>
      </el-form>
    </div>
  </div>
</template>

<script>
  import {getPzOptions,subsidysummaryUpdate,subsidysummaryInit,subsidysummarySave,subsidysummaryInfo} from '@/api/bglhbt/index'
  import * as XLSX from "xlsx";
  import * as XLSXS from "xlsx-style";
  import FileSaver from "file-saver";
  import {dateFormat} from '@/utils/index'
  export default{
    data() {
      return {
        stateLoading:false,
        type:this.$route.query.type,
        jstype:this.$route.query.jstype,
        printType:false,
        pzOptions:[],
        formInline:{
		  lhnd:new Date().getFullYear(),
          type:'budget',
          pzbm:'',
          pzmc:'',
          dataType:'0',
          tabulatorDate:'',
          reviewDate:null,
          financeDate:null,
          leaderDate:null,
		  reviewStatus:0,//复核状态
		  financeStatus:0,//领导人批复状态
		  leaderStatus:0,//单位负责人批复状态
		  tabulator:'',
		  reviewer:'',
		  financeUsername:'',
		  leaderUsername:'',
          orgCode:sessionStorage.getItem("orgCode"),
          sskdbm:sessionStorage.getItem("tyshxydm")+'001',
          ccqy:sessionStorage.getItem("orgName"),
          deptCode:sessionStorage.getItem("tyshxydm")+'001',
          ysGz:'',
          ysGzzt:0,
		  isDelete:0,
          detailList:[
			  {
				 ccqy:'', 
				 scnf:'',
				 pzmc:'',
				 sjlhsl:'',
				 ygbflhbt:'',
				 sjlhsl:'',
				 fl:'',
				 ccf:'',
			  }
          ],
        }
      }

    },
    created(){
      // if(this.$route.query.id){
        this.getJxcInfo()
      // }
      getPzOptions().then((res) => {
        this.pzOptions = res.data;
      });
    },
    methods:{
      cancelClick(){
        this.$router.push({
          name: "ysbtsummaryIndex",
        });
      },
	 //  getSummaries(params){
		// console.log(params,'uyt6666666----')  
	 //  },
	  saveZc(type, formName, shtype, sussInfo, errInfo) {
	  	console.log('66555-==============')
		this.formInline.detailList.splice(this.formInline.detailList.length -1 ,1)
	  	this.shtype = shtype
	  	if(type == 'bh'){
	  		if(this.type == 'fh'){
	  			this.shtype=2
	  			this.formInline.reviewStatus = 0
	  		}else if(this.type == 'cwsh'){
	  			this.shtype=3
	  			this.formInline.financeStatus = 0
	  		}else if(this.type == 'fzrsh'){
	  			this.shtype=4
	  			this.formInline.leaderStatus = 0
	  		}
	  		
	  	}
	  	if(shtype ==1){
	  		this.formInline.tabulator =this.formInline.tabulator ? this.formInline.tabulator :sessionStorage.getItem("userName")
	  	    this.formInline.operationType = type
	  	}else if (shtype == 2) {
	  		this.formInline.reviewStatus = 1
	  	}
	  	else if (shtype == 3) {
	  		this.formInline.financeStatus = 1
	  	}else if (shtype == 4) {
	  		this.formInline.leaderStatus = 1
	  	}
	  	// this.formInline.summaryStatus = 1
		this.formInline.type='budget'
	  	this.$refs[formName].validate((valid) => {
	  		if (valid) {
	  			if (this.$route.query.id) {
	  				// console.log(this.formInline,'ooiyy7778-----')
	  				subsidysummaryUpdate(this.formInline, this.shtype).then(res => {
	  					if (res.infoCode == 200) {
	  						this.$message({
	  							message: "提交成功",
	  							type: "success",
	  						});
	  						this.$router.push({
	  							name: "ysbtsummaryIndex",
	  							query: {
	  								active: 'bt'
	  							}
	  						});
	  					} else {
	  						this.$message.error(res.msg);
	  					}
	  				})
	  			} else {
	  				// console.log(this.formInline,'ooiyy7778----+++++++++++++-')
	  
	  				subsidysummarySave(this.formInline).then(res => {
	  					if (res.infoCode == 200) {
	  						this.$message({
	  							message: "保存成功",
	  							type: "success",
	  						});
	  						this.$router.push({
	  							name: "ysbtsummaryIndex",
	  							query: {
	  								active: 'bt'
	  							}
	  						});
	  					} else {
	  						this.$message.error(res.msg);
	  					}
	  				})
	  			}
	  		}
	  	})
	  
	  },
      getJxcInfo(){
		  if(this.$route.query.id){
			  var data={
				  id:this.$route.query.id
			  }
			 subsidysummaryInfo(data).then(res =>{
			   if(res.infoCode == 200){
			     this.formInline=res.data
			 	// this.formInline.detailList=res.data.detailList
			 	if(this.type == 'xg'){
					// if(this.formInline.status == '91000301'){
					// 	this.formInline.tabulatorDate=dateFormat(new Date())
					// }else{
					// 	this.formInline.tabulatorDate=this.formInline.tabulatorDate ? this.formInline.tabulatorDate :dateFormat(new Date())
					// }
			 		this.formInline.tabulator =this.formInline.tabulator ? this.formInline.tabulator :sessionStorage.getItem("userName")
			 		this.formInline.tabulatorDate=this.formInline.tabulatorDate ? this.formInline.tabulatorDate :dateFormat(new Date())
					this.formInline.reviewer=''
			 		this.formInline.reviewDate=null
			 		this.formInline.financeUsername=''
			 		this.formInline.financeDate=null
			 		this.formInline.leaderUsername =''
			 		this.formInline.leaderDate=null
			 	}else if(this.type == 'fh'){
			 		this.formInline.reviewer =this.formInline.reviewer ? this.formInline.reviewer :sessionStorage.getItem("userName")	
			 	    this.formInline.reviewDate=dateFormat(new Date())
			 		this.formInline.financeUsername=''
			 		this.formInline.financeDate=null
			 		this.formInline.leaderUsername =''
			 		this.formInline.leaderDate=null
			 	}
			 	else if(this.type == 'cwsh'){
			 		this.formInline.financeUsername =this.formInline.financeUsername ? this.formInline.financeUsername :sessionStorage.getItem("userName")	
			 	    this.formInline.financeDate=dateFormat(new Date())
			 		this.formInline.leaderUsername =''
			 		this.formInline.leaderDate=null
			 	}
			 	else if(this.type == 'fzrsh'){
			 		this.formInline.leaderUsername =this.formInline.leaderUsername ? this.formInline.leaderUsername :sessionStorage.getItem("userName")	
			 	    this.formInline.leaderDate=dateFormat(new Date())
			 	}
				var ysHj={
				   ccqy:"合计",
				   bcybje:null,
				   sjlhsl:null,
				   ygbflhbt:null
				}
				this.formInline.detailList.forEach((item,i) =>{
				   ysHj.bcybje+=item.bcybje
				   ysHj.sjlhsl+=item.sjlhsl
				   ysHj.ygbflhbt+=item.ygbflhbt
				})
				ysHj.sjlhsl=String(ysHj.sjlhsl).indexOf(".") > -1
				  ? Number(ysHj.sjlhsl).toFixed(2)
				  : ysHj.sjlhsl
				ysHj.bcybje=String(ysHj.bcybje).indexOf(".") > -1
				  ? Number(ysHj.bcybje).toFixed(3)
				  : ysHj.bcybje
				ysHj.ygbflhbt=String(ysHj.ygbflhbt).indexOf(".") > -1
				  ? Number(ysHj.ygbflhbt).toFixed(3)
				  : ysHj.ygbflhbt
				this.formInline.detailList.push(ysHj)
			   }
			   
			 })  
		  }else{
			 var data=this.$route.query.yslist.split(',')
			 subsidysummaryInit(data,{type:'budget'}).then(res =>{
			   if(res.infoCode == 200){
			     this.formInline=res.data
			 	this.formInline.detailList=res.data.detailList
			 	if(this.type == 'xg'){
			 		this.formInline.tabulator =this.formInline.tabulator ? this.formInline.tabulator :sessionStorage.getItem("userName")
			 	    this.formInline.tabulatorDate=this.formInline.tabulatorDate ? this.formInline.tabulatorDate : dateFormat(new Date())
			 		this.formInline.reviewer=''
			 		this.formInline.reviewDate=null
			 		this.formInline.financeUsername=''
			 		this.formInline.financeDate=null
			 		this.formInline.leaderUsername =''
			 		this.formInline.leaderDate=null
			 	}else if(this.type == 'fh'){
			 		this.formInline.reviewer =this.formInline.reviewer ? this.formInline.reviewer :sessionStorage.getItem("userName")	
			 	    this.formInline.reviewDate=dateFormat(new Date())
			 		this.formInline.financeUsername=''
			 		this.formInline.financeDate=null
			 		this.formInline.leaderUsername =''
			 		this.formInline.leaderDate=null
			 	}
			 	else if(this.type == 'cwsh'){
			 		this.formInline.financeUsername =this.formInline.financeUsername ? this.formInline.financeUsername :sessionStorage.getItem("userName")	
			 	    this.formInline.financeDate=dateFormat(new Date())
			 		this.formInline.leaderUsername =''
			 		this.formInline.leaderDate=null
			 	}
			 	else if(this.type == 'fzrsh'){
			 		this.formInline.leaderUsername =this.formInline.leaderUsername ? this.formInline.leaderUsername :sessionStorage.getItem("userName")	
			 	    this.formInline.leaderDate=dateFormat(new Date())
			 	}
			  var ysHj={
			   ccqy:"合计",
			   bcybje:null,
			   sjlhsl:null,
			   ygbflhbt:null
			  }
			  this.formInline.detailList.forEach((item,i) =>{
			   ysHj.bcybje+=item.bcybje
			   ysHj.sjlhsl+=item.sjlhsl
			   ysHj.ygbflhbt+=item.ygbflhbt
			  })
			  ysHj.sjlhsl=String(ysHj.sjlhsl).indexOf(".") > -1
			    ? Number(ysHj.sjlhsl).toFixed(2)
			    : ysHj.sjlhsl
			  ysHj.bcybje=String(ysHj.bcybje).indexOf(".") > -1
			    ? Number(ysHj.bcybje).toFixed(3)
			    : ysHj.bcybje
			  ysHj.ygbflhbt=String(ysHj.ygbflhbt).indexOf(".") > -1
			    ? Number(ysHj.ygbflhbt).toFixed(3)
			    : ysHj.ygbflhbt
			  this.formInline.detailList.push(ysHj)
			   }
			 }) 
		  }
        
      },
    exportExcel() {
      this.$confirm("是否下载Excel表？", "提示", {
        closeOnClickModal: false,
        closeOnPressEscape: false,
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
        customClass: "messageBox",
      }).then(() => {
        let wb = XLSX.utils.table_to_book(
          document.getElementById("summaryData"),
          { sheet: "包干轮换补贴汇总" }
        );
        this.setExlStyle(wb["Sheets"]["包干轮换补贴汇总"]);
        //合并单元格边框补齐
        this.addRangeBorder(
          wb["Sheets"]["包干轮换补贴汇总"]["!merges"],
          wb["Sheets"]["包干轮换补贴汇总"]
        );
        var ws = XLSXS.write(wb, {
          type: "buffer",
        });
        try {
          FileSaver.saveAs(
            new Blob([ws], { type: "application/octet-stream" }),
            `包干轮换补贴汇总.xlsx`
          );
        } catch (e) {
          if (typeof console !== "undefined") console.log(e, ws);
        }
        return ws;
      });
    },
    setExlStyle(data, type) {
      let borderAll = {
        //单元格外侧框线
        top: {
          style: "thin",
        },
        bottom: {
          style: "thin",
        },
        left: {
          style: "thin",
        },
        right: {
          style: "thin",
        },
      };
      data["!cols"] = [];
      // if(type =='kc'){
      // data['!cols'].push({wpx: 60},{wpx: 260});
      for (let i = 0; i < 22; i++) {
        data["!cols"].push({ wpx: 120 });
      }
      // }
      // this.$nextTick(() =>{
      for (let key in data) {
        console.log(key, data[key], "datakey----------------");
        if (data[key] instanceof Object) {
          // data[key].t='s'
          data[key].s = {
            // item.NumberFormat = "@";
            border: borderAll,
            alignment: {
              horizontal: "center", //水平居中对齐
              vertical: "center",
            },
            font: {
              sz: 11,
            },
            bold: true,
            numFmt: 0,
          };
          // console.log(key,data[key],'datakey----------------')
        }
      }
      this.$nextTick(() => {
        return data;
      });
    },
    addRangeBorder(range, ws) {
      let cols = [
        "A",
        "B",
        "C",
        "D",
        "E",
        "F",
        "G",
        "H",
        "I",
        "J",
        "K",
        "L",
        "M",
        "N",
        "O",
        "P",
        "Q",
        "R",
        "S",
        "T",
        "U",
        "V",
        "W",
        "X",
        "Y",
        "Z",
      ];
      range.forEach((item) => {
        console.log(item);
        let style = {
          s: {
            border: {
              top: { style: "thin" },
              left: { style: "thin" },
              bottom: { style: "thin" },
              right: { style: "thin" },
            },
          },
        };
        // 处理合并行
        for (let i = item.s.c; i <= item.e.c; i++) {
          ws[`${cols[i]}${Number(item.e.r) + 1}`] =
            ws[`${cols[i]}${Number(item.e.r) + 1}`] || style;
          // 处理合并列
          for (let k = item.s.r + 2; k <= item.e.r + 1; k++) {
            ws[cols[i] + k] = ws[cols[k] + item.e.r] || style;
          }
        }
      });
      return ws;
    },
      inputNum(val,index){
        // console.log(val,index,'88888========')
        // let all = 0;
        var ygbflhbt=Number(this.formInline.budgetList[index].sjlhsl*this.formInline.budgetList[index].fl*this.formInline.budgetList[index].ccq)
        this.$set(
          this.formInline.budgetList[index],
          "ygbflhbt",
          String(ygbflhbt).indexOf(".") > -1
            ? Number(ygbflhbt).toFixed(0)
            : Number(ygbflhbt)
        );
        console.log(this.formInline.budgetList[index].ygbflhbt,'9912---------')
        var ygsq=ygbflhbt*0.7
        console.log(ygsq,'9912---------')
        this.$set(
          this.formInline.budgetList[index],
          "ygsq",
          String(ygsq).indexOf(".") > -1
            ? Number(ygsq).toFixed(2)
            : Number(ygsq)
        );
        console.log(this.formInline.budgetList[index].ygsq,'uyytt7777777777')
        var sjsq=ygsq
        this.$set(
          this.formInline.budgetList[index],
          "sjsq",
          String(sjsq).indexOf(".") > -1
            ? Number(sjsq).toFixed(2)
            : Number(sjsq)
        );
      },
    }
  }
</script>

<style scoped lang="scss">
.recordsDetailsTable{
    margin: 40px 0px 0px 0px;
    background-color: #fff;
    font-size: 14px;
    padding-bottom: 20px;
    table {
      width: 100%;
      margin-top: 10px;
      font-size: 14px;
    }
    .tdsize{
      font-size: 18px;
      font-weight: 700;
    }
    td,
    th {
      text-align: center;
      border: 1px solid #eaeaea;
      word-wrap: break-word;
      height: 40px;
    }
    span,
    .el-input,
    .el-textarea {
      font-size: 12px;
    }
}
.title-name{
    text-align: center;
    font-size: 22px;
    font-weight: 600;
  }
  .line-box{
    display: flex;
  }
  .flexBox{
    display: flex;
    line-height: 40px;
    height: 40px;
    // text-align: center;
  }
  .areawidth{
    margin-top: 20px;
    width: 100%;
  }
 .areawidth /deep/ .el-textarea__inner{
   width: 100%!important;
 }
 // .el-form--inline .el-form-item
 .areawidth /deep/.el-form-item{
   width: 100%!important;
 }
 .areawidth /deep/ .el-form-item__content{
   width: 93%!important;
 }
 .printPdf{
   margin: 40px;
 }
 #pdfId{
     background-color: #fff;
     /* overflow-y: auto; */
     margin: 10px;
     // border: 1px solid rgb(244, 245, 248);
     padding: 10px;
 }
 .textarap {
   border: 1px solid #dcdfe6;
   background-color: #ffffff;
   line-height: 1.5;
   padding: 5px 15px;
   border-radius: 4px;
   color: #606266;
   font-size: 12px;
   min-height: 40px;
 }
 .inputText {
   border: 1px solid #dcdfe6;
   background-color: #ffffff;
   line-height: 40px;
   height: 40px;
   padding: 0 15px;
   border-radius: 4px;
   color: #606266;
   font-size: 12px;
   width: 80px;
 }
</style>
<style>
  #bglhbtsubsidy {
    position: relative !important;
  }

  #bglhbtsubsidy > div {
    left: 80px !important;
    top: -80px !important;
  }
</style>
