chenhaozhe
2026-04-04 820b3f7a95cd865b29b3ea8e19b47ee964e0a2c6
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-LayUI
1个文件已修改
428 ■■■■ 已修改文件
WebTM/views/项目管理/工作任务/PM_WorkTaskReportBill.html 428 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebTM/views/ÏîÄ¿¹ÜÀí/¹¤×÷ÈÎÎñ/PM_WorkTaskReportBill.html
@@ -1,11 +1,13 @@
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>任务汇报</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
    <script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
@@ -48,6 +50,7 @@
    </style>-->
</head>
<body>
    <div class="layui-fluid" style="padding: 0;">
        <div class="layui-card" style="padding: 2px;background-color: #efefef;">
@@ -58,8 +61,10 @@
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">新增</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">修改</button>-->
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">保存</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnEdit" id="btnEdit">退出</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit=""
                            lay-filter="btnSave" id="btnSave">保存</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit=""
                            lay-filter="btnEdit" id="btnEdit">退出</button>
                        <!--<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CheckBill" id="set_CheckBill">审核</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_AbandonCheck" id="set_AbandonCheck">反审核</button>
                        <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="set_CloseBill" id="set_CloseBill">关闭</button>
@@ -77,44 +82,72 @@
                                <div class="layui-form-item" style="padding-top: 10px;">
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">单据号<label style="color:red"> * </label></label>
                                            <label class="layui-form-label" style="width: 85px;">单据号<label
                                                    style="color:red"> * </label></label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HBillNo" lay-verify="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
                                                <input type="hidden" name="HInterID" id="HInterID" lay-verify="HInterID">
                                                <input type="text" class="layui-input" name="HBillNo"
                                                    lay-verify="HBillNo" id="HBillNo"
                                                    style="background-color:#efefef4d;" readonly>
                                                <input type="hidden" name="HInterID" id="HInterID"
                                                    lay-verify="HInterID">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">日期<label style="color:red"> * </label></label>
                                            <label class="layui-form-label" style="width: 85px;">日期<label
                                                    style="color:red"> * </label></label>
                                            <div class="layui-input-block" style="margin-left: 120px; width:180px;">
                                                <input type="date" class="layui-input" lay-verify="HDate" name="HDate" id="HDate" style="padding-left: 80px;">
                                                <input type="date" class="layui-input" lay-verify="HDate" name="HDate"
                                                    id="HDate" style="padding-left: 80px;">
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">汇报人<label style="color:red"> * </label></label>
                                            <label class="layui-form-label"
                                                style="width: 85px;padding: 9px 18px;">汇报人<label style="color:red"> *
                                                </label></label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" lay-verify="HReportEmpName" name="HReportEmpName" id="HReportEmpName" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="hidden" name="HReportEmpID" id="HReportEmpID" lay-verify="HReportEmpID" value="0">
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHReportEmp" id="btnSearchHReportEmp" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                <input type="text" class="layui-input" lay-verify="HReportEmpName"
                                                    name="HReportEmpName" id="HReportEmpName"
                                                    style="background-color:#efefef4d;width: 60%;display: inline-block;"
                                                    readonly>
                                                <input type="hidden" name="HReportEmpID" id="HReportEmpID"
                                                    lay-verify="HReportEmpID" value="0">
                                                <button class="layui-btn layuiadmin-btn-order" type="button"
                                                    lay-submit="" lay-filter="btnSearchHReportEmp"
                                                    id="btnSearchHReportEmp"
                                                    style="padding: 0 10px;float: right;margin-right: 3px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">接收人</label>
                                            <label class="layui-form-label"
                                                style="width: 85px;padding: 9px 18px;">接收人</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" lay-verify="HReceiveEmp" name="HReceiveEmp" id="HReceiveEmp" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="text" class="layui-input" lay-verify="HReceiveEmp"
                                                    name="HReceiveEmp" id="HReceiveEmp"
                                                    style="background-color:#efefef4d;width: 60%;display: inline-block;"
                                                    readonly>
                                                <!--<input type="hidden" name="HPMEmpID" id="HPMEmpID" lay-verify="HPMEmpID" value="0">-->
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHReceiveEmp" id="btnSearchHReceiveEmp" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                <button class="layui-btn layuiadmin-btn-order" type="button"
                                                    lay-submit="" lay-filter="btnSearchHReceiveEmp"
                                                    id="btnSearchHReceiveEmp"
                                                    style="padding: 0 10px;float: right;margin-right: 3px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;padding: 9px 18px;">抄送人</label>
                                            <label class="layui-form-label"
                                                style="width: 85px;padding: 9px 18px;">抄送人</label>
                                            <div class="layui-input-block" style="margin-left: 77px;">
                                                <input type="text" class="layui-input" lay-verify="HCopyEmp" name="HCopyEmp" id="HCopyEmp" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
                                                <input type="text" class="layui-input" lay-verify="HCopyEmp"
                                                    name="HCopyEmp" id="HCopyEmp"
                                                    style="background-color:#efefef4d;width: 60%;display: inline-block;"
                                                    readonly>
                                                <!--<input type="hidden" name="HWorkEmpID" id="HWorkEmpID" lay-verify="HWorkEmpID" value="0">-->
                                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearchHCopyEmp" id="btnSearchHCopyEmp" style="padding: 0 10px;float: right;margin-right: 3px;">
                                                <button class="layui-btn layuiadmin-btn-order" type="button"
                                                    lay-submit="" lay-filter="btnSearchHCopyEmp" id="btnSearchHCopyEmp"
                                                    style="padding: 0 10px;float: right;margin-right: 3px;">
                                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                </button>
                                            </div>
