正在显示
2 个修改的文件
包含
288 行增加
和
35 行删除
@@ -36,6 +36,8 @@ Page({ | @@ -36,6 +36,8 @@ Page({ | ||
36 | supporttype:"", | 36 | supporttype:"", |
37 | is_single:"", | 37 | is_single:"", |
38 | share_method:"", | 38 | share_method:"", |
39 | + isEdit:false, | ||
40 | + edit_id:null, | ||
39 | data: { | 41 | data: { |
40 | hasLover:false, | 42 | hasLover:false, |
41 | house_type: "", | 43 | house_type: "", |
@@ -597,7 +599,13 @@ Page({ | @@ -597,7 +599,13 @@ Page({ | ||
597 | }) | 599 | }) |
598 | this.initOSS() | 600 | this.initOSS() |
599 | if (options.datas && options.datas.length > 0 && options.datas !="undefined") { | 601 | if (options.datas && options.datas.length > 0 && options.datas !="undefined") { |
600 | - this.handleTransData(JSON.parse(options.datas)) | 602 | + if (options.isedit == 'true'){ |
603 | + this.isEdit = true | ||
604 | + this.handlEditData(JSON.parse(options.datas)) | ||
605 | + }else{ | ||
606 | + this.isEdit = false | ||
607 | + this.handleTransData(JSON.parse(options.datas)) | ||
608 | + } | ||
601 | } | 609 | } |
602 | }, | 610 | }, |
603 | getTaxList: function () { | 611 | getTaxList: function () { |
@@ -659,6 +667,247 @@ Page({ | @@ -659,6 +667,247 @@ Page({ | ||
659 | schoolCountryData: country_data | 667 | schoolCountryData: country_data |
660 | }) | 668 | }) |
661 | }, | 669 | }, |
670 | + handlEditData: function (data) { | ||
671 | + | ||
672 | + this.edit_id = data.id | ||
673 | + console.log('data===', data) | ||
674 | + switch (this.data.cur_index + '') { | ||
675 | + case 'children_education': | ||
676 | + var setData = {} | ||
677 | + var commonbirthDate = this.data.commonbirthDate | ||
678 | + commonbirthDate.selected = format.formatTime_date(data.birth_date) | ||
679 | + commonbirthDate.datelong = data.birth_date | ||
680 | + setData.commonbirthDate = commonbirthDate | ||
681 | + var childrenpercentData = this.data.childrenpercentData | ||
682 | + childrenpercentData.selected = data.percent + '%' | ||
683 | + setData.childrenpercentData = childrenpercentData | ||
684 | + var studystartdate = this.data.studystartdate | ||
685 | + studystartdate.selected = format.formatTime_date(data.education_start) | ||
686 | + studystartdate.datelong = data.education_start | ||
687 | + setData.studystartdate = studystartdate | ||
688 | + var studyenddate = this.data.studyenddate | ||
689 | + studyenddate.selected = format.formatTime_date(data.education_end) | ||
690 | + studyenddate.datelong = data.education_end | ||
691 | + setData.studyenddate = studyenddate | ||
692 | + setData.deduction_amount = data.deduction_amount | ||
693 | + if (data.children_id_card_no && data.children_id_card_no.length) { | ||
694 | + setData.children_id_card_no = data.children_id_card_no | ||
695 | + this.dealIdInfo(data.children_id_card_no, 'children_id_card_no_input') | ||
696 | + } | ||
697 | + if (data.children_name && data.children_name.length) { | ||
698 | + setData.children_name = data.children_name | ||
699 | + } | ||
700 | + if (data.student_no && data.student_no.length) { | ||
701 | + setData.children_student_no = data.student_no | ||
702 | + } | ||
703 | + if (data.education_period && data.education_period.length) { | ||
704 | + var childedudegreeData = this.data.childedudegreeData | ||
705 | + childedudegreeData.selected = data.education_period | ||
706 | + setData.childedudegreeData = childedudegreeData | ||
707 | + } | ||
708 | + if (data.school_country && data.school_country.length) { | ||
709 | + var schoolCountryData = this.data.schoolCountryData | ||
710 | + schoolCountryData.selected = data.school_country | ||
711 | + setData.schoolCountryData = schoolCountryData | ||
712 | + } | ||
713 | + if (data.school_name && data.school_name.length) { | ||
714 | + setData.school_name = data.school_name | ||
715 | + } | ||
716 | + if (data.spouse_name && data.spouse_name.length) { | ||
717 | + setData.spouse_name = data.spouse_name | ||
718 | + } | ||
719 | + if (data.spouse_id_card_no && data.spouse_id_card_no.length) { | ||
720 | + setData.spouse_id_card_no = data.spouse_id_card_no | ||
721 | + this.dealIdInfo(data.id_card_no, 'spouse_id_card_no_input') | ||
722 | + } | ||
723 | + if (data.spouse_birthday && data.spouse_birthday.length) { | ||
724 | + var loverbirthDate = this.data.loverbirthDate | ||
725 | + loverbirthDate.selected = format.formatTime_date(data.spouse_birthday) | ||
726 | + loverbirthDate.datelong = data.spouse_birthday | ||
727 | + setData.loverbirthDate = loverbirthDate | ||
728 | + } | ||
729 | + this.setData(setData) | ||
730 | + break; | ||
731 | + case 'continuing_education': | ||
732 | + var setData = {} | ||
733 | + if (data.education_type && data.education_type.length) { | ||
734 | + if ('title' == data.education_type) { | ||
735 | + setData.edu_lable = 'school' | ||
736 | + var edutypeData = this.data.edutypeData | ||
737 | + edutypeData.selected = "学历(学位)继续教育" | ||
738 | + setData.edutypeData = edutypeData | ||
739 | + | ||
740 | + if (data.education_period && data.education_period.length) { | ||
741 | + var edulevelData = this.data.edulevelData | ||
742 | + edulevelData.selected = data.education_period | ||
743 | + setData.edulevelData = edulevelData | ||
744 | + } | ||
745 | + var studystartdate = this.data.studystartdate | ||
746 | + studystartdate.selected = format.formatTime_date(data.education_start) | ||
747 | + studystartdate.datelong = data.education_start | ||
748 | + setData.studystartdate = studystartdate | ||
749 | + var studyenddate = this.data.studyenddate | ||
750 | + studyenddate.selected = format.formatTime_date(data.education_end) | ||
751 | + studyenddate.datelong = data.education_end | ||
752 | + setData.studyenddate = studyenddate | ||
753 | + | ||
754 | + } else { | ||
755 | + setData.edu_lable = 'tech' | ||
756 | + var edutypeData = this.data.edutypeData | ||
757 | + edutypeData.selected = "职业资格继续教育" | ||
758 | + var edustyleData = this.data.edustyleData | ||
759 | + if (data.education_type == 'major'){ | ||
760 | + edustyleData.selected = "专业技术人员职业资格" | ||
761 | + } else if (data.education_type == 'profession'){ | ||
762 | + edustyleData.selected = "技能人员职业资格" | ||
763 | + } | ||
764 | + setData.edutypeData = edutypeData | ||
765 | + setData.edustyleData = edustyleData | ||
766 | + var applydate = this.data.applydate | ||
767 | + applydate.selected = format.formatTime_date(data.approval_date) | ||
768 | + applydate.datelong = data.approval_date | ||
769 | + setData.applydate = applydate | ||
770 | + | ||
771 | + if (data.certification_name && data.certification_name.length) { | ||
772 | + setData.certification_name = data.certification_name | ||
773 | + } | ||
774 | + if (data.certification_no && data.certification_no.length) { | ||
775 | + setData.certification_no = data.certification_no | ||
776 | + } | ||
777 | + if (data.certification_authority && data.certification_authority.length) { | ||
778 | + setData.certification_authority = data.certification_authority | ||
779 | + } | ||
780 | + } | ||
781 | + } | ||
782 | + this.setData(setData) | ||
783 | + break; | ||
784 | + case 'support_duty': | ||
785 | + var setData = {} | ||
786 | + var olderbirthDate = this.data.olderbirthDate | ||
787 | + olderbirthDate.selected = format.formatTime_date(data.birth_date) | ||
788 | + olderbirthDate.datelong = data.birth_date | ||
789 | + setData.olderbirthDate = olderbirthDate | ||
790 | + if (data.supported_name && data.supported_name.length) { | ||
791 | + setData.supported_name = data.supported_name | ||
792 | + } | ||
793 | + if (data.id_card_no && data.id_card_no.length) { | ||
794 | + setData.id_card_no = data.id_card_no | ||
795 | + this.dealIdInfo(data.id_card_no, 'older_id_card_no_input') | ||
796 | + } | ||
797 | + if (data.relationship && data.relationship.length) { | ||
798 | + var older_relativeData = this.data.older_relativeData | ||
799 | + older_relativeData.selected = data.relationship | ||
800 | + setData.older_relativeData = older_relativeData | ||
801 | + } | ||
802 | + this.is_single = data.is_single | ||
803 | + this.supporttype = data.is_single=='y'? 'D': 'S' | ||
804 | + this.share_method = data.share_method | ||
805 | + this.setData(setData) | ||
806 | + break; | ||
807 | + | ||
808 | + // case 'medical_fund': | ||
809 | + // var setData = {} | ||
810 | + // var commonbirthDate = this.data.commonbirthDate | ||
811 | + // commonbirthDate.selected = format.formatTime_date(data.patient_birthday) | ||
812 | + // commonbirthDate.datelong = data.patient_birthday | ||
813 | + // setData.commonbirthDate = commonbirthDate | ||
814 | + // if (data.name && data.name.length) { | ||
815 | + // setData.name = data.name | ||
816 | + // } | ||
817 | + // if (data.id_card_no && data.id_card_no.length) { | ||
818 | + // setData.id_card_no = data.id_card_no | ||
819 | + // this.dealIdInfo(data.id_card_no, 'medical_id_card_no_input') | ||
820 | + // } | ||
821 | + // if (data.family_ties && data.family_ties.length) { | ||
822 | + // var taxperson_relativeData = this.data.taxperson_relativeData | ||
823 | + // taxperson_relativeData.selected = data.family_ties | ||
824 | + // setData.taxperson_relativeData = taxperson_relativeData | ||
825 | + // } | ||
826 | + // this.setData(setData) | ||
827 | + // break; | ||
828 | + case "house_fund": | ||
829 | + var setData = {} | ||
830 | + if (data.spouse_name && data.spouse_name.length) { | ||
831 | + setData.spouse_name = data.spouse_name | ||
832 | + } | ||
833 | + if (data.spouse_id_card_no && data.spouse_id_card_no.length) { | ||
834 | + setData.spouse_id_card_no = data.spouse_id_card_no | ||
835 | + this.dealIdInfo(data.id_card_no, 'spouse_id_card_no_input') | ||
836 | + } | ||
837 | + if (this.data.loverbirthDate.selected.length) { | ||
838 | + var loverbirthDate = this.data.loverbirthDate | ||
839 | + loverbirthDate.selected = format.formatTime_date(data.spouse_birthday) | ||
840 | + loverbirthDate.datelong = data.spouse_birthday | ||
841 | + setData.loverbirthDate = loverbirthDate | ||
842 | + } | ||
843 | + if (data.loan_type && data.loan_type.length) { | ||
844 | + var loantypeData = this.data.loantypeData | ||
845 | + loantypeData.selected = data.loan_type | ||
846 | + setData.loantypeData = loantypeData | ||
847 | + } | ||
848 | + if (data.house_detail_address && data.house_detail_address.length) { | ||
849 | + setData.house_detail_address = data.house_detail_address | ||
850 | + } | ||
851 | + if (data.certification_no && data.certification_no.length) { | ||
852 | + setData.certification_no = data.certification_no | ||
853 | + } | ||
854 | + if (data.certification_type && data.certification_type.length) { | ||
855 | + var identifytypeData = this.data.identifytypeData | ||
856 | + identifytypeData.selected = data.certification_type | ||
857 | + setData.identifytypeData = identifytypeData | ||
858 | + } | ||
859 | + if (data.loan_before_marry && data.loan_before_marry.length) { | ||
860 | + var beforemarryData = this.data.beforemarryData | ||
861 | + beforemarryData.selected = data.loan_before_marry | ||
862 | + setData.beforemarryData = beforemarryData | ||
863 | + } | ||
864 | + if (data.loan_by_self && data.loan_by_self.length) { | ||
865 | + var isselfData = this.data.isselfData | ||
866 | + isselfData.selected = data.loan_by_self | ||
867 | + setData.isselfData = isselfData | ||
868 | + } | ||
869 | + if (data.loan_contract_no && data.loan_contract_no.length) { | ||
870 | + setData.loan_contract_no = data.loan_contract_no | ||
871 | + } | ||
872 | + if (data.rent_contract_no && data.rent_contract_no.length) { | ||
873 | + setData.rent_contract_no = data.rent_contract_no | ||
874 | + } | ||
875 | + if (data.rent_start && data.rent_start.length) { | ||
876 | + var leasestartDate = this.data.leasestartDate | ||
877 | + leasestartDate.selected = format.formatTime_date(data.rent_start) | ||
878 | + leasestartDate.datelong = data.rent_start | ||
879 | + setData.leasestartDate = leasestartDate | ||
880 | + } | ||
881 | + if (data.rent_end && data.rent_end.length) { | ||
882 | + var leaseendDate = this.data.leaseendDate | ||
883 | + leaseendDate.selected = format.formatTime_date(data.rent_end) | ||
884 | + leaseendDate.datelong = data.rent_end | ||
885 | + setData.leaseendDate = leaseendDate | ||
886 | + } | ||
887 | + if (data.work_city && data.work_city.province) { | ||
888 | + var workingcityInfo = this.data.workingcityInfo | ||
889 | + workingcityInfo.requestdata = data.work_city | ||
890 | + workingcityInfo.selected = data.work_city.province + data.work_city.city | ||
891 | + setData.workingcityInfo = workingcityInfo | ||
892 | + } | ||
893 | + if (this.data.house_type == 'house_fund_loan' && data.house_address && data.house_address.province) { | ||
894 | + var houseLocateInfo = this.data.houseLocateInfo | ||
895 | + houseLocateInfo.requestdata = data.house_address | ||
896 | + houseLocateInfo.selected = data.work_city.province + data.work_city.city + data.work_city.district | ||
897 | + setData.houseLocateInfo = houseLocateInfo | ||
898 | + } | ||
899 | + if (this.data.house_type == 'house_fund_rent' && data.house_address && data.house_address.province) { | ||
900 | + var rentLocateInfo = this.data.rentLocateInfo | ||
901 | + rentLocateInfo.requestdata = data.house_address | ||
902 | + rentLocateInfo.selected = data.work_city.province + data.work_city.city + data.work_city.district | ||
903 | + setData.rentLocateInfo = rentLocateInfo | ||
904 | + } | ||
905 | + | ||
906 | + this.setData(setData) | ||
907 | + break; | ||
908 | + } | ||
909 | + | ||
910 | + }, | ||
662 | 911 | ||
663 | handleTransData: function(data) { | 912 | handleTransData: function(data) { |
664 | switch (this.data.cur_index + '') { | 913 | switch (this.data.cur_index + '') { |
@@ -1477,43 +1726,47 @@ Page({ | @@ -1477,43 +1726,47 @@ Page({ | ||
1477 | } | 1726 | } |
1478 | newdata.legal_entity_id = this.legal_entity_id | 1727 | newdata.legal_entity_id = this.legal_entity_id |
1479 | newdata.legal_entity = this.legal_entity | 1728 | newdata.legal_entity = this.legal_entity |
1729 | + if (this.isEdit) { | ||
1730 | + newdata.id = this.edit_id | ||
1731 | + } | ||
1480 | console.log("newdata", newdata); | 1732 | console.log("newdata", newdata); |
1481 | this.addDatas(newdata, subUrl) | 1733 | this.addDatas(newdata, subUrl) |
1482 | }, | 1734 | }, |
1483 | 1735 | ||
1484 | addDatas: function(newdata, subUrl) { | 1736 | addDatas: function(newdata, subUrl) { |
1485 | - wx.showModal({ | ||
1486 | - title: '确认要提交申报吗?', | ||
1487 | - content: '确认后将不能修改', | ||
1488 | - showCancel: true, | ||
1489 | - confirmColor: '#357AEB', | ||
1490 | - cancelColor: '#999', | ||
1491 | - success: function(res) { | ||
1492 | - if (res.confirm) { | ||
1493 | - var that = this; | ||
1494 | - var Authorization = app.globalData.Authorization; | ||
1495 | - wx.request({ | ||
1496 | - url: baseUrl + subUrl, | ||
1497 | - method: "POST", | ||
1498 | - header: { | ||
1499 | - 'content-type': 'application/json', | ||
1500 | - "Authorization": Authorization | ||
1501 | - }, | ||
1502 | - data: newdata, | ||
1503 | - success(res) { | ||
1504 | - if (res && res.statusCode < 300) { | ||
1505 | - wx.navigateBack({ | ||
1506 | - delta: 1 | ||
1507 | - }) | ||
1508 | - }else{ | ||
1509 | - wx.showToast({ | ||
1510 | - title: res.data.message ? res.data.message:'请求出错', | ||
1511 | - icon:'none' | ||
1512 | - }) | ||
1513 | - } | ||
1514 | - } | 1737 | + // wx.showModal({ |
1738 | + // title: '确认要提交申报吗?', | ||
1739 | + // content: '确认后将不能修改', | ||
1740 | + // showCancel: true, | ||
1741 | + // confirmColor: '#357AEB', | ||
1742 | + // cancelColor: '#999', | ||
1743 | + // success: function(res) { | ||
1744 | + // if (res.confirm) { | ||
1745 | + // ///接口 | ||
1746 | + // } else if (res.cancel) {} | ||
1747 | + // } | ||
1748 | + // }) | ||
1749 | + var that = this; | ||
1750 | + var Authorization = app.globalData.Authorization; | ||
1751 | + wx.request({ | ||
1752 | + url: baseUrl + subUrl, | ||
1753 | + method: "POST", | ||
1754 | + header: { | ||
1755 | + 'content-type': 'application/json', | ||
1756 | + "Authorization": Authorization | ||
1757 | + }, | ||
1758 | + data: newdata, | ||
1759 | + success(res) { | ||
1760 | + if (res && res.statusCode < 300) { | ||
1761 | + wx.navigateBack({ | ||
1762 | + delta: 1 | ||
1515 | }) | 1763 | }) |
1516 | - } else if (res.cancel) {} | 1764 | + } else { |
1765 | + wx.showToast({ | ||
1766 | + title: res.data.message ? res.data.message : '请求出错', | ||
1767 | + icon: 'none' | ||
1768 | + }) | ||
1769 | + } | ||
1517 | } | 1770 | } |
1518 | }) | 1771 | }) |
1519 | }, | 1772 | }, |
@@ -97,19 +97,19 @@ | @@ -97,19 +97,19 @@ | ||
97 | <view style='height:90rpx'> | 97 | <view style='height:90rpx'> |
98 | <text class='red_star_right_10'>*</text> | 98 | <text class='red_star_right_10'>*</text> |
99 | <text class='text_777_30 float_left'>证书名称</text> | 99 | <text class='text_777_30 float_left'>证书名称</text> |
100 | - <input class='input_wrap' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;color:#000;' placeholder='请输入证书名称' name='certification_name'></input> | 100 | + <input class='input_wrap' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;color:#000;' placeholder='请输入证书名称' name='certification_name' value='{{certification_name}}'></input> |
101 | </view> | 101 | </view> |
102 | <view class='divide_line_30'></view> | 102 | <view class='divide_line_30'></view> |
103 | <view style='height:90rpx'> | 103 | <view style='height:90rpx'> |
104 | <text class='red_star_right_10'>*</text> | 104 | <text class='red_star_right_10'>*</text> |
105 | <text class='text_777_30 float_left'>证书编号</text> | 105 | <text class='text_777_30 float_left'>证书编号</text> |
106 | - <input class='input_wrap' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;color:#000;' placeholder='请输入证书编号' name='certification_no'></input> | 106 | + <input class='input_wrap' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;color:#000;' placeholder='请输入证书编号' name='certification_no' value='{{certification_no}}'></input> |
107 | </view> | 107 | </view> |
108 | <view class='divide_line_30'></view> | 108 | <view class='divide_line_30'></view> |
109 | <view style='height:90rpx'> | 109 | <view style='height:90rpx'> |
110 | <text class='red_star_right_10'>*</text> | 110 | <text class='red_star_right_10'>*</text> |
111 | <text class='text_777_30 float_left'>发证机关</text> | 111 | <text class='text_777_30 float_left'>发证机关</text> |
112 | - <input class='input_wrap' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;color:#000;' placeholder='请输入发证机关' name='certification_authority'></input> | 112 | + <input class='input_wrap' placeholder-class='text_999_30 float_right' style='line-height: 90rpx;text-align: right;color:#000;' placeholder='请输入发证机关' name='certification_authority' value='{{certification_authority}}'></input> |
113 | </view> | 113 | </view> |
114 | </view> | 114 | </view> |
115 | 115 |
请
注册
或
登录
后发表评论