Ejemplo n.º 1
0
        // GET api/menu
        public IEnumerable <dynamic> Get()
        {
            //var UserCode = this.User.Identity.Name;
            var UserCode = FormsAuth.GetUserData <LoginerBase>().UserCode;

            return(new sys_menuService().GetUserMenu(UserCode));
        }
Ejemplo n.º 2
0
        public ActionResult Index()
        {
            var loginer = FormsAuth.GetUserData <LoginerBase>();

            ViewBag.Title = "生产实时监控";

            ViewBag.UserName = loginer.UserName;
            ViewBag.UserCode = loginer.UserCode;
            //ViewBag.Settings = new sys_userService().GetCurrentUserSettings();

            string TenantId = SysHelper.GetTenantId();

            if (!string.IsNullOrEmpty(TenantId))
            {
            }
            else
            {
                ViewBag.TenantCode = "";
            }

            var result = new Dictionary <string, object>();

            result.Add("theme", "gray");
            result.Add("navigation", "accordion");
            result.Add("gridrows", "20");
            result.Add("tenant", "std");

            ViewBag.Settings = result;

            return(View());
        }
Ejemplo n.º 3
0
        public ActionResult Index()
        {
            var code    = new sys_codeService();
            var loginer = FormsAuth.GetUserData <LoginerBase>();
            var model   = new
            {
                dataSource = new{
                    user = loginer.UserName,
                },
                urls = new{
                    query  = "/api/Mms/EQP_FailureRelease",
                    newkey = "/api/Mms/EQP_FailureRelease/getnewkey",
                    edit   = "/api/Mms/EQP_FailureRelease/edit"
                },
                resx = new{
                    noneSelect   = "请先选择一条数据!",
                    editSuccess  = "保存成功!",
                    auditSuccess = "单据已审核!"
                },
                form = new{
                    ReleaseTime  = "",
                    FailureState = ""
                },
                defaultRow = new {
                    FailRemoveMan = loginer.UserName,
                    IsEnable      = true,
                },
                setting = new{
                    idField        = "ID",
                    postListFields = new string[] { "ID", "FailureRemoveCode", "FailureReportID", "ReleaseTime", "FailRemoveDescription", "FailRemoveMan", "FailureState", "IsEnable", "CreatePerson", "CreateTime", "ModifyPerson", "ModifyTime" }
                }
            };

            return(View(model));
        }
        public ActionResult Index(int id = 0)
        {
            var loginer = FormsAuth.GetUserData <LoginerBase>();
            SYS_BN_Department department = new SYS_BN_Department();

            if (id == 10)
            {
                var user = new SYS_BN_UserService().GetModel(ParamQuery.Instance().AndWhere("IsEnable", 1).AndWhere("UserCode", MmsHelper.GetUserCode()));
                department = new SYS_BN_DepartmentService().GetModel(ParamQuery.Instance().AndWhere("IsEnable", 1).AndWhere("DepartmentCode", user.DepartmentCode));
            }
            //var dapart=new SYS_BN_DepartmentService().get
            var warehouse = new SYS_BN_WarehouseService().GetWarehouseByCode(loginer.UserCode);

            uc         = new sys_codeService().Getsys_codeByTypeAndID("BillType", id);
            ViewBag.uc = uc;
            var model = new
            {
                urls = new
                {
                    query  = "/api/Mms/WMS_BN_BillMain",
                    remove = "/api/Mms/WMS_BN_BillMain/",
                    billno = "/api/Mms/WMS_BN_BillMain/getnewbillno",
                    audit  = "/api/Mms/WMS_BN_BillMain/audit/",
                    edit1  = "/Mms/WMS_BN_BillMain/edit/",
                    edit2  = "/Mms/WMS_BN_BillMain/customerEdit/?id=newid&type=" + id
                },
                resx = new
                {
                    detailTitle   = uc.Text + "明细",
                    noneSelect    = "请先选择一条单据!",
                    deleteConfirm = "确定要删除选中的单据吗?",
                    deleteSuccess = "删除成功!",
                    auditSuccess  = "单据已审核!"
                },
                dataSource = new
                {
                    //dsPurpose = new sys_codeService().GetValueTextListByType("Purpose")
                },
                form = new
                {
                    BillCode       = "",
                    ContractCode   = "",
                    ProjectName    = "",
                    DepartmentID   = department.DepartmentCode ?? "",
                    DepartmentName = department.DepartmentName ?? "",
                    SupplierCode   = "",
                    SupplierName   = "",
                    WarehouseCode  = "",
                    WarehouseName  = "",
                    ApproveState   = 1
                },
                idField = "ID"
            };

            return(View(model));
        }
