leaveOffice9000_我要离职_离职申请.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699
  1. var _person = {}
  2. var _hrOrgUnit = {}
  3. var _HRBizDefine = [] // 用户设置的变动操作
  4. var isSameDatePersonChange = null
  5. //是否一天多次变动 是,最后工作日等于离职日期;
  6. //false:根据 isDefaultSameday判断最后工作日和离职日期是否同一天
  7. var isDefaultSameday = null
  8. //最后工作日和离职日期是否同一天( true:同一天;false:最后工作日是离职日期前一天)
  9. var isResignNextMonth = null
  10. _this.pageinit = function () {
  11. initHeader()
  12. checkIsExistResignBill()
  13. // getExistResignBillInfo()
  14. // $("#btnAddnew").hide()
  15. // mbos('editgrid1').addEntry()
  16. if (requestParam.operateState === "ADDNEW") {
  17. mbos('editgrid1').addEntry()
  18. setTimeout(function () {
  19. setBillId()
  20. CheckDefaultSameDayService("")
  21. getHRBizDefineByUiClass()
  22. }, 1000)
  23. }
  24. mbos("applicationHistory").bind("click", function () {
  25. mbos.ui.open({
  26. path: mbos.pageInfo.path,
  27. name: "bill.listui",
  28. });
  29. })
  30. $("#application_img").on('error', function () {
  31. $(this).attr('src', '/mbos/store/4000148/'+mbos.pageInfo.path+'/default.png');
  32. });
  33. }
  34. _this.edit = function (event) {
  35. return page.edit && page.edit(event);
  36. }
  37. _this.addnew = function (event) {
  38. return page.addnew && page.addnew(event);
  39. }
  40. _this.save = function (event) {
  41. //202503加入社保数据校验;
  42. var opValiflag = opValidate();
  43. if(!opValiflag){
  44. return;
  45. }
  46. var vali = mbos.ng.invokeAllScope("validate", { method: "save" });
  47. if (!vali) {
  48. return;
  49. }
  50. if (event.isvaliSuccess === false) {
  51. return;
  52. }
  53. if (requestParam.operateState === "ADDNEW") {
  54. mbos("billState").value({ isenum: true, value: 0 })
  55. }
  56. function _save() {
  57. return CheckResignBillInfoService(function () { save(event) })
  58. }
  59. //弱校验提示
  60. CheckWeakService(_save);
  61. //CheckResignAssign(_save)
  62. }
  63. _this.submit = function (event) {
  64. //202503加入社保数据校验;
  65. var opValiflag = opValidate();
  66. if(!opValiflag){
  67. return;
  68. }
  69. var vali = mbos.ng.invokeAllScope("validate", { method: "submit" });
  70. if (!vali) {
  71. return;
  72. }
  73. mbos("billState").value({ isenum: true, value: 1 })
  74. function _submit() {
  75. return CheckResignBillInfoService(function () { submit(event) })
  76. }
  77. //弱校验提示
  78. CheckWeakService(_submit);
  79. // CheckResignAssign(_submit)
  80. }
  81. _this.back = function (event) {
  82. return page.back && page.back(event);
  83. }
  84. _this.afterSave = function (e) {
  85. if (requestParam.operateState === "ADDNEW") {
  86. mbos.ui.open({
  87. path: mbos.pageInfo.path,
  88. name: "application.editui",
  89. params: {
  90. billID: e.keyValue,
  91. operateState: "EDIT"
  92. }
  93. });
  94. } else {
  95. }
  96. }
  97. mbos('entity').bind('afterLoad', function () {
  98. if (requestParam.operateState !== "ADDNEW") {
  99. getHRBizDefineByUiClass()
  100. }
  101. })
  102. // 获取变动操作联动数据
  103. function getHRBizDefineByUiClass() {
  104. mbos.eas.invokeScript({
  105. name: "commonOSFservice",
  106. param: ['getHRBizDefineByUiClass', JSON.stringify({ uiClass: "com.kingdee.eas.hr.affair.app.ResignBizBill.form" })],
  107. success: function (res) {
  108. _HRBizDefine = res
  109. var { outEmpType, affairActionReason, variationReason } = res[0] || {outEmpType:[], affairActionReason: [], variationReason: []}
  110. var first = res.map((item) => "'" + item.number + "'");
  111. var sec = outEmpType.map((item) => "'" + item.number + "'");
  112. var thrid = affairActionReason.map((item) => "'" + item.number + "'");
  113. var fourth = variationReason.map((item) => "'" + item.number + "'");
  114. if (requestParam.operateState === "ADDNEW" && res.length) {
  115. mbos("entrys.hrBizDefine", 0).value({ name: res[0].name, id: res[0].id, number: res[0].number });
  116. if (sec.length === 1) mbos("entrys.oldEmpType", 0).value(outEmpType[0])
  117. if (thrid.length === 1) mbos("entrys.affairActionReason", 0).value(affairActionReason[0])
  118. if (fourth.length === 1) mbos("entrys.variationReason", 0).value(variationReason[0])
  119. }
  120. // 用户设置的F7选项为空时, 把过滤条件设成xnull, 否则会全部显示
  121. if (first.length === 0) { first = ['"xnull"'] }
  122. if (sec.length === 0) { sec = ['"xnull"'] }
  123. if (thrid.length === 0) { thrid = ['"xnull"'] }
  124. if (fourth.length === 0) { fourth = ['"xnull"'] }
  125. // F7 选项 过滤
  126. mbos("entrys.hrBizDefine", 0).attr('dynamicFilter', 'number in (' + first.join(",") + ')');
  127. mbos("entrys.oldEmpType", 0).attr('dynamicFilter', 'number in (' + sec.join(",") + ')');
  128. mbos("entrys.affairActionReason", 0).attr('dynamicFilter', 'number in (' + thrid.join(",") + ')');
  129. mbos("entrys.variationReason", 0).attr('dynamicFilter', 'number in (' + fourth.join(",") + ')');
  130. },
  131. error: function (data) {
  132. if (typeof (data) == "string") {
  133. mbos.msgBox.showError("", data);
  134. } else {
  135. mbos.msgBox.showError({ ...data, msg: "" });
  136. }
  137. }
  138. })
  139. }
  140. _this.bizdatachange = function (event) {
  141. // isSameDatePersonChange
  142. //是否一天多次变动 是,最后工作日等于离职日期;
  143. //false:根据 isDefaultSameday判断最后工作日和离职日期是否同一天
  144. //isDefaultSameday
  145. var value = event.new_value
  146. if (!value) return
  147. CheckDefaultSameDayService(value, callback)
  148. function callback() {
  149. var nextDate = "";
  150. if (isSameDatePersonChange) {
  151. mbos("entrys.leftCompanyDate", 0).value(value);
  152. } else {
  153. if (isDefaultSameday) {
  154. mbos("entrys.leftCompanyDate", 0).value(value)
  155. } else {
  156. var prev = getPrevDate(value)
  157. mbos("entrys.leftCompanyDate", 0).value(prev)
  158. }
  159. }
  160. }
  161. }
  162. //后一天
  163. function getNextDate(value) {
  164. var date = new Date(value)
  165. var nextDate = new Date(date.getTime() + 24 * 60 * 60 * 1000)
  166. nextDate = nextDate.format('yyyy-MM-dd')
  167. return nextDate
  168. }
  169. function getPrevDate(value, day) {
  170. var date = new Date(value)
  171. var prevDate = day ? new Date(date.getTime() + day * 24 * 60 * 60 * 1000) : new Date(date.getTime() - 24 * 60 * 60 * 1000)
  172. var s1 = prevDate.format('yyyy-MM-dd')
  173. return s1
  174. }
  175. _this.leftdatechange = function (event) {
  176. var value = event.new_value
  177. var bizDate = mbos("entrys.bizDate", 0).value()
  178. if (!bizDate) {
  179. var param1 = { title: localeResource.msg50 };
  180. mbos.ui.showInfo(param1);
  181. return
  182. }
  183. var prev = getPrevDate(bizDate)
  184. if (isSameDatePersonChange) {
  185. if (value !== bizDate) {
  186. var param2 = { title: localeResource.msg43 };
  187. mbos.ui.showInfo(param2);
  188. mbos("entrys.leftCompanyDate", 0).value(bizDate);
  189. //禁用用户日期
  190. nextDate = getNextDate(bizDate);
  191. mbos("entrys.forbidUserDate", 0).value(nextDate);
  192. }
  193. } else {
  194. if (value !== bizDate && value !== prev) {
  195. var param3 = { title: localeResource.msg44 };
  196. mbos.ui.showInfo(param3);
  197. mbos("entrys.leftCompanyDate", 0).value(bizDate);
  198. //禁用用户日期
  199. nextDate = getNextDate(bizDate);
  200. mbos("entrys.forbidUserDate", 0).value(nextDate);
  201. }else{
  202. //禁用用户日期
  203. nextDate = getNextDate(value);
  204. mbos("entrys.forbidUserDate", 0).value(nextDate);
  205. }
  206. }
  207. }
  208. mbos('page').bind('afterRendered', function () {
  209. })
  210. mbos("page").bind("afterSave", function (e) {
  211. var param1 = { title: localeResource.msg45 };
  212. mbos.ui.showInfo(param1);
  213. if (requestParam.operateState === "ADDNEW") {
  214. mbos.ui.open({
  215. path: mbos.pageInfo.path,
  216. name: "application.editui",
  217. params: {
  218. billID: e.keyValue,
  219. operateState: "EDIT"
  220. }
  221. });
  222. }
  223. })
  224. mbos("page").bind("afterSubmit", function (e) {
  225. var param1 = { title: localeResource.msg46 };
  226. mbos.ui.showInfo(param1);
  227. mbos.ui.open({
  228. path: mbos.pageInfo.path,
  229. name: "bill.listui",
  230. params: {
  231. billID: mbos("entity").value().id,
  232. }
  233. });
  234. })
  235. //保存,提交弱校验提示
  236. function CheckWeakService(callback) {
  237. initEntityDataBeforeRequest()
  238. var data = mbos('entity').data
  239. mbos.eas.invokeScript({
  240. name: "commonOSFservice",
  241. param: ['checkWeakHireOrFlucExisService', JSON.stringify({ model: data })],
  242. success: function (res) {
  243. if (res.errorCode == '1') {
  244. mbos.ui.showConfirm({
  245. title: localeResource.msg53,
  246. msg: res.msg,
  247. callback: function (data) {
  248. if (data == 0) {
  249. //点击确定
  250. CheckResignAssign(callback)
  251. //callback && callback()
  252. }
  253. }
  254. });
  255. } else {
  256. CheckResignAssign(callback)
  257. }
  258. },
  259. error: function (data) {
  260. if (typeof (data) == "string") {
  261. mbos.msgBox.showError("", data);
  262. } else {
  263. mbos.msgBox.showError({ ...data, msg: "" });
  264. }
  265. }
  266. })
  267. }
  268. function setBillId() {
  269. var param = [];
  270. param[0] = mbos('entity').data.bosType;
  271. mbos.eas.invokeScript({
  272. name: "getbillid",
  273. param: param,
  274. success: function (data) {
  275. mbos('entity').data.id = data;
  276. }
  277. })
  278. }
  279. function initEntityDataBeforeRequest() {
  280. mbos("hrOrgUnit").value(_hrOrgUnit)
  281. mbos('entrys.person', 0).value(_person)
  282. mbos("applier").value(_person)
  283. mbos("isMultiEntry").value(false)
  284. var data = mbos('entity').data
  285. data._entityName = "com.kingdee.eas.hr.affair.app.ResignBizBill"
  286. data.ismobile = "true"
  287. }
  288. // 获取头部信息
  289. function initHeader() {
  290. mbos.eas.invokeScript({
  291. name: "commonOSFservice",
  292. param: ['getMobileUserInfoService', JSON.stringify({})],
  293. success: function (res) {
  294. var { personName, companyName, photo = "xxx", positionName, departmentName, personNumber, hrOrgUnit } = res
  295. _person.name = personName
  296. _person.id = easContext.person.id
  297. console.log(easContext.person)
  298. _person.bosType = easContext.person.bosType
  299. _hrOrgUnit = hrOrgUnit // id name
  300. $("#applicationHistory").text(localeResource.msg7)
  301. console.log($("#application_number"), personNumber, "per")
  302. $("#application_img").attr("src", photo ? "data:image/png;base64," + photo : '/mbos/store/4000148/'+mbos.pageInfo.path+'/default.png')
  303. $("#application_name").text(personName)
  304. $("#application_number").text(personNumber)
  305. $("#application_job").text(positionName + (departmentName ? (" | " + departmentName) : ""))
  306. $("#application_company").text(companyName);
  307. mbos("entrys_oldAdminOrg", 0).value({ name: res.adminName, id: res.adminId });
  308. mbos("entrys_oldPosition", 0).value({ name: res.positionName, id: res.positionId });
  309. mbos("entrys_oldJobGrade", 0).value({ name: res.jobGradeName, id: res.jobGradeId });
  310. mbos("entrys_oldJobLevel", 0).value({ name: res.jobLevelName, id: res.jobLevelId });
  311. $(".header_container").css("visibility", "visible")
  312. if (requestParam.operateState === "ADDNEW") {
  313. GetResignEmpBillNum()
  314. }
  315. setTimeout(function(){
  316. var dataSubmit = mbos('entity').value();
  317. mbos('nextperson1').checkParticipantPerson({
  318. editdata: dataSubmit,
  319. callback: function(){
  320. var nextPerson = mbos('entity').data.workflowNextPerson;
  321. }
  322. });
  323. },1000);
  324. },
  325. error: function (e) {
  326. $("#applicationHeader").hide()
  327. }
  328. })
  329. }
  330. //是否存在在途的单据
  331. function getExistResignBillInfo() {
  332. mbos.eas.invokeScript({
  333. name: "commonOSFservice",
  334. param: ['GetExistResignBillInfoService', JSON.stringify({})],
  335. success: function (res) {
  336. if (res.isExist) {
  337. mbos.ui.open({
  338. path: mbos.pageInfo.path,
  339. name: "billDetail.editui",
  340. params: {
  341. billID: mbos("entity").value().id,
  342. }
  343. });
  344. }
  345. },
  346. error: function (e) {
  347. console.log(e);
  348. }
  349. })
  350. }
  351. //检查员工有待办任务时是否允许提交离职申请
  352. function CheckResignAssign(callback) {
  353. initEntityDataBeforeRequest()
  354. var data = mbos('entity').data
  355. console.log(data, "检查员工有待办任务时是否允许提交离职申请 data--------")
  356. mbos.eas.invokeScript({
  357. name: "commonOSFservice",
  358. param: ['CheckResignAssignService', JSON.stringify({ model: data })],
  359. success: function (res) {
  360. var { isContainAssign, isResignCheck, assignMsg } = res
  361. if (isContainAssign) {
  362. if (isResignCheck) {
  363. mbos.ui.showConfirm({
  364. title: assignMsg,
  365. msg: "",
  366. callback: function (data) {
  367. if (data == 0) {
  368. callback && callback()
  369. }
  370. }
  371. });
  372. } else {
  373. mbos.ui.showInfo({ title: assignMsg, msg: "" });
  374. }
  375. } else {
  376. callback && callback()
  377. }
  378. },
  379. error: function (data) {
  380. if (typeof (data) == "string") {
  381. mbos.msgBox.showError("", data);
  382. } else {
  383. mbos.msgBox.showError({ ...data, msg: "" });
  384. }
  385. }
  386. })
  387. }
  388. // 保存和提交前校验业务数据
  389. function CheckResignBillInfoService(callback, fallback) {
  390. var data = mbos('entity').data
  391. mbos.eas.invokeScript({
  392. name: "commonOSFservice",
  393. param: ['CheckResignBillInfoService', JSON.stringify({ model: data })],
  394. success: function (res) {
  395. callback && callback()
  396. },
  397. error: function (data) {
  398. if (typeof (data) == "string") {
  399. mbos.msgBox.showError("", data);
  400. } else {
  401. mbos.msgBox.showError({ ...data, msg: "" });
  402. }
  403. }
  404. })
  405. }
  406. // 是否申请记录存在单据
  407. function checkIsExistResignBill() {
  408. mbos.eas.invokeScript({
  409. name: "commonOSFservice",
  410. param: ['IsExistResignBillRecordsService', JSON.stringify({})],
  411. success: function (res) {
  412. if (res.isExist) {
  413. $("#applicationHistory").show()
  414. }
  415. },
  416. error: function (e) {
  417. console.log(e);
  418. }
  419. })
  420. }
  421. // 获取单据编号
  422. function GetResignEmpBillNum() {
  423. var data = {
  424. hrOrgUnitId: _hrOrgUnit.id,
  425. businessType: 3,
  426. personId: _person.id
  427. }
  428. mbos.eas.invokeScript({
  429. name: "commonOSFservice",
  430. param: ['GetResignEmpBillNumService', JSON.stringify(data)],
  431. success: function (res) {
  432. if (res.respObj) {
  433. mbos('number').value(res.respObj)
  434. } else {
  435. mbos('number').show()
  436. }
  437. },
  438. error: function (data) {
  439. if (typeof (data) == "string") {
  440. mbos.msgBox.showError("", data);
  441. } else {
  442. mbos.msgBox.showError({ ...data, msg: "" });
  443. }
  444. }
  445. })
  446. }
  447. _this.bdczchange = function (event) {
  448. console.log(_HRBizDefine)
  449. console.log(event)
  450. var { outEmpType, affairActionReason, variationReason } = _HRBizDefine.find((item) => item.id === event.new_value.id) || { outEmpType: [], affairActionReason: [], variationReason: [] }
  451. var sec = outEmpType.map((item) => "'" + item.number + "'");
  452. var thrid = affairActionReason.map((item) => "'" + item.number + "'");
  453. var fourth = variationReason.map((item) => "'" + item.number + "'");
  454. if (sec.length === 1) mbos("entrys.oldEmpType", 0).value(outEmpType[0])
  455. if (thrid.length === 1) mbos("entrys.affairActionReason", 0).value(affairActionReason[0])
  456. if (fourth.length === 1) mbos("entrys.variationReason", 0).value(variationReason[0])
  457. if (sec.length === 0) { sec = ['"xnull"'] }
  458. if (thrid.length === 0) { thrid = ['"xnull"'] }
  459. if (fourth.length === 0) { fourth = ['"xnull"'] }
  460. mbos("entrys.oldEmpType", 0).attr('dynamicFilter', 'number in (' + sec.join(",") + ')');
  461. mbos("entrys.affairActionReason", 0).attr('dynamicFilter', 'number in (' + thrid.join(",") + ')');
  462. mbos("entrys.variationReason", 0).attr('dynamicFilter', 'number in (' + fourth.join(",") + ')');
  463. }
  464. function getEditData() {
  465. mbos('entity').data.fromMbos = true;
  466. return mbos('entity').data;
  467. }
  468. function save(e) {
  469. var vali = mbos.ng.invokeAllScope("validate", { method: "save" });
  470. if (!vali) {
  471. return;
  472. }
  473. if (e.isvaliSuccess === false) {
  474. return;
  475. }
  476. // this should be a init Action! TODO
  477. mbos.post({
  478. url: "/mbos/editpage/save",
  479. param: {
  480. "bostype": getEditData().bosType,
  481. "model": JSON.stringify(getEditData()),
  482. "uiname": requestParam.name
  483. },
  484. success: function (data) {
  485. event = event || {};
  486. angular.extend(event, data);
  487. mbos.page.fire("afterSave", event);
  488. },
  489. error: function (data) {
  490. if (typeof (data) == "string") {
  491. mbos.msgBox.showError("", data);
  492. } else {
  493. mbos.msgBox.showError({ ...data, msg: "" });
  494. }
  495. }
  496. });
  497. }
  498. function submit(e) {
  499. console.log(111111)
  500. var vali = mbos.ng.invokeAllScope("validate", { method: "submit" });
  501. if (!vali) {
  502. return;
  503. }
  504. if (e.isvaliSuccess === false) {
  505. return;
  506. }
  507. //
  508. if (requestParam.isfromlcjs) {
  509. getEditData().isfromlcjs = requestParam.isfromlcjs;
  510. }
  511. if (requestParam.ssotype == "workflow") {
  512. getEditData().isfromlcjs = requestParam.isfromlcjs;
  513. }
  514. if (e.isvaliSuccess === false) {
  515. return;
  516. }
  517. mbos.post({
  518. url: "/mbos/editpage/submit",
  519. param: { "bostype": getEditData().bosType, "uiname": requestParam.name, "model": JSON.stringify(getEditData()) },
  520. success: function (data) {
  521. event = event || {};
  522. if (requestParam.ssotype == "workflow") {
  523. window.parent.postMessage("hasmbos", "*");
  524. return;
  525. }
  526. mbos.page.fire("afterSubmit", event);
  527. //mbos._invoke("afterSubmit", event);
  528. },
  529. error: function (data) {
  530. if (typeof (data) == "string") {
  531. mbos.msgBox.showError("", data);
  532. } else {
  533. mbos.msgBox.showError({ ...data, msg: "" });
  534. }
  535. }
  536. });
  537. };
  538. // 离职日期和最后工作日期是否同一天
  539. function CheckDefaultSameDayService(date, callback) {
  540. var data = {
  541. personId: easContext.person.id,
  542. hrOrgUnitId: _hrOrgUnit.id,
  543. date: date
  544. }
  545. mbos.eas.invokeScript({
  546. name: "commonOSFservice",
  547. param: ['CheckDefaultSameDayService', JSON.stringify(data)],
  548. success: function (res) {
  549. console.log(res, 'res--------------')
  550. if (res.respCode == "000000") {
  551. isDefaultSameday = res.respObj.isDefaultSameday
  552. isSameDatePersonChange = res.respObj.isSameDatePersonChange
  553. isResignNextMonth = res.respObj.isResignNextMonth
  554. var bizDate = res.respObj.bizDate
  555. console.log(bizDate, '--bizDate-----')
  556. if (bizDate) {
  557. mbos('entrys.bizDate', 0).value(bizDate)
  558. }
  559. callback && callback()
  560. }
  561. },
  562. error: function (data) {
  563. if (typeof (data) == "string") {
  564. mbos.msgBox.showError("", data);
  565. } else {
  566. mbos.msgBox.showError({ ...data, msg: "" });
  567. }
  568. }
  569. })
  570. }
  571. Date.prototype.format = function (fmt) {
  572. var o = {
  573. "M+": this.getMonth() + 1, //月份
  574. "d+": this.getDate(), //日
  575. "H+": this.getHours(), //小时
  576. "m+": this.getMinutes(), //分
  577. "s+": this.getSeconds(), //秒
  578. "q+": Math.floor((this.getMonth() + 3) / 3), //季度
  579. "S": this.getMilliseconds() //毫秒
  580. };
  581. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  582. for (var k in o)
  583. if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
  584. return fmt;
  585. }
  586. _this.suggestchange = function (event) {
  587. var value = event.new_value
  588. if (value.length >= 200) {
  589. mbos.ui.showInfo({ title: localeResource.msg52 });
  590. mbos('textarea2', 0).value(value.substr(0, 200))
  591. }
  592. }
  593. ////202503加入社保数据校验;
  594. _this.ces_change = function(event){
  595. var value = event.new_value.value;
  596. if(value == 0 ){
  597. //添加图标,并且图标放入控件的后面
  598. $('#entrys_suspensionDate_0 label').append('<span class="must_input_icon ng-scope" style="margin-left:5px; color: red;">*</span>');
  599. $('#entrys_deduction_0 label').append('<span class="must_input_icon ng-scope" style="margin-left:5px; color: red;">*</span>');
  600. $('#entrys_otherSocialInfo_0 label').append('<span class="must_input_icon ng-scope" style="margin-left:5px; color: red;">*</span>');
  601. }else{
  602. //移除图标
  603. $('#entrys_suspensionDate_0 label span').remove();
  604. $('#entrys_deduction_0 label span').remove();
  605. $('#entrys_otherSocialInfo_0 label span').remove();
  606. }
  607. }
  608. //校验方法//202503加入社保数据校验;
  609. function opValidate() {
  610. var cesEnum = mbos('entrys_fiveinsurances_0').value().value;
  611. var sionDate = mbos('entrys_suspensionDate_0').value();
  612. var deducVal = mbos('entrys_deduction_0').value();
  613. var otherSo = mbos('entrys_otherSocialInfo_0').value();
  614. var isValid = true;
  615. var errorMsg = "";
  616. //如果cesEnum == 0 并且sionDate或deducVal或otherSo其中一个为空或者不存在,则提示不能为空
  617. if (cesEnum == 0 && (!sionDate || !deducVal || !otherSo)) {
  618. isValid = false;
  619. errorMsg = "社保结算信息必填,请检查!";
  620. }
  621. if (!isValid) {
  622. mbos.ui.showError({ title: errorMsg });
  623. return false;
  624. }
  625. return true;
  626. }