Przeglądaj źródła

前后:对比列表

dubch 5 lat temu
rodzic
commit
c580b7c01b

+ 22 - 19
src/dashoo.cn/backend/api/controllers/oilsupplier/goodsaptitude.go

@@ -1496,7 +1496,7 @@ func (this *OilGoodsAptitudeController) ImportExcel() {
 		this.ServeJSON()
 	}
 	// 外网不用 go func()
-	go func() {
+	//go func() {
 		_dir := utils.Cfg.MustValue("file", "tmplateDir") + "xlsx"
 		filename := strconv.Itoa(int(time.Now().Unix())) + ".xlsx"
 		utils.DownloadFile(url, filename, _dir)
@@ -1527,8 +1527,9 @@ func (this *OilGoodsAptitudeController) ImportExcel() {
 		} else {
 			elapsed := time.Since(t)
 			log.Println(elapsed)
+			this.CreateContrast()
 		}
-	}()
+	//}()
 	errorinfo.Code = 0
 	errorinfo.Message = "导入中,请等待!"
 	this.Data["json"] = &errorinfo
@@ -1704,22 +1705,22 @@ 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), &supplierCertSubList)
+			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].MinClassId = "0"
 			list[0].NoSubCnt = int(total1)
-			for _, sub := range supplierCertSubList {
-				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
-				}
-			}
+			//for _, sub := range supplierCertSubList {
+			//	var goodsList goodsaptitudeclass.OilGoodsAptitudeClass
+			//	where2 := "Code = '"+ sub.Code + "'"
+			//	svc.GetEntityByWhere(Tmp_OilGoodsAptitudeClassName, where2, &goodsList)
+			//	if goodsList.Id > 0{
+			//		list[0].MinClassId = strconv.Itoa(goodsList.Id)
+			//	} else {
+			//		list[0].MinClassId = "0"
+			//		break
+			//	}
+			//}
 			list[0].SetupTime = time.Now()
 			var oneTwo supplier.OilSupplierContrast
 			svc.GetEntityByCode("SupplierTypeCode = '01' and SupplierId = "+ strconv.Itoa(list[0].Id), &oneTwo)
