Browse Source

文件列表,必传文件限制

shihang 6 years ago
parent
commit
bfdf45e513

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

@@ -317,18 +317,23 @@ func (this *OilSupplierCertSubController) AddBusiness() {
 	needList := filesvc.GetTechNeedFileList(model.SubClassId)
 
 	if err == nil {
-		var list []suppliercertsub.OilSupplierCertSub
+		var list []supplierfile.OilSupplierFile
 		where := "SupplierId = '" + strconv.Itoa(model.SupplierId) + "'"
-		where += " and SupplierCertId = '" + strconv.Itoa(model.SupplierCertId) + "'"
-		svc.GetEntitysByWhere(OilSupplierCertSubName, where, &list)
+		//where += " and SupplierCertId = '" + strconv.Itoa(model.SupplierCertId) + "'"
+		svc.GetEntitysByWhere(OilSupplierFileName, where, &list)
 
-		if len(list) == 1 { //第一次添加准入项,将共有必备资质写入文件表
+		if len(list) == 0 { //第一次添加准入项,将共有必备资质写入文件表
 			for i := 0; i < len(needList); i++ {
 				var entity supplierfile.OilSupplierFile
 				entity.SupplierId = model.SupplierId
-				entity.SupplierTypeCode = model.SupplierTypeCode
+				if i < 4 {
+					entity.SupplierTypeCode = "000"
+				} else {
+					entity.SupplierTypeCode = model.SupplierTypeCode
+				}
 				entity.NeedFileType = needList[i].FileName
 				entity.FileType = 1
+				entity.EffectDate = time.Now()
 				entity.CreateBy = this.User.Realname
 				entity.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
 				svc.InsertEntityBytbl(OilSupplierFileName, &entity)
@@ -341,6 +346,7 @@ func (this *OilSupplierCertSubController) AddBusiness() {
 					entity.SupplierTypeCode = model.SupplierTypeCode
 					entity.NeedFileType = needList[i].FileName
 					entity.FileType = 1
+					entity.EffectDate = time.Now()
 					entity.CreateBy = this.User.Realname
 					entity.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
 					svc.InsertEntityBytbl(OilSupplierFileName, &entity)

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

@@ -41,7 +41,7 @@ func (this *SupplierfileController) FileList() {
 	}
 	SupplierTypeCode := this.GetString("SupplierTypeCode")
 	if SupplierTypeCode != "" {
-		where = where + " and SupplierTypeCode = '" + SupplierTypeCode + "'"
+		where = where + " and SupplierTypeCode in ( '000', '" + SupplierTypeCode + "')"
 	}
 	total := svc.GetPagingEntitiesWithoutAccCode(page.CurrentPage, page.Size, orderby, asc, &list, where)
 	var datainfo DataInfo

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

@@ -199,8 +199,8 @@
       }
     },
     methods: {
-      getvalue(serviceId, SupplierTypeCode, certId) {
-        this.SupplierId = serviceId
+      getvalue(SupplierId, SupplierTypeCode, certId) {
+        this.SupplierId = SupplierId
         this.SupplierTypeCode = SupplierTypeCode
         this.SupplierCertId = certId
         this.initData()

+ 4 - 17
src/dashoo.cn/frontend_web/src/components/oilsupplier/subfilelist.vue

@@ -117,10 +117,6 @@
         type: String,
         default: '0'
       },
-      businessList: {
-        type: Array,
-        default: []
-      },
       canadd: {
         type: Boolean,
         default: false
@@ -171,8 +167,8 @@
       }
     },
     methods: {
-      getvalue(serviceId, SupplierTypeCode, certId) {
-        this.SupplierId = serviceId
+      getvalue(SupplierId, SupplierTypeCode, certId) {
+        this.SupplierId = SupplierId
         this.SupplierTypeCode = SupplierTypeCode
         this.initData()
       },
@@ -192,19 +188,9 @@
             _this.currentItemCount = res.data.currentItemCount
           })
           .catch(err => {
-            // handle error
             console.error(err)
           })
       },
-      getCode() {
-        if (this.businessList && this.businessList.length > 0) {
-          for (var i = 0; i < this.businessList.length; i++) {
-            if (this.SubfileForm.SupplierCertSubId == this.businessList[i].Id) {
-              this.SubfileForm.CertSubName = this.businessList[i].Name
-            }
-          }
-        }
-      },
       makesure() {
         if (this.Title == '新增文件') {
           if (this.$refs.refuploadattach.uploadFiles && this.$refs.refuploadattach.uploadFiles.length > 0) {
@@ -335,7 +321,7 @@
         this.visible = true
       },
       openDialog(val) {
-        this.Title = '编辑文件'
+        this.Title = '编辑文件'       
         this.SubfileForm.Id = val.Id
         this.SubfileForm.SupplierId = val.SupplierId
         this.SubfileForm.SupplierTypeCode = val.SupplierTypeCode
@@ -353,6 +339,7 @@
         this.SubfileForm.EffectDate = new Date(val.EffectDate)
         this.SubfileForm.FileUrl = val.FileUrl
         this.SubfileForm.OtherRemark = val.OtherRemark
+        this.doclist = []
         if (val.FileUrl != '') {
           this.getwendanginfo(val.FileUrl)
         }

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

@@ -177,7 +177,7 @@
         </el-tab-pane>
 
         <el-tab-pane label="企业资质" :disabled="!certId">
-          <business-list ref="businessList" :data.sync="businessList" :SupplierCertId="certId" :SupplierId="serviceId"
+          <business-list ref="businessList" :data.sync="businessList" :SupplierCertId="certId" :SupplierId="formData.Id"
             :SupplierTypeCode="classId" :canadd="add_flat" @close="AuditEntity" height="360px" style="margin-top: 20px">
           </business-list>
         </el-tab-pane>

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

@@ -177,7 +177,7 @@
           </el-card>
         </el-tab-pane>
         <el-tab-pane label="企业资质" :disabled="!certId">
-          <business-list ref="businessList" :data.sync="businessList" :SupplierCertId="certId+''" :SupplierId="serviceId"
+          <business-list ref="businessList" :data.sync="businessList" :SupplierCertId="certId+''" :SupplierId="formData.Id"
             :SupplierTypeCode="classId" :canadd="add_flat" @close="selectAuditOrg" height="360px" style="margin-top: 20px">
           </business-list>
         </el-tab-pane>

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

@@ -177,7 +177,7 @@
         </el-tab-pane>
 
         <el-tab-pane label="企业资质" :disabled="!certId">
-          <business-list ref="businessList" :data.sync="businessList" :SupplierCertId="certId" :SupplierId="serviceId"
+          <business-list ref="businessList" :data.sync="businessList" :SupplierCertId="certId" :SupplierId="formData.Id"
             :SupplierTypeCode="classId" :canadd="add_flat" @close="AuditEntity" height="360px" style="margin-top: 20px">
           </business-list>
         </el-tab-pane>