Ver Fonte

信息变更 降级

lining há 5 anos atrás
pai
commit
432f032636

+ 133 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/infochange.go

@@ -6,6 +6,7 @@ import (
 	"dashoo.cn/backend/api/business/oilsupplier/infochange"
 	"dashoo.cn/backend/api/business/oilsupplier/supplier"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
+	"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
 	"dashoo.cn/backend/api/business/oilsupplier/supplierfile"
 	"dashoo.cn/backend/api/business/register"
 	"dashoo.cn/business2/parameter"
@@ -1254,6 +1255,14 @@ func (this *InfoChangeController) InfoAudit() {
 			var supfilemodel supplierfile.OilSupplierFile
 			supfilemodel.SupType = 3
 			svc.UpdateEntityBywheretbl(OilSupplierFileName, &supfilemodel, []string{"SupType"}, where)
+
+			// 级别 一级变二级 删除不符合的准入项和资质
+			for _, item := range infoitems {
+				if item.SelectItem == "Grade" && (item.BeChangeInfo == "1" && item.ChangeInfo == "2") {
+					this.BusinessDelete(utils.ToStr(dataother.SuppId))
+				}
+			}
+
 			//var qualdetail []qualchange.OilQualChangeDetail
 			//svc.UpdateEntityBytbl(OilSupplierFileName, qualdetail[i].FileId, &supfilemodel, []string{"SupType"})
 			//where := "SupplierId = " + utils.ToStr(dataother.SuppId)
@@ -1367,3 +1376,127 @@ func (this *InfoChangeController) updatesupplier(supname string, suppid int, inf
 
 	return err
 }
+
+
+func (this *InfoChangeController) BusinessDelete(SupplierId string) {
+	SupplierTypeCode := "01"
+	var IsManufacturer string
+
+	//根据Id查出OilSupplierCertSub的SubClassId
+	svc := suppliercertsub.GetOilSupplierCertSubService(utils.DBE) //获得数据库引擎
+	filesvc := supplierfile.GetSupplierfileService(utils.DBE)
+	paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
+
+	var DelCertSublList []suppliercertsub.OilSupplierCertSub
+	// 级别 一级变二级  把物资类一级的删掉
+	whereDel := "SupplierId=" + SupplierId + " and SupplierTypeCode='01' and GoodsLevel='1'"
+	svc.GetEntities(&DelCertSublList, whereDel)
+
+	Id := ""
+	for _, item := range DelCertSublList {
+		Id = Id + ","	+ strconv.Itoa(item.Id)
+	}
+	Id = strings.Trim(Id,",")
+	if Id != "" {
+		Ids := strings.Split(Id, ",")
+
+		//
+		var CertSublList []suppliercertsub.OilSupplierCertSub
+		where := "SupplierId=" + SupplierId + " and Id not in (" + Id + ") and SupplierTypeCode =" + SupplierTypeCode // 没有删除的准入范围
+		svc.GetEntities(&CertSublList, where)
+		SubClassIds := ""
+		for _, CertSub := range CertSublList {
+
+			SubClassIds += strconv.Itoa(CertSub.SubClassId) + ","
+		}
+		var SurplusList []supplierfile.FileList
+		SubClassIds = strings.Trim(SubClassIds, ",")
+		if SubClassIds != "" {
+			if SupplierTypeCode == "01" {
+				//SurplusList = filesvc.GetGoodsNeedFileList(SubClassIds, IsManufacturer)
+			} else if SupplierTypeCode == "02" {
+				SurplusList = filesvc.GetBasicNeedFileList(SubClassIds)
+			} else if SupplierTypeCode == "03" {
+				SurplusList = filesvc.GetTechNeedFileList(SubClassIds)
+			}
+		}
+		fileNames := ""
+		for _, CertSub := range SurplusList {
+			fileNames += CertSub.FileName + ","
+		}
+
+		for i := 0; i < len(Ids); i++ {
+			IsManufacturer = filesvc.CheckIsManuf(Ids[i])
+			if SubClassIds != "" {
+				if SupplierTypeCode == "01" {
+					var CertSublList2 []suppliercertsub.OilSupplierCertSub
+					wheregood := "SupplierId=" + SupplierId + " and Id not in (" + Id + ") and SupplierTypeCode =" + SupplierTypeCode + " and IsManufacturer =" + IsManufacturer // 没有删除的准入范围
+					svc.GetEntities(&CertSublList2, wheregood)
+					SubClassIds2 := ""
+					for _, CertSub := range CertSublList2 {
+						SubClassIds2 += strconv.Itoa(CertSub.SubClassId) + ","
+					}
+					SubClassIds2 = strings.Trim(SubClassIds2, ",")
+					SurplusList = filesvc.GetGoodsNeedFileList(SubClassIds2, IsManufacturer)
+				}
+			}
+			if fileNames == "" {
+				for _, CertSub := range SurplusList {
+					fileNames += CertSub.FileName + ","
+				}
+			}
+			var datamain suppliercertsub.OilSupplierCertSub    //创建OilSupplierCertSub结构体(映射用)
+			var datamain2 []suppliercertsub.OilSupplierCertSub //空的查询用
+
+			where := " Id= " + Ids[i]
+			svc.GetEntity(&datamain, where) //根据Id查找,映射结构体
+
+			//再根据企业id查找这个企业有几个准入范围(如果只有一个准入范围了,基本资质也删除)
+
+			supplierId := datamain.SupplierId
+			where = "SupplierId=" + strconv.Itoa(supplierId)
+			svc.GetEntities(&datamain2, where)
+			flag := 0
+			if len(datamain2) == 1 {
+				flag = 1
+			}
+			subClassId := datamain.SubClassId //4.拿到结构体中的准入范围SubClassId
+			//根据SubClassId查出此准入范围所拥有的资质名称
+			var needList []supplierfile.FileList //定义存储所拥有资质名称的数组
+			if datamain.SupplierTypeCode == "01" {
+				needList = filesvc.GetGoodsNeedFileList(strconv.Itoa(subClassId), IsManufacturer) //通过准入范围Id获得资质名称并填充数组
+			} else if datamain.SupplierTypeCode == "02" {
+				needList = filesvc.GetBasicNeedFileList(strconv.Itoa(subClassId))
+			} else {
+				needList = filesvc.GetTechNeedFileList(strconv.Itoa(subClassId))
+			}
+
+			var mustField string
+			mustField = paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MustFieldName") //必需的资质
+
+			//根据企业ID(SupplierId)和此准入范围所拥有的资质名称删除OilSupplierFile表中对应的资质
+			for j := 0; j < len(needList); j++ { //循环遍历资质名称数组,逐条删除
+
+				if flag == 0 && strings.Contains(mustField, needList[j].FileName+",") {
+					continue
+				}
+				if flag == 0 && strings.Contains(fileNames, needList[j].FileName+",") {
+					continue
+				}
+				if datamain.SupplierTypeCode == "01" {
+					where = " SupplierId= '" + strconv.Itoa(datamain.SupplierId) + "' and SupplierTypeCode =" + SupplierTypeCode + " and IsManuf='" + IsManufacturer + "' and NeedFileType='" + needList[j].FileName + "'" //拼接删除sql
+				} else {
+					where = " SupplierId= '" + strconv.Itoa(datamain.SupplierId) + "' and SupplierTypeCode =" + SupplierTypeCode + " and NeedFileType='" + needList[j].FileName + "'" //拼接删除sql
+				}
+				svc.DeleteEntityBytbl(OilSupplierFileName, where) //删除第j条资质数据
+
+			}
+			where = " SupplierId=" + strconv.Itoa(datamain.SupplierId) + " and SupplierTypeCode =" + SupplierTypeCode + " and SubClassId=" + strconv.Itoa(subClassId)
+			svc.DeleteEntityBytbl(OilSupplierCert2FileName, where)
+
+			where = " Id= " + Ids[i] + " and SupplierTypeCode =" + SupplierTypeCode
+			svc.DeleteEntityBytbl(OilSupplierCertSubName, where) //删除OilSupplierCertSub单条准入范围
+
+		}
+	}
+}

+ 2 - 2
src/dashoo.cn/frontend_web/nuxt.config.ignore.js

@@ -166,8 +166,8 @@ module.exports = {
     // 'pages/oilsupplier/basisbuild/*.*',
     'pages/oilsupplier/compayaudit/*.*',
     // 'pages/oilsupplier/goodsaptitude/*.*',
-    'pages/oilsupplier/infochange/*.*',
-    'pages/oilsupplier/infochangech/*.*',
+    // 'pages/oilsupplier/infochange/*.*',
+    // 'pages/oilsupplier/infochangech/*.*',
     // 'pages/oilsupplier/supplier/*.*',
     'pages/oilsupplier/supplierappend/*.*',
     'pages/oilsupplier/supplieraudit/*.*',

+ 23 - 6
src/dashoo.cn/frontend_web/src/pages/oilsupplier/infochangech/_opera/auditoperation.vue

@@ -88,6 +88,22 @@
               </el-form-item>
             </el-col> -->
 
+              <el-col :span="8">
+                <el-form-item label="级别" prop="Gradechange">
+                  <el-select v-model="formData.Grade" :readonly="true"
+                             placeholder="请选择级别"
+                             :class="changedForm['Grade'] ? 'modified-form-input' : ''"
+                             style="width: 100%">
+                    <el-option
+                      v-for="item in GradeOptions"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value">
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+              </el-col>
+
               <el-col :span="8">
                 <el-form-item label="管理单位">
                   <el-select filterable v-model="formData.MgrUnit" maxlength="255" :readonly="true"
@@ -781,6 +797,13 @@
         UnitRelationAry: [],
         countryoptions: [],
         countryListOptions: [],
+        GradeOptions: [{
+          value: '1',
+          label: '一级'
+        }, {
+          value: '2',
+          label: '二级'
+        }],
         countryprops: {
           value: 'adcode',
           label: 'name',
@@ -994,7 +1017,6 @@
       this.serviceId = this.$route.params.opera
       this.InfoStatus = this.$route.query.InfoStatus
       this.infoId = this.serviceId
-      console.log(this.infoId, 'this.infoId')
       this.initDatas()
       this.auditget()
       this.getDictOptions()
@@ -1006,7 +1028,6 @@
     },
     methods: {
       InfoStatusBool () {
-        console.log(this.InfoStatus, 'this.InfoStatus')
         if (this.InfoStatus === '10' || this.InfoStatus === '-10' || this.InfoStatus === '-1' ||
           this.InfoStatus === '-2' || this.InfoStatus === '-5') {
           return true
@@ -1128,7 +1149,6 @@
                   }
                 }
               }
-              console.log('-this.InfoData---',this.InfoData)
             })
             .catch(err => {
               console.error(err);
@@ -1142,7 +1162,6 @@
         api.GetMainInfo(this.infoId, this.$axios)
           .then(res => {
             this.Infomain = res.data.items;
-            console.log('this.Infomain', this.Infomain)
             if (this.Infomain) {
               this.entrydetail.business = this.infoId + ''
               this.entrydetail.instance = this.Infomain[0].WorkFlowId + ''
@@ -1272,10 +1291,8 @@
           auditstepcode: this.auditstepcode,
           processkey: this.entrydetail.process
         }
-        console.log(this.InfoStatus, params)
         apiCert.isAccess(params, this.$axios).then(res => {
           this.auditBtn = res.data
-          console.log('---this.auditBtn-',this.auditBtn)
         }).catch(err => {
           console.log(err)
         })

+ 34 - 21
src/dashoo.cn/frontend_web/src/pages/oilsupplier/infochangech/_opera/operation.vue

@@ -91,7 +91,7 @@
                   <el-select v-model="formData.Grade"
                              placeholder="请选择级别"
                              :class="changedForm['Grade'] ? 'modified-form-input' : ''"
-                             style="width: 100%"
+                             style="width: 100%" :disabled="Grade == '2'"
                              @change="GradeChange">
                     <el-option
                       v-for="item in GradeOptions"
@@ -830,18 +830,25 @@
           }
         }
       }
-      //注册资金限制
+      // 注册资金限制
       var checkMoney = (rule, value, callback) => {
-        if (!value) {
-          return callback(new Error('注册资金不能为空'));
+        if (value < 0) {
+          callback(new Error('注册资金不能小于0'))
         } else {
-            if (value < 1) {
-              callback(new Error('注册资金至少为1'));
-            } else {
-              callback();
-            }
-          }
-        };
+          callback()
+        }
+        // if (!value) {
+        //   if (value !== 0) {
+        //     return callback(new Error('注册资金不能为空*'))
+        //   }
+        // } else {
+        //   if (value < 0) {
+        //     callback(new Error('注册资金至少为0'))
+        //   } else {
+        //     callback()
+        //   }
+        // }
+      }
 
       // 固话检验
       var checkTelphone = (rule, value, callback) => {
@@ -857,6 +864,7 @@
         }
       }
       return {
+        Grade: '',
         size: 10,
         sizeProject: 10,
         currentItemCount: 0,
@@ -1229,11 +1237,10 @@
             trigger: 'change'
           }],
 
