using YLErp.Modules.ClientModule;
namespace YLErp.Web.Controllers
{
///
/// 客户审批
///
public class processlogController : BaseController
{
public processlogController() {
}
public ActionResult processlogListInner(int eid, string type)
{
ViewBag.eid = eid;
ViewBag.type = type;
return View();
}
public ActionResult processlogCreditListInner(int eid)
{
ViewBag.enid = eid;
return View();
}
public ActionResult CreditLogList(int id)
{
var dates = yldb.credit_log.Where(c => c.CreditId == id)
.Select(n => new CreditLogDto
{
id = n.id,
OptType = n.OptType,
Changes = n.Changes ?? "",
OptName = n.OptName,
OptDate = n.OptDate
}).OrderByDescending(d => d.id).ToArray();
return View(dates);
}
public ActionResult processlogClientRatingListInner(int eid)
{
ViewBag.enid = eid;
return View();
}
[HttpPost]
public JsonResult QueryOfCreditLog(ProcesslogReq req)
{
var sList = new ClientCreditService(CurUser).SearchCreditList(req);
return Json(sList);
}
[HttpPost]
public JsonResult QueryOfClientRatingLog(ProcesslogReq req)
{
var sList = new ClientProcessLogService(CurUser).SearchClientRatingList(req);
return Json(sList);
}
[HttpPost]
public JsonResult processlogInnerListQuery(ProcesslogReq req)
{
if (string.IsNullOrWhiteSpace(req.ProcessType))
{
req.ProcessType = "OpenProcess";
}
var sList = new ClientProcessLogService(CurUser).SearchList(req);
return Json(sList);
}
[HttpPost]
public ActionResult UpdateProcessCreditLog(int creditId, string status, string text)
{
var message = new ClientCreditService(CurUser).UpdateProcessCreditLog(creditId, status, text);
return JsonSuccess(message);
}
[HttpPost]
public ActionResult UpdateProcessClient_RatingLog(int client_ratingId, string status, string text)
{
var message = new ClientProcessLogService(CurUser).UpdateProcessClient_RatingLog(client_ratingId, status, text);
return JsonSuccess(message);
}
///
/// 开户审批
///
/// 客户id
/// 审批结果,pass/reject
/// 审批意见
[HttpPost]
public ActionResult UpdateProcessLog(int clientId, string status, string text)
{
var message = new ClientProcessLogService(CurUser).UpdateProcessLog(clientId, status, text);
return JsonSuccess(message);
}
}
}