Kaynağa Gözat

前:准入保存不检查资质,提交检查;准入审核入库去掉二次确认框

wd 4 yıl önce
ebeveyn
işleme
39bdcbd143

+ 1 - 1
src/dashoo.cn/frontend_web/src/pages/oilsupplier/infochangech/_opera/auditoperation.vue

@@ -1121,7 +1121,7 @@
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button size="mini" @click="dialogVisibleBack = false">取 消</el-button>
-        <el-button size="mini" type="primary" @click="backEntity" :loading="putLoading">确定</el-button>
+<!--        <el-button size="mini" type="primary" @click="backEntity" :loading="putLoading">确定</el-button>-->
       </span>
     </el-dialog>
     <el-dialog title="审核" :visible.sync="dialogCommonAuditMakeSureVisible">

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

@@ -58,7 +58,7 @@
             提交
           </el-button>
           <el-button v-if="parseInt(IsCompanyUser) !== 1 && formData.Status <= 0" type="primary" size="mini" style="float: right;margin-left: 25px" @click="commitAudit()">
-            提交审批
+            提交
           </el-button>
           <el-button v-if="parseInt(totalTab) >= 3 && formData.Status == 6" type="primary" size="mini" style="float: right;margin-left: 25px" @click="recallApplyClick()" :loading="recallApplyBtn">
             撤回
