Authored by zhichao

fix:自监控管理->报表填报管理

... ... @@ -3,6 +3,7 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'xmSelect', 'lay
var $ = layui.$;
var form = layui.form;
var common = layui.common;
var admin = layui.admin;
var table = layui.table;
//对外暴露的接口
exports('reportSelectAdd', function (data) {
... ... @@ -12,7 +13,10 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'xmSelect', 'lay
form.render();
if (id) {
var url = common.domainName + '/inspection-report/report/select/findByIds';
$.get(url, {'id': id, 'access_token': accessToken}, function (res) {
admin.req({
url: url,
data: {'id': id}
}).done(function (res) {
if (res.object) {
let data = res.object;
var $form = $("#reportSelectAddForm");
... ... @@ -67,24 +71,22 @@ layui.define(['table', 'form', 'laydate', 'common', 'sessions', 'xmSelect', 'lay
form.on('submit(reportSelect-add-submit)', function (data) {
var bean = data.field;
var loading = layer.load(2);
$.ajax({
admin.req({
type: 'post',
url: common.domainName + '/inspection-report/report/select/saveOrUpdate?access_token=' + accessToken,
url: common.domainName + '/inspection-report/report/select/saveOrUpdate',
contentType: "application/json; charset=utf-8",
data: JSON.stringify(bean),
success: function (res) {
layer.close(loading);
layer.msg('保存成功', {
offset: '15px'
, icon: 1
, time: 2000
}, function () {
layer.closeAll();
table.reload('reportSelect_table', {});
})
}
data: JSON.stringify(bean)
}).done(function (res) {
layer.close(loading);
layer.msg('保存成功', {
offset: '15px'
, icon: 1
, time: 2000
}, function () {
layer.closeAll();
table.reload('reportSelect_table', {});
})
});
})
});
... ...