Răsfoiți Sursa

增项-变更信息-变更资质

lining 5 ani în urmă
părinte
comite
7e5cfa6c55
19 a modificat fișierele cu 3813 adăugiri și 471 ștergeri
  1. 30 0
      src/dashoo.cn/backend/api/business/oilsupplier/suppliercertappendsub/oilsuppliercertappendsub.go
  2. 40 0
      src/dashoo.cn/backend/api/business/oilsupplier/suppliercertappendsub/oilsuppliercertappendsubService.go
  3. 1 0
      src/dashoo.cn/backend/api/controllers/base.go
  4. 2 2
      src/dashoo.cn/backend/api/controllers/oilsupplier/infochange.go
  5. 6 2
      src/dashoo.cn/backend/api/controllers/oilsupplier/qualchange.go
  6. 60 0
      src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertappend.go
  7. 127 0
      src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertappendsub.go
  8. 2 2
      src/dashoo.cn/backend/api/controllers/oilsupplier/supplierfile.go
  9. 6 0
      src/dashoo.cn/frontend_web/src/api/oilsupplier/supplierappendsub.js
  10. 974 96
      src/dashoo.cn/frontend_web/src/pages/oilsupplier/addtionaudit/_opera/basisdataopera.vue
  11. 1052 107
      src/dashoo.cn/frontend_web/src/pages/oilsupplier/addtionaudit/_opera/goodsdataopera.vue
  12. 959 97
      src/dashoo.cn/frontend_web/src/pages/oilsupplier/addtionaudit/_opera/techdataopera.vue
  13. 166 59
      src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/basisdataopera.vue
  14. 227 67
      src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/goodsdataopera.vue
  15. 151 34
      src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/techdataopera.vue
  16. 2 1
      src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/basislist.vue
  17. 2 1
      src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/goodslist.vue
  18. 2 1
      src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/index.vue
  19. 4 2
      src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/techlist.vue

+ 30 - 0
src/dashoo.cn/backend/api/business/oilsupplier/suppliercertappendsub/oilsuppliercertappendsub.go

@@ -59,4 +59,34 @@ type OilAppendChangeItem struct {
 	ModifiedOn       time.Time `xorm:"DATETIME"`
 	ModifiedUserId   int       `xorm:"INT(10)"`
 	ModifiedBy       string    `xorm:"VARCHAR(50)"`
+}
+
+type OilAppendChangeDetail 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)"`
+	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(2000)"`
+	FileName          string    `xorm:"not null default '' comment('文件名称') VARCHAR(2000)"`
+	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(2000)"`
+	FileUrl           string    `xorm:"VARCHAR(2000)"`
+	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)"`
 }

+ 40 - 0
src/dashoo.cn/backend/api/business/oilsupplier/suppliercertappendsub/oilsuppliercertappendsubService.go

@@ -3,6 +3,7 @@ package suppliercertappendsub
 import (
 	. "dashoo.cn/backend/api/mydb"
 	"github.com/go-xorm/xorm"
+	"strconv"
 )
 
 type OilSupplierCertAppendSubService struct {
@@ -14,3 +15,42 @@ func GetOilSupplierCertAppendSubService(xormEngine *xorm.Engine) *OilSupplierCer
 	s.DBE = xormEngine
 	return s
 }
