Forráskód Böngészése

前后:检查资质页面

dubch 4 éve
szülő
commit
3006d093a5

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

@@ -495,3 +495,15 @@ func (s *OilSupplierService) GetDeleteSub(TableName, where string , entitiesPtr
 
 	//return total
 }
+
+func (s *OilSupplierService) GetDeleteSub2(TableName, where string , entitiesPtr interface{}, name string) {
+
+	sql := `update OilSupplierCertSub a `
+	if TableName == "OilBasisBuild" {
+		sql += ` left join ` + TableName + ` b on b.Id = a.SubClassId`
+	} else {
+		sql += ` left join ` + TableName + ` b on b.ClassId = a.SubClassId`
+	}
+	sql += " set IsQuestion = 2, LackFile = concat(IFNULL(LackFile,''),',','" + name + "') where IsQuestion != 2 and " + where
+	s.DBE.SQL(sql).Find(entitiesPtr)
+}

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

@@ -28,6 +28,7 @@ type OilSupplierCertSub struct {
 	ModifiedBy           string    `xorm:"VARCHAR(50)"`
 	DueTime           	 time.Time `xorm:"DATETIME"`
 	IsQuestion           int       `xorm:"default 0 comment('问题状态,0正常,1有问题') INT(10)"`
+	LackFile             string    `xorm:"default 0 comment('缺少资质') VARCHAR(500)"`
 }
 type OilSupplierCertSub1 struct {
 	Id                   int       `xorm:"not null pk autoincr INT(10)"`

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

@@ -14,6 +14,7 @@ type BaseTableheader struct {
 	Remark         string    `xorm:"comment('备注') VARCHAR(500)"`
 	Isdelete       int       `xorm:"default 0 comment('是否以删除(0正常,1已删除)') INT(10)"`
 	SortCode       int       `xorm:"default 0 comment('排序码') INT(10)"`
+	ShowSort       int       `xorm:"default 0 comment('排序码') INT(11)"`
 	Createon       time.Time `xorm:"comment('创建时间') DATETIME"`
 	Createuserid   int       `xorm:"comment('创建者编号 ') INT(10)"`
 	Createby       string    `xorm:"comment('创建者') VARCHAR(50)"`

+ 137 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/supplier.go

@@ -3119,6 +3119,143 @@ func (this *OilSupplierController) CheckSupplierFileDelete() {
 	this.ServeJSON()
 }
 
+// @Title 检查缺资质列表
+// @Description
+// @Success	200	{object} controllers.Request
+// @router /checkSupplierFileList [post]
+func (this *OilSupplierController) CheckSupplierFileList() {
+	var file supplierfile.CheckFile
+	var jsonBlob = this.Ctx.Input.RequestBody
+	json.Unmarshal(jsonBlob, &file)
+	//获取主表信息
+	var supplierEntity supplier.OilSupplier
+	supplierService := supplier.GetOilSupplierService(utils.DBE)
+	supplierService.GetEntityById(file.SupplierId, &supplierEntity)
+	//获取准入信息表
+	var cert suppliercert.OilSupplierCert
+	supplierService.GetEntityByWhere("OilSupplierCert", "Id = "+file.CertId, &cert)
+
+	// 查询出已有哪些资质
+	var tableheaderList []qualchange.OilQualChangeDetail1
+	fileSql := "SELECT * from OilSupplierFile WHERE SupplierId = " + strconv.Itoa(file.SupplierId)
+	svcHeader := tableheader.GetTableHeaderService(utils.DBE)
+	svcHeader.DBE.SQL(fileSql).Find(&tableheaderList)
+	var companyHasHeaders string
+	for _, tableheader := range tableheaderList {
+		companyHasHeaders += tableheader.NeedFileType + ","
+	}
+	paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
+	filesvc := supplierfile.GetSupplierfileService(utils.DBE)
+	mergerCertSkipField := paramSvc.GetBaseparameterMessage("GFGL", "paramset", "MergerCertSkipFieldName")
+
+	var certSubList2 suppliercertsub.OilSupplierCertSub
+	certSubList2.LackFile = ""
+	certSubList2.IsQuestion = 0
+	svcHeader.UpdateEntityBywheretbl(OilSupplierCertSubName, &certSubList2, []string{"LackFile", "IsQuestion"}, "IsQuestion = 2 and SupplierId = " + strconv.Itoa(supplierEntity.Id) + " and SupplierCertId = " + file.CertId)
+
+	//对准入范围的判断
+	var certSubList []suppliercertsub.OilSupplierCertSub
+	certsubService := suppliercertsub.GetOilSupplierCertSubService(utils.DBE)
+	certsubService.GetListByCertId(strconv.Itoa(cert.Id), &certSubList)
+	idString := ""
+	idString1 := ""
+	for i := 0; i < len(certSubList); i = i+1000 {
+		var ids suppliercertsub.Ids
+		certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids, 3, strconv.Itoa(i))
+		if ids.Id != "" {
+			idString += "," + ids.Id
+		} else {
+			break
+		}
+	}
+	var needList []supplierfile.FileList
+	var needList1 []supplierfile.FileList
+
+	if cert.SupplierTypeCode == "01" {
+		//需要的资质
+		needList1 = filesvc.GetGoodsNeedFileListNew(idString, "2")
+		if file.Type == 1 { //制造商
+			//如果是制造商,准入范围按照各项准入范围的类型判断
+			// 制造
+			idString = ""
+			for i := 0; i < len(certSubList); i = i+1000 {
+				var ids suppliercertsub.Ids
+				certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids, 1, strconv.Itoa(i))
+				if ids.Id != "" {
+					idString += "," + ids.Id
+				} else {
+					break
+				}
+			}
+			// 非制造
+			for i := 0; i < len(certSubList); i = i+1000 {
+				var ids1 suppliercertsub.Ids
+				certsubService.GetIds(strconv.Itoa(cert.Id), cert.SupplierTypeCode, &ids1, 2, strconv.Itoa(i))
+				if ids1.Id != "" {
+					idString1 += "," + ids1.Id
+				} else {
+					break
+				}
+			}
+			needList = filesvc.GetGoodsNeedFileListNew(idString, "1")
+			needList1 = filesvc.GetGoodsNeedFileListNew(idString1, "2")
+			for _, need := range needList1 {
+				needList = append(needList, need)
+			}
+		}
+	} else if cert.SupplierTypeCode == "02" {
+		needList = filesvc.GetBasicNeedFileListNew(idString)
+	} else if cert.SupplierTypeCode == "03" {
+		needList = filesvc.GetTechNeedFileListNew(idString)
+	}
+
+	for _, needHeader := range needList {
+		if (supplierEntity.CredentialFlag == "1" || supplierEntity.CredentialFlag == "2") &&
+			strings.Contains(mergerCertSkipField, needHeader.FileName+",") {
+			//三证合一或五证合一的证件,不需要验证了
+			continue
+		}
+
+		if !strings.Contains(companyHasHeaders, needHeader.FileName+",") {
+			var header tableheader.BaseTableheader
+			where1 := "Name = '" + needHeader.FileName + "' and CategoryCode = '" + cert.SupplierTypeCode + "'"
+			if cert.SupplierTypeCode == "01" {
+				where1 += " and IsManuf != '2'"
+			}
+			supplierService.GetEntityByWhere(BaseTableHeader, where1, &header)
+			if header.Code != "" {
+				where2 := header.Code + " = '1'"
+				where2 += " and a.SupplierId = " + strconv.Itoa(supplierEntity.Id) + " and a.SupplierTypeCode = '" + cert.SupplierTypeCode + "'"
+
+				var certSub []suppliercertsub.OilSupplierCertSub
+				if cert.SupplierTypeCode == "01" {
+					if file.Type == 1 {
+						where2 += " and IsManufacturer != 2"
+						supplierService.GetDeleteSub2(OilGoodsAptitudeName, where2, &certSub, header.Name)
+					} else {
+						where2 += " and IsManufacturer == 2"
+						supplierService.GetDeleteSub2(OilGoodsAptitudeName, where2, &certSub, header.Name)
+					}
+				} else if cert.SupplierTypeCode == "02" {
+					supplierService.GetDeleteSub2(OilBasisBuildName, where2, &certSub, header.Name)
+				} else {
+					supplierService.GetDeleteSub2(OilTechnologyServiceName, where2, &certSub, header.Name)
+				}
+			} else {
+				fmt.Print("22222")
+			}
+		}
+	}
+
+	var certSubList1 []suppliercertsub.OilSupplierCertSub
+	certsubService.GetEntitysByWhere(OilSupplierCertSubName, "IsQuestion = 2 and SupplierId = " + strconv.Itoa(supplierEntity.Id) + " and SupplierCertId = " + file.CertId, &certSubList1)
+
+	var datainfo DataInfo
+	datainfo.Items = certSubList1
+	this.Data["json"] = &datainfo
+	this.ServeJSON()
+}
+
 // @Title 对外-招投标系统
 // @Description
 // @Success 200 {object}

