<%@ page contentType="text/html;charset=UTF-8" %>
<script>
$(document).ready(function() {
	$("#agree").click(function () {
		jp.prompt("审核意见", function (message) {
			jp.post("${ctx}/act/task/nonRePowerEndTask",
				{
					"taskId":"${nonPower.act.taskId}",
					"taskName":"${nonPower.act.taskName}",
					"taskDefKey":"${nonPower.act.taskDefKey}",
					"procInsId":"${nonPower.act.procInsId}",
					"procDefId":"${nonPower.act.procDefId}",
					"flag":"yes",
					"comment":window.encodeURI(message)
				},
				function (data) {
					if (data.success) {
						jp.success(data.msg);
						jp.go("${ctx}/act/task/todo");
					} else {
						jp.error(data.mag);
					}
				})
		});
	});
	$("#no").click(function () {
		jp.prompt("审核意见", function (message) {
			jp.post("${ctx}/act/task/nonRePowerEndTask",
				{
					"taskId":"${nonPower.act.taskId}",
					"taskName":"${nonPower.act.taskName}",
					"taskDefKey":"${nonPower.act.taskDefKey}",
					"procInsId":"${nonPower.act.procInsId}",
					"procDefId":"${nonPower.act.procDefId}",
					"flag":"no",
					"comment":window.encodeURI(message)
				},
				function (data) {
					if(data.success){
						jp.success(data.msg);
						jp.go("${ctx}/act/task/todo")
					}else {
						jp.error(data.mag);
					}
				})
		});
	});

	$("#export").click(function(){
		jp.downloadFile('${ctx}/nonPower/civilEnd?id=${nonPower.id}');
	});
})

</script>