@@ -3076,10 +3077,12 @@ func (this *OilGoodsAptitudeController) DeleteSuspend() {
 				//subDelete.DueTime = "2021-06-06 00:00:00"
 				paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
 				DueTimeStr := paramSvc.GetBaseparameterMessage("GFZT", "paramset", "Suspend")
-				fmt.Println("返回的时间", DueTimeStr)
-				local, _ := time.LoadLocation("Local")
-				theTime, _ := time.ParseInLocation("2006-01-02", DueTimeStr, local)
-				subDelete.DueTime = theTime
+				//fmt.Println("返回的时间", DueTimeStr)
+				//local, _ := time.LoadLocation("Local")
+				//theTime, _ := time.ParseInLocation("2006-01-02", DueTimeStr, local)
+				currentTime := time.Now()
+				days,_ := strconv.Atoi(DueTimeStr)
+				subDelete.DueTime = currentTime.AddDate(0, 0, days)
 				i := 1
 				//暂停
 				for _, value := range code {

+ 15 - 16
src/dashoo.cn/backend/api/controllers/oilsupplier/technologyservice.go

@@ -1941,19 +1941,19 @@ func (this *OilTechnologyServiceController) CreateContrast() {
 			total := svc.GetTableTotal(" SupplierTypeCode='03' AND SupplierId = " + strconv.Itoa(item.Id), &supplierCertSubList)
 			total1 := svc.GetNoSubCntTotal("a.SupplierTypeCode = '03' and c.ClassId is null and a.SupplierId = " + strconv.Itoa(item.Id))
 			list[0].SubCnt = int(total)
-			list[0].MinClassId = "0"
+			//list[0].MinClassId = "0"
 			list[0].NoSubCnt = int(total1)
-			for _, sub := range supplierCertSubList {
-				var technologyClassList technologyserviceclass.OilTechnologyServiceClass
-				where2 := "Name = '"+ sub.Name + "'"
-				svc.GetEntityByWhere(Tmp_TechnologyClassName, where2, &technologyClassList)
-				if technologyClassList.Id > 0{
-					list[0].MinClassId = strconv.Itoa(technologyClassList.Id)
-				} else {
-					list[0].MinClassId = "0"
-					break
-				}
-			}
+			//for _, sub := range supplierCertSubList {
+			//	var technologyClassList technologyserviceclass.OilTechnologyServiceClass
+			//	where2 := "Name = '"+ sub.Name + "'"
+			//	svc.GetEntityByWhere(Tmp_TechnologyClassName, where2, &technologyClassList)
+			//	if technologyClassList.Id > 0{
+			//		list[0].MinClassId = strconv.Itoa(technologyClassList.Id)
+			//	} else {
+			//		list[0].MinClassId = "0"
+			//		break
+			//	}
+			//}
 			list[0].SetupTime = time.Now()
 			svc.InsertEntityBytbl("OilSupplierTecContrast", list[0])
 			svc.DBE.Query("commit;")
@@ -2151,10 +2151,9 @@ func (this *OilTechnologyServiceController) DeleteSuspend() {
 				//subDelete.DueTime = "2021-06-06 00:00:00"
 				paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
 				DueTimeStr := paramSvc.GetBaseparameterMessage("GFZT", "paramset", "Suspend")
-				fmt.Println("返回的时间", DueTimeStr)
-				local, _ := time.LoadLocation("Local")
-				theTime, _ := time.ParseInLocation("2006-01-02", DueTimeStr, local)	// 2006年01月02日
-				subDelete.DueTime = theTime
+				currentTime := time.Now()
+				days,_ := strconv.Atoi(DueTimeStr)
+				subDelete.DueTime = currentTime.AddDate(0, 0, days)
 				i := 1
 				//暂停
 				for _, value := range code {

+ 9 - 3
src/dashoo.cn/frontend_web/src/pages/oilsupplier/basisbuild/index.vue

@@ -45,7 +45,7 @@
         </el-form>
       </div>
       <el-table highlight-current-row stripe :data="entityList" id="rebateSetTable" size="mini" border height="calc(100vh - 243px)"
-        style="width: 100%" @sort-change="orderby">
+        style="width: 100%" @sort-change="orderby" v-loading="loading1">
         <el-table-column label="操作" min-width="200" align="center" fixed="right">
           <template slot-scope="scope">
             <router-link :to="'/oilsupplier/basisbuild/' + scope.row.Id + '/operation'">
@@ -171,7 +171,7 @@
         </div>
 
         <el-table :data="importentityList" size="mini" border height="calc(100vh - 360px)"
-                  style="width: 100%" @sort-change="orderby">
+                  style="width: 100%" @sort-change="orderby" v-loading="loading2">
 
           <el-table-column v-for="column in tableColumns" :prop="column.prop" sortable :min-width="column.width"
                            :label="column.label" :key="column.Id" align="center" show-overflow-tooltip>
@@ -307,12 +307,13 @@
       })
     },
     name: 'oilbasisbuild',
-
     data() {
       return {
         Excelurl: '',
         textarea: '',
         errorDialogVisible: false,
+        loading2: false,
+        loading1: false,
         uploadshow: false,
         importDialogVisible: false,
         importloading: false,
@@ -504,10 +505,12 @@
     },
     methods: {
       showimport () {
+        this.importcurrentPage = 1
         this.initImportDatas()
         this.showimportvisible = true
       },
       initImportDatas () {
+        this.loading2 = true
         // 分页及列表条件
         let params = {
           _currentPage: this.importcurrentPage,
@@ -531,6 +534,7 @@
         api.getImportList(myCreateOn.join(','), params, this.$axios).then(res => {
           this.importentityList = res.data.items
           this.importcurrentItemCount = res.data.currentItemCount
+          this.loading2 = false
         }).catch(err => {
           console.error(err)
         })
@@ -751,6 +755,7 @@
         return cmd
       },
       initDatas() {
+        this.loading1 = true
         // 分页及列表条件
         let params = {
           _currentPage: this.currentPage,
@@ -773,6 +778,7 @@
         api.getList(myCreateOn.join(','), params, this.$axios).then(res => {
           this.entityList = res.data.items
           this.currentItemCount = res.data.currentItemCount
+          this.loading1 = false
         }).catch(err => {
           console.error(err)
         })

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

@@ -44,7 +44,7 @@
         </el-form>
       </div>
       <el-table stripe highlight-current-row :data="entityList" id="rebateSetTable" size="mini" border height="calc(100vh - 243px)"
-        style="width: 100%" @sort-change="orderby" >
+        style="width: 100%" @sort-change="orderby" v-loading="loading1">
         <el-table-column label="操作" min-width="200" align="center" fixed="right">
           <template slot-scope="scope">
             <router-link :to="'/oilsupplier/goodsaptitude/' + scope.row.Id + '/operation'">
@@ -331,7 +331,7 @@
           </el-form>
         </div>
         <el-table :data="importentityList" id="rebateSetTableimport" size="mini" border height="calc(100vh - 350px)"
-                  style="width: 100%" @sort-change="importorderby">
+                  style="width: 100%" @sort-change="importorderby" v-loading="loading2">
 
           <el-table-column v-for="column in tableColumns" :prop="column.prop" sortable :width="column.width"
                            :key="column.Id" :label="column.label" align="center" show-overflow-tooltip>
@@ -495,10 +495,11 @@
       })
     },
     name: 'oilgoodsaptitude',
-
     data () {
       return {
         deleteDialogVisible: false,
+        loading1: false,
+        loading2: false,
         importloading: false,
         confirmLoading: false,
         textarea: '',
@@ -927,6 +928,7 @@
         })
       },
       showimport () {
+        this.importcurrentPage = 1
         this.initImportDatas()
         this.showimportvisible = true
       },
@@ -944,7 +946,7 @@
             })
             this.importloading = false
             this.initImportDatas()
-            this.createContrast()
+            // this.createContrast()
           } else if (res.data.code === -1) {
             this.errorDialogVisible = true
             this.textarea = res.data.message
@@ -1157,6 +1159,7 @@
           })
       },
       initDatas () {
+        this.loading1 = true
         // 分页及列表条件
         let params = {
           _currentPage: this.currentPage,
@@ -1181,11 +1184,13 @@
         api.getList(myCreateOn.join(','), params, this.$axios).then(res => {
           this.entityList = res.data.items
           this.currentItemCount = res.data.currentItemCount
+          this.loading1 = false
         }).catch(err => {
           console.error(err)
         })
       },
       initImportDatas () {
+        this.loading2 = true
         // 分页及列表条件
         let params = {
           _currentPage: this.importcurrentPage,
@@ -1210,6 +1215,7 @@
         api.getImportList(myCreateOn.join(','), params, this.$axios).then(res => {
           this.importentityList = res.data.items
           this.importcurrentItemCount = res.data.currentItemCount
+          this.loading2 = false
         }).catch(err => {
           console.error(err)
         })

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

@@ -264,7 +264,7 @@
 
     methods: {
       tableRowClassName({row, rowIndex}) {
-        if (row.MinClassId == '0'){
+        if (row.NoSubCnt > 0){
           return 'green-row'
         }
         if (row.Checked == "1") {
@@ -284,7 +284,7 @@
         }
       },
       hover({row}) {
-        if (row.MinClassId == '0'){
+        if (row.NoSubCnt > 0){
           return "background-color:pink"
         }
         if (row.Checked == "1") {

+ 9 - 3
src/dashoo.cn/frontend_web/src/pages/oilsupplier/technologyservice/index.vue

@@ -39,7 +39,7 @@
         </el-form>
       </div>
       <el-table highlight-current-row stripe :data="entityList" id="rebateSetTable" size="mini" border height="calc(100vh - 243px)"
-        style="width: 100%" @sort-change="orderby">
+        style="width: 100%" @sort-change="orderby" v-loading="loading1">
         <el-table-column label="操作" min-width="200" align="center" fixed="right">
           <template slot-scope="scope">
             <router-link :to="'/oilsupplier/technologyservice/' + scope.row.Id + '/operation'">
@@ -282,7 +282,7 @@
         </div>
 
         <el-table :data="importentityList" size="mini" border height="calc(100vh - 360px)"
-                  style="width: 100%" @sort-change="orderby">
+                  style="width: 100%" @sort-change="orderby"  v-loading="loading2">
 
           <el-table-column v-for="column in tableColumns" :key="column.Id" :prop="column.prop" sortable
                            :width="column.width" :label="column.label" align="center" show-overflow-tooltip>
@@ -442,12 +442,13 @@
       tmpClassCheck
     },
     name: 'oiltechnologyservice',
-
     data() {
       return {
         Excelurl: '',
         textarea: '',
         errorDialogVisible: false,
+        loading1: false,
+        loading2: false,
         uploadshow: false,
         importDialogVisible: false,
         importloading: false,
@@ -724,10 +725,12 @@
     },
     methods: {
       showimport () {
+        this.importcurrentPage = 1
         this.initImportDatas()
         this.showimportvisible = true
       },
       initImportDatas () {
+        this.loading2 = true
         // 分页及列表条件
         let params = {
           _currentPage: this.importcurrentPage,
@@ -751,6 +754,7 @@
         api.getImportList(myCreateOn.join(','), params, this.$axios).then(res => {
           this.importentityList = res.data.items
           this.importcurrentItemCount = res.data.currentItemCount
+          this.loading2 = false
         }).catch(err => {
           console.error(err)
         })
@@ -1065,6 +1069,7 @@
         return cmd
       },
       initDatas() {
+        this.loading1 = true
         // 分页及列表条件
         let params = {
           _currentPage: this.currentPage,
@@ -1087,6 +1092,7 @@
         api.getList('', params, this.$axios).then(res => {
           this.entityList = res.data.items
           this.currentItemCount = res.data.currentItemCount
+          this.loading1 = false
         }).catch(err => {
           console.error(err)
         })