|
@@ -100,9 +100,12 @@ TalentAllowanceInfoDlg.initProjectColumns = function () {
|
|
|
{title: '核查项目名称', field: 'projectName', visible: true, align: 'center', valign: 'middle', width: "15%", 'class': 'uitd_showTip'},
|
|
|
{title: '详情', field: 'months', visible: true, align: 'center', valign: 'middle', width: "45%",
|
|
|
formatter: function (value, row, index) {
|
|
|
- var html = TalentAllowanceInfoDlg.createMonthSelector(row.project, row.id, row.enterpriseId, value);
|
|
|
- if (row.days != null && row.days != '') {
|
|
|
-
|
|
|
+ var allowanceType = $("#allowanceType").val();
|
|
|
+ var html = "";
|
|
|
+ if (row.project == 4 && allowanceType == 2) {
|
|
|
+ html = TalentAllowanceInfoDlg.createDaySelector(row.id, value);
|
|
|
+ } else {
|
|
|
+ html = TalentAllowanceInfoDlg.createMonthSelector(row.id, value);
|
|
|
}
|
|
|
return html;
|
|
|
}
|
|
@@ -115,11 +118,12 @@ TalentAllowanceInfoDlg.initProjectColumns = function () {
|
|
|
},
|
|
|
{title: '操作', field: 'project', visible: true, align: 'left', valign: 'middle', width: "15%",
|
|
|
formatter: function (value, row, index) {
|
|
|
+ var allowanceType = $("#allowanceType").val();
|
|
|
var butHtml = "";
|
|
|
if (row.isEdit == 1) {
|
|
|
/*butHtml = butHtml + "<button type='button' data-value='" + (row.description ? row.description : "") + "' onclick=\"TalentAllowanceInfoDlg.showEditProjectModal('" + row.project + "','" + row.id + "','" + row.enterpriseId + "','" + row.months + "','" + row.days + "',this)\" style='margin-left: 5px' class=\"btn btn-xs btn-danger tips\">" +
|
|
|
"<i class=\"fa fa-edit\"></i>修改</button>";*/
|
|
|
- butHtml = butHtml + "<button type='button' onclick=\"TalentAllowanceInfoDlg.saveProjectData('" + row.id + "')\" style='margin-left: 5px' class=\"btn btn-xs btn-danger tips\">" +
|
|
|
+ butHtml = butHtml + "<button type='button' onclick=\"TalentAllowanceInfoDlg.saveProjectData('" + row.id + "','" + row.project + "','" + allowanceType + "')\" style='margin-left: 5px' class=\"btn btn-xs btn-danger tips\">" +
|
|
|
"<i class=\"fa fa-edit\"></i>保存</button>";
|
|
|
}
|
|
|
butHtml = butHtml + "<button type='button' onclick='TalentAllowanceInfoDlg.showLog(\"" + row.id + "\")' style='margin-left: 5px' class='btn btn-xs btn-success'><i class=\"fa fa-book\"></i>日志</button>";
|
|
@@ -128,7 +132,27 @@ TalentAllowanceInfoDlg.initProjectColumns = function () {
|
|
|
}
|
|
|
];
|
|
|
}
|
|
|
-TalentAllowanceInfoDlg.createMonthSelector = function (project, id, enterpriseId, selectMonths) {
|
|
|
+
|
|
|
+TalentAllowanceInfoDlg.createDaySelector = function (id, selectDays) {
|
|
|
+ var dayArr = selectDays ? selectDays.split(",") : [];
|
|
|
+ var tmpKv = {};
|
|
|
+ for (var d = 0; d < dayArr.length; d++) {
|
|
|
+ var kv = dayArr[d].split("=");
|
|
|
+ tmpKv["m" + kv[0]] = kv[1];
|
|
|
+ }
|
|
|
+ var html = '<div id="m' + id + '" class="day-selector"><span style="color:red;">*填写对应月份打卡天数,没有填写则记为0天</span><ul>';
|
|
|
+ var bigMonths = [1, 3, 5, 7, 8, 10, 12];
|
|
|
+ for (var m = 1; m <= 12; m++) {
|
|
|
+ var month = m < 10 ? "0" + m : m;
|
|
|
+ var day = tmpKv["m" + month] ? tmpKv["m" + month] : "";
|
|
|
+ var maxDay = bigMonths.indexOf(m) > -1 ? 31 : (m != 2 ? 30 : 29);
|
|
|
+ html += '<li><label>' + m + '月</label><input type="number" name="day" class="form-control" max="' + maxDay + '" min="0" num="' + month + '" value="' + day + '"></li>';
|
|
|
+ }
|
|
|
+ html += '</ul></div>'
|
|
|
+ return html;
|
|
|
+}
|
|
|
+
|
|
|
+TalentAllowanceInfoDlg.createMonthSelector = function (id, selectMonths) {
|
|
|
var monthArr = selectMonths ? selectMonths.split(",") : [];
|
|
|
var html = '<div id="m' + id + '" class="month-selector"><ul><li><input type="checkbox" onchange="TalentAllowanceInfoDlg.newCheckAll(' + id + ',this)">全选</li>';
|
|
|
for (var m = 1; m <= 12; m++) {
|