YL
2022-02-15 81c93ee7a4bc6735ad8f69ea0ee7244eaa58d73f
WebTM/views/Ä£Öξ߹ÜÀí/Ä£Öξֿ߲â¹ÜÀí/Sc_MouldScrapOutBillList.html
@@ -2,7 +2,7 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; 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, maximum-scale=1">
@@ -84,6 +84,8 @@
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit"><i class="layui-icon layui-icon-form"></i>编辑</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-view"><i class="layui-icon layui-icon-tips"></i>预览</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></i>打印</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-audit"><i class="layui-icon layui-icon-repeat"></i>审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Faudit"><i class="layui-icon layui-icon-refresh"></i>反审核</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-delete"></i>删除</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
@@ -147,9 +149,17 @@
                    //编辑
                    case 'btn-Edit': set_ShowBill();
                        break;
                    //预览
                    case 'btn-view': get_ViewReport();
                        break;
                    //打印
                    case 'btn-print': get_PrintReport();
                        break;
                    //审核
                    case 'btn-audit': get_Audit();
                        break;
                    //反审核
                    case 'btn-Faudit': get_FAudit();
                        break;
                    //删除
                    case 'btn-Delete': set_DeleteBill();
@@ -157,7 +167,6 @@
                    //刷新
                    case 'get_Refresh': set_Refresh();
                        break;
                    //退出
                    case 'get_Exit': Pub_Close(2);
                        break;