+
+func (s *OilSupplierCertAppendSubService) GetQualPagingEntities(FileName, qualChangeName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where, MInfoId 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, a.IsDelete `
+	sql += ` from ` + FileName + ` a `
+	if MInfoId != "" {
+		sql += ` left join ` + qualChangeName + " b on b.FileId = a.Id AND b.ParentId =" + MInfoId
+	} else {
+		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
+}

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

@@ -279,6 +279,7 @@ var (
 	OilSupplierSceneFileName                 string = "OilSupplierSceneFile" // 现场考察报告
 	OilCatalogSubName                        string = "OilCatalogSub" // 目录提交审核的主表
 	OilAppendChangeItemName                  string = "OilAppendChangeItem" // 增项信息变更的表
+	OilAppendChangeDetailName                string = "OilAppendChangeDetail" // 增项资质变更
 )
 
 //分页信息及数据

+ 2 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/infochange.go

@@ -1443,8 +1443,8 @@ func (this *InfoChangeController) InfoAudit() {
 			s := time.Since(t)
 			log.Println(s, "============================")
 			var qualdetail []qualchange.OilQualChangeDetail
-			where := "SupplierId = " + utils.ToStr(dataother.SuppId)
-			svc.GetEntities(&qualdetail, where)
+			where1 := "SupplierId = " + utils.ToStr(dataother.SuppId) + " and ParentId=" + strconv.Itoa(infoid)
+			svc.GetEntities(&qualdetail, where1)
 			if len(qualdetail) > 0 {
 				for i := 0; i < len(qualdetail); i++ {
 					var supfilemodel supplierfile.OilSupplierFile

+ 6 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/qualchange.go

@@ -3,6 +3,7 @@ package oilsupplier
 import (
 	"dashoo.cn/backend/api/business/audithistory"
 	"dashoo.cn/backend/api/business/auditsetting"
+	"dashoo.cn/backend/api/business/oilsupplier/tableheader"
 	"dashoo.cn/business2/parameter"
 	"encoding/json"
 	"strconv"
@@ -565,10 +566,13 @@ func (this *QualChangeController) AddQualChange() {
 	svc := qualchange.GetQualChangeService(utils.DBE)
 
 	var supplierfile supplierfile.OilSupplierFile
-
 	where := "SupplierId = '" + strconv.Itoa(model.SupplierId) + "' and NeedFileType='" + model.NeedFileType + "'"
 	has := svc.GetEntity(&supplierfile, where)
 
+	var tableHeader tableheader.BaseTableheader
+	where1 := "Name = '" + model.NeedFileType + "'"
+	svc.GetEntityByWhere(BaseTableHeader, where1, &tableHeader)
+
 	if has {
 		errinfo.Message = "操作失败!不能重复添加"
 		errinfo.Code = -1
@@ -579,7 +583,7 @@ func (this *QualChangeController) AddQualChange() {
 
 	supplierfile.SupplierId = model.SupplierId
 	supplierfile.SupplierTypeCode = model.SupplierTypeCode
-	supplierfile.IsManuf = ""
+	supplierfile.IsManuf = tableHeader.IsManuf
 	supplierfile.NeedFileType = model.NeedFileType
 	supplierfile.FileType = 1
 	supplierfile.SupType = 4

+ 60 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertappend.go

@@ -936,6 +936,24 @@ func (this *OilSupplierCertAppendController) AuditEntityFir() {
 				} else {
 					status = suppliercert.ALL_PASE_STATUS
 				}
+				//  信息变更
+				var infoitems []suppliercertappendsub.OilAppendChangeItem
+				where := "SupplierId = " + utils.ToStr(supplierCertAppendEntity.SupplierId) +" and InfoId = " +utils.ToStr(supplierCertAppendEntity.Id)
+				svc.GetEntities(&infoitems, where)
+				this.updatesupplier(OilSupplierName, supplierCertAppendEntity.SupplierId, infoitems)
+				// 更新资质
+				var qualdetail []suppliercertappendsub.OilAppendChangeDetail
+				wheres := "SupplierId = " + utils.ToStr(supplierCertAppendEntity.SupplierId) + " and ParentId=" + strconv.Itoa(supplierCertAppendEntity.Id)
+				svc.GetEntities(&qualdetail, wheres)
+				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
+						svc.UpdateEntityBytbl(OilSupplierFileName, qualdetail[i].FileId, &supfilemodel, []string{"FileName", "FileUrl", "EffectDate"})
+					}
+				}
 			}
 			if status == suppliercert.ALL_PASE_STATUS {
 				appsvc := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
@@ -954,6 +972,24 @@ func (this *OilSupplierCertAppendController) AuditEntityFir() {
 				var appendmodel suppliercertappend.OilSupplierCertAppend
 				appendmodel.Status = suppliercert.ALL_PASE_STATUS
 				appsvc.UpdateEntityBywheretbl(OilSupplierCertAppendName, &appendmodel, []string{"Status"}, appdwhere)
+				//  信息变更
+				var infoitems []suppliercertappendsub.OilAppendChangeItem
+				where := "SupplierId = " + utils.ToStr(supplierCertAppendEntity.SupplierId) +" and InfoId = " +utils.ToStr(supplierCertAppendEntity.Id)
+				svc.GetEntities(&infoitems, where)
+				this.updatesupplier(OilSupplierName, supplierCertAppendEntity.SupplierId, infoitems)
+				// 更新资质
+				var qualdetail []suppliercertappendsub.OilAppendChangeDetail
+				wheres := "SupplierId = " + utils.ToStr(supplierCertAppendEntity.SupplierId) + " and ParentId=" + strconv.Itoa(supplierCertAppendEntity.Id)
+				svc.GetEntities(&qualdetail, wheres)
+				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
+						svc.UpdateEntityBytbl(OilSupplierFileName, qualdetail[i].FileId, &supfilemodel, []string{"FileName", "FileUrl", "EffectDate"})
+					}
+				}
 			}
 			supplierCertAppendEntity.Status = status
 			supplierCertAppendEntity.Step = step
@@ -1029,3 +1065,27 @@ func (this *OilSupplierCertAppendController) AuditEntityFir() {
 		}
 	}
 }
+
+
+//更新供方信息表
+func (this *OilSupplierCertAppendController) updatesupplier(supname string, suppid int, infoitems []suppliercertappendsub.OilAppendChangeItem) error {
+	svc := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
+	var err error
+	if len(infoitems) > 0 {
+		for i := 0; i < len(infoitems); i++ {
+			//var cols []string
+			//cols = append(cols, infoitems[i].SelectItem)
+			where := " Id = " + utils.ToStr(suppid)
+			var sql string
+			if infoitems[i].SelectItem == "SetupTime" {
+				sql = `UPDATE ` + supname + ` set ` + infoitems[i].SelectItem + ` = '` + infoitems[i].ChangeInfo[0: 10] + `' where ` + where
+			} else {
+				sql = `UPDATE ` + supname + ` set ` + infoitems[i].SelectItem + ` = '` + infoitems[i].ChangeInfo + `' where ` + where
+			}
+			_, err = svc.DBE.Exec(sql)
+			//err = svc.UpdateEntityBytbl(OilSupplierName, suppid, &supmodel, cols)
+		}
+	}
+
+	return err
+}

+ 127 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertappendsub.go

@@ -1020,4 +1020,131 @@ func (this *OilSupplierCertAppendSubController) AddInfoChangeItemCh() {
 		this.Data["json"] = &errinfo
 		this.ServeJSON()
 	}
+}
+
+// @Title 资质文件
+// @Description get user by token
+// @Success 200 {object} models.Userblood
+// @router /filelist [get]
+func (this *OilSupplierCertAppendSubController) FileList() {
+	page := this.GetPageInfoForm()
+	var list []suppliercertappendsub.OilAppendChangeDetail
+	svc := suppliercertappendsub.GetOilSupplierCertAppendSubService(utils.DBE)
+	where := " 1=1"
+	orderby := "a.Id"
+	asc := true
+	Order := this.GetString("Order")
+	Prop := this.GetString("Prop")
+	if Order != "" && Prop != "" {
+		orderby = Prop
+		if Order == "asc" {
+			asc = true
+		}
+	}
+	SupplierId := this.GetString("SupplierId")
+	MInfoId := this.GetString("MInfoId")
+	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, OilAppendChangeDetailName, page.CurrentPage, page.Size, orderby, asc, &list, where, MInfoId)
+	var datainfo DataInfo
+	datainfo.Items = list
+	datainfo.CurrentItemCount = total
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
+// @Title 资质文件变更上传
+// @Description 更新文件上传
+// @Param	id	path	string	true
+// @Success	200	{object}
+// @router /editqualchange/:id [put]
+func (this *OilSupplierCertAppendSubController) EditQualChange() {
+	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 suppliercertappendsub.OilAppendChangeDetail
+	var jsonblob = this.Ctx.Input.RequestBody
+	svc := suppliercertappendsub.GetOilSupplierCertAppendSubService(utils.DBE)
+	json.Unmarshal(jsonblob, &model)
+	model.FileUrl = strings.Trim(model.FileUrl, "$")
+	model.FileName = strings.Trim(model.FileName, "$")
+	model.OldFileUrl = strings.Trim(model.OldFileUrl, "$")
+	model.OldFileName = strings.Trim(model.OldFileName, "$")
+	var err error
+	var entity suppliercertappendsub.OilAppendChangeDetail
+	var qualdetaimodel []suppliercertappendsub.OilAppendChangeDetail
+
+
+	qdwhere := " SupplierId = " + utils.ToStr(model.SupplierId) + " and FileId = " + utils.ToStr(model.Id) + " and ParentId=" + id
+	svc.GetEntitysByWhere(OilAppendChangeDetailName, qdwhere, &qualdetaimodel)
+	entity = model
+	entity.Id = 0
+	entity.ParentId, _ = strconv.Atoi(id)
+	entity.SupplierCertId = model.SupplierCertId
+	entity.FileId = model.Id
+	if len(qualdetaimodel) == 0 {
+		entity.CreateOn = time.Now()
+		entity.CreateBy = this.User.Realname
+		entity.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+		_, err = svc.InsertEntityBytbl(OilAppendChangeDetailName, &entity)
+	} else {
+		err = svc.UpdateEntityBywheretbl(OilAppendChangeDetailName, &entity, []string{"OldEffectDate", "FileUrl", "FileName", "OtherRemark"}, qdwhere)
+	}
+
+	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 /deletenewfile/:Id [delete]
+func (this *OilSupplierCertAppendSubController) DeleteNewFile() {
+	Id := this.Ctx.Input.Param(":Id")
+	var errinfo ErrorInfo
+	if Id == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+
+	svc := suppliercertappendsub.GetOilSupplierCertAppendSubService(utils.DBE)
+
+	where := "FileId=" + Id
+	err := svc.DeleteEntityBytbl(OilAppendChangeDetailName, where)
+
+	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()
+	}
 }

+ 2 - 2
src/dashoo.cn/backend/api/controllers/oilsupplier/supplierfile.go

@@ -45,9 +45,9 @@ func (this *SupplierfileController) AllFileList() {
 		where = where + " and SupplierId = '" + SupplierId + "'"
 	}
 	SupplierTypeCode := this.GetString("SupplierTypeCode")
-	AppendId := this.GetString("AppendId")
+	//AppendId := this.GetString("AppendId")
 	if SupplierTypeCode != "" {
-		where = where + " and SupplierCertSubId= "+ AppendId +" and SupplierTypeCode in ( '000', '" + SupplierTypeCode + "')"
+		where = where + " and SupplierTypeCode in ( '000', '" + SupplierTypeCode + "')"
 	}
 	total := svc.GetPagingEntitiesWithoutAccCode(page.CurrentPage, page.Size, orderby, asc, &list, where)
 	var datainfo DataInfo

+ 6 - 0
src/dashoo.cn/frontend_web/src/api/oilsupplier/supplierappendsub.js

@@ -72,5 +72,11 @@ export default {
       method: 'post',
       data: formData
     })
+  },
+  deleteNewFile (Id, myAxios) {
+    return myAxios({
+      url: '/suppliercertappendsub/deletenewfile/' + Id,
+      method: 'delete'
+    })
   }
 }

Fișier diff suprimat deoarece este prea mare
+ 974 - 96
src/dashoo.cn/frontend_web/src/pages/oilsupplier/addtionaudit/_opera/basisdataopera.vue


Fișier diff suprimat deoarece este prea mare
+ 1052 - 107
src/dashoo.cn/frontend_web/src/pages/oilsupplier/addtionaudit/_opera/goodsdataopera.vue


Fișier diff suprimat deoarece este prea mare
+ 959 - 97
src/dashoo.cn/frontend_web/src/pages/oilsupplier/addtionaudit/_opera/techdataopera.vue


+ 166 - 59
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/basisdataopera.vue

@@ -470,33 +470,51 @@
             <el-card class="box-card" style="margin-top: 10px;">
               <div slot="header" class="clearfix">
                 <span><i class="icon icon-table2"></i> 企业资质</span>
-                <el-button style="float: right; padding: 3px 0" type="text" @click="showDialog" >添加</el-button>
+                <!--<el-button style="float: right; padding: 3px 0" type="text" @click="showDialog" >添加</el-button>-->
               </div>
-              <el-table :data="subfileList" size="mini" border>
+              <el-table :data="subfileList1" 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)"
-                               :disabled="scope.row.SupType != 2||formData.Status > 0">上传
-                    </el-button>
-                    <el-button type="primary" plain size="mini" title="删除" style="margin-left:3px"
-                               v-if="scope.row.FileType == '66'" @click="newdeletedata(scope.row)">删除</el-button>
+                    <el-button type="primary" plain size="mini" title="文件变更" :disabled="formData.Status > 0" @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="FileUrlList" label="资质文件" show-overflow-tooltip>
+                <el-table-column prop="NeedFileType" label="文件分类" show-overflow-tooltip></el-table-column>
+                <el-table-column prop="OldFileUrlList" label="原文件" show-overflow-tooltip>
                   <template slot-scope="scope">
-                    <div v-for="(tmpUrl, index) in scope.row.FileUrlList">
-                      <a :href="fileurlcut(scope.row.FileUrl, index)" target="_blank"
-                         class="buttonText">{{scope.row.FileName.split('$')[index]}}</a>
+                    <div v-for="(tmpUrl, index) in scope.row.OldFileUrlList">
+                      <a :href="'http://'+fileurlcut(scope.row.OldFileUrl, index)" target="_blank"
+                         class="buttonText">{{scope.row.OldFileName.split('$')[index]}}</a>
                     </div>
                   </template>
                 </el-table-column>
-                <el-table-column prop="EffectDate" label="有效日期" show-overflow-tooltip>
+                <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="FileUrlList" label="变更后文件" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <el-row align="middle">
+                      <el-col :span="20">
+                        <div v-for="(tmpUrl, index) in scope.row.FileUrlList">
+                          <a :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank"
+                             class="buttonText">{{scope.row.FileName.split('$')[index]}}
+                          </a>
+                        </div>
+                      </el-col>
+                      <el-col :span="4" v-if="scope.row.FileUrl != '' && formData.Status <= 0 && formData.Status != -5">
+                        <i class="el-icon-close" :style="{'float': 'right', 'height': '100%','line-height': lineheight(scope.row.FileUrlList.length)  + 'px',}" @click="iconclear(scope.row)"></i>
+                      </el-col>
+                    </el-row>
+                  </template>
+                </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="Remark" label="描述" show-overflow-tooltip></el-table-column>
               </el-table>
               <div style="float: right; margin: 20px;">
                 <el-button type="primary" size="mini" style="margin-right: 8px" @click="commitaudit"
@@ -512,7 +530,7 @@
       </div>
     </el-card>
     <el-dialog title="上传文件" :visible.sync="visible" top="5vh">
-      <el-form :model="SubfileForm" label-width="100px">
+      <el-form :model="SubfileForm" ref="subfileForm" :rules="rules" label-width="100px">
         <el-row>
           <el-col :span="12">
             <el-form-item label="资质名称" required>
@@ -925,7 +943,7 @@
         SupplierId: 0,
         SupplierTypeCode: '',
         SupplierCertId: 0,
-        subfileList: [],
+        subfileList1: [],
         visible: false,
         dynamicTableColumns: [],
         flag: '',
@@ -1266,7 +1284,14 @@
             required: true,
             message: '用户名',
             trigger: 'blur'
-          }]
+          }],
+          rules: {
+            NeedFileType: [
+              {required: true, message: '资质名称不能为空', trigger: 'blur'}
+            ],
+            EffectDate:
+              [{ required: true, message: '请选择有效日期', trigger: 'change' }]
+          }
         },
         // 增项信息表
         formData: {
@@ -1356,6 +1381,7 @@
       // this.serviceType = this.$route.params.opera //获取服务类型
       this.Id = this.$route.query.Id
       this.editFlag = this.$route.query.editFlag
+      this.supplierId = this.$route.query.sId
       if (this.editFlag == '1' && this.Id !== '') {
         this.getEntityById()
         this.dialogFormData.SupplierCertAppendId = this.Id
@@ -1368,8 +1394,60 @@
       this.orgtreeChange(this.majorDept)
       this.changeOrgUnit(this.selectDept)
       this.initTableHeader()
+      this.getsubfile()
     },
     methods: {
+      // =======================================
+      getsubfile () {
+        let _this = this
+        const params = {
+          SupplierId: this.supplierId,
+          SupplierTypeCode: '02',
+          MInfoId: this.Id
+        }
+        _this.$axios.get('suppliercertappendsub/filelist', {
+          params
+        })
+          .then(res => {
+            _this.subfileList1 = res.data.items
+            _this.currentItemCountProject = res.data.currentItemCount
+            for (let idx in _this.subfileList1) {
+              _this.subfileList1[idx].FileUrlList = _this.subfileList1[idx].FileUrl.split('$')
+            }
+            for (let idx1 in _this.subfileList1) {
+              _this.subfileList1[idx1].OldFileUrlList = _this.subfileList1[idx1].OldFileUrl.split('$')
+            }
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      iconclear (row) {
+        this.$confirm('该操作将删除新上传的资质,是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          api.deleteNewFile(row.Id, this.$axios).then(res => {
+            if (res.data.code === 0) {
+              this.getsubfile()
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          })
+        })
+      },
+
+      lineheight (list) {
+        return list * 23 + ''
+      },
       changeOrgUnit (val) {
         let auditstepcode = 'PROF_RECE'
         suppapi.getAuditerByDept(val, auditstepcode, this.$axios).then(res => {
@@ -1393,7 +1471,7 @@
                     type: 'success',
                     message: response.data.message
                   })
-                  _this.getFileList()
+                  _this.getsubfile()
                 } else {
                   _this.$message({
                     type: 'warning',
@@ -1434,7 +1512,7 @@
                 message: res.data.message
               })
               this.newVisible = false
-              this.getFileList()
+              this.getsubfile()
               this.$refs.newrefuploadattach.uploadFiles = []
             } else {
               _this.$message({
@@ -1596,50 +1674,70 @@
           console.error(err)
         })
       },
-      // 获取资质文件
-      getFileList () {
-        this.SupplierId = this.formData.SupplierId
-        this.SupplierTypeCode = this.formData.AppendType
+      // // 获取资质文件
+      // getFileList () {
+      //   this.SupplierId = this.formData.SupplierId
+      //   this.SupplierTypeCode = this.formData.AppendType
+      //   let _this = this
+      //   const params = {
+      //     AppendId: this.formData.Id,
+      //     SupplierId: this.SupplierId,
+      //     SupplierTypeCode: this.SupplierTypeCode,
+      //     _currentPage: 1,
+      //     _size: 1000
+      //   }
+      //   _this.$axios.get('supplierfile/filelistall', {
+      //     params
+      //   })
+      //     .then(res => {
+      //       _this.subfileList = res.data.items
+      //       _this.currentItemCount = res.data.currentItemCount
+      //       for (let idx in _this.subfileList) {
+      //         _this.subfileList[idx].FileUrlList = _this.subfileList[idx].FileUrl.split('$')
+      //       }
+      //     })
+      //     .catch(err => {
+      //       console.error(err)
+      //     })
+      // },
+      makesure () {
+        // if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
+        //   // 上传附件是否完成判断
+        //   if (!this.attachissuccess()) {
+        //     this.$message.error('有附件未成功上传!不能保存数据')
+        //     return
+        //   }
+        //   this.getattachissuccess()
+        //   this.editSubfile()
+        // } else {
+        //   this.editSubfile()
+        // }
         let _this = this
-        const params = {
-          AppendId: this.formData.Id,
-          SupplierId: this.SupplierId,
-          SupplierTypeCode: this.SupplierTypeCode,
-          _currentPage: 1,
-          _size: 1000
-        }
-        _this.$axios.get('supplierfile/filelistall', {
-          params
-        })
-          .then(res => {
-            _this.subfileList = res.data.items
-            _this.currentItemCount = res.data.currentItemCount
-            for (let idx in _this.subfileList) {
-              _this.subfileList[idx].FileUrlList = _this.subfileList[idx].FileUrl.split('$')
+        _this.$refs['subfileForm'].validate((valid) => {
+          if (valid) {
+            if (_this.$refs.refuploadattach.uploadFiles && _this.$refs.refuploadattach.uploadFiles.length > 0) {
+              // 上传附件是否完成判断
+              if (!_this.attachissuccess()) {
+                _this.$message.error('有附件未成功上传!不能保存数据')
+                return
+              }
+              _this.getattachissuccess()
+              _this.editqualchange()
+            } else {
+              _this.$message({
+                type: 'warning',
+                message: '请上传文件!'
+              })
             }
-          })
-          .catch(err => {
-            console.error(err)
-          })
-      },
-      makesure () {
-        if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
-          // 上传附件是否完成判断
-          if (!this.attachissuccess()) {
-            this.$message.error('有附件未成功上传!不能保存数据')
-            return
           }
-          this.getattachissuccess()
-          this.editSubfile()
-        } else {
-          this.editSubfile()
-        }
+        })
       },
-      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)
+        _this.$axios.put('/suppliercertappendsub/editqualchange/' + _this.Id, _this.SubfileForm)
           .then(res => {
             if (res.data.code === 0) {
               _this.$message({
@@ -1647,7 +1745,7 @@
                 message: res.data.message
               })
               this.visible = false
-              this.getFileList()
+              this.getsubfile()
               this.$refs.refuploadattach.uploadFiles = []
             } else {
               _this.$message({
@@ -1725,7 +1823,9 @@
         this.SubfileForm.FileExt = val.FileExt
         this.SubfileForm.FileType = val.FileType
         this.SubfileForm.FileName = val.FileName
-        this.SubfileForm.EffectDate = new Date(val.EffectDate)
+        this.SubfileForm.OldFileName = val.OldFileName
+        this.SubfileForm.OldEffectDate = new Date(val.OldEffectDate)
+        this.SubfileForm.OldFileUrl = val.OldFileUrl
         this.SubfileForm.FileUrl = val.FileUrl
         this.getwendanginfo(val.FileUrl)
         this.SubfileForm.OtherRemark = val.OtherRemark
@@ -1918,7 +2018,7 @@
           if (this.formData.InStyle == '2' || this.formData.InStyle == '6' || this.formData.InStyle == '4') {
             this.allowpre = false
           }
-          this.getFileList()
+          this.getsubfile()
           // 显示公司名
           _this.supplierOptions = _this.formData.SupplierId.toString()
           _this.getSortList()
@@ -2612,6 +2712,8 @@
       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') {
@@ -2625,6 +2727,11 @@
   }
 </script>
 <style lang='scss'>
+  .el-icon-close:hover
+  {
+    color:red;
+    cursor: pointer;
+  }
   .attach-uploader .el-upload {
     border: 1px dashed #63B8FF;
     cursor: pointer;

+ 227 - 67
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/goodsdataopera.vue

@@ -550,7 +550,7 @@
                       </template>
                     </el-table-column>
                     <el-table-column
-                      label="是否为制造商" width="100">
+                      label="是否为制造商" width="110">
                       <template slot-scope="scope">
                         <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 2" :disabled="isDisabledBtn()" @click="type_change(scope)">非制造商</el-button>
                         <el-button type="primary" plain size="mini" v-if="scope.row.IsManufacturer == 1" :disabled="isDisabledBtn()" @click="type_change(scope)">制造商</el-button>
@@ -568,40 +568,84 @@
             <el-card class="box-card" style="margin-top: 10px;">
               <div slot="header" class="clearfix">
                 <span><i class="icon icon-table2"></i> 企业资质</span>
-                <el-button style="float: right; padding: 3px 0" type="text" @click="showDialog" >添加</el-button>
+                <!--<el-button style="float: right; padding: 3px 0" type="text" @click="showDialog" >添加</el-button>-->
               </div>
-              <el-table :data="subfileList" size="mini" border>
+              <!--<el-table :data="subfileList" size="mini" 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)"-->
+                               <!--:disabled="formData.Status > 0">上传-->
+                    <!--</el-button>-->
+                    <!--<el-button type="primary" plain size="mini" title="删除" style="margin-left:3px"-->
+                               <!--v-if="scope.row.FileType == '66'" @click="newdeletedata(scope.row)">删除</el-button>-->
+                  <!--</template>-->
+                <!--</el-table-column>-->
+                <!--<el-table-column prop="NeedFileType" label="资质名称" show-overflow-tooltip></el-table-column>-->
+                <!--<el-table-column label="贸易/制造" v-if="SupplierTypeCode == '01'" show-overflow-tooltip>-->
+                  <!--<template slot-scope="scope">-->
+                    <!--<span v-if="scope.row.IsManuf=='1'">制造商</span>-->
+                    <!--<span v-else-if="scope.row.IsManuf=='2'">贸易商</span>-->
+                    <!--<span v-else>通用</span>-->
+                  <!--</template>-->
+                <!--</el-table-column>-->
+                <!--<el-table-column prop="FileUrlList" label="资质文件" show-overflow-tooltip>-->
+                  <!--<template slot-scope="scope">-->
+                    <!--<div v-for="(tmpUrl, index) in scope.row.FileUrlList">-->
+                      <!--<a :href="fileurlcut(scope.row.FileUrl, index)" target="_blank"-->
+                         <!--class="buttonText">{{scope.row.FileName.split('$')[index]}}</a>-->
+                    <!--</div>-->
+                  <!--</template>-->
+                <!--</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>-->
+              <el-table :data="subfileList1" 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)"
-                               :disabled="scope.row.SupType != 2||formData.Status > 0">上传
-                    </el-button>
-                    <el-button type="primary" plain size="mini" title="删除" style="margin-left:3px"
-                               v-if="scope.row.FileType == '66'" @click="newdeletedata(scope.row)">删除</el-button>
+                    <el-button type="primary" plain size="mini" title="文件变更" :disabled="formData.Status > 0" @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 label="贸易/制造" v-if="SupplierTypeCode == '01'" show-overflow-tooltip>
+                <el-table-column prop="NeedFileType" label="文件分类" show-overflow-tooltip></el-table-column>
+                <el-table-column prop="OldFileUrlList" label="原文件" show-overflow-tooltip>
                   <template slot-scope="scope">
-                    <span v-if="scope.row.IsManuf=='1'">制造商</span>
-                    <span v-else-if="scope.row.IsManuf=='2'">贸易商</span>
-                    <span v-else>通用</span>
+                    <div v-for="(tmpUrl, index) in scope.row.OldFileUrlList">
+                      <a :href="'http://'+fileurlcut(scope.row.OldFileUrl, index)" target="_blank"
+                         class="buttonText">{{scope.row.OldFileName.split('$')[index]}}</a>
+                    </div>
                   </template>
                 </el-table-column>
-                <el-table-column prop="FileUrlList" label="资质文件" show-overflow-tooltip>
+                <el-table-column prop="OldEffectDate" label="原有效日期" show-overflow-tooltip>
                   <template slot-scope="scope">
-                    <div v-for="(tmpUrl, index) in scope.row.FileUrlList">
-                      <a :href="fileurlcut(scope.row.FileUrl, index)" target="_blank"
-                         class="buttonText">{{scope.row.FileName.split('$')[index]}}</a>
-                    </div>
+                    {{ jstimehandle(scope.row.OldEffectDate+'') }}
+                  </template>
+                </el-table-column>
+                <el-table-column prop="FileUrlList" label="变更后文件" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <el-row align="middle">
+                      <el-col :span="20">
+                        <div v-for="(tmpUrl, index) in scope.row.FileUrlList">
+                          <a :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank"
+                             class="buttonText">{{scope.row.FileName.split('$')[index]}}
+                          </a>
+                        </div>
+                      </el-col>
+                      <el-col :span="4" v-if="scope.row.FileUrl != '' && formData.Status <= 0 && formData.Status != -5">
+                        <i class="el-icon-close" :style="{'float': 'right', 'height': '100%','line-height': lineheight(scope.row.FileUrlList.length)  + 'px',}" @click="iconclear(scope.row)"></i>
+                      </el-col>
+                    </el-row>
                   </template>
                 </el-table-column>
-                <el-table-column prop="EffectDate" label="有效日期" show-overflow-tooltip>
+                <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="Remark" label="描述" show-overflow-tooltip></el-table-column>
               </el-table>
               <div style="float: right; margin: 20px;">
                 <el-button type="primary" size="mini" style="margin-right: 8px" @click="commitaudit"
@@ -617,7 +661,7 @@
       </div>
     </el-card>
     <el-dialog title="上传文件" :visible.sync="visible" top="5vh">
-      <el-form :model="SubfileForm" size="mini" label-width="100px">
+      <el-form ref="subfileForm" :model="SubfileForm" :rules="rules" label-width="100px">
         <el-row>
           <el-col :span="12">
             <el-form-item label="资质名称" required>
@@ -1198,6 +1242,7 @@
         SupplierTypeCode: '',
         SupplierCertId: 0,
         subfileList: [],
+        subfileList1: [],
         visible: false,
         dynamicTableColumns: [],
         flag: '',
@@ -1334,6 +1379,7 @@
             trigger: 'blur'
           }]
         },
+        supplierId: '',
         Id: '', // 传的参数
         editFlag: '', // 编辑操作标记
         waituploads: [], // 等待上传的附件列表
@@ -1618,6 +1664,13 @@
             message: '用户名',
             trigger: 'blur'
           }]
+        },
+        rules: {
+          NeedFileType: [
+            {required: true, message: '资质名称不能为空', trigger: 'blur'}
+          ],
+          EffectDate:
+            [{ required: true, message: '请选择有效日期', trigger: 'change' }]
         }
       }
     },
@@ -1625,6 +1678,7 @@
       this.IsCompanyUser = this.authUser.Profile.IsCompanyUser
       // this.serviceType = this.$route.params.opera //获取服务类型
       this.Id = this.$route.query.Id
+      this.supplierId = this.$route.query.sId
       this.editFlag = this.$route.query.editFlag
       if (this.editFlag == '1' && this.Id !== '') {
         this.getEntityById()
@@ -1637,8 +1691,60 @@
       this.changeOrgUnit(this.selectDept)
       this.initTableHeader()
       this.initData2019()
+      this.getsubfile()
     },
     methods: {
+      // =======================================
+      getsubfile () {
+        let _this = this
+        const params = {
+          SupplierId: this.supplierId,
+          SupplierTypeCode: '01',
+          MInfoId: this.Id
+        }
+        _this.$axios.get('suppliercertappendsub/filelist', {
+          params
+        })
+          .then(res => {
+            _this.subfileList1 = res.data.items
+            _this.currentItemCountProject = res.data.currentItemCount
+            for (let idx in _this.subfileList1) {
+              _this.subfileList1[idx].FileUrlList = _this.subfileList1[idx].FileUrl.split('$')
+            }
+            for (let idx1 in _this.subfileList1) {
+              _this.subfileList1[idx1].OldFileUrlList = _this.subfileList1[idx1].OldFileUrl.split('$')
+            }
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      iconclear (row) {
+        this.$confirm('该操作将删除新上传的资质,是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          api.deleteNewFile(row.Id, this.$axios).then(res => {
+            if (res.data.code === 0) {
+              this.getsubfile()
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          })
+        })
+      },
+
+      lineheight (list) {
+        return list * 23 + ''
+      },
       changeOrgUnit (val) {
         let auditstepcode = 'PROF_RECE'
         suppapi.getAuditerByDept(val, auditstepcode, this.$axios).then(res => {
@@ -1678,7 +1784,7 @@
                     type: 'success',
                     message: response.data.message
                   })
-                  _this.getFileList()
+                  _this.getsubfile()
                 } else {
                   _this.$message({
                     type: 'warning',
@@ -1719,7 +1825,7 @@
                 message: res.data.message
               })
               this.newVisible = false
-              this.getFileList()
+              this.getsubfile()
               this.$refs.newrefuploadattach.uploadFiles = []
             } else {
               _this.$message({
@@ -1858,7 +1964,7 @@
               })
               this.getSortList()
               this.getMySortList()
-              this.getFileList()
+              this.getsubfile()
               this.tableloading = false
             }
           })
@@ -1876,7 +1982,7 @@
               })
               this.getMySortList()
               this.getSortList()
-              this.getFileList()
+              this.getsubfile()
               this.tableloading = false
             }
           })
@@ -1971,7 +2077,7 @@
           if (this.formData.InStyle == '2' || this.formData.InStyle == '6' || this.formData.InStyle == '4') {
             this.allowpre = false
           }
-          this.getFileList()
+          this.getsubfile()
           // 显示公司名
           _this.supplierOptions = _this.formData.SupplierId.toString()
           _this.getSortList()
@@ -2269,49 +2375,69 @@
         })
       },
       // 获取资质文件
-      getFileList () {
-        this.SupplierId = this.formData.SupplierId
-        this.SupplierTypeCode = this.formData.AppendType
+      // getFileList () {
+      //   this.SupplierId = this.formData.SupplierId
+      //   this.SupplierTypeCode = this.formData.AppendType
+      //   let _this = this
+      //   const params = {
+      //     AppendId: this.formData.Id,
+      //     SupplierId: this.SupplierId,
+      //     SupplierTypeCode: this.SupplierTypeCode,
+      //     _currentPage: 1,
+      //     _size: 1000
+      //   }
+      //   _this.$axios.get('supplierfile/filelistall', {
+      //     params
+      //   })
+      //     .then(res => {
+      //       _this.subfileList = res.data.items
+      //       _this.currentItemCount = res.data.currentItemCount
+      //       for (let idx in _this.subfileList) {
+      //         _this.subfileList[idx].FileUrlList = _this.subfileList[idx].FileUrl.split('$')
+      //       }
+      //     })
+      //     .catch(err => {
+      //       console.error(err)
+      //     })
+      // },
+      makesure () {
+        // if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
+        //   // 上传附件是否完成判断
+        //   if (!this.attachissuccess()) {
+        //     this.$message.error('有附件未成功上传!不能保存数据')
+        //     return
+        //   }
+        //   this.getattachissuccess()
+        //   this.editSubfile()
+        // } else {
+        //   this.editSubfile()
+        // }
         let _this = this
-        const params = {
-          AppendId: this.formData.Id,
-          SupplierId: this.SupplierId,
-          SupplierTypeCode: this.SupplierTypeCode,
-          _currentPage: 1,
-          _size: 1000
-        }
-        _this.$axios.get('supplierfile/filelistall', {
-          params
-        })
-          .then(res => {
-            _this.subfileList = res.data.items
-            _this.currentItemCount = res.data.currentItemCount
-            for (let idx in _this.subfileList) {
-              _this.subfileList[idx].FileUrlList = _this.subfileList[idx].FileUrl.split('$')
+        _this.$refs['subfileForm'].validate((valid) => {
+          if (valid) {
+            if (_this.$refs.refuploadattach.uploadFiles && _this.$refs.refuploadattach.uploadFiles.length > 0) {
+              // 上传附件是否完成判断
+              if (!_this.attachissuccess()) {
+                _this.$message.error('有附件未成功上传!不能保存数据')
+                return
+              }
+              _this.getattachissuccess()
+              _this.editqualchange()
+            } else {
+              _this.$message({
+                type: 'warning',
+                message: '请上传文件!'
+              })
             }
-          })
-          .catch(err => {
-            console.error(err)
-          })
-      },
-      makesure () {
-        if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
-          // 上传附件是否完成判断
-          if (!this.attachissuccess()) {
-            this.$message.error('有附件未成功上传!不能保存数据')
-            return
           }
-          this.getattachissuccess()
-          this.editSubfile()
-        } else {
-          this.editSubfile()
-        }
+        })
       },
-      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)
+        _this.$axios.put('/suppliercertappendsub/editqualchange/' + _this.Id, _this.SubfileForm)
           .then(res => {
             if (res.data.code === 0) {
               _this.$message({
@@ -2319,8 +2445,7 @@
                 message: res.data.message
               })
               this.visible = false
-              // this.initData()
-              this.getFileList()
+              this.getsubfile()
               this.$refs.refuploadattach.uploadFiles = []
             } else {
               _this.$message({
@@ -2333,6 +2458,32 @@
             console.error(err)
           })
       },
+      // editSubfile () {
+      //   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)
+      //     .then(res => {
+      //       if (res.data.code === 0) {
+      //         _this.$message({
+      //           type: 'success',
+      //           message: res.data.message
+      //         })
+      //         this.visible = false
+      //         // this.initData()
+      //         this.getFileList()
+      //         this.$refs.refuploadattach.uploadFiles = []
+      //       } else {
+      //         _this.$message({
+      //           type: 'warning',
+      //           message: res.data.message
+      //         })
+      //       }
+      //     })
+      //     .catch(err => {
+      //       console.error(err)
+      //     })
+      // },
       fileurlcut (val, index) {
         let fileurlall = val.split('$')[index]
         let fileurl = fileurlall.split('|')
@@ -2361,7 +2512,9 @@
         this.SubfileForm.FileExt = val.FileExt
         this.SubfileForm.FileType = val.FileType
         this.SubfileForm.FileName = val.FileName
-        this.SubfileForm.EffectDate = new Date(val.EffectDate)
+        this.SubfileForm.OldFileName = val.OldFileName
+        this.SubfileForm.OldEffectDate = new Date(val.OldEffectDate)
+        this.SubfileForm.OldFileUrl = val.OldFileUrl
         this.SubfileForm.FileUrl = val.FileUrl
         this.getwendanginfo(val.FileUrl)
         this.SubfileForm.OtherRemark = val.OtherRemark
@@ -2761,7 +2914,7 @@
               this.loading = false
               this.getSortList()
               this.getMySortList()
-              this.getFileList()
+              this.getsubfile()
             } else {
               this.loading = false
               this.$message({
@@ -3054,6 +3207,8 @@
       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') {
@@ -3100,7 +3255,7 @@
               this.Remark1 = ''
               this.getSortList()
               this.getMySortList()
-              this.getFileList()
+              this.getsubfile()
               this.initData2019()
             } else {
               this.loading = false
@@ -3147,6 +3302,11 @@
   }
 </script>
 <style lang='scss'>
+  .el-icon-close:hover
+  {
+    color:red;
+    cursor: pointer;
+  }
   .attach-uploader .el-upload {
     border: 1px dashed #63B8FF;
     cursor: pointer;

+ 151 - 34
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/techdataopera.vue

@@ -461,33 +461,51 @@
             <el-card class="box-card" style="margin-top: 10px;">
               <div slot="header" class="clearfix">
                 <span><i class="icon icon-table2"></i> 企业资质</span>
-                <el-button style="float: right; padding: 3px 0" type="text" @click="showDialog1">添加</el-button>
+                <!--<el-button style="float: right; padding: 3px 0" type="text" @click="showDialog1">添加</el-button>-->
               </div>
-              <el-table :data="subfileList" size="mini" border>
+              <el-table :data="subfileList1" 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)"
-                               :disabled="scope.row.SupType != 2||formData.Status > 0">上传
-                    </el-button>
-                    <el-button type="primary" plain size="mini" title="删除" style="margin-left:3px"
-                               v-if="scope.row.FileType == '66'" @click="newdeletedata(scope.row)">删除</el-button>
+                    <el-button type="primary" plain size="mini" title="文件变更" :disabled="formData.Status > 0" @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="FileUrlList" label="资质文件" show-overflow-tooltip>
+                <el-table-column prop="NeedFileType" label="文件分类" show-overflow-tooltip></el-table-column>
+                <el-table-column prop="OldFileUrlList" label="原文件" show-overflow-tooltip>
                   <template slot-scope="scope">
-                    <div v-for="(tmpUrl, index) in scope.row.FileUrlList">
-                      <a :href="fileurlcut(scope.row.FileUrl, index)" target="_blank"
-                         class="buttonText">{{scope.row.FileName.split('$')[index]}}</a>
+                    <div v-for="(tmpUrl, index) in scope.row.OldFileUrlList">
+                      <a :href="'http://'+fileurlcut(scope.row.OldFileUrl, index)" target="_blank"
+                         class="buttonText">{{scope.row.OldFileName.split('$')[index]}}</a>
                     </div>
                   </template>
                 </el-table-column>
-                <el-table-column prop="EffectDate" label="有效日期" show-overflow-tooltip>
+                <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="FileUrlList" label="变更后文件" show-overflow-tooltip>
+                  <template slot-scope="scope">
+                    <el-row align="middle">
+                      <el-col :span="20">
+                        <div v-for="(tmpUrl, index) in scope.row.FileUrlList">
+                          <a :href="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank"
+                             class="buttonText">{{scope.row.FileName.split('$')[index]}}
+                          </a>
+                        </div>
+                      </el-col>
+                      <el-col :span="4" v-if="scope.row.FileUrl != '' && formData.Status <= 0 && formData.Status != -5">
+                        <i class="el-icon-close" :style="{'float': 'right', 'height': '100%','line-height': lineheight(scope.row.FileUrlList.length)  + 'px',}" @click="iconclear(scope.row)"></i>
+                      </el-col>
+                    </el-row>
+                  </template>
+                </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="Remark" label="描述" show-overflow-tooltip></el-table-column>
               </el-table>
               <div style="float: right; margin: 20px;">
                 <el-button type="primary" size="mini" style="margin-right: 8px" @click="commitaudit"
@@ -502,8 +520,8 @@
         </el-tabs>
       </div>
     </el-card>
-    <el-dialog title="编辑文件" :visible.sync="visible" top="5vh">
-      <el-form :model="SubfileForm" label-width="100px">
+    <el-dialog title="上传文件" :visible.sync="visible" top="5vh">
+      <el-form ref="subfileForm" :model="SubfileForm" :rules="rules" label-width="100px">
         <el-row>
           <el-col :span="12">
             <el-form-item label="资质名称" required>
@@ -914,7 +932,7 @@
         SupplierId: 0,
         SupplierTypeCode: '',
         SupplierCertId: 0,
-        subfileList: [],
+        subfileList1: [],
         visible: false,
         dynamicTableColumns: [],
         flag: '',
@@ -1319,6 +1337,14 @@
             message: '用户名',
             trigger: 'blur'
           }]
+        },
+        supplierId: '',
+        rules: {
+          NeedFileType: [
+            {required: true, message: '资质名称不能为空', trigger: 'blur'}
+          ],
+          EffectDate:
+            [{ required: true, message: '请选择有效日期', trigger: 'change' }]
         }
       }
     },
@@ -1334,6 +1360,7 @@
       this.IsCompanyUser = this.authUser.Profile.IsCompanyUser
       // this.serviceType = this.$route.params.opera //获取服务类型
       this.Id = this.$route.query.Id
+      this.supplierId = this.$route.query.sId
       this.editFlag = this.$route.query.editFlag
       if (this.editFlag == '1' && this.Id !== '') {
         this.getEntityById()
@@ -1346,8 +1373,60 @@
       // this.orgtreeChange(this.majorDept)
       // this.changeOrgUnit(this.selectDept)
       this.initTableHeader()
+      this.getsubfile()
     },
     methods: {
+      // =======================================
+      getsubfile () {
+        let _this = this
+        const params = {
+          SupplierId: this.supplierId,
+          SupplierTypeCode: '03',
+          MInfoId: this.Id
+        }
+        _this.$axios.get('suppliercertappendsub/filelist', {
+          params
+        })
+          .then(res => {
+            _this.subfileList1 = res.data.items
+            _this.currentItemCountProject = res.data.currentItemCount
+            for (let idx in _this.subfileList1) {
+              _this.subfileList1[idx].FileUrlList = _this.subfileList1[idx].FileUrl.split('$')
+            }
+            for (let idx1 in _this.subfileList1) {
+              _this.subfileList1[idx1].OldFileUrlList = _this.subfileList1[idx1].OldFileUrl.split('$')
+            }
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      },
+      iconclear (row) {
+        this.$confirm('该操作将删除新上传的资质,是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          api.deleteNewFile(row.Id, this.$axios).then(res => {
+            if (res.data.code === 0) {
+              this.getsubfile()
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          })
+        })
+      },
+
+      lineheight (list) {
+        return list * 23 + ''
+      },
       changeOrgUnit (val) {
         let auditstepcode = 'PROF_RECE'
         suppapi.getAuditerByDept(val, auditstepcode, this.$axios).then(res => {
@@ -1371,7 +1450,7 @@
                     type: 'success',
                     message: response.data.message
                   })
-                  _this.getFileList()
+                  _this.getsubfile()
                 } else {
                   _this.$message({
                     type: 'warning',
@@ -1412,7 +1491,7 @@
                 message: res.data.message
               })
               this.newVisible = false
-              this.getFileList()
+              this.getsubfile()
               this.$refs.newrefuploadattach.uploadFiles = []
             } else {
               _this.$message({
@@ -1576,7 +1655,7 @@
           if (this.formData.InStyle == '2' || this.formData.InStyle == '6' || this.formData.InStyle == '4') {
             this.allowpre = false
           }
-          this.getFileList()
+          this.getsubfile()
           // 显示公司名
           _this.supplierOptions = _this.formData.SupplierId.toString()
           _this.getSortList()
@@ -1928,23 +2007,43 @@
         // }
       },
       makesure () {
-        if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
-          // 上传附件是否完成判断
-          if (!this.attachissuccess()) {
-            this.$message.error('有附件未成功上传!不能保存数据')
-            return
+        // if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
+        //   // 上传附件是否完成判断
+        //   if (!this.attachissuccess()) {
+        //     this.$message.error('有附件未成功上传!不能保存数据')
+        //     return
+        //   }
+        //   this.getattachissuccess()
+        //   this.editSubfile()
+        // } else {
+        //   this.editSubfile()
+        // }
+        let _this = this
+        _this.$refs['subfileForm'].validate((valid) => {
+          if (valid) {
+            if (_this.$refs.refuploadattach.uploadFiles && _this.$refs.refuploadattach.uploadFiles.length > 0) {
+              // 上传附件是否完成判断
+              if (!_this.attachissuccess()) {
+                _this.$message.error('有附件未成功上传!不能保存数据')
+                return
+              }
+              _this.getattachissuccess()
+              _this.editqualchange()
+            } else {
+              _this.$message({
+                type: 'warning',
+                message: '请上传文件!'
+              })
+            }
           }
-          this.getattachissuccess()
-          this.editSubfile()
-        } else {
-          this.editSubfile()
-        }
+        })
       },
-      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)
+        _this.$axios.put('/suppliercertappendsub/editqualchange/' + _this.Id, _this.SubfileForm)
           .then(res => {
             if (res.data.code === 0) {
               _this.$message({
@@ -1952,7 +2051,7 @@
                 message: res.data.message
               })
               this.visible = false
-              this.getFileList()
+              this.getsubfile()
               this.$refs.refuploadattach.uploadFiles = []
             } else {
               _this.$message({
@@ -1993,7 +2092,9 @@
         this.SubfileForm.FileExt = val.FileExt
         this.SubfileForm.FileType = val.FileType
         this.SubfileForm.FileName = val.FileName
-        this.SubfileForm.EffectDate = new Date(val.EffectDate)
+        this.SubfileForm.OldFileName = val.OldFileName
+        this.SubfileForm.OldEffectDate = new Date(val.OldEffectDate)
+        this.SubfileForm.OldFileUrl = val.OldFileUrl
         this.SubfileForm.FileUrl = val.FileUrl
         this.getwendanginfo(val.FileUrl)
         this.SubfileForm.OtherRemark = val.OtherRemark
@@ -2575,6 +2676,8 @@
       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') {
@@ -2588,6 +2691,20 @@
   }
 </script>
 <style lang='scss'>
+  .el-icon-close:hover
+  {
+    color:red;
+    cursor: pointer;
+  }
+  .modified-form-input {
+    .el-input__inner {
+      background-color: wheat;
+    }
+
+    .el-textarea__inner {
+      background-color: wheat;
+    }
+  }
   .attach-uploader .el-upload {
     border: 1px dashed #63B8FF;
     cursor: pointer;

+ 2 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/basislist.vue

@@ -383,7 +383,8 @@
           path: `/oilsupplier/supplierappend/2/basisdataopera`,
           query: {
             Id: row.Id,
-            editFlag: 1 // 编辑标记: 1 修改,0 不修改
+            editFlag: 1, // 编辑标记: 1 修改,0 不修改
+            sId: row.SupplierId
           }
         })
       },

+ 2 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/goodslist.vue

@@ -386,7 +386,8 @@
           path: `/oilsupplier/supplierappend/1/goodsdataopera`,
           query: {
             Id: row.Id,
-            editFlag: 1 //编辑标记: 1 修改,0 不修改
+            editFlag: 1, //编辑标记: 1 修改,0 不修改
+            sId: row.SupplierId
           }
         })
       },

+ 2 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/index.vue

@@ -381,7 +381,8 @@ import WfHistory from '@/components/workflow/wfhistory.vue'
           path: `/oilsupplier/supplierappend/` + (row.AppendType === '01' ? '1' : (row.AppendType === '02' ? '2' : '3')) + `/` + (row.AppendType === '01' ? 'goodsdataopera' : (row.AppendType === '02' ? 'basisdataopera' : 'techdataopera')),
           query: {
             Id: row.Id,
-            editFlag: 1 // 编辑标记: 1 修改,0 不修改
+            editFlag: 1, // 编辑标记: 1 修改,0 不修改
+            sId: row.SupplierId
           }
         })
       },

+ 4 - 2
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/techlist.vue

@@ -319,7 +319,8 @@
                     path: `/oilsupplier/supplierappend/3/techdataopera`,
                     query: {
                       Id: AppendId,
-                      editFlag: 1 //编辑标记: 1 修改,0 不修改
+                      editFlag: 1, //编辑标记: 1 修改,0 不修改
+                      sId: _this.appendformData.SupplierId
                     }
                   })
                   _this.$message({
@@ -386,7 +387,8 @@
           path: `/oilsupplier/supplierappend/3/techdataopera`,
           query: {
             Id: row.Id,
-            editFlag: 1 //编辑标记: 1 修改,0 不修改
+            editFlag: 1, //编辑标记: 1 修改,0 不修改
+            sId: row.SupplierId
           }
         })
       },

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff