瀏覽代碼

展示删除的准入项

lining 6 年之前
父節點
當前提交
4d0cea76f3

+ 52 - 0
src/dashoo.cn/backend/api/business/oilsupplier/goodsaptitude/oilgoodsaptitudeService.go

@@ -19,6 +19,10 @@ func GetOilGoodsAptitudeService(xormEngine *xorm.Engine) *OilGoodsAptitudeServic
 	return s
 }
 
+type TotalResult struct {
+	Total int64 `xorm:"INT(11) 'total'"`
+}
+
 func (s *OilGoodsAptitudeService) GetMyPagingEntitiesWithOrderBytbl(tableName string, pageIndex, itemsPerPage int64, order string, asc bool, entitiesPtr interface{}, where ...string) (total int64) {
 	var err error
 	var resultsSlice []map[string][]byte
@@ -125,4 +129,52 @@ func (s *OilGoodsAptitudeService) GetGoodsAptitudeF(entity interface{}, where st
 	err := s.DBE.Sql(sql).Find(entity)
 
 	return err
+}
+
+func (s *OilGoodsAptitudeService) TruncateTable(tableName string) error {
+	sql := "TRUNCATE TABLE " + tableName
+	_,err := s.DBE.Query(sql)
+	return err
+}
+
+func (s *OilGoodsAptitudeService) GetMyPagingDelEntitiesWithOrderBytbl(supplierTableName, supplierCertTableName, OilInfoChangeName, OilCorporateInfoName, OilSupplierCertSubName,
+OilSupplierFileName string, pageIndex, itemsPerPage int64, orderby string, asc bool, entitiesPtr interface{}, where,having, liftjoon string) (total int64) {
+
+	var sql string
+	sql = `select SQL_CALC_FOUND_ROWS a.Id,a.SupplierName,b.AccessCardNo,b.SupplierTypeCode,`
+	sql += `a.LegalPerson,a.RegCapital,a.Mobile,b.AuditDate,b.ApplyTime,b.InFlag,a.ContactName,a.CommercialNo, `
+	sql += `a.DepositBank,a.HseTraining,a.CompanyType,a.SetupTime,a.Address,a.Province,a.City,a.Street, `
+	sql += `a.LinkAddress,a.LinkProvince,a.LinkCity,a.LinkStreet,a.BusinessScope, `
+	sql += `b.InStyle, b.Id CertId, `
+	sql += `group_concat(distinct e.NeedFileType) NeedFileType `
+	if liftjoon != "" {
+		sql += `,group_concat(distinct d.Name) CerSubName `
+	}
+	sql += `from ` + supplierTableName + ` a `
+	sql += `left join ` + supplierCertTableName + ` b on b.SupplierId = a.Id `
+	sql += liftjoon
+	sql += `left join ` + OilSupplierFileName + ` e  on e.SupplierId = a.Id `
+	sql += `LEFT JOIN tmp_OilSupplierCertSub t ON t.SupplierCertId = b.Id `
+	sql += `where ` + where
+
+	sql += ` group by a.Id,b.Id ` + having
+	if asc {
+		sql += ` order by ` + orderby + ` ASC `
+	} else {
+		sql += ` order by ` + orderby + ` DESC `
+	}
+	sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
+
+
+	sqlCount := "SELECT FOUND_ROWS() as total"
+
+	var totalResult TotalResult
+	session := s.DBE.NewSession()
+	session.Begin()
+	session.SQL(sql).Find(entitiesPtr)
+	session.SQL(sqlCount).Get(&totalResult)
+	session.Commit()
+	total = totalResult.Total
+
+	return total
 }

+ 24 - 0
src/dashoo.cn/backend/api/business/oilsupplier/suppliercertsub/oilsuppliercertsub.go

@@ -51,6 +51,30 @@ type Del_OilSupplierCertSub struct {
 	DeleteDate           time.Time `xorm:"DATETIME"`
 }
 
+type Tmp_OilSupplierCertSub struct {
+	Id                   int       `xorm:<- not null pk autoincr INT(10)"`
+	SupplierId           int       `xorm:"not null comment('供方基本信息表主键') INT(10)"`
+	SupplierCertId       int       `xorm:"not null comment('供方准入证书信息表主键') INT(10)"`
+	SupplierCertAppendId int       `xorm:"not null comment('增项信息表ID') INT(10)"`
+	GoodsLevel           string    `xorm:"not null default '' comment('级别')"`
+	IsManufacturer		 int	   `xorm:"not null comment('是否为供应商') INT(11)"`
+	SupplierTypeCode     string    `xorm:"not null default '' comment('准入类别代码') VARCHAR(5)"`
+	SubClassId           int       `xorm:"not null comment('分类表主键(物资类或基建类或技术服务类)') INT(10)"`
+	Code                 string    `xorm:"not null default '' comment('分类编码') VARCHAR(8)"`
+	AppendStatus         string    `xorm:"not null default '' comment('增项审核状态') VARCHAR(10)"`
+	Type                 string    `xorm:"not null default '' comment('类型') VARCHAR(10)"`
+	Name                 string    `xorm:"not null default '' comment('分类名称') VARCHAR(50)"`
+	CertSubStatus        string    `xorm:"null default '1' comment('1:正常2:不良记录暂停') VARCHAR(10)"`
+	Remark               string    `xorm:"comment('备注') VARCHAR(500)"`
+	IsDelete             int       `xorm:"default 0 comment('删除状态,0正常,1已删除') INT(10)"`
+	CreateOn             time.Time `xorm:"DATETIME created"`
+	CreateUserId         int       `xorm:"INT(10)"`
+	CreateBy             string    `xorm:"VARCHAR(50)"`
+	ModifiedOn           time.Time `xorm:"DATETIME"`
+	ModifiedUserId       int       `xorm:"INT(10)"`
+	ModifiedBy           string    `xorm:"VARCHAR(50)"`
+}
+
 type goodsChecked struct {
 	Id       string `json:"id"`
 	Code     string

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

@@ -275,6 +275,7 @@ var (
 	OilAnnualChangeItemName                  string = "OilAnnualChangeItem"           //信息变更表
 	Tmp_OilGoodsAptitudeName                 string = "tmp_OilGoodsAptitude"
 	Tmp_OilGoodsAptitudeClassName            string = "tmp_OilGoodsAptitudeClass"
+	TmpOilSupplierCertSubName                string = "tmp_OilSupplierCertSub"
 )
 
 //分页信息及数据

+ 313 - 5
src/dashoo.cn/backend/api/controllers/oilsupplier/goodsaptitude.go

@@ -1431,9 +1431,12 @@ func (this *OilGoodsAptitudeController) UpdataSuppierCertSub() {
 
 	t := time.Now()
 
+	goodsvc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
+	goodsvc.TruncateTable(TmpOilSupplierCertSubName)
+
 	supsvc := supplier.GetOilSupplierService(utils.DBE)
 	var suppliercertList []suppliercert.OilSupplierCert
-	where := "SupplierTypeCode='01' AND OutsideFlog = '' AND (InFlag IN ('1','2')) "
+	where := "AccessCardNo='2018WZ035'"//"SupplierTypeCode='01' AND OutsideFlog = '' AND (InFlag IN ('1','2')) "
 	supsvc.GetEntities(&suppliercertList, where)
 
 	var goodsaptitudeClassList []goodsaptitudeclass.OilGoodsAptitudeClass
@@ -1474,8 +1477,9 @@ func (this *OilGoodsAptitudeController) UpdataSuppierCertSub() {
 							cell := row.AddCell()
 							cell.Value = supplierCertSub.Code + "  " + supplierCertSub.Name
 							log.Println(supplierCertSub.Code + "====" + val)
-							wheredel := "Id = " + strconv.Itoa(supplierCertSub.Id)
-							supsvc.DeleteEntityBytbl(OilSupplierCertSubName, wheredel)
+							//wheredel := "Id = " + strconv.Itoa(supplierCertSub.Id)
+							//supsvc.DeleteEntityBytbl(OilSupplierCertSubName, wheredel)
+							supsvc.InsertEntityBytbl(TmpOilSupplierCertSubName, supplierCertSub)
 							break
 						}
 						if  supplierCertSub.Name != goodsaptitudeClass.Name {
@@ -1492,8 +1496,9 @@ func (this *OilGoodsAptitudeController) UpdataSuppierCertSub() {
 				}
 			}
 			if decCode != "" {
-				wheredel := "Code = '" + decCode + "'"
-				supsvc.DeleteEntityBytbl(OilSupplierCertSubName, wheredel)
+				//wheredel := "Code = '" + decCode + "'"
+				//supsvc.DeleteEntityBytbl(OilSupplierCertSubName, wheredel)
+				supsvc.InsertEntityBytbl(TmpOilSupplierCertSubName, supplierCertSub)
 			}
 			cell1 := row.AddCell()
 			cell1.Value = decCode
@@ -1531,4 +1536,307 @@ func (this *OilGoodsAptitudeController) GetGoodsAptitudeName(classId, IsManuf st
 	}
 
 	return strings.Split(goodsAptitudeName, ",")
+}
+
+// @Title 获取所有
+// @Description
+// @Success 200 {object}
+// @router /getcompanylist [post]
+func (this *OilGoodsAptitudeController) GetTList() {
+
+	var model  supplier.OilSupplierSelect
+	var model1 supplier.RegCapitalRange    //注册资金范围
+	//var model2 supplier.NeedFileTypeStruct //资质结构体
+
+	var jsonBlob = this.Ctx.Input.RequestBody
+	json.Unmarshal(jsonBlob, &model)
+	json.Unmarshal(jsonBlob, &model1)
+	//json.Unmarshal(jsonBlob, &model2)
+
+	// //获取分页信息
+	page := this.GetPageInfoForm()
+	where := " 1=1 AND b.InFlag in (1,2,3) AND b.Status = '8' and b.SupplierTypeCode = '01' AND  t.SupplierId IS NOT NULL "
+	orderby := "a.Id"
+	asc := true
+	Order := this.GetString("Order")
+	Prop := this.GetString("Prop")
+	CheckUId := this.GetString("CheckUId")
+	FullId := this.GetString("FullId")
+	if Order != "" && Prop != "" {
+		orderby = Prop
+		if Order == "desc" {
+			asc = false
+		}
+	}
+	leftjoin := ""
+	//准入证号
+	if model.AccessCardNo != "" {
+		where = where + " and b.AccessCardNo like '%" + model.AccessCardNo + "%'"
+	}
+	//企业名称
+	if model.SupplierName != "" {
+		where = where + " and a.SupplierName like '%" + model.SupplierName + "%'"
+	}
+
+	if model.OldSupplierName != "" {
+		where = where + " and OldSupplierName like '%" + model.OldSupplierName + "%'"
+	}
+	if FullId != "" {
+		where = where + " and f.Id = '" + FullId + "'"
+	}
+	if CheckUId != "" {
+		where = where + " and g.CheckUnitId = '" + CheckUId + "'"
+	}
+
+	//准入标识 1 准入 2 暂停 3取消
+	if model.InFlag != "" {
+		where = where + " and b.InFlag = '" + model.InFlag + "'"
+	}
+	//法人
+	if model.LegalPerson != "" {
+		where = where + " and a.LegalPerson like '%" + model.LegalPerson + "%'"
+	}
+	//联系人
+	if model.ContactName != "" {
+		where = where + " and a.ContactName like '%" + model.ContactName + "%'"
+	}
+	//统一社会信用代码
+	if model.CommercialNo != "" {
+		where = where + " and a.CommercialNo like '%" + model.CommercialNo + "%'"
+	}
+	//开户银行
+	if model.DepositBank != "" {
+		where = where + " and a.DepositBank like '%" + model.DepositBank + "%'"
+	}
+	//HSE审查
+	if model.HseTraining != "" {
+		where = where + " and a.HseTraining = '" + model.HseTraining + "'"
+	}
+	//公司类型
+	if model.CompanyType != "" {
+		where = where + " and a.CompanyType like '%" + model.CompanyType + "%'"
+	}
+	//成立时间
+	SetupTime := this.GetString("SetupTime")
+	if SetupTime != "" {
+		where = where + " and a.SetupTime ='" + SetupTime + "'"
+	}
+	//注册资金范围
+	if model1.RegCapital1 != "" {
+		where = where + " and a.RegCapital >= '" + model1.RegCapital1 + "'"
+	}
+	if model1.RegCapital2 != "" {
+		where = where + " and a.RegCapital <= '" + model1.RegCapital2 + "'"
+	}
+
+	//注册省份
+	if model.Province != "" {
+		where = where + " and a.Province = '" + model.Province + "'"
+	}
+	//注册市
+	if model.City != "" {
+		where = where + " and a.City = '" + model.City + "'"
+	}
+	//注册区
+	if model.Street != "" {
+		where = where + " and a.Street = '" + model.Street + "'"
+	}
+	//注册详细地址
+	if model.Address != "" {
+		where = where + " and a.Address like '%" + model.Address + "%'"
+	}
+	if model.LinkProvince != "" {
+		where = where + " and a.LinkProvince = '" + model.LinkProvince + "'"
+	}
+	if model.LinkCity != "" {
+		where = where + " and a.LinkCity = '" + model.LinkCity + "'"
+	}
+	if model.LinkStreet != "" {
+		where = where + " and a.LinkStreet = '" + model.LinkStreet + "'"
+	}
+	if model.LinkAddress != "" {
+		where = where + " and a.LinkAddress like '%" + model.LinkAddress + "%'"
+	}
+	//营业范围
+	if model.BusinessScope != "" {
+		where = where + " and a.BusinessScope like '%" + model.BusinessScope + "%'"
+	}
+	CreateOn := this.GetString("CreateOn")
+	if CreateOn != "" {
+		dates := strings.Split(CreateOn, ",")
+		if len(dates) == 2 {
+			minDate := dates[0]
+			maxDate := dates[1]
+			where = where + " and a.CreateOn>='" + minDate + "' and a.CreateOn<='" + maxDate + "'"
+		}
+	}
+
+	a := model.InStyle
+	fmt.Println(a)
+	//准入方式
+	if model.InStyle != "" {
+		if model.InStyle == "0"{
+			where = where + " and b.InStyle in ('2','3','4','5')"
+		}else{
+			where = where + " and b.InStyle ='" + model.InStyle + "'"
+		}
+	}
+
+	having:=""
+	//准入范围
+	if model.CerSubName!="" {
+		having = " having CerSubName like '%"+model.CerSubName+"%' "
+		leftjoin = "left join "+ OilSupplierCertSubName + " d  on d.SupplierCertId = b.Id "
+	}
+	//资质
+	if model.NeedFileType!="" {
+		having = " having NeedFileType like '%"+model.NeedFileType+"%' "
+	}
+	if model.CerSubName!=""&& model.NeedFileType!=""{
+		having = " having CerSubName like '%"+model.CerSubName+"%' and  NeedFileType like '%"+model.NeedFileType+"%' "
+		leftjoin = "left join "+ OilSupplierCertSubName + " d  on d.SupplierCertId = b.Id "
+	}
+	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
+	var list []supplier.OilSupplierSelect
+
+	total := svc.GetMyPagingDelEntitiesWithOrderBytbl(OilSupplierName, OilSupplierCertName, OilInfoChangeName,OilCorporateInfoName,OilSupplierCertSubName,
+		OilSupplierFileName, page.CurrentPage, page.Size, orderby, asc, &list, where,having, leftjoin)
+
+	var datainfo DataInfo
+	datainfo.Items = list
+	datainfo.CurrentItemCount = total
+	datainfo.PageIndex = page.CurrentPage
+	datainfo.ItemsPerPage = page.Size
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+
+}
+
+// @Title 获取删除的准入项
+// @Description get user by token
+// @Success 200 {object} []suppliercertsub.OilSupplierCertSub
+// @router /delcertsublist [get]
+func (this *OilGoodsAptitudeController) GetDelCertSubList() {
+	//获取分页信息
+	page := this.GetPageInfoForm()
+	where := " 1=1 "
+	orderby := "Id"
+	asc := false
+	Order := this.GetString("Order")
+	Prop := this.GetString("Prop")
+	if Order != "" && Prop != "" {
+		orderby = Prop
+		if Order == "asc" {
+			asc = true
+		}
+	}
+	Id := this.GetString("Id")
+	SupplierId := this.GetString("SupplierId")
+	SupplierCertId := this.GetString("SupplierCertId")
+	SupplierTypeCode := this.GetString("SupplierTypeCode")
+	Code := this.GetString("Code")
+	Name := this.GetString("Name")
+	Remark := this.GetString("Remark")
+	IsDelete := this.GetString("IsDelete")
+	CreateOn := this.GetString("CreateOn")
+	CreateUserId := this.GetString("CreateUserId")
+	CreateBy := this.GetString("CreateBy")
+	ModifiedOn := this.GetString("ModifiedOn")
+	ModifiedUserId := this.GetString("ModifiedUserId")
+	ModifiedBy := this.GetString("ModifiedBy")
+
+	if Id != "" {
+		where = where + " and Id like '%" + Id + "%'"
+	}
+
+	if SupplierId != "" {
+		where = where + " and SupplierId like '%" + SupplierId + "%'"
+	}
+
+	if SupplierCertId != "" {
+		where = where + " and SupplierCertId = '" + SupplierCertId + "'"
+	}
+
+	if SupplierTypeCode != "" {
+		where = where + " and SupplierTypeCode = '" + SupplierTypeCode + "'"
+	}
+
+	if Code != "" {
+		where = where + " and Code like '%" + Code + "%'"
+	}
+
+	if Name != "" {
+		where = where + " and Name like '%" + Name + "%'"
+	}
+
+	if Remark != "" {
+		where = where + " and Remark like '%" + Remark + "%'"
+	}
+
+	if IsDelete != "" {
+		where = where + " and IsDelete like '%" + IsDelete + "%'"
+	}
+
+	if CreateUserId != "" {
+		where = where + " and CreateUserId like '%" + CreateUserId + "%'"
+	}
+
+	if CreateBy != "" {
+		where = where + " and CreateBy like '%" + CreateBy + "%'"
+	}
+
+	if ModifiedOn != "" {
+		where = where + " and ModifiedOn like '%" + ModifiedOn + "%'"
+	}
+
+	if ModifiedUserId != "" {
+		where = where + " and ModifiedUserId like '%" + ModifiedUserId + "%'"
+	}
+
+	if ModifiedBy != "" {
+		where = where + " and ModifiedBy like '%" + ModifiedBy + "%'"
+	}
+
+	if CreateOn != "" {
+		dates := strings.Split(CreateOn, ",")
+		if len(dates) == 2 {
+			minDate := dates[0]
+			maxDate := dates[1]
+			where = where + " and CreateOn>='" + minDate + "' and CreateOn<='" + maxDate + "'"
+		}
+	}
+	where = where + " and Type in (1, 3)"
+	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
+	var list []suppliercertsub.Tmp_OilSupplierCertSub
+	total := svc.GetMyPagingEntitiesWithOrderBytbl(TmpOilSupplierCertSubName, page.CurrentPage, page.Size, orderby, asc, &list, where)
+	var datainfo DataInfo
+	datainfo.Items = list
+	datainfo.CurrentItemCount = total
+	datainfo.PageIndex = page.CurrentPage
+	datainfo.ItemsPerPage = page.Size
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
+// @Title 删除不符合的的准入项
+// @Description get user by token
+// @Success 200 {object} []suppliercertsub.OilSupplierCertSub
+// @router /deltmpsuppliercertsub [get]
+func (this *OilGoodsAptitudeController) DelTmpSupplierCertSub() {
+	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
+	where := "1=1"
+	err := svc.DeleteEntityBytbl(TmpOilSupplierCertSubName, where)
+
+	var errinfo ErrorInfo
+	if err == nil {
+		errinfo.Code = 0
+		errinfo.Message = "删除成功!"
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	} else {
+		errinfo.Code = -1
+		errinfo.Message = "删除失败!"
+		this.Data["json"] = &errinfo
+		this.ServeJSON()
+	}
 }

+ 14 - 0
src/dashoo.cn/frontend_web/src/api/oilsupplier/goodsaptitude.js

@@ -117,5 +117,19 @@ export default {
       url: '/goodsaptitude/updatasuppiercertsub',
       method: 'GET'
     })
+  },
+  getCompanyList (params, formdata, myAxios) {
+    return myAxios({
+      url: '/goodsaptitude/getcompanylist',
+      method: 'post',
+      params: params,
+      data: formdata
+    })
+  },
+  delTmpSupplierCertSub (myAxios) {
+    return myAxios({
+      url: '/goodsaptitude/deltmpsuppliercertsub',
+      method: 'get'
+    })
   }
 }

