Ver código fonte

Merge remote-tracking branch 'upstream/master' into develop

# Conflicts:
#	src/dashoo.cn/backend/api/conf/app.conf
#	src/dashoo.cn/backend/api/controllers/base.go
#	src/dashoo.cn/backend/api/controllers/casbin/user.go
#	src/dashoo.cn/backend/api/routers/router.go
#	src/dashoo.cn/frontend_web/src/pages/login.vue
#	src/dashoo.cn/frontend_web/src/pages/login3.vue
huahaiyan 6 anos atrás
pai
commit
73e0d80cd1

+ 55 - 0
src/dashoo.cn/backend/api/business/company/basecompany.go

@@ -0,0 +1,55 @@
+package company
+
+import (
+	"time"
+)
+
+type Base_Company struct {
+	Id             int       `xorm:"not null pk autoincr INT(10)"`
+	Fullname       string    `xorm:"VARCHAR(50)"`
+	ShortName      string    `xorm:"VARCHAR(50)"`
+	AccCode        string    `xorm:"VARCHAR(10)"`
+	TableCode      string    `xorm:"VARCHAR(50)"`
+	Enabled        int       `xorm:"INT(11)"`
+	SortCode       int       `xorm:"INT(11)"`
+	CreateUserId   int       `xorm:"INT(11)"`
+	Address        string    `xorm:"VARCHAR(50)"`
+	CreateBy       string    `xorm:"VARCHAR(255)"`
+	CreateOn       time.Time `xorm:"DATETIME created"`
+	ModifiedUserId int       `xorm:"INT(11)"`
+	ModifiedBy     string    `xorm:"VARCHAR(255)"`
+	ModifiedOn     time.Time `xorm:"DATETIME updated"`
+}
+type Base_Companytree struct {
+	Id       string `json:"id"`
+	ParentId string `json:"pId"`
+	Fullname string `json:"name"`
+	IsParent string `json:"isParent"`
+	Nocheck  string `json:"nocheck"`
+}
+
+type Base_Indextree struct {
+	Id          string `json:"id"`
+	ParentId    string `json:"pId"`
+	Fullname    string `json:"name"`
+	IsParent    string `json:"isParent"`
+	Nocheck     string `json:"nocheck"`
+	Longitude   string `json:"lng"`
+	Latitude    string `json:"lat"`
+	DeviceState string `json:"devicestate"`
+}
+
+type Base_Indextree1 struct {
+	Id       string `json:"id"`
+	ParentId string `json:"pId"`
+	Fullname string `json:"name"`
+}
+
+type UserCompany struct {
+	Companyname string
+	Username    string
+	Realname    string
+	Mobile      string
+	Telephone   string
+	Email       string
+}

+ 245 - 0
src/dashoo.cn/backend/api/business/company/basecompanyService.go