@@ -201,13 +210,19 @@
                    , height: 'full-50'
                    , page: true
                    , cellMinWidth: 120
                    , limit: 50
                    , limits: [50, 500, 5000, 20000]
                    , cols: [[
                        { type: 'checkbox', fixed: 'left' }
                        , { field: 'hmainid', title: '单据ID', hide: true }
                        , { field: '日期', title: '日期', width: 160, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>" }
                        , { field: '单据号', title: '单据号', width: 160 }
                        , { field: '单据类型', title: '单据类型', width: 160 }
                        , { field: '物料代码', title: '物料代码', width: 110 }
                        , { field: 'HSupTypeID', title: 'HSupTypeID', width: 200, hide: true }
                        , { field: '往来类型名称', title: '往来类型', width: 200 }
                        , { field: 'HSupID', title: 'HSupID', width: 200, hide: true }
                        , { field: '往来单位', title: '往来单位', width: 200 }
                        , { field: 'HManagerID', title: 'HManagerID', width: 200, hide: true }
                        , { field: '负责人代码', title: '负责人代码', width: 200 }
                        , { field: '负责人名称', title: '负责人名称', width: 200 }
@@ -220,10 +235,6 @@
                        , { field: 'HDeptID', title: 'HDeptID', width: 200, hide: true }
                        , { field: '部门代码', title: '部门代码', width: 115 }
                        , { field: '部门名称', title: '部门名称', width: 200 }
                        , { field: 'HSupTypeID', title: 'HSupTypeID', width: 200, hide: true }
                        , { field: '往来类型名称', title: '往来类型', width: 200 }
                        , { field: 'HSupID', title: 'HSupID', width: 200, hide: true }
                        , { field: '往来单位', title: '往来单位', width: 200 }
                        , { field: '摘要', title: '摘要', width: 200 }
                        , { field: '内部单据号', title: '内部单据号', width: 115 }
                        , { field: '备注', title: '备注', width: 200 }
@@ -280,7 +291,7 @@
                $.ajax({
                    url: GetWEBURL() + '/Sc_MouldScrapOutHouseBill/GetMouldScrapOutHouseBill',
                    type: "GET",
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
                    data: { "sWhere": sWhere, "user": sessionStorage["HUserName"], "Organization": sessionStorage["Organization"] },
                    success: function (data1) {
                        if (data1.count == 1) {
                            option.data = data1.data;
@@ -323,7 +334,7 @@
                layer.open({
                    type: 2,
                    skin: 'layui-layer-rim', //加上边框
                    title: '新增模治具处理出库单',
                    title: '新增器具处理出库单',
                    closeBtn: 1,
                    shift: 2,
                    area: ['100%', '100%'],
@@ -379,12 +390,16 @@
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    layer.alert("我是打印按钮!单据主ID是:" + InterID);
                    //window.open("../生产工序管理/工序汇报单/HBarPlanPrint.html?linterid=" + linterid + "&Type=HDepartMent" + "&OpenTmp=b");
                    //window.open("../../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + InterID + "&Type=HDepartMent" + "&OpenTmp=b");
                    window.open("../../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + InterID + "&Type=HMouldScrapOutBill&OpenTmp=器具处理出库条码");
                    layer.open({
                        type: 2
                        , area: ['50%', '50%']
                        , title: '打印模版选择'
                        , shade: 0.6 //遮罩透明度
                        , maxmin: false //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + data[0].hmainid.toString() + '&MyMsg=' + data[0].hmainid.toString() + '&Type=HMouldScrapOutBill', 'yes']
                        , resize: false
                    })
                }
                else {
                    layer.msg('请选择一行数据打印!');
@@ -396,15 +411,83 @@
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    layer.alert("我是打印按钮!单据主ID是:" + InterID);
                    //window.open("../生产工序管理/工序汇报单/HBarPlanPrint.html?linterid=" + linterid + "&Type=HDepartMent" + "&OpenTmp=b");
                    //window.open("../../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + InterID + "&Type=HDepartMent" + "&OpenTmp=b");
                    window.open("../../基础资料/公用基础资料/HBarPlanPrint.html?linterid=" + InterID + "&Type=HMouldScrapOutBill&OpenTmp=器具处理出库条码");
                    layer.open({
                        type: 2
                        , area: ['50%', '50%']
                        , title: '打印模版选择'
                        , shade: 0.6 //遮罩透明度
                        , maxmin: false //允许全屏最小化
                        , anim: 0 //0-6的动画形式,-1不开启
                        , content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + data[0].hmainid.toString() + '&MyMsg=' + data[0].hmainid.toString() + '&Type=HMouldScrapOutBill', 'yes']
                        , resize: false
                    })
                }
                else {
                    layer.msg('请选择一行数据打印!');
                }
            }
            //审核
            function get_Audit() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "Sc_MouldScrapOutHouseBill/AuditMouldScrapOutHouseBill", //方法所在页面和方法名
                        data: { "HInterID": InterID, "user": sessionStorage["HUserName"], "flag": 1 },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    window.location.reload();
                                });
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else {
                    layer.msg('请选择一行数据!');
                }
            }
            //反审核
            function get_FAudit() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    $.ajax({
                        type: "GET",
                        url: GetWEBURL() + "Sc_MouldScrapOutHouseBill/AuditMouldScrapOutHouseBill", //方法所在页面和方法名
                        data: { "HInterID": InterID, "user": sessionStorage["HUserName"], "flag": 2 },
                        success: function (result) {
                            if (result.count == 1) {
                                layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                    var index = layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    layer.close(index);
                                    //修改为功后刷新界面
                                    window.location.reload();
                                });
                            } else {
                                layer.alert(result.code + result.Message, { icon: 5 });
                            }
                        }, error: function () {
                            layer.alert("接口请求失败!", { icon: 5 });
                        }
                    });
                }
                else {
                    layer.msg('请选择一行数据!');
                }
            }
            //删除
@@ -414,10 +497,10 @@
                if (checkStatus.data.length === 1) {
                    var InterID = data[0].hmainid.toString();
                    var HBillStatus = data[0].HBillStatus.toString();
                    if (HBillStatus != "1") {
                        layer.msg('单据状态不为未审核状态,不允许删除!');
                        return false;
                    }
                    //if (HBillStatus != "1") {
                    //    layer.msg('单据状态不为未审核状态,不允许删除!');
                    //    return false;
                    //}
                    //逻辑删除方法
                    layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                        $.ajax({