Explorar el Código

前后:年审的资质检查;注册退回短信加座机

dubch hace 4 años
padre
commit
51f401b098

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

@@ -66,4 +66,5 @@ type CheckFile struct {
 	CertId            string
 	SupplierId        int
 	Grade        	  string
+	Table        	  int 	"1准入,2增项,3年审,4信息变更"
 }

+ 29 - 13
src/dashoo.cn/backend/api/controllers/oilsupplier/supplier.go

@@ -1,6 +1,7 @@
 package oilsupplier
 
 import (
+	"dashoo.cn/backend/api/business/oilsupplier/annualaudit"
 	"dashoo.cn/backend/api/business/oilsupplier/qualchange"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertappendsub"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercertsub"
@@ -2781,14 +2782,9 @@ func (this *OilSupplierController) CheckSupplierFileNew(){
 			continue
 		}
 		var fileist1 supplierfile.OilSupplierFile
-		where1 := " SupplierId = '" + strconv.Itoa(file.SupplierId) + "' and NeedFileType = '" + needHeader.FileName + "'"
+		where1 := " SupplierId = '" + strconv.Itoa(file.SupplierId ) + "' and NeedFileType = '" + needHeader.FileName + "'"
 		filesvc.GetEntityByWhere("OilSupplierFile", where1, &fileist1)
 
-		var filelist2 suppliercertappendsub.OilAppendChangeDetail
-		where2 := " SupplierId = '" + strconv.Itoa(file.SupplierId) + "' and NeedFileType = '" + needHeader.FileName + "'"
-		svc2 := suppliercertappendsub.GetOilSupplierCertAppendSubService(utils.DBE)
-		svc2.GetEntityByWhere("OilQualChangeDetail", where2, &filelist2)
-
 		if !strings.Contains(companyHasHeaders, needHeader.FileName+",") {
 			errinfo.Message = "请上传!" + needHeader.FileName + "!"
 			errinfo.Code = 0
@@ -2796,13 +2792,33 @@ func (this *OilSupplierController) CheckSupplierFileNew(){
 			this.ServeJSON()
 			return
 		} else {
-			if filelist2.FileName == "" && fileist1.FileName == "" {
-				//缺少的资质
-				errinfo.Message = "请上传!" + needHeader.FileName + "!"
-				errinfo.Code = 0
-				this.Data["json"] = &errinfo
-				this.ServeJSON()
-				return
+			if file.Table == 3 {
+				var filelist2 annualaudit.OilAnnualChangeDetail
+				where2 := " SupplierId = '" + strconv.Itoa(file.SupplierId) + "' and NeedFileType = '" + needHeader.FileName + "'"
+				svc2 := suppliercertappendsub.GetOilSupplierCertAppendSubService(utils.DBE)
+				svc2.GetEntityByWhere("OilAnnualChangeDetail", where2, &filelist2)
+				if filelist2.FileName == "" && fileist1.FileName == "" {
+					//缺少的资质
+					errinfo.Message = "请上传!" + needHeader.FileName + "!"
+					errinfo.Code = 0
+					this.Data["json"] = &errinfo
+					this.ServeJSON()
+					return
+				}
+			}
+			if file.Table == 4 {
+				var filelist2 suppliercertappendsub.OilAppendChangeDetail
+				where2 := " SupplierId = '" + strconv.Itoa(file.SupplierId) + "' and NeedFileType = '" + needHeader.FileName + "'"
+				svc2 := suppliercertappendsub.GetOilSupplierCertAppendSubService(utils.DBE)
+				svc2.GetEntityByWhere("OilQualChangeDetail", where2, &filelist2)
+				if filelist2.FileName == "" && fileist1.FileName == "" {
+					//缺少的资质
+					errinfo.Message = "请上传!" + needHeader.FileName + "!"
+					errinfo.Code = 0
+					this.Data["json"] = &errinfo
+					this.ServeJSON()
+					return
+				}
 			}
 		}
 	}

+ 1 - 1
src/dashoo.cn/backend/api/controllers/register/oilcorporateinfo.go

@@ -525,7 +525,7 @@ func (this *OilCorporateInfoController) ComAudit() {
 			var sPerson userRole.Base_User
 			svc.GetEntity(&sPerson, "Id ="+this.User.Id)
 			toMobile := model.UserTelephone
-			msg := "市场管理信息系统账号注册失败,因“" + Remark + "”,请按照要求重新注册,联系人:" + sPerson.Realname + " "
+			msg := "市场管理信息系统账号注册失败,因“" + Remark + "”,请按照要求重新注册,联系人:" + sPerson.Realname + ",座机号:" + sPerson.Mobile
 
 			//调用短信接口发送短信
 			msgService := msg2.GetMsgService(utils.DBE)

+ 131 - 97
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/bassicoperation.vue

@@ -47,7 +47,7 @@
             <div slot="header" class="clearfix">
               <span>供方基本信息表</span>
               <span style="float: right;">
-                <el-button type="primary" size="mini" @click="saveEntity" v-if="Status <= 0">保存基本信息
+                <el-button type="primary" size="mini" @click="saveEntity" v-if="Status <= 0" :loading="saveLoading">保存基本信息
                 </el-button>
               </span>
             </div>
@@ -1160,6 +1160,7 @@ import Viewer from 'v-viewer'
         auditBtn: false,
         firOptions: [],
         newVisible: false,
+        saveLoading: false,
         newSubfileForm: {
           Id: '',
           SupplierId: '',
@@ -2334,45 +2335,54 @@ import Viewer from 'v-viewer'
               })
               return
             }
+            console.log('2232423423')
             return true
           }