@@ -124,13 +157,15 @@
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">备注</label>
                                            <div class="layui-input-block" style="margin-left: 120px; width: 501px;">
                                                <input type="text" class="layui-input" lay-verify="HRemark" name="HRemark" id="HRemark">
                                                <input type="text" class="layui-input" lay-verify="HRemark"
                                                    name="HRemark" id="HRemark">
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">组织<label style="color:red"> * </label></label>
                                            <label class="layui-form-label" style="width: 85px;">组织<label
                                                    style="color:red"> * </label></label>
                                            <div class="layui-input-block" style="margin-left: 120px; width: 501px;">
                                                <select name="HOrgID" id="HOrgID" lay-verify="HOrgID">
                                                    <!--动态渲染组织-->
@@ -141,10 +176,14 @@
                                    <div class="layui-row">
                                        <div class="layui-inline">
                                            <div class="layui-input-block" style="margin-left: 120px; width: 501px;">
                                                <input type="hidden" name="HProID" id="HProID" lay-verify="HProID" value="0">
                                                <input type="hidden" name="HProjectStageID" id="HProjectStageID" lay-verify="HProjectStageID" value="0">
                                                <input type="hidden" name="HMainSourceBillType" id="HMainSourceBillType" lay-verify="HMainSourceBillType" value="">
                                                <input type="hidden" name="HMainSourceBillNo" id="HMainSourceBillNo" lay-verify="HMainSourceBillNo" value="">
                                                <input type="hidden" name="HProID" id="HProID" lay-verify="HProID"
                                                    value="0">
                                                <input type="hidden" name="HProjectStageID" id="HProjectStageID"
                                                    lay-verify="HProjectStageID" value="0">
                                                <input type="hidden" name="HMainSourceBillType" id="HMainSourceBillType"
                                                    lay-verify="HMainSourceBillType" value="">
                                                <input type="hidden" name="HMainSourceBillNo" id="HMainSourceBillNo"
                                                    lay-verify="HMainSourceBillNo" value="">
                                            </div>
                                        </div>
                                    </div>
@@ -157,19 +196,22 @@
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">制单人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMaker" id="HMaker" style="background-color:#efefef4d;" readonly>
                                                <input type="text" class="layui-input" name="HMaker" id="HMaker"
                                                    style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">修改人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HUpdater" id="HUpdater" style="background-color:#efefef4d;" readonly>
                                                <input type="text" class="layui-input" name="HUpdater" id="HUpdater"
                                                    style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">审核人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HChecker" id="HChecker" style="background-color:#efefef4d;" readonly>
                                                <input type="text" class="layui-input" name="HChecker" id="HChecker"
                                                    style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
