From 7f9d058a0e632be6a3daf6f46d26b69742db0720 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期三, 08 十一月 2023 13:13:25 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/zycrm' into zycrm
---
src/main/webapp/static/js/priOnline/priOnline.js | 88 ++++++++++++++++++++++++++++++++++++++-----
1 files changed, 77 insertions(+), 11 deletions(-)
diff --git a/src/main/webapp/static/js/priOnline/priOnline.js b/src/main/webapp/static/js/priOnline/priOnline.js
index abc3432..1a53bac 100644
--- a/src/main/webapp/static/js/priOnline/priOnline.js
+++ b/src/main/webapp/static/js/priOnline/priOnline.js
@@ -1,5 +1,6 @@
var pageCurr;
var admin;
+var treeCond;
layui.config({
base: baseUrl + "/static/layui/lay/modules/"
}).extend({
@@ -9,8 +10,66 @@
var $ = layui.jquery;
var layer = layui.layer;
var layDate = layui.laydate;
+ var tree = layui.tree;
var form = layui.form;
+ var dropdown = layui.dropdown;
admin = layui.admin;
+
+ $('#organization').html(localStorage.getItem('nickname') + ' <i class="layui-icon"></i>');
+
+ // 閮ㄩ棬浜哄憳 绛涢��
+ dropdown.render({
+ elem: '#organization'
+ ,content: ['<div id="organizationTree" style="height: calc(100vh - 525px);border: none"></div>'].join('')
+ ,style: 'width: 370px; height: 350px; padding: 0 15px; box-shadow: 1px 1px 30px rgb(0 0 0 / 12%);'
+ ,ready: function(){
+ loadTree();
+ }
+ });
+
+ // 鏍戝舰鍥�
+ var organizationTree;
+ window.loadTree = function(condition){
+ var loadIndex = layer.load(2);
+ $.ajax({
+ url: baseUrl+"/dept/user/tree/auth",
+ headers: {'token': localStorage.getItem('token')},
+ data: {
+ 'condition': condition
+ },
+ method: 'POST',
+ success: function (res) {
+ layer.close(loadIndex);
+ if (res.code === 200){
+ organizationTree = tree.render({
+ elem: '#organizationTree',
+ id: 'organizationTree',
+ onlyIconControl: true,
+ data: res.data,
+ click: function (obj) {
+ treeCond = {
+ key: obj.data.key,
+ val: obj.data.id
+ }
+ $('#organization').html(obj.data.title + ' <i class="layui-icon"></i>');
+ $('#organizationTree').find('.ew-tree-click').removeClass('ew-tree-click');
+ $(obj.elem).children('.layui-tree-entry').addClass('ew-tree-click');
+ clearFormVal($('#search-box'));
+ tableIns.reload({
+ where: {[obj.data.key]: obj.data.id},
+ page: {curr: 1}
+ });
+ }
+ });
+ treeData = res.data;
+ } else if (res.code === 403){
+ top.location.href = baseUrl+"/";
+ } else {
+ layer.msg(res.msg)
+ }
+ }
+ })
+ }
// 鏁版嵁娓叉煋
tableIns = table.render({
@@ -24,10 +83,10 @@
cellMinWidth: 150,
cols: [[
{type: 'checkbox', fixed: 'left'}
- ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
- ,{field: 'templateName', align: 'center',title: '妯℃澘鍚�'}
- ,{field: 'orderNum', align: 'center',title: '璁㈠崟鍙�'}
- ,{field: 'itemId$', align: 'center',title: '椤圭洰鍚�'}
+ ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80,hide: true}
+ ,{field: 'templateName', align: 'center',title: '鏍镐环鍚�',hide: false}
+ ,{field: 'orderNum', align: 'center',title: '鏍镐环鍗曞彿'}
+ ,{field: 'planId$', align: 'center',title: '瑙勫垝鍗曞彿'}
,{field: 'createTime$', align: 'center',title: '鍒涘缓鏃堕棿'}
,{field: 'updateTime$', align: 'center',title: '鏇存柊鏃堕棿'}
,{field: 'status$', align: 'center',title: '鐘舵��'}
@@ -248,16 +307,23 @@
return;
}
+ let formData = new FormData($("#uploadFile")[0]);
+ formData.append("id", data.id);
+ formData.append("checkData", zip(exportJson.sheets));
$.ajax({
url: baseUrl+"/priOnline/uploadCheck/auth",
headers: {'token': localStorage.getItem('token')},
- data: JSON.stringify({
- id: data.id,
- checkData: zip(exportJson.sheets)
- }),
+ data: formData,
+ // data: JSON.stringify({
+ // id: data.id,
+ // checkData: zip(exportJson.sheets)
+ // }),
+ // dataType: "json",
method: 'POST',
- dataType: "json",
- contentType:'application/json;charset=UTF-8',
+ cache: false,
+ processData: false,
+ contentType: false,
+ // contentType:'application/json;charset=UTF-8',
success: function (res) {
if (res.code == 200) {
layer.msg('涓婁紶鎴愬姛',{time:1000},() => {
@@ -328,7 +394,7 @@
maxmin: true,
area: [top.detailWidth, top.detailHeight],
shadeClose: false,
- content: 'priOnline_detail.html?item_id=' + data.field.itemId + "&pri_id=" + data.field.priId,
+ content: 'priOnline_detail.html?item_id=' + data.field.planId + "&pri_id=" + data.field.priId,
success: function(layero, index){
clearFormVal(layer.getChildFrame('#detail', index));
// layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
--
Gitblit v1.9.1