Bladeren bron

mbos更新

yuanzhi_kuang 5 maanden geleden
bovenliggende
commit
461faab94e

+ 253 - 0
mbos/88/备份/出差单_备份.js

@@ -0,0 +1,253 @@
+_this.pageinit = function () {
+    newPageInit()
+  }
+  // 从其他页面跳过来时,获取日期
+  function setDate() {
+    var date = moment(mbos.getRequestParams().date).format('YYYY-MM-DD')
+    if (date && mbos.getRequestParams().operateState == 'ADDNEW') {
+      mbos('entries_tripStartTime', 0).value(date + ' 08:00')
+      getStartEndTime(0)
+    }
+  }
+  
+  // 过滤出差类型F7 传递变量 ,dsQuery1为出差类型数据源的id
+  mbos('dsQuery1').bind('beforeLoad', function (e) {
+    var params = setParams('getTripTypeFilter', e.index) // 获取参数
+    mbos.variable.setValue("v_entry", encodeURIComponent(JSON.stringify(params))); //赋值给变量
+  })
+  
+  // 	在页面初始化加载之后
+  mbos('page').bind('afterLoad', function () {
+    _this.path = mbos.pageInfo.path// 轻应用的路径编码 例如 trip880
+    _this.detailPageCode = mbos.pageInfo.name.replace('Add', 'View') // 详情页面的编码 (个别页面可特殊处理直接写入) 例如 tripView.editui
+    _this.operateState = mbos.getRequestParams().operateState // 'ADDNEW' 'EDIT' 'VIEW'
+    // 初始化审批流
+    // mbos('nextperson1').checkParticipantPerson({
+    //   "callback": function () { }
+    // });
+    //   单据说明
+    mbos('description').bind('click', function () {
+      handleClickDesc()
+    })
+  })
+  mbos('entries').bind('afterRendered', function (e) {
+    showTimeZone(e.index)
+    multiLangField(e.index)// 兼容多语言字段回显的问题
+    if (e.index == 0) {
+      setDate()
+      // 初始化审批流
+        _this.getNextPerson();
+    }
+  })
+  // 初始化审批流
+  _this.getNextPerson = function(){
+    var entries = setModel('getNextPerson');
+    var data = JSON.parse(JSON.stringify(mbos('entity').value()));
+    data.entries = JSON.parse(JSON.stringify(entries));
+    var date = mbos.getRequestParams().date || new Date()
+    var today = moment(date).format('YYYY-MM-DD')
+    var beginTime = today + ' 00:00';
+    var endTime = today + ' 23:59';
+    mbos.eas.invokeScript({
+      name: "getHROrgUnit",
+      param: [{'beginTime': beginTime, 'endTime':endTime}],
+      success: function (res) {
+        console.log(res)
+        if(res.hrOrgUnitId){
+          data.hrOrgUnit = res.hrOrgUnitId
+        }
+        mbos('nextperson1').checkParticipantPerson({
+          'editdata': data,
+          "callback": function () { }
+        });
+      }
+    })
+  }
+  // 是否展示时区
+  function showTimeZone(index) {
+    var callback = function (res) {
+      if (res.data == 'true') {
+        mbos('entries_timeZone', index).show()
+      }
+    }
+    setModel()
+    baseInterface('isShowTimezone', callback, index)
+  }
+  // 保存按钮
+  _this.save = function (event) {
+    setModel()
+    baseInterface('save', toView) // 调用保存接口
+  }
+  // 提交按钮
+  _this.submit = function (event) {
+      // 确认提交 弹框
+    mbos.ui.showConfirm({
+      title: localeResource.confirmSubmit,
+      iconclass: "kdfont kdfont-zhuangtai_jingshi the_info",
+      callback: function (data) {
+        if (data == 0) {     
+          setModel()
+          baseInterface('submit', toView) // 调用提交接口
+        }
+      }
+    });
+  
+  }
+  
+  // 点击“保存、提交” 跳转页面
+  function toView(res) {
+    // 提交接口 返回的res.data为数组,取第一条数据
+    if (res.data.keyValue || (res.data.length > 0 && res.data[0].keyValue)) {
+      // 操作成功 提示弹框
+      mbos.ui.showInfo({
+        title: localeResource.succeed,
+        iconclass: "kdfont kdfont-zhuangtai_wancheng the_success",
+        callback: function () {
+          openPage(_this.path, _this.detailPageCode, { billID: res.data.keyValue || res.data[0].keyValue })
+        }
+      });
+    }
+  }
+  // 给隐藏的model赋值
+  function setModel(method) {
+    if (typeof _this.operateState != "undefined" && (_this.operateState === "ADDNEW" || _this.operateState === "EDIT")) {
+      var entries = mbos('entity').data.entries
+      entries.map(function (entry) {
+        entry.person = easContext.person
+        entry.position = easContext.position
+        entry.adminOrgUnit = easContext.position.adminOrgUnit
+        getEntries(entry,method) // 各单据处理分录数据
+      })
+      return entries
+    }
+  }
+  // 各单据处理分录数据的函数
+  function getEntries(entry,method) {
+    entry.startTimeHMS = entry.tripStartTime
+    entry.endTimeHMS = entry.tripEndTime
+    if(method == 'getNextPerson'){
+      // entry.position = easContext.position.id;
+      // entry.adminOrgUnit = easContext.position.adminOrgUnit.id;
+      if(entry.startTimeHMS){
+        entry.startTimeHMS = moment(entry.startTimeHMS).format('YYYY-MM-DD HH:mm:ss')
+      }
+      if(entry.tripStartTime){
+        entry.tripStartTime = moment(entry.tripStartTime).format('YYYY-MM-DD HH:mm:ss')
+      }
+      if(entry.endTimeHMS){
+        entry.endTimeHMS = moment(entry.endTimeHMS).format('YYYY-MM-DD HH:mm:ss')
+      }
+      if(entry.tripEndTime){
+        entry.tripEndTime = moment(entry.tripEndTime).format('YYYY-MM-DD HH:mm:ss')
+      }
+    }else{
+      // delete entry.position;
+      // delete entry.adminOrgUnit;
+      
+    }
+  }
+  // 计算单据时长
+  function getTimeLength(index) {
+    var callback = function (res) {
+      mbos('entries_tripDays', index).value(res.data)
+    }
+    setModel(index)
+    var entry = mbos('entity').data.entries[index]
+    if (entry.tripEndTime && entry.tripStartTime) {
+      baseInterface('getBillLength', callback, index)
+    }
+  }
+  // 根据时间判断 是否展示弹性算时长字段
+  function isElastic(index) {
+    var callback = function (res) {
+      if (res.data) {
+        mbos('entries_isElasticCalLen', index).show()
+      }
+    }
+    setModel(index)
+    var entry = mbos('entity').data.entries[index]
+    if (entry.tripEndTime && entry.tripStartTime) {
+      baseInterface('showIsElasticCalCtrl', callback, index)
+    }
+  }
+  // 获取整天的开始、结束时间
+  function getStartEndTime(i) {
+    var callback = function (res) {
+      mbos('entries_tripStartTime', i).value(moment(res.data.beginTime).format('YYYY-MM-DD HH:mm'))
+      mbos('entries_tripEndTime', i).value(moment(res.data.endTime).format('YYYY-MM-DD HH:mm'))
+      
+    }
+    if (mbos('entries_tripStartTime', i).value() || mbos('entries_tripEndTime', i).value()){
+      setModel(i)
+      var params = _.cloneDeep(mbos('entity').data)
+      var endTime = params.entries[i].tripEndTime
+      if (endTime && endTime.includes('00:00')) { // 防止结束日期会一直触发 
+        params.entries[i].tripEndTime = moment(endTime).subtract(1, "minutes").format("YYYY-MM-DD HH:mm")
+      }
+      // 【BT-01684276】改为传一条分录数据
+      params.entries = [params.entries[i]];
+      baseInterface('getAllDayBeginAndEndTime', callback, i, params)
+    }
+  }
+  
+  // 如果是整天出差 则使用date;否则使用datetime,同时清空时长
+  function recalcTime(event) {
+    mbos('entries_tripDays', event.index).value('')
+    if (String(event.new_value) == 'true') {
+      var entry = mbos('entity').data.entries[event.index]
+      if (entry.tripEndTime || entry.tripStartTime) {
+        getStartEndTime(event.index) // 获取pc端配置的起止时间
+        //  _this.startHadCalculate = true // 阻止二次触发 出差单整天时 开始时间触发问题
+        // _this.endHadCalculate = true // 阻止二次触发
+      }
+    }
+  }
+  
+  // 计算时长
+  _this.calTime1 = function (event) {
+    getTimeLength(event.index)
+    isElastic(event.index)
+    if (String(mbos('entries_isAllDay', event.index).value()) == 'true' && !Boolean(_this.startHadCalculate)) {
+      getStartEndTime(event.index)
+      // _this.startHadCalculate = true // 阻止二次触发
+    } else {
+      _this.startHadCalculate = false
+    }
+      console.log('startHadCalculate', _this.startHadCalculate)
+  }
+  _this.calTime2 = function (event) {
+    getTimeLength(event.index)
+    isElastic(event.index)
+    if (String(mbos('entries_isAllDay', event.index).value()) == 'true' && !Boolean(_this.endHadCalculate)) {
+      getStartEndTime(event.index)
+      // _this.endHadCalculate = true// 阻止二次触发
+    } else {
+      _this.endHadCalculate = false
+    }
+      console.log('endHadCalculate', _this.endHadCalculate)
+  }
+  // 监听是否整天
+  _this.calTime3 = function (event) {
+    getTimeLength(event.index)
+    recalcTime(event)
+  }
+  // 监听弹性
+  _this.calTime4 = function (event) {
+    getTimeLength(event.index)
+  }
+  
+  // 时长更改时 做校验
+  _this.lengthChange = function(event){
+    var value = event.new_value
+    //   判断是否小于0
+    if (!isNaN(parseFloat(value)) && value < 0) {
+      mbos.msgBox.showError(localeResource.lengthValid);
+      setTimeout(()=>{
+        mbos('entries_tripDays',event.index).value(0)
+      })
+      return
+    }
+    
+  }
+          
+  