@@ -0,0 +1,245 @@
+package company
+
+import (
+	"fmt"
+	"strconv"
+
+	"dashoo.cn/utils"
+	. "dashoo.cn/utils/db"
+	"github.com/go-xorm/xorm"
+)
+
+type BaseCompanyService struct {
+	ServiceBase
+}
+
+func GetCompanyService(xormEngine *xorm.Engine) *BaseCompanyService {
+	s := new(BaseCompanyService)
+	s.DBE = xormEngine
+	return s
+}
+
+//提交   //传入f,s 两个参数 返回 comid
+func (s *BaseCompanyService) AddCompany(fullname, shortname string) (err error, comacccode string) {
+	model := Base_Company{Fullname: fullname, ShortName: shortname}
+	//model := Base_User{Username: user.Username}
+
+	has, _ := s.DBE.Get(&model)
+	if has {
+		err = utils.NewError("ErrorUserNameExist")
+		return
+	}
+
+	for i := 0; i < 10000; i++ {
+		acccode := "s" + utils.GetRandomString(4)
+		model1 := Base_Company{AccCode: acccode}
+		has1, _ := s.DBE.Get(&model1)
+		if has1 {
+			continue
+		} else {
+			model.AccCode = acccode
+			_, err = s.DBE.Insert(&model)
+			break
+		}
+	}
+
+	comacccode = model.AccCode
+	return
+}
+
+//根据Domain,ID查企业ID
+func (s *BaseCompanyService) GetCompanyid(where string) (ids []string) {
+	var idList []Id_Str
+	s.DBE.Sql(` select Id from Base_Company ` + where).Find(&idList)
+	ids = s.GetIdsFromId_StrList(idList)
+	if len(ids) == 0 {
+		ids = append(ids, "-1")
+	}
+	return
+}
+
+//判断是否存在短域名
+func (s *BaseCompanyService) IsexistComcode(code string) bool {
+	company := new(Base_Company)
+	has, _ := s.DBE.Where("ShortName=?", code).Get(company)
+	return has
+}
+
+//获取acccode
+func (s *BaseCompanyService) GetAcccodeByComcode(code string) int {
+	company := new(Base_Company)
+	s.DBE.Where("ShortName=?", code).Get(company)
+	return company.Id
+}
+func (s *BaseCompanyService) GetFullnameByAccode(Accode string) string {
+	var BaseCompany Base_Company
+	s.DBE.Where("Id=?", Accode).Get(&BaseCompany) //都得到的是整条语句
+	return BaseCompany.Fullname                   //取其中一个字段
+}
+
+//获取公司列表
+func (s *BaseCompanyService) GetCompanyTree(companytitle string) []Base_Companytree {
+	var tree []Base_Companytree
+	s.DBE.Sql(`select
+		0 Id,-1 ParentId,'` + companytitle + `' Fullname union all
+		select Id,0 ParentId,Fullname from Base_Company order by Id`).Find(&tree)
+	return tree
+}
+
+func (s *BaseCompanyService) GetPagingEntitiesWithOrderSearch(pageIndex, itemsPerPage int64, order string, where string) (int64, []UserCompany) {
+	var err error
+	var total int64
+	//获取总记录数
+	sqlCount := `select count(*)
+		from Base_User a left join
+		Base_Company b on a.AccCode=b.Id where` + where + ""
+	var sql string
+
+	sql = `select a.Realname Realname,a.UserName Username,b.Fullname Companyname,a.Mobile,a.Telephone,a.Email
+		from Base_User a left join
+		Base_Company b on a.AccCode=b.Id where ` + where + ` order by ` + order + ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
+
+	List := make([]UserCompany, 0)
+	utils.DBE.Sql(sql).Find(&List)
+	resultsSlice, err := s.DBE.Query(sqlCount)
+	LogError(err)
+
+	if len(resultsSlice) > 0 {
+		results := resultsSlice[0]
+		for _, value := range results {
+			total, err = strconv.ParseInt(string(value), 10, 64)
+			LogError(err)
+			break
+		}
+	}
+	return total, List
+}
+
+func (s *BaseCompanyService) GetBindingTree(whereorg, wherecompany string) (tree []Base_Companytree) {
+	s.DBE.Sql(`select concat('o',Id) Id,concat('o',ParentId) ParentId,Fullname, 'true' IsParent,'false' Nocheck from Base_Organize
+		where ` + whereorg + `
+		union all
+		select Id,concat('o',OrganizeId) ParentId,Fullname, 'false' IsParent ,'false' Nocheck
+		from Base_Company where
+		` + wherecompany).Find(&tree)
+	return
+
+}
+
+//撤销用户控制企业权限
+func (s *BaseCompanyService) GetEntityByUserid(userId string) (Base_Company, bool) {
+	var model Base_Company
+	sql := `select b.* from Base_User a
+		inner join Base_Company b on a.AccCode=b.Id
+		where a.Id=` + userId
+	has, _ := s.DBE.Sql(sql).Get(&model)
+	return model, has
+}
+
+func (s *BaseCompanyService) GetDevicesNumByOrg(whereorg, wherecompany string) int {
+	var num Id_Int
+	s.DBE.Sql(`select count(*) Id from Channels a
+		inner join Base_User b on a.CreateUserId=b.Id
+		inner join Base_Company c on b.AccCode=c.Id and ` + wherecompany + `
+		inner join Base_Organize d on c.OrganizeId=d.Id and
+		` + whereorg).Get(&num)
+	return num.Id
+
+}
+
+func (s *BaseCompanyService) GetDevicesNumByCompany(wherecompany string) int {
+	var num Id_Int
+	s.DBE.Sql(`select count(*) Id from Channels a
+		inner join Base_User b on a.CreateUserId=b.Id
+		inner join Base_Company c on b.AccCode=c.Id and ` + wherecompany).Get(&num)
+	return num.Id
+
+}
+
+func (s *BaseCompanyService) GetIndexTree(whereorg, wherecompany string) (tree []Base_Indextree) {
+	s.DBE.Sql(`select concat('o',Id) Id,concat('o',ParentId) ParentId,Fullname, 'true' IsParent,'true' Nocheck,0 Longitude,0 Latitude,0 DeviceState from Base_Organize
+		where ` + whereorg + `
+		union all
+		select Id,concat('o',OrganizeId) ParentId,Fullname, 'false' IsParent ,'false' Nocheck,Longitude,Latitude,DeviceState
+		from Base_Company where
+		` + wherecompany).Find(&tree)
+	return
+
+}
+
+func (s *BaseCompanyService) GetIndexTree1(whereorg, wherecompany string) (tree []Base_Indextree1) {
+	s.DBE.Sql(`select concat('o',Id) Id,concat('o',ParentId) ParentId,Fullname from Base_Organize
+		where ` + whereorg + `
+		union all
+		select Id,concat('o',OrganizeId) ParentId,Fullname
+		from Base_Company where
+		` + wherecompany).Find(&tree)
+	return
+
+}
+
+func (s *BaseCompanyService) GetUidByCompanyid(companyid string) int {
+	var uid Id_Int
+	s.DBE.Sql("select Id from Base_User where CreateUserId='0' and AccCode=" + companyid + " limit 1").Get(&uid)
+	return uid.Id
+
+}
+
+// 表
+var (
+	biobank = []string{"DonorsInfo", "DonorsLog", "SamplesMain", "SamplesDetail",
+		"SamplesBusiness", "SamplesFileDetail", "SamplesLog", "SamplesAttachment",
+		"SampleSearchTemplate", "MaterialInfo", "MaterialBatchKC",
+		"MaterialStoreHouse", "MaterialCKDetail", "MaterialCKHead", "MaterialPDDetail",
+		"MaterialPDHead", "MaterialRKDetail", "MaterialRKHead", "DonorsInfoAttachment",
+		"DocumentInfo", "DocumentHistory"}
+	cellbank = []string{"DonorsInfo", "DonorsLog", "SamplesMain", "SamplesDetail",
+		"SamplesBusiness", "SamplesFileDetail", "SamplesLog", "SamplesAttachment",
+		"SampleSearchTemplate", "MaterialInfo", "MaterialBatchKC",
+		"MaterialStoreHouse", "MaterialCKDetail", "MaterialCKHead", "MaterialPDDetail",
+		"MaterialPDHead", "MaterialRKDetail", "MaterialRKHead", "Instrument",
+		"InstrumenMaintainLog", "InstrumenRunRecord", "Customer", "CellsContract", "CellsContractDetail",
+		"CellsCollection", "CellsCollectionDetail", "CellsCollectionSensors", "CellsPrepareTemplate",
+		"CellsPrepareTemplateStep", "CellsPrepareTemplateStepDetail",
+		"CellsPreparation", "CellsPreparationInfo", "CellsPreparationInfoDetail",
+		"DonorsInfoAttachment", "InstrumenMaintainLogAttachment", "CellsContractAttachment", "TestTemplate",
+		"CellsProductDelivery", "CellsProductDeliveryAttachment", "CellsProductDeliverySample", "CellsPreparationInfoDetailAttachment",
+		"CellsPreparationTrace", "DocumentInfo", "DocumentHistory"}
+	lims = []string{"TestSample", "TestSampleDetail", "TestSampleInfo",
+		"TestSampleRelation", "TestTransferOrders", "TestInfo", "TestInfoDetail",
+		"TestItemsList", "TestList", "TestListDetail", "TestLaboratory",
+		"TestQualityControl", "TestControlParameters", "TestControlParametersDetail", "TestApplication",
+		"TestPackageCategory", "TestPrintTemplate", "TestPackage", "TestPackageItems",
+		"Instrument", "InstrumenMaintainLog", "Instrumenstate", "DocumentInfo", "DocumentHistory"}
+)
+
+func (s *BaseCompanyService) CreateSampleDonorTable(acccode, source string) error {
+	var err error
+	switch source {
+	case "biobank":
+		for _, v := range biobank {
+			if v != "" {
+				table := acccode + v
+				sql := fmt.Sprintf("CREATE TABLE %v LIKE AAtemplate%v", table, v)
+				_, err = s.DBE.Exec(sql)
+			}
+		}
+	case "cellbank":
+		for _, v := range cellbank {
+			if v != "" {
+				table := acccode + v
+				sql := fmt.Sprintf("CREATE TABLE %v LIKE AAtemplate%v", table, v)
+				_, err = s.DBE.Exec(sql)
+			}
+		}
+	case "lims":
+		for _, v := range lims {
+			if v != "" {
+				table := acccode + v
+				sql := fmt.Sprintf("CREATE TABLE %v LIKE AAtemplate%v", table, v)
+				_, err = s.DBE.Exec(sql)
+			}
+		}
+	}
+	return err
+}

