 	element.children('.header').text(header)
 	element.find('.label').text(header)
 
-lastProgress = Number.MAX_VALUE
+lastPercent = 100
 updateModelProgress = (event)->
 	if event.lengthComputable
-		if event.loaded < lastProgress
+		percent = Math.round(100 * event.loaded / event.total)
+		if percent < lastPercent
 			$('#progress .ui.progress').progress
-				total: event.total
-				value: event.loaded
+				total: 100
+				value: percent
 		else
-			$('#progress .ui.progress').progress('increment', event.loaded - lastProgress)
-
-		$('#progress .bar .progress').text(parseInt(100 * event.loaded / event.total) + '%')
-		lastProgress = event.loaded
+			$('#progress .ui.progress').progress('increment', percent - lastPercent)
+
+		$('#progress .bar .progress').text(percent + '%')
+		lastPercent = percent
 
 form1Rule =
 	name:

	submitForm = ->
		switchModalProgress('正在上传信息表')
		form = $.extend({}, $('#form1').form('get values'), $('#form3').form('get values'))
		jqxhr = $.post '/joinsdi/upload/form', form, (body)->
			submitID = body
			submitAvatar()
		jqxhr.fail ->
			modalAlert('网络错误', '信息表上传失败。请确认网络链接正常，或向我们反馈')

	submitAvatar = ->
		switchModalProgress('正在上传照片')

			if this.status == 200
				submitApply()
			else
				modalAlert('照片上传失败', '数据错误，请确认上传的照片的大小，格式符合要求，并向我们反馈。')
		xhr.onerror = ->
			modalAlert('照片上传失败', '网络错误，请确认网络连接正常。')
		xhr.upload.addEventListener('progress', updateModelProgress)
		xhr.send(form)

