|
|
const {
|
|
|
entryDetail,
|
|
|
findAllPlan,
|
|
|
getElectricPlanAll,
|
|
|
appletsFailed,
|
|
|
appletsToExamine,
|
|
|
API_BASE_URL,
|
|
|
IMG_BASE_URL,
|
|
|
WU_TU_PIAN_URL,
|
|
|
getFormSet,
|
|
|
designCustomerEntry,getAllDictionarySelect
|
|
|
} = require('../../../api/api')
|
|
|
|
|
|
Page({
|
|
|
data: {
|
|
|
tabIndex: '0',
|
|
|
productList: [],
|
|
|
IMG_BASE_URL: IMG_BASE_URL,
|
|
|
WU_TU_PIAN_URL:WU_TU_PIAN_URL,
|
|
|
planList: [], //方案列表
|
|
|
|
|
|
standardSolutionsList: [{
|
|
|
projectId: "", //产品ID
|
|
|
type: "", //方案类型
|
|
|
name: "", //方案名称
|
|
|
id: "", //方案ID
|
|
|
code: "", //方案编号
|
|
|
drawing: "", //参考图纸
|
|
|
}], //标准方案初始数量
|
|
|
|
|
|
combinedSolutionsList: [{
|
|
|
type: "", //方案类型
|
|
|
name: "", //方案名称
|
|
|
id: "", //方案ID
|
|
|
code: "", //方案编号
|
|
|
pickerIndex: 0, //方案类型选择下标
|
|
|
drawing: "", //参考图纸
|
|
|
addType: 1, //显示新增方案按钮
|
|
|
}], //组合方案初始数量
|
|
|
|
|
|
photo: {
|
|
|
fwImg1: [],
|
|
|
fwImg2: [],
|
|
|
fwImg3: [],
|
|
|
fwImg4: [],
|
|
|
fwImg5: [],
|
|
|
|
|
|
flyImgs: [], //无人机航拍图
|
|
|
roofPhotoOne:[],//安装区域整体照片
|
|
|
roofPhotoTwo:[],//安装区域东南角照片
|
|
|
roofPhotoThree:[],//安装区域西南角照片
|
|
|
roofPhotoFour:[],//安装区域正南照片
|
|
|
roofPhotoFive:[],//安装区域细节照片
|
|
|
roofPhotoFacade:[],//房屋内部结构照片
|
|
|
roofPhotoInterior:[],//房屋内部环境照片
|
|
|
detailSupplementOne:[],//逆变器、配电箱预安装位置照片
|
|
|
houseSupplementOne:[],//房屋其他障碍物照片
|
|
|
surveyVideo:[],//踏勘补充证明视频
|
|
|
surveyFiles:[],//踏勘记录表
|
|
|
|
|
|
vrRoofOne: [], //房屋整体图
|
|
|
vrRoofTwo: [], //房屋整体俯视图
|
|
|
vrRoofThree: [], //房屋内部结构图
|
|
|
vrRoofFour: [], //入户全景照片
|
|
|
|
|
|
designDrawings: [], //设计图纸
|
|
|
zjpbImg: [], //组件排布图
|
|
|
zjzxImg: [], // 组件走线图
|
|
|
zjcsImg: [], //支架侧视图
|
|
|
zjhsImg: [], //电气图
|
|
|
},
|
|
|
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: '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: {}, //自定义字段
|
|
|
// productZj:0,//产品默认的组件值
|
|
|
gridType: '0',
|
|
|
multiPhoto: [], //多产品图片
|
|
|
multiPhotoTips: [],//多产品图片
|
|
|
multiScheme:[],//多产品方案
|
|
|
multiComponentList:[],//多产品组件
|
|
|
},
|
|
|
onLoad(options) {
|
|
|
this.data.entryId = options.projectId;
|
|
|
this.setData({
|
|
|
entryId:options.projectId,
|
|
|
type:options.type
|
|
|
});
|
|
|
if(options.type == '3'){
|
|
|
wx.setNavigationBarTitle({
|
|
|
title: '设计',
|
|
|
})
|
|
|
}
|
|
|
this.entryDetail()
|
|
|
this.findAllPlan()
|
|
|
},
|
|
|
/*** 获取字典 */
|
|
|
getDictionaryList(partner, callback) {
|
|
|
getAllDictionarySelect({
|
|
|
capitalId: partner,
|
|
|
}).then((res) => {
|
|
|
if(res.data){
|
|
|
this.setData({
|
|
|
roofTypeList: res.data.roof_type.map(item=>item.columns), //屋顶类型
|
|
|
angleAzimuthSel: res.data.angle_azimuth.map(item=>item.columns), //方位角
|
|
|
})
|
|
|
}
|
|
|
if(callback) callback(res.data)
|
|
|
})
|
|
|
},
|
|
|
/** 获取自定义字段 */
|
|
|
getFormSet(partner) {
|
|
|
let params = {
|
|
|
stage: '02', //01:信息登记,02:踏勘设计,03:电站安装,04:电站并网
|
|
|
partner: partner,
|
|
|
}
|
|
|
getFormSet(params).then((res) => {
|
|
|
this.setData({
|
|
|
formSetObj: res.data.columns
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
/** 业主信息 **/
|
|
|
userFn(e){
|
|
|
wx.navigateTo({
|
|
|
url: '/home/pages/ownerForm/ownerForm?projectId=' + this.data.entryId,
|
|
|
})
|
|
|
},
|
|
|
/** 拨打业主联系电话 **/
|
|
|
phoneFn(e) {
|
|
|
const phone = e.currentTarget.dataset.phone;
|
|
|
if (!phone) {
|
|
|
wx.showToast({
|
|
|
title: '暂无联系方式',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
wx.makePhoneCall({
|
|
|
phoneNumber: phone,
|
|
|
})
|
|
|
},
|
|
|
/** 获取方案类型和方案名称 **/
|
|
|
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,
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
/** 获取组件、逆变器、并网箱列表 **/
|
|
|
getElectricPlanAll(e) {
|
|
|
getElectricPlanAll({
|
|
|
partnerId: wx.getStorageSync('capitalId'),//资方
|
|
|
}).then((res) => {
|
|
|
var AllComponentApiList = [];
|
|
|
var converterApiList = [];
|
|
|
var cagesApiList = [];
|
|
|
var zhijApiList = [];
|
|
|
for (let i = 0; i < res.zjs.length; i++) {
|
|
|
const element = res.zjs[i].columns;
|
|
|
AllComponentApiList.push(element)
|
|
|
}
|
|
|
for (let j = 0; j < res.inverters.length; j++) {
|
|
|
const element = res.inverters[j].columns;
|
|
|
converterApiList.push(element)
|
|
|
}
|
|
|
for (let k = 0; k < res.boxs.length; k++) {
|
|
|
const element = res.boxs[k].columns;
|
|
|
cagesApiList.push(element)
|
|
|
}
|
|
|
for (let k = 0; k < res.zhij.length; k++) {
|
|
|
const element = res.zhij[k].columns;
|
|
|
zhijApiList.push(element)
|
|
|
}
|
|
|
// console.log(12121, this.data.multiComponentList[this.data.tabIndex].productZj)
|
|
|
let componentApiList = AllComponentApiList.length ? AllComponentApiList.filter(itm=>Number(itm.model) >= this.data.multiComponentList[this.data.tabIndex].productZj) : [];//过滤大于等于productZj的组件列表
|
|
|
this.setData({
|
|
|
componentApiList: componentApiList, //组件
|
|
|
converterApiList: converterApiList, //逆变器
|
|
|
cagesApiList: cagesApiList, //并网箱
|
|
|
zhijApiList: zhijApiList, //支架
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
/** 获取电站详情 **/
|
|
|
entryDetail(e) {
|
|
|
let that = this
|
|
|
wx.showLoading({
|
|
|
title: "加载中"
|
|
|
})
|
|
|
entryDetail({
|
|
|
userId: wx.getStorageSync('userId'),
|
|
|
entryId: this.data.entryId,
|
|
|
}).then((res) => {
|
|
|
wx.hideLoading()
|
|
|
// if(res.management == '04'){
|
|
|
//华融资方--多产品分开显示
|
|
|
let productList = res.projectDetailList //产品集合
|
|
|
let multiPhoto = []
|
|
|
let multiScheme = []
|
|
|
//拆分成多产品
|
|
|
productList.forEach((item,index)=>{
|
|
|
//多产品图片处理
|
|
|
multiPhoto.push(this.data.photo)
|
|
|
multiScheme.push({
|
|
|
standardSolutionsListIndex: 0,
|
|
|
standardSolutionsList: [{
|
|
|
projectId: item.projectId, //产品ID
|
|
|
type: "", //方案类型
|
|
|
name: "", //方案名称
|
|
|
id: "", //方案ID
|
|
|
code: "", //方案编号
|
|
|
drawing: "", //参考图纸
|
|
|
}]
|
|
|
})
|
|
|
// 添加图片
|
|
|
this.setData({
|
|
|
multiScheme, //方案信息默认值
|
|
|
[`multiPhoto[${index}].dipAngle`]:item.dipAngle,//组件倾角
|
|
|
[`multiPhoto[${index}].zjpbImg`]: item.zjpbImg ? item.zjpbImg.split(",").map(itm => {return {name: itm,url: IMG_BASE_URL + itm}}) : [], //组件排布图
|
|
|
[`multiPhoto[${index}].zjzxImg`]: item.zjzxImg ? item.zjzxImg.split(",").map(itm => {return {name: itm,url: IMG_BASE_URL + itm}}) : [], //组件接线图
|
|
|
[`multiPhoto[${index}].zjcsImg`]: item.zjcsImg ? item.zjcsImg.split(",").map(itm => {return {name: itm,url: IMG_BASE_URL + itm}}) : [], //组件支架图
|
|
|
[`multiPhoto[${index}].zjhsImg`]: item.zjhsImg ? item.zjhsImg.split(",").map(itm => {return {name: itm,url: IMG_BASE_URL + itm}}) : [], //电气图
|
|
|
[`multiPhoto[${index}].dzImgs`]: item.dzImgs ? item.dzImgs.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//组合图
|
|
|
//房屋信息
|
|
|
[`multiPhoto[${index}].flyImgs`]:item.flyImgs ? item.flyImgs.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//无人机航拍图
|
|
|
[`multiPhoto[${index}].roofPhotoOne`]:item.roofPhotoOne ? item.roofPhotoOne.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//安装区域整体照片
|
|
|
[`multiPhoto[${index}].roofPhotoTwo`]:item.roofPhotoTwo ? item.roofPhotoTwo.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//安装区域东南角照片
|
|
|
[`multiPhoto[${index}].roofPhotoThree`]:item.roofPhotoThree ? item.roofPhotoThree.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//安装区域西南角照片
|
|
|
[`multiPhoto[${index}].roofPhotoFour`]:item.roofPhotoFour ? item.roofPhotoFour.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//安装区域正南照片
|
|
|
[`multiPhoto[${index}].roofPhotoFive`]:item.roofPhotoFive ? item.roofPhotoFive.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//安装区域细节照片
|
|
|
[`multiPhoto[${index}].roofPhotoInterior`]:item.roofPhotoInterior ? item.roofPhotoInterior.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//房屋内部环境照片
|
|
|
[`multiPhoto[${index}].roofPhotoFacade`]:item.roofPhotoFacade ? item.roofPhotoFacade.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//房屋内部结构照片
|
|
|
[`multiPhoto[${index}].detailSupplementOne`]:item.detailSupplementOne ? item.detailSupplementOne.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//逆变器、配电箱预安装位置照片
|
|
|
[`multiPhoto[${index}].houseSupplementOne`]:item.houseSupplementOne ? item.houseSupplementOne.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//房屋其他障碍物照片
|
|
|
[`multiPhoto[${index}].surveyVideo`]:item.surveyVideo ? item.surveyVideo.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [{url:WU_TU_PIAN_URL}],//踏勘补充证明视频
|
|
|
[`multiPhoto[${index}].surveyFiles`]:item.surveyFiles ? item.surveyFiles.split(",").map(itm=>{return {name:itm, url:IMG_BASE_URL + itm}}) : [],//踏勘记录表
|
|
|
[`multiPhoto[${index}].vrRoofOne`]: item.vrRoofOne ? item.vrRoofOne.split(",").map(itm => { return { name: itm, url: IMG_BASE_URL + itm}}) : [], //房屋整体图(VR全景)
|
|
|
[`multiPhoto[${index}].vrRoofTwo`]: item.vrRoofTwo ? item.vrRoofTwo.split(",").map(itm => { return { name: itm, url: IMG_BASE_URL + itm}}) : [], //房屋整体俯视图(VR)
|
|
|
[`multiPhoto[${index}].vrRoofThree`]: item.vrRoofThree ? item.vrRoofThree.split(",").map(itm => { return { name: itm, url: IMG_BASE_URL + itm}}) : [], //房屋内部结构图(VR)
|
|
|
[`multiPhoto[${index}].vrRoofFour`]: item.vrRoofFour ? item.vrRoofFour.split(",").map(itm => { return { name: itm, url: IMG_BASE_URL + itm}}) : [], //入户全景照片(VR)
|
|
|
[`multiPhoto[${index}].houseOutlinePhoto`]: item.houseOutlinePhoto ? item.houseOutlinePhoto.split(",").map(itm => { return { name: itm, url: IMG_BASE_URL + itm}}) : [], //房屋轮廓照片
|
|
|
[`multiPhoto[${index}].fwImg1`]: item.fwImg1 ? item.fwImg1.split(",").map(itm => {return {name: itm,url: IMG_BASE_URL + itm}}) : [], //房屋整体图
|
|
|
[`multiPhoto[${index}].fwImg2`]: item.fwImg2 ? item.fwImg2.split(",").map(itm => {return {name: itm,url: IMG_BASE_URL + itm}}) : [], //房屋内部结构图
|
|
|
[`multiPhoto[${index}].fwImg3`]: item.fwImg3 ? item.fwImg3.split(",").map(itm => {return {name: itm,url: IMG_BASE_URL + itm}}) : [], //房屋屋顶东南侧图片
|
|
|
[`multiPhoto[${index}].fwImg4`]: item.fwImg4 ? item.fwImg4.split(",").map(itm => {return {name: itm,url: IMG_BASE_URL + itm}}) : [], //房屋屋顶西南侧图片
|
|
|
[`multiPhoto[${index}].fwImg5`]: item.fwImg5 ? item.fwImg5.split(",").map(itm => {return {name: itm,url: IMG_BASE_URL + itm}}) : [], //遮阴物与房屋距离、高度
|
|
|
// paycycle: res.pay_cycle ? res.pay_cycle : "",
|
|
|
});
|
|
|
if(item.addEntryReqDesignDetails.length>0){
|
|
|
this.setData({
|
|
|
[`multiPhoto[${index}].designDrawings`]: item.addEntryReqDesignDetails[0].designDrawings ? item.addEntryReqDesignDetails[0].designDrawings.split(",").map(itm => {return {name: itm, url: IMG_BASE_URL + itm} }) : [], //设计图纸
|
|
|
})
|
|
|
}else{
|
|
|
this.setData({
|
|
|
[`multiPhoto[${index}].designDrawings`]: [], //设计图纸
|
|
|
})
|
|
|
}
|
|
|
// 组件,逆变器,并网箱,支架
|
|
|
if (item.componentList.length > 0) {
|
|
|
var componentList = [];
|
|
|
var converterList = [];
|
|
|
var cagesList = [];
|
|
|
var zhijList = [];
|
|
|
var componentNum = 0;
|
|
|
for (let i = 0; i < item.componentList.length; i++) {
|
|
|
const element = item.componentList[i];
|
|
|
var OB = {
|
|
|
projectId: "", //产品ID
|
|
|
id: "",
|
|
|
num: "", //数量
|
|
|
model: "", //名称
|
|
|
addType: 0,
|
|
|
}
|
|
|
if (element.item_type == 3) {
|
|
|
OB.projectId = item.projectId;
|
|
|
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.projectId = item.projectId;
|
|
|
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.projectId = item.projectId;
|
|
|
OB.id = element.item_id;
|
|
|
OB.num = element.num;
|
|
|
OB.model = element.model;
|
|
|
cagesList.push(OB)
|
|
|
} else if (element.item_type == 4) {
|
|
|
OB.projectId = item.projectId;
|
|
|
OB.id = element.item_id;
|
|
|
OB.num = element.num;
|
|
|
OB.model = element.model;
|
|
|
zhijList.push(OB)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//维持默认数组第一addType为1,用以显示新增按钮
|
|
|
if (componentList.length > 0) {
|
|
|
componentList[0].addType = 1;
|
|
|
this.setData({
|
|
|
[`multiComponentList[${index}].componentList`]: componentList
|
|
|
})
|
|
|
} else {
|
|
|
this.setData({
|
|
|
[`multiComponentList[${index}].componentList`]: [{
|
|
|
projectId: item.projectId, //产品ID
|
|
|
id: res.modeId ? res.modeId : '',//默认产品信息中的组件规格id
|
|
|
num: '', //数量
|
|
|
model: res.modeId ? res.assemblySpecs : '', //名称,默认产品信息中的组件规格
|
|
|
addType: 1,
|
|
|
}], //组件初始数量
|
|
|
})
|
|
|
}
|
|
|
if (converterList.length > 0) {
|
|
|
converterList[0].addType = 1;
|
|
|
this.setData({
|
|
|
[`multiComponentList[${index}].converterList`]: converterList
|
|
|
})
|
|
|
} else {
|
|
|
this.setData({
|
|
|
[`multiComponentList[${index}].converterList`]: [{
|
|
|
projectId: item.projectId, //产品ID
|
|
|
id: "",
|
|
|
num: "", //数量
|
|
|
model: "", //名称
|
|
|
addType: 1,
|
|
|
}], //逆变器初始数量
|
|
|
})
|
|
|
}
|
|
|
if (cagesList.length > 0) {
|
|
|
cagesList[0].addType = 1;
|
|
|
this.setData({
|
|
|
[`multiComponentList[${index}].cagesList`]: cagesList
|
|
|
})
|
|
|
} else {
|
|
|
this.setData({
|
|
|
[`multiComponentList[${index}].cagesList`]: [{
|
|
|
projectId: item.projectId, //产品ID
|
|
|
id: "",
|
|
|
num: "", //数量
|
|
|
model: "", //名称
|
|
|
addType: 1,
|
|
|
}], //并网箱初始数量
|
|
|
})
|
|
|
}
|
|
|
if (zhijList.length > 0) {
|
|
|
zhijList[0].addType = 1;
|
|
|
this.setData({
|
|
|
[`multiComponentList[${index}].zhijList`]: zhijList
|
|
|
})
|
|
|
} else {
|
|
|
this.setData({
|
|
|
[`multiComponentList[${index}].zhijList`]: [{
|
|
|
projectId: item.projectId, //产品ID
|
|
|
id: "",
|
|
|
num: "", //数量
|
|
|
model: "", //名称
|
|
|
addType: 1,
|
|
|
}], //支架初始数量
|
|
|
})
|
|
|
}
|
|
|
this.setData({
|
|
|
[`multiComponentList[${index}].productZj`]:item.assemblySpecs ? Number(item.assemblySpecs) : 0,//产品默认的组件值
|
|
|
[`multiComponentList[${index}].componentNum`]: (componentNum/1000).toFixed(3),
|
|
|
})
|
|
|
}else{
|
|
|
this.setData({
|
|
|
[`multiComponentList[${index}].componentList`]: [{
|
|
|
projectId: item.projectId, //产品ID
|
|
|
id: res.modeId ? res.modeId : '',//默认产品信息中的组件规格id
|
|
|
num: '', //数量
|
|
|
model: res.modeId ? item.assemblySpecs : '', //名称,默认产品信息中的组件规格
|
|
|
addType: 1,
|
|
|
}], //组件初始数量
|
|
|
[`multiComponentList[${index}].converterList`]: [{
|
|
|
projectId: item.projectId, //产品ID
|
|
|
id: "",
|
|
|
num: "", //数量
|
|
|
model: "", //名称
|
|
|
addType: 1,
|
|
|
}], //逆变器初始数量
|
|
|
[`multiComponentList[${index}].cagesList`]: [{
|
|
|
projectId: item.projectId, //产品ID
|
|
|
id: "",
|
|
|
num: "", //数量
|
|
|
model: "", //名称
|
|
|
addType: 1,
|
|
|
}], //并网箱初始数量
|
|
|
[`multiComponentList[${index}].zhijList`]: [{
|
|
|
projectId: item.projectId, //产品ID
|
|
|
id: "",
|
|
|
num: "", //数量
|
|
|
model: "", //名称
|
|
|
addType: 1,
|
|
|
}], //支架初始数量
|
|
|
[`multiComponentList[${index}].productZj`]: item.assemblySpecs ? Number(item.assemblySpecs) : 0,//产品默认的组件值
|
|
|
[`multiComponentList[${index}].componentNum`]: 0,
|
|
|
})
|
|
|
}
|
|
|
//方案信息
|
|
|
if (res.scheme_type == 1) {//标准方案
|
|
|
if(productList[index].addEntryReqDesignDetails.length){
|
|
|
for (let i = 0; i < that.data.planList.length; i++) {
|
|
|
const element = that.data.planList[i];
|
|
|
if (productList[index].addEntryReqDesignDetails[0].schemeTypeId && (productList[index].addEntryReqDesignDetails[0].schemeTypeId == element.id)) {
|
|
|
this.setData({
|
|
|
[`multiScheme[${index}].standardSolutionsListIndex`]: i,
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
this.setData({
|
|
|
[`multiScheme[${index}].standardSolutionsList[0].projectId`]: productList[index].projectId,
|
|
|
[`multiScheme[${index}].standardSolutionsList[0].id`]: productList[index].addEntryReqDesignDetails[0].schemeId ? productList[index].addEntryReqDesignDetails[0].schemeId : '',
|
|
|
[`multiScheme[${index}].standardSolutionsList[0].type`]: productList[index].addEntryReqDesignDetails[0].schemeTypeName ? productList[index].addEntryReqDesignDetails[0].schemeTypeName : '',
|
|
|
[`multiScheme[${index}].standardSolutionsList[0].typeId`]: productList[index].addEntryReqDesignDetails[0].schemeTypeId ? productList[index].addEntryReqDesignDetails[0].schemeTypeId : '',
|
|
|
[`multiScheme[${index}].standardSolutionsList[0].name`]: productList[index].addEntryReqDesignDetails[0].schemeName ? productList[index].addEntryReqDesignDetails[0].schemeName : "",
|
|
|
})
|
|
|
}
|
|
|
|
|
|
} 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({
|
|
|
productList,
|
|
|
multiComponentList: this.data.multiComponentList,
|
|
|
multiScheme: this.data.multiScheme
|
|
|
})
|
|
|
// console.log(6666, this.data.multiScheme)
|
|
|
|
|
|
this.setData({
|
|
|
detail: res,
|
|
|
projectList: res.projectList,
|
|
|
id: res.id, //修改数据的时候传此ID
|
|
|
projectId: res.project_id,
|
|
|
tenant_type: res.tenant_type=='1' ? '个人' : '单位',//1.个人,2单位
|
|
|
capitalName: res.zfName, //资方
|
|
|
filingName: res.filing_type=='1' ? '农户备案' : '项目公司备案',//备案类型
|
|
|
filingType: res.filing_type, // 备案类型:1.农户备案 2.项目公司备案
|
|
|
//业主信息参数
|
|
|
name: res.tenant_name,
|
|
|
phone: res.mobile,
|
|
|
idCard: res.id_code,
|
|
|
regno: res.regno,
|
|
|
provinceName: res.province,
|
|
|
cityName: res.city,
|
|
|
areaName: res.area,
|
|
|
address: res.address,
|
|
|
//项目信息
|
|
|
projectName: res.projectName,//产品名称
|
|
|
companyName: res.project_company_name ? res.project_company_name : "",
|
|
|
leaseDate: res.leaseDate ? res.leaseDate : '',//预计投放日
|
|
|
repaymentMethod: res.repayment_method ? res.repayment_method : 1,//划转方式
|
|
|
//如果租金划转方式是二类卡,那么二类卡的信息 显示这个
|
|
|
secCardName:res.secCardName ? res.secCardName : '',//二类卡账户名
|
|
|
secCardNo:res.secCardNo ? res.secCardNo : '',//二类卡账号
|
|
|
secBankNumber:res.secBankNumber ? res.secBankNumber : '',//二类卡联行号
|
|
|
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,//方位角
|
|
|
|
|
|
projectCode: res.projectCode,
|
|
|
powerStationCode: res.power_station_code,
|
|
|
createTime: res.create_time,
|
|
|
shootType: res.shoot_type ? res.shoot_type : 1,
|
|
|
|
|
|
|
|
|
remark: res.remarks,
|
|
|
schemeType: res.scheme_type ? res.scheme_type : 1,
|
|
|
solutionRemark: res.scheme_remarks,
|
|
|
age: res.age ? res.age : "", //年龄
|
|
|
gender: res.gender == "MALE" ? "男" : "女", //性别
|
|
|
tssBankNum: res.tss_bank_num ? res.tss_bank_num : "", //卡开户行
|
|
|
tssBankNumName: res.tss_bank_num_name ? res.tss_bank_num_name : "", //卡开户行名称
|
|
|
bankCode: res.bank_code ? res.bank_code : "",
|
|
|
bankName: res.bank_name ? res.bank_name : "", //卡账号名称
|
|
|
});
|
|
|
//并网方式处理
|
|
|
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,
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
//保险购买情况
|
|
|
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: "其他"
|
|
|
})
|
|
|
}
|
|
|
console.log("photo",this.data.photo);
|
|
|
this.getFormSet(res.management)
|
|
|
//下拉字典
|
|
|
this.getDictionaryList(res.management, (res2)=>{
|
|
|
if(res2.angle_azimuth){
|
|
|
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
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
this.getElectricPlanAll();
|
|
|
})
|
|
|
},
|
|
|
/** 打开文件 **/
|
|
|
openDocument(res) {
|
|
|
console.log('openDocument', res)
|
|
|
let path = res.currentTarget.dataset.path
|
|
|
if (path) {
|
|
|
//获取文件后缀
|
|
|
let suffix = path.substring(path.lastIndexOf('.') + 1) //获取文件后缀
|
|
|
if (suffix.search(/jpg|png|jpeg/) == -1) {
|
|
|
wx.downloadFile({
|
|
|
// 示例 url,并非真实存在
|
|
|
url: IMG_BASE_URL + path,
|
|
|
success: function (res) {
|
|
|
const filePath = res.tempFilePath
|
|
|
wx.openDocument({
|
|
|
filePath: filePath,
|
|
|
showMenu: true,
|
|
|
success: function (res) {
|
|
|
console.log('打开文档成功')
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
wx.previewImage({
|
|
|
urls: [IMG_BASE_URL + path] // 需要预览的图片http链接列表
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
/** 上传pdf或图片 **/
|
|
|
upload(e) {
|
|
|
var that = this;
|
|
|
let name = e.currentTarget.dataset.name;
|
|
|
let maxcount = e.currentTarget.dataset.maxcount;
|
|
|
let tabIndex = e.currentTarget.dataset.tabindex;
|
|
|
console.log(55555, name, tabIndex ,this.data.multiPhoto[tabIndex][name].length)
|
|
|
wx.chooseMessageFile({
|
|
|
count: maxcount - this.data.multiPhoto[tabIndex][name].length,
|
|
|
type: 'all',
|
|
|
success(res) {
|
|
|
if (Array.isArray(res.tempFiles)) { //多张
|
|
|
var count = 0;
|
|
|
that.afteruploadPhotoReadFile(e, res.tempFiles, count, 'file')
|
|
|
return
|
|
|
}
|
|
|
//获取文件后缀/jpg|png|jpeg|pdf|dwg
|
|
|
let suffix = res.tempFiles[0].path.substring(res.tempFiles[0].path.lastIndexOf('.') + 1)
|
|
|
if (suffix.search(/pdf|jpg|png|jpeg|doc|docx|xls|xlsx/) == -1&&name=='designDrawings') {
|
|
|
wx.showToast({
|
|
|
title: '文件格式不正确',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
wx.showLoading({
|
|
|
title: '选择中',
|
|
|
})
|
|
|
console.log("执行",res);
|
|
|
wx.uploadFile({
|
|
|
// url: that.data.API_BASE_URL + 'common/weChat/uploadImage',
|
|
|
url: API_BASE_URL + 'common/uploadFile_Name?fileName=' + res.tempFiles[0].name,
|
|
|
filePath: res.tempFiles[0].path,
|
|
|
name: 'file',
|
|
|
complete: function (res) {
|
|
|
wx.hideLoading()
|
|
|
if (res.statusCode == 200) {
|
|
|
wx.showToast({
|
|
|
title: '选择成功11',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
that.data.multiPhoto[tabIndex][name].push({
|
|
|
name: JSON.parse(res.data).path,
|
|
|
url: IMG_BASE_URL + JSON.parse(res.data).path
|
|
|
});
|
|
|
console.log(6666, that.data.multiPhoto)
|
|
|
that.setData({
|
|
|
[`multiPhoto${tabIndex}.${name}`]: that.data.multiPhoto[tabIndex].photo[name]
|
|
|
})
|
|
|
} else {
|
|
|
wx.showToast({
|
|
|
title: '选择失败',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
/** 删除图片 **/
|
|
|
deleteImg(e) {
|
|
|
const name = e.currentTarget.dataset.name
|
|
|
const index = (name != 'surveyFiles' && name != 'designDrawings') ? e.detail.index : e.currentTarget.dataset.index //删除图片的下标
|
|
|
this.data.multiPhoto[this.data.tabIndex][name].splice(index, 1);
|
|
|
this.setData({
|
|
|
[`multiPhoto[${this.data.tabIndex}].${name}`]: this.data.multiPhoto[this.data.tabIndex][name]
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
* 选择设计方案
|
|
|
* @param {*} e 1:标准方案 2:组合方案
|
|
|
*/
|
|
|
radioChangeSolution(e) {
|
|
|
this.setData({
|
|
|
schemeType: e.detail.value == 1 ? 1 : 2,
|
|
|
})
|
|
|
},
|
|
|
/** 选择标准方案类型 **/
|
|
|
bindPlanChange(e) {
|
|
|
const index = e.detail.value; //选择第几个
|
|
|
let tabIndex = e.currentTarget.dataset.tabindex; //产品下标
|
|
|
this.data.multiScheme[tabIndex].standardSolutionsList[0].type = this.data.planList[index].name; //方案类型
|
|
|
this.data.multiScheme[tabIndex].standardSolutionsList[0].typeId = this.data.planList[index].id; //方案类型id
|
|
|
this.data.multiScheme[tabIndex].standardSolutionsList[0].name = ""; //方案名称
|
|
|
this.data.multiScheme[tabIndex].standardSolutionsList[0].code = ""; //方案编号
|
|
|
this.data.multiScheme[tabIndex].standardSolutionsList[0].nameId = ""; //方案名称Id
|
|
|
this.data.multiScheme[tabIndex].standardSolutionsList[0].id = "";
|
|
|
this.data.multiScheme[tabIndex].standardSolutionsListIndex = index;
|
|
|
this.setData({
|
|
|
multiScheme: this.data.multiScheme,
|
|
|
// standardSolutionsList: this.data.standardSolutionsList,
|
|
|
// standardSolutionsListIndex: index, //选择方案类型的下标用以渲染方案名称picker选择器
|
|
|
})
|
|
|
},
|
|
|
/** 选择标准方案名称 **/
|
|
|
bindPlanNameChange(e) {
|
|
|
let tabIndex = e.currentTarget.dataset.tabindex; //产品下标
|
|
|
if (!this.data.multiScheme[tabIndex].standardSolutionsListIndex) {
|
|
|
wx.showToast({
|
|
|
title: '请先选择标准方案类型',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
const index = e.detail.value; //选择第几个
|
|
|
this.data.multiScheme[tabIndex].standardSolutionsList[0].name = this.data.planList[this.data.multiScheme[tabIndex].standardSolutionsListIndex].allPlan[index].name; //方案名称
|
|
|
this.data.multiScheme[tabIndex].standardSolutionsList[0].id = this.data.planList[this.data.multiScheme[tabIndex].standardSolutionsListIndex].allPlan[index].id; //方案名称Id
|
|
|
|
|
|
this.setData({
|
|
|
multiScheme: this.data.multiScheme
|
|
|
})
|
|
|
},
|
|
|
/** 选择组合方案类型 **/
|
|
|
bindCombinationPlanChange(e) {
|
|
|
const pickerIndex = e.detail.value; //选择器选择第几个
|
|
|
const index = e.currentTarget.dataset.index; //选择第几个
|
|
|
this.setData({
|
|
|
[`combinedSolutionsList[${index}].type`]: this.data.planList[pickerIndex].name,
|
|
|
[`combinedSolutionsList[${index}].planTypeId`]: this.data.planList[pickerIndex].id,
|
|
|
[`combinedSolutionsList[${index}].pickerIndex`]: pickerIndex, //选择方案类型的下标用以渲染方案名称picker选择器
|
|
|
[`combinedSolutionsList[${index}].name`]: "",
|
|
|
[`combinedSolutionsList[${index}].code`]: "",
|
|
|
[`combinedSolutionsList[${index}].id`]: "",
|
|
|
})
|
|
|
},
|
|
|
/** 选择组合方案名称 **/
|
|
|
bindCombinationPlanNameChange(e) {
|
|
|
const pickerIndex = e.detail.value; //选择器选择第几个
|
|
|
const cindex = e.currentTarget.dataset.cindex; //选择第几个
|
|
|
const index = e.currentTarget.dataset.index; //选择第几个
|
|
|
for (let i = 0; i < this.data.combinedSolutionsList.length; i++) {
|
|
|
const element = this.data.combinedSolutionsList[i];
|
|
|
if (index == i && !element.type) {
|
|
|
wx.showToast({
|
|
|
title: '请先选择当前组合方案类型',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
}
|
|
|
this.setData({
|
|
|
[`combinedSolutionsList[${index}].id`]: this.data.planList[cindex].allPlan[pickerIndex].id,
|
|
|
[`combinedSolutionsList[${index}].name`]: this.data.planList[cindex].allPlan[pickerIndex].name,
|
|
|
[`combinedSolutionsList[${index}].code`]: this.data.planList[cindex].allPlan[pickerIndex].code,
|
|
|
})
|
|
|
},
|
|
|
/** 选择组件 **/
|
|
|
bindComponentChange(e) {
|
|
|
const pickerIndex = e.detail.value; //选择器选择第几个
|
|
|
const index = e.currentTarget.dataset.index; //选择第几个
|
|
|
var componentNum = 0
|
|
|
componentNum = this.data.multiComponentList[this.data.tabIndex].componentList[0].num * this.data.componentApiList[pickerIndex].model
|
|
|
this.setData({
|
|
|
[`multiComponentList[${this.data.tabIndex}].componentList[${index}].material_model`]: this.data.componentApiList[pickerIndex].material_model,
|
|
|
[`multiComponentList[${this.data.tabIndex}].componentList[${index}].model`]: this.data.componentApiList[pickerIndex].model,
|
|
|
[`multiComponentList[${this.data.tabIndex}].componentList[${index}].id`]: this.data.componentApiList[pickerIndex].id,
|
|
|
[`multiComponentList[${this.data.tabIndex}].componentNum`]: (componentNum/1000).toFixed(3)
|
|
|
})
|
|
|
},
|
|
|
/** 选择逆变器 **/
|
|
|
bindConverterChange(e) {
|
|
|
const pickerIndex = e.detail.value; //选择器选择第几个
|
|
|
const index = e.currentTarget.dataset.index; //选择第几个
|
|
|
this.setData({
|
|
|
[`multiComponentList[${this.data.tabIndex}].converterList[${index}].material_model`]: this.data.converterApiList[pickerIndex].material_model,
|
|
|
[`multiComponentList[${this.data.tabIndex}].converterList[${index}].model`]: this.data.converterApiList[pickerIndex].model,
|
|
|
[`multiComponentList[${this.data.tabIndex}].converterList[${index}].id`]: this.data.converterApiList[pickerIndex].id,
|
|
|
})
|
|
|
},
|
|
|
/** 选择并网箱 **/
|
|
|
bindCagesChange(e) {
|
|
|
const pickerIndex = e.detail.value; //选择器选择第几个
|
|
|
const index = e.currentTarget.dataset.index; //选择第几个
|
|
|
this.setData({
|
|
|
[`cagesList[${index}].model`]: this.data.cagesApiList[pickerIndex].model,
|
|
|
[`cagesList[${index}].id`]: this.data.cagesApiList[pickerIndex].id,
|
|
|
})
|
|
|
},
|
|
|
/** 选择支架 **/
|
|
|
bindZhijChange(e) {
|
|
|
const pickerIndex = e.detail.value; //选择器选择第几个
|
|
|
const index = e.currentTarget.dataset.index; //选择第几个
|
|
|
this.setData({
|
|
|
[`zhijList[${index}].model`]: this.data.zhijApiList[pickerIndex].model,
|
|
|
[`zhijList[${index}].id`]: this.data.zhijApiList[pickerIndex].id,
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
* 输入组件,逆变器,并网箱的数量
|
|
|
* @param {*} e 1:组件 2:逆变器 3:并网箱
|
|
|
*/
|
|
|
inputNum(e) {
|
|
|
switch (e.currentTarget.dataset.type) {
|
|
|
case "1":
|
|
|
this.setData({
|
|
|
[`multiComponentList[${this.data.tabIndex}].componentList[${e.currentTarget.dataset.index}].num`]: e.detail.value,
|
|
|
})
|
|
|
var componentNum = 0
|
|
|
for (let i = 0; i < this.data.multiComponentList[this.data.tabIndex].componentList.length; i++) {
|
|
|
const element = this.data.multiComponentList[this.data.tabIndex].componentList[i];
|
|
|
componentNum = element.num * element.model
|
|
|
}
|
|
|
this.setData({
|
|
|
[`multiComponentList[${this.data.tabIndex}].componentNum`]: (componentNum/1000).toFixed(3)
|
|
|
})
|
|
|
break;
|
|
|
case "2":
|
|
|
this.setData({
|
|
|
[`multiComponentList[${this.data.tabIndex}].converterList[${e.currentTarget.dataset.index}].num`]: e.detail.value,
|
|
|
})
|
|
|
break;
|
|
|
case "3":
|
|
|
this.setData({
|
|
|
[`multiComponentList[${this.data.tabIndex}].cagesList[${e.currentTarget.dataset.index}].num`]: e.detail.value,
|
|
|
})
|
|
|
break;
|
|
|
case "4":
|
|
|
this.setData({
|
|
|
[`multiComponentList[${this.data.tabIndex}].zhijList[${e.currentTarget.dataset.index}].num`]: e.detail.value,
|
|
|
})
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
/** 新增方案 **/
|
|
|
addSolution(e) {
|
|
|
const list = [{
|
|
|
type: "", //方案类型
|
|
|
name: "", //方案名称
|
|
|
id: "", //方案ID
|
|
|
code: "", //方案编号
|
|
|
pickerIndex: 0, //方案类型选择下标
|
|
|
drawing: "", //参考图纸
|
|
|
}]
|
|
|
var demo = this.data.combinedSolutionsList.concat(list)
|
|
|
this.setData({
|
|
|
[`combinedSolutionsList[${demo.length-1}]`]: demo[demo.length - 1]
|
|
|
})
|
|
|
},
|
|
|
/** 删除方案 **/
|
|
|
deleteSolution(e) {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '确定删除当前方案?',
|
|
|
complete: (res) => {
|
|
|
if (res.confirm) {
|
|
|
this.data.combinedSolutionsList.splice(e.currentTarget.dataset.index, 1)
|
|
|
this.setData({
|
|
|
combinedSolutionsList: this.data.combinedSolutionsList
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
* 新增型号
|
|
|
* @param {*} e 1:组件 2:逆变器 3:并网箱
|
|
|
*/
|
|
|
add(e) {
|
|
|
const list = {
|
|
|
projectId: this.data.productList[this.data.tabIndex].projectId,
|
|
|
id: "",
|
|
|
num: "",
|
|
|
name: "",
|
|
|
}
|
|
|
switch (e.currentTarget.dataset.type) {
|
|
|
case "1":
|
|
|
this.setData({
|
|
|
[`multiComponentList[${this.data.tabIndex}].componentList`]: this.data.multiComponentList[this.data.tabIndex].componentList.concat(list)
|
|
|
})
|
|
|
break;
|
|
|
case "2":
|
|
|
this.setData({
|
|
|
[`multiComponentList[${this.data.tabIndex}].converterList`]: this.data.multiComponentList[this.data.tabIndex].converterList.concat(list)
|
|
|
})
|
|
|
break;
|
|
|
case "3":
|
|
|
this.setData({
|
|
|
[`multiComponentList[${this.data.tabIndex}].cagesList`]: this.data.multiComponentList[this.data.tabIndex].cagesList.concat(list)
|
|
|
})
|
|
|
break;
|
|
|
case "4":
|
|
|
this.setData({
|
|
|
[`multiComponentList[${this.data.tabIndex}].zhijList`]: this.data.multiComponentList[this.data.tabIndex].zhijList.concat(list)
|
|
|
})
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
/**
|
|
|
* 删除型号
|
|
|
* @param {*} e 1:组件 2:逆变器 3:并网箱
|
|
|
*/
|
|
|
delete(e) {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '确定删除?',
|
|
|
complete: (res) => {
|
|
|
if (res.confirm) {
|
|
|
switch (e.currentTarget.dataset.type) {
|
|
|
case "1":
|
|
|
this.data.multiComponentList[this.data.tabIndex].componentList.splice(e.currentTarget.dataset.index, 1)
|
|
|
this.setData({
|
|
|
[`multiComponentList[${this.data.tabIndex}].componentList`]: this.data.multiComponentList[this.data.tabIndex].componentList
|
|
|
})
|
|
|
break;
|
|
|
case "2":
|
|
|
this.data.multiComponentList[this.data.tabIndex].converterList.splice(e.currentTarget.dataset.index, 1)
|
|
|
this.setData({
|
|
|
[`multiComponentList[${this.data.tabIndex}].converterList`]: this.data.multiComponentList[this.data.tabIndex].converterList,
|
|
|
})
|
|
|
break;
|
|
|
case "3":
|
|
|
this.data.multiComponentList[this.data.tabIndex].cagesList.splice(e.currentTarget.dataset.index, 1)
|
|
|
this.setData({
|
|
|
[`multiComponentList[${this.data.tabIndex}].cagesList`]: this.data.multiComponentList[this.data.tabIndex].cagesList,
|
|
|
})
|
|
|
break;
|
|
|
case "4":
|
|
|
this.data.multiComponentList[this.data.tabIndex].zhijList.splice(e.currentTarget.dataset.index, 1)
|
|
|
this.setData({
|
|
|
[`multiComponentList[${this.data.tabIndex}].zhijList`]: this.data.multiComponentList[this.data.tabIndex].zhijList,
|
|
|
})
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
/** 上传设计图纸,多张图片递归 **/
|
|
|
afteruploadPhotoReadS(e, count) {
|
|
|
let ob = {
|
|
|
name: '',
|
|
|
url: '',
|
|
|
}
|
|
|
wx.showLoading({
|
|
|
title: '加载第' + (count + 1) + '张照片中',
|
|
|
mask: true,
|
|
|
})
|
|
|
const element = e.detail.file[count];
|
|
|
var that = this;
|
|
|
wx.uploadFile({
|
|
|
url: that.data.API_BASE_URL + 'common/weChat/uploadImage',
|
|
|
filePath: element.url,
|
|
|
name: 'file',
|
|
|
success(res) {
|
|
|
wx.hideLoading()
|
|
|
console.log("res", res)
|
|
|
if (res.statusCode == 200) {
|
|
|
count = count + 1;
|
|
|
ob.name = res.data
|
|
|
ob.url = element.url
|
|
|
that.data.multiPhoto[that.data.tabIndex].designDrawings.push(ob)
|
|
|
console.log("designDrawings", that.data.multiPhoto[that.data.tabIndex].designDrawings)
|
|
|
that.setData({
|
|
|
'photo.designDrawings': that.data.multiPhoto[that.data.tabIndex].designDrawings
|
|
|
})
|
|
|
if (count == e.detail.file.length) {
|
|
|
wx.showToast({
|
|
|
title: '选择成功',
|
|
|
icon: 'error'
|
|
|
})
|
|
|
} else {
|
|
|
that.afteruploadPhotoReadS(e, count)
|
|
|
}
|
|
|
} else {
|
|
|
wx.showToast({
|
|
|
title: '选择失败',
|
|
|
icon: 'error'
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
/** 文件上传多张递归 **/
|
|
|
afteruploadPhotoReadFile(e, file, count, type) {
|
|
|
let ob = {
|
|
|
name: '',
|
|
|
url: '',
|
|
|
}
|
|
|
const name = e.currentTarget.dataset.name
|
|
|
let tabIndex = e.currentTarget.dataset.tabindex;
|
|
|
console.log(55555, name, tabIndex ,this.data.multiPhoto[tabIndex][name].length)
|
|
|
wx.showLoading({
|
|
|
title: '加载第' + (count + 1) + '张照片中',
|
|
|
mask: true,
|
|
|
})
|
|
|
const element = file[count];
|
|
|
var that = this;
|
|
|
var url = ''
|
|
|
if(type =='file'){
|
|
|
//获取文件后缀
|
|
|
let suffix = element.path.substring(element.path.lastIndexOf('.') + 1)
|
|
|
// console.log(989898, name,suffix)
|
|
|
if (suffix.search(/pdf|jpg|png|jpeg|doc|docx|xls|xlsx/) == -1&&name=='designDrawings') {
|
|
|
wx.showToast({
|
|
|
title: '文件格式不正确',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
else if (suffix.search(/jpg|png|jpeg|pdf/) == -1 && name!='designDrawings') {
|
|
|
wx.showToast({
|
|
|
title: '只能上传jpg、png、jpeg、pdf文件',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
url = API_BASE_URL + 'common/uploadFile_Name?fileName='+ element.name
|
|
|
}else{
|
|
|
url = API_BASE_URL + 'common/weChat/uploadImage'
|
|
|
}
|
|
|
wx.uploadFile({
|
|
|
url: url,
|
|
|
filePath: type =='file'?element.path:element.tempFilePath,
|
|
|
name: 'file',
|
|
|
success(res) {
|
|
|
wx.hideLoading()
|
|
|
if (res.statusCode == 200) {
|
|
|
count = count + 1;
|
|
|
ob.name = type =='file'?JSON.parse(res.data).path: res.data,
|
|
|
ob.url = type =='file'?JSON.parse(res.data).path:element.tempFilePath
|
|
|
that.data.multiPhoto[tabIndex][name].push(ob);
|
|
|
that.setData({
|
|
|
[`multiPhoto[${tabIndex}].${name}`]: that.data.multiPhoto[tabIndex][name]
|
|
|
})
|
|
|
if (count == file.length) {
|
|
|
wx.showToast({
|
|
|
title: '选择成功',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
} else {
|
|
|
that.afteruploadPhotoReadFile(e, file, count, type)
|
|
|
}
|
|
|
} else {
|
|
|
wx.showToast({
|
|
|
title: '选择失败',
|
|
|
icon: 'error'
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
/** 不通过 **/
|
|
|
noPass(e) {
|
|
|
if (!this.data.auditOpinion) {
|
|
|
wx.showToast({
|
|
|
title: '请输入不通过审核意见',
|
|
|
icon: 'none'
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
wx.showLoading({
|
|
|
title: "提交中"
|
|
|
})
|
|
|
appletsFailed({
|
|
|
id: this.data.entryId,
|
|
|
remarks: this.data.auditOpinion ? this.data.auditOpinion : "",
|
|
|
userId: wx.getStorageSync('userId')
|
|
|
}).then((res) => {
|
|
|
wx.hideLoading()
|
|
|
if (res.code == 200) {
|
|
|
wx.showToast({
|
|
|
title: '不通过成功',
|
|
|
icon: 'none',
|
|
|
success: function () {
|
|
|
setTimeout(function () {
|
|
|
wx.navigateBack()
|
|
|
}, 1500)
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
wx.showToast({
|
|
|
title: res.msg || res.errMsg,
|
|
|
icon: res.code
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
/** 通过 **/
|
|
|
pass(ee) {
|
|
|
var CustomerEntry = {
|
|
|
id: this.data.id ? this.data.id : "",
|
|
|
examineRemarks: this.data.auditOpinion ? this.data.auditOpinion : "", //审核意见
|
|
|
}
|
|
|
console.log("CustomerEntry", CustomerEntry)
|
|
|
// return
|
|
|
var data = {
|
|
|
userId: wx.getStorageSync('userId'),
|
|
|
CustomerEntry: CustomerEntry,
|
|
|
}
|
|
|
|
|
|
wx.showLoading({
|
|
|
title: "提交中"
|
|
|
})
|
|
|
|
|
|
appletsToExamine(
|
|
|
data).then((res) => {
|
|
|
wx.hideLoading()
|
|
|
if (res.code == 200) {
|
|
|
wx.showToast({
|
|
|
title: '通过成功',
|
|
|
icon: 'none',
|
|
|
success: function () {
|
|
|
setTimeout(function () {
|
|
|
wx.navigateBack()
|
|
|
}, 1500)
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
wx.showToast({
|
|
|
title: res.msg || res.errMsg,
|
|
|
icon: 'none'
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
/** 取消 **/
|
|
|
cancel(e) {
|
|
|
wx.showModal({
|
|
|
title: '提示',
|
|
|
content: '确定取消?',
|
|
|
complete: (res) => {
|
|
|
if (res.cancel) {}
|
|
|
if (res.confirm) {
|
|
|
wx.navigateBack()
|
|
|
}
|
|
|
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
/** 勘测设计暂存或提交 **/
|
|
|
submitFrom(e) {
|
|
|
var type = e.currentTarget.dataset.type
|
|
|
let multiScheme = this.data.multiScheme //方案信息集合
|
|
|
let multiComponentList = this.data.multiComponentList //组件信息集合
|
|
|
let productList = this.data.productList //产品信息集合
|
|
|
let addEntryReqDesignDetails = []
|
|
|
console.log(1221, multiScheme)
|
|
|
//方案信息校检
|
|
|
try{
|
|
|
multiScheme.forEach((sitem, index)=>{
|
|
|
addEntryReqDesignDetails.push({
|
|
|
"projectId": sitem.standardSolutionsList[0].projectId, // 产品id
|
|
|
"schemeTypeId": sitem.standardSolutionsList[0].typeId,//方案类型id
|
|
|
"schemeTypeName": sitem.standardSolutionsList[0].type,//方案类型名称
|
|
|
"schemeId": sitem.standardSolutionsList[0].id,//方案id
|
|
|
"schemeName": sitem.standardSolutionsList[0].name,//方案名称
|
|
|
"designDrawings": this.data.multiPhoto[index].designDrawings.length > 0 ? this.data.multiPhoto[index].designDrawings.map(itm => itm.name).join(",") : "" ,//设计图纸
|
|
|
// "designDrawingsName":sitem.projectId//设计图纸名称
|
|
|
})
|
|
|
console.log(666555, addEntryReqDesignDetails, sitem.standardSolutionsList[0].id)
|
|
|
if (this.data.schemeType == 1 && sitem.standardSolutionsList[0].id == '') {
|
|
|
wx.showToast({
|
|
|
title: "请完整选择标准方案",
|
|
|
icon: 'none'
|
|
|
})
|
|
|
throw Error()
|
|
|
} else if (this.data.schemeType == 2) {
|
|
|
for (let i = 0; i < this.data.combinedSolutionsList.length; i++) {
|
|
|
const element = this.data.combinedSolutionsList[i];
|
|
|
if (!element.code) {
|
|
|
wx.showToast({
|
|
|
title: "请完整选择组合方案",
|
|
|
icon: 'none'
|
|
|
})
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}catch(e) { console.log(e) }
|
|
|
|
|
|
var composePlanList = []; // 标准方案或组合方案
|
|
|
if (this.data.schemeType == 2) { //组合
|
|
|
this.data.combinedSolutionsList.forEach(element => {
|
|
|
var composePlanListOB = {}
|
|
|
composePlanListOB.code = element.code;
|
|
|
composePlanListOB.name = element.name;
|
|
|
composePlanListOB.planType = element.type;
|
|
|
composePlanListOB.planId = element.id;
|
|
|
composePlanListOB.planTypeId = element.planTypeId;
|
|
|
composePlanList.push(composePlanListOB)
|
|
|
});
|
|
|
}
|
|
|
|
|
|
var itemList = []; //组件 逆变器 并网箱 1:组件 2:逆变器 3:并网箱
|
|
|
multiComponentList.forEach(citem=>{
|
|
|
citem.componentList.forEach(element => { //组件
|
|
|
var component = {}
|
|
|
if (element.id && element.num) {
|
|
|
component.itemType = 3;
|
|
|
component.projectId = element.projectId;
|
|
|
component.itemId = element.id;
|
|
|
component.num = element.num
|
|
|
itemList.push(component)
|
|
|
}
|
|
|
});
|
|
|
|
|
|
citem.converterList.forEach(element => { //逆变器
|
|
|
var component = {}
|
|
|
if (element.id && element.num) {
|
|
|
component.itemType = 1;
|
|
|
component.projectId = element.projectId;
|
|
|
component.itemId = element.id;
|
|
|
component.num = element.num;
|
|
|
itemList.push(component)
|
|
|
}
|
|
|
});
|
|
|
|
|
|
citem.cagesList.forEach(element => { //并网箱
|
|
|
var component = {}
|
|
|
if (element.id && element.num) {
|
|
|
component.itemType = 2;
|
|
|
component.projectId = element.projectId;
|
|
|
component.itemId = element.id;
|
|
|
component.num = element.num;
|
|
|
itemList.push(component)
|
|
|
}
|
|
|
});
|
|
|
citem.zhijList.forEach(element => { //支架
|
|
|
var component = {}
|
|
|
if (element.id && element.num) {
|
|
|
component.itemType = 4;
|
|
|
component.projectId = element.projectId;
|
|
|
component.itemId = element.id;
|
|
|
component.num = element.num;
|
|
|
itemList.push(component)
|
|
|
}
|
|
|
});
|
|
|
})
|
|
|
|
|
|
|
|
|
var CustomerEntry = {
|
|
|
type: type, //0:暂存 1:提交
|
|
|
id: this.data.id ? this.data.id : "",
|
|
|
composePlanLists: composePlanList.length > 0 ? composePlanList : [],
|
|
|
itemList: itemList,
|
|
|
|
|
|
schemeTypeId: this.data.schemeType == 1 ? this.data.standardSolutionsList[0].typeId ? this.data.standardSolutionsList[0].typeId : "" : "", //当设计方案为标准方案时,传参
|
|
|
schemeTypeName: this.data.schemeType == 1 ? this.data.standardSolutionsList[0].type ? this.data.standardSolutionsList[0].type : "" : "",
|
|
|
schemeId: this.data.schemeType == 1 ? this.data.standardSolutionsList[0].id ? this.data.standardSolutionsList[0].id : "" : "",
|
|
|
schemeName: this.data.schemeType == 1 ? this.data.standardSolutionsList[0].name ? this.data.standardSolutionsList[0].name : "" : "",
|
|
|
|
|
|
designDrawings: this.data.photo.designDrawings.length > 0 ? this.data.photo.designDrawings.map(itm => itm.name).join(",") : "", //设计图纸,
|
|
|
zjpbImg: this.data.photo.zjpbImg.length > 0 ? this.data.photo.zjpbImg.map(itm => itm.name).join(",") : "", //组件排布图,
|
|
|
zjzxImg: this.data.photo.zjzxImg.length > 0 ? this.data.photo.zjzxImg.map(itm => itm.name).join(",") : "", //组件支架图,
|
|
|
zjcsImg: this.data.photo.zjcsImg.length > 0 ? this.data.photo.zjcsImg.map(itm => itm.name).join(",") : "", //组件接线图,
|
|
|
zjhsImg: this.data.photo.zjhsImg.length > 0 ? this.data.photo.zjhsImg.map(itm => itm.name).join(",") : "", //电气图,
|
|
|
|
|
|
schemeType: this.data.schemeType, //设计方案
|
|
|
schemeRemarks: this.data.solutionRemark ? this.data.solutionRemark : "", //方案备注
|
|
|
examineRemarks: this.data.auditOpinion ? this.data.auditOpinion : "", //审核意见
|
|
|
|
|
|
projectList: this.data.projectList,
|
|
|
addEntryReqDesignDetails
|
|
|
}
|
|
|
console.log("CustomerEntry", CustomerEntry)
|
|
|
console.log("zhijList", this.data.zhijList)
|
|
|
// return
|
|
|
var data = {
|
|
|
userId: wx.getStorageSync('userId'),
|
|
|
CustomerEntry: CustomerEntry,
|
|
|
}
|
|
|
|
|
|
wx.showLoading({
|
|
|
title: "提交中"
|
|
|
})
|
|
|
|
|
|
designCustomerEntry(
|
|
|
data).then((res) => {
|
|
|
wx.hideLoading()
|
|
|
if (res.code == 200) {
|
|
|
wx.showToast({
|
|
|
title: '操作成功',
|
|
|
icon: 'none',
|
|
|
success: function () {
|
|
|
setTimeout(function () {
|
|
|
wx.navigateBack()
|
|
|
}, 1500)
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
wx.showToast({
|
|
|
title: res.msg || res.errMsg,
|
|
|
icon: 'none'
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
/** 文件或图片上传选择-对话框 **/
|
|
|
selectUplosd(e){
|
|
|
var that = this;
|
|
|
let name = e.currentTarget.dataset.name;
|
|
|
let maxcount = e.currentTarget.dataset.maxcount;
|
|
|
|
|
|
wx.showActionSheet({
|
|
|
itemList: ['文件', '图片'],
|
|
|
success: function (res) {
|
|
|
if (!res.cancel) {
|
|
|
if (res.tapIndex == 0) {//文件
|
|
|
that.upload(e);
|
|
|
} else if (res.tapIndex == 1) {//图片
|
|
|
wx.chooseMedia({
|
|
|
count: maxcount - that.data.photo[name].length,
|
|
|
mediaType: ['image'],
|
|
|
sourceType: ['album'],
|
|
|
success: function (rep) {
|
|
|
if (Array.isArray(rep.tempFiles)) { //多张
|
|
|
var count = 0;
|
|
|
that.afteruploadPhotoReadFile(e, rep.tempFiles, count)
|
|
|
return
|
|
|
}
|
|
|
wx.showLoading({
|
|
|
title: '选择中',
|
|
|
})
|
|
|
wx.uploadFile({
|
|
|
url: API_BASE_URL + 'common/weChat/uploadImage',
|
|
|
filePath: rep.tempFiles[0].tempFilePath,
|
|
|
name: 'file',
|
|
|
complete: function (res) {
|
|
|
wx.hideLoading()
|
|
|
if (res.statusCode == 200) {
|
|
|
wx.showToast({
|
|
|
title: '选择成功',
|
|
|
icon: 'none',
|
|
|
})
|
|
|
var item = {
|
|
|
url: "",
|
|
|
name: "",
|
|
|
}
|
|
|
item.url = rep.tempFiles[0].tempFilePath;
|
|
|
item.name = res.data;
|
|
|
that.data.photo[name].push(item)
|
|
|
that.setData({
|
|
|
[`photo.${name}`]: that.data.photo[name]
|
|
|
})
|
|
|
} else {
|
|
|
wx.showToast({
|
|
|
title: '选择失败',
|
|
|
icon: 'error'
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
fail: function(){},
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
//tab切换
|
|
|
changeTab(e){
|
|
|
let index = e.currentTarget.dataset.index
|
|
|
this.setData({
|
|
|
tabIndex: index
|
|
|
})
|
|
|
this.getElectricPlanAll()
|
|
|
}
|
|
|
}) |