+ 175 - 0
src/dashoo.cn/backend/api/controllers/casbin/user.go

@@ -1,9 +1,16 @@
 package casbin
 
 import (
+	"dashoo.cn/backend/api/business/accountinfo"
+	"dashoo.cn/backend/api/business/company"
+	"dashoo.cn/backend/api/business/printscheme"
 	"encoding/json"
+	"fmt"
 	"strings"
 
+	"dashoo.cn/backend/api/business/logsinfo"
+	"dashoo.cn/business2/auth"
+
 	"dashoo.cn/backend/api/business/organize"
 	"dashoo.cn/backend/api/models"
 	"dashoo.cn/business2/permission"
@@ -34,6 +41,18 @@ type UserModel struct {
 	Sign           string `json:"sign"`
 }
 
+type ChangePwdModel struct {
+	Pwd    string `json:"pass"`
+	NwePwd string `json:"newpass"`
+}
+
+type RegisteModel struct {
+	Companyname string `json:"companyname"`
+	Username    string `json:"username"`
+	Password    string `json:"password"`
+	Source      string `json:"source"`
+}
+
 // @Title get
 // @Description get user by token
 // @Param	uid		path 	string	true		"The key for staticblock"
@@ -352,3 +371,159 @@ func (this *UserController) Delete() {
 		this.ServeJSON()
 	}
 }
