username@email.com
2021-06-28 76430b83e28b43122886c1cd8a9fb1cd61040d22
Merge branch 'master' of http://47.108.235.38:8080/r/zhengcaioa

# Conflicts:
# zhengcaioa/.vs/zhengcaioa/DesignTimeBuild/.dtbcache.v2
# zhengcaioa/.vs/zhengcaioa/v16/.suo
# zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Edit.cshtml
17个文件已修改
1个文件已删除
1个文件已添加
1802 ■■■■■ 已修改文件
zhengcaioa/.vs/zhengcaioa/DesignTimeBuild/.dtbcache.v2 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/.vs/zhengcaioa/config/applicationhost.config 987 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/.vs/zhengcaioa/v16/.suo 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/HrSalaryDTO.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/IServices/IHrSalaryService.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/IServices/ISimService.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Model/Sim.cs 88 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Model/zhengcaioaContext.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/HrSalaryService.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/SimService.cs 131 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Controllers/HR/SalaryCheckController.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Controllers/admin/SimCostController.cs 101 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Edit.cshtml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/SalaryCheck/Edit.cshtml 38 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/SimCost/Edit.cshtml 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/SimCost/Index.cshtml 152 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/SimCost/SimYear.cshtml 142 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/zhengcaioa.csproj.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
用户表更新.sql 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/.vs/zhengcaioa/DesignTimeBuild/.dtbcache.v2
Binary files differ
zhengcaioa/.vs/zhengcaioa/config/applicationhost.config
File was deleted
zhengcaioa/.vs/zhengcaioa/v16/.suo
Binary files differ
zhengcaioa/DTO/HrSalaryDTO.cs
@@ -92,6 +92,10 @@
                        str = "未确认";
                        break;
                    case "H":
                        str = "已核准";
                        break;
                    case "S":
                        str = "申诉";
                        break;
zhengcaioa/IServices/IHrSalaryService.cs
@@ -34,5 +34,7 @@
        ResultDataEntity<HrSalaryDTO> SearchSalaryByPaging(HrSalaryDTOSearch searchEntity);
        ResultEntity SaveCheckSalary(HrSalaryDTO dto);
        void AutoCheck();
    }
}
zhengcaioa/IServices/ISimService.cs
@@ -22,8 +22,10 @@
        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);
    }
}
zhengcaioa/Model/Sim.cs
@@ -147,8 +147,94 @@
        {
            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; }
    }
}
zhengcaioa/Model/zhengcaioaContext.cs
@@ -22,6 +22,8 @@
        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; }
zhengcaioa/Services/HrSalaryService.cs
@@ -101,6 +101,13 @@
                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;
@@ -178,7 +185,7 @@
                        }
                    }
                    updatepltRole.Islock = "Q";
                    updatepltRole.Islock = "H";
                    updatepltRole.Modifier = dto.Modifier;
                    updatepltRole.Modifytime =DateTime.Now;
                    var count= _context.SaveChanges();
@@ -578,7 +585,7 @@
            var entity = (from a in _context.HrSalaries
                          join b in _context.PltUsers on a.Userid equals b.Id
                          join c in _context.HrDepts on b.DeptId equals c.Id
                          where a.RecStatus=="A" && a.Userid == userid && a.Year == year && a.Month==month
                          where a.RecStatus=="A" && a.Islock!="D" && a.Userid == userid && a.Year == year && a.Month==month
                          select new HrSalaryDTO()
                          {
                              Id = a.Id,
@@ -819,5 +826,17 @@
            data.LoadData(searchEntity, rolelist);
            return data;
        }
        public void AutoCheck()
        {
            try
            {
                var salary = _context.Database.ExecuteSqlRaw("update [hr_salary] set islock='Q',[modifier]='e4c93811-b9b1-4998-89f5-c416ebab0c07',modifytime=getdate() where islock = 'H' and DATEDIFF(hh,[modifytime], getdate()) > 72");
            }
            catch (Exception)
            {
                throw;
            }
        }
    }
}
zhengcaioa/Services/SimService.cs
@@ -209,13 +209,13 @@
            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)
@@ -227,22 +227,22 @@
                }
                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);
@@ -284,9 +284,9 @@
        /// </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