-          RegCapital: [{
-            required: true,
-            validator: checkMoney,
-            trigger: 'change'
-          } ],
+          RegCapital: [
+            {required: true, validator: checkMoney, trigger: 'change'},
+            { type: 'number', message: '只能输入数字', trigger: 'blur' }
+          ],
           DepositBank: [{
             required: true,
             message: '请输入开户银行',
@@ -1357,6 +1364,7 @@
             .then(res => {
               this.copyformdata = _.cloneDeep(res.data[0])
               this.formData = res.data[1]
+              this.Grade = this.formData.Grade
               this.CityAry = []
               this.CityAry.push(this.formData.Province)
               this.CityAry.push(this.formData.City)
@@ -1564,6 +1572,9 @@
               this.infochangedata = res.data.items
               if (this.infochangedata) {
                 for (var i = 0; i < this.infochangedata.length; i++) {
+                  if (this.infochangedata[i].SelectItem === 'Grade') {
+                    this.Grade = this.infochangedata[i].BeChangeInfo
+                  }
                   if (this.infochangedata[i].SelectItem != 'Province' && this.infochangedata[i].SelectItem !=
                     'City' && this.infochangedata[i].SelectItem != 'Street' && this.infochangedata[i]
                     .SelectItem != 'LinkProvince' && this.infochangedata[i].SelectItem != 'LinkCity' && this
@@ -1579,12 +1590,14 @@
         }
       },
       GradeChange (val) {
-        if (val === '1') {
-          this.formData.MgrUnit = '中油集团公司'
+        // if (val === '1') {
+        //   this.formData.MgrUnit = '中油集团公司'
+        // }
+        if (val === '2') {
+          this.$alert('变更级别,审批通过别后将删除不符合该级别的准入项和资质!', '变更确认', {
+            confirmButtonText: '确定'
+          })
         }
-        this.$alert('确认变更企业级别后会删除不符合该级别的准入项和资质!', '变更确认', {
-          confirmButtonText: '确定',
-        })
       },
       InStyleChange (val) {
         if (val === '2') {