@@ -178,19 +220,22 @@
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">制单日期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HMakerDate" id="HMakerDate" style="background-color:#efefef4d;" readonly>
                                                <input type="text" class="layui-input" name="HMakerDate" id="HMakerDate"
                                                    style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">修改日期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HUpdaterDate" id="HUpdaterDate" style="background-color:#efefef4d;" readonly>
                                                <input type="text" class="layui-input" name="HUpdaterDate"
                                                    id="HUpdaterDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">审核日期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HCheckerDate" id="HCheckerDate" style="background-color:#efefef4d;" readonly>
                                                <input type="text" class="layui-input" name="HCheckerDate"
                                                    id="HCheckerDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
@@ -198,19 +243,22 @@
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">关闭人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HCloseMan" id="HCloseMan" style="background-color:#efefef4d;" readonly>
                                                <input type="text" class="layui-input" name="HCloseMan" id="HCloseMan"
                                                    style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">作废人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HDeleteMan" id="HDeleteMan" style="background-color:#efefef4d;" readonly>
                                                <input type="text" class="layui-input" name="HDeleteMan" id="HDeleteMan"
                                                    style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">退回人</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HBacker" id="HBacker" style="background-color:#efefef4d;" readonly>
                                                <input type="text" class="layui-input" name="HBacker" id="HBacker"
                                                    style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
@@ -218,19 +266,22 @@
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">关闭日期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HCloseManDate" id="HCloseManDate" style="background-color:#efefef4d;" readonly>
                                                <input type="text" class="layui-input" name="HCloseManDate"
                                                    id="HCloseManDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">作废日期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HDeleteManDate" id="HDeleteManDate" style="background-color:#efefef4d;" readonly>
                                                <input type="text" class="layui-input" name="HDeleteManDate"
                                                    id="HDeleteManDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">退回日期</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HBackerDate" id="HBackerDate" style="background-color:#efefef4d;" readonly>
                                                <input type="text" class="layui-input" name="HBackerDate"
                                                    id="HBackerDate" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
@@ -238,7 +289,8 @@
                                        <div class="layui-inline">
                                            <label class="layui-form-label" style="width: 85px;">退回原因</label>
                                            <div class="layui-input-block" style="margin-left: 120px;">
                                                <input type="text" class="layui-input" name="HBackRemark" id="HBackRemark" style="background-color:#efefef4d;" readonly>
                                                <input type="text" class="layui-input" name="HBackRemark"
                                                    id="HBackRemark" style="background-color:#efefef4d;" readonly>
                                            </div>
                                        </div>
                                    </div>
@@ -247,9 +299,10 @@
                        </div>
                    </div>
                    <div class="layui-tab" lay-filter="tab-POStockInBill">
                        <ul class="layui-tab-title" lay-filter="tab-all">
                            <li lay-id="1" style="padding:1px;" class="layui-this">项目阶段</li>
                            <li lay-id="2" style="padding:1px;" class="layui-this">附件</li>
                        </ul>
                        <div class="layui-tab-content">
                            <!--子表-->
@@ -265,6 +318,15 @@
                                    </div>
                                </script>
                            </div>
                            <!-- å­è¡¨é™„ä»¶ -->
                            <div class="layui-tab-item layui-show">
                                <script type="text/html" id="toolbarAttachmentTable">
                                    <div class="layui-btn-container">
                                        <!-- <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-ChooseFile"><i class="layui-icon layui-icon-form"></i>上传附件</button> -->
                                    </div>
                                </script>
                                <table class="layui-hide" id="AttachmentTable" lay-filter="AttachmentTable"></table>
                            </div>
                        </div>
                    </div>
                </form>
