187 lines
6.6 KiB
Plaintext
187 lines
6.6 KiB
Plaintext
@using CRM.Core.Model.Entity
|
||
@using Core.Web.WebHelper
|
||
@model Core.Web.Controllers.OutComplaintController.OutComplaintDto
|
||
@{
|
||
ViewBag.Title = "Index";
|
||
Layout = "~/Views/Shared/_Layout.cshtml";
|
||
}
|
||
<style>
|
||
.layui-form-label {
|
||
width: 150px
|
||
}
|
||
.layui-input-block {
|
||
margin-left: 0;
|
||
}
|
||
.layui-laydate-content > .layui-laydate-list {
|
||
padding-bottom: 0px;
|
||
overflow: hidden;
|
||
}
|
||
|
||
.layui-laydate-content > .layui-laydate-list > li {
|
||
width: 50%
|
||
}
|
||
|
||
.merge-box .scrollbox .merge-list {
|
||
padding-bottom: 5px;
|
||
}
|
||
.layui-form-item .layui-input-inline {
|
||
float: left;
|
||
width: auto !important;
|
||
margin-right: 10px;
|
||
}
|
||
.dialogName {
|
||
width: 31%;
|
||
display: inline-block;
|
||
text-align: center;
|
||
}
|
||
</style>
|
||
|
||
<div class="x-body">
|
||
<div style="margin: 10px 50px;">
|
||
<div class="dialogName">客户ID:<span id="resid"></span></div>
|
||
<div class="dialogName">客户姓名:<span id="cname"></span></div>
|
||
<div class="dialogName">外诉处理状态:<span id="status"></span></div>
|
||
</div>
|
||
<table class="layui-hide" id="tabl1" lay-filter="tabl1"></table>
|
||
</div>
|
||
<script src="~/Scripts/layui_ext/xm-select/xm-select.js"></script>
|
||
<script>
|
||
var selectRow = {};
|
||
var layer;
|
||
var table;
|
||
var winindex;
|
||
var upload;
|
||
var inneruserTree;
|
||
var element;
|
||
var form;
|
||
var accessories = [];
|
||
layui.config({
|
||
base: '../Scripts/layui_ext/',
|
||
}).extend({
|
||
selectInput: 'selectInput/selectInput'
|
||
}).use(['table'], function () {
|
||
var $ = layui.jquery
|
||
, table = layui.table;
|
||
var tableCols = [[
|
||
{ field: 'Id', title: 'Id', hide: true }
|
||
,{ field: 'Index', title: '投诉次数', width: 100 }
|
||
, { field: 'Content', title: '投诉内容', edit:'text' }
|
||
, { field: 'Follow', title: '处理跟进', edit: 'text' }
|
||
, { field: 'Creator', title: '创建人', width: 100 }
|
||
, { field: 'CreateTime', title: '创建时间', width: 165 }
|
||
, { field: 'Updater', title: '更新人', width: 100 }
|
||
, { field: 'UpdateTime', title: '更新时间', width: 165 }
|
||
]];
|
||
var param = { id: @Html.Raw(ViewBag.id) };
|
||
table.render({
|
||
id: 'testReload',//列表别名ID
|
||
elem: '#tabl1',//表ID
|
||
url: '/OutComplaint/OutComplaintFollowUpHtml',
|
||
even: true, //开启隔行背景
|
||
method: 'get'
|
||
, dataType: 'json'
|
||
, cols: tableCols
|
||
//, request: {
|
||
// pageName: 'pageIndex' //页码的参数名称,默认:page
|
||
// , limitName: 'pageSize' //每页数据量的参数名,默认:limit
|
||
//}
|
||
, response: {
|
||
statusName: 'code' //规定数据状态的字段名称,默认:code
|
||
, statusCode: 0 //规定成功的状态码,默认:0
|
||
, msgName: 'message' //规定状态信息的字段名称,默认:msg
|
||
}
|
||
, parseData: function (res) { //res 即为原始返回的数据
|
||
console.log(res)
|
||
document.getElementById("resid").innerHTML = res.data.Resid;
|
||
document.getElementById("cname").innerHTML = res.data.Cname;
|
||
document.getElementById("status").innerHTML = res.data.OutComplaintStatusStr;
|
||
return {
|
||
"code": res.code, //解析接口状态
|
||
"msg": res.msg, //解析提示文本
|
||
"data": res.data.Details //解析数据列表
|
||
};
|
||
}
|
||
, done: function (res, curr, count) {
|
||
// 保存行高的数组
|
||
var height = [];
|
||
// 遍历行,将所有行的高度保存到数组中
|
||
$(".layui-table-body tr").each(function (index, val) {
|
||
height.push($(val).height());
|
||
});
|
||
// 数组排序
|
||
height.sort((a, b) => { return a - b });
|
||
// 将行高设置为数组中最大的高度
|
||
$(".layui-table-body tr").height(height[height.length - 1]);
|
||
}
|
||
, cellMinWidth: 80 //全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
||
, page: false
|
||
, where: param
|
||
});
|
||
|
||
$('#search').on('click', function () {
|
||
var resid = $('#resid').val();
|
||
if (!resid) {
|
||
layer.msg('请输入客户ID', { icon: 2 });
|
||
return;
|
||
}
|
||
search(resid);
|
||
});
|
||
|
||
table.on('edit(tabl1)', function (obj) {
|
||
var para = obj.data;
|
||
$.post("/OutComplaint/UpdateOutComlpaintFollowUp", { Id: para.Id, Content: para.Content, Follow: para.Follow, OperatorEid: @ViewBag.eid, Operator: '@ViewBag.userName' }, function (rsp) {
|
||
if (rsp.code == 0) {
|
||
TableReload();
|
||
layer.msg("修改成功");
|
||
}
|
||
else
|
||
layer.msg("修改失败");
|
||
});
|
||
});
|
||
})
|
||
|
||
function search(resid, select) {
|
||
layui.use('form', function () {
|
||
var form = layui.form;
|
||
$.ajax({
|
||
type: "GET",
|
||
url: '/OutComplaint/GetComplaintCustomerInfo?resid=' + resid,
|
||
dataType: "json",
|
||
contentType: "application/json",
|
||
success: function (da) {
|
||
console.log(da)
|
||
if (da.code == 0) {
|
||
$('#cname').val(da.data.cname);
|
||
$('#eid').val(da.data.eid);
|
||
$("#deptid").append(new Option('请选择', ''));
|
||
$(da.data.deptInfos).each(function (index, val) {
|
||
if (select && val.deptid == select) {
|
||
$("#deptid").append(new Option(val.deptname, val.deptid, true, true));
|
||
} else {
|
||
$("#deptid").append(new Option(val.deptname, val.deptid));
|
||
}
|
||
});
|
||
form.render('select');
|
||
} else {
|
||
layer.msg(da.retmsg, { icon: 2 });
|
||
}
|
||
},
|
||
error: function () {
|
||
layer.msg('操作失败!', { icon: 2 });
|
||
}
|
||
});
|
||
});
|
||
}
|
||
|
||
function TableReload() {
|
||
selectRow = {};
|
||
var table = layui.table;
|
||
table.reload('testReload');
|
||
}
|
||
|
||
function Closed() {
|
||
layer.close(winindex);
|
||
}
|
||
|
||
</script>
|