杨乐
2022-02-07 4915fc2aec6f6e89485479d8be712a92fdc85d08
WebTM/views/Éú²ú¹¤Ðò¹ÜÀí/¹¤ÐòÅɹ¤µ¥/Sc_Add_ProcessSendWork.html
@@ -2,7 +2,7 @@
<html>
<head>
    <meta charset="utf-8" />
        <title>新增派工单</title>
    <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">
@@ -19,7 +19,7 @@
                        <div class="layui-card-header">
                            <div class="layui-btn-group">
                                <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">保存</button>
                                <button type="button" id="add-btn" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Saver">保存</button>
                                <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" lay-filter="Exit">退出</button>
                            </div>
@@ -51,14 +51,14 @@
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label">任务单号:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HManagerName" id="HManagerName"  autocomplete="off" disabled>
                                                        <input class="layui-input" name="HManagerName" id="HManagerName" autocomplete="off" disabled>
                                                        <input id="HManagerID" name="HManagerID" type="hidden" />
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label">车间代码:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HEmpName" id="HEmpName" readonly="readonly" autocomplete="off">
                                                        <input type="text" name="HDeptNumber" id="HDeptNumber" lay-verify="HDeptNumber" readonly="readonly" autocomplete="off" class="layui-input">
                                                    </div>
                                                </div>
                                            </div>
@@ -69,115 +69,45 @@
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label">车间:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HStatus" id="HStatus"  autocomplete="off">
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label"> å†…部单据号:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HSupName" lay-verify="HSupName" id="HSupName" readonly="readonly" autocomplete="off">
                                                        <input id="HSupID" name="HSupID" type="hidden" />
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label"> äº§å“ä»£ç ï¼š</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HDeptName" lay-verify="HDeptName" id="HDeptName" readonly="readonly" autocomplete="off">
                                                        <input type="text" name="HDeptName" id="HDeptName" lay-verify="HDeptName" autocomplete="off" class="layui-input">
                                                        <button type="button" lay-submit="" class="layui-btn" lay-filter="HDeptID-BT">
                                                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                                        </button>
                                                        <input id="HDeptID" name="HDeptID" type="hidden" />
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label"> äº§å“ï¼š</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HDHDate" lay-verify="HDHDate" id="HDHDate">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-row">
                                                  <div class="layui-col-xs3">
                                                    <label class="layui-form-label"> å•位代码:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HDHDate" lay-verify="HDHDate" id="HDHDate">
                                                    </div>
                                                </div>
                                                  <div class="layui-col-xs3">
                                                    <label class="layui-form-label"> å•位:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HDHDate" lay-verify="HDHDate" id="HDHDate">
                                                    </div>
                                                </div>
                                                   <div class="layui-col-xs3">
                                                    <label class="layui-form-label"> è§„格型号:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HDHDate" lay-verify="HDHDate" id="HDHDate">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                          <div class="layui-form-item">
                                            <div class="layui-row">
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label">工序计划单号:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HStatus" id="HStatus"  autocomplete="off">
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label"> è®¡åˆ’开工日期:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HSupName" lay-verify="HSupName" id="HSupName" readonly="readonly" autocomplete="off">
                                                        <input id="HSupID" name="HSupID" type="hidden" />
                                                        <input class="layui-input" name="HPlanBeginDate" lay-verify="HPlanBeginDate" id="HPlanBeginDate" autocomplete="off">
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label"> è®¡åˆ’完工日期:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HDeptName" lay-verify="HDeptName" id="HDeptName" readonly="readonly" autocomplete="off">
                                                        <input id="HDeptID" name="HDeptID" type="hidden" />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                                        <input class="layui-input" name="HPlanEndDate" lay-verify="HPlanEndDate" id="HPlanEndDate" autocomplete="off">
                                           <div class="layui-form-item">
                                            <div class="layui-row">
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label">工序:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HStatus" id="HStatus"  autocomplete="off">
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label"> æ€»æ´¾å·¥æ•°é‡ï¼š</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HSupName" lay-verify="HSupName" id="HSupName" readonly="readonly" autocomplete="off">
                                                        <input id="HSupID" name="HSupID" type="hidden" />
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label"> æ€»å·¥æ—¶ï¼š</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HDeptName" lay-verify="HDeptName" id="HDeptName" readonly="readonly" autocomplete="off">
                                                        <input id="HDeptID" name="HDeptID" type="hidden" />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-row">
                                                <div class="layui-col-xs6">
                                                    <label class="layui-form-label"> å¤‡    æ³¨ï¼š</label>
                                                    <div class="layui-input-block">
