WorkForm.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. MWF.xApplication.Execution = MWF.xApplication.Execution || {};
  2. MWF.xDesktop.requireApp("Template", "MPopupForm", null, false);
  3. MWF.xDesktop.requireApp("Template", "MForm", null, false);
  4. MWF.xDesktop.requireApp("Execution","Attachment",null,false);
  5. MWF.xApplication.Execution.WorkForm = new Class({
  6. Extends: MPopupForm,
  7. Implements: [Options, Events],
  8. options: {
  9. "style": "default",
  10. "width": "800",
  11. "height": "100%",
  12. "hasTop": true,
  13. "hasIcon": false,
  14. "hasBottom": true,
  15. "title": "",
  16. "draggable": false,
  17. "closeAction": true
  18. },
  19. initialize: function (explorer, actions, data, options) {
  20. this.setOptions(options);
  21. this.explorer = explorer;
  22. this.app = explorer.app;
  23. this.lp = this.app.lp.workForm;
  24. this.actions = this.app.restActions;
  25. this.path = "/x_component_Execution/$WorkForm/";
  26. this.cssPath = this.path + this.options.style + "/css.wcss";
  27. this._loadCss();
  28. this.options.title = this.lp.title;
  29. this.data = data || {};
  30. this.actions = actions;
  31. },
  32. load: function () {
  33. //isNew = false,重新获取一遍,isNew = new 是新建工作 新建判断都方在options里 有parentWorkId一定是有上级工作,如果是centerWorkId是第一层创建
  34. if(this.options.isNew){
  35. if(this.options.parentWorkId){
  36. this.actions.getBaseWorkInfo(this.options.parentWorkId,function(json){
  37. if(json.data){
  38. this.parentWorkData = json.data
  39. }
  40. }.bind(this),
  41. function(xhr,text,error){
  42. this.showErrorMessage(xhr,text,error)
  43. }.bind(this),false
  44. )
  45. }else if(this.options.centerWorkId){
  46. this.data.centerId = this.options.centerWorkId
  47. }else if(this.data.centerWorkId) {
  48. this.data.centerId = this.data.centerWorkId
  49. }
  50. }else{
  51. if(this.data.id){
  52. this.id = this.data.id
  53. }else if(this.options.id){
  54. this.id = this.options.id
  55. }
  56. this.actions.getBaseWorkInfo(this.id,function(json){
  57. if(json.data){
  58. this.data = json.data
  59. }
  60. }.bind(this),
  61. function(xhr,text,error){
  62. this.showErrorMessage(xhr,text,error)
  63. }.bind(this),false
  64. )
  65. }
  66. if (this.options.isNew) {
  67. this.create();
  68. } else if (this.options.isEdited) {
  69. this.edit();
  70. } else {
  71. this.open();
  72. }
  73. },
  74. createTopNode: function () {
  75. if (!this.formTopNode) {
  76. this.formTopNode = new Element("div.formTopNode", {
  77. "styles": this.css.formTopNode
  78. }).inject(this.formNode);
  79. this.formTopIconNode = new Element("div", {
  80. "styles": this.css.formTopIconNode
  81. }).inject(this.formTopNode);
  82. this.formTopTextNode = new Element("div", {
  83. "styles": this.css.formTopTextNode,
  84. "text": this.options.title + ( this.data.title ? ("-" + this.data.title ) : "" )
  85. }).inject(this.formTopNode);
  86. if (this.options.closeAction) {
  87. this.formTopCloseActionNode = new Element("div", {"styles": this.css.formTopCloseActionNode}).inject(this.formTopNode);
  88. this.formTopCloseActionNode.addEvent("click", function () {
  89. this.close()
  90. }.bind(this))
  91. }
  92. this.formTopContentNode = new Element("div", {
  93. "styles": this.css.formTopContentNode
  94. }).inject(this.formTopNode);
  95. this._createTopContent();
  96. }
  97. },
  98. _createTopContent: function () {
  99. },
  100. _createTableContent: function () {
  101. var html = "<table width='100%' bordr='0' cellpadding='5' cellspacing='0' styles='formTable'>" +
  102. "<tr>" +
  103. " <td styles='formTableTitle' lable='centerWorkTitle'></td>" +
  104. " <td styles='formTableValue' item='centerWorkTitle' colspan='3'></td>" +
  105. "</tr><tr>" +
  106. " <td styles='formTableTitle' lable='timeLimit'></td>" +
  107. " <td styles='formTableValue' item='timeLimit'></td>" +
  108. " <td styles='formTableTitle' lable='reportCycle'></td>" +
  109. " <td styles='formTableValue'><span item='reportCycle'></span><span item='reportDay'></span></td>" +
  110. "</tr><tr>" +
  111. " <td styles='formTableTitle' lable='dutyDepartment'></td>" +
  112. " <td styles='formTableValue' item='dutyDepartment'></td>" +
  113. " <td styles='formTableTitle' lable='dutyPerson'></td>" +
  114. " <td styles='formTableValue' item='dutyPerson'></td>" +
  115. "</tr><tr>" +
  116. " <td styles='formTableTitle' lable='secondDepartment'></td>" +
  117. " <td styles='formTableValue' item='secondDepartment'></td>" +
  118. " <td styles='formTableTitle' lable='secondPerson'></td>" +
  119. " <td styles='formTableValue' item='secondPerson'></td>" +
  120. "</tr><tr>" +
  121. " <td styles='formTableTitle' lable='readReader'></td>" +
  122. " <td styles='formTableValue' item='readReader' colspan='3'></td>" +
  123. "</tr><tr>" +
  124. " <td styles='formTableValue' colspan='4'>" +
  125. " <div styles='formTableTitleDiv' lable='workSplitAndDescription'></div>" +
  126. " <div styles='formTableValueDiv' item='workSplitAndDescription'></div>" +
  127. " </td>" +
  128. "</tr><tr>" +
  129. " <td styles='formTableValue' colspan='4'>" +
  130. " <div styles='formTableTitleDiv' lable='specificActionInitiatives'></div>" +
  131. " <div styles='formTableValueDiv' item='specificActionInitiatives'></div>" +
  132. " </td>" +
  133. "</tr><tr>" +
  134. "</tr><tr>" +
  135. " <td styles='formTableValue' colspan='4'>" +
  136. " <div styles='formTableTitleDiv' lable='milestoneMark'></div>" +
  137. " <div styles='formTableValueDiv' item='milestoneMark'></div>" +
  138. " </td>" +
  139. "</tr><tr>" +
  140. " <td styles='formTableValue' colspan='4'>" +
  141. " <div styles='formTableValueDiv' item='attachments'></div>"+
  142. " </td>" +
  143. "</tr>"+
  144. "</table>";
  145. this.formTableArea.set("html", html);
  146. this.loadForm();
  147. },
  148. loadForm: function(){
  149. if(this.parentWorkData){
  150. this.data.parentWorkId = this.parentWorkData.id;
  151. this.data.workDetail = this.parentWorkData.workDetail;
  152. this.data.centerId = this.parentWorkData.centerId;
  153. }
  154. this.form = new MForm(this.formTableArea, this.data, {
  155. style: "execution",
  156. isEdited: this.isEdited || this.isNew,
  157. itemTemplate: this.getItemTemplate(this.lp )
  158. },this.app);
  159. this.form.load();
  160. var taObj = this.formTableArea.getElements("textarea");
  161. taObj.setStyles({height:"70px"});
  162. this.attachmentArea = this.formTableArea.getElement("[item='attachments']");
  163. this.loadAttachment( this.attachmentArea );
  164. //部署过程
  165. this.tmpLp = this.lp.processInfo;
  166. this.processInfo = new Element("div.processInfo",{
  167. "styles":this.css.processInfoDiv
  168. //}).inject(this.detailContentNode,"top")
  169. }).inject(this.formTableArea);
  170. this.processInfoTitle = new Element("div.processInfoTitle",{
  171. "styles":this.css.processInfoTitleDiv,
  172. "text":this.tmpLp.title
  173. }).inject(this.processInfo);
  174. //alert(JSON.stringify(this.data.okrWorkAuthorizeRecords))
  175. this.processInfoContent = new Element("div.processInfoContent",{
  176. "styles":this.css.processInfoContent
  177. }).inject(this.processInfo);
  178. var tHead = "<table styles='processTable'>";
  179. var tBody = "<tr>";
  180. tBody+="<td styles='processTH'>"+this.tmpLp.operate+"</td>";
  181. tBody+="<td styles='processTH'>"+this.tmpLp.time+"</td>";
  182. tBody+="<td styles='processTH'>"+this.tmpLp.source.split('@')[0]+"</td>";
  183. tBody+="<td styles='processTH'>"+this.tmpLp.target.split('@')[0]+"</td>";
  184. tBody+="<td styles='processTH'>"+this.tmpLp.opinion+"</td>";
  185. tBody+="</tr>";
  186. if(this.data.workDeployAuthorizeRecords){
  187. this.data.workDeployAuthorizeRecords.each(function(d){
  188. tBody += "<tr>";
  189. tBody+="<td styles='processTD'>"+d.operationTypeCN+"</td>";
  190. tBody+="<td styles='processTD'>"+ d.operationTime+"</td>";
  191. tBody+="<td styles='processTD'>"+ d.source.split('@')[0]+"</td>";
  192. tBody+="<td styles='processTD'>"+ d.target.split('@')[0]+"</td>";
  193. tBody+="<td styles='processTD'>"+d.opinion+"</td>";
  194. tBody+="</tr>"
  195. }.bind(this))
  196. }
  197. var tBottom = "</table>";
  198. this.processInfoContent.set("html",tHead+tBody+tBottom);
  199. this.formatStyles(this.processInfoContent);
  200. },
  201. formatStyles:function(obj){
  202. obj.getElements("[styles]").each(function(el){
  203. var styles = el.get("styles");
  204. if( styles && this.css[styles] ){
  205. el.setStyles( this.css[styles] )
  206. }
  207. }.bind(this))
  208. },
  209. getItemTemplate: function( lp ){
  210. _self = this;
  211. return {
  212. centerWorkTitle:{
  213. text: lp.centerWorkTitle+":",
  214. type :"innerText",
  215. value : this.data.centerWorkInfo?this.data.centerWorkInfo.title:(this.data.centerWorkTitle?this.data.centerWorkTitle.title:"")
  216. },
  217. workType: {
  218. text: lp.workType + ":",
  219. type: "select",
  220. notEmpty:true,
  221. selectValue: lp.workTypeValue.split(",")
  222. },
  223. workLevel: {
  224. text: lp.workLevel + ":",
  225. type: "select",
  226. notEmpty:true,
  227. selectValue: lp.workLevelValue.split(",")
  228. },
  229. timeLimit: {text: lp.timeLimit + ":", tType: "date",name:"completeDateLimitStr",notEmpty:true,attr : {readonly:true}},
  230. reportCycle: {
  231. text: lp.reportCycle + ":",
  232. type: "select",
  233. notEmpty:true,
  234. //selectValue: lp.reportCycleValue.split(","),
  235. selectText: lp.reportCycleText.split(","),
  236. className: (_self.isEdited || _self.isNew) ? "inputSelectUnformatWidth":"",
  237. event: {
  238. change: function (item, ev) {
  239. if (item.get("value") == lp.reportCycleText.split(",")[0]) {
  240. this.form.getItem("reportDay").resetItemOptions(lp.weekDayValue.split(","),lp.weekDayText.split(","))
  241. } else if (item.get("value") == lp.reportCycleText.split(",")[1]) {
  242. this.form.getItem("reportDay").resetItemOptions(lp.monthDayValue.split(","),lp.monthDayText.split(","))
  243. }
  244. }.bind(this)
  245. }
  246. },
  247. reportDay: {
  248. type: "select",
  249. name:"reportDayInCycle",
  250. notEmpty:true,
  251. selectValue: (!this.data.reportCycle || this.data.reportCycle==lp.reportCycleText.split(",")[0])?lp.weekDayValue.split(","):lp.monthDayValue.split(","), //lp.weekDayValue.split(","),
  252. selectText: (!this.data.reportCycle || this.data.reportCycle==lp.reportCycleText.split(",")[0])?lp.weekDayText.split(","):lp.monthDayText.split(","),
  253. className: (_self.isEdited || _self.isNew) ? "inputSelectUnformatWidth":""
  254. },
  255. dutyDepartment: {
  256. type:"org",
  257. orgType:"unit",
  258. text: lp.dutyDepartment + ":",
  259. name:"responsibilityUnitName",
  260. notEmpty:true,
  261. attr : {readonly:true},
  262. event:{
  263. "change":function(item){
  264. var department = item.getValue(",");
  265. if( department ){
  266. _self.getDepartmentLeader( department, function( leader ){
  267. _self.form.getItem("dutyPerson").setValue(leader);
  268. })
  269. }
  270. }
  271. }
  272. },
  273. dutyPerson: {
  274. type:"org",
  275. orgType:"identity",
  276. text: lp.dutyPerson + ":",
  277. count:1,
  278. name:"responsibilityIdentity",
  279. notEmpty:true,
  280. attr : {readonly:true},
  281. onQuerySelect : function( item ){
  282. var department = this.form.getItem("dutyDepartment").getValue();
  283. //item.options.departments = department ? [department] : [] ;
  284. department = typeOf(department)=="string" ? [department] : department;
  285. var list = [];
  286. (department || []).each( function(d){
  287. return list.push( d.split("@")[0] );
  288. });
  289. item.options.units = list || [] ;
  290. }.bind(this)
  291. },
  292. secondDepartment: {
  293. text: lp.secondDepartment + ":",
  294. type: "org",
  295. orgType:"unit",
  296. name:"cooperateUnitNameList",
  297. value:this.cooperateUnitNameList?this.cooperateUnitNameList.join(","):"",
  298. count: 0,
  299. attr : {readonly:true},
  300. event:{
  301. "change":function(item){
  302. var deptstr = item.getValue(",");
  303. if(deptstr){
  304. var depts = deptstr.split(",");
  305. var users = "";
  306. for(var i=0;i<depts.length;i++){
  307. if(depts[i]!=""){
  308. _self.getDepartmentLeader( depts[i], function( leader ){
  309. if(users=="") users = leader;
  310. else users = users + ","+leader
  311. })
  312. }
  313. }
  314. _self.form.getItem("secondPerson").setValue(users);
  315. }
  316. }
  317. }},
  318. secondPerson: {
  319. text: lp.secondPerson + ":", type:"org",orgType: "identity",
  320. name:"cooperateIdentityList",
  321. value:this.cooperateIdentity?this.cooperateIdentity.join(","):"",
  322. count: 0,attr : {readonly:true}
  323. },
  324. readReader: {
  325. text: lp.readReader + ":",type:"org", orgType: "identity",
  326. name:"readLeaderIdentityList",
  327. value:this.readLeaderIdentity?this.readLeaderIdentity.join(","):"",
  328. attr : {readonly:true},count: 0
  329. },
  330. subject: {text: lp.subject + ":",name:"title",notEmpty:true},
  331. workSplitAndDescription: {text: lp.workSplitAndDescription + ":", type: "textarea",name:"workDetail",notEmpty:true},
  332. specificActionInitiatives: {text: lp.specificActionInitiatives + ":", type: "textarea",name:"progressAction"},
  333. cityCompanyDuty: {text: lp.cityCompanyDuty + ":", type: "textarea",name:"dutyDescription"},
  334. milestoneMark: {text: lp.milestoneMark + ":", type: "textarea",name:"landmarkDescription"},
  335. importantMatters: {text: lp.importantMatters + ":", type: "textarea",name:"majorIssuesDescription"}
  336. }
  337. },
  338. loadAttachment: function( area ){
  339. this.attachment = new MWF.xApplication.Execution.Attachment( area, this.app, this.actions, this.app.lp, {
  340. size:this.options.isNew?"max":"min",
  341. documentId : this.data.id,
  342. isNew : this.options.isNew,
  343. isEdited : this.options.isEdited,
  344. onQueryUploadAttachment : function(){
  345. this.attachment.isQueryUploadSuccess = true;
  346. if( !this.data.id || this.data.id=="" ){
  347. var data = this.form.getResult(true, ",", true, false, true);
  348. if( !data ){
  349. this.attachment.isQueryUploadSuccess = false;
  350. return;
  351. }
  352. if(this.options.isNew){
  353. data.centerId = this.options.centerWorkId || this.data.centerWorkId || this.data.centerId ;
  354. }
  355. if(data.cooperateUnitNameList == ""){
  356. data.cooperateUnitNameList = [];
  357. }else{
  358. data.cooperateUnitNameList = data.cooperateUnitNameList.split(",");
  359. }
  360. if(data.cooperateIdentityList == ""){
  361. data.cooperateIdentityList = [];
  362. }else{
  363. data.cooperateIdentityList = data.cooperateIdentityList.split(",");
  364. }
  365. if(data.readLeaderIdentityList == ""){
  366. data.readLeaderIdentityList = [];
  367. }else{
  368. data.readLeaderIdentityList = data.readLeaderIdentityList.split(",");
  369. }
  370. this.app.restActions.saveTask(data, function(json){
  371. if(json.type && json.type == "success"){
  372. if(json.data.id) {
  373. this.attachment.options.documentId = json.data.id;
  374. this.data.id = json.data.id;
  375. //this.options.isNew = false;
  376. }
  377. }
  378. }.bind(this), function(xhr,text,error){
  379. this.showErrorMessage(xhr,text,error)
  380. }.bind(this),false)
  381. }
  382. }.bind(this)
  383. });
  384. this.attachment.load();
  385. },
  386. _createBottomContent: function () {
  387. this.cancelActionNode = new Element("div.formCancelActionNode", {
  388. "styles": this.css.formCancelActionNode,
  389. "text": this.app.lp.cancel
  390. }).inject(this.formBottomNode);
  391. this.cancelActionNode.addEvent("click", function (e) {
  392. this.cancel(e);
  393. }.bind(this));
  394. if ((this.isNew || this.isEdited) && this.options.actionStatus == "save" ) {
  395. this.okActionNode = new Element("div.formOkActionNode", {
  396. "styles": this.css.formOkActionNode,
  397. "text": this.app.lp.ok
  398. }).inject(this.formBottomNode);
  399. this.okActionNode.addEvent("click", function (e) {
  400. this.ok(e);
  401. }.bind(this));
  402. }
  403. if(this.options.actionStatus=="deploy"){
  404. this.deployActionNode = new Element("div.formDeployActionNode",{
  405. "styles": this.css.formOkActionNode,
  406. "text" : this.app.lp.deploy
  407. }).inject(this.formBottomNode)
  408. .addEvent("click",function(){
  409. this.deploy();
  410. }.bind(this))
  411. }
  412. },
  413. deploy: function(){
  414. //先调用保存,再部署
  415. var data = this.form.getResult(true, ",", true, false, true);
  416. if (data) {
  417. if(data.cooperateUnitNameList == ""){
  418. data.cooperateUnitNameList = [];
  419. }else{
  420. data.cooperateUnitNameList = data.cooperateUnitNameList.split(",");
  421. }
  422. if(data.cooperateIdentityList == ""){
  423. data.cooperateIdentityList = [];
  424. }else{
  425. data.cooperateIdentityList = data.cooperateIdentityList.split(",");
  426. }
  427. if(data.readLeaderIdentityList == ""){
  428. data.readLeaderIdentityList = [];
  429. }else{
  430. data.readLeaderIdentityList = data.readLeaderIdentityList.split(",");
  431. }
  432. data.title = data.workDetail;
  433. data.deployerName = this.app.user;
  434. data.creatorName = this.app.user;
  435. data.centerId = this.data.centerId;
  436. this.app.createShade();
  437. this.app.restActions.saveTask(data,function(json){
  438. if(json.type && json.type == "success"){
  439. if(json.data.id){
  440. var ids = [];
  441. ids.push(json.data.id);
  442. var workData = { "workIds":ids };
  443. this.actions.deployBaseWork( workData, function( json ){
  444. if(json.type && json.type=="success"){
  445. this.app.notice(this.app.lp.WorkDeploy.deployeSuccess, "ok");
  446. //this.reloadContent();
  447. this.close();
  448. }
  449. this.fireEvent("postDeploy", json);
  450. this.app.destroyShade();
  451. }.bind(this),function(xhr,error,text){
  452. this.app.destroyShade();
  453. this.app.showErrorMessage(xhr,error,text)
  454. }.bind(this));
  455. }
  456. }
  457. }.bind(this),function(xhr,error,text){
  458. this.app.showErrorMessage(xhr,error,text)
  459. }.bind(this))
  460. }
  461. },
  462. _ok: function (data, callback) {
  463. if(data.cooperateUnitNameList == ""){
  464. data.cooperateUnitNameList = [];
  465. }else{
  466. data.cooperateUnitNameList = data.cooperateUnitNameList.split(",");
  467. }
  468. if(data.cooperateIdentityList == ""){
  469. data.cooperateIdentityList = [];
  470. }else{
  471. data.cooperateIdentityList = data.cooperateIdentityList.split(",");
  472. }
  473. if(data.readLeaderIdentityList == ""){
  474. data.readLeaderIdentityList = [];
  475. }else{
  476. data.readLeaderIdentityList = data.readLeaderIdentityList.split(",");
  477. }
  478. this.app.createShade();
  479. this.app.restActions.saveTask(data,function(json){
  480. if(json.type && json.type=="success"){
  481. this.app.notice(this.lp.submitSuccess, "ok");
  482. if(this.options.tabLocation){
  483. //if(this.options.from == "view"){
  484. //if(this.app.workTask.contentDiv) this.app.workTask.contentDiv.destroy()
  485. if(this.app.workTask)this.app.workTask.loadBaseWorkList(this.options.tabLocation);
  486. if(this.app.workList)this.app.workList.loadBaseWorkList(this.options.tabLocation);
  487. //}
  488. }else{
  489. if(this.explorer && this.explorer.explorer && this.explorer.explorer.reloadList){
  490. this.explorer.explorer.reloadList();
  491. }
  492. }
  493. this.close();
  494. }
  495. this.app.destroyShade();
  496. this.fireEvent("postSave", json);
  497. }.bind(this),function(xhr,text,error){
  498. this.app.destroyShade();
  499. var errorText = error;
  500. if (xhr) errorMessage = xhr.responseText;
  501. var e = JSON.parse(errorMessage);
  502. if(e.message){
  503. this.app.notice( e.message,"error");
  504. }else{
  505. this.app.notice( errorText,"error");
  506. }
  507. }.bind(this));
  508. //this.app.restActions.saveDocument( this.data.id, data, function(json){
  509. // if( callback )callback(json);
  510. //}.bind(this));
  511. },
  512. getDepartmentLeader:function(department, callback){
  513. var data = {};
  514. data.name =this.app.lp.departmentLeader;
  515. data.unit = department;
  516. this.app.orgActions.getDutyValue(data,function(json){
  517. if(json.data.identityList && json.data.identityList.length>0){
  518. if(callback)callback(json.data.identityList[0])
  519. }
  520. }.bind(this),null,false);
  521. //this.app.restActions.getDepartmentDuty(function( json ){
  522. // if( json.data.identityList && json.data.identityList.length > 0 ){
  523. // if(callback) callback(json.data.identityList[0])
  524. // //this.app.restActions.getPersonByIdentity( function(data){
  525. // // if(callback)callback(data.data.name);
  526. // //}.bind(this),null, json.data.identityList[0] ,false)
  527. // }
  528. //}.bind(this),null,this.app.lp.departmentLeader, department, false )
  529. },
  530. showErrorMessage:function(xhr,text,error){
  531. var errorText = error;
  532. if (xhr) errorMessage = xhr.responseText;
  533. if(errorMessage!=""){
  534. var e = JSON.parse(errorMessage);
  535. if(e.message){
  536. this.app.notice( e.message,"error");
  537. }else{
  538. this.app.notice( errorText,"error");
  539. }
  540. }else{
  541. this.app.notice(errorText,"error")
  542. }
  543. }
  544. });