chenhaozhe
2025-08-20 d4e2d5e93bdee0dd3538714b83745fd16dc4a07e
WebTM/views/ÖÊÁ¿¹ÜÀí/°²µÆÖ𼶺ô½Ð¹æÔò/OA_AndengFlowRuleBillMain.html
@@ -225,7 +225,14 @@
            <option value="消息">消息</option>
            <option value="同时接收">同时接收</option>
        </select>
    </script>
    </script>
    <!--复选框 å®Œæˆæ ‡è®°-->
    <script type="text/html" id="HIsRece">
        <div class="layui-input-block" style="margin-left: 20px;">
            <input type="checkbox" name="HIsRece" lay-filter="HIsRece" id="HIsRece{{d.LAY_TABLE_INDEX+1}}" lay-skin="primary">
        </div>
    </script>
    <script>
@@ -289,22 +296,31 @@
                ////禁用组织选项
                //$("#HOrgID").attr("disabled", true);
                OperationType = 1;
                //初始化项目阶段表
                get_InitGrid();
                //生成并设置主表的内码和单据号
                createBillNo();
                //初始化制单人和制单时间
                $("#HMaker").val(sessionStorage["HUserName"]);
                $("#HMakerDate").val(Format(new Date(), "yyyy-MM-dd"));
                //初始化日期
                $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
            }
            else if (OperationType == 2) {//如果修改则走下面 new                                        //编辑
                OperationType = 1;
                //初始化项目阶段表
                get_InitGrid();
                RoadBillMain(linterid);
                //生成并设置主表的内码和单据号
                createBillNo();
                //初始化制单人和制单时间
                $("#HMaker").val(sessionStorage["HUserName"]);
                $("#HMakerDate").val(Format(new Date(), "yyyy-MM-dd"));
                //初始化日期
                $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
            }
            else if (OperationType == 3) {//如果修改则走下面 new                                        //编辑
                ////禁用组织选项
@@ -395,6 +411,8 @@
                    , "HDutyNumber": ""
                    , "HDutyName": ""
                    , "HTimes": ""
                    ,"HReceiveType":""
                    , "HIsRece": false
                    , "HRemark": ""
                    , "HReceiveType": ""
                    , "HSourceInterID": "0"
@@ -407,11 +425,19 @@
                        table.cache["mainTable"].push(NewRow);
                        option.data = table.cache["mainTable"];
                        table.render(option);
                        CheckedSet_tableSub();
                        for (var i = 1; i <= option.data.length; i++) {
                            $('#HReceiveType' + i + '').find("option[value='" + option.data[i - 1].HReceiveType + "']").attr("selected", true);
                            $('#HReceiveType' + i + '').find("option[value='" + option.data[i - 1].HReceiveType + "']").attr("selected", true);
                        }
                        for (var i = 1; i <= option.data.length; i++) {
                            //完成标记
                            if (option.data[i - 1].HIsRece) {
                                $('#HIsRece' + i + '').attr("checked", true);
                            }
                        }
                        form.render('select');
                        form.render('checkbox');
                        break;
                    case 'btn-CopyLine':
                        var copydata = JSON.stringify(data);
@@ -427,11 +453,19 @@
                            table.cache["mainTable"].push(JSON.parse(copyrow));//将复制的行强转成json追加到表格上
                            option.data = table.cache["mainTable"];//将数据绑定到data上
                            table.render(option);//将数据渲染到表格上
                            CheckedSet_tableSub();
                            for (var i = 1; i <= option.data.length; i++) {
                                $('#HReceiveType' + i + '').find("option[value='" + option.data[i - 1].HReceiveType + "']").attr("selected", true);
                            }
                            for (var i = 1; i <= option.data.length; i++) {
                                //完成标记
                                if (option.data[i - 1].HIsRece) {
                                    $('#HIsRece' + i + '').attr("checked", true);
                                }
                            }
                            form.render('select');
                            form.render('checkbox');
                        }
                        break;
                    //上一行
@@ -550,7 +584,7 @@
                        , { field: 'HDutyName', title: '职务名称', edit: 'text', event: "HDutyName", style: 'background-color: #f9f9f9;' } //f7
                        , { field: 'HTimes', title: '触发时间', edit: 'text', style: 'background-color: #f9f9f9;', }
                        , { field: 'HReceiveType', title: '接收模式', style: 'background-color: #f9f9f9;', templet: '#HReceiveType' }
                        , { field: 'HIsRece', title: '是否接收人', templet: "#HIsRece" }//checkbox
                        , { field: 'HRemark', title: '备注', edit: 'text' }
                        , { field: 'HSourceInterID', title: '源单内码', hide: true, style: 'background-color: #f9f9f9;' }     //f7
                        , { field: 'HSourceEntryID', title: '源单子内码', hide: true, style: 'background-color: #f9f9f9;' }     //f7
