(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d2176a9"],{c743:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e._self._c;return t("div",[t("basic-container",[t("avue-crud",{attrs:{option:e.option,"table-loading":e.loading,data:e.dataForm,page:e.page},on:{"update:page":function(t){e.page=t},"search-change":e.searchChange,"search-reset":e.searchReset,"current-change":e.currentChange,"size-change":e.sizeChange},scopedSlots:e._u([{key:"menuLeft",fn:function({size:a}){return[t("el-button",{attrs:{icon:"el-icon-plus",type:"primary",size:a},on:{click:e.addData}},[e._v("新增")])]}},{key:"menu",fn:function({row:a}){return[t("el-button",{attrs:{type:"text",size:"small",icon:"el-icon-view"},on:{click:function(t){return e.handleView(a)}}},[e._v("查 看 ")])]}}])}),t("dataQuotaInfo",{ref:"dataQuotaInfo",attrs:{deviceGroupList:e.deviceGroupList,visible:e.show,isViewData:e.isViewData,detailData:e.detailData,title:e.title},on:{handleBeforeClose:e.handleBeforeClose,updataList:e.updataList}})],1)],1)},o=[],i=a("f0a4"),l=function(){var e=this,t=e._self._c;return t("div",[t("cus-drawe",{attrs:{visible:e.visible,size:"70%",title:e.title,showBtn:!("查看配额预测"==e.title),buttons:e.buttonList},on:{handleBeforeClose:e.handleBeforeClose,buttonClick:e.buttonClick}},[t("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{model:e.ruleForm,rules:e.rules,"label-width":"180px",disabled:e.isViewData}},[t("el-row",[t("el-row",[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"年度:",prop:"year"}},[t("el-date-picker",{staticStyle:{width:"100%"},attrs:{clearable:"","picker-options":e.pickerOptions,type:"year",placeholder:"选择年度","value-format":"yyyy"},on:{change:e.changeDatePicker},model:{value:e.ruleForm.year,callback:function(t){e.$set(e.ruleForm,"year",t)},expression:"ruleForm.year"}})],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"机组名称:",prop:"deviceGroupId"}},[t("el-select",{attrs:{clearable:"",placeholder:"请选择"},on:{change:e.changeDeviceGroup},model:{value:e.ruleForm.deviceGroupId,callback:function(t){e.$set(e.ruleForm,"deviceGroupId",t)},expression:"ruleForm.deviceGroupId"}},e._l(e.deviceGroupList,(function(e){return t("el-option",{key:e.id,attrs:{label:e.deviceGroupName,value:e.id}})})),1)],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"机组分类:",prop:"groupClass"}},[t("el-select",{attrs:{clearable:"",placeholder:"请选择"},on:{change:e.getHeatingLoadValueAndpowerSupplyValue},model:{value:e.ruleForm.groupClass,callback:function(t){e.$set(e.ruleForm,"groupClass",t)},expression:"ruleForm.groupClass"}},e._l(e.unitTypeList,(function(e){return t("el-option",{key:e.dictKey,attrs:{label:e.dictValue,value:e.dictKey}})})),1)],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"机组类型:",prop:"groupType"}},[t("el-select",{attrs:{clearable:"",placeholder:"请选择"},model:{value:e.ruleForm.groupType,callback:function(t){e.$set(e.ruleForm,"groupType",t)},expression:"ruleForm.groupType"}},e._l(e.productTypeList,(function(e){return t("el-option",{key:e.dictKey,attrs:{label:e.dictValue,value:e.dictValue}})})),1)],1)],1),e.showHeatingLoadComp2()||e.showHeatingLoadComp3()?t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{prop:"heatingLoad",label:"供热量:"}},[t("el-input",{attrs:{clearable:""},model:{value:e.ruleForm.heatingLoad,callback:function(t){e.$set(e.ruleForm,"heatingLoad",t)},expression:"ruleForm.heatingLoad"}},[t("template",{slot:"append"},[e._v("GJ")])],2)],1)],1):e._e(),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"供电量:",prop:"powerSupply"}},[t("el-input",{attrs:{clearable:""},model:{value:e.ruleForm.powerSupply,callback:function(t){e.$set(e.ruleForm,"powerSupply",t)},expression:"ruleForm.powerSupply"}},[t("template",{slot:"append"},[e._v("MWh")])],2)],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"供电基准值:",prop:"powerSupplyValue"}},[t("el-input",{attrs:{clearable:""},model:{value:e.ruleForm.powerSupplyValue,callback:function(t){e.$set(e.ruleForm,"powerSupplyValue",t)},expression:"ruleForm.powerSupplyValue"}},[t("template",{slot:"append"},[e._v("tCO2/MWh")])],2)],1)],1),e.showHeatingLoadComp2()||e.showHeatingLoadComp3()?t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"供热基准值:",prop:"heatingLoadValue"}},[t("el-input",{attrs:{clearable:""},model:{value:e.ruleForm.heatingLoadValue,callback:function(t){e.$set(e.ruleForm,"heatingLoadValue",t)},expression:"ruleForm.heatingLoadValue"}},[t("template",{slot:"append"},[e._v("tCO2/GJ")])],2)],1)],1):e._e(),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"供热比:",prop:"heatingRatio"}},[t("el-input",{attrs:{clearable:""},on:{blur:e.changeHeatingRatio},model:{value:e.ruleForm.heatingRatio,callback:function(t){e.$set(e.ruleForm,"heatingRatio",t)},expression:"ruleForm.heatingRatio"}},[t("template",{slot:"append"},[e._v("%")])],2)],1)],1),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"机组冷却方式:",prop:"unitCoolingMethod"}},[t("el-select",{attrs:{clearable:"",placeholder:"请选择"},on:{change:e.changeUnitCoolingMethod},model:{value:e.ruleForm.unitCoolingMethod,callback:function(t){e.$set(e.ruleForm,"unitCoolingMethod",t)},expression:"ruleForm.unitCoolingMethod"}},e._l(e.coolingMethodDict,(function(e,a){return t("el-option",{key:a,attrs:{label:e.dictValue,value:e.dictKey}})})),1)],1)],1),e.showHeatingLoadComp()||e.showHeatingLoadComp2()?t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{prop:"groupCorrectionFactor",label:"机组冷却方式修正系数:"}},[t("el-input",{attrs:{clearable:""},model:{value:e.ruleForm.groupCorrectionFactor,callback:function(t){e.$set(e.ruleForm,"groupCorrectionFactor",t)},expression:"ruleForm.groupCorrectionFactor"}})],1)],1):e._e(),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"负荷(出力)系数:",prop:"loadingFactor"}},[t("el-input",{attrs:{clearable:""},on:{blur:e.changeLoadingFactor},model:{value:e.ruleForm.loadingFactor,callback:function(t){e.$set(e.ruleForm,"loadingFactor",t)},expression:"ruleForm.loadingFactor"}})],1)],1),e.showHeatingLoadComp()||e.showHeatingLoadComp2()?t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"负荷(出力)系数修正系数:",prop:"loadCorrectionFactor"}},[t("el-input",{attrs:{clearable:""},model:{value:e.ruleForm.loadCorrectionFactor,callback:function(t){e.$set(e.ruleForm,"loadCorrectionFactor",t)},expression:"ruleForm.loadCorrectionFactor"}})],1)],1):e._e(),t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"供热量修正系数:",prop:"heatSupplyCoefficient"}},[t("el-input",{attrs:{clearable:""},model:{value:e.ruleForm.heatSupplyCoefficient,callback:function(t){e.$set(e.ruleForm,"heatSupplyCoefficient",t)},expression:"ruleForm.heatSupplyCoefficient"}})],1)],1)],1),t("el-row",[t("el-col",{attrs:{span:12}},[t("el-form-item",{attrs:{label:"试算配额量:",prop:"forecastQuota"}},[t("el-input",{attrs:{placeholder:"通过计算得出",clearable:"",disabled:""},model:{value:e.ruleForm.forecastQuota,callback:function(t){e.$set(e.ruleForm,"forecastQuota",t)},expression:"ruleForm.forecastQuota"}},[t("template",{slot:"append"},[e._v("tCO2")])],2)],1)],1)],1)],1)],1)],1)],1)},s=[],u=a("507f"),n=a("f1de"),c=a("c54a"),p={props:{isViewData:{type:Boolean,default:!1},detailData:{type:Boolean,default:()=>[]},visible:{type:Boolean,default:!1},title:{type:String,default:"配额预测"}},data(){return{deviceGroupDetail:{},coolingMethodDict:[],titleText:"配额预测",dialogd:!1,deviceGroupList:[],ruleForm:{year:(new Date).getFullYear().toString(),deviceGroupId:"",heatingLoad:"",powerSupply:"",powerSupplyValue:"",groupType:"",groupClass:"",heatingLoadValue:"",heatingRatio:"",unitCoolingMethod:"",groupCorrectionFactor:"",loadingFactor:"",loadCorrectionFactor:"",heatSupplyCoefficient:"",forecastQuota:""},rules:{year:[{required:!0,message:"请选择年度",trigger:"change"}],deviceGroupId:[{required:!0,message:"请选择机组名称",trigger:"change"}],heatingLoad:[{required:!0,message:"请输入供热量",trigger:"blur"},{validator:c["b"],trigger:"blur"}],groupType:[{required:!0,message:"请选择机组类型",trigger:"blur"}],groupClass:[{required:!0,message:"请选择机组分类",trigger:"blur"}],powerSupply:[{required:!0,message:"请输入供电量",trigger:"blur"},{validator:c["b"],trigger:"blur"}],powerSupplyValue:[{required:!0,message:"请输入供电基准值",trigger:"change"},{validator:c["b"],trigger:"blur"}],heatingLoadValue:[{required:!0,message:"请输入供热基准值",trigger:"blur"},{validator:c["b"],trigger:"blur"}],heatingRatio:[{required:!0,message:"请输入供热比",trigger:"blur"},{validator:c["b"],trigger:"blur"}],unitCoolingMethod:[{required:!0,message:"请选择机组冷却方式",trigger:"change"}],groupCorrectionFactor:[{required:!0,message:"请输入机组冷却方式修正系数",trigger:"blur"}],loadingFactor:[{required:!0,message:"请输入负荷出力系数",trigger:"blur"},{validator:c["b"],trigger:"blur"}],loadCorrectionFactor:[{required:!0,message:"请输入负荷系数修正系数",trigger:"blur"},{validator:c["b"],trigger:"blur"}],heatSupplyCoefficient:[{required:!0,message:"请输入供热量修正系数",trigger:"blur"},{validator:c["b"],trigger:"blur"}],forecastQuota:[{required:!0,message:"请输入预测配额量",trigger:"blur"}]},pickerOptions:{disabledDate(e){return e.getTime()>Date.now()-864e4}},productTypeList:[],unitTypeList:[],powerSupplyValueList:[],heatintempRowgLoadValueList:[],tempRow:{},isFirstVisit:!0}},watch:{detailData:{deep:!0,handler(e,t){e!=t&&(this.ruleForm=e)}},visible(e){e||this.$refs.ruleForm.resetFields()},"ruleForm.year":{handler(e,t){e&&(this.ruleForm.deviceGroupId="",this.getdeviceGroupList({year:e}).then(()=>{this.isFirstVisit&&this.tempRow&&this.tempRow.deviceGroupId&&(this.isFirstVisit=!1,this.ruleForm.deviceGroupId=this.tempRow.deviceGroupId)}))},immediate:!0}},computed:{buttonList(){return"编辑配额预测"==this.title?[{type:"",icon:"el-icon-circle-close",label:"取 消",btnName:"cancel"},{type:"primary",icon:"el-icon-s-order",label:"计 算",btnName:"computed"},{type:"",icon:"el-icon-circle-close",label:"取 消",btnName:"cancel"}]:[{type:"primary",icon:"el-icon-circle-plus-outline",label:"保 存",btnName:"save"},{type:"primary",icon:"el-icon-s-order",label:"计 算",btnName:"computed"},{type:"",icon:"el-icon-circle-close",label:"取 消",btnName:"cancel"}]}},created(){this.init()},methods:{init(){this.getdeviceGroupList(),this.getCoolingMethod(),this.getProcuctType()},initForm(){return{year:(new Date).getFullYear().toString(),deviceGroupId:"",heatingLoad:"",powerSupply:"",powerSupplyValue:"",groupType:"",groupClass:"",heatingLoadValue:"",heatingRatio:"",unitCoolingMethod:"",groupCorrectionFactor:"",loadingFactor:"",loadCorrectionFactor:"",heatSupplyCoefficient:"",forecastQuota:""}},showHeatingLoadComp(){const{deviceGroupType:e,productType:t}=this.deviceGroupDetail;return!0},showHeatingLoadComp2(){const{deviceGroupType:e,productType:t}=this.deviceGroupDetail;return!0},showHeatingLoadComp3(){const{deviceGroupType:e,productType:t}=this.deviceGroupDetail;return!0},changeHeatingRatio(){const e=this.ruleForm.heatingRatio;this.ruleForm.heatSupplyCoefficient=(1-e/100*.22).toFixed(6)},changeLoadingFactor(){const e=100*this.ruleForm.loadingFactor;e>=85?this.ruleForm.loadCorrectionFactor=1:e>=80&&e<85?this.ruleForm.loadCorrectionFactor=1+.0014*(85-100*e).toFixed(6):e>=75&&e<80?this.ruleForm.loadCorrectionFactor=1.007+.0016*(80-100*e).toFixed(6):e<75&&(this.ruleForm.loadCorrectionFactor=1.015*Math.pow(16-20*e,2).toFixed(6))},async getProcuctType(){this.productTypeList=await this.mapDictData("group_type_e"),this.unitTypeList=await this.mapDictData("unit_type_class"),this.powerSupplyValueList=await this.mapDictData("power_supply_value"),this.heatingLoadValueList=await this.mapDictData("heating_load_value")},resetRuleForm(){this.$refs.ruleForm.resetFields()},async changeDatePicker(e){this.ruleForm.deviceGroupId&&this.changeDeviceGroup(this.ruleForm.deviceGroupId),e&&this.ruleForm.groupClass&&(this.powerSupplyValueList.forEach(t=>{let a=t.remark.split(",");a[0]==e&&a[1]==this.ruleForm.groupClass&&(this.ruleForm.powerSupplyValue=t.dictValue)}),this.heatingLoadValueList.forEach(t=>{let a=t.remark.split(",");a[0]==e&&a[1]==this.ruleForm.groupClass&&(this.ruleForm.heatingLoadValue=t.dictValue)}))},async getHeatingLoadValueAndpowerSupplyValue(e){e&&this.ruleForm.year&&(this.powerSupplyValueList.forEach(t=>{let a=t.remark.split(",");a[0]==this.ruleForm.year&&a[1]==e&&(this.ruleForm.powerSupplyValue=t.dictValue)}),this.heatingLoadValueList.forEach(t=>{let a=t.remark.split(",");a[0]==this.ruleForm.year&&a[1]==e&&(this.ruleForm.heatingLoadValue=t.dictValue)}))},changeUnitCoolingMethod(e){const t=this.coolingMethodDict.find(t=>t.dictKey===e);this.ruleForm.groupCorrectionFactor=t.groupCorrectionFactor},async mapDictData(e){const{data:t}=await Object(n["getDict"])(e);return 200===t.code&&t.data.length?t.data[0].children:[]},async getCoolingMethod(){const e=await this.mapDictData("cooling-method"),t=e.map(e=>{let t="空冷"===e.dictValue?1.5:1;return{...e,groupCorrectionFactor:t}});this.coolingMethodDict=t},async getdeviceGroupList(e){const t=await Object(u["getdeviceGroupList"])({year:(new Date).getFullYear().toString(),...e});this.deviceGroupList=t.data.data.records||[]},buttonClick(e){if("save"===e)this.$refs.ruleForm.validate(async e=>{if(e){let e;this.unitTypeList.forEach(t=>{t.dictKey===this.ruleForm.groupClass&&(e=t.dictValue)});let{groupClass:t,...a}=this.ruleForm,r={...a,groupClass:e};const{data:o}=await Object(u["addPredictionQuotaSubmit"])(r);200===o.code&&(this.handleBeforeClose(),this.$refs.ruleForm.resetFields(),this.$emit("updataList"),this.isFirstVisit=!0)}});else if("computed"===e){let e,{powerSupply:t,powerSupplyValue:a,groupCorrectionFactor:r,loadCorrectionFactor:o,groupType:i,heatingLoad:l,heatingLoadValue:s}=this.ruleForm;l=Number(l),s=Number(s),"编辑配额试算"==this.title?this.ruleForm.groupClass&&this.unitTypeList.forEach(t=>{t.dictValue===this.ruleForm.groupClass&&(e=t.remark)}):this.ruleForm.groupClass&&this.unitTypeList.forEach(t=>{t.dictKey===this.ruleForm.groupClass&&(e=t.remark)});const u=Number(t)*Number(a),n=1-this.ruleForm.heatingRatio/100*.22;if("rm"==e&&"纯凝发电机组"==i){const e=u*r*n*o;this.ruleForm.forecastQuota=e.toFixed(2)}else if("rm"==e&&"热电联产机组"==i){const e=u*r*n*o+Number(l)*Number(s);this.ruleForm.forecastQuota=e.toFixed(2)}else if("rq"==e&&"纯凝发电机组"==i){const e=u*n;this.ruleForm.forecastQuota=e.toFixed(2)}else if("rq"==e&&"热电联产机组"==i){const e=u*n+Number(l)*Number(s);this.ruleForm.forecastQuota=e.toFixed(2)}}else this.$refs.ruleForm.resetFields(),this.handleBeforeClose()},async changeDeviceGroup(e){const{data:t}=await Object(u["getDeviceGroupQuotaDetail"])({id:e});this.deviceGroupDetail=t.data,this.ruleForm.heatingLoad=t.data.heatingLoad,this.ruleForm.powerSupply=t.data.powerSupply,this.ruleForm.loadingFactor=t.data.loadingFactor,this.ruleForm.heatingRatio=t.data.heatingRatio;const a=100*t.data.loadingFactor;a>=85?this.ruleForm.loadCorrectionFactor=1:a>=80&&a<85?this.ruleForm.loadCorrectionFactor=1+.0014*(85-100*a).toFixed(6):a>=75&&a<80?this.ruleForm.loadCorrectionFactor=1.007+.0016*(80-100*a).toFixed(6):a<75&&(this.ruleForm.loadCorrectionFactor=1.015*Math.pow(16-20*a,2).toFixed(6)),this.ruleForm.heatingRatio&&(this.ruleForm.heatSupplyCoefficient=(1-this.ruleForm.heatingRatio/100*.22).toFixed(6))},handleBeforeClose(){this.isFirstVisit=!0,this.initForm(),this.$emit("handleBeforeClose")}}},d=p,h=a("1805"),g=Object(h["a"])(d,l,s,!1,null,null,null),m=g.exports,F=a("0e0b"),y={data(){return{isViewData:!1,loading:!1,show:!1,page:{pageSize:10,currentPage:1,total:0},option:{height:"auto",calcHeight:30,searchShow:!0,searchMenuSpan:6,menu:!0,tip:!1,border:!0,align:"center",index:!1,viewBtn:!1,editBtn:!1,addBtn:!1,delBtn:!1,menuLeft:!1,menuFixed:!1,menuWidth:130,column:[{label:"核算年度",prop:"year",type:"year",valueFormat:"yyyy",search:!0},{label:"机组名称",prop:"deviceGroupName",search:!0},{label:"机组分类",prop:"groupClass"},{label:"试算配额量(tCO2)",prop:"forecastQuota"},{label:"供热基准值(tCO2/GJ)",prop:"heatingLoadValue"},{label:"供电基准值(tCO2/MWh)",prop:"powerSupplyValue"}]},dataForm:[],deviceGroupList:[],detailData:{year:(new Date).getFullYear().toString(),deviceGroupId:"",heatingLoad:"",powerSupply:"",powerSupplyValue:"",groupClass:"",groupType:"",heatingLoadValue:"",heatingRatio:"",unitCoolingMethod:"",groupCorrectionFactor:"",loadingFactor:"",loadCorrectionFactor:"",heatSupplyCoefficient:"",forecastQuota:""},title:"",query:{},unitTypeList:[]}},components:{dataQuotaInfo:m},computed:{...Object(i["b"])(["permission"])},async created(){this.onLoad()},methods:{async getUitTypeList(){this.unitTypeList=await this.mapDictData("unit_type_class")},async mapDictData(e){const{data:t}=await Object(n["getDict"])(e);return 200===t.code&&t.data.length?t.data[0].children:[]},searchReset(){this.query={},this.onLoad()},updataList(){this.onLoad(),this.show=!1},async getdeviceGroupList(){const{data:{data:{records:e}}}=await Object(u["getdeviceGroupList"])({});this.deviceGroupList=e||[]},async hasleDel(e){this.$confirm("此操作将永久删除该文件, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(async()=>{const{data:t}=await Object(u["predictionQuotaRemove"])(e.id);200===t.code&&(this.onLoad(),this.$message({type:"success",message:"删除成功!"}))})},handleView(e){this.show=!0,this.isViewData=!0,this.detailData=e,this.$refs.dataQuotaInfo.ruleForm=Object(F["b"])(e),this.title="查看配额试算"},hasleEdit(e){this.show=!0,this.isViewData=!1,this.$refs.dataQuotaInfo.tempRow=Object(F["b"])(e),this.$refs.dataQuotaInfo.ruleForm=Object(F["b"])(e),this.title="编辑配额试算"},addData(){this.$refs.dataQuotaInfo.tempRow={},this.$refs.dataQuotaInfo.ruleForm=Object(F["b"])(row),this.isViewData=!1,this.title="配额试算",this.show=!0},handleBeforeClose(){this.$refs.dataQuotaInfo.tempRow={},this.show=!1,this.$refs.dataQuotaInfo.ruleForm=this.detailData},onLoad(){let e=[{id:"1728001545380773889",createUser:"1605399440819564545",createDept:"1605399437405401089",createTime:"2023-11-24 18:44:08",updateUser:"1605399440819564545",updateTime:"2023-11-24 18:44:08",status:1,isDeleted:0,tenantId:"999606",year:"2023",deviceGroupId:"1694645662248861697",deviceGroupName:"2#机组",heatingLoad:"30887693.360000",powerSupply:"437667.360000",powerSupplyValue:"1.000000",heatingLoadValue:"1.000000",heatingRatio:"86.540000",unitCoolingMethod:"waterCooling",groupCorrectionFactor:"1",loadingFactor:"89.677059",loadCorrectionFactor:"1",heatSupplyCoefficient:"0.809612",forecastQuota:"354340.750000",industryId:null,industryName:null,groupType:"纯凝发电机组",groupClass:"300MW等级以上常规燃煤机组"}];const t=e.map(e=>{const t=this.unitTypeList.find(t=>t.dictKey==e.groupType);return{...e,groupTypeName:t&&t.dictValue}});this.dataForm=t,this.page.total=1},searchChange(e,t){this.query=e,this.page.currentPage=1,this.onLoad(),t()},currentChange(e){this.page.currentPage=e,this.onLoad()},sizeChange(e){this.page.pageSize=e}}},b=y,f=Object(h["a"])(b,r,o,!1,null,null,null);t["default"]=f.exports}}]);