+ 72 - 0
mbos/88/备份/出差单_查看_备份.js

@@ -0,0 +1,72 @@
+// 	在页面初始化加载之后  
+mbos('page').bind('afterLoad', function () {
+    _this.operateState = mbos.getRequestParams().operateState // 页面状态
+    _this.path = mbos.pageInfo.path // 轻应用的路径编码
+    _this.editPageCode = mbos.pageInfo.name.replace('View', 'Add') // 详情页面的编码 (个别页面可特殊处理直接写入)
+    _this.title = localeResource.Travel_Request
+    toggleEntry() // 折叠\展开实体分录
+    toggleApprove() // 折叠\展开 审批流程
+    
+     _this.decimal = 4
+    getDecimal()// 获取pc配置的小数点数
+  })
+  mbos('entity').bind('afterLoad', function () {
+    initCommon(_this.title)// 初始化公共部分
+  })
+  
+  mbos('editgrid1').bind('afterRendered', function (e) {
+    activedEntry() // 保证蓝色的下标在对应分录上
+    var index = e.index
+    initPage() // 页面初始化时数据调整
+    timeStyle(e) // 起止时间的样式优化展示
+    // 是否展示弹性算时长字段
+    mbos('entries_isElasticCalLen', index).value() ? mbos('entries_isElasticCalLen', index).show(): mbos('entries_isElasticCalLen', index).hide()
+    $('#timeLength_' + index).find('label')[0].innerHTML = (mbos('timeLengthValue', index).value()).toFixed(_this.decimal) + localeResource.days;
+    $("[id^='entries_remark'] textarea").attr('rows', 3) // 多行文本 默认3行
+    $("[id^='entries_tripReason'] textarea").attr('rows', 3) // 多行文本 默认3行
+  })
+  // 获取pc配置的小数点数 默认为小数点后四位
+  function getDecimal(i){
+    var callback = function(res){
+      _this.decimal = res.data.decimalPlaceSystem || 4
+      
+    }
+    baseInterface('getDecimalPlace', callback) // 获取小数点数
+  }
+  // 编辑
+  _this.edit = function (event) {
+    editHandle(_this.path, _this.editPageCode)
+  }
+  // 删除
+  _this.delete = function (event) {
+    deleteHandle()
+  }
+  
+  // 撤回
+  _this.recall = function (event) {
+    // 未审批
+    recallHandle()
+  }
+  
+  // 提交
+  _this.toSubmit = function (event) {
+    submitHandle()
+  }
+  
+  // 分录中 时间的样式优化展示
+  function timeStyle(e) {
+    //   开始时间
+    var start = mbos('startTime', e.index).value().split(" ");
+    $('#sTime_' + e.index).find('label')[0].innerHTML = start[1];
+    $('#sDate_' + e.index).find('label')[0].innerHTML = start[0];
+    // 结束时间
+    var end = mbos('endTime', e.index).value().split(" ");
+    $('#eTime_' + e.index).find('label')[0].innerHTML = end[1];
+    $('#eDate_' + e.index).find('label')[0].innerHTML = end[0];
+    // 时长及箭头图标
+    $('#timeLength_' + e.index).find('label')[0].innerHTML = mbos('timeLengthValue', e.index).value() + localeResource.days;
+    $('#timeLength_' + e.index).find('label').addClass("lengthBottom");
+    $("#arrow_" + e.index).find('label').addClass("arrowIcon");
+  }
+          
+  

+ 255 - 0
mbos/88/备份/我要出差.js

@@ -0,0 +1,255 @@
+_this.pageinit = function () {
+  newPageInit()
+}
+// 从其他页面跳过来时,获取日期
+function setDate() {
+  var date = moment(mbos.getRequestParams().date).format('YYYY-MM-DD')
+  if (date && mbos.getRequestParams().operateState == 'ADDNEW') {
+    mbos('entries_tripStartTime', 0).value(date + ' 08:00')
+    getStartEndTime(0)
+  }
+}
+
+// 过滤出差类型F7 传递变量 ,dsQuery1为出差类型数据源的id
+mbos('dsQuery1').bind('beforeLoad', function (e) {
+  var params = setParams('getTripTypeFilter', e.index) // 获取参数
+  mbos.variable.setValue("v_entry", encodeURIComponent(JSON.stringify(params))); //赋值给变量
+})
+
+// 	在页面初始化加载之后
+mbos('page').bind('afterLoad', function () {
+  _this.path = mbos.pageInfo.path// 轻应用的路径编码 例如 trip880
+  _this.detailPageCode = mbos.pageInfo.name.replace('Add', 'View') // 详情页面的编码 (个别页面可特殊处理直接写入) 例如 tripView.editui
+  _this.operateState = mbos.getRequestParams().operateState // 'ADDNEW' 'EDIT' 'VIEW'
+  // 初始化审批流
+  // mbos('nextperson1').checkParticipantPerson({
+  //   "callback": function () { }
+  // });
+  //   单据说明
+  mbos('description').bind('click', function () {
+    handleClickDesc()
+  })
+})
+mbos('entries').bind('afterRendered', function (e) {
+  showTimeZone(e.index)
+  multiLangField(e.index)// 兼容多语言字段回显的问题
+  if (e.index == 0) {
+    setDate()
+    // 初始化审批流
+  	_this.getNextPerson();
+  }
+})
+// 初始化审批流
+_this.getNextPerson = function(){
+  var entries = setModel('getNextPerson');
+  var data = JSON.parse(JSON.stringify(mbos('entity').value()));
+  data.entries = JSON.parse(JSON.stringify(entries));
+  var date = mbos.getRequestParams().date || new Date()
+  var today = moment(date).format('YYYY-MM-DD')
+  var beginTime = today + ' 00:00';
+  var endTime = today + ' 23:59';
+  mbos.eas.invokeScript({
+    name: "getHROrgUnit",
+    param: [{'beginTime': beginTime, 'endTime':endTime}],
+    success: function (res) {
+      console.log(res)
+      if(res.hrOrgUnitId){
+        data.hrOrgUnit = res.hrOrgUnitId
+      }
+      mbos('nextperson1').checkParticipantPerson({
+        'editdata': data,
+        "callback": function () { }
+      });
+    }
+  })
+}
+// 是否展示时区
+function showTimeZone(index) {
+  var callback = function (res) {
+    if (res.data == 'true') {
+      mbos('entries_timeZone', index).show()
+    }
+  }
+  setModel()
+  baseInterface('isShowTimezone', callback, index)
+}
+// 保存按钮
+_this.save = function (event) {
+  setModel()
+  baseInterface('save', toView) // 调用保存接口
+}
+// 提交按钮
+_this.submit = function (event) {
+    // 确认提交 弹框
+  mbos.ui.showConfirm({
+    title: localeResource.confirmSubmit,
+    iconclass: "kdfont kdfont-zhuangtai_jingshi the_info",
+    callback: function (data) {
+      if (data == 0) {     
+        setModel()
+        baseInterface('submit', toView) // 调用提交接口
+      }
+    }
+  });
+
+}
+
+// 点击“保存、提交” 跳转页面
+function toView(res) {
+  // 提交接口 返回的res.data为数组,取第一条数据
+  if (res.data.keyValue || (res.data.length > 0 && res.data[0].keyValue)) {
+    // 操作成功 提示弹框
+    mbos.ui.showInfo({
+      title: localeResource.succeed,
+      iconclass: "kdfont kdfont-zhuangtai_wancheng the_success",
+      callback: function () {
+        openPage(_this.path, _this.detailPageCode, { billID: res.data.keyValue || res.data[0].keyValue })
+      }
+    });
+  }
+}
+// 给隐藏的model赋值
+function setModel(method) {
+  if (typeof _this.operateState != "undefined" && (_this.operateState === "ADDNEW" || _this.operateState === "EDIT")) {
+    var entries = mbos('entity').data.entries
+    entries.map(function (entry) {
+      entry.person = easContext.person
+      entry.position = easContext.position
+      entry.adminOrgUnit = easContext.position.adminOrgUnit
+      getEntries(entry,method) // 各单据处理分录数据
+    })
+	return entries
+  }
+}
+// 各单据处理分录数据的函数
+function getEntries(entry,method) {
+  entry.startTimeHMS = entry.tripStartTime
+  entry.endTimeHMS = entry.tripEndTime
+  if(method == 'getNextPerson'){
+    // entry.position = easContext.position.id;
+    // entry.adminOrgUnit = easContext.position.adminOrgUnit.id;
+    if(entry.startTimeHMS){
+      entry.startTimeHMS = moment(entry.startTimeHMS).format('YYYY-MM-DD HH:mm:ss')
+    }
+    if(entry.tripStartTime){
+      entry.tripStartTime = moment(entry.tripStartTime).format('YYYY-MM-DD HH:mm:ss')
+    }
+    if(entry.endTimeHMS){
+      entry.endTimeHMS = moment(entry.endTimeHMS).format('YYYY-MM-DD HH:mm:ss')
+    }
+    if(entry.tripEndTime){
+      entry.tripEndTime = moment(entry.tripEndTime).format('YYYY-MM-DD HH:mm:ss')
+    }
+  }else{
+    // delete entry.position;
+    // delete entry.adminOrgUnit;
+    
+  }
+}
+// 计算单据时长
+function getTimeLength(index) {
+  var callback = function (res) {
+    mbos('entries_tripDays', index).value(res.data)
+    res.data / 7.0
+
+
+  }
+  setModel(index)
+  var entry = mbos('entity').data.entries[index]
+  if (entry.tripEndTime && entry.tripStartTime) {
+    baseInterface('getBillLength', callback, index)
+  }
+}
+// 根据时间判断 是否展示弹性算时长字段
+function isElastic(index) {
+  var callback = function (res) {
+    if (res.data) {
+      mbos('entries_isElasticCalLen', index).show()
+    }
+  }
+  setModel(index)
+  var entry = mbos('entity').data.entries[index]
+  if (entry.tripEndTime && entry.tripStartTime) {
+    baseInterface('showIsElasticCalCtrl', callback, index)
+  }
+}
+// 获取整天的开始、结束时间
+function getStartEndTime(i) {
+  var callback = function (res) {
+    mbos('entries_tripStartTime', i).value(moment(res.data.beginTime).format('YYYY-MM-DD HH:mm'))
+    mbos('entries_tripEndTime', i).value(moment(res.data.endTime).format('YYYY-MM-DD HH:mm'))
+    
+  }
+  if (mbos('entries_tripStartTime', i).value() || mbos('entries_tripEndTime', i).value()){
+    setModel(i)
+    var params = _.cloneDeep(mbos('entity').data)
+    var endTime = params.entries[i].tripEndTime
+    if (endTime && endTime.includes('00:00')) { // 防止结束日期会一直触发 
+      params.entries[i].tripEndTime = moment(endTime).subtract(1, "minutes").format("YYYY-MM-DD HH:mm")
+    }
+    // 【BT-01684276】改为传一条分录数据
+    params.entries = [params.entries[i]];
+    baseInterface('getAllDayBeginAndEndTime', callback, i, params)
+  }
+}
+
+// 如果是整天出差 则使用date;否则使用datetime,同时清空时长
+function recalcTime(event) {
+  mbos('entries_tripDays', event.index).value('')
+  if (String(event.new_value) == 'true') {
+    var entry = mbos('entity').data.entries[event.index]
+    if (entry.tripEndTime || entry.tripStartTime) {
+      getStartEndTime(event.index) // 获取pc端配置的起止时间
+      //  _this.startHadCalculate = true // 阻止二次触发 出差单整天时 开始时间触发问题
+      // _this.endHadCalculate = true // 阻止二次触发
+    }
+  }
+}
+
+// 计算时长
+_this.calTime1 = function (event) {
+  getTimeLength(event.index)
+  isElastic(event.index)
+  if (String(mbos('entries_isAllDay', event.index).value()) == 'true' && !Boolean(_this.startHadCalculate)) {
+    getStartEndTime(event.index)
+    // _this.startHadCalculate = true // 阻止二次触发
+  } else {
+    _this.startHadCalculate = false
+  }
+    console.log('startHadCalculate', _this.startHadCalculate)
+}
+_this.calTime2 = function (event) {
+  getTimeLength(event.index)
+  isElastic(event.index)
+  if (String(mbos('entries_isAllDay', event.index).value()) == 'true' && !Boolean(_this.endHadCalculate)) {
+    getStartEndTime(event.index)
+    // _this.endHadCalculate = true// 阻止二次触发
+  } else {
+    _this.endHadCalculate = false
+  }
+    console.log('endHadCalculate', _this.endHadCalculate)
+}
+// 监听是否整天
+_this.calTime3 = function (event) {
+  getTimeLength(event.index)
+  recalcTime(event)
+}
+// 监听弹性
+_this.calTime4 = function (event) {
+  getTimeLength(event.index)
+}
+
+// 时长更改时 做校验
+_this.lengthChange = function(event){
+  var value = event.new_value
+  //   判断是否小于0
+  if (!isNaN(parseFloat(value)) && value < 0) {
+    mbos.msgBox.showError(localeResource.lengthValid);
+    setTimeout(()=>{
+      mbos('entries_tripDays',event.index).value(0)
+    })
+    return
+  }
+  
+}
+        