@@ -274,7 +336,24 @@
    <!--子表表:删除-->
    <script type="text/html" id="barDemo">
        <!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
    <!-- å­è¡¨é™„ä»¶ æ“ä½œæ  -->
    <script type="text/html" id="AttachmentOperate">
        <!-- ä¸Šä¼ å‰æ˜¾ç¤º -->
    <div {{d.uploadStatus==0 ? '' : 'style="display:none;"' }} class="waitUploaded">
        <a class="layui-btn layui-btn-xs" lay-event="fileSelect">选择文件</a>
    </div>
    <!-- å¾…上传显示 -->
    <div {{d.uploadStatus==1 ? '' : 'style="display:none;"' }} class="preUploaded">
        <a class="layui-btn layui-btn-xs" lay-event="fileUpload">上传文件</a>
    </div>
    <!-- ä¸Šä¼ åŽæ˜¾ç¤º -->
    <div {{d.uploadStatus==2 ? '' : 'style="display:none;"' }} class="uploaded">
        <a class="layui-btn layui-btn-xs" lay-event="downloadFile">下载</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delFile">删除</a>
    </div>
    </script>
    <!--复选框 å®Œæˆæ ‡è®°-->
@@ -295,19 +374,25 @@
            base: '../../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'laydate', 'table', 'element'], function () {
        }).use(['index', 'form', 'laydate', 'table', 'element', 'upload'], function () {
            //#region å…¬å…±å˜é‡
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , element = layui.element;
                , element = layui.element
                , upload = layui.upload
                ;
            //模块名
            var HModName = "PM_WorkTaskReportBill";
            //表格渲染参数
            var option = {};            //项目阶段表渲染参数
            // é™„件表格渲染参数
            var attachmentOption = {};
            // æ–‡ä»¶ä¸Šä¼ ç»„件绑定实例
            fileUploadInst = {}
            //记录组织的值
            var HOrgIDBar = 0;
            //获取参数
@@ -316,6 +401,9 @@
            var linterid = params[params[1]]; //从参数中获取 å•据内码
            var HEntryID = params[params[3]]; //从参数中获取 å•据内码
            //var HProjectStageID = params[params[3]]; //阶段内码
            // é™„件上传临时文件
            var tempFileMap = {};
            //全局变量
            window.OptionData = [];
@@ -361,7 +449,9 @@
                $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
                //初始化项目阶段表
                get_InitGrid();
                //初始化 é™„件表
                get_InitAttachmentGrid();
            }
            else if (OperationType == 2) {      //我的任务模块下推
                ////禁用组织选项
@@ -379,7 +469,8 @@
                $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
                //初始化项目阶段表
                get_InitGrid();
                //初始化 é™„件表
                get_InitAttachmentGrid();
                get_Display();
            }
            else if (OperationType == 3) {//如果修改则走下面 new                                        //编辑
@@ -387,6 +478,9 @@
                //$("#HOrgID").attr("disabled", true);
                //初始化项目阶段表
                get_InitGrid();
                //初始化 é™„件表
                get_InitAttachmentGrid();
                RoadBillMain(linterid);
            } else if (OperationType == 4) {                     //下推
                //禁用组织选项
@@ -404,9 +498,11 @@
                $("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
                //初始化项目阶段表
                get_InitGrid();
                //初始化 é™„件表
                get_InitAttachmentGrid();
                //下推-页面设置
                set_WorkTaskReport();
            }
            //#endregion
@@ -514,11 +610,25 @@
                    , "HSourceBillNo": ""
                    , "HSourceBillType": ""
                };
                // æ–°å»º é™„件行数据
                var attachmentNewRaw = {
                    "HWeekReportFileAddr": ""
                    , "HWeekReportFileName": ""
                    , "HWeekProDays": "0"
                    , "Size": ""
                    , "Status": ""
                    , "uploadStatus": 0
                }
                switch (obj.event) {
                    case 'btn-AddLine':
                        table.cache["mainTable"].push(NewRow);
                        option.data = table.cache["mainTable"];
                        table.render(option);
                        table.cache["AttachmentTable"].push(attachmentNewRaw);
                        attachmentOption.data = table.cache["AttachmentTable"]
                        table.render(attachmentOption);
                        CheckedSet_tableSub();
                        for (var i = 1; i <= option.data.length; i++) {
@@ -544,6 +654,9 @@
                            table.cache["mainTable"].push(JSON.parse(copyrow));//将复制的行强转成json追加到表格上
                            option.data = table.cache["mainTable"];//将数据绑定到data上
                            table.render(option);//将数据渲染到表格上
                            table.cache["AttachmentTable"].push(attachmentNewRaw);
                            attachmentOption.data = table.cache["AttachmentTable"]
                            table.render(attachmentOption);
                            CheckedSet_tableSub();
                            for (var i = 1; i <= option.data.length; i++) {
@@ -597,6 +710,82 @@
            })
            //#endregion
            table.on('tool(AttachmentTable)', function (obj) {
                var data = obj.data;      // å½“前行数据
                var that = this;          // å½“前点击的按钮
                var tr = $(this).closest("tr");
                var index = tr.data("index");
                if (obj.event === 'fileUpload') {
                    // åˆ¤æ–­æ˜¯å¦å·²é€‰æ‹©æ–‡ä»¶
                    console.log(tempFileMap, index)
                    if (!tempFileMap[index]) {
                        layer.msg("请先选择文件!");
                        return;
                    }
                    var formData = new FormData();
                    formData.append("file", tempFileMap[index]); // è¿½åŠ å·²é€‰æ‹©çš„æ–‡ä»¶
                    formData.append("HNumber", $("#HBillNo").val());
                    formData.append("HRemark", $("#HRemark").val());
                    formData.append("HUserName", sessionStorage["HUserName"]);
                    layer.load(); // åŠ è½½ä¸­
                    $.ajax({
                        url: GetWEBURL() + "/PM_WorkTaskReportBill/UploadFile",
                        type: "POST",
                        data: formData,
                        contentType: false,
                        processData: false,
                        success: function (res) {
                            layer.closeAll('loading');
                            if (res.count == 1) {
                                // èŽ·å–è¡¨æ ¼ç¼“å­˜
                                var cache = table.cache['AttachmentTable'];
                                cache[index].Status = "已上传";
                                cache[index].uploadStatus = 2;
                                cache[index].HWeekReportFileAddr = TransWebUrlToFileUrl(GetWEBURL(), res.data + cache[index].HWeekReportFileName)
                                console.log(cache[index].HWeekReportFileAddr)
                                table.reload('AttachmentTable', {
                                    data: cache,
                                });
                                layer.msg("上传成功");
                            } else {
                                layer.msg("上传失败:" + res.Message);
                            }
                        },
                        error: function () {
                            layer.closeAll('loading');
                            layer.msg("上传异常,请重试");
                        }
                    });
                } else if (obj.event == 'downloadFile') {
                    // ä¸‹è½½æ–‡ä»¶
                    downloadFile(index)
                } else if (obj.event == 'delFile') {
                    // åˆ é™¤ç¼“å­˜
                    var cache = table.cache['AttachmentTable'];
                    cache[index].HWeekReportFileAddr = "";
                    cache[index].HWeekReportFileName = "";
                    cache[index].Size = "";
                    cache[index].Status = "";
                    cache[index].HWeekProDays = 0;
                    cache[index].uploadStatus = 0;
                    table.reload('AttachmentTable', {
                        data: cache,
                    });
                    layer.msg("删除成功");
                }
            });
            //
@@ -627,6 +816,48 @@
            //#endregion
            //#region æ­¤é¡µé¢æ‰€æœ‰çš„æ–¹æ³•
            function TransWebUrlToFileUrl(webUrl, fileAddr) {
                webUrl = webUrl.substr(0, webUrl.length - 1) // åŽ»é™¤åŽä¸€ä¸ª/
                lastbackSlashIndex = webUrl.lastIndexOf("/")
                webUrl = webUrl.substr(0, lastbackSlashIndex)
                return webUrl + "/" + fileAddr
            }
            //#region
            function downloadFile(index) {
                var cache = table.cache['AttachmentTable'];
                var row = cache[index];
                // ä¼˜å…ˆä½¿ç”¨æœ¬åœ°ä¸´æ—¶æ–‡ä»¶
                if (tempFileMap[index]) {
                    const file = tempFileMap[index];
                    const url = URL.createObjectURL(file);
                    const a = document.createElement('a');
                    a.href = url;
                    a.download = file.name;
                    document.body.appendChild(a);
                    a.click();
                    document.body.removeChild(a);
                    URL.revokeObjectURL(url);
                    return;
                }
                if (row.HWeekReportFileAddr) {
                    var fileUrl = row.HWeekReportFileAddr;
                    const a = document.createElement('a');
                    a.href = fileUrl;
                    a.download = row.HWeekReportFileName; // æ–‡ä»¶å
                    document.body.appendChild(a);
                    a.click();
                    document.body.removeChild(a);
                    return;
                }
                layer.msg('无可下载的文件');
            }
            //#endregion
            //#region èŽ·å–ç»„ç»‡
            function Organ() {
@@ -755,7 +986,47 @@
                CheckedSet_tableSub();
            }
            //#endregion
            //#region å­è¡¨é™„件表 åˆå§‹åŒ–
            function get_InitAttachmentGrid() {
                attachmentOption = {
                    elem: '#AttachmentTable',
                    toolbar: '#toolbarAttachmentTable'
                    , totalRow: true
                    , cellMinWidth: 120
                    , height: 400
                    , cols: [[
                        { type: 'numbers', title: '序号', style: 'background-color: #f9f9f9;' }
                        , { field: 'HWeekReportFileAddr', title: '人天单文件路径', hide: true, style: 'background-color: #f9f9f9;' }
                        , { field: 'HWeekReportFileName', title: '人天单文件名称', style: 'background-color: #f9f9f9;' }
                        , { field: 'HWeekProDays', title: '本周实施消耗人天', edit: true, style: 'background-color: #f9f9f9;' }
                        , { field: 'Size', title: '文件大小', style: 'background-color: #f9f9f9;' }
                        , { field: 'Status', title: '上传状态', style: 'background-color: #f9f9f9;' }
                        , { field: 'uploadStatus', title: '上传状态代码', hide: true, style: 'background-color: #f9f9f9;' }
                        , { fixed: 'right', title: '操作', toolbar: '#AttachmentOperate' }
                    ]]
                    , done: function () {
                        bindUploadToTable();
                    }
                }
                var rowDataAttachment = [
                    {
                        "HWeekReportFileAddr": ""
                        , "HWeekReportFileName": ""
                        , "HWeekProDays": "0"
                        , "Size": ""
                        , "Status": ""
                        , "uploadStatus": 0
                    },
                ];
                attachmentOption.data = rowDataAttachment;
                table.render(attachmentOption);
            }
            //#endregion
            //#region å®Œæˆæ ‡è®°
            form.on('checkbox(HFinishFlag)', function (data) {
                //获取下拉框选中的值
@@ -767,6 +1038,40 @@
                    }
                });
            });
            //#endregion
            //#region è‡ªå®šä¹‰è¡¨æ ¼ç»‘定文件上传功能
            function bindUploadToTable() {
                // 1. é€‰æ‹©æœ¬åœ°æ–‡ä»¶ï¼ˆæœªé€‰æ‹© â†’ å¾…上传)
                upload.render({
                    elem: '[lay-event="fileSelect"]',
                    accept: 'file',
                    exts: 'doc|docx|xls|xlsx|pdf|zip|rar|txt',
                    auto: false,
                    choose: function (obj) {
                        var tr = this.item.parents('tr');
                        var index = tr.data('index');
                        var cache = table.cache['AttachmentTable'];
                        // é¢„览文件信息
                        obj.preview(function (i, file) {
                            // å­˜å…¥ä¸´æ—¶æ–‡ä»¶
                            tempFileMap[index] = file;
                            // æ›´æ–°è¡ŒçŠ¶æ€ â†’ å¾…上传
                            cache[index].HWeekReportFileName = file.name;
                            cache[index].Size = (file.size / 1024).toFixed(2) + 'KB';
                            cache[index].Status = "待上传";
                            cache[index].uploadStatus = 1;
                            table.reload('AttachmentTable', { data: cache });
                            console.log(tempFileMap)
                            layer.msg('已选择文件,请点击上传');
                        });
                    }
                });
            }
            //#endregion
            //#region æ±‡æŠ¥äººé€‰æ‹©é¡µé¢