+
+// @Title 修改密码
+// @Description 修改密码
+// @Param	body	body	business.device.DeviceChannels	"传感器信息"
+// @Success	200	{object} controllers.Request
+// @router /userchangepwd [put]
+func (this *UserController) UserChangePWD() {
+	var model ChangePwdModel
+	var jsonblob = this.Ctx.Input.RequestBody
+	json.Unmarshal(jsonblob, &model)
+	var errinfo ErrorInfo
+
+	svcauth := auth.GetAuthServic(utils.DBE)
+	var user userRole.Base_User
+
+	if svcauth.VerifyUser3DES(this.User.Username, model.Pwd, &user) {
+		var entitypaw1, entitypaw2 logsinfo.Userpassword
+		idint, _ := utils.StrTo(this.User.Id).Int()
+		var umodel userRole.Base_User = userRole.Base_User{Id: idint}
+		svcauth.UpdateLog(this.User.Id, &entitypaw1, &entitypaw2, this.User.Id, this.User.Realname)
+		err := svcauth.SetNewPassword3DES(&umodel, model.NwePwd)
+		if err != nil {
+			errinfo.Message = "修改失败!" + err.Error()
+			errinfo.Code = -2
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+		} else {
+			errinfo.Message = "密码修改成功"
+			errinfo.Code = 0
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+		}
+	} else {
+		errinfo.Message = "修改失败!当前密码输入错误"
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+
+}
+
+// @Title 注册管理账号
+// @Description 注册管理账号
+// @Param	body	body	business.device.DeviceChannels	"传感器信息"
+// @Success	200	{object} controllers.Request
+// @router /registemanage [put]
+func (this *UserController) Registerput() {
+
+	var model RegisteModel
+	var jsonblob = this.Ctx.Input.RequestBody
+	json.Unmarshal(jsonblob, &model)
+	var errinfo ErrorInfo
+
+	var user userRole.Base_User
+	user.Username = model.Username
+	user.Realname = model.Companyname
+	//	this.ParseForm(&user) //去页面数值
+	svc := company.GetCompanyService(utils.DBE)
+	err, comacccode := svc.AddCompany(user.Realname, user.Username) //这两个参数传到company库,返回id
+	if err == nil {
+		svcuser := userRole.GetUserService(utils.DBE)
+		user.AccCode = comacccode //id传到 user库的acccode
+		pass := model.Password    //取到前台密码
+		//更改密码算法2014-11-21
+		pwd, key, errrk := utils.TripleDesEncrypt(pass)
+		if errrk != nil {
+			errinfo.Message = "添加失败!" + utils.AlertProcess(errrk.Error())
+			errinfo.Code = -2
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+			return
+		}
+		user.Roleid = 10000120 //企业用户
+		user.Auditstatus = 1
+		user.Userpassword = pwd
+		user.Publickey = key
+		user.Email = user.Username
+		err = svcuser.AddUser(&user)
+
+		//svcSampleOrgan := sampleorgan.GetSampleOrganService(utils.DBE)
+		//var entityOrgan sampleorgan.SampleOrgan
+		//entityOrgan.AccCode = comacccode
+		//entityOrgan.TNode = "SystemInner"
+		//entityOrgan.TNodeParent = "0"
+		//entityOrgan.Item = 1
+		//entityOrgan.Code = "ALL"
+		//entityOrgan.Name = "全部"
+		//entityOrgan.CreateBy = user.Username
+		//entityOrgan.CreateUserId = user.Id
+		//_, err = svcSampleOrgan.InsertEntity(&entityOrgan)
+		svcPrintScheme := printscheme.GetPrintSchemeService(utils.DBE)
+		var listPrintScheme []printscheme.PrintScheme
+		var listPrintScheme_new []printscheme.PrintScheme
+		listPrintScheme = svcPrintScheme.GetPrintSchemeList("IsSystem=2")
+		for i := 0; i < len(listPrintScheme); i++ {
+			listPrintScheme[i].IsSystem = 1
+			listPrintScheme[i].CreateBy = user.Username
+			listPrintScheme[i].CreateUserId = user.Id
+			listPrintScheme[i].AccCode = user.AccCode
+			listPrintScheme_new = append(listPrintScheme_new, listPrintScheme[i])
+		}
+		svc.InsertEntity(&listPrintScheme_new)
+		if err == nil {
+			//创建表结构
+			err := svc.CreateSampleDonorTable(user.AccCode, model.Source)
+			if err != nil {
+				fmt.Println(err.Error())
+			}
+			//写入账户信息,赠送短信
+			var accountinfo accountinfo.AccountInfo
+			accountinfo.ProjectSourse = "biobank"
+			accountinfo.ProjectAccount = user.AccCode
+			accountinfo.ProjectAccountName = user.Realname
+			accountinfo.SurplusCount = 50
+			accountinfo.ActionType = "sms"
+			u, p := this.GetuAndp()
+			strUrl := utils.Cfg.MustValue("server", "apiurl") + "/accountinfos/?u=" + u + "&p=" + p
+			Apipost(strUrl, "POST", accountinfo)
+
+			//添加一条组织根节点
+			var entityorg organize.Base_Organize
+			// 编辑后添加一条数据
+			entityorg.Fullname = model.Companyname
+			entityorg.Parentid = 0
+			entityorg.Createuserid = user.Id
+			entityorg.Createby = user.Realname
+			entityorg.AccCode = user.AccCode
+			svcuser.InsertEntity(&entityorg)
+
+			//修改用户的组织id
+			user.Departmentid = utils.ToStr(entityorg.Id)
+			user.Departmentname = entityorg.Fullname
+			var usercols []string = []string{"Departmentid", "Departmentname"}
+			svcuser.UpdateEntityByIdCols(user.Id, &user, usercols)
+
+			errinfo.Message = "注册用户成功!"
+			errinfo.Code = 0
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+		} else {
+			errinfo.Message = "注册失败!" + utils.AlertProcess(err.Error())
+			errinfo.Code = -2
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+			return
+		}
+	} else {
+		errinfo.Message = "注册失败!" + utils.AlertProcess(err.Error())
+		errinfo.Code = -3
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+
+}

+ 6 - 0
src/dashoo.cn/backend/api/routers/router.go

@@ -288,6 +288,12 @@ func init() {
 				&oilsupplier.WinningController{},
 			),
 		),
+		//工作流
+		beego.NSNamespace("/workflow",
+			beego.NSInclude(
+				&workflow.WorkflowController{},
+			),
+		),
 	)
 	beego.AddNamespace(ns)
 }

+ 141 - 165
src/dashoo.cn/frontend_web/src/pages/login3.vue

@@ -1,87 +1,38 @@
 <template>
-  <div class="login-body">
-    <el-container>
-      <el-header style="height:100px">
-        <div style="top: 18px; position: relative;">
-          <img src="../assets/img/title_gongfang.png">
-        </div>
-      </el-header>
-      <el-main style="height:700px;">
-        <el-container>
-          <el-main style="height:650px; padding:5px 20px 0 15px; background-color: #D3DCE6;">
-            <div>
-              <div style="height:250px; background-color: white;">
-                <div style="padding: 10px 0 0 15px;"><img src="../assets/img/tongzhigonggao.jpg" alt="通知公告" style="height: 40px; width: 100px;"></div>
-                <div>
-                  <template>
-                    <el-table :data="noticeList" style="width: 100%" max-height="200" >
-                      <el-table-column prop="Name" label="通知标题" width="450">
-                        <template slot-scope="scope">
-                          <i class="el-icon-caret-right"></i>
-                          <span style="margin-left: 5px">{{ scope.row.Name }}</span>
-                        </template>
-                      </el-table-column>
-                      <el-table-column prop="CreateOn" label="时间" width="141">
-                        <template slot-scope="scope">
-                          {{ jstimehandle(scope.row.CreateOn+'') }}
-                        </template>
-                      </el-table-column>
-                    </el-table>
-                  </template>
-                </div>
-              </div>
-              <div style="height:250px; background-color: white; margin: 20px 0 0 0;">
-                <div style="padding: 10px 0 0 15px;"><img src="../assets/img/ziliaoxiazai.jpg" alt="资料下载" style="height: 40px; width: 100px;"></div>
-                <div>
-                  <!-- <ul type="circle">
-                    <li v-for="item in fileList" :key="item">
-                      {{ item.Name }} <a style="font-weight: 400; font-size: 10px;">({{ jstimehandle(item.CreateOn) }})</a>
-                    </li>
-                  </ul> -->
-                  <template>
-                    <el-table :data="fileList" style="width: 100%" max-height="200" @row-click="DownloadFile">
-                      <el-table-column prop="Name" label="文件名" width="450">
-                        <template slot-scope="scope">
-                          <i class="el-icon-caret-right"></i>
-                          <a style="margin-left: 5px">{{ scope.row.Name }}</a>
-                        </template>
-                      </el-table-column>
-                      <el-table-column prop="CreateOn" label="时间" width="141">
-                        <template slot-scope="scope">
-                          {{ jstimehandle(scope.row.CreateOn+'') }}
-                        </template>
-                      </el-table-column>
-                    </el-table>
-                  </template>
-                </div>
-              </div>
-            </div>
-          </el-main>
-          <el-aside style="height:650px; width:300px;">
-            <div style="padding: 5px 10px 0 0;">
-              <el-form auto-complete="off" :model="model" :rules="rules" ref="user" label-position="top">
-                <p style="font-size: 20px; margin: 15px 0 5px 0; font-weight: 500;">登录</p>
-                <el-form-item label="用户名" prop="username" style="text-align:left;">
-                  <el-input type="text" v-model="model.username" placeholder="请输入用户名">
-                    <el-select v-model="loginMode" slot="append" placeholder="登录类型" style="width: 110px;">
-                      <el-option label="普通账户" :value="1"></el-option>
-                      <el-option label="PTR认证" :value="2"></el-option>
-                    </el-select>
-                  </el-input>
-                </el-form-item>
-                <el-form-item label="密码" prop="password" style="text-align:left;">
-                  <el-input type="password" v-model="model.password" placeholder="请输入密码" @keyup.enter.native="login()" />
-                </el-form-item>
-                <el-button type="primary" :loading="loading" @click="login()" style="width:100px">{{ loading ? '登录中...' : '登录' }}</el-button>
-              </el-form>
-            </div>
-          </el-aside>
-        </el-container>
-      </el-main>
-      <el-footer style="height:30px; font-size:10px; padding: 7px;">
-        <div>©大港油田信息中心 版权所有</div>
-      </el-footer>
-    </el-container>
+
+  <div style="height: calc(100vh); width: 100%; background-color:#FFFFFF" >
+    <img src="../assets/img/title_gongfang.png" style="height:60px; margin-top: 20px;margin-left: 100px;"  >
+    <div class="back-width">
+      <div class="login-body">
+        <section class="login">
+          <!--<header class="login-header">
+            <h1 style="text-align:center;margin-top:70px;margin-bottom:40px;"><router-link to="/"><img src="../assets/img/logo.png" style="height:80px;"></router-link></h1>
+            <el-alert v-if="error" :title="error.title" type="warning" :description="error.message" show-icon/>
+          </header>-->
+          <el-form class="login-form" auto-complete="off" :model="model" :rules="rules" ref="user" label-position="top">
+            <h2 class="heading">登录</h2>
+            <el-form-item label="用户名" prop="username">
+              <el-input type="text" v-model="model.username" placeholder="请输入用户名">
+                <el-select v-model="loginMode" slot="append" placeholder="登录类型" style="width: 110px;">
+                  <el-option label="普通账户" :value="1"></el-option>
+                  <el-option label="PTR认证" :value="2"></el-option>
+                </el-select>
+              </el-input>
+            </el-form-item>
+            <el-form-item label="密码" prop="password">
+              <el-input type="password" v-model="model.password" placeholder="请输入密码" @keyup.enter.native="login()" />
+            </el-form-item>
+            <el-button type="primary" :loading="loading" @click="login()">{{ loading ? '登录中...' : '登录' }}</el-button>
+          </el-form>
+
+        </section>
+      </div>
+    </div>
+    <div >
+      <footer class="login-footer" style="color:#A9A9A9">
+        ©大港油田信息中心 版权所有
+      </footer>
+    </div>
   </div>
 </template>
 
