| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>服务公司管理</title>
- <meta http-equiv="X-UA-Compatible" content="IE=8" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" type="text/css" href="http://static.vbdsm.com/js/lib/easyui/themes/vber/easyui.css" />
- <link rel="stylesheet" type="text/css" href="http://static.vbdsm.com/js/lib/easyui/themes/icon.css" />
- <script type="text/javascript" src="http://static.vbdsm.com/js/lib/jquery-1.8.0.min.js"></script>
- <script type="text/javascript" src="http://static.vbdsm.com/js/lib/highcharts/highcharts.js"></script>
- <script type="text/javascript" src="http://static.vbdsm.com/js/lib/easyui/jquery.easyui.min.js"></script>
- <script type="text/javascript" src="http://static.vbdsm.com/js/lib/easyui/locale/easyui-lang-zh_CN.js"></script>
- <script type="text/javascript" src="http://static.vbdsm.com/js/lib/loadmask/jquery.loadmask.min.js"></script>
- <script type="text/javascript" src="http://static.vbdsm.com/js/static.support.js"></script>
- <script type="text/javascript" src="http://static.vbdsm.com/js/easyui.support.js"></script>
- <script type="text/javascript" src="http://static.vbdsm.com/js/common.tools.js"></script>
- <script type="text/javascript" src="http://static.vbdsm.com/js/util.js"></script>
- <style type="text/css">
- .datagrid-cell-rownumber {
- height: 26px;
- }
- </style>
- <script type="text/javascript" charset="UTF-8"></script>
- </head>
- <body>
- <div style="width: 100%; height: 100%">
- <table id="easyui-datagrid-tab"></table>
- </div>
- <!-- 新增、修改窗口 -->
- <div id="proxy-window" style="top: 150px; width: 460px; height: 350px; overflow-x: hidden" data-options="modal:true,collapsible:false,minimizable:false,maximizable:false,closed:true,resizable:false">
- <form id="memberFrm" target="ajaxResult" method="post">
- <input type="hidden" name="id" />
- <table style="width: 450px; border: 0; font-size: 12px; margin-top: 5px">
- <tbody>
- <tr>
- <td style="width: 100px" align="right">名称:</td>
- <td style="width: 330px"><input id="name" name="name" style="width: 313px" class="easyui-validatebox easyui-textbox" autocomplete="off" maxlength="120" class="textbox" required="true" /><span style="color: #ff0000">*</span></td>
- </tr>
- <tr>
- <td align="right">所在省市:</td>
- <td>
- <input id="province" name="province" style="width: 100px" required="true" />
- <input id="city" name="city" style="width: 100px" required="true" />
- <input id="district" name="district" style="width: 100px" />
- </td>
- </tr>
- <tr>
- <td align="right">级别:</td>
- <td>
- <select id="tg" class="easyui-validatebox easyui-combobox" name="tg" style="width: 100px">
- <option value="1">总部</option>
- <option value="0">服务商/代理</option>
- <option value="2">服务公司</option>
- </select>
- <!-- <input id="higherOrg" name="higherOrg" style="width: 230px;" value="0"/> -->
- </td>
- </tr>
- <tr>
- <td align="right">上级公司:</td>
- <td>
- <input id="higherOrg" name="higherOrg" style="width: 230px" />
- </td>
- </tr>
- <tr>
- <td align="right">负责人:</td>
- <td><input id="principal" name="principal" style="width: 150px" class="easyui-validatebox easyui-textbox" autocomplete="off" maxlength="20" class="textbox" required="true" /><span style="color: #ff0000">*</span></td>
- </tr>
- <tr>
- <td align="right">联系电话:</td>
- <td><input id="tel" name="tel" style="width: 150px" class="easyui-validatebox easyui-textbox" autocomplete="off" maxlength="20" class="textbox" required="true" /><span style="color: #ff0000">*</span></td>
- </tr>
- <tr>
- <td align="right">坐标:</td>
- <td>
- <input id="coordinate" name="coordinate" style="width: 150px" class="easyui-validatebox easyui-textbox" autocomplete="off" maxlength="100" class="textbox" />
- </td>
- </tr>
- <tr>
- <td align="right">详细地址:</td>
- <td>
- <input id="address" name="address" style="width: 313px" class="easyui-validatebox easyui-textbox" autocomplete="off" maxlength="100" class="textbox" />
- </td>
- </tr>
- <tr id="siteTr" style="display: none">
- <td align="right">所属机构站点:</td>
- <td id="siteTd"><input type="checkbox" name="site" value="0" /></td>
- </tr>
- </tbody>
- </table>
- </form>
- <div align="center" style="bottom: 15px; width: 98%">
- <hr style="color: #045b83; border: 1px solid; margin-left: 10px; margin-right: 10px" />
- <a style="" href="javascript:void(0)" onclick="return saveProxy();" id="btn-save" icon="icon-save">保存</a>
- <a href="javascript:void(0)" onclick="closeWindow()" id="btn-undo" icon="icon-undo">取消</a>
- </div>
- </div>
- <div id="user-window" title="用户管理" class="easyui-tabs" style="top: 150px; width: 550px; height: 400px" data-options="iconCls:'pag-list',modal:true,minimizable:false,maximizable:false,closed:true,resizable:false">
- <div title="已分配">
- <table class="easyui-datagrid" id="allotTable" style="width: 100%; height: 345px" data-options="rownumbers:true,method:'get',border:false,toolbar:'#allotTab', pagination:true, pageSize:2">
- <thead>
- <tr>
- <th data-options="field:'ck',checkbox:true,width:80"></th>
- <th data-options="field:'realName',width:120,align:'center'">用户名</th>
- <th data-options="field:'loginName',width:120,align:'center'">用户账号</th>
- <th
- data-options="field:'state',width:120,align:'center',formatter:function(value,row){
- if(value==0)return '关闭';
- if(value==1)return '开启'; }">
- 用户状态
- </th>
- <th
- data-options="field:'expiredTime',width:120,align:'center',formatter:function(value,row){
- return new Date(value).format('yyyy-MM-dd') }">
- 过期时间
- </th>
- </tr>
- </thead>
- </table>
- <div id="allotTab" style="height: auto">
- <div>
- <a href="#" class="easyui-linkbutton" iconCls="icon-cancel" plain="true" onclick="return confimUnAllot()">取消分配</a>
- </div>
- </div>
- </div>
- <div title="未分配">
- <table class="easyui-datagrid" id="noAllotTable" style="width: 100%; height: 345px" data-options="rownumbers:true, method:'get', border:false, toolbar:'#noAllotTab', pagination:true, pageSize:2">
- <thead>
- <tr>
- <th data-options="field:'ck',checkbox:true,width:80"></th>
- <th data-options="field:'realName',width:120,align:'center'">用户名</th>
- <th data-options="field:'loginName',width:120,align:'center'">用户账号</th>
- <th
- data-options="field:'state',width:120,align:'center',formatter:function(value,row){
- if(value==0)return '关闭';
- if(value==1)return '开启'; }">
- 用户状态
- </th>
- <th
- data-options="field:'expiredTime',width:120,align:'center',formatter:function(value,row){
- return new Date(value).format('yyyy-MM-dd') }">
- 过期时间
- </th>
- </tr>
- </thead>
- </table>
- <div id="noAllotTab" style="height: auto">
- <div>
- 用户账号:<input type="text" name="userAccount" class="easyui-textbox" id="userAccount" />
- <input type="hidden" id="operaPCID" />
- <a href="#" class="easyui-linkbutton" iconCls="icon-search" plain="true" onclick="queryUnAllotUsers(0)">查询</a>
- <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="allotUsers(true)">分配</a>
- </div>
- </div>
- </div>
- </div>
- <script>
- //下拉框联动
- //一层Combo
- var srmCombx = $("#province").combobox({
- loader: function (param, success, error) {
- $.ajax({
- url: "/web/area/getComboxData.json",
- dataType: "json",
- data: { parentId: 0 },
- success: function (data) {
- //data.unshift({id : '', title : '-请选择-'});
- success(data)
- },
- error: function () {
- error.apply(this, arguments)
- },
- })
- },
- onSelect: function (record) {
- // onSelect 用户点击时触发的事件
- // 在此的意义在于,用户点击一级后自动二级combobox
- piperowCombx
- .combobox({
- loader: function (param, success, error) {
- $.ajax({
- url: "/web/area/getComboxData.json",
- dataType: "json",
- data: { parentId: $("#province").combobox("getValue") },
- success: function (data) {
- //data.unshift({id : '', title : '全部'});
- success(data)
- },
- error: function () {
- error.apply(this, arguments)
- },
- })
- },
- onSelect: function (record) {
- // 这里也使用了onSelect事件,在二级combobox被用户点击时触发三级combobox
- pipeCombx.combobox({
- loader: function (param, success, error) {
- $.ajax({
- url: "/web/area/getComboxData.json",
- dataType: "json",
- data: { parentId: $("#city").combobox("getValue") },
- success: function (data) {
- // data.unshift({id : '', title : '全部'});
- success(data)
- },
- error: function () {
- error.apply(this, arguments)
- },
- })
- },
- valueField: "id",
- textField: "title",
- //value : '',
- editable: false,
- })
- },
- onLoadSuccess: function () {
- //清空三级下拉框 就是成功加载完触发的事件 当一级combobox改变时,二级和三级就需要清空
- //alert("111");
- pipeCombx.combobox("clear")
- },
- valueField: "id",
- textField: "title",
- //value : '',
- editable: false,
- })
- .combobox("clear") //清空二级下拉框
- },
- valueField: "id",
- textField: "title",
- //value : '',
- editable: false,
- onLoadSuccess: function () {
- //记载一级combobox时,二级和三级清空
- piperowCombx.combobox("clear")
- pipeCombx.combobox("clear")
- },
- })
- /******************************************************************************************************/
- //下面的俩个是组件,
- //二层Combo
- var piperowCombx = $("#city").combobox({
- loader: function (param, success, error) {
- var parentId = $("#province").combobox("getValue")
- if (parentId != null && parentId != "") {
- $.ajax({
- url: "/web/area/getComboxData.json",
- dataType: "json",
- data: { parentId: parentId },
- success: function (data) {
- //data.unshift({id:'',title:'全部'});
- success(data)
- },
- error: function () {
- error.apply(this, arguments)
- },
- })
- }
- },
- valueField: "id",
- textField: "title",
- //value:'',
- editable: false,
- })
- //三层Combo
- var pipeCombx = $("#district").combobox({
- loader: function (param, success, error) {
- var parentId = $("#province").combobox("getValue")
- if (parentId != null && parentId != "") {
- $.ajax({
- url: "/web/area/getComboxData.json",
- dataType: "json",
- data: { parentId: parentId },
- success: function (data) {
- //data.unshift({id:'',title:'全部'});
- success(data)
- },
- error: function () {
- error.apply(this, arguments)
- },
- })
- $("#district").show()
- }
- },
- valueField: "id",
- textField: "title",
- editable: false,
- })
- var tableObj = $("#easyui-datagrid-tab")
- var screenWidth = document.body.clientWidth
- var tableWidth = screenWidth * 0.95
- $(function () {
- initGridData()
- })
- //分页控件
- function initGridData() {
- //获取DataGrid分页组件对象
- var p = $("#easyui-datagrid-tab").datagrid("getPager")
- //设置分页组件参数
- $(p).pagination({
- pageSize: 20,
- pageNumber: 1,
- pageList: [10, 20, 50],
- onSelectPage: function (pageNumber, pageSize) {
- getData(pageNumber, pageSize)
- },
- })
- var obj = $(p).pagination("options")
- getData(obj.pageNumber, obj.pageSize)
- }
- //表格数据查询
- function getData(pageNumber, pageSize) {
- ajax({
- url: "/web/proxy/getList.json",
- type: "post",
- dataType: "json",
- data: { pageNo: pageNumber, pageSize: pageSize },
- success: function (data) {
- tableObj.datagrid("loadData", data)
- ResizeDG("easyui-datagrid-tab", 0, 0)
- },
- error: function () {
- alert("载入数据发生错误,请重试。")
- },
- })
- }
- //页面初始化加载数据
- tableObj.datagrid({
- fit: true,
- fitcolumns: true,
- pagination: true,
- pageSize: 20,
- border: false,
- rownumbers: true,
- singleSelect: true,
- selectOnCheck: false,
- checkOnSelect: true,
- columns: [
- [
- { field: "checkId", width: tableWidth * 0.1, checkbox: true },
- {
- field: "id",
- title: "操作",
- width: 170,
- align: "center",
- formatter: function (value, rec) {
- return '<a class="tb_btn_modify" href="javascript:modify(' + rec.id + ');" >修改</a> ' + '<a class="tb_btn_man" href="javascript:userDistribution(' + rec.id + ');" >用户</a> ' + '<a class="tb_btn_remove" href="javascript:deleteProxy(' + rec.id + ');" >删除</a>'
- },
- },
- { field: "name", title: "名称", width: tableWidth * 0.2, align: "left" },
- {
- field: "tg",
- title: "级别",
- width: tableWidth * 0.1,
- align: "center",
- formatter: function (value, rec) {
- if (0 == rec.tg) {
- return "服务商/代理"
- } else if (1 == rec.tg) {
- return "总部"
- } else if (2 == rec.tg) {
- return "服务公司"
- }
- },
- },
- { field: "higherOrgName", title: "上级", width: tableWidth * 0.1, align: "center" },
- { field: "principal", title: "负责人", width: tableWidth * 0.1, align: "center" },
- { field: "tel", title: "联系电话", width: tableWidth * 0.1, align: "center" },
- { field: "address", title: "详细地址", width: tableWidth * 0.22, align: "left" },
- ],
- ],
- toolbar: [
- {
- text: "新增",
- iconCls: "icon-add",
- handler: add,
- },
- "-",
- {
- text: "删除",
- iconCls: "icon-remove",
- handler: removeBatch,
- },
- "-",
- {
- text: "取消",
- iconCls: "icon-undo",
- handler: undo,
- },
- ],
- onLoadError: function () {
- alert("载入数据发生错误,请重试。")
- },
- onLoadSuccess: function (data) {
- $(".tb_btn_modify").linkbutton({ iconCls: "icon-edit", plain: true })
- $(".tb_btn_man").linkbutton({ iconCls: "icon-man", plain: true })
- $(".tb_btn_remove").linkbutton({ iconCls: "icon-remove", plain: true })
- },
- })
- //取消
- function undo() {
- tableObj.datagrid("rejectChanges")
- editIndex = undefined
- }
- $("#btn-save,#btn-undo").linkbutton()
- //增加、修改
- win = $("#proxy-window").window({
- closed: true,
- })
- //用户分配窗口关闭
- win_user = $("#user-window").window({
- closed: true,
- })
- //用户分配窗口打开
- function userDistribution(id) {
- $("#operaPCID").val(id)
- $("#userAccount").textbox("setValue", "")
- settingAllotPagination(id)
- settingUnAllotPagination(0)
- win_user.window("open")
- }
- //allotTable分页控件
- function settingAllotPagination(id) {
- //获取DataGrid分页组件对象
- var allot = $("#allotTable").datagrid("getPager")
- //设置分页组件参数
- $(allot).pagination({
- pageSize: 10,
- pageNumber: 1,
- pageList: [10, 15, 20, 40],
- onSelectPage: function (pageNumber, pageSize) {
- queryAllotUsers(id, pageNumber, pageSize)
- },
- })
- var obj = $(allot).pagination("options")
- queryAllotUsers(id, obj.pageNumber, obj.pageSize)
- }
- //noAllotTable分页控件
- function settingUnAllotPagination(id) {
- //获取DataGrid分页组件对象
- var noAllot = $("#noAllotTable").datagrid("getPager")
- //设置分页组件参数
- $(noAllot).pagination({
- pageSize: 10,
- pageNumber: 1,
- pageList: [10, 15, 20, 40],
- onSelectPage: function (pageNumber, pageSize) {
- queryUnAllotUsers(id, pageNumber, pageSize)
- },
- })
- var obj = $(noAllot).pagination("options")
- queryUnAllotUsers(id, obj.pageNumber, obj.pageSize)
- }
- //已分配用户查询
- function queryAllotUsers(pcId, pageNumber, pageSize) {
- ajax({
- url: "/web/user/getUserByContion.json",
- type: "post",
- dataType: "json",
- data: { proxyCompanyId: pcId, pageNo: pageNumber, pageSize: pageSize },
- success: function (data) {
- $("#allotTable").datagrid("loadData", data.data)
- },
- })
- }
- //未分配用户查询
- function queryUnAllotUsers(pcId, pageNumber, pageSize) {
- var userAccount = $("#userAccount").val()
- ajax({
- url: "/web/user/getUserByContion.json",
- type: "post",
- dataType: "json",
- data: {
- proxyCompanyId: pcId,
- loginName: userAccount,
- pageNo: pageNumber,
- pageSize: pageSize,
- },
- success: function (data) {
- $("#noAllotTable").datagrid("loadData", data.data)
- },
- })
- }
- function confimUnAllot() {
- confirm("警告", "将解除分配关系,是否确认取消分配?", function (data) {
- if (data) {
- allotUsers(false)
- } else {
- return false
- }
- })
- }
- //用户分配
- function allotUsers(flag) {
- var rows = null
- var oid = $("#operaPCID").val()
- var proxyCompanyId = 0
- if (flag) {
- proxyCompanyId = $("#operaPCID").val()
- rows = $("#noAllotTable").datagrid("getSelections")
- } else {
- rows = $("#allotTable").datagrid("getSelections")
- }
- if (rows.length > 0) {
- var ids = ""
- for (var i = 0; i < rows.length; i++) {
- var id = rows[i].id
- ids += id + ","
- }
- ids = ids.substring(0, ids.length - 1)
- ajax({
- url: "/web/user/addProxyUserBind.json",
- type: "post",
- dataType: "json",
- data: { userIds: ids, proxyCompanyId: proxyCompanyId },
- success: function (json) {
- alert(json.msg)
- if (json.status == 1) {
- queryAllotUsers(oid)
- queryUnAllotUsers(0)
- }
- },
- error: function (json) {
- alert("用户分配出错了,请重试")
- },
- })
- } else {
- alert("请选择用户")
- }
- }
- //服务公司添加、修改的form表单
- form = win.find("form")
- //新增
- function add() {
- $("#higherOrg").combobox({
- //上级机构数据请求
- loader: function (param, success, error) {
- $.ajax({
- url: "/web/proxy/getComboxData.json",
- dataType: "json",
- success: function (data) {
- success(data)
- },
- error: function () {
- error.apply(this, arguments)
- },
- })
- },
- valueField: "id",
- textField: "title",
- editable: false,
- })
- $.ajax({
- //机构站点数据请求,如果不是超级管理员,不予显示
- url: "/web/proxy/getSiteData.json",
- dataType: "json",
- success: function (jsonData) {
- var html = ""
- for (var i = 0; i < jsonData.length; i++) {
- var id = jsonData[i].id
- var name = jsonData[i].name
- var checked = jsonData[i].checked
- if (checked) {
- html += "<input type='checkbox' name='site' value='" + id + "' checked='checked' />" + name
- } else {
- html += "<input type='checkbox' name='site' value='" + id + "' />" + name
- }
- html += "<br/>"
- //修改为每个平台占一行
- /* if((i+1)%2 == 0){
- html += "<br/>";
- } */
- }
- $("#siteTd").html(html)
- $("#siteTr").show()
- },
- error: function () {
- error.apply(this, arguments)
- },
- })
- win.window("open")
- win.dialog("setTitle", "新增")
- form.form("clear")
- form.form("load", { tg: 1 })
- }
- //修改
- function modify(id) {
- $("#higherOrg").combobox({
- loader: function (param, success, error) {
- $.ajax({
- url: "/web/proxy/getComboxData.json",
- dataType: "json",
- success: function (data) {
- success(data)
- },
- error: function () {
- error.apply(this, arguments)
- },
- })
- },
- valueField: "id",
- textField: "title",
- editable: false,
- })
- $.getJSON("/web/proxy/getOne/" + id + ".json", function (json) {
- form.form("load", json)
- if (json.city == 0) {
- piperowCombx.combobox("clear")
- }
- if (json.district == 0) {
- pipeCombx.combobox("clear")
- }
- //加载二级下拉框
- piperowCombx
- .combobox({
- loader: function (param, success, error) {
- $.ajax({
- url: "/web/area/getComboxData.json",
- dataType: "json",
- data: { parentId: json.province },
- success: function (data) {
- $("#city").combobox("select", json.city)
- success(data)
- },
- error: function () {
- error.apply(this, arguments)
- },
- })
- },
- valueField: "id",
- textField: "title",
- //value : '',
- editable: false,
- })
- .combobox("clear") //清空二级下拉框
- //加载三级下拉框
- if (json.district != null && json.district != "undefind" && json.district != 0) {
- pipeCombx.combobox({
- loader: function (param, success, error) {
- $.ajax({
- url: "/web/area/getComboxData.json",
- dataType: "json",
- data: { parentId: json.city },
- success: function (data) {
- $("#district").combobox("select", json.district)
- success(data)
- },
- error: function () {
- error.apply(this, arguments)
- },
- })
- },
- valueField: "id",
- textField: "title",
- //value : '',
- editable: false,
- })
- }
- })
- $.ajax({
- //机构站点数据请求,如果不是超级管理员,不予显示
- url: "/web/proxy/getSiteData.json",
- dataType: "json",
- data: { orgId: id },
- success: function (jsonData) {
- var html = ""
- for (var i = 0; i < jsonData.length; i++) {
- var id = jsonData[i].id
- var name = jsonData[i].name
- var checked = jsonData[i].checked
- if (checked) {
- html += "<input type='checkbox' name='site' value='" + id + "' checked='checked' />" + name
- } else {
- html += "<input type='checkbox' name='site' value='" + id + "' />" + name
- }
- html += "<br/>"
- /* if((i+1)%2 == 0){
- html += "<br/>";
- } */
- }
- $("#siteTd").html(html)
- $("#siteTr").show()
- },
- error: function () {
- error.apply(this, arguments)
- },
- })
- win.window("open")
- win.dialog("setTitle", "修改")
- }
- function closeWindow() {
- win.window("close")
- win_user.window("close")
- }
- //保存
- function saveProxy() {
- $("#memberFrm").form("submit", {
- url: "/web/proxy/addOrModify.json",
- onSubmit: function () {
- return $(this).form("validate")
- },
- success: function (json) {
- var result = eval("(" + json + ")")
- if (result.status == 1) {
- closeWindow()
- initGridData()
- } else {
- alert("数据保存出错了")
- }
- },
- })
- }
- //删除
- function deleteProxy(id) {
- confirm("警告", "是否确认删除?", function (data) {
- if (data) {
- ajax({
- url: "/web/proxy/remove/" + id + ".json",
- type: "post",
- dataType: "json",
- success: function (json) {
- if (json.status == 1) {
- initGridData()
- } else {
- alert(json.msg)
- }
- },
- })
- }
- })
- }
- //批量删除
- function removeBatch() {
- var rows = tableObj.datagrid("getChecked")
- if (rows.length > 0) {
- confirm("警告", "是否确认删除?", function (data) {
- if (data) {
- var ids = ""
- for (var i = 0; i < rows.length; i++) {
- var id = rows[i].id
- ids += id + ","
- }
- ids = ids.substring(0, ids.length - 1)
- ajax({
- url: "/web/proxy/removeBatch.json",
- type: "post",
- dataType: "json",
- data: { ids: ids },
- success: function (json) {
- if (json.status == 1) {
- initGridData()
- } else {
- alert(json.msg)
- }
- },
- })
- }
- })
- } else {
- alert("请选择要删除的项!")
- }
- }
- </script>
- </body>
- </html>
|