代码调试

This commit is contained in:
BianLzhaoMin 2025-02-19 16:56:45 +08:00
parent 095d0e78cc
commit f972b0eb88
2 changed files with 39 additions and 51 deletions

View File

@ -1,16 +1,15 @@
//form序列化为json //form序列化为json
$.fn.serializeObject = function() $.fn.serializeObject = function () {
{
var o = {}; var o = {};
var a = this.serializeArray(); var a = this.serializeArray();
$.each(a, function() { $.each(a, function () {
if (o[this.name] !== undefined) { if (o[this.name] !== undefined) {
if (!o[this.name].push) { if (!o[this.name].push) {
o[this.name] = [o[this.name]]; o[this.name] = [o[this.name]];
} }
o[this.name].push(this.value || ''); o[this.name].push(this.value || "");
} else { } else {
o[this.name] = this.value || ''; o[this.name] = this.value || "";
} }
}); });
return o; return o;
@ -18,17 +17,24 @@ $.fn.serializeObject = function()
//获取url后的参数值 //获取url后的参数值
function getUrlParam(key) { function getUrlParam(key) {
var href = window.location.href; var href = window.location.href;
var url = href.split("?");
if(url.length <= 1){
return "";
}
var params = url[1].split("&");
for(var i=0; i<params.length; i++){ console.log("key+++++", key);
var param = params[i].split("="); var url = href.split("?");
if(key == param[0]){ console.log("url+++++", url);
return param[1]; if (url.length <= 1) {
} return "";
} }
var params = url[1].split("&");
console.log("params+++++", params);
for (var i = 0; i < params.length; i++) {
var param = params[i].split("=");
console.log("param*****+++++", param);
if (key == param[0]) {
return param[1];
}
}
} }

View File

@ -74,10 +74,10 @@
} else { } else {
$("#btnGroup").hide(); $("#btnGroup").hide();
} }
// if (getUrlParam("type") == '1') { if (getUrlParam("type") == '1') {
// $("#btnGroup").hide(); $("#btnGroup").hide();
// $("#txtTip").hide(); $("#txtTip").hide();
// } }
} }
}) })
} }
@ -159,40 +159,22 @@
if (cellData.field === 'examineAndApprove') { if (cellData.field === 'examineAndApprove') {
cellData.templet = function (d) { cellData.templet = function (d) {
//如果d.isApprove == 1 去除当前行的编辑功能 //如果d.isApprove == 1 去除当前行的编辑功能
// let text = ""; let text = "";
// if (d.isTwoApprove == 1) { if (d.isTwoApprove == 1) {
// text += '<a style="color: #009688;cursor: pointer;font-size: 15px"' + text += '<a style="color: #009688;cursor: pointer;font-size: 15px"' +
// ' id="pass">已通过</a>'; ' id="pass">已通过</a>';
// } }
// if (d.isTwoApprove == 2) { if (d.isTwoApprove == 2) {
// text += '<a style="color: #a59e9e;cursor: pointer;font-size: 15px"' + text += '<a style="color: #a59e9e;cursor: pointer;font-size: 15px"' +
// ' id="reject">已驳回</a>'; ' id="reject">已驳回</a>';
// } }
// text += '<a lay-event="pass" style="color: #009688;cursor: pointer;font-size: 15px"' + // text += '<a lay-event="pass" style="color: #009688;cursor: pointer;font-size: 15px"' +
// ' id="pass">通过</a>'; // ' id="pass">通过</a>';
// text += // text +=
// '<a lay-event="reject" style="color: #a59e9e;cursor: pointer;font-size: 15px;margin-left: 10px"' + // '<a lay-event="reject" style="color: #a59e9e;cursor: pointer;font-size: 15px;margin-left: 10px"' +
// ' id="reject">驳回</a>'; // ' id="reject">驳回</a>';
let text = "";
if (d.isTwoApprove == 1 && d.isApprove == 1 && d.isThreeApprove == 0) {
text += '<a lay-event="pass" style="color: #009688;cursor: pointer;font-size: 15px"' +
' id="pass">通过</a>';
text +=
'<a lay-event="reject" style="color: #a59e9e;cursor: pointer;font-size: 15px;margin-left: 10px"' +
' id="reject">驳回</a>';
} else {
if (d.isTwoApprove == 1 && d.isApprove == 1 && d.isThreeApprove == 1) {
text += '<a style="color: #009688;cursor: pointer;font-size: 15px"' +
' id="pass">已通过</a>';
} else if (d.isThreeApprove == 2 && d.isTwoApprove == 1) {
text += '<a style="color: #a59e9e;cursor: pointer;font-size: 15px"' +
' id="reject">已驳回</a>';
} else {
noMessage++
return ''
}
}
return text; return text;
} }
} }