浏览代码

资质变更

lining 5 年之前
父节点
当前提交
52e66315da

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

@@ -158,7 +158,7 @@ func (s *QualChangeService) GetQualPagingEntities(FileName, qualChangeName strin
 	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 += ` 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

+ 12 - 2
src/dashoo.cn/backend/api/business/oilsupplier/supplierfile/supplierfileService.go

@@ -31,8 +31,14 @@ func GetSupplierfileService(xormEngine *xorm.Engine) *SupplierfileService {
 	return s
 }
 
-func (s *SupplierfileService) GetGoodsNeedFileList(classid string,IsManuf string) (needList []FileList) {
+func (s *SupplierfileService) GetGoodsNeedFileList(classid string,IsManuf ...string) (needList []FileList) {
 	Ids := strings.Split(classid, ",")
+	search := ""
+	if len(IsManuf) == 0 {
+		search = ""
+	} else {
+		search = IsManuf[0]
+	}
 	for i := 0; i < len(Ids); i++ {
 		classid = Ids[i]
 		var entity goodsaptitude.OilGoodsAptitude
@@ -46,7 +52,11 @@ func (s *SupplierfileService) GetGoodsNeedFileList(classid string,IsManuf string
 			curCertConfig := reflect.ValueOf(entity)
 			setValue := curCertConfig.FieldByName(header.Code).String()
 			if setValue != "" && setValue != "0" {
-				if header.IsManuf == IsManuf || header.IsManuf == "0" {
+				if search != "" {
+					if header.IsManuf == search || header.IsManuf == "0" {
+						needList = append(needList, FileList{FileName: header.Name})
+					}
+				} else {
 					needList = append(needList, FileList{FileName: header.Name})
 				}
 			}

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

@@ -4,6 +4,7 @@ import (
 	"dashoo.cn/backend/api/business/audithistory"
 	"dashoo.cn/backend/api/business/auditsetting"
 	"dashoo.cn/backend/api/business/oilsupplier/infochange"
+	"dashoo.cn/backend/api/business/oilsupplier/qualchange"
 	"dashoo.cn/backend/api/business/oilsupplier/supplier"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
@@ -14,6 +15,7 @@ import (
 	"dashoo.cn/business2/userRole"
 	"encoding/json"
 	"fmt"
+	"log"
 	"reflect"
 	"strconv"
 	"strings"
@@ -589,7 +591,7 @@ func (this *InfoChangeController) GetChangeEntity() {
 				floatchangeinfo, _ := strconv.ParseFloat(info.ChangeInfo, 64)
 				elem.FieldByName(info.SelectItem).SetFloat(floatchangeinfo)
 			} else if elem.FieldByName(info.SelectItem).Type().String() == "time.Time" {
-				t, _ := time.Parse("2006-01-02", info.ChangeInfo)
+				t, _ := time.Parse("2006-01-02", info.ChangeInfo[0 : 10])
 				elem.FieldByName(info.SelectItem).Set(reflect.ValueOf(t))
 			} else {
 				elem.FieldByName(info.SelectItem).SetString(info.ChangeInfo)
@@ -725,7 +727,7 @@ func (this *InfoChangeController) DelInfoChangech() {
 	svc := infochange.GetInfoChangeService(utils.DBE)
 	var infoChange infochange.OilInfoChange
 	where := "Id=" + Id + " and Status <= '0'"
-	has1 := svc.GetEntity(infoChange, where)
+	has1 := svc.GetEntity(&infoChange, where)
  	if !has1 {
 		errinfo.Message = "删除失败"
 		errinfo.Code = -1
@@ -740,6 +742,8 @@ func (this *InfoChangeController) DelInfoChangech() {
 	svc.DeleteEntityBytbl(OilInfoChangeItemName, where)
 	where = "Id=" + Id
 	err := svc.DeleteEntityBytbl(OilInfoChangeName, where)
+	where = "SupplierId=" + strconv.Itoa(infoChange.SupplierId) + " and FileName=''"
+	err = svc.DeleteEntityBytbl(OilSupplierFileName, where)
 
 	if err == nil {
 		errinfo.Message = "删除成功"
@@ -754,6 +758,123 @@ func (this *InfoChangeController) DelInfoChangech() {
 	}
 }
 
+// @Title 删除资质
+// @Description
+// @Success 200 {object} ErrorInfo
+// @Failure 403 :id 为空
+// @router /delfile/:Id [delete]
+func (this *InfoChangeController) DelFile() {
+	Id := this.Ctx.Input.Param(":Id")
+	var errinfo ErrorInfo
+	if Id == "" {
+		errinfo.Message = "操作失败!请求信息不完整"
+		errinfo.Code = -2
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+
+	svc := infochange.GetInfoChangeService(utils.DBE)
+	var file supplierfile.OilSupplierFile
+	where := "Id=" + Id
+	has1 := svc.GetEntity(&file, where)
+	if !has1 {
+		errinfo.Message = "删除失败"
+		errinfo.Code = -1
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+		return
+	}
+
+	// 之前的资质改状态, 新增资质删除
+	var err error
+	if file.FileUrl != "" {
+		cols := []string{"IsDelete"}
+		file.IsDelete = 1
+		_, err = svc.UpdateEntityByIdCols(Id, &file, cols)
+	} else {
+		where := "FileId=" + Id
+		err = svc.DeleteEntityBytbl(OilQualChangeDetailName, where)
+		err = svc.DeleteEntityById(Id, &file)
+	}
+
+	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 *InfoChangeController) 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 := infochange.GetInfoChangeService(utils.DBE)
+
+	where := "FileId=" + Id
+	err := svc.DeleteEntityBytbl(OilQualChangeDetailName, 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()
+	}
+}
+
+// @Title 删除资质撤销
+// @Description
+// @Success 200 {object} ErrorInfo
+// @Failure 403 :id 为空
+// @router /recall [post]
+func (this *InfoChangeController) Recall() {
+	SupplierId := this.GetString("SupplierId")
+	SupplierTypeCode := this.GetString("SupplierTypeCode")
+	var errinfo ErrorInfo
+
+	svc := infochange.GetInfoChangeService(utils.DBE)
+	var file supplierfile.OilSupplierFile
+	where := "SupplierId=" + SupplierId + " and SupplierTypeCode in ('000', '" + SupplierTypeCode + "')" + " and IsDelete=1"
+	cols := []string{"IsDelete"}
+	file.IsDelete = 0
+	err := svc.UpdateEntityBywheretbl(OilSupplierFileName, &file, cols, 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()
+	}
+
+}
+
 // @Title 添加
 // @Description 新增
 // @Success	200	{object} controllers.Request
@@ -898,7 +1019,7 @@ func (this *InfoChangeController) AddInfoMain() {
 	var suppliermodel supplier.OilSupplier
 	var errinfo ErrorDataInfo
 	svc := infochange.GetInfoChangeService(utils.DBE)
-	where := " SupplierId = " + SupplierId + " and Status < 4"
+	where := " SupplierId = " + SupplierId + " and Status < 11"
 	svc.GetEntitysByWhere(OilInfoChangeName, where, &infochm)
 	if len(infochm) > 0 {
 		errinfo.Message = "有已提交在申请中的信息变更,请审批完成后再提交!"
@@ -1192,6 +1313,7 @@ func (this *InfoChangeController) AuditEntity() {
 // @Success	200	{object} controllers.Request
 // @router /infoaudit [post]
 func (this *InfoChangeController) InfoAudit() {
+	t := time.Now()
 	svc := infochange.GetInfoChangeService(utils.DBE)
 	var jsonblob = this.Ctx.Input.RequestBody
 	var dataother InfoShenHeModel
@@ -1304,10 +1426,10 @@ func (this *InfoChangeController) InfoAudit() {
 			myerr = svc.UpdateEntityBywheretbl(OilInfoChangeItemName, &infochangeitemmodel, []string{"ChangeStatus"}, itemswhere)
 			myerr = this.updatesupplier(OilSupplierName, dataother.SuppId, infoitems, supmodel)
 			//资质更新
-			where := "SupplierId = " + utils.ToStr(dataother.SuppId) + " and SupType = 2"
-			var supfilemodel supplierfile.OilSupplierFile
-			supfilemodel.SupType = 3
-			svc.UpdateEntityBywheretbl(OilSupplierFileName, &supfilemodel, []string{"SupType"}, where)
+			//where := "SupplierId = " + utils.ToStr(dataother.SuppId) + " and SupType = 2"
+			//var supfilemodel supplierfile.OilSupplierFile
+			//supfilemodel.SupType = 3
+			//svc.UpdateEntityBywheretbl(OilSupplierFileName, &supfilemodel, []string{"SupType"}, where)
 
 			// 级别 一级变二级 删除不符合的准入项和资质
 			for _, item := range infoitems {
@@ -1316,20 +1438,22 @@ func (this *InfoChangeController) InfoAudit() {
 				}
 			}
 
-			//var qualdetail []qualchange.OilQualChangeDetail
-			//svc.UpdateEntityBytbl(OilSupplierFileName, qualdetail[i].FileId, &supfilemodel, []string{"SupType"})
-			//where := "SupplierId = " + utils.ToStr(dataother.SuppId)
-			//svc.GetEntities(&qualdetail, where)
-			//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
-			//		supfilemodel.SupType = 3
-			//		svc.UpdateEntityBytbl(OilSupplierFileName, qualdetail[i].FileId, &supfilemodel, []string{"FileName", "FileUrl", "EffectDate","SupType"})
-			//	}
-			//}
+			// 删除资质及准入项
+			this.FileDelete(strconv.Itoa(dataother.SuppId))
+			s := time.Since(t)
+			log.Println(s, "============================")
+			var qualdetail []qualchange.OilQualChangeDetail
+			where := "SupplierId = " + utils.ToStr(dataother.SuppId)
+			svc.GetEntities(&qualdetail, where)
+			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"})
+				}
+			}
 		}
 		infomodel.Status = status
 		infomodel.Step = step
@@ -1421,7 +1545,11 @@ func (this *InfoChangeController) updatesupplier(supname string, suppid int, inf
 			//cols = append(cols, infoitems[i].SelectItem)
 			where := " Id = " + utils.ToStr(suppid)
 			var sql string
-			sql = `UPDATE ` + supname + ` set ` + infoitems[i].SelectItem + ` = '` + infoitems[i].ChangeInfo + `' where ` + where
+			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)
 		}
@@ -1552,4 +1680,34 @@ func (this *InfoChangeController) BusinessDelete(SupplierId string) {
 
 		}
 	}
+}
+
+func (this *InfoChangeController) FileDelete(supplierId string) {
+	s := time.Now()
+	where := "SupplierId=" + supplierId + " and IsDelete=1"
+	svc := infochange.GetInfoChangeService(utils.DBE)
+	var delfiles []supplierfile.OilSupplierFile
+	svc.GetEntities(&delfiles, where)
+	delfilenames := ""
+	for _, delfile :=  range delfiles {
+		delfilenames += delfile.NeedFileType + ","
+	}
+	fmt.Println("del==" + delfilenames)
+	var sub []suppliercertsub.OilSupplierCertSub
+	weresup := "SupplierId=" + supplierId
+	svc.GetEntitysByWhere(OilSupplierCertSubName, weresup, &sub)
+	for _, item := range sub {
+		filesvc := supplierfile.GetSupplierfileService(utils.DBE)
+		needList := filesvc.GetGoodsNeedFileList(strconv.Itoa(item.SubClassId))
+		for _, needfile := range needList {
+			if strings.Index(delfilenames, needfile.FileName) > -1 {
+				where := "Id=" + strconv.Itoa(item.Id)
+				svc.DeleteEntityBytbl(OilSupplierCertSubName, where)
+				break
+			}
+		}
+	}
+	svc.DeleteEntityBytbl(OilSupplierFileName, where)
+	sp := time.Since(s)
+	log.Println(sp, "++++++++++++++++++++")
 }

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

@@ -187,7 +187,7 @@ func (this *QualChangeController) FileList() {
 	page := this.GetPageInfoForm()
 	var list []qualchange.OilQualChangeDetail
 	svc := qualchange.GetQualChangeService(utils.DBE)
-	where := " 1=1"
+	where := " 1=1 and a.IsDelete = 0"
 	orderby := "a.Id"
 	asc := true
 	Order := this.GetString("Order")
@@ -270,9 +270,9 @@ func (this *QualChangeController) AuditFileList() {
 	}
 	SupplierTypeCode := this.GetString("SupplierTypeCode")
 	if SupplierTypeCode != "" {
-		where = where + " and a.SupplierTypeCode in ( '000', " + SupplierTypeCode + ")"
+		where = where + " and a.SupplierTypeCode in ( '000', '" + SupplierTypeCode + "')"
 	}
-	where = where + " and b.FileUrl != ''"
+	where = where + " and (b.FileUrl != '' OR a.IsDelete = 1)"
 	total := svc.GetQualPagingEntities(OilSupplierFileName, OilQualChangeDetailName, page.CurrentPage, page.Size, orderby, asc, &list, where, "")
 	var datainfo DataInfo
 	datainfo.Items = list

+ 1 - 1
src/dashoo.cn/frontend_web/nuxt.config.ignore.js

@@ -169,7 +169,7 @@ module.exports = {
     'pages/oilsupplier/infochange/*.*',
     // 'pages/oilsupplier/infochangech/*.*',
     // 'pages/oilsupplier/supplier/*.*',
-    // 'pages/oilsupplier/supplierappend/*.*',
+    'pages/oilsupplier/supplierappend/*.*',
     'pages/oilsupplier/supplieraudit/*.*',
     'pages/oilsupplier/suppliercert/*.*',
     'pages/oilsupplier/supplierfile/*.*',

+ 20 - 1
src/dashoo.cn/frontend_web/src/api/oilsupplier/infochange.js

@@ -104,7 +104,7 @@ export default {
       params: formData
     })
   },
-  getAuditer(myAxios) {
+  getAuditer (myAxios) {
     return myAxios({
       url: '/infochange/getauditer',
       method: 'GET'
@@ -121,5 +121,24 @@ export default {
       url: '/infochange/delinfochangech/' + entityId,
       method: 'delete'
     })
+  },
+  delFile (entityId, myAxios) {
+    return myAxios({
+      url: '/infochange/delfile/' + entityId,
+      method: 'delete'
+    })
+  },
+  recall (params, myAxios) {
+    return myAxios({
+      url: '/infochange/recall',
+      method: 'post',
+      params: params
+    })
+  },
+  deleteNewFile (Id, myAxios) {
+    return myAxios({
+      url: '/infochange/deletenewfile/' + Id,
+      method: 'delete'
+    })
   }
 }

+ 57 - 54
src/dashoo.cn/frontend_web/src/components/oilsupplier/auditbuslist.vue

@@ -1,67 +1,70 @@
 <template>
   <div>
-    <el-card class="box-card">
-      <div slot="header" class="clearfix">
-        <span style="font-weight: bold">准入范围</span>
-        <span style="float: right;">
-          <el-button type="primary" size="mini"  v-if ="Visiblebtn =='0'" @click="AuditEntity">提交审批</el-button>
-        </span>
-      </div>
-      <el-table :data="auditbusList" border height="calc(100vh - 435px)" size="mini">
-        <!--<el-table-column label="操作" width="90" align="center" fixed v-if="Visiblebtn != '10'">-->
-          <!--<template slot-scope="scope">-->
-            <!--<el-popover trigger="hover" width="700" placement="right" @show="getopinonList(scope.row)">-->
-              <!--<el-table :data="opinionList">-->
-                <!--<el-table-column width="80" property="AuditStatus" label="状态">-->
-                  <!--<template slot-scope="scope">-->
-                    <!--{{ transferStr(scope.row.AuditStatus+'') }}-->
-                  <!--</template>-->
-                <!--</el-table-column>-->
-                <!--<el-table-column width="90" property="AuditorName" label="审批人"></el-table-column>-->
-                <!--<el-table-column min-width="100" property="Opinion" label="审批意见"></el-table-column>-->
-                <!--<el-table-column width="150" property="CreateOn" label="审批时间">-->
+    <!--<el-card class="box-card">-->
+      <!--<div slot="header" class="clearfix">-->
+        <!--<span style="font-weight: bold">准入范围</span>-->
+        <!--<span style="float: right;">-->
+          <!--<el-button type="primary" size="mini"  v-if ="Visiblebtn =='0'" @click="AuditEntity">提交审批</el-button>-->
+        <!--</span>-->
+      <!--</div>-->
+      <!--<el-table :data="auditbusList" border height="calc(100vh - 435px)" size="mini">-->
+        <!--&lt;!&ndash;<el-table-column label="操作" width="90" align="center" fixed v-if="Visiblebtn != '10'">&ndash;&gt;-->
+          <!--&lt;!&ndash;<template slot-scope="scope">&ndash;&gt;-->
+            <!--&lt;!&ndash;<el-popover trigger="hover" width="700" placement="right" @show="getopinonList(scope.row)">&ndash;&gt;-->
+              <!--&lt;!&ndash;<el-table :data="opinionList">&ndash;&gt;-->
+                <!--&lt;!&ndash;<el-table-column width="80" property="AuditStatus" label="状态">&ndash;&gt;-->
+                  <!--&lt;!&ndash;<template slot-scope="scope">&ndash;&gt;-->
+                    <!--&lt;!&ndash;{{ transferStr(scope.row.AuditStatus+'') }}&ndash;&gt;-->
+                  <!--&lt;!&ndash;</template>&ndash;&gt;-->
+                <!--&lt;!&ndash;</el-table-column>&ndash;&gt;-->
+                <!--&lt;!&ndash;<el-table-column width="90" property="AuditorName" label="审批人"></el-table-column>&ndash;&gt;-->
+                <!--&lt;!&ndash;<el-table-column min-width="100" property="Opinion" label="审批意见"></el-table-column>&ndash;&gt;-->
+                <!--&lt;!&ndash;<el-table-column width="150" property="CreateOn" label="审批时间">&ndash;&gt;-->
+                  <!--&lt;!&ndash;<template slot-scope="scope">&ndash;&gt;-->
+                    <!--&lt;!&ndash;{{ jstimehandle(scope.row.CreateOn+'') }}&ndash;&gt;-->
+                  <!--&lt;!&ndash;</template>&ndash;&gt;-->
+                <!--&lt;!&ndash;</el-table-column>&ndash;&gt;-->
+                <!--&lt;!&ndash;<el-table-column width="120" property="Remark" label="备注信息"></el-table-column>&ndash;&gt;-->
+              <!--&lt;!&ndash;</el-table>&ndash;&gt;-->
+              <!--&lt;!&ndash;<div slot="reference" class="name-wrapper">&ndash;&gt;-->
+                <!--&lt;!&ndash;<el-button type="primary" plain size="mini" title="意见" @click="openDialog(scope.row)">意见</el-button>&ndash;&gt;-->
+              <!--&lt;!&ndash;</div>&ndash;&gt;-->
+            <!--&lt;!&ndash;</el-popover>&ndash;&gt;-->
+          <!--&lt;!&ndash;</template>&ndash;&gt;-->
+        <!--&lt;!&ndash;</el-table-column>&ndash;&gt;-->
+        <!--<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-->
+                  <!--label="是否为制造商" width="100" v-if="SupplierTypeCode == '01'">-->
                   <!--<template slot-scope="scope">-->
-                    <!--{{ jstimehandle(scope.row.CreateOn+'') }}-->
+                    <!--<el-tag type="info" v-if="scope.row.IsManufacturer == 2">非制造商</el-tag>-->
+                    <!--<el-tag type="success" v-else-if="scope.row.IsManufacturer == 1">制造商</el-tag>-->
+                    <!--<span v-else>——</span>-->
                   <!--</template>-->
-                <!--</el-table-column>-->
-                <!--<el-table-column width="120" property="Remark" label="备注信息"></el-table-column>-->
-              <!--</el-table>-->
-              <!--<div slot="reference" class="name-wrapper">-->
-                <!--<el-button type="primary" plain size="mini" title="意见" @click="openDialog(scope.row)">意见</el-button>-->
-              <!--</div>-->
-            <!--</el-popover>-->
+        <!--</el-table-column>-->
+         <!--<el-table-column prop="CertSubStatus" label="状态" show-overflow-tooltip>-->
+            <!--<template slot-scope="scope">-->
+            <!--<span v-if="scope.row.CertSubStatus=='1'"-->
+                  <!--style="color:#67C23A">准入</span>-->
+            <!--<span v-else-if="scope.row.CertSubStatus>'1'"-->
+                  <!--style="color:#E6A23C">暂停</span>-->
+            <!--<span v-else>——</span>-->
           <!--</template>-->
         <!--</el-table-column>-->
-        <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
-                  label="是否为制造商" width="100" v-if="SupplierTypeCode == '01'">
-                  <template slot-scope="scope">
-                    <el-tag type="info" v-if="scope.row.IsManufacturer == 2">非制造商</el-tag>
-                    <el-tag type="success" v-else-if="scope.row.IsManufacturer == 1">制造商</el-tag>
-                    <span v-else>——</span>
-                  </template>
-        </el-table-column>
-         <el-table-column prop="CertSubStatus" label="状态" show-overflow-tooltip>
-            <template slot-scope="scope">
-            <span v-if="scope.row.CertSubStatus=='1'"
-                  style="color:#67C23A">准入</span>
-            <span v-else-if="scope.row.CertSubStatus>'1'"
-                  style="color:#E6A23C">暂停</span>
-            <span v-else>——</span>
-          </template>
-        </el-table-column>
-        <el-table-column prop="Remark" label="备注" show-overflow-tooltip></el-table-column>
-      </el-table>
-      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
-        :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
-        :total="currentItemCount">
-      </el-pagination>
-    </el-card>
+        <!--<el-table-column prop="Remark" label="备注" show-overflow-tooltip></el-table-column>-->
+      <!--</el-table>-->
+      <!--<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"-->
+        <!--:page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"-->
+        <!--:total="currentItemCount">-->
+      <!--</el-pagination>-->
+    <!--</el-card>-->
 
     <el-card class="box-card" style="margin-top: 10px;">
       <div slot="header" class="clearfix">
         <span style="font-weight: bold">企业资质</span>
+        <span style="float: right;">
+          <el-button type="primary" size="mini"  v-if ="Visiblebtn =='0'" @click="AuditEntity">提交审批</el-button>
+        </span>
         <!-- <el-button style="float: right; padding: 3px 0" type="text" @click="subfiledialog">添加</el-button> -->
       </div>
       <auditfile-list ref="auditfileList" :data="auditfileList" :SupplierId="SupplierId"

+ 14 - 12
src/dashoo.cn/frontend_web/src/pages/oilsupplier/infochangech/_opera/auditoperation.vue

@@ -422,11 +422,11 @@
               <span style="font-weight: bold">企业资质</span>
             </div>
             <el-table :data="subfileList1" border>
-              <el-table-column label="操作" width="150" align="center" fixed>
+              <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="InfoStatus > 0 || butnab">
-                    变更</el-button>
+                  <span v-if="scope.row.OldFileUrl == ''" style="color:#20A0FF">新增</span>
+                  <span v-if="scope.row.OldFileUrl != '' && scope.row.FileUrl != ''" style="color:#E6A23C">变更</span>
+                  <span v-if="scope.row.IsDelete == 1 && scope.row.OldFileUrl != ''" style="color:#F56C6C">删除</span>
                 </template>
               </el-table-column>
               <el-table-column prop="NeedFileType" label="文件分类" show-overflow-tooltip></el-table-column>
@@ -477,11 +477,11 @@
               <span style="font-weight: bold">企业资质</span>
             </div>
             <el-table :data="subfileList2" border>
-              <el-table-column label="操作" width="150" align="center" fixed>
+              <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="InfoStatus > 0 || butnab">
-                    变更</el-button>
+                  <span v-if="scope.row.OldFileUrl == ''" style="color:#20A0FF">新增</span>
+                  <span v-if="scope.row.OldFileUrl != '' && scope.row.FileUrl != ''" style="color:#E6A23C">变更</span>
+                  <span v-if="scope.row.IsDelete == 1 && scope.row.OldFileUrl != ''" style="color:#F56C6C">删除</span>
                 </template>
               </el-table-column>
               <el-table-column prop="NeedFileType" label="文件分类" show-overflow-tooltip></el-table-column>
@@ -532,11 +532,11 @@
               <span style="font-weight: bold">企业资质</span>
             </div>
             <el-table :data="subfileList3" border>
-              <el-table-column label="操作" width="150" align="center" fixed>
+              <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="InfoStatus > 0 || butnab">
-                    变更</el-button>
+                  <span v-if="scope.row.OldFileUrl == ''" style="color:#20A0FF">新增</span>
+                  <span v-if="scope.row.OldFileUrl != '' && scope.row.FileUrl != ''" style="color:#E6A23C">变更</span>
+                  <span v-if="scope.row.IsDelete == 1 && scope.row.OldFileUrl != ''" style="color:#F56C6C">删除</span>
                 </template>
               </el-table-column>
               <el-table-column prop="NeedFileType" label="文件分类" show-overflow-tooltip></el-table-column>
@@ -1699,6 +1699,8 @@
           return '----'
         } else if (val === '0001-01-01T08:00:00+08:00') {
           return '----'
+        } else if (val === '0001-01-01T00:00:00Z') {
+          return '----'
         } else if (val === '5000-01-01T23:59:59+08:00') {
           return '永久'
         } else {

+ 159 - 21
src/dashoo.cn/frontend_web/src/pages/oilsupplier/infochangech/_opera/operation.vue

@@ -433,7 +433,10 @@
           <el-card class="box-card" style="margin-top: 10px;">
             <div slot="header" class="clearfix">
               <span style="font-weight: bold">企业资质</span>
-              <el-button style="float: right; padding: 3px 0" type="text" @click="showDialog('01')">添加</el-button>
+              <span style="float: right;">
+                <el-button style="padding: 3px 0" type="text" @click="recall('01')" v-if="!(InfoStatus > 0 || butnab)">撤销删除</el-button>
+                <el-button style="padding: 3px 0" type="text" @click="showDialog('01')" v-if="!(InfoStatus > 0 || butnab)">添加</el-button>
+              </span>
             </div>
             <el-table :data="subfileList1" border>
               <el-table-column label="操作" width="150" align="center" fixed>
@@ -441,6 +444,9 @@
                   <el-button type="primary" plain size="mini" title="文件变更" @click="openDialog(scope.row)"
                     :disabled="InfoStatus > 0 || butnab">
                     变更</el-button>
+                  <el-button type="danger" plain size="mini" title="文件变更" @click="delFile(scope.row)"
+                             :disabled="InfoStatus > 0 || butnab">
+                    删除</el-button>
                 </template>
               </el-table-column>
               <el-table-column prop="NeedFileType" label="文件分类" show-overflow-tooltip></el-table-column>
@@ -459,10 +465,18 @@
               </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="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank"
-                      class="buttonText">{{scope.row.FileName.split('$')[index]}}</a>
-                  </div>
+                  <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 != ''">
+                      <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 >
@@ -490,7 +504,10 @@
           <el-card class="box-card" style="margin-top: 10px;">
             <div slot="header" class="clearfix">
               <span style="font-weight: bold">企业资质</span>
-              <el-button style="float: right; padding: 3px 0" type="text" @click="showDialog('02')">添加</el-button>
+              <span style="float: right;">
+                <el-button style="padding: 3px 0" type="text" @click="recall('02')" v-if="!(InfoStatus > 0 || butnab)">撤销删除</el-button>
+                <el-button style="padding: 3px 0" type="text" @click="showDialog('02')" v-if="!(InfoStatus > 0 || butnab)">添加</el-button>
+              </span>
             </div>
             <el-table :data="subfileList2" border>
               <el-table-column label="操作" width="150" align="center" fixed>
@@ -498,7 +515,7 @@
                   <el-button type="primary" plain size="mini" title="文件变更" @click="openDialog(scope.row)"
                     :disabled="InfoStatus > 0 || butnab">
                     变更</el-button>
-                  <el-button type="primary" plain size="mini" title="文件变更" @click="delFile(scope.row)"
+                  <el-button type="danger" plain size="mini" title="文件变更" @click="delFile(scope.row)"
                              :disabled="InfoStatus > 0 || butnab">
                     删除</el-button>
                 </template>
@@ -519,10 +536,18 @@
               </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="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank"
-                      class="buttonText">{{scope.row.FileName.split('$')[index]}}</a>
-                  </div>
+                  <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 != ''">
+                      <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>
@@ -538,7 +563,10 @@
           <el-card class="box-card" style="margin-top: 10px;">
             <div slot="header" class="clearfix">
               <span style="font-weight: bold">企业资质</span>
-              <el-button style="float: right; padding: 3px 0" type="text" @click="showDialog('03')">添加</el-button>
+              <span style="float: right;">
+                <el-button style="padding: 3px 0" type="text" @click="recall('03')" v-if="!(InfoStatus > 0 || butnab)">撤销删除</el-button>
+                <el-button style="padding: 3px 0" type="text" @click="showDialog('03')" v-if="!(InfoStatus > 0 || butnab)">添加</el-button>
+              </span>
             </div>
             <el-table :data="subfileList3" border>
               <el-table-column label="操作" width="150" align="center" fixed>
@@ -546,6 +574,9 @@
                   <el-button type="primary" plain size="mini" title="文件变更" @click="openDialog(scope.row)"
                     :disabled="InfoStatus > 0 || butnab">
                     变更</el-button>
+                  <el-button type="danger" plain size="mini" title="文件变更" @click="delFile(scope.row)"
+                             :disabled="InfoStatus > 0 || butnab">
+                    删除</el-button>
                 </template>
               </el-table-column>
               <el-table-column prop="NeedFileType" label="文件分类" show-overflow-tooltip></el-table-column>
@@ -564,10 +595,18 @@
               </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="'http://'+fileurlcut(scope.row.FileUrl, index)" target="_blank"
-                      class="buttonText">{{scope.row.FileName.split('$')[index]}}</a>
-                  </div>
+                  <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 != ''">
+                      <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>
@@ -850,6 +889,7 @@
         }
       }
       return {
+        lineheightpx: '23',
         IsMust: false,
         Grade: '',
         size: 10,
@@ -976,6 +1016,13 @@
           value: '2',
           label: '二级'
         }],
+        deloptions: [{
+          value: 0,
+          label: '正常'
+        }, {
+          value: 1,
+          label: '删除'
+        }],
         UnitRelationOptions: [],
         InOptions: [],
         CompanyTypeOptions: [],
@@ -1278,7 +1325,6 @@
     created () {
       this.serviceId = this.$route.params.opera
       this.supplierId = this.serviceId
-      console.log(this.supplierId, this.serviceId)
       this.InfoStatus = this.$route.query.InfoStatus
       this.MInfoId = this.$route.query.infoId + ''
       this.backhistroy.certId = this.MInfoId
@@ -1296,13 +1342,92 @@
       // this.getAccessCardNo()
     },
     methods: {
+      lineheight (list) {
+        return list * 23 + ''
+      },
+      iblur () {
+
+      },
+      iconclear (row) {
+        this.$confirm('该操作将删除新上传的资质,是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          api.deleteNewFile(row.Id, this.$axios).then(res => {
+            if (res.data.code === 0) {
+              this.getsubfile1()
+              this.getsubfile2()
+              this.getsubfile3()
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          })
+        })
+      },
+      recall (code) {
+        let params = {
+          SupplierId: this.supplierId,
+          SupplierTypeCode: code
+        }
+        this.$confirm('该操作将恢复删除的数据,是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            api.recall(params, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                this.getsubfile1()
+                this.getsubfile2()
+                this.getsubfile3()
+                this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+            })
+          })
+      },
       delFile (row) {
-        this.$confirm('此操作将彻底删除该数据, 是否继续?', '提示', {
+        let confirmmsg = '此操作将彻底删除该数据, 是否继续?'
+        if (row.OldFileUrl !== '') {
+          confirmmsg = '审批通过后将彻底删除该数据,是否继续?'
+        }
+        this.$confirm(confirmmsg, '提示', {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
           type: 'warning'
         })
           .then(() => {
+            api.delFile(row.Id, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                this.getsubfile1()
+                this.getsubfile2()
+                this.getsubfile3()
+                this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+            })
           })
           .catch(() => {})
       },
@@ -1818,7 +1943,6 @@
                   _this.$message.error('有附件未成功上传!不能保存数据')
                   return
                 }
-                console.log(_this.SubfileForm, '===============')
                 _this.getattachissuccess()
                 _this.addqualchange()
               } else {
@@ -1930,7 +2054,6 @@
             this.dynamicTableColumns = res.data.items
           })
         }
-        console.log(this.dynamicTableColumns, 'this.dynamicTableColumns')
       },
       showDialog (code) {
         this.initTableHeader(code)
@@ -1954,7 +2077,6 @@
         this.SubfileForm.OldFileName = ''
         this.SubfileForm.OldEffectDate = null
         this.SubfileForm.OldFileUrl = ''
-        console.log(this.SubfileForm, 'this.SubfileForm')
         this.visible = true
       },
       openDialog (val) {
@@ -2286,6 +2408,17 @@
           console.error(err)
         })
       },
+      delbtndisabled (row) {
+        if (row.OldFileUrl !== '') {
+          return true
+        } else {
+          if (this.InfoStatus > 0 || this.butnab) {
+            return true
+          } else {
+            return false
+          }
+        }
+      },
       getCityList (val) {
         let resultData = JSON.parse(val)
         let countstr = JSON.stringify(resultData.districts[0].districts)
@@ -2321,6 +2454,11 @@
 </script>
 
 <style lang='scss'>
+  .el-icon-close:hover
+  {
+    color:red;
+    cursor: pointer;
+  }
   .modified-form-input {
     .el-input__inner {
       background-color: wheat;

+ 19 - 13
src/dashoo.cn/frontend_web/src/pages/oilsupplier/infochangech/index.vue

@@ -468,19 +468,25 @@
 
       },
       delInfoChangech (Id) {
-        api.delInfoChangech(Id, this.$axios).then(res => {
-          if (res.data.code === 0) {
-            this.initDatas()
-            this.$message({
-              type: 'success',
-              message: res.data.message
-            })
-          } else {
-            this.$message({
-              type: 'warning',
-              message: res.data.message
-            })
-          }
+        this.$confirm('该操作将彻底删除的数据,是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          api.delInfoChangech(Id, this.$axios).then(res => {
+            if (res.data.code === 0) {
+              this.initDatas()
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          })
         })
       },
       getDictOptions() {