(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/declare/declare"],{"0de5":function(t,e,n){"use strict";n.d(e,"b",(function(){returni})),n.d(e,"c",(function(){returnr})),n.d(e,"a",(function(){returno}));varo={uForm:function(){returnn.e("uview-ui/components/u-form/u-form").then(n.bind(null,"b644"))},uFormItem:function(){returnPromise.all([n.e("common/vendor"),n.e("uview-ui/components/u-form-item/u-form-item")]).then(n.bind(null,"a3d2"))},uInput:function(){returnPromise.all([n.e("common/vendor"),n.e("uview-ui/components/u-input/u-input")]).then(n.bind(null,"f735"))},uSelect:function(){returnn.e("uview-ui/components/u-select/u-select").then(n.bind(null,"fc7a"))}},i=function(){vart=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){t.selectshow=!0},t.e1=function(e){t.ranking_selectShow=!1})},r=[]},"169e":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void0;varo,i=c(n("8f6c")),r=n("86df"),a=c(n("9036"));functionc(t){returnt&&t.__esModule?t:{default:t}}functions(t){returnf(t)||d(t)||u(t)||l()}functionl(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}functionu(t,e){if(t){if("string"===typeoft)returnh(t,e);varn=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(t,e):void0}}functiond(t){if("undefined"!==typeofSymbol&&Symbol.iteratorinObject(t))returnArray.from(t)}functionf(t){if(Array.isArray(t))returnh(t)}functionh(t,e){(null==e||e>t.length)&&(e=t.length);for(varn=0,o=newArray(e);n<e;n++)o[n]=t[n];returno}varg=null,m={data:function(){return{dataArr:[],ranking_selectShow:!1,selectValue:"",options:[],Rankdate:"",status:"1",cWidth:"",cHeight:"",pixelRatio:1,chartData:{categories:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],series:[{name:"申报电量",data:[100,200,300,400,500],color:"#1989FA"},{name:"实际用电量",data:[80,220,250,380,460],color:"#EC6045"}],maxValue:0},rankingdata:[],DeclarationElectricity:"45272kWh",actualPower:"45272kWh",endtime:"2021-01-25",selectshow:!1,tabbarIndex:1,tabbar:!1,tabindex:1,form:{num:"",month:"",letter:"",select:"",type:"",note:""},selectlist:[{value:"1",label:"正常申报"},{value:"2",label:"增产/减产"},{value:"3",label:"其他"}],enterpriseId:"",declarationDeadline:""}},created:function(){},onLoad:function(){},onShow:function(){this.getmonthlist(),this.enterpriseId=t.getStorageSync("user").enterpriseId;vare=t.getStorageSync("type"),n=t.getStorageSync("user");if(1==e){varo=n.userType;1!=o&&5!=o&&(this.tabbar=!0)}this.verification(this.enterpriseId)},methods:{clickTab:function(t){this.tabindex=t,2==t?this.getstatistics(this.enterpriseId):3==t&&this.getranking()},showLineA:function(t,e){console.log("canvaLineA"),g=newi.default({$this:o,canvasId:t,type:"line",fontSize:11,legend:{show:!0},dataLabel:!1,dataPointShape:!0,background:"#FFFFFF",pixelRatio:o.pixelRatio,categories:e.categories,series:e.series,animation:!0,xAxis:{type:"grid",gridColor:"#fff",gridType:"solid",dashLength:8},yAxis:{gridType:"solid",gridColor:"#F2F2F2",splitNumber:5,min:0,max:e.maxValue},width:o.cWidth*o.pixelRatio,height:o.cHeight*o.pixelRatio,extra:{line:{type:"straight"}}})},touchLineA:function(t){g.showToolTip(t,{format:function(t,e){returne+" "+t.name+":"+t.data}})},getstatistics:function(e){varn=this;(0,r.get)(a.default.reportStatistics,{enterpriseId:e}).then((function(e){if(200==e.code){n.chartData.series[0].data=e.data.reportElectricityList,n.chartData.series[1].data=e.data.actualElectricityList,n.DeclarationElectricity=e.data.totalReportElectricity,n.actualPower=e.data.totalActualUserElectricity,n.declarationDeadline=e.data.declarationDeadline;vari=Math.max.apply(Math,s(e.data.reportElectricityList)),r=Math.max.apply(Math,s(e.data.actualElectricityList)),a=i>r?i:r;n.chartData.maxValue=1.2*a,o=n,n.cWidth=t.upx2px(670),n.cHeight=t.upx2px(500),n.showLineA("canvasLineA",n.chartData)}elseconsole.log(e.msg)}))},getranking:function(){vart=this;(0,r.get)(a.default.reportRank,{date:t.Rankdate}).then((function(e){200==e.code?t.rankingdata=e.data:console.log(e.msg)}))},declareClick:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;returne&&n.electricityDeclaration&&1==n.electricityDeclaration?(t.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1):!this.form.num||isNaN(this.form.num)?(t.showToast({title:"请输入申报电量",icon:"none"}),!1):this.form.select?this.form.letter?"正常申报"!=this.form.select&&""==this.form.note&&""!=this.form.select?(t.showToast({title:"请填写备注",icon:"none"}),!1):voidthis.declarereport():(t.showToast({title:"请上传确认函",icon:"none"}),!1):(t.showToast({title:"请选择申报类型",icon:"none"}),!1)},declarereport:function(){vare=newDate,n=e.getDate();(0,r.post)(a.default.report,{userId:this.enterpriseId,reportElectricity:Number(this.form.num),month:this.form.month+"-"+n,type:this.form.type,reportImage:this.form.letter,remark:this.form.note}).then((function(e){200==e.code?t.showToast({title:"申报成功!"}):t.showToast({title:e.msg,icon:"none"})}))},Download:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;if(n&&e&&1==n.electricityDeclaration)returnt.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1;if(!this.form.num)returnt.showToast({title:"请输入申报电量",icon:"none"}),!1;(0,r.get)(a.default.downloadTemplate,{month:this.form.month+"-10",reportElectricity:this.form.num}).then((function(e){if(200==e.code){varn=e.msg.replace("http:","https:"),o=t.downloadFile({url:n,filePath:wx.env.USER_DATA_PATH+"/月度委托电量确认函.docx",success:function(e){200==e.statusCode&&t.openDocument({filePath:e.filePath,showMenu:!0,success:function(){console.log("打开文档成功")}})}});o.onProgressUpdate((function(t){console.log("下载进度"+t.progress),console.log("已经下载的数据长度"+t.totalBytesWritten),console.log("预期需要下载的数据总长度"+t.totalBytesExpectedToWrite)}))}elset.showToast({title:e.msg,icon:"none"})}))},chooseImg:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;if(n&&e&&1==n.electricityDeclaration)returnt.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1;varo=this;t.chooseImage({count:1,sizeType:["original","compressed"],success:function(e){varn=e.tempFilePaths;t.getStorageSync("token");t.uploadFile({url:a.default.uploadFile,filePath:n[0],name:"file",success:function(t){vare=JSON.parse(t.data).url;o.form.letter=e}})}})},linkto:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;if(n&&e&&1==n.electricityDeclaration)returnt.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1;console.log("1111111111111111111111111111"),t.navigateTo({url:"./DeclareHistory"})},selectconfirm:function(t){this.form.select=t[0].label,this.form.type=t[0].value},getmonth:function(){vart=this.declarationDeadline;console.log(t),""!=t&&null!=t&&"null"!=t||(t="25"),0==t.indexOf("0")&&(t=t.slice(1));vare=(0,r.getDate)().split("-")[0],n=(0,r.getDate)().split("-")[1];0==n.indexOf("0")&&(n=n.slice(1)),console.log(n);varo=(0,r.getDate)().split("-")[2];0==o.indexOf("0")&&(o=o.slice(1)),12==n?(e=Number(e)+1,n=1):n=Number(n)+1,Number(t)<Number(o)&&(12==n?(e=Number(e)+1,n=1):n+=1),n<10&&(n="0"+n),o<10&&(o="0"+o),this.form.month=e+"-"+n},clickSelect:function(){console.log(this.ranking_selectShow),this.ranking_selectShow=!this.ranking_selectShow},getValue:function(t){this.selectValue=this.options[t],console.log(this.selectValue),this.ranking_selectShow=!1;vare=newDate,n=e.getDate();n<10&&(n="0"+n),this.Rankdate=this.dataArr[t]+"-"+n,this.getranking()},getmonthlist:function(){vart=this,e=newDate;e.getFullYear();e.setMonth(e.getMonth()+2,1);for(varn=0;n<12;n++){e.setMonth(e.getMonth()-1);varo=e.getMonth()+1;o=o<10?"0"+o:o,t.dataArr.push(e.getFullYear()+"-"+o)}t.dataArr.map((function(e){varn=e.split("-")[0]+"年",o=e.split("-")[1]+"月";0==o.indexOf("0")&&(o=o.slice(1)),t.options.push(n+o)})),t.selectValue=t.options[1]},verification:function(t){vare=this;(0,r.get)(a.default.reportElectric,{enterpriseId:t}).then((function(t){t.sign?(e.status=1,e.declarationDeadline=t.declarationDeadline,e.getmonth()):e.status=0}))}}};e.default=m}).call(this,n("543d")["default"])},3506:function(t,e,n){"use strict";varo=n("c004"),i=n.n(o);i.a},7181:function(t,e,n){"use strict";n.r(e);varo=n("169e"),i=n.n(o);for(varrino)"default"!==r&&function(t){n.d(e,t,(function(){returno[t]}))}(r);e["default"]=i.a},c004:function(t,e,n){},dc89:function(t,e,n){"use strict";(function(t){n("78ef");o(n("66fd"));vare=o(n("fd84"));functiono(t){returnt&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},fd84:function(t,e,n){"use strict";n.r(e);varo=n("0de5"),i=n("7181");for(varrini)"default"!==r&&function(t){n.d(e,t,(function(){returni[t]}))}(r);n("3506");vara,c=n("f0c5"),s=Object(c["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],a);e["default"]=s.exports}},[["dc89","common/runtime","common/vendor"]]]);
=======
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/declare/declare"],{1307:function(t,e,n){},"2f4c":function(t,e,n){"use strict";n.r(e);varo=n("d472"),i=n.n(o);for(varrino)"default"!==r&&function(t){n.d(e,t,(function(){returno[t]}))}(r);e["default"]=i.a},"565b":function(t,e,n){"use strict";varo=n("1307"),i=n.n(o);i.a},"6bb1":function(t,e,n){"use strict";n.d(e,"b",(function(){returni})),n.d(e,"c",(function(){returnr})),n.d(e,"a",(function(){returno}));varo={uForm:function(){returnn.e("uview-ui/components/u-form/u-form").then(n.bind(null,"9abc"))},uFormItem:function(){returnPromise.all([n.e("common/vendor"),n.e("uview-ui/components/u-form-item/u-form-item")]).then(n.bind(null,"546a"))},uInput:function(){returnPromise.all([n.e("common/vendor"),n.e("uview-ui/components/u-input/u-input")]).then(n.bind(null,"6696"))},uSelect:function(){returnn.e("uview-ui/components/u-select/u-select").then(n.bind(null,"03f3"))}},i=function(){vart=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){t.selectshow=!0},t.e1=function(e){t.ranking_selectShow=!1})},r=[]},7445:function(t,e,n){"use strict";n.r(e);varo=n("6bb1"),i=n("2f4c");for(varrini)"default"!==r&&function(t){n.d(e,t,(function(){returni[t]}))}(r);n("565b");vara,c=n("f0c5"),s=Object(c["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],a);e["default"]=s.exports},d405:function(t,e,n){"use strict";(function(t){n("0cf7");o(n("66fd"));vare=o(n("7445"));functiono(t){returnt&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},d472:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void0;varo,i=c(n("55c8")),r=n("a000"),a=c(n("7363"));functionc(t){returnt&&t.__esModule?t:{default:t}}functions(t){returnf(t)||d(t)||u(t)||l()}functionl(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}functionu(t,e){if(t){if("string"===typeoft)returnh(t,e);varn=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(t,e):void0}}functiond(t){if("undefined"!==typeofSymbol&&Symbol.iteratorinObject(t))returnArray.from(t)}functionf(t){if(Array.isArray(t))returnh(t)}functionh(t,e){(null==e||e>t.length)&&(e=t.length);for(varn=0,o=newArray(e);n<e;n++)o[n]=t[n];returno}varg=null,m={data:function(){return{dataArr:[],ranking_selectShow:!1,selectValue:"",options:[],Rankdate:"",status:"1",cWidth:"",cHeight:"",pixelRatio:1,chartData:{categories:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],series:[{name:"申报电量",data:[100,200,300,400,500],color:"#1989FA"},{name:"实际用电量",data:[80,220,250,380,460],color:"#EC6045"}],maxValue:0},rankingdata:[],DeclarationElectricity:"45272kWh",actualPower:"45272kWh",endtime:"2021-01-25",selectshow:!1,tabbarIndex:1,tabbar:!1,tabindex:1,form:{num:"",month:"",letter:"",select:"",type:"",note:""},selectlist:[{value:"1",label:"正常申报"},{value:"2",label:"增产/减产"},{value:"3",label:"其他"}],enterpriseId:"",declarationDeadline:"",onDeclare:!1}},created:function(){},onLoad:function(){},onShow:function(){this.onDeclare=!1,this.getmonthlist(),this.enterpriseId=t.getStorageSync("user").enterpriseId;vare=t.getStorageSync("type"),n=t.getStorageSync("user");if(1==e){varo=n.userType;1!=o&&5!=o&&(this.tabbar=!0)}this.verification(this.enterpriseId)},methods:{clickTab:function(t){this.tabindex=t,2==t?this.getstatistics(this.enterpriseId):3==t&&this.getranking()},showLineA:function(t,e){console.log("canvaLineA"),g=newi.default({$this:o,canvasId:t,type:"line",fontSize:11,legend:{show:!0},dataLabel:!1,dataPointShape:!0,background:"#FFFFFF",pixelRatio:o.pixelRatio,categories:e.categories,series:e.series,animation:!0,xAxis:{type:"grid",gridColor:"#fff",gridType:"solid",dashLength:8},yAxis:{gridType:"solid",gridColor:"#F2F2F2",splitNumber:5,min:0,max:e.maxValue},width:o.cWidth*o.pixelRatio,height:o.cHeight*o.pixelRatio,extra:{line:{type:"straight"}}})},touchLineA:function(t){g.showToolTip(t,{format:function(t,e){returne+" "+t.name+":"+t.data}})},getstatistics:function(e){varn=this;(0,r.get)(a.default.reportStatistics,{enterpriseId:e}).then((function(e){if(200==e.code){n.chartData.series[0].data=e.data.reportElectricityList,n.chartData.series[1].data=e.data.actualElectricityList,n.DeclarationElectricity=e.data.totalReportElectricity,n.actualPower=e.data.totalActualUserElectricity,n.declarationDeadline=e.data.declarationDeadline;vari=Math.max.apply(Math,s(e.data.reportElectricityList)),r=Math.max.apply(Math,s(e.data.actualElectricityList)),a=i>r?i:r;n.chartData.maxValue=1.2*a,o=n,n.cWidth=t.upx2px(670),n.cHeight=t.upx2px(500),n.showLineA("canvasLineA",n.chartData)}elseconsole.log(e.msg)}))},getranking:function(){vart=this;(0,r.get)(a.default.reportRank,{date:t.Rankdate}).then((function(e){200==e.code?t.rankingdata=e.data:console.log(e.msg)}))},declareClick:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;returne&&n.electricityDeclaration&&1==n.electricityDeclaration?(t.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1):!this.form.num||isNaN(this.form.num)?(t.showToast({title:"请输入申报电量",icon:"none"}),!1):this.form.select?this.form.letter?"正常申报"!=this.form.select&&""==this.form.note&&""!=this.form.select?(t.showToast({title:"请填写备注",icon:"none"}),!1):voidthis.declarereport():(t.showToast({title:"请上传确认函",icon:"none"}),!1):(t.showToast({title:"请选择申报类型",icon:"none"}),!1)},declarereport:function(){vare=this;this.onDeclare=!0;varn=newDate,o=n.getDate();(0,r.post)(a.default.report,{userId:this.enterpriseId,reportElectricity:Number(this.form.num),month:this.form.month+"-"+o,type:this.form.type,reportImage:this.form.letter,remark:this.form.note}).then((function(n){if(200==n.code){t.showToast({title:"电量申报成功!"});varo=setTimeout((function(){t.navigateTo({url:"/pages/declare/DeclareHistory"}),clearTimeout(o)}),1500)}elset.showToast({title:n.msg,icon:"none"}),e.onDeclare=!1}))},Download:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;if(n&&e&&1==n.electricityDeclaration)returnt.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1;if(!this.form.num)returnt.showToast({title:"请输入申报电量",icon:"none"}),!1;(0,r.get)(a.default.downloadTemplate,{month:this.form.month+"-10",reportElectricity:this.form.num}).then((function(e){if(200==e.code){varn=e.msg.replace("http:","https:"),o=t.downloadFile({url:n,filePath:wx.env.USER_DATA_PATH+"/月度委托电量确认函.docx",success:function(e){200==e.statusCode&&t.openDocument({filePath:e.filePath,showMenu:!0,success:function(){console.log("打开文档成功")}})}});o.onProgressUpdate((function(t){console.log("下载进度"+t.progress),console.log("已经下载的数据长度"+t.totalBytesWritten),console.log("预期需要下载的数据总长度"+t.totalBytesExpectedToWrite)}))}elset.showToast({title:e.msg,icon:"none"})}))},chooseImg:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;if(n&&e&&1==n.electricityDeclaration)returnt.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1;varo=this;t.chooseImage({count:1,sizeType:["original","compressed"],success:function(e){varn=e.tempFilePaths;t.getStorageSync("token");t.uploadFile({url:a.default.uploadFile,filePath:n[0],name:"file",success:function(t){vare=JSON.parse(t.data).url;o.form.letter=e}})}})},linkto:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;if(n&&e&&1==n.electricityDeclaration)returnt.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1;console.log("1111111111111111111111111111"),t.navigateTo({url:"./DeclareHistory"})},selectconfirm:function(t){this.form.select=t[0].label,this.form.type=t[0].value},getmonth:function(){vart=this.declarationDeadline;console.log(t),""!=t&&null!=t&&"null"!=t||(t="25"),0==t.indexOf("0")&&(t=t.slice(1));vare=(0,r.getDate)().split("-")[0],n=(0,r.getDate)().split("-")[1];0==n.indexOf("0")&&(n=n.slice(1)),console.log(n);varo=(0,r.getDate)().split("-")[2];0==o.indexOf("0")&&(o=o.slice(1)),12==n?(e=Number(e)+1,n=1):n=Number(n)+1,Number(t)<Number(o)&&(12==n?(e=Number(e)+1,n=1):n+=1),n<10&&(n="0"+n),o<10&&(o="0"+o),this.form.month=e+"-"+n},clickSelect:function(){console.log(this.ranking_selectShow),this.ranking_selectShow=!this.ranking_selectShow},getValue:function(t){this.selectValue=this.options[t],console.log(this.selectValue),this.ranking_selectShow=!1;vare=newDate,n=e.getDate();n<10&&(n="0"+n),this.Rankdate=this.dataArr[t]+"-"+n,this.getranking()},getmonthlist:function(){vart=this,e=newDate;e.getFullYear();e.setMonth(e.getMonth()+2,1);for(varn=0;n<12;n++){e.setMonth(e.getMonth()-1);varo=e.getMonth()+1;o=o<10?"0"+o:o,t.dataArr.push(e.getFullYear()+"-"+o)}t.dataArr.map((function(e){varn=e.split("-")[0]+"年",o=e.split("-")[1]+"月";0==o.indexOf("0")&&(o=o.slice(1)),t.options.push(n+o)})),t.selectValue=t.options[1]},verification:function(t){vare=this;(0,r.get)(a.default.reportElectric,{enterpriseId:t}).then((function(t){t.sign?(e.status=1,e.declarationDeadline=t.declarationDeadline,e.getmonth()):e.status=0}))}}};e.default=m}).call(this,n("543d")["default"])}},[["d405","common/runtime","common/vendor"]]]);
>>>>>>>6564f8bb0059b03adf3e16712c15e2f07b7e6bbf
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/declare/declare"],{"169e":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void0;varo,i=c(n("8f6c")),r=n("86df"),a=c(n("9036"));functionc(t){returnt&&t.__esModule?t:{default:t}}functions(t){returnd(t)||f(t)||u(t)||l()}functionl(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}functionu(t,e){if(t){if("string"===typeoft)returnh(t,e);varn=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(t,e):void0}}functionf(t){if("undefined"!==typeofSymbol&&Symbol.iteratorinObject(t))returnArray.from(t)}functiond(t){if(Array.isArray(t))returnh(t)}functionh(t,e){(null==e||e>t.length)&&(e=t.length);for(varn=0,o=newArray(e);n<e;n++)o[n]=t[n];returno}varg=null,m={data:function(){return{dataArr:[],ranking_selectShow:!1,selectValue:"",options:[],Rankdate:"",status:"1",cWidth:"",cHeight:"",pixelRatio:1,chartData:{categories:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],series:[{name:"申报电量",data:[100,200,300,400,500],color:"#1989FA"},{name:"实际用电量",data:[80,220,250,380,460],color:"#EC6045"}],maxValue:0},rankingdata:[],DeclarationElectricity:"45272kWh",actualPower:"45272kWh",endtime:"2021-01-25",selectshow:!1,tabbarIndex:1,tabbar:!1,tabindex:1,form:{num:"",month:"",letter:"",select:"",type:"",note:""},selectlist:[{value:"1",label:"正常申报"},{value:"2",label:"增产/减产"},{value:"3",label:"其他"}],enterpriseId:"",declarationDeadline:"",onDeclare:!1}},created:function(){},onLoad:function(){},onShow:function(){this.onDeclare=!1,this.getmonthlist(),this.enterpriseId=t.getStorageSync("user").enterpriseId;vare=t.getStorageSync("type"),n=t.getStorageSync("user");if(1==e){varo=n.userType;1!=o&&5!=o&&(this.tabbar=!0)}this.verification(this.enterpriseId)},methods:{clickTab:function(t){this.tabindex=t,2==t?this.getstatistics(this.enterpriseId):3==t&&this.getranking()},showLineA:function(t,e){console.log("canvaLineA"),g=newi.default({$this:o,canvasId:t,type:"line",fontSize:11,legend:{show:!0},dataLabel:!1,dataPointShape:!0,background:"#FFFFFF",pixelRatio:o.pixelRatio,categories:e.categories,series:e.series,animation:!0,xAxis:{type:"grid",gridColor:"#fff",gridType:"solid",dashLength:8},yAxis:{gridType:"solid",gridColor:"#F2F2F2",splitNumber:5,min:0,max:e.maxValue},width:o.cWidth*o.pixelRatio,height:o.cHeight*o.pixelRatio,extra:{line:{type:"straight"}}})},touchLineA:function(t){g.showToolTip(t,{format:function(t,e){returne+" "+t.name+":"+t.data}})},getstatistics:function(e){varn=this;(0,r.get)(a.default.reportStatistics,{enterpriseId:e}).then((function(e){if(200==e.code){n.chartData.series[0].data=e.data.reportElectricityList,n.chartData.series[1].data=e.data.actualElectricityList,n.DeclarationElectricity=e.data.totalReportElectricity,n.actualPower=e.data.totalActualUserElectricity,n.declarationDeadline=e.data.declarationDeadline;vari=Math.max.apply(Math,s(e.data.reportElectricityList)),r=Math.max.apply(Math,s(e.data.actualElectricityList)),a=i>r?i:r;n.chartData.maxValue=1.2*a,o=n,n.cWidth=t.upx2px(670),n.cHeight=t.upx2px(500),n.showLineA("canvasLineA",n.chartData)}elseconsole.log(e.msg)}))},getranking:function(){vart=this;(0,r.get)(a.default.reportRank,{date:t.Rankdate}).then((function(e){200==e.code?t.rankingdata=e.data:console.log(e.msg)}))},declareClick:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;returne&&n.electricityDeclaration&&1==n.electricityDeclaration?(t.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1):!this.form.num||isNaN(this.form.num)?(t.showToast({title:"请输入申报电量",icon:"none"}),!1):this.form.select?this.form.letter?"正常申报"!=this.form.select&&""==this.form.note&&""!=this.form.select?(t.showToast({title:"请填写备注",icon:"none"}),!1):voidthis.declarereport():(t.showToast({title:"请上传确认函",icon:"none"}),!1):(t.showToast({title:"请选择申报类型",icon:"none"}),!1)},declarereport:function(){vare=this;this.onDeclare=!0;varn=newDate,o=n.getDate();(0,r.post)(a.default.report,{userId:this.enterpriseId,reportElectricity:Number(this.form.num),month:this.form.month+"-"+o,type:this.form.type,reportImage:this.form.letter,remark:this.form.note}).then((function(n){if(200==n.code){t.showToast({title:"电量申报成功!"});varo=setTimeout((function(){t.navigateTo({url:"/pages/declare/DeclareHistory"}),clearTimeout(o)}),1500)}elset.showToast({title:n.msg,icon:"none"}),e.onDeclare=!1}))},Download:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;if(n&&e&&1==n.electricityDeclaration)returnt.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1;if(!this.form.num)returnt.showToast({title:"请输入申报电量",icon:"none"}),!1;(0,r.get)(a.default.downloadTemplate,{month:this.form.month+"-10",reportElectricity:this.form.num}).then((function(e){if(200==e.code){varn=e.msg.replace("http:","https:"),o=t.downloadFile({url:n,filePath:wx.env.USER_DATA_PATH+"/月度委托电量确认函.docx",success:function(e){200==e.statusCode&&t.openDocument({filePath:e.filePath,showMenu:!0,success:function(){console.log("打开文档成功")}})}});o.onProgressUpdate((function(t){console.log("下载进度"+t.progress),console.log("已经下载的数据长度"+t.totalBytesWritten),console.log("预期需要下载的数据总长度"+t.totalBytesExpectedToWrite)}))}elset.showToast({title:e.msg,icon:"none"})}))},chooseImg:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;if(n&&e&&1==n.electricityDeclaration)returnt.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1;varo=this;t.chooseImage({count:1,sizeType:["original","compressed"],success:function(e){varn=e.tempFilePaths;t.getStorageSync("token");t.uploadFile({url:a.default.uploadFile,filePath:n[0],name:"file",success:function(t){vare=JSON.parse(t.data).url;o.form.letter=e}})}})},linkto:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;if(n&&e&&1==n.electricityDeclaration)returnt.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1;console.log("1111111111111111111111111111"),t.navigateTo({url:"./DeclareHistory"})},selectconfirm:function(t){this.form.select=t[0].label,this.form.type=t[0].value},getmonth:function(){vart=this.declarationDeadline;console.log(t),""!=t&&null!=t&&"null"!=t||(t="25"),0==t.indexOf("0")&&(t=t.slice(1));vare=(0,r.getDate)().split("-")[0],n=(0,r.getDate)().split("-")[1];0==n.indexOf("0")&&(n=n.slice(1)),console.log(n);varo=(0,r.getDate)().split("-")[2];0==o.indexOf("0")&&(o=o.slice(1)),12==n?(e=Number(e)+1,n=1):n=Number(n)+1,Number(t)<Number(o)&&(12==n?(e=Number(e)+1,n=1):n+=1),n<10&&(n="0"+n),o<10&&(o="0"+o),this.form.month=e+"-"+n},clickSelect:function(){console.log(this.ranking_selectShow),this.ranking_selectShow=!this.ranking_selectShow},getValue:function(t){this.selectValue=this.options[t],console.log(this.selectValue),this.ranking_selectShow=!1;vare=newDate,n=e.getDate();n<10&&(n="0"+n),this.Rankdate=this.dataArr[t]+"-"+n,this.getranking()},getmonthlist:function(){vart=this,e=newDate;e.getFullYear();e.setMonth(e.getMonth()+2,1);for(varn=0;n<12;n++){e.setMonth(e.getMonth()-1);varo=e.getMonth()+1;o=o<10?"0"+o:o,t.dataArr.push(e.getFullYear()+"-"+o)}t.dataArr.map((function(e){varn=e.split("-")[0]+"年",o=e.split("-")[1]+"月";0==o.indexOf("0")&&(o=o.slice(1)),t.options.push(n+o)})),t.selectValue=t.options[1]},verification:function(t){vare=this;(0,r.get)(a.default.reportElectric,{enterpriseId:t}).then((function(t){t.sign?(e.status=1,e.declarationDeadline=t.declarationDeadline,e.getmonth()):e.status=0}))}}};e.default=m}).call(this,n("543d")["default"])},3506:function(t,e,n){"use strict";varo=n("c004"),i=n.n(o);i.a},7181:function(t,e,n){"use strict";n.r(e);varo=n("169e"),i=n.n(o);for(varrino)"default"!==r&&function(t){n.d(e,t,(function(){returno[t]}))}(r);e["default"]=i.a},9783:function(t,e,n){"use strict";n.d(e,"b",(function(){returni})),n.d(e,"c",(function(){returnr})),n.d(e,"a",(function(){returno}));varo={uForm:function(){returnn.e("uview-ui/components/u-form/u-form").then(n.bind(null,"b644"))},uFormItem:function(){returnPromise.all([n.e("common/vendor"),n.e("uview-ui/components/u-form-item/u-form-item")]).then(n.bind(null,"a3d2"))},uInput:function(){returnPromise.all([n.e("common/vendor"),n.e("uview-ui/components/u-input/u-input")]).then(n.bind(null,"f735"))},uSelect:function(){returnn.e("uview-ui/components/u-select/u-select").then(n.bind(null,"fc7a"))}},i=function(){vart=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){t.selectshow=!0},t.e1=function(e){t.ranking_selectShow=!1})},r=[]},c004:function(t,e,n){},dc89:function(t,e,n){"use strict";(function(t){n("78ef");o(n("66fd"));vare=o(n("fd84"));functiono(t){returnt&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},fd84:function(t,e,n){"use strict";n.r(e);varo=n("9783"),i=n("7181");for(varrini)"default"!==r&&function(t){n.d(e,t,(function(){returni[t]}))}(r);n("3506");vara,c=n("f0c5"),s=Object(c["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],a);e["default"]=s.exports}},[["dc89","common/runtime","common/vendor"]]]);
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesA/dianliangshengbao/shengbao"],{"0104":function(t,e,n){"use strict";varo=n("cc40"),i=n.n(o);i.a},"67de":function(t,e,n){"use strict";n.d(e,"b",(function(){returni})),n.d(e,"c",(function(){returnr})),n.d(e,"a",(function(){returno}));varo={uForm:function(){returnn.e("uview-ui/components/u-form/u-form").then(n.bind(null,"b644"))},uFormItem:function(){returnPromise.all([n.e("common/vendor"),n.e("uview-ui/components/u-form-item/u-form-item")]).then(n.bind(null,"a3d2"))},uInput:function(){returnPromise.all([n.e("common/vendor"),n.e("uview-ui/components/u-input/u-input")]).then(n.bind(null,"f735"))},uSelect:function(){returnn.e("uview-ui/components/u-select/u-select").then(n.bind(null,"fc7a"))}},i=function(){vart=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){t.selectshow=!0},t.e1=function(e){t.ranking_selectShow=!1})},r=[]},"90d9":function(t,e,n){"use strict";n.r(e);varo=n("67de"),i=n("abe4");for(varrini)"default"!==r&&function(t){n.d(e,t,(function(){returni[t]}))}(r);n("0104");vara,c=n("f0c5"),s=Object(c["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],a);e["default"]=s.exports},abe4:function(t,e,n){"use strict";n.r(e);varo=n("f2cb"),i=n.n(o);for(varrino)"default"!==r&&function(t){n.d(e,t,(function(){returno[t]}))}(r);e["default"]=i.a},cc40:function(t,e,n){},e702:function(t,e,n){"use strict";(function(t){n("78ef");o(n("66fd"));vare=o(n("90d9"));functiono(t){returnt&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},f2cb:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void0;varo,i=c(n("8f6c")),r=n("86df"),a=c(n("9036"));functionc(t){returnt&&t.__esModule?t:{default:t}}functions(t){returnd(t)||f(t)||u(t)||l()}functionl(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}functionu(t,e){if(t){if("string"===typeoft)returnh(t,e);varn=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(t,e):void0}}functionf(t){if("undefined"!==typeofSymbol&&Symbol.iteratorinObject(t))returnArray.from(t)}functiond(t){if(Array.isArray(t))returnh(t)}functionh(t,e){(null==e||e>t.length)&&(e=t.length);for(varn=0,o=newArray(e);n<e;n++)o[n]=t[n];returno}varg=null,m={data:function(){return{dataArr:[],ranking_selectShow:!1,selectValue:"",options:[],Rankdate:"",status:"1",cWidth:"",cHeight:"",pixelRatio:1,chartData:{categories:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],series:[{name:"申报电量",data:[],color:"#1989FA"},{name:"实际用电量",data:[],color:"#EC6045"}],maxValue:0},rankingdata:[],DeclarationElectricity:"45272kWh",actualPower:"45272kWh",endtime:"2021-01-25",selectshow:!1,tabbarIndex:1,tabbar:!1,tabindex:1,form:{num:"",month:"",letter:"",select:"",type:"",note:""},selectlist:[{value:"1",label:"正常申报"},{value:"2",label:"增产/减产"},{value:"3",label:"其他"}],enterpriseId:"",declarationDeadline:""}},created:function(){},onLoad:function(){},onShow:function(){this.enterpriseId=t.getStorageSync("user").enterpriseId,this.getmonthlist();vare=t.getStorageSync("type"),n=t.getStorageSync("user");if(1==e){varo=n.userType;1!=o&&5!=o&&(this.tabbar=!0)}this.verification(this.enterpriseId)},methods:{clickTab:function(t){this.tabindex=t,2==t?this.getstatistics(this.enterpriseId):3==t&&this.getranking()},showLineA:function(t,e){console.log("canvaLineA"),g=newi.default({$this:o,canvasId:t,type:"line",fontSize:11,legend:{show:!0},dataLabel:!1,dataPointShape:!0,background:"#FFFFFF",pixelRatio:o.pixelRatio,categories:e.categories,series:e.series,animation:!0,xAxis:{type:"grid",gridColor:"#fff",gridType:"solid",dashLength:8},yAxis:{gridType:"solid",gridColor:"#F2F2F2",splitNumber:5,min:0,max:e.maxValue},width:o.cWidth*o.pixelRatio,height:o.cHeight*o.pixelRatio,extra:{line:{type:"straight"}}})},touchLineA:function(t){g.showToolTip(t,{format:function(t,e){returne+" "+t.name+":"+t.data}})},getstatistics:function(e){varn=this;(0,r.get)(a.default.reportStatistics,{enterpriseId:e}).then((function(e){if(200==e.code){n.chartData.series[0].data=e.data.reportElectricityList,n.chartData.series[1].data=e.data.actualElectricityList,n.DeclarationElectricity=e.data.totalReportElectricity,n.actualPower=e.data.totalActualUserElectricity;vari=Math.max.apply(Math,s(e.data.reportElectricityList)),r=Math.max.apply(Math,s(e.data.actualElectricityList)),a=i>r?i:r;n.chartData.maxValue=1.2*a,o=n,n.cWidth=t.upx2px(670),n.cHeight=t.upx2px(500),n.showLineA("canvasLineA",n.chartData)}elseconsole.log(e.msg)}))},getranking:function(){vart=this;(0,r.get)(a.default.reportRank,{date:t.Rankdate}).then((function(e){200==e.code?t.rankingdata=e.data:console.log(e.msg)}))},declareClick:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;returne&&n.electricityDeclaration&&1==n.electricityDeclaration?(t.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1):!this.form.num||isNaN(this.form.num)?(t.showToast({title:"请输入申报电量",icon:"none"}),!1):this.form.select?this.form.letter?"正常申报"!=this.form.select&&""==this.form.note&&""!=this.form.select?(t.showToast({title:"请填写备注",icon:"none"}),!1):voidthis.declarereport():(t.showToast({title:"请上传确认函",icon:"none"}),!1):(t.showToast({title:"请选择申报类型",icon:"none"}),!1)},declarereport:function(){vare=newDate,n=e.getDate();(0,r.post)(a.default.report,{userId:this.enterpriseId,reportElectricity:Number(this.form.num),month:this.form.month+"-"+n,type:this.form.type,reportImage:this.form.letter,remark:this.form.note}).then((function(e){200==e.code?t.showToast({title:"申报成功!"}):t.showToast({title:e.msg,icon:"none"})}))},Download:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;if(n&&e&&1==n.electricityDeclaration)returnt.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1;if(!this.form.num)returnt.showToast({title:"请输入申报电量",icon:"none"}),!1;(0,r.get)(a.default.downloadTemplate,{month:this.form.month+"-10",reportElectricity:this.form.num}).then((function(e){if(200==e.code){varn=e.msg.replace("http","https"),o=t.downloadFile({url:n,filePath:wx.env.USER_DATA_PATH+"/月度委托电量确认函.docx",success:function(e){200==e.statusCode&&t.openDocument({filePath:e.filePath,showMenu:!0,success:function(){console.log("打开文档成功")}})}});o.onProgressUpdate((function(t){console.log("下载进度"+t.progress),console.log("已经下载的数据长度"+t.totalBytesWritten),console.log("预期需要下载的数据总长度"+t.totalBytesExpectedToWrite)}))}elset.showToast({title:e.msg,icon:"none"})}))},chooseImg:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;if(n&&e&&1==n.electricityDeclaration)returnt.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1;varo=this;t.chooseImage({count:1,sizeType:["original","compressed"],success:function(e){varn=e.tempFilePaths;t.getStorageSync("token");t.uploadFile({url:a.default.uploadFile,filePath:n[0],name:"file",success:function(t){vare=JSON.parse(t.data).url;o.form.letter=e}})}})},linkto:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;if(n&&e&&1==n.electricityDeclaration)returnt.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1;t.navigateTo({url:"/pages/declare/DeclareHistory"})},selectconfirm:function(t){this.form.select=t[0].label,this.form.type=t[0].value},getmonth:function(){vart=this.declarationDeadline;""!=t&&null!=t&&"null"!=t||(t="25"),0==t.indexOf("0")&&(t=t.slice(1));vare=(0,r.getDate)().split("-")[0],n=(0,r.getDate)().split("-")[1];0==n.indexOf("0")&&(n=n.slice(1));varo=(0,r.getDate)().split("-")[2];0==o.indexOf("0")&&(o=o.slice(1)),12==n?(e=Number(e)+1,n=1):n=Number(n)+1,Number(t)<Number(o)&&(12==n?(e=Number(e)+1,n=1):n+=1),n<10&&(n="0"+n),o<10&&(o="0"+o),this.form.month=e+"-"+n},clickSelect:function(){console.log(this.ranking_selectShow),this.ranking_selectShow=!this.ranking_selectShow},getValue:function(t){this.selectValue=this.options[t],console.log(this.selectValue),this.ranking_selectShow=!1;vare=newDate,n=e.getDate();n<10&&(n="0"+n),this.Rankdate=this.dataArr[t]+"-"+n,this.getranking()},getmonthlist:function(){vart=this,e=newDate;e.getFullYear();e.setMonth(e.getMonth()+2,1);for(varn=0;n<12;n++){e.setMonth(e.getMonth()-1);varo=e.getMonth()+1;o=o<10?"0"+o:o,t.dataArr.push(e.getFullYear()+"-"+o)}t.dataArr.map((function(e){varn=e.split("-")[0]+"年",o=e.split("-")[1]+"月";0==o.indexOf("0")&&(o=o.slice(1)),t.options.push(n+o)})),t.selectValue=t.options[1]},verification:function(t){vare=this;(0,r.get)(a.default.reportElectric,{enterpriseId:t}).then((function(t){t.sign?(e.status=1,e.declarationDeadline=t.declarationDeadline,e.getmonth()):e.status=0}))}}};e.default=m}).call(this,n("543d")["default"])}},[["e702","common/runtime","common/vendor"]]]);
=======
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesA/dianliangshengbao/shengbao"],{"08f9":function(t,e,n){},"0e66":function(t,e,n){"use strict";n.d(e,"b",(function(){returni})),n.d(e,"c",(function(){returna})),n.d(e,"a",(function(){returno}));varo={uForm:function(){returnn.e("uview-ui/components/u-form/u-form").then(n.bind(null,"9abc"))},uFormItem:function(){returnPromise.all([n.e("common/vendor"),n.e("uview-ui/components/u-form-item/u-form-item")]).then(n.bind(null,"546a"))},uInput:function(){returnPromise.all([n.e("common/vendor"),n.e("uview-ui/components/u-input/u-input")]).then(n.bind(null,"6696"))},uSelect:function(){returnn.e("uview-ui/components/u-select/u-select").then(n.bind(null,"03f3"))}},i=function(){vart=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){t.selectshow=!0},t.e1=function(e){t.ranking_selectShow=!1})},a=[]},"2b37":function(t,e,n){"use strict";n.r(e);varo=n("0e66"),i=n("b412");for(varaini)"default"!==a&&function(t){n.d(e,t,(function(){returni[t]}))}(a);n("32a8");varr,s=n("f0c5"),c=Object(s["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],r);e["default"]=c.exports},"32a8":function(t,e,n){"use strict";varo=n("08f9"),i=n.n(o);i.a},b412:function(t,e,n){"use strict";n.r(e);varo=n("b9b1"),i=n.n(o);for(varaino)"default"!==a&&function(t){n.d(e,t,(function(){returno[t]}))}(a);e["default"]=i.a},b9b1:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void0;varo,i=s(n("55c8")),a=n("a000"),r=s(n("7363"));functions(t){returnt&&t.__esModule?t:{default:t}}functionc(t){returnh(t)||f(t)||u(t)||l()}functionl(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}functionu(t,e){if(t){if("string"===typeoft)returnd(t,e);varn=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void0}}functionf(t){if("undefined"!==typeofSymbol&&Symbol.iteratorinObject(t))returnArray.from(t)}functionh(t){if(Array.isArray(t))returnd(t)}functiond(t,e){(null==e||e>t.length)&&(e=t.length);for(varn=0,o=newArray(e);n<e;n++)o[n]=t[n];returno}varg=null,m={data:function(){return{dataArr:[],ranking_selectShow:!1,selectValue:"",options:[],Rankdate:"",status:"1",cWidth:"",cHeight:"",pixelRatio:1,chartData:{categories:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],series:[{name:"申报电量",data:[],color:"#1989FA"},{name:"实际用电量",data:[],color:"#EC6045"}],maxValue:0},rankingdata:[],DeclarationElectricity:"45272kWh",actualPower:"45272kWh",endtime:"2021-01-25",selectshow:!1,tabbarIndex:1,tabbar:!1,tabindex:1,form:{num:"",month:"",letter:"",select:"",type:"",note:""},selectlist:[{value:"1",label:"正常申报"},{value:"2",label:"增产/减产"},{value:"3",label:"其他"}],enterpriseId:"",declarationDeadline:"",onDeclare:!1}},created:function(){},onLoad:function(){},onShow:function(){this.onDeclare=!1,this.enterpriseId=t.getStorageSync("user").enterpriseId,this.getmonthlist();vare=t.getStorageSync("type"),n=t.getStorageSync("user");if(1==e){varo=n.userType;1!=o&&5!=o&&(this.tabbar=!0)}this.verification(this.enterpriseId)},methods:{clickTab:function(t){this.tabindex=t,2==t?this.getstatistics(this.enterpriseId):3==t&&this.getranking()},showLineA:function(t,e){console.log("canvaLineA"),g=newi.default({$this:o,canvasId:t,type:"line",fontSize:11,legend:{show:!0},dataLabel:!1,dataPointShape:!0,background:"#FFFFFF",pixelRatio:o.pixelRatio,categories:e.categories,series:e.series,animation:!0,xAxis:{type:"grid",gridColor:"#fff",gridType:"solid",dashLength:8},yAxis:{gridType:"solid",gridColor:"#F2F2F2",splitNumber:5,min:0,max:e.maxValue},width:o.cWidth*o.pixelRatio,height:o.cHeight*o.pixelRatio,extra:{line:{type:"straight"}}})},touchLineA:function(t){g.showToolTip(t,{format:function(t,e){returne+" "+t.name+":"+t.data}})},getstatistics:function(e){varn=this;(0,a.get)(r.default.reportStatistics,{enterpriseId:e}).then((function(e){if(200==e.code){n.chartData.series[0].data=e.data.reportElectricityList,n.chartData.series[1].data=e.data.actualElectricityList,n.DeclarationElectricity=e.data.totalReportElectricity,n.actualPower=e.data.totalActualUserElectricity;vari=Math.max.apply(Math,c(e.data.reportElectricityList)),a=Math.max.apply(Math,c(e.data.actualElectricityList)),r=i>a?i:a;n.chartData.maxValue=1.2*r,o=n,n.cWidth=t.upx2px(670),n.cHeight=t.upx2px(500),n.showLineA("canvasLineA",n.chartData)}elseconsole.log(e.msg)}))},getranking:function(){vart=this;(0,a.get)(r.default.reportRank,{date:t.Rankdate}).then((function(e){200==e.code?t.rankingdata=e.data:console.log(e.msg)}))},declareClick:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;returne&&n.electricityDeclaration&&1==n.electricityDeclaration?(t.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1):!this.form.num||isNaN(this.form.num)?(t.showToast({title:"请输入申报电量",icon:"none"}),!1):this.form.select?this.form.letter?"正常申报"!=this.form.select&&""==this.form.note&&""!=this.form.select?(t.showToast({title:"请填写备注",icon:"none"}),!1):voidthis.declarereport():(t.showToast({title:"请上传确认函",icon:"none"}),!1):(t.showToast({title:"请选择申报类型",icon:"none"}),!1)},declarereport:function(){vare=this;this.onDeclare=!0;varn=newDate,o=n.getDate();(0,a.post)(r.default.report,{userId:this.enterpriseId,reportElectricity:Number(this.form.num),month:this.form.month+"-"+o,type:this.form.type,reportImage:this.form.letter,remark:this.form.note}).then((function(n){if(200==n.code){t.showToast({title:"电量申报成功!"});varo=setTimeout((function(){t.navigateTo({url:"/pages/declare/DeclareHistory"}),clearTimeout(o)}),1500)}elset.showToast({title:n.msg,icon:"none"}),e.onDeclare=!1}))},Download:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;if(n&&e&&1==n.electricityDeclaration)returnt.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1;if(!this.form.num)returnt.showToast({title:"请输入申报电量",icon:"none"}),!1;(0,a.get)(r.default.downloadTemplate,{month:this.form.month+"-10",reportElectricity:this.form.num}).then((function(e){if(200==e.code){varn=e.msg.replace("http:","https:"),o=t.downloadFile({url:n,filePath:wx.env.USER_DATA_PATH+"/月度委托电量确认函.docx",success:function(e){200==e.statusCode&&t.openDocument({filePath:e.filePath,showMenu:!0,success:function(){console.log("打开文档成功")}})}});o.onProgressUpdate((function(t){console.log("下载进度"+t.progress),console.log("已经下载的数据长度"+t.totalBytesWritten),console.log("预期需要下载的数据总长度"+t.totalBytesExpectedToWrite)}))}elset.showToast({title:e.msg,icon:"none"})}))},chooseImg:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;if(n&&e&&1==n.electricityDeclaration)returnt.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1;varo=this;t.chooseImage({count:1,sizeType:["original","compressed"],success:function(e){varn=e.tempFilePaths;t.getStorageSync("token");t.uploadFile({url:r.default.uploadFile,filePath:n[0],name:"file",success:function(t){vare=JSON.parse(t.data).url;o.form.letter=e}})}})},linkto:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;if(n&&e&&1==n.electricityDeclaration)returnt.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1;t.navigateTo({url:"/pages/declare/DeclareHistory"})},selectconfirm:function(t){this.form.select=t[0].label,this.form.type=t[0].value},getmonth:function(){vart=this.declarationDeadline;""!=t&&null!=t&&"null"!=t||(t="25"),0==t.indexOf("0")&&(t=t.slice(1));vare=(0,a.getDate)().split("-")[0],n=(0,a.getDate)().split("-")[1];0==n.indexOf("0")&&(n=n.slice(1));varo=(0,a.getDate)().split("-")[2];0==o.indexOf("0")&&(o=o.slice(1)),12==n?(e=Number(e)+1,n=1):n=Number(n)+1,Number(t)<Number(o)&&(12==n?(e=Number(e)+1,n=1):n+=1),n<10&&(n="0"+n),o<10&&(o="0"+o),this.form.month=e+"-"+n},clickSelect:function(){console.log(this.ranking_selectShow),this.ranking_selectShow=!this.ranking_selectShow},getValue:function(t){this.selectValue=this.options[t],console.log(this.selectValue),this.ranking_selectShow=!1;vare=newDate,n=e.getDate();n<10&&(n="0"+n),this.Rankdate=this.dataArr[t]+"-"+n,this.getranking()},getmonthlist:function(){vart=this,e=newDate;e.getFullYear();e.setMonth(e.getMonth()+2,1);for(varn=0;n<12;n++){e.setMonth(e.getMonth()-1);varo=e.getMonth()+1;o=o<10?"0"+o:o,t.dataArr.push(e.getFullYear()+"-"+o)}t.dataArr.map((function(e){varn=e.split("-")[0]+"年",o=e.split("-")[1]+"月";0==o.indexOf("0")&&(o=o.slice(1)),t.options.push(n+o)})),t.selectValue=t.options[1]},verification:function(t){vare=this;(0,a.get)(r.default.reportElectric,{enterpriseId:t}).then((function(t){t.sign?(e.status=1,e.declarationDeadline=t.declarationDeadline,e.getmonth()):e.status=0}))}}};e.default=m}).call(this,n("543d")["default"])},d822:function(t,e,n){"use strict";(function(t){n("0cf7");o(n("66fd"));vare=o(n("2b37"));functiono(t){returnt&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])}},[["d822","common/runtime","common/vendor"]]]);
>>>>>>>6564f8bb0059b03adf3e16712c15e2f07b7e6bbf
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesA/dianliangshengbao/shengbao"],{"0104":function(t,e,n){"use strict";varo=n("cc40"),i=n.n(o);i.a},2380:function(t,e,n){"use strict";n.d(e,"b",(function(){returni})),n.d(e,"c",(function(){returnr})),n.d(e,"a",(function(){returno}));varo={uForm:function(){returnn.e("uview-ui/components/u-form/u-form").then(n.bind(null,"b644"))},uFormItem:function(){returnPromise.all([n.e("common/vendor"),n.e("uview-ui/components/u-form-item/u-form-item")]).then(n.bind(null,"a3d2"))},uInput:function(){returnPromise.all([n.e("common/vendor"),n.e("uview-ui/components/u-input/u-input")]).then(n.bind(null,"f735"))},uSelect:function(){returnn.e("uview-ui/components/u-select/u-select").then(n.bind(null,"fc7a"))}},i=function(){vart=this,e=t.$createElement;t._self._c;t._isMounted||(t.e0=function(e){t.selectshow=!0},t.e1=function(e){t.ranking_selectShow=!1})},r=[]},"90d9":function(t,e,n){"use strict";n.r(e);varo=n("2380"),i=n("abe4");for(varrini)"default"!==r&&function(t){n.d(e,t,(function(){returni[t]}))}(r);n("0104");vara,c=n("f0c5"),s=Object(c["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],a);e["default"]=s.exports},abe4:function(t,e,n){"use strict";n.r(e);varo=n("f2cb"),i=n.n(o);for(varrino)"default"!==r&&function(t){n.d(e,t,(function(){returno[t]}))}(r);e["default"]=i.a},cc40:function(t,e,n){},e702:function(t,e,n){"use strict";(function(t){n("78ef");o(n("66fd"));vare=o(n("90d9"));functiono(t){returnt&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("543d")["createPage"])},f2cb:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void0;varo,i=c(n("8f6c")),r=n("86df"),a=c(n("9036"));functionc(t){returnt&&t.__esModule?t:{default:t}}functions(t){returnd(t)||f(t)||u(t)||l()}functionl(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}functionu(t,e){if(t){if("string"===typeoft)returnh(t,e);varn=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(t,e):void0}}functionf(t){if("undefined"!==typeofSymbol&&Symbol.iteratorinObject(t))returnArray.from(t)}functiond(t){if(Array.isArray(t))returnh(t)}functionh(t,e){(null==e||e>t.length)&&(e=t.length);for(varn=0,o=newArray(e);n<e;n++)o[n]=t[n];returno}varg=null,m={data:function(){return{dataArr:[],ranking_selectShow:!1,selectValue:"",options:[],Rankdate:"",status:"1",cWidth:"",cHeight:"",pixelRatio:1,chartData:{categories:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],series:[{name:"申报电量",data:[],color:"#1989FA"},{name:"实际用电量",data:[],color:"#EC6045"}],maxValue:0},rankingdata:[],DeclarationElectricity:"45272kWh",actualPower:"45272kWh",endtime:"2021-01-25",selectshow:!1,tabbarIndex:1,tabbar:!1,tabindex:1,form:{num:"",month:"",letter:"",select:"",type:"",note:""},selectlist:[{value:"1",label:"正常申报"},{value:"2",label:"增产/减产"},{value:"3",label:"其他"}],enterpriseId:"",declarationDeadline:"",onDeclare:!1}},created:function(){},onLoad:function(){},onShow:function(){this.onDeclare=!1,this.enterpriseId=t.getStorageSync("user").enterpriseId,this.getmonthlist();vare=t.getStorageSync("type"),n=t.getStorageSync("user");if(1==e){varo=n.userType;1!=o&&5!=o&&(this.tabbar=!0)}this.verification(this.enterpriseId)},methods:{clickTab:function(t){this.tabindex=t,2==t?this.getstatistics(this.enterpriseId):3==t&&this.getranking()},showLineA:function(t,e){console.log("canvaLineA"),g=newi.default({$this:o,canvasId:t,type:"line",fontSize:11,legend:{show:!0},dataLabel:!1,dataPointShape:!0,background:"#FFFFFF",pixelRatio:o.pixelRatio,categories:e.categories,series:e.series,animation:!0,xAxis:{type:"grid",gridColor:"#fff",gridType:"solid",dashLength:8},yAxis:{gridType:"solid",gridColor:"#F2F2F2",splitNumber:5,min:0,max:e.maxValue},width:o.cWidth*o.pixelRatio,height:o.cHeight*o.pixelRatio,extra:{line:{type:"straight"}}})},touchLineA:function(t){g.showToolTip(t,{format:function(t,e){returne+" "+t.name+":"+t.data}})},getstatistics:function(e){varn=this;(0,r.get)(a.default.reportStatistics,{enterpriseId:e}).then((function(e){if(200==e.code){n.chartData.series[0].data=e.data.reportElectricityList,n.chartData.series[1].data=e.data.actualElectricityList,n.DeclarationElectricity=e.data.totalReportElectricity,n.actualPower=e.data.totalActualUserElectricity;vari=Math.max.apply(Math,s(e.data.reportElectricityList)),r=Math.max.apply(Math,s(e.data.actualElectricityList)),a=i>r?i:r;n.chartData.maxValue=1.2*a,o=n,n.cWidth=t.upx2px(670),n.cHeight=t.upx2px(500),n.showLineA("canvasLineA",n.chartData)}elseconsole.log(e.msg)}))},getranking:function(){vart=this;(0,r.get)(a.default.reportRank,{date:t.Rankdate}).then((function(e){200==e.code?t.rankingdata=e.data:console.log(e.msg)}))},declareClick:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;returne&&n.electricityDeclaration&&1==n.electricityDeclaration?(t.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1):!this.form.num||isNaN(this.form.num)?(t.showToast({title:"请输入申报电量",icon:"none"}),!1):this.form.select?this.form.letter?"正常申报"!=this.form.select&&""==this.form.note&&""!=this.form.select?(t.showToast({title:"请填写备注",icon:"none"}),!1):voidthis.declarereport():(t.showToast({title:"请上传确认函",icon:"none"}),!1):(t.showToast({title:"请选择申报类型",icon:"none"}),!1)},declarereport:function(){vare=this;this.onDeclare=!0;varn=newDate,o=n.getDate();(0,r.post)(a.default.report,{userId:this.enterpriseId,reportElectricity:Number(this.form.num),month:this.form.month+"-"+o,type:this.form.type,reportImage:this.form.letter,remark:this.form.note}).then((function(n){if(200==n.code){t.showToast({title:"电量申报成功!"});varo=setTimeout((function(){t.navigateTo({url:"/pages/declare/DeclareHistory"}),clearTimeout(o)}),1500)}elset.showToast({title:n.msg,icon:"none"}),e.onDeclare=!1}))},Download:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;if(n&&e&&1==n.electricityDeclaration)returnt.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1;if(!this.form.num)returnt.showToast({title:"请输入申报电量",icon:"none"}),!1;(0,r.get)(a.default.downloadTemplate,{month:this.form.month+"-10",reportElectricity:this.form.num}).then((function(e){if(200==e.code){varn=e.msg.replace("http:","https:"),o=t.downloadFile({url:n,filePath:wx.env.USER_DATA_PATH+"/月度委托电量确认函.docx",success:function(e){200==e.statusCode&&t.openDocument({filePath:e.filePath,showMenu:!0,success:function(){console.log("打开文档成功")}})}});o.onProgressUpdate((function(t){console.log("下载进度"+t.progress),console.log("已经下载的数据长度"+t.totalBytesWritten),console.log("预期需要下载的数据总长度"+t.totalBytesExpectedToWrite)}))}elset.showToast({title:e.msg,icon:"none"})}))},chooseImg:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;if(n&&e&&1==n.electricityDeclaration)returnt.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1;varo=this;t.chooseImage({count:1,sizeType:["original","compressed"],success:function(e){varn=e.tempFilePaths;t.getStorageSync("token");t.uploadFile({url:a.default.uploadFile,filePath:n[0],name:"file",success:function(t){vare=JSON.parse(t.data).url;o.form.letter=e}})}})},linkto:function(){vare=t.getStorageSync("user").createById,n=t.getStorageSync("user").tenterpriseRole;if(n&&e&&1==n.electricityDeclaration)returnt.showToast({title:"你没有权限,无法申报电量,请联系管理员",icon:"none"}),!1;t.navigateTo({url:"/pages/declare/DeclareHistory"})},selectconfirm:function(t){this.form.select=t[0].label,this.form.type=t[0].value},getmonth:function(){vart=this.declarationDeadline;""!=t&&null!=t&&"null"!=t||(t="25"),0==t.indexOf("0")&&(t=t.slice(1));vare=(0,r.getDate)().split("-")[0],n=(0,r.getDate)().split("-")[1];0==n.indexOf("0")&&(n=n.slice(1));varo=(0,r.getDate)().split("-")[2];0==o.indexOf("0")&&(o=o.slice(1)),12==n?(e=Number(e)+1,n=1):n=Number(n)+1,Number(t)<Number(o)&&(12==n?(e=Number(e)+1,n=1):n+=1),n<10&&(n="0"+n),o<10&&(o="0"+o),this.form.month=e+"-"+n},clickSelect:function(){console.log(this.ranking_selectShow),this.ranking_selectShow=!this.ranking_selectShow},getValue:function(t){this.selectValue=this.options[t],console.log(this.selectValue),this.ranking_selectShow=!1;vare=newDate,n=e.getDate();n<10&&(n="0"+n),this.Rankdate=this.dataArr[t]+"-"+n,this.getranking()},getmonthlist:function(){vart=this,e=newDate;e.getFullYear();e.setMonth(e.getMonth()+2,1);for(varn=0;n<12;n++){e.setMonth(e.getMonth()-1);varo=e.getMonth()+1;o=o<10?"0"+o:o,t.dataArr.push(e.getFullYear()+"-"+o)}t.dataArr.map((function(e){varn=e.split("-")[0]+"年",o=e.split("-")[1]+"月";0==o.indexOf("0")&&(o=o.slice(1)),t.options.push(n+o)})),t.selectValue=t.options[1]},verification:function(t){vare=this;(0,r.get)(a.default.reportElectric,{enterpriseId:t}).then((function(t){t.sign?(e.status=1,e.declarationDeadline=t.declarationDeadline,e.getmonth()):e.status=0}))}}};e.default=m}).call(this,n("543d")["default"])}},[["e702","common/runtime","common/vendor"]]]);