SelfHoliday.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  1. MWF.xDesktop.requireApp("Attendance", "Explorer", null, false);
  2. MWF.xDesktop.requireApp("Selector", "package", null, false);
  3. MWF.xDesktop.requireApp("Template", "Explorer", null, false);
  4. MWF.xApplication.Attendance.SelfHoliday = new Class({
  5. Extends: MWF.xApplication.Attendance.Explorer,
  6. Implements: [Options, Events],
  7. initialize: function(node, app, actions, options){
  8. this.setOptions(options);
  9. this.app = app;
  10. this.path = "/x_component_Attendance/$SelfHoliday/";
  11. this.cssPath = "/x_component_Attendance/$SelfHoliday/"+this.options.style+"/css.wcss";
  12. this._loadCss();
  13. this.actions = actions;
  14. this.node = $(node);
  15. this.initData();
  16. if (!this.personActions) this.personActions = new MWF.xAction.org.express.RestActions();
  17. },
  18. load: function(){
  19. this.loadToolbar();
  20. this.loadFilter();
  21. this.loadContentNode();
  22. this.loadView();
  23. this.setNodeScroll();
  24. },
  25. loadFilter : function(){
  26. this.fileterNode = new Element("div.fileterNode", {
  27. "styles" : this.css.fileterNode
  28. }).inject(this.node);
  29. this._loadFilterContent();
  30. },
  31. exportExcel : function(){
  32. var exportForm = new MWF.xApplication.Attendance.SelfHoliday.ExportExcelForm( this );
  33. exportForm.edit();
  34. },
  35. _loadFilterContent : function(){
  36. var _self = this;
  37. var html = "<table bordr='0' cellpadding='5' cellspacing='0' styles='formTable' width='1350'>"+
  38. "<tr>" +
  39. " <td styles='formTableTitle' lable='q_topUnitName'></td>"+
  40. " <td styles='formTableValue' item='q_topUnitName'></td>"+
  41. " <td styles='formTableTitle' lable='q_unitName'></td>"+
  42. " <td styles='formTableValue' item='q_unitName'></td>"+
  43. " <td styles='formTableTitle' lable='q_empName'></td>"+
  44. " <td styles='formTableValue' item='q_empName'></td>"+
  45. " <td styles='formTableTitle' lable='startdateString'></td>"+
  46. " <td styles='formTableValue' item='startdateString'></td>"+
  47. " <td styles='formTableTitle' lable='enddateString'></td>"+
  48. " <td styles='formTableValue' item='enddateString'></td>"+
  49. " <td styles='formTableValue' item='action'></td>"+
  50. "</tr>" +
  51. "</table>";
  52. this.fileterNode.set("html",html);
  53. MWF.xDesktop.requireApp("Template", "MForm", function(){
  54. this.filter = new MForm( this.fileterNode, {}, {
  55. style : "filter",
  56. isEdited : true,
  57. itemTemplate : {
  58. q_topUnitName : { "text" : "选择公司", "type" : "org", "orgType" : "unit", style : {"min-width" : "200px"} },
  59. q_unitName : { "text" : "选择部门", "type" : "org", "orgType" : "unit", style : {"min-width" : "250px"} },
  60. q_empName : { "text" : "选择人员", "type" : "org", "orgType" : "person", style : {"min-width" : "100px"} },
  61. startdateString : { "text" : "开始日期", "tType" : "date",style : {"border" : "1px solid rgb(153, 153, 153)","background":'url("../x_component_Template/$MForm/default/icon/calendar.png") 98% center no-repeat',"border-radius":"3px","box-shadow":"rgb(204, 204, 204) 0px 0px 6px","height":"26px","width":"100px"} },
  62. enddateString : { "text" : "结束日期", "tType" : "date" ,style : {"border" : "1px solid rgb(153, 153, 153)","background":'url("../x_component_Template/$MForm/default/icon/calendar.png") 98% center no-repeat',"border-radius":"3px","box-shadow":"rgb(204, 204, 204) 0px 0px 6px","height":"26px","width":"100px"}},
  63. action : {
  64. "type" : "button",
  65. "value" : "查询",
  66. "event" : { "click" : function(){
  67. var filterData = _self.filter.getResult( true,",",true,true,true);
  68. this.loadView( filterData );
  69. }.bind(this)}
  70. }
  71. }
  72. }, this.app, this.css);
  73. this.filter.load();
  74. }.bind(this), true);
  75. },
  76. loadView : function( filterData ){
  77. this.elementContentNode.empty();
  78. this.view = new MWF.xApplication.Attendance.SelfHoliday.View(this.elementContentNode, this.app,this, this.viewData, this.options.searchKey );
  79. this.view.filterData = filterData;
  80. this.view.load();
  81. this.setContentSize();
  82. },
  83. createDocument: function(){
  84. if(this.view)this.view._createDocument();
  85. }
  86. });
  87. MWF.xApplication.Attendance.SelfHoliday.View = new Class({
  88. Extends: MWF.xApplication.Attendance.Explorer.View,
  89. _createItem: function(data){
  90. return new MWF.xApplication.Attendance.SelfHoliday.Document(this.table, data, this.explorer, this);
  91. },
  92. _getCurrentPageData: function(callback, count){
  93. //this.actions.listSelfHoliday(function(json){
  94. // if (callback) callback(json);
  95. //});
  96. if(!count )count=20;
  97. var id = (this.items.length) ? this.items[this.items.length-1].data.id : "(0)";
  98. var filter = this.filterData || {};
  99. this.actions.listSelfHolidayFilterNext(id, count, filter, function(json){
  100. if (callback) callback(json);
  101. });
  102. },
  103. _removeDocument: function(documentData, all){
  104. this.actions.deleteSelfHoliday(documentData.id, function(json){
  105. this.explorer.view.reload();
  106. this.app.notice(this.app.lp.deleteDocumentOK, "success");
  107. }.bind(this));
  108. },
  109. _createDocument: function(){
  110. var selfHoliday = new MWF.xApplication.Attendance.SelfHoliday.Form(this.explorer);
  111. selfHoliday.create();
  112. },
  113. _openDocument: function( documentData ){
  114. var selfHoliday = new MWF.xApplication.Attendance.SelfHoliday.Form(this.explorer, documentData );
  115. selfHoliday.open();
  116. }
  117. });
  118. MWF.xApplication.Attendance.SelfHoliday.Document = new Class({
  119. Extends: MWF.xApplication.Attendance.Explorer.Document
  120. });
  121. MWF.xApplication.Attendance.SelfHoliday.ExportExcelForm = new Class({
  122. Extends: MWF.xApplication.Attendance.Explorer.PopupForm,
  123. _createTableContent: function(){
  124. var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='formTable'>"+
  125. "<tr><td colspan='2' styles='formTableHead'>导出员工休假记录</td></tr>" +
  126. "<tr>" +
  127. " <td styles='formTableTitle' lable='startDate'></td>"+
  128. " <td styles='formTableValue' item='startDate'></td>"+
  129. "</tr>" +
  130. "<tr>" +
  131. " <td styles='formTableTitle' lable='endDate'></td>"+
  132. " <td styles='formTableValue' item='endDate'></td>"+
  133. //" <td styles='formTableValue' item='action'></td>"+
  134. "</tr>" +
  135. "</table>";
  136. this.formTableArea.set("html",html);
  137. MWF.xDesktop.requireApp("Template", "MForm", function(){
  138. this.form = new MForm( this.formTableArea, {q_empName : layout.desktop.session.user.distinguishedName }, {
  139. isEdited : true,
  140. itemTemplate : {
  141. startDate : { "text" : "开始日期", "tType" : "date" },
  142. endDate : { "text" : "结束日期", "tType" : "date" }
  143. }
  144. }, this.app );
  145. this.form.load();
  146. }.bind(this), true);
  147. },
  148. _ok: function( data, callback ){
  149. this.app.restActions.exportSelfHoliday( data.startDate, data.endDate, function(json){
  150. if( callback )callback(json);
  151. }.bind(this) );
  152. this.close();
  153. }
  154. });
  155. MWF.xApplication.Attendance.SelfHoliday.Form = new Class({
  156. Extends: MWF.xApplication.Attendance.Explorer.PopupForm,
  157. options : {
  158. "width": 600,
  159. "height": 450,
  160. "hasTop" : true,
  161. "hasBottom" : true,
  162. "title" : "",
  163. "draggable" : true,
  164. "closeAction" : true
  165. },
  166. _createTableContent: function(){
  167. var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='formTable'>"+
  168. "<tr><td colspan='2' styles='formTableHead'>员工休假记录</td></tr>" +
  169. "<tr><td styles='formTabelTitle' lable='unitName'></td>"+
  170. " <td styles='formTableValue' item='unitName'></td></tr>" +
  171. "<tr><td styles='formTabelTitle' lable='employeeName'></td>"+
  172. " <td styles='formTableValue' item='employeeName'></td></tr>" +
  173. "<tr><td styles='formTabelTitle' lable='leaveType'></td>"+
  174. " <td styles='formTableValue' item='leaveType'></td></tr>" +
  175. "<tr><td styles='formTabelTitle' lable='startTime'></td>"+
  176. " <td styles='formTableValue' item='startTime'></td></tr>" +
  177. "<tr><td styles='formTabelTitle' lable='endTime'></td>"+
  178. " <td styles='formTableValue' item='endTime'></td></tr>" +
  179. "<tr><td styles='formTabelTitle' lable='leaveDayNumber'></td>"+
  180. " <td styles='formTableValue' item='leaveDayNumber'></td></tr>" +
  181. "</table>";
  182. this.formTableArea.set("html",html);
  183. MWF.xDesktop.requireApp("Template", "MForm", function(){
  184. this.form = new MForm( this.formTableArea, this.data, {
  185. isEdited : this.isEdited || this.isNew,
  186. itemTemplate : {
  187. unitName : { text : "部门", "type" : "org", orgType : "unit", notEmpty : true},
  188. employeeName : { text: "员工姓名", "type" : "org", orgType : "person" , notEmpty : true },
  189. leaveType : {
  190. text: "休假类型",
  191. "type" : "select", notEmpty : true,
  192. "selectValue" : "带薪年休假,带薪病假,带薪福利假,扣薪事假,其他".split(",")
  193. },
  194. startTime : {
  195. text:"开始时间", tType : "datetime", notEmpty : true
  196. },
  197. endTime : {
  198. text:"结束时间", tType : "datetime", notEmpty : true
  199. },
  200. leaveDayNumber : {
  201. text:"休假天数", tType : "number", notEmpty : true
  202. }
  203. }
  204. }, this.app);
  205. this.form.load();
  206. }.bind(this), true);
  207. },
  208. _ok: function( data, callback ){
  209. this.app.restActions.saveSelfHoliday(data, function(json){
  210. if( callback )callback(json);
  211. }.bind(this));
  212. }
  213. });
  214. //
  215. //MWF.xApplication.Attendance.SelfHoliday.Form = new Class({
  216. // Extends: MWF.widget.Common,
  217. // Implements: [Options, Events],
  218. // options: {
  219. // "width": "500",
  220. // "height": "400"
  221. // },
  222. // initialize: function( explorer, data ){
  223. // this.explorer = explorer;
  224. // this.app = explorer.app;
  225. // this.data = data || {};
  226. // this.css = this.explorer.css;
  227. //
  228. // this.load();
  229. // },
  230. // load: function(){
  231. //
  232. // },
  233. //
  234. // open: function(){
  235. // this.isNew = false;
  236. // this.isEdited = false;
  237. // this._open();
  238. // },
  239. // create: function(){
  240. // this.isNew = true;
  241. // this._open();
  242. // },
  243. // edit: function(){
  244. // this.isEdited = true;
  245. // this._open();
  246. // },
  247. // _open : function(){
  248. // this.createMarkNode = new Element("div", {
  249. // "styles": this.css.createMarkNode,
  250. // "events": {
  251. // "mouseover": function(e){e.stopPropagation();},
  252. // "mouseout": function(e){e.stopPropagation();}
  253. // }
  254. // }).inject(this.app.content, "after");
  255. //
  256. // this.createAreaNode = new Element("div", {
  257. // "styles": this.css.createAreaNode
  258. // });
  259. //
  260. // this.createNode();
  261. //
  262. // this.createAreaNode.inject(this.createMarkNode, "after");
  263. // this.createAreaNode.fade("in");
  264. //
  265. //
  266. // this.setCreateNodeSize();
  267. // this.setCreateNodeSizeFun = this.setCreateNodeSize.bind(this);
  268. // this.addEvent("resize", this.setCreateNodeSizeFun);
  269. // },
  270. // createNode: function(){
  271. // var _self = this;
  272. // var d = this.data;
  273. // this.createNode = new Element("div", {
  274. // "styles": this.css.createNode
  275. // }).inject(this.createAreaNode);
  276. //
  277. //
  278. // this.createIconNode = new Element("div", {
  279. // "styles": this.isNew ? this.css.createNewNode : this.css.createIconNode
  280. // }).inject(this.createNode);
  281. //
  282. //
  283. // this.createFormNode = new Element("div", {
  284. // "styles": this.css.createFormNode
  285. // }).inject(this.createNode);
  286. //
  287. //
  288. // var table = new Element("table", {
  289. // "width" : "100%", "border" : "0", "cellpadding" : "0", "cellspacing" : "0"
  290. // }).inject( this.createFormNode );
  291. //
  292. // var tr = new Element("tr").inject(table);
  293. // var td = new Element("td", { "colspan":'2', "styles" : this.css.editTableHead, "text" : "员工休假记录" }).inject(tr);
  294. //
  295. // var tr = new Element("tr").inject(table);
  296. // var td = new Element("td", { "styles" : this.css.editTableTitle, "text" : "部门:" }).inject(tr);
  297. // var td = new Element("td", { "styles" : this.css.editTableValue }).inject(tr);
  298. // if( !this.isNew && !this.isEdited ){
  299. // td.set("text", d.unitName )
  300. // }else{
  301. // this.unitName = new MDomItem( td, {
  302. // "name" : "unitName",
  303. // "value" : d.unitName,
  304. // "style" : this.css.inputPersonStyle,
  305. // "event" : {
  306. // "click" : function( mdi){ _self.selectPeople(this, "unit", mdi.get("value").split(",") ) }
  307. // }
  308. // }, true, this.app );
  309. // this.unitName.load();
  310. // }
  311. //
  312. // var tr = new Element("tr").inject(table);
  313. // var td = new Element("td", { "styles" : this.css.editTableTitle, "text" : "员工姓名:" }).inject(tr);
  314. // var td = new Element("td", { "styles" : this.css.editTableValue }).inject(tr);
  315. // if( !this.isNew && !this.isEdited ){
  316. // td.set("text", d.employeeName )
  317. // }else{
  318. // this.employeeName = new MDomItem( td, {
  319. // "name" : "employeeName",
  320. // "value" : d.employeeName,
  321. // "style" : this.css.inputPersonStyle,
  322. // "event" : {
  323. // "click" : function( mdi){ _self.selectPeople(this, "person", mdi.get("value").split(",") ) }
  324. // }
  325. // }, true, this.app );
  326. // this.employeeName.load();
  327. // }
  328. //
  329. // var tr = new Element("tr").inject(table);
  330. // var td = new Element("td", { "styles" : this.css.editTableTitle, "text" : "休假类型:" }).inject(tr);
  331. // var td = new Element("td", { "styles" : this.css.editTableValue }).inject(tr);
  332. // if( !this.isNew && !this.isEdited ){
  333. // td.set("text", d.leaveType )
  334. // }else{
  335. // this.leaveType = new MDomItem( td, {
  336. // "name" : "leaveType",
  337. // "type" : "select",
  338. // "value" : d.leaveType,
  339. // "selectValue" : "带薪年休假,带薪病假,带薪福利假,扣薪事假,其他".split(",")
  340. // }, true, this.app );
  341. // this.leaveType.load();
  342. // }
  343. //
  344. // var tr = new Element("tr").inject(table);
  345. // var td = new Element("td", { "styles" : this.css.editTableTitle, "text" : "开始时间:" }).inject(tr);
  346. // var td = new Element("td", { "styles" : this.css.editTableValue }).inject(tr);
  347. // if( !this.isNew && !this.isEdited ){
  348. // td.set("text", d.startTime )
  349. // }else{
  350. // this.startTime = new MDomItem( td, {
  351. // "name" : "startTime",
  352. // "value" : d.startTime,
  353. // "style" : this.css.inputTimeStyle,
  354. // "event" : {
  355. // "click" : function( mdi){ _self.selectDateTime(this, false, true ) }
  356. // }
  357. // }, true, this.app );
  358. // this.startTime.load();
  359. // }
  360. //
  361. // var tr = new Element("tr").inject(table);
  362. // var td = new Element("td", { "styles" : this.css.editTableTitle, "text" : "结束时间:" }).inject(tr);
  363. // var td = new Element("td", { "styles" : this.css.editTableValue} ).inject(tr);
  364. // if( !this.isNew && !this.isEdited ){
  365. // td.set("text", d.endTime )
  366. // }else{
  367. // this.endTime = new MDomItem( td, {
  368. // "name" : "endTime",
  369. // "value" : d.endTime,
  370. // "style" : this.css.inputTimeStyle,
  371. // "event" : {
  372. // "click" : function( mdi){ _self.selectDateTime(this, false, true ) }
  373. // }
  374. // }, true, this.app );
  375. // this.endTime.load();
  376. // }
  377. //
  378. // var tr = new Element("tr").inject(table);
  379. // var td = new Element("td", { "styles" : this.css.editTableTitle, "text" : "休假天数:" }).inject(tr);
  380. // var td = new Element("td", { "styles" : this.css.editTableValue}).inject(tr);
  381. // if( !this.isNew && !this.isEdited ){
  382. // td.set("text", d.leaveDayNumber )
  383. // }else{
  384. // this.leaveDayNumber = new MDomItem( td, {
  385. // "name" : "leaveDayNumber",
  386. // "value" : d.leaveDayNumber,
  387. // "style" : this.css.inputStyle,
  388. // "event" : {
  389. // "keyup" : function(){ this.value=this.value.replace(/[^\d.]/g,'') }
  390. // }
  391. // }, true, this.app );
  392. // this.leaveDayNumber.load();
  393. // }
  394. //
  395. // if( this.isNew || this.isEdited ){
  396. // this.createOkActionNode = new Element("div", {
  397. // "styles": this.css.createOkActionNode,
  398. // "text": this.app.lp.ok
  399. // }).inject(this.createFormNode);
  400. //
  401. // this.createOkActionNode.addEvent("click", function(e){
  402. // this.okCreate(e);
  403. // }.bind(this));
  404. // }
  405. // this.cancelActionNode = new Element("div", {
  406. // "styles": this.css.createCancelActionNode,
  407. // "text": this.app.lp.cancel
  408. // }).inject(this.createFormNode);
  409. //
  410. // this.cancelActionNode.addEvent("click", function(e){
  411. // this.cancelCreate(e);
  412. // }.bind(this));
  413. //
  414. // },
  415. // setCreateNodeSize: function (width, height, top, left) {
  416. // if (!width)width = this.options && this.options.width ? this.options.width : "50%"
  417. // if (!height)height = this.options && this.options.height ? this.options.height : "50%"
  418. // if (!top) top = this.options && this.options.top ? this.options.top : 0;
  419. // if (!left) left = this.options && this.options.left ? this.options.left : 0;
  420. //
  421. // var allSize = this.app.content.getSize();
  422. // var limitWidth = allSize.x; //window.screen.width
  423. // var limitHeight = allSize.y; //window.screen.height
  424. //
  425. // "string" == typeof width && (1 < width.length && "%" == width.substr(width.length - 1, 1)) && (width = parseInt(limitWidth * parseInt(width, 10) / 100, 10));
  426. // "string" == typeof height && (1 < height.length && "%" == height.substr(height.length - 1, 1)) && (height = parseInt(limitHeight * parseInt(height, 10) / 100, 10));
  427. // 300 > width && (width = 300);
  428. // 220 > height && (height = 220);
  429. // top = top || parseInt((limitHeight - height) / 2, 10);
  430. // left = left || parseInt((limitWidth - width) / 2, 10);
  431. //
  432. // this.createAreaNode.setStyles({
  433. // "width": "" + width + "px",
  434. // "height": "" + height + "px",
  435. // "top": "" + top + "px",
  436. // "left": "" + left + "px"
  437. // });
  438. //
  439. // this.createNode.setStyles({
  440. // "width": "" + width + "px",
  441. // "height": "" + height + "px"
  442. // });
  443. //
  444. // var iconSize = this.createIconNode ? this.createIconNode.getSize() : {x: 0, y: 0};
  445. // var topSize = this.formTopNode ? this.formTopNode.getSize() : {x: 0, y: 0};
  446. // var bottomSize = this.formBottomNode ? this.formBottomNode.getSize() : {x: 0, y: 0};
  447. //
  448. // var contentHeight = height - iconSize.y - topSize.y - bottomSize.y;
  449. // //var formMargin = formHeight -iconSize.y;
  450. // this.createFormNode.setStyles({
  451. // "height": "" + contentHeight + "px"
  452. // });
  453. // },
  454. // cancelCreate: function(e){
  455. // var _self = this;
  456. // if( this.unitName )var unitName = this.unitName.get("value");
  457. // if ( this.isNew && unitName!="" && unitName!="default" ){
  458. // this.app.confirm("warn", e,
  459. // this.app.lp.create_cancel_title,
  460. // this.app.lp.create_cancel, "320px", "100px",
  461. // function(){
  462. // _self.createMarkNode.destroy();
  463. // _self.createAreaNode.destroy();
  464. // this.close();
  465. // },function(){
  466. // this.close();
  467. // }
  468. // );
  469. // }else{
  470. // this.createMarkNode.destroy();
  471. // this.createAreaNode.destroy();
  472. // delete _self;
  473. // }
  474. // },
  475. // okCreate: function(e){
  476. // var data = {
  477. // "id" : (this.data && this.data.id) ? this.data.id : null,
  478. // "unitName": this.unitName.get("value"),
  479. // "employeeName": this.employeeName.get("value"),
  480. // "leaveType": this.leaveType.get("value"),
  481. // "startTime": this.startTime.get("value"),
  482. // "endTime": this.endTime.get("value"),
  483. // "leaveDayNumber": this.leaveDayNumber.get("value")
  484. // };
  485. //
  486. // //alert(JSON.stringify(data))
  487. //
  488. // if (data.unitName && data.employeeName && data.leaveType && data.startTime && data.endTime && data.leaveDayNumber){
  489. // this.app.restActions.saveSelfHoliday(data, function(json){
  490. // if( json.type == "ERROR" ){
  491. // this.app.notice( json.message , "error");
  492. // }else{
  493. // this.createMarkNode.destroy();
  494. // this.createAreaNode.destroy();
  495. // if(this.explorer.view)this.explorer.view.reload();
  496. // this.app.notice( this.isNew ? this.app.lp.createSuccess : this.app.lp.updateSuccess , "success");
  497. // }
  498. // // this.app.processConfig();
  499. // }.bind(this));
  500. // }else{
  501. // this.app.notice( this.app.lp.selfHoliday.inputVaild, "error");
  502. // }
  503. // },
  504. // selectDateTime : function( el, timeOnly, isTme ){
  505. // MWF.require("MWF.widget.Calendar", function(){
  506. // var calendar = new MWF.widget.Calendar( el, {
  507. // "style": "xform",
  508. // "timeOnly": timeOnly,
  509. // "isTime": isTme,
  510. // "target": this.app.content
  511. // });
  512. // calendar.show();
  513. // }.bind(this));
  514. // },
  515. // selectPeople: function(el, type, value ){
  516. // var title
  517. // if( type == "unit" ){
  518. // title = "选择部门"
  519. // }else if( type == "topUnit" ){
  520. // title = "选择公司"
  521. // }else{
  522. // title = "选择个人"
  523. // }
  524. // var options = {
  525. // "type": type,
  526. // "title": title,
  527. // "count" : "1",
  528. // "values": value || [],
  529. // "onComplete": function(items){
  530. // var vs = [];
  531. // items.each(function(item){
  532. // vs.push(item.data.name);
  533. // }.bind(this));
  534. // el.set("value",vs.join( "," ));
  535. // }.bind(this)
  536. // };
  537. // var selector = new MWF.O2Selector(this.app.content, options);
  538. // }
  539. //});