+ 674 - 0
src/dashoo.cn/frontend_web/src/pages/oilsupplier/goodsaptitude/_opera/showdelcertsub.vue

@@ -0,0 +1,674 @@
+<template>
+  <div>
+    <!--顶部显示-->
+    <el-breadcrumb class="heading">
+      <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
+      <el-breadcrumb-item>待删除准入项</el-breadcrumb-item>
+    </el-breadcrumb>
+
+    <!--内框顶部显示-->
+    <el-card class="box-card" style="height: calc(100vh - 115px);position:relative">
+      <div slot="header">
+        <span>
+          <i class="icon icon-table2"></i> 待删除准入项查询
+        </span>
+
+        <el-form
+          :model="searchForm"
+          ref="searchformRef"
+          :inline="true"
+          style="float: right;position:absolute;right:15px;top:10.5px"
+        >
+          <el-form-item label="准入编码">
+            <el-input size="mini" v-model="searchForm.AccessCardNo" placeholder="请输入内容"></el-input>
+          </el-form-item>
+          <el-form-item label="企业名称">
+            <el-input size="mini" v-model="searchForm.SupplierName" placeholder="请输入内容"></el-input>
+          </el-form-item>
+
+          <el-form-item>
+            <el-dropdown
+              split-button
+              type="primary"
+              size="mini"
+              @click="initDatas($event)"
+              @command="searchCommand"
+            >
+              查询
+              <el-dropdown-menu slot="dropdown">
+                <el-dropdown-item command="search">高级查询</el-dropdown-item>
+                <el-dropdown-item command="clear">查询重置</el-dropdown-item>
+              </el-dropdown-menu>
+            </el-dropdown>
+          </el-form-item>
+          <el-form-item>
+           <!--<el-button type="primary" size="mini" @click="exportExcel">导出</el-button>-->
+            <el-button type="warning" size="mini" @click="delSupplierCertSub">删除</el-button>
+            <router-link :to="'/oilsupplier/goodsaptitude'">
+              <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" >返回</el-button>
+            </router-link>
+          </el-form-item>
+          <!-- 预留接口 公司基本信息和准入范围 -->
+          <!-- <el-form-item label="特殊查询">
+            <el-input size="mini" v-model="Spesearch" placeholder="输入特殊查询"></el-input>
+          </el-form-item>
+          <el-form-item>
+            <el-button type="primary" size="mini" @click="ssearch">特殊查询</el-button>
+          </el-form-item> -->
+        </el-form>
+      </div>
+
+      <!--内框表格显示-->
+      <el-table id="rebateSetTable" :data="entityList" size="mini" v-loading="loading" border height="calc(100vh - 243px)"
+        style="width: 100%" @sort-change="orderby" >
+        <el-table-column label="操作" width="260px" align="center" fixed="right" show-overflow-tooltip>
+          <template slot-scope="scope">
+            <el-button type="text" @click="opencertsub(scope.row)" title="导出" size="mini" icon="el-icon-document" width="120px">待删除准入范围</el-button>
+            <!--<el-button type="text" @click="openfilelist(scope.row)" title="导出" size="mini" icon="el-icon-document" width="120px">企业资质</el-button>-->
+          </template>
+        </el-table-column>
+        <!--内框表格剩余栏显示-->
+        <el-table-column label="状态" prop="InFlag" width="100px" align="center">
+          <template slot-scope="scope">
+            <el-alert v-if="scope.row.InFlag=='1'" :closable="false" style="background:rgba(255,255,255,0.2)" title="准入" type="success" ></el-alert>
+            <el-alert v-if="scope.row.InFlag=='2'" :closable="false" style="background:rgba(255,255,255,0.2)" title="暂停" type="warning" ></el-alert>
+            <el-alert v-if="scope.row.InFlag=='3'" :closable="false" style="background:rgba(255,255,255,0.2)" title="取消" type="error"></el-alert>
+          </template>
+        </el-table-column>
+        <el-table-column label="准入编码" width="100px" prop="AccessCardNo" sortable align="center">
+           <template slot-scope="scope" >
+             <span style="font-family:'黑体';font-size:13px">{{scope.row.AccessCardNo}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="企业名称" min-width="300px" prop="SupplierName" sortable align="center"></el-table-column>
+        <el-table-column label="准入类别" prop="SupplierTypeCode" align="center">
+          <template slot-scope="scope">
+              {{transferStr(scope.row.SupplierTypeCode)}}
+          </template>
+        </el-table-column>
+        <el-table-column label="法人代表"  width="100px" prop="LegalPerson" align="center"></el-table-column>
+        <el-table-column label="注册资金(万元)"  width="170px" prop="RegCapital" sortable align="center"></el-table-column>
+        <el-table-column label="移动电话"  width="120px" prop="Mobile" align="center"></el-table-column>
+        <!--<el-table-column label="最后一次年审" width="100px" prop="AuditDate" align="center">-->
+          <!--<template slot-scope="scope">{{ jstimehandle(scope.row.AuditDate) }}</template>-->
+        <!--</el-table-column>-->
+      </el-table>
+
+      <!-- 分页 -->
+      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[10, 15, 20, 25]" :page-size="size"
+        layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount"></el-pagination>
+    </el-card>
+
+    <!--查询框-->
+    <el-dialog title="高级查询" :visible.sync="dialogVisible" width="720px">
+      <el-form label-width="135px">
+        <el-row>
+          <el-col :span="12">
+            <el-form-item label="准入编码">
+              <el-input size="mini" v-model="searchForm.AccessCardNo" placeholder="请输入内容"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="企业名称">
+              <el-input size="mini" v-model="searchForm.SupplierName" placeholder="请输入内容"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="准入标识">
+              <el-select
+                size="mini"
+                style="width:100%"
+                v-model="searchForm.InFlag"
+                placeholder="请选择"
+              >
+                <el-option label="全部" value></el-option>
+                <el-option label="准入" value="1"></el-option>
+                <el-option label="暂停" value="2"></el-option>
+                <el-option label="取消" value="3"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="法人">
+              <el-input size="mini" v-model="searchForm.LegalPerson" placeholder="请输入内容"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="统一社会信用代码">
+              <el-input size="mini" v-model="searchForm.CommercialNo" placeholder="请输入内容"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item label="成立时间">
+              <el-date-picker
+                v-model="SetupTime"
+                size="mini"
+                type="date"
+                format="yyyy 年 MM 月 dd 日"
+                value-format="yyyy-MM-dd"
+                placeholder="选择日期"
+                style="width: 100%"
+              ></el-date-picker>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-form-item label="注册资本(万元)">
+            <el-col :span="5">
+              <el-input size="mini" v-model="searchForm.RegCapital1" placeholder="请输入内容"></el-input>
+            </el-col>
+            <el-col :span="1">
+              <span>&nbsp;~</span>
+            </el-col>
+            <el-col :span="5">
+              <el-input size="mini" v-model="searchForm.RegCapital2" placeholder="请输入内容"></el-input>
+            </el-col>
+          </el-form-item>
+        </el-row>
+         <el-row>
+          <el-col :span="24">
+            <el-form-item label="企业资质">
+              <el-input size="mini" v-model="searchForm.NeedFileType" placeholder="请输入内容"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="24">
+            <el-form-item label="准入范围">
+              <el-input size="mini" v-model="searchForm.CerSubName" placeholder="请输入内容"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="dialogVisible = false">取 消</el-button>
+        <el-button size="mini" type="primary" @click="initDatas($event)">查 询</el-button>
+      </span>
+    </el-dialog>
+    <el-dialog :visible.sync="dialogVisibleCertsSub" width="80%">
+      <el-card class="box-card">
+            <div slot="header" class="clearfix">
+              <span style="font-weight: bold">准入范围</span>
+              <span style="float: right;">
+                <el-form ref="form" :inline="true" style="margin-top: -10px">
+                  <el-form-item label="编码">
+                    <el-input size="mini" v-model="searchFormSub.Code" style="width: 100%"></el-input>
+                  </el-form-item>
+                  <el-form-item label="名称">
+                    <el-input size="mini" v-model="searchFormSub.Name" style="width: 100%"></el-input>
+                  </el-form-item>
+                  <el-form-item>
+                    <el-button type="primary" size="mini" style="margin-left: 8px" @click="search">查询</el-button>
+                    <!--<el-button type="primary" @click="toPdf" size="mini" style="margin-left: 25px">下载准入范围</el-button>-->
+                  </el-form-item>
+                </el-form>
+              </span>
+            </div>
+            <el-table :data="certsubList" border size="mini">
+              <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 label="状态"
+                               align="center"
+                               width="100px">
+                <template slot-scope="scope">
+            <span v-if="scope.row.CertSubStatus=='1'"
+                  style="color:#67C23A">准入</span>
+                  <span v-else-if="scope.row.CertSubStatus=='2'"
+                        style="color:#E6A23C">暂停</span>
+                  <span v-else>——</span>
+                </template>
+              </el-table-column>
+            </el-table>
+            <el-pagination
+              @size-change="handleSizeChangeSub"
+              @current-change="handleCurrentChangeSub"
+              :current-page="currentPageSub"
+              :page-sizes="[10, 50, 100, 200, 400]"
+              :page-size="sizeSub"
+              layout="total, sizes, prev, pager, next, jumper"
+              :total="currentItemCountSub"
+            ></el-pagination>
+          </el-card>
+    </el-dialog>
+    <el-dialog :visible.sync="dialogVisibleSubFile" width="80%">
+      <subfile-list ref="subfileListRef"
+                        :SupplierId="SupplierId"
+                        height="360px"
+                        style="margin-top: 20px"></subfile-list>
+
+    </el-dialog>
+  </div>
+</template>
+
+
+
+
+
+<script>
+import api from '@/api/oilsupplier/goodsaptitude'
+import FileSaver from 'file-saver'
+import XLSX from 'xlsx'
+import oapi from '@/api/oilsupplier/supplier'
+import SubfileList from '@/pages/select/components/subfilelist'
+
+export default {
+  components: {
+    SubfileList
+  },
+  created () {
+    Object.assign(this.searchFormReset, this.searchForm)
+    // 执行初始化方法
+    this.getDictOptions()
+    this.initDatas()
+    this.getDictOptions2()
+    // watermark.set("大港油田企业法规处")
+  },
+  data () {
+    return {
+      SupplierId: '',
+      Id: '',
+      SupplierCertId: '',
+      SupplierTypeCode: '',
+      SupplierName: '',
+      dialogVisibleCertsSub: false,
+      dialogVisibleSubFile: false,
+      loading: false,
+      Spesearch: '',
+      orgOptions: [],
+      auditorg: '',
+      selectDept: '',
+      allorgunitOptions: [],
+      HSEOptions: [
+        {
+          value: '',
+          label: '全部'
+        },
+        {
+          value: '1',
+          label: '是'
+        },
+        {
+          value: '0',
+          label: '否'
+        }
+      ],
+      nftOptions: [],
+      CityAry: [],
+      LinkCityAry: [],
+      countryprops: {
+        value: 'adcode',
+        label: 'name',
+        children: 'districts'
+      },
+      CompanyTypeOptions: [],
+      dictData: null,
+      searchFormReset: {},
+      dialogVisible: false,
+      formData: {
+        SupplierName: '',
+        AccessCardNo: '',
+        SpecTypeCode: '',
+        Country: '',
+        InStyle: '',
+        ManagementUnit: '',
+        CredentialFlag: '',
+        CommercialNo: '',
+        CountryTaxNo: '',
+        OrganCode: '',
+        Address: '',
+        ZipCode: '',
+        LinkAddress: '',
+        LinkZipCode: '',
+        LegalPerson: '',
+        CompanyType: '',
+        RegCapital: '',
+        SetupTime: '',
+        DepositBank: '',
+        BankAccount: '',
+        ContactName: '',
+        Mobile: '',
+        Telphone: '',
+        Fax: '',
+        CompanyTel: '',
+        EMail: '',
+        BankCreditRating: '',
+        Level: '',
+        HseTraining: '',
+        QualitySystemCert: '',
+        ProductQualityCert: '',
+        MaunLicense: '',
+        MaunAgent: '',
+        SupplierCertificate: '',
+        SafetyLicense: '',
+        SpecIndustryCert: '',
+        BusinessScope: '',
+        Remark: ''
+      },
+      show: false,
+      // 定义列表数据
+      entityList: [],
+      // 分页参数
+      sizeSub: 10,
+      currentPageSub: 1,
+      currentItemCountSub: 0,
+      // 分页参数
+      size: 10,
+      currentPage: 1,
+      currentItemCount: 0,
+      SetupTime: '', // 成立时间
+      CreateOn: [],
+      ssList: [],
+      searchForm: {
+        AccessCardNo: '',
+        SupplierName: '',
+        SupplierTypeCode: '',
+        InFlag: '',
+        LegalPerson: '',
+        ContactName: '',
+        CommercialNo: '',
+        RegCapital1: '',
+        RegCapital2: '',
+        CompanyType: '',
+        Province: '',
+        City: '',
+        Street: '',
+        Address: '',
+        LinkProvince: '',
+        LinkCity: '',
+        LinkStreet: '',
+        LinkAddress: '',
+        DepositBank: '',
+        BusinessScope: '',
+        OldSupplierName: '',
+        HseTraining: '',
+        // NeedFileType: [],
+        NeedFileType: '',
+        CerSubName: '',
+        FullName: '',
+        CheckUserName: '',
+        CheckUserId: ''
+      },
+      searchFormSub: {
+        Code: '',
+        Name: ''
+      },
+      // 列表排序
+      Column: {
+        Order: '',
+        Prop: ''
+      },
+      countryoptions: [],
+
+      certsubList: []
+    }
+  },
+
+  methods: {
+    delSupplierCertSub () {
+      this.$confirm('此操作将删除缺少资质的准入项, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        api.delTmpSupplierCertSub(this.$axios).then(res => {
+          console.log(res)
+          if (res.data.code === 0) {
+            this.$message({
+              type: 'success',
+              message: res.data.message
+            })
+            this.initDatas()
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        })
+      })
+    },
+    search () {
+      this.getCertSub()
+    },
+    openfilelist (row) {
+      let _this = this
+      _this.dialogVisibleSubFile = true
+      _this.SupplierId = row.Id
+    },
+    opencertsub (row) {
+      this.certsubList = []
+      this.dialogVisibleCertsSub = true
+      this.Id = row.Id
+      this.SupplierCertId = row.CertId
+      this.SupplierTypeCode = row.SupplierTypeCode
+      this.SupplierName = row.SupplierName
+      this.getCertSub(row)
+    },
+    getCertSub (row) {
+      let _this = this
+      const params = {
+        SupplierCertId: this.SupplierCertId,
+        SupplierTypeCode: this.SupplierTypeCode,
+        _currentPage: this.currentPageSub,
+        _size: this.sizeSub
+      }
+      Object.assign(params, this.searchFormSub)
+      this.$axios.get('goodsaptitude/delcertsublist', {
+        params
+      })
+        .then(res => {
+          _this.certsubList = res.data.items
+          _this.currentItemCountSub = res.data.currentItemCount
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    },
+    transferStr (val) {
+      if (val === '01') {
+        return '物资类'
+      } else if (val === '02') {
+        return '基建类'
+      } else if (val === '03') {
+        return '技术服务类'
+      } else {
+        return val
+      }
+    },
+    GetorgOptions () {
+      let _this = this
+      this.$axios.get('/register/orgloginlist').then(res => {
+        _this.orgOptions = res.data.items
+      }).catch(err => {
+        console.log(err)
+      })
+    },
+    getDictOptions2 () {
+      let params = {
+      }
+      oapi.getDictListByStatus(params, this.$axios).then(res => {
+        this.allorgunitOptions = res.data.items['Allunitorglist']
+      }).catch(err => {
+        console.error(err)
+      })
+    },
+    handleLinkAreaChange (value) {
+      this.searchForm.LinkProvince = value[0]
+      this.searchForm.LinkCity = value[1]
+      this.searchForm.LinkStreet = value[2]
+    },
+    handleAreaChange (value) {
+      this.searchForm.Province = value[0]
+      this.searchForm.City = value[1]
+      this.searchForm.Street = value[2]
+    },
+    getDictOptions () {
+      oapi
+        .getDictList(this.$axios)
+        .then(res => {
+          this.dictData = res.data.items
+          this.CompanyTypeOptions = this.dictData['CompanyType']
+          this.getCityList(this.dictData['GaodeMapChinaAreas'])
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    },
+    getCityList (val) {
+      let resultData = JSON.parse(val)
+      let countstr = JSON.stringify(resultData.districts[0].districts)
+      countstr = countstr.replace(/\,\"districts\"\:\[\]/g, '')
+      this.countryoptions = JSON.parse(countstr)
+    },
+    exportExcel () {
+      /* generate workbook object from table */
+      let wb = XLSX.utils.table_to_book(
+        document.querySelector('#rebateSetTable')
+      )
+      /* get binary string as output */
+      let wbout = XLSX.write(wb, {
+        bookType: 'xlsx',
+        bookSST: true,
+        type: 'array'
+      })
+      try {
+        FileSaver.saveAs(
+          new Blob([wbout], { type: 'application/octet-stream' }),
+          'SupplierSituation.xlsx'
+        )
+      } catch (e) {
+        if (typeof console !== 'undefined') console.log(e, wbout)
+      }
+      return wbout
+    },
+
+    // 列表排序功能
+    orderby (column) {
+      if (column.order === 'ascending') {
+        this.Column.Order = 'asc'
+      } else if (column.order === 'descending') {
+        this.Column.Order = 'desc'
+      }
+      this.Column.Prop = column.prop
+      this.initDatas()
+    },
+    jstimehandle (val) {
+      if (val === '') {
+        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 {
+        val = val.replace('T', ' ')
+        return val.substring(0, 10)
+      }
+    },
+    // 初始化列表方法
+    initDatas (event) {
+      if (event != null) {
+        this.currentPage = 1
+        this.dialogVisible = false
+      }
+      this.loading = true
+      let myCreateOn = []
+      // 解析时间
+      if (this.CreateOn != null && this.CreateOn.length === 2) {
+        this.CreateOn[1].setHours(23)
+        this.CreateOn[1].setMinutes(59)
+        this.CreateOn[1].setSeconds(59)
+        myCreateOn.push(this.formatDateTime(this.CreateOn[0]))
+        myCreateOn.push(this.formatDateTime(this.CreateOn[1]))
+      }
+      let params = {
+        _size: this.size,
+        _currentPage: this.currentPage,
+        Order: this.Column.Order,
+        Prop: this.Column.Prop,
+        SetupTime: this.SetupTime,
+        CreateOn: myCreateOn.join(','),
+        CheckUId: this.auditorg,
+        FullId: this.selectDept
+      }
+      api.getCompanyList(params, this.searchForm, this.$axios)
+        .then(res => {
+          this.entityList = res.data.items
+          this.currentItemCount = res.data.currentItemCount
+          this.loading = false
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    },
+    // 分页方法
+    handleCurrentChangeSub (value) {
+      this.currentPageSub = value
+      this.getCertSub()
+    },
+    handleSizeChangeSub (value) {
+      this.sizeSub = value
+      this.currentPageSub = 1
+      this.getCertSub()
+    },
+    // 分页方法
+    handleCurrentChange (value) {
+      this.currentPage = value
+      this.initDatas()
+    },
+    handleSizeChange (value) {
+      this.size = value
+      this.currentPage = 1
+      this.initDatas()
+    },
+    searchCommand (command) {
+      if (command === 'search') {
+        this.dialogVisible = true
+      } else if (command === 'clear') {
+        this.clearSearch()
+      }
+    },
+    clearSearch () {
+      Object.assign(this.searchForm, this.searchFormReset)
+      this.CityAry = []
+      this.SetupTime = ''
+      this.auditorg = ''
+      this.selectDept = '',
+      (this.LinkCityAry = []), (this.currentPage = 1)
+      this.initDatas()
+    },
+    formatDateTime (date) {
+      var y = date.getFullYear()
+      var m = date.getMonth() + 1
+      m = m < 10 ? ('0' + m) : m
+      var d = date.getDate()
+      d = d < 10 ? ('0' + d) : d
+      var h = date.getHours()
+      var minute = date.getMinutes()
+      minute = minute < 10 ? ('0' + minute) : minute
+      return y + '-' + m + '-' + d + ' ' + h + ':' + minute
+    }
+  }
+}
+</script>
+
+<style>
+.eldialog .el-input__inner {
+  border: none;
+}
+.eldialog .el-textarea__inner {
+  border: none;
+  resize: none;
+  height: 70px;
+}
+</style>
+

+ 10 - 0
src/dashoo.cn/frontend_web/src/pages/oilsupplier/goodsaptitude/index.vue

@@ -17,6 +17,9 @@
           </el-button>
           <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="updatasuppiercertsub()">更新企业资质
           </el-button>
+          <router-link :to="'/oilsupplier/goodsaptitude/_opera/showdelcertsub'">
+            <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;">查看待删除准入项</el-button>
+          </router-link>
           <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="showimport">查看导入内容
           </el-button>
           <el-button type="primary" size="mini" style="margin-left:10px; margin-top: -4px;" @click="importExcel">导入
@@ -452,6 +455,9 @@
     <el-dialog title="导入失败" :visible.sync="errorDialogVisible" :close-on-click-modal = "false" width="720px">
       <el-input type="textarea" autosize placeholder="请输入内容" v-model="textarea"></el-input>
     </el-dialog>
+    <el-dialog title="删除的准入项" :visible.sync="deleteDialogVisible" :close-on-click-modal = "false" width="720px">
+
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -473,6 +479,7 @@
 
     data () {
       return {
+        deleteDialogVisible: false,
         importloading: false,
         textarea: '',
         showimportvisible: false,
@@ -798,6 +805,9 @@
       this.getDictOptions()
     },
     methods: {
+      showDelSupplierCertSub () {
+        this.deleteDialogVisible = true
+      },
       updatasuppiercertsub () {
         this.$confirm('此操作将更新企业资质, 是否继续?', '提示', {
           confirmButtonText: '确定',