You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.9 KiB

layui.use(['laytpl', 'upload'], function () {
var form = layui.form
, laytpl = layui.laytpl
, upload = layui.upload;
var questionId = GetQueryString("question_id");
$.ajax({
type: "GET",
dataType: "json",
url: '/dsBase/jianli/getJlQuestionDetail',
data: {
question_id: questionId
},
success: function (data) {
var questionInfoTpl = questionInfoScript.innerHTML,
questionInfoView = document.getElementById('questionInfoView');
laytpl(questionInfoTpl).render(data, function (html) {
questionInfoView.innerHTML = html;
});
}
});
// 下载文件
window.downlaodFile = function (url, fileName) {
download(url, fileName);
}
// 通过
$("#save").click(function(){
$.ajax({
type: "POST",
dataType: "json",
url: "/dsBase/jianli/finishQuestion",
data: {
question_id: questionId,
repair_content: $("#questionResult").val()
},
success: function (data) {
if (data.success) {
layer.msg("通过成功", { icon: 1, time: 1300, shade: [0.1, '#000', true] }, function () {
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
window.parent.parentTableRender();
});
} else {
alert(data.message);
}
}
});
});
// 退回
$("#back").click(function(){
$.ajax({
type: "POST",
dataType: "json",
url: "/dsBase/jianli/replyQuestion",
data: {
question_id: questionId,
reply_content: $("#questionResult").val()
},
success: function (data) {
if (data.success) {
layer.msg("退回成功!", { icon: 1, time: 1300, shade: [0.1, '#000', true] }, function () {
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
window.parent.parentTableRender();
});
} else {
alert(data.message);
}
}
});
});
// 获取参数值
function GetQueryString(name, istop) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (typeof (istop) != "undefined") r = top.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
});