| | |
| | | formData: { user: 'test' }, |
| | | success(res) { |
| | | // 上传完成需要更新 fileList |
| | | const { fileImgList = [] } = that.data; |
| | | const { transactionReceiptList = [] } = that.data; |
| | | const { otherList = [] } = that.data; |
| | | const { cardIdList = [] } = that.data; |
| | | const { fileImgList = [] } = that.data; //合同 |
| | | const { transactionReceiptList = [] } = that.data; // 交易凭证 |
| | | const { otherList = [] } = that.data; //其他 |
| | | const { cardIdList = [] } = that.data; //身份证 |
| | | let result = JSON.parse(res.data) |
| | | if (that.data.beforList == 'a') { |
| | | cardIdList.push({ ...file, url: result.data }); |
| | | that.setData({ cardIdList }); |
| | | console.log(that.data.cardIdList); |
| | | |
| | | } else if (that.data.beforList == 'b') { |
| | | fileImgList.push({ ...file, url: result.data }); |
| | | that.setData({ fileImgList }); |
| | |
| | | this.data.reportDetail.reportMaterials = this.data.materials |
| | | this.data.reportDetail.userId = wx.getStorageSync('id') |
| | | this.data.reportDetail.cheatTime = this.data.cheatTime |
| | | this.data.reportDetail.idCardMaterials = this.data.cardIdList.map(res => res.url).join(',') |
| | | this.data.reportDetail.contractMaterials = this.data.fileImgList.map(res => res.url).join(',') |
| | | this.data.reportDetail.transactionMaterials = this.data.transactionReceiptList.map(res => res.url).join(',') |
| | | this.data.reportDetail.elseMaterials = this.data.otherList.map(res => res.url).join(',') |
| | | this.data.reportDetail.idCardMaterials =this.data.cardIdList.length>0? this.data.cardIdList.map(res => res.url).join(','):null |
| | | this.data.reportDetail.contractMaterials =this.data.fileImgList.length>0? this.data.fileImgList.map(res => res.url).join(','):null |
| | | this.data.reportDetail.transactionMaterials =this.data.transactionReceiptList.length>0? this.data.transactionReceiptList.map(res => res.url).join(','):null |
| | | this.data.reportDetail.elseMaterials =this.data.otherList.length>0? this.data.otherList.map(res => res.url).join(','):null;; |
| | | // if ( this.data.reportDetail.information==null|| this.data.reportDetail.reportDescription==null) { |
| | | // wx.showToast({ |
| | | // icon: "none", |
| | |
| | | }, |
| | | onLoad:function(e) { |
| | | console.log(e); |
| | | |
| | | let that = this |
| | | |
| | | let phone = wx.getStorageSync('phone') |
| | | that.setData({ |
| | | phone: phone |
| | |
| | | sexId: arraySex.findIndex(val=>{return val.sex == form.sex}), |
| | | Location: form.location, |
| | | workingLocation: form.workingLocation, |
| | | cardIdList: form.idCardMaterials.split(',').map(i => { |
| | | cardIdList:form.idCardMaterials? form.idCardMaterials.split(',').map(i => { |
| | | return { |
| | | thumb: that.imgComplete(i), |
| | | url: i, |
| | | type: "image", |
| | | size: 999999 |
| | | } |
| | | }), |
| | | fileImgList: form.contractMaterials.split(',').map(i => { |
| | | }):[], |
| | | fileImgList:form.contractMaterials? form.contractMaterials.split(',').map(i => { |
| | | return { |
| | | thumb: that.imgComplete(i), |
| | | url: i, |
| | | type: "image", |
| | | size: 999999 |
| | | } |
| | | }), |
| | | transactionReceiptList: form.transactionMaterials.split(',').map(i => { |
| | | }):[], |
| | | transactionReceiptList:form.transactionMaterials? form.transactionMaterials.split(',').map(i => { |
| | | return { |
| | | thumb: that.imgComplete(i), |
| | | url: i, |
| | | type: "image", |
| | | size: 999999 |
| | | } |
| | | }), |
| | | otherList: form.elseMaterials.split(',').map(i => { |
| | | }):[], |
| | | otherList:form.elseMaterials? form.elseMaterials.split(',').map(i => { |
| | | return { |
| | | thumb: that.imgComplete(i), |
| | | url: i, |
| | | type: "image", |
| | | size: 999999 |
| | | } |
| | | }) |
| | | }):[] |
| | | }) |
| | | } |
| | | }) |