yusijie
2024-03-29 ae5cfe81fd2b9f38c2e9ccfcdeaa7be2b28ad5dc
WebTM/views/ÖÊÁ¿¹ÜÀí/Ѳ¼ì¼Ç¼µ¥/QC_Add_Edit_PatrolProcCheckBill.html
@@ -8,6 +8,7 @@
    <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/PageTitle.js"></script>
    <style>
        /* é˜²æ­¢ä¸‹æ‹‰æ¡†çš„下拉列表被隐藏---必须设置--- */
        .layui-table-cell {
@@ -35,7 +36,7 @@
                        </div>
                        <div class="layui-card-body">
                            <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                                <h1 style="text-align:center;"><b>巡检单</b></h1>
                                <h1 style="text-align: center; padding: 10px 0;"><b>巡检单</b></h1>
                                <div class="layui-tab-content">
                                    <div class="layui-tab-item layui-show">
                                        <div class="layui-form-item">
@@ -91,6 +92,13 @@
                                                    <label class="layui-form-label" style="margin-left:5px;">工序名称</label>
                                                    <div class="layui-input-inline">
                                                        <input type="text" name="HMainProcName" id="HMainProcName" onkeyup="this.value=this.value.replace(/\D/g,'')" lay-verify="" autocomplete="off" class="layui-input" value="">
                                                    </div>
                                                </div>
                                                <div class="layui-inline">
                                                    <label class="layui-form-label">判断结论</label>
                                                    <div class="layui-input-block">
                                                        <input type="radio" name="HLastResult" id="HLastResult" value="1" title="合格" checked>
                                                        <input type="radio" name="HLastResult" id="HLastResult" value="0" title="不合格">
                                                    </div>
                                                </div>
                                                <div class="layui-colorpicker-xs" style="margin-top:15px">
@@ -308,15 +316,24 @@
            //    }, function () { window.location.href = "../../user/login.html"; });
            //}
            //debugger
            //#region ã€åŠ¨æ€èŽ·å–æ¨¡å—åç§°ã€‘
            var HModuleType = "7506";
            //通过单据类型,从数据库动态获取单据模块命名,引用js文件 PageTitle.js
            var HPageTitle = get_PageTitle(HModuleType) == "" ? $("h1").html() : get_PageTitle(HModuleType);
            $("h1").html('<b>' + HPageTitle + '</b>');
            //#endregion
            var tableReload = table.reload;
            var option = {
            window.option = {
                elem: '#mainTable'
                , toolbar: '#toolbarDemo'
                , totalRow: true
                , height: 500
                //,url: '/demo/table/user/' //数据接口
                , page: true //开启分页
                , cols: [[ //表头
                    { type: 'checkbox', fixed: 'left' }
                    { type: 'checkbox', fixed: 'left', totalRowText: '合计行' }
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe", width: 75 }
                    , { field: '检验项目分类', title: '检验项目分类', event: "", width: 120 }
                    , { field: 'HQCCheckItemID', title: '检验项目ID', edit: 'text', hide: true }
@@ -341,16 +358,17 @@
            var option_BadRe = {
                elem: '#BadReTable'
                , toolbar: '#toolbarDemo2'
                , totalRow: true
                , height: 500
                //,url: '/demo/table/user/' //数据接口
                , page: true //开启分页
                , cols: [[ //表头
                    { type: 'checkbox', fixed: 'left' }
                    { type: 'checkbox', fixed: 'left', totalRowText: '合计行' }
                    , { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe", width: 75 }
                    , { field: 'HBadReasonID', title: '不良原因ID', edit: 'text', hide: true }
                    , { field: 'HBadReasonNumber', title: '不良原因代码', edit: 'text', width: 120, event: "HBadReason" }
                    , { field: 'HBadReasonName', title: '不良原因', edit: 'text', width: 120 }
                    , { field: 'HQty', title: '数量', edit: 'text', width: 120, event: "HQty" }
                    , { field: 'HQty', title: '数量', edit: 'text', width: 120, event: "HQty", totalRow: true }
                    , { field: 'HEmpID', title: '责任人ID', edit: 'text', hide: true }
                    , { field: 'HEmpNumber', title: '责任人代码', edit: 'text', width: 120, event: "HEmp" }
                    , { field: 'HEmpName', title: '责任人', edit: 'text', width: 120 }
@@ -575,7 +593,7 @@
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes'],
                                content: ['../../基础资料/生产基础资料/Gy_BadReason.html', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
@@ -589,8 +607,8 @@
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HBadReasonID: checkStatus.data[0].HItemID
                                        , HBadReasonNumber: checkStatus.data[0].HNumber
                                        , HBadReasonName: checkStatus.data[0].HName
                                        , HBadReasonNumber: checkStatus.data[0].不良原因代码
                                        , HBadReasonName: checkStatus.data[0].不良原因名称
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
@@ -613,7 +631,7 @@
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html', 'yes'],
                                content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
@@ -627,8 +645,8 @@
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HEmpID: checkStatus.data[0].HItemID
                                        , HEmpNumber: checkStatus.data[0].HNumber
                                        , HEmpName: checkStatus.data[0].HName
                                        , HEmpNumber: checkStatus.data[0].职员代码
                                        , HEmpName: checkStatus.data[0].职员名称
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
@@ -689,7 +707,7 @@
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html', 'yes'],
                                content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
@@ -703,8 +721,8 @@
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HCheckEmpID: checkStatus.data[0].HItemID
                                        , HCheckEmpNumber: checkStatus.data[0].HNumber
                                        , HCheckEmpName: checkStatus.data[0].HName
                                        , HCheckEmpNumber: checkStatus.data[0].职员代码
                                        , HCheckEmpName: checkStatus.data[0].职员名称
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
@@ -727,7 +745,7 @@
                                shift: 2,
                                area: ['90%', '90%'],
                                maxmin: true,
                                content: ['../../../views/Baseset/基础资料/Gy_MaterialList.html', 'yes'],
                                content: ['../../基础资料/公用基础资料/Gy_Material.html', 'yes'],
                                btn: ['确定', '取消']
                                , btn1: function (index, layero) {
@@ -741,9 +759,9 @@
                                    //同步更新表格和缓存对应的值
                                    obj.update({
                                        HMaterID: checkStatus.data[0].HItemID
                                        , HMaterNumber: checkStatus.data[0].HNumber
                                        , HMaterName: checkStatus.data[0].HName
                                        , HMaterModel: checkStatus.data[0].HModel
                                        , HMaterNumber: checkStatus.data[0].物料代码
                                        , HMaterName: checkStatus.data[0].物料名称
                                        , HMaterModel: checkStatus.data[0].规格型号
                                    });
                                    layer.close(layer.index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                                }
@@ -791,14 +809,31 @@
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_BadReasonList.html', 'yes']
                                , content: ['../../基础资料/生产基础资料/Gy_BadReason.html', 'yes']
                                , resize: false
                                , end: function () {
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
                                    var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                                    if (checkStatus.data.length != 1) {
                                        return layer.msg("请选择一条数据");
                                    }
                                    //更新表格缓存的数据
                                    _obj.update({
                                        HWasterReasonName: HReasonName
                                        , HBadReasonID: ReasonID
                                        HWasterReasonName: checkStatus.data[0].不良原因名称
                                        , HBadReasonID: checkStatus.data[0].HItemID
                                    });
                                    layer.close(index);//关闭弹窗
                                }
                                //, end: function () {
                                //    _obj.update({
                                //        HWasterReasonName: HReasonName
                                //        , HBadReasonID: ReasonID
                                //    });
                                //}
                            })
                            console.log("字段赋值" + data.HWasterReasonName);
                            console.log("行号:" + rowIndex);
@@ -817,13 +852,29 @@
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                                , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html', 'yes']
                                , resize: false
                                , end: function () {
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
                                    var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                                    if (checkStatus.data.length != 1) {
                                        return layer.msg("请选择一条数据");
                                    }
                                    //更新表格缓存的数据
                                    _obj.update({
                                        HEmpName: EmpName
                                        HEmpName: checkStatus.data[0].职员名称
                                    });
                                    layer.close(index);//关闭弹窗
                                }
                                //, end: function () {
                                //    _obj.update({
                                //        HEmpName: EmpName
                                //    });
                                //}
                            })
                            console.log("字段赋值" + data.HEmpName);
                            console.log("行号:" + rowIndex);
@@ -842,14 +893,32 @@
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html', 'yes']
                                , content: ['../../基础资料/生产基础资料/Gy_Process.html', 'yes']
                                , resize: false
                                , end: function () {
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
                                    var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                                    if (checkStatus.data.length != 1) {
                                        return layer.msg("请选择一条数据");
                                    }
                                    //更新表格缓存的数据
                                    _obj.update({
                                        HSQProcName: SQProcName
                                        , HProcID: ProcID
                                        HSQProcName: checkStatus.data[0].工序名称
                                        , HProcID: checkStatus.data[0].HItemID
                                    });
                                    layer.close(index);//关闭弹窗
                                }
                                //, end: function () {
                                //    _obj.update({
                                //        HSQProcName: SQProcName
                                //        , HProcID: ProcID
                                //    });
                                //}
                            })
                            console.log("字段赋值" + data.HSQProcName);
                            console.log("行号:" + rowIndex);
@@ -868,13 +937,31 @@
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_ProcList.html?Type=HZR', 'yes']
                                , content: ['../../基础资料/生产基础资料/Gy_Process.html', 'yes']
                                , resize: false
                                , end: function () {
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
                                    var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                                    if (checkStatus.data.length != 1) {
                                        return layer.msg("请选择一条数据");
                                    }
                                    //更新表格缓存的数据
                                    _obj.update({
                                        HZRProcName: ZRProcName
                                        HZRProcName: checkStatus.data[0].工序名称
                                    });
                                    layer.close(index);//关闭弹窗
                                }
                                //, end: function () {
                                //    _obj.update({
                                //        HZRProcName: ZRProcName
                                //    });
                                //}
                            })
                            console.log("字段赋值" + data.HZRProcName);
                            console.log("行号:" + rowIndex);
@@ -909,13 +996,32 @@
                                , shade: 0.6 //遮罩透明度
                                , maxmin: true //允许全屏最小化
                                , anim: 0 //0-6的动画形式,-1不开启
                                , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HWorker', 'yes']
                                , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html', 'yes']
                                , resize: false
                                , end: function () {
                                , btn: ["确定", "取消"]
                                , btn1: function (index, laero) {
                                    //按钮一  çš„回调
                                    var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
                                    var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
                                    if (checkStatus.data.length != 1) {
                                        return layer.msg("请选择一条数据");
                                    }
                                    //更新表格缓存的数据
                                    _obj.update({
                                        HPSProcName: QRName
                                        HPSProcName: checkStatus.data[0].职员名称
                                    });
                                    layer.close(index);//关闭弹窗
                                }
                                //, end: function () {
                                //        _obj.update({
                                //            HPSProcName: QRName
                                //        });
                                //    }
                                //}
                            })
                            console.log("字段赋值" + data.HPSProcName);
                            console.log("行号:" + rowIndex);
@@ -1172,11 +1278,19 @@
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: ['../../../views/Baseset/基础资料/Gy_EmployeeList.html?Type=HKeeper', 'yes']
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    , content: ['../../基础资料/公用基础资料/Gy_EmployeeList.html?Type=HEmp', 'yes']
                    , btn: ['确定', '取消']
                    , btn1: function (index, layero) {//按钮【按钮一】的回调
                        var iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length === 0) {
                            return layer.msg('请选择数据');
                        }
                        $("#HEmpName").val(checkStatus.data[0].职员名称);
                        $("#HFirstCheckEmp").val(checkStatus.data[0].HItemID);
                        layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
                    }
                    , btn2: function (index, layero) { }
                })
            });
