Ext.define('BusinessRefModel', {
|
extend: 'Ext.data.Model',
|
fields:[
|
'resourceid','objectid','addtime','remark','createuserid','feedbacktype','feedbackstatus','serverstatus','createusername'
|
],
|
idProperty: 'objectid'
|
});
|
var search = window.location.search;
|
var resourceid = "";
|
if(search.indexOf("?") > -1){
|
search = search.replace("?", "");
|
resourceid = search.split('=')[1];
|
}
|
var BusinessRefStore = new Ext.data.Store({
|
autoDestroy: true,
|
pageSize: 10,
|
model: 'BusinessRefModel',
|
proxy: {
|
type: 'ajax',
|
url: '/res/problemFeedback/getDataList?resourceid='+resourceid,
|
reader: {
|
root: 'topics',
|
totalProperty: 'totalCount'
|
},
|
simpleSortMode: true
|
},
|
remoteSort: true
|
});
|
|
var formdata = {};
|
Ext.onReady(function () {
|
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
|
Ext.tip.QuickTipManager.init();
|
Ext.Ajax.timeout = 900000;
|
Ext.require([
|
'Ext.ux.PagingToolbar'
|
]);
|
Ext.create('Ext.grid.Panel', {
|
id: 'gridexample',
|
renderTo: 'grid',
|
// width: 2400,
|
// height: 418,
|
layout: 'fit',
|
autoScroll: false,
|
//bodyStyle: 'width:100%',
|
store: BusinessRefStore,
|
stateful: false,
|
stateId: 'BusinessRefList-Grid',
|
viewConfig: {
|
forceFit: true,
|
enableTextSelection: true //列表数据可复制
|
},
|
columns: [
|
{ xtype: 'rownumberer', text: "序号", width: '5%', align: 'center' },
|
{text: "问题类型", dataIndex: 'feedbackstatus', width: '15%', sortable: true, align: 'center', filter: { type: 'string' }},
|
{text: "反馈说明", dataIndex: 'remark', width: '20%', sortable: true, align: 'center', filter: { type: 'string' }},
|
{text: "反馈方式", dataIndex: 'feedbacktype', width: '15%', sortable: true, align: 'center', filter: { type: 'string' }},
|
{text: "反馈人", dataIndex: 'createusername', width: '15%', sortable: true, align: 'center', filter: { type: 'string' }},
|
{text: "反馈时间", dataIndex: 'addtime', width: '15%', sortable: true, align: 'center', filter: { type: 'string' }},
|
{text: "服务状态", dataIndex: 'serverstatus', width: '15%', sortable: true, align: 'center', filter: { type: 'string' }}
|
],
|
bbar: Ext.create('Ext.ux.PagingToolbar', {
|
id: "Page",
|
name: "Page",
|
store: BusinessRefStore,
|
displayInfo: true,
|
firstText: "首页",
|
prevText: "上一页",
|
nextText: "下一页",
|
lastText: "尾页",
|
refreshText: '刷新',
|
beforePageText: '第',
|
afterPageText: '页,共 {0} 页',
|
displayMsg: '显示 {0} - {1} 条,共 {2} 条',
|
emptyMsg: "没有数据显示",
|
items: [
|
{
|
xtype: 'label',
|
text: ''
|
}
|
]
|
})
|
});
|
BusinessRefStore.on('beforeload', function () {
|
//GetSearchWhere("SearchForm");
|
BusinessRefStore.proxy.extraParams = [];
|
Ext.apply(BusinessRefStore.proxy.extraParams, formdata);
|
});
|
BusinessRefStore.on('load', function (store, records, successful, eOpts) {
|
|
});
|
BusinessRefStore.load();
|
//添加resize监听防止切换tab或者收起左栏导致grid不自适应宽度
|
$(window).resize(function () {
|
Ext.getCmp('gridexample').doLayout();//panel重新布局
|
});
|
});
|
|
//获取查询条件
|
function GetSearchWhere(formId) {
|
var form = document.forms[formId];
|
for (var i = 0; i < form.elements.length; i++) {
|
var strID = form.elements[i].id;
|
var value = form.elements[i].value;
|
if (form.elements[i].type == "checkbox") {
|
if (form.elements[i].checked == true)
|
value = "on";
|
else
|
value = "";
|
}
|
if (form.elements[i].type == "radio") {
|
if (form.elements[i].checked == true) {
|
strID = form.elements[i].name;
|
value = form.elements[i].value;
|
}
|
}
|
formdata[strID] = (value == "全部" || value == "None" ? "" : value + "");
|
}
|
}
|
|
//关闭窗口
|
function ColseLayer() {
|
$(".layui-layer-close1").click();
|
}
|
|
//保存问题反馈
|
function SaveProbelm(){
|
if($("#remark").val() == ""){
|
alert("反馈说明不能为空!");
|
return false;
|
}
|
if ($("#remark").val().length > 500) {
|
alert("反馈说明不能超过500字符!");
|
return false;
|
}
|
$.ajax({
|
url: '/res/problemFeedback/insertSelective',
|
type: 'post',
|
dataType: "text",
|
data: {
|
'remark': $("#remark").val(),
|
'feedbackstatus': $('#feedbackstatus').val(),
|
'resourceid':$("#resourceid").val()
|
},
|
success: function (data) {
|
if(result = 1){
|
alert("保存成功!");
|
reshPage(1);
|
location.reload();
|
}
|
},
|
error: function (e) {
|
alert(e.message);
|
}
|
});
|
}
|
|
//弹出添加窗口
|
function OpenAddWin() {
|
$("#remark").val("");
|
$('#feedbackstatus').val("服务问题");
|
layer.open({
|
type: 1,
|
title: '添加问题反馈',
|
shadeClose: false,
|
area: ['500px', '260px'],
|
content: jQuery("#resOtherInfo")
|
});
|
}
|
|
//新增一条改变状态
|
function ChangeStatus(){
|
$.ajax({
|
url: '/res/problemFeedback/insertNormalSelective',
|
type: 'post',
|
dataType: "text",
|
data: {
|
'resourceid':$("#resourceid").val()
|
},
|
success: function (data) {
|
if(result = 1){
|
alert("修改成功!");
|
reshPage(0);
|
location.reload();
|
}
|
},
|
error: function (e) {
|
alert(e.message);
|
}
|
});
|
}
|
|
//刷新父页面状态
|
function reshPage(type){
|
if(type == 0 && $("#yichang",window.parent.document)){
|
$("#yichang",window.parent.document).hide();
|
}
|
if(type == 1){
|
if($("#yichang",window.parent.document).length == 0){
|
$("#tdtitle",window.parent.document).append("<span id=\"yichang\" style=\"font-size: 14px;color:red;\">【"
|
+ $('#feedbackstatus').val().substring(0,2) +"异常】</span>");
|
}
|
if($("#yichang",window.parent.document).css("display") == "none") {
|
$("#yichang", window.parent.document).css("display", "");
|
$("#yichang", window.parent.document).text("【"+$('#feedbackstatus').val().substring(0, 2) + "异常】");
|
}
|
}
|
}
|