You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

93 lines
3.8 KiB

  1. /* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
  2. * Copyright (c) 2013-2018 北京泉江科技有限公司
  3. * 创建人:超级管理员
  4. * 日 期:2020-04-30 10:32
  5. * 描 述:合同管理
  6. */
  7. var acceptClick;
  8. var keyValue = request('keyValue');
  9. var bootstrap = function ($, learun) {
  10. "use strict";
  11. var page = {
  12. init: function () {
  13. $('.lr-form-wrap').lrscroll();
  14. page.bind();
  15. page.initData();
  16. },
  17. bind: function () {
  18. $('#ContractCategoryId').lrDataSourceSelect({ code: 'ContractCategory', value: 'id', text: 'name' });
  19. $('#EmpId').lrDataSourceSelect({
  20. code: 'EmpInfo', value: 'empid', text: 'empname', select: function (item) {
  21. if (!!item) {
  22. console.log(item);
  23. $('#F_CompanyId').lrselectSet(item.f_companyid);
  24. $('#F_DepartmentId').lrselectSet(item.f_departmentid);
  25. $('#TitleOfTechPostNo').val(item.titleoftechpostno);
  26. $('#FictitiousRetireTime').val(item.fictitiousretiretime);
  27. }
  28. }
  29. });
  30. //校区
  31. $('#F_CompanyId').lrDataSourceSelect({
  32. code: 'company', value: 'f_companyid', text: 'f_fullname',
  33. select: function (item) {
  34. if (!!item) {
  35. // 部门
  36. $('#F_DepartmentId').lrselectRefresh({
  37. type: 'tree',
  38. // 是否允许搜索
  39. allowSearch: true,
  40. // 访问数据接口地址
  41. url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTree',
  42. // 访问数据接口参数
  43. param: { companyId: item.f_companyid, parentId: '0' }
  44. });
  45. }
  46. }
  47. });
  48. // 部门选择
  49. $('#F_DepartmentId').lrselect();
  50. $('#ProbationPeriod').lrDataItemSelect({ code: 'ProbationPeriod' });
  51. $('#ContractDeadline').lrDataItemSelect({ code: 'ContractDeadline' });
  52. $('#SalaryStandardUnit').lrDataItemSelect({ code: 'SalaryStandardUnit' });
  53. $('#OperateUserId').lrselect({
  54. allowSearch: true,
  55. url: top.$.rootUrl + '/PersonnelManagement/ContractManagement/GetUserList',
  56. value: "F_UserId",
  57. text: "F_RealName"
  58. });
  59. $('#OperateUserId').lrselectSet(learun.clientdata.get(['userinfo']).userId);
  60. },
  61. initData: function () {
  62. if (!!keyValue) {
  63. $.lrSetForm(top.$.rootUrl + '/PersonnelManagement/ContractManagement/GetFormData?keyValue=' + keyValue, function (data) {
  64. for (var id in data) {
  65. if (!!data[id].length && data[id].length > 0) {
  66. $('#' + id).jfGridSet('refreshdata', data[id]);
  67. }
  68. else {
  69. $('[data-table="' + id + '"]').lrSetFormData(data[id]);
  70. }
  71. }
  72. });
  73. }
  74. }
  75. };
  76. // 保存数据
  77. acceptClick = function (callBack) {
  78. if (!$('body').lrValidform()) {
  79. return false;
  80. }
  81. var postData = {
  82. strEntity: JSON.stringify($('body').lrGetFormData())
  83. };
  84. $.lrSaveForm(top.$.rootUrl + '/PersonnelManagement/ContractManagement/SaveForm?keyValue=' + keyValue, postData, function (res) {
  85. // 保存成功后才回调
  86. if (!!callBack) {
  87. callBack();
  88. }
  89. });
  90. };
  91. page.init();
  92. }