首页 新闻 赞助 找找看

报错数据接口请求异常:parsererror,获取不到数据库中数据,是什么问题呢

0
悬赏园豆:50 [已解决问题] 解决于 2019-12-04 15:33

table.render({
elem: '#table'
,url: host+'/contractParty/pageList'
,method:'POST'
,dataType:'json'
,id: 'tableReload'
,toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板
,title: '提示'
,layEvent: 'LAYTABLE_TIPS'
,icon: 'layui-icon-tips'
, contentType: "application/x-www-form-urlencoded;charset=UTF-8"
,page: { //支持传入 laypage 组件的所有参数(某些参数除外,如:jump/elem) - 详见文档
layout: ['limit', 'count', 'prev', 'page', 'next', 'skip'] //自定义分页布局
,groups: 3 //只显示 1 个连续页码
,first: false //不显示首页
,last: false //不显示尾页
}
,pageList:[25, 55, 70, 100, 200, 500]
,title: '用户数据表'
,cols: [[ //表头
{type: 'checkbox',fixed:'left'}
,{field: 'segmentName', title: '标段(合同)名称', width:200,align: "center"}
,{field: 'unitName', title: '单位名称',align: "center", width:200}
,{field: 'unitTypeName', title: '单位类别', width:150,align: "center"}
,{field: 'representative', title: '法人代表',align: "center", width:150}
,{field: 'unitLeader', title: '单位负责人',align: "center", width: 150}
,{field: 'financePerson', title: '单位财务负责人', width: 150,align: "center"}
,{field: 'bankAccounts', title: '开户行', width: 150,align: "center"}
,{field: 'accountNumber', title: '开户行账号', align: "center",width: 150}
,{field: 'paragraph', title: '税号', width: 135,align: "center", }
,{field: 'registeredCapital', title: '注册资金(元)', align: "center",width: 100}
,{field: 'enterprise', title: '企业资质',align: "center", width: 100}
,{field: 'businessScope', title: '营业范围',align: "center", width: 100}
,{field: 'contactName', title: '联系人',align: "center", width: 100}
,{field: 'contactNumber', title: '联系电话', align: "center",width: 100}
,{field: 'address', title: '地址', align: "center",width: 110}
,{field: 'orderNo', title: '排序码', align: "center",width: 100}
,{field: 'operation', title: '操作', toolbar: '#barDemo',align: "center", width: 110,fixed:'right'}
]]
});

var_sincere的主页 var_sincere | 初学一级 | 园豆:157
提问于:2019-11-27 10:46
< >
分享
最佳答案
1

一、数据格式问题;
二、没把数据传入后台;

收获园豆:20
闪存最后一个地球人 | 小虾三级 |园豆:889 | 2019-11-27 11:03
其他回答(1)
0

你设置的数据格式是json,后台接口返回的格式可能不标准或者不是JSON格式,就导致报这个错了。

收获园豆:30
顾星河 | 园豆:7169 (大侠五级) | 2019-11-27 10:52
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册