Ver código fonte

前:增项提交检查资质

dubch 4 anos atrás
pai
commit
1c12ac394c

+ 51 - 25
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/basisdataopera.vue

@@ -2058,41 +2058,67 @@
         }
         return true
       },
+      // 检查资质文件
+      checkFile () {
+        return new Promise((resolve, reject) => {
+          let fileType = {
+            Type: this.supplierData.OperType === '制造商' ? 1 : 2,
+            SupplierId: this.formData.SupplierId,
+            CertId: this.formData.SupplierCertId.toString(),
+            Grade: this.Grade,
+            Table: 4
+          }
+          suppapi.checkSupplierFileNew(fileType, this.$axios).then(res => {
+            if (res.data.code === 1) {
+              return resolve(true)
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+              return resolve(false)
+            }
+          })
+        })
+      },
       // 企业用户自行提交审批
       companySubmitToSecUnitSeparate () {
-        let checkRes = this.companySubmitToSecUnitParamsCheck
+        let checkRes = this.companySubmitToSecUnitParamsCheck()
         if (!checkRes) {
           return false
         }
         this.btnloading = true
-        // this.auditform.FirstAuditName = this.UnitOrg
-        // this.auditform.CertId = this.formData.Id
-        // this.auditform.TypeCode = '01'
-        let params = {
-          UnitId: this.UnitOrg,
-          AuditRemark: this.auditform.AuditRemark
-        }
-        api2.companyAuditEntity(this.formData.Id, params, this.$axios).then(res => {
-          if (res.data.code === 0) {
-            // 保存成功后,初始化数据,变成修改
-            this.getEntityById()
-            if (this.$refs['WfHistory']) {
-              this.$refs['WfHistory'].getHistoryTask()
+        this.checkFile().then(val => {
+          if (val) {
+            let params = {
+              UnitId: this.UnitOrg,
+              AuditRemark: this.auditform.AuditRemark
             }
-            this.dialogComSubmitToSeparateUnitVisible = false
-            this.$message({
-              type: 'success',
-              message: res.data.message
+            api2.companyAuditEntity(this.formData.Id, params, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                // 保存成功后,初始化数据,变成修改
+                this.getEntityById()
+                if (this.$refs['WfHistory']) {
+                  this.$refs['WfHistory'].getHistoryTask()
+                }
+                this.dialogComSubmitToSeparateUnitVisible = false
+                this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+              this.btnloading = false
+            }).catch(err => {
+              console.error(err)
             })
           } else {
-            this.$message({
-              type: 'warning',
-              message: res.data.message
-            })
+            this.btnloading = false
           }
-          this.btnloading = false
-        }).catch(err => {
-          console.error(err)
         })
       },
       companySubmitToSecUnitParamsCheck () {

+ 54 - 28
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/goodsdataopera.vue

@@ -3405,44 +3405,70 @@
         }
         return true
       },
+      // 检查资质文件
+      checkFile () {
+        return new Promise((resolve, reject) => {
+          let fileType = {
+            Type: this.supplierData.OperType === '制造商' ? 1 : 2,
+            SupplierId: this.formData.SupplierId,
+            CertId: this.formData.SupplierCertId.toString(),
+            Grade: this.Grade,
+            Table: 4
+          }
+          suppapi.checkSupplierFileNew(fileType, this.$axios).then(res => {
+            if (res.data.code === 1) {
+              return resolve(true)
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+              return resolve(false)
+            }
+          })
+        })
+      },
       // 企业用户自行提交审批
       companySubmitToSecUnitSeparate () {
-        this.saveinfochange(1)
-        let checkRes = this.companySubmitToSecUnitParamsCheck
+        // this.saveinfochange(1)
+        let checkRes = this.companySubmitToSecUnitParamsCheck()
         if (!checkRes) {
           return false
         }
         this.btnloading = true
-        // this.auditform.FirstAuditName = this.UnitOrg
-        // this.auditform.CertId = this.formData.Id
-        // this.auditform.TypeCode = '01'
-        let params = {
-          UnitId: this.UnitOrg,
-          AuditRemark: this.auditform.AuditRemark
-        }
-        console.log('提交增项申请的参数', params)
-        console.log('实际的增项申请id', this.dialogFormData.SupplierCertAppendId, this.formData.id)
-        api2.companyAuditEntity(this.formData.Id, params, this.$axios).then(res => {
-          if (res.data.code === 0) {
-            // 保存成功后,初始化数据,变成修改
-            this.getEntityById()
-            if (this.$refs['WfHistory']) {
-              this.$refs['WfHistory'].getHistoryTask()
+        this.checkFile().then(val => {
+          if (val) {
+            let params = {
+              UnitId: this.UnitOrg,
+              AuditRemark: this.auditform.AuditRemark
             }
-            this.dialogComSubmitToSeparateUnitVisible = false
-            this.$message({
-              type: 'success',
-              message: res.data.message
+            console.log('提交增项申请的参数', params)
+            console.log('实际的增项申请id', this.dialogFormData.SupplierCertAppendId, this.formData.id)
+            api2.companyAuditEntity(this.formData.Id, params, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                // 保存成功后,初始化数据,变成修改
+                this.getEntityById()
+                if (this.$refs['WfHistory']) {
+                  this.$refs['WfHistory'].getHistoryTask()
+                }
+                this.dialogComSubmitToSeparateUnitVisible = false
+                this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+              this.btnloading = false
+            }).catch(err => {
+              console.error(err)
             })
           } else {
-            this.$message({
-              type: 'warning',
-              message: res.data.message
-            })
+            this.btnloading = false
           }
-          this.btnloading = false
-        }).catch(err => {
-          console.error(err)
         })
       },
       companySubmitToSecUnitParamsCheck () {

+ 51 - 27
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/techdataopera.vue

@@ -2072,8 +2072,6 @@
                   if (valid) {
                     this.addInfoChangeItemCh(val)
                   }
-                }).catch(err => {
-                  console.error(err)
                 })
               }
             }).catch(err => {
@@ -2591,41 +2589,67 @@
         }
         return true
       },
+      // 检查资质文件
+      checkFile () {
+        return new Promise((resolve, reject) => {
+          let fileType = {
+            Type: this.supplierData.OperType === '制造商' ? 1 : 2,
+            SupplierId: this.formData.SupplierId,
+            CertId: this.formData.SupplierCertId.toString(),
+            Grade: this.Grade,
+            Table: 4
+          }
+          suppapi.checkSupplierFileNew(fileType, this.$axios).then(res => {
+            if (res.data.code === 1) {
+              return resolve(true)
+            } else {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+              return resolve(false)
+            }
+          })
+        })
+      },
       // 企业用户自行提交审批
       companySubmitToSecUnitSeparate () {
-        let checkRes = this.companySubmitToSecUnitParamsCheck
+        let checkRes = this.companySubmitToSecUnitParamsCheck()
         if (!checkRes) {
           return false
         }
         this.btnloading = true
-        // this.auditform.FirstAuditName = this.UnitOrg
-        // this.auditform.CertId = this.formData.Id
-        // this.auditform.TypeCode = '01'
-        let params = {
-          UnitId: this.UnitOrg,
-          AuditRemark: this.auditform.AuditRemark
-        }
-        api2.companyAuditEntity(this.formData.Id, params, this.$axios).then(res => {
-          if (res.data.code === 0) {
-            // 保存成功后,初始化数据,变成修改
-            this.getEntityById()
-            if (this.$refs['WfHistory']) {
-              this.$refs['WfHistory'].getHistoryTask()
+        this.checkFile().then(val => {
+          if (val) {
+            let params = {
+              UnitId: this.UnitOrg,
+              AuditRemark: this.auditform.AuditRemark
             }
-            this.dialogComSubmitToSeparateUnitVisible = false
-            this.$message({
-              type: 'success',
-              message: res.data.message
+            api2.companyAuditEntity(this.formData.Id, params, this.$axios).then(res => {
+              if (res.data.code === 0) {
+                // 保存成功后,初始化数据,变成修改
+                this.getEntityById()
+                if (this.$refs['WfHistory']) {
+                  this.$refs['WfHistory'].getHistoryTask()
+                }
+                this.dialogComSubmitToSeparateUnitVisible = false
+                this.$message({
+                  type: 'success',
+                  message: res.data.message
+                })
+              } else {
+                this.$message({
+                  type: 'warning',
+                  message: res.data.message
+                })
+              }
+              this.btnloading = false
+            }).catch(err => {
+              console.error(err)
             })
           } else {
-            this.$message({
-              type: 'warning',
-              message: res.data.message
-            })
+            this.btnloading = false
           }
-          this.btnloading = false
-        }).catch(err => {
-          console.error(err)
         })
       },
       companySubmitToSecUnitParamsCheck () {