2
3
Quellcode durchsuchen

前后:资质导入,对比列表导出

dubch vor 5 Jahren
Ursprung
Commit
4a6462b9c2

+ 4 - 0
src/dashoo.cn/backend/api/business/oilsupplier/goodsaptitude/oilgoodsaptitude.go

@@ -291,4 +291,8 @@ type OilGoodsAptitudeF struct {
 	F44               string    `xorm:"default '' VARCHAR(2)"`
 	F45               string    `xorm:"default '' VARCHAR(2)"`
 	F46               string    `xorm:"default '' VARCHAR(2)"`
+}
+
+type OilGoodsAptitudeCode struct {
+	Codes               string
 }

+ 29 - 5
src/dashoo.cn/backend/api/business/oilsupplier/goodsaptitude/oilgoodsaptitudeService.go

@@ -356,8 +356,7 @@ func (s *OilGoodsAptitudeService) GetPagingCheckedEntities(pageIndex, itemsPerPa
 	return total
 }
 
-func (s *OilGoodsAptitudeService) GetPagingTmpCheckedEntities(pageIndex, itemsPerPage int64, orderby string,
-	asc bool, entitiesPtr interface{}, having string) (total int64) {
+func (s *OilGoodsAptitudeService) GetPagingTmpCheckedEntities(entitiesPtr interface{}, where string) (total int64) {
 
 	var sql string
 	sql = `SELECT 
@@ -471,14 +470,38 @@ func (s *OilGoodsAptitudeService) GetPagingTmpCheckedEntities(pageIndex, itemsPe
 			
 			 FROM OilSupplier a
 			 LEFT JOIN OilSupplierCert b ON a.Id=b.SupplierId
-			 LEFT JOIN OilSupplierCertSub sub ON b.Id=sub.SupplierCertId
+			 LEFT JOIN OilSupplierCertSub sub ON b.Id=sub.SupplierCertId and sub.Type in (1, 3) 
 			 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 `
-	sql += having
+	sql += where
 	sql += ` GROUP BY a.Id, b.Id `
+	//sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
+
+	//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)
+	//s.DBE.SQL(sqlCount).Get(&totalResult)
+	total = totalResult.Total
+
+	return total
+}
+
+func (s *OilGoodsAptitudeService) GetPagingSubEntities(pageIndex, itemsPerPage int64, orderby string,
+	asc bool, entitiesPtr interface{}, having string) (total int64) {
+
+	var sql string
+	sql = `SELECT 
+		 a.*,group_concat(DISTINCT header.Code) AS HeaderCodes
+		 FROM OilSupplierCertSub a
+		 LEFT JOIN OilSupplierFile files ON a.SupplierId=files.SupplierId
+		 LEFT JOIN Base_TableHeader header ON files.NeedFileType=header.Name
+		 LEFT JOIN OilGoodsAptitude goods ON a.SubClassId=goods.ClassId`
+	sql += " where (" + having + ")"
+	sql += ` GROUP BY a.Id `
 	if asc {
 		sql += ` order by ` + orderby + ` ASC `
 	} else {
@@ -486,7 +509,8 @@ func (s *OilGoodsAptitudeService) GetPagingTmpCheckedEntities(pageIndex, itemsPe
 	}
 	sql += ` limit ` + utils.ToStr((pageIndex-1)*itemsPerPage) + "," + utils.ToStr(itemsPerPage)
 
-	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
+	sqlCount := "SELECT count(*) as total FROM OilSupplierCertSub a"
+	sqlCount += " where (" + having + ")"
 
 	var totalResult TotalResult
 	s.DBE.SQL(sql).Find(entitiesPtr)

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

@@ -251,13 +251,10 @@ type OilSupplierContrast struct {
 	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    //统一社会信用代码
@@ -277,8 +274,6 @@ type OilSupplierContrast struct {
 	NeedFileType     string    //资质
 	CerSubName       string    //准入范围
 	InStyle          string    //准入方式
-	FullName         string    //专业科室审批
-	CheckUnitName    string    //推荐单位
 	Remark           string
 
 	SubCnt           string
@@ -286,7 +281,6 @@ type OilSupplierContrast struct {
 	SubNames           string
 	CertSubCodes           string
 	SubClassIds           string
-	F01           string
 	Checked           string
 }
 

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

@@ -26,6 +26,8 @@ type OilSupplierCertSub struct {
 	ModifiedOn           time.Time `xorm:"DATETIME"`
 	ModifiedUserId       int       `xorm:"INT(10)"`
 	ModifiedBy           string    `xorm:"VARCHAR(50)"`
+	HeaderCodes           string
+	Checked           int
 }
 
 type Del_OilSupplierCertSub struct {

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

@@ -630,6 +630,53 @@ func (this *ActivitiService) FillExcel(datas map[string]interface{}, ContractCla
 	fmt.Println("==retDocUrl==", retDocUrl)
 	return retDocUrl
 }
+func (this *ActivitiService) ContrastExcel(datas map[string]interface{}, templateUrl string, fileName string) string {
+	var wordTempVM excelContrastVM
+	wordTempVM.Datas         = datas
+	wordTempVM.TemplateUrl   = templateUrl
+	wordTempVM.FileName      = fileName
+	jsonParam, err := json.Marshal(wordTempVM)
+	if err != nil {
+		fmt.Println(err, "生成json字符串错误")
+	}
+	params := string(jsonParam)
+	retVal := this.PostOrigin("/excel/contrast-excel", params, "")
+	if retVal.StatusCode != 200 {
+		return ""
+	}
+
+	_dir := utils.Cfg.MustValue("file", "tmplateDir") + "excel"
+	utils.CreatePath(_dir)
+	_dir += "/tmp_" + strconv.Itoa(int(time.Now().Unix())) + ".xlsx"
+	raw := retVal.Body
+	defer raw.Close()
+
+	file, err := os.Create(_dir)
+	defer file.Close()
+	writer := bufio.NewWriter(file)
+	defer writer.Flush()
+	body, err := ioutil.ReadAll(raw)
+	writer.Write(body)
+
+	if err != nil {
+		return ""
+	}
+	var sw *Seaweed
+	var filer []string
+	if _filer := os.Getenv("GOSWFS_FILER_URL"); _filer != "" {
+		filer = []string{_filer}
+	}
+	fmt.Println("GOSWFS_FILER_URL2 == ", os.Getenv("GOSWFS_FILER_URL"))
+	sw = NewSeaweed("http", utils.Cfg.MustValue("file", "upFileHost"), filer, 2*1024*1024, 5*time.Minute)
+	//_, fID, err := sw.Upload(retVal.Body, "tmp.pdf", int64(len(pdfByte)), "", "")
+	_, _, fID, err := sw.UploadFile(_dir, "", "")
+	fmt.Println("err_表单下载2=", err)
+	fmt.Println("fID_表单下载2=", fID)
+	retDocUrl := utils.Cfg.MustValue("file", "downFileHost") + "/" + fID
+	os.Remove(_dir)
+	fmt.Println("==retDocUrl==", retDocUrl)
+	return retDocUrl
+}
 
 
 // 带水印

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

@@ -78,6 +78,11 @@ type excelTemplateVM struct {
 	FileName    string                 `json:"fileName"`
 	ContractClass string               `json:"contractClass"`
 }
+type excelContrastVM struct {
+	Datas       map[string]interface{} `json:"datas"`
+	TemplateUrl string                 `json:"templateUrl"`
+	FileName    string                 `json:"fileName"`
+}
 type WordTemplateWatermarkVM struct {
 	Datas       map[string]interface{} `json:"datas"`
 	TemplateUrl string                 `json:"templateUrl"`

+ 2 - 0
src/dashoo.cn/backend/api/conf/app.conf

@@ -80,6 +80,8 @@ OriginUrl=http://localhost:8081/api
 AposeUrl=http://localhost:8081/api/apose
 BaseUrl=http://localhost:8081/api/acti
 
+ContrastExcel=http://weed1.labsop.cn:9390/1,03cbc09423fef5
+
 [bank]
 callbackHost=http://localhost:10091/api
 

+ 92 - 37
src/dashoo.cn/backend/api/controllers/oilsupplier/goodsaptitude.go

@@ -1277,15 +1277,11 @@ func (this *OilGoodsAptitudeController) ImportExcel() {
 		this.Data["json"] = &errorinfo
 		this.ServeJSON()
 	}
+	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
 
-	session := utils.DBE.NewSession()
-	err := session.Begin()
-	svc := goodsaptitude.GetOilGoodsAptitudeSession(session)
-
-	err = svc.TruncateTable(Tmp_OilGoodsAptitudeName)
+	err := svc.TruncateTable(Tmp_OilGoodsAptitudeName)
 
 	if err != nil {
-		session.Rollback()
 		errorinfo.Code = -2
 		errorinfo.Message = "导入失败!"
 		this.Data["json"] = &errorinfo
@@ -1295,7 +1291,6 @@ func (this *OilGoodsAptitudeController) ImportExcel() {
 	err = svc.TruncateTable(Tmp_OilGoodsAptitudeClassName)
 
 	if err != nil {
-		session.Rollback()
 		errorinfo.Code = -2
 		errorinfo.Message = "导入失败!"
 		this.Data["json"] = &errorinfo
@@ -1320,27 +1315,37 @@ func (this *OilGoodsAptitudeController) ImportExcel() {
 	Fstrs = "GoodsLevel,GoodsDesc,Standard,CompanyType," + Fstrs
 	columnArr := strings.Split(Fstrs, ",")
 
-	defer func() {
-		session.Close()
-	}()
-
 	codemap := make(map[string]int)
 	for i := 2; i < len(sheet.Rows); i++ {
 		lineNo := strconv.Itoa(i + 1)
-		this.OperationCell(svc, lineNo, columnArr, codemap, sheet.Rows[i].Cells, &errLineNum)
+		this.OperationCell(lineNo, columnArr, codemap, sheet.Rows[i].Cells, &errLineNum)
 	}
 	os.Remove(filePath)
 
 	if errLineNum != "" {
-		session.Rollback()
 		errorinfo.Code = -1
 		errorinfo.Message = "导入失败!错误行号:" + errLineNum
 		this.Data["json"] = &errorinfo
 		this.ServeJSON()
 	} else {
-		session.Commit()
 		elapsed := time.Since(t)
 		log.Println(elapsed)
+		//清空
+		svc.TruncateTable("OilSupplierContrast")
+		// 插入对比列表
+		svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
+		var list1 []supplier.OilSupplier
+		svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, 0, 0, "Id", false, &list1, " 1=1")
+		for _, item := range list1 {
+			var list []supplier.OilSupplierContrast
+			where := "  b.SupplierTypeCode='01' and a.Id = " + strconv.Itoa(item.Id)
+			svc.GetPagingTmpCheckedEntities(&list, where)
+			if list != nil {
+				svc.InsertEntityBytbl("OilSupplierContrast", list[0])
+			}
+		}
+		elapsed1 := time.Since(t)
+		log.Println(elapsed1)
 		errorinfo.Code = 0
 		errorinfo.Message = "导入成功!"
 		this.Data["json"] = &errorinfo
@@ -1348,7 +1353,7 @@ func (this *OilGoodsAptitudeController) ImportExcel() {
 	}
 }
 
-func (this *OilGoodsAptitudeController) OperationCell(svc *goodsaptitude.OilGoodsAptitudeSession, lineNo string, columnArr []string, codemap map[string]int, cellsArr []*xlsx.Cell, errLineNum *string) {
+func (this *OilGoodsAptitudeController) OperationCell(lineNo string, columnArr []string, codemap map[string]int, cellsArr []*xlsx.Cell, errLineNum *string) {
 
 	defer func() {
 		if err := recover(); err != nil {
@@ -1356,6 +1361,7 @@ func (this *OilGoodsAptitudeController) OperationCell(svc *goodsaptitude.OilGood
 			*errLineNum += lineNo + ","
 		}
 	}()
+	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
 	parentId := 0
 	classId := 0
 	cellsArrLen := len(cellsArr)
@@ -1898,7 +1904,7 @@ func (this *OilGoodsAptitudeController) GetDelCertSubList() {
 	//获取分页信息
 	page := this.GetPageInfoForm()
 	where := " 1=1 "
-	orderby := "Id"
+	orderby := "a.Id"
 	asc := false
 	Order := this.GetString("Order")
 	Prop := this.GetString("Prop")
@@ -1924,55 +1930,55 @@ func (this *OilGoodsAptitudeController) GetDelCertSubList() {
 	ModifiedBy := this.GetString("ModifiedBy")
 
 	if Id != "" {
-		where = where + " and Id like '%" + Id + "%'"
+		where = where + " and a.Id like '%" + Id + "%'"
 	}
 
 	if SupplierId != "" {
-		where = where + " and SupplierId like '%" + SupplierId + "%'"
+		where = where + " and a.SupplierId like '%" + SupplierId + "%'"
 	}
 
 	if SupplierCertId != "" {
-		where = where + " and SupplierCertId = '" + SupplierCertId + "'"
+		where = where + " and a.SupplierCertId = '" + SupplierCertId + "'"
 	}
 
 	if SupplierTypeCode != "" {
-		where = where + " and SupplierTypeCode = '" + SupplierTypeCode + "'"
+		where = where + " and a.SupplierTypeCode = '" + SupplierTypeCode + "'"
 	}
 
 	if Code != "" {
-		where = where + " and Code like '%" + Code + "%'"
+		where = where + " and a.Code like '%" + Code + "%'"
 	}
 
 	if Name != "" {
-		where = where + " and Name like '%" + Name + "%'"
+		where = where + " and a.Name like '%" + Name + "%'"
 	}
 
 	if Remark != "" {
-		where = where + " and Remark like '%" + Remark + "%'"
+		where = where + " and a.Remark like '%" + Remark + "%'"
 	}
 
 	if IsDelete != "" {
-		where = where + " and IsDelete like '%" + IsDelete + "%'"
+		where = where + " and a.IsDelete like '%" + IsDelete + "%'"
 	}
 
 	if CreateUserId != "" {
-		where = where + " and CreateUserId like '%" + CreateUserId + "%'"
+		where = where + " and a.CreateUserId like '%" + CreateUserId + "%'"
 	}
 
 	if CreateBy != "" {
-		where = where + " and CreateBy like '%" + CreateBy + "%'"
+		where = where + " and a.CreateBy like '%" + CreateBy + "%'"
 	}
 
 	if ModifiedOn != "" {
-		where = where + " and ModifiedOn like '%" + ModifiedOn + "%'"
+		where = where + " and a.ModifiedOn like '%" + ModifiedOn + "%'"
 	}
 
 	if ModifiedUserId != "" {
-		where = where + " and ModifiedUserId like '%" + ModifiedUserId + "%'"
+		where = where + " and a.ModifiedUserId like '%" + ModifiedUserId + "%'"
 	}
 
 	if ModifiedBy != "" {
-		where = where + " and ModifiedBy like '%" + ModifiedBy + "%'"
+		where = where + " and a.ModifiedBy like '%" + ModifiedBy + "%'"
 	}
 
 	if CreateOn != "" {
@@ -1980,14 +1986,38 @@ func (this *OilGoodsAptitudeController) GetDelCertSubList() {
 		if len(dates) == 2 {
 			minDate := dates[0]
 			maxDate := dates[1]
-			where = where + " and CreateOn>='" + minDate + "' and CreateOn<='" + maxDate + "'"
+			where = where + " and a.CreateOn>='" + minDate + "' and a.CreateOn<='" + maxDate + "'"
 		}
 	}
-	where = where + " and Type in (1, 3)"
+	where = where + " and a.Type in (1, 3)"
 	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
-	var list []suppliercertsub.Tmp_OilSupplierCertSub
+	var list []suppliercertsub.OilSupplierCertSub
 	//total := svc.GetMyPagingEntitiesWithOrderBytbl(TmpOilSupplierCertSubName, page.CurrentPage, page.Size, orderby, asc, &list, where)
-	total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierCertSubName, page.CurrentPage, page.Size, orderby, asc, &list, where)
+	//total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierCertSubName, page.CurrentPage, page.Size, orderby, asc, &list, where)
+	total := svc.GetPagingSubEntities(page.CurrentPage, page.Size, orderby, asc, &list, where)
+	a := 0
+	for _, item := range list {
+		sql := "SELECT CONCAT_WS(',',IF(ifnull(F01, '') = '', '', F01),IF(ifnull(F02, '') = '', '', F02),IF(ifnull(F03, '') = '', '', F03),IF(ifnull(F04, '') = '', '', F04),IF(ifnull(F05, '') = '', '', F05),IF(ifnull(F06, '') = '', '', F06),IF(ifnull(F07, '') = '', '', F07),IF(ifnull(F08, '') = '', '', F08),IF(ifnull(F09, '') = '', '', F09),IF(ifnull(F10, '') = '', '', F10),IF(ifnull(F11, '') = '', '', F11),IF(ifnull(F12, '') = '', '', F12),IF(ifnull(F13, '') = '', '', F13),IF(ifnull(F14, '') = '', '', F14),IF(ifnull(F15, '') = '', '', F15),IF(ifnull(F16, '') = '', '', F16),IF(ifnull(F17, '') = '', '', F17),IF(ifnull(F18, '') = '', '', F18),IF(ifnull(F19, '') = '', '', F19),IF(ifnull(F20, '') = '', '', F20),IF(ifnull(F21, '') = '', '', F21),IF(ifnull(F22, '') = '', '', F22),IF(ifnull(F23, '') = '', '', F23),IF(ifnull(F24, '') = '', '', F24),IF(ifnull(F25, '') = '', '', F25),IF(ifnull(F26, '') = '', '', F26),IF(ifnull(F27, '') = '', '', F27),IF(ifnull(F28, '') = '', '', F28),IF(ifnull(F29, '') = '', '', F29),IF(ifnull(F30, '') = '', '', F30),IF(ifnull(F31, '') = '', '', F31),IF(ifnull(F32, '') = '', '', F32),IF(ifnull(F33, '') = '', '', F33),IF(ifnull(F34, '') = '', '', F34),IF(ifnull(F35, '') = '', '', F35),IF(ifnull(F36, '') = '', '', F36),IF(ifnull(F37, '') = '', '', F37),IF(ifnull(F38, '') = '', '', F38),IF(ifnull(F39, '') = '', '', F39),IF(ifnull(F40, '') = '', '', F40),IF(ifnull(F41, '') = '', '', F41),IF(ifnull(F42, '') = '', '', F42),IF(ifnull(F43, '') = '', '', F43),IF(ifnull(F44, '') = '', '', F44),IF(ifnull(F45, '') = '', '', F45),IF(ifnull(F46, '') = '', '', F46)) AS Codes FROM OilGoodsAptitude "
+		sql += " where ClassId = "+ strconv.Itoa(item.SubClassId)
+		model, _ := svc.DBE.QueryString(sql)
+		code := strings.Split(model[0]["Codes"], ",")
+		i := 1
+		for _, value := range code {
+			if i > 10 {
+				if value == "1" && strings.Index(item.HeaderCodes, "F"+strconv.Itoa(i)) < 0 {
+					list[a].Checked = 1
+					break
+				}
+			} else {
+				if value == "1" && strings.Index(item.HeaderCodes, "F0"+strconv.Itoa(i)) < 0 {
+					list[a].Checked = 1
+					break
+				}
+			}
+			i += 1
+		}
+		a += 1
+	}
 	var datainfo DataInfo
 	datainfo.Items = list
 	datainfo.CurrentItemCount = total
@@ -2151,12 +2181,12 @@ func (this *OilGoodsAptitudeController) GetCompareTmpSupplier() {
 			where = where + " and CreateOn>='" + minDate + "' and CreateOn<='" + maxDate + "'"
 		}
 	}
-	where = where + " and sub.Type in (1, 3)"
 	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
-	var list []supplier.OilSupplierContrast
-	total := svc.GetPagingTmpCheckedEntities(page.CurrentPage, page.Size, orderby, asc, &list, where)
+	var list2 []supplier.OilSupplierContrast
+
+	total := svc.GetMyPagingEntitiesWithOrderBytbl("OilSupplierContrast", page.CurrentPage, page.Size, orderby, asc, &list2, where)
 	var datainfo DataInfo
-	datainfo.Items = list
+	datainfo.Items = list2
 	datainfo.CurrentItemCount = total
 	datainfo.PageIndex = page.CurrentPage
 	datainfo.ItemsPerPage = page.Size
@@ -2164,7 +2194,32 @@ func (this *OilGoodsAptitudeController) GetCompareTmpSupplier() {
 	this.ServeJSON()
 }
 
+// @Title 导出到execl
+// @Description 导出到execl
+// @Success	200	{object} controllers.Request
+// @router /exportexecl [post]
+func (this *OilGoodsAptitudeController) ExeclExport() {
+	// 填物资类信息表首页信息
+	svcActiviti := workflow.GetActivitiService(utils.DBE)
+	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
+	var list2 []supplier.OilSupplierContrast
+	where := " 1=1"
+	svc.GetMyPagingEntitiesWithOrderBytbl("OilSupplierContrast", 0,0, "Id", false, &list2, where)
+
+	fileName := "资质导入对比表.xlsx"
+	Url := utils.Cfg.MustValue("workflow", "ContrastExcel")
 
+	var datamap = make(map[string]interface{})
+	datamap["data"] = list2
+	retDocUrl := svcActiviti.ContrastExcel(datamap, Url, fileName)
+	var datainfo ErrorDataInfo
+	datainfo.Code = 0
+	datainfo.Item = retDocUrl
+	datainfo.Message = "打印成功"
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+
+}
 
 // @Title 修改资质后找出不符合的准入
 // @Description 修改实体

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

@@ -153,6 +153,12 @@ export default {
       method: 'post'
     })
   },
+  execlexport (myAxios) {
+    return myAxios({
+      url: '/goodsaptitude/exportexecl/',
+      method: 'post'
+    })
+  },
   getCompareTmpSupplier (params, myAxios) {
     return myAxios({
       url: '/goodsaptitude/get-compare-tmp-supplier',

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

@@ -86,12 +86,12 @@
                   </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-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 :data="certsubList" border size="mini" :row-class-name="subRowClassName">
           <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>
@@ -272,6 +272,15 @@
           return 'yellow-row'
         }
       },
+      subRowClassName({row, rowIndex}) {
+        // console.log(row, 'row')
+        console.log(row.Checked, 'row')
+        if (row.Checked === 1) {
+          return 'yellow-row'
+        } else{
+          return 'blue-row'
+        }
+      },
       searchCommand (command) {
         if (command === 'search') {
           this.dialogVisible = true
@@ -365,6 +374,7 @@
         this.SupplierCertId = row.CertId
         this.SupplierTypeCode = row.SupplierTypeCode
         this.SupplierName = row.SupplierName
+        this.currentPageSub = 1
         this.getCertSub(row)
       },
       getCertSub (row) {
@@ -473,37 +483,27 @@
       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
-          }
+        api.execlexport(this.$axios)
+          .then(res => {
+            // response
+            if (res.data.code === 0) {
+              // this.$message({
+              //    type: 'success'
+              //    message: res.data.message
+              // })
+              let docurl = res.data.item
+              // 内网服务器专用
+              if (process.client && docurl.indexOf('upfile') === 0) {
+                const myDomain = window.location.host
+                location.href = 'http://' + myDomain + '/' + docurl
+              } else {
+                location.href = 'http://' + docurl
+              }
+            }
+          }).catch(err => {
+          console.error(err)
         })
+        this.loading = false
       },
     }