@@ -90,10 +41,14 @@
   import Component from 'class-component'
   @Component({
     data() {
+      // form model
+      // TODO: remove default values
       const model = {
         username: '',
         password: ''
       }
+
+      // form validate rules
       const rules = {
         username: [{
           required: true,
@@ -106,69 +61,12 @@
       }
 
       return {
-        noticeList: [], //通知列表
-        fileList: [], //文档列表
         loginMode: 1,
         model: model,
         rules: rules,
         error: null,
         loading: false
       }
-    },
-    created() {
-      this.initNoticeListData()
-      this.initFileListData()
-    },
-    methods: {
-      //获取通知列表
-      initNoticeListData() {
-        let _this = this
-        //传递列名
-        const params = {
-          colName: "NoticeTab"
-        }
-        _this.$axios.get("/document/getdocumentnameandtime", {params})
-          .then(function (response) {
-            _this.noticeList = response.data
-          })
-          .catch(function (error) {
-            console.log(error);
-          });
-      },
-      //获取文件列表
-      initFileListData() {
-        let _this = this
-        //传递列名
-        const params = {
-          colName: "DocTab"
-        }
-        _this.$axios.get("/document/getdocumentnameandtime", {params})
-          .then(function (response) {
-            _this.fileList = response.data
-          })
-          .catch(function (error) {
-            console.log(error);
-          });
-      },
-      //下载文件
-      DownloadFile(row){
-        let val = row.FileURL
-        let urlArr = val.split('|')
-        location.href = "http://" + urlArr[0]
-      },
-      //格式化时间
-      jstimehandle(val) {
-        if (val === '') {
-          return '----'
-        } else if (val === '0001-01-01T08:00:00+08:00') {
-          return '----'
-        } else if (val === '5000-01-01T23:59:59+08:00') {
-          return '永久'
-        } else {
-          val = val.replace('T', ' ')
-          return val.substring(0, 10)
-        }
-      }
     }
   })
   export default class Login extends Vue {
@@ -186,7 +84,7 @@
                 password: this.model.password.replace(/(^\s*)|(\s*$)/g, "")
               }
             })