@@ -795,7 +1100,7 @@
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                    , end: function () {}
                    , end: function () { }
                })
            }
            //#endregion
@@ -807,10 +1112,12 @@
                for (var i = 0; i < table.cache["mainTable"].length; i++) {
                    if (table.cache["mainTable"][i] != "") {
                        table.cache["mainTable"][i].LAY_TABLE_INDEX = i;
                        // åˆå¹¶ä¸»è¡¨å¯¹è±¡å’Œé™„件表对象
                        $.extend(true, table.cache["mainTable"][i], table.cache["AttachmentTable"][i])
                        num.push(table.cache["mainTable"][i])
                    }
                }
                //获取组织数据
                data.field.HPRDORGID = sessionStorage["OrganizationID"];//组织
                //若为编辑-保存,则更新修改人和修改时间
@@ -970,7 +1277,7 @@
                });
            }
            //#endregion
            //#region ç¼–辑 é¡µé¢èµ‹å€¼
            function RoadBillMain(linterid)//加载表头
            {
@@ -1016,9 +1323,12 @@
                        //子表  èµ‹å€¼
                        for (var i = 0; i < tableSub.length; i++) {
                            tableSub[i].RowID = (i + 1) * 10;
                            tableSub[i]["uploadStatus"] = tableSub[i]["HWeekReportFileName"] ? 2 : 0
                        }
                        option.data = tableSub;
                        attachmentOption.data = tableSub;
                        table.render(option);
                        table.render(attachmentOption)
                        CheckedSet_tableSub();
                        form.render('select');
                    }
