| | |
| | | }); |
| | | } |
| | | |
| | | // 获取案件详情 |
| | | function getCaseDetailApi(submitData) { |
| | | // 附件上传的id |
| | | function getByIdApi(param) { |
| | | return $$.request({ |
| | | url: 'paCaseInfo/getCaseInfo?id=' + submitData, |
| | | url: 'caseUtils/getNewTimeCaseId', |
| | | type: 'get', |
| | | service: 'mediate' |
| | | submitData: param || {}, |
| | | service: 'utils' |
| | | }); |
| | | } |
| | | |
| | | // 获取保存的草稿案件 |
| | | function getDraftCaseApi(type) { |
| | | // 删除附件 |
| | | function delfileApi(id) { |
| | | return $$.request({ |
| | | url: 'paCaseInfo/listByInputUserAndStatus?inputStatus=' + type, |
| | | url: 'fileInfo/deleteFileById?id=' + id, |
| | | type: 'get', |
| | | service: 'mediate' |
| | | service: 'sys', |
| | | }); |
| | | } |
| | | |
| | | // 保存草稿 or 保存案件 |
| | | function submitCaseApi(submitData) { |
| | | function getawApi(submitData) { |
| | | return $$.request({ |
| | | url: 'paCaseInfo/applyCase', |
| | | url: 'case-law/get-clain-rise-case', |
| | | type: 'post', |
| | | ai: true, |
| | | submitData, |
| | | service: 'mediate' |
| | | service: 'mediate', |
| | | }); |
| | | } |
| | | |
| | | // 检查请求中的风险 |
| | | function checkCaseClaimRiskApi(submitData) { |
| | | return $$.request({ |
| | | url: 'guide/checkCaseClaimRisk', |
| | | type: 'post', |
| | | submitData, |
| | | v1: true, |
| | | service: 'mediate' |
| | | }); |
| | | } |
| | | |
| | | // 获取历史填写过的人员数据 |
| | | function getPersonHistoryApi() { |
| | | return $$.request({ |
| | | url: 'paCaseInfo/pickUser', |
| | | type: 'get', |
| | | service: 'mediate' |
| | | }); |
| | | } |
| | | |
| | | //类案推荐缓存 |
| | | // 获取案例 |
| | | function getCaseApi(submitData) { |
| | | return $$.request({ |
| | | url: 'guide/cacheLatjCaseGuide', |
| | | url: 'case-law/get-case', |
| | | type: 'post', |
| | | ai: true, |
| | | submitData, |
| | | type: 'get', |
| | | v1: true, |
| | | service: 'mediate' |
| | | service: 'mediate', |
| | | }); |
| | | } |
| | | |
| | | //案件特征 |
| | | function getFeatureApi(submitData) { |
| | | return $$.request({ |
| | | url: 'guide/cacheCaseFeature', |
| | | submitData, |
| | | type: 'get', |
| | | v1: true, |
| | | service: 'mediate' |
| | | }); |
| | | } |
| | | |
| | | //调解策略及争议焦点 |
| | | function getCacheOpenAiCaseGuideList(submitData) { |
| | | function caseRegisterSaveApi(submitData) { |
| | | return $$.request({ |
| | | url: 'guide/cacheOpenAiCaseGuideList', |
| | | url: 'caseInfo/caseRegister', |
| | | type: 'post', |
| | | submitData, |
| | | type: 'get', |
| | | v1: true, |
| | | service: 'mediate' |
| | | }); |
| | | } |
| | |
| | | location: [], // 省市区等地理资源 |
| | | select: {}, // 下拉框数据 |
| | | goToMaterialSave: false, // 避免跳转到材料上传页面重复保存草稿 |
| | | agreementMsg: '', // 服务协议 |
| | | ownerId: '', //附件上传id |
| | | data: { |
| | | stepText: 5, //用户须知倒计时5秒 |
| | | timer: null, // 用于存储定时器的引用 |
| | | popupVisibleText: false, //是否滚动到底部 |
| | | imgUrl: $$.url.img, |
| | | steps: [{ |
| | | title: '填写申请', |
| | | icon: '', |
| | | title: '填写人员', |
| | | number: '1', |
| | | activeIcon: 'steps-register-1-active.png' |
| | | }, |
| | | { |
| | | title: '预览申请', |
| | | icon: 'steps-register-2.png', |
| | | title: '描述纠纷', |
| | | number: '2', |
| | | activeIcon: 'steps-register-2-active.png' |
| | | }, |
| | | { |
| | | title: '提交申请', |
| | | icon: 'steps-register-3.png', |
| | | number: '3', |
| | | activeIcon: 'steps-register-3-active.png' |
| | | }, |
| | | ], |
| | | saveStatus: false, //未提交,已提交 |
| | | oneList: [], |
| | | titleShow: { |
| | | '09_01001-1': ['自然人', '姓名', '真实姓名'], |
| | | '09_01001-2': ['法人', '企业名称', '企业全名', '法定代表人姓名'], |
| | |
| | | }, // 用于判断显示的输入框标题 |
| | | stepsActive: 0, // 步骤条当前下标 |
| | | submitData: { |
| | | caseDes: '', |
| | | occurTime: new Date().getTime(), |
| | | occurTimeName: $$.moment(new Date().getTime()).format('YYYY-MM-DD'), |
| | | caseType: '', |
| | | caseTypeName: '', |
| | | caseClaim: '', |
| | | prov: '', |
| | | provName: '', |
| | | city: '', |
| | | cityName: '', |
| | | area: '', |
| | | areaName: '', |
| | | road: '', |
| | | roadName: '', |
| | | village: '', |
| | | villageName: '', |
| | | addr: '', |
| | | wantUserId: '', |
| | | wantUserName: '', |
| | | wantUnitId: '', |
| | | wantUnitName: '', |
| | | plaintiffList: [], |
| | | defendantList: [], |
| | | lat: '', |
| | | lng: '', |
| | | peopleNum: '', |
| | | amount: '', |
| | | caseDes: '', |
| | | caseClaim: '', |
| | | }, // 表单数据 |
| | | fileList: [], //表单附件 |
| | | addPersonData: {}, //添加的当事人 |
| | | materialNum: 0, // 纠纷材料总数量 |
| | | userInfoVisible: false, // 是否采用个人信息更新申请人信息 |
| | | timePicker: false, //时间选择展示 |
| | | maxDate: new Date().getTime(), |
| | | popup: { |
| | | formtype: '', // 控制在纠纷信息 or 申请人信息 or 被申请人添加数据 |
| | | index: 0, // 如为申请人信息 or 被申请人确认下拉选择此参数为下标 |
| | |
| | | data: [], |
| | | activeIndex: null |
| | | }, // 选择人员 |
| | | caseCause: [{ |
| | | value: '22_00039-0005', |
| | | label: '家庭婚姻纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0004', |
| | | label: '邻里纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0019', |
| | | label: '房屋宅基地纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0002', |
| | | label: '合同纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0020', |
| | | label: '生产经营纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0013', |
| | | label: '损害赔偿纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0015', |
| | | label: '山林土地纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0016', |
| | | label: '征地纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0021', |
| | | label: '环境污染纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0001', |
| | | label: '劳动争议纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0006', |
| | | label: '道路交通事故纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0007', |
| | | label: '医疗纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0022', |
| | | label: '物业管理纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0018', |
| | | label: '消费纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0023', |
| | | label: '旅游纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0008', |
| | | label: '知识产权纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0024', |
| | | label: '互联网纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0003', |
| | | label: '借贷纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0009', |
| | | label: '所有权纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0010', |
| | | label: '继承纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0011', |
| | | label: '人格权纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0012', |
| | | label: '股权转让纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0014', |
| | | label: '建设用地使用权纠纷', |
| | | }, |
| | | { |
| | | value: '22_00039-0017', |
| | | label: '其他纠纷', |
| | | }, |
| | | ], |
| | | threeAvtice: '1', |
| | | caseDesNum: 0, //事项概况字数 |
| | | caseClaimNum: 0, //事项申请字数 |
| | | }, |
| | | |
| | | //类案推荐展开隐藏 |
| | | _case() { |
| | | this.setData({ |
| | | showDetail: !this.data.showDetail, |
| | | // 获取服务协议 |
| | | async getAgreement() { |
| | | var that = this; |
| | | const res = await $$.commonRequest({ |
| | | url: `${$$.url.txt}agree.txt`, |
| | | type: 'get' |
| | | }); |
| | | if (res) { |
| | | that.data.popupVisible = true; |
| | | that.setData({ |
| | | popupVisible: true, |
| | | }); |
| | | this.startCountdown(); // 启动倒计时 |
| | | } |
| | | }, |
| | | |
| | | //须知弹窗倒计时 |
| | | startCountdown: function () { |
| | | let that = this; |
| | | that.setData({ |
| | | timer: setInterval(function () { |
| | | if (that.data.stepText > 0) { |
| | | that.data.stepText--; |
| | | that.setData({ |
| | | stepText: that.data.stepText |
| | | }); |
| | | } else { |
| | | clearInterval(that.data.timer); // 倒计时结束,清除定时器 |
| | | // 在这里执行销毁操作,比如隐藏或删除倒计时组件 |
| | | } |
| | | }, 1000) |
| | | }) |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | | // 身份证ocr |
| | | handleOCR(e) { |
| | | let that = this; |
| | | wx.chooseMedia({ |
| | | count: 1, |
| | | mediaType: ['image'], |
| | | success(res2) { |
| | | const tempFiles = res2.tempFiles[0]; |
| | | $$.showLoading(); |
| | | wx.uploadFile({ |
| | | url: `${$$.baseUrl}${$$.url.sys}/api/v1/fileInfo/wecatRecognition`, |
| | | filePath: tempFiles.tempFilePath, |
| | | name: 'file', |
| | | header: { |
| | | Authorization: app.globalData.token |
| | | }, |
| | | complete(res3) { |
| | | $$.hideLoading(); |
| | | if (res3.errMsg === 'uploadFile:ok') { |
| | | let { |
| | | code, |
| | | data |
| | | } = JSON.parse(res3.data); |
| | | if (code == -1) { |
| | | $$.errorModal({ |
| | | content: '识别失败' |
| | | }); |
| | | return; |
| | | } |
| | | let item = that.data.popupMsg.data; |
| | | that.data.popupMsg.data.certiNo = data?.ocrResult.certificateNumber; |
| | | that.data.popupMsg.data[item.perClass === '09_01001-1' ? 'trueName' : 'deputy'] = data?.ocrResult.trueName; |
| | | that.setData({ |
| | | popupMsg: that.data.popupMsg |
| | | }); |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | | }); |
| | | }, |
| | | |
| | | // 表单修改 |
| | | handleChange(e) { |
| | | let formtype = e.currentTarget.dataset.formtype, |
| | | key = e.currentTarget.dataset.key, |
| | | let key = e.currentTarget.dataset.key, |
| | | value = e.detail; |
| | | if (formtype === 'popupMsg') { |
| | | // 修改申请人and被申请人的form |
| | | this.data.popupMsg.data[key] = value; |
| | | } else { |
| | | this.data.submitData[key] = value; |
| | | } |
| | | this.data.submitData[key] = value; |
| | | this.setData({ |
| | | submitData: this.data.submitData |
| | | }); |
| | | if (key === 'caseDes' || key === 'caseClaim') { |
| | | this.setData({ |
| | | [key + 'Num']: value.length |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 删除意向调解信息 |
| | | handleDeleteWant() { |
| | | let that = this; |
| | | $$.showModal({ |
| | | content: '确定删除意向调解信息吗?', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | let obj = { |
| | | wantUserId: '', |
| | | wantUserName: '', |
| | | wantUnitId: '', |
| | | wantUnitName: '', |
| | | }; |
| | | that.setData({ |
| | | submitData: { |
| | | ...that.data.submitData, |
| | | ...obj |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | threeTagChange(e) { |
| | | value = e.detail; |
| | | this.setData({ |
| | | threeAvtice: value |
| | | }); |
| | | }, |
| | | |
| | | // 下拉框选择确认 |
| | | handleConfirmPicker({ |
| | | detail |
| | |
| | | }); |
| | | } else if (type === 'location') { |
| | | arr = [ |
| | | ['prov', 'provName'], |
| | | ['city', 'cityName'], |
| | | ['area', 'areaName'], |
| | | ['road', 'roadName'], |
| | | ['village', 'villageName'], |
| | | ['road', 'roadName'] |
| | | ]; |
| | | arr.forEach((x, t) => { |
| | | this.data.submitData[x[0]] = value[t]?.value || ''; |
| | |
| | | }); |
| | | }, |
| | | |
| | | // 多行下拉选择时,省市区选择 |
| | | handleChangeColumns(e) { |
| | | if (this.data.popup.type === 'location') { |
| | | let selectData = $$.changeLocation(e, this.location, this.data.popup.selectData); |
| | | this.setData({ |
| | | popup: { |
| | | ...this.data.popup, |
| | | selectData |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 下拉框选择开启 |
| | | handleShowPopup(e) { |
| | |
| | | values: selectOption[arr[0]].children[arr[1]].children || [], |
| | | defaultIndex: arr[2] |
| | | }, |
| | | { |
| | | values: selectOption[arr[0]].children[arr[1]].children[arr[2]].children || [], |
| | | defaultIndex: arr[3] |
| | | }, |
| | | ]; |
| | | selectData.forEach((x) => { |
| | | x.values.forEach((y) => { |
| | | delete y.children; |
| | | }); |
| | | }); |
| | | } else if (type === 'occurTime') { |
| | | this.setData({ |
| | | timePicker: true |
| | | }) |
| | | return; |
| | | } else { |
| | | let selectOption = this.select[type]; |
| | | selectData = [{ |
| | |
| | | }, |
| | | }); |
| | | }, |
| | | |
| | | // 关闭下拉框选择 |
| | | handleClosePopup() { |
| | | this.data.popup.visible = false; |
| | |
| | | }); |
| | | }, |
| | | |
| | | // 调解请求输入时额外的需求操作 |
| | | handlecaseClaimFocus() { |
| | | if (!this.data.submitData.caseClaim) { |
| | | this.data.submitData.caseClaim = '请求1:'; |
| | | this.setData({ |
| | | submitData: this.data.submitData |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 点击新增 or 删除 or 修改 申请人或被申请人 |
| | | handleEditParty(e) { |
| | | let that = this; |
| | | let formtype = e.currentTarget.dataset.formtype, |
| | | index = e.currentTarget.dataset.index, |
| | | edittype = e.currentTarget.dataset.edittype, |
| | | agent = e.currentTarget.dataset.agent; |
| | | let type = formtype === 'plaintiffList' ? 2 : 3; |
| | | if (edittype === 'delete') { |
| | | // 点击删除 |
| | | $$.showModal({ |
| | | content: '确定删除当前人员信息吗?', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | let formtype_ = that.data.popupMsg.type === 2 ? 'plaintiffList' : 'defendantList'; |
| | | let partyIndex = that.data.popupMsg.partyIndex; |
| | | if (this.data.popupMsg.partyTabActive === '2') { |
| | | that.data.submitData[formtype_][partyIndex].agent = null; |
| | | } else { |
| | | that.data.submitData[formtype_].splice(partyIndex, 1); |
| | | } |
| | | that.setData({ |
| | | submitData: that.data.submitData, |
| | | popupMsg: { |
| | | show: false |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | }); |
| | | } else if (edittype === 'edit') { |
| | | // 点击修改 |
| | | let data = this.data.submitData[formtype][index]; |
| | | this.setData({ |
| | | popupMsg: { |
| | | show: true, |
| | | title: formtype === 'plaintiffList' ? '修改申请人' : '修改被申请人', |
| | | type: type, |
| | | editType: 'edit', |
| | | buttonText: '保存信息', |
| | | partyArr: this.select['personClass'], |
| | | partyTabActive: agent ? '2' : '1', |
| | | partyIndex: index, |
| | | perClassIndex: agent ? 0 : data.perClass === '09_01001-1' ? 0 : data.perClass === '09_01001-2' ? 1 : 2, |
| | | data: agent ? data.agent : data, |
| | | }, |
| | | }); |
| | | } else { |
| | | // 点击增加 |
| | | this.setData({ |
| | | popupMsg: { |
| | | show: true, |
| | | title: formtype === 'plaintiffList' ? '增加申请人' : '增加被申请人', |
| | | type: type, |
| | | editType: 'add', |
| | | buttonText: '保存信息', |
| | | partyArr: this.select['personClass'], |
| | | partyTabActive: '1', // 当事人代理人tab下标 |
| | | perClassIndex: 0, // 当事人类型下标 |
| | | data: { |
| | | id: $$.getBusinessId(), |
| | | perClass: '09_01001-1', |
| | | perClassName: '自然人', |
| | | trueName: '', |
| | | deputy: '', |
| | | mobile: '', |
| | | certiNo: '', |
| | | }, |
| | | }, |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 切换增加弹窗的'1'当事人,'2'代理人 |
| | | handleChangeTab(e) { |
| | | if (this.data.popupMsg.editType === 'edit') { |
| | | Toast.fail('不支持修改类型'); |
| | | return false; |
| | | } |
| | | // 滚动到底部事件 |
| | | handlescrolltolower() { |
| | | this.setData({ |
| | | popupMsg: { |
| | | ...this.data.popupMsg, |
| | | partyTabActive: e.detail.name, |
| | | perClassIndex: 0, |
| | | partyIndex: 0, |
| | | data: { |
| | | ...this.data.popupMsg.data, |
| | | perClass: '09_01001-1', |
| | | perClassName: '自然人', |
| | | trueName: '', |
| | | deputy: '', |
| | | mobile: '', |
| | | certiNo: '', |
| | | }, |
| | | }, |
| | | }); |
| | | popupVisibleText: true |
| | | }) |
| | | }, |
| | | |
| | | // 切换增加弹窗的人员类型 |
| | | handleChangePerClass(e) { |
| | | if (this.data.popupMsg.editType === 'edit') { |
| | | Toast.fail('不支持修改类型'); |
| | | return false; |
| | | } |
| | | let value = e.currentTarget.dataset.item; |
| | | let index = e.currentTarget.dataset.index; |
| | | let arr = ['perClass', 'perClassName']; |
| | | arr.forEach((x, t) => { |
| | | this.data.popupMsg.data[x] = value[t === 0 ? 'value' : 'label']; |
| | | }); |
| | | this.data.popupMsg.data.trueName = ''; |
| | | this.data.popupMsg.data.deputy = ''; |
| | | this.data.popupMsg.perClassIndex = index; |
| | | this.setData({ |
| | | popupMsg: this.data.popupMsg |
| | | }); |
| | | }, |
| | | |
| | | // 选择代理人 |
| | | handleSelectAgent(e) { |
| | | this.setData({ |
| | | popupMsg: { |
| | | ...this.data.popupMsg, |
| | | partyIndex: e.currentTarget.dataset.index, |
| | | }, |
| | | }); |
| | | }, |
| | | |
| | | // 底部弹窗操作,恢复草稿 |
| | | handleClickPopupMsg() { |
| | | if (this.data.popupMsg.type === 1) { |
| | | // 恢复草稿 |
| | | this.setData({ |
| | | materialNum: this.data.popupMsg.submitData.fileSize, |
| | | userInfoVisible: false, |
| | | submitData: { |
| | | ...this.data.submitData, |
| | | ...this.data.popupMsg.submitData, |
| | | ...this.data.popupMsg.intentionObj |
| | | }, |
| | | popupMsg: { |
| | | show: false |
| | | }, |
| | | }); |
| | | } else { |
| | | // 当事人保存 |
| | | let popupMsg = this.data.popupMsg; |
| | | let data = this.data.popupMsg.data; |
| | | |
| | | // 信息校验 |
| | | let msg = null; |
| | | let arr = this.data.submitData[popupMsg.type === 2 ? 'defendantList' : 'plaintiffList']; |
| | | let arr2 = this.data.submitData[popupMsg.type === 2 ? 'plaintiffList' : 'defendantList']; |
| | | |
| | | console.log('arr2', arr2); |
| | | console.log('arr', arr); |
| | | console.log('data', data); |
| | | console.log('popupMsg', popupMsg); |
| | | forEach: for (let t = 0; t < arr.length; t++) { |
| | | if (arr[t].certiNo === data.certiNo && !!$$.verifyEmpty(data.certiNo)) { |
| | | msg = '申请人与被申请人不能相同'; |
| | | break forEach; |
| | | } |
| | | } |
| | | forEach: for (let t = 0; t < arr2.length; t++) { |
| | | if (arr2[t].certiNo === data.certiNo && !!$$.verifyEmpty(data.certiNo) && arr2[t].perClass === data.perClass && t !== popupMsg.partyIndex) { |
| | | msg = `与${popupMsg.type === 3 ? '被' : ''}申请人不能重复`; |
| | | break forEach; |
| | | } |
| | | } |
| | | // 被申请人可不需要手机号码,申请人和代理人需要 |
| | | if ( |
| | | (data.mobile && !$$.mobileRegExp(data.mobile) && popupMsg.type === 3) || |
| | | (!$$.mobileRegExp(data.mobile) && popupMsg.type === 2) || |
| | | (!$$.mobileRegExp(data.mobile) && popupMsg.partyTabActive === '2') |
| | | ) { |
| | | msg = '请输入正确的手机号码'; |
| | | } |
| | | if (!$$.verifyEmpty(data.trueName) || (data.perClass !== '09_01001-1' && !$$.verifyEmpty(data.deputy))) { |
| | | msg = '请补充' + (popupMsg.type === 3 ? '被' : '') + '申请人方的' + (popupMsg.partyTabActive === '1' ? '当事人' : '代理人') + '信息'; |
| | | } |
| | | if (popupMsg.partyTabActive === '1') { |
| | | |
| | | } |
| | | // 增加申请人的信息 |
| | | // if (!arr2[popupMsg.partyIndex]?.trueName || !arr2[popupMsg.partyIndex]?.mobile) { |
| | | // msg = '请补充申请人方的当事人信息'; |
| | | // } |
| | | if (msg) { |
| | | Toast.fail(msg); |
| | | return; |
| | | } |
| | | if (popupMsg.partyTabActive === '2' && typeof popupMsg.partyIndex !== 'number') { |
| | | Toast.fail('请选择代理对象'); |
| | | return; |
| | | } |
| | | if (popupMsg.partyTabActive === '2' && arr2[popupMsg.partyIndex]?.certiNo === data.certiNo) { |
| | | Toast.fail('代理人与当事人不能相同'); |
| | | return; |
| | | } |
| | | |
| | | let type = popupMsg.type === 2 ? 'plaintiffList' : 'defendantList'; |
| | | if (popupMsg.partyTabActive === '2') { |
| | | this.data.submitData[type][popupMsg.partyIndex] = { |
| | | ...this.data.submitData[type][popupMsg.partyIndex] |
| | | }; |
| | | this.data.submitData[type][popupMsg.partyIndex].agent = { |
| | | ...this.data.submitData[type][popupMsg.partyIndex].agent, |
| | | ...data |
| | | }; |
| | | } else { |
| | | if (popupMsg.editType === 'add') { |
| | | this.data.submitData[type] = [...this.data.submitData[type], data]; |
| | | } else { |
| | | this.data.submitData[type][popupMsg.partyIndex] = { |
| | | ...this.data.submitData[type][popupMsg.partyIndex], |
| | | ...data |
| | | }; |
| | | } |
| | | } |
| | | this.setData({ |
| | | submitData: this.data.submitData, |
| | | popupMsg: { |
| | | show: false |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 关闭底部弹窗 |
| | | handleClosePopupMsg() { |
| | | if (this.data.popupMsg.type === 1) { |
| | | this.getUserInfo(this.data.popupMsg.intentionObj); |
| | | } else { |
| | | this.setData({ |
| | | popupMsg: { |
| | | show: false |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 关闭选择人员 |
| | | handleVisiblePopupSelect(e) { |
| | | // 用户须知 |
| | | handleAgree(e) { |
| | | let type = e.currentTarget.dataset.type; |
| | | if (type === 'open') { |
| | | this.getPersonHistory(); |
| | | } else { |
| | | this.setData({ |
| | | popupSelect: { |
| | | show: false |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 选择人员 |
| | | handleSelectPerson(e) { |
| | | this.setData({ |
| | | popupSelect: { |
| | | ...this.data.popupSelect, |
| | | activeIndex: e.currentTarget.dataset.index |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // 确定历史人员数据填充 |
| | | handleConfirmPerson() { |
| | | if (typeof this.data.popupSelect.activeIndex !== 'number') { |
| | | Toast.fail('请选择人员'); |
| | | if (!this.data.popupVisibleText) { |
| | | Toast('请阅读完整的用户须知'); |
| | | return; |
| | | } |
| | | let data = this.data.popupSelect.data[this.data.popupSelect.activeIndex] || {}; |
| | | this.data.popupMsg.perClassIndex = |
| | | this.data.popupMsg.partyTabActive === '2' ? 0 : data.perClass === '09_01001-1' ? 0 : data.perClass === '09_01001-2' ? 1 : 2; |
| | | this.data.popupMsg.data = { |
| | | ...this.data.popupMsg.data, |
| | | perClass: data.perClass, |
| | | perClassName: data.perClassName, |
| | | trueName: data.trueName, |
| | | deputy: data.deputy, |
| | | mobile: data.mobile, |
| | | certiNo: data.certiNo, |
| | | }; |
| | | this.setData({ |
| | | popupSelect: { |
| | | show: false |
| | | }, |
| | | popupMsg: this.data.popupMsg |
| | | }); |
| | | }, |
| | | |
| | | // 跳转至材料上传页面 |
| | | handleGoToMaterial() { |
| | | // 先保存 |
| | | if (this.data.submitData.inputStatus !== '2') { |
| | | this.goToMaterialSave = true; |
| | | this.saveCase(); |
| | | } |
| | | // 获取人员数据保存至全局变量中,方便附件上传页面获取有多少人员 |
| | | let person = []; |
| | | let arr = ['plaintiffList', 'defendantList']; |
| | | arr.forEach((y) => { |
| | | this.data.submitData[y].forEach((x) => { |
| | | if (x.trueName) { |
| | | person.push({ |
| | | id: x.id, |
| | | perClass: x.perClass, |
| | | perClassName: x.perClassName, |
| | | trueName: x.trueName, |
| | | }); |
| | | } |
| | | if (x.agent && x.agent.trueName) { |
| | | person.push({ |
| | | agent: true, |
| | | id: x.agent.id, |
| | | perClass: x.agent.perClass, |
| | | perClassName: x.agent.perClassName, |
| | | trueName: x.agent.trueName, |
| | | }); |
| | | } |
| | | if (type === 'agree') { |
| | | // 同意协议之后退出登录后不重复弹出 |
| | | wx.setStorage({ |
| | | key: 'agreement', |
| | | data: 1 |
| | | }); |
| | | } |
| | | this.setData({ |
| | | popupVisible: false |
| | | }); |
| | | app.globalData.material.person = person; |
| | | wx.navigateTo({ |
| | | url: '../../pages/materialShow/index?caseId=' + this.data.submitData.id + '&editVisible=true', |
| | | }); |
| | | if (this.data.oneList?.length === 0) { |
| | | this.setData({ |
| | | addMePlaintiff: true |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // 下一步 or 上一步 |
| | | handleNext(e) { |
| | | let type = e.currentTarget.dataset.type; |
| | | let content = this.data.tipData.guideList.length === 0 ? |
| | | '请再次仔细核对您的申请信息,确定提交调解申请吗?' : |
| | | `根据人工智能大数据分析,您的请求可调整为:【${this.data.tipData.guideList}】(以上建议仅供参考),确定提交调解申请吗?` |
| | | if (type === 'next' && this.data.stepsActive === 0) { |
| | | // this.checkCaseDetail(); |
| | | this.fengxian(); |
| | | } else if (type === 'next' && this.data.stepsActive === 1) { |
| | | let that = this; |
| | | $$.showModal({ |
| | | title: '申请提交确认', |
| | | content: content, |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | that.submitCase(); |
| | | } |
| | | }, |
| | | }); |
| | | } else if (type === 'back' && this.data.stepsActive === 1) { |
| | | if (this.data.oneList?.length <= 0) { |
| | | $$.showToast({ |
| | | title: '请至少添加一名当事人', |
| | | duration: 500 |
| | | }); |
| | | } else { |
| | | this.setData({ |
| | | stepsActive: 1 |
| | | }); |
| | | this.getById(); |
| | | } |
| | | return; |
| | | } |
| | | if (type === 'back' && this.data.stepsActive === 1) { |
| | | this.setData({ |
| | | stepsActive: 0 |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 校验提交信息的必填项并下一步 |
| | | checkCaseDetail() { |
| | | let msg = ''; |
| | | let submitData = this.data.submitData; |
| | | let arr1 = [{ |
| | | key: 'area', |
| | | title: '纠纷发生地' |
| | | }, |
| | | { |
| | | key: 'caseDes', |
| | | title: '纠纷描述' |
| | | }, |
| | | { |
| | | key: 'caseClaim', |
| | | title: '调解请求' |
| | | }, |
| | | ]; |
| | | forEach: for (let i = 0; i < arr1.length; i++) { |
| | | if (!$$.verifyEmpty(submitData[arr1[i].key])) { |
| | | msg = arr1[i].title; |
| | | break forEach; |
| | | } |
| | | } |
| | | if (msg) { |
| | | Toast.fail(msg + '未填写'); |
| | | return false; |
| | | } |
| | | if (submitData.plaintiffList.length === 0) { |
| | | Toast.fail('至少添加一名申请人'); |
| | | return false; |
| | | } |
| | | if (submitData.plaintiffList?.length > 0) { |
| | | if (!submitData.plaintiffList[0].trueName) { |
| | | Toast.fail('至少添加一名申请人'); |
| | | return false; |
| | | } |
| | | } |
| | | if (submitData.defendantList.length === 0) { |
| | | Toast.fail('至少添加一名被申请人'); |
| | | return false; |
| | | } |
| | | if (submitData.defendantList?.length > 0) { |
| | | if (!submitData.defendantList[0].trueName) { |
| | | Toast.fail('至少添加一名申请人'); |
| | | return false; |
| | | } |
| | | } |
| | | if (msg) { |
| | | Toast.fail(msg); |
| | | return false; |
| | | } |
| | | // this.fengxian(); |
| | | this.setData({ |
| | | stepsActive: 1 |
| | | }); |
| | | }, |
| | | |
| | | // 返回首页 |
| | | handleGoHomepage() { |
| | | if (this.data.changeVisible) { |
| | | wx.navigateBack({ |
| | | delta: 1, |
| | | }); |
| | | return false; |
| | | } |
| | | wx.reLaunch({ |
| | | url: '../../pages/homePage/index', |
| | | }); |
| | | }, |
| | | |
| | | // 录音组件开启 and 关闭触发 |
| | | handleVisibleRecording(e) { |
| | | this.setData({ |
| | | recordingVisible: !this.data.recordingVisible |
| | | }); |
| | | }, |
| | | |
| | | // 获取录音转写的文字 |
| | | handleGetWords(e) { |
| | | let key = e.currentTarget.dataset.type; |
| | | let value = e.detail; |
| | | if (key === 'caseDes') { |
| | | this.data.submitData[key] = this.data.submitData[key] + value; |
| | | this.setData({ |
| | | submitData: this.data.submitData, |
| | | recordingVisible: !this.data.recordingVisible |
| | | }); |
| | | } else { |
| | | if (!this.data.submitData.caseClaim) { |
| | | this.data.submitData[key] = '请求1:' + value; |
| | | } else { |
| | | this.data.submitData[key] = this.data.submitData[key] + value; |
| | | } |
| | | this.setData({ |
| | | submitData: this.data.submitData, |
| | | recordingVisible: !this.data.recordingVisible |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 退出页面保存草稿前判断,如果地址没有更改则不需要保存。 |
| | | handleCheckSave() { |
| | | if (this.data.popupMsg.type === 1 && this.data.popupMsg.show) { |
| | | // 恢复草稿弹窗时退出不保存 |
| | | return; |
| | | } |
| | | if (this.goToMaterialSave || this.data.stepsActive !== 0 || this.data.submitData.inputStatus === '2') { |
| | | // 跳转纠纷材料 || 不在第一步骤 || 修改时则不保存 |
| | | this.goToMaterialSave = false; |
| | | return; |
| | | } |
| | | // 地址变动后保存草稿 |
| | | let save = false; |
| | | if (['prov', 'city', 'area', 'road', 'village'].map((x) => this.data.submitData[x]).join('') !== this.userInfo.address) save = true; |
| | | let arr = ['caseDes', 'caseType', 'caseTypeName', 'caseClaim', 'addr', 'wantUserId', 'wantUserName', 'wantUnitId', 'wantUnitName']; |
| | | arr.forEach((x) => { |
| | | if ($$.verifyEmpty(this.data.submitData[x])) save = true; |
| | | }); |
| | | if (this.data.submitData['plaintiffList'].length > 1 || this.data.submitData['defendantList'].length > 0) { |
| | | save = true; |
| | | } |
| | | if (save) { |
| | | this.saveCase(); |
| | | } |
| | | }, |
| | | if (type === 'next' && this.data.stepsActive === 1) { |
| | | let newData = this.data.submitData; |
| | | |
| | | async fengxian() { |
| | | let that = this; |
| | | $$.showLoading(); |
| | | let submitData = this.data.submitData; |
| | | const res = await checkCaseClaimRiskApi({ |
| | | caseDes: submitData.caseDes, |
| | | caseClaim: submitData.caseClaim, |
| | | caseTypeName: submitData.caseTypeName, |
| | | }); |
| | | $$.hideLoading(); |
| | | if (res.type) { |
| | | if (res.data?.case_risk_claims || res.data?.guide_risk_claims) { |
| | | if (res.data?.case_risk_claims.length && res.data?.guide_risk_claims.length) { |
| | | let caseList = res.data?.case_risk_claims; |
| | | let guideList = res.data?.guide_risk_claims; |
| | | let caseText = res.data?.caseText; |
| | | let caseTitle = res.data?.caseTitle; |
| | | let similarity = res.data?.similarity; |
| | | if (!this.data.tipData.guideList || JSON.stringify(this.data.tipData.guideList) !== JSON.stringify(guideList)) { |
| | | this.setData({ |
| | | 'tipData.guideList': guideList, |
| | | 'tipData.caseList': caseList, |
| | | caseText: caseText, |
| | | caseTitle: caseTitle, |
| | | similarity: similarity, |
| | | showCase: true, |
| | | }); |
| | | } else { |
| | | this.checkCaseDetail(); |
| | | } |
| | | that.setData({ |
| | | tipData: { |
| | | caseList, |
| | | guideList |
| | | } |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | 'tipData.guideList': [], |
| | | 'tipData.caseList': [], |
| | | }); |
| | | this.checkCaseDetail(); |
| | | } |
| | | console.log('this.data.submitData', this.data.submitData); |
| | | if (!newData.caseType) { |
| | | $$.showToast({ |
| | | title: '请选择纠纷类型', |
| | | duration: 500 |
| | | }); |
| | | return; |
| | | } |
| | | } |
| | | }, |
| | | |
| | | // 上传案件 |
| | | async submitCase() { |
| | | $$.showLoading(); |
| | | let submitData = this.data.submitData; |
| | | submitData.inputStatus = '2'; |
| | | submitData.process = null; |
| | | const res = await submitCaseApi(submitData); |
| | | $$.hideLoading(); |
| | | if (res.type) { |
| | | if (this.data.changeVisible) { |
| | | // 用于当“我的调解”页面等其他页面进入修改时,修改后返回更新数据凭证 |
| | | app.globalData.caseMsg.handleVisible = true; |
| | | if (!newData.occurTime) { |
| | | $$.showToast({ |
| | | title: '请选择纠纷发生时间', |
| | | duration: 500 |
| | | }); |
| | | return; |
| | | } |
| | | if (!newData.addr) { |
| | | $$.showToast({ |
| | | title: '请选择纠纷发生地', |
| | | duration: 500 |
| | | }); |
| | | return; |
| | | } |
| | | if (!newData.caseDes) { |
| | | $$.showToast({ |
| | | title: '请填写事项概况', |
| | | duration: 500 |
| | | }); |
| | | return; |
| | | } |
| | | if (!newData.caseClaim) { |
| | | $$.showToast({ |
| | | title: '请填写事项申请', |
| | | duration: 500 |
| | | }); |
| | | return; |
| | | } |
| | | // if (!this.data.fileList?.length <= 0) { |
| | | // // 附件上传提示 |
| | | // this.setData({ |
| | | // showFileTip: true |
| | | // }) |
| | | // return; |
| | | // } |
| | | // 提交AI接口 |
| | | this.getaw(newData); |
| | | this.setData({ |
| | | stepsActive: 2 |
| | | }); |
| | | let caseId = res.data; |
| | | // 在这里调用接口 |
| | | // getCaseApi({ |
| | | // caseId, |
| | | // start_page_num: '0', |
| | | // end_page_num: '100' |
| | | // }); |
| | | // getFeatureApi({ |
| | | // caseId, |
| | | // }) |
| | | // getCacheOpenAiCaseGuideList({ |
| | | // caseId, |
| | | // guideTypes: '5,6' |
| | | // }) |
| | | return; |
| | | } |
| | | if (type === 'back' && this.data.stepsActive === 2) { |
| | | this.setData({ |
| | | stepsActive: 1 |
| | | }); |
| | | return; |
| | | } |
| | | // 申请提交 |
| | | if (type === 'next' && this.data.stepsActive === 2) { |
| | | let data = this.data.submitData; |
| | | let list = this.data.oneList; |
| | | let personList = []; //"15_020008-1" 申请方当事人 ,"15_020008-2" 被申请方当事人 |
| | | let agentList = []; //"24_00006-1" 申请方代理人 ,"24_00006-2" 被申请方代理人 |
| | | personList = list.filter(item => item.perType === '15_020008-1' || item.perType === '15_020008-2'); |
| | | agentList = list.filter(item => item.perType === '24_00006-1' || item.perType === '24_00006-2'); |
| | | this.caseRegisterSave({ |
| | | ...data, |
| | | personList, |
| | | agentList, |
| | | id: this.data.ownerId, |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | // 保存草稿 |
| | | async saveCase() { |
| | | let submitData = this.data.submitData; |
| | | submitData.inputStatus = '1'; |
| | | const res = await submitCaseApi(submitData); |
| | | async getaw(data) { |
| | | let newData = { |
| | | caseDes: data.caseDes, |
| | | caseClaim: data.caseClaim, |
| | | caseId: this.data.ownerId, |
| | | } |
| | | const res = await getawApi(newData); |
| | | if (res.type) { |
| | | console.log('保存成功'); |
| | | console.log('res.data', res.data); |
| | | this.setData({ |
| | | AIData: res.data || {} |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // 修改案件 时 获取案件信息 |
| | | async getCaseData(caseId, changeVisible) { |
| | | async getById() { |
| | | $$.showLoading(); |
| | | const res = await getCaseDetailApi(caseId); |
| | | const res = await getByIdApi(); |
| | | $$.hideLoading(); |
| | | if (res.type) { |
| | | this.setData({ |
| | | materialNum: res.data.fileSize, |
| | | userInfoVisible: false, |
| | | submitData: res.data, |
| | | changeVisible: changeVisible, |
| | | }); |
| | | ownerId: res.data || '' |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | // 获取当前页面是否存在草稿 |
| | | async getDraftCase(options) { |
| | | let intentionObj = {}; |
| | | if (options.type) { |
| | | // 找他调页面跳转进入赋值意向调解信息 |
| | | let arr = []; |
| | | if (options.type === '1') { |
| | | arr = ['wantUserId', 'wantUserName']; |
| | | } else { |
| | | arr = ['wantUnitId', 'wantUnitName']; |
| | | } |
| | | intentionObj[arr[0]] = options.id; |
| | | intentionObj[arr[1]] = options.name; |
| | | } |
| | | async caseRegisterSave(params) { |
| | | $$.showLoading(); |
| | | const res = await getDraftCaseApi('1'); |
| | | if (res.type) { |
| | | if (res.data?.id) { |
| | | $$.hideLoading(); |
| | | this.userInfo = { |
| | | address: ['prov', 'city', 'area', 'road', 'village'].map((x) => res.data[x]).join('') |
| | | }; |
| | | this.setData({ |
| | | popupMsg: { |
| | | show: true, |
| | | title: '恢复草稿', |
| | | buttonText: '恢复草稿', |
| | | type: 1, |
| | | intentionObj, |
| | | submitData: res.data |
| | | } |
| | | }); |
| | | } else { |
| | | this.getUserInfo(intentionObj); |
| | | } |
| | | } else { |
| | | this.getUserInfo(intentionObj); |
| | | } |
| | | }, |
| | | |
| | | // 获取个人信息,填充个人信息材料至第一个申请人处,如有草稿则不执行 |
| | | async getUserInfo(intentionObj) { |
| | | let obj = {}, |
| | | locationObj = {}; |
| | | const res = await getUserInfoApi(); |
| | | const res = await caseRegisterSaveApi(params); |
| | | $$.hideLoading(); |
| | | if (res.type) { |
| | | this.data.userInfoVisible = true; |
| | | obj = { |
| | | trueName: res.data.trueName || '', |
| | | certiNo: res.data.idcard || '', |
| | | mobile: res.data.mobile || '', |
| | | address: ['prov', 'city', 'area', 'road', 'village'].map((x) => res.data[x]).join(''), |
| | | }; |
| | | ['prov', 'provName', 'city', 'cityName', 'area', 'areaName', 'road', 'roadName', 'village', 'villageName'].forEach((x) => { |
| | | locationObj[x] = res.data[x] || ''; |
| | | // Toast('提交成功'); |
| | | this.setData({ |
| | | saveStatus: true |
| | | }) |
| | | } |
| | | const res1 = await getCaseApi({ |
| | | caseDes: params.caseDes, |
| | | caseClaim: params.caseClaim, |
| | | caseId: params.id, |
| | | }); |
| | | if (res1.type) { |
| | | wx.setStorage({ |
| | | key: 'AICase', |
| | | data: { |
| | | caseDes: params.caseDes, |
| | | caseClaim: params.caseClaim, |
| | | caseId: params.id, |
| | | } |
| | | }); |
| | | } |
| | | this.data.submitData.plaintiffList[0] = { |
| | | perClass: '09_01001-1', |
| | | perClassName: '自然人', |
| | | id: $$.getBusinessId(), |
| | | ...obj |
| | | }; |
| | | this.userInfo = obj; |
| | | this.setData({ |
| | | userInfoVisible: this.data.userInfoVisible, |
| | | submitData: { |
| | | ...this.data.submitData, |
| | | ...intentionObj, |
| | | ...locationObj, |
| | | id: $$.getBusinessId() |
| | | }, |
| | | popupMsg: { |
| | | show: false |
| | | }, |
| | | |
| | | //选择纠纷类型 、跳转事项概况语音描述,跳转事项申请语音描述 |
| | | caseTypeGoPage(e) { |
| | | let url = e.currentTarget.dataset.url; |
| | | wx.navigateTo({ |
| | | url: url, |
| | | }); |
| | | }, |
| | | |
| | | // 图片识别 |
| | | ocrClick(e) { |
| | | let key = e.currentTarget.dataset.key; |
| | | let keyNum = e.currentTarget.dataset.keynum; |
| | | let that = this; |
| | | wx.chooseMedia({ |
| | | count: 1, |
| | | mediaType: ['image'], |
| | | success(res2) { |
| | | const tempFiles = res2.tempFiles[0]; |
| | | $$.showLoading(); |
| | | wx.uploadFile({ |
| | | url: `${$$.baseUrl}${$$.url.sys}/api/wechat/fileInfo/recognitionText`, |
| | | filePath: tempFiles.tempFilePath, |
| | | name: 'file', |
| | | header: { |
| | | Authorization: app.globalData.token |
| | | }, |
| | | complete(res3) { |
| | | $$.hideLoading(); |
| | | if (res3.errMsg === 'uploadFile:ok') { |
| | | let { |
| | | code, |
| | | data |
| | | } = JSON.parse(res3.data); |
| | | if (code == -1) { |
| | | $$.errorModal({ |
| | | content: '识别失败' |
| | | }); |
| | | return; |
| | | } |
| | | let wordsResult = data?.ocrResult?.wordsResult.join(''); |
| | | let wordsResultNum = data?.ocrResult?.wordsResultNum; |
| | | that.setData({ |
| | | submitData: { |
| | | ...that.data.submitData, |
| | | [key]: wordsResult |
| | | }, |
| | | [keyNum]: wordsResult.length |
| | | }); |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | | }); |
| | | }, |
| | | |
| | | // 获取选择人员 |
| | | async getPersonHistory() { |
| | | $$.showLoading(); |
| | | const res = await getPersonHistoryApi(); |
| | | $$.hideLoading(); |
| | | if (res.type) { |
| | | this.setData({ |
| | | popupSelect: { |
| | | show: true, |
| | | data: res.data || [] |
| | | //选择地址 |
| | | openmap: function (e) { |
| | | var that = this; |
| | | console.log('latitude') |
| | | wx.getLocation({ |
| | | type: 'gcj02', //返回可以用于wx.openLocation的经纬度 |
| | | success: function (res) { |
| | | wx.chooseLocation({ |
| | | success: function (res) { |
| | | that.setData({ |
| | | submitData: { |
| | | ...that.data.submitData, |
| | | addr: res.address, |
| | | lng: res.longitude, |
| | | lat: res.latitude, |
| | | } |
| | | }) |
| | | }, |
| | | fail: function (res) { |
| | | |
| | | }, |
| | | |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | delAddress() { |
| | | this.setData({ |
| | | submitData: { |
| | | ...this.data.submitData, |
| | | addr: '', |
| | | lng: '', |
| | | lat: '' |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 上传文件图片 |
| | | async handleUploadFile(e) { |
| | | let id = e.currentTarget.dataset.id; |
| | | let type = e.currentTarget.dataset.type; |
| | | let that = this; |
| | | this.filesArr = []; |
| | | wx.chooseMedia({ |
| | | mediaType: ['image'], |
| | | success(res2) { |
| | | const tempFiles = res2.tempFiles; |
| | | // 多个文件逐一上传 |
| | | tempFiles.forEach((x, t) => { |
| | | $$.showLoading('上传中...'); |
| | | wx.uploadFile({ |
| | | url: `${$$.baseUrl}${$$.url.sys}/api/wechat/fileInfo/upload?mainId=${id}&ownerId=${id}&ownerType=${type}`, |
| | | filePath: x.tempFilePath, |
| | | name: 'file', |
| | | header: { |
| | | Authorization: app.globalData.token |
| | | }, |
| | | complete(res) { |
| | | $$.hideLoading(); |
| | | if (res.errMsg === 'uploadFile:ok') { |
| | | const getData = JSON.parse(res.data) |
| | | const file = { |
| | | ...getData.data[0], |
| | | wxurl: x.tempFilePath |
| | | }; |
| | | that.setData({ |
| | | fileList: that.data.fileList.concat(file) |
| | | }) |
| | | $$.showToast({ |
| | | icon: 'success', |
| | | title: '上传成功', |
| | | duration: 500 |
| | | }); |
| | | } else { |
| | | $$.showToast({ |
| | | title: '上传失败', |
| | | duration: 500 |
| | | }); |
| | | } |
| | | |
| | | }, |
| | | }); |
| | | }); |
| | | }, |
| | | }); |
| | | }, |
| | | |
| | | // 预览图片 |
| | | handlePreviewImage(e) { |
| | | let item = e.currentTarget.dataset.item; |
| | | console.log('item', item); |
| | | let index = e.currentTarget.dataset.index; |
| | | wx.previewImage({ |
| | | current: item.wxurl, |
| | | urls: [item.wxurl] // 需要预览的图片http链接列表 |
| | | }); |
| | | }, |
| | | |
| | | // 删除图片 |
| | | async handleDelImage(e) { |
| | | let item = e.currentTarget.dataset.item; |
| | | let index = e.currentTarget.dataset.index; |
| | | let id = e.currentTarget.dataset.id; |
| | | let type = e.currentTarget.dataset.type; |
| | | $$.showModal({ |
| | | title: '删除材料确认', |
| | | content: '确定删除材料' + item.name + '吗?', |
| | | cancelText: '我再想想', |
| | | confirmText: '确定删除', |
| | | success: async (res) => { |
| | | if (res.confirm) { |
| | | $$.showLoading(); |
| | | const res = await delfileApi(id); |
| | | if (res.type) { |
| | | $$.showToast({ |
| | | icon: 'success', |
| | | title: '删除成功', |
| | | duration: 500 |
| | | }); |
| | | let list = this.data.fileList.filter((i, idx) => idx !== index); |
| | | console.log('list', list); |
| | | this.setData({ |
| | | fileList: list |
| | | }) |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | }); |
| | | |
| | | }, |
| | | |
| | | // 请求下拉框资源 |
| | |
| | | } |
| | | }, |
| | | |
| | | // 获取省市区等地理资源 |
| | | async getLocationData() { |
| | | |
| | | // 获取个人信息 |
| | | async getUserInfo() { |
| | | $$.showLoading(); |
| | | const res = await $$.commonRequest({ |
| | | url: `${$$.url.assets}locationSelect.json`, |
| | | type: 'get' |
| | | }); |
| | | const res = await getUserInfoApi(); |
| | | $$.hideLoading(); |
| | | if (res) { |
| | | let location = []; |
| | | $$.province.forEach((x) => { |
| | | location.push(res[x][0]); |
| | | if (res.type) { |
| | | let data = res.data || {} |
| | | this.setData({ |
| | | oneList: [{ |
| | | ...data, |
| | | perType: '15_020008-1', |
| | | perTypeName: '申请方当事人', |
| | | perClass: '09_01001-1', |
| | | perClassName: '自然人', |
| | | certiNo: data.idcard || '', |
| | | certiType: data.certiType || '09_00015-1', |
| | | certiTypeName: data.certiTypeName || '身份证', |
| | | }] |
| | | }) |
| | | }; |
| | | }, |
| | | |
| | | // 自动添加申请人提醒 |
| | | oneAddMe(e) { |
| | | let formtype = e.currentTarget.dataset.formtype; |
| | | if (formtype === 'yes') { |
| | | this.getUserInfo() |
| | | } |
| | | this.setData({ |
| | | addMePlaintiff: false |
| | | }) |
| | | }, |
| | | |
| | | // 填写人员 |
| | | oneDelPerson(e) { |
| | | console.log('e', e); |
| | | let index = e.currentTarget.dataset.index; |
| | | let item = e.currentTarget.dataset.item; |
| | | |
| | | $$.showModal({ |
| | | title: '删除人员确认', |
| | | content: '确定删除当事人' + item.trueName + '吗?', |
| | | cancelText: '我再想想', |
| | | confirmText: '确定删除', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | this.setData({ |
| | | oneList: this.data.oneList.filter((i, idx) => idx !== index) |
| | | }) |
| | | } |
| | | }, |
| | | }); |
| | | }, |
| | | |
| | | // 添加当事人 |
| | | oneAddPerson(e) { |
| | | let perType = e.currentTarget.dataset.pertype; |
| | | let perTypeName = e.currentTarget.dataset.pertypename; |
| | | if (!perType) { |
| | | this.setData({ |
| | | addPerson: true |
| | | }) |
| | | } else { |
| | | this.setData({ |
| | | addPerson: false |
| | | }) |
| | | wx.navigateTo({ |
| | | url: `../../pages/addPerson/index?perType=${perType}&perTypeName=${perTypeName}`, |
| | | }); |
| | | this.location = location; |
| | | } |
| | | }, |
| | | |
| | | // 修改当事人 |
| | | oneEditPerson(e) { |
| | | let item = e.currentTarget.dataset.item; |
| | | let index = e.currentTarget.dataset.index; |
| | | wx.navigateTo({ |
| | | url: `../../pages/addPerson/index?data=${JSON.stringify(item)}&index=${index}`, |
| | | }); |
| | | }, |
| | | |
| | | // 关闭自定义弹窗 |
| | | addClosePopup(e) { |
| | | let key = e.currentTarget.dataset.key; |
| | | this.setData({ |
| | | [key]: false |
| | | }) |
| | | }, |
| | | |
| | | // 选择发生事件确定 |
| | | onInput(e) { |
| | | let key = e.currentTarget.dataset.key; |
| | | let value = e.detail; |
| | | this.setData({ |
| | | [key]: false, |
| | | submitData: { |
| | | ...this.data.submitData, |
| | | occurTime: value, |
| | | occurTimeName: $$.moment(value).format('YYYY-MM-DD'), |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面加载 |
| | | */ |
| | | onLoad: function (options) { |
| | | this.getLocationData(); |
| | | this.getSelectOptionData(); |
| | | if (options.change) { |
| | | this.getCaseData(options.caseId, true); |
| | | onLoad: function () { |
| | | let agreement = wx.getStorageSync('agreement'); |
| | | if (!agreement) { |
| | | this.getAgreement(); |
| | | } else { |
| | | this.getDraftCase(options); |
| | | if (this.data.oneList?.length === 0) { |
| | | this.setData({ |
| | | addMePlaintiff: true |
| | | }) |
| | | } |
| | | } |
| | | |
| | | }, |
| | | |
| | | /** |
| | | * 生命周期函数--监听页面显示 |
| | | */ |
| | | onShow: function () { |
| | | if (app.globalData.material.data.length !== 0) { |
| | | // 计算附件数量 |
| | | let num = 0; |
| | | app.globalData.material.data.forEach((x) => { |
| | | num = num + x.num; |
| | | }); |
| | | app.globalData.material.data = []; |
| | | if (this.data.oneData?.trueName) { |
| | | let list = this.data.oneList; |
| | | console.log('list', list); |
| | | console.log('this.data.editIndex', this.data.editIndex); |
| | | console.log('this.data.oneData', this.data.oneData); |
| | | if (this.data.editIndex) { |
| | | list[this.data.editIndex] = this.data.oneData; |
| | | } else { |
| | | list = list.concat(this.data.oneData) |
| | | } |
| | | this.setData({ |
| | | materialNum: num |
| | | }); |
| | | oneList: list, |
| | | oneData: {}, |
| | | editIndex: false, |
| | | }) |
| | | } |
| | | |
| | | if (this.data.twoData?.label) { |
| | | this.setData({ |
| | | submitData: { |
| | | ...this.data.submitData, |
| | | caseType: this.data.twoData.value, |
| | | caseTypeName: this.data.twoData.label, |
| | | }, |
| | | twoData: {} |
| | | }) |
| | | } |
| | | if (this.data.twoValue) { |
| | | console.log('this.data.twoValue', this.data.twoValue); |
| | | console.log('this.data.twoKey', this.data.twoKey); |
| | | this.setData({ |
| | | submitData: { |
| | | ...this.data.submitData, |
| | | [this.data.twoKey]: this.data.twoValue, |
| | | }, |
| | | [this.data.twoKey + 'Num']: this.data.twoValue.length, |
| | | twoValue: '', |
| | | twoKey: '' |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | onHide: function () { |
| | | this.handleCheckSave(); |
| | | // this.handleCheckSave(); |
| | | }, |
| | | |
| | | onUnload: function () { |
| | | this.handleCheckSave(); |
| | | // this.handleCheckSave(); |
| | | }, |
| | | }); |