-            if (process.env.appclient == 'gfgl') {
+            if (process.env.appclient == 'lims') {
               this.$router.push(this.$route.query.page || '/')
             } else if (process.env.appclient == 'cellbank') {
               this.$router.push(this.$route.query.page || '/indexdqm')
@@ -195,6 +93,7 @@
             }
           }
         } catch (e) {
+          // this.$message.warning(e.message)
           this.$message.warning('账号或密码错误')
         } finally {
           this.logging = false
@@ -209,39 +108,116 @@
 </script>
 
 <style lang="scss">
-  .el-header {
-    background-color: white;
-    text-align: center;
-    opacity:0.8;
-  }
-  
-  .el-main {
-    background-color: #E9EEF3;
-    color: #333;
-     opacity:0.9;
-  }
-
-  .el-aside {
-    background-color: #D3DCE6;
-    color: #333;
-    text-align: center;
-  }
+  @import '../assets/styles/base/variables';
 
-  .el-footer {
-    background-color: #B3C0D1;
-    color: #333;
-    text-align: center;
+  .back-width {
+    background-color: #2F79F6;
+    position: fixed;
+    margin: auto;
+    left: 0;
+    right: 0;
+    top: 88px;
+    width: 100%;
+    height: 550px;
   }
 
   .login-body {
-     background: url("../assets/img/tian.png") no-repeat left 50%;
+
+    background: url("../assets/img/tian.png") no-repeat left 50%;
     font-family: 'Open Sans', sans-serif;
     background-color: #2469E8;
     background-size: cover;
 
+    /*background-size: cover;
+    -webkit-background-size: cover;
+    -moz-background-size: cover;
+    -o-background-size: cover;*/
+    /*min-height: 1050px;*/
+
+    position: absolute;
+
     margin: auto;
-    width: 1000px;
-    height: 1300px;
+    left: -400px;
+    right: 0;
+    bottom: 0;
+    width: 899px;
+    height: 550px;
+    /*
+    top: 0;
+    right: 0;
+    bottom: 0;
+    left: 0;*/
+  }
+
+  .login-footer {
+    font-size: 10px;
+    clear: both;
+    display: block;
+    text-align: center;
+    margin: 0px auto;
+    position: absolute;
+    bottom: 10px;
+    width: 100%;
+
+    a {
+      color: $brand-color;
+    }
+  }
+
+  .login {
+    /*flex: 1;
+    width: 100%;*/
+    position: relative;
+    max-width: 22rem;
+    top: 60px;
+    left: 850px;
+    font-size: 0.875rem;
+    opacity: 0.9;
+
+    &-header {
+      margin-bottom: 1rem;
+
+      .brand {
+        margin: 4.5rem 0 3.5rem;
+        text-align: center;
+        letter-spacing: 0.125rem;
+
+        a {
+          margin: 0;
+          color: $brand-color;
+          font: 300 3rem sans-serif;
+
+          &:hover {
+            color: $brand-hover-color;
+            text-shadow: 0 0 1rem $brand-hover-color;
+          }
+        }
+      }
+    }
+
+    &-form {
+      margin-bottom: 2.5rem;
+      padding: 1.875rem 1.25rem;
+      background: $login-form-background;
+      color: $login-form-color;
+
+      .heading {
+        margin: 0 0 1rem;
+        font-weight: 400;
+        font-size: 1.5rem;
+      }
+
+      .el-button {
+        margin-top: 0.5rem;
+        width: 100%;
+      }
+    }
+
+
+  }
+
+  .nuxt-progress {
+    display: none;
   }
 
 </style>