+ 183 - 0
mbos/ganbudanan.js

@@ -0,0 +1,183 @@
+// 脚本文件
+$(document).ready(function() {
+    var currentLevel = 0; // 当前层级
+    var breadcrumbs = []; // 面包屑数组
+    var breadcrumbIds = []; // 面包屑数组
+
+    function loadOrganizations(parentId) {
+        var param =  {"orgId": parentId, "checkType":"1","isOfficer":1};
+        mbos.eas.invokeScript({
+            name: "commonOSFservice",
+            param: ['GetAdminInfoService', JSON.stringify(param)],
+            success: function (res) {
+                if (res && res.length > 0) {
+                    renderOrganizations(res);
+                }else{
+                    //调用加载员工的方法
+                    loadEmployees(parentId);
+                }
+            },
+            error: function (data) {
+              if (typeof (data) == "string") {
+                mbos.msgBox.showError("", data);
+              } else {
+                mbos.msgBox.showError({ ...data, msg: "" });
+              }
+            }
+        })
+        
+    }
+        
+    
+
+
+    function renderOrganizations(organizations) {
+        $("#sub-organization-label").text("下级部门");
+        $('#organization-tree').empty();
+        organizations.forEach(function(org) {
+            var $orgContainer = $('<span>');    
+            var $orgName = $('<span>').text(org.name).addClass('org-name');
+            var $orgCount = $('<span>').text(' (共'+org.totalCount+'人)').addClass('org-count');
+            $orgContainer.append($orgName).append($orgCount);
+            var $li = $('<li>').append($orgContainer).addClass('organization-item')
+            $li.click(function() {
+                    if ($(this).hasClass('selected')) {
+                        loadEmployees(org.id); // 加载员工信息
+                    } else {
+                        loadOrganizations(org.id); // 加载下一级组织
+                        updateBreadcrumbs(org.name, org.id);
+                    }
+                });
+    
+            // 只有当org.count不为0时才创建$countContainer
+            if (org.count > 0) {
+                // 创建一个容器
+                var $countContainer = $('<span>');
+                // 创建 org.count 的元素并设置为浅蓝色
+                var $count = $('<span>').text('本层级人数: '+org.count+'人')
+                    .css('color', '#007bff'); // 浅蓝色
+                // var $separator = $('<span>').text(' >')
+                // .css('color', '#007bff'); // 浅蓝色
+                // 将两个元素添加到容器中
+                // $countContainer.append($count).append($separator);
+                $countContainer.append($count) ;
+                $countContainer.click(function(e) {
+                    e.stopPropagation(); // 阻止事件冒泡
+                    loadEmployees(org.id); // 查询当前组织下的所有员工
+                });
+                // 将计数添加到列表项中
+                $li.append($countContainer);
+            }
+            if (currentLevel > 0 && !org.hasChildren) {
+                $li.addClass('selected');
+            }
+            $('#organization-tree').append($li);
+        });
+    }
+
+
+    function updateBreadcrumbs(name, orgId) {
+        breadcrumbs.push(name);
+        breadcrumbIds.push(orgId);
+        renderBreadcrumbs();
+    }
+    
+    function renderBreadcrumbs() {
+        $('#breadcrumb-container').empty();
+    
+        breadcrumbs.forEach(function(crumb, index) {
+            var $span = $('<span>').addClass('breadcrumb-item')
+                .text(crumb)
+                .click(function() {
+                    breadcrumbs = breadcrumbs.slice(0, index + 1);
+                    breadcrumbIds = breadcrumbIds.slice(0, index + 1);
+                    loadOrganizations(breadcrumbIds[breadcrumbIds.length - 1]);
+        
+                    // 隐藏当前面包屑后面的分隔符和面包屑
+                    $('#breadcrumb-container').find('.breadcrumb-item').slice(index + 1).remove();
+                    $('#breadcrumb-container').find('.breadcrumb-separator').slice(index).remove();
+                });
+        
+            // 添加“ > ”作为分隔符
+            if (index > 0) {
+                $('#breadcrumb-container').append($('<span>').addClass('breadcrumb-separator').text(' > '));
+            }
+        
+            $('#breadcrumb-container').append($span);
+        });
+    }
+
+    function loadEmployees(orgId,perName) {
+        var param =  {"orgId": orgId, "perName": perName,"checkType":"1",isOfficer:1};
+        mbos.eas.invokeScript({
+            name: "commonOSFservice",
+            param: ['getPersonFromOrgService', JSON.stringify(param)],
+            success: function (res) {
+              if (res) {
+                renderEmployees(res);
+              } else {
+                mbos.msgBox.showError("无组织数据", data); 
+              }
+            },
+            error: function (data) {
+              if (typeof (data) == "string") {
+                mbos.msgBox.showError("", data);
+              } else {
+                mbos.msgBox.showError({ ...data, msg: "" });
+              }
+            }
+        })
+    }
+
+    function renderEmployees(employees) {
+        $("#sub-organization-label").text("部门成员");
+        $('#organization-tree').empty();
+        employees.forEach(function(emp) {
+            // 创建一个外部容器来包裹员工信息
+            var $li = $('<li>').addClass('organization-item').attr('empId', emp.fid)
+                .click(function() {
+                    var that = this;
+                    var empId = $(that).attr('empId');
+                    // console.log(empId);
+                    //测试环境
+                    // var eidVal = 'ding5208b4333b1d308b4ac5d6980864d335';
+                    //正式环境
+                    var eidVal = 'ding68ce57ecf9d937b324f2f5cc6abecb85';
+                    // 跳转到员工信息详情页面
+                    window.location.href = 'https://mbos.kdeascloud.com/mbos/page/loadPage?appid='+eidVal
+                    +'&path=archive9000&name=archive9000.navui&isOfficer=1&personId=' + encodeURIComponent(empId);
+                });
+    
+            // 创建员工信息的容器
+            var $infoDiv = $('<div>').addClass('info-div');  
+            // 增加员工编码
+            var $numberSpan = $('<span>').text(emp.number).addClass('number-span');  
+            // 创建一个用于员工姓名和职位的容器
+            var $detailsDiv = $('<div>').addClass('details-div');  
+            // 增加员工姓名
+            var $nameSpan = $('<span>').text(emp.name).addClass('name-span');  
+            // 增加bumen信息
+            var $posSpan = $('<span>').text(emp.depname+'  ('+emp.posname+')').addClass('pos-span');  
+            // 将员工姓名和职位信息添加到详细信息容器中
+            $detailsDiv.append($nameSpan).append($posSpan);
+            // 将员工编码和详细信息容器添加到信息容器中
+            $infoDiv.append($numberSpan).append($detailsDiv);
+            // 将整个信息容器添加到列表项中
+            $li.append($infoDiv);
+            // 将列表项添加到组织树中
+            $('#organization-tree').append($li);
+        });
+    }
+    
+
+    // 初始化加载一级组织
+    loadOrganizations('1');
+    updateBreadcrumbs("组织架构","1");
+
+    // 搜索框事件绑定
+    $('#search-button').on('click', function() {
+        var searchText = $('#search-box').val().toLowerCase();
+        loadEmployees('',searchText);
+    });
+});
+        

