提交 bd9b6e38bed1ab216dc827d53ab54bd113001261

作者 wangyu
1 个父辈 5f1bc081

代码优化

@@ -61,8 +61,8 @@ App({ @@ -61,8 +61,8 @@ App({
61 } else if (user && user.type == "1") {//注册用户 61 } else if (user && user.type == "1") {//注册用户
62 if (relaunch) { 62 if (relaunch) {
63 wx.reLaunch({ //重新加载 63 wx.reLaunch({ //重新加载
64 - // url: '../main/home/home'  
65 - url: '../../getPhone/getPhone' 64 + url: '../home/home'
  65 + // url: '../../getPhone/getPhone'
66 }) 66 })
67 } 67 }
68 } 68 }
1 { 1 {
2 "pages": [ 2 "pages": [
3 - "pages/getPhone/getPhone",  
4 "pages/main/home/home", 3 "pages/main/home/home",
5 - 4 + "pages/getPhone/getPhone",
6 "pages/main/editinfo/editinfo", 5 "pages/main/editinfo/editinfo",
7 "pages/main/addinfo/addinfo", 6 "pages/main/addinfo/addinfo",
8 "pages/main/idinfo/idinfo", 7 "pages/main/idinfo/idinfo",
@@ -10,7 +10,6 @@ Page({ @@ -10,7 +10,6 @@ Page({
10 isshow01: false, 10 isshow01: false,
11 isshow02: false, 11 isshow02: false,
12 isshow03: false, 12 isshow03: false,
13 - taxInfo: {},  
14 proffessionlist: {}, 13 proffessionlist: {},
15 banklist: {}, 14 banklist: {},
16 isself: false, 15 isself: false,
@@ -19,7 +18,7 @@ Page({ @@ -19,7 +18,7 @@ Page({
19 card_number: '', 18 card_number: '',
20 birthday: '', 19 birthday: '',
21 requestBody: {}, 20 requestBody: {},
22 - disabledName: false, 21 + profession_index:[0,0,0],
23 22
24 relativeData: { 23 relativeData: {
25 isrequre: true, 24 isrequre: true,
@@ -80,6 +79,7 @@ Page({ @@ -80,6 +79,7 @@ Page({
80 label: '职业', 79 label: '职业',
81 bindtype: 'profession', 80 bindtype: 'profession',
82 selected: '', 81 selected: '',
  82 + range_key: 'label',
83 placeholder: '请选择职业', 83 placeholder: '请选择职业',
84 onChange: 'onPickerSelect' 84 onChange: 'onPickerSelect'
85 }, 85 },
@@ -213,41 +213,10 @@ Page({ @@ -213,41 +213,10 @@ Page({
213 * 生命周期函数--监听页面加载 213 * 生命周期函数--监听页面加载
214 */ 214 */
215 onLoad: function(options) { 215 onLoad: function(options) {
216 - // console.log('options.id', options.id)  
217 - // if (!options.id || options.id.length < 0) {  
218 - // this.setData({  
219 - // isself: false,  
220 - // })  
221 - // } else {  
222 - // this.getpersonalTax(options.id)  
223 - // }  
224 this.getproffessiondata() 216 this.getproffessiondata()
225 this.getbanklist() 217 this.getbanklist()
226 }, 218 },
227 219
228 - getpersonalTax: function(id) {  
229 - var that = this  
230 - var Authorization = app.globalData.Authorization;  
231 - wx.request({  
232 - url: baseUrl + 'persontax/v1/personal-taxes/' + id,  
233 - method: "GET",  
234 - header: {  
235 - 'content-type': 'application/json', // 默认值  
236 - "Authorization": Authorization  
237 - },  
238 - success: function(res) {  
239 - console.log(res)  
240 - that.setData({  
241 - taxInfo: res.data,  
242 - isself: res.data.family_ties ? false : true  
243 - })  
244 - },  
245 - fail(res) {  
246 - console.log(res)  
247 - }  
248 - })  
249 - },  
250 -  
251 getproffessiondata: function() { 220 getproffessiondata: function() {
252 var that = this 221 var that = this
253 var Authorization = app.globalData.Authorization; 222 var Authorization = app.globalData.Authorization;
@@ -260,8 +229,8 @@ Page({ @@ -260,8 +229,8 @@ Page({
260 "Authorization": Authorization 229 "Authorization": Authorization
261 }, 230 },
262 success: function(res) { 231 success: function(res) {
263 - console.log('proffessiondata', res.data)  
264 proffession_info.values = that.handleProfession(res.data.items) 232 proffession_info.values = that.handleProfession(res.data.items)
  233 + console.log('proffession_info------', proffession_info)
265 that.setData({ 234 that.setData({
266 proffessionlist: res.data.items, 235 proffessionlist: res.data.items,
267 professionData: proffession_info 236 professionData: proffession_info
@@ -271,60 +240,10 @@ Page({ @@ -271,60 +240,10 @@ Page({
271 console.log(res) 240 console.log(res)
272 } 241 }
273 }) 242 })
274 - console.log('proffessionData--', that.data.professionData)  
275 }, 243 },
276 244
277 handleProfession: function(items) { 245 handleProfession: function(items) {
278 - // var newdata = []  
279 - // var one = []  
280 - // var two = []  
281 - // var three = []  
282 - // var oneObj = {},  
283 - // twoObj = {},  
284 - // threeObj = {}  
285 - // if (data && data.length > 0) {  
286 - // console.log('one', one)  
287 - // data.map((d, i) => {  
288 - // one.push(d.one_level_code) //三级联动中 第一级所有的code  
289 - // two.push(d.two_level_code) //三级联动中 第二级所有的code  
290 - // three.push(d.three_level_code) //三级联动中 第三级所有的code  
291 - // oneObj[d.one_level_code] = {  
292 - // "value": d.one_level_code,  
293 - // "label": d.one_level_name,  
294 - // "children": []  
295 - // } //三级联动中 第一级所有的code + name  
296 - // twoObj[d.two_level_code] = {  
297 - // "value": d.two_level_code,  
298 - // "label": d.two_level_name,  
299 - // "children": []  
300 - // } //三级联动中 第一级所有的code + name  
301 - // threeObj[d.three_level_code] = {  
302 - // "value": d.three_level_code,  
303 - // "label": d.three_level_name  
304 - // } //三级联动中 第一级所有的code + name  
305 - // for (let b in twoObj) { //把第三级的数据的Code和第二级数据的code做判断 相等的 放到第二级的children数组中  
306 - // for (let c in threeObj) {  
307 - // if (b == c.slice(0, c.length - 1)) {  
308 - // twoObj[b].children.push(threeObj[c])  
309 - // }  
310 - // }  
311 - // }  
312 - // for (let a in oneObj) { //把第二级的数据的Code和第二级数据的code做判断 相等的 放到第一级的children数组中  
313 - // for (let b in twoObj) {  
314 - // if (a == b.slice(0, b.length - 1)) {  
315 - // oneObj[a].children.push(twoObj[b])  
316 - // }  
317 - // }  
318 - // }  
319 - // one = [...new Set(one)] //一级code去重  
320 - // one.map((da, ind) => { //遍历 得到最终的三级联动数据  
321 - // // console.log('oneObj', newdata)  
322 - // newdata.push(oneObj[da])  
323 - // })  
324 - // })  
325 - // }  
326 - // return newdata  
327 - 246 + var new_profession_data = []
328 var list = [], 247 var list = [],
329 tempTwo = {}, 248 tempTwo = {},
330 tempOne = {}, 249 tempOne = {},
@@ -371,8 +290,9 @@ Page({ @@ -371,8 +290,9 @@ Page({
371 for (var key in tempOne) { 290 for (var key in tempOne) {
372 list.push(tempOne[key]); 291 list.push(tempOne[key]);
373 } 292 }
374 - console.log('newdata', list)  
375 - return list; 293 + new_profession_data = [list, list[0].children, list[0].children[0].children]
  294 + console.log('new_profession_data', new_profession_data)
  295 + return new_profession_data;
376 296
377 }, 297 },
378 298
@@ -526,11 +446,14 @@ Page({ @@ -526,11 +446,14 @@ Page({
526 }) 446 })
527 break; 447 break;
528 case 'profession': 448 case 'profession':
529 - // var profession_data = this.data.professionData  
530 - // profession_data.selected = profession_data.values[e.detail.value]  
531 - // this.setData({  
532 - // professionData: profession_data  
533 - // }) 449 + var profession_data = this.data.professionData
  450 + console.log(profession_data.values[e.detail.value[e.detail.value[0]]][0])
  451 + var profession_name = profession_data.values[e.detail.value[e.detail.value[0]]][0].children[e.detail.value[1]].children[e.detail.value[2]].label
  452 + profession_data.selected = profession_name
  453 + this.setData({
  454 + profession_index: e.detail.value,
  455 + professionData: profession_data
  456 + })
534 break; 457 break;
535 case 'degree': 458 case 'degree':
536 var degree_data = this.data.degreeData 459 var degree_data = this.data.degreeData
@@ -663,6 +586,9 @@ Page({ @@ -663,6 +586,9 @@ Page({
663 586
664 formSubmit: function(e) { 587 formSubmit: function(e) {
665 console.log("date", Date.parse(new Date(this.data.birthday)) / 1000) 588 console.log("date", Date.parse(new Date(this.data.birthday)) / 1000)
  589 + // var pro_index = this.data.profession_index
  590 + // var profession_datas = this.data.professionData.values[pro_index[pro_index[0]]][0]
  591 + // console.log('profession_datas', profession_datas)
666 592
667 var formdata = e.detail.value; 593 var formdata = e.detail.value;
668 console.log("formdata", formdata); 594 console.log("formdata", formdata);
@@ -694,15 +620,15 @@ Page({ @@ -694,15 +620,15 @@ Page({
694 this.showtoast('请选择是否特定行业'); 620 this.showtoast('请选择是否特定行业');
695 return 621 return
696 } 622 }
697 - var new_ard_num = '' 623 + var new_card_num = ''
698 if (this.data.isIdCard && this.data.card_number.length > 0) { 624 if (this.data.isIdCard && this.data.card_number.length > 0) {
699 - new_ard_num = this.data.card_number 625 + new_card_num = this.data.card_number
700 } 626 }
701 if (!this.data.isIdCard && formdata.id_card_no && formdata.id_card_no.length > 0) { 627 if (!this.data.isIdCard && formdata.id_card_no && formdata.id_card_no.length > 0) {
702 - new_ard_num = formdata.id_card_no 628 + new_card_num = formdata.id_card_no
703 } 629 }
704 this.setData({ 630 this.setData({
705 - card_number: new_ard_num, 631 + card_number: cnew_ard_num,
706 }) 632 })
707 this.goCommit(formdata); 633 this.goCommit(formdata);
708 }, 634 },
@@ -711,6 +637,9 @@ Page({ @@ -711,6 +637,9 @@ Page({
711 var that = this 637 var that = this
712 var formdata = data 638 var formdata = data
713 console.log("form_data", formdata); 639 console.log("form_data", formdata);
  640 + var pro_index = that.data.profession_index
  641 + var profession_data_info = that.data.professionData.values[pro_index[pro_index[0]]][0]
  642 + console.log('profession_datas', profession_data_info)
714 var Authorization = app.globalData.Authorization; 643 var Authorization = app.globalData.Authorization;
715 wx.request({ 644 wx.request({
716 url: baseUrl + 'persontax/v1/personal-taxes', 645 url: baseUrl + 'persontax/v1/personal-taxes',
@@ -724,12 +653,12 @@ Page({ @@ -724,12 +653,12 @@ Page({
724 "gender": that.data.genderData.selected, 653 "gender": that.data.genderData.selected,
725 "birth_date": Date.parse(new Date(this.data.birthday)) / 1000, 654 "birth_date": Date.parse(new Date(this.data.birthday)) / 1000,
726 "profession": { 655 "profession": {
727 - "one_level_code": "1",  
728 - "one_level_name": "专业技术人员",  
729 - "two_level_code": "11",  
730 - "two_level_name": "科学研究人员",  
731 - "three_level_code": "111",  
732 - "three_level_name": "哲学研究人员" 656 + "one_level_code": profession_data_info.value,
  657 + "one_level_name": profession_data_info.label,
  658 + "two_level_code": profession_data_info.children[pro_index[1]].value,
  659 + "two_level_name": profession_data_info.children[pro_index[1]].label,
  660 + "three_level_code": profession_data_info.children[pro_index[1]].children[pro_index[2]].value,
  661 + "three_level_name": profession_data_info.children[pro_index[1]].children[pro_index[2]].label
733 }, 662 },
734 "education": that.data.degreeData.selected, 663 "education": that.data.degreeData.selected,
735 "taxpayer_no": formdata.taxpayer_no ? formdata.taxpayer_no : '', 664 "taxpayer_no": formdata.taxpayer_no ? formdata.taxpayer_no : '',
@@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
45 <view class='item_body' hidden="{{!isself}}"> 45 <view class='item_body' hidden="{{!isself}}">
46 <text style='color:red;font-size: 28rpx;line-height: 80rpx;float:left'>*</text> 46 <text style='color:red;font-size: 28rpx;line-height: 80rpx;float:left'>*</text>
47 <text class='text_black_28 float_left'>姓名</text> 47 <text class='text_black_28 float_left'>姓名</text>
48 - <input class='input_wrap float_right' placeholder='请填写姓名' value='{{taxInfo.name}}' disabled='{{disabledName}}' placeholder-class='text_999_28'></input> 48 + <input class='input_wrap float_right' placeholder='请填写姓名' value='' placeholder-class='text_999_28'></input>
49 </view> 49 </view>
50 <view class="divide_line"></view> 50 <view class="divide_line"></view>
51 51
@@ -77,7 +77,7 @@ @@ -77,7 +77,7 @@
77 <view class='item_body' bindtap='getIdInfo'> 77 <view class='item_body' bindtap='getIdInfo'>
78 <text style='color:red;font-size: 28rpx;line-height: 80rpx;float:left'>*</text> 78 <text style='color:red;font-size: 28rpx;line-height: 80rpx;float:left'>*</text>
79 <text class='text_black_28 float_left'>证照号码</text> 79 <text class='text_black_28 float_left'>证照号码</text>
80 - <view wx:if="{{isIdCard}}"> 80 + <view wx:if="{{isIdCard}}" >
81 <image class='image_camera float_right' src='/images/camera.png'></image> 81 <image class='image_camera float_right' src='/images/camera.png'></image>
82 <text class='text_333_28 float_right'>{{card_number}}</text> 82 <text class='text_333_28 float_right'>{{card_number}}</text>
83 </view> 83 </view>
@@ -17,6 +17,7 @@ Page({ @@ -17,6 +17,7 @@ Page({
17 cur_id: '', 17 cur_id: '',
18 isself: true, 18 isself: true,
19 isIdCard:true, 19 isIdCard:true,
  20 + profession_haschanges:false,
20 name: '', 21 name: '',
21 mobile:'', 22 mobile:'',
22 card_number: '', 23 card_number: '',
@@ -29,6 +30,7 @@ Page({ @@ -29,6 +30,7 @@ Page({
29 bindtype: 'relative', 30 bindtype: 'relative',
30 placeholder: '请选择关系', 31 placeholder: '请选择关系',
31 selected: '', 32 selected: '',
  33 + disabled: true,
32 values: ["子女", "配偶"], 34 values: ["子女", "配偶"],
33 onChange: 'onPickerSelect' 35 onChange: 'onPickerSelect'
34 }, 36 },
@@ -83,6 +85,7 @@ Page({ @@ -83,6 +85,7 @@ Page({
83 multiIndex: [0, 0, 0], 85 multiIndex: [0, 0, 0],
84 placeholder: '请选择职业', 86 placeholder: '请选择职业',
85 selected: '', 87 selected: '',
  88 + range_key:'label',
86 onChange: 'onPickerSelect' 89 onChange: 'onPickerSelect'
87 }, 90 },
88 degreeData: { 91 degreeData: {
@@ -265,6 +268,7 @@ Page({ @@ -265,6 +268,7 @@ Page({
265 //非必填 268 //非必填
266 this.data.genderData.selected = tax_info.gender 269 this.data.genderData.selected = tax_info.gender
267 this.data.birthDate.selected = format.yearFormString(tax_info.birth_date) + '-' + format.monthFormString(tax_info.birth_date) + '-' + format.dayFormString(tax_info.birth_date) 270 this.data.birthDate.selected = format.yearFormString(tax_info.birth_date) + '-' + format.monthFormString(tax_info.birth_date) + '-' + format.dayFormString(tax_info.birth_date)
  271 + this.data.professionData.selected = tax_info.profession.three_level_name
268 this.data.startDate.selected = format.yearFormString(tax_info.join_date) + '-' + format.monthFormString(tax_info.join_date) + '-' + format.dayFormString(tax_info.join_date) 272 this.data.startDate.selected = format.yearFormString(tax_info.join_date) + '-' + format.monthFormString(tax_info.join_date) + '-' + format.dayFormString(tax_info.join_date)
269 this.data.endDate.selected = format.yearFormString(tax_info.separate_date) + '-' + format.monthFormString(tax_info.separate_date) + '-' + format.dayFormString(tax_info.separate_date) 273 this.data.endDate.selected = format.yearFormString(tax_info.separate_date) + '-' + format.monthFormString(tax_info.separate_date) + '-' + format.dayFormString(tax_info.separate_date)
270 this.data.degreeData.selected = tax_info.education 274 this.data.degreeData.selected = tax_info.education
@@ -287,6 +291,7 @@ Page({ @@ -287,6 +291,7 @@ Page({
287 specificIndustryInfo: this.data.specificIndustryInfo, 291 specificIndustryInfo: this.data.specificIndustryInfo,
288 genderData: this.data.genderData, 292 genderData: this.data.genderData,
289 293
  294 + professionData:this.data.professionData,
290 degreeData: this.data.degreeData, 295 degreeData: this.data.degreeData,
291 disabilityInfo: this.data.disabilityInfo, 296 disabilityInfo: this.data.disabilityInfo,
292 lieshuInfo: this.data.lieshuInfo, 297 lieshuInfo: this.data.lieshuInfo,
@@ -308,7 +313,7 @@ Page({ @@ -308,7 +313,7 @@ Page({
308 }) 313 })
309 }, 314 },
310 315
311 - getproffessiondata: function() { 316 + getproffessiondata: function () {
312 var that = this 317 var that = this
313 var Authorization = app.globalData.Authorization; 318 var Authorization = app.globalData.Authorization;
314 var proffession_info = that.data.professionData 319 var proffession_info = that.data.professionData
@@ -319,9 +324,9 @@ Page({ @@ -319,9 +324,9 @@ Page({
319 'content-type': 'application/json', // 默认值 324 'content-type': 'application/json', // 默认值
320 "Authorization": Authorization 325 "Authorization": Authorization
321 }, 326 },
322 - success: function(res) {  
323 - console.log('proffessiondata', res.data) 327 + success: function (res) {
324 proffession_info.values = that.handleProfession(res.data.items) 328 proffession_info.values = that.handleProfession(res.data.items)
  329 + console.log('proffession_info------', proffession_info)
325 that.setData({ 330 that.setData({
326 proffessionlist: res.data.items, 331 proffessionlist: res.data.items,
327 professionData: proffession_info 332 professionData: proffession_info
@@ -331,59 +336,60 @@ Page({ @@ -331,59 +336,60 @@ Page({
331 console.log(res) 336 console.log(res)
332 } 337 }
333 }) 338 })
334 - console.log('proffessionData--', that.data.professionData)  
335 }, 339 },
336 340
337 - handleProfession: function(data) {  
338 - var newdata = []  
339 - var one = []  
340 - var two = []  
341 - var three = []  
342 - var oneObj={}, twoObj={}, threeObj = {}  
343 - if (data && data.length > 0) {  
344 - console.log('one',one)  
345 - data.map((d, i) => {  
346 - one.push(d.one_level_code) //三级联动中 第一级所有的code  
347 - two.push(d.two_level_code) //三级联动中 第二级所有的code  
348 - three.push(d.three_level_code) //三级联动中 第三级所有的code  
349 - oneObj[d.one_level_code] = { 341 + handleProfession: function (items) {
  342 + var new_profession_data = []
  343 + var list = [],
  344 + tempTwo = {},
  345 + tempOne = {},
  346 + tempThree = {};
  347 + items.map((d) => {
  348 + if (!tempOne[d.one_level_code]) {
  349 + tempOne[d.one_level_code] = {
350 "value": d.one_level_code, 350 "value": d.one_level_code,
351 "label": d.one_level_name, 351 "label": d.one_level_name,
352 "children": [] 352 "children": []
353 - } //三级联动中 第一级所有的code + name  
354 - twoObj[d.two_level_code] = { 353 + };
  354 + }
  355 + if (!tempTwo[d.two_level_code]) {
  356 + var districtArray = [];
  357 + districtArray.push({
  358 + "value": d.three_level_code,
  359 + "label": d.three_level_name,
  360 + "children": []
  361 + });
  362 +
  363 + tempTwo[d.two_level_code] = {
355 "value": d.two_level_code, 364 "value": d.two_level_code,
356 "label": d.two_level_name, 365 "label": d.two_level_name,
357 - "children": []  
358 - } //三级联动中 第一级所有的code + name  
359 - threeObj[d.three_level_code] = {  
360 - "value": d.three_level_code,  
361 - "label": d.three_level_name  
362 - } //三级联动中 第一级所有的code + name  
363 - for (let b in twoObj) { //把第三级的数据的Code和第二级数据的code做判断 相等的 放到第二级的children数组中  
364 - for (let c in threeObj) {  
365 - if (b == c.slice(0, c.length - 1)) {  
366 - twoObj[b].children.push(threeObj[c])  
367 - }  
368 - }  
369 - }  
370 - for (let a in oneObj) { //把第二级的数据的Code和第二级数据的code做判断 相等的 放到第一级的children数组中  
371 - for (let b in twoObj) {  
372 - if (a == b.slice(0, b.length - 1)) {  
373 - oneObj[a].children.push(twoObj[b])  
374 - }  
375 - } 366 + "children": districtArray
  367 + };
  368 +
  369 + } else {
  370 + if (!tempThree[d.three_level_code]) {
  371 + tempTwo[d.two_level_code].children.push({
  372 + "value": d.three_level_code,
  373 + "label": d.three_level_name,
  374 + "children": []
  375 + });
  376 + tempThree[d.three_level_code] = "y"
376 } 377 }
377 - one = [...new Set(one)] //一级code去重  
378 - one.map((da, ind) => { //遍历 得到最终的三级联动数据  
379 - // console.log('oneObj', newdata)  
380 - newdata.push(oneObj[da])  
381 - })  
382 - }) 378 + }
  379 + });
  380 + items.map((d) => {
  381 + if (tempTwo[d.two_level_code]) {
  382 + tempOne[d.one_level_code].children.push(tempTwo[d.two_level_code]);
  383 + tempTwo[d.two_level_code] = null;
  384 + }
  385 + });
  386 + for (var key in tempOne) {
  387 + list.push(tempOne[key]);
383 } 388 }
384 - console.log('newdata', newdata)  
385 -  
386 - return newdata 389 + new_profession_data = [list, list[0].children, list[0].children[0].children]
  390 + console.log('new_profession_data', new_profession_data)
  391 + return new_profession_data;
  392 +
387 }, 393 },
388 394
389 getbanklist: function() { 395 getbanklist: function() {
@@ -517,11 +523,15 @@ Page({ @@ -517,11 +523,15 @@ Page({
517 }) 523 })
518 break; 524 break;
519 case 'profession': 525 case 'profession':
520 - // var profession_data = this.data.professionData  
521 - // profession_data.selected = profession_data.values[e.detail.value]  
522 - // this.setData({  
523 - // professionData: profession_data  
524 - // }) 526 + var profession_data = this.data.professionData
  527 + console.log(profession_data.values[e.detail.value[e.detail.value[0]]][0])
  528 + var profession_name = profession_data.values[e.detail.value[e.detail.value[0]]][0].children[e.detail.value[1]].children[e.detail.value[2]].label
  529 + profession_data.selected = profession_name
  530 + this.setData({
  531 + profession_haschanges:true,
  532 + profession_index: e.detail.value,
  533 + professionData: profession_data
  534 + })
525 break; 535 break;
526 case 'degree': 536 case 'degree':
527 var degree_data = this.data.degreeData 537 var degree_data = this.data.degreeData
@@ -652,10 +662,12 @@ Page({ @@ -652,10 +662,12 @@ Page({
652 662
653 663
654 getIdInfo: function(e) { 664 getIdInfo: function(e) {
655 - wx.navigateTo({  
656 - url: '../idinfo/idinfo',  
657 - success: function(res) {},  
658 - }) 665 + if(this.data.isIdCard){
  666 + wx.navigateTo({
  667 + url: '../idinfo/idinfo',
  668 + success: function (res) { },
  669 + })
  670 + }
659 }, 671 },
660 672
661 formSubmit: function (e) { 673 formSubmit: function (e) {
@@ -667,7 +679,7 @@ Page({ @@ -667,7 +679,7 @@ Page({
667 if (formdata.name.length < 1) { 679 if (formdata.name.length < 1) {
668 this.showtoast('请输入姓名'); 680 this.showtoast('请输入姓名');
669 return 681 return
670 - } else if (this.data.relativeData.selected.length < 1) { 682 + } else if (!this.data.isself&&this.data.relativeData.selected.length < 1) {
671 this.showtoast('请选择成员关系'); 683 this.showtoast('请选择成员关系');
672 return 684 return
673 } else if (this.data.personstatusData.selected.length < 1) { 685 } else if (this.data.personstatusData.selected.length < 1) {
@@ -709,6 +721,7 @@ Page({ @@ -709,6 +721,7 @@ Page({
709 var that = this 721 var that = this
710 var formdata = data 722 var formdata = data
711 console.log("form_data", formdata); 723 console.log("form_data", formdata);
  724 + var request_profession = that.getProfessionRequest()
712 var Authorization = app.globalData.Authorization; 725 var Authorization = app.globalData.Authorization;
713 wx.request({ 726 wx.request({
714 url: baseUrl + 'persontax/v1/personal-taxes/'+that.data.cur_id, 727 url: baseUrl + 'persontax/v1/personal-taxes/'+that.data.cur_id,
@@ -721,14 +734,7 @@ Page({ @@ -721,14 +734,7 @@ Page({
721 "id_card_no": that.data.card_number, 734 "id_card_no": that.data.card_number,
722 "gender": that.data.genderData.selected, 735 "gender": that.data.genderData.selected,
723 "birth_date": that.data.long_birth_date, 736 "birth_date": that.data.long_birth_date,
724 - "profession": {  
725 - "one_level_code": "1",  
726 - "one_level_name": "专业技术人员",  
727 - "two_level_code": "11",  
728 - "two_level_name": "科学研究人员",  
729 - "three_level_code": "111",  
730 - "three_level_name": "哲学研究人员"  
731 - }, 737 + "profession": request_profession,
732 "education": that.data.degreeData.selected, 738 "education": that.data.degreeData.selected,
733 "taxpayer_no": formdata.taxpayer_no ? formdata.taxpayer_no : '', 739 "taxpayer_no": formdata.taxpayer_no ? formdata.taxpayer_no : '',
734 "taxpayer_status": that.data.personstatusData.selected, 740 "taxpayer_status": that.data.personstatusData.selected,
@@ -796,6 +802,25 @@ Page({ @@ -796,6 +802,25 @@ Page({
796 }) 802 })
797 }, 803 },
798 804
  805 + getProfessionRequest:function(){
  806 + var that = this
  807 + var pro_index = that.data.profession_index
  808 + if (that.data.profession_haschanges&&pro_index.length==3){
  809 + var profession_data_info = that.data.professionData.values[pro_index[pro_index[0]]][0]
  810 + console.log('profession_datas', profession_data_info)
  811 + return {
  812 + "one_level_code": profession_data_info.value,
  813 + "one_level_name": profession_data_info.label,
  814 + "two_level_code": profession_data_info.children[pro_index[1]].value,
  815 + "two_level_name": profession_data_info.children[pro_index[1]].label,
  816 + "three_level_code": profession_data_info.children[pro_index[1]].children[pro_index[2]].value,
  817 + "three_level_name": profession_data_info.children[pro_index[1]].children[pro_index[2]].label
  818 + }
  819 + }else{
  820 + return that.data.taxInfo.profession
  821 + }
  822 + },
  823 +
799 showtoast: function (title) { 824 showtoast: function (title) {
800 wx.showToast({ 825 wx.showToast({
801 title: title, 826 title: title,
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 <view class='item_body'> 13 <view class='item_body'>
14 <text style='color:red;font-size: 28rpx;line-height: 80rpx;float:left'>*</text> 14 <text style='color:red;font-size: 28rpx;line-height: 80rpx;float:left'>*</text>
15 <text class='text_black_28 float_left'>姓名</text> 15 <text class='text_black_28 float_left'>姓名</text>
16 - <input class='input_wrap float_right' placeholder='请填写姓名' name='name' value='{{name}}' disabled='{{disabled}}'></input> 16 + <input class='input_wrap float_right' placeholder='请填写姓名' name='name' value='{{name}}' disabled='true'></input>
17 </view> 17 </view>
18 <view class="divide_line"></view> 18 <view class="divide_line"></view>
19 <!-- <view class='item_body' bindtap='openpicker'> 19 <!-- <view class='item_body' bindtap='openpicker'>
@@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
45 <view class='item_body' hidden="{{!isself}}"> 45 <view class='item_body' hidden="{{!isself}}">
46 <text style='color:red;font-size: 28rpx;line-height: 80rpx;float:left'>*</text> 46 <text style='color:red;font-size: 28rpx;line-height: 80rpx;float:left'>*</text>
47 <text class='text_black_28 float_left'>姓名</text> 47 <text class='text_black_28 float_left'>姓名</text>
48 - <input class='input_wrap float_right' placeholder='请填写姓名' value='{{taxInfo.name}}' disabled='{{disabled}}'></input> 48 + <input class='input_wrap float_right' placeholder='请填写姓名' value='{{taxInfo.name}}' disabled='true'></input>
49 </view> 49 </view>
50 <view class="divide_line"></view> 50 <view class="divide_line"></view>
51 51
@@ -82,7 +82,7 @@ @@ -82,7 +82,7 @@
82 <text class='text_333_28 float_right'>{{card_number}}</text> 82 <text class='text_333_28 float_right'>{{card_number}}</text>
83 </view> 83 </view>
84 <view wx:else> 84 <view wx:else>
85 - <input class='input_wrap float_right' placeholder='请输入证件号码' value='{{card_number}}' name='id_card_no'></input> 85 + <input class='input_wrap float_right' placeholder='请输入证件号码' value='{{card_number}}' name='id_card_no' ></input>
86 </view> 86 </view>
87 </view> 87 </view>
88 <view class="divide_line"></view> 88 <view class="divide_line"></view>
@@ -117,7 +117,7 @@ @@ -117,7 +117,7 @@
117 <image class='arrow_wrap' src='/images/arrow_right.png'></image> 117 <image class='arrow_wrap' src='/images/arrow_right.png'></image>
118 <text class='text_333_28 float_right'></text> 118 <text class='text_333_28 float_right'></text>
119 </view> --> 119 </view> -->
120 - <template is="picker_cell_muti" data="{{...professionData}}" /> 120 + <template is="picker_cell_normal" data="{{...professionData}}" />
121 <view class="divide_line"></view> 121 <view class="divide_line"></view>
122 <!-- <view class='item_body'> 122 <!-- <view class='item_body'>
123 <text class='text_666_28 float_left'>学历</text> 123 <text class='text_666_28 float_left'>学历</text>
@@ -326,10 +326,9 @@ @@ -326,10 +326,9 @@
326 326
327 <view style='width:100% '> 327 <view style='width:100% '>
328 <text class='text_666_28 float_left '>备注</text> 328 <text class='text_666_28 float_left '>备注</text>
329 - <input class='extra_input' value='{{taxInfo.comment}}' name='comment' placeholder-class='text_999_28' placeholder='请输入备注'></input> 329 + <input class='extra_input' style='text-aligh: right' value='{{taxInfo.comment}}' name='comment' placeholder-class='text_999_28' placeholder='请输入备注'></input>
330 </view> 330 </view>
331 </view> 331 </view>
332 -  
333 </view> 332 </view>
334 333
335 <view style='background:#f8f8f8;height:150rpx '></view> 334 <view style='background:#f8f8f8;height:150rpx '></view>
@@ -89,7 +89,6 @@ @@ -89,7 +89,6 @@
89 font-size: 28rpx; 89 font-size: 28rpx;
90 color: #333; 90 color: #333;
91 float: right; 91 float: right;
92 - text-aligh: right;  
93 line-height: 40rpx; 92 line-height: 40rpx;
94 padding: 16rpx 0; 93 padding: 16rpx 0;
95 word-wrap: break-word; 94 word-wrap: break-word;
@@ -7,7 +7,7 @@ Page({ @@ -7,7 +7,7 @@ Page({
7 * 页面的初始数据 7 * 页面的初始数据
8 */ 8 */
9 data: { 9 data: {
10 - taxlist:[""] 10 + taxlist:['']
11 }, 11 },
12 12
13 /** 13 /**
@@ -34,6 +34,10 @@ Page({ @@ -34,6 +34,10 @@ Page({
34 getTaxList:function(){ 34 getTaxList:function(){
35 var that = this; 35 var that = this;
36 var Authorization = app.globalData.Authorization; 36 var Authorization = app.globalData.Authorization;
  37 + console.log('Authorization',Authorization)
  38 + if(!Authorization||Authorization.length<10){
  39 + return
  40 + }
37 wx.request({ 41 wx.request({
38 url: baseUrl + 'persontax/v1/personal-taxes', 42 url: baseUrl + 'persontax/v1/personal-taxes',
39 method: "GET", 43 method: "GET",
注册登录 后发表评论