| | |
| | | |
| | | SimCost GetSimCost(int id); |
| | | |
| | | ResultDataEntity<SimCostView> SearchSimCostByPage(SimCostDTOSearch searchEntity); |
| | | List<SimCostView> SearchSimCostByPage(string sim, int year); |
| | | |
| | | SimCostView GetSimCost(string userid , int bill_year, int bill_month); |
| | | |
| | | ResultDataEntity<SimCostYearView> SearchSimCostYearByPage(SimCostDTOSearch searchEntity); |
| | | } |
| | | } |
| | |
| | | { |
| | | get |
| | | { |
| | | return status=="0"?"æ£å¸¸":"å
³è´¦"; |
| | | return status=="0"?"æªæ ¸å":"å·²æ ¸å"; |
| | | } |
| | | } |
| | | } |
| | | |
| | | [Table("v_sim_costyear")] |
| | | public class SimCostYearView |
| | | { |
| | | /// <summary> |
| | | /// å¡å· |
| | | /// </summary> |
| | | [Key] |
| | | public string sim_id { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¹´ |
| | | /// </summary> |
| | | public int bill_year { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 1æ |
| | | /// </summary> |
| | | public decimal Jan { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 2æ |
| | | /// </summary> |
| | | public decimal Feb { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 3æ |
| | | /// </summary> |
| | | public decimal Mar { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 4æ |
| | | /// </summary> |
| | | public decimal Apr { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 5æ |
| | | /// </summary> |
| | | public decimal May { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 6æ |
| | | /// </summary> |
| | | public decimal Jun { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 7æ |
| | | /// </summary> |
| | | public decimal Jul { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 8æ |
| | | /// </summary> |
| | | public decimal Aug { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 9æ |
| | | /// </summary> |
| | | public decimal Sept { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 10æ |
| | | /// </summary> |
| | | public decimal Oct { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 11æ |
| | | /// </summary> |
| | | public decimal Nov { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 12æ |
| | | /// </summary> |
| | | public decimal Dece { get; set; } |
| | | |
| | | /// <summary> |
| | | /// å¡å· |
| | | /// </summary> |
| | | public string sim { get; set; } |
| | | |
| | | /// <summary> |
| | | /// æ£æ¥ç¼è¾æ |
| | | /// </summary> |
| | | [NotMapped] |
| | | public int month { get; set; } |
| | | } |
| | | } |
| | |
| | | public virtual DbSet<SimCost> SimCost { get; set; } |
| | | public virtual DbSet<SimCostView> SimCostView { get; set; } |
| | | public virtual DbSet<HrSalaryAppeal> HrSalaryAppeal { get; set; } |
| | | public virtual DbSet<SimCostYearView> SimCostYearView { get; set; } |
| | | |
| | | |
| | | public virtual DbSet<AdmAskLeave> AdmAskLeaves { get; set; } |
| | | public virtual DbSet<AdmAskLeaveOff> AdmAskLeaveOffs { get; set; } |
| | |
| | | var updatepltRole = _context.HrSalaries.Where(c=>c.Id==dto.Id).SingleOrDefault(); |
| | | if(updatepltRole!=null) |
| | | { |
| | | //æ´æ°çµè¯è´¹ç¨ç¶æ |
| | | var sim = _context.SimCost.Where(c => c.bill_year == dto.Year && c.bill_month <= dto.Month && c.user_id == dto.Userid && c.status == "0").ToList(); |
| | | foreach(var item in sim) |
| | | { |
| | | item.status = "1"; |
| | | } |
| | | |
| | | var user = _context.PltUsers.Where(c => c.Id == updatepltRole.Userid).SingleOrDefault(); |
| | | |
| | | updatepltRole.Jiangjin = dto.Jiangjin; |
| | |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | try |
| | | { |
| | | var temp = _context.SimCost.Where(e => e.id == md.id).SingleOrDefault(); |
| | | var temp = _context.SimCost.Where(e => e.sim_id == md.sim_id && e.bill_year==md.bill_year && e.bill_month==md.bill_month).SingleOrDefault(); |
| | | var tempBind = _context.SimBindView.Where(e => e.Id == md.sim_id).SingleOrDefault(); |
| | | if (temp != null && temp.status=="0") |
| | | { |
| | | temp.bill_amount = md.bill_amount; |
| | | temp.bill_month = md.accounted_time.Month; |
| | | temp.bill_year = md.accounted_time.Year; |
| | | //temp.bill_month =md.m; |
| | | //temp.bill_year = md.accounted_time.Year; |
| | | temp.sub_userid = md.sub_userid; |
| | | temp.up_time = DateTime.Now; |
| | | if(tempBind!=null) |
| | |
| | | } |
| | | else |
| | | { |
| | | md.bill_month = md.accounted_time.Month; |
| | | md.bill_year = md.accounted_time.Year; |
| | | //md.bill_month = md.accounted_time.Month; |
| | | //md.bill_year = md.accounted_time.Year; |
| | | |
| | | //彿éå¤å¤æ |
| | | var monthck = _context.SimCost.Where(c => c.sim_id == md.sim_id && c.bill_year == md.bill_year && c.bill_month == md.bill_month).Count(); |
| | | if(monthck>0) |
| | | { |
| | | resultEntity.Result = false; |
| | | resultEntity.Message = string.Format("æ¤çµè¯å¡å¨[{0}-{1}]æå·²åå¨è®°å½ï¼ä¸è½é夿·»å ï¼",md.bill_year,md.bill_month); |
| | | return resultEntity; |
| | | } |
| | | else |
| | | //var monthck = _context.SimCost.Where(c => c.sim_id == md.sim_id && c.bill_year == md.bill_year && c.bill_month == md.bill_month).Count(); |
| | | //if(monthck>0) |
| | | //{ |
| | | // resultEntity.Result = false; |
| | | // resultEntity.Message = string.Format("æ¤çµè¯å¡å¨[{0}-{1}]æå·²åå¨è®°å½ï¼ä¸è½é夿·»å ï¼",md.bill_year,md.bill_month); |
| | | // return resultEntity; |
| | | //} |
| | | //else |
| | | { |
| | | md.up_time = DateTime.Now; |
| | | md.status = "0"; |
| | | |
| | | md.accounted_time = DateTime.Now; |
| | | if (tempBind != null) |
| | | { |
| | | md.allow_amount = decimal.Parse(tempBind.cardpro); |
| | |
| | | /// </summary> |
| | | /// <param name="searchEntity"></param> |
| | | /// <returns></returns> |
| | | public ResultDataEntity<SimCostView> SearchSimCostByPage(SimCostDTOSearch searchEntity) |
| | | public List<SimCostView> SearchSimCostByPage(string sim ,int year) |
| | | { |
| | | ResultDataEntity<SimCostView> data = new ResultDataEntity<SimCostView>(); |
| | | List<SimCostView> data = new List<SimCostView>(); |
| | | try |
| | | { |
| | | //var codedata = (from e in _context.SysCodes |
| | |
| | | // && e.CodeField == "cardpro" |
| | | // select c).OrderBy(x => x.Sort).ToList(); |
| | | |
| | | var dt = _context.SimCostView.OrderByDescending(c => c.accounted_time).ToList(); |
| | | if (!string.IsNullOrEmpty(searchEntity.searchtime)) |
| | | { |
| | | var times = searchEntity.searchtime.Split('|'); |
| | | if(times.Length==2) |
| | | { |
| | | DateTime d1 = DateTime.Parse(times[0]); |
| | | DateTime d2 = DateTime.Parse(times[1]); |
| | | dt = dt.Where(c => c.accounted_time > d1 && c.accounted_time < d2).ToList(); |
| | | } |
| | | } |
| | | if (!string.IsNullOrEmpty(searchEntity.searchsim)) |
| | | { |
| | | dt = dt.Where(c => !string.IsNullOrEmpty(c.simcard) && c.simcard.Contains(searchEntity.searchsim)).ToList(); |
| | | } |
| | | data = _context.SimCostView.Where(c => c.bill_year==year && c.sim_id==sim).OrderBy(c=>c.bill_month).ToList(); |
| | | //if (!string.IsNullOrEmpty(searchEntity.searchtime)) |
| | | //{ |
| | | // var times = searchEntity.searchtime.Split('|'); |
| | | // if(times.Length==2) |
| | | // { |
| | | // DateTime d1 = DateTime.Parse(times[0]); |
| | | // DateTime d2 = DateTime.Parse(times[1]); |
| | | // dt = dt.Where(c => c.accounted_time > d1 && c.accounted_time < d2).ToList(); |
| | | // } |
| | | //} |
| | | //if (!string.IsNullOrEmpty(searchEntity.searchsim)) |
| | | //{ |
| | | // dt = dt.Where(c => !string.IsNullOrEmpty(c.simcard) && c.simcard.Contains(searchEntity.searchsim)).ToList(); |
| | | //} |
| | | //SimCostDTOSearch searchEntity = new SimCostDTOSearch(); |
| | | //searchEntity.rows = 20; |
| | | //searchEntity.page = 1; |
| | | |
| | | if (searchEntity.totalrows == 0) |
| | | searchEntity.totalrows = dt.Count(); |
| | | //if (searchEntity.totalrows == 0) |
| | | // searchEntity.totalrows = dt.Count(); |
| | | |
| | | var signinList = dt.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList(); |
| | | //var signinList = dt.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList(); |
| | | |
| | | //signinList = signinList.Select(a => new SimBindView() |
| | | //{ |
| | |
| | | // username = a.username |
| | | //}).ToList(); |
| | | |
| | | data.LoadData(searchEntity, signinList); |
| | | //data.LoadData(searchEntity, signinList); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | return data; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢è´¹ç¨è®°å½ |
| | | /// </summary> |
| | | /// <param name="userid"></param> |
| | | /// <param name="bill_year"></param> |
| | | /// <param name="bill_month"></param> |
| | | /// <returns></returns> |
| | | public SimCostView GetSimCost(string userid, int bill_year, int bill_month) |
| | | { |
| | | |
| | |
| | | return entity; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ¥è¯¢å
容 |
| | | /// </summary> |
| | | /// <param name="searchEntity"></param> |
| | | /// <returns></returns> |
| | | public ResultDataEntity<SimCostYearView> SearchSimCostYearByPage(SimCostDTOSearch searchEntity) |
| | | { |
| | | ResultDataEntity<SimCostYearView> data = new ResultDataEntity<SimCostYearView>(); |
| | | try |
| | | { |
| | | int year=DateTime.Now.Year; |
| | | if (!string.IsNullOrEmpty(searchEntity.searchtime)) |
| | | { |
| | | year = int.Parse(searchEntity.searchtime); |
| | | } |
| | | |
| | | var dt = (from c in _context.SimCostYearView where c.bill_year==year orderby c.sim select c).ToList(); |
| | | |
| | | if (!string.IsNullOrEmpty(searchEntity.searchsim)) |
| | | { |
| | | dt = dt.Where(c => c.sim==searchEntity.searchsim).ToList(); |
| | | } |
| | | |
| | | if (searchEntity.totalrows == 0) |
| | | searchEntity.totalrows = dt.Count(); |
| | | |
| | | var signinList = dt.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList(); |
| | | if(signinList.Count>0) |
| | | { |
| | | var month = DateTime.Now.Month-1; |
| | | var ck = (from c in _context.SimCost where c.status == "1" && c.bill_year == year orderby c.bill_month descending select c).FirstOrDefault(); |
| | | if(ck!=null) |
| | | { |
| | | month= ck.bill_month; |
| | | } |
| | | foreach (var item in signinList) |
| | | { |
| | | item.month = month; |
| | | } |
| | | } |
| | | |
| | | data.LoadData(searchEntity, signinList); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw; |
| | | } |
| | | return data; |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | /// å表页 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public IActionResult Index() |
| | | public IActionResult Index(int year,string sim) |
| | | { |
| | | List<ActionEntity> actionlist = new List<ActionEntity>(); |
| | | ActionEntity actionEntity = new ActionEntity(); |
| | | actionEntity.OpenType = 0; |
| | | actionEntity.ActionUrl = ""; |
| | | actionEntity.ActionFun = "Search"; |
| | | actionEntity.PageIco = "fa fa-search"; |
| | | actionEntity.ActionName = "æ¥è¯¢"; |
| | | actionlist.Add(actionEntity); |
| | | //List<ActionEntity> actionlist = new List<ActionEntity>(); |
| | | //ActionEntity actionEntity = new ActionEntity(); |
| | | //actionEntity.OpenType = 0; |
| | | //actionEntity.ActionUrl = ""; |
| | | //actionEntity.ActionFun = "Search"; |
| | | //actionEntity.PageIco = "fa fa-search"; |
| | | //actionEntity.ActionName = "æ¥è¯¢"; |
| | | //actionlist.Add(actionEntity); |
| | | |
| | | ActionEntity actionEntity1 = new ActionEntity(); |
| | | actionEntity1.OpenType = 0; |
| | | actionEntity1.ActionUrl = ""; |
| | | actionEntity1.ActionFun = "Add"; |
| | | actionEntity1.PageIco = "fa fa-plus"; |
| | | actionEntity1.ActionName = "æ°å¢"; |
| | | actionlist.Add(actionEntity1); |
| | | //ActionEntity actionEntity1 = new ActionEntity(); |
| | | //actionEntity1.OpenType = 0; |
| | | //actionEntity1.ActionUrl = ""; |
| | | //actionEntity1.ActionFun = "Add"; |
| | | //actionEntity1.PageIco = "fa fa-plus"; |
| | | //actionEntity1.ActionName = "æ°å¢"; |
| | | //actionlist.Add(actionEntity1); |
| | | |
| | | |
| | | //ActionEntity actionEntity4 = new ActionEntity(); |
| | |
| | | //actionEntity4.ActionName = "æ¹éå é¤"; |
| | | //actionlist.Add(actionEntity4); |
| | | |
| | | ViewData["ActionInfo"] = actionlist; |
| | | //ViewData["ActionInfo"] = actionlist; |
| | | ViewBag.Year = year; |
| | | ViewBag.Sim = sim; |
| | | //var js= _simService.SearchSimCostByPage(sim, year) |
| | | return View(); |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | /// <param name="search"></param> |
| | | /// <returns></returns> |
| | | public IActionResult GetList(SimCostDTOSearch search) |
| | | public IActionResult GetList(int year, string sim) |
| | | { |
| | | return new JsonResult(_simService.SearchSimCostByPage(search)); |
| | | var list = _simService.SearchSimCostByPage(sim, year); |
| | | //var result = new |
| | | //{ |
| | | // total:"1", |
| | | // page: 1, |
| | | // records: list.Count, |
| | | // rows: list |
| | | //}; |
| | | return Json(list); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | /// <param name="id"></param> |
| | | /// <returns></returns> |
| | | public IActionResult Edit(string id=null) |
| | | { |
| | | ViewBag.SimCard = _simService.GetBindSim(); |
| | | public IActionResult Edit(string id,decimal money,int year, int month,string sim) |
| | | { |
| | | SimCost dto = new SimCost(); |
| | | dto.accounted_time = DateTime.Now; |
| | | if (!string.IsNullOrEmpty(id)) |
| | | { |
| | | dto = _simService.GetSimCost(int.Parse(id)); |
| | | } |
| | | dto.bill_month = month; |
| | | dto.bill_amount = money; |
| | | dto.sim_id = id; |
| | | dto.sub_userid = sim; |
| | | dto.bill_year = year; |
| | | //if (!string.IsNullOrEmpty(id)) |
| | | //{ |
| | | // dto = _simService.GetSimCost(int.Parse(id)); |
| | | //} |
| | | ViewData.Model = dto; |
| | | return View(); |
| | | } |
| | |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å表页 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public IActionResult SimYear() |
| | | { |
| | | return View(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// å表å
容 |
| | | /// </summary> |
| | | /// <param name="search"></param> |
| | | /// <returns></returns> |
| | | public IActionResult GetSimYearList(SimCostDTOSearch search) |
| | | { |
| | | return new JsonResult(_simService.SearchSimCostYearByPage(search)); |
| | | } |
| | | |
| | | [HttpPost] |
| | | public IActionResult SaveSimYearCost(object data) |
| | | { |
| | | var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User")); |
| | | ResultEntity resultEntity = new ResultEntity(); |
| | | //using (TransactionScope scope = new TransactionScope()) |
| | | //{ |
| | | // data.sub_userid = curentuser.Id; |
| | | // resultEntity = _simService.SaveCost(data); |
| | | // scope.Complete(); |
| | | //} |
| | | return new JsonResult(resultEntity); |
| | | } |
| | | |
| | | ///// <summary> |
| | | ///// è§£ç» |
| | | ///// </summary> |
| | |
| | | @using zhengcaioa.Models; |
| | | @{ |
| | | Layout = null; |
| | | List<SimBindView> Card = ViewData["SimCard"] as List<SimBindView>; |
| | | } |
| | | |
| | | <!DOCTYPE html> |
| | |
| | | <div id="div_content" class="ibox-content" style="background-color:white;"> |
| | | <div class="row"> |
| | | <div class="clearfix layer-area" style="padding-bottom:15px;"> |
| | | <label class="text-right col-sm-1 col-md-1 control-label">çµè¯å¡å·<i class="red">*</i></label> |
| | | <label class="text-right col-sm-1 col-md-1 control-label">çµè¯å·ç <i class="red">*</i></label> |
| | | <div class="col-sm-2 col-md-2"> |
| | | <select id="cbbCard" class="data form-control" name="sim_id" data-placeholder="éæ© åºå ..."> |
| | | <option value="" hassubinfo="true">è¯·éæ©</option> |
| | | @foreach (var item in Card) |
| | | { |
| | | @if (!item.Id.Equals(Model.sim_id)) |
| | | { |
| | | <option value="@item.Id" hassubinfo="true"> |
| | | @item.simcard |
| | | </option> |
| | | } |
| | | else |
| | | { |
| | | <option value="@item.Id" hassubinfo="true" selected="selected"> |
| | | @item.simcard |
| | | </option> |
| | | } |
| | | } |
| | | </select> |
| | | <input type="hidden" name="id" value="@Model.id" /> |
| | | <input type="text" value="@Model.sub_userid" class="form-control" readonly="readonly" /> |
| | | <input type="hidden" name="sim_id" value="@Model.sim_id" /> |
| | | </div> |
| | | </div> |
| | | <div class="clearfix layer-area" style="padding-bottom:15px;"> |
| | | <label class="text-right col-sm-1 col-md-1 control-label">è´¹ç¨æä»½<i class="red">*</i></label> |
| | | <div class="col-sm-2 col-md-2"> |
| | | <input type="text" name="bill_month" class="form-control" value="@Model.bill_month" readonly="readonly" /> |
| | | <input type="hidden" name="bill_year" value="@Model.bill_year" /> |
| | | </div> |
| | | </div> |
| | | <div class="clearfix layer-area" style="padding-bottom:15px;"> |
| | | <label class="text-right col-sm-1 col-md-1 control-label">å®é
çµè¯è´¹ç¨<i class="red">*</i></label> |
| | | <div class="col-sm-2 col-md-2"> |
| | | <input id="billamount" class="form-control" label="èªèµå¾
é" name="bill_amount" labtype="txt" addvisible="true" maxlength="500" editvisible="true" reg="" ismust="true" type="text" value="@Model.bill_amount" oninput="if(value.length>4)value=value.slice(0,10)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)"> |
| | | </div> |
| | | </div> |
| | | <div class="clearfix layer-area" style="padding-bottom:15px;"> |
| | | |
| | | <label class="text-right col-sm-1 col-md-1 control-label">è´¹ç¨è®°è´¦æ¥æ<i class="red">*</i></label> |
| | | <div class="col-sm-2 col-md-2"> |
| | | <input id="acTime" class="form-control" name="accounted_time" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="text" value="@Model.accounted_time.ToString("yyyy/MM/dd")" > |
| | | <input id="billamount" class="form-control" name="bill_amount" labtype="txt" addvisible="true" maxlength="500" editvisible="true" reg="" ismust="true" type="text" value="@Model.bill_amount" oninput="if(value.length>4)value=value.slice(0,10)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </form> |
| | | |
| | | <script type="text/javascript"> |
| | | $(function () { |
| | | |
| | | $("#cbbCard").chosen(); |
| | | |
| | | laydate({ elem: "#acTime", format: 'YYYY/MM/DD', istime: false, event: "focus" }); |
| | | |
| | | }); |
| | | |
| | | var hh = document.body.clientHeight - $('.ibox-title').height() - $("#top").height() * 2 - 95; |
| | | $("#div_content").height(hh); |
| | | |
| | | toastr.options = { |
| | | "closeButton": true, |
| | | "debug": false, |
| | | "progressBar": true, |
| | | "positionClass": "toast-bottom-right", |
| | | "onclick": null, |
| | | "showDuration": "300", |
| | | "hideDuration": "600", |
| | | "timeOut": "4500", |
| | | "extendedTimeOut": "600", |
| | | "showEasing": "swing", |
| | | "hideEasing": "linear", |
| | | "showMethod": "fadeIn", |
| | | "hideMethod": "fadeOut" |
| | | }; |
| | | |
| | | |
| | | toastr.options = { |
| | | "closeButton": true, |
| | | "debug": false, |
| | | "progressBar": true, |
| | | "positionClass": "toast-bottom-right", |
| | | "onclick": null, |
| | | "showDuration": "300", |
| | | "hideDuration": "600", |
| | | "timeOut": "4500", |
| | | "extendedTimeOut": "600", |
| | | "showEasing": "swing", |
| | | "hideEasing": "linear", |
| | | "showMethod": "fadeIn", |
| | | "hideMethod": "fadeOut" |
| | | }; |
| | | |
| | | // ä¿å |
| | | function saveSimCost() { |
| | | |
| | | if ($("#cbbCard").val() == '') { |
| | | toastr.warning("çµè¯å¡å·ä¸è½ä¸ºç©º"); |
| | | return; |
| | | } |
| | | |
| | | if ($("#billamount").val() == '') { |
| | | toastr.warning("å®é
çµè¯è´¹ç¨ä¸è½ä¸ºç©º"); |
| | | return; |
| | | } |
| | | if ($("#acTime").val() == '') { |
| | | toastr.warning("è´¹ç¨è®°è´¦æ¥æä¸è½ä¸ºç©º"); |
| | | return; |
| | | } |
| | | |
| | | |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "/SimCost/SaveSimCost", |
| | |
| | | @{ |
| | | ViewBag.Title = "çµè¯è´¹å½å
¥"; |
| | | Layout = "~/Views/Shared/_Layout_Search.cshtml"; |
| | | ViewBag.Title = "çµè¯è´¹"; |
| | | Layout = null;// "~/Views/Shared/_Layout_Search.cshtml"; |
| | | } |
| | | |
| | | <link href="~/css/jquery-confirm.css" rel="stylesheet"> |
| | | <script src="~/js/jquery-confirm.js" type="text/javascript"></script> |
| | | <html> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> |
| | | <meta name="description" content=""> |
| | | <meta name="author" content="ThemeBucket"> |
| | | <title></title> |
| | | <link href="~/css/bootstrap.min.css" rel="stylesheet"> |
| | | <link href="~/css/plugins/jqgrid/ui.jqgrid.css?v=111111111" rel="stylesheet"> |
| | | <link href="~/css/animate.min.css" rel="stylesheet"> |
| | | <link href="~/css/style.min.css" rel="stylesheet"> |
| | | <script src="~/js/jquery.min.js"></script> |
| | | <script src="~/js/plugins/jqgrid/i18n/grid.locale-cn.js"></script> |
| | | <script src="~/js/plugins/jqgrid/jquery.jqGrid.min.js"></script> |
| | | </head> |
| | | <body style="width:100%;padding:10px"> |
| | | <table id="list2"></table> |
| | | @*<div id="pager2"></div>*@ |
| | | |
| | | @section headerStyle{ |
| | | <script type="text/javascript"> |
| | | |
| | | <script type="text/javascript"> |
| | | $(function () { |
| | | var year =@ViewBag.Year; |
| | | var sim ='@ViewBag.Sim'; |
| | | var urlstr = "/SimCost/GetList?year=" + year + "&sim=" + sim; |
| | | |
| | | gridConfig = { multiselect: false, selectcol: "id" }; |
| | | jQuery("#list2").jqGrid( |
| | | { |
| | | url: urlstr, |
| | | datatype: "json", |
| | | colModel: [ |
| | | { |
| | | label: 'æ¥æ', name : 'bill_year', labtype: 'txt', hidden: false, width: 100, |
| | | formatter: function (cellvalue, options, rowObject) { |
| | | return rowObject.bill_year + "-" + rowObject.bill_month; |
| | | } |
| | | }, |
| | | { |
| | | label: 'çµè¯å¡å·', name : 'simcard', labtype: 'txt', hidden: false, width: 150, |
| | | }, |
| | | { label: '使ç¨äººå', name : 'username', labtype: 'txt', hidden: false, width: 150 }, |
| | | { label: 'çµè¯åéé¢', name : 'bill_amount', labtype: 'txt', hidden: false, width: 150 }, |
| | | { label: 'çµè¯è¡¥è´´éé¢', name : 'allow_amount', labtype: 'txt', hidden: false, width: 150 }, |
| | | { label: 'å·®å¼éé¢', name : 'amount', labtype: 'txt', hidden: false, width: 100 }, |
| | | { label: 'ç¶æ', name : 'statusChs', labtype: 'txt', hidden: false, width: 100 }, |
| | | { label: 'æ´æ°æ¥æ', name: 'up_time', labtype: 'txt', hidden: false, width: 200}, |
| | | ], |
| | | shrinkToFit: true, |
| | | //rowNum: 10, |
| | | //rowList: [10, 20, 30], |
| | | //pager: '#pager2', |
| | | //sortname: 'id', |
| | | mtype: "post", |
| | | viewrecords: true, |
| | | }); |
| | | }); |
| | | |
| | | |
| | | |
| | | @*gridConfig = { multiselect: false, selectcol: "id" }; |
| | | dataCol = [ |
| | | { label: 'åºå·', name: 'id', labtype: 'txt', hidden: false, width: 50 }, |
| | | { label: 'è´¦åæ¥æ', name: 'accountMonth', labtype: 'txt', hidden: false, width: 150 }, |
| | | { |
| | | label: 'æ¥æ', name: 'bill_year', labtype: 'txt', hidden: false, width: 150, |
| | | formatter: function (cellvalue, options, rowObject) { |
| | | return rowObject.bill_year + "-" + rowObject.bill_month; |
| | | }}, |
| | | { |
| | | label: 'çµè¯å¡å·', name: 'simcard', labtype: 'txt', hidden: false, width: 150, |
| | | formatter: function (cellvalue, options, rowObject) { |
| | | return "<a onclick=\"OpenWindow('ç¼è¾çµè¯è´¹ç¨','98%','90%', '/SimCost/Edit?id=" + rowObject.id + "')\" >" + cellvalue + "</a>"; |
| | | } |
| | | }, |
| | | { label: '使ç¨äººå', name: 'username', labtype: 'txt', hidden: false, width: 150 }, |
| | | { label: 'çµè¯åéé¢', name: 'bill_amount', labtype: 'txt', hidden: false, width: 100 }, |
| | |
| | | { label: 'ç¶æ', name: 'statusChs', labtype: 'txt', hidden: false, width: 100 }, |
| | | { label: 'æ´æ°æ¥æ', name: 'up_time', labtype: 'txt', hidden: false }, |
| | | ]; |
| | | dataUrl = "/SimCost/GetList"; |
| | | searchCol = [ |
| | | { label: 'æ¶é´', name: 'searchtime', labtype: 'datearea', hidden: false }, |
| | | { label: 'çµè¯å¡å·', name: 'searchsim', labtype: 'txt', hidden: false, cwidth: '5%', cccwidth: '8%' } |
| | | ]; |
| | | dataUrl = "/SimCost/GetList?year=" +@ViewBag.Year+"&sim="+@ViewBag.Sim;*@ |
| | | |
| | | var _pageAdd = function () { |
| | | OpenWindow("æ°å¢çµè¯è´¹ç¨", "98%", "90%", "/SimCost/Edit/"); |
| | | } |
| | | </script> |
| | | |
| | | var _pageUnBind = function () { |
| | | var db = jQuery('#jqGrid').jqGrid('getGridParam', 'selarrrow'); |
| | | if (db.length > 0) { |
| | | $.confirm({ |
| | | title: 'è§£é¤ç»å®æä½ç¡®è®¤', |
| | | content: 'æ¤æä½å°è§£é¤æéå®çµè¯å¡å人åç»å®å
³ç³»ï¼ç¡®è®¤è¦ç»§ç»å?', |
| | | type: 'green', |
| | | icon: 'glyphicon glyphicon-question-sign', |
| | | buttons: { |
| | | ok: { |
| | | text: '确认', |
| | | btnClass: 'btn-primary', |
| | | action: function () { |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "/Sim/UnBindSim?id="+db, |
| | | dataType: "json", |
| | | global: false, |
| | | success: function (data) { |
| | | </body> |
| | | </html> |
| | | |
| | | if (data.Result) { |
| | | jQuery('#jqGrid').jqGrid().trigger('reloadGrid'); |
| | | |
| | | parent.layer.msg('设置æå', { icon: 6 }); |
| | | } |
| | | else { |
| | | parent.layer.msg(data.Message, { icon: 5 }); |
| | | } |
| | | }, |
| | | error: function () { |
| | | parent.layer.msg('失败', { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | cancel: { |
| | | text: 'åæ¶', |
| | | btnClass: 'btn-primary' |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | else { |
| | | $.alert("请å
éæ©éè¦è§£ç»ççµè¯å¡ï¼"); |
| | | } |
| | | |
| | | } |
| | | |
| | | var _afterSave = function (result) { |
| | | if (result) { |
| | | toastr.success("ä¿åæå"); |
| | | } else { |
| | | toastr.error("ä¿å失败"); |
| | | } |
| | | } |
| | | |
| | | var _afterDel = function (result) { |
| | | if (result) { |
| | | toastr.success("å 餿å"); |
| | | } else { |
| | | /**/ |
| | | toastr.error("å 餿å"); |
| | | /**/ |
| | | } |
| | | } |
| | | </script> |
| | | } |
New file |
| | |
| | | @{ |
| | | ViewBag.Title = "çµè¯è´¹ç»è®¡å½å
¥"; |
| | | Layout = "~/Views/Shared/_Layout_Search.cshtml"; |
| | | } |
| | | |
| | | <link href="~/css/jquery-confirm.css" rel="stylesheet"> |
| | | <link href="~/js/plugins/layer/laydate/theme/default/laydate.css" rel="stylesheet"> |
| | | <script src="~/js/jquery-confirm.js" type="text/javascript"></script> |
| | | <script src="~/js/plugins/layer/laydate/laydate5.js" type="text/javascript"></script> |
| | | |
| | | <style> |
| | | /* .laydate_table { |
| | | display: none; |
| | | }*/ |
| | | |
| | | .col-base { |
| | | line-height: 35px; |
| | | } |
| | | /* |
| | | #laydate_hms { |
| | | display: none !important; |
| | | }*/ |
| | | </style> |
| | | |
| | | @section headerStyle{ |
| | | |
| | | <table style="line-height:35px;margin-top:15px"> |
| | | <tr> |
| | | <td width="100"></td> |
| | | <td>æ¥è¯¢å¹´ä»½ï¼</td> |
| | | <td width="180"> |
| | | <input id="acTime" style="width:150px" class="layui-input" placeholder="yyyy" type="text" /> |
| | | </td> |
| | | <td>çµè¯å¡å·ï¼</td> |
| | | <td width="180"> |
| | | <input id="acSim" class="form-control" labtype="txt" addvisible="true" type="text"> |
| | | </td> |
| | | <td> |
| | | <a class="btn btn-default btn-outline" href="#" onclick="doSearch()" style="margin-left:20px"> |
| | | <i class="fa fa-search"></i> <span class="bold">æ¥è¯¢</span> |
| | | </a> |
| | | </td> |
| | | <td></td> |
| | | </tr> |
| | | </table> |
| | | |
| | | <script type="text/javascript"> |
| | | |
| | | gridConfig = { multiselect: false, selectcol: "sim_id" }; |
| | | shrinkToFit = true; |
| | | footerrow = true; |
| | | |
| | | dataCol = [ |
| | | { label: 'åºå·', name: 'sim_id', labtype: 'txt', hidden: true }, |
| | | { label: '年份', name: 'bill_year', labtype: 'txt', hidden: false, width: 100 }, |
| | | { |
| | | label: 'çµè¯å¡å·', name: 'sim', labtype: 'txt', hidden: false, width: 100, |
| | | formatter: function (cellvalue, options, rowObject) { |
| | | var simcode = rowObject.sim_id; |
| | | var url = "/SimCost/Index?year=" + rowObject.bill_year + "&sim=" + simcode; |
| | | return "<a onclick=\"OpenWindow('çµè¯è´¹','70%','50%','"+url+"' )\" >" + cellvalue + "</a>"; |
| | | } |
| | | }, |
| | | |
| | | { |
| | | label: '1æ', name: 'Jan', labtype: 'txt', hidden: false, align: 'right', width: 100, formatter: currencyFmatter |
| | | }, |
| | | { label: '2æ', name: 'Feb', labtype: 'txt', hidden: false, align: 'right', width: 100, formatter: currencyFmatter }, |
| | | { label: '3æ', name: 'Mar', labtype: 'txt', hidden: false, align: 'right', width: 100, formatter: currencyFmatter}, |
| | | { label: '4æ', name: 'Apr', labtype: 'txt', hidden: false, align: 'right', width: 100, formatter: currencyFmatter}, |
| | | { label: '5æ', name: 'May', labtype: 'txt', hidden: false, align: 'right', width: 100, formatter: currencyFmatter}, |
| | | { label: '6æ', name: 'Jun', labtype: 'txt', hidden: false, align: 'right', width: 100, formatter: currencyFmatter}, |
| | | { label: '7æ', name: 'Jul', labtype: 'txt', hidden: false, align: 'right', width: 100, formatter: currencyFmatter}, |
| | | { label: '8æ', name: 'Aug', labtype: 'txt', hidden: false, align: 'right', width: 100, formatter: currencyFmatter}, |
| | | { label: '9æ', name: 'Sept', labtype: 'txt', hidden: false, align: 'right', width: 100, formatter: currencyFmatter}, |
| | | { label: '10æ', name: 'Oct', labtype: 'txt', hidden: false, align: 'right', width: 100, formatter: currencyFmatter}, |
| | | { label: '11æ', name: 'Nov', labtype: 'txt', hidden: false, align: 'right', width: 100, formatter: currencyFmatter }, |
| | | { label: '12æ', name: 'Dece', labtype: 'txt', hidden: false, align: 'right', width: 100, formatter: currencyFmatter } |
| | | ]; |
| | | dataUrl = "/SimCost/GetSimYearList"; |
| | | searchCol = []; |
| | | |
| | | var lastsel; |
| | | |
| | | $(function () { |
| | | |
| | | laydate.render({ |
| | | elem: '#acTime' |
| | | , type: 'year' |
| | | , value: getNowFormatDate() |
| | | }); |
| | | |
| | | //$("#jqGridPager").hide();//éèdiv |
| | | |
| | | //$("#jqGrid").closest(".ui-jqgrid-bdiv").css({ 'overflow-x': 'scroll' }); |
| | | |
| | | //jQuery("#jqGrid").jqGrid('setGridHeight', 150); |
| | | |
| | | }); |
| | | |
| | | |
| | | function getNowFormatDate() { |
| | | var date = new Date(); |
| | | var year = date.getFullYear(); |
| | | return year; |
| | | } |
| | | |
| | | function currencyFmatter(cellvalue, options, rowObject) { |
| | | var id = rowObject.sim_id; |
| | | var sim = rowObject.sim; |
| | | var m = options.pos - 3; |
| | | |
| | | if (m > rowObject.month) { |
| | | var y = rowObject.bill_year; |
| | | var url = "/SimCost/Edit?id=" + id + "&money=" + cellvalue + "&year=" + y + "&month=" + m + "&sim=" + sim; |
| | | |
| | | return "<a onclick=\"OpenWindow('çµè¯è´¹ç¨å½å
¥','30%','50%','" + url + "')\">" + cellvalue + "</a>"; |
| | | } |
| | | else { |
| | | return cellvalue; |
| | | } |
| | | } |
| | | |
| | | function doSearch() { |
| | | |
| | | |
| | | // $("#jqGrid").trigger('reloadGrid'); |
| | | $("#jqGrid").jqGrid('setGridParam', { |
| | | url: "/SimCost/GetSimYearList", |
| | | postData: { |
| | | searchtime: $('#acTime').val(), |
| | | searchsim: $('#acSim').val(), |
| | | } |
| | | |
| | | }).trigger("reloadGrid"); |
| | | |
| | | } |
| | | |
| | | |
| | | </script> |
| | | |
| | | } |
| | |
| | | --çµè¯å¡åé
èå |
| | | insert into [plt_page] values('a3479c03-d554-4e02-b201-487e8e1dfb55','1','çµè¯å¡åé
','',3,'/Sim/Index/','01','M','967b0bdd-cd5d-4660-8c72-7f744c07751b','',0,'A','e4c93811-b9b1-4998-89f5-c416ebab0c07',getdate(),'e4c93811-b9b1-4998-89f5-c416ebab0c07',getdate()) |
| | | --çµè¯è´¹è®°å½æç» |
| | | insert into [plt_page] values('5E973843-7EB4-41A6-B49B-192208647B2C','1','çµè¯è´¹ç¨è®°å½','',4,'/SimCost/Index/','01','M','967b0bdd-cd5d-4660-8c72-7f744c07751b','',0,'A','e4c93811-b9b1-4998-89f5-c416ebab0c07',getdate(),'e4c93811-b9b1-4998-89f5-c416ebab0c07',getdate()) |
| | | insert into [plt_page] values('5E973843-7EB4-41A6-B49B-192208647B2C','1','çµè¯è´¹ç¨è®°å½','',4,'/SimCost/SimYear/','01','M','967b0bdd-cd5d-4660-8c72-7f744c07751b','',0,'A','e4c93811-b9b1-4998-89f5-c416ebab0c07',getdate(),'e4c93811-b9b1-4998-89f5-c416ebab0c07',getdate()) |
| | | |
| | | USE [zhengcaioa] |
| | | GO |