<template>
  <div class="financialBox">
	<el-form
	  v-loading="quillLoading"
	  :model="formData"
	  ref="formData"
	>
	<el-form-item label="" prop="fssj">
	  <quill-editor
	    :disabled="btnAction == '详情'"
	    v-model="formData.mtext"
	    ref="myQuillEditor"
	    id="myQuillEditor"
	    :options="quillOption"
	  ></quill-editor>
	</el-form-item>
	   <el-row
	     class="saveCancel"
	     style="text-align: center; margin-top: 20px"
	   >
	     <el-col :span="24">
	       <div class="grid-content bg-purple">
	         <el-button
	           type="primary"
	           @click="saveBasic('1')"
	           v-if="btnAction !== '详情'"
	         >
	           <i class="iconfont iconbaocun"></i>
	           保存
	         </el-button>
	         <el-button
	           type="primary"
	           @click="saveBasic('0')"
	           v-if="btnAction !== '详情'"
	         >
	           <i class="iconfont icontijiao"></i>
	           提交
	         </el-button>
			<!-- <el-button
			   type="primary"
			   @click="handleExportWord()"
			   v-if="btnAction !== '导出'"
			 >
			   <i class="iconfont icondaochu11"></i>
			   导出
			 </el-button> -->
	         <el-button
	           type="primary"
	           class="iconfont iconfanhui"
	           @click="goBack"
	           >返回</el-button
	         >
	       </div>
	     </el-col>
	   </el-row>
	</el-form>
	
  </div>
</template>
<script>
	
	import {
		sysCwModelsSaveOrUpdate,
		sysCwModelsFindByParmary
	} from "@/api/budgetFilling/index";
import { quillEditor } from "vue-quill-editor";
import quillConfig from "@/utils/quill-config.js";
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";