Ejemplo n.º 5
0
        public ActionResult Index()
        {
            var loginer = FormsAuth.GetUserData <LoginerBase>();

            ViewBag.Title    = "水务设备管理系统";
            ViewBag.UserName = loginer.UserName;
            ViewBag.Settings = new sys_userService().GetCurrentUserSettings();

            return(View());
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 用户ID
        /// </summary>
        /// <returns></returns>
        public static string GetUserId()
        {
            string UserId = FormsAuth.GetUserData().UserId;

            if (string.IsNullOrEmpty(UserId))
            {
                UserId = Guid.Empty.ToString();
            }

            return(UserId);
        }
Ejemplo n.º 7
0
 /// <summary>
 /// 用户班次
 /// </summary>
 /// <returns></returns>
 public static string GetUserShiftId()
 {
     if (FormsAuth.GetUserData().ShiftId == null)
     {
         return("");
     }
     else
     {
         return(FormsAuth.GetUserData().ShiftId.ToString());
     }
 }
Ejemplo n.º 8
0
        public ActionResult Index()
        {
            var loginer = FormsAuth.GetUserData <LoginerBase>();

            ViewBag.Title       = "航鹏化动公司智能制造平台";
            ViewBag.UserCode    = loginer.UserCode;
            ViewBag.UserName    = loginer.UserName;
            ViewBag.Settings    = new sys_userService().GetCurrentUserSettings();
            ViewBag.CurrentDate = DateTime.Now.Year;
            ViewBag.TableName   = "";
            return(View());
        }
Ejemplo n.º 9
0
        public bool AuthorizeUserMenu(List <string> urls)
        {
            var UserCode = FormsAuth.GetUserData().UserCode;
            var result   = db.Sql(string.Format(@"
select 1
from sys_roleMenuMap A
left join sys_userRoleMap B on B.RoleCode = A.RoleCode
left join sys_menu C on C.MenuCode = A.MenuCode
where B.UserCode = '{1}'
and C.URL in ('{0}')", string.Join("','", urls), UserCode)).QueryMany <int>();

            return(result.Count > 0);
        }
Ejemplo n.º 10
0
        public void Audit(dynamic data)
        {
            var pUpdate = ParamUpdate.Instance()
                          .Update("MES_WorkshopPurchaseMain")
                          .Column("ApproveState", data.form.status.ToString())
                          .Column("ApproveRemark", data.form.comment.ToString())
                          .Column("ApprovePerson", FormsAuth.GetUserData().UserName)
                          .Column("ApproveDate", DateTime.Now)
                          .AndWhere("ID", data.form.ID.ToString());

            var service      = new MES_WorkshopPurchaseMainService();
            var rowsAffected = service.Update(pUpdate);

            MmsHelper.ThrowHttpExceptionWhen(rowsAffected < 0, "单据审核失败[BillNo={0}],请重试或联系管理员!");
        }
Ejemplo n.º 11
0
        public void Audit(string id, JObject data)
        {
            var pUpdate = ParamUpdate.Instance()
                          .Update("SYS_BOM")
                          .Column("ApproveState", data["status"])
                          .Column("ApproveRemark", data["comment"])
                          .Column("ApprovePerson", FormsAuth.GetUserData().UserName)
                          .Column("ApproveDate", DateTime.Now)
                          .AndWhere("ID", id);

            var service      = new SYS_BOMService();
            var rowsAffected = service.Update(pUpdate);

            MmsHelper.ThrowHttpExceptionWhen(rowsAffected < 0, "单据审核失败[BillNo={0}],请重试或联系管理员!", id);
        }
Ejemplo n.º 12
0
        public void Audit(string id, dynamic data)
        {
            var service = new psi_customerService();
            var result  = service.Update(ParamUpdate.Instance()
                                         .Column("AuditState", data.status)
                                         .Column("AuditReason", data.comment)
                                         .Column("AuditPerson", FormsAuth.GetUserData().UserName)
                                         .Column("AuditDate", DateTime.Now)
                                         .AndWhere("Id", id));

            if (result <= 0)
            {
                throw new HttpResponseException(new HttpResponseMessage()
                {
                    Content = new StringContent("审核收货单失败{Id=" + id + "},请重试或联系管理员!")
                });
            }
        }
        public dynamic Get(RequestWrapper query)
        {
            query.LoadSettingXmlString(@"
<settings defaultOrderBy='ID'>
    <select>*</select>
    <from>WMS_BN_BillMain</from>
    <where defaultForAll='true' defaultCp='equal' defaultIgnoreEmpty='true' >
        <field name='BillCode'		cp='like'></field>   
        <field name='ContractCode'		cp='equal'></field>   
        <field name='DepartmentID'		cp='equal'></field>   
        <field name='SupplierCode'		cp='equal'></field>   
        <field name='WarehouseCode'		cp='equal'></field>   
        <field name='ApproveState'		cp='equal'></field>   
    </where>
</settings>");
            var service = new WMS_BN_BillMainService();
            //if (WMS_BN_BillMainController.uc.Value =="8")
            //{
            //var loginer = FormsAuth.GetUserData<LoginerBase>();
            //var warehouse = new SYS_BN_WarehouseService().GetWarehouseByCode(loginer.UserCode);
            //var pQuery1 = query.ToParamQuery().AndWhere("ApproveState", 1).AndWhere("BillType","6").AndWhere("WarehouseCode", warehouse.WarehouseCode);
            //var result = service.GetDynamicListWithPaging(pQuery1);
            //return result;
            //}
            //else if (WMS_BN_BillMainController.uc.Value == "9")
            //{
            //    var loginer = FormsAuth.GetUserData<LoginerBase>();
            //    var warehouse = new SYS_BN_WarehouseService().GetWarehouseByCode(loginer.UserCode);
            //    var pQuery1 = query.ToParamQuery().AndWhere("ApproveState", 1).AndWhere("BillType", "7").AndWhere("WarehouseCode", warehouse.WarehouseCode);
            //    var result = service.GetDynamicListWithPaging(pQuery1);
            //    return result;
            //}
            //else

            var loginer   = FormsAuth.GetUserData <LoginerBase>();
            var warehouse = new SYS_BN_WarehouseService().GetWarehouseByCode(loginer.UserCode);
            var pQuery    = query.ToParamQuery().AndWhere("BillType", WMS_BN_BillMainController.uc.Value);
            //.AndWhere("WarehouseCode", warehouse.WarehouseCode);
            var result = service.GetDynamicListWithPaging(pQuery);

            return(result);
        }
        public ActionResult Index()
        {
            var loginer = FormsAuth.GetUserData <LoginerBase>();
            SYS_BN_Department department = new SYS_BN_Department();

            var user = new SYS_BN_UserService().GetModel(ParamQuery.Instance().AndWhere("IsEnable", 1).AndWhere("UserCode", MmsHelper.GetUserCode()));

            department = new SYS_BN_DepartmentService().GetModel(ParamQuery.Instance().AndWhere("IsEnable", 1).AndWhere("DepartmentCode", user.DepartmentCode));

            var model = new
            {
                urls = new
                {
                    query  = "/api/Mms/MES_MaterialReturnMain",
                    remove = "/api/Mms/MES_MaterialReturnMain/",
                    billno = "/api/Mms/MES_MaterialReturnMain/getnewbillno",
                    audit  = "/api/Mms/MES_MaterialReturnMain/audit/",
                    edit1  = "/Mms/MES_MaterialReturnMain/edit/"
                },
                resx = new
                {
                    detailTitle   = "车间退料明细",
                    noneSelect    = "请先选择一条单据!",
                    deleteConfirm = "确定要删除选中的单据吗?",
                    deleteSuccess = "删除成功!",
                    auditSuccess  = "单据已审核!"
                },
                dataSource = new
                {
                    //dsPurpose = new sys_codeService().GetValueTextListByType("Purpose")
                },
                form = new
                {
                    BillCode       = "",
                    DepartmentID   = department.DepartmentCode ?? "",
                    DepartmentName = department.DepartmentName ?? ""
                },
                idField = "ID"
            };

            return(View(model));
        }
Ejemplo n.º 15
0
        public ActionResult Index()
        {
            var code    = new sys_codeService();
            var report  = new EQP_FailureReportService();
            var loginer = FormsAuth.GetUserData <LoginerBase>();

            var model = new
            {
                dataSource = new{
                    failureReport = report.GetSelectReport(),
                },
                urls = new{
                    query  = "/api/Mms/EQP_FailureReport",
                    newkey = "/api/Mms/EQP_FailureReport/getnewkey",
                    edit   = "/api/Mms/EQP_FailureReport/edit"
                },
                resx = new{
                    noneSelect   = "请先选择一条数据!",
                    editSuccess  = "保存成功!",
                    auditSuccess = "单据已审核!"
                },
                form = new{
                    FailureReportCode = "",
                    EquipmentName     = "",
                    FailReportState   = ""
                },
                defaultRow = new {
                    IsEnable        = true,
                    FailReportState = 1,
                    FailTime        = DateTime.Now,
                    ReportPerson    = loginer.UserName,
                },
                setting = new{
                    idField = "ID",

                    postListFields = new string[] { "ID", "FailureReportCode", "EquipmentID", "EquipmentName", "WorkshopID", "WorkshopName", "FailTime", "FailDescription", "ReportPerson", "FailReportState", "IsEnable", "CreatePerson", "CreateTime", "ModifyPerson", "ModifyTime" }
                }
            };

            return(View(model));
        }
Ejemplo n.º 16
0
        public ActionResult Index(int id = 0)
        {
            var loginer = FormsAuth.GetUserData <LoginerBase>();

            uc = new sys_codeService().Getsys_codeByTypeAndID("MaintenanceType", id);
            var model = new
            {
                dataSource = new{
                },
                urls       = new{
                    query  = "/api/Mms/EQP_EquipmentMaintenancePlan",
                    newkey = "/api/Mms/EQP_EquipmentMaintenancePlan/getnewkey",
                    edit   = "/api/Mms/EQP_EquipmentMaintenancePlan/edit"
                },
                resx = new{
                    noneSelect   = "请先选择一条数据!",
                    editSuccess  = "保存成功!",
                    auditSuccess = "单据已审核!"
                },
                form = new{
                    PlanedStartTime        = "",
                    EquipmentMaintenanceID = "",
                    EquipmentCode          = "",
                    EquipmentName          = "",
                    MaintenanceType        = id,
                    MaintenanceName        = uc.Text,
                    //MaintenanceMan = loginer.UserName,
                },
                defaultRow = new {
                    MaintenanceState = 1,
                    MaintenanceType  = id,
                    MaintenanceName  = uc.Text,
                },
                setting = new{
                    idField        = "ID",
                    postListFields = new string[] { "ID", "MaintenancePlanCode", "EquipmentMaintenanceID", "EquipmentCode", "EquipmentName", "MaintenanceType", "MaintenanceName", "PlanedStartTime", "PlanedFinishTime", "ActualStartTime", "ActualFinishTime", "PlanedContent", "ActualContent", "MaintenanceMan", "MaintenanceState", "IsEnable", "CreatePerson", "CreateTime", "ModifyPerson", "ModifyTime" }
                }
            };

            return(View(model));
        }
Ejemplo n.º 17
0
        public void SaveCurrentUserSettings(JObject settings)
        {
            var UserCode = FormsAuth.GetUserData <LoginerBase>().UserCode;

            foreach (JProperty item in settings.Children())
            {
                var result = db.Update("sys_userSetting")
                             .Column("SettingValue", item.Value.ToString())
                             .Where("UserCode", UserCode)
                             .Where("SettingCode", item.Name)
                             .Execute();

                if (result <= 0)
                {
                    var model = new sys_userSetting();
                    model.UserCode     = UserCode;
                    model.SettingCode  = item.Name;
                    model.SettingValue = item.Value.ToString();
                    db.Insert <sys_userSetting>("sys_userSetting", model).AutoMap(x => x.ID).Execute();
                }
            }
        }
Ejemplo n.º 18
0
        public List <sys_roleMenuColumnMap> GetCurrentUserMenuColumns()
        {
            var MenuCode = new sys_menuService().GetCurrentMenuCode();
            var UserCode = FormsAuth.GetUserData().UserCode;
            var sql      = @"
select *
from sys_roleMenuColumnMap 
where MenuCode = @0
and RoleCode in (
select RoleCode
from sys_userRoleMap
where userCode = @1
union
select A.RoleCode
from sys_organizeRoleMap A
inner join sys_userOrganizeMap B on B.OrganizeCode = A.OrganizeCode
where B.UserCode = @1
)";

            var result = db.Sql(sql, MenuCode, UserCode).QueryMany <sys_roleMenuColumnMap>();

            return(result);
        }
Ejemplo n.º 19
0
        public List <sys_button> GetCurrentUserMenuButtons()
        {
            var MenuCode = GetCurrentMenuCode();
            var UserCode = FormsAuth.GetUserData().UserCode;
            var sql      = @"
select A.*
from sys_button A
inner join sys_roleMenuButtonMap B on B.MenuCode = @0 and B.ButtonCode = A.ButtonCode
where RoleCode in (
select RoleCode
from sys_userRoleMap
where userCode = @1
union
select A.RoleCode
from sys_organizeRoleMap A
inner join sys_userOrganizeMap B on B.OrganizeCode = A.OrganizeCode
where B.UserCode = @1
)
order by ButtonSeq";
            var result   = db.Sql(sql, MenuCode, UserCode).QueryMany <sys_button>();

            return(result);
        }
Ejemplo n.º 20
0
        public Dictionary <string, object> GetCurrentUserSettings()
        {
            var result   = new Dictionary <string, object>();
            var UserCode = FormsAuth.GetUserData <LoginerBase>().UserCode;
            //var config = db.Sql("select ConfigJSON from sys_user where UserCode=@0", UserCode).QuerySingle<string>();
            var settings = db.Sql("select * from sys_userSetting where UserCode=@0", UserCode).QueryMany <sys_userSetting>();

            foreach (var item in settings)
            {
                result.Add(item.SettingCode, item.SettingValue);
            }

            var defaults = GetDefaultUserSetttins();

            foreach (var item in defaults)
            {
                if (!result.ContainsKey(item.Key))
                {
                    result.Add(item.Key, item.Value);
                }
            }

            return(result);
        }
        public ActionResult Edit(string id = "")
        {
            //string billCode = new MES_MaterialPickMainService().GetBillCodeByID(id);
            var data = new MES_MaterialPickDetailApiController().GetPageData(id);
            //string documentNo = MmsHelper.GetOrderNumber("MES_MaterialPickMain", "BillCode", "CJLL", "", "");
            var loginer   = FormsAuth.GetUserData <LoginerBase>();
            var dpartment = new SYS_BN_UserService().GetDepartmentInfo(loginer.UserCode);
            SYS_BN_Warehouse warehouse = new SYS_BN_WarehouseService().GetModel(ParamQuery.Instance().AndWhere("ISEnable", 1).AndWhere("WarehouseName", dpartment.DepartmentName));

            ViewBag.IsWarehouse = warehouse == null ? 0 : 1;
            warehouse           = warehouse ?? new SYS_BN_Warehouse();

            string departid   = "";
            var    departname = "";

            if (dpartment != null)
            {
                departid   = dpartment.DepartmentCode;
                departname = dpartment.DepartmentName;
            }
            string dtNow = DateTime.Now.ToString("yyyy-MM-dd");
            var    model = new
            {
                urls = new
                {
                    getdata     = "/api/Mms/MES_MaterialPickDetail/GetPageData/",    //获取主表数据及数据滚动数据api
                    edit        = "/api/Mms/MES_MaterialPickDetail/edit/",           //数据保存api
                    audit       = "/api/Mms/MES_MaterialPickDetail/audit/",          //审核api
                    newkey      = "/api/Mms/MES_MaterialPickDetail/GetNewRowId/",    //获取新的明细数据的主键(日语叫采番)
                    storageSave = "/api/Mms/MES_MaterialPickDetail/PostStorage/"
                },
                resx = new
                {
                    rejected    = "已撤消修改!",
                    editSuccess = "保存成功!",
                    auditPassed = "单据已通过审核!",
                    auditReject = "单据已取消审核!"
                },
                dataSource = new
                {
                    pageData = data,
                    //payKinds = codeService.GetValueTextListByType("PayType")
                },
                form = new
                {
                    defaults = new MES_MaterialPickMain().Extend(new
                    {
                        ID             = id,
                        BillCode       = data.form == null ? "系统生成" : data.form.BillCode,
                        DepartmentID   = departid,
                        DepartmentName = departname,
                        PickingDate    = dtNow,
                        IsEnable       = 1,
                        BillState      = 1,
                        ContractCode   = "",
                        ProjectName    = "",
                        WarehouseCode  = warehouse.WarehouseCode,
                        WarehouseName  = warehouse.WarehouseName
                    }),
                    primaryKeys = new string[] { "ID" }
                },
                tabs = new object[] {
                    new{
                        type       = "grid",
                        rowId      = "ID",
                        relationId = "ID",
                        postFields = new string[] { "ID", "MainID", "ContractCode", "ProjectName", "InventoryCode", "InventoryName", "RequiredQuantity", "IsEnable", "Model", "Unit", "Material" },
                        defaults   = new { ID = "", MainID = id, ContractCode = "", ProjectName = "", InventoryCode = "", InventoryName = "", RequiredQuantity = "", IsEnable = 1, Model = "", Unit = "", Material = "" }
                    }
                }
            };

            return(View(model));
        }
Ejemplo n.º 22
0
 public static string GetUserCode()
 {
     return(FormsAuth.GetUserData().UserCode);
 }
        public ActionResult customerEdit(string id = "", string type = "")
        {
            uc         = new sys_codeService().Getsys_codeByTypeAndID("BillType", int.Parse(type));
            ViewBag.uc = uc;
            var loginer = FormsAuth.GetUserData <LoginerBase>();
            var user    = new SYS_BN_UserService().GetModel(ParamQuery.Instance().AndWhere("IsEnable", 1).AndWhere("UserCode", loginer.UserCode));
            //var department = new SYS_BN_UserService().GetDepartmentInfo(MmsHelper.GetUserCode());
            var department             = new SYS_BN_DepartmentService().GetModel(ParamQuery.Instance().AndWhere("IsEnable", 1).AndWhere("DepartmentCode", user.DepartmentCode));
            SYS_BN_Warehouse warehouse = new SYS_BN_Warehouse();

            if (department.DepartmentCode == "0107")
            {
                warehouse = new SYS_BN_WarehouseService().GetModel(ParamQuery.Instance().AndWhere("IsEnable", 1).AndWhere("UserCode", MmsHelper.GetUserCode()));
            }
            else
            {
                warehouse = new SYS_BN_WarehouseService().GetModel(ParamQuery.Instance().AndWhere("ISEnable", 1).AndWhere("WarehouseName", department.DepartmentName));
            }
            //var department=new SYS_BN_DepartmentService().GetIDNameList(MmsHelper.GetUserCode())



            warehouse    = warehouse ?? new SYS_BN_Warehouse();
            ViewBag.user = warehouse.WarehouseCode == null ? 0 : 1;

            var    data     = new WMS_BN_BillDetailApiController().GetPageData(id);
            string billCode = new WMS_BN_BillMainService().GetBillCodeByID(id);
            //string documentNo = MmsHelper.GetOrderNumber("WMS_BN_BillMain", "BillCode", uc.Description, "", "");
            var model = new
            {
                urls = new
                {
                    getdata     = "/api/Mms/WMS_BN_BillDetail/GetPageData/",    //获取主表数据及数据滚动数据api
                    edit        = "/api/Mms/WMS_BN_BillDetail/edit/",           //数据保存api
                    audit       = "/api/Mms/WMS_BN_BillDetail/audit/",          //审核api
                    newkey      = "/api/Mms/WMS_BN_BillDetail/GetNewRowId/",    //获取新的明细数据的主键(日语叫采番)
                    storageSave = "/api/Mms/WMS_BN_BillDetail/PostStorage/"
                },
                resx = new
                {
                    rejected    = "已撤消修改!",
                    editSuccess = "保存成功!",
                    auditPassed = "单据已通过审核!",
                    auditReject = "单据已取消审核!"
                },
                dataSource = new
                {
                    pageData = data,

                    DepartmentID   = department.DepartmentCode,
                    DepartmentName = department.DepartmentName,
                    WarehouseCode  = warehouse.WarehouseCode,
                    //payKinds = codeService.GetValueTextListByType("PayType")
                },
                form = new
                {
                    defaults    = new WMS_BN_BillMain().Extend(new { ID = data.scrollKeys.current, BillCode = data.form == null ? "系统生成" : data.form.BillCode, BillType = uc.Value, ContractCode = "", DepartmentID = "", DepartmentName = "", SupplierCode = "", WarehouseCode = warehouse.WarehouseCode, WarehouseName = warehouse.WarehouseName, ApproveState = "1", ApprovePerson = "", ApproveDate = "", ApproveRemark = "", Remark = "", CreatePerson = MmsHelper.GetUserName(), CreateTime = DateTime.Now, ModifyPerson = MmsHelper.GetUserName(), ModifyTime = DateTime.Now }),
                    primaryKeys = new string[] { "ID" }
                },
                tabs = new object[] {
                    new{
                        type       = "grid",
                        rowId      = "ID",
                        relationId = "ID",
                        postFields = new string[] { "ID", "BillCode", "OrderBillCode", "InventoryCode", "InventoryName", "Specs", "Unit", "MateNum", "ConfirmNum", "UnitPrice", "TotalPrice", "PackageCode", "BatchCode", "PBillCode", "AccountabilityCode", "Remark", "CreatePerson", "CreateTime", "ModifyPerson", "ModifyTime", "IsEnable" },
                        defaults   = new { ID = "", BillCode = billCode, InventoryCode = "", InventoryName = "", Unit = "", MateNum = "", ConfirmNum = "", PackageCode = "", BatchCode = "", PBillCode = "", AccountabilityCode = "", Remark = "", CreatePerson = "", CreateTime = "", ModifyPerson = "", ModifyTime = "", IsEnable = 1 }
                    }
                }
            };

            return(View("Edit", model));
        }
Ejemplo n.º 24
0
 /// <summary>
 /// 获取当前的登录用户者
 /// </summary>
 public Users GetLoginUser()
 {
     return(FormsAuth.GetUserData());
 }
Ejemplo n.º 25
0
        public ActionResult Edit(string id = "")
        {
            var userName = FormsAuth.GetUserData().UserName;
            var data     = new PurchaseApiController().GetEditMaster(id);
            var model    = new
            {
                form       = data.form,
                scrollKeys = data.scrollKeys,
                dataSource = new
                {
                    //warehouseItems = new psi_warehouseService().GetDynamicList(ParamQuery.Instance().Select("Id as value,Name as text"))
                },
                urls = new
                {
                    getdetail = "/api/psi/purchase/getdetail/",
                    getmaster = "/api/psi/purchase/geteditmaster/",
                    edit      = "/api/psi/purchase/edit",
                    audit     = "/api/psi/purchase/audit/",
                    getrowid  = "/api/psi/purchase/getnewrowid/",
                },
                resx = new
                {
                    rejected     = "已撤消修改!",
                    editSuccess  = "保存成功!",
                    auditSuccess = "单据已审核!"
                },
                defaultForm = new{
                    BillNo         = id,
                    BillDate       = DateTime.Now,
                    DoPerson       = userName,
                    DoDate         = DateTime.Now,
                    Supplier       = "",
                    ContractName   = "",
                    PurchaseDate   = DateTime.Now,
                    PurchasePerson = userName,
                    TotalMoney     = 0,
                    Remark         = "",
                    AuditPerson    = userName,
                    AuditDate      = DateTime.Now,
                    AuditState     = "Unapproved",
                    AuditReason    = "",
                    CreatePerson   = userName,
                    CreateDate     = DateTime.Now,
                    UpdatePerson   = "",
                    UpdateDate     = ""
                },
                defaultRow = new
                {
                    Num       = 1,
                    UnitPrice = 0,
                    Money     = 0
                },
                setting = new
                {
                    postFormKeys   = new string[] { "BillNo" },
                    postListFields = new string[] { "BillNo", "RowId", "GoodNo", "Num", "UnitPrice", "Money", "Remark" }
                }
            };

            return(View(model));
        }