+ 7 - 0
src/dashoo.cn/frontend_web/src/api/oilsupplier/supplier.js

@@ -227,6 +227,13 @@ export default {
       data: fileType
     })
   },
+  checkSupplierFileList (fileType, myAxios) {
+    return myAxios({
+      url: '/supplier/checkSupplierFileList',
+      method: 'post',
+      data: fileType
+    })
+  },
   getSupplierCert (Id, myAxios) {
     return myAxios({
       url: '/supplier/getSupplierCertId/' + Id,

+ 178 - 0
src/dashoo.cn/frontend_web/src/components/oilsupplier/checkFile.vue

@@ -0,0 +1,178 @@
+<template>
+  <div>
+    <el-dialog title="缺资质准入范围" :visible.sync="checkFileListShow" :close-on-click-modal="false" width="80%">
+      <el-card class="box-card" style="height: calc(100vh - 115px);">
+        <el-table :data="subList" border height="calc(100vh - 243px)" size="mini" style="width: 100%" v-loading="tableLoading" highlight-current-row @selection-change="handleSelectionChange">
+          <el-table-column type="selection" width="55"></el-table-column>
+          <el-table-column label="操作" width="180" align="center" fixed="right">
+            <template slot-scope="scope">
+               <el-button type="primary" title="删除" size="mini" plain @click="deleteData(scope.row.Id)">删除</el-button>
+            </template>
+          </el-table-column>
+          <el-table-column label="序号" align="center" width="70">
+            <template slot-scope="scope">
+              <span>{{scope.$index+(currentPage - 1) * size + 1}} </span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="Name" label="准入范围" width="130" align="center" show-overflow-tooltip></el-table-column>
+          <el-table-column prop="LackFile" label="缺少资质" min-width="100" align="center" show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span>{{trimString(scope.row.LackFile)}} </span>
+            </template>
+          </el-table-column>
+        </el-table>
+        <el-pagination style="float: right; margin-top: 10px; margin-bottom: 5px" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
+                       :page-sizes="[10, 50, 100, 200]" :page-size="size" layout="total, sizes, prev, pager, next, jumper"
+                       :total="currentItemCount">
+        </el-pagination>
+      </el-card>
+
+      <div style="display: flex;justify-content: flex-end;margin-top: 16px;">
+        <el-button type="primary" :loading="deleteLoading" size="mini" @click="deleteList">删除所有</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {mapGetters} from 'vuex'
+import api from '@/api/oilsupplier/supplier'
+import apiCert from '@/api/oilsupplier/suppliercert'
+
+export default {
+  computed: {
+    ...mapGetters({
+      authUser: 'authUser'
+    }),
+  },
+  name: 'checkFile',
+  components: {
+  },
+  props: {
+  },
+  data () {
+    return {
+      certId: 0,
+      supplierId: 0,
+      operType: 0,
+      subList: [],
+      Ids: [],
+      size: 10,
+      currentPage: 1,
+      currentItemCount: 0,
+      tableLoading: false,
+      checkFileListShow: false,
+      deleteLoading: false
+    }
+  },
+  created () {
+    this.initData()
+  },
+  methods: {
+    getValue (supplierId, certId, operType) {
+      this.certId = certId
+      this.operType = operType
+      this.supplierId = supplierId
+      this.initData()
+    },
+    initData () {
+      if (this.certId) {
+        this.tableLoading = true
+        let fileType = {
+          Type: this.operType,
+          SupplierId: this.supplierId,
+          CertId: this.certId.toString()
+        }
+        api.checkSupplierFileList(fileType, this.$axios).then(res => {
+          this.subList = res.data.items
+          this.tableLoading = false
+        }).catch(err => {
+          console.error(err)
+        })
+      }
+    },
+    deleteList () {
+
+    },
+    trimString (val) {
+      return val.substr(1)
+    },
+    deleteData (val) {
+      if (val != null && val != '') {
+        this.Ids = []
+        this.Ids.push(val)
+      }
+      if (this.Ids.length == 0) {
+        this.$message({
+          type: 'warning',
+          message: '请先选择删除条目'
+        })
+        return
+      }
+      console.log(this.Ids, 'this.Ids===')
+      let _this = this
+      _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+          const delload = this.$loading({
+            lock: true,
+            text: '正在删除请稍后...'
+          })
+          let params = {
+            SupplierId: parseInt(_this.supplierId)
+          }
+          _this.$axios.delete('suppliercertsub/businessdelete/' + this.Ids.join(), {params})
+            .then(function (response) {
+              if (response.data.code === 0) {
+                _this.$message({
+                  type: 'success',
+                  message: response.data.message
+                })
+                delload.close()
+                _this.Ids = []
+                _this.initData()
+              } else {
+                delload.close()
+                _this.Ids = []
+                _this.$message({
+                  type: 'warning',
+                  message: response.data.message
+                })
+              }
+            })
+            .catch(function (error) {
+              console.log(error)
+            })
+        })
+        .catch(() => {
+          _this.Ids = []
+        })
+    },
+    handleSelectionChange (val) {
+      this.Ids = []
+      for (let i = 0; i < val.length; i++) {
+        this.Ids.push(val[i].Id)
+      }
+    },
+    handleSearch () {
+      this.currentPage = 1
+      this.initData()
+    },
+    handleCurrentChange (value) {
+      this.currentPage = value
+      this.initData()
+    },
+    handleSizeChange (value) {
+      this.size = value
+      this.currentPage = 1
+      this.initData()
+    },
+  }
+}
+</script>
+
+<style scoped="scoped">
+
+</style>

+ 11 - 0
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/techdataopera.vue

@@ -27,6 +27,9 @@
           <el-button type="primary" size="mini" style="margin-left: 8px"
                      v-if="formData.Id !='' && currentStatus <= 0" @click="saveinfochange">保存
           </el-button>
+<!--          <el-button type="primary" size="mini" style="margin-left: 8px"-->
+<!--                     v-if="formData.Id !='' && currentStatus <= 0" @click="checkFileList">检查资质-->
+<!--          </el-button>-->
           <el-button type="primary" size="mini" style="margin-right: 8px" @click="separateUnitSubmitClick"
             v-if="formData.Id !='' && currentStatus <= 0 && IsCompanyUser == 0">提交审核
           </el-button>
@@ -994,6 +997,7 @@
       :visible="chooseAuditorVisibleFen" typeCode="03"></choose-auditor-fen>
 
 
+    <check-file ref="checkFile"></check-file>
 
     <el-dialog title="新增资质" :close-on-click-modal="false" :visible.sync="newVisible" top="5vh">
       <el-form ref="newSubfileForm" :model="newSubfileForm" label-width="100px" :rules="rules">
@@ -1055,6 +1059,7 @@
   import PerformanceList from '@/components/oilsupplier/performancelist'
   import PatentList from '@/components/oilsupplier/patentlist'
   import WinningList from '@/components/oilsupplier/winninglist'
+  import CheckFile from '@/components/oilsupplier/checkFile'
   // v-viewer
   import Vue from 'vue'
   import Viewer from 'v-viewer'
@@ -1068,6 +1073,7 @@
     components: {
       WfMultiHistory,
       ChooseAuditor,
+      CheckFile,
       EquipmentList, // 企业主要设备
       PerformanceList, // 近三年主要业绩列表
       PatentList, // 专利及专有技术列表
@@ -2327,6 +2333,11 @@
       itemsshow () {
         this.myitemsshow = true
       },
+      checkFileList () {
+        console.log(this.$refs, 'this.$refs')
+        this.$refs.checkFile.checkFileListShow = true
+        this.$refs.checkFile.getValue(this.formData.SupplierId, this.formData.SupplierCertId, this.supplierData.OperType === '制造商' ? 1 : 2)
+      },
       // 保存信息变更数据
       saveinfochange (val) {
         if (this.formData.InStyle == '4' && !(this.subfileList1[0]['OldFileUrl'] != '' || this.subfileList1[0]['FileUrl'] != '')) {