Sfoglia il codice sorgente

资质变更添加

huahaiyan 6 anni fa
parent
commit
a1c18017ab

+ 32 - 0
src/dashoo.cn/backend/api/business/oilsupplier/qualchange/qualchange.go

@@ -7,6 +7,9 @@ import (
 
 type OilQualChangeDetail struct {
 	Id                int       `xorm:"not null default 0 INT(10)"`
+	SupplierId        int       `xorm:"INT(10)"`
+	SupplierCertId    int       `xorm:"not null comment('准入子表Id') INT(10)"`
+	FileId            int       `xorm:"not null comment('资质文件Id') INT(10)"`
 	ParentId          int       `xorm:"not null default 0 comment('主表Id') INT(10)"`
 	SupplierTypeCode  string    `xorm:"not null default '0' comment('准入类别代码(01 物资类,02 基建类,03 技术服务类)') VARCHAR(5)"`
 	SupplierCertSubId int       `xorm:"not null default 0 comment('供方对应准入子分类表') INT(10)"`
@@ -35,6 +38,7 @@ type OilQualChangeDetail struct {
 type OilQualChangeMain struct {
 	Id             int       `xorm:"not null pk autoincr INT(10)"`
 	SupplierId     int       `xorm:"not null comment('供方基本信息表主键') INT(10)"`
+	SupplierCertId int       `xorm:"not null comment('准入子表Id') INT(10)"`
 	SupplierName   string    `xorm:"comment('企业名称') VARCHAR(255)"`
 	AccesscardNo   string    `xorm:"comment('准入证号') VARCHAR(20)"`
 	CommercialNo   string    `xorm:"comment('工商注册号') VARCHAR(20)"`
@@ -49,6 +53,34 @@ type OilQualChangeMain struct {
 	ModifiedBy     string    `xorm:"VARCHAR(50)"`
 }
 
+type QualChangeModel struct {
+	OilQualChangeMain `xorm:"extends"`
+	DetailId          int       `xorm:"not null default 0 INT(10)"`
+	FileId            int       `xorm:"not null comment('资质文件Id') INT(10)"`
+	SupplierTypeCode  string    `xorm:"not null default '0' comment('准入类别代码(01 物资类,02 基建类,03 技术服务类)') VARCHAR(5)"`
+	SupplierCertSubId int       `xorm:"not null default 0 comment('供方对应准入子分类表') INT(10)"`
+	CertSubName       string    `xorm:"default '' comment('分类名称') VARCHAR(50)"`
+	NeedFileType      string    `xorm:"not null default '' comment('文件分类') VARCHAR(50)"`
+	NeedFileCode      string    `xorm:"not null default '' comment('文件分类编码') VARCHAR(20)"`
+	OldFileName       string    `xorm:"not null default '' comment('原文件名称') VARCHAR(50)"`
+	FileName          string    `xorm:"not null default '' comment('文件名称') VARCHAR(50)"`
+	FileExt           string    `xorm:"VARCHAR(10)"`
+	FileType          int       `xorm:"default 0 comment('0:不必要文件;1:必上传文件;') INT(10)"`
+	OldEffectDate     time.Time `xorm:"comment('原有效期') DATETIME"`
+	EffectDate        time.Time `xorm:"comment('有效期') DATETIME"`
+	OldFileUrl        string    `xorm:"VARCHAR(100)"`
+	FileUrl           string    `xorm:"VARCHAR(100)"`
+	OtherRemark       string    `xorm:"VARCHAR(500)"`
+	Remark            string    `xorm:"comment('备注') VARCHAR(500)"`
+	IsDelete          int       `xorm:"default 0 comment('删除状态,0正常,1已删除') INT(10)"`
+	CreateOn          time.Time `xorm:"DATETIME"`
+	CreateUserId      int       `xorm:"INT(10)"`
+	CreateBy          string    `xorm:"VARCHAR(50)"`
+	ModifiedOn        time.Time `xorm:"DATETIME"`
+	ModifiedUserId    int       `xorm:"INT(10)"`
+	ModifiedBy        string    `xorm:"VARCHAR(50)"`
+}
+
 type OilSupplierQual struct {
 	supplier.OilSupplier `xorm:"extends"`
 	CertId               string

+ 36 - 1
src/dashoo.cn/backend/api/business/oilsupplier/qualchange/qualchangeService.go

@@ -144,4 +144,39 @@ func (s *QualChangeService) SubmitOrgAudit(workflowid, certId, annualId, wfName,
 	ActiComplete.CallbackUrl = ""
 	svcActiviti.MultiTaskComplete(ActiComplete)
 	return processInstanceId
-}
+}
+
+func (s *QualChangeService) GetQualPagingEntities(FileName, qualChangeName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where string) (total int64) {
+	var resultsSlice []map[string][]byte
+
+	//获取总记录数
+	sqlCount := `select count(*) from ` + FileName + ` a `
+	sqlCount += ` left join ` + qualChangeName + " b on b.FileId = a.Id"
+	sqlCount += ` where ` + where
+
+	var sql string
+	sql = `select a.Id Id, a.SupplierId SupplierId, a.SupplierTypeCode SupplierTypeCode, a.SupplierCertSubId SupplierCertSubId, a.CertSubName CertSubName, `
+	sql += ` a.NeedFileType NeedFileType, a.NeedFileCode NeedFileCode, a.FileExt FileExt, a.FileType FileType, `
+	sql += ` a.EffectDate OldEffectDate, a.FileUrl OldFileUrl, a.FileName OldFileName, `
+	sql += ` b.EffectDate EffectDate, b.FileUrl FileUrl, b.FileName FileName, b.ParentId `
+	sql += ` from ` + FileName + ` a `
+	sql += ` left join ` + qualChangeName + " b on b.FileId = a.Id"
+	sql += ` where ` + where
+	if asc {
+		sql += ` order by ` + orderby + ` ASC `
+	} else {
+		sql += ` order by ` + orderby + ` DESC `
+	}
+	sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
+	s.DBE.SQL(sql).Find(entitiesPtr)
+	resultsSlice, _ = s.DBE.Query(sqlCount)
+
+	if len(resultsSlice) > 0 {
+		results := resultsSlice[0]
+		for _, value := range results {
+			total, _ = strconv.ParseInt(string(value), 10, 64)
+			break
+		}
+	}
+	return total
+}

+ 2 - 0
src/dashoo.cn/backend/api/business/workflow/workflow.go

@@ -89,4 +89,6 @@ const (
 	OIL_APPEND_APPLY string = "oil_append_apply"
 	//信息变更流程图
 	OIL_INFO_CHANGE string = "oil_info_change"
+	//资质变更流程图
+	OIL_QUAL_CHANGE string = "oil_qual_change"
 )

+ 330 - 109
src/dashoo.cn/backend/api/controllers/oilsupplier/qualchange.go

@@ -2,6 +2,8 @@ package oilsupplier
 
 import (
 	"dashoo.cn/backend/api/business/oilsupplier/qualchange"
+	"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
+	"dashoo.cn/backend/api/business/oilsupplier/supplierfile"
 	"dashoo.cn/business2/permission"
 	"encoding/json"
 	"strconv"
@@ -22,6 +24,13 @@ import (
 type QualChangeController struct {
 	BaseController
 }
+type QualShenHeModel struct {
+	QualId        int
+	SuccessStatus int
+	AuditorRemark string
+	Auditer       int
+	SuppId        int
+}
 
 // @Title 获取列表
 // @Description get user by token
@@ -139,6 +148,10 @@ func (this *QualChangeController) GetMyTaskEntityList() {
 			where = where + " and CreateOn>='" + minDate + "' and CreateOn<='" + maxDate + "'"
 		}
 	}
+	//找出待办任务
+	actisvc := workflow.GetActivitiService(utils.DBE)
+	certIdList := actisvc.GetMyTasks(workflow.OIL_QUAL_CHANGE, this.User.Id)
+	where += " and Id in (" + certIdList + ")"
 
 	svc := qualchange.GetQualChangeService(utils.DBE)
 	var list []qualchange.OilQualChangeMain
@@ -152,76 +165,76 @@ func (this *QualChangeController) GetMyTaskEntityList() {
 	this.ServeJSON()
 }
 
-// @Title 获取列表
+// @Title 资质文件
 // @Description get user by token
-// @Success 200 {object} []annualaudit.OilAnnualAudit
-// @router /mytasks [get]
-//func (this *QualChangeController) GetMyTaskEntityList() {
-//
-//	//获取分页信息
-//	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
-//		}
-//	}
-//	SupplierTypeName := this.GetString("SupplierTypeName")
-//	RecUnitId := this.GetString("RecUnitId")
-//	AccessCardNo := this.GetString("AccessCardNo")
-//	SupplierName := this.GetString("SupplierName")
-//	CreateOn := this.GetString("CreateOn")
-//
-//	if SupplierTypeName != "" {
-//		where = where + " and SupplierTypeName like '%" + SupplierTypeName + "%'"
-//	}
-//
-//	if RecUnitId != "" {
-//		where = where + " and RecUnitId like '%" + RecUnitId + "%'"
-//	}
-//
-//	if AccessCardNo != "" {
-//		where = where + " and AccessCardNo like '%" + AccessCardNo + "%'"
-//	}
-//
-//	if SupplierName != "" {
-//		where = where + " and SupplierName like '%" + SupplierName + "%'"
-//	}
-//
-//	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 := annualaudit.GetOilAnnualAuditService(utils.DBE)
-//	var list []annualaudit.OilAnnualAudit
-//	//找出待办任务
-//	actisvc := workflow.GetActivitiService(utils.DBE)
-//	certIdList := actisvc.GetMyTasks(workflow.OIL_AUDIT_APPLY, this.User.Id)
-//	where += " and Id in (" + certIdList + ")"
-//	//根据部门查询待办任务
-//
-//	total := svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size,orderby,asc, &list, where)
-//	//total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, 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()
-//}
+// @Success 200 {object} models.Userblood
+// @router /filelist [get]
+func (this *QualChangeController) FileList() {
+	page := this.GetPageInfoForm()
+	var list []qualchange.OilQualChangeDetail
+	svc := qualchange.GetQualChangeService(utils.DBE)
+	where := " 1=1"
+	orderby := "a.Id"
+	asc := false
+	Order := this.GetString("Order")
+	Prop := this.GetString("Prop")
+	if Order != "" && Prop != "" {
+		orderby = Prop
+		if Order == "asc" {
+			asc = true
+		}
+	}
+	SupplierId := this.GetString("SupplierId")
+	if SupplierId != "" {
+		where = where + " and a.SupplierId = '" + SupplierId + "'"
+	}
+	SupplierTypeCode := this.GetString("SupplierTypeCode")
+	if SupplierTypeCode != "" {
+		where = where + " and a.SupplierTypeCode in ( '000', '" + SupplierTypeCode + "')"
+	}
+	total := svc.GetQualPagingEntities(OilSupplierFileName,OilQualChangeDetailName, page.CurrentPage, page.Size, orderby, asc, &list, where)
+	var datainfo DataInfo
+	datainfo.Items = list
+	datainfo.CurrentItemCount = total
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
 
+// @Title 资质文件
+// @Description get user by token
+// @Success 200 {object} models.Userblood
+// @router /auditfilelist [get]
+func (this *QualChangeController) AuditFileList() {
+	page := this.GetPageInfoForm()
+	var list []qualchange.OilQualChangeDetail
+	svc := qualchange.GetQualChangeService(utils.DBE)
+	where := " 1=1"
+	orderby := "a.Id"
+	asc := false
+	Order := this.GetString("Order")
+	Prop := this.GetString("Prop")
+	if Order != "" && Prop != "" {
+		orderby = Prop
+		if Order == "asc" {
+			asc = true
+		}
+	}
+	SupplierId := this.GetString("SupplierId")
+	if SupplierId != "" {
+		where = where + " and a.SupplierId = '" + SupplierId + "'"
+	}
+	SupplierTypeCode := this.GetString("SupplierTypeCode")
+	if SupplierTypeCode != "" {
+		where = where + " and a.SupplierTypeCode in ( '000', '" + SupplierTypeCode + "')"
+	}
+	where = where + " and b.FileUrl != ''"
+	total := svc.GetQualPagingEntities(OilSupplierFileName,OilQualChangeDetailName, page.CurrentPage, page.Size, orderby, asc, &list, where)
+	var datainfo DataInfo
+	datainfo.Items = list
+	datainfo.CurrentItemCount = total
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
 // @Title 获取年审企业名称
 // @Description 获取实体
 // @Success 200 {object} annualaudit.OilAnnualAudit
@@ -421,66 +434,274 @@ func (this *QualChangeController) UpdateEntity() {
 	}
 }
 
-// @Title 删除单条信息
-// @Description
-// @Success 200 {object} ErrorInfo
-// @Failure 403 :id 为空
-// @router /delete/:Id [delete]
-func (this *QualChangeController) DeleteEntity() {
-	Id := this.Ctx.Input.Param(":Id")
+// @Title 资质文件变更上传
+// @Description 更新文件上传
+// @Param	id	path	string	true
+// @Success	200	{object}
+// @router /editqualchange/:id [put]
+func (this *QualChangeController) EditQualChange() {
+	id := this.Ctx.Input.Param(":id")
 	var errinfo ErrorInfo
-	if Id == "" {
+	if id == "" {
 		errinfo.Message = "操作失败!请求信息不完整"
 		errinfo.Code = -2
 		this.Data["json"] = &errinfo
 		this.ServeJSON()
 		return
 	}
-	var model annualaudit.OilAnnualAudit
-	var entityempty annualaudit.OilAnnualAudit
-	svc := annualaudit.GetOilAnnualAuditService(utils.DBE)
-	opdesc := "删除-" + Id
-	err := svc.DeleteOperationAndWriteLogBytbl(""+OilAnnualAuditName, BaseOperationLogName, Id, &model, &entityempty, utils.ToStr(this.User.Id), this.User.Username, opdesc, "", "钻井日报")
+	var model qualchange.OilQualChangeDetail
+	var jsonblob = this.Ctx.Input.RequestBody
+	svc := qualchange.GetQualChangeService(utils.DBE)
+	json.Unmarshal(jsonblob, &model)
+	var entity qualchange.OilQualChangeDetail
+	var mainentirt qualchange.OilQualChangeMain
+	var qualmain []qualchange.OilQualChangeMain
+	qmwhere := " SupplierId = " + utils.ToStr(model.SupplierId)
+	svc.GetEntitysByWhere(OilQualChangeMainName, qmwhere, &qualmain)
+	var qualmainId int
+	if len(qualmain) == 0 {
+		mainentirt.SupplierCertId = model.SupplierCertId
+		mainentirt.SupplierId = model.SupplierId
+		mainentirt.Status = "0"
+		mainentirt.Step = 1
+		svc.InsertEntityBytbl(OilQualChangeMainName,&mainentirt)
+		qualmainId = mainentirt.Id
+	}else {
+		qualmainId = qualmain[0].Id
+	}
+	entity = model
+	entity.Id = 0
+	entity.ParentId = qualmainId
+	entity.SupplierCertId = model.SupplierCertId
+	entity.FileId, _ = utils.StrTo(id).Int()
+	entity.CreateOn = time.Now()
+	entity.CreateBy = this.User.Realname
+	entity.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+	_,err := svc.InsertEntityBytbl(OilQualChangeDetailName,&entity)
 	if err == nil {
-		errinfo.Message = "删除成功"
+		errinfo.Message = "操作成功!"
 		errinfo.Code = 0
 		this.Data["json"] = &errinfo
 		this.ServeJSON()
 	} else {
-		errinfo.Message = "删除失败!" + utils.AlertProcess(err.Error())
+		errinfo.Message = "操作失败!" + utils.AlertProcess(err.Error())
 		errinfo.Code = -1
 		this.Data["json"] = &errinfo
 		this.ServeJSON()
 	}
 }
 
-// @Title 基建类业务
-// @Description get user by token
-// @Success 200 {object} models.Userblood
-// @router /basiclist [get]
-func (this *QualChangeController) BasicList() {
-	page := this.GetPageInfoForm()
-	var list []annualaudit.OilAnnualAudit
-	svc := annualaudit.GetOilAnnualAuditService(utils.DBE)
-	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
+// @Title 提交审批
+// @Description 提交审批
+// @Success	200	{object} controllers.Request
+// @router /audit/:id [post]
+func (this *QualChangeController) AuditEntity() {
+	suppId := this.Ctx.Input.Param(":id")
+	firstAudit := this.GetString("firstAudit")
+
+	//取出审批列表
+	svc := qualchange.GetQualChangeService(utils.DBE)
+	var suppentity supplier.OilSupplier
+	//供方信息
+	svc.GetEntityById(suppId,&suppentity)
+	var qualmain qualchange.OilQualChangeMain
+	where := " SupplierId = " + suppId
+	svc.GetEntity(&qualmain, where)
+	var errinfo ErrorDataInfo
+	defer func() { //finally处理失败的异常
+		if err := recover(); err != nil {
+			errinfo.Message = "提交失败," + err.(string)
+			errinfo.Code = -1
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+		} else {
+			//返回正确结果
+			errinfo.Message = "审核提交成功"
+			errinfo.Code = 0
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
 		}
+	}()
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	processInstanceId := ""
+	if qualmain.WorkFlowId == "0" || len(qualmain.WorkFlowId) <= 0 {
+		//启动工作流
+		processInstanceId = svcActiviti.StartProcess(workflow.OIL_QUAL_CHANGE, utils.ToStr(qualmain.Id), this.User.Id)
 	}
-	keyword := this.GetString("keyword")
-	if keyword != "" {
-		where = where + " and Name like '%" + keyword + "%'"
+
+	var ActiComplete workflow.ActiCompleteVM
+	ActiComplete.ProcessKey = workflow.OIL_QUAL_CHANGE
+	ActiComplete.BusinessKey = utils.ToStr(qualmain.Id)
+	ActiComplete.UserNames = firstAudit
+	ActiComplete.UserId = this.User.Id
+	ActiComplete.Result = "1"
+	ActiComplete.Remarks = "资质变更二级单位初审"
+	ActiComplete.CallbackUrl = ""
+	receiveVal := svcActiviti.TaskComplete(ActiComplete)
+
+	if receiveVal == "true" {
+		//记下workflowID(首次提交时才会记录,中间状态请忽略) 及审批状态
+		var qualmainmodel qualchange.OilQualChangeMain
+		qualmainmodel.WorkFlowId = processInstanceId
+		qualmainmodel.Status = suppliercert.FIRST_TRIAL_STATUS //二级单位初审
+		qualmainmodel.CreateOn = time.Now()
+		qualmainmodel.CreateBy = this.User.Realname
+		qualmainmodel.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+		qualmainmodel.SupplierName = suppentity.SupplierName
+		qualmainmodel.CommercialNo = suppentity.CommercialNo
+		cols := []string{
+			"Id",
+			"WorkflowId",
+			"Status",
+			"Step",
+			"CreateOn",
+			"CreateBy",
+			"CreateUserId",
+			"SupplierName",
+			"CommercialNo",
+		}
+		_,err := svc.UpdateEntityByIdCols(qualmain.Id, qualmainmodel, cols)
+		if err == nil {
+			errinfo.Message = "提交成功!"
+			errinfo.Code = 0
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+		}else {
+			errinfo.Message = "提交失败!"
+			errinfo.Code = -1
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+		}
+	} else {
+		errinfo.Message = "工作流异常,请联系管理员!"
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
 	}
-	total := svc.GetPagingEntitiesWithoutAccCode(page.CurrentPage, page.Size, orderby, asc, &list, where)
-	var datainfo DataInfo
-	datainfo.Items = list
-	datainfo.CurrentItemCount = total
-	this.Data["json"] = &datainfo
-	this.ServeJSON()
 }
+
+// @Title 审批
+// @Description 审批
+// @Success	200	{object} controllers.Request
+// @router /qualaudit [post]
+func (this *QualChangeController) QualAudit() {
+	svc := qualchange.GetQualChangeService(utils.DBE)
+	var jsonblob = this.Ctx.Input.RequestBody
+	var dataother QualShenHeModel
+	json.Unmarshal(jsonblob, &dataother)
+	//取出审批列表
+	var qualid = dataother.QualId
+	var qualmodel qualchange.OilQualChangeMain
+	svc.GetEntityById(utils.ToStr(dataother.QualId), &qualmodel)
+	var qualdetail []qualchange.OilQualChangeDetail
+	where := "ParentId = "+ utils.ToStr(qualid)
+	svc.GetEntities(&qualdetail,where)
+	var qualchanentity qualchange.OilQualChangeMain
+	var errinfo ErrorDataInfo
+	defer func() { //finally处理失败的异常
+		if err := recover(); err != nil {
+			errinfo.Message = "提交失败," + err.(string)
+			errinfo.Code = -1
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+		} else {
+			//返回正确结果
+			errinfo.Message = "审核提交成功"
+			errinfo.Code = 0
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+		}
+	}()
+	step := 2
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	var ActiComplete workflow.ActiCompleteVM
+	ActiComplete.ProcessKey = workflow.OIL_QUAL_CHANGE
+	ActiComplete.BusinessKey = utils.ToStr(qualid)
+	ActiComplete.UserNames = utils.ToStr(dataother.Auditer)
+	ActiComplete.UserId = this.User.Id
+	ActiComplete.Remarks = dataother.AuditorRemark
+	ActiComplete.CallbackUrl = ""
+	if dataother.SuccessStatus == 1 {
+		ActiComplete.Result = "1"
+		if qualmodel.Status == "1" {
+			qualchanentity.Status = "2" //二级单位初审
+		} else if qualmodel.Status == "2" {
+			qualchanentity.Status = "3" //企业法规处审批
+			step = 3
+		}
+		receiveVal := svcActiviti.TaskComplete(ActiComplete)
+		if receiveVal == "true" {
+			cols := []string{
+				"Id",
+				"Status",
+				"Step",
+			}
+			_, err := svc.UpdateEntityByIdCols(qualid, qualchanentity, cols)
+			if err == nil{
+				//原信息表更新
+				if qualmodel.Status == "2" {
+					if len(qualdetail) > 0 {
+						for i:= 0; i<len(qualdetail); i++ {
+							var supfilemodel supplierfile.OilSupplierFile
+							supfilemodel.FileName = qualdetail[i].FileName
+							supfilemodel.FileUrl = qualdetail[i].FileUrl
+							supfilemodel.EffectDate = qualdetail[i].EffectDate
+							err = svc.UpdateEntityBytbl(OilSupplierFileName, qualdetail[i].FileId, &supfilemodel, []string{"FileName", "FileUrl", "EffectDate"})
+						}
+					}
+				}
+				errinfo.Message = "提交成功!"
+				errinfo.Code = 0
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+			}else {
+				errinfo.Message = "提交失败!"
+				errinfo.Code = -1
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+			}
+
+		} else {
+			errinfo.Message = "工作流异常,请联系管理员!"
+			errinfo.Code = -1
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+			return
+		}
+	} else {
+		ActiComplete.Result = "0"
+		if qualmodel.Status == "1" {
+			qualchanentity.Status = "-2" //二级单位初审
+		} else if qualmodel.Status == "2" {
+			qualchanentity.Status = "-3" //企业法规处审批
+		}
+		receiveVal := svcActiviti.TaskComplete(ActiComplete)
+		if receiveVal == "true" {
+			qualchanentity.Step = step
+			cols := []string{
+				"Id",
+				"Status",
+				"Step",
+			}
+			_, err := svc.UpdateEntityByIdCols(qualid, qualchanentity, cols)
+			if err == nil {
+				errinfo.Message = "提交成功!"
+				errinfo.Code = 0
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+			}else {
+				errinfo.Message = "提交失败!"
+				errinfo.Code = -1
+				this.Data["json"] = &errinfo
+				this.ServeJSON()
+			}
+		} else {
+			errinfo.Message = "工作流异常,请联系管理员!"
+			errinfo.Code = -1
+			this.Data["json"] = &errinfo
+			this.ServeJSON()
+			return
+		}
+	}
+}

+ 9 - 2
src/dashoo.cn/frontend_web/src/api/oilsupplier/qualchange.js

@@ -31,6 +31,13 @@ export default {
       data: formData
     })
   },
+  qualAudit (shenheform, myAxios) {
+    return myAxios({
+      url: '/qualchange/qualaudit',
+      method: 'post',
+      data: shenheform
+    })
+  },
   updateEntity (entityId, formData, myAxios) {
     return myAxios({
       url: '/qualchange/update/' + entityId,
@@ -44,9 +51,9 @@ export default {
       method: 'delete'
     })
   },
-  auditEntity (entityId, myAxios) {
+  auditEntity (entityId, FirstAudit, myAxios) {
     return myAxios({
-      url: '/qualchange/audit/' + entityId,
+      url: '/qualchange/audit/' + entityId + '?firstAudit=' + FirstAudit,
       method: 'post'
     })
   },

+ 449 - 0
src/dashoo.cn/frontend_web/src/pages/oilsupplier/qualchange/_opera/auditoperation.vue

@@ -0,0 +1,449 @@
+<template>
+  <div>
+    <el-breadcrumb class="heading">
+      <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
+      <el-breadcrumb-item :to="{ path: '/oilsupplier/qualchange/qualaudit' }">资质变更</el-breadcrumb-item>
+      <el-breadcrumb-item>编辑</el-breadcrumb-item>
+    </el-breadcrumb>
+    <el-card class="box-card">
+      <div slot="header">
+        <span>
+          <i class="icon icon-table2"></i> 编辑
+        </span>
+        <span style="float: right;">
+          <el-button type="primary" size="mini" @click="commitshow = true" v-if="butnshow == 0 && (QualStatus == '1' || QualStatus == '2')">审核</el-button>
+          <router-link :to="'/oilsupplier/qualchange/qualaudit'">
+            <el-button type="primary" size="mini" style="margin-left: 8px">返回</el-button>
+          </router-link>
+        </span>
+      </div>
+      <el-table :data="businessList" border>
+        <el-table-column prop="Code" label="分类编码" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="Name" label="分类名称" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="Remark" label="备注" show-overflow-tooltip></el-table-column>
+      </el-table>
+    </el-card>
+    <el-card class="box-card" style="margin-top: 10px;">
+      <div slot="header" class="clearfix">
+        <span style="font-weight: bold">企业资质</span>
+      </div>
+      <el-table :data="subfileList" border>
+        <el-table-column prop="NeedFileType" label="文件分类" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="OldFileName" label="原文件" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="OldEffectDate" label="原有效日期" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{ jstimehandle(scope.row.OldEffectDate+'') }}
+          </template>
+        </el-table-column>
+        <el-table-column prop="FileName" label="变更后文件" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="EffectDate" label="变更后有效日期" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{ jstimehandle(scope.row.EffectDate+'') }}
+          </template>
+        </el-table-column>
+        <el-table-column prop="Remark" label="描述" show-overflow-tooltip></el-table-column>
+      </el-table>
+
+      <el-dialog :title="Title" :visible.sync="visible" top="5vh">
+        <el-form :model="SubfileForm" label-width="100px">
+          <el-row>
+           <el-col :span="12">
+            <el-form-item label="资质文件">
+              <el-upload style="margin-top: 10px;" action="" ref="refuploadattach" :http-request="uploadrequest"
+                class="attach-uploader" :before-upload="beforeAvatarUpload">
+                <i class="el-icon-plus attach-uploader-icon"></i>
+              </el-upload>
+            </el-form-item>
+          </el-col>
+            <el-col :span="12">
+              <el-form-item label="有效日期" required>
+                <el-date-picker style="width: 100%" v-model="SubfileForm.EffectDate" type="date" placeholder="请选择有效日期">
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="描述">
+                <el-input v-model="SubfileForm.Remark" type="textarea" :rows=3 placeholder="请输入备注信息"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer" style="margin-top:-30px;">
+          <el-button @click="visible = false">取 消</el-button>
+          <el-button type="primary" @click="makesure()">确 定</el-button>
+        </div>
+      </el-dialog>
+    </el-card>
+    <el-dialog title="审核" :visible.sync="commitshow">
+      <el-form label-width="120px" :model="entityForm" :rules="rules" ref="EntityFormref">
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="提交审批人" v-if="QualStatus == '1'" prop="auditer" required>
+              <el-select ref="selectAuditer" v-model="entityForm.auditer" placeholder="请选择" style="width: 100%"
+                filterable allow-create default-first-option>
+                <el-option v-for="item in auditerOption" :key="item.id" :label="item.realname" :value="item.id">
+                </el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="审核状态">
+              <template>
+                <el-radio class="radio" v-model="shenheForm.SuccessStatus" :label="1">通过</el-radio>
+                <el-radio class="radio" v-model="shenheForm.SuccessStatus" :label="2">未通过</el-radio>
+              </template>
+            </el-form-item>
+            <el-form-item label="意见">
+              <el-input type="textarea" v-model="shenheForm.AuditorRemark" placeholder="请输入审核说明"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span style="float: right;margin-top:-10px;">
+        <el-button size="small" @click="commitshow = false">取 消</el-button>
+        <el-button type="primary" size="small" @click="QualChangeAuditLaw()">确 定</el-button>
+      </span>
+      <br>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+  import {
+    mapGetters
+  } from 'vuex'
+  import supplierapi from '@/api/oilsupplier/supplier'
+  import api from '@/api/oilsupplier/technologyservice'
+  import uploadajax from '@/assets/js//uploadajax.js'
+  import quaapi from '@/api/oilsupplier/qualchange'
+  import infoapi from '@/api/oilsupplier/infochange'
+  import axios from 'axios'
+ // import uploadajax from '../../assets/js/uploadajax.js'
+  export default {
+    computed: {
+      ...mapGetters({
+        authUser: 'authUser',
+        session: 'session'
+      })
+    },
+    // components: {
+    //   BusinessList,
+    //   SubfileList, //文档
+    // },
+    name: 'oiltechnologyserviceEdit',
+
+    data() {
+      return {
+        businessList: [], //准入业务
+        serviceId: '',
+        certId: '',
+        classId: '',
+        SupplierId: '',
+        SupplierCertId: '',
+        SupplierTypeCode: '',
+        subfileList: [],
+        techList: [],
+        techTreeList: [],
+        orgtreelist: [],
+        orgtreeprops: {
+          value: 'id',
+          label: 'Fullname',
+          children: 'children'
+        },
+        selectedorg: [],
+        entityForm: {
+          Id: '',
+          SupplierName: '',
+          SupplierId: '',
+          SupplierTypeName: '',
+          FirstAudit: '',
+          auditer: '',
+        },
+        Title: '',
+        SubfileForm: {
+          Id: '',
+          SupplierId: '',
+          SupplierTypeCode: '',
+          SupplierCertSubId: '',
+          CertSubName: '',
+          NeedFileType: '',
+          NeedFileCode: '',
+          FileType: '',
+          FileExt: '',
+          FileName: '',
+          EffectDate: new Date(),
+          FileUrl: '',
+          OldFileName: '',
+          OldEffectDate: new Date(),
+          OldFileUrl: '',
+          OtherRemark: '',
+          Remark: '',
+          IsDelete: 0
+        },
+        visible: false,
+        selfVisible: this.visible, // 避免vue双向绑定警告
+        rules: {
+          FirstAudit: [{
+            required: true,
+            message: '请选择初审单位',
+            trigger: 'blur'
+          }],
+          auditer: [{
+            required: true,
+            message: '请选择审批人',
+            trigger: 'blur'
+          }]
+        },
+        waituploads: [], // 等待上传的附件列表
+        doclist: [],
+        QualStatus: '',
+        butnab: false,
+        commitshow: false,
+        auditerOption: [],
+        shenheForm: {
+          SuccessStatus: 1,
+          AuditorRemark: '',
+          QualId: 0,
+          Auditer: 0,
+          SuppId: 0,
+        },
+        butnshow: 0,
+        QualId: 0,
+      }
+    },
+    created() {
+      this.serviceId = this.$route.params.opera;
+      if (this.$route.query.certid) {
+        this.certId = this.$route.query.certid + ''
+      }
+      if (this.$route.query.QualId) {
+        this.QualId = this.$route.query.QualId + ''
+      }
+      this.QualStatus = this.$route.query.QualStatus
+      if (this.QualStatus > 0) {
+        this.butnab = false
+      }
+      this.SupplierId = this.serviceId
+      this.SupplierTypeCode = this.classId
+      this.SupplierCertId = this.certId
+      this.getDictOptions()
+      this.initData()
+      this.getbusList()
+      this.auditget()
+    },
+    methods: {
+      initData() {
+        let _this = this
+        const params = {
+          SupplierId: this.SupplierId,
+          SupplierTypeCode: '',
+          _currentPage: 1,
+          _size: 1000,
+        }
+        _this.$axios.get('qualchange/auditfilelist', {
+            params
+          })
+          .then(res => {
+            _this.subfileList = res.data.items
+            _this.currentItemCount = res.data.currentItemCount
+            console.log("----this.subfileList---",this.subfileList)
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      auditget() {
+        this.auditerOption = []
+        infoapi.getAuditer(this.$axios).then(res => {
+          this.auditerOption = res.data.item
+          console.log("----res.data.item-----",res.data.item)
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      getDictOptions() {
+        api.getDictList(this.$axios).then(res => {
+          //this.wellNoOptions = res.data.items['WellNo']
+          //this.supervisersOptions = res.data.items['Supervisers']
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      getbusList() {
+        let _this = this
+        const params = {
+          SupplierCertId: this.SupplierCertId,
+          SupplierTypeCode: '',
+          _currentPage: 1,
+          _size: 1000
+        }
+        this.$axios.get('suppliercertsub/list', {
+            params
+          })
+          .then(res => {
+            _this.businessList = res.data.items
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      QualChangeAuditLaw() {
+        this.shenheForm.Auditer = this.entityForm.auditer
+        this.shenheForm.QualId = parseInt(this.QualId)
+        this.shenheForm.SuppId = parseInt(this.SupplierId)
+
+        quaapi.qualAudit(this.shenheForm, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            // 保存成功后,初始化数据,变成修改
+            this.initData()
+            this.commitshow = false
+            this.butnshow = 1
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
+      //文档列表
+      getwendanginfo(iUrl) {
+        let _this = this
+        _this.doclist = []
+        let exArr = iUrl.split('|')
+        let params = {
+          name: exArr[1],
+          url: exArr[0]
+        }
+        _this.doclist.push(params)
+      },
+
+      beforeAvatarUpload(file) {
+        let isLt50m = file.size / 1024 / 1024 / 50 < 1
+        if (!isLt50m) {
+          this.$message.error('上传文件大小不能超过 50MB!')
+          return false
+        }
+        return true
+      },
+      uploadrequest(option) {
+        let _this = this
+        axios.post(process.env.upfilehost, {})
+          .then(function (res) {
+            if (res.data && res.data.fid && res.data.fid !== '') {
+              option.action = `http://${res.data.url}/${res.data.fid}`
+              _this.waituploads.push({
+                uid: option.file.uid,
+                url: res.data.publicUrl,
+                fid: res.data.fid
+              })
+              uploadajax(option)
+            } else {
+              _this.$message({
+                type: 'warning',
+                message: '未上传成功!请刷新界面重新上传!'
+              })
+            }
+          })
+          .catch(function (error) {
+            _this.$message({
+              type: 'warning',
+              message: '未上传成功!请重新上传!'
+            })
+          })
+      },
+       // 判断附件是否上传成功
+      attachissuccess() {
+        if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
+          for (let i = 0; i < this.$refs.refuploadattach.uploadFiles.length; i++) {
+            if (this.$refs.refuploadattach.uploadFiles[i].status !== 'success') {
+              return false
+            }
+          }
+        }
+        return true
+      },
+      getattachissuccess() {
+        this.SubfileForm.FileUrl = ''
+        if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
+          for (let i = 0; i < this.$refs.refuploadattach.uploadFiles.length; i++) {
+            if (this.$refs.refuploadattach.uploadFiles[i].status === 'success') {
+              for (let j = 0; j < this.waituploads.length; j++) {
+                if (this.waituploads[j].uid === this.$refs.refuploadattach.uploadFiles[i].uid) {
+                  this.SubfileForm.FileUrl =
+                    `${this.waituploads[j].url}/${this.waituploads[j].fid}|${this.$refs.refuploadattach.uploadFiles[i].name}`
+                  this.SubfileForm.FileName = `${this.$refs.refuploadattach.uploadFiles[i].name}`
+                }
+              }
+            }
+          }
+        }
+      },
+      submitqualChange() {
+        this.getorgtreelist()
+        this.commitshow = true
+      },
+      jstimehandle(val) {
+        if (val === '') {
+          return '----'
+        } else if (val === '0001-01-01T00:00:00Z') {
+          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)
+        }
+      },
+
+      formatDateTime(date) {
+        var y = date.getFullYear();
+        var m = date.getMonth() + 1;
+        m = m < 10 ? ('0' + m) : m;
+        var d = date.getDate();
+        d = d < 10 ? ('0' + d) : d;
+        var h = date.getHours();
+        var minute = date.getMinutes();
+        minute = minute < 10 ? ('0' + minute) : minute;
+        return y + '-' + m + '-' + d + ' ' + h + ':' + minute;
+      }
+    }
+  }
+
+</script>
+<style lang='scss'>
+  .attach-uploader .el-upload {
+    border: 1px dashed #63B8FF;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+    // margin-bottom: -17px;
+    margin-top: -15px;
+    margin-left: 20px
+  }
+
+  .attach-uploader .el-upload:hover {
+    border-color: #228B22;
+  }
+
+  .attach-uploader-icon {
+    font-size: 25px;
+    color: #63B8FF;
+    width: 50px;
+    height: 50px;
+    line-height: 50px;
+    text-align: center;
+  }
+
+  .attach-uploader-icon:hover {
+    color: #228B22;
+  }
+
+</style>

+ 148 - 101
src/dashoo.cn/frontend_web/src/pages/oilsupplier/qualchange/_opera/operation.vue

@@ -11,7 +11,8 @@
           <i class="icon icon-table2"></i> 编辑
         </span>
         <span style="float: right;">
-          <el-button type="primary" size="mini" @click="submitqualChange" v-if="(QualStatus == 0 || QualStatus == '') && !butnab">提交申请</el-button>
+          <el-button type="primary" size="mini" @click="submitqualChange"
+            v-if="(QualStatus == 0 || QualStatus == '') && butnab">提交申请</el-button>
           <router-link :to="'/oilsupplier/qualchange'">
             <el-button type="primary" size="mini" style="margin-left: 8px">返回</el-button>
           </router-link>
@@ -31,43 +32,32 @@
         :SupplierTypeCode="SupplierTypeCode" :businessList="businessList" :BusinessForm="BusinessForm" height="360px"
         style="margin-top: 20px">
       </subfile-list> -->
-       <el-table :data="subfileList" border>
-      <el-table-column label="操作" width="150" align="center" fixed>
-        <template slot-scope="scope">
-          <el-button type="primary" plain size="mini" title="编辑" @click="openDialog(scope.row)">编辑</el-button>
-        </template>
-      </el-table-column>
-      <el-table-column prop="NeedFileType" label="文件分类" show-overflow-tooltip></el-table-column>
-      <el-table-column prop="FileName" label="原文件" show-overflow-tooltip></el-table-column>
-      <el-table-column prop="EffectDate" label="原有效日期" show-overflow-tooltip>
-        <template slot-scope="scope">
-          {{ jstimehandle(scope.row.EffectDate+'') }}
-        </template>
-      </el-table-column>
-      <el-table-column prop="OtherRemark" label="变更后文件" show-overflow-tooltip></el-table-column>
-      <el-table-column prop="EffectDate" label="变更后有效日期" show-overflow-tooltip>
-        <template slot-scope="scope">
-          {{ jstimehandle(scope.row.EffectDate+'') }}
-        </template>
-      </el-table-column>
-      <el-table-column prop="Remark" label="描述" show-overflow-tooltip></el-table-column>
-    </el-table>
+      <el-table :data="subfileList" border>
+        <el-table-column label="操作" width="150" align="center" fixed>
+          <template slot-scope="scope">
+            <el-button type="primary" plain size="mini" title="文件变更" @click="openDialog(scope.row)">变更</el-button>
+          </template>
+        </el-table-column>
+        <el-table-column prop="NeedFileType" label="文件分类" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="OldFileName" label="原文件" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="OldEffectDate" label="原有效日期" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{ jstimehandle(scope.row.OldEffectDate+'') }}
+          </template>
+        </el-table-column>
+        <el-table-column prop="FileName" label="变更后文件" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="EffectDate" label="变更后有效日期" show-overflow-tooltip>
+          <template slot-scope="scope">
+            {{ jstimehandle(scope.row.EffectDate+'') }}
+          </template>
+        </el-table-column>
+        <el-table-column prop="Remark" label="描述" show-overflow-tooltip></el-table-column>
+      </el-table>
 
-    <el-dialog :title="Title" :visible.sync="visible" top="5vh">
-      <el-form :model="SubfileForm" label-width="100px">
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="有效日期" required>
-              <el-date-picker style="width: 100%" v-model="SubfileForm.EffectDate" type="date" placeholder="请选择有效日期">
-              </el-date-picker>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="描述">
-              <el-input v-model="SubfileForm.Remark" type="textarea" :rows=3 placeholder="请输入备注信息"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
+      <el-dialog :title="Title" :visible.sync="visible" top="5vh">
+        <el-form :model="SubfileForm" label-width="100px">
+          <el-row>
+           <el-col :span="12">
             <el-form-item label="资质文件">
               <el-upload style="margin-top: 10px;" action="" ref="refuploadattach" :http-request="uploadrequest"
                 class="attach-uploader" :before-upload="beforeAvatarUpload">
@@ -75,32 +65,26 @@
               </el-upload>
             </el-form-item>
           </el-col>
-          <el-col :span="24">
-            <el-form-item class="maintainlog" label="" label-width="120px">
-              <div style="overflow: auto;">
-                <template>
-                  <el-row>
-                    <el-col :span="24" v-for="(v,K) in doclist" :key="v">
-                      <span>
-                        <el-button size="small" type="text" icon="el-icon-delete" title="删除" @click="deletefile(K)">
-                        </el-button>
-                      </span>
-                      <a style="margin-left:10px" @click="clickachment(v.url)">{{ v.name }}</a>
-                    </el-col>
-                  </el-row>
-                </template>
-              </div>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
-      <div slot="footer" class="dialog-footer" style="margin-top:-30px;">
-        <el-button @click="visible = false">取 消</el-button>
-        <el-button type="primary" @click="makesure()">确 定</el-button>
-      </div>
-    </el-dialog>
+            <el-col :span="12">
+              <el-form-item label="有效日期" required>
+                <el-date-picker style="width: 100%" v-model="SubfileForm.EffectDate" type="date" placeholder="请选择有效日期">
+                </el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="24">
+              <el-form-item label="描述">
+                <el-input v-model="SubfileForm.Remark" type="textarea" :rows=3 placeholder="请输入备注信息"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <div slot="footer" class="dialog-footer" style="margin-top:-30px;">
+          <el-button @click="visible = false">取 消</el-button>
+          <el-button type="primary" @click="makesure()">确 定</el-button>
+        </div>
+      </el-dialog>
     </el-card>
-     <!-- <el-dialog title="提交申请" :visible.sync="commitshow" width="360px">
+    <el-dialog title="提交申请" :visible.sync="commitshow" width="360px">
       <el-form label-width="90px" :model="entityForm" :rules="rules" ref="EntityFormref">
         <el-row>
           <el-col :span="24">
@@ -116,7 +100,7 @@
             <el-form-item label="审批人" prop="auditer" required>
               <el-select ref="selectAuditer" v-model="entityForm.auditer" placeholder="请选择" style="width: 100%"
                 filterable allow-create default-first-option>
-               <el-option v-for="item in auditerOption" :key="item.id" :label="item.realname" :value="item.id">
+                <el-option v-for="item in auditerOption" :key="item.id" :label="item.realname" :value="item.id">
                 </el-option>
               </el-select>
             </el-form-item>
@@ -125,10 +109,10 @@
       </el-form>
       <span style="float: right;margin-top:-10px;">
         <el-button size="small" @click="commitshow = false">取 消</el-button>
-        <el-button type="primary" size="small" @click="addInfoChangeAudit()">确 定</el-button>
+        <el-button type="primary" size="small" @click="addQualChangeAudit()">确 定</el-button>
       </span>
       <br>
-    </el-dialog> -->
+    </el-dialog>
 
   </div>
 </template>
@@ -137,10 +121,12 @@
   import {
     mapGetters
   } from 'vuex'
-  // import BusinessList from '@/components/oilsupplier/businesslist'
-  import api from '@/api/oilsupplier/technologyservice';
-  // import SubfileList from '@/components/oilsupplier/subfilelist'
+  import supplierapi from '@/api/oilsupplier/supplier'
+  import api from '@/api/oilsupplier/technologyservice'
   import uploadajax from '@/assets/js//uploadajax.js'
+  import quaapi from '@/api/oilsupplier/qualchange'
+  import axios from 'axios'
+ // import uploadajax from '../../assets/js/uploadajax.js'
   export default {
     computed: {
       ...mapGetters({
@@ -166,17 +152,26 @@
         subfileList: [],
         techList: [],
         techTreeList: [],
+        orgtreelist: [],
         orgtreeprops: {
           value: 'id',
-          label: 'Name',
+          label: 'Fullname',
           children: 'children'
         },
         selectedorg: [],
-
+        entityForm: {
+          Id: '',
+          SupplierName: '',
+          SupplierId: '',
+          SupplierTypeName: '',
+          FirstAudit: '',
+          auditer: '',
+        },
         Title: '',
         SubfileForm: {
           Id: '',
           SupplierId: '',
+          SupplierCertId: '',
           SupplierTypeCode: '',
           SupplierCertSubId: '',
           CertSubName: '',
@@ -187,18 +182,33 @@
           FileName: '',
           EffectDate: new Date(),
           FileUrl: '',
+          OldFileName: '',
+          OldEffectDate: new Date(),
+          OldFileUrl: '',
           OtherRemark: '',
           Remark: '',
           IsDelete: 0
         },
         visible: false,
         selfVisible: this.visible, // 避免vue双向绑定警告
-
+        rules: {
+          FirstAudit: [{
+            required: true,
+            message: '请选择初审单位',
+            trigger: 'blur'
+          }],
+          auditer: [{
+            required: true,
+            message: '请选择审批人',
+            trigger: 'blur'
+          }]
+        },
         waituploads: [], // 等待上传的附件列表
         doclist: [],
         QualStatus: '',
         butnab: false,
         commitshow: false,
+        auditerOption: [],
       }
     },
     created() {
@@ -210,13 +220,12 @@
         this.classId = this.$route.query.classId + ''
       }
       this.QualStatus = this.$route.query.QualStatus
-      if (this.QualStatus > 0){
-        this.butnab = true
+      if (this.QualStatus > 0) {
+        this.butnab = false
       }
       this.SupplierId = this.serviceId
       this.SupplierTypeCode = this.classId
       this.SupplierCertId = this.certId
-      console.log("---Id---", this.certId, this.serviceId)
       this.getDictOptions()
       this.initData()
       this.getbusList()
@@ -230,17 +239,44 @@
           _currentPage: 1,
           _size: 1000,
         }
-        _this.$axios.get('supplierfile/filelist', {
+        _this.$axios.get('qualchange/filelist', {
             params
           })
           .then(res => {
             _this.subfileList = res.data.items
             _this.currentItemCount = res.data.currentItemCount
+            console.log("----this.subfileList---",this.subfileList)
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      getorgtreelist() {
+        let _this = this
+        let params = {
+          IsInnerOrganize: 1
+        }
+        _this.$axios.get('organizes/orgalllist', {
+            params
+          })
+          .then(res => {
+            _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
           })
           .catch(err => {
             console.error(err)
           })
       },
+      auditOrgChang(val) {
+        this.auditerOption = []
+        this.entityForm.auditer = ''
+        let auditstepcode = 'FIRST_TRIAL'
+        supplierapi.getAuditerByDept(val[val.length - 1], auditstepcode, this.$axios).then(res => {
+          console.log("---res.data.item--", res.data)
+          this.auditerOption = res.data.item
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       getDictOptions() {
         api.getDictList(this.$axios).then(res => {
           //this.wellNoOptions = res.data.items['WellNo']
@@ -267,26 +303,30 @@
             console.error(err)
           })
       },
+      //保存修改
       makesure() {
-          if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
+        if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
             // 上传附件是否完成判断
             if (!this.attachissuccess()) {
               this.$message.error('有附件未成功上传!不能保存数据')
               return
             }
             this.getattachissuccess()
-            this.editSubfile()
+            this.editqualchange()
           } else {
-            this.editSubfile()
+            this.editqualchange()
           }
       },
-      editSubfile() {
+      editqualchange() {
         let _this = this
         _this.SubfileForm.SupplierId = parseInt(_this.SubfileForm.SupplierId)
         _this.SubfileForm.SupplierCertSubId = parseInt(_this.SubfileForm.SupplierCertSubId)
-        _this.$axios.put('/supplierfile/editsubfile/' + _this.SubfileForm.Id, _this.SubfileForm)
+        _this.SubfileForm.SupplierCertId = parseInt(_this.SupplierCertId)
+        console.log("----this.SubfileForm---",this.SubfileForm)
+        _this.$axios.put('/qualchange/editqualchange/' + _this.SubfileForm.Id, _this.SubfileForm)
           .then(res => {
             if (res.data.code === 0) {
+              this.butnab = true
               _this.$message({
                 type: 'success',
                 message: res.data.message,
@@ -306,7 +346,8 @@
           })
       },
       openDialog(val) {
-        this.Title = '编辑文件'
+        console.log("======val----",val)
+        this.Title = '资质变更'
         this.SubfileForm.Id = val.Id
         this.SubfileForm.SupplierId = val.SupplierId
         this.SubfileForm.SupplierTypeCode = val.SupplierTypeCode
@@ -320,9 +361,9 @@
         this.SubfileForm.NeedFileCode = val.NeedFileCode
         this.SubfileForm.FileExt = val.FileExt
         this.SubfileForm.FileType = val.FileType
-        this.SubfileForm.FileName = val.FileName
-        this.SubfileForm.EffectDate = new Date(val.EffectDate)
-        this.SubfileForm.FileUrl = val.FileUrl
+        this.SubfileForm.OldFileName = val.OldFileName
+        this.SubfileForm.OldEffectDate = new Date(val.OldEffectDate)
+        this.SubfileForm.OldFileUrl = val.OldFileUrl
         this.SubfileForm.OtherRemark = val.OtherRemark
         if (val.FileUrl != '') {
           this.getwendanginfo(val.FileUrl)
@@ -377,7 +418,7 @@
             })
           })
       },
-     // 判断附件是否上传成功
+       // 判断附件是否上传成功
       attachissuccess() {
         if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
           for (let i = 0; i < this.$refs.refuploadattach.uploadFiles.length; i++) {
@@ -404,26 +445,32 @@
           }
         }
       },
-      clickachment(url, uid) {
-        window.open(`http://${url}`)
-      },
-      deletefile() {
-        let _this = this
-        _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
-            confirmButtonText: '确定',
-            cancelButtonText: '取消',
-            type: 'warning'
-          })
-          .then(() => {
-            _this.doclist = []
-          })
-          .catch(() => {})
-      },
-
       submitqualChange() {
         this.getorgtreelist()
         this.commitshow = true
       },
+      addQualChangeAudit() {
+        console.log("==this.SupplierId====", this.SupplierId)
+        quaapi.auditEntity(this.SupplierId, this.entityForm.auditer, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            // 保存成功后,初始化数据,变成修改
+            this.initData()
+            this.commitshow = false
+            this.butnab = false
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       jstimehandle(val) {
         if (val === '') {
           return '----'

+ 8 - 17
src/dashoo.cn/frontend_web/src/pages/oilsupplier/qualchange/index.vue

@@ -40,7 +40,7 @@
         <el-table-column label="操作" min-width="90" align="center" fixed>
           <template slot-scope="scope">
             <router-link :to="'/oilsupplier/qualchange/' + scope.row.Id + '/operation?certid=' + scope.row.CertId +'&classId='+ scope.row.SupplierTypeCode +'&QualStatus='+scope.row.Status">
-              <el-button type="primary" plain title="编辑" size="mini">编辑</el-button>
+              <el-button type="primary" plain title="资质变更" size="mini">资质变更</el-button>
             </router-link>
           </template>
         </el-table-column>
@@ -53,28 +53,19 @@
         <el-table-column sortable min-width="110" align="center" prop="Status" label="审核状态">
           <template slot-scope="scope">
             <el-alert v-if="scope.row.Status=='2'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title="初审未通过" type="warning">
+              title="待法规处审核" type="warning">
             </el-alert>
-            <el-alert v-if="scope.row.Status=='4'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title=" 待集中评审" type="warning">
-            </el-alert>
-            <el-alert v-if="scope.row.Status=='0'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title="已申请" type="info">
+            <el-alert v-if="scope.row.Status=='-2'" :closable="false" style="background:rgba(255,255,255,0.2)"
+              title="初审未通过" type="error">
             </el-alert>
             <el-alert v-if="scope.row.Status=='1'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title="待二级复审 " type="warning">
+              title="已申请" type="info">
             </el-alert>
-            <el-alert v-if="scope.row.Status=='5'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title="待交费 " type="warning">
+            <el-alert v-if="scope.row.Status=='-3'" :closable="false" style="background:rgba(255,255,255,0.2)"
+              title="审核未通过" type="success">
             </el-alert>
             <el-alert v-if="scope.row.Status=='3'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title=" 待专业科室审核" type="warning">
-            </el-alert>
-            <el-alert v-if="scope.row.Status=='6'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title=" 待入库" type="warning">
-            </el-alert>
-            <el-alert v-if="scope.row.Status=='7'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title=" 完成" type="success">
+              title="审核通过" type="success">
             </el-alert>
           </template>
         </el-table-column>

+ 37 - 26
src/dashoo.cn/frontend_web/src/pages/oilsupplier/qualchange/qualaudit.vue

@@ -37,12 +37,13 @@
         </el-form>
       </div>
       <el-table :data="entityList" border height="calc(100vh - 243px)" style="width: 100%" @sort-change="orderby">
-        <el-table-column label="操作" min-width="90" align="center" fixed>
-          <!-- <template slot-scope="scope"> -->
-            <!-- <router-link :to="'/oilsupplier/qualchange/' + scope.row.Id + '/operation?certid=' + scope.row.CertId +'&classId='+ scope.row.SupplierTypeCode"> -->
-              <el-button type="primary" plain title="审核" size="mini">审核</el-button>
-            <!-- </router-link> -->
-          <!-- </template> -->
+        <el-table-column label="操作" min-width="150" align="center" fixed>
+          <template slot-scope="scope">
+           <router-link :to="'/oilsupplier/qualchange/' + scope.row.SupplierId + '/auditoperation?certid=' + scope.row.SupplierCertId +'&QualId='+ scope.row.Id +'&QualStatus='+scope.row.Status">
+            <el-button type="primary" plain title="审核" size="mini">审核</el-button>
+            </router-link>
+            <el-button type="primary" style="margin-left: 8px;" plain title="审批历史" size="mini" @click="getvalues(scope.row)">审批历史</el-button>
+          </template>
         </el-table-column>
         <el-table-column prop="AccessCardNo" label="准入证号" sortable min-width="110" align="center" show-overflow-tooltip>
         </el-table-column>
@@ -53,28 +54,19 @@
         <el-table-column sortable min-width="110" align="center" prop="Status" label="审核状态">
           <template slot-scope="scope">
             <el-alert v-if="scope.row.Status=='2'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title="初审未通过" type="warning">
+              title="待法规处审核" type="warning">
             </el-alert>
-            <el-alert v-if="scope.row.Status=='4'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title=" 待集中评审" type="warning">
-            </el-alert>
-            <el-alert v-if="scope.row.Status=='0'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title="已申请" type="info">
+            <el-alert v-if="scope.row.Status=='-2'" :closable="false" style="background:rgba(255,255,255,0.2)"
+              title="初审未通过" type="error">
             </el-alert>
             <el-alert v-if="scope.row.Status=='1'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title="待二级复审 " type="warning">
+              title="已申请" type="info">
             </el-alert>
-            <el-alert v-if="scope.row.Status=='5'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title="待交费 " type="warning">
+            <el-alert v-if="scope.row.Status=='-3'" :closable="false" style="background:rgba(255,255,255,0.2)"
+              title="审核未通过" type="success">
             </el-alert>
             <el-alert v-if="scope.row.Status=='3'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title=" 待专业科室审核" type="warning">
-            </el-alert>
-            <el-alert v-if="scope.row.Status=='6'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title=" 待入库" type="warning">
-            </el-alert>
-            <el-alert v-if="scope.row.Status=='7'" :closable="false" style="background:rgba(255,255,255,0.2)"
-              title=" 完成" type="success">
+              title="审核通过" type="success">
             </el-alert>
           </template>
         </el-table-column>
@@ -128,16 +120,23 @@
         <el-button size="mini" type="primary" @click="handleSearch">查 询</el-button>
       </span>
     </el-dialog>
+    <el-dialog title="审核历史查看" :visible.sync="historyVisible" width="900px">
+      <wf-history ref="WfHistory" :entryinfo="entrydetail"></wf-history>
+    </el-dialog>
   </div>
 </template>
 <script>
   import {
     mapGetters
-  } from 'vuex';
-  import supplierapi from '@/api/oilsupplier/supplier';
-  import api from '@/api/oilsupplier/qualchange';
+  } from 'vuex'
+  import WfHistory from '@/components/workflow/wfhistory.vue'
+  import supplierapi from '@/api/oilsupplier/supplier'
+  import api from '@/api/oilsupplier/qualchange'
 
   export default {
+    components: {
+      WfHistory,
+    },
     computed: {
       ...mapGetters({
         authUser: 'authUser'
@@ -147,6 +146,7 @@
 
     data() {
       return {
+        historyVisible: false,
         addshow: false,
         dialogVisible: false,
         delevisble: false,
@@ -203,7 +203,12 @@
           ModifiedOn: '',
           ModifiedUserId: '',
           ModifiedBy: '',
-
+        },
+        //工作流
+        entrydetail: {
+          process: 'oil_qual_change',
+          business: '',
+          instance: '',
         },
       }
     },
@@ -256,6 +261,12 @@
         })
       },
 
+      getvalues(val) {
+        this.entrydetail.business = val.Id
+        this.entrydetail.instance = val.WorkFlowId
+        this.historyVisible = true
+      },
+
       searchCommand(command) {
         if (command == 'search') {
           this.dialogVisible = true