+ 699 - 0
mbos/leaveOffice9000_我要离职_离职申请.js

@@ -0,0 +1,699 @@
+var _person = {}
+var _hrOrgUnit = {}
+var _HRBizDefine = [] // 用户设置的变动操作
+
+var isSameDatePersonChange = null
+//是否一天多次变动 是,最后工作日等于离职日期;
+//false:根据 isDefaultSameday判断最后工作日和离职日期是否同一天
+var isDefaultSameday = null
+//最后工作日和离职日期是否同一天( true:同一天;false:最后工作日是离职日期前一天)
+var isResignNextMonth = null
+_this.pageinit = function () {
+  initHeader()
+  checkIsExistResignBill()
+  // getExistResignBillInfo()
+  // $("#btnAddnew").hide()
+  // mbos('editgrid1').addEntry()
+  if (requestParam.operateState === "ADDNEW") {
+    mbos('editgrid1').addEntry()
+    setTimeout(function () {
+      setBillId()
+      CheckDefaultSameDayService("")
+      getHRBizDefineByUiClass()
+    }, 1000)
+  }
+
+  mbos("applicationHistory").bind("click", function () {
+    mbos.ui.open({
+      path: mbos.pageInfo.path,
+      name: "bill.listui",
+    });
+  })
+
+  $("#application_img").on('error', function () {
+    $(this).attr('src', '/mbos/store/4000148/'+mbos.pageInfo.path+'/default.png');
+  });
+  
+}
+
+
+_this.edit = function (event) {
+  return page.edit && page.edit(event);
+
+}
+_this.addnew = function (event) {
+  return page.addnew && page.addnew(event);
+}
+_this.save = function (event) {
+  
+  //202503加入社保数据校验;
+  var opValiflag =  opValidate();
+  if(!opValiflag){
+    return;
+  }
+  var vali = mbos.ng.invokeAllScope("validate", { method: "save" });
+  if (!vali) {
+    return;
+  }
+  if (event.isvaliSuccess === false) {
+    return;
+  }
+
+  if (requestParam.operateState === "ADDNEW") {
+    mbos("billState").value({ isenum: true, value: 0 })
+  }
+  
+  function _save() {
+    return CheckResignBillInfoService(function () { save(event) })
+  }
+  //弱校验提示
+  CheckWeakService(_save);
+  //CheckResignAssign(_save)
+  
+}
+_this.submit = function (event) {
+  //202503加入社保数据校验;
+  var opValiflag =  opValidate();
+  if(!opValiflag){
+    return;
+  }
+
+  var vali = mbos.ng.invokeAllScope("validate", { method: "submit" });
+  if (!vali) {
+    return;
+  }
+  mbos("billState").value({ isenum: true, value: 1 })
+  
+  
+  function _submit() {
+    return CheckResignBillInfoService(function () { submit(event) })
+  }
+  //弱校验提示
+  CheckWeakService(_submit);
+  // CheckResignAssign(_submit)
+  
+}
+
+_this.back = function (event) {
+  return page.back && page.back(event);
+}
+
+_this.afterSave = function (e) {
+  if (requestParam.operateState === "ADDNEW") {
+    mbos.ui.open({
+      path: mbos.pageInfo.path,
+      name: "application.editui",
+      params: {
+        billID: e.keyValue,
+        operateState: "EDIT"
+      }
+    });
+  } else {
+
+  }
+}
+mbos('entity').bind('afterLoad', function () {
+  if (requestParam.operateState !== "ADDNEW") {
+    getHRBizDefineByUiClass()
+  }
+})
+
+// 获取变动操作联动数据
+function getHRBizDefineByUiClass() {
+  mbos.eas.invokeScript({
+    name: "commonOSFservice",
+    param: ['getHRBizDefineByUiClass', JSON.stringify({ uiClass: "com.kingdee.eas.hr.affair.app.ResignBizBill.form" })],
+    success: function (res) {
+      _HRBizDefine = res
+      var { outEmpType, affairActionReason, variationReason } = res[0] || {outEmpType:[], affairActionReason: [], variationReason: []}
+      var first = res.map((item) => "'" + item.number + "'");
+      var sec = outEmpType.map((item) => "'" + item.number + "'");
+      var thrid = affairActionReason.map((item) => "'" + item.number + "'");
+      var fourth = variationReason.map((item) => "'" + item.number + "'");
+      if (requestParam.operateState === "ADDNEW" && res.length) {
+        mbos("entrys.hrBizDefine", 0).value({ name: res[0].name, id: res[0].id, number: res[0].number });
+        if (sec.length === 1) mbos("entrys.oldEmpType", 0).value(outEmpType[0])
+        if (thrid.length === 1) mbos("entrys.affairActionReason", 0).value(affairActionReason[0])
+        if (fourth.length === 1) mbos("entrys.variationReason", 0).value(variationReason[0])
+      }
+      // 用户设置的F7选项为空时, 把过滤条件设成xnull, 否则会全部显示
+      if (first.length === 0) { first = ['"xnull"'] }
+      if (sec.length === 0) { sec = ['"xnull"'] }
+      if (thrid.length === 0) { thrid = ['"xnull"'] }
+      if (fourth.length === 0) { fourth = ['"xnull"'] }
+      // F7 选项 过滤
+      mbos("entrys.hrBizDefine", 0).attr('dynamicFilter', 'number in (' + first.join(",") + ')');
+      mbos("entrys.oldEmpType", 0).attr('dynamicFilter', 'number in (' + sec.join(",") + ')');
+      mbos("entrys.affairActionReason", 0).attr('dynamicFilter', 'number in (' + thrid.join(",") + ')');
+      mbos("entrys.variationReason", 0).attr('dynamicFilter', 'number in (' + fourth.join(",") + ')');
+
+    },
+    error: function (data) {
+      if (typeof (data) == "string") {
+        mbos.msgBox.showError("", data);
+      } else {
+        mbos.msgBox.showError({ ...data, msg: "" });
+      }
+    }
+  })
+}
+
+
+_this.bizdatachange = function (event) {
+  // isSameDatePersonChange
+  //是否一天多次变动 是,最后工作日等于离职日期;
+  //false:根据 isDefaultSameday判断最后工作日和离职日期是否同一天
+  //isDefaultSameday
+  var value = event.new_value
+  if (!value) return
+
+  CheckDefaultSameDayService(value, callback)
+
+  function callback() {
+    var nextDate = "";
+    if (isSameDatePersonChange) {
+      mbos("entrys.leftCompanyDate", 0).value(value);
+    } else {
+      if (isDefaultSameday) {
+        mbos("entrys.leftCompanyDate", 0).value(value)
+      } else {
+        var prev = getPrevDate(value)
+        mbos("entrys.leftCompanyDate", 0).value(prev)
+      }
+    }
+  }
+
+}
+
+//后一天
+function getNextDate(value) {
+  var date = new Date(value)
+  var nextDate =  new Date(date.getTime() + 24 * 60 * 60 * 1000)
+  nextDate = nextDate.format('yyyy-MM-dd')
+  return nextDate
+}
+
+function getPrevDate(value, day) {
+  var date = new Date(value)
+  var prevDate = day ? new Date(date.getTime() + day * 24 * 60 * 60 * 1000) : new Date(date.getTime() - 24 * 60 * 60 * 1000)
+  var s1 = prevDate.format('yyyy-MM-dd')
+  return s1
+}
+
+_this.leftdatechange = function (event) {
+  var value = event.new_value
+  var bizDate = mbos("entrys.bizDate", 0).value()
+  if (!bizDate) {
+    var param1 = { title: localeResource.msg50 };
+    mbos.ui.showInfo(param1);
+    return
+  }
+  var prev = getPrevDate(bizDate)
+  if (isSameDatePersonChange) {
+    if (value !== bizDate) {
+      var param2 = { title: localeResource.msg43 };
+      mbos.ui.showInfo(param2);
+      mbos("entrys.leftCompanyDate", 0).value(bizDate);
+       //禁用用户日期
+       	nextDate = getNextDate(bizDate);
+        mbos("entrys.forbidUserDate", 0).value(nextDate);
+    }
+  } else {
+    if (value !== bizDate && value !== prev) {
+      var param3 = { title: localeResource.msg44 };
+      mbos.ui.showInfo(param3);
+      mbos("entrys.leftCompanyDate", 0).value(bizDate);
+       //禁用用户日期
+       	nextDate = getNextDate(bizDate);
+        mbos("entrys.forbidUserDate", 0).value(nextDate);
+    }else{
+       //禁用用户日期
+       	nextDate = getNextDate(value);
+        mbos("entrys.forbidUserDate", 0).value(nextDate);
+    }
+  }
+}
+
+
+mbos('page').bind('afterRendered', function () {
+
+})
+
+
+mbos("page").bind("afterSave", function (e) {
+  var param1 = { title: localeResource.msg45 };
+  mbos.ui.showInfo(param1);
+
+  if (requestParam.operateState === "ADDNEW") {
+    mbos.ui.open({
+      path: mbos.pageInfo.path,
+      name: "application.editui",
+      params: {
+        billID: e.keyValue,
+        operateState: "EDIT"
+      }
+    });
+  }
+})
+
+mbos("page").bind("afterSubmit", function (e) {
+  var param1 = { title: localeResource.msg46 };
+  mbos.ui.showInfo(param1);
+  mbos.ui.open({
+    path: mbos.pageInfo.path,
+    name: "bill.listui",
+    params: {
+      billID: mbos("entity").value().id,
+    }
+  });
+})
+
+//保存,提交弱校验提示
+function CheckWeakService(callback) {
+  initEntityDataBeforeRequest()
+  var data = mbos('entity').data
+
+  mbos.eas.invokeScript({
+    name: "commonOSFservice",
+    param: ['checkWeakHireOrFlucExisService', JSON.stringify({ model: data })],
+    success: function (res) {
+      if (res.errorCode == '1') {
+          mbos.ui.showConfirm({
+            title: localeResource.msg53,
+            msg: res.msg,
+            callback: function (data) {
+              if (data == 0) {
+                //点击确定
+                  CheckResignAssign(callback)
+                //callback && callback()
+              }
+            }
+          });
+
+      } else {
+         CheckResignAssign(callback)
+      }
+    },
+    error: function (data) {
+      if (typeof (data) == "string") {
+        mbos.msgBox.showError("", data);
+      } else {
+        mbos.msgBox.showError({ ...data, msg: "" });
+      }
+    }
+  })
+}
+
+function setBillId() {
+  var param = [];
+  param[0] = mbos('entity').data.bosType;
+  mbos.eas.invokeScript({
+    name: "getbillid",
+    param: param,
+    success: function (data) {
+      mbos('entity').data.id = data;
+    }
+  })
+}
+
+
+function initEntityDataBeforeRequest() {
+  mbos("hrOrgUnit").value(_hrOrgUnit)
+  mbos('entrys.person', 0).value(_person)
+  mbos("applier").value(_person)
+  mbos("isMultiEntry").value(false)
+  var data = mbos('entity').data
+  data._entityName = "com.kingdee.eas.hr.affair.app.ResignBizBill"
+  data.ismobile = "true"
+}
+
+
+// 获取头部信息
+function initHeader() {
+  mbos.eas.invokeScript({
+    name: "commonOSFservice",
+    param: ['getMobileUserInfoService', JSON.stringify({})],
+    success: function (res) {
+      var { personName, companyName, photo = "xxx", positionName, departmentName, personNumber, hrOrgUnit } = res
+      _person.name = personName
+      _person.id = easContext.person.id
+      console.log(easContext.person)
+      _person.bosType = easContext.person.bosType
+      _hrOrgUnit = hrOrgUnit // id name
+
+      $("#applicationHistory").text(localeResource.msg7)
+      console.log($("#application_number"), personNumber, "per")
+      $("#application_img").attr("src", photo ? "data:image/png;base64," + photo : '/mbos/store/4000148/'+mbos.pageInfo.path+'/default.png')
+      $("#application_name").text(personName)
+      $("#application_number").text(personNumber)
+      $("#application_job").text(positionName + (departmentName ? (" | " + departmentName) : ""))
+      $("#application_company").text(companyName);
+      mbos("entrys_oldAdminOrg", 0).value({ name: res.adminName, id: res.adminId });
+      mbos("entrys_oldPosition", 0).value({ name: res.positionName, id: res.positionId });
+      mbos("entrys_oldJobGrade", 0).value({ name: res.jobGradeName, id: res.jobGradeId });
+      mbos("entrys_oldJobLevel", 0).value({ name: res.jobLevelName, id: res.jobLevelId });
+      $(".header_container").css("visibility", "visible")
+
+      if (requestParam.operateState === "ADDNEW") {
+        GetResignEmpBillNum()
+      }
+      setTimeout(function(){
+          var dataSubmit = mbos('entity').value();
+          mbos('nextperson1').checkParticipantPerson({
+            editdata: dataSubmit,
+            callback: function(){
+              var nextPerson = mbos('entity').data.workflowNextPerson;
+            }
+          }); 
+      },1000);
+    },
+    error: function (e) {
+      $("#applicationHeader").hide()
+    }
+  })
+}
+
+//是否存在在途的单据
+function getExistResignBillInfo() {
+  mbos.eas.invokeScript({
+    name: "commonOSFservice",
+    param: ['GetExistResignBillInfoService', JSON.stringify({})],
+    success: function (res) {
+      if (res.isExist) {
+        mbos.ui.open({
+          path: mbos.pageInfo.path,
+          name: "billDetail.editui",
+          params: {
+            billID: mbos("entity").value().id,
+          }
+        });
+      }
+    },
+    error: function (e) {
+      console.log(e);
+    }
+  })
+}
+
+//检查员工有待办任务时是否允许提交离职申请
+function CheckResignAssign(callback) {
+  initEntityDataBeforeRequest()
+  var data = mbos('entity').data
+  console.log(data, "检查员工有待办任务时是否允许提交离职申请 data--------")
+
+  mbos.eas.invokeScript({
+    name: "commonOSFservice",
+    param: ['CheckResignAssignService', JSON.stringify({ model: data })],
+    success: function (res) {
+      var { isContainAssign, isResignCheck, assignMsg } = res
+      if (isContainAssign) {
+        if (isResignCheck) {
+          mbos.ui.showConfirm({
+            title: assignMsg,
+            msg: "",
+            callback: function (data) {
+              if (data == 0) {
+                callback && callback()
+              }
+            }
+          });
+        } else {
+          mbos.ui.showInfo({ title: assignMsg, msg: "" });
+        }
+      } else {
+        callback && callback()
+      }
+    },
+    error: function (data) {
+      if (typeof (data) == "string") {
+        mbos.msgBox.showError("", data);
+      } else {
+        mbos.msgBox.showError({ ...data, msg: "" });
+      }
+    }
+  })
+}
+
+// 保存和提交前校验业务数据
+function CheckResignBillInfoService(callback, fallback) {
+  var data = mbos('entity').data
+  mbos.eas.invokeScript({
+    name: "commonOSFservice",
+    param: ['CheckResignBillInfoService', JSON.stringify({ model: data })],
+    success: function (res) {
+      callback && callback()
+    },
+    error: function (data) {
+      if (typeof (data) == "string") {
+        mbos.msgBox.showError("", data);
+      } else {
+        mbos.msgBox.showError({ ...data, msg: "" });
+      }
+    }
+  })
+}
+
+
+// 是否申请记录存在单据
+function checkIsExistResignBill() {
+  mbos.eas.invokeScript({
+    name: "commonOSFservice",
+    param: ['IsExistResignBillRecordsService', JSON.stringify({})],
+    success: function (res) {
+      if (res.isExist) {
+        $("#applicationHistory").show()
+      }
+    },
+    error: function (e) {
+      console.log(e);
+    }
+  })
+}
+
+
+// 获取单据编号
+function GetResignEmpBillNum() {
+  var data = {
+    hrOrgUnitId: _hrOrgUnit.id,
+    businessType: 3,
+    personId: _person.id
+  }
+  mbos.eas.invokeScript({
+    name: "commonOSFservice",
+    param: ['GetResignEmpBillNumService', JSON.stringify(data)],
+    success: function (res) {
+      if (res.respObj) {
+        mbos('number').value(res.respObj)
+      } else {
+        mbos('number').show()
+      }
+    },
+    error: function (data) {
+      if (typeof (data) == "string") {
+        mbos.msgBox.showError("", data);
+      } else {
+        mbos.msgBox.showError({ ...data, msg: "" });
+      }
+    }
+  })
+}
+
+_this.bdczchange = function (event) {
+  console.log(_HRBizDefine)
+  console.log(event)
+  var { outEmpType, affairActionReason, variationReason } = _HRBizDefine.find((item) => item.id === event.new_value.id) || { outEmpType: [], affairActionReason: [], variationReason: [] }
+  var sec = outEmpType.map((item) => "'" + item.number + "'");
+  var thrid = affairActionReason.map((item) => "'" + item.number + "'");
+  var fourth = variationReason.map((item) => "'" + item.number + "'");
+  if (sec.length === 1) mbos("entrys.oldEmpType", 0).value(outEmpType[0])
+  if (thrid.length === 1) mbos("entrys.affairActionReason", 0).value(affairActionReason[0])
+  if (fourth.length === 1) mbos("entrys.variationReason", 0).value(variationReason[0])
+
+  if (sec.length === 0) { sec = ['"xnull"'] }
+  if (thrid.length === 0) { thrid = ['"xnull"'] }
+  if (fourth.length === 0) { fourth = ['"xnull"'] }
+
+  mbos("entrys.oldEmpType", 0).attr('dynamicFilter', 'number in (' + sec.join(",") + ')');
+  mbos("entrys.affairActionReason", 0).attr('dynamicFilter', 'number in (' + thrid.join(",") + ')');
+  mbos("entrys.variationReason", 0).attr('dynamicFilter', 'number in (' + fourth.join(",") + ')');
+}
+
+function getEditData() {
+  mbos('entity').data.fromMbos = true;
+  return mbos('entity').data;
+}
+
+function save(e) {
+  var vali = mbos.ng.invokeAllScope("validate", { method: "save" });
+  if (!vali) {
+    return;
+  }
+  if (e.isvaliSuccess === false) {
+    return;
+  }
+  // this  should be a init Action!  TODO
+  mbos.post({
+    url: "/mbos/editpage/save",
+    param: {
+      "bostype": getEditData().bosType,
+      "model": JSON.stringify(getEditData()),
+      "uiname": requestParam.name
+    },
+    success: function (data) {
+      event = event || {};
+      angular.extend(event, data);
+      mbos.page.fire("afterSave", event);
+    },
+    error: function (data) {
+      if (typeof (data) == "string") {
+        mbos.msgBox.showError("", data);
+      } else {
+        mbos.msgBox.showError({ ...data, msg: "" });
+      }
+    }
+  });
+}
+
+
+function submit(e) {
+  console.log(111111)
+  var vali = mbos.ng.invokeAllScope("validate", { method: "submit" });
+  if (!vali) {
+    return;
+  }
+  if (e.isvaliSuccess === false) {
+    return;
+  }
+  //
+  if (requestParam.isfromlcjs) {
+    getEditData().isfromlcjs = requestParam.isfromlcjs;
+  }
+  if (requestParam.ssotype == "workflow") {
+    getEditData().isfromlcjs = requestParam.isfromlcjs;
+  }
+  if (e.isvaliSuccess === false) {
+    return;
+  }
+  mbos.post({
+    url: "/mbos/editpage/submit",
+    param: { "bostype": getEditData().bosType, "uiname": requestParam.name, "model": JSON.stringify(getEditData()) },
+    success: function (data) {
+      event = event || {};
+      if (requestParam.ssotype == "workflow") {
+        window.parent.postMessage("hasmbos", "*");
+        return;
+      }
+      mbos.page.fire("afterSubmit", event);
+      //mbos._invoke("afterSubmit", event);
+    },
+    error: function (data) {
+      if (typeof (data) == "string") {
+        mbos.msgBox.showError("", data);
+      } else {
+        mbos.msgBox.showError({ ...data, msg: "" });
+      }
+    }
+  });
+};
+
+
+
+// 离职日期和最后工作日期是否同一天
+function CheckDefaultSameDayService(date, callback) {
+  var data = {
+    personId: easContext.person.id,
+    hrOrgUnitId: _hrOrgUnit.id,
+    date: date
+  }
+  mbos.eas.invokeScript({
+    name: "commonOSFservice",
+    param: ['CheckDefaultSameDayService', JSON.stringify(data)],
+    success: function (res) {
+      console.log(res, 'res--------------')
+      if (res.respCode == "000000") {
+        isDefaultSameday = res.respObj.isDefaultSameday
+        isSameDatePersonChange = res.respObj.isSameDatePersonChange
+        isResignNextMonth = res.respObj.isResignNextMonth
+        var bizDate = res.respObj.bizDate
+        console.log(bizDate, '--bizDate-----')
+        if (bizDate) {
+          mbos('entrys.bizDate', 0).value(bizDate)
+        }
+        callback && callback()
+      }
+    },
+    error: function (data) {
+      if (typeof (data) == "string") {
+        mbos.msgBox.showError("", data);
+      } else {
+        mbos.msgBox.showError({ ...data, msg: "" });
+      }
+    }
+  })
+}
+
+
+Date.prototype.format = function (fmt) {
+  var o = {
+    "M+": this.getMonth() + 1, //月份 
+    "d+": this.getDate(), //日 
+    "H+": this.getHours(), //小时 
+    "m+": this.getMinutes(), //分 
+    "s+": this.getSeconds(), //秒 
+    "q+": Math.floor((this.getMonth() + 3) / 3), //季度 
+    "S": this.getMilliseconds() //毫秒 
+  };
+  if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+  for (var k in o)
+    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+  return fmt;
+}
+
+_this.suggestchange = function (event) {
+  var value = event.new_value
+  if (value.length >= 200) {
+    mbos.ui.showInfo({ title: localeResource.msg52 });
+    mbos('textarea2', 0).value(value.substr(0, 200))
+  }
+}
+        
+////202503加入社保数据校验;
+_this.ces_change = function(event){
+  var value = event.new_value.value;
+  if(value ==  0 ){
+    //添加图标,并且图标放入控件的后面
+     $('#entrys_suspensionDate_0 label').append('<span class="must_input_icon ng-scope" style="margin-left:5px; color: red;">*</span>');
+     $('#entrys_deduction_0 label').append('<span class="must_input_icon ng-scope" style="margin-left:5px; color: red;">*</span>');
+     $('#entrys_otherSocialInfo_0 label').append('<span class="must_input_icon ng-scope" style="margin-left:5px; color: red;">*</span>');
+  }else{
+    //移除图标
+    $('#entrys_suspensionDate_0 label span').remove();
+    $('#entrys_deduction_0 label span').remove();
+    $('#entrys_otherSocialInfo_0 label span').remove();
+  }
+         
+
+}
+
+
+//校验方法//202503加入社保数据校验;
+function opValidate() {
+  var cesEnum = mbos('entrys_fiveinsurances_0').value().value;
+  var  sionDate = mbos('entrys_suspensionDate_0').value();
+  var  deducVal = mbos('entrys_deduction_0').value();
+  var  otherSo = mbos('entrys_otherSocialInfo_0').value();
+  var isValid = true;
+  var errorMsg = "";
+  //如果cesEnum == 0 并且sionDate或deducVal或otherSo其中一个为空或者不存在,则提示不能为空
+  if (cesEnum == 0 && (!sionDate || !deducVal || !otherSo)) {
+    isValid = false;
+    errorMsg = "社保结算信息必填,请检查!";
+  }
+    
+  if (!isValid) {
+    mbos.ui.showError({ title: errorMsg });
+    return false;
+  }
+  return true;
+}
+        

