Parcourir la source

检测计划-检测任务

yuedefeng il y a 6 ans
Parent
commit
ba73a62149

+ 33 - 0
src/dashoo.cn/backend/api/business/limsentrustequipment/limsentrustequipment.go

@@ -0,0 +1,33 @@
+package limsentrustequipment
+
+import (
+	"time"
+)
+
+type LimsEntrustEquipment struct {
+	Id               int       `json:"Id" xorm:"not null pk autoincr INT(10) 'Id'"`
+	EntrustMainId    int       `json:"EntrustMainId" xorm:"comment('计划或任务表ID') INT(10) 'EntrustMainId'"`
+	DepartmentId     int       `json:"DepartmentId" xorm:"comment('二级单位ID') INT(10) 'DepartmentId'"`
+	DepartmentName   string    `json:"DepartmentName" xorm:"comment('二级单位名称') VARCHAR(500) 'DepartmentName'"`
+	OrderNo          int       `json:"OrderNo" xorm:"comment('序号') INT(10) 'OrderNo'"`
+	PositionCheckId  int       `json:"PositionCheckId" xorm:"comment('检测地点ID') INT(11) 'PositionCheckId'"`
+	PositionCheck    string    `json:"PositionCheck" xorm:"comment('检测地点') VARCHAR(255) 'PositionCheck'"`
+	PositionID       int       `json:"PositionID" xorm:"comment('安装位置ID') INT(11) 'PositionID'"`
+	Position         string    `json:"Position" xorm:"comment('安装位置') VARCHAR(255) 'Position'"`
+	CustNo           string    `json:"CustNo" xorm:"comment('编号') VARCHAR(255) 'CustNo'"`
+	DeviceName       string    `json:"DeviceName" xorm:"comment('设备名称') VARCHAR(255) 'DeviceName'"`
+	TemplateTypeId   int       `json:"TemplateTypeId" xorm:"comment('模板分类ID') INT(10) 'TemplateTypeId'"`
+	TemplateTypeName string    `json:"TemplateTypeName" xorm:"comment('模板分类名称') VARCHAR(255) 'TemplateTypeName'"`
+	Spec             string    `json:"Spec" xorm:"comment('规格型号') VARCHAR(255) 'Spec'"`
+	SpecId           string    `json:"SpecId" xorm:"comment('规格型号Id') VARCHAR(255) 'SpecId'"`
+	Manufacturer     string    `json:"Manufacturer" xorm:"comment('制造厂家') VARCHAR(255) 'Manufacturer'"`
+	Status           string    `json:"Status" xorm:"comment('产品状态') VARCHAR(255) 'Status'"`
+	Remark           string    `json:"Remark" xorm:"VARCHAR(255) 'Remark'"`
+	CreateOn         time.Time `json:"CreateOn" xorm:"not null DATETIME 'CreateOn'"`
+	CreateUserId     int       `json:"CreateUserId" xorm:"INT(10) 'CreateUserId'"`
+	CreateBy         string    `json:"CreateBy" xorm:"VARCHAR(50) 'CreateBy'"`
+	ModifiedOn       time.Time `json:"ModifiedOn" xorm:"DATETIME 'ModifiedOn'"`
+	ModifiedUserId   int       `json:"ModifiedUserId" xorm:"INT(10) 'ModifiedUserId'"`
+	ModifiedBy       string    `json:"ModifiedBy" xorm:"VARCHAR(50) 'ModifiedBy'"`
+}
+

+ 16 - 0
src/dashoo.cn/backend/api/business/limsentrustequipment/limsentrustequipmentService.go

@@ -0,0 +1,16 @@
+package limsentrustequipment
+
+import (
+	. "dashoo.cn/backend/api/mydb"
+	"github.com/go-xorm/xorm"
+)
+
+type LimsEntrustEquipmentService struct {
+	MyServiceBase
+}
+
+func GetLimsEntrustEquipmentService(xormEngine *xorm.Engine) *LimsEntrustEquipmentService {
+	s := new(LimsEntrustEquipmentService)
+	s.DBE = xormEngine
+	return s
+}

+ 2 - 1
src/dashoo.cn/backend/api/controllers/base.go

@@ -257,7 +257,8 @@ var (
 	LimsPetroleUmPipeName                    string = "LimsReportPetroleumPipe"        //  石油专用管材方钻杆检验记录
 	LimsCertificateName                      string = "LimsCertificate"                //  关联证书表
 	LimsReportOilPipeUltrasonicName          string = "LimsReportOilPipeUltrasonic"    // 石油专用管材油(套)管超声波检测记录
-	LimsCheckEquipmentListName               string = "LimsCheckEquipmentList"         // 石油专用管材油(套)管超声波检测记录
+	LimsCheckEquipmentListName               string = "LimsCheckEquipmentList"         // 二级单位检测设备
+	LimsEntrustEquipmentName               	 string = "LimsEntrustEquipment"           // 检测计划设备列表
 )
 
 //分页信息及数据

+ 7 - 1
src/dashoo.cn/backend/api/controllers/lims/limscheckequipmentlist.go

