From 5f5db5ddcccd858e45bf9e9b92f55646218d4643 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期二, 07 十一月 2023 10:29:59 +0800
Subject: [PATCH] #
---
src/main/webapp/static/js/priOnline2/priOnline.js | 135 ++++++++++++++++++++++++++++++++++----------
1 files changed, 104 insertions(+), 31 deletions(-)
diff --git a/src/main/webapp/static/js/priOnline2/priOnline.js b/src/main/webapp/static/js/priOnline2/priOnline.js
index 05e67a8..b2a6eb5 100644
--- a/src/main/webapp/static/js/priOnline2/priOnline.js
+++ b/src/main/webapp/static/js/priOnline2/priOnline.js
@@ -5,7 +5,7 @@
base: baseUrl + "/static/layui/lay/modules/"
}).extend({
cascader: 'cascader/cascader',
-}).use(['table','laydate', 'form', 'admin', 'xmSelect', 'element', 'cascader', 'tree', 'dropdown'], function() {
+}).use(['table', 'laydate', 'form', 'admin', 'xmSelect', 'element', 'cascader', 'tree', 'dropdown'], function () {
var table = layui.table;
var $ = layui.jquery;
var layer = layui.layer;
@@ -104,9 +104,7 @@
hide: false
}
, {field: 'itemId', align: 'center', title: '瑙勫垝鍗曞彿', hide: true}
- , {field: 'createTime$', align: 'center', title: '鍒涘缓鏃堕棿'}
- , {field: 'updateTime$', align: 'center', title: '鏇存柊鏃堕棿'}
- , {field: 'status$', align: 'center', title: '鐘舵��'}
+ , {field: 'status$', align: 'center', title: '鐘舵��', hide: false}
// ,{field: 'memberId$', align: 'center',title: ''}
, {
field: 'settle$',
@@ -116,9 +114,13 @@
event: 'more',
hide: false
}
- , {field: 'user$', align: 'center', title: '涓氬姟鍛�'}
- , {field: 'updateUserId$', align: 'center', title: '鏇存柊浜哄憳'}
- , {field: 'checkDataStatus$', align: 'center', title: '鎶ヤ环鏁版嵁'}
+ , {field: 'settleSize', align: 'center', title: '娴佺▼闀垮害', hide: true}
+ , {field: 'user$', align: 'center', title: '涓氬姟鍛�', hide: false}
+ , {field: 'deptId$', align: 'center', title: '閮ㄩ棬', hide: true}
+ , {field: 'checkDataStatus$', align: 'center', title: '鎶ヤ环鏁版嵁', hide: false}
+ , {field: 'createTime$', align: 'center', title: '鍒涘缓鏃堕棿', hide: true}
+ , {field: 'updateUserId$', align: 'center', title: '鏇存柊浜哄憳', hide: false}
+ , {field: 'updateTime$', align: 'center', title: '鏇存柊鏃堕棿', hide: false}
, {fixed: 'right', title: '鎿嶄綔', align: 'center', toolbar: '#operate', width: 350}
]],
request: {
@@ -174,6 +176,9 @@
switch (obj.event) {
case 'addBlank':
showEditModel();
+ break;
+ case 'addBlank2':
+ showEditModel2();
break;
case 'refreshData':
tableIns.reload({
@@ -266,6 +271,7 @@
title: data.name
}, function (i) {
layer.close(i);
+ console.log(data)
approvalEnd(data.id);
});
break;
@@ -276,13 +282,14 @@
offset: '200px',
title: data.name
}, function (i) {
+ console.log(data)
layer.close(i);
- // 鎸囧畾瑙勫垝鍛�
- if (data.settle === 2) {
+ // 鎸囧畾妯℃澘
+ if ((data.settle === 1 && data.settleSize===3) || (data.settle===2 && data.settleSize===4)) {
admin.open({
type: 1,
area: '300px',
- title: '閫夋嫨瑙勫垝鍛�',
+ title: '閫夋嫨鎶ヤ环妯℃澘',
content: $('#plannerListDialog').html(),
success: function (layero, dIndex) {
let plannerSel = xmSelect.render({
@@ -543,6 +550,42 @@
});
}
+ /* 寮圭獥 - 鏂板銆佷慨鏀� */
+ function showEditModel2(mData) {
+ admin.open({
+ type: 1,
+ area: '800px',
+ title: '鎺ュ彇' + '鏍镐环',
+ content: $('#editDialogHJ').html(),
+ success: function (layero, dIndex) {
+ let loadNameXml = loadNameXmlSel()
+ form.val('detailHJ', mData);
+ form.on('submit(editSubmitHJ)', function (data) {
+ data.field.id = loadNameXml.getValue()[0] ? loadNameXml.getValue()[0].id : null;
+ $.ajax({
+ url: baseUrl+"/priOnline2/HJ/add/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: data.field,
+ method: 'POST',
+ success: function (res) {
+ if (res.code === 200){
+ layer.close(dIndex);
+ layer.msg(res.msg, {icon: 1});
+ tableReload()
+ } else if (res.code === 403){
+ top.location.href = baseUrl+"/";
+ }else {
+ layer.msg(res.msg, {icon: 2});
+ }
+ }
+ })
+ });
+ $(layero).children('.layui-layer-content').css('overflow', 'visible');
+ layui.form.render('select');
+ }
+ });
+ }
+
//鏇存柊form
function showEditForm(mData) {
admin.open({
@@ -581,10 +624,11 @@
}
});
}
- function approvalEnd(planId, plannerId, dIdx) {
+
+ function approvalEnd(priOnlineId, plannerId, dIdx) {
let loadIndex = layer.load(2);
$.ajax({
- url: baseUrl+"/priOnline2/approvalEnd/auth",
+ url: baseUrl + "/priOnline2/approvalEnd/auth",
headers: {'token': localStorage.getItem('token')},
data: {
priOnlineId: priOnlineId,
@@ -596,11 +640,11 @@
layer.close(dIdx);
}
layer.close(loadIndex);
- if (res.code === 200){
+ if (res.code === 200) {
layer.msg(res.msg, {icon: 1});
tableReload();
- } else if (res.code === 403){
- top.location.href = baseUrl+"/";
+ } else if (res.code === 403) {
+ top.location.href = baseUrl + "/";
} else {
layer.msg(res.msg, {icon: 2});
}
@@ -611,7 +655,7 @@
function approval(priOnlineId, plannerId, dIdx) {
let loadIndex = layer.load(2);
$.ajax({
- url: baseUrl+"/priOnline2/approval/auth",
+ url: baseUrl + "/priOnline2/approval/auth",
headers: {'token': localStorage.getItem('token')},
data: {
priOnlineId: priOnlineId,
@@ -623,11 +667,11 @@
layer.close(dIdx);
}
layer.close(loadIndex);
- if (res.code === 200){
+ if (res.code === 200) {
layer.msg(res.msg, {icon: 1});
tableReload();
- } else if (res.code === 403){
- top.location.href = baseUrl+"/";
+ } else if (res.code === 403) {
+ top.location.href = baseUrl + "/";
} else {
layer.msg(res.msg, {icon: 2});
}
@@ -635,16 +679,45 @@
})
}
+ window.loadNameXmlSel = function () {
+ return xmSelect.render({
+ el: '#nameXmlSel',
+ autoRow: true,
+ filterable: true,
+ remoteSearch: true,
+ clickClose: true,
+ radio: true,
+ remoteMethod: function (val, cb, show) {
+ $.ajax({
+ url: baseUrl + "/priOnline2/HJ/search/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: {
+ condition: val
+ },
+ method: 'POST',
+ success: function (res) {
+ if (res.code === 200) {
+ cb(res.data)
+ } else {
+ cb([]);
+ layer.msg(res.msg, {icon: 2});
+ }
+ }
+ });
+ }
+ });
+ }
+
});
// 鍏抽棴鍔ㄤ綔
-$(document).on('click','#data-detail-close', function () {
+$(document).on('click', '#data-detail-close', function () {
parent.layer.closeAll();
});
function tableReload(child) {
var searchData = {};
- $.each($('#search-box [name]').serializeArray(), function() {
+ $.each($('#search-box [name]').serializeArray(), function () {
searchData[this.name] = this.value;
});
(child ? parent.tableIns : tableIns).reload({
@@ -654,14 +727,14 @@
},
done: function (res, curr, count) {
if (res.code === 403) {
- top.location.href = baseUrl+"/";
+ top.location.href = baseUrl + "/";
}
- pageCurr=curr;
+ pageCurr = curr;
if (res.data.length === 0 && count !== 0) {
tableIns.reload({
where: searchData,
page: {
- curr: pageCurr-1
+ curr: pageCurr - 1
}
});
pageCurr -= 1;
@@ -675,9 +748,9 @@
for (var val in data) {
var find = el.find(":input[id='" + val + "']");
find.val(data[val]);
- if (showImg){
+ if (showImg) {
var next = find.next();
- if (next.get(0)){
+ if (next.get(0)) {
if (next.get(0).localName === "img") {
find.hide();
next.attr("src", data[val]);
@@ -697,13 +770,13 @@
function detailScreen(index) {
var detail = layer.getChildFrame('#data-detail', index);
- var height = detail.height()+60;
- if (height > ($(window).height()*0.9)) {
- height = ($(window).height()*0.9);
+ var height = detail.height() + 60;
+ if (height > ($(window).height() * 0.9)) {
+ height = ($(window).height() * 0.9);
}
layer.style(index, {
- top: (($(window).height()-height)/3)+"px",
- height: height+'px'
+ top: (($(window).height() - height) / 3) + "px",
+ height: height + 'px'
});
$(".layui-layer-shade").remove();
}
--
Gitblit v1.9.1