@@ -187,55 +117,55 @@
                                            </div>
                                        </div>
                                    </div>
                                            <div class="layui-tab-item">
                                                <div class="layui-form-item">
                                                    <div class="layui-row">
                                                        <div class="layui-col-xs3">
                                                            <label class="layui-form-label">制 å• äººï¼š</label>
                                                            <div class="layui-input-inline">
                                                                <input class="layui-input" name="HMaker" id="HMaker" readonly="readonly" autocomplete="off">
                                                            </div>
                                                        </div>
                                                        <div class="layui-col-xs3">
                                                            <label class="layui-form-label">审 æ ¸ äººï¼š</label>
                                                            <div class="layui-input-inline">
                                                                <input class="layui-input" name="HChecker" id="HChecker" readonly="readonly" autocomplete="off">
                                                            </div>
                                                        </div>
                                                        <div class="layui-col-xs3">
                                                            <label class="layui-form-label">变 æ›´ äººï¼š</label>
                                                            <div class="layui-input-inline">
                                                                <input class="layui-input" name="HUpDater" id="HUpDater" readonly="readonly" autocomplete="off">
                                                            </div>
                                                        </div>
                                    <div class="layui-tab-item">
                                        <div class="layui-form-item">
                                            <div class="layui-row">
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label">制 å• äººï¼š</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HMaker" id="HMaker" readonly="readonly" autocomplete="off">
                                                    </div>
                                                </div>
                                                <div class="layui-form-item">
                                                    <div class="layui-row">
                                                        <div class="layui-col-xs3">
                                                            <label class="layui-form-label">制单日期:</label>
                                                            <div class="layui-input-inline">
                                                                <input class="layui-input" name="HMakeDate" id="HMakeDate" readonly="readonly" autocomplete="off">
                                                            </div>
                                                        </div>
                                                        <div class="layui-col-xs3">
                                                            <label class="layui-form-label">审核日期:</label>
                                                            <div class="layui-input-inline">
                                                                <input class="layui-input" name="HCheckDate" id="HCheckDate" readonly="readonly" autocomplete="off">
                                                            </div>
                                                        </div>
                                                        <div class="layui-col-xs3">
                                                            <label class="layui-form-label">变更日期:</label>
                                                            <div class="layui-input-inline">
                                                                <input class="layui-input" name="HUpDateDate" id="HUpDateDate" readonly="readonly" autocomplete="off">
                                                            </div>
                                                        </div>
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label">审 æ ¸ äººï¼š</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HChecker" id="HChecker" readonly="readonly" autocomplete="off">
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label">变 æ›´ äººï¼š</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HUpDater" id="HUpDater" readonly="readonly" autocomplete="off">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="layui-form-item">
                                            <div class="layui-row">
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label">制单日期:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HMakeDate" id="HMakeDate" readonly="readonly" autocomplete="off">
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label">审核日期:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HCheckDate" id="HCheckDate" readonly="readonly" autocomplete="off">
                                                    </div>
                                                </div>
                                                <div class="layui-col-xs3">
                                                    <label class="layui-form-label">变更日期:</label>
                                                    <div class="layui-input-inline">
                                                        <input class="layui-input" name="HUpDateDate" id="HUpDateDate" readonly="readonly" autocomplete="off">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table>
                        <script type="text/html" id="toolbarDemo">
