const { getAllDictionarySelect, IMG_BASE_URL, WU_TU_PIAN_URL, getAllConditionList, findAllPlan,getKcFormSet } = require('../../../api/api') Component({ properties: { entryId: String, childObj:Object, }, data: { photo: { flyImgs: [], //无人机航拍图 roofPhotoOne:[],//安装区域整体照片 roofPhotoTwo:[],//安装区域东南角照片 roofPhotoThree:[],//安装区域西南角照片 roofPhotoFour:[],//安装区域正南照片 roofPhotoFive:[],//安装区域细节照片 roofPhotoFacade:[],//房屋内部结构照片 roofPhotoInterior:[],//房屋内部环境照片 detailSupplementOne:[],//逆变器、配电箱预安装位置照片 houseSupplementOne:[],//房屋其他障碍物照片 surveyVideo:[],//踏勘补充证明视频 surveyFiles:[],//踏勘记录表 vrRoofOne: [], //房屋整体图 vrRoofTwo: [], //房屋整体俯视图 vrRoofThree: [], //房屋内部结构图 vrRoofFour: [], //入户全景照片 houseOutlinePhoto:[], //房屋轮廓照片 designDrawings: [], //设计图纸 dzImgs: [], //组合图 }, photoTips:[ { showKey: 'fly_imgs', key:'flyImgs', num:9, minNum:3, title: '无人机航拍图', },{ showKey: 'roof_photo_one', key:'roofPhotoOne', num:9, minNum:2, title: '安装区域整体照片', },{ showKey: 'roof_photo_two', key:'roofPhotoTwo', num:9, minNum:1, title: '安装区域东南角照片', },{ showKey: 'roof_photo_four', key:'roofPhotoFour', num:9, minNum:1, title: '安装区域正南照片', },{ showKey: 'roof_photo_three', key:'roofPhotoThree', num:9, minNum:1, title: '安装区域西南角照片', },{ showKey: 'roof_photo_five', key:'roofPhotoFive', num:9, minNum:1, title: '安装区域细节照片', },{ showKey: 'roof_photo_interior', key:'roofPhotoInterior', num:9, minNum:2, title: '房屋内部环境照片', },{ showKey: 'roof_photo_facade', key:'roofPhotoFacade', num:9, minNum:2, title: '房屋内部结构照片', },{ showKey: 'detail_supplement_one', key:'detailSupplementOne', num:9, minNum:1, title: '逆变器、配电箱预安装位置照片', },{ showKey: 'house_outline_photo', key: 'houseOutlinePhoto', num: 9, minNum: 1, title: '房屋轮廓照片', },{ showKey: 'house_supplement_one', key:'houseSupplementOne', num:9, minNum:1, title: '房屋其他障碍物照片', },{ showKey: 'survey_files', key:'surveyFiles', num:4, title: '踏勘记录表', },{ showKey: 'roof_photo_one_03', key: 'roofPhotoOne', num: 9, minNum: 2, title: '房屋屋顶照片', },{ showKey: 'roof_photo_two_03', key: 'roofPhotoTwo', num: 9, minNum: 1, title: '房屋屋顶东侧图片', },{ showKey: 'roof_photo_three_03', key: 'roofPhotoThree', num: 9, minNum: 1, title: '房屋屋顶西侧图片', },{ showKey: 'roof_photo_four_03', key: 'roofPhotoFour', num: 9, minNum: 1, title: '房屋屋顶南侧图片', },{ showKey: 'fw_img3', key: 'fwImg3', num: 9, minNum: 1, title: '房屋屋顶东南侧图片', },{ showKey: 'fw_img4', key: 'fwImg4', num: 9, minNum: 1, title: '房屋屋顶西南侧图片', },{ showKey: 'fw_img5', key: 'fwImg5', num: 9, minNum: 1, title: '遮阴物与房屋距离、高度', },{ showKey: 'survey_video', key: 'surveyVideo', num: 8, minNum: 1, title: '踏勘补充证明视频', },{ showKey: 'house_ownership', key: 'houseOwnership', num: 8, minNum: 1, title: '房产证明', },{ showKey: 'survey_files_03', key: 'surveyFiles', num: 9, minNum: 1, title: '户用勘察记录表(附平面草图)', },{ showKey: 'fw_img1', key: 'fwImg1', num: 9, minNum: 1, title: '房屋整体图', },{ showKey: 'vr_roof_one', key: 'vrRoofOne', num: 9, minNum: 1, title: '房屋整体图(VR全景)', },{ showKey: 'vr_roof_two', key: 'vrRoofTwo', num: 9, minNum: 1, title: '房屋整体俯视图(无人机)', },{ showKey: 'vr_roof_three', key: 'vrRoofThree', num: 9, minNum: 1, title: '房屋内部结构图(VR)', },{ showKey: 'fw_img2', key: 'fwImg2', num: 9, minNum: 1, title: '房屋内部结构图', },{ showKey: 'vr_roof_four', key: 'vrRoofFour', num: 9, minNum: 1, title: '入户全景照片(VR)', },{ showKey: 'fly_imgs_04', key: 'flyImgs', num: 9, minNum: 3, title: '屋顶高空俯视照片', },{ showKey: 'roof_photo_two_04', key: 'roofPhotoTwo', num: 9, minNum: 1, title: '屋顶东南照片', },{ showKey: 'roof_photo_four_04', key: 'roofPhotoFour', num: 9, minNum: 1, title: '屋顶正南照片', },{ showKey: 'roof_photo_three_04', key: 'roofPhotoThree', num: 9, minNum: 1, title: '屋顶西南照片', },{ showKey: 'vr_roof_four_04', key: 'vrRoofFour', num: 9, minNum: 1, title: '入户全景照片', },{ showKey: 'survey_files_04', key: 'surveyFiles', num: 4, title: '现场勘测表', }], formSetObj: {}, //自定义字段 standardSolutionsList:[],//标准方案初始数量 combinedSolutionsList:[],//组合方案初始数量 planList:[],//方案 gridType: '0', gfRoofTypeList: [] }, ready(){ this.findAllPlan(); this.entryDetail(); }, methods:{ /** 获取自定义字段 */ getFormSet(partner) { getAllConditionList({ partner: partner, }).then((res) => { this.setData({ formSetObj: res.data }) }) if(partner == '03'){ getKcFormSet().then((res) => { if(res.data){ this.setData({ gfRoofTypeList: res.data, //广发--屋顶类型数据集合 }) } }) } }, //屋顶类型对应显示字段 roofTypeToColumn(name){ this.data.gfRoofTypeList.forEach(item=>{ if(name == item.roofType){ let selectRoofType = item.forms.map(itm=>{return itm.columns}); let roofTypeAllColumn = {} selectRoofType.forEach(item2=>{ roofTypeAllColumn[item2.column_key] = { status: 1, must_fill_flag: item2.must_fill_flag } }) // console.log(555, roofTypeAllColumn) this.setData({ roofTypeAllColumn }) } }) }, /*** 获取字典 */ getDictionaryList(partner, callback) { getAllDictionarySelect({ capitalId: partner, }).then((res) => { if(res.data){ this.setData({ angleAzimuthSel: res.data.angle_azimuth.map(item=>item.columns), //方位角 }) } if(callback) callback(res.data) }) }, /** 获取电站详情 **/ entryDetail(e) { let that = this let res = JSON.parse(JSON.stringify(this.data.childObj)); // 组件,逆变器,并网箱,支架 var componentNum = 0; var componentList = []; var converterList = []; var cagesList = []; var zhijList = []; if (res.componentList.length > 0) { for (let i = 0; i < res.componentList.length; i++) { const element = res.componentList[i]; var OB = { id: "", num: "", //数量 model: "", //名称 addType: 0, } if (element.item_type == 3) { OB.id = element.item_id; OB.num = element.num; OB.model = element.model; OB.material_model = element.material_model; componentNum = element.num * element.model + componentNum componentList.push(OB) } else if (element.item_type == 1) { OB.id = element.item_id; OB.num = element.num; OB.model = element.model; OB.material_model = element.material_model; converterList.push(OB) } else if (element.item_type == 2) { OB.id = element.item_id; OB.num = element.num; OB.model = element.model; cagesList.push(OB) } else if (element.item_type == 4) { OB.id = element.item_id; OB.num = element.num; OB.model = element.model; zhijList.push(OB) } } } //保险购买情况 if (res.insurance_flag == 1) { this.setData({ insuranceName: "控制投放及续保" }) } else if (res.insurance_flag == 2) { this.setData({ insuranceName: "控制投放" }) } else if (res.insurance_flag == 3) { this.setData({ insuranceName: "其他" }) } //方案信息-方案类型 if (res.scheme_type == 1) {//标准方案 this.setData({ [`standardSolutionsList[0].id`]: res.scheme_id ? res.scheme_id : '', [`standardSolutionsList[0].type`]: res.scheme_type_name ? res.scheme_type_name : '', [`standardSolutionsList[0].typeId`]: res.scheme_type_id ? res.scheme_type_id : '', [`standardSolutionsList[0].name`]: res.scheme_name ? res.scheme_name : "", }) } else if (res.scheme_type == 2) {//组合方案 if (res.composePlanList.length > 0) { var combinedSolutionsList = [] for (let i = 0; i < res.composePlanList.length; i++) { var combinedSolutionsListOB = {} const element = res.composePlanList[i]; if (i == 0) { combinedSolutionsListOB.addType = 1; } combinedSolutionsListOB.code = element.code; combinedSolutionsListOB.id = element.planId; combinedSolutionsListOB.name = element.name; combinedSolutionsListOB.type = element.planType; combinedSolutionsListOB.planTypeId = element.planTypeId; for (let i = 0; i < that.data.planList.length; i++) { const planTypeObj = that.data.planList[i]; if (planTypeObj.allPlan.length > 0) { for (let j = 0; j < planTypeObj.allPlan.length; j++) { const plan = planTypeObj.allPlan[j]; if (plan.id == element.planId) { combinedSolutionsListOB.pickerIndex = i } } } } combinedSolutionsList.push(combinedSolutionsListOB) } this.setData({ combinedSolutionsList: combinedSolutionsList }) } } this.setData({ detail: res, id: res.id, //修改数据的时候传此ID projectId: res.project_id, tenant_type: res.tenant_type=='1' ? '个人' : '单位',//1.个人,2单位 //业主信息参数 name: res.tenant_name, phone: res.mobile, provinceName: res.province, cityName: res.city, areaName: res.area, address: res.address, //项目信息 capitalId: res.zfId, //资方Id capitalName: res.zfName, //资方 projectName: res.projectName,//产品名称 companyName: res.project_company_name,//项目公司 filingName: res.filing_type=='1' ? '农户备案' : '项目公司备案',//备案类型 leaseDate: res.leaseDate ? res.leaseDate : '',//预计投放日 repaymentMethod: res.repayment_method,//划转方式 //如果租金划转方式是二类卡,那么二类卡的信息 显示这个 secCardName:res.secCardName ? res.secCardName : '',//二类卡账户名 secCardNo:res.secCardNo ? res.secCardNo : '',//二类卡账号 secBankNumber:res.secBankNumber ? res.secBankNumber : '',//二类卡联行号 bankName: res.bank_name ? res.bank_name : '', //卡账号名称 bankCode: res.bank_code ? res.bank_code : '', //卡账号 tssBankNum: res.tss_bank_num ? res.tss_bank_num : '', //卡开户行 longitude: res.longitude, //经度 latitude: res.latitude, //纬度 //房屋信息 roofType: res.roof_type, sealRoof:res.seal_roof,//是否封屋顶,1是,2.否 completionYear:res.completion_year ? res.completion_year : '',//房屋建成年份 slopeGradient:res.slope_gradient ? res.slope_gradient : '',//屋面坡度 purlineInterval:res.purline_interval ? res.purline_interval : '',//檀条间距 waterproof:res.waterproof ? res.waterproof : '',//屋顶防水情况 sourcePollution:res.source_pollution ? res.source_pollution : '',//是否有污染源 opsCondition:res.ops_condition ? res.ops_condition : '',//是否具备运维空间 voltageClasses:res.voltage_classes ? res.voltage_classes : '',//并网电压等级 transformerCapacity:res.transformer_capacity ? res.transformer_capacity : '',//变压器容量 restrictFlag:res.restrict_flag ? res.restrict_flag : '',//是否符合变压器容量限制要求 dipAngle:res.dip_angle ? res.dip_angle : '',//组件倾角 roofArea: res.roof_area, //屋顶面积 deg: res.distance,//配电箱至并网点距离 height: res.building_height,//建筑高度 azimuth: res.azimuth ? res.azimuth : 1,//方位角 directionDeg: res.angle,//方位角 ewLength: res.ew_length, //东西长 nsWide: res.ns_wide, //南北宽 roofFaceThickness: res.roof_face_thickness,//屋面板厚度 structureType: res.structure_type,//结构类型 siteSlope: res.site_slope,//场地坡度 groundType: res.ground_type,//地面类型 geologicalCondition: res.geological_condition,//地质情况 fenceHeight: res.fence_height,//围墙高度 //房屋信息-图片 [`photo.flyImgs`]:res.fly_imgs ? res.fly_imgs.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//无人机航拍图 [`photo.roofPhotoOne`]:res.roof_photo_one ? res.roof_photo_one.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//安装区域整体照片 [`photo.roofPhotoTwo`]:res.roof_photo_two ? res.roof_photo_two.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//安装区域东南角照片 [`photo.roofPhotoThree`]:res.roof_photo_three ? res.roof_photo_three.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//安装区域西南角照片 [`photo.roofPhotoFour`]:res.roof_photo_four ? res.roof_photo_four.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//安装区域正南照片 [`photo.roofPhotoFive`]:res.roof_photo_five ? res.roof_photo_five.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//安装区域细节照片 [`photo.roofPhotoInterior`]:res.roof_photo_interior ? res.roof_photo_interior.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//房屋内部环境照片 [`photo.roofPhotoFacade`]:res.roof_photo_facade ? res.roof_photo_facade.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//房屋内部结构照片 [`photo.detailSupplementOne`]:res.detail_supplement_one ? res.detail_supplement_one.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//逆变器、配电箱预安装位置照片 [`photo.houseSupplementOne`]:res.house_supplement_one ? res.house_supplement_one.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//房屋其他障碍物照片 [`photo.surveyVideo`]:res.survey_video ? res.survey_video.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//踏勘补充证明视频 [`photo.houseOwnership`]:res.house_ownership ? res.house_ownership.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [],//房产证 [`photo.surveyFiles`]:res.survey_files ? res.survey_files.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [],//踏勘记录表 [`photo.vrRoofOne`]: res.vr_roof_one ? res.vr_roof_one.split(",").map(itm => { return { name: itm, url: IMG_BASE_URL + itm}}) : [], //房屋整体图(VR全景) [`photo.vrRoofTwo`]: res.vr_roof_two ? res.vr_roof_two.split(",").map(itm => { return { name: itm, url: IMG_BASE_URL + itm}}) : [], //房屋整体俯视图(VR) [`photo.vrRoofThree`]: res.vr_roof_three ? res.vr_roof_three.split(",").map(itm => { return { name: itm, url: IMG_BASE_URL + itm}}) : [], //房屋内部结构图(VR) [`photo.vrRoofFour`]: res.vr_roof_four ? res.vr_roof_four.split(",").map(itm => { return { name: itm, url: IMG_BASE_URL + itm}}) : [], //入户全景照片(VR) [`photo.houseOutlinePhoto`]: res.house_outline_photo ? res.house_outline_photo.split(",").map(itm => { return { name: itm, url: IMG_BASE_URL + itm}}) : [], //房屋轮廓照片 //方案信息 componentNum: (componentNum/1000).toFixed(3),//设计安装容量 componentList: componentList,//组件 converterList: converterList,//逆变器 cagesList: cagesList,//并网箱 zhijList: zhijList,//支架 schemeType: res.scheme_type ? res.scheme_type : 1,//设计方案 solutionRemark: res.scheme_remarks ? res.scheme_remarks : '',//方案备注 [`photo.designDrawings`]: res.design_drawings ? res.design_drawings.split(",").map(itm => { return { name: itm, url: IMG_BASE_URL + itm } }) : [], //设计图纸 'photo.zjpbImg': res.zjpb_img ? res.zjpb_img.split(",").map(itm => {return {name: itm,url: IMG_BASE_URL + itm}}) : [], //组件排布图 'photo.zjzxImg': res.zjzx_img ? res.zjzx_img.split(",").map(itm => {return {name: itm,url: IMG_BASE_URL + itm}}) : [], //组件接线图 'photo.zjcsImg': res.zjcs_img ? res.zjcs_img.split(",").map(itm => {return {name: itm,url: IMG_BASE_URL + itm}}) : [], //组件支架图 'photo.zjhsImg': res.zjhs_img ? res.zjhs_img.split(",").map(itm => {return {name: itm,url: IMG_BASE_URL + itm}}) : [], //电气图 // [`photo.nbqwzImg[0].url`]: res.nbqwz_img ? IMG_BASE_URL + res.nbqwz_img : WU_TU_PIAN_URL, // [`photo.pdxwzImg[0].url`]: res.pdxwz_img ? IMG_BASE_URL + res.pdxwz_img : WU_TU_PIAN_URL, [`photo.dzImgs`]: res.dz_imgs ? res.dz_imgs.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//组合图 //2024-9-4 广发 'photo.fwImg1': res.fw_img1 ? res.fw_img1.split(",").map(itm => {return {name: itm,url: IMG_BASE_URL + itm}}) : [], //房屋整体图 'photo.fwImg2': res.fw_img2 ? res.fw_img2.split(",").map(itm => {return {name: itm,url: IMG_BASE_URL + itm}}) : [], //房屋内部结构图 'photo.fwImg3': res.fw_img3 ? res.fw_img3.split(",").map(itm => {return {name: itm,url: IMG_BASE_URL + itm}}) : [], //房屋屋顶东南侧图片 'photo.fwImg4': res.fw_img4 ? res.fw_img4.split(",").map(itm => {return {name: itm,url: IMG_BASE_URL + itm}}) : [], //房屋屋顶西南侧图片 'photo.fwImg5': res.fw_img5 ? res.fw_img5.split(",").map(itm => {return {name: itm,url: IMG_BASE_URL + itm}}) : [], //遮阴物与房屋距离、高度 }); //并网方式处理 if(res.recordBoxHistory){ if(res.recordBoxHistory ==''){//并网方式没选择过,默认‘单户并网’ this.setData({ // gridType: '0',//并网方式 boxTotalCount: '', //总数 boxGroupNum: '', //编号 boxGroupName: '', //名称 }) }else{ this.setData({ gridType: res.recordBoxHistory.type,//并网方式 gridStatus: res.recordBoxHistory.status,//状态为1不能编辑 boxTotalCount: res.recordBoxHistory.total_count, boxGroupNum: res.recordBoxHistory.group_number, boxGroupName: res.recordBoxHistory.group_name, boxGroupId: res.recordBoxHistory.box_group_id, }) } } // console.log("photo",this.data.photo); this.getFormSet(res.management) //下拉字典 this.getDictionaryList(res.management, (res2)=>{ let angleList = res2.angle_azimuth.map(item=>item.columns) if(res.azimuth){ let azimuthName = angleList.find(itm => itm.dict_key === res.azimuth).dict_value; this.setData({ azimuthName }) } }); setTimeout(()=>{ if(res.management == '03' && res.roof_type !=''){ this.roofTypeToColumn(res.roof_type) } },500) }, /** 获取方案类型和方案名称 **/ findAllPlan(e) { let that = this findAllPlan({ }).then((res) => { for (let i = 0; i < res.length; i++) { res[i].allPlan = JSON.parse(res[i].allPlan) for (let j = 0; j < res[i].allPlan.length; j++) { var element = res[i].allPlan[j].columns; res[i].allPlan[j] = element } } that.setData({ planList: res, }) }) }, //打开pdf文件或者大图查看图片 openDocument(res) { let path = res.currentTarget.dataset.path if (path) { let suffix = path.substring(path.lastIndexOf('.') + 1) //获取文件后缀 if(suffix=='mp4'){// 开始预览多媒体内容 wx.previewMedia({ sources: [{ url :IMG_BASE_URL + path, type: 'video' }], // 需要预览的资源列表 }); }else if(suffix != 'jpg' && suffix != 'png' && suffix != 'gif' && suffix != 'jpeg') { wx.showLoading({ title: '加载中', }) wx.downloadFile({ url: IMG_BASE_URL + path, complete: function (res) { wx.hideLoading() const filePath = res.tempFilePath wx.openDocument({ filePath: filePath, fileType: suffix, showMenu: true, success: function (res) {} }) } }) }else{ wx.previewImage({ urls: [IMG_BASE_URL + path] // 需要预览的图片http链接列表 }) } } }, } })