export default {
  data() {
    return {
		quillLoading:false,
		quillOption: quillConfig,
		btnAction:this.$route.query.btnAction,
		// name:'年度财政预算项目',
		formData:{
			dataStatus:'1',
			dataType:'1',
			depotCode:sessionStorage.getItem("deptId"),
			orgCode:sessionStorage.getItem("orgCode"),
			mtext:`
			</br>
			</br>
			<p style="text-align:center"><span class="ql-size-huge">${this.dateFormat()}${this.dataName()}</span></p>
			</br>
            <p style="text-align:center"><span class="ql-size-huge">${this.dataName1()}</span></p></br>
           <p style="text-align:center"><span class="ql-size-large">（部门参考模板）</span></br>
		   </br>
		   </br>
		   </br>
		   </br>
		   </br>
		   </br>
		   </br>
		   <p style="text-align:center">
		     <span class="ql-size-large">项 目 名 称：</span><u class="ql-size-large">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</u>
		   </p>  
			<p style="text-align:center">
			 <span class="ql-size-large">项 目 单 位：</span>
			 <u class="ql-size-large">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</u>
			</p>
			<p style="text-align:center">
			<span class="ql-size-large">主 管 部 门：</span>
			<u class="ql-size-large">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</u>
			</p>
			<p style="text-align:center">
			<span class="ql-size-large">评 估 日 期：</span>
			<u class="ql-size-large">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</u>
			</p>
		   </br>
		   </br>
		   </br>
		   <p style="text-align:center"><span class="ql-size-huge">XX项目事前绩效评估报告</span></p>
		  </br>
		   <p>
		   <span class="ql-size-large">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;按照市委、市政府《关于全面推进预算绩效管理的实施方案》和《天津市市级财政支出事前绩效评估管理暂行办法》（津财绩效〔2020〕19号）等文件要求，我们对XX项目开展了事前绩效评估，对项目立项必要性、投入经济性、绩效目标合理性、实施方案可行性、筹资合规性等进行了论证分析，梳理了存在问题并进行了调整完善。该项目评估结果为（建议予以支持/建议调整完善后予以支持/不予支持），有关情况如下。</span>
		   </p>
		   <h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;一、评估对象</h1>
		   <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;（一）基本信息</h2>
		   <p><span class="ql-size-large">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp项目名称：×××××××</span></p>
		   <p><span class="ql-size-large">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp项目单位：×××××××</span></p>
		   <p><span class="ql-size-large">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp主管部门：×××××××</span></p>
		   <p><span class="ql-size-large">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp项目属性（新增/延续）：×××××××</span></p>
		   <p><span class="ql-size-large">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp申请资金总额：</span></p>
		   <p><span class="ql-size-large">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp其中申请财政资金：中央资金××万元、市级资金××万元、区级资金××万元</span></p>
		   <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;（二）项目背景</h2>
		   <p><span style="color: red;" class="ql-size-large">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp（该部分简要描述项目的立项依据、政策背景、历史沿革等。）</span></p>
		   <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;（三）项目内容和预算构成</h2>
		   <p><span style="color: red;" class="ql-size-large">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp（项目内容，预算构成主要介绍该项目申请预算资金的主要构成，体现资金的主要支出方向和具体用途。）</span></p>
		   <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;（四）项目实施主体及职责分工</h2>
		   <h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;二、评估内容</h1>
		   <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;（一）项目立项必要性</h2>
		   <p>
		   <span class="ql-size-large" style="color: red;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp（主要内容：1.项目立项依据是否充分；2.是否具有现实需求；3.项目申报、审批、调整等决策过程是否科学规范等；4.是否与现有政策存在重叠交叉；5.是否属于公共财政支持范围。以上5方面需逐条分析。） </span></p>
		   <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;（二）投入经济性</h2>
		   <p>
		   <span style="color: red;" class="ql-size-large">
		   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp（主要内容：1.按照项目预算组成内容分别阐明测算依据、测算过程、测算结果；2.项目投入成本与预期产出效果是否相匹配；3.投入成本是否合理，成本测算依据是否充分；4.项目是否采取有效成本控制措施。以上4方面需逐条分析。）
		   </span></p>
		   <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;（三）绩效目标合理性</h2>
		   <p>
		   <span style="color: red;" class="ql-size-large">
		   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp（主要内容：1.绩效目标设定是否明确，与项目内容是否高度相关；2.绩效目标和指标设置是否完整、细化、量化；3.绩效目标和指标设定与项目预算金额是否相匹配。以上3方面需逐条分析。）
		   </span></p>
		   <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;（四）实施方案可行性</h2>
		   <p>
		   <span style="color: red;" class="ql-size-large">
		   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp（主要内容：1.实施方案是否完整、合理、可行；2.项目组织、进度安排是否合理；3.人员、设施、物资等基础保障条件是否具备；4.项目组织机构人员是否健全、职责分工是否明确；5.业务管理制度、技术规程、标准是否健全完善，是否采取有效的过程控制措施。以上5方面需逐条分析。）
		   </span></p>
		   <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;（五）筹资合规性</h2>
		   <p><span class="ql-size-large" style="color: red;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;（主要内容：</span><strong class="ql-size-large" style="color: red;">1.资金来源渠道是否符合相关规定，事权与支出责任是否匹配2.对筹资风险认识是否全面，是否针对预期风险设定应对措施。</strong><span class="ql-size-large" style="color: red;">以上2方面需逐条分析。） </span></p>
		   <h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;三、评估结果</h1>
		   <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;（一）发现问题及改进情况</h2>
		   <h2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;（二）评估结论</h2>
		   <p>
		   <span style="color: red;" class="ql-size-large">
		   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;（对上述五个维度进行总结概括，明确提出评估结论，提出建议安排预算金额。）
		   </span></p>
		`},
    };
  },
  components: {
    quillEditor
  },
  created() {
	  if(this.$route.query.id){
		  this.GetFindByParmary()
	  }
	  // this.name='name'
  },
  methods: {
	GetFindByParmary(){
		var data={
			id:this.$route.query.id
		}
		sysCwModelsFindByParmary(data).then(res =>{
			if(res.infoCode == 200){
				this.formData=res.data
			}
		}).catch((e) => {});
	},
	
	//保存修改
	saveBasic(dataStatus) {
		this.quillLoading=true
		console.log(this.tbnf,'uerty77777')
		let operateName=sessionStorage.getItem("userName")
	  let params = JSON.parse(JSON.stringify(this.formData));
	  params.tbnf=this.tbnf
	  params.mname=this.name+this.name1
	  params.dataStatus=dataStatus
	  sysCwModelsSaveOrUpdate(params,operateName)
	    .then((response) => {
	      if (response.infoCode == 200) {
			  this.quillLoading=false
	        this.$router.push({
	          path: "ndczysbgIndex",
	        });
	        this.$message({
	          showClose: true,
	          message: "保存成功！",
	          type: "success",
	        });
	      }
	    })
	    .catch((e) => {
			this.quillLoading=false
		});
	},
	goBack(){
		this.$router.push({
		  path: "ndczysbgIndex",
		});
	},
	dataName(){
		this.name='年度财政预算项目'
		return '年度财政预算项目'
	},
	dataName1(){
		this.name1='事前绩效评估报告'
		return '事前绩效评估报告'
	},
    dateFormat() {
      let date = new Date();
      let year = date.getFullYear();
      /* 在日期格式中，月份是从0开始的，因此要加0
       * 使用三元表达式在小于10的前面加0，以达到格式统一  如 09:11:05
       * */
      let month =
        date.getMonth() + 1 < 10
          ? "0" + (date.getMonth() + 1)
          : date.getMonth() + 1;
      let day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
      let hours =
        date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
      let minutes =
        date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
      let seconds =
        date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
      // 拼接
	  this.tbnf=year+1
	  return (year+1)
	   
      // return (year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds)
      // this.formData.fbrq = year + "-" + month + "-" + day;
    },
  },
};
</script>
<style lang="scss" scoped>
.seeCLa {
  color: #409eff;
  cursor: pointer;
}
.el-form-item {
  margin-bottom: 0px;
  .el-form-item__label {
    line-height: 30px;
    color: #333 !important;
  }
  .el-form-item__content {
    line-height: 30px;
  }
}
.financialBox{
	padding: 20px;
}
.financialBox /deep/.ql-editor {
  min-height: 220px;
}
.ql-toolbar.ql-snow {
  // display: none;
}
.ql-toolbar.ql-snow + .ql-container.ql-snow {
  border-top: 1px solid #ccc !important;
}
.zdqyCl /deep/.el-cascader-menu__wrap {
  height: 222px !important;
}
.zdqyCl /deep/.el-cascader-menu__list {
  padding: 0px 0 18px 0 !important;
}
.tzdx /deep/ .el-form-item__error {
  color: #f56c6c;
  font-size: 12px;
  line-height: 1;
  padding-top: 4px;
  position: absolute;
  top: 10px;
  left: 80px;
}
.ql-editor span{
	font-size: 32px!important;
}
</style>
<style>
.upload-plan {
  position: relative;
}
.upload-plan .el-upload-list {
  width: 75%;
}
.upload-plan .view-btn {
  position: absolute;
  right: 0;
  top: 40px;
}
</style>