@@ -247,16 +177,15 @@
                        <blockquote class="layui-elem-quote">工序计划单</blockquote>
                    </form>
                </div>
                        </div>
            </div>
        </div>
    </div>
     <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/layui/layui.js"></script>
    <script src="../../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script>
         function getUrlVars() {
        function getUrlVars() {
            var vars = [], hash;
            var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
            for (var i = 0; i < hashes.length; i++) {
@@ -268,15 +197,29 @@
        }
        var params = getUrlVars();
        var HInterID = params[params[0]];
            $.ajax({
            url: GetWEBURL()+"/Sc_ProcessMangement/MES_Sc_ProcessSendWorkMain_Json",
        var lentryid = params[params[1]];
        var PlanBeginDate = params[params[2]];
        var PlanEndDate = params[params[3]];
        //alert(HInterID + '第二个:' + lentryid);
        var date = new Date();
        var day = date.getDate();
        var month = date.getMonth() + 1;
        var year = date.getFullYear();
        var shijian = year + "-" + month + "-" + day;
        //获取单据号
        $.ajax({
            url: GetWEBURL() + "/api/newBill/getNewInterBillNo",
            type: "GET",
            data: {"sWhere": "and HInterID="+HInterID },
            data: { "billType": '3712' },
            success: function (d) {
                //console.log(d.data);
                $("#HBillNo").val(d.data[0].HBillNo);
                $("#HDate").val(d.data[0].HDate);
                $("#HBillNo").val(d.data.HBillNo);//
                $("#HDate").val(shijian);
                $('#HPlanBeginDate').val(shijian);
                //HPlanEndDate
                $('#HPlanEndDate').val(shijian);
            }, error: function () {
                layer.alert("获取单据号失败!", { icon: 5 });
            }
        });
@@ -295,64 +238,121 @@
                , laydate = layui.laydate
            //
            //执行一个laydate实例
            laydate.render({
                elem: '#HPlanBeginDate,#HPlanEndDate' //指定元素
            });
            //加载计划单下推的数据
            RoadHBillSub();
            table.render({
                elem: '#mainTable'
              //, url: GetWEBURL()+'GetNewPOInStockShowBillSub'
              , toolbar: '#toolbarDemo'
              //, where: { sMsg: linterid, sMsg2: lentryid, sMsg3: lSourceBillType }
             // , where: { sMsg: '28', sMsg2: '28,5;' }
              , cols: [[
                  { type: 'checkbox', fixed: 'left' }
                  , { field: 'HInterID', title: 'HInterID', sort: true, fixed: true, hide: true }
                    ,{ field: 'HDate', title: '日期', sort: true, width: 120 }
                    , { field: 'HBillNo', title: '单据号', sort: true, width: 170 }
                //, url: GetWEBURL()+'GetNewPOInStockShowBillSub'
                , toolbar: '#toolbarDemo'
                //, where: { sMsg: linterid, sMsg2: lentryid, sMsg3: lSourceBillType }
                // , where: { sMsg: '28', sMsg2: '28,5;' }
                , cols: [[
                    { type: 'checkbox' }
                    //{ field: 'hmainid', title: 'hmainid', sort: true, width: 165 }
                    , { field: 'hmainid', title: 'hmainid', sort: true, fixed: true, hide: true }
                    , { field: '日期', title: '日期', sort: true, width: 120 }
                    , { field: '单据号', title: '单据号', sort: true, width: 170 }
                    //, { field: 'HBillStatus ', title: '单据状态', width: 105 }
                    , { field: 'HICMOBillNo', title: '任务单号' }
                    , { field: '计划数量', title: '计划数量', width: 100, edit: 'text', event: "inputHPlanQty" }
                    , { field: 'HMaterID', title: 'HMaterID' }
                    ////, { field: 'hunitid', title: 'hunitid' }
                    , { field: 'HMaterID ', title: '产品ID ', width: 115 }
                    , { field: 'HMaterNumber', title: '产品代码' }
                    , { field: '物料代码 ', title: '物料代码 ', width: 115 }
                    , { field: '物料名称', title: '物料名称' }
                    ////, { field: 'hempid', title: 'hempid' }
                    , { field: 'HUnitID', title: '单位ID', width: 100 }
                    , { field: '规格型号', title: '规格型号', width: 100 }
                    , { field: 'HUnitNumber', title: '单位代码' }
                    , { field: 'HPlanQty', title: '计划数量',width:100,edit: 'text', event: "inputHPlanQty"  }
                    , { field: 'HPlanBeginDate', title: '计划开工日期' }
                    , { field: 'HPlanEndDate', title: '计划完工日期' }
                    , { field: '单位', title: '单位' }
                    , { field: 'hunitid', title: 'hunitid' }
                    , { field: '计量单位代码', title: '计量单位代码' }
                    ////, { field: 'HCenterID', title: 'HCenterID' }
                    , { field: 'HExplanation', title: '摘要' }
                    , { field: 'HRemark ', title: '备注' }
                    , { field: '计量单位', title: '计量单位' }
                    , { field: '生产数量 ', title: '生产数量' }
                    ////, { field: 'hbomid', title: 'hbomid' }
                    , { field: 'HInnerBillNo', title: '内部单据号' }
                    , { field: 'HSupID', title: '委外加工单位' }
                    , { field: 'HMarker', title: '检验人' }
                    , { field: 'HBacker', title: '退回人' }
                    , { field: 'HBackDate', title: '退回日期' }
                    , { field: 'HChecker', title: '审核人' }
                    , { field: 'HCheckDate', title: '审核日期' }
                    , { field: 'HMaker', title: '制单人' }
                    , { field: 'HMakeDate', title: '制单日期' }
                    , { field: 'HUpDater', title: '修改人' }
                    , { field: 'HUpDateDate', title: '修改日期' }
                    , { field: 'HCloseMan', title: '关闭人' }
                    , { field: 'HCloseDate', title: '关闭日期' }
                    , { field: 'HCloseType', title: '关闭类型' }
                    , { field: '计划开工日期', title: '计划开工日期' }
                    , { field: '计划完工日期', title: '计划完工日期' }
                    , { field: '摘要', title: '摘要' }
                    , { field: '表头备注', title: '表头备注' }
                    , { field: '内部单据号', title: '内部单据号' }
                    , { field: 'hicmointerid', title: 'hicmointerid' }
                    , { field: '任务单号', title: '任务单号' }
                    , { field: '制单人', title: '制单人' }
                    , { field: '制单日期', title: '制单日期' }
                    , { field: '审核人', title: '审核人' }
                    , { field: '审核日期', title: '审核日期' }
                    , { field: '修改人', title: '修改人' }
                    , { field: '修改日期', title: '修改日期' }
                    , { field: '关闭人', title: '关闭人' }
                    ////, { field: 'hsubid', title: 'hsubid' }
                    , { field: 'HDeleteMan', title: '作废人' }
                    , { field: 'HDeleteDate', title: '作废日期' }
              ]]
              // , data: [linterid]
                    , { field: '关闭日期', title: '关闭日期' }
                    , { field: '关闭类型', title: '关闭类型' }
                    , { field: '作废人', title: '作废人' }
                    , { field: '作废日期', title: '作废日期' }
                    , { field: 'hsubid', title: 'hsubid', fixed: true, hide: true }
                    , { field: '工序计划单号', title: '工序计划单号' }
                    , { field: '工序号', title: '工序号' }
                    , { field: 'hprocid', title: 'hprocid' }
                    , { field: '工序代码', title: '工序代码' }
                    , { field: '工序', title: '工序' }
                    , { field: '加工说明', title: '加工说明' }
                    , { field: '开工固天', title: '开工固天' }
                    , { field: '开工固数', title: '开工固数' }
                    , { field: 'HCenterID', title: 'HCenterID' }
                    , { field: '工作中心代码', title: '工作中心代码' }
                    , { field: '工作中心', title: '工作中心' }
                    , { field: 'HDeptID', title: 'HDeptID' }
                    , { field: '加工车间代码', title: '加工车间代码' }
                    , { field: '加工车间', title: '加工车间' }
                    , { field: 'HGroupID', title: 'HGroupID' }
                    , { field: '班组代码', title: '班组代码' }
                    , { field: '班组名称', title: '班组名称' }
                    , { field: 'HWorkerID', title: 'HWorkerID' }
                    , { field: '操作员代码', title: '操作员代码' }
                    , { field: '操作员', title: '操作员' }
                    , { field: 'HSourceID', title: 'HSourceID' }
                    , { field: '资源代码', title: '资源代码' }
                    , { field: '生产资源', title: '生产资源' }
                    , { field: '关联数量', title: '关联数量' }
                    , { field: '时间单位', title: '时间单位' }
                    , { field: '计划加工时间', title: '计划加工时间' }
                    , { field: '工序计划开工日期', title: '工序计划开工日期' }
                    , { field: '工序计划完工日期', title: '工序计划完工日期' }
                    , { field: '准备时间', title: '准备时间' }
                    , { field: '排队时间', title: '排队时间' }
                    , { field: '转移时间', title: '转移时间' }
                    , { field: '表体备注', title: '表体备注' }
                    , { field: '批次', title: '批次' }
                    , { field: '源单主内码', title: '源单主内码' }
                    , { field: '源单子内码', title: '源单子内码' }
                    , { field: '源单单号', title: '源单单号' }
                    , { field: '源单类型', title: '源单类型' }
                    , { field: '销售订单主ID', title: '销售订单主ID' }
                    , { field: '销售订单子ID', title: '销售订单子ID' }
                    , { field: '销售订单号', title: '销售订单号' }
                    , { field: 'HBillType', title: 'HBillType' }
                    , { field: '单据类型', title: '单据类型' }
                    , { field: 'HBillSubType', title: 'HBillSubType' }
                    , { field: 'HQtyDecimal', title: 'HQtyDecimal' }
                    , { field: 'HPriceDecimal', title: 'HPriceDecimal' }
                ]]
                // , data: [linterid]
                // , page: true
            , limit: 500 //每页默认显示的数量
              //, height: 500
              , done: function () {
                     layer.closeAll("loading");
                 }
                , limit: 500 //每页默认显示的数量
                //, height: 500
                , done: function () {
                    layer.closeAll("loading");
                }
            });
            table.on('tool(mainTable)', function (obj) {
                var data = obj.data;
                if (obj.event==='inputHPlanQty') {
                     $(obj.tr).find(".layui-table-edit").keyup(function () {
                if (obj.event === 'inputHPlanQty') {
                    $(obj.tr).find(".layui-table-edit").keyup(function () {
                        var $input = $(this), val = $input.val();
                        if (!val) val = "1";
                        $input.val(val.replace(/[^\d]/g, ''));
@@ -360,15 +360,15 @@
                }
            });
             ///加载显示数据
            ///编辑 åŠ è½½æ˜¾ç¤ºæ•°æ®
            function RoadHBillSub() {
                     $.ajax({
            url: GetWEBURL()+'/Sc_ProcessMangement/MES_Sc_ProcessPlanMain_Json',
            type: "GET",
            data: { "sWhere": "and HInterID="+HInterID},
                 success: function (result) {
                     console.log(result);
                     //$("#HBillNo").val(result.data[0].HInterID);
                $.ajax({
                    url: GetWEBURL() + '/Sc_ProcessMangement/MES_Sc_ProcessPlanMain_Json',
                    type: "GET",
                    data: { "sWhere": "and hmainid in('" + lentryid + "')", "user": sessionStorage["HUserName"]},
                    success: function (result) {
                        console.log(result);
                        //$("#HBillNo").val(result.data[0].HInterID);
                        ajaxReturnData = JSON.parse(JSON.stringify(result)).data;
                        table.reload('mainTable', {
@@ -379,49 +379,127 @@
                                layer.closeAll("loading");
                            }
                        });
                         },
                  error: function (result) {
                    },
                    error: function (result) {
                        console.log(result);
                    }
             });
                });
            };
            //  form.on('submit(Saver)', function (data) {//保存
            //    //debugger;
            //    var sMainStr = JSON.stringify(data.field);
            //    var sSubStr = JSON.stringify(table.cache['mainTable']);
            //    var sMainSub = sMainStr + ';' + sSubStr;
            //    $.ajax(
            //    {
            //        type: "POST",
            //        url: GetWEBURL()+"SaverPOInStock", //方法所在页面和方法名
            //        async: true,
            //        data: {"msg": sMainSub  },
            //        dataType: "json",
            //        success: function (data) {
            //            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
            //                layer.msg(data.Message, { icon: 1 });
            //            }
            //            else {
            //                f_alert(data.Message);
            //            }
            //            layer.closeAll("loading");
            //        },
            //        error: function (err) {
            //            f_alert("错误:" + err);
            //        }
            //    });
            //});
            form.on('submit(Saver)', function (data) {//保存
                //debugger;
                var sMainStr = JSON.stringify(data.field);
                var sSubStr = JSON.stringify(table.cache['mainTable']);
                var sMainSub = sMainStr + ';' + sSubStr + ";" + sessionStorage["HUserName"];
                $.ajax(
                    {
                        type: "POST",
                        url: GetWEBURL() + "SaveProcessSendWork", //方法所在页面和方法名
                        async: true,
                        data: { "msg": sMainSub },
                        dataType: "json",
                        success: function (data) {
                            if (data.count == 1) { // è¯´æ˜ŽéªŒè¯æˆåŠŸäº†ï¼Œ
                                layer.msg(data.Message, { icon: 1 });
                                $('#add-btn').addClass("layui-btn-disabled").attr("disabled", true);
                            }
                            else {
                                f_alert(data.Message);
                                console.log("bobo" + sMainStr);
                            }
                            layer.closeAll("loading");
                        },
                        error: function (err) {
                            f_alert("错误:" + err);
                            console.log("bobo" + sMainStr);
                        }
                    });
            });
            function f_alert(sMsg) {
                layer.alert(sMsg, { icon: 5 });
            }
              form.on('submit(Exit)', function (data) {//保存
            form.on('submit(Exit)', function (data) {//保存
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index); //再执行关闭
            });
            //选择部门
            form.on('submit(HDeptID-BT)', function () {//选择部门
                layer.open({
                    type: 2
                    , area: ['666px', '666px']
                    , title: '部门列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_DepartmentList.html', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //选择产品
            form.on('submit(HMateriaID-BT)', function () {//选择产品
                layer.open({
                    type: 2
                    , area: ['666px', '666px']
                    , title: '产品列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_MaterialList.html', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
            //HUnitID-BT
            //选择单位
            form.on('submit(HUnitID-BT)', function () {//选择单位
                layer.open({
                    type: 2
                    , area: ['666px', '666px']
                    , title: '单位列表'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_UnitList.html', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                })
            });
        });
        function GetHDeptNameValue(obj) {   //返回部门
            $("#HDeptName").val(obj[0].HName);
            $("#HDeptID").val(obj[0].HItemID);
            $("#HDeptNumber").val(obj[0].HNumber);
        }
        function GetHMaterNameValue(obj) {   //返回产品
            $("#HMateriaName").val(obj[0].HName);
            $("#HMateriaNumber").val(obj[0].HNumber);
        }
        function GetHUnitNameValue(obj) {   //返回单位
            $("#HDHName").val(obj[0].HName);
            $("#HDHNumber").val(obj[0].HNumber);
        }
    </script>