@@ -562,13 +596,14 @@
                var rowdata = [
                    {
                        "HSNO": ""
                        "HSNO": "1"
                        , "HDutyID": ""
                        , "HDutyNumber": ""
                        , "HDutyName": ""
                        , "HTimes": ""
                        , "HTimes": "1"
                        , "HRemark": ""
                        , "HReceiveType": ""
                        , "HReceiveType": "短信"
                        , "HIsRece": false
                        , "HSourceInterID": "0"
                        , "HSourceEntryID": "0"
                        , "HSourceBillNo": ""
@@ -595,6 +630,19 @@
            });
            //#endregion
            //#region å®Œæˆæ ‡è®°
            form.on('checkbox(HIsRece)', function (data) {
                //获取下拉框选中的值
                var elem = data.othis.parents('tr');
                var dataindex = elem.attr("data-index");
                $.each(option.data, function (index, value) {
                    if (value.LAY_TABLE_INDEX == dataindex) {
                        value.HIsRece = data.elem.checked;//把选中下拉框id值赋值给表格缓存
                    }
                });
            });
            //#endregion
            //#region å¼‚常呼叫类型
            function get_checkSearchHErrMsg() {
                layer.open({
@@ -613,7 +661,7 @@
                        }
                        //获取数据
                        $("#HErrMsgBackTypeID").val(checkStatus.data[0].HItemID);//岗位id
                        $("#HErrMsgBackTypeName").val(checkStatus.data[0].岗位名称);//岗位名称
                        $("#HErrMsgBackTypeName").val(checkStatus.data[0].异常反馈类型名称);//岗位名称
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
@@ -632,7 +680,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '发送部门表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html?openType=2&HOrgName=' + sessionStorage["Organization"], 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -661,7 +709,7 @@
                    , area: ['90%', '90%']//大小
                    , title: '接收部门表'//标题
                    , shift: 2//弹出动画
                    , content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html', 'yes']
                    , content: ['../../基础资料/公用基础资料/Gy_DepartmentList.html?openType=2&HOrgName=' + sessionStorage["Organization"], 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
@@ -756,8 +804,8 @@
                        //主表 èµ‹å€¼
                        form.val("formData", { //formTest å³ class="layui-form" æ‰€åœ¨å…ƒç´ å±žæ€§ lay-filter="" å¯¹åº”的值
                            "HInterID": data[0]["hmainid"]
                            , "HBillNo": data[0]["单据号"]
                            "HInterID": OperationType == 2 ? "" : data[0]["hmainid"]
                            , "HBillNo": OperationType == 2 ? "" : data[0]["单据号"]
                            , "HDate": formatDate(data[0]["日期"])
                            , "HDeptID": data[0]["HDeptID"]
                            , "HDeptName": data[0]["发起部门"]
@@ -789,22 +837,22 @@
                                {
                                    "HSNO": tableSub[i].流程号, "HDutyID": tableSub[i].HDutyID, "HDutyNumber": tableSub[i].职务编码,
                                    "HDutyName": tableSub[i].职务, "HTimes": tableSub[i].触发时间, "HRemark": tableSub[i].备注,
                                    "HReceiveType": tableSub[i].接收模式
                                    "HReceiveType": tableSub[i].接收模式, "HIsRece": tableSub[i].HIsRece
                                }
                            )
                        }
                        option.data = rowdata;
                        table.render(option);
                        CheckedSet_tableSub();
                        for (var i = 0; i < rowdata.length; i++) {
                            $('#HReceiveType' + (i + 1)).find("option[value='" + tableSub[i].接收模式 + "']").attr("selected", true);
                            $('#HReceiveType' + (i + 1)).find("option[value='" + tableSub[i].接收模式 + "']").attr("selected", true);
                        }
                        form.render('select');
                        form.render('checkbox');
                    }
                })
            }
            //#endregion
            //#endregion
            //#region å®¡æ ¸
@@ -956,6 +1004,19 @@
            }
            //#endregion
            //#region åˆ·æ–°è®¾ç½®å¤é€‰æ¡†çŠ¶æ€
            function CheckedSet_tableSub() {
                var tableSub = option.data;
                //对子表中的复选框进行选中
                for (var i = 0; i < tableSub.length; i++) {
                    if (tableSub[i].HIsRece) {
                        $('#HIsRece' + (i + 1)).attr("checked", true);
                    }
                }
                form.render('checkbox');
            }
            //#endregion
            //#region éšè—åˆ—设置
            function get_HideColumn() {
@@ -1102,7 +1163,7 @@
                $("#HReceiveDeptName").val(obj[0].部门名称);
                $("#HReceiveDeptID").val(obj[0].HItemID);
            }
        }
        //异常呼叫类型
        function GetErrMsgBackTypeValue(obj) {