+          return false
         })
       },
       separateUnitSubmitAuditMakeSure () {
         console.log('二级分办单位审核结果 确认提交')
-        let checkRes = this.separateUnitSubmitAuditParamsCheck
-        if (!checkRes) {
-          return false
-        }
-        let params = {
-          firstAudit: this.auditer,
-          SecondAudit: this.fushenauditer,
-          AuditRemark: this.entityForm.Remark
-        }
         this.loading = true
-        annualapi.separateUnitAuditEntity(this.annualId, params, this.$axios).then(res => {
-          if (res.data.code === 0) {
-            // 保存成功后,初始化数据,变成修改
-            // this.Status = res.data.item
-            // this.entityForm.Status = this.Status
-            // this.initDatas()
-            this.getstatus(this.annualId)
-            this.isAccess()
-            this.dialogSeparateUnitAuditVisible = false
-            this.$message({
-              type: 'success',
-              message: res.data.message
+        // let checkRes = this.separateUnitSubmitAuditParamsCheck()
+        // if (!checkRes) {
+        //   this.loading = false
+        //   return false
+        // }
+        this.saveEntity(1).then(res=>{
+          if (res) {
+            let params = {
+              firstAudit: this.auditer,
+              SecondAudit: this.fushenauditer,
+              AuditRemark: this.entityForm.Remark
+            }
+            annualapi.separateUnitAuditEntity(this.annualId, params, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                // 保存成功后,初始化数据,变成修改
+                // this.Status = res.data.item
+                // this.entityForm.Status = this.Status
+                // this.initDatas()
+                this.getstatus(this.annualId)
+                this.isAccess()
+                this.dialogSeparateUnitAuditVisible = false
+                this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+              this.loading = false
+            }).catch(err => {
+              this.loading = false
+              console.error(err)
             })
           } else {
-            this.$message({
-              type: 'warning',
-              message: res.data.message
-            })
+            this.loading = false
           }
-          this.loading = false
-        }).catch(err => {
-          this.loading = false
-          console.error(err)
         })
       },
       comSubmitToSeparateUnitClick () {
@@ -2380,59 +2390,58 @@ import Viewer from 'v-viewer'
       },
       // 企业用户自行提交审批
       companySubmitToSecUnitSeparate () {
-        this.saveEntity(1)
-        let checkRes = this.companySubmitToSecUnitParamsCheck
+        this.loading = true
+        let checkRes = this.companySubmitToSecUnitParamsCheck()
         if (!checkRes) {
+          this.loading = false
           return false
         }
-        this.loading = true
-        // this.auditform.FirstAuditName = this.UnitOrg
-        // this.auditform.CertId = this.formData.Id
-        // this.auditform.TypeCode = '01'
-        let params = {
-          UnitId: this.UnitOrg,
-          AuditRemark: this.entityForm.Remark
-        }
-        let _this = this
-        annualapi.companyAuditEntity(this.annualId, params, this.$axios).then(res => {
-          if (res.data.code === 0) {
-            // 保存成功后,初始化数据,变成修改
-            this.$message({
-              type: 'success',
-              message: res.data.message
-            })
-            _this.dialogComSubmitToSeparateUnitVisible = false
-            // this.getEntityById()
-            if (_this.$refs['WfHistory']) {
-              _this.$refs['WfHistory'].getHistoryTask()
+        this.saveEntity(1).then(res=>{
+          if (res) {
+            // this.auditform.FirstAuditName = this.UnitOrg
+            // this.auditform.CertId = this.formData.Id
+            // this.auditform.TypeCode = '01'
+            let params = {
+              UnitId: this.UnitOrg,
+              AuditRemark: this.entityForm.Remark
             }
-            _this.initDatas()
-            _this.getstatus(this.annualId)
-            _this.isAccess()
-          } else {
-            this.$message({
-              type: 'warning',
-              message: res.data.message
+            let _this = this
+            annualapi.companyAuditEntity(this.annualId, params, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                // 保存成功后,初始化数据,变成修改
+                this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+                _this.dialogComSubmitToSeparateUnitVisible = false
+                // this.getEntityById()
+                if (_this.$refs['WfHistory']) {
+                  _this.$refs['WfHistory'].getHistoryTask()
+                }
+                _this.initDatas()
+                _this.getstatus(this.annualId)
+                _this.isAccess()
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+              _this.loading = false
+            }).catch(err => {
+              console.error(err)
             })
+          } else {
+            this.loading = false
           }
-          _this.loading = false
-        }).catch(err => {
-          console.error(err)
         })
       },
       companySubmitToSecUnitParamsCheck () {
-        if (this.myentityList == null || this.myentityList.length <= 0) {
-          this.$message({
-            type: 'warning',
-            message: '没有新增准入项,不能提交!'
-          })
-          return
-        }
-        for (let idx in this.subfileList1) {
-          if (this.subfileList1[idx].OldFileUrl === '' && this.subfileList1[idx].FileUrl === '') {
+        for (let idx in this.subfileList) {
+          if (this.subfileList[idx].OldFileUrl === '' && this.subfileList[idx].FileUrl === '') {
             this.$message({
               type: 'warning',
-              message: this.subfileList1[idx].NeedFileType + '没有上传,不能提交!'
+              message: this.subfileList[idx].NeedFileType + '没有上传,不能提交!'
             })
             return
           }
@@ -2933,32 +2942,57 @@ import Viewer from 'v-viewer'
 
       // 保存信息
       saveEntity (val) {
-        let valid1 = false
-        let valid2 = false
-        this.$refs['EntityForm'].validate((valid) => {
-          valid1 = valid
-        })
-
-        this.$refs['EntityFormCert'].validate((valid) => {
-          valid2 = valid
-        })
-        if (valid1 && valid2) {
-          api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
-            if (res.data.item) {
-              this.$message({
-                type: 'warning',
-                message: '该银行账号与其他公司重复'
-              })
-            } else {
-              this.addInfoChangeItemCh(val)
-            }
-          }).catch(err => {
-            console.error(err)
+        return new Promise((resolve, reject) => {
+          this.saveLoading = true
+          let valid1 = false
+          let valid2 = false
+          this.$refs['EntityForm'].validate((valid) => {
+            valid1 = valid
           })
-          return true
-        } else {
-          return false
-        }
+          this.$refs['EntityFormCert'].validate((valid) => {
+            valid2 = valid
+          })
+          if (valid1 && valid2) {
+            api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
+              if (res.data.item) {
+                this.$message({
+                  type: 'warning',
+                  message: '该银行账号与其他公司重复'
+                })
+                this.saveLoading = false
+                resolve(false)
+              } else {
+                // 检查是否缺少资质
+                let fileType = {
+                  Type: this.formData.OperType === '制造商' ? 1 : 2,
+                  SupplierId: this.formData.Id,
+                  CertId: this.certId,
+                  Grade: this.formData.Grade,
+                  Table: 3
+                }
+                api.checkSupplierFileNew(fileType, this.$axios).then(res => {
+                  if (res.data.code === 1) {
+                    this.addInfoChangeItemCh(val)
+                    resolve(true)
+                  } else {
+                    this.$message({
+                      type: 'warning',
+                      message: res.data.message
+                    })
+                    resolve(false)
+                  }
+                  this.saveLoading = false
+                })
+              }
+            }).catch(err => {
+              console.error(err)
+            })
+            return true
+          } else {
+            this.saveLoading = false
+            resolve(false)
+          }
+        })
       },
       addInfoChangeItemCh (val) {
         let AllInfochangeItemList = {

+ 148 - 110
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/goodsoperation.vue

@@ -48,8 +48,7 @@
             <div slot="header" class="clearfix">
               <span>供方基本信息表</span>
               <span style="float: right;">
-                <el-button type="primary" size="mini" @click="saveinfochange" v-if="Status <= 0">保存
-                </el-button>
+                <el-button type="primary" size="mini" @click="saveinfochange" v-if="Status <= 0" :loading="saveLoading">保存</el-button>
               </span>
             </div>
             <!--<goods-info ref="GoodsInfo" :formData.sync="formData" :dictData.sync="dictData" :authUser="authUser"-->
@@ -1325,6 +1324,7 @@
         firOptions: [],
         newVisible: false,
         auditBtn: false,
+        saveLoading: false,
         newSubfileForm: {
           Id: '',
           SupplierId: '',
@@ -2899,47 +2899,78 @@
       // },
       // 保存信息
       saveinfochange (val) {
-        let valid1 = false
-        let valid2 = false
-        this.$refs['EntityForm'].validate((valid) => {
-          valid1 = valid
-        })
-
-        this.$refs['EntityFormCert'].validate((valid) => {
-          valid2 = valid
-        })
-        if (this.formData.Grade == 1 && (this.formData.PACNumber == '' || typeof this.formData.PACNumber == 'undefined' || this.formData.PACNumber.trim() == '')) {
-          this.$message({
-            type: 'warning',
-            message: '中石油准入证编号不能为空!'
+        return new Promise((resolve, reject) => {
+          this.saveLoading = true
+          let valid1 = false
+          let valid2 = false
+          this.$refs['EntityForm'].validate((valid) => {
+            valid1 = valid
           })
-          return
-        }
-        if (this.formData.InStyle === '3' && this.formData.MgrUnit === '大港油田分公司') {
-          this.$message({
-            type: 'warning',
-            message: '二级物资准入不能选择大港油田分公司!'
-          })
-          return
-        }
-        if (valid1 && valid2) {
-          api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
-            if (res.data.item) {
-              this.$message({
-                type: 'warning',
-                message: '该银行账号与其他公司重复'
-              })
-            } else {
-              this.addInfoChangeItemCh(val)
-            }
-          }).catch(err => {
-            console.error(err)
+
+          this.$refs['EntityFormCert'].validate((valid) => {
+            valid2 = valid
           })
-          return true
-        } else {
-          return false
-        }
+          if (this.formData.Grade == 1 && (this.formData.PACNumber == '' || typeof this.formData.PACNumber == 'undefined' || this.formData.PACNumber.trim() == '')) {
+            this.$message({
+              type: 'warning',
+              message: '中石油准入证编号不能为空!'
+            })
+            this.saveLoading = false
+            resolve(false)
+          }
+          if (this.formData.InStyle === '3' && this.formData.MgrUnit === '大港油田分公司') {
+            this.$message({
+              type: 'warning',
+              message: '二级物资准入不能选择大港油田分公司!'
+            })
+            this.saveLoading = false
+            resolve(false)
+          }
+          if (valid1 && valid2) {
+            api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
+              if (res.data.item) {
+                this.$message({
+                  type: 'warning',
+                  message: '该银行账号与其他公司重复'
+                })
+                this.saveLoading = false
+                resolve(false)
+              } else {
+                // 检查是否缺少资质
+                let fileType = {
+                  Type: this.formData.OperType === '制造商' ? 1 : 2,
+                  SupplierId: this.formData.Id,
+                  CertId: this.certId,
+                  Grade: this.formData.Grade,
+                  Table: 3
+                }
+                api.checkSupplierFileNew(fileType, this.$axios).then(res => {
+                  if (res.data.code === 1) {
+                    this.addInfoChangeItemCh(val)
+                    this.saveLoading = false
+                    resolve(true)
+                  } else {
+                    this.$message({
+                      type: 'warning',
+                      message: res.data.message
+                    })
+                    this.saveLoading = false
+                    resolve(false)
+                  }
+                })
+              }
+            }).catch(err => {
+              this.saveLoading = false
+              resolve(false)
+              console.error(err)
+            })
+          } else {
+            this.saveLoading = false
+            resolve(false)
+          }
+        })
       },
+
       addInfoChangeItemCh (val) {
         let AllInfochangeItemList = {
           SupplierId: this.formData.Id + '',
@@ -3037,44 +3068,52 @@
             }
             return true
           }
+          return false
         })
       },
       separateUnitSubmitAuditMakeSure () {
         console.log('二级分办单位审核结果 确认提交')
-        let checkRes = this.separateUnitSubmitAuditParamsCheck
-        if (!checkRes) {
-          return false
-        }
-        let params = {
-          firstAudit: this.auditer,
-          SecondAudit: this.fushenauditer,
-          AuditRemark: this.entityForm.Remark
-        }
         this.loading = true
-        let _this = this
-        annualapi.separateUnitAuditEntity(this.annualId, params, this.$axios).then(res => {
-          if (res.data.code === 0) {
-            // 保存成功后,初始化数据,变成修改
-            // this.Status = res.data.item
-            // this.entityForm.Status = this.Status
-            this.$message({
-              type: 'success',
-              message: res.data.message
+        // let checkRes = this.separateUnitSubmitAuditParamsCheck()
+        // if (!checkRes) {
+        //   this.loading = false
+        //   return false
+        // }
+        this.saveinfochange(1).then(res=>{
+          if (res) {
+            let params = {
+              firstAudit: this.auditer,
+              SecondAudit: this.fushenauditer,
+              AuditRemark: this.entityForm.Remark
+            }
+            let _this = this
+            annualapi.separateUnitAuditEntity(this.annualId, params, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                // 保存成功后,初始化数据,变成修改
+                // this.Status = res.data.item
+                // this.entityForm.Status = this.Status
+                this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+                _this.initDatas()
+                _this.getstatus(this.annualId)
+                _this.isAccess()
+                _this.dialogSeparateUnitAuditVisible = false
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+              this.loading = false
+            }).catch(err => {
+              this.loading = false
+              console.error(err)
             })
-            _this.initDatas()
-            _this.getstatus(this.annualId)
-            _this.isAccess()
-            _this.dialogSeparateUnitAuditVisible = false
           } else {
-            this.$message({
-              type: 'warning',
-              message: res.data.message
-            })
+            this.loading = false
           }
-          this.loading = false
-        }).catch(err => {
-          this.loading = false
-          console.error(err)
         })
       },
       comSubmitToSeparateUnitClick () {
@@ -3082,56 +3121,55 @@
       },
       // 企业用户自行提交审批
       companySubmitToSecUnitSeparate () {
-        this.saveinfochange(1)
-        let checkRes = this.companySubmitToSecUnitParamsCheck
+        this.loading = true
+        let checkRes = this.companySubmitToSecUnitParamsCheck()
         if (!checkRes) {
+          this.loading = false
           return false
         }
-        this.loading = true
-        // this.auditform.FirstAuditName = this.UnitOrg
-        // this.auditform.CertId = this.formData.Id
-        // this.auditform.TypeCode = '01'
-        let params = {
-          UnitId: this.UnitOrg,
-          AuditRemark: this.entityForm.Remark
-        }
-        let _this = this
-        annualapi.companyAuditEntity(this.annualId, params, this.$axios).then(res => {
-          if (res.data.code === 0) {
-            // 保存成功后,初始化数据,变成修改
-            this.$message({
-              type: 'success',
-              message: res.data.message
+        this.saveinfochange(1).then(res=>{
+          if (res) {
+            // this.auditform.FirstAuditName = this.UnitOrg
+            // this.auditform.CertId = this.formData.Id
+            // this.auditform.TypeCode = '01'
+            let params = {
+              UnitId: this.UnitOrg,
+              AuditRemark: this.entityForm.Remark
+            }
+            let _this = this
+            annualapi.companyAuditEntity(this.annualId, params, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                // 保存成功后,初始化数据,变成修改
+                this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+                _this.initDatas()
+                _this.getstatus(this.annualId)
+                _this.isAccess()
+                _this.dialogComSubmitToSeparateUnitVisible = false
+                // _this.getEntityById()
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+              _this.loading = false
+            }).catch(err => {
+              console.error(err)
             })
-            _this.initDatas()
-            _this.getstatus(this.annualId)
-            _this.isAccess()
-            _this.dialogComSubmitToSeparateUnitVisible = false
-            // _this.getEntityById()
           } else {
-            this.$message({
-              type: 'warning',
-              message: res.data.message
-            })
+            this.loading = false
           }
-          _this.loading = false
-        }).catch(err => {
-          console.error(err)
         })
       },
-      companySubmitToSecUnitParamsCheck () {
-        if (this.myentityList == null || this.myentityList.length <= 0) {
-          this.$message({
-            type: 'warning',
-            message: '没有新增准入项,不能提交!'
-          })
-          return
-        }
-        for (let idx in this.subfileList1) {
-          if (this.subfileList1[idx].OldFileUrl === '' && this.subfileList1[idx].FileUrl === '') {
+      companySubmitToSecUnitParamsCheck ()  {
+        for (let idx in this.subfileList) {
+          if (this.subfileList[idx].OldFileUrl === '' && this.subfileList[idx].FileUrl === '') {
             this.$message({
               type: 'warning',
-              message: this.subfileList1[idx].NeedFileType + '没有上传,不能提交!'
+              message: this.subfileList[idx].NeedFileType + '没有上传,不能提交!'
             })
             return
           }

+ 130 - 97
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/operation.vue

@@ -47,7 +47,7 @@
             <div slot="header" class="clearfix">
               <span>供方基本信息表</span>
               <span style="float: right;">
-                <el-button type="primary" size="mini" @click="saveinfochange" v-if="Status <= 0">保存
+                <el-button type="primary" size="mini" @click="saveinfochange" v-if="Status <= 0" :loading="saveLoading">保存
                 </el-button>
               </span>
             </div>
@@ -1075,6 +1075,7 @@ import Viewer from 'v-viewer'
       }
       return {
         auditBtn: false,
+        saveLoading: false,
         firOptions: [],
         newVisible: false,
         newSubfileForm: {
@@ -2281,43 +2282,51 @@ import Viewer from 'v-viewer'
             }
             return true
           }
+          return false
         })
       },
       separateUnitSubmitAuditMakeSure () {
         console.log('二级分办单位审核结果 确认提交')
-        let checkRes = this.separateUnitSubmitAuditParamsCheck
-        if (!checkRes) {
-          return false
-        }
-        let params = {
-          firstAudit: this.auditer,
-          SecondAudit: this.fushenauditer,
-          AuditRemark: this.entityForm.Remark
-        }
         this.loading = true
-        annualapi.separateUnitAuditEntity(this.annualId, params, this.$axios).then(res => {
-          if (res.data.code === 0) {
-            // 保存成功后,初始化数据,变成修改
-            // this.Status = res.data.item
-            // this.entityForm.Status = this.Status
-            this.$message({
-              type: 'success',
-              message: res.data.message
+        // let checkRes = this.separateUnitSubmitAuditParamsCheck()
+        // if (!checkRes) {
+        //   this.loading = false
+        //   return false
+        // }
+        this.saveinfochange(1).then(res=>{
+          if (res) {
+            let params = {
+              firstAudit: this.auditer,
+              SecondAudit: this.fushenauditer,
+              AuditRemark: this.entityForm.Remark
+            }
+            annualapi.separateUnitAuditEntity(this.annualId, params, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                // 保存成功后,初始化数据,变成修改
+                // this.Status = res.data.item
+                // this.entityForm.Status = this.Status
+                this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+                this.initDatas()
+                this.getstatus(this.annualId)
+                this.isAccess()
+                this.dialogSeparateUnitAuditVisible = false
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+              this.loading = false
+            }).catch(err => {
+              this.loading = false
+              console.error(err)
             })
-            this.initDatas()
-            this.getstatus(this.annualId)
-            this.isAccess()
-            this.dialogSeparateUnitAuditVisible = false
           } else {
-            this.$message({
-              type: 'warning',
-              message: res.data.message
-            })
+            this.loading = false
           }
-          this.loading = false
-        }).catch(err => {
-          this.loading = false
-          console.error(err)
         })
       },
       comSubmitToSeparateUnitClick () {
@@ -2325,59 +2334,58 @@ import Viewer from 'v-viewer'
       },
       // 企业用户自行提交审批
       companySubmitToSecUnitSeparate () {
-        this.saveinfochange(1)
-        let checkRes = this.companySubmitToSecUnitParamsCheck
+        this.loading = true
+        let checkRes = this.companySubmitToSecUnitParamsCheck()
         if (!checkRes) {
+          this.loading = false
           return false
         }
-        this.loading = true
-        // this.auditform.FirstAuditName = this.UnitOrg
-        // this.auditform.CertId = this.formData.Id
-        // this.auditform.TypeCode = '01'
-        let params = {
-          UnitId: this.UnitOrg,
-          AuditRemark: this.entityForm.Remark
-        }
-        let _this = this
-        annualapi.companyAuditEntity(this.annualId, params, this.$axios).then(res => {
-          if (res.data.code === 0) {
-            // 保存成功后,初始化数据,变成修改
-            this.$message({
-              type: 'success',
-              message: res.data.message
-            })
-            _this.dialogComSubmitToSeparateUnitVisible = false
-            // _this.getEntityById()
-            _this.initDatas()
-            _this.getstatus(this.annualId)
-            if (_this.$refs['WfHistory']) {
-              _this.$refs['WfHistory'].getHistoryTask()
+        this.saveinfochange(1).then(res=>{
+          if (res) {
+            // this.auditform.FirstAuditName = this.UnitOrg
+            // this.auditform.CertId = this.formData.Id
+            // this.auditform.TypeCode = '01'
+            let params = {
+              UnitId: this.UnitOrg,
+              AuditRemark: this.entityForm.Remark
             }
-            _this.isAccess()
-          } else {
-            this.$message({
-              type: 'warning',
-              message: res.data.message
+            let _this = this
+            annualapi.companyAuditEntity(this.annualId, params, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                // 保存成功后,初始化数据,变成修改
+                this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+                _this.dialogComSubmitToSeparateUnitVisible = false
+                // _this.getEntityById()
+                _this.initDatas()
+                _this.getstatus(this.annualId)
+                if (_this.$refs['WfHistory']) {
+                  _this.$refs['WfHistory'].getHistoryTask()
+                }
+                _this.isAccess()
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+              _this.loading = false
+            }).catch(err => {
+              console.error(err)
             })
+          } else {
+            this.loading = false
           }
-          _this.loading = false
-        }).catch(err => {
-          console.error(err)
         })
       },
       companySubmitToSecUnitParamsCheck () {
-        if (this.myentityList == null || this.myentityList.length <= 0) {
-          this.$message({
-            type: 'warning',
-            message: '没有新增准入项,不能提交!'
-          })
-          return
-        }
-        for (let idx in this.subfileList1) {
-          if (this.subfileList1[idx].OldFileUrl === '' && this.subfileList1[idx].FileUrl === '') {
+        for (let idx in this.subfileList) {
+          if (this.subfileList[idx].OldFileUrl === '' && this.subfileList[idx].FileUrl === '') {
             this.$message({
               type: 'warning',
-              message: this.subfileList1[idx].NeedFileType + '没有上传,不能提交!'
+              message: this.subfileList[idx].NeedFileType + '没有上传,不能提交!'
             })
             return
           }
@@ -2903,32 +2911,57 @@ import Viewer from 'v-viewer'
 
       // 保存信息
       saveinfochange (val) {
-        let valid1 = false
-        let valid2 = false
-        this.$refs['EntityForm'].validate((valid) => {
-          valid1 = valid
-        })
-
-        this.$refs['EntityFormCert'].validate((valid) => {
-          valid2 = valid
-        })
-        if (valid1 && valid2) {
-          api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
-            if (res.data.item) {
-              this.$message({
-                type: 'warning',
-                message: '该银行账号与其他公司重复'
-              })
-            } else {
-              this.addInfoChangeItemCh(val)
-            }
-          }).catch(err => {
-            console.error(err)
+        return new Promise((resolve, reject) => {
+          this.saveLoading = true
+          let valid1 = false
+          let valid2 = false
+          this.$refs['EntityForm'].validate((valid) => {
+            valid1 = valid
           })
-          return true
-        } else {
-          return false
-        }
+          this.$refs['EntityFormCert'].validate((valid) => {
+            valid2 = valid
+          })
+          if (valid1 && valid2) {
+            api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
+              if (res.data.item) {
+                this.$message({
+                  type: 'warning',
+                  message: '该银行账号与其他公司重复'
+                })
+                this.saveLoading = false
+                resolve(false)
+              } else {
+                // 检查是否缺少资质
+                let fileType = {
+                  Type: this.formData.OperType === '制造商' ? 1 : 2,
+                  SupplierId: this.formData.Id,
+                  CertId: this.certId,
+                  Grade: this.formData.Grade,
+                  Table: 3
+                }
+                api.checkSupplierFileNew(fileType, this.$axios).then(res => {
+                  if (res.data.code === 1) {
+                    this.addInfoChangeItemCh(val)
+                    resolve(true)
+                  } else {
+                    this.$message({
+                      type: 'warning',
+                      message: res.data.message
+                    })
+                    resolve(false)
+                  }
+                  this.saveLoading = false
+                })
+              }
+            }).catch(err => {
+              console.error(err)
+            })
+            return true
+          } else {
+            this.saveLoading = false
+            resolve(false)
+          }
+        })
       },
       addInfoChangeItemCh (val) {
         let AllInfochangeItemList = {

+ 7 - 2
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/basicindex.vue

@@ -16,7 +16,7 @@
               @click="addaudit">添加
             </el-button>
             <el-button v-if="IsCompanyUser == 1" type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
-              @click="addauditcom">添加
+              @click="addauditcom" :loading="addLoading">添加
             </el-button>
           </span>
           <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
@@ -236,6 +236,7 @@
     data () {
       return {
         tableLoading: false,
+        addLoading: false,
         annualauditmakesure: false,
         chooseAuditorVisible: false,
         orgtreelist: [],
@@ -508,6 +509,7 @@
           type: 'warning'
         })
           .then(() => {
+            this.addLoading = true
             api.addEntity(this.entityForm, this.entityForm.auditer, this.$axios).then(res => {
               if (res.data.code === 0) {
                 // 保存成功后,初始化数据,变成修改
@@ -515,7 +517,7 @@
                 this.initDatas()
                 this.addshow = false
                 this.$router.push({
-                  path: '/oilsupplier/annualaudit/' + this.entityForm.SupplierId + '/goodsoperation',
+                  path: '/oilsupplier/annualaudit/' + this.entityForm.SupplierId + '/bassicoperation',
                   query: {
                     certid: this.certId,
                     // WorkflowId: ,
@@ -528,7 +530,9 @@
                   type: 'success',
                   message: res.data.message
                 })
+                this.addLoading = false
               } else if (res.data.code === -3) {
+                this.addLoading = false
                 this.$confirm(res.data.message)
                   .then(_ => {
                     console.log('年审审批不到期不允许添加2222')
@@ -536,6 +540,7 @@
                   })
                   .catch(_ => {})
               } else {
+                this.addLoading = false
                 this.$message({
                   type: 'warning',
                   message: res.data.message

+ 6 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/goodsindex.vue

@@ -16,7 +16,7 @@
               @click="addaudit">添加
             </el-button>
             <el-button v-if="IsCompanyUser == 1" type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
-              @click="addauditcom">添加
+              @click="addauditcom" :loading="addLoading">添加
             </el-button>
           </span>
           <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
@@ -236,6 +236,7 @@
     data () {
       return {
         tableLoading: false,
+        addLoading: false,
         chooseAuditorVisible: false,
         orgtreelist: [],
         orgtreeprops: {
@@ -510,6 +511,7 @@
           type: 'warning'
         })
           .then(() => {
+            this.addLoading = true
             api.addEntity(this.entityForm, this.entityForm.auditer, this.$axios).then(res => {
               if (res.data.code === 0) {
                 console.log('年审审批111')
@@ -531,14 +533,17 @@
                   type: 'success',
                   message: res.data.message
                 })
+                this.addLoading = false
               } else if (res.data.code === -3) {
                 console.log('年审审批不到期不允许添加2222')
+                this.addLoading = false
                 this.$confirm(res.data.message)
                   .then(_ => {
                     // this.addannualdirect()
                   })
                   .catch(_ => {})
               } else {
+                this.addLoading = false
                 this.$message({
                   type: 'warning',
                   message: res.data.message

+ 7 - 2
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/techindex.vue

@@ -16,7 +16,7 @@
               @click="addaudit">添加
             </el-button>
             <el-button v-if="IsCompanyUser == 1" type="primary" size="mini" style="margin-left:10px; margin-top: -4px;"
-              @click="addauditcom">添加
+              @click="addauditcom" :loading="addLoading">添加
             </el-button>
           </span>
           <el-form ref="form" :inline="true" style="float: right; margin-top: -10px">
@@ -235,6 +235,7 @@ import WfHistory from '@/components/workflow/wfmultihistory.vue'
     data () {
       return {
         tableLoading: false,
+        addLoading : false,
         chooseAuditorVisible: false,
         orgtreelist: [],
         orgtreeprops: {
@@ -511,6 +512,7 @@ import WfHistory from '@/components/workflow/wfmultihistory.vue'
           type: 'warning'
         })
           .then(() => {
+            this.addLoading = true
             api.addEntity(this.entityForm, this.entityForm.auditer, this.$axios).then(res => {
               if (res.data.code === 0) {
                 // 保存成功后,初始化数据,变成修改
@@ -518,7 +520,7 @@ import WfHistory from '@/components/workflow/wfmultihistory.vue'
                 this.initDatas()
                 this.addshow = false
                 this.$router.push({
-                  path: '/oilsupplier/annualaudit/' + this.entityForm.SupplierId + '/goodsoperation',
+                  path: '/oilsupplier/annualaudit/' + this.entityForm.SupplierId + '/operation',
                   query: {
                     certid: this.certId,
                     // WorkflowId: ,
@@ -527,17 +529,20 @@ import WfHistory from '@/components/workflow/wfmultihistory.vue'
                     annualId: this.entityForm.Id
                   }
                 })
+                this.addLoading = false
                 this.$message({
                   type: 'success',
                   message: res.data.message
                 })
               } else if (res.data.code === -3) {
+                this.addLoading = false
                 this.$confirm(res.data.message)
                   .then(_ => {
                     // this.addannualdirect()
                   })
                   .catch(_ => {})
               } else {
+                this.addLoading = false
                 this.$message({
                   type: 'warning',
                   message: res.data.message

+ 0 - 3
src/dashoo.cn/frontend_web/src/pages/oilsupplier/infochangech/_opera/operation.vue

@@ -1679,7 +1679,6 @@
           .catch(() => {})
       },
       companySubmitToSecUnitSeparate () {
-        this.saveinfochange(1)
         if (this.UnitOrg === '') {
           this.$message({
             type: 'warning',
@@ -1698,7 +1697,6 @@
         this.entityForm.MInfoId = this.MInfoId
         this.btnloading = true
         this.saveinfochange(1).then(val => {
-          console.log(val,'222222')
           if (val) {
             let params = {
               unitId: this.UnitOrg,
@@ -2748,7 +2746,6 @@
         }
         this.btnloading = true
         this.saveinfochange(1).then(val => {
-          console.log(val,'222222')
           if (val) {
             this.entityForm.fushenauditer = this.fushenauditer
             this.entityForm.auditer = this.auditer