<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <meta name="format-detection" content="telephone=no">
    <th:block th:include="include :: header('连锁商品查询')" />
    <th:block th:include="include :: layout-latest-css" />
    <th:block th:include="include :: ztree-css" />
</head>
<style>
    /* 设置 ul 的基本样式 */

</style>

<body class="gray-bg">
<div class="ui-layout-center">
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse" >
                <form id="SSpglProductdetails-form">
                    <input type="hidden" id="deptId" name="deptId">
                    <input type="hidden" id="parentId" name="parentId">
                    <h4>查询条件</h4>
                    <hr>
                    <div class="select-list" >
                        <div class="col-sm-12">
                        <div class="form-group">
                            <!--is-required 增加星号 显示为必填-->
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <label class="control-label">商品名称:</label>
                                    <input type="text" class="styled-input" placeholder="通用名/商品名/助记码/条形码" name="productName" autocomplete="off"/>
                                </div>
                            </div>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <label class="control-label">营销分类:</label>
                                    <select name="marketingType"  class="styled-input">
                                        <option value="">全部</option>
                                        <option value="1">网络营销</option>
                                        <option value="2">线下营销</option>
                                        <option value="3">电话营销</option>
                                    </select>
                                </div>
                            </div>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <label class="control-label">批准文号:</label>
                                    <input type="text" class="styled-input" placeholder="请输入批准文号" name="genericName" autocomplete="off"/>
                                </div>
                            </div>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <label class="control-label">注册证号:</label>
                                    <input type="text" class="styled-input" placeholder="请输入注册证号" name="genericName" autocomplete="off"/>
                                </div>
                            </div>
                        </div>
                    </div>
                        <div class="col-sm-12">
                            <hr>
                            <div class="form-group">
                                <!--is-required 增加星号 显示为必填-->
                                <div class="col-sm-3">
                                    <div class="input-group">
                                        <label class="control-label">处方类别:</label>
                                        <input type="text" class="styled-input" placeholder="请输入处方类别" name="genericName" autocomplete="off"/>
                                    </div>
                                </div>
                                <div class="col-sm-3">
                                    <div class="input-group">
                                        <label class="control-label">经营范围:</label>
                                        <input type="text" class="styled-input" placeholder="请输入经营范围" name="genericName" autocomplete="off"/>
                                    </div>
                                </div>
                                <div class="col-sm-3">
                                    <div class="input-group">
                                        <label class="control-label">经营属性:</label>
                                        <select name="managementAttribute"  class="styled-input">
                                            <option value="">全部</option>
                                            <option value="1">网络</option>
                                            <option value="2">线下</option>
                                            <option value="3">门店</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-3">
                                    <div class="input-group">
                                        <label class="control-label">销售属性:</label>
                                        <select name="salesAttributes"  class="styled-input">
                                            <option value="">全部</option>
                                            <option value="1">网络</option>
                                            <option value="2">线下</option>
                                            <option value="3">电话</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="col-sm-12">
                            <hr>
                            <div class="form-group">
                                <!--is-required 增加星号 显示为必填-->
                                <div class="col-sm-3">
                                    <div class="input-group">
                                        <label class="control-label">是否可零售:</label>
                                        <select name="sfkls"  class="styled-input">
                                            <option value="">全部</option>
                                            <option value="1">是</option>
                                            <option value="0">否</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-3">
                                    <div class="input-group">
                                        <label class="control-label">是否冷链药品:</label>
                                        <select name="sfllyp"  class="styled-input">
                                            <option value="">全部</option>
                                            <option value="1">是</option>
                                            <option value="0">否</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-3">
                                    <div class="input-group">
                                        <label class="control-label">是否特管药品:</label>
                                        <select name="sftgyp"  class="styled-input">
                                            <option value="">全部</option>
                                            <option value="1">是</option>
                                            <option value="0">否</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-sm-3">
                                    <div class="input-group">
                                        <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;查询</a>
                                        <a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:user:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
</div>

