|
@{
|
|
ViewBag.Title = "problemtype";
|
Layout = "~/Views/Shared/_Layout_DataEdit.cshtml";
|
}
|
@section headerStyle{
|
<script language="javascript" type="text/javascript">
|
var questiontypeDropDown = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.questiontype))';
|
var WentiId = '@Html.Raw(ViewBag.WentiId)';
|
controllist = [
|
{
|
label: '题目类别信息', name: 'data', labtype: 'panel',islist:'false', data: [
|
|
{ label: ' 题目Id ', name: 'Id', labtype: 'txt', addvisible: false, editvisible: false ,reg:''}
|
, { label: ' 编码 ', name: 'CodeSn', labtype: 'txt', addvisible: true, editvisible: true, reg: '', ismust: true }
|
, { label: ' 名称 ', name: 'Comments', labtype: 'txt', addvisible: true, editvisible: true, reg: '', ismust: true }
|
, { label: ' 排序 ', name: 'Sort', labtype: 'txt', addvisible: true, editvisible: true, reg: '' }
|
, { label: ' 问题类别 ', name: 'Contents', labtype: 'combox', addvisible: true, editvisible: true, reg: '', data: JSON.parse(questiontypeDropDown)}
|
, { label: ' 主表id ', name: 'CodeId', labtype: 'txt', addvisible: false, editvisible: false ,reg:'' }
|
|
, { label: ' 状态 ', name: 'RecStatus', labtype: 'txt', disabled:false, addvisible: false, editvisible: false ,reg:''}
|
|
|
]}
|
|
];
|
|
|
|
saveurl = '/SysCode/Savequestiontype';
|
editurl = '/SysCode/Getproblemtype?WentiId=' + WentiId;
|
nullifyurl = "/SysCode/NullifySysCodeDtl/";//废弃取消单据时的url 返回json数据
|
//deldtlurl = "/HrPosition/NullifyDtl/";//删除单据明细时时配置的url 返回json数据
|
comments ="题目类别信息";
|
|
function _pageSaveContinue() {//获取值x
|
|
|
var jsonStr = "";
|
ischeck = true;
|
|
if (typeof (_parSaveCheck) === "function") {
|
ischeck = _parSaveCheck();
|
if (!ischeck) { return; }
|
|
}
|
if (!isauto) {
|
jsonStr += getjsonval('');
|
jsonStr = jsonStr.substring(0, jsonStr.length - 1)
|
jsonStr = '{' + jsonStr + '}';
|
}
|
else {
|
jsonStr = savedata;
|
}
|
// $("#aa").html(jsonStr);
|
if (!ischeck) { return false; }
|
if (jsonStr == "") { return false; }
|
|
if (typeof (_beforeSaveData) === "function") {
|
jsonStr = _beforeSaveData(jsonStr);
|
}
|
|
$.ajax({
|
url: saveurl,
|
type: 'POST',
|
data: JSON.parse(jsonStr),//{ "jsonStrs": jsonStr},
|
//contentType: "application/json;charset=utf-8",
|
dataType: 'json',
|
success: function (data) {
|
//console.log(JSON.stringify(data));
|
//data = JSON.stringify(data)
|
|
console.log(data);
|
//data = JSON.parse(data);
|
console.log(typeof (data));
|
var issuccess = data.Result;
|
var sysid = data.ReturnID;
|
var successMsg = savesuccessmsg == "" ? '保存成功' : savesuccessmsg;
|
if (issuccess) {
|
|
if (typeof (_afterSaveSucc) === "function") {
|
layer.alert(successMsg, function () {
|
setTimeout(function () {
|
var result = _afterSaveSucc();
|
if (result == undefined) {
|
|
return;
|
}
|
return;
|
|
}, 500);
|
|
return;
|
});
|
|
}
|
if (id != null && id != undefined && id != '') {
|
layer.alert(successMsg, { icon: 6 }, function () {
|
if (typeof (_afterSaveData) === "function") {
|
_afterSaveData();
|
} else {
|
//location.reload(true);
|
//_pageAutoClose();//自动关闭页面方法
|
location.href = '/SysCode/Editproblemtype?WentiId=' + WentiId;;
|
}
|
});
|
}
|
else {
|
layer.alert(successMsg, { icon: 6 }, function () {
|
if (typeof (_afterSaveData) === "function") {
|
_afterSaveData();
|
|
} else {
|
//if (self.location.href.substr(0, self.location.href.length - 1) == '/') {
|
// self.location.href = self.location.href + sysid + '';
|
//}
|
//else {
|
// if (self.location.href.indexOf('id') < 0) {
|
// self.location.href = self.location.href + '/' + sysid + '';
|
// }
|
//}
|
location.href = '/SysCode/Editproblemtype?WentiId=' + WentiId;;
|
}
|
});
|
}
|
}
|
else {
|
// msg.err(data.Message);
|
parent.layer.alert(data.Message, { icon: 5 });
|
}
|
},
|
error: function () {
|
msg.err('页面出错');
|
}
|
});
|
};
|
</script>
|
}
|
|
|
@section footerScripts{
|
<script language="javascript" type="text/javascript">
|
|
|
</script>
|
}
|