@@ -298,26 +298,29 @@
                //                && 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()
                //{
@@ -329,7 +332,7 @@
                //    username = a.username
                //}).ToList();
                data.LoadData(searchEntity, signinList);
                //data.LoadData(searchEntity, signinList);
            }
            catch (Exception ex)
            {
@@ -338,7 +341,13 @@
            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)
        {
@@ -349,6 +358,56 @@
            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
    }
}
zhengcaioa/zhengcaioa/Controllers/HR/SalaryCheckController.cs
@@ -62,6 +62,8 @@
        /// <returns></returns>
        public IActionResult GetList(HrSalaryDTOSearch search)
        {
            _hrSalaryService.AutoCheck();
            return new JsonResult(_hrSalaryService.SearchSalaryByPaging(search));
        }
@@ -212,6 +214,9 @@
        /// <returns></returns>
        public IActionResult GetSearchList(HrSalaryDTOSearch search)
        {
            //自动确认
            _hrSalaryService.AutoCheck();
            return new JsonResult(_hrSalaryService.SearchByPagingFinish(search));
        }
        
zhengcaioa/zhengcaioa/Controllers/admin/SimCostController.cs
@@ -34,24 +34,24 @@
        /// åˆ—表页
        /// </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();
@@ -62,7 +62,10 @@
            //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();
        }
@@ -71,9 +74,17 @@
        /// </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>
@@ -81,15 +92,18 @@
        /// </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();
        }
@@ -113,6 +127,39 @@
            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>
zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Edit.cshtml
@@ -270,14 +270,18 @@
            "hideMethod": "fadeOut"
        };
        var id = '@Model.Id';
        if (id == null || id == '') {
            $("#GoodsStatus").val("A");
        }
         $(function () {
             if (id.length > 0) {
             }
             else {
                 $("#GoodsStatus").val("A");
             }
            });
        var delPosition = function () {
            if (id == null || id == '') {
@@ -319,7 +323,7 @@
        // ä¿å­˜å²—位信息
        var savePosition = function () {
            if ($("#ClassifyId").val() == '') {
                toastr.warning("物品类别不能为空");
@@ -333,7 +337,7 @@
                toastr.warning("物品数量不能为空");
                return;
            }
            if ($("#GoodsStatus").val() == '') {
                toastr.warning("物品状态不能为空");
                return;
@@ -343,7 +347,7 @@
                toastr.warning("物品名称不能为空");
                return;
            }
@@ -358,7 +362,7 @@
                global: false,
                data: $('form').serializeArray(),
                success: function (data) {
                        if (data.Result) {
zhengcaioa/zhengcaioa/Views/SalaryCheck/Edit.cshtml
@@ -72,25 +72,25 @@
                            <div class="clearfix layer-area" style="padding-bottom:15px;">
                                <label class="text-right col-sm-3 col-md-3 control-label">奖金</label>
                                <div class="col-sm-9 col-md-9">
                                    <input class="form-control" name="Jiangjin" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="text" value="@Model.Jiangjin" oninput="if(value.length>10)value=value.slice(0,10)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
                                    <input class="form-control" id="Jiangjin" name="Jiangjin" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="text" value="@Model.Jiangjin" oninput="if(value.length>10)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-3 col-md-3 control-label">补发工资</label>
                                <div class="col-sm-9 col-md-9">
                                    <input class="form-control" name="Bufagongzi" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="text" value="@Model.Bufagongzi" oninput="if(value.length>10)value=value.slice(0,10)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
                                    <input class="form-control" id="Bufagongzi" name="Bufagongzi" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="text" value="@Model.Bufagongzi" oninput="if(value.length>10)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-3 col-md-3 control-label">赔偿</label>
                                <div class="col-sm-9 col-md-9">
                                    <input class="form-control" name="Peichang" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="text" value="@Model.Peichang" oninput="if(value.length>10)value=value.slice(0,10)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
                                    <input class="form-control" id="Peichang" name="Peichang" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="text" value="@Model.Peichang" oninput="if(value.length>10)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-3 col-md-3 control-label">纠错</label>
                                <div class="col-sm-9 col-md-9">
                                    <input class="form-control" label="薪资待遇" name="Jiucuo" labtype="txt" addvisible="true" maxlength="500" editvisible="true" reg="" ismust="true" type="text" value="@Model.Jiucuo" oninput="if(value.length>10)value=value.slice(0,10)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
                                    <input class="form-control" id="Jiucuo" name="Jiucuo" labtype="txt" addvisible="true" maxlength="500" editvisible="true" reg="" ismust="true" type="text" value="@Model.Jiucuo" oninput="if(value.length>10)value=value.slice(0,10)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
                                </div>
                            </div>
@@ -133,7 +133,7 @@
                <a class="btn btn-success" href="javascript:void(0)" onclick="_pageAutoClose();" style="margin-left:4px; border-radius:4px;">
                    <i class="glyphicon glyphicon-remove"></i>&nbsp;&nbsp;<span class="bold">取消</span>
                </a>
                <a class="btn btn-success" href="javascript:void(0)" onclick="saveSimCost();" style="margin-left:4px; border-radius:4px;">
                <a class="btn btn-success" href="javascript:void(0)" onclick="saveCheck();" style="margin-left:4px; border-radius:4px;">
                    <i class="glyphicon glyphicon-ok"></i>&nbsp;&nbsp;<span class="bold">提交</span>
                </a>
            </div>
@@ -173,24 +173,29 @@
        };
        // ä¿å­˜
        function saveSimCost() {
        function saveCheck() {
            if ($("#cbbCard").val() == '') {
                toastr.warning("电话卡号不能为空");
            if ($("#Jiangjin").val() == '') {
                toastr.warning("奖金不能为空");
                return;
            }
            if ($("#billamount").val() == '') {
                toastr.warning("实际电话费用不能为空");
            if ($("#Bufagongzi").val() == '') {
                toastr.warning("补发工资不能为空");
                return;
            }
            if ($("#acTime").val() == '') {
                toastr.warning("费用记账日期不能为空");
            if ($("#Peichang").val() == '') {
                toastr.warning("赔偿不能为空");
                return;
            }
            if ($("#Jiucuo").val() == '') {
                toastr.warning("纠错不能为空");
                return;
            }
           
            $.ajax({
                type: "POST",
                url: "/SimCost/SaveSimCost2",
                url: "/SalaryCheck/SaveCheck",
                dataType: "json",
                global: false,
                data: $('#fm').serialize(),
@@ -198,12 +203,7 @@
                        if (data.Result) {
                            parent.layer.msg('设置成功', { icon: 6 });
                            try {
                                _pageAutoClose();//自动关闭页面方法
                            }
                            catch (err) {
                                parent._CloseTab1("/SimCost/Edit/");
                            }
                            _pageAutoClose();//自动关闭页面方法
                        }
                        else {
                            // toastr.error("失败");
zhengcaioa/zhengcaioa/Views/SimCost/Edit.cshtml
@@ -3,7 +3,6 @@
@using zhengcaioa.Models;
@{
    Layout = null;
    List<SimBindView> Card = ViewData["SimCard"] as List<SimBindView>;
}
<!DOCTYPE html>
@@ -58,40 +57,23 @@
                        <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>
@@ -114,49 +96,32 @@
    </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",
zhengcaioa/zhengcaioa/Views/SimCost/Index.cshtml
@@ -1,24 +1,77 @@
@{
    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 },
@@ -27,80 +80,11 @@
            { 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>
}
zhengcaioa/zhengcaioa/Views/SimCost/SimYear.cshtml
New file
@@ -0,0 +1,142 @@
@{
    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>&nbsp;&nbsp;<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>
}
zhengcaioa/zhengcaioa/zhengcaioa.csproj.user
@@ -15,6 +15,6 @@
    <WebStackScaffolding_IsPartialViewSelected>False</WebStackScaffolding_IsPartialViewSelected>
    <WebStackScaffolding_IsReferencingScriptLibrariesSelected>False</WebStackScaffolding_IsReferencingScriptLibrariesSelected>
    <WebStackScaffolding_LayoutPageFile />
    <ShowAllFiles>true</ShowAllFiles>
    <ShowAllFiles>false</ShowAllFiles>
  </PropertyGroup>
</Project>
Óû§±í¸üÐÂ.sql
@@ -103,7 +103,7 @@
--电话卡分配菜单
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