欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 新闻 > 焦点 > 泛微E9开发 根据故障来源新增明细行,并且初始化错误类型

泛微E9开发 根据故障来源新增明细行,并且初始化错误类型

2024/12/24 3:31:30 来源:https://blog.csdn.net/a_waste_only/article/details/140104239  浏览:    关键词:泛微E9开发 根据故障来源新增明细行,并且初始化错误类型

根据故障来源新增明细行,并且初始化错误类型

    • 1、需求说明
    • 2、实现方法
    • 3、扩展知识点
      • 3.1 批量修改字段值或显示属性
        • 3.1.1 格式
        • 3.1.2 参数
        • 3.1.3 演示
      • 3.2 根据字段ID获取字段信息
        • 3.2.1 格式
        • 3.2.2 参数
        • 3.2.3 演示

1、需求说明

用户对出现故障的机器或设备进行判断问题判断,系统根据软硬件故障自动识别相关的故障原因,并且对故障原因进行确认,当存在某个现象时,明细表自动新增行,并初始化错误类型。

  1. “硬件故障”
    在这里插入图片描述

  2. “硬件故障”去掉“硬盘存在坏道或损坏”故障原因在这里插入图片描述

  3. “软件故障”
    在这里插入图片描述

2、实现方法

代码块

<script>var gzlxField = WfForm.convertFieldNameToId("gzlypd");var yjgzFieldArr = ["26199","26200","26201","26202","26203","26204","26205"];var rjgzFieldArr = ["26206","26208","26209","26210","26211","26212","26213"];//故障来源判断,清空故障相关值clearData = function(gzlyV){//硬件故障,清空软件故障相关值if(gzlyV == "0"){WfForm.changeMoreField({field26199:{value:""},field26200:{value:""},field26201:{value:""},field26202:{value:""},field26203:{value:""},field26204:{value:""},field26205:{value:""},field26214:{value:""}},{field26199:{viewAttr:3},field26200:{viewAttr:3},field26201:{viewAttr:3},field26202:{viewAttr:3},field26203:{viewAttr:3},field26204:{viewAttr:3},field26205:{viewAttr:3},field26214:{viewAttr:3}});}else if(gzlyV == "1"){     //软件故障,清空硬件故障相关值WfForm.changeMoreField({field26206:{value:""},field26208:{value:""},field26209:{value:""},field26210:{value:""},field26211:{value:""},field26212:{value:""},field26213:{value:""},field26214:{value:""}},{field26206:{viewAttr:3},field26208:{viewAttr:3},field26209:{viewAttr:3},field26210:{viewAttr:3},field26211:{viewAttr:3},field26212:{viewAttr:3},field26213:{viewAttr:3},field26214:{viewAttr:3}});}else{}}operateDetailRow = function(value,fieldLable){//无问题,表示清空该行if(value == "1"){ var rowArr = WfForm.getDetailAllRowIndexStr("detail_1").split(",");for(var i=0; i<rowArr.length; i++){var rowIndex = rowArr[i];if(rowIndex !== ""){var fieldMark = "field25902_"+rowIndex;    //遍历明细行字段var fieldValue = WfForm.getFieldValue(fieldMark);if(fieldValue == fieldLable){WfForm.delDetailRow("detail_1",rowIndex.toString());}}}}else if(value == "0"){WfForm.addDetailRow("detail_1",{field25902:{value:fieldLable}});}else{}} jQuery(document).ready(function(){debugger;//故障来源判断  - 值触发WfForm.bindFieldChangeEvent(gzlxField,function(obj,id,value){WfForm.delDetailRow("detail_1","all");clearData(value); });//硬件故障+其他  - 值触发WfForm.bindFieldChangeEvent("field26199,field26200,field26201,field26202,field26203,field26204,field26205,field26214",function(obj,id,value){var gzlxValue = WfForm.getFieldValue(gzlxField);if(gzlxValue == "1"){return;}if(value){var fieldid = id.substring(5,id.length);var fieldInfo = WfForm.getFieldInfo(fieldid);var fieldLable = fieldInfo.fieldlabel;operateDetailRow(value,fieldLable);}});//软件故障+其他  - 值触发WfForm.bindFieldChangeEvent("field26206,field26208,field26209,field26210,field26211,field26212,field26213,field26214",function(obj,id,value){var gzlxValue = WfForm.getFieldValue(gzlxField);if(gzlxValue == "0"){return;}if(value){var fieldid = id.substring(5,id.length);var fieldInfo = WfForm.getFieldInfo(fieldid);var fieldLable = fieldInfo.fieldlabel;operateDetailRow(value,fieldLable);}});})</script>

3、扩展知识点

3.1 批量修改字段值或显示属性

3.1.1 格式

changeMoreField: function(changeDatas, changeVariable)

3.1.2 参数

参数说明

参数参数类型参数类型参数类型
changeMoreFieldJSON修改的字段值信息集合
changeVariableJSON修改的字段显示属性集合
3.1.3 演示
WfForm.changeMoreField({field110:{value:"修改后的值"},field111:{value:"2,3",specialobj:[{id:"2",name:"张三"},{id:"3",name:"李四"}]},...
},{field110:{viewAttr:2},field111:{viewAttr:3},...
});

3.2 根据字段ID获取字段信息

说明:根据字段ID获取字段信息,JSON格式,包括名称、类型、只读必填属性等

3.2.1 格式

getFieldInfo:function(fieldid)

3.2.2 参数

参数说明

参数参数类型参数类型参数类型
fieldidString字段ID,不带任何标示
返回值字段信息JSON重要属性说明
参数说明
htmltype字段大类型(文本/多行文本…)
detailtype字段小类型(整数/浮点数…)
fieldname字段数据库名称
fieldlabel字段显示名
viewattr字段属性(1:只读;2:可编辑;3:必填)
3.2.3 演示
WfForm.getFieldInfo("111");

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com