@@ -50,6 +50,8 @@ func (this *LimsCheckEquipmentListController) GetEntityList() {
 	Manufacturer := this.GetString("Manufacturer")
 	status := this.GetString("Status")
 
+	TemplateTypeId := this.GetString("TemplateTypeId")
+
 	if Id != "" {
 		where = where + " and Id like '%" + Id + "%'"
 	}
@@ -63,7 +65,11 @@ func (this *LimsCheckEquipmentListController) GetEntityList() {
 	}
 
 	if PositionCheckId != "" {
-		where = where + " and PositionCheckId like '%" + PositionCheckId + "%'"
+		where = where + " and PositionCheckId = '" + PositionCheckId + "'"
+	}
+
+	if TemplateTypeId != "" {
+		where = where + " and TemplateTypeId = '" + TemplateTypeId + "'"
 	}
 
 	if PositionCheck != "" {

+ 148 - 1
src/dashoo.cn/backend/api/controllers/lims/limsentrust.go

@@ -1,8 +1,8 @@
 package lims
 
 import (
+	"dashoo.cn/backend/api/business/testtype"
 	"encoding/json"
-	//"fmt"
 	"strconv"
 	"strings"
 	"time"
@@ -32,6 +32,126 @@ type LimsEnturstController struct {
 	BaseController
 }
 
+// @Title 获取委托列表
+// @Description get user by token
+// @Success 200 {object} models.Userblood
+// @router /entrustplanlist [get]
+func (this *LimsEnturstController) GetEntrustPlanList() {
+	var list []limsentrust.LimsEntrustMain
+	//获取分页信息
+	page := this.GetPageInfoForm()
+	entrustno := this.GetString("entrustno")
+	EntrustTypeId := this.GetString("EntrustTypeId")
+	CustomerId := this.GetString("CustomerId")
+	detectsample := this.GetString("detectsample")
+	ReportStatus := this.GetString("ReportStatus")
+	EntrustTime := this.GetString("EntrustTime")
+	ProjectTypeId := this.GetString("ProjectTypeId")
+	DetectSampleId := this.GetString("DetectSampleId")
+	orderby := "EntrustTime"
+	asc := false
+	Order := this.GetString("Order")
+	Prop := this.GetString("Prop")
+	if Order != "" && Prop != "" {
+		orderby = Prop
+		if Order == "asc" {
+			asc = true
+		}
+	}
+
+	userSvc := userRole.GetUserService(utils.DBE)
+	organizeSvc := organize.GetOrganizeService(utils.DBE)
+	departList := organizeSvc.GetChildByTopId(this.User.DepartmentId)
+	//取出当前部门及下级部门的所有用户列表
+	var subUserList []userRole.Base_User
+	whereUser := " 1=1 "
+	whereUser += " and DepartmentId in (" + departList + ")"
+	// whereUser += " and EntrustStatus<0 "
+	userSvc.GetEntities(&subUserList, whereUser)
+	var userIds string
+
+	for _, tmpUser := range subUserList {
+		userIds += strconv.Itoa(tmpUser.Id) + ","
+	}
+	userIds = strings.Trim(userIds, ",")
+
+	where := " 1=1 "
+	where += " AND CreateUserId in (" + userIds + ")"
+
+	if entrustno != "" {
+		where = where + " and EntrustNo like '%" + entrustno + "%'"
+	}
+	if EntrustTypeId != "" {
+		where = where + " and EntrustTypeId = '" + EntrustTypeId + "'"
+	}
+	if ProjectTypeId != "" {
+		where = where + " and ProjectTypeId = '" + ProjectTypeId + "'"
+	}
+	if CustomerId != "" {
+		where = where + " and CustomerId = '" + CustomerId + "'"
+	}
+	if detectsample != "" {
+		where = where + " and DetectSample like '%" + detectsample + "%'"
+	}
+	if ReportStatus != "" {
+		where = where + " and ReportStatus = '" + ReportStatus + "'"
+	}
+	if DetectSampleId != "" {
+		where = where + " and DetectSampleId = '" + DetectSampleId + "'"
+	}
+	if EntrustTime != "" {
+		dates := strings.Split(EntrustTime, ",")
+		if len(dates) == 2 {
+			minDate := dates[0]
+			maxDate := dates[1]
+			where = where + " and EntrustTime>='" + minDate + "' and EntrustTime<='" + maxDate + "'"
+		}
+	}
+	var projectTypeIds string
+	projectTypeList := this.TestTypeTreeByOrg()
+	for _, value := range projectTypeList {
+		projectTypeIds += strconv.Itoa(value.Id) + ","
+	}
+	projectTypeIds = strings.TrimRight(projectTypeIds, ",")
+	if len(projectTypeIds) > 0 {
+		where = where + " and ProjectTypeId in (" + projectTypeIds + ")"
+	}
+	svc := limsentrust.GetLimsEnturstService(utils.DBE)
+	total := svc.GetPagingEntitiesWithOrderBytbl(this.User.AccCode, page.CurrentPage, page.Size, orderby, asc, &list, where)
+	var datainfo DataInfo
+	datainfo.Items = list
+	datainfo.CurrentItemCount = total
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
+func (this *LimsEnturstController) TestTypeTreeByOrg() []testtype.TestTemplateModel {
+	var list []testtype.TestTemplateModel
+	svc := testtype.GetTestTypeService(utils.DBE)
+	userSvc := userRole.GetUserService(utils.DBE)
+	curUserInfo := userSvc.GetUserInfoByRealName(this.User.Realname)
+	//取出下级用户
+	var subUserList []userRole.Base_User
+	whereUser := " 1=1 "
+	whereUser += " and CreateUserId = " + strconv.Itoa(curUserInfo.Id)
+	userSvc.GetEntities(&subUserList, whereUser)
+	var userIds string
+
+	for _, tmpUser := range subUserList {
+		userIds += strconv.Itoa(tmpUser.Id) + ","
+	}
+	//上级用户
+	userIds += strconv.Itoa(curUserInfo.Createuserid) + ","
+	//当前登录用户
+	userIds += strconv.Itoa(curUserInfo.Id)
+
+	where := " 1=1 "
+	where += " AND a.CreateUserId in (" + userIds + ")"
+
+	list = svc.GetListWithTemplate(this.User.AccCode+TestPackageTypesName, this.User.AccCode+LimsDocTemplateName, where, "a.Id desc")
+	return list
+}
+
 // @Title 获取委托列表
 // @Description get user by token
 // @Success 200 {object} models.Userblood
@@ -66,6 +186,7 @@ func (this *LimsEnturstController) GetEntrustList() {
 	var subUserList []userRole.Base_User
 	whereUser := " 1=1 "
 	whereUser += " and DepartmentId in (" + departList + ")"
+	whereUser += " and EntrustStatus>=0 "
 	userSvc.GetEntities(&subUserList, whereUser)
 	var userIds string
 
@@ -149,6 +270,15 @@ func (this *LimsEnturstController) AddEntrust() {
 	//	if err == nil {
 	//		this.AddSampleType(strconv.Itoa(model.Id), SampleCode)
 	//	}
+	// 保存设备明细
+	insertEquipmentSQL := "INSERT INTO " + this.User.AccCode + LimsEntrustEquipmentName
+	insertEquipmentSQL += "(Entrustmainid, Departmentid, Departmentname, Orderno, Positioncheckid, Positioncheck, Positionid, Position, Custno, Devicename, Templatetypeid, Templatetypename, Spec, Specid, Manufacturer, Status, Remark, CreateOn, CreateUserId, CreateBy)"
+	insertEquipmentSQL += " SELECT '" + strconv.Itoa(model.Id) + "' as EntrustMainId, Departmentid, Departmentname, Orderno, Positioncheckid, Positioncheck, Positionid, Position, Custno, Devicename, Templatetypeid, Templatetypename, Spec, Specid, Manufacturer, Status, Remark, now() as CreateOn, '" + this.User.Id + "' as CreateUserId, '" + this.User.Realname + "' as CreateBy FROM "
+	insertEquipmentSQL += this.User.AccCode + LimsCheckEquipmentListName
+	insertEquipmentSQL += " WHERE PositionCheckId=" + strconv.Itoa(model.AddressId)
+	insertEquipmentSQL += " and TemplateTypeId=" + strconv.Itoa(model.ProjectTypeId)
+
+	svc.DBE.Exec(insertEquipmentSQL)
 
 	var errinfo ErrorDataInfo
 	if err == nil {
@@ -240,6 +370,23 @@ func (this *LimsEnturstController) GetEntrustInfo() {
 	this.ServeJSON()
 }
 
+// @Title 获取委托单详情
+// @Description 获取委托单详情
+// @Success 200 {object} business.device.DeviceChannels
+// @router /receive/:id [get]
+func (this *LimsEnturstController) ReceiveEntrustInfo() {
+	Id := this.Ctx.Input.Param(":id")
+	var model limsentrust.CustomerEntrustModel
+	svc := limsentrust.GetLimsEnturstService(utils.DBE)
+	sqlUpdate := "update " + this.User.AccCode + LimsEntrustMainName + " set EntrustStatus = '0' where Id='" + Id + "'"
+	svc.DBE.Exec(sqlUpdate)
+
+	this.Data["json"] = &model
+	this.ServeJSON()
+}
+
+
+
 // @Title 分模板统计检测样本数量
 // @Description get user by token
 // @Success 200 {object} models.Userblood

+ 403 - 0
src/dashoo.cn/backend/api/controllers/lims/limsentrustequipment.go

@@ -0,0 +1,403 @@
+package lims
+
+import (
+	"dashoo.cn/backend/api/business/baseUser"
+	"dashoo.cn/backend/api/business/limsentrustequipment"
+	. "dashoo.cn/backend/api/controllers"
+	"dashoo.cn/business/userRole"
+	"dashoo.cn/utils"
+	"encoding/json"
+	"strings"
+	"time"
+)
+
+type LimsEntrustEquipmentController struct {
+	BaseController
+}
+
+// @Title 获取列表
+// @Description get user by token
+// @Success 200 {object} []limsentrustequipment.LimsEntrustEquipment
+// @router /list [get]
+func (this *LimsEntrustEquipmentController) GetEntityList() {
+
+	//获取分页信息
+	page := this.GetPageInfoForm()
+	where := " 1=1 "
+	orderby := "Id"
+	asc := false
+	Order := this.GetString("Order")
+	Prop := this.GetString("Prop")
+	if Order != "" && Prop != "" {
+		orderby = Prop
+		if Order == "asc" {
+			asc = true
+		}
+	}
+	Id := this.GetString("Id")
+	EntrustMainId := this.GetString("EntrustMainId")
+	DepartmentId := this.GetString("DepartmentId")
+	DepartmentName := this.GetString("DepartmentName")
+	OrderNo := this.GetString("OrderNo")
+	PositionCheckId := this.GetString("PositionCheckId")
+	PositionCheck := this.GetString("PositionCheck")
+	PositionID := this.GetString("PositionID")
+	Position := this.GetString("Position")
+	CustNo := this.GetString("CustNo")
+	DeviceName := this.GetString("DeviceName")
+	TemplateTypeId := this.GetString("TemplateTypeId")
+	TemplateTypeName := this.GetString("TemplateTypeName")
+	Spec := this.GetString("Spec")
+	SpecId := this.GetString("SpecId")
+	Manufacturer := this.GetString("Manufacturer")
+	Status := this.GetString("Status")
+	Remark := this.GetString("Remark")
+	CreateOn := this.GetString("CreateOn")
+	CreateUserId := this.GetString("CreateUserId")
+	CreateBy := this.GetString("CreateBy")
+	ModifiedOn := this.GetString("ModifiedOn")
+	ModifiedUserId := this.GetString("ModifiedUserId")
+	ModifiedBy := this.GetString("ModifiedBy")
+
+	if Id != "" {
+		where = where + " and Id like '%" + Id + "%'"
+	}
+
+
+	if EntrustMainId != "" {
+		where = where + " and EntrustMainId like '%" + EntrustMainId + "%'"
+	}
+
+
+	if DepartmentId != "" {
+		where = where + " and DepartmentId like '%" + DepartmentId + "%'"
+	}
+
+
+	if DepartmentName != "" {
+		where = where + " and DepartmentName like '%" + DepartmentName + "%'"
+	}
+
+
+	if OrderNo != "" {
+		where = where + " and OrderNo like '%" + OrderNo + "%'"
+	}
+
+
+	if PositionCheckId != "" {
+		where = where + " and PositionCheckId like '%" + PositionCheckId + "%'"
+	}
+
+
+	if PositionCheck != "" {
+		where = where + " and PositionCheck like '%" + PositionCheck + "%'"
+	}
+
+
+	if PositionID != "" {
+		where = where + " and PositionID like '%" + PositionID + "%'"
+	}
+
+
+	if Position != "" {
+		where = where + " and Position like '%" + Position + "%'"
+	}
+
+
+	if CustNo != "" {
+		where = where + " and CustNo like '%" + CustNo + "%'"
+	}
+
+
+	if DeviceName != "" {
+		where = where + " and DeviceName like '%" + DeviceName + "%'"
+	}
+
+
+	if TemplateTypeId != "" {
+		where = where + " and TemplateTypeId like '%" + TemplateTypeId + "%'"
+	}
+
+
+	if TemplateTypeName != "" {
+		where = where + " and TemplateTypeName like '%" + TemplateTypeName + "%'"
+	}
+
+
+	if Spec != "" {
+		where = where + " and Spec like '%" + Spec + "%'"
+	}
+
+
+	if SpecId != "" {
+		where = where + " and SpecId like '%" + SpecId + "%'"
+	}
+
+
+	if Manufacturer != "" {
+		where = where + " and Manufacturer like '%" + Manufacturer + "%'"
+	}
+
+
+	if Status != "" {
+		where = where + " and Status like '%" + Status + "%'"
+	}
+
+
+	if Remark != "" {
+		where = where + " and Remark like '%" + Remark + "%'"
+	}
+
+
+	if CreateOn != "" {
+		where = where + " and CreateOn like '%" + CreateOn + "%'"
+	}
+
+
+	if CreateUserId != "" {
+		where = where + " and CreateUserId like '%" + CreateUserId + "%'"
+	}
+
+
+	if CreateBy != "" {
+		where = where + " and CreateBy like '%" + CreateBy + "%'"
+	}
+
+
+	if ModifiedOn != "" {
+		where = where + " and ModifiedOn like '%" + ModifiedOn + "%'"
+	}
+
+
+	if ModifiedUserId != "" {
+		where = where + " and ModifiedUserId like '%" + ModifiedUserId + "%'"
+	}
+
+
+	if ModifiedBy != "" {
+		where = where + " and ModifiedBy like '%" + ModifiedBy + "%'"
+	}
+
+
+	if CreateOn != "" {
+		dates := strings.Split(CreateOn, ",")
+		if len(dates) == 2 {
+			minDate := dates[0]
+			maxDate := dates[1]
+			where = where + " and CreateOn>='" + minDate + "' and CreateOn<='" + maxDate + "'"
+		}
+	}
+
+	svc := limsentrustequipment.GetLimsEntrustEquipmentService(utils.DBE)
+	var list []limsentrustequipment.LimsEntrustEquipment
+	total := svc.GetPagingEntitiesWithOrderBytbl(this.User.AccCode, page.CurrentPage, page.Size, orderby, asc, &list, where)
+	var datainfo DataInfo
+	datainfo.Items = list
+	datainfo.CurrentItemCount = total
+	datainfo.PageIndex = page.CurrentPage
+	datainfo.ItemsPerPage = page.Size
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
+// @Title 获取字典列表
+// @Description get user by token
+// @Success 200 {object} map[string]interface{}
+// @router /dictlist [get]
+func (this *LimsEntrustEquipmentController) GetDictList() {
+	dictList := make(map[string]interface{})
+	//dictSvc := items.GetItemsService(utils.DBE)
+	userSvc := baseUser.GetBaseUserService(utils.DBE)
+	//customerSvc := svccustomer.GetCustomerService(utils.DBE)
+	//dictList["WellNo"] = dictSvc.GetKeyValueItems("WellNo", this.User.AccCode)
+	var userEntity userRole.Base_User
+	userSvc.GetEntityById(this.User.Id, &userEntity)
+	dictList["Supervisers"] = userSvc.GetUserListByDepartmentId(this.User.AccCode, userEntity.Departmentid)
+
+	//var dictCustomer []svccustomer.Customer
+	//customerSvc.GetEntitysByWhere(this.User.AccCode + CustomerName, "", &dictCustomer)
+	//dictList["EntrustCorp"] = &dictCustomer
+
+	var datainfo DataInfo
+	datainfo.Items = dictList
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
+// @Title 获取实体
+// @Description 获取实体
+// @Success 200 {object} limsentrustequipment.LimsEntrustEquipment
+// @router /get/:id [get]
+func (this *LimsEntrustEquipmentController) GetEntity() {
+	Id := this.Ctx.Input.Param(":id")
+
+	var model limsentrustequipment.LimsEntrustEquipment
+	svc := limsentrustequipment.GetLimsEntrustEquipmentService(utils.DBE)
+	svc.GetEntityByIdBytbl(this.User.AccCode+LimsEntrustEquipmentName, Id, &model)
+
+	this.Data["json"] = &model
+	this.ServeJSON()
+}
+
+// @Title 添加
+// @Description 新增
+// @Param 	body body limsentrustequipment.LimsEntrustEquipment
+// @Success	200	{object} controllers.Request
+// @router /add [post]
+func (this *LimsEntrustEquipmentController) AddEntity() {
+	var model limsentrustequipment.LimsEntrustEquipment
+	var jsonBlob = this.Ctx.Input.RequestBody
+	svc := limsentrustequipment.GetLimsEntrustEquipmentService(utils.DBE)
+
+	json.Unmarshal(jsonBlob, &model)
+	model.CreateOn = time.Now()
+	model.CreateBy = this.User.Realname
+	model.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+
+	_, err := svc.InsertEntityBytbl(this.User.AccCode+LimsEntrustEquipmentName, &model)
+
+	var errinfo ErrorDataInfo
+	if err == nil {
+		//新增
+		errinfo.Message = "添加成功!"
+		errinfo.Code = 0
+		errinfo.Item = model.Id
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "添加失败!" + utils.AlertProcess(err.Error())
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
+}
+
+// @Title 修改实体
+// @Description 修改实体
+// @Param 	body body limsentrustequipment.LimsEntrustEquipment
+// @Success	200	{object} controllers.Request
+// @router /update/:id [post]
+func (this *LimsEntrustEquipmentController) UpdateEntity() {
+	id := this.Ctx.Input.Param(":id")
+	var errinfo ErrorInfo
+	if id == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+
+	var model limsentrustequipment.LimsEntrustEquipment
+	svc := limsentrustequipment.GetLimsEntrustEquipmentService(utils.DBE)
+
+	var jsonBlob = this.Ctx.Input.RequestBody
+	json.Unmarshal(jsonBlob, &model)
+	model.ModifiedOn = time.Now()
+	model.ModifiedBy = this.User.Realname
+	model.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
+
+	cols := []string{
+
+		"Id",
+
+		"EntrustMainId",
+
+		"DepartmentId",
+
+		"DepartmentName",
+
+		"OrderNo",
+
+		"PositionCheckId",
+
+		"PositionCheck",
+
+		"PositionID",
+
+		"Position",
+
+		"CustNo",
+
+		"DeviceName",
+
+		"TemplateTypeId",
+
+		"TemplateTypeName",
+
+		"Spec",
+
+		"SpecId",
+
+		"Manufacturer",
+
+		"Status",
+
+		"Remark",
+
+		"CreateOn",
+
+		"CreateUserId",
+
+		"CreateBy",
+
+		"ModifiedOn",
+
+		"ModifiedUserId",
+
+		"ModifiedBy",
+
+
+	}
+	err := svc.UpdateEntityBytbl(this.User.AccCode+LimsEntrustEquipmentName, id, &model, cols)
+	if err == nil {
+		errinfo.Message = "修改成功!"
+		errinfo.Code = 0
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "修改失败!" + utils.AlertProcess(err.Error())
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
+}
+
+// @Title 删除单条信息
+// @Description
+// @Success 200 {object} ErrorInfo
+// @Failure 403 :id 为空
+// @router /delete/:Id [delete]
+func (this *LimsEntrustEquipmentController) DeleteEntity() {
+	Id := this.Ctx.Input.Param(":Id")
+	var errinfo ErrorInfo
+	if Id == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+	var model limsentrustequipment.LimsEntrustEquipment
+	var entityempty limsentrustequipment.LimsEntrustEquipment
+	svc := limsentrustequipment.GetLimsEntrustEquipmentService(utils.DBE)
+	opdesc := "删除-" + Id
+	err := svc.DeleteOperationAndWriteLogBytbl(this.User.AccCode+LimsEntrustEquipmentName, BaseOperationLogName, Id, &model, &entityempty, utils.ToStr(this.User.Id), this.User.Username, opdesc, this.User.AccCode, "钻井日报")
+
+	// 删除任务设备子表
+	insertEquipmentSQL := "DELETE FROM " + this.User.AccCode + LimsEntrustEquipmentName
+	insertEquipmentSQL += " WHERE EntrustMainId='" + Id + "'"
+	svc.DBE.Exec(insertEquipmentSQL)
+
+	if err == nil {
+		errinfo.Message = "删除成功"
+		errinfo.Code = 0
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Message = "删除失败!" + utils.AlertProcess(err.Error())
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
+}

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

@@ -569,6 +569,12 @@ func init() {
 				&lims.LimsCheckEquipmentListController{},
 			),
 		),
+		// 任务计划对应设备列表
+		beego.NSNamespace("/limsentrustequipment",
+			beego.NSInclude(
+				&lims.LimsEntrustEquipmentController{},
+			),
+		),
 	)
 	beego.AddNamespace(ns)
 }

+ 41 - 0
src/dashoo.cn/frontend_web/src/api/lims/entrustEquipment.js

@@ -0,0 +1,41 @@
+export default {
+  getList (CreateOn, params, myAxios) {
+    return myAxios({
+      url: '/limsentrustequipment/list?CreateOn='+ CreateOn,
+      method: 'GET',
+      params: params
+    })
+  },
+  getDictList (myAxios) {
+    return myAxios({
+      url: '/limsentrustequipment/dictlist/',
+      method: 'GET'
+    })
+  },
+  getEntity (entityId, myAxios) {
+    return myAxios({
+      url: '/limsentrustequipment/get/'+entityId,
+      method: 'GET',
+    })
+  },
+  addEntity (formData, myAxios) {
+    return myAxios({
+      url: '/limsentrustequipment/add',
+      method: 'post',
+      data: formData
+    })
+  },
+  updateEntity (entityId, formData, myAxios) {
+    return myAxios({
+      url: '/limsentrustequipment/update/'+entityId,
+      method: 'post',
+      data: formData
+    })
+  },
+  deleteEntity (entityId, myAxios) {
+    return myAxios({
+      url: '/limsentrustequipment/delete/'+entityId,
+      method: 'delete'
+    })
+  }
+}

+ 6 - 9
src/dashoo.cn/frontend_web/src/api/lims/limsentrust.js

@@ -1,23 +1,20 @@
 /*import axios from 'axios';*/
 export default {
   entrustList(EntrustTime, params, myAxios) {
-    /*return myAxios.get('/limsentrust/entrustlist?EntrustTime=' + EntrustTime, {
-      params
-    })*/
     return myAxios({
       url: '/limsentrust/entrustlist?EntrustTime=' + EntrustTime,
       method: 'GET',
       params: params
-    });
+    })
   },
 
-  /*queryList(query, myAxios) {
+  entrustPlanList(EntrustTime, params, myAxios) {
     return myAxios({
-      url: '/staffAttendanceRule/selectCondition',
-      method: 'post',
-      data: JSON.stringify(query)
+      url: '/limsentrust/entrustplanlist?EntrustTime=' + EntrustTime,
+      method: 'GET',
+      params: params
     });
-  },*/
+  },
 
   addEntrust(mainForm, myAxios) {
     return myAxios({

+ 4 - 6
src/dashoo.cn/frontend_web/src/pages/lims/checkequipmentlist/index.vue

@@ -1,5 +1,3 @@
-
-
 <template>
   <div>
     <!--<el-breadcrumb class="heading">
@@ -32,10 +30,10 @@
         </el-form>
       </div>
       <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
-        <el-table-column label="操作" min-width="100" align="center" fixed>
+        <el-table-column label="操作" width="160px" align="center" fixed>
           <template slot-scope="scope">
-            <el-button type="text" title="编辑" size="small" icon="el-icon-edit" @click="ShowEntityDialog(scope.row.Id)"></el-button>
-            <el-button size="small" style="margin-left:10px;" type="text" icon="el-icon-delete" title="删除" @click="deleteConfirm(scope.row)"></el-button>
+            <el-button type="primary" title="编辑" size="small" plain @click="ShowEntityDialog(scope.row.Id)">编辑</el-button>
+            <el-button type="plain" plain title="删除" size="small" style="margin-left:10px;" @click="deleteConfirm(scope.row)">删除</el-button>
           </template>
         </el-table-column>
 
@@ -165,7 +163,7 @@
         authUser: 'authUser'
       })
     },
-    name: 's5ovelimscheckequipmentlist',
+    name: 'CheckEquipmentList',
 
     data() {
       return {

+ 3 - 31
src/dashoo.cn/frontend_web/src/pages/lims/secondunitform/index.vue

@@ -67,37 +67,7 @@
         </el-tab-pane>
 
         <el-tab-pane label="设备列表" name="2">
-          <div>
-            <el-button type="primary" size="mini">新增设备</el-button>
-            <el-table
-              :data="tableData2"
-              stripe
-              style="width: 100%">
-              <el-table-column
-                prop="seqNo"
-                label="序号"
-              >
-              </el-table-column>
-              <el-table-column
-                prop="name"
-                label="设备分类"
-              >
-              </el-table-column>
-              <el-table-column
-                prop="address"
-                label="地点名称"
-                width="180">
-              </el-table-column>
-              <el-table-column
-                prop="address2"
-                label="设备厂家">
-              </el-table-column>
-              <el-table-column
-                prop="address3"
-                label="设备型号">
-              </el-table-column>
-            </el-table>
-          </div>
+          <check-equipment-list></check-equipment-list>
         </el-tab-pane>
       </el-tabs>
 
@@ -113,11 +83,13 @@
 
   import api from '@/api/lims/customerposition'
   import CustomerPosition from '../principal/subdata/customerposition'
+  import CheckEquipmentList from '../checkequipmentlist/index'
 
   export default {
     name: 'labsetingadd',
     components: {
       CustomerPosition,
+      CheckEquipmentList
     },
     data() {
       return {

+ 147 - 85
src/dashoo.cn/frontend_web/src/pages/lims/taskplan/_opera/operation.vue

@@ -21,9 +21,12 @@
         </el-breadcrumb>
 
         <span style="float: right;">
+          <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px" :disabled="mainForm.EntrustStatus >= 0"
+                     @click="ReceiveEntrustNo">接收计划</el-button>
 
-          <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px" v-if="mainForm.EntrustStatus == 0"
+          <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px" :disabled="mainForm.EntrustStatus >= 0"
                      @click="trueEntrustNo">保存</el-button>
+
           <router-link :to="'/lims/taskplan'">
             <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px">返回</el-button>
           </router-link>
@@ -155,13 +158,31 @@
 
       </el-form>
 
-      <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
-        <el-table-column v-for="column in tableColumns" :key="column.Id"
-                         v-if="column.prop != 'CreateOn'" :prop="column.prop" sortable min-width="100" :label="column.label" align="center" show-overflow-tooltip></el-table-column>
-      </el-table>
-      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
-                     :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
-      </el-pagination>
+      <div v-if="mainForm.Id <= 0">
+        <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
+          <el-table-column v-for="column in tableColumns" :key="column.Id"
+                           v-if="column.prop != 'CreateOn'" :prop="column.prop" sortable min-width="100" :label="column.label" align="center" show-overflow-tooltip></el-table-column>
+        </el-table>
+        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+                       :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
+        </el-pagination>
+      </div>
+
+      <div v-if="mainForm.Id > 0">
+        <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
+          <el-table-column label="操作" width="100px" fixed>
+            <template slot-scope="scope">
+              <el-button type="plain" plain size="mini" @click="delEntrustEquipment(scope.row.Id)">删除</el-button>
+            </template>
+          </el-table-column>
+          <el-table-column v-for="column in tableColumns" :key="column.Id"
+                           v-if="column.prop != 'CreateOn'" :prop="column.prop" sortable min-width="100" :label="column.label" align="center" show-overflow-tooltip></el-table-column>
+        </el-table>
+        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+                       :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
+        </el-pagination>
+      </div>
+
     </el-card>
   </div>
 </template>
@@ -170,10 +191,10 @@
   import {
     mapGetters
   } from 'vuex'
-  import axios from "../../../../../.nuxt/axios"
   import docTemplateApi from '@/api/lims/docTemplate'
-  import entrustApi from "@/api/lims/limsentrust"
+  import entrustApi from '@/api/lims/limsentrust'
   import checkEquipmentApi from '@/api/lims/limscheckequipmentlist'
+  import entrustEquipmentApi from '@/api/lims/entrustEquipment'
   export default {
     computed: {
       ...mapGetters({
@@ -181,21 +202,19 @@
       })
     },
     name: 'limsentrustdetail',
-    data() {
+    data () {
       return {
-        //ln
         typevalue: [],
         EntrustSampleId: '',
-        //ln
         currentPage: 1,
         size: 10,
         currentItemCount: 0,
-        pagetitle: '', //界面标题
+        pagetitle: '', // 界面标题
         ServiceId: '',
         Id: '',
-        //样本单位
+        // 样本单位
         sampeunitlist: [],
-        //委托方名称
+        // 委托方名称
         customerList: [],
         groupOptions: [{
           label: '大港油田',
@@ -206,13 +225,13 @@
         }],
         addressList: [],
         CusAddList: [],
-        projectTypeList: [], //检测报告大项
-        sampleTypeList: [], //检测项目小项,样品名称列表
+        projectTypeList: [], // 检测报告大项
+        sampleTypeList: [], // 检测项目小项,样品名称列表
         sampleTypeTreeList: [],
         selectedorg: [],
-        //详情
+        // 详情
         testdetails: [],
-        //检测类型
+        // 检测类型
         testtypes: [],
 
         orgtreeprops: {
@@ -221,9 +240,9 @@
           children: 'children'
         },
         sampleTypeOrigList: [],
-        testTypeList: [], //检测类型
-        entypeList: [], //委托类型
-        departmentList: [], //特检站下属部门
+        testTypeList: [], // 检测类型
+        entypeList: [], // 委托类型
+        departmentList: [], // 特检站下属部门
         departmentId: '',
         templatecode: '',
         tjz: false,
@@ -262,7 +281,7 @@
           ISreveive: 0,
           ReveiveNum: 0.0,
           DataTemplateId: 0,
-          DataTemplateName: '',
+          DataTemplateName: ''
         },
         tableColumns: [
           {
@@ -345,8 +364,8 @@
           }],
           SampleNum: [{
             type: 'number',
-            message: "样品数量必须为数值",
-            trigger: "blur",
+            message: '样品数量必须为数值',
+            trigger: 'blur',
           }],
         },
         tableData2: [{
@@ -405,11 +424,11 @@
         deliverList: [],
         deliverTitle: '',
         deliver_flag: '',
-        //分页参数
+        // 分页参数
         size: 10,
         currentPage: 1,
         currentItemCount: 0,
-        //列表排序
+        // 列表排序
         Column: {
           Order: '',
           Prop: ''
@@ -444,8 +463,8 @@
         rulesdeliverForm: {
           SampleNum: [{
             type: 'number',
-            message: "样品数量必须为数值",
-            trigger: "blur",
+            message: '样品数量必须为数值',
+            trigger: 'blur',
           }],
           SampleCode: [{
             required: true,
@@ -511,40 +530,49 @@
         },
       }
     },
-    created() {
+    created () {
       this.ServiceId = this.$route.params.opera
       this.departmentId = this.authUser.Profile.DepartmentId
 
-      this.initDeviceList()
-
       this.getCustomerInfo()
       // request
       if (this.ServiceId === 'add') {
         this.pagetitle = '新增检测计划'
-        this.mainForm.EntrustTypeId = 329 //委托检测
+        this.mainForm.EntrustTypeId = 329 // 委托检测
         // this.getEntrustNo()
         // this.testcodec()
       } else if (this.ServiceId != '0') {
         this.pagetitle = '编辑检测计划'
         this.getEntrustInfo()
       }
-      //获取委托类型
+      // 获取委托类型
       this.getEntypeList()
       this.getsamplesnumlist()
       this.getCustomer()
       this.getProjectType()
       this.getSampleTypeOrigList()
       this.getDictList()
-      //判断组织结构
+      // 判断组织结构
       this.getOrganizeListById()
-      this.getPermissions() //权限
+      this.getPermissions() // 权限
     },
     methods: {
-      //验证单号是否唯一
-      trueEntrustNo() {
+      ReceiveEntrustNo () {
         let _this = this
-        if (_this.ServiceId == 'addentrust') {
-          _this.$axios.get("/limsentrust/entrustmakesure?EntrustNo=" + _this.mainForm.EntrustNo, {})
+        _this.$axios.get('/limsentrust/receive/' + _this.mainForm.Id + '?EntrustNo=' + _this.mainForm.EntrustNo, {})
+          .then(function () {
+            _this.getEntrustInfo()
+            _this.$message({
+              type: 'success',
+              message: '接收成功'
+            })
+          })
+      },
+      // 验证单号是否唯一
+      trueEntrustNo () {
+        let _this = this
+        if (_this.ServiceId === 'addentrust') {
+          _this.$axios.get('/limsentrust/entrustmakesure?EntrustNo=' + _this.mainForm.EntrustNo, {})
             .then(function (response) {
               _this.entrustTotal = response.data.items
               if (_this.entrustTotal === 0) {
@@ -560,13 +588,13 @@
           _this.checkField()
         }
       },
-      //检查字段是否为空
-      checkField() {
+      // 检查字段是否为空
+      checkField () {
         let _this = this
-        if (_this.selectedorg && _this.selectedorg.length > 0) { //验证样本
-          if (_this.mainForm.CustomerId && _this.mainForm.CustomerId > 0) { //验证委托方
+        if (_this.selectedorg && _this.selectedorg.length > 0) { // 验证样本
+          if (_this.mainForm.CustomerId && _this.mainForm.CustomerId > 0) { // 验证委托方
             if (!_this.tjz) {
-              if (_this.mainForm.AddressId && _this.mainForm.AddressId > 0) { //验证检测地点
+              if (_this.mainForm.AddressId && _this.mainForm.AddressId > 0) { // 验证检测地点
                 _this.saveEntity()
               } else {
                 _this.$message({
@@ -590,25 +618,37 @@
           })
         }
       },
-      //保存数据
-      saveEntity() {
-        if (this.ServiceId == 'addentrust' || this.ServiceId <= '0') {
+      // 保存数据
+      saveEntity () {
+        if (this.ServiceId === 'add' || this.ServiceId <= '0') {
           this.addEntrust()
         } else {
           this.editEntrust()
         }
       },
 
-      addEntrust() {
+      delEntrustEquipment (val) {
+        let _this = this
+        _this.$confirm("是否要删除关联设备?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          entrustEquipmentApi.deleteEntity(val, _this.$axios).then(function () {
+            _this.initDeviceList()
+          })
+        }).catch(() => {})
+      },
+
+      addEntrust () {
         let _this = this
         this.$refs['mainForm'].validate((valid) => {
           if (valid) {
             _this.mainForm.EntrustStatus = -1
             _this.mainForm.SampleNum = parseFloat(_this.mainForm.SampleNum)
             _this.mainForm.CustomerId = parseInt(_this.mainForm.CustomerId)
-            _this.mainForm.CustomerName = _this.$refs.selectCustomer.selectedLabel + ''
             _this.mainForm.AddressId = parseInt(_this.mainForm.AddressId)
-            if (!_this.tjz && _this.mainForm.AddressId && _this.mainForm.AddressId != 0) {
+            if (!_this.tjz && _this.mainForm.AddressId && _this.mainForm.AddressId !== 0) {
               _this.mainForm.AddressName = _this.$refs.refAddress.selectedLabel + ''
             }
             _this.mainForm.ProjectTypeId = parseInt(_this.mainForm.ProjectTypeId)
@@ -627,7 +667,7 @@
                     message: res.data.message
                   })
                   _this.ServiceId = res.data.item
-                  //刷新一下界面
+                  // 刷新一下界面
                   _this.getEntrustInfo()
                   _this.getpartuserlist(this.mainForm.DataTemplateId)
                 } else {
@@ -646,7 +686,7 @@
           }
         })
       },
-      editEntrust() {
+      editEntrust () {
         let _this = this
         this.$refs['mainForm'].validate((valid) => {
           if (valid) {
@@ -654,9 +694,8 @@
             _this.mainForm.EntrustStatus = parseInt(_this.mainForm.EntrustStatus)
             _this.mainForm.SampleNum = parseInt(_this.mainForm.SampleNum)
             _this.mainForm.CustomerId = parseInt(_this.mainForm.CustomerId)
-            _this.mainForm.CustomerName = _this.$refs.selectCustomer.selectedLabel + ''
             _this.mainForm.AddressId = parseInt(_this.mainForm.AddressId)
-            if (_this.mainForm.AddressId && _this.mainForm.AddressId != 0) {
+            if (_this.mainForm.AddressId && _this.mainForm.AddressId !== 0) {
               _this.mainForm.AddressName = _this.$refs.refAddress.selectedLabel + ''
             }
             _this.mainForm.ProjectTypeId = parseInt(_this.mainForm.ProjectTypeId)
@@ -691,15 +730,11 @@
           }
         })
       },
-      getEntrustInfo() {
+      getEntrustInfo () {
         let _this = this
         this.$axios.get('limsentrust/getentrustinfo/' + _this.ServiceId, {})
           .then(res => {
             _this.mainForm = res.data
-            _this.mainForm.EntrustStatus = _this.mainForm.EntrustStatus + ''
-            if (res.data.EntrustStatus == '1') {
-              _this.status_flag = true
-            }
             _this.mainForm.SampleNum = parseInt(_this.mainForm.SampleNum + '')
             _this.mainForm.EntrustTime = new Date(res.data.EntrustTime)
             _this.mainForm.EndTime = new Date(res.data.EndTime)
@@ -714,12 +749,13 @@
             // }
             _this.getAddress(_this.mainForm.CustomerId)
             _this.getpartuserlist(this.mainForm.DataTemplateId)
+            _this.initDeviceList()
           }).catch(err => {
-          // handle error
-          console.error(err)
-        })
+            // handle error
+            console.error(err)
+          })
       },
-      getSampleNum() {
+      getSampleNum () {
         let _this = this
         this.$axios.get('limsentrust/getsamplenum/' + _this.ServiceId, {})
           .then(res => {
@@ -730,7 +766,7 @@
         })
       },
 
-      saveDetail() {
+      saveDetail () {
         let _this = this
         //负责人姓名
         let tempOfficers = [];
@@ -937,26 +973,48 @@
       },
 
       initDeviceList () {
-        // 分页及列表条件
-        let params = {
-          _currentPage: this.currentPage,
-          _size: this.size,
-          Order: this.Column.Order,
-          Prop: this.Column.Prop,
-          TemplateTypeId: this.mainForm.ProjectTypeId,
-          PositionCheckId: this.mainForm.AddressId
-        }
+        if (this.mainForm.Id <= 0) {
+          let tmpTypeId = 0
+          if (this.mainForm.ProjectTypeId !== '') {
+            tmpTypeId = this.mainForm.ProjectTypeId
+          }
+          // 分页及列表条件
+          let params = {
+            _currentPage: this.currentPage,
+            _size: this.size,
+            Order: this.Column.Order,
+            Prop: this.Column.Prop,
+            TemplateTypeId: tmpTypeId,
+            PositionCheckId: this.mainForm.AddressId
+          }
+          // 访问接口
+          checkEquipmentApi.getList('', params, this.$axios).then(res => {
+            this.entityList = res.data.items
+            this.currentItemCount = res.data.currentItemCount
+          }).catch(err => {
+            console.error(err)
+          })
 
-        //访问接口
-        checkEquipmentApi.getList('', params, this.$axios).then(res => {
-          this.entityList = res.data.items
-          this.currentItemCount = res.data.currentItemCount
-        }).catch(err => {
-          console.error(err)
-        })
+        } else {
+          // 分页及列表条件
+          let params = {
+            _currentPage: this.currentPage,
+            _size: this.size,
+            Order: this.Column.Order,
+            Prop: this.Column.Prop,
+            EntrustMainId: this.mainForm.Id
+          }
+          // 访问接口
+          entrustEquipmentApi.getList('', params, this.$axios).then(res => {
+            this.entityList = res.data.items
+            this.currentItemCount = res.data.currentItemCount
+          }).catch(err => {
+            console.error(err)
+          })
+        }
       },
 
-      //列表排序功能
+      // 列表排序功能
       orderby(column) {
         if (column.order == 'ascending') {
           this.Column.Order = 'asc'
@@ -1050,7 +1108,7 @@
 
       //发送
       transportShow() {
-        if (this.mainForm.DeliverStatus == 0) {
+        if (this.mainForm.DeliverStatus === 0) {
           this.getDeliverNo()
         } else {
           this.getDeliverInfo()
@@ -1211,7 +1269,7 @@
         if (this.ServiceId === 'add') {
           if (this.tjz) {
             for (var i = 0; i < this.projectTypeList.length; i++) {
-              if (this.mainForm.ProjectTypeId == this.projectTypeList[i].Id) {
+              if (this.mainForm.ProjectTypeId === this.projectTypeList[i].Id) {
                 this.templatecode = this.projectTypeList[i].TemplateCode
                 this.getReportNo()
               }
@@ -1396,10 +1454,14 @@
         this.selectedorg = []
         this.getCode()
         this.getSampleType()
+
+        this.currentPage = 1
         this.initDeviceList()
       },
 
       AddressChangeHandler () {
+
+        this.currentPage = 1
         this.initDeviceList()
       },
 

+ 8 - 33
src/dashoo.cn/frontend_web/src/pages/lims/taskplan/index.vue

@@ -44,12 +44,12 @@
       <el-table :data="entrustList" border height="calc(100vh - 230px)" style="width: 100%;" @sort-change="orderby">
         <el-table-column label="操作" width="150" align="center" fixed>
           <template slot-scope="scope">
-            <router-link :to="'/lims/tasksentrust/'+scope.row.Id+'/operation'">
+            <router-link :to="'/lims/taskplan/'+scope.row.Id+'/operation'" :disabled="scope.row.EntrustStatus > 0">
               <el-button type="primary" plain size="mini">编辑</el-button>
             </router-link>
             <!--<el-button :disabled="scope.row.EntrustStatus==0" type="primary" plain size="mini" title="" style="margin-left:3px;"
               @click="entrustPrint(scope.row)">打印</el-button>-->
-            <el-button type="primary" plain size="mini" style="margin-left:3px" :disabled="scope.row.EntrustStatus != '0' || !permissions[permissionscode.delete]"
+            <el-button type="plain" size="mini" style="margin-left:3px" :disabled="scope.row.EntrustStatus > 0"
                        @click="delEntrust(scope.row)">删除</el-button>
           </template>
         </el-table-column>
@@ -65,32 +65,6 @@
             {{ jstimehandle(scope.row.EntrustTime+'') }}
           </template>
         </el-table-column>
-        <el-table-column prop="EntrustStatus" sortable label="分配状态" align="center" mini-width="120">
-          <template slot-scope="scope">
-            <el-alert v-if="scope.row.EntrustStatus=='1'" :closable="false" style="background:rgba(255,255,255,0.2)"
-                      title="已分配"
-                      type="success">
-            </el-alert>
-            <el-alert v-if="scope.row.EntrustStatus=='0'" :closable="false" style="background:rgba(255,255,255,0.2)"
-                      title="未分配"
-                      type="warning">
-            </el-alert>
-          </template>
-        </el-table-column>
-        <!--<el-table-column prop="DeliverStatus" sortable label="交接状态" align="center" mini-width="120" v-if="!tjz">
-          <template slot-scope="scope">
-            <el-tag size="small" v-show="scope.row.DeliverStatus=='0'" type="danger">未交接</el-tag>
-            <el-tag size="small" v-show="scope.row.DeliverStatus=='1'" type="warning">待交接</el-tag>
-            <el-tag size="small" v-show="scope.row.DeliverStatus=='2'" type="warning">已发送</el-tag>
-            <el-tag size="small" v-show="scope.row.DeliverStatus=='3'" type="success">已交接</el-tag>
-          </template>
-        </el-table-column>
-        <el-table-column prop="ReportStatus" sortable label="签发状态" align="center" mini-width="120">
-          <template slot-scope="scope">
-            <el-tag size="small" v-show="scope.row.ReportStatus=='0'" type="warning">未签发</el-tag>
-            <el-tag size="small" v-show="scope.row.ReportStatus=='2'" type="success">已签发</el-tag>
-          </template>
-        </el-table-column>-->
       </el-table>
       <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
                      :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
@@ -166,7 +140,7 @@
     },
 
     name: 'sampletype',
-    data() {
+    data () {
       return {
         dialogVisible: false,
         searchform: {
@@ -218,13 +192,13 @@
     },
     methods: {
       initdata() {
-        let _this = this;
+        let _this = this
         let EntrustTime = []
         if (!_this.EntrustTime) {
           _this.EntrustTime = []
         }
         // 解析时间
-        if (_this.EntrustTime.length == 2) {
+        if (_this.EntrustTime || _this.EntrustTime.length === 2) {
           _this.EntrustTime[1].setHours(23)
           _this.EntrustTime[1].setMinutes(59)
           _this.EntrustTime[1].setSeconds(59)
@@ -235,10 +209,11 @@
           _currentPage: this.currentPage,
           _size: this.size,
           Order: this.Column.Order,
-          Prop: this.Column.Prop
+          Prop: this.Column.Prop,
+          EntrustStatus: -1
         }
         Object.assign(params, this.searchform)
-        api.entrustList(EntrustTime.join(','), params, this.$axios)
+        api.entrustPlanList(EntrustTime.join(','), params, this.$axios)
           .then(
             function (response) {
               _this.entrustList = response.data.items

+ 0 - 34
src/dashoo.cn/frontend_web/src/pages/lims/tasksentrust/_opera/operation.vue

@@ -788,7 +788,6 @@
                   })
                   _this.getEntrustInfo()
                   _this.getSampleList()
-                  console.log("-==--bianjibaocun--", this.mainForm.DataTemplateId)
                   _this.getpartuserlist(this.mainForm.DataTemplateId)
                 } else {
                   _this.$message({
@@ -826,8 +825,6 @@
             //   _this.selectedorg = []
             // }
             _this.getAddress(_this.mainForm.CustomerId)
-            console.log("-==--bianji--", this.mainForm.DataTemplateId)
-            console.log("--------mainform----", this.mainForm)
             _this.getpartuserlist(this.mainForm.DataTemplateId)
           }).catch(err => {
             // handle error
@@ -858,15 +855,6 @@
         let _this = this
         _this.testcodec()
         _this.saveDetail()
-        /*_this.$confirm("确定分配该任务?分配后所有信息将不可修改!", "提示", {
-            confirmButtonText: "确定",
-            cancelButtonText: "取消",
-            type: "warning"
-          })
-          .then(() => {
-            _this.saveDetail()
-          })
-          .catch(() => {})*/
       },
       saveDetail() {
         let _this = this
@@ -1298,28 +1286,6 @@
 
       },
 
-      /*addtaskbalance() {
-        let _this = this
-        alert('aaaa');
-        _this.$axios.put('limsentrustsample/addtaskbalance/' + _this.ServiceId, _this.mainForm)
-          .then(res => {
-            // response
-            if (res.data.code === 0) {
-              _this.$message({
-                type: 'success',
-                message: res.data.message
-              })
-            } else {
-              _this.$message({
-                type: 'warning',
-                message: res.data.message
-              })
-            }
-          }).catch(err => {
-            console.error(err)
-          })
-      },*/
-
       testcodec() {
         this.$axios.get('/codesequence/GetProjectCenterDailySequence')
           .then(res => {