浏览代码

前后:对比列表

dubch 5 年之前
父节点
当前提交
4d6a36bbcc

+ 4 - 1
src/dashoo.cn/backend/api/business/oilsupplier/goodsaptitude/oilgoodsaptitudeService.go

@@ -560,10 +560,13 @@ func (s *OilGoodsAptitudeService) GetPagingSubEntities(pageIndex, itemsPerPage i
 	return total
 }
 
-func (s *OilGoodsAptitudeService) GetTableTotal(where string) (total int64) {
+func (s *OilGoodsAptitudeService) GetTableTotal(where string, entitiesPtr interface{}) (total int64) {
 
 	sqlCount := "SELECT count(*) as total FROM OilSupplierCertSub where (" + where + ")"
 
+	sql := "SELECT * FROM OilSupplierCertSub where (" + where + ")"
+	s.DBE.SQL(sql).Find(entitiesPtr)
+
 	var totalResult TotalResult
 	s.DBE.SQL(sqlCount).Get(&totalResult)
 	total = totalResult.Total

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

@@ -8,7 +8,6 @@ import (
 	"dashoo.cn/backend/api/business/oilsupplier/supplierfile"
 	"dashoo.cn/backend/api/business/oilsupplier/supplierpausereason"
 	"dashoo.cn/backend/api/business/oilsupplier/tableheader"
-	"dashoo.cn/backend/api/business/oilsupplier/technologyserviceclass"
 	"encoding/json"
 	"fmt"
 	"github.com/tealeg/xlsx"
@@ -1705,17 +1704,17 @@ func (this *OilGoodsAptitudeController) CreateContrast() {
 		svc.GetPagingTmpCheckedEntities(&list, where)
 		if list != nil {
 			var supplierCertSubList []suppliercertsub.OilSupplierCertSub
-			total := svc.GetTableTotal(" SupplierTypeCode='01' AND SupplierId = " + strconv.Itoa(item.Id))
-			total1 := svc.GetNoSubCntTotal("a.SupplierTypeCode = '03' and b.`Name` is null and a.SupplierId = " + strconv.Itoa(item.Id))
+			total := svc.GetTableTotal(" SupplierTypeCode='01' AND SupplierId = " + strconv.Itoa(item.Id), &supplierCertSubList)
+			total1 := svc.GetNoSubCntTotal("a.SupplierTypeCode = '01' and b.`Name` is null and a.SupplierId = " + strconv.Itoa(item.Id))
 			list[0].SubCnt = int(total)
 			list[0].MinClassId = "0"
 			list[0].NoSubCnt = int(total1)
 			for _, sub := range supplierCertSubList {
-				var technologyClassList technologyserviceclass.OilTechnologyServiceClass
-				where2 := "Name = '"+ sub.Name + "'"
-				svc.GetEntityByWhere(OilTechnologyServiceClassName, where2, &technologyClassList)
-				if technologyClassList.Id > 0{
-					list[0].MinClassId = strconv.Itoa(technologyClassList.Id)
+				var goodsList goodsaptitudeclass.OilGoodsAptitudeClass
+				where2 := "Code = '"+ sub.Code + "'"
+				svc.GetEntityByWhere(OilGoodsAptitudeClassName, where2, &goodsList)
+				if goodsList.Id > 0{
+					list[0].MinClassId = strconv.Itoa(goodsList.Id)
 				} else {
 					list[0].MinClassId = "0"
 					break

+ 10 - 2
src/dashoo.cn/frontend_web/src/pages/oilsupplier/goodsaptitude/tmpclasscheck.vue

@@ -34,8 +34,8 @@
           </el-form-item>
         </el-form>
       </div>
-      <el-table highlight-current-row :data="entityList" id="rebateSetTable" size="mini" border height="calc(100vh - 243px)"
-                style="width: 100%" @sort-change="orderby" v-loading="loading" :row-class-name="tableRowClassName">
+      <el-table :data="entityList" id="rebateSetTable" size="mini" border height="calc(100vh - 243px)"
+                style="width: 100%" @sort-change="orderby" v-loading="loading" :row-class-name="tableRowClassName" :cell-style="hover">
         <el-table-column align="center">
           <template slot-scope="scope">
             <el-checkbox :key="scope.row['ClassId']" @change="handleCheckedCitiesChange($event, scope.row['ClassId'])">
@@ -216,6 +216,14 @@
           return 'yellow-row'
         }
       },
+      hover({row, rowIndex}) {
+        if (row.checked === 1) {
+          console.log(row.checked, 'checked')
+          return "background-color:lightyellow"
+        } else {
+          return "background-color:white"
+        }
+      },
       // 列表排序功能
       orderby (column) {
         if (column.order === 'ascending') {

+ 9 - 2
src/dashoo.cn/frontend_web/src/pages/oilsupplier/technologyservice/tmpclasscheck.vue

@@ -31,8 +31,8 @@
           </el-form-item>
         </el-form>
       </div>
-      <el-table highlight-current-row :data="entityList" id="rebateSetTable" size="mini" border height="calc(100vh - 243px)"
-                style="width: 100%" @sort-change="orderby" v-loading="loading" :row-class-name="tableRowClassName">
+      <el-table :data="entityList" id="rebateSetTable" size="mini" border height="calc(100vh - 243px)"
+                style="width: 100%" @sort-change="orderby" v-loading="loading" :row-class-name="tableRowClassName" :cell-style="hover">
         <el-table-column align="center">
           <template slot-scope="scope">
             <el-checkbox :key="scope.row['ClassId']" @change="handleCheckedCitiesChange($event, scope.row['ClassId'])">
@@ -163,6 +163,13 @@
           return 'yellow-row'
         }
       },
+      hover({row, rowIndex}) {
+        if (row.checked === 1) {
+          return "background-color:lightyellow"
+        } else {
+          return "background-color:white"
+        }
+      },
       // 列表排序功能
       orderby (column) {
         if (column.order === 'ascending') {