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

年审通过修改资质状态;物资类增项添加准入范围置空;增项通过修改资质状态

wd 4 лет назад
Родитель
Сommit
52b5ad6c22

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

@@ -136,6 +136,7 @@ type SupplierCertSubModel struct {
 	Name             string
 	Remark           string
 	IsDelete         int
+	SubType			 int  	// 1 已入库添加
 }
 
 type SupplierCertSubLostModel struct {
@@ -168,6 +169,7 @@ type TechnologySubModel struct {
 	Name             string
 	Remark           string
 	IsDelete         int
+	SubType			 int  	// 1 已入库添加
 }
 
 type OilSupplierCertAppendSub struct {

+ 2 - 1
src/dashoo.cn/backend/api/controllers/oilsupplier/annualListener.go

@@ -361,7 +361,8 @@ func (this *OilAnnualListenerController) WorkflowEndAudit() {
 			supFileModel.FileName = qualDetail[i].FileName
 			supFileModel.FileUrl = qualDetail[i].FileUrl
 			supFileModel.EffectDate = qualDetail[i].EffectDate
-			srv.UpdateEntityBytbl(OilSupplierFileName, qualDetail[i].FileId, &supFileModel, []string{"FileName", "FileUrl", "EffectDate"})
+			supFileModel.SupType = 3
+			srv.UpdateEntityBytbl(OilSupplierFileName, qualDetail[i].FileId, &supFileModel, []string{"FileName", "FileUrl", "EffectDate", "SupType"})
 		}
 	}
 

+ 11 - 5
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertappend.go

@@ -1415,11 +1415,17 @@ func (this *OilSupplierCertAppendController) UpdateIsStorage() {
 	}
 	if status == "1" && receiveVal == "true" {
 		// 资质文件改状态
-		var file supplierfile.OilSupplierFile
-		svc := supplierfile.GetSupplierfileService(utils.DBE)
-		cols := []string{"SupType"}
-		file.SupType = 3
-		svc.UpdateEntityBywheretbl(OilSupplierFileName, &file, cols, "SupType = 2 and SupplierId = "+strconv.Itoa(supplierCertAppendEntity.SupplierId))
+		var fileDetail []annualaudit.OilAnnualChangeDetail
+		whereDetail := "SupplierId = " + utils.ToStr(supplierCertAppendEntity.SupplierId) + " and ParentId=" + id
+		certAppendSrv.GetEntitysByWhere(OilAppendChangeDetailName, whereDetail, &fileDetail)
+		if len(fileDetail) > 0 {
+			// 变更资质
+			for i := 0; i < len(fileDetail); i++ {
+				var supFileModel supplierfile.OilSupplierFile
+				supFileModel.SupType = 3
+				certAppendSrv.UpdateEntityBytbl(OilSupplierFileName, fileDetail[i].FileId, &supFileModel, []string{"SupType"})
+			}
+		}
 	}
 
 }

+ 21 - 4
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertsub.go

@@ -345,7 +345,7 @@ func (this *OilSupplierCertSubController) DeleteEntity() {
 	}
 }
 
-// @Title 批量添加准入范围--物资类
+// @Title 批量添加准入范围--物资类-检查需要哪些资质
 // @Description 批量添加准入范围
 // @Success 200 {object} business.device.DeviceChannels
 // @router /check-certsub-lost [post]