<th:block th:include="include :: footer" />
<th:block th:include="include :: layout-latest-js" />
<th:block th:include="include :: ztree-js" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('dtp:pmService:edit')}]];
    var removeFlag = [[${@permission.hasPermi('dtp:pmService:remove')}]];
    var prefix = ctx + "spgl/sspglproductdetails";
    $(function() {
        var panehHidden = false;
        if ($(this).width() < 1590) {
            panehHidden = true;
        }
        $('body').layout({ initClosed: panehHidden, west__size: 185, resizeWithWindow: false });
        // 回到顶部绑定
        if ($.fn.toTop !== undefined) {
            var opt = {
                win:$('.ui-layout-center'),
                doc:$('.ui-layout-center')
            };
            $('#scroll-up').toTop(opt);
        }
        queryArchivesList();
    });

    function queryArchivesList() {
        var options = {
            url: prefix + "/sSpglProductdetailsList",
            viewUrl: prefix + "/sSpglProductdetailsView/{id}",
            createUrl: prefix + "/sSpglProductdetailsAdd",
            updateUrl: prefix + "/sSpglProductdetailsEdit/{id}",
            removeUrl: prefix + "/sSpglProductdetailsRemove",
            /*exportUrl: prefix + "/export",
            importUrl: prefix + "/importData",
            importTemplateUrl: prefix + "/importTemplate",*/
            sortName: "id",
            sortOrder: "asc",
            modalName: "连锁商品查询",
            fitColumns: true,
            striped: true,
            autoRowHeight: true,
            rowNumbers: true,
            showFooter:true,  //是否显示表格底部区域。
            clickToSelect: true, //是否启用点击行时选中整行的功能。
            singleSelect: true, //是否仅允许选择一行
            columns: [{
                checkbox: true
            },
                { field: 'id', title: '主键', align: 'center' ,visible:false},
                    { field: 'productCode', title: '商品编码', align: 'center' },
                    { field: 'productName', title: '商品名称', align: 'center' },
                    { field: 'specification', title: '规格', align: 'center' },
                    { field: 'manufacturer', title: '生产厂家', align: 'center' },
                    { field: 'genericName', title: '通用名称', align: 'center' },
                    { field: 'productCategory', title: '商品分类', align: 'center' },
                    { field: 'brandName', title: '商品品牌', align: 'center' },
                    { field: 'retailPrice', title: '零售价/元', align: 'center' },
                    { field: 'salesAttributes', title: '销售属性', align: 'center' },
                    { field: 'minimumPrice', title: '最低限价', align: 'center' },
                    { field: 'productionLicenseNumber', title: '生产许可证号/备案凭证编号', align: 'center' },
                    { field: 'productionLicenseValidUntil', title: '生产许可证号有效期', align: 'center' },
                    { field: 'unitOfDispensing', title: '拆零单位', align: 'center' },
                    { field: 'isDispensable', title: '是否可拆零', align: 'center' },
                    { field: 'dispensingRatio', title: '拆零比例', align: 'center' },
                    { field: 'uniqueCode', title: '本位码', align: 'center' },
                    { field: 'marketingAuthorizationHolder', title: '上市许可持有人', align: 'center' },
                    { field: 'prescriptionCategory', title: '处方类别', align: 'center' },
                    { field: 'prescriptionCategorySecondLevel', title: '处方类别二级', align: 'center' },
                    { field: 'prescriptionCategoryThirdLevel', title: '处方类别三级', align: 'center' },
                    { field: 'approvalNumber', title: '批准文号', align: 'center' },
                    { field: 'approvalNumberValidUntil', title: '批准文号有效期', align: 'center' },
                    { field: 'approvalNumberTwo', title: '批准文号2', align: 'center' },
                    { field: 'approvalNumberTwoValidUntil', title: '批准文号2有效期', align: 'center' },
                    { field: 'approvalNumberThree', title: '批准文号3', align: 'center' },
                    { field: 'approvalNumberThreeValidUntil', title: '批准文号3有效期', align: 'center' },
                    { field: 'registrationNumber', title: '注册证号', align: 'center' },
                    { field: 'registrationNumberValidUntil', title: '注册证号有效期', align: 'center' },
                    { field: 'registrationNumberTwo', title: '注册证号2', align: 'center' },
                    { field: 'registrationNumberTwoValidUntil', title: '注册证号2有效期', align: 'center' },

                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        if (row.serviceId != 1) {
                            var actions = [];
                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="edit_page(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                            actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
                            var more = [];
                            /*more.push("<a class='btn btn-default btn-xs " + resetPwdFlag + "' href='javascript:void(0)' onclick='resetPwd(" + row.userId + ")'><i class='fa fa-key'></i>重置密码</a> ");
                            more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authRole(" + row.userId + ")'><i class='fa fa-check-square-o'></i>分配角色</a>");
                            actions.push('<a tabindex="0" class="btn btn-info btn-xs" role="button" data-container="body" data-placement="left" data-toggle="popover" data-html="true" data-trigger="hover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');*/
                            return actions.join('');
                        } else {
                            return "";
                        }
                    }
                }]
        };
        $.table.init(options);
    }

    /* 自定义重置-表单重置/隐藏框/树节点选择色/搜索 */
    function resetPre() {
        resetDate();
        $("#SSpglProductdetails-form")[0].reset();
        $("#deptId").val("");
        $("#parentId").val("");
        $(".curSelectedNode").removeClass("curSelectedNode");
        $.table.search();
        var resetButton = document.getElementById('SSpglProductdetails-form');
        resetButton.addEventListener('click', function() {
            _refresh();
        });
    }
    function edit_page(id){
        table.set();
        var url = "/404.html";
        if ($.common.isNotEmpty(id)) {
            url = table.options.updateUrl.replace("{id}", id);
        } else {
            var id = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
            if (id.length == 0) {
                $.modal.alertWarning("请至少选择一条记录");
                return;
            }
            url = table.options.updateUrl.replace("{id}", id);
        }
        $.modal.openTab("修改" + table.options.modalName, url + "?status=1" );
    }

    /* 用户状态显示 */
    function statusTools(row) {
        if (row.status == 1) {
            return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.userId + '\')"></i> ';
        } else {
            return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.userId + '\')"></i> ';
        }
    }
</script>
</body>

</html>
