forked from kidgrow-microservices-platform

zxh
2020-08-21 5d97b0934973737a903f45d1d89e095b2e255694
kidgrow-web/kidgrow-web-manager/src/main/resources/static/pages/opration/doctorTemplete.html
@@ -19,7 +19,7 @@
                <option value="0">公开-</option>
                <option value="1">私有</option>
            </select>
            <input name="templeteTitle" id="templeteTitle" placeholder="请输入标题名称" type="text"
            <input name="templeteTitle" id="templeteTitle" placeholder="按标题" type="text"
                class="layui-input search-input" maxlength="20" />
            <button id="app-btn-search" class="layui-btn icon-btn"><i class="layui-icon">&#xe615;</i>搜索</button>
            <button id="docto-templete-btn-add" class="layui-btn icon-btn permissions" permissions="doctortemplete-edit"><i class="layui-icon">&#xe654;</i>添加</button>
@@ -68,8 +68,8 @@
            <div class="layui-input-block">
                <select id="publicType-add" name="publicType" placeholder="开放类型" lay-verify="required" required>
                    <option value="">-请选择-</option>
                    <option value="1">公开</option>
                    <option value="0">私有</option>
                    <option value="0">公开</option>
                    <option value="1">私有</option>
                </select>
            </div>
        </div>
@@ -115,14 +115,14 @@
            page: true,
            cols: [[
                { type: 'numbers' },
                { field: 'templeteTitle', width: 180, sort: true, title: '标题' },
                { field: 'templeteTitle',align:'center', width: 180, sort: true, title: '标题' },
                {
                    field: 'publicType', width: 200, sort: true, title: '开放类型', templet: function (d) {
                        return d.publicType ==true ? "公开" : "私有"
                    field: 'publicType',align:'center', width: 200, sort: true, title: '开放类型', templet: function (d) {
                        return d.publicType ==true ? "私有" : "公开"
                    }
                },
                {
                    field: 'templeteType', width: 180, sort: true, title: '话术类型', templet: function (d) {
                    field: 'templeteType',align:'center', width: 180, sort: true, title: '话术类型', templet: function (d) {
                        if (d.templeteType == 0) {
                            return "结论";
                        } else if (d.templeteType == 1) {
@@ -132,10 +132,10 @@
                        }
                    }
                },
                { field: 'createUserName', width: 300, sort: true, title: '创建者' },
                { field: 'createTime', width: 250, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" },
                { field: 'enabled', width: 100, sort: true, templet: '#doctor-templete-tpl-state', title: '状态' },
                { field: 'recordTitle', width: 300, toolbar: '#doctor-templete-table-bar', sort: true, title: '操作' },
                { field: 'createUserName',align:'center', width: 300, sort: true, title: '创建者' },
                { field: 'createTime',align:'center', width: 250, sort: true, title: '创建时间', templet: "<div>{{layui.util.toDateString(d.createTime, 'yyyy/MM/dd HH:mm')}}</div>" },
                { field: 'enabled',align:'center', width: 100, sort: true, templet: '#doctor-templete-tpl-state', title: '状态' },
                { field: 'recordTitle',align:'center', width: 150, toolbar: '#doctor-templete-table-bar', sort: true, title: '操作' },
            ]],
            done:function(res){
                permissionsInput(res,config);
@@ -155,10 +155,10 @@
                    admin.req('api-opration/doctortemplete/' + obj.data.id, {}, function (data) {
                        layer.closeAll('loading');
                        if (data.code == 0) {
                            layer.msg(data.msg, { icon: 1, time: 500 });
                            layer.msg(data.msg, { icon: 1, time: 2000 });
                            table.reload('app-table', {});
                        } else {
                            layer.msg(data.msg, { icon: 2, time: 500 });
                            layer.msg(data.msg, { icon: 2, time: 2000 });
                        }
                    }, 'delete');
                });
@@ -182,10 +182,10 @@
            }, function (data) {
                layer.closeAll('loading');
                if (data.code == 0) {
                    layer.msg(data.msg, { icon: 1, time: 500 });
                    layer.msg(data.msg, { icon: 1, time: 2000 });
                    table.reload('app-table', {});
                } else {
                    layer.msg(data.msg, { icon: 2, time: 500 });
                    layer.msg(data.msg, { icon: 2, time: 2000 });
                    $(obj.elem).prop('checked', !obj.elem.checked);
                    form.render('checkbox');
                }
@@ -200,15 +200,14 @@
            }else if (data.field.publicType==0){
                data.field.publicType=false;
            }
            console.log(data.field.publicType)
            admin.req('api-opration/doctortemplete', JSON.stringify(data.field), function (data) {
                layer.closeAll('loading');
                if (data.code == 0) {
                    // layer.msg(data.msg, { icon: 1, time: 500 });
                    // layer.msg(data.msg, { icon: 1, time: 2000 });
                    layer.closeAll();
                    table.reload('app-table', {});
                } else {
                    layer.msg(data.msg, { icon: 2, time: 500 });
                    layer.msg(data.msg, { icon: 2, time: 2000 });
                }
            }, "POST");
            return false;
@@ -231,7 +230,6 @@
                    $('#app-form')[0].reset();
                    $('#app-form').attr('method', 'POST');
                    if (data) {
                        console.log(data.publicType == true ? 1 : 0);
                        if(index==1){
                            $('#sure').hide();
                        }