@@ -1506,6 +1620,52 @@
                return true;
            }
        }
        function GetHEmpValue(obj) {  //检验员
            $("#HEmpName").val(obj[0].职员名称);
            $("#HFirstCheckEmp").val(obj[0].HItemID);
        }
        function GetProcessValue(obj) {  //工序
            $("#HMainProcID").val(obj[0].HItemID);
            $("#HMainProcNumber").val(obj[0].工序代码);
            $("#HMainProcName").val(obj[0].工序名称);
            var HQCSchemeID_Patrol = obj[0].HQCSchemeID_Patrol;
            $.ajax({
                url: GetWEBURL() + "/Web/GetCheckItemByCheckProjectID",
                type: "GET",
                data: { "CheckProjectID": HQCSchemeID_Patrol, "HBatchQty": 0 },
                success: function (result) {
                    if (result.code == 1) {
                        var rowdata = [];
                        var data = result.data;
                        for (var i = 0; i < result.data.length; i++) {
                            //子表  èµ‹å€¼
                            rowdata.push({
                                "检验项目分类": data[i]["检验项目分类"], "HQCCheckItemID": data[i]["HQCCheckItemID"], "HQCCheckItemName": data[i]["检验项目"],
                                "HQCStd": "",
                                "HQCNote1": "",
                                "HQCNote2": "",
                                "HQCNote3": "",
                                "HQCNote4": "",
                                "HQCNote5": "",
                                "HQCNote6": "",
                                "HQCNote7": "",
                                "HQCNote8": "",
                                "HQCNote9": "",
                                "HQCNote10": "",
                                "HRemark": ""
                            });
                        }
                        option.data = rowdata;
                        table.render(option);
                    }
                }
            })
        }
    </script>
</body>
</html>