2
3
Просмотр исходного кода

前后:评价禁用;生成对比列表加commit

dubch 5 лет назад
Родитель
Сommit
0dc0bde2db

+ 11 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/goodsaptitude.go

@@ -1532,18 +1532,23 @@ func (this *OilGoodsAptitudeController) ImportExcel() {
 			svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
 			var list1 []supplier.OilSupplier
 			svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, 0, 0, "Id", false, &list1, " 1=1")
+			svc.DBE.Query("SET unique_checks=0;")
+			svc.DBE.Query("SET autocommit=0;")
 			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 {
 					total := svc.GetTableTotal(" SupplierId = " + strconv.Itoa(item.Id))
-					total1 := svc.GetTableTotal(" SubClassId > 0 and SupplierId = " + strconv.Itoa(item.Id))
+					total1 := svc.GetTableTotal(" SubClassId = 0 and SupplierId = " + strconv.Itoa(item.Id))
 					list[0].SubCnt = int(total)
 					list[0].NoSubCnt = int(total1)
 					svc.InsertEntityBytbl("OilSupplierContrast", list[0])
+					svc.DBE.Query("commit;")
 				}
 			}
+			svc.DBE.Query("SET unique_checks=1;")
+			svc.DBE.Query("SET autocommit=1;")
 			elapsed1 := time.Since(t)
 			log.Println(elapsed1)
 		}
@@ -1715,6 +1720,8 @@ func (this *OilGoodsAptitudeController) CreateContrast() {
 	// 插入对比列表
 	var list1 []supplier.OilSupplier
 	svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierName, 0, 0, "Id", false, &list1, " 1=1")
+	svc.DBE.Query("SET unique_checks=0;")
+	svc.DBE.Query("SET autocommit=0;")
 	for _, item := range list1 {
 		var list []supplier.OilSupplierContrast
 		where := "  b.SupplierTypeCode='01' and a.Id = " + strconv.Itoa(item.Id)
@@ -1725,8 +1732,11 @@ func (this *OilGoodsAptitudeController) CreateContrast() {
 			list[0].SubCnt = int(total)
 			list[0].NoSubCnt = int(total1)
 			svc.InsertEntityBytbl("OilSupplierContrast", list[0])
+			svc.DBE.Query("commit;")
 		}
 	}
+	svc.DBE.Query("SET unique_checks=1;")
+	svc.DBE.Query("SET autocommit=1;")
 	var errorinfo ErrorInfo
 	errorinfo.Code = 0
 	errorinfo.Message = "成功!"

+ 1 - 2
src/dashoo.cn/frontend_web/src/pages/oilcontract/contract-import/index.vue

@@ -59,7 +59,7 @@
               </div>
               <el-button slot="reference" type="text" v-if="deleteBoolean" style="margin-left:3px" icon="el-icon-delete" size="small" >删除</el-button>
             </el-popover>
-            <el-button type="text"  size="small" v-if="evaluateBoolean && scope.row.Status !== 3" style="margin-left:3px"  icon="el-icon-edit-outline" @click="onNavigateEvaluate(scope.row)">评价</el-button>
+            <el-button type="text" size="small" :disabled="!evaluateBoolean || scope.row.Status === 3" style="margin-left:3px"  icon="el-icon-edit-outline" @click="onNavigateEvaluate(scope.row)">评价</el-button>
           </template>
         </el-table-column>
 
@@ -465,7 +465,6 @@
         tableDataList: {
           tableData: []
         },
-
         searchForm: {
           Id: '',
           SupplierId: '',