// pages/acceptance/acceptance.js const { entryDetail, IMG_BASE_URL, API_BASE_URL, WU_TU_PIAN_URL, getActualCapacity, twoMergeAcceptRefuse, toNetAccept } = require('../../../api/api') import Dialog from '@vant/weapp/dialog/dialog'; Page({ /** * 页面的初始数据 */ data: { IMG_BASE_URL: IMG_BASE_URL, API_BASE_URL: API_BASE_URL, noneImg: 'https://sky-energy.oss-cn-beijing.aliyuncs.com/prohibit_delete/wutupian.png', photoList: [],//图片集合 powerCapacityUrl: [], //3天发电量 gridCheck: false, photoTips: [ //安装 { title:'1.设备信息照片', list:[{ key:'nbqPlateImg', num:1, title: '逆变器序列号照片', message: '1、铭牌清晰' },{ key:'txPlateImg', num:1, title: '逆变器通讯棒照片', message: '1、清晰' },{ key:'zjPlateImg', num:1, title: '组件铭牌照片', message: '1、组件铭牌内容清晰。' },{ key:'zjSnImgs', num:4, title: '组件SN', message: '1、上传组件包装箱A4 纸条码或组件边框SN最少2张;2、图片清晰可看清SN 号码。' }] }, { title:'2.支架及组件安装照片', list:[{ key:'zjImg1', num:1, title: '膨胀螺栓', message: '膨胀螺丝大小不低于设计要求,阳光房膨胀螺丝M12*100' },{ key:'zjImg2', num:1, title: '基座安装固定', message: '1、膨胀螺丝必须使用大垫片固定;2、照片能够看出第二道防水。' },{ key:'zjImg3', num:1, title: '底座防水', message: '1、照片能够体现三道防水施工完成;2、整个底座均需涂刷防水;3、防水面积大于底座5cm以上。' },{ key:'zjImg4', num:1, title: '支架基础距离房檐的距离', message: '1、能够看清楚底座距离墙边的距离,不小于200mm;2、有女儿墙的测量外墙到立柱的距离;' },{ key:'zjImg5', num:1, title: '支架东向西拍摄', message: '1、支架按图施工;2、支架焊接必须满焊;3、支架防腐防锈施工完成。' },{ key:'zjImg6', num:1, title: '支架西向东拍摄', message: '1、支架按图施工;2、支架焊接必须满焊;3、支架防腐防锈施工完成。' },{ key:'zjImg7', num:1, title: '支架南向北拍摄', message: '1、支架按图施工;2、支架焊接必须满焊;3、支架防腐防锈施工完成。' },{ key:'zjImg8', num:1, title: '支架北向南拍摄', message: '1、支架按图施工;2、支架焊接必须满焊;3、支架防腐防锈施工完成。' },{ key:'zjImg9', num:1, title: '支架角度', message: '1、支架角度和图纸保持一致,按图施工;2、必须使用角度仪进行测量,不允许使用手机。' },{ key:'componentImg1', num:1, title: '支架节点(斜支撑)', message: '1、按图施工;2、焊接必须满焊;3、防腐防锈按要求施工。' },{ key:'componentImg2', num:1, title: '支架距照片(南北)', message: '1、间距尺寸符合图施工;2、能够看清立柱南北间距尺寸。' },{ key:'componentImg3', num:1, title: '支架距照片(东西)', message: '1、间距尺寸符合图施工;2、能够看清立柱东西间距尺寸。' },{ key:'componentImg4', num:3, title: '防风加固', message: '1、横拉杆和背拉杆施工按图施工。' },{ key:'sizeMeasureImgs', num:9, title: '方管尺寸测量', message: '1.三种方管尺寸均需测量(100*100/80*40/50*50)。' }] }, { title:'3.电气设备安装照片', list:[{ key:'totalImgs', num:1, title: '并网箱、逆变器外部安装照片、接地引下线', message: '1、墙面安装底部高度不小于1.8米;2、建议安装高度2 米。3、方位角在150-300 之间必须安装遮阳棚。4、周边是否存在易燃易爆物品。' },{ key:'bwInnerImg', num:1, title: '并网箱内部整体照片', message: '1、线鼻是否压接;2、防火封堵完整;3、线缆线皮包扎。' },{ key:'dqsbAnImgOne', num:1, title: '直流线缆保护', message: '1、直流电缆穿管保护;2、管口需使用防火泥封堵。' },{ key:'dqsbAnImgTwo', num:1, title: '直流线缆固定', message: '1、直流电缆走线横平竖直;2、直流电缆绑住需使用包塑扎丝固定。' }], }, { title:'4.接地系统照片', list:[{ key:'zujianJdImg', num:1, title: '组件边框接地', message: '1.组件边框接地可靠' },{ key:'zjJdImgs', num:2, title: '引下线与支架连接点、南北坡接地连接点', message: '1、焊接倍数满足要求,建议10cm;2、焊接满焊;3、防腐防锈施工完成。' },{ key:'groundResistanceImgs', num:2, title: '接地电阻', message: '1、电气接地小于4Ω;2、支架接地小于10Ω;3、共用接地小于4Ω。' }] }, { title:'5.调试记录照片', list:[{ key:'openWayVoltageImgs', num:6, title: '开路电压', message: '1、组串号按图施工;2、需要测量每一路开路电压;3、开路电压测量时能够看清楚号码线管;4、第一张照片需附逆变器下MPPT插入照片。' }] }, { title:'6.方阵安装完毕整体照片', list:[{ key:'directionAirImg1', num:1, title: '东向西航拍', message: '1、无遮挡;2、组件无污染或破损;3、组件边框距离檩条端头不少于6cm。' },{ key:'directionAirImg2', num:1, title: '西向东航拍', message: '1、无遮挡;2、组件无污染或破损;3、组件边框距离檩条端头不少于6cm。' },{ key:'directionAirImg3', num:1, title: '南向北航拍', message: '1、无遮挡;2、组件无污染或破损;3、组件边框距离檩条端头不少于6cm。' },{ key:'directionAirImg4', num:1, title: '北向南航拍', message: '1、无遮挡;2、组件无污染或破损;3、组件边框距离檩条端头不少于6cm。' },{ key:'zjNearImg', num:1, title: '组件近景', message: '1、无遮挡;2、无异物、无划伤' },{ key:'zjAngleImg', num:1, title: '组件角度', message: '1、组件角度和图纸一致。' },{ key:'zjItemImg', num:1, title: '檩条出组件照片', message: '1、檩条末端预留安全长度不小于6cm;2、照片需要测量尺寸。' },{ key:'waterChannelImg', num:1, title: '水槽照片', message: '1、水槽清晰可见。' },{ key:'mediumFixImg', num:1, title: '中压固定照片', message: '1、压块固定牢固跟图纸要求一致。' },{ key:'safetyWarningImg', num:1, title: '安全警示牌', message: '1、在上人位置悬挂安全警示牌。' },{ key:'safetyDiscloseDocImg', num:1, title: '现场安全交底文件', message: '1、现场交底记录必须现场签字;2、签字人数跟现场影像照片一致。3、交底人跟被交底人不允许为同一人。' },{ key:'discloseDocImg', num:1, title: '现场交底照片', message: '1、安全帽佩戴正确;2、帽带必须戴好;3、涉及高空作业人员佩戴安全带和防坠器、防滑鞋;4、反光背心穿戴整齐。' },{ key:'recordDocImg', num:1, title: '记录表', message: '1、是否全部认真检查,检查结果是否合格;2、结论是否手签,检查人签字等。' }] }, //并网 { title:'并网', list:[{ key:'yxImg', num:1, title:'电站运行信息', message: '监控后台逆变器连续三天的日发电量截图' },{ key:'gebImg', num:1, title: '补充图片', message: '其他细节照片可根据需要自行增加' }] }, ], // 安装 photo: { //1.设备信息照片 nbqPlateImg: [],//逆变器序列号照片,逆变器1铭牌照片 txPlateImg: [],//逆变器通讯棒照片,通讯棒1铭牌照 zjPlateImg: [],//组件铭牌照片 zjSnImgs:[],//组件SN,1-4张---- //2.支架及组件安装照片 zjImg1: [],//膨胀螺栓 zjImg2: [],//基座安装固定 zjImg3: [],//底座防水 zjImg4: [],//支架基础距离房檐的距离 zjImg5: [],//支架东向西拍摄 zjImg6: [],//支架西向东拍摄--- zjImg7: [],//支架南向北拍摄--- zjImg8: [],//支架北向南拍摄--- zjImg9: [],//支架角度---- componentImg1: [],//支架节点(斜支撑) componentImg2: [],//支架距照片(南北) componentImg3: [],//支架距照片(东西) componentImg4: [],//防风加固,1-3张 sizeMeasureImgs: [],//方管尺寸测量---,9张 //3.电气设备安装照片 totalImgs: [],//并网箱、逆变器外部安装照片、接地引下线,逆变器、并网箱整体安装照片, 存在字段名逆变器和并网箱接地照 bwInnerImg: [],//并网箱内部整体照片 dqsbAnImgOne: [],//直流线缆保护 dqsbAnImgTwo: [],//直流线缆固定 //4.接地系统照片 zjJdImgs: [],//引下线与支架连接点、南北坡接地连接点,2张---- groundResistanceImgs: [],//接地电阻,1-2张----- zujianJdImg: [],//组件边框接地 //5.调试记录照片 openWayVoltageImgs: [],//开路电压,1-6张----- //6.方阵安装完毕整体照片 directionAirImg1: [],//东向西航拍---- directionAirImg2: [],//西向东航拍---- directionAirImg3: [],//南向北航拍---- directionAirImg4: [],//北向南航拍---- zjNearImg: [],//组件近景---- zjAngleImg: [],//组件角度---- zjItemImg: [],//檩条出组件照片---- waterChannelImg: [],//水槽照片---- mediumFixImg: [],//中压固定照片---- safetyWarningImg: [],//安全警示牌---- safetyDiscloseDocImg: [],//现场安全交底文件---- discloseDocImg: [],//现场交底照片---- recordDocImg: [],//记录表---- }, }, onLoad(options) { this.setData({ entryId: options.projectId, status: options.status, //5是安装,7是并网 }); wx.setNavigationBarTitle({ title: options.status == '5' ? '安装验收' : '并网验收', }) this.entryDetail() }, /** * * 获取电站详情 * * @param {*} e */ entryDetail(e) { entryDetail({ userId: wx.getStorageSync('userId'), entryId: this.data.entryId, }).then((res) => { this.setData({ detail: res, 'data.projectId': res.project_id, 'data.projectCode': res.projectCode, 'data.projectName': res.projectName, 'data.powerStationCode': res.power_station_code, 'data.name': res.tenant_name, 'data.traderName': res.create_trader_name, 'data.traderTel': res.traderTel, 'data.phone': res.mobile, 'data.idCard': res.id_code, 'data.region': res.province + res.city + res.area + res.address, 'data.scheme': res.scheme_type == 1 ? "标准方案" : "组合方案", 'data.generatorNo': res.generator_no, //发电户号 'data.provinceCodeName': res.province_code_name, //电力公司 'data.code': res.province_code, //发电户号 'data.bankName': res.bank_name,//开户银行 'data.bankCode': res.bank_code,//银行账号 'data.powerName': res.powerName,//项目名称 'data.zujBrand': res.map.zujBrand,//组件品牌 }); if(res.report){ this.setData({ //并网图片显示 // [`bwPhoto.gebImg[0].url`]: res.report.gebImg ? this.data.IMG_BASE_URL + res.report.gebImg : this.data.noneImg, // [`bwPhoto.yxImg[0].url`]: res.report.yxImg ? this.data.IMG_BASE_URL + res.report.yxImg : this.data.noneImg, [`photo.dbImgs[0].url`]:res.report.dbImgs ? IMG_BASE_URL + res.report.dbImgs : WU_TU_PIAN_URL,//电表图片 [`photo.yxImg[0].url`]:res.report.yxImg ? IMG_BASE_URL + res.report.yxImg : WU_TU_PIAN_URL,//电站运行信息 [`photo.gebImg[0].url`]:res.report.gebImg ? IMG_BASE_URL + res.report.gebImg2 : WU_TU_PIAN_URL,//补充信息 [`photo.gebImg2[0].url`]:res.report.gebImg2 ? IMG_BASE_URL + res.report.gebImg2 : WU_TU_PIAN_URL,//补充信息2 }) } // if (res.sn) { // var snList = res.sn.split(",") // this.setData({ // snList: snList // }) // } // if (res.nbq_sn) { // var nbqSnList = res.nbq_sn.split(",") // this.setData({ // nbqSnList: nbqSnList, // }) // } if (res.report) { for(let i in this.data.photo){ if(res.report[i]){ let arr = res.report[i].split(","),arr2=[]; arr.forEach(itm=>{ arr2.push({ name:itm, url:IMG_BASE_URL + itm }); }); this.setData({ [`photo.${i}`]: arr2, }); }else{ this.setData({ [`photo.${i}`]: [{name:'',url:this.data.noneImg}], }); } } } //重新赋值,传给子组件 const photoList = JSON.parse(JSON.stringify(this.data.photo)) this.setData({ photoList }) // this.getActualCapacity() // this.getProviceCodeList() }) }, /** * * 查询安装组件信息 * * @param {*} e */ getActualCapacity(e) { getActualCapacity({ entryId: this.data.entryId, }).then((res) => { const data = JSON.parse(res.data) this.setData({ component: data.columns }) }) }, /** * * 查看注意方案 * * @param {*} e */ viewNote(e) { const type = e.currentTarget.dataset.type let title = this.data.photoTips[type].title let message = this.data.photoTips[type].message Dialog.alert({ title: title, message: message, theme: 'round-button', }).then(() => { }); }, /** * 提交 */ passFn(e) { let type = e.currentTarget.dataset.type, txt = '', status = this.data.status; if(type == '2'){ //并网 if (!this.data.fixConclusion) { wx.showToast({ title: '请输入不通过验收意见', icon: 'none' }) return } //安装 // if (!this.data.fixConclusionSh && status == '5') { // wx.showToast({ // title: '请输入不通过审核意见', // icon: 'none' // }) // return // } txt = '不通过成功'; }else{ // if (this.data.powerCapacityUrl.length == 0) { // wx.showToast({ // title: '请上传近3天发电量', // icon: 'none' // }) // return // } if (!this.data.gridCheck) { wx.showToast({ title: '审核通过需物料并网完成', icon: 'none' }) return } txt = '通过成功'; } // console.log("执行7", this.data.fixConclusion); // console.log("执行5", this.data.fixConclusionSh); // return wx.showLoading({ title: "提交中" }); // if(status == '7'){ twoMergeAcceptRefuse({ id: this.data.entryId, type:type,//1.通过 2.驳回 fixConclusion: this.data.fixConclusion ? this.data.fixConclusion : "", powerCapacityUrl: this.data.powerCapacityUrl.length>0?this.data.powerCapacityUrl[0].url:'', materialMergeFlag: this.data.gridCheck?'1':'0', userId: wx.getStorageSync('userId') }).then((res) => { wx.hideLoading() if (res.code == 200) { wx.showToast({ title: txt, icon: 'none', success: function () { setTimeout(function () { wx.navigateBack() }, 1500) } }) } else { wx.showToast({ icon: 'none', title: res.msg || res.errMsg, }) } }) //}else if(status == '5'){ // toNetAccept({ // id: this.data.entryId, // type:type,//1.通过 2.驳回 // fixConclusionSh: this.data.fixConclusionSh ? this.data.fixConclusionSh : "", // userId: wx.getStorageSync('userId') // }).then((res) => { // wx.hideLoading() // if (res.code == 200) { // wx.showToast({ // title: txt, // icon: 'none', // success: function () { // setTimeout(function () { // wx.navigateBack() // }, 1500) // } // }) // } else { // wx.showToast({ // title: res.msg || res.errMsg, // icon: res.code // }) // } // }) // } }, /** * * 上传图片 * * @param {*} e */ afteruploadPhotoRead(e) { const type = e.currentTarget.dataset.type const name = e.currentTarget.dataset.name const { file } = e.detail; const img = file.url; wx.showLoading({ title: '上传中', }) var that = this wx.uploadFile({ url: that.data.API_BASE_URL + 'common/weChat/uploadImage', filePath: file.url, name: 'file', complete: function (res) { console.log("上传图片", res) wx.hideLoading() if (res.statusCode == 200) { wx.showToast({ title: '选择成功', icon: 'none', }) var item = { url: "", name: "", } item.url = img; item.name = res.data; that.data.powerCapacityUrl.push(item) that.setData({ powerCapacityUrl: that.data.powerCapacityUrl }) } else { wx.showToast({ title: '选择失败', icon: 'error' }) } } }) }, /** 删除图片 **/ deleteImg(e) { this.setData({ powerCapacityUrl: [] }) }, //并网已完成 onChangeGrid(e){ this.setData({ gridCheck: e.detail, }); }, //查看发电量 goLink(){ wx.navigateTo({ url: '/home/pages/3days/3days?id=' + this.data.detail.entry_id }) } })