@@ -1030,6 +1340,7 @@
            function set_WorkTaskReport() {
                var data = getUrlVars_JSON().data;
                var dataArray = [];
                var AttachmentArray = [];
                for (var i = 0; i < data.length; i++) {
                    var NewRow =
                    {
@@ -1051,11 +1362,23 @@
                        , "HSourceBillNo": data[i].HSourceBillNo
                        , "HSourceBillType": data[i].HSourceBillType
                    };
                    var attachmentNewRaw = {
                        "HWeekReportFileAddr": ""
                        , "HWeekReportFileName": ""
                        , "HWeekProDays": "0"
                        , "Size": ""
                        , "Status": ""
                        , "uploadStatus": 0
                    }
                    dataArray.push(NewRow);
                    AttachmentArray.push(attachmentNewRaw)
                }
                option.data = dataArray;
                table.render(option);
                attachmentOption.data = AttachmentArray;
                table.render(attachmentOption)
                CheckedSet_tableSub();
@@ -1328,6 +1651,12 @@
                            oldData.splice(obj.tr.data('index'), 1)
                            option.data = oldData;//将数据绑定到data上
                            table.render(option);
                            var oldDataAttachment = table.cache['AttachmentTable'];
                            oldDataAttachment.splice(obj.tr.data('index'), 1)
                            attachmentOption.data = oldDataAttachment
                            table.render(attachmentOption)
                            CheckedSet_tableSub();
                            layer.close(index);
                        }
@@ -1480,7 +1809,7 @@
                    url: GetWEBURL() + '/PM_WorkTaskBill/XTList',
                    type: "GET",
                    async: false,
                    data: { "HInterID": linterid, sWhere: sWhere, "user": sessionStorage["HUserName"]},
                    data: { "HInterID": linterid, sWhere: sWhere, "user": sessionStorage["HUserName"] },
                    success: function (data1) {
                        if (data1.count == 1) {
                            var rowdata = [];
@@ -1698,4 +2027,5 @@
    </script>
</body>
</html>