@@ -367,7 +367,12 @@ func (this *OilSupplierCertSubController) CheckCertSubLost() {
 	supplierTypeCode := dataother.SupplierTypeCode
 	var tableheaderList []supplierfile.OilSupplierFile
 
-	fileSql := "SELECT * from OilSupplierFile WHERE SupplierId='" + strconv.Itoa(supplierId) + "' and SupType in (0, 1, 3, 5)"
+	var whereType = ""
+	if dataother.SubType == 1{
+		whereType = " and SupType in (0, 1, 3, 5)"
+	}
+
+	fileSql := "SELECT * from OilSupplierFile WHERE SupplierId='" + strconv.Itoa(supplierId) + "'" + whereType
 	fileSql += " AND (SupplierTypeCode='" + supplierTypeCode + "' or SupplierTypeCode='000')"
 
 	svcHeader := tableheader.GetTableHeaderService(utils.DBE)
@@ -633,8 +638,13 @@ func (this *OilSupplierCertSubController) CheckTechCertLost() {
 		//	needList = append(needList, needFile)
 		//}
 
+		var whereType = ""
+		if dataother.SubType == 1{
+			whereType = " and SupType in (0, 1, 3, 5)"
+		}
+
 		var fileist []supplierfile.OilSupplierFile
-		where := "SupplierTypeCode in ('03','000') and SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "' and SupType in (0, 1, 3, 5)"
+		where := "SupplierTypeCode in ('03','000') and SupplierId = '" + strconv.Itoa(dataother.SupplierId) + "'" + whereType
 		svcSupplier.GetEntitysByWhere(OilSupplierFileName, where, &fileist)
 
 		var companyHasHeaders string
@@ -793,6 +803,8 @@ func (this *OilSupplierCertSubController) CheckBasisBusinessLost() {
 	var err error
 	var jsonblob = this.Ctx.Input.RequestBody
 	json.Unmarshal(jsonblob, &model)
+	var dataother suppliercertsub.TechnologySubModel
+	json.Unmarshal(jsonblob, &dataother)
 
 	var supplierCertModel suppliercert.OilSupplierCert
 	svcCert := suppliercert.GetOilSupplierCertService(utils.DBE)
@@ -816,9 +828,14 @@ func (this *OilSupplierCertSubController) CheckBasisBusinessLost() {
 	//	needList = append(needList, needFile)
 	//}
 
+	var whereType = ""
+	if dataother.SubType == 1{
+		whereType = " and SupType in (0, 1, 3, 5)"
+	}
+
 	if err == nil {
 		var list []supplierfile.OilSupplierFile
-		where := "SupplierTypeCode in (02,000) and SupplierId = '" + strconv.Itoa(model.SupplierId) + "' and SupType in (0, 1, 3, 5)"
+		where := "SupplierTypeCode in (02,000) and SupplierId = '" + strconv.Itoa(model.SupplierId) + "'" + whereType
 		svcCert.GetEntitysByWhere(OilSupplierFileName, where, &list)
 		var companyHasHeaders string
 		for _, tableheader := range list {

+ 5 - 0
src/dashoo.cn/frontend_web/src/components/oilsupplier/businesslist.vue

@@ -167,6 +167,10 @@
       status: {
         type: String,
         default: ''
+      },
+      subType: {
+        type: Number,
+        default: 0
       }
     },
     computed: {
@@ -718,6 +722,7 @@
           SupplierCertId: parseInt(_this.BusinessForm.SupplierCertId),
           SubClassId: val.Id,
           Code: val.Code,
+          SubType: this.subType,
           Name: val.Name
         }
         console.log(params, 'PARAMS')

+ 5 - 0
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodslist2.vue

@@ -323,6 +323,10 @@
       status: {
         type: String,
         default: ''
+      },
+      subType: {
+        type: Number,
+        default: 0
       }
     },
     computed: {
@@ -807,6 +811,7 @@
           SupplierCertId: parseInt(_this.SupplierCertId),
           SupplierTypeCode: '01',
           Type: '1',
+          SubType: this.subType,
           IsManufacturer: 2,
           CertSubStatus: '-1',
           Remark: _this.Remark

+ 5 - 0
src/dashoo.cn/frontend_web/src/components/oilsupplier/techlist.vue

@@ -136,6 +136,10 @@
       selectNeedSecure: {
         type: Function,
         default: null
+      },
+      subType: {
+        type: Number,
+        default: 0
       }
     },
     computed: {
@@ -285,6 +289,7 @@
           SupplierCertId: parseInt(_this.SupplierCertId),
           SupplierTypeCode: '03',
           Type: '1',
+          SubType: this.subType,
           CertSubStatus: '-1',
           Remark: _this.Remark
         }

+ 1 - 0
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/goodsdataopera.vue

@@ -2201,6 +2201,7 @@
         }
       },
       addSortData1 () {
+        this.checkList = []
         this.lostTableData = []
         this.goodsDialog = true
       },

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstore/_opera/basisedit.vue

@@ -214,7 +214,7 @@
         </el-tab-pane>
 
         <el-tab-pane label="准入范围" name="4">
-          <business-list ref="businessList" :data.sync="businessList" @close="getbuslist" :canadd="true"
+          <business-list ref="businessList" :data.sync="businessList" @close="getbuslist" :subType="1" :canadd="true"
             height="360px" style="margin-top: 20px" :candelete="delete_flat" :newcanadd="newadd_flat"></business-list>
         </el-tab-pane>
 

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstore/_opera/goodsedit.vue

@@ -170,7 +170,7 @@
         </el-tab-pane>
 
         <el-tab-pane label="准入范围" name="4" :disabled="!certId">
-          <goods-list ref="goodsList" :data.sync="goodsList" @close="getbuslist" :canadd="true" :newcanadd="newadd_flat"
+          <goods-list ref="goodsList" :data.sync="goodsList" @close="getbuslist" :canadd="true" :subType="1" :newcanadd="newadd_flat"
                       :operType="formData.OperType" height="360px"
             style="margin-top: 20px" :candelete="delete_flat"></goods-list>
         </el-tab-pane>

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstore/_opera/techedit.vue

@@ -210,7 +210,7 @@
         </el-tab-pane>
 
         <el-tab-pane name="4" label="准入范围">
-          <tech-list ref="techList" :data.sync="techList" @close="getbuslist" :canadd="true" :newcanadd="newadd_flat" height="360px"
+          <tech-list ref="techList" :data.sync="techList" @close="getbuslist" :canadd="true" :subType="1" :newcanadd="newadd_flat" height="360px"
             style="margin-top: 20px" :candelete="delete_flat" :selectNeedSecure="selectNeedSecure"></tech-list>
         </el-tab-pane>