+ 471 - 0
mbos/qingjiadan.js

@@ -0,0 +1,471 @@
+_this.pageinit = function () {
+    newPageInit()
+  }
+  // 	在页面初始化加载之后
+  mbos('page').bind('afterLoad', function () {
+    _this.path = mbos.pageInfo.path// 轻应用的路径编码 例如 trip880
+    _this.detailPageCode = mbos.pageInfo.name.replace('Add', 'View') // 详情页面的编码 (个别页面可特殊处理直接写入) 例如 tripView.editui
+    _this.operateState = mbos.getRequestParams().operateState // 'ADDNEW' 'EDIT' 'VIEW'
+    // 初始化审批流
+    // mbos('nextperson1').checkParticipantPerson({
+    //   "callback": function () { }
+    // });
+    // 单据说明
+    mbos('description').bind('click', function () {
+      handleClickDesc()
+    })
+  })
+  // 【请假类型】F7过滤, _this.holidayIdList是接口返回的过滤数据,再依据这个过滤F7 
+  function filterLeaveTypeF7(index) {
+    var filterStr = _this.holidayIdList.join('\',\'')
+    mbos('entries_sourceHolidayType', index).attr('dynamicFilter', 'id in (\'' + filterStr + '\')'); // 动态添加过滤
+  }
+  // 哺乳假F7
+  function filterBreastTypeF7(index) {  
+    mbos('entries.bfType', index).attr('dynamicFilter', 'state = 1'); // 动态添加过滤
+  }
+  // 分录渲染后
+  mbos('entries').bind('afterRendered', function (e) {
+    _this.leaveLengthTitle = mbos('entries_leaveLength_0').attr('title').split('(')[0] // 获取请假时长的标题
+    getHolidayType(e)
+    multiLangField(e.index)// 兼容多语言字段回显的问题
+    // 初始化审批流
+    _this.getNextPerson();
+  })
+  // 初始化审批流
+  _this.getNextPerson = function(){
+    var entries = setModel('getNextPerson');
+    var data = JSON.parse(JSON.stringify(mbos('entity').value()));
+    data.entries = JSON.parse(JSON.stringify(entries));
+    var date = mbos.getRequestParams().date || new Date()
+    var today = moment(date).format('YYYY-MM-DD')
+    var beginTime = today + ' 00:00';
+    var endTime = today + ' 23:59';
+    mbos.eas.invokeScript({
+      name: "getHROrgUnit",
+      param: [{'beginTime': beginTime, 'endTime':endTime}],
+      success: function (res) {
+        console.log(res)
+        if(res.hrOrgUnitId){
+          data.hrOrgUnit = res.hrOrgUnitId
+        }
+        mbos('nextperson1').checkParticipantPerson({
+          'editdata': data,
+          "callback": function () { }
+        });
+      }
+    })
+  }
+  // 提交前增加校验,R20240625-5062 计算时长为0、手动修改为大于0时,增加不允许提交校验
+  _this.verify = function(action){
+    var flag = true;
+    var params = getModel(-1, action);
+    $.each(params.entries, function(i,item){
+        if(item.leaveLength > item.realLeaveLength){
+          mbos.ui.showInfo('请假长度只能改小,不能改大。');
+          flag = false;
+          return false;
+        }
+    })
+    return flag;
+  }
+  // 保存按钮
+  _this.save = function (event) {
+    // R20240625-5062 计算时长为0、手动修改为大于0时,增加不允许提交校验
+    if(!_this.verify('save')){
+      return false;
+    }
+    
+    var params = getModel(-1, 'save') // 封装model,不走common的封装
+    baseInterface('save', toView, -1, params) // 调用保存接口
+  }
+  // 提交按钮
+  _this.submit = function (event) {
+    // R20240625-5062 计算时长为0、手动修改为大于0时,增加不允许提交校验
+    if(!_this.verify('submit')){
+      return false;
+    }
+      // 确认提交 弹框
+    mbos.ui.showConfirm({
+      title: localeResource.confirmSubmit,
+      iconclass: "kdfont kdfont-zhuangtai_jingshi the_info",
+      callback: function (data) {
+        if (data == 0) {
+          var params = getModel(-1, 'submit') // 封装model,不走common的封装
+          baseInterface('submit', toView, -1, params) // 调用提交接口
+        }
+      }
+    });
+  
+  
+  }
+  
+  // 点击“保存、提交” 跳转页面
+  function toView(res) {
+    // 提交接口 返回的res.data为数组,取第一条数据
+    if (res.data.keyValue || (res.data.length > 0 && res.data[0].keyValue)) {
+          // 操作成功 提示弹框
+      mbos.ui.showInfo({
+        title: localeResource.succeed,
+        iconclass: "kdfont kdfont-zhuangtai_wancheng the_success",
+        callback: function () {
+          openPage(_this.path, _this.detailPageCode, { billID: res.data.keyValue || res.data[0].keyValue })
+        }
+      });
+    }
+  }
+  // 给隐藏的model赋值
+  // method: getNextPerson,获取审批人数据
+  function setModel(method) {
+    if (typeof _this.operateState != "undefined" && (_this.operateState === "ADDNEW" || _this.operateState === "EDIT")) {
+      var entries = _.cloneDeep(mbos('entity').data.entries) // lodash 深拷贝
+      entries.map(function (entry, i) {
+        entry.person = easContext.person
+  //       position和adminOrgUnit取后端默认值,前端取的是人事档案的不是正确的值
+        // entry.position = easContext.position.id
+        // entry.adminOrgUnit = easContext.position.adminOrgUnit.id
+        getEntries(entry, i, method) // 各单据处理分录数据
+      })
+      return entries
+    }
+  }
+  function getModel(index, method) {
+    var entries = setModel()
+    var obj = mbos('entity').data
+    if (method === "save" || method === "submit"){ // 只在保存喝提交时修改枚举字段的存储,不然会清空表头的枚举字段
+      Object.keys(obj).map(key => {
+        if (obj[key] && obj[key].isenum) {// 遍历枚举字段 依据后端需要 传参只传value
+          obj[key] = obj[key].value
+        }
+      })
+      console.log(obj)    
+    }
+  
+    var model = {
+      ...obj,
+      entries: entries,
+    }
+    if (index >= 0) { // index 为-1 时代表取所有明细
+      model.entries = [entries[index]]
+    }
+    if ((method === "save" || method === "submit") && mbos.getRequestParams().abnormalId) {
+      model.abnormalId = mbos.getRequestParams().abnormalId
+    }
+    var personList = mbos('personSelector1').$element ? mbos('personSelector1').getpersonList() : []; // 抄送人列表
+    model.ccPersonIds = personList.map(function (i) { return (i.personid || i.id) }).join(',')
+    model.ccPerson = personList.map(function (i) { return (i.personid || i.id) }).join(',')
+    return model
+  }
+  // 各单据处理分录数据的函数
+  // method: getNextPerson,获取审批人数据
+  function getEntries(entry, i, method) {
+    if (!entry.bfType) entry.bfType = ''
+    var halfData = _this['isHalf' + i]
+    if (halfData && entry.beginTime && !entry.beginTime.split(' ')[1] && mbos('beginHalf', i).value().value) {
+      // 页面显示的是上午下午,但是传参得拼接上时分 格式为年月日时分
+      entry.beginTime = entry.beginTime + ' ' + (mbos('beginHalf', i).value().value === 'am' ? halfData.amBeginTime : halfData.pmBeginTime)
+      entry.endTime = entry.endTime + ' ' + (mbos('endHalf', i).value().value === 'am' ? halfData.amEndTime : halfData.pmEndTime)
+    }
+    // 如果是哺乳假 非自定义的类型 结束时间需要拼接时分为23:59
+    var _holidayType = mbos('entries_sourceHolidayType', i).value()
+    var _bfType = mbos('entries_bfType', i).value()
+    if (_holidayType && _holidayType.name == localeResource.bf_holiday && _bfType && _bfType.name !== localeResource.Customized){
+      entry.beginTime += ' 00:00'
+      entry.endTime += ' 23:59'
+    }
+    if(method == 'getNextPerson'){
+      entry.position = easContext.position;
+      entry.adminOrgUnit = easContext.position.adminOrgUnit;
+      if(entry.beginTime){
+        entry.beginTime = moment(entry.beginTime).format('YYYY-MM-DD HH:mm:ss');
+      }
+      if(entry.endTime){
+        entry.endTime = moment(entry.endTime).format('YYYY-MM-DD HH:mm:ss');
+      }
+    }else{
+      delete entry.position;
+      delete entry.adminOrgUnit;
+    }
+  }
+  // 获取请假类型
+  var getHolidayType = _.debounce(function (e) {
+    var callback = function (res) {
+      var list = res.data
+      _this.holidayIdList = res.data.map(item => item.holidayTypeId.id) // 存储过滤后的请假类型F7数据
+      filterLeaveTypeF7(e.index)
+      filterBreastTypeF7(e.index)
+      // 请假类型数组
+      _this.holidayType = {}
+      for (var i = 0; i < list.length; i++) {
+        var typeId = list[i].holidayTypeId.id
+        _this.holidayType[typeId] = {
+          holidayPolicyId: list[i].holidayPolicyInfo.id,
+          sourceUnit: list[i].unit,
+          sourceHolidayType: list[i].holidayTypeId,
+          description: list[i].description
+        }
+      }
+      if (mbos.getRequestParams().type && mbos.getRequestParams().holidayTypeId){ 
+        // 从我的假期页面跳转过来,携带赋值假期类型
+        mbos('entries_sourceHolidayType', e.index).value({
+          id:  decodeURIComponent(mbos.getRequestParams().holidayTypeId),
+          name: mbos.getRequestParams().type
+        })
+      }
+      if (mbos('entries_sourceHolidayType', e.index).value()) {
+        _this.typeChange({
+          index: e.index,
+          new_value: mbos('entries_sourceHolidayType', e.index).value(),
+          old_value: ''
+        })
+      }
+    }
+    var date = mbos.getRequestParams().date || new Date()
+    //  需要传参时间,默认为当天 或其他页面带过来的参数
+    var today = moment(date).format('YYYY-MM-DD')
+    if (!mbos('entries_beginTime', e.index).value()) {
+      mbos('entries_beginTime', e.index).value(today + ' 00:00')
+    }
+    if (!mbos('entries_endTime', e.index).value()) {
+      mbos('entries_endTime', e.index).value(today + ' 23:59')
+    }
+    setModel()
+    baseInterface('getHolidayTypeByPerson', callback, e.index)
+  }, 0)
+  // 接口计算请假时长
+  var getTimeLength = _.debounce(function (index) {
+    var callback = function (res) {
+      mbos('entries_leaveLength', index).value(res.data.leaveBillDays)
+      // R20240625-5062 计算时长为0、手动修改为大于0时,增加不允许提交校验
+      mbos('entries_realLeaveLength', index).value(res.data.leaveBillDays)
+    }
+  
+    var params = getModel(index) // 封装model,不走common的封装
+    var entry = mbos('entity').data.entries[index]
+    if (entry.beginTime && entry.endTime && entry.sourceHolidayType) {
+      baseInterface('getBillLength', callback, index, params)
+    }
+  }, 500)
+  // 获取假期剩余额度单位
+  var getRemainLength = _.debounce(function (event) {
+    var index = event.index
+    var entry = mbos('entity').data.entries[index]
+    delete entry.SourceHolidayType
+    if (entry.beginTime && entry.endTime && entry.sourceHolidayType) {
+      var callback = function (res) {
+        if (!res.data) {
+          $('#remainCard_' + index).css('display', 'none')
+          return
+        }
+        if (res && res.data) {
+          var type = _this.holidayType[mbos('entries_sourceHolidayType', index).value().id]
+          $('#remainCard_' + index).css('display', 'flex')
+          var sourceTypeName  = type.sourceHolidayType.name == "年假" ? "本年度全年年假" : type.sourceHolidayType.name;
+          document.getElementById('remainCard_' + index).innerText = `${sourceTypeName}  ${localeResource.remained}${res.data.remainLimitVal}${type.sourceUnit.alias} ${localeResource.remainedDays}`
+        }
+      }
+      setModel()
+      baseInterface('getHolidayLimitByHolidayType', callback, index)
+    }
+  }, 200)
+  // 根据时间判断 是否展示弹性算时长字段
+  var isElastic = _.debounce(function (index) {
+    var callback = function (res) {
+      if (res.data) {
+        mbos('entries_isElasticCalLen', index).show()
+      } else {
+        mbos('entries_isElasticCalLen', index).hide()
+      }
+    }
+    //   TODO   holidayPolicyId待添加
+    setModel(index)
+    var entry = mbos('entity').data.entries[index]
+    if (entry.beginTime && entry.endTime) {
+      baseInterface('showIsElasticCalCtrl', callback, index)
+    }
+  }, 500)
+  
+  /**
+   * 修改开始结束时间的格式
+   * YYYY-MM-DD      : 非【自定义】的所有哺乳假类型
+   * YYYY-MM-DD HH:mm:未启用半天假的非哺乳假;【自定义】的哺乳假类型且未启用半天假;
+   * YYYY-MM-DD AM/PM:启用半天假的非哺乳假、【自定义】的哺乳假类型且启用半天假 
+   */
+  function beginEndFormat(format, index) {
+    mbos('entries.beginTime', index).timeFormat(format)
+    mbos('entries.endTime', index).timeFormat(format)
+  }
+  
+  // 是否开启半天假
+  function isHalfHoliday(index, timeFormat) {
+    var callback = function (res) {
+      if (res.data && res.data.isHalfDayOff) {
+        //       先赋值 在设置半天假 最后格式化时间,顺序不能变
+        _this['isHalf' + index] = res.data
+        setHalfDay(index)// 设置开启半天假的样式
+        beginEndFormat('YYYY-MM-DD', index)
+      } else {
+        _this['isHalf' + index] = false
+        hideHalfDay(index)// 隐藏半天假
+        beginEndFormat(timeFormat ? timeFormat : 'YYYY-MM-DD HH:mm', index)
+      }
+    }
+    setModel()
+    baseInterface('getSetIsCtrlHalfDayOff', callback, index)
+  }
+  // 设置开启半天假的样式
+  function setHalfDay(index) {
+    $('#entries_beginTime_' + index).removeClass('col-xs-12').addClass('col-xs-9')
+    $('#entries_endTime_' + index).removeClass('col-xs-12').addClass('col-xs-9')
+    // mbos('beginHalf', index).show()
+    // mbos('endHalf', index).show()
+    $('#beginHalf_' + index).css("display", "block")
+    $('#endHalf_' + index).css("display", "block")
+    var half = {
+      am: { alias: localeResource.AM, value: "am" },
+      pm: { alias: localeResource.PM, value: "pm" },
+    }
+    var halfData = _this['isHalf' + index] // 半天假及时间字段
+    // 编辑时 根据时间判断
+    var startHM = halfData.pmBeginTime === mbos('entries_beginTime', index).value().split(' ')[1] ? half.pm : half.am
+    var endHM = halfData.amEndTime === mbos('entries_endTime', index).value().split(' ')[1] ? half.am : half.pm
+    mbos('beginHalf', index).value(startHM)
+    mbos('endHalf', index).value(endHM)
+  }
+  // 隐藏半天假
+  function hideHalfDay(index) {
+    $('#entries_beginTime_' + index).removeClass('col-xs-9').addClass('col-xs-12')
+    $('#entries_endTime_' + index).removeClass('col-xs-9').addClass('col-xs-12')
+    mbos('beginHalf', index).hide()
+    mbos('endHalf', index).hide()
+  }
+  // 监听请假类型
+  _this.typeChange = function (event) {
+    var index = event.index
+    var entry = mbos('entity').data.entries[index]
+    if (!event.new_value) return //清空
+    var type = _this.holidayType && _this.holidayType[event.new_value.id]
+    if (type) {
+      entry.sourceUnit = type.sourceUnit // 1是天 2是小时
+      entry.holidayPolicyId = type.holidayPolicyId
+      entry.SourceHolidayType = type.sourceHolidayType.id
+    }
+    // 是否是哺乳假
+    if (mbos('entries_sourceHolidayType', index).value() && (mbos('entries_sourceHolidayType', index).value().id == "8r0AAAAMhrv9LVKY" || mbos('entries_sourceHolidayType', index).value().name == localeResource.bf_holiday)) {
+      // 请假类型为【哺乳假】则显示 哺乳假类型、子女出生日期、产假结束日期
+      mbos('entries.bfType', index).show()
+      var format = 'YYYY-MM-DD'
+      if (mbos('entries_bfType', index).value()) {
+        if(mbos('entries_bfType', index).value().name == localeResource.Customized){
+          format = 'YYYY-MM-DD HH:mm'
+        } else {
+          mbos('entries.childbirthday', index).show()
+          mbos('entries.mLEndTime', index).show()
+        }
+      } else {
+        // 如果哺乳假类型不存在则默认为自定义
+        mbos('entries_bfType', index).value({id: "8r0AAAA09p9IT3K3", name: localeResource.Customized})
+        format = 'YYYY-MM-DD HH:mm'
+      }
+      
+      isHalfHoliday(index, format) // 判断是否启用半天假
+    } else {// 非哺乳假时间格式只有两种:【年月日时分】、【年月日 上/下午】。启用半天假时为【年月日 上/下午】,其他的都是【年月日时分】;
+      // 其他类型则隐藏
+      mbos('entries.bfType', index).hide()
+      mbos('entries_bfType', index).value('')
+      mbos('entries.childbirthday', index).hide()
+      mbos('entries.childbirthday', index).value('')
+      mbos('entries.mLEndTime', index).hide()
+      mbos('entries.mLEndTime', index).value('')
+      isHalfHoliday(index) // 判断是否启用半天假
+    }
+    if (entry.sourceUnit) {
+      mbos('entries_leaveLength', index).attr('title', _this.leaveLengthTitle + `(${entry.sourceUnit.alias})`);
+    }
+    getTimeLength(index)
+    getRemainLength(event)
+  }
+  // 监听 开始时间
+  _this.calTime1 = function (event) {
+    getHolidayType(event)
+    getTimeLength(event.index)
+    isElastic(event.index)
+    getRemainLength(event)
+  }
+  // 监听 结束时间
+  _this.calTime2 = function (event) {
+    getHolidayType(event)
+    getTimeLength(event.index)
+    isElastic(event.index)
+    getRemainLength(event)
+  }
+  // 监听 子女出生日期
+  _this.birthdayChange = function (event) {
+    // 请假开始时间默认值:产假结束日期,再加1天;
+    if (event.new_value) {
+      var value = moment(mbos('entries_childbirthday', event.index).value()).add(1, 'years').format('YYYY-MM-DD')
+      mbos('entries.endTime', event.index).value(value)
+    }
+  }
+  // 监听 产假结束日期
+  _this.mlEndChange = function (event) {
+    // 请假结束时间默认值:子女出生日期延后一年,再减1天;
+    if (event.new_value) {
+      var value = moment(mbos('entries_mLEndTime', event.index).value()).add(1, 'days').format('YYYY-MM-DD')
+      mbos('entries.beginTime', event.index).value(value)
+    }
+  }
+  // 监听 哺乳假类型
+  _this.bfTypeChange = function (event) {
+    var index = event.index
+    // 哺乳假类型是否为【自定义】
+    if (!mbos('entries_bfType', index).value()){
+       // 如果哺乳假类型不存在则默认为自定义
+        setTimeout(()=>{
+          mbos('entries_bfType', index).value({id: "8r0AAAA09p9IT3K3", name: localeResource.Customized})
+        }, 0)
+    }
+    if (mbos('entries_bfType', index).value() && (mbos('entries_bfType', index).value().id == "8r0AAAA09p9IT3K3" || mbos('entries_bfType', index).value().name == localeResource.Customized)) {
+      //   【自定义】: 则不展示【子女出生日期、产假结束日期】
+      mbos('entries.childbirthday', index).value('')
+      mbos('entries.childbirthday', index).hide()
+      mbos('entries.mLEndTime', index).value('')
+      mbos('entries.mLEndTime', index).hide()
+      // 哺乳假类型为【自定义】时,启用半天假时为【年月日 上/下午】,其他的都是【年月日 时分】
+      isHalfHoliday(index) // 判断是否启用半天假
+    } else {
+      // 非【自定义】的所有哺乳假类型 日期格式为年月日
+      beginEndFormat('YYYY-MM-DD', index)
+      mbos('entries.childbirthday', index).show()
+      mbos('entries.mLEndTime', index).show()
+    }
+    getTimeLength(event.index)
+  }
+  // 监听是否是弹性算时长
+  _this.isElasticChange = function (event) {
+    getTimeLength(event.index)
+  }
+  // 更改半天假开始
+  _this.calTime3 = function (event) {
+    getTimeLength(event.index)
+  }
+  // 更改半天假结束
+  _this.calTime4 = function (event) {
+    getTimeLength(event.index)
+  }
+  
+  // 时长更改时 做校验
+  _this.lengthChange = function(event){
+    var value = event.new_value
+  //   判断是否等于小于0
+    if (!isNaN(parseFloat(value)) && value <= 0) {
+      mbos.msgBox.showError(localeResource.lengthValid);
+      setTimeout(()=>{
+        mbos('entries_leaveLength',event.index).value('')
+      })
+      return
+    }
+    
+  }
+          
+  

File diff suppressed because it is too large
+ 3 - 0
mbos/备份/app正式环境1.6日,3日后可删


+ 0 - 0
mbos/lizhidan.js → mbos/备份/leaveOffice9000_我要离职_离职申请_源备份.js


Some files were not shown because too many files changed in this diff