195 lines
8.3 KiB
HTML
195 lines
8.3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
|
<link href="/jscss/style.css" rel="stylesheet" type="text/css" />
|
|
<script type="text/javascript" charset="utf-8" src="/jscss/theme.js"></script>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="container">
|
|
<form class="search" onsubmit="table.search(this,'btn');return false;">
|
|
<ul></ul>
|
|
<div>
|
|
<div class="sinps"></div>
|
|
<div class="sbtns">
|
|
<button class="lang btn" type="submit">查询</button>
|
|
<a class="lang btn" onclick="exportxls()">导出</a>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<div class="table">
|
|
<div class="loading col-24">Loading...</div>
|
|
<div class="list"></div>
|
|
<div>
|
|
<div class="btmbtn">
|
|
<a class="lang btn def" onclick="ciyfn.select_all(table)">全选</a>
|
|
<a class="lang btn def" onclick="ciyfn.select_diff(table)">反选</a>
|
|
|
|
|
<a class="lang btn dag" onclick="ciyfn.select_callfunc(table, this, 'del','已选{n}条,是否批量删除?', {},function(json){table.delline(json)})">批量删除</a>
|
|
</div>
|
|
<div class="page"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="alert_edit" style="display:none;">
|
|
<div class="char4 row">
|
|
<div class="ciy-form col-24 col-sm-24 top">
|
|
<label class="lang">答复内容</label>
|
|
<div>
|
|
<ciy-textarea com="replymsg" minheight="15em" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript" src="/jscss/ciy.js"></script>
|
|
<script type="text/javascript" src="/jscss/ciycmp.js"></script>
|
|
<script type="text/javascript" src="/jscss/ciytable.js"></script>
|
|
<script type="text/javascript" src="../common.js"></script>
|
|
<script type="text/javascript">
|
|
'use strict';
|
|
var table;
|
|
var Glob = {};
|
|
ciyfn.pageload(function () {
|
|
//Glob.urlp = ciyfn.urlparam();
|
|
table = new ciyclass.table({
|
|
dom: '.table'
|
|
, url: 'list'
|
|
, pagecount: 10
|
|
, fn_beforedata: function (json) {
|
|
ciyfn.fillsearch({
|
|
searchdom: '.search'
|
|
, data: json
|
|
, lidata: [{ id: '', name: '全部' }, { id: '1', name: '未答复' }, { id: '2', name: '已答复' }]
|
|
, liclick: function (dom) {
|
|
table.search(dom, 'li');
|
|
}
|
|
});
|
|
return json;
|
|
}
|
|
, fn_tdcontent: function (key, datashow, field, data) {
|
|
if (key == '_btn') {
|
|
var html = '';
|
|
html += `<a class="lang btn def" onclick="menubtn(this, 'view')">查看</a>`;
|
|
html += `<a class="lang btn" onclick="menubtn(this, 'edit')">答复</a>`;
|
|
return html;
|
|
}
|
|
}
|
|
, fn_done: function (json) {
|
|
// table.mergecol('auditstatus');
|
|
// table.mergefix('总计', 'center', 6, 0, 8, 1);
|
|
// table.footertotal();
|
|
}
|
|
});
|
|
table.callpage(1);
|
|
});
|
|
function menubtn(dom, btn) {
|
|
var id = $5(dom).parent('tr').attr('data-id');
|
|
if (btn == 'view') {
|
|
view(id);
|
|
}
|
|
if (btn == 'edit') {
|
|
edit(id);
|
|
}
|
|
}
|
|
|
|
function getdata(id, act, cb) {
|
|
cb({ data: id == 0 ? {} : table.data[id] });
|
|
}
|
|
|
|
function edit(id) {
|
|
getdata(id, 'edit', function (jsndat) {
|
|
ciyfn.alert({
|
|
title: '修改'
|
|
, width: 'pc'
|
|
, content: document.getElementById("alert_edit").innerHTML
|
|
//, noparent:true
|
|
, fn_showed: function (doc, dom) {
|
|
var dat = jsndat.data;
|
|
var path = ciyfn.makeuploadpath('suggest', ciyfn.getstorage(ciy_vars.tokenfield));
|
|
ciycmp({ dom: $5('[com=replymsg]', dom), value: dat.replymsg });
|
|
}
|
|
, cb: function (opn) {
|
|
if (opn.btn == "关闭")
|
|
return opn.close();
|
|
opn.inputs.id = id;
|
|
if (ciyfn.throttle(opn.dombtn)) return;
|
|
ciyfn.callfunc('update', opn.inputs, function (json) {
|
|
table.updateline(json);
|
|
opn.close();
|
|
ciyfn.toast('答复成功');
|
|
});
|
|
},
|
|
btns: id == 0 ? ["新建", "*关闭"] : ["答复", "*关闭"],
|
|
});
|
|
});
|
|
}
|
|
function view(id) {
|
|
getdata(id, 'view', function (jsndat) {
|
|
var dat = jsndat.data;
|
|
var html = '<div class="char4 row gridline">';
|
|
html += '<div class="ciy-form col-24 col-sm-12">';
|
|
html += '<label>所属用户</label><div>';
|
|
html += ciyfn.tdshow('vuser', dat.vuser, table.field.vuser.ext, dat, table.json, true);
|
|
html += '</div></div>';
|
|
|
|
html += '<div class="ciy-form col-24 col-sm-12">';
|
|
html += '<label>联系方式</label><div>';
|
|
html += ciyfn.tdshow('contract', dat.contract, table.field.contract.ext, dat, table.json, true);
|
|
html += '</div></div>';
|
|
|
|
html += '<div class="ciy-form col-24 col-sm-24 top">';
|
|
html += '<label>建议内容</label><div>';
|
|
html += ciyfn.tdshow('content', dat.content, table.field.content.ext, dat, table.json, true);
|
|
html += '</div></div>';
|
|
|
|
html += '<div class="ciy-form col-24 col-sm-24 top">';
|
|
html += '<label>图片</label><div>';
|
|
html += ciyfn.tdshow('imgs', dat.imgs, table.field.imgs.ext, dat, table.json, true);
|
|
html += '</div></div>';
|
|
|
|
html += '<div class="ciy-form col-24 col-sm-8">';
|
|
html += '<label>提交时间</label><div>';
|
|
html += ciyfn.tdshow('addtimes', dat.addtimes, table.field.addtimes.ext, dat, table.json, true);
|
|
html += '</div></div>';
|
|
|
|
html += '<div class="ciy-form col-24 col-sm-8">';
|
|
html += '<label>答复人</label><div>';
|
|
html += ciyfn.tdshow('replyuser', dat.replyuser, table.field.replyuser.ext, dat, table.json, true);
|
|
html += '</div></div>';
|
|
|
|
html += '<div class="ciy-form col-24 col-sm-8">';
|
|
html += '<label>答复时间</label><div>';
|
|
html += ciyfn.tdshow('replytimes', dat.replytimes, table.field.replytimes.ext, dat, table.json, true);
|
|
html += '</div></div>';
|
|
|
|
html += '<div class="ciy-form col-24 col-sm-24 top">';
|
|
html += '<label>答复内容</label><div>';
|
|
html += ciyfn.tdshow('replymsg', dat.replymsg, table.field.replymsg.ext, dat, table.json, true);
|
|
html += '</div></div>';
|
|
|
|
html += '</div>';
|
|
ciyfn.alert({
|
|
title: '查看'
|
|
, width: 'pc'
|
|
, autoheight: true
|
|
, content: html
|
|
});
|
|
});
|
|
}
|
|
function exportxls() {
|
|
ciyfn.table_exportxls('exportxls', table, function (json) {
|
|
ciyfn.alert({
|
|
content: '<div style="text-align:center;"><span class="lang">导出数据已生成</span><br/><br/><a class="lang btn lg" href="' + json.url + '" target="_blank">下载数据</a></div>'
|
|
, btns: null
|
|
});
|
|
});
|
|
}
|
|
</script>
|
|
</body>
|
|
|
|
</html> |