瀏覽代碼

前:年审保存基本信息不再检查资质,在提交审核时检查

wd 4 年之前
父節點
當前提交
fdbaa3f2db

+ 33 - 23
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/bassicoperation.vue

@@ -2493,6 +2493,7 @@
         //   return false
         // }
         this.saveEntity(1).then(res => {
+          console.log(res, 'res---')
           if (res) {
             let params = {
               firstAudit: this.auditer,
@@ -3128,35 +3129,44 @@
                 this.saveLoading = false
                 return 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
-                    return resolve(true)
-                  } else {
-                    this.$message({
-                      duration: 10000,
-                      type: 'warning',
-                      message: res.data.message
-                    })
-                    this.saveLoading = false
-                    return resolve(false)
+                this.addInfoChangeItemCh(val)
+                if (val === 1) {
+                  // 检查是否缺少资质
+                  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.saveLoading = false
+                      return resolve(true)
+                    } else {
+                      this.$message({
+                        duration: 10000,
+                        type: 'warning',
+                        message: res.data.message
+                      })
+                      this.saveLoading = false
+                      return resolve(false)
+                    }
+                  })
+                } else {
+                  this.saveLoading = false
+                  return resolve(true)
+                }
               }
             }).catch(err => {
               console.error(err)
             })
-            return resolve(true)
           } else {
+            this.$message({
+              duration: 10000,
+              type: 'warning',
+              message: '请完善企业基本信息!'
+            })
             this.saveLoading = false
             return resolve(false)
           }

+ 34 - 23
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/goodsoperation.vue

@@ -49,7 +49,7 @@
             <div slot="header" class="clearfix">
               <span>供方基本信息表</span>
               <span style="float: right;">
-                <el-button type="primary" size="mini" @click="saveinfochange" v-if="Status <= 0" :loading="saveLoading">保存</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"-->
@@ -3074,35 +3074,46 @@
                 this.saveLoading = false
                 return 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
-                    return resolve(true)
-                  } else {
-                    this.$message({
-                      duration: 10000,
-                      type: 'warning',
-                      message: res.data.message
-                    })
-                    this.saveLoading = false
-                    return resolve(false)
+                this.addInfoChangeItemCh(val)
+                console.log(val, 'val')
+                if (val) {
+                  // 检查是否缺少资质
+                  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.saveLoading = false
+                      return resolve(true)
+                    } else {
+                      this.$message({
+                        duration: 10000,
+                        type: 'warning',
+                        message: res.data.message
+                      })
+                      this.saveLoading = false
+                      return resolve(false)
+                    }
+                  })
+                } else {
+                  this.saveLoading = false
+                  return resolve(true)
+                }
               }
             }).catch(err => {
               this.saveLoading = false
               return resolve(false)
             })
           } else {
+            this.$message({
+              duration: 10000,
+              type: 'warning',
+              message: '请完善企业基本信息!'
+            })
             this.saveLoading = false
             return resolve(false)
           }

+ 33 - 24
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/operation.vue

@@ -48,7 +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" :loading="saveLoading">保存
+                <el-button type="primary" size="mini" @click="saveinfochange" v-if="Status <= 0" :loading="saveLoading">保存基本信息
                 </el-button>
               </span>
             </div>
@@ -3114,35 +3114,44 @@ import Viewer from 'v-viewer'
                 this.saveLoading = false
                 return 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
-                    return resolve(true)
-                  } else {
-                    this.$message({
-                      duration: 10000,
-                      type: 'warning',
-                      message: res.data.message
-                    })
-                    this.saveLoading = false
-                    return resolve(false)
+                this.addInfoChangeItemCh(val)
+                if (val === 1) {
+                  // 检查是否缺少资质
+                  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.saveLoading = false
+                      return resolve(true)
+                    } else {
+                      this.$message({
+                        duration: 10000,
+                        type: 'warning',
+                        message: res.data.message
+                      })
+                      this.saveLoading = false
+                      return resolve(false)
+                    }
+                  })
+                } else {
+                  this.saveLoading = false
+                  return resolve(true)
+                }
               }
             }).catch(err => {
               console.error(err)
             })
-            return true
           } else {
+            this.$message({
+              duration: 10000,
+              type: 'warning',
+              message: '请完善企业基本信息!'
+            })
             this.saveLoading = false
             return resolve(false)
           }