Sfoglia il codice sorgente

前后:物资类导入

dubch 5 anni fa
parent
commit
08d1772c24

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

@@ -286,6 +286,7 @@ type OilSupplierContrast struct {
 	MinClassId           string   // subclassid的最小值
 	OneTwoCount         int   // 1变2
 	TwoOneCount           int   // 2变1
+	IsDelete           int   // 2变1
 }
 
 //type NeedFileTypeStruct struct {

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

@@ -26,6 +26,7 @@ type OilSupplierCertSub struct {
 	ModifiedOn           time.Time `xorm:"DATETIME"`
 	ModifiedUserId       int       `xorm:"INT(10)"`
 	ModifiedBy           string    `xorm:"VARCHAR(50)"`
+	IsQuestion           int       `xorm:"default 0 comment('问题状态,0正常,1有问题') INT(10)"`
 }
 type OilSupplierCertSub1 struct {
 	Id                   int       `xorm:"not null pk autoincr INT(10)"`
@@ -54,6 +55,7 @@ type OilSupplierCertSub1 struct {
 	Checked           int
 	HeaderName           string
 	MinClassId           string
+	IsQuestion		     string
 }
 
 type Del_OilSupplierCertSub struct {

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

@@ -2164,7 +2164,7 @@ func (this *OilGoodsAptitudeController) GetTList() {
 
 }
 
-// @Title 查看对比列表的准入范围
+// @Title 查看对比列表的准入范围 2020-12-18
 // @Description get user by token
 // @Success 200 {object} []suppliercertsub.OilSupplierCertSub
 // @router /delcertsublist [get]
@@ -2260,13 +2260,18 @@ func (this *OilGoodsAptitudeController) GetDelCertSubList() {
 	where = where + " and a.Type in (1, 3)"
 	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
 	var list []suppliercertsub.OilSupplierCertSub1
+	var co supplier.OilSupplierContrast
+	svc.GetEntityById(SupplierId, &co)
 	//total := svc.GetMyPagingEntitiesWithOrderBytbl(TmpOilSupplierCertSubName, page.CurrentPage, page.Size, orderby, asc, &list, where)
 	//total := svc.GetMyPagingEntitiesWithOrderBytbl(OilSupplierCertSubName, page.CurrentPage, page.Size, orderby, asc, &list, where)
+	if co.IsDelete == 1 {
+		where += " and a.IsQuestion = 1"
+	}
 	total := svc.GetPagingTmpSubEntities(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 tmp_OilGoodsAptitude a LEFT JOIN tmp_OilGoodsAptitudeClass class ON a.ClassId = class.Id"
-		sql += " where class.Code = '"+ item.Code + "' and class.Name = '" + item.Name + "'"
+		sql += " where class.Code = '"+ item.Code + "'"
 		model, _ := svc.DBE.QueryString(sql)
 		if model != nil {
 			code := strings.Split(model[0]["Codes"], ",")
@@ -3035,7 +3040,7 @@ func (this *OilGoodsAptitudeController) PdfExport() {
 
 }
 
-// @Title 确认更新后的删除/暂停企业准入范围
+// @Title 确认更新后的删除/暂停企业准入范围 2020-12-18
 // @Description 修改实体
 // @Success	200	{object} controllers.Request
 // @router /delete-suspend [post]
@@ -3044,44 +3049,59 @@ func (this *OilGoodsAptitudeController) DeleteSuspend() {
 	var err error
 	var list []supplier.OilSupplierContrast
 	svc := goodsaptitude.GetOilGoodsAptitudeService(utils.DBE)
-	svc.GetEntitysByWhere("OilSupplierContrast", "TwoOneCount = 0", &list)
+	//svc.GetEntitysByWhere("OilSupplierContrast", "TwoOneCount = 0", &list)
+	svc.GetEntitysByWhere("OilSupplierContrast", "1=1", &list)
 	for _,item := range list{
 		var sub []suppliercertsub.OilSupplierCertSub
 		svc.GetEntitysByWhere("OilSupplierCertSub", "SupplierTypeCode = '01' and SupplierId = " + strconv.Itoa(item.Id), &sub)
 		for _, itemSub := range sub {
-			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,a.GoodsLevel  FROM OilGoodsAptitude a LEFT JOIN OilGoodsAptitudeClass class ON a.ClassId = class.Id"
-			sql += " where class.Code = '"+ itemSub.Code + "' and class.Name = '" + itemSub.Name + "'"
+			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,a.GoodsLevel,class.Name  FROM OilGoodsAptitude a LEFT JOIN OilGoodsAptitudeClass class ON a.ClassId = class.Id"
+			sql += " where class.Code = '"+ itemSub.Code + "'"
 			model, _ := svc.DBE.QueryString(sql)
 			var subDelete suppliercertsub.OilSupplierCertSub1
 			if model != nil {
 				code := strings.Split(model[0]["Codes"], ",")
-				cols := []string{"GoodsLevel"}
+				cols := []string{"GoodsLevel", "Name"}
 				subDelete.GoodsLevel = model[0]["GoodsLevel"]
+				subDelete.Name = model[0]["Name"]
+
+				//2升1不变
+				if model[0]["GoodsLevel"] == "1" && itemSub.GoodsLevel == "2" {
+					colsC := []string{"IsDelete"}
+					colsS := []string{"IsQuestion"}
+					item.IsDelete = 1
+					itemSub.IsQuestion = 1
+					svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &itemSub, colsS, "Id = "+strconv.Itoa(itemSub.Id))
+					svc.UpdateEntityBywheretbl("OilSupplierContrast",  &item, colsC, "Id = "+strconv.Itoa(item.Id))
+					continue
+				}
 
 				// 1降2修改
 				if item.OneTwoCount > 0 {
-					svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = "+strconv.Itoa(itemSub.Id))
+					err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = "+strconv.Itoa(itemSub.Id))
 				}
 				cols = append(cols, "DueTime")
 				cols = append(cols, "CertSubStatus")
 				subDelete.CertSubStatus = "2"
-				subDelete.DueTime = "2021-06-06 00:00:00"
+				//subDelete.DueTime = "2021-06-06 00:00:00"
+				paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
+				subDelete.DueTime = paramSvc.GetBaseparameterMessage("GFZT", "paramset", "Suspend")
 				i := 1
 				//暂停
 				for _, value := range code {
 					if i == 36 || i == 37 || i == 1 {
 						if (code[0] == "1" && strings.Index(item.HeaderCodes, "F01") < 0) && (code[35] == "1" && strings.Index(item.HeaderCodes, "F36") < 0) && (code[36] == "1" && strings.Index(item.HeaderCodes, "F37") < 0) {
-							svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = " + strconv.Itoa(itemSub.Id))
+							err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = " + strconv.Itoa(itemSub.Id))
 							break
 						}
 					} else if i > 10 {
 						if value == "1" && strings.Index(item.HeaderCodes, "F"+strconv.Itoa(i)) < 0 {
-							svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = " + strconv.Itoa(itemSub.Id))
+							err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = " + strconv.Itoa(itemSub.Id))
 							break
 						}
 					} else {
 						if value == "1" && strings.Index(item.HeaderCodes, "F0"+strconv.Itoa(i)) < 0 {
-							svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = " + strconv.Itoa(itemSub.Id))
+							err = svc.UpdateEntityBywheretbl(OilSupplierCertSubName, &subDelete, cols, "Id = " + strconv.Itoa(itemSub.Id))
 							break
 						}
 					}
@@ -3089,21 +3109,20 @@ func (this *OilGoodsAptitudeController) DeleteSuspend() {
 				}
 			} else {
 				// 删除
-				svc.DeleteEntityById(itemSub.Id, &subDelete)
+				err = svc.DeleteEntityById(itemSub.Id, &subDelete)
 			}
 		}
-		svc.DeleteTable("OilSupplierContrast", "Id = " + strconv.Itoa(item.Id))
+		if item.TwoOneCount == 0 {
+			err = svc.DeleteTable("OilSupplierContrast", "Id = " + strconv.Itoa(item.Id))
+		}
 	}
-
-
-
 	if err == nil {
 		errinfo.Message = "修改成功!"
 		errinfo.Code = 0
 		this.Data["json"] = &errinfo
 		this.ServeJSON()
 	} else {
-		errinfo.Message = "修改成功失败!"
+		errinfo.Message = "修改失败!"
 		errinfo.Code = -1
 		this.Data["json"] = &errinfo
 		this.ServeJSON()

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

@@ -277,7 +277,7 @@
              </template>
            </el-table-column>
            <el-table-column  prop="SourceContractClass"  min-width="110" label="合同类别" align="center" show-overflow-tooltip></el-table-column>
-           <el-table-column  prop="ContractClass"  min-width="110" label="选择合同类别" align="center" show-overflow-tooltip >
+           <el-table-column  prop="ContractClass"  width="250" label="选择合同类别" align="center" show-overflow-tooltip >
              <template slot-scope="scope">
                 <el-form-item  style="margin-bottom: 0px;" :prop="'tableData.' + scope.$index + '.ContractClass'" :rules="rules.ContractClass">
                   <el-select size="small" v-model="scope.row.ContractClass" placeholder="请选择" style="width: 100%" >
@@ -823,7 +823,7 @@
               this.$message({type: 'warning', message: '导入失败'})
             })
           } else {
-            this.$message({type: 'warning', message: '请填写完整才能导入'})
+            this.$message({type: 'warning', message: '请填写完整才能导入'})
           }
         });
 

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

@@ -29,8 +29,8 @@
             <el-button type="primary" size="mini" @click="importhandleSearch">查询</el-button>
           </el-form-item>
           <el-form-item>
-            <el-button type="primary" size="mini" @click="deleteList" :disabled="isDisable" :loading="deleteloading">删除</el-button>
-            <el-button type="primary" size="mini" @click="changeList" v-if="conditions == 2" :disabled="isDisableCh" :loading="changeloading">暂停</el-button>
+<!--            <el-button type="primary" size="mini" @click="deleteList" :disabled="isDisable" :loading="deleteloading">删除</el-button>-->
+<!--            <el-button type="primary" size="mini" @click="changeList" v-if="conditions == 2" :disabled="isDisableCh" :loading="changeloading">暂停</el-button>-->
           </el-form-item>
         </el-form>
       </div>

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

@@ -23,7 +23,7 @@
 
       <!--内框表格显示-->
       <el-table id="rebateSetTable1" :data="conList" size="mini" v-loading="loading" border height="calc(100vh - 243px)"
-                style="width: 100%" @sort-change="orderby" :row-class-name="tableRowClassName">
+                style="width: 100%" @sort-change="orderby" :row-class-name="tableRowClassName" :cell-style="hover">
         <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>
@@ -264,25 +264,36 @@
 
     methods: {
       tableRowClassName({row, rowIndex}) {
-        if (row.MinClassId === '0'){
+        if (row.MinClassId == '0'){
           return 'green-row'
         }
-        if (row.Checked === "1") {
+        if (row.Checked == "1") {
           return 'blue-row'
         } else{
           return 'yellow-row'
         }
       },
       subRowClassName({row, rowIndex}) {
-        if (row.MinClassId === '0'){
+        if (row.MinClassId == '0'){
           return 'green-row'
         }
-        if (row.Checked === 1) {
+        if (row.Checked == '1') {
           return 'yellow-row'
         } else{
           return 'blue-row'
         }
       },
+      hover({row}) {
+        if (row.MinClassId == '0'){
+          return "background-color:pink"
+        }
+        if (row.Checked == "1") {
+          console.log(row.Checked, 'Checked')
+          return "background-color:lightblue"
+        } else{
+          return "background-color:lightyellow"
+        }
+      },
       searchCommand (command) {
         if (command === 'search') {
           this.dialogVisible = true