userList.html 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  1. <!-- 用户管理页面 -->
  2. <div id="userList" class="plg-tab-container">
  3. <style>
  4. #usermanager_grid>div .layui-tab { margin-top: 0px;}
  5. </style>
  6. <div class="layui-carousel" id="usermanager_grid" style="margin-bottom: -15px;">
  7. <div carousel-item>
  8. <div id="usermanager_grid_01" class="grid-container-full"></div>
  9. <div id="usermanager_grid_01_edit" class="grid-container-full" style="min-height: 550px;">
  10. <div class="layui-row">
  11. <div class="layui-col-lg12">
  12. <div class="tc-title">
  13. <a href="#" id="usermanager_btn_back" class="back-link"><i class="layui-icon layui-icon-return"></i></a>
  14. <span id="usermanager_span_title"></span>
  15. </div>
  16. </div>
  17. </div>
  18. <div class="layui-row layui-col-space15" style="margin: 20px;">
  19. <div class="layui-col-lg12 tc-panel" style="min-height: 300px;">
  20. <div id="usermanager_grid_sub" style="min-height: 450px;"></div>
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25. <div id="usermanager_treeContent" class="usermanager_treeContent" style="display:none; position: absolute; background-color: #fff; border: 1px #ddd solid; z-index: 99999999; height: auto; min-height: 100px; max-height: 300px; overflow: auto">
  26. <ul id="usermanager_treeC" name="usermanager_treeC" style="margin-top:0; width:200px;"></ul>
  27. </div>
  28. </div>
  29. </div>
  30. <script>
  31. /**
  32. * jiw
  33. * 2018.10.29
  34. * 用户管理界面
  35. */
  36. (function () {
  37. var param = { "pageNum": 1, "pageSize": 10 };
  38. var grid = null, grid3 = null;
  39. var grid_wnd_0 = null;
  40. var form1 = null, tmp_gridrow_id = 0;
  41. var m = $(document.body).height();
  42. var stepindex = 0;
  43. gridInit(0);
  44. //滑屏
  45. var carousel = layui.carousel;
  46. var car = carousel.render({
  47. elem: "#usermanager_grid",
  48. autoplay: false,
  49. index: 0,
  50. arrow: "none",
  51. indicator: "none",
  52. anim: "fade",
  53. width: "100%", //设置容器宽度
  54. height: "100%"
  55. });
  56. function changePanel(name) {
  57. car.slide(name);
  58. }
  59. //返回主页面
  60. $("#usermanager_btn_back").click(function () {
  61. changePanel("usermanager_grid_01");
  62. return false;
  63. });
  64. //主页面Grid
  65. function gridInit(type) {
  66. //用户管理
  67. if (type === 0) {
  68. var gridOpts = {
  69. skin: "terrace",
  70. rowId: "p_id",
  71. columns: [
  72. { id: "p_id", name: "id", type: "ro", width: 100, hidden: true },
  73. { id: "p_workernumber", name: "员工号", type: "ro", width: 100 },
  74. { id: "p_username", name: "用户账号", type: "ro", width: 100 },
  75. { id: "p_nickname", name: "用户名称", type: "ro", width: 100 },
  76. { id: "p_phone", name: "电话号码", type: "ro", width: 100 },
  77. { id: "p_email", name: "电子邮件", type: "ro", width: "*" },
  78. { id: "p_frozen", name: "冻结状态", type: "ch", width: 80 },
  79. {
  80. id: "op", name: "操作", type: "button", align: "center", width: 280, render: function () {
  81. return "重置密码^res_userManage_restClick,修改^res_userManage_editClick,删除^res_userManage_delClick,分配系统^res_userManage_edit1Click";
  82. }
  83. }
  84. ],
  85. multiselect: false,
  86. toolbar: [
  87. {
  88. type: "input",
  89. name: "search",
  90. label: "查询条件:",
  91. placeholder: "账号,名称,手机号",
  92. offsetLeft: 10
  93. }, { type: "newcolumn" },
  94. { type: "button", name: "btn_search", value: "查询" },
  95. { type: "newcolumn" },
  96. { type: "newcolumn" },
  97. {
  98. type: "button",
  99. name: "btn_add2",
  100. className: "plg-toolbar-right",
  101. value: "<i class='layui-icon layui-icon-add-1'></i>批量新增"
  102. }, { type: "newcolumn" },
  103. {
  104. type: "button",
  105. name: "btn_add",
  106. className: "plg-toolbar-right",
  107. offsetLeft: 20,
  108. value: "<i class='layui-icon layui-icon-add-1'></i>新增用户"
  109. }, { type: "newcolumn" }
  110. ],
  111. imagePath: "/prologui/assets/PlgGrid",
  112. url: '/api/service-users/user/getPlgFxUserPage/v1.0',
  113. type: "post",
  114. params: param,
  115. contentType: "application/x-www-form-urlencoded",
  116. page: true,
  117. totalCount: "totalCount"
  118. };
  119. grid = new PlgGrid(gridOpts);
  120. grid.renderTo("usermanager_grid_01");
  121. grid.loadData();
  122. //工具栏按钮事件
  123. grid.attachToolBarEvent("onButtonClick", function (name) {
  124. // 查询
  125. if (name === "btn_search") {
  126. grid.setParams(grid.getToolBarForm().getFormData());
  127. grid.reload();
  128. }
  129. // 新增
  130. else if (name === "btn_add") {
  131. adduser();
  132. }
  133. else if (name === "btn_add2") {
  134. addUser();
  135. }
  136. });
  137. // 双击行
  138. grid.on("onRowDblClicked", function () {
  139. show_userinfo(grid.getSelectedRowId(), grid.getSelectedRowData());
  140. });
  141. }
  142. }
  143. //批量新增用户信息
  144. function addUser() {
  145. var gridopt = {
  146. skin: "terrace",
  147. rowId: "p_id",
  148. columns: [
  149. { id: "p_id", name: "id", type: "ro", hidden: true },
  150. { id: "p_nickname", name: "用户名称", type: "ed" },
  151. { id: "p_username", name: "用户账号", type: "ed" },
  152. { id: "p_email", name: "Email", type: "ed" },
  153. { id: "p_phone", name: "电话号码", type: "ed" }
  154. ],
  155. multiselect: false,
  156. imagePath: "/prologui/assets/PlgGrid",
  157. // url: "/api/service-users/",
  158. url: "/api/service-users/user/usergroup/allotUserGroup/v1.0",
  159. type: "post",
  160. contentType: "Application/json",
  161. params: {},
  162. page: false
  163. };
  164. var wnd_opt = {
  165. title: "批量新增用户",
  166. shadeClose: true,
  167. area: ['950px', '550px'],
  168. btn: '保存',
  169. btnAlign: 'r',
  170. content: '<div id="usermanager_grid_02_1" style="height:420px"></div>',
  171. yes: function (index) {
  172. param = [];
  173. for (var i = 0; i < grid3.getGrid().getRowsNum(); i++) {
  174. if (grid3.getCellVaule2(i, 2).length > 1 && grid3.getCellVaule2(i, 3).length > 1) {
  175. param.push({
  176. "p_nickname": grid3.getCellVaule((i + 1), 2),
  177. "p_username": grid3.getCellVaule((i + 1), 3),
  178. "p_email": grid3.getCellVaule((i + 1), 4),
  179. "p_phone": grid3.getCellVaule((i + 1), 5),
  180. "p_enable": 1
  181. });
  182. }
  183. }
  184. if (param.length < 1) return false;
  185. layer.msg("数据处理中...");
  186. Prolog.ajax({
  187. url: "/api/service-users/user/batchInsertPlgFxUser/v1.0",
  188. type: "post",
  189. contentType: "Application/json",
  190. data: JSON.stringify(param),
  191. success: function (data) {
  192. if (typeof data != "object") data = JSON.parse(data);
  193. if (data.success) {
  194. layer.closeAll();
  195. }
  196. else {
  197. layer.open({
  198. type: 1, offset: "auto", id: 'layerError', title: "错误提示"
  199. , area: ["500px"], content: '<div style="padding: 10px;">' + data.message + '</div>'
  200. , btn: '关闭', btnAlign: 'r', shade: 0
  201. , yes: function () {
  202. layer.closeAll();
  203. }
  204. });
  205. }
  206. },
  207. error: function () {
  208. }
  209. });
  210. },
  211. success: function () {
  212. grid3 = new PlgGrid(gridopt);
  213. grid3.renderTo("usermanager_grid_02_1");
  214. grid3.loadData({
  215. "success": true, "message": "成功", "code": "200", "data":
  216. {
  217. "list":
  218. [{ "p_id": 1, "p_enable": 1 }, { "p_id": 2, "p_enable": 1 }, {
  219. "p_id": 3,
  220. "p_enable": 1
  221. }, { "p_id": 4, "p_enable": 1 }, { "p_id": 5, "p_enable": 1 },
  222. { "p_id": 6, "p_enable": 1 }, { "p_id": 7, "p_enable": 1 }, {
  223. "p_id": 8,
  224. "p_enable": 1
  225. }, { "p_id": 9, "p_enable": 1 }, { "p_id": 10, "p_enable": 1 }]
  226. }
  227. });
  228. }
  229. };
  230. PlgDialog.open(wnd_opt);
  231. }
  232. //组织机构
  233. var rsp_tree = [], treeDown;
  234. Prolog.ajax({
  235. // url: '/api/service-users/user/getPlgFxUserPage/v1.0',
  236. url: "/api/service-users/organization/getPlgFxOrganizationById/v1.0",
  237. type: "post",
  238. contentType: "application/x-www-form-urlencoded",
  239. data: {},
  240. success: function (data) {
  241. if (data.success) {
  242. for (var i = 0; i < data.data.length; i++) {
  243. rsp_tree.push({
  244. id: data.data[i].p_organizationid,
  245. name: data.data[i].p_name,
  246. menuId: data.data[i].p_organizationid,
  247. parentMenuId: (data.data[i].p_fatherid === null) ? "0" : data.data[i].p_fatherid
  248. });
  249. }
  250. var treecfg = {
  251. renderer: "usermanager_treeC",
  252. setData: rsp_tree,
  253. skin: "menu-tree",
  254. toolBar: false,
  255. delMenu: null,
  256. setting: {
  257. callback: {
  258. //单击事件的回调
  259. onClick: function (event, treeId, treeNode) {
  260. if (!treeNode.isParent) {
  261. form1.getDForm().setItemValue("p_cname", treeNode.name);
  262. form1.getDForm().setItemValue("p_companyid", treeNode.id);
  263. $("#usermanager_treeContent").fadeOut("fast");
  264. }
  265. }
  266. }
  267. }
  268. }
  269. treeDown = new PlgZtree(treecfg);
  270. treeDown.treeObj.expandAll(true);
  271. }
  272. },
  273. error: function () {
  274. }
  275. });
  276. $("body").bind("mousedown", function (event) {
  277. if (!(event.target.name == "p_cname" || event.target.id == "usermanager_treeContent" || $(event.target).parents("#usermanager_treeContent").length > 0)) {
  278. $("#usermanager_treeContent").fadeOut("fast");
  279. }
  280. });
  281. //添加用户
  282. function adduser() {
  283. stepindex = 0;
  284. var str = `<div class="layui-col-lg12 tc-15-step" id="usermanager_grid_useradd_main">
  285. <ol>
  286. <li class="succeed">
  287. <div class="tc-15-step-name"><span class="tc-15-step-num">1</span>填写用户信息</div>
  288. <div class="tc-15-step-arrow"></div>
  289. </li>
  290. <li class="disabled">
  291. <div class="tc-15-step-name"><span class="tc-15-step-num">2</span>分配系统</div>
  292. <div class="tc-15-step-arrow"></div>
  293. </li>
  294. <li class="disabled">
  295. <div class="tc-15-step-name"><span class="tc-15-step-num">3</span>完成</div>
  296. <div class="tc-15-step-arrow"></div>
  297. </li>
  298. </ol>
  299. </div>
  300. <div class="layui-col-lg12" style="min-height: 280px;">
  301. <div id="usermanager_grid_useradd_content"></div>
  302. </div>
  303. <div class="layui-col-lg12 button-ft">
  304. <button class="layui-btn layui-btn-sm layui-btn-normal" id="useradd_btn_next">下一步</button>
  305. </div>`;
  306. $("#usermanager_grid_sub").html(str);
  307. $("#useradd_btn_next").show();
  308. $("ol li").each(function () {
  309. if ($(this).index() === 0) {
  310. $(this).removeClass("disabled");
  311. $(this).addClass("succeed");
  312. }
  313. else {
  314. $(this).removeClass("succeed");
  315. $(this).addClass("disabled");
  316. }
  317. });
  318. userFormInit(0, {});
  319. changePanel("usermanager_grid_01_edit");
  320. $("#usermanager_grid_useradd_content").height((m > 530) ? m - 400 : m);
  321. $("#usermanager_grid_sub").width("100%");
  322. $("#usermanager_grid_01_edit .tc-panel").attr("style", "min-height: 400px;");
  323. $("#useradd_btn_next").click(function () {
  324. if (stepindex === 0) {
  325. var b = form1.validate();
  326. if (!b) return;
  327. var fd = form1.getFormData();
  328. var rdata = save_userinfo(grid, "/api/service-users/user/insertPlgFxUser/v1.0", "post", "application/x-www-form-urlencoded", fd);
  329. if (rdata.success === false) {
  330. layer.msg(rdata.message);
  331. return;
  332. }
  333. tmp_gridrow_id = rdata.p_id;
  334. $("#usermanager_grid_useradd_content").html("");
  335. userSystemInit(0, rdata);
  336. }
  337. else if (stepindex === 1) {
  338. //var b = save_system(0);
  339. //if (b) {
  340. $("#usermanager_grid_useradd_content").html("<h1>用户新增成功,3秒后返回!</h1>");
  341. grid.reload();
  342. $("#useradd_btn_next").hide();
  343. //layer.msg("用户新增成功,3秒后返回!");
  344. setTimeout(function () { changePanel("usermanager_grid_01"); }, 3000);
  345. //}
  346. ////console.log(b);
  347. }
  348. stepindex++;
  349. $("ol li").each(function () {
  350. if (stepindex === $(this).index()) {
  351. $(this).removeClass("disabled");
  352. $(this).addClass("succeed");
  353. }
  354. });
  355. });
  356. }
  357. //用户表单
  358. function userFormInit(ntype, rdata) {
  359. var tit = "新增用户";
  360. var rediv = "usermanager_grid_useradd_content";
  361. if (ntype === 1) {
  362. tit = "用户 [" + rdata.p_nickname + "] 信息修改";
  363. rediv = "usermanager_grid_sub";
  364. }
  365. $("#usermanager_span_title").html(tit);
  366. $("#" + rediv).html("");
  367. var formcfg = {
  368. renderer: rediv,
  369. items: [
  370. { type: "settings", inputWidth: 140, width: 550, labelWidth: 80, position: "label-left", labelAlign: "left" },
  371. {
  372. type: "block", width: 520,
  373. list: [
  374. { type: "input", name: "p_username", label: "用户账号:", editable: false, validate: "NotEmpty", required: true },
  375. { type: "newcolumn", offset: 40 },
  376. { type: "input", name: "p_nickname", label: "用户姓名:", validate: "NotEmpty", required: true }]
  377. },
  378. {
  379. type: "block", width: 520,
  380. list: [
  381. { type: "input", name: "p_workernumber", label: "员工号:", editable: false },
  382. { type: "newcolumn", offset: 40 },
  383. { type: "input", name: "p_cname", label: "所属机构:", readonly: true }]
  384. },
  385. {
  386. type: "block", width: 520,
  387. list: [
  388. { type: "input", name: "p_phone", label: "联系电话:" },
  389. { type: "newcolumn", offset: 40 },
  390. { type: "input", name: "p_email", label: "Email:" }]
  391. },
  392. {
  393. type: "block", width: 520,
  394. list: [{ type: "checkbox", name: "p_frozen", label: "冻结状态:" }, { type: "hidden", name: "p_enable", value: 1 }, { type: "hidden", name: "p_id" }, { type: "hidden", name: "p_companyid" }]
  395. },
  396. {
  397. type: "block", width: 520, list: [
  398. { type: "button", name: "btn_save_userinfo", offsetLeft: 80, value: "保存", hidden: (ntype != 1) }
  399. ]
  400. }
  401. ]
  402. };
  403. form1 = new PlgForm(formcfg);
  404. form1.setFormData(rdata);
  405. if (ntype === 1) {
  406. form1.getDForm().disableItem("p_username");
  407. var node = treeDown.treeObj.getNodeByParam("id", rdata.p_companyid);
  408. if (node != null) {
  409. $(form1.getDForm().getInput("p_cname")).val(node.name);
  410. treeDown.treeObj.selectNode(node);
  411. }
  412. }
  413. form1.attachEvent("onButtonClick", function (name) {
  414. if (name === "btn_save_userinfo") {
  415. var fd = form1.getFormData();
  416. save_userinfo(grid, "/api/service-users/user/updatePlgFxUser/v1.0", "put", "application/x-www-form-urlencoded", fd);
  417. }
  418. });
  419. form1.attachEvent("onFocus", function (name) {
  420. if (name === "p_cname") {
  421. var inputOffset = $(form1.getDForm().getInput("p_cname")).offset();
  422. $("#usermanager_treeContent").css({
  423. left: (inputOffset.left - 230) + "px",
  424. top: (inputOffset.top - 60) + "px"
  425. }).slideDown("fast");
  426. }
  427. });
  428. }
  429. //用户分配系统
  430. function userSystemInit(ntype, rdata) {
  431. var rediv = "usermanager_grid_useradd_content";
  432. param.type = 0;
  433. var tbar = [
  434. {
  435. type: "input",
  436. name: "search",
  437. label: "查询条件:",
  438. placeholder: "名称",
  439. offsetLeft: 10
  440. }, { type: "newcolumn" },
  441. {
  442. type: "combo",
  443. name: "type",
  444. label: "状态:",
  445. offsetLeft: 10,
  446. width: 130,
  447. options: [{ text: "未分配", value: "0" }, { text: "已分配", value: "1" }],
  448. hidden: (ntype === 0)
  449. }, { type: "newcolumn" },
  450. { type: "button", name: "btn_search", offsetLeft: 20, value: "查询" }, { type: "newcolumn" },
  451. { type: "button", name: "btn_save", offsetLeft: 10, value: "保存" }
  452. ];
  453. if (ntype === 1) {
  454. rediv = "usermanager_grid_sub";
  455. //param.type = 1;
  456. }
  457. $("#" + rediv).html("");
  458. param.userid = rdata.p_id;
  459. var gridopt = {
  460. skin: "terrace",
  461. rowId: "p_id",
  462. columns: [
  463. { id: "p_id", name: "id", type: "ro", hidden: true },
  464. { id: "p_systemid", name: "编号", type: "ro", width: 200 },
  465. { id: "p_systemname", name: "名称", type: "ro", width: "*" }
  466. ],
  467. toolbar: tbar,
  468. multiselect: true,
  469. imagePath: "/prologui/assets/PlgGrid",
  470. url: "/api/service-users/user/getAllocatedSystem/v1.0",
  471. type: "post",
  472. contentType: "application/x-www-form-urlencoded",
  473. params: param,
  474. page: true,
  475. totalCount: "totalCount"
  476. };
  477. grid_wnd_0 = new PlgGrid(gridopt);
  478. grid_wnd_0.renderTo(rediv);
  479. grid_wnd_0.loadData();
  480. if (ntype === 1) {
  481. grid_wnd_0.attachToolBarEvent("onButtonClick", function (name) {
  482. // 查询
  483. if (name === "btn_search") {
  484. var p = grid_wnd_0.getToolBarForm().getFormData();
  485. p.pageNum = 1;
  486. p.pageSize = 10;
  487. p.userid = rdata.p_id;
  488. grid_wnd_0.setParams(p);
  489. grid_wnd_0.reload();
  490. }
  491. else if (name === "btn_save") {
  492. save_system(1);
  493. }
  494. });
  495. grid_wnd_0.getToolBarForm().getCombo("type").attachEvent("onChange", function (v, t) {
  496. var p = grid_wnd_0.getToolBarForm().getFormData();
  497. p.pageNum = 1;
  498. p.pageSize = 10;
  499. p.userid = rdata.p_id;
  500. grid_wnd_0.setParams(p);
  501. grid_wnd_0.reload();
  502. });
  503. }
  504. }
  505. //用户信息保存
  506. function save_userinfo(grid, url, type, contentType, formData) {
  507. var rep = null;
  508. Prolog.ajax({
  509. url: url,
  510. type: type,
  511. contentType: contentType,
  512. data: formData,
  513. async: false,
  514. success: function (data) {
  515. if (data.success) {
  516. if (type === "put")
  517. layer.msg("保存成功!");
  518. grid.reload();
  519. rep = data.data;
  520. }
  521. else {
  522. rep = data;
  523. }
  524. },
  525. error: function () {
  526. }
  527. });
  528. return rep;
  529. }
  530. //分配系统保存
  531. function save_system(ntype) {
  532. var par, type, rsp = null;
  533. (ntype === 0) ? type = "0" : type = grid_wnd_0.getToolBarForm().getFormData().type;
  534. if (type === "0") {
  535. par = { "type": "1", "userid": tmp_gridrow_id, "systemids": grid_wnd_0.getCheckedIds() };
  536. }
  537. else if (type === "1") {
  538. par = { "type": "0", "userid": tmp_gridrow_id, "systemids": grid_wnd_0.getCheckedIds() };
  539. }
  540. if (grid_wnd_0.getCheckedIds() === "") return rsp;
  541. layer.msg("数据处理中...");
  542. Prolog.ajax({
  543. url: "/api/service-users/user/allotSystem/v1.0",
  544. type: "post",
  545. contentType: "application/json",
  546. data: JSON.stringify(par),
  547. async: false,
  548. success: function (data) {
  549. if (typeof data != "object") data = JSON.parse(data);
  550. if (data.success) {
  551. layer.closeAll();
  552. if (ntype === 1) {
  553. grid_wnd_0.reload();
  554. grid.reload();
  555. }
  556. rsp = data;
  557. }
  558. else {
  559. layer.open({
  560. type: 1, offset: "auto", id: 'layerError', title: "错误提示"
  561. , area: ["500px"], content: '<div style="padding: 10px;">' + data.message + '</div>'
  562. , btn: '关闭', btnAlign: 'r', shade: 0
  563. , yes: function () {
  564. layer.closeAll();
  565. }
  566. });
  567. rsp = null;
  568. }
  569. },
  570. error: function () {
  571. }
  572. });
  573. return rsp;
  574. }
  575. //查看用户详细
  576. function show_userinfo(rid, rdata) {
  577. grid.selectRowById(rid);
  578. $("#usermanager_span_title").html("用户 [" + rdata.p_nickname + "] 信息查看");
  579. var str = `<ul>
  580. <li><span class='span-item-tit'>姓名</span>
  581. <span class='span-item-txt'>` + ((rdata.p_nickname === null) ? "" : rdata.p_nickname) + `</sapn></li>
  582. <li><span class='span-item-tit'>用户名</span>
  583. <span class='span-item-txt'>` + ((rdata.p_username === null) ? "" : rdata.p_username) + `</span></li>
  584. <li><span class='span-item-tit'>员工号</span>
  585. <span class='span-item-txt'>` + ((rdata.p_workernumber === null) ? "" : rdata.p_workernumber) + `</span></li>
  586. <li><span class='span-item-tit'>所属机构</span>
  587. <span class='span-item-txt'>` + ((rdata.p_companyid === null) ? "" : rdata.p_companyid) + `</span></li>
  588. <li><span class='span-item-tit'>电话</span>
  589. <span class='span-item-txt'>` + ((rdata.p_phone === null) ? "" : rdata.p_phone) + `</span></li>
  590. <li><span class='span-item-tit'>邮箱</span>
  591. <span class='span-item-txt'>` + ((rdata.p_email === null) ? "" : rdata.p_email) + `</span></li>
  592. <li><span class='span-item-tit'>是否在线</span>
  593. <span class='span-item-txt'>` + ((rdata.p_online === 0) ? "离线" : "在线") + `</span></li>
  594. <li><span class='span-item-tit'>是否冻结</span>
  595. <span class='span-item-txt'>` + ((rdata.p_frozen === 0) ? "正常" : "已冻结") + `</span></li>
  596. <li><span class='span-item-tit'>是否启用</span>
  597. <span class='span-item-txt'>` + ((rdata.p_enable === 0) ? "启用" : "停用") + `</span></li>
  598. <li><span class='span-item-tit'>创建人</span>
  599. <span class='span-item-txt'>` + ((rdata.p_creatorname === null) ? "" : rdata.p_creatorname) + `</span></li>
  600. <li><span class='span-item-tit'>创建时间</span>
  601. <span class='span-item-txt'>` + ((rdata.p_createtime === null) ? "" : rdata.p_createtime) + `</span></li>
  602. <li><span class='span-item-tit'>修改人</span>
  603. <span class='span-item-txt'>` + ((rdata.p_modifiername === null) ? "" : rdata.p_modifiername) + `</span></li>
  604. <li><span class='span-item-tit'>修改时间</span>
  605. <span class='span-item-txt'>` + ((rdata.p_lastmodifytime === null) ? "" : rdata.p_lastmodifytime) + `</span></li>
  606. </ul>`;
  607. $("#usermanager_grid_sub").html(str);
  608. changePanel("usermanager_grid_01_edit");
  609. }
  610. window.res_userManage_restClick = function (rid, rdata) {
  611. if (rid === null) {
  612. PlgDialog.msg("请选择行!");
  613. return;
  614. }
  615. Prolog.ajax({
  616. url: "/api/service-users/user/resetPassword/v1.0",
  617. type: "post",
  618. contentType: "application/x-www-form-urlencoded",
  619. data: { "id": rid, "username": rdata.p_username },
  620. success: function (data) {
  621. if (typeof data != "object") data = JSON.parse(data);
  622. if (data.success) {
  623. layer.closeAll();
  624. PlgDialog.msg("密码已重置!");
  625. }
  626. else {
  627. layer.open({
  628. type: 1
  629. , offset: "auto"
  630. , id: 'layerDemo'
  631. , title: "错误提示"
  632. , content: '<div style="padding: 10px;">' + data.message + '</div>'
  633. , btn: '关闭'
  634. , btnAlign: 'r'
  635. , shade: 0
  636. , yes: function () {
  637. layer.closeAll();
  638. }
  639. });
  640. }
  641. },
  642. error: function () {
  643. }
  644. });
  645. return false;
  646. };
  647. window.res_userManage_delClick = function (rid, rdata) {
  648. Prolog.delGridRowData(grid, "/api/service-users/user/deletePlgFxUserById/v1.0", "", "", { "id": rid }, false);
  649. return false;
  650. };
  651. window.res_userManage_editClick = function (rid, rdata) {
  652. grid.selectRowById(rid);
  653. userFormInit(1, rdata);
  654. changePanel("usermanager_grid_01_edit");
  655. return false;
  656. };
  657. window.res_userManage_edit1Click = function (rid, rdata) {
  658. grid.selectRowById(rid);
  659. tmp_gridrow_id = rid;
  660. $("#usermanager_span_title").html("用户 [" + rdata.p_nickname + "] 分配系统");
  661. userSystemInit(1, rdata);
  662. changePanel("usermanager_grid_01_edit");
  663. $("#usermanager_grid_sub").width("100%");
  664. $("#usermanager_grid_sub").height((m > 530) ? m - 260 : m);
  665. return false;
  666. };
  667. })();
  668. </script>