@@ -1364,7 +1364,7 @@ export default {
       let valid = true
       // this
       if (this.formDataCert.Status <= 0 && this.activeName === '0') {
-        valid = this.saveEntity()
+        valid = this.saveEntity(1)
       } else if (this.formDataCert.Status <= 0 && this.activeName === '1') {
         // valid = this.updateNumberEntity()
         // valid = true// 没办法中的办法
@@ -1530,72 +1530,79 @@ export default {
 
     // 保存信息
     saveEntity (val) {
-      let valid1 = false
-      let valid2 = false
-      this.$refs['BasisInfo'].$refs['EntityForm'].validate((valid) => {
-        valid1 = valid
-      })
-
-      this.$refs['BasisInfo'].$refs['EntityFormCert'].validate((valid) => {
-        valid2 = valid
-      })
+      return new Promise((resolve, reject) => {
+        let valid1 = false
+        let valid2 = false
+        this.$refs['BasisInfo'].$refs['EntityForm'].validate((valid) => {
+          valid1 = valid
+        })
 
-      if (valid1 && valid2) {
-        if (!this.formData.SetupTime) {
-          this.formData.SetupTime = null
-        } else {
-          this.formData.SetupTime = new Date(this.formData.SetupTime)
-        }
-        // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
-        this.formData.RegCapital = parseFloat(this.formData.RegCapital)
-        let isCompanyUser = ''
-        if (this.authUser.Profile.IsCompanyUser === 1) {
-          isCompanyUser = '1'
-        }
-        console.log(isCompanyUser, 'isCompanyUser')
-        api.signupCommercialNo(this.formData.CommercialNo, this.formData.Id, isCompanyUser, this.$axios).then(res => {
-          console.log(res, 'Item')
-          if (res.data.item) {
-            this.$message({
-                    duration: 10000,
-                    type: 'warning',
-              message: '该统一社会信用代码与其他公司重复'
-            })
+        this.$refs['BasisInfo'].$refs['EntityFormCert'].validate((valid) => {
+          valid2 = valid
+        })
+        if (valid1 && valid2) {
+          if (!this.formData.SetupTime) {
+            this.formData.SetupTime = null
           } else {
-            api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
-              // console.log(res, 'checkBack')
-              if (res.data.item) {
-                this.$message({
+            this.formData.SetupTime = new Date(this.formData.SetupTime)
+          }
+          // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
+          this.formData.RegCapital = parseFloat(this.formData.RegCapital)
+          let isCompanyUser = ''
+          if (this.authUser.Profile.IsCompanyUser === 1) {
+            isCompanyUser = '1'
+          }
+          api.signupCommercialNo(this.formData.CommercialNo, this.formData.Id, isCompanyUser, this.$axios).then(res => {
+            if (res.data.item) {
+              this.$message({
+                duration: 10000,
+                type: 'warning',
+                message: '该统一社会信用代码与其他公司重复'
+              })
+              return resolve(false)
+            } else {
+              api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
+                if (res.data.item) {
+                  this.$message({
                     duration: 10000,
                     type: 'warning',
-                  message: '该银行账号与其他公司重复'
-                })
-              } else {
-                if (!this.formData.Id || !this.certId) {
-                  if (val === 1) {
-                    this.addEntityNoInfo()
-                  } else {
-                    this.addEntity()
-                  }
+                    message: '该银行账号与其他公司重复'
+                  })
+                  return resolve(false)
                 } else {
-                  if (val === 1) {
-                    this.updateEntityNoInfo()
+                  if (!this.formData.Id || !this.certId) {
+                    if (val === 1) {
+                      this.addEntityNoInfo()
+                    } else {
+                      this.addEntity()
+                    }
                   } else {
-                    this.updateEntity()
+                    if (val === 1) {
+                      this.updateEntityNoInfo()
+                    } else {
+                      this.updateEntity()
+                    }
                   }
+                  return resolve(true)
                 }
-              }
-            }).catch(err => {
-              console.error(err)
-            })
-          }
-        }).catch(err => {
-          console.error(err)
-        })
-        return true
-      } else {
-        return false
-      }
+              }).catch(err => {
+                console.error(err)
+                return resolve(false)
+              })
+            }
+          }).catch(err => {
+            console.error(err)
+            return resolve(false)
+          })
+        } else {
+          this.$message({
+            duration: 10000,
+            type: 'warning',
+            message: '请完善企业基本信息!'
+          })
+          return resolve(false)
+        }
+      })
     },
 
     // 保存信息
@@ -1750,19 +1757,18 @@ export default {
             return false
           }
           this.formDataCert.InStyle = this.formData.InStyle
-          api.updateNumberEntity(this.formData.Id + '_' + this.certId, this.formDataCert, this.$axios).then(
-            res => {
-              if (res.data.code === 0) {
-                // 保存成功后,初始化数据,变成修改
-                this.initDatas()
-              } else {
-                this.$message({
+          api.updateNumberEntity(this.formData.Id + '_' + this.certId, this.formDataCert, this.$axios).then(res => {
+            if (res.data.code === 0) {
+              // 保存成功后,初始化数据,变成修改
+              this.initDatas()
+            } else {
+              this.$message({
                 duration: 10000,
                 type: 'warning',
                 message: res.data.message
               })
-              }
-            }).catch(err => {
+            }
+          }).catch(err => {
             console.error(err)
           })
         } else {
@@ -1796,23 +1802,7 @@ export default {
       this.chooseAuditorVisible = true
     },
     commitAudit () {
-      this.saveEntity(1)
-      this.updateNumberEntityNoInfo()
-      apiCert.checkSupplierCertCanSubmit(this.certId, this.$axios)
-        .then(res => {
-          if (res.data.code === 0) {
-            this.selectAuditOrg()
-          } else {
-            this.$message({
-                duration: 10000,
-                type: 'warning',
-                message: res.data.message
-              })
-          }
-        })
-        .catch(err => {
-          console.error(err)
-        })
+      this.selectAuditOrg()
     },
     setAuditer (val, name) {
       this.auditer = val
@@ -1897,110 +1887,133 @@ export default {
     secondaryUnitSubmitApply (val) {
       if (!this.auditer) {
         this.$message({
-                    duration: 10000,
-                    type: 'warning',
+          duration: 10000,
+          type: 'warning',
           message: '请选择审批人!'
         })
         return false
       }
       if (!this.fushenauditer) {
         this.$message({
-                    duration: 10000,
-                    type: 'warning',
+          duration: 10000,
+          type: 'warning',
           message: '请选择复审人!'
         })
         return false
       }
       if (!this.selectDept) {
         this.$message({
-                    duration: 10000,
-                    type: 'warning',
+          duration: 10000,
+          type: 'warning',
           message: '请选择专业处室!'
         })
         return false
       }
       if (!this.userOptions || this.userOptions.length === 0) {
         this.$message({
-                    duration: 10000,
-                    type: 'warning',
+          duration: 10000,
+          type: 'warning',
           message: '该专业科室未配置接收人!'
         })
         return false
       }
       this.loading = true
-      this.applyLoading = true
-      let params = {
-        'FirstAudit': this.auditer,
-        'SecondAudit': this.fushenauditer,
-        'ThirdAudit': this.selectDept, // this.majorDept[this.majorDept.length - 1] 专业处室部门id
-        'AuditRemark': this.auditform.AuditRemark
-      }
-      apiCert.unitAuditEntity(this.certId, params, this.$axios).then(res => {
-        if (res.data.code === 0) {
-          // 保存成功后,初始化数据,变成修改
-          this.initDatas()
-          if (this.$refs['WfHistory']) {
-            this.$refs['WfHistory'].getHistoryTask()
+      this.saveEntity(1).then(res => {
+        if (res) {
+          let params = {
+            'FirstAudit': this.auditer,
+            'SecondAudit': this.fushenauditer,
+            'ThirdAudit': this.selectDept, // this.majorDept[this.majorDept.length - 1] 专业处室部门id
+            'AuditRemark': this.auditform.AuditRemark
           }
-          this.dialogVisible = false
-          this.$message({
+          apiCert.unitAuditEntity(this.certId, params, this.$axios).then(res => {
+            if (res.data.code === 0) {
+              // 保存成功后,初始化数据,变成修改
+              this.initDatas()
+              if (this.$refs['WfHistory']) {
+                this.$refs['WfHistory'].getHistoryTask()
+              }
+              this.dialogVisible = false
+              this.$message({
                 duration: 10000,
                 type: 'success',
                 message: res.data.message
               })
-        } else {
-          this.$message({
+            } else {
+              this.$message({
                 duration: 10000,
                 type: 'warning',
                 message: res.data.message
               })
+            }
+            this.loading = false
+          }).catch(err => {
+            console.error(err)
+          })
+        } else {
+          this.loading = false
         }
-        this.applyLoading = false
-        this.loading = false
-      }).catch(err => {
-        console.error(err)
       })
     },
     companySubmitToSecUnitSeparateMakeSure () {
       if (this.orgauditOptions == null || this.orgauditOptions.length === 0) {
         this.$message({
-                    duration: 10000,
-                    type: 'warning',
+          duration: 10000,
+          type: 'warning',
           message: '该单位没有分办人员!'
         })
         return
       }
-      this.applyLoading = true
-      this.auditform.UnitId = this.UnitOrg
-      this.auditform.CertId = this.certId
       this.loading = true
-      console.log('企业用户提交参数', this.auditform)
-      apiCert.companyAuditEntity(this.certId, this.auditform, this.$axios)
-        .then(res => {
-          if (res.data.code === 0) {
-            // 保存成功后,初始化数据,变成修改
-            this.dialogVisibleCom = false
-            this.$message({
-                duration: 10000,
-                type: 'success',
-                message: res.data.message
+      this.saveEntity(1).then(res => {
+        if (res) {
+          this.updateNumberEntityNoInfo()
+          apiCert.checkSupplierCertCanSubmit(this.certId, this.$axios).then(res => {
+            if (res.data.code === 0) {
+              this.auditform.UnitId = this.UnitOrg
+              this.auditform.CertId = this.certId
+              console.log('企业用户提交参数', this.auditform)
+              apiCert.companyAuditEntity(this.certId, this.auditform, this.$axios).then(res => {
+                if (res.data.code === 0) {
+                  // 保存成功后,初始化数据,变成修改
+                  this.dialogVisibleCom = false
+                  this.$message({
+                    duration: 10000,
+                    type: 'success',
+                    message: res.data.message
+                  })
+                  this.initDatas()
+                  if (this.$refs['WfHistory']) {
+                    this.$refs['WfHistory'].getHistoryTask()
+                  }
+                } else {
+                  this.$message({
+                    duration: 10000,
+                    type: 'warning',
+                    message: res.data.message
+                  })
+                }
+                this.loading = false
+              }).catch(err => {
+                this.loading = false
+                console.error(err)
               })
-            this.initDatas()
-            if (this.$refs['WfHistory']) {
-                this.$refs['WfHistory'].getHistoryTask()
-              }
-          } else {
-            this.$message({
+            } else {
+              this.$message({
                 duration: 10000,
                 type: 'warning',
                 message: res.data.message
               })
-          }
+              this.loading = false
+            }
+          }).catch(err => {
+            this.loading = false
+            console.error(err)
+          })
+        } else {
           this.loading = false
-        })
-        .catch(err => {
-          console.error(err)
-        })
+        }
+      })
     },
     SubpEntity () {
       if (this.orgauditOptions == null || this.orgauditOptions.length === 0) {

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

@@ -57,7 +57,7 @@
             提交
           </el-button>
           <el-button v-if="parseInt(IsCompanyUser) !== 1 && parseInt(totalTab) >= 3 && formData.Status <= 0" type="primary" size="mini" style="float: right;margin-left: 25px" @click="commitAudit()">
-            提交审批
+            提交
           </el-button>
           <el-button v-if="parseInt(totalTab) >= 3 && formData.Status == 6" type="primary" size="mini" style="float: right;margin-left: 25px" @click="recallApplyClick()" :loading="recallApplyBtn">
             撤回
@@ -1642,107 +1642,107 @@ export default {
 
     // 保存信息
     saveEntity (val) {
-      // console.log('2221111')
-      let valid1 = false
-      let valid2 = false
-      this.$refs['GoodsInfo'].$refs['EntityForm'].validate((valid) => {
-        valid1 = valid
-      })
-
-      this.$refs['GoodsInfo'].$refs['EntityFormCert'].validate((valid) => {
-        valid2 = valid
-      })
-
-      if (this.formData.Grade == 1 && (this.formData.PACNumber == '' || typeof this.formData.PACNumber == 'undefined')) {
-        this.$message({
-                    duration: 10000,
-                    type: 'warning',
-          message: '中石油准入证编号不能为空!'
-        })
-        return
-      }
-      if (this.formData.InStyle === '3' && this.formData.MgrUnit.indexOf('大庆油田') != -1 && (this.formData.PACNumber == '' || typeof this.formData.PACNumber == 'undefined')) {
-        this.$message({
-                    duration: 10000,
-                    type: 'warning',
-          message: '中石油准入证编号不能为空!'
+      return new Promise((resolve, reject) => {
+        let valid1 = false
+        let valid2 = false
+        this.$refs['GoodsInfo'].$refs['EntityForm'].validate((valid) => {
+          valid1 = valid
         })
-        return
-      }
-      if (this.formData.InStyle === '3' && this.formData.MgrUnit === '大港油田分公司') {
-        this.$message({
-                    duration: 10000,
-                    type: 'warning',
-          message: '二级物资准入不能选择大港油田分公司!'
+
+        this.$refs['GoodsInfo'].$refs['EntityFormCert'].validate((valid) => {
+          valid2 = valid
         })
-        return
-      }
 
-      /** 2019.05.16 - 16 准入申请中,若选择了“管理单位”,“中石油准入证编号”应自动改为必填项 */
-      // if (this.formData.MgrUnit != null) {
-      //   if (this.formData.MgrUnit.length > 0 && !this.formData.PACNumber) {
-      //     valid1 = false
-      //     this.$message({
-      //       type: 'warning',
-      //       message: '【中石油准入证编号】不能为空'
-      //     })
-      //     return
-      //   }
-      // }
-      if (valid1 && valid2) {
-        if (!this.formData.SetupTime) {
-          this.formData.SetupTime = null
-        } else {
-          this.formData.SetupTime = new Date(this.formData.SetupTime)
+        if (this.formData.Grade == 1 && (this.formData.PACNumber == '' || typeof this.formData.PACNumber == 'undefined')) {
+          this.$message({
+            duration: 10000,
+            type: 'warning',
+            message: '中石油准入证编号不能为空!'
+          })
+          return resolve(false)
+        }
+        if (this.formData.InStyle === '3' && this.formData.MgrUnit.indexOf('大庆油田') != -1 && (this.formData.PACNumber == '' || typeof this.formData.PACNumber == 'undefined')) {
+          this.$message({
+            duration: 10000,
+            type: 'warning',
+            message: '中石油准入证编号不能为空!'
+          })
+          return resolve(false)
         }
-        // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
-        this.formData.RegCapital = parseFloat(this.formData.RegCapital)
-        let isCompanyUser = ''
-        if (this.authUser.Profile.IsCompanyUser === 1) {
-          isCompanyUser = '1'
+        if (this.formData.InStyle === '3' && this.formData.MgrUnit === '大港油田分公司') {
+          this.$message({
+            duration: 10000,
+            type: 'warning',
+            message: '二级物资准入不能选择大港油田分公司!'
+          })
+          return resolve(false)
         }
-        // console.log(isCompanyUser, 'isCompanyUser')
-        api.signupCommercialNo(this.formData.CommercialNo, this.formData.Id, isCompanyUser, this.$axios).then(res => {
-          // console.log(res, 'Item')
-          if (res.data.item) {
-            this.$message({
-                    duration: 10000,
-                    type: 'warning',
-              message: '该统一社会信用代码与其他公司重复'
-            })
+
+        if (valid1 && valid2) {
+          if (!this.formData.SetupTime) {
+            this.formData.SetupTime = null
           } else {
-            api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
-              // console.log(res, 'checkBack')
-              if (res.data.item) {
-                this.$message({
+            this.formData.SetupTime = new Date(this.formData.SetupTime)
+          }
+          // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
+          this.formData.RegCapital = parseFloat(this.formData.RegCapital)
+          let isCompanyUser = ''
+          if (this.authUser.Profile.IsCompanyUser === 1) {
+            isCompanyUser = '1'
+          }
+          api.signupCommercialNo(this.formData.CommercialNo, this.formData.Id, isCompanyUser, this.$axios).then(res => {
+            if (res.data.item) {
+              this.$message({
+                duration: 10000,
+                type: 'warning',
+                message: '该统一社会信用代码与其他公司重复'
+              })
+              return resolve(false)
+            } else {
+              api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
+                // console.log(res, 'checkBack')
+                if (res.data.item) {
+                  this.$message({
                     duration: 10000,
                     type: 'warning',
-                  message: '该银行账号与其他公司重复'
-                })
-              } else {
-                if (!this.formData.Id || !this.certId) {
-                  if (val === 1) {
-                    this.addEntityNoInfo()
-                  } else {
-                    this.addEntity()
-                  }
+                    message: '该银行账号与其他公司重复'
+                  })
+                  return resolve(false)
                 } else {
-                  if (val === 1) {
-                    this.updateEntityNoInfo()
+                  if (!this.formData.Id || !this.certId) {
+                    if (val === 1) {
+                      this.addEntityNoInfo()
+                    } else {
+                      this.addEntity()
+                    }
                   } else {
-                    this.updateEntity()
+                    if (val === 1) {
+                      this.updateEntityNoInfo()
+                    } else {
+                      this.updateEntity()
+                    }
                   }
+                  return resolve(true)
                 }
-              }
-            }).catch(err => {
-              console.error(err)
-            })
-          }
-        }).catch(err => {
-          console.error(err)
-        })
-        return true
-      }
+              }).catch(err => {
+                console.error(err)
+                return resolve(false)
+              })
+            }
+          }).catch(err => {
+            console.error(err)
+            return resolve(false)
+          })
+          return true
+        } else {
+          this.$message({
+            duration: 10000,
+            type: 'warning',
+            message: '请完善企业基本信息!'
+          })
+          return resolve(false)
+        }
+      })
     },
 
     // 保存信息
@@ -1997,23 +1997,7 @@ export default {
           return false
         }
       }
-      this.saveEntity(1)
-      this.updateNumberEntityNoInfo()
-      apiCert.checkSupplierCertCanSubmit(this.formData.CertId, this.$axios)
-        .then(res => {
-          if (res.data.code === 0) {
-            this.selectAuditOrg()
-          } else {
-            this.$message({
-                duration: 10000,
-                type: 'warning',
-                message: res.data.message
-              })
-          }
-        })
-        .catch(err => {
-          console.error(err)
-        })
+      this.selectAuditOrg()
     },
     checkSubFile () {
       let _this = this
@@ -2198,110 +2182,132 @@ export default {
     secondaryUnitSubmitApply (val) {
       if (!this.auditer) {
         this.$message({
-                    duration: 10000,
-                    type: 'warning',
+          duration: 10000,
+          type: 'warning',
           message: '请选择审批人!'
         })
         return false
       }
       if (!this.fushenauditer) {
         this.$message({
-                    duration: 10000,
-                    type: 'warning',
+          duration: 10000,
+          type: 'warning',
           message: '请选择复审人!'
         })
         return false
       }
       if (!this.selectDept) {
         this.$message({
-                    duration: 10000,
-                    type: 'warning',
+          duration: 10000,
+          type: 'warning',
           message: '请选择专业处室!'
         })
         return false
       }
       if (!this.userOptions || this.userOptions.length === 0) {
         this.$message({
-                    duration: 10000,
-                    type: 'warning',
+          duration: 10000,
+          type: 'warning',
           message: '该专业科室未配置接收人!'
         })
         return false
       }
       this.loading = true
-      this.applyLoading = true
-      let params = {
-        'FirstAudit': this.auditer,
-        'SecondAudit': this.fushenauditer,
-        'ThirdAudit': this.selectDept, // this.majorDept[this.majorDept.length - 1] 专业处室部门id
-        'AuditRemark': this.auditform.AuditRemark
-      }
-      apiCert.unitAuditEntity(this.certId, params, this.$axios).then(res => {
-        if (res.data.code === 0) {
-          // 保存成功后,初始化数据,变成修改
-          this.initDatas()
-          if (this.$refs['WfHistory']) {
-            this.$refs['WfHistory'].getHistoryTask()
+      this.saveEntity(1).then(res => {
+        if (res) {
+          let params = {
+            'FirstAudit': this.auditer,
+            'SecondAudit': this.fushenauditer,
+            'ThirdAudit': this.selectDept, // this.majorDept[this.majorDept.length - 1] 专业处室部门id
+            'AuditRemark': this.auditform.AuditRemark
           }
-          this.dialogVisible = false
-          this.$message({
+          apiCert.unitAuditEntity(this.certId, params, this.$axios).then(res => {
+            if (res.data.code === 0) {
+              // 保存成功后,初始化数据,变成修改
+              this.initDatas()
+              if (this.$refs['WfHistory']) {
+                this.$refs['WfHistory'].getHistoryTask()
+              }
+              this.dialogVisible = false
+              this.$message({
                 duration: 10000,
                 type: 'success',
                 message: res.data.message
               })
-        } else {
-          this.$message({
+            } else {
+              this.$message({
                 duration: 10000,
                 type: 'warning',
                 message: res.data.message
               })
+            }
+            this.loading = false
+          }).catch(err => {
+            console.error(err)
+          })
+        } else {
+          this.loading = false
         }
-        this.applyLoading = false
-        this.loading = false
-      }).catch(err => {
-        console.error(err)
       })
     },
     companySubmitToSecUnitSeparateMakeSure () {
       if (this.orgauditOptions == null || this.orgauditOptions.length === 0) {
         this.$message({
-                    duration: 10000,
-                    type: 'warning',
+          duration: 10000,
+          type: 'warning',
           message: '该单位没有分办人员!'
         })
         return
       }
-      this.applyLoading = true
-      this.auditform.UnitId = this.UnitOrg
-      this.auditform.CertId = this.certId
       this.loading = true
-      // console.log('企业用户提交参数', this.auditform)
-      apiCert.companyAuditEntity(this.certId, this.auditform, this.$axios)
-        .then(res => {
-          if (res.data.code === 0) {
-            // 保存成功后,初始化数据,变成修改
-            this.dialogVisibleCom = false
-            this.$message({
-                duration: 10000,
-                type: 'success',
-                message: res.data.message
+      this.saveEntity(1).then(res => {
+        if (res) {
+          this.updateNumberEntityNoInfo()
+          apiCert.checkSupplierCertCanSubmit(this.formData.CertId, this.$axios).then(res => {
+            if (res.data.code === 0) {
+              this.auditform.UnitId = this.UnitOrg
+              this.auditform.CertId = this.certId
+              apiCert.companyAuditEntity(this.certId, this.auditform, this.$axios).then(res => {
+                if (res.data.code === 0) {
+                  // 保存成功后,初始化数据,变成修改
+                  this.dialogVisibleCom = false
+                  this.$message({
+                    duration: 10000,
+                    type: 'success',
+                    message: res.data.message
+                  })
+                  this.initDatas()
+                  if (this.$refs['WfHistory']) {
+                    this.$refs['WfHistory'].getHistoryTask()
+                  }
+                } else {
+                  this.$message({
+                    duration: 10000,
+                    type: 'warning',
+                    message: res.data.message
+                  })
+                }
+                this.loading = false
+              }).catch(err => {
+                this.loading = false
+                console.error(err)
               })
-            this.initDatas()
-            if (this.$refs['WfHistory']) {
-              this.$refs['WfHistory'].getHistoryTask()
-            }
-          } else {
-            this.$message({
+            } else {
+              this.$message({
                 duration: 10000,
                 type: 'warning',
                 message: res.data.message
               })
-          }
+              this.loading = false
+            }
+          }).catch(err => {
+            this.loading = false
+            console.error(err)
+          })
+        } else {
           this.loading = false
-        })
-        .catch(err => {
-          console.error(err)
-        })
+        }
+      })
     },
     SubpEntity () {
       if (this.orgauditOptions == null || this.orgauditOptions.length === 0) {

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

@@ -1550,73 +1550,82 @@ export default {
 
     // 保存信息
     saveEntity (val) {
-      let valid1 = false
-      let valid2 = false
+      return new Promise((resolve, reject) => {
+        let valid1 = false
+        let valid2 = false
 
-      this.$refs['TechInfo'].$refs['EntityForm'].validate((valid) => {
-        valid1 = valid
-      })
+        this.$refs['TechInfo'].$refs['EntityForm'].validate((valid) => {
+          valid1 = valid
+        })
 
-      this.$refs['TechInfo'].$refs['EntityFormCert'].validate(valid => {
-        valid2 = valid
-      })
+        this.$refs['TechInfo'].$refs['EntityFormCert'].validate(valid => {
+          valid2 = valid
+        })
 
-      if (valid1 && valid2) {
-        if (!this.formData.SetupTime) {
-          this.formData.SetupTime = null
-        } else {
-          this.formData.SetupTime = new Date(this.formData.SetupTime)
-        }
-        // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
-        this.formData.RegCapital = parseFloat(this.formData.RegCapital)
-        let isCompanyUser = ''
-        if (this.authUser.Profile.IsCompanyUser === 1) {
-          isCompanyUser = '1'
-        }
-        console.log(isCompanyUser, 'isCompanyUser')
-        api.signupCommercialNo(this.formData.CommercialNo, this.formData.Id, isCompanyUser, this.$axios).then(res => {
-          console.log(res, 'Item')
-          if (res.data.item) {
-            this.$message({
-                    duration: 10000,
-                    type: 'warning',
-              message: '该统一社会信用代码与其他公司重复'
-            })
+        if (valid1 && valid2) {
+          if (!this.formData.SetupTime) {
+            this.formData.SetupTime = null
           } else {
-            api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
-              // console.log(res, 'checkBack')
-              if (res.data.item) {
-                this.$message({
+            this.formData.SetupTime = new Date(this.formData.SetupTime)
+          }
+          // this.formData.WellNo = this.$refs.selectWellNo.selectedLabel + '';
+          this.formData.RegCapital = parseFloat(this.formData.RegCapital)
+          let isCompanyUser = ''
+          if (this.authUser.Profile.IsCompanyUser === 1) {
+            isCompanyUser = '1'
+          }
+          api.signupCommercialNo(this.formData.CommercialNo, this.formData.Id, isCompanyUser, this.$axios).then(res => {
+            console.log(res, 'Item')
+            if (res.data.item) {
+              this.$message({
+                duration: 10000,
+                type: 'warning',
+                message: '该统一社会信用代码与其他公司重复'
+              })
+              return resolve(false)
+            } else {
+              api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
+                // console.log(res, 'checkBack')
+                if (res.data.item) {
+                  this.$message({
                     duration: 10000,
                     type: 'warning',
-                  message: '该银行账号与其他公司重复'
-                })
-              } else {
-                if (!this.formData.Id || !this.certId) {
-                  if (val === 1) {
-                    this.addEntityNoInfo()
-                  } else {
-                    this.addEntity()
-                  }
+                    message: '该银行账号与其他公司重复'
+                  })
                 } else {
-                  if (val === 1) {
-                    this.updateEntityNoInfo()
+                  if (!this.formData.Id || !this.certId) {
+                    if (val === 1) {
+                      this.addEntityNoInfo()
+                    } else {
+                      this.addEntity()
+                    }
                   } else {
-                    this.updateEntity()
+                    if (val === 1) {
+                      this.updateEntityNoInfo()
+                    } else {
+                      this.updateEntity()
+                    }
                   }
+                  return resolve(true)
                 }
-              }
-            }).catch(err => {
-              console.error(err)
-            })
-          }
-        }).catch(err => {
-          console.error(err)
-        })
-        return true
-      } else {
-        return false
-      }
+              }).catch(err => {
+                console.error(err)
+                return resolve(false)
+              })
+            }
+          }).catch(err => {
+            console.error(err)
+            return resolve(false)
+          })
+        } else {
+          this.$message({
+            duration: 10000,
+            type: 'warning',
+            message: '请完善企业基本信息!'
+          })
+          return resolve(false)
+        }
+      })
     },
 
     // 保存信息
@@ -1831,12 +1840,6 @@ export default {
         }).catch(err => {
           console.error(err)
         })
-      } else {
-        this.$message({
-          duration: 10000,
-          type: 'warning',
-          message: '请完善企业基本信息'
-        })
       }
       // this.updateNumberEntityNoInfo()
     },
@@ -1971,108 +1974,130 @@ export default {
     secondaryUnitSubmitApply (val) {
       if (!this.auditer) {
         this.$message({
-                    duration: 10000,
-                    type: 'warning',
+          duration: 10000,
+          type: 'warning',
           message: '请选择审批人!'
         })
         return false
       }
       if (!this.fushenauditer) {
         this.$message({
-                    duration: 10000,
-                    type: 'warning',
+          duration: 10000,
+          type: 'warning',
           message: '请选择复审人!'
         })
         return false
       }
       if (!this.selectDept) {
         this.$message({
-                    duration: 10000,
-                    type: 'warning',
+          duration: 10000,
+          type: 'warning',
           message: '请选择专业处室!'
         })
         return false
       }
       if (!this.userOptions || this.userOptions.length === 0) {
         this.$message({
-                    duration: 10000,
-                    type: 'warning',
+          duration: 10000,
+          type: 'warning',
           message: '该专业科室未配置接收人!'
         })
         return false
       }
       this.loading = true
-      this.applyLoading = true
-      let params = {
-        'FirstAudit': this.auditer,
-        'SecondAudit': this.fushenauditer,
-        'ThirdAudit': this.selectDept, // this.majorDept[this.majorDept.length - 1] 专业处室部门id
-        'AuditRemark': this.auditform.AuditRemark
-      }
-      apiCert.unitAuditEntity(this.certId, params, this.$axios).then(res => {
-        if (res.data.code === 0) {
-          // 保存成功后,初始化数据,变成修改
-          this.initDatas()
-          this.dialogVisible = false
-          this.$message({
+      this.saveEntity(1).then(res => {
+        if (res) {
+          let params = {
+            'FirstAudit': this.auditer,
+            'SecondAudit': this.fushenauditer,
+            'ThirdAudit': this.selectDept, // this.majorDept[this.majorDept.length - 1] 专业处室部门id
+            'AuditRemark': this.auditform.AuditRemark
+          }
+          apiCert.unitAuditEntity(this.certId, params, this.$axios).then(res => {
+            if (res.data.code === 0) {
+              // 保存成功后,初始化数据,变成修改
+              this.initDatas()
+              this.dialogVisible = false
+              this.$message({
                 duration: 10000,
                 type: 'success',
                 message: res.data.message
               })
-        } else {
-          this.$message({
+            } else {
+              this.$message({
                 duration: 10000,
                 type: 'warning',
                 message: res.data.message
               })
+            }
+            this.loading = false
+          }).catch(err => {
+            console.error(err)
+          })
+        } else {
+          this.loading = false
         }
-        this.applyLoading = false
-        this.loading = false
-      }).catch(err => {
-        console.error(err)
       })
     },
     companySubmitToSecUnitSeparateMakeSure () {
       if (this.orgauditOptions == null || this.orgauditOptions.length === 0) {
         this.$message({
-                    duration: 10000,
-                    type: 'warning',
+          duration: 10000,
+          type: 'warning',
           message: '该单位没有分办人员!'
         })
         return
       }
-      this.applyLoading = true
-      this.auditform.UnitId = this.UnitOrg
-      this.auditform.CertId = this.certId
       this.loading = true
-      console.log('企业用户提交参数', this.auditform)
-      let _this = this
-      apiCert.companyAuditEntity(this.certId, this.auditform, this.$axios)
-        .then(res => {
-          if (res.data.code === 0) {
-            // 保存成功后,初始化数据,变成修改
-            _this.initDatas()
-            if (_this.$refs['WfHistory']) {
-              _this.$refs['WfHistory'].getHistoryTask()
-            }
-            _this.dialogVisibleCom = false
-            this.$message({
-                duration: 10000,
-                type: 'success',
-                message: res.data.message
+      this.saveEntity(1).then(res => {
+        if (res) {
+          this.updateNumberEntityNoInfo()
+          apiCert.checkSupplierCertCanSubmit(this.certId, this.$axios).then(res => {
+            if (res.data.code === 0) {
+              this.auditform.UnitId = this.UnitOrg
+              this.auditform.CertId = this.certId
+              let _this = this
+              apiCert.companyAuditEntity(this.certId, this.auditform, this.$axios).then(res => {
+                if (res.data.code === 0) {
+                  // 保存成功后,初始化数据,变成修改
+                  _this.initDatas()
+                  if (_this.$refs['WfHistory']) {
+                    _this.$refs['WfHistory'].getHistoryTask()
+                  }
+                  _this.dialogVisibleCom = false
+                  this.$message({
+                    duration: 10000,
+                    type: 'success',
+                    message: res.data.message
+                  })
+                } else {
+                  this.$message({
+                    duration: 10000,
+                    type: 'warning',
+                    message: res.data.message
+                  })
+                }
+                this.loading = false
+              }).catch(err => {
+                this.loading = false
+                console.error(err)
               })
-          } else {
-            this.$message({
+            } else {
+              this.$message({
                 duration: 10000,
                 type: 'warning',
                 message: res.data.message
               })
-          }
+              this.loading = false
+            }
+          }).catch(err => {
+            this.loading = false
+            console.error(err)
+          })
+        } else {
           this.loading = false
-        })
-        .catch(err => {
-          console.error(err)
-        })
+        }
+      })
     },
     // 交费环节发现错误 撤回
     recallApplyClick () {

+ 34 - 39
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstorage/_opera/basisedit.vue

@@ -255,8 +255,7 @@
         <el-row>
           <el-col :span="24">
             <el-form-item label="退回原因">
-              <el-input v-model="backRemark" type="textarea">
-              </el-input>
+              <el-input v-model="backRemark" type="textarea" placeholder="请输入退回原因,不少于2个字!"></el-input>
             </el-form-item>
           </el-col>
         </el-row>
@@ -509,6 +508,14 @@
     },
     methods: {
       backEntity () {
+        if (this.backRemark.length <= 2) {
+          this.$message({
+            duration: 10000,
+            type: 'warning',
+            message: '请输入退回原因,不少于2个字!'
+          })
+          return
+        }
         let params = {
           result: '0',
           BackRemark: this.backRemark,
@@ -582,53 +589,41 @@
       confirm () {
         if (this.formData.JSAccessCardNo === '') {
           this.$message({
-                    duration: 10000,
-                    type: 'warning',
+            duration: 10000,
+            type: 'warning',
             message: '准入证编码不能为空!'
           })
           return
         }
         this.btnLoading = true
-        this.$confirm('确认提交入库', '提示', {
-          confirmButtonText: '确认',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          let params = {
-            result: '1',
-            AccessCardNo: this.formData.JSAccessCardNo, // 基建类准入编码 确认入库时 自动更新准入编码
-            SupplierId: this.formData.Id
+        let params = {
+          result: '1',
+          AccessCardNo: this.formData.JSAccessCardNo, // 基建类准入编码 确认入库时 自动更新准入编码
+          SupplierId: this.formData.Id
+        }
+        apiCert.updateIsStorage(this.certId, params, this.$axios).then(res => {
+          this.initDatas()
+          if (this.$refs['WfHistory']) {
+            this.$refs['WfHistory'].getHistoryTask()
           }
-          apiCert.updateIsStorage(this.certId, params, this.$axios).then(res => {
-            this.initDatas()
-            if (this.$refs['WfHistory']) {
-              this.$refs['WfHistory'].getHistoryTask()
-            }
-            if (res.data.code === 0) {
-              this.$message({
-                duration: 10000,
-                type: 'success',
-                message: res.data.message
-              })
-              this.btnLoading = false
-              if (this.is_todo === '1') {
-                this.$router.push('/')
-              }
-            } else {
-              this.$message({
-                duration: 10000,
-                type: 'warning',
-                message: res.data.message
-              })
-              this.btnLoading = false
+          if (res.data.code === 0) {
+            this.$message({
+              duration: 10000,
+              type: 'success',
+              message: res.data.message
+            })
+            this.btnLoading = false
+            if (this.is_todo === '1') {
+              this.$router.push('/')
             }
-          }).catch(() => {
+          } else {
             this.$message({
-              type: 'info',
-              message: '已取消'
+              duration: 10000,
+              type: 'warning',
+              message: res.data.message
             })
             this.btnLoading = false
-          })
+          }
         }).catch(() => {
           this.$message({
             type: 'info',

+ 40 - 45
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstorage/_opera/goodsedit.vue

@@ -256,8 +256,7 @@
         <el-row>
           <el-col :span="24">
             <el-form-item label="退回原因">
-              <el-input v-model="backRemark" type="textarea">
-              </el-input>
+              <el-input v-model="backRemark" type="textarea" placeholder="请输入退回原因,不少于2个字!"></el-input>
             </el-form-item>
           </el-col>
         </el-row>
@@ -512,6 +511,14 @@
     },
     methods: {
       backEntity () {
+        if (this.backRemark.length <= 2) {
+          this.$message({
+            duration: 10000,
+            type: 'warning',
+            message: '请输入退回原因,不少于2个字!'
+          })
+          return
+        }
         let params = {
           result: '0',
           BackRemark: this.backRemark,
@@ -585,55 +592,43 @@
       confirm () {
         if (this.formData.WZAccessCardNo === '') {
           this.$message({
-                    duration: 10000,
-                    type: 'warning',
+            duration: 10000,
+            type: 'warning',
             message: '准入证编码不能为空!'
           })
           return
         }
         this.btnLoading = true
-        this.$confirm('确认提交入库', '提示', {
-          confirmButtonText: '确认',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          let params = {
-            result: '1',
-            AccessCardNo: this.formData.WZAccessCardNo, // 物资类准入编码 确认入库时 自动更新准入编码
-            SupplierId: this.formData.Id
-          }
-          let _this = this
-          apiCert.updateIsStorage(this.certId, params, this.$axios).then(res => {
-            // 准入申请更新入库
-            if (res.data.code === 0) {
-              this.initDatas()
-              if (_this.$refs['WfHistory']) {
-                _this.$refs['WfHistory'].getHistoryTask()
-              }
-              this.$message({
-                duration: 10000,
-                type: 'success',
-                message: res.data.message
-              })
-              this.btnLoading = false
-              if (this.is_todo === '1') {
-                this.$router.push('/')
-              }
-            } else {
-              this.$message({
-                duration: 10000,
-                type: 'warning',
-                message: res.data.message
-              })
-              this.btnLoading = false
+        let params = {
+          result: '1',
+          AccessCardNo: this.formData.WZAccessCardNo, // 物资类准入编码 确认入库时 自动更新准入编码
+          SupplierId: this.formData.Id
+        }
+        let _this = this
+        apiCert.updateIsStorage(this.certId, params, this.$axios).then(res => {
+          // 准入申请更新入库
+          if (res.data.code === 0) {
+            this.initDatas()
+            if (_this.$refs['WfHistory']) {
+              _this.$refs['WfHistory'].getHistoryTask()
             }
-          })
-        }).catch(() => {
-          this.$message({
-            type: 'info',
-            message: '已取消'
-          })
-          this.btnLoading = false
+            this.$message({
+              duration: 10000,
+              type: 'success',
+              message: res.data.message
+            })
+            this.btnLoading = false
+            if (this.is_todo === '1') {
+              this.$router.push('/')
+            }
+          } else {
+            this.$message({
+              duration: 10000,
+              type: 'warning',
+              message: res.data.message
+            })
+            this.btnLoading = false
+          }
         })
       },
       inputCompany (val) {

+ 34 - 38
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierstorage/_opera/techedit.vue

@@ -263,7 +263,7 @@
         <el-row>
           <el-col :span="24">
             <el-form-item label="退回原因">
-              <el-input v-model="backRemark" type="textarea">
+              <el-input v-model="backRemark" type="textarea" placeholder="请输入退回原因,不少于2个字!">
               </el-input>
             </el-form-item>
           </el-col>
@@ -518,6 +518,14 @@
     },
     methods: {
       backEntity () {
+        if (this.backRemark.length <= 2) {
+          this.$message({
+            duration: 10000,
+            type: 'warning',
+            message: '请输入退回原因,不少于2个字!'
+          })
+          return
+        }
         let params = {
           result: '0',
           BackRemark: this.backRemark,
@@ -598,52 +606,40 @@
           return
         }
         this.btnLoading = true
-        this.$confirm('确认提交入库', '提示', {
-          confirmButtonText: '确认',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          let params = {
-            result: '1',
-            AccessCardNo: this.formData.JFAccessCardNo, // 服务类准入编码 确认入库时 自动更新准入编码
-            SupplierId: this.formData.Id
-          }
-          apiCert.updateIsStorage(this.certId, params, this.$axios).then(res => {
-            if (res.data.code === 0) {
-              this.initDatas()
-              if (this.$refs['WfHistory']) {
-                this.$refs['WfHistory'].getHistoryTask()
-              }
-              this.$message({
-                duration: 10000,
-                type: 'success',
-                message: res.data.message
-              })
-              this.btnLoading = false
-              if (this.is_todo === '1') {
-                this.$router.push('/')
-              }
-            } else {
-              this.$message({
-                duration: 10000,
-                type: 'warning',
-                message: res.data.message
-              })
-              this.btnLoading = false
+        let params = {
+          result: '1',
+          AccessCardNo: this.formData.JFAccessCardNo, // 服务类准入编码 确认入库时 自动更新准入编码
+          SupplierId: this.formData.Id
+        }
+        apiCert.updateIsStorage(this.certId, params, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            this.initDatas()
+            if (this.$refs['WfHistory']) {
+              this.$refs['WfHistory'].getHistoryTask()
             }
-          }).catch(() => {
             this.$message({
-              type: 'info',
-              message: '已取消'
+              duration: 10000,
+              type: 'success',
+              message: res.data.message
             })
             this.btnLoading = false
-          })
+            if (this.is_todo === '1') {
+              this.$router.push('/')
+            }
+          } else {
+            this.$message({
+              duration: 10000,
+              type: 'warning',
+              message: res.data.message
+            })
+            this.btnLoading = false
+          }
         }).catch(() => {
-          this.btnLoading = false
           this.$message({
             type: 'info',
             message: '已取消'
           })
+          this.btnLoading = false
         })
       },
       inputCompany (val) {