2
3
Quellcode durchsuchen

Merge branch 'develop' of http://code.dashoo.cn/dashoo/supplier_system into develop

baichengfei vor 5 Jahren
Ursprung
Commit
fe61634500

+ 49 - 48
src/dashoo.cn/backend/api/business/oilsupplier/goodsaptitude/oilgoodsaptitudeService.go

@@ -225,7 +225,7 @@ func (s *OilGoodsAptitudeService) GetPagingCheckedEntities(pageIndex, itemsPerPa
 	sql = `SELECT 
 		 a.Id,a.SupplierName,
 		 b.SupplierTypeCode, b.SupplierTypeName,
-		 b.AccessCardNo,b.SupplierTypeCode, a.DepositBank,a.HseTraining,
+		 b.AccessCardNo, a.DepositBank,a.HseTraining,
 		 a.CompanyType,a.SetupTime,a.Address,a.Province,a.City,a.Street,
 		a.LegalPerson,a.RegCapital,a.Mobile,b.AuditDate,b.ApplyTime,b.InFlag,
 		a.ContactName,a.CommercialNo,a.LinkAddress,a.LinkProvince,
@@ -363,7 +363,7 @@ func (s *OilGoodsAptitudeService) GetPagingTmpCheckedEntities(pageIndex, itemsPe
 	sql = `SELECT 
 			 a.Id,a.SupplierName,
 			 b.SupplierTypeCode, b.SupplierTypeName,
-			 b.AccessCardNo,b.SupplierTypeCode, a.DepositBank,a.HseTraining,
+			 b.AccessCardNo, a.DepositBank,a.HseTraining,
 			 a.CompanyType,a.SetupTime,a.Address,a.Province,a.City,a.Street,
 			a.LegalPerson,a.RegCapital,a.Mobile,b.AuditDate,b.ApplyTime,b.InFlag,
 			a.ContactName,a.CommercialNo,a.LinkAddress,a.LinkProvince,
@@ -421,51 +421,52 @@ func (s *OilGoodsAptitudeService) GetPagingTmpCheckedEntities(pageIndex, itemsPe
 			max(goods.F46) AS F46,
 			
 			(
-			if((max(goods.F01)='1' AND LOCATE('F01', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND 
-			if((max(goods.F02)='1' AND LOCATE('F02', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F03)='1' AND LOCATE('F03', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F04)='1' AND LOCATE('F04', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F05)='1' AND LOCATE('F05', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F06)='1' AND LOCATE('F06', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F07)='1' AND LOCATE('F07', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F08)='1' AND LOCATE('F08', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F09)='1' AND LOCATE('F09', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F10)='1' AND LOCATE('F10', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F11)='1' AND LOCATE('F12', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F13)='1' AND LOCATE('F13', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F14)='1' AND LOCATE('F14', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F15)='1' AND LOCATE('F15', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F16)='1' AND LOCATE('F16', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F17)='1' AND LOCATE('F17', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F18)='1' AND LOCATE('F18', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F19)='1' AND LOCATE('F19', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F20)='1' AND LOCATE('F20', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F21)='1' AND LOCATE('F21', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F22)='1' AND LOCATE('F22', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F23)='1' AND LOCATE('F23', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F24)='1' AND LOCATE('F24', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F25)='1' AND LOCATE('F25', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F26)='1' AND LOCATE('F26', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F27)='1' AND LOCATE('F27', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F28)='1' AND LOCATE('F28', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F29)='1' AND LOCATE('F29', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F30)='1' AND LOCATE('F30', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F31)='1' AND LOCATE('F31', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F32)='1' AND LOCATE('F32', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F33)='1' AND LOCATE('F33', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F34)='1' AND LOCATE('F34', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F35)='1' AND LOCATE('F35', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F36)='1' AND LOCATE('F36', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F37)='1' AND LOCATE('F37', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F38)='1' AND LOCATE('F38', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F39)='1' AND LOCATE('F39', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F40)='1' AND LOCATE('F40', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F41)='1' AND LOCATE('F41', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F42)='1' AND LOCATE('F42', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F43)='1' AND LOCATE('F43', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F44)='1' AND LOCATE('F44', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F45)='1' AND LOCATE('F45', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) AND
-			if((max(goods.F46)='1' AND LOCATE('F46', group_concat(DISTINCT header.Code)) >= 0), TRUE, FALSE) 
+			if((max(goods.F01)='1' AND LOCATE('F01', group_concat(DISTINCT header.Code)) > 0) or (max(goods.F01) is null) or (max(goods.F01) = ''), TRUE, FALSE) AND 
+			if((max(goods.F02)='1' AND LOCATE('F02',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F02) is null) or (max(goods.F02) = ''), TRUE, FALSE) AND
+			if((max(goods.F03)='1' AND LOCATE('F03',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F03) is null) or (max(goods.F03) = ''), TRUE, FALSE) AND
+			if((max(goods.F04)='1' AND LOCATE('F04',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F04) is null) or (max(goods.F04) = ''), TRUE, FALSE) AND
+			if((max(goods.F05)='1' AND LOCATE('F05',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F05) is null) or (max(goods.F05) = ''), TRUE, FALSE) AND
+			if((max(goods.F06)='1' AND LOCATE('F06',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F06) is null) or (max(goods.F06) = ''), TRUE, FALSE) AND
+			if((max(goods.F07)='1' AND LOCATE('F07',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F07) is null) or (max(goods.F07) = ''), TRUE, FALSE) AND
+			if((max(goods.F08)='1' AND LOCATE('F08',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F08) is null) or (max(goods.F08) = ''), TRUE, FALSE) AND
+			if((max(goods.F09)='1' AND LOCATE('F09',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F09) is null) or (max(goods.F09) = ''), TRUE, FALSE) AND
+			if((max(goods.F10)='1' AND LOCATE('F10',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F10) is null) or (max(goods.F10) = ''), TRUE, FALSE) AND
+			if((max(goods.F10)='1' AND LOCATE('F11',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F11) is null) or (max(goods.F11) = ''), TRUE, FALSE) AND
+			if((max(goods.F11)='1' AND LOCATE('F12',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F12) is null) or (max(goods.F12) = ''), TRUE, FALSE) AND
+			if((max(goods.F13)='1' AND LOCATE('F13',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F13) is null) or (max(goods.F13) = ''), TRUE, FALSE) AND
+			if((max(goods.F14)='1' AND LOCATE('F14',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F14) is null) or (max(goods.F14) = ''), TRUE, FALSE) AND
+			if((max(goods.F15)='1' AND LOCATE('F15',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F15) is null) or (max(goods.F15) = ''), TRUE, FALSE) AND
+			if((max(goods.F16)='1' AND LOCATE('F16',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F16) is null) or (max(goods.F16) = ''), TRUE, FALSE) AND
+			if((max(goods.F17)='1' AND LOCATE('F17',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F17) is null) or (max(goods.F17) = ''), TRUE, FALSE) AND
+			if((max(goods.F18)='1' AND LOCATE('F18',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F18) is null) or (max(goods.F18) = ''), TRUE, FALSE) AND
+			if((max(goods.F19)='1' AND LOCATE('F19',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F19) is null) or (max(goods.F19) = ''), TRUE, FALSE) AND
+			if((max(goods.F20)='1' AND LOCATE('F20',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F20) is null) or (max(goods.F20) = ''), TRUE, FALSE) AND
+			if((max(goods.F21)='1' AND LOCATE('F21',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F21) is null) or (max(goods.F21) = ''), TRUE, FALSE) AND
+			if((max(goods.F22)='1' AND LOCATE('F22',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F22) is null) or (max(goods.F22) = ''), TRUE, FALSE) AND
+			if((max(goods.F23)='1' AND LOCATE('F23',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F23) is null) or (max(goods.F23) = ''), TRUE, FALSE) AND
+			if((max(goods.F24)='1' AND LOCATE('F24',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F24) is null) or (max(goods.F24) = ''), TRUE, FALSE) AND
+			if((max(goods.F25)='1' AND LOCATE('F25',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F25) is null) or (max(goods.F25) = ''), TRUE, FALSE) AND
+			if((max(goods.F26)='1' AND LOCATE('F26',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F26) is null) or (max(goods.F26) = ''), TRUE, FALSE) AND
+			if((max(goods.F27)='1' AND LOCATE('F27',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F27) is null) or (max(goods.F27) = ''), TRUE, FALSE) AND
+			if((max(goods.F28)='1' AND LOCATE('F28',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F28) is null) or (max(goods.F28) = ''), TRUE, FALSE) AND
+			if((max(goods.F29)='1' AND LOCATE('F29',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F29) is null) or (max(goods.F29) = ''), TRUE, FALSE) AND
+			if((max(goods.F30)='1' AND LOCATE('F30',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F30) is null) or (max(goods.F30) = ''), TRUE, FALSE) AND
+			if((max(goods.F31)='1' AND LOCATE('F31',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F31) is null) or (max(goods.F31) = ''), TRUE, FALSE) AND
+			if((max(goods.F32)='1' AND LOCATE('F32',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F32) is null) or (max(goods.F32) = ''), TRUE, FALSE) AND
+			if((max(goods.F33)='1' AND LOCATE('F33',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F33) is null) or (max(goods.F33) = ''), TRUE, FALSE) AND
+			if((max(goods.F34)='1' AND LOCATE('F34',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F34) is null) or (max(goods.F34) = ''), TRUE, FALSE) AND
+			if((max(goods.F35)='1' AND LOCATE('F35',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F35) is null) or (max(goods.F35) = ''), TRUE, FALSE) AND
+			if((max(goods.F36)='1' AND LOCATE('F36',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F36) is null) or (max(goods.F36) = ''), TRUE, FALSE) AND
+			if((max(goods.F37)='1' AND LOCATE('F37',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F37) is null) or (max(goods.F37) = ''), TRUE, FALSE) AND
+			if((max(goods.F38)='1' AND LOCATE('F38',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F38) is null) or (max(goods.F38) = ''), TRUE, FALSE) AND
+			if((max(goods.F39)='1' AND LOCATE('F39',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F39) is null) or (max(goods.F39) = ''), TRUE, FALSE) AND
+			if((max(goods.F40)='1' AND LOCATE('F40',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F40) is null) or (max(goods.F40) = ''), TRUE, FALSE) AND
+			if((max(goods.F41)='1' AND LOCATE('F41',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F41) is null) or (max(goods.F41) = ''), TRUE, FALSE) AND
+			if((max(goods.F42)='1' AND LOCATE('F42',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F42) is null) or (max(goods.F42) = ''), TRUE, FALSE) AND
+			if((max(goods.F43)='1' AND LOCATE('F43',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F43) is null) or (max(goods.F43) = ''), TRUE, FALSE) AND
+			if((max(goods.F44)='1' AND LOCATE('F44',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F44) is null) or (max(goods.F44) = ''), TRUE, FALSE) AND
+			if((max(goods.F45)='1' AND LOCATE('F45',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F45) is null) or (max(goods.F45) = ''), TRUE, FALSE) AND
+			if((max(goods.F46)='1' AND LOCATE('F46',  group_concat(DISTINCT header.Code)) > 0) or (max(goods.F46) is null) or (max(goods.F46) = ''), TRUE, FALSE) 
 			) AS checked
 			
 			 FROM OilSupplier a
@@ -485,7 +486,7 @@ func (s *OilGoodsAptitudeService) GetPagingTmpCheckedEntities(pageIndex, itemsPe
 	}
 	sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
 
-	sqlCount := "SELECT count(*) as total FROM OilSupplier a LEFT JOIN OilSupplierCert b ON a.Id=b.SupplierId WHERE b.SupplierTypeCode='01'"
+	sqlCount := "SELECT count(DISTINCT a.Id) as total FROM OilSupplier a LEFT JOIN OilSupplierCert b ON a.Id=b.SupplierId LEFT JOIN OilSupplierCertSub sub ON b.Id=sub.SupplierCertId LEFT JOIN OilSupplierFile files ON a.Id=files.SupplierId LEFT JOIN Base_TableHeader header ON files.NeedFileType=header.Name LEFT JOIN tmp_OilGoodsAptitudeClass class ON sub.Code=class.Code LEFT JOIN tmp_OilGoodsAptitude goods ON class.Id=goods.ClassId WHERE b.SupplierTypeCode='01' AND " + having
 
 	var totalResult TotalResult
 	s.DBE.SQL(sql).Find(entitiesPtr)

+ 44 - 0
src/dashoo.cn/backend/api/business/oilsupplier/supplier/oilsupplier.go

@@ -246,6 +246,50 @@ type OilSupplierSelect struct {
 	Remark           string
 }
 
+type OilSupplierContrast struct {
+	Id               int //Oilsupplier表id
+	CertId           int
+	AccessCardNo     string    //准入证号
+	SupplierName     string    //企业名称
+	OldSupplierName  string    //企业曾用名
+	SupplierTypeCode string    //准入类别编号
+	LegalPerson      string    //法定代表人姓名
+	RegCapital       float64   //注册资本
+	Mobile           string    //移动电话
+	AuditDate        time.Time //最后一次年审
+	ApplyTime        time.Time //有效期至
+	InFlag           string    //状态
+	ContactName      string    //联系人姓名
+	CommercialNo     string    //统一社会信用代码
+	DepositBank      string    //开户银行
+	HseTraining      string    //是否需要进行HSE审查培训
+	CompanyType      string    //公司类型
+	SetupTime        time.Time //成立时间
+	Address          string    //注册详细地址
+	Province         string    //注册省
+	City             string    //注册市
+	Street           string    //注册区
+	LinkAddress      string    //通信详细地址
+	LinkProvince     string    //通信地址省
+	LinkCity         string    //通信地址市
+	LinkStreet       string    //通信地址区
+	BusinessScope    string    //营业范围
+	NeedFileType     string    //资质
+	CerSubName       string    //准入范围
+	InStyle          string    //准入方式
+	FullName         string    //专业科室审批
+	CheckUnitName    string    //推荐单位
+	Remark           string
+
+	SubCnt           string
+	HeaderCodes           string
+	SubNames           string
+	CertSubCodes           string
+	SubClassIds           string
+	F01           string
+	Checked           string
+}
+
 //type NeedFileTypeStruct struct {
 //	NeedFileType []string
 //	CertSubName string

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

@@ -1986,7 +1986,8 @@ func (this *OilGoodsAptitudeController) GetDelCertSubList() {
 	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)
+	//total := svc.GetMyPagingEntitiesWithOrderBytbl(TmpOilSupplierCertSubName, page.CurrentPage, page.Size, orderby, asc, &list, where)
+	total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierCertSubName, page.CurrentPage, page.Size, orderby, asc, &list, where)
 	var datainfo DataInfo
 	datainfo.Items = list
 	datainfo.CurrentItemCount = total
@@ -2019,7 +2020,8 @@ func (this *OilGoodsAptitudeController) DelTmpSupplierCertSub() {
 	if id != "" {
 		wheredel += " and Id=" + id
 	}
-	svc.GetEntitysByWhere(TmpOilSupplierCertSubName, wheredel, &supplierCertSubList)
+	//svc.GetEntitysByWhere(TmpOilSupplierCertSubName, wheredel, &supplierCertSubList)
+	svc.GetEntitysByWhere(OilSupplierCertSubName, wheredel, &supplierCertSubList)
 
 	var errinfo ErrorInfo
 	for _, item := range supplierCertSubList {
@@ -2036,7 +2038,8 @@ func (this *OilGoodsAptitudeController) DelTmpSupplierCertSub() {
 
 	for _, item := range supplierCertSubList {
 		where := "Id = " + strconv.Itoa(item.Id)
-		err = svc.DeleteEntityBytbl(TmpOilSupplierCertSubName, where)
+		//err = svc.DeleteEntityBytbl(TmpOilSupplierCertSubName, where)
+		err = svc.DeleteEntityBytbl(OilSupplierCertSubName, where)
 	}
 
 	if err == nil {
@@ -2148,9 +2151,9 @@ func (this *OilGoodsAptitudeController) GetCompareTmpSupplier() {
 			where = where + " and CreateOn>='" + minDate + "' and CreateOn<='" + maxDate + "'"
 		}
 	}
-	where = where + " and b.Type in (1, 3)"
+	where = where + " and sub.Type in (1, 3)"
 	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
-	var list []supplier.OilSupplierSelect
+	var list []supplier.OilSupplierContrast
 	total := svc.GetPagingTmpCheckedEntities(page.CurrentPage, page.Size, orderby, asc, &list, where)
 	var datainfo DataInfo
 	datainfo.Items = list

+ 328 - 5
src/dashoo.cn/frontend_web/src/pages/oilsupplier/goodsaptitude/tmpsuppliercheck.vue

@@ -23,14 +23,14 @@
             </el-dropdown>
           </el-form-item>
           <el-form-item>
-            <el-button type="warning" size="mini">导出</el-button>
+            <el-button type="warning" size="mini" @click="exportExcel">导出</el-button>
           </el-form-item>
         </el-form>
       </div>
 
       <!--内框表格显示-->
       <el-table id="rebateSetTable1" highlight-current-row :data="conList" size="mini" v-loading="loading" border height="calc(100vh - 243px)"
-                style="width: 100%" @sort-change="orderby" >
+                style="width: 100%" @sort-change="orderby" :row-class-name="tableRowClassName">
         <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>
@@ -58,6 +58,11 @@
         <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="130px" prop="Checked" sortable align="center">
+          <template slot-scope="scope" >
+            <span style="font-family:'黑体';font-size:13px">{{stringChecked(scope.row.Checked)}}</span>
+          </template>
+        </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>-->
@@ -67,11 +72,76 @@
       <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 :visible.sync="dialogVisibleCertsSub" width="90%">
+      <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 label="操作" width="160px" align="center" fixed="right" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <el-button type="text" style="color: #F56C6C" @click="delcertsubbyid(scope.row)" title="删除" size="mini" icon="el-icon-delete" width="90px">删除</el-button>
+            </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 prop="GoodsLevel" label="级别" width="80px" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span v-if="scope.row.GoodsLevel=='1'">一级</span>
+              <span v-if="scope.row.GoodsLevel=='2'">二级</span>
+            </template>
+          </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>
   </div>
 </template>
 
 <script>
   import api from '@/api/oilsupplier/goodsaptitude'
+  import XLSX from "xlsx";
   export default {
     name: 'compareTmpSupplier',
     created () {
@@ -91,6 +161,7 @@
         },
         conList: [],
         loading: false,
+        dialogVisibleCertsSub: false,
         searchForm: {
           AccessCardNo: '',
           SupplierName: '',
@@ -120,11 +191,87 @@
           FullName: '',
           CheckUserName: '',
           CheckUserId: ''
-        }
+        },
+        SupplierId: '',
+        Id: '',
+        SupplierCertId: '',
+        SupplierTypeCode: '',
+        SupplierName: '',
+        searchFormSub: {
+          Code: '',
+          Name: ''
+        },
+        // 分页参数
+        sizeSub: 10,
+        currentPageSub: 1,
+        currentItemCountSub: 0,
+        certsubList: [],
+        showcolumn: [],
+        tableColumns: [
+
+          {
+            prop: 'InFlag',
+            label: '状态',
+            width: 120,
+            sort: true
+          },
+          {
+            prop: 'AccessCardNo',
+            label: '准入编码',
+            width: 150,
+            sort: true
+          },
+
+          {
+            prop: 'SupplierName',
+            label: '企业名称',
+            width: 120,
+            sort: true
+          },
+
+          {
+            prop: 'SupplierTypeCode',
+            label: '准入类别',
+            width: 150,
+            sort: true
+          },
+
+          {
+            prop: 'LegalPerson',
+            label: '法人代表',
+            width: 120,
+            sort: true
+          },
+
+          {
+            prop: 'RegCapital',
+            label: '注册资金',
+            width: 150,
+            sort: true
+          },
+
+          {
+            prop: 'Mobile',
+            label: '移动电话',
+            width: 120,
+            sort: true
+          }
+
+        ],
+        dynamicTableColumns: [],
       }
     },
 
     methods: {
+      tableRowClassName({row, rowIndex}) {
+        // console.log(row, 'row')
+        console.log(row.Checked, 'row')
+        if (row.Checked === "1") {
+          return 'blue-row'
+        } else{
+          return 'yellow-row'
+        }
+      },
       searchCommand (command) {
         if (command === 'search') {
           this.dialogVisible = true
@@ -162,7 +309,26 @@
         this.currentPage = 1
         this.initDatas()
       },
+      transferStr (val) {
+        if (val === '01') {
+          return '物资类'
+        } else if (val === '02') {
+          return '基建类'
+        } else if (val === '03') {
+          return '服务类'
+        } else {
+          return val
+        }
+      },
+      stringChecked(val) {
+        if (val === '1') {
+          return '否'
+        }  else {
+          return '是'
+        }
+      },
       initDatas () {
+        this.loading = true
         // 分页及列表条件
         let params = {
           _currentPage: this.currentPage,
@@ -185,14 +351,171 @@
         Object.assign(params, this.searchForm)
         // 访问接口
         api.getCompareTmpSupplier(params, this.$axios).then(res => {
-          this.entityList = res.data.items
+          this.conList = res.data.items
           this.currentItemCount = res.data.currentItemCount
+          this.loading = false
         }).catch(err => {
           console.error(err)
         })
-      }
+      },
+      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)
+          })
+      },
+      // 分页方法
+      handleCurrentChangeSub (value) {
+        this.currentPageSub = value
+        this.getCertSub()
+      },
+      handleSizeChangeSub (value) {
+        this.sizeSub = value
+        this.currentPageSub = 1
+        this.getCertSub()
+      },
+      // 导出准入范围到pdf
+      toPdf () {
+        api.pdfexport(this.Id, this.SupplierTypeCode, this.$axios)
+          .then(res => {
+            // response
+            if (res.data.code === 0) {
+              // this.$message({
+              //   type: 'success'
+              //   message: res.data.message
+              // })
+              let docurl = res.data.item
+              let pdfurl
+              // 内网服务器专用
+              if (process.client && docurl.indexOf('upfile') === 0) {
+                const myDomain = window.location.host
+                // location.href = 'http://' + myDomain + '/' + docurl
+                pdfurl = 'http://' + process.env.LOCAL_IP + '/' + docurl
+                let requestParams = {
+                  pdfUrl: pdfurl,
+                  watermark: this.SupplierName
+                }
+                this.$axios.post('supplierdataentry/word-to-pdf-watermark', requestParams)
+                  .then(function (res) {
+                    window.open('http://' + myDomain + '/' + res.data)
+                  })
+              } else {
+                // location.href = 'http://' + docurl
+                pdfurl = 'http://' + docurl
+                let requestParams = {
+                  pdfUrl: pdfurl,
+                  watermark: this.SupplierName
+                }
+                this.$axios.post('supplierdataentry/word-to-pdf-watermark', requestParams)
+                  .then(function (res) {
+                    window.open('http://' + res.data)
+                  })
+              }
+            }
+          }).catch(err => {
+          console.error(err)
+        })
+      },
+      search () {
+        this.getCertSub()
+      },
+      delcertsubbyid (row) {
+        console.log(row)
+        this.$confirm('是否删除准入项?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          let params = {
+            Id: row.Id
+          }
+          console.log(params)
+          api.delTmpSupplierCertSub(params, this.$axios).then(res => {
+            console.log(res)
+            if (res.data.code === 0) {
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+              this.getCertSub()
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          })
+        })
+      },
+      exportExcel () {
+        console.log('111111导出')
+        this.loading = true
+        // 显示列
+        Object.assign(this.showcolumn, this.tableColumns)
+        Object.assign(this.showcolumn, this.dynamicTableColumns)
+        let showcolumn = this.tableColumns.concat(this.dynamicTableColumns)
+        let showcolumnarr = []
+        let showcolumnnamearr = []
 
+        for (var i = 0; i < showcolumn.length; i++) {
+          showcolumnarr.push(showcolumn[i].label)
+          showcolumnnamearr.push(showcolumn[i].prop.replace(/,/g, ','))
+        }
+        let params = {
+          _currentPage: this.currentPage,
+          _size: this.size,
+          Order: this.Column.Order,
+          Prop: this.Column.Prop,
+          Edition: '1',
+          showcolumnarr: showcolumnarr + '',
+          showcolumnnamearr: showcolumnnamearr + ''
+        }
+        api.exportExcelAll(params, this.$axios).then(res => {
+          this.loading = false
+          let docurl = res.data
+          // 内网服务器专用
+          if (process.client && docurl.indexOf('upfile') === 0) {
+            const myDomain = window.location.host
+            location.href = 'http://' + myDomain + '/' + docurl
+          } else {
+            location.href = 'http://' + docurl
+          }
+        })
+      },
     }
 
   }
 </script>
+
+<style>
+.el-table .blue-row {
+  background: deepskyblue;
+}
+
+.el-table .yellow-row {
+  background: yellow;
+}
+</style>