Browse Source

前:银行账号重复判断

dubch 5 năm trước cách đây
mục cha
commit
97b28d44b8

+ 6 - 0
src/dashoo.cn/frontend_web/src/api/oilsupplier/supplier.js

@@ -199,5 +199,11 @@ export default {
       url: 'register/getcommercialno?commercialno=' + commercialNo + '&supId=' + supId,
       method: 'GET'
     })
+  },
+  checkBack (bankAccount, supId, myAxios) {
+    return myAxios({
+      url: '/supplier/getBankAccount?bankAccount=' + bankAccount + '&supId=' + supId,
+      method: 'GET'
+    })
   }
 }

+ 0 - 12
src/dashoo.cn/frontend_web/src/components/oilsupplier/basisinfo.vue

@@ -551,18 +551,6 @@
           if (value.length < 12) {
             callback(new Error('请填写正确位数的银行账号'))
           } else {
-            this.$axios.get('/supplier/getBankAccount?bankAccount=' + value + '&supId=' + this.formData.Id, {})
-              .then(res => {
-                if (res.data.item) {
-                  callback(new Error('该银行账号与其他公司重复'))
-                } else {
-                  callback()
-                }
-              })
-              .catch(err => {
-                console.error(err)
-                callback()
-              })
             callback()
           }
         }

+ 0 - 12
src/dashoo.cn/frontend_web/src/components/oilsupplier/goodsinfo.vue

@@ -951,18 +951,6 @@ export default {
         if (value.length < 12) {
           callback(new Error('请填写正确位数的银行账号'))
         } else {
-          this.$axios.get('/supplier/getBankAccount?bankAccount=' + value + '&supId=' + this.formData.Id, {})
-            .then(res => {
-              if (res.data.item) {
-                callback(new Error('该银行账号与其他公司重复'))
-              } else {
-                callback()
-              }
-            })
-            .catch(err => {
-              console.error(err)
-              callback()
-            })
           callback()
         }
       }

+ 0 - 12
src/dashoo.cn/frontend_web/src/components/oilsupplier/techinfo.vue

@@ -548,18 +548,6 @@
           if (value.length < 12) {
             callback(new Error('请填写正确位数的银行账号'))
           } else {
-            this.$axios.get('/supplier/getBankAccount?bankAccount=' + value + '&supId=' + this.formData.Id, {})
-              .then(res => {
-                if (res.data.item) {
-                  callback(new Error('该银行账号与其他公司重复'))
-                } else {
-                  callback()
-                }
-              })
-              .catch(err => {
-                console.error(err)
-                callback()
-              })
             callback()
           }
         }

+ 31 - 18
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/bassicoperation.vue

@@ -2954,26 +2954,14 @@ import apiCert from '@/api/oilsupplier/suppliercert'
           valid2 = valid
         })
         if (valid1 && valid2) {
-          let AllInfochangeItemList = {
-            SupplierId: this.formData.Id + '',
-            MInfoId: this.annualId,
-            InfochangeForm: this.infochangeItemList
-          }
-          annualapi.addInfoChangeItemCh(AllInfochangeItemList, this.$axios).then(res => {
-            if (res.data.code === 0) {
-              // 保存成功后,初始化数据,变成修改
-              this.initDatas()
-              if (val !== 1) {
-                this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-              }
-            } else {
+          api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
+            if (res.data.item) {
               this.$message({
                 type: 'warning',
-                message: res.data.message
+                message: '该银行账号与其他公司重复'
               })
+            } else {
+              this.addInfoChangeItemCh(val)
             }
           }).catch(err => {
             console.error(err)
@@ -2983,7 +2971,32 @@ import apiCert from '@/api/oilsupplier/suppliercert'
           return false
         }
       },
-
+      addInfoChangeItemCh (val) {
+        let AllInfochangeItemList = {
+          SupplierId: this.formData.Id + '',
+          MInfoId: this.annualId,
+          InfochangeForm: this.infochangeItemList
+        }
+        annualapi.addInfoChangeItemCh(AllInfochangeItemList, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            // 保存成功后,初始化数据,变成修改
+            this.initDatas()
+            if (val !== 1) {
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+            }
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       CheckCompanyBase () {
         if (!this.formData.Id) {
           this.$message({

+ 31 - 18
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/goodsoperation.vue

@@ -2844,26 +2844,14 @@
           valid2 = valid
         })
         if (valid1 && valid2) {
-          let AllInfochangeItemList = {
-            SupplierId: this.formData.Id + '',
-            MInfoId: this.annualId,
-            InfochangeForm: this.infochangeItemList
-          }
-          annualapi.addInfoChangeItemCh(AllInfochangeItemList, this.$axios).then(res => {
-            if (res.data.code === 0) {
-              // 保存成功后,初始化数据,变成修改
-              this.initDatas()
-              if (val !== 1) {
-                this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-              }
-            } else {
+          api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
+            if (res.data.item) {
               this.$message({
                 type: 'warning',
-                message: res.data.message
+                message: '该银行账号与其他公司重复'
               })
+            } else {
+              this.addInfoChangeItemCh(val)
             }
           }).catch(err => {
             console.error(err)
@@ -2873,7 +2861,32 @@
           return false
         }
       },
-
+      addInfoChangeItemCh (val) {
+        let AllInfochangeItemList = {
+          SupplierId: this.formData.Id + '',
+          MInfoId: this.annualId,
+          InfochangeForm: this.infochangeItemList
+        }
+        annualapi.addInfoChangeItemCh(AllInfochangeItemList, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            // 保存成功后,初始化数据,变成修改
+            this.initDatas()
+            if (val !== 1) {
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+            }
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       updateEntity () {
         annualapi.supupdateEntity(this.formData.Id, this.formData, this.$axios).then(res => {
           if (res.data.code === 0) {

+ 31 - 18
src/dashoo.cn/frontend_web/src/pages/oilsupplier/annualaudit/_opera/operation.vue

@@ -2923,26 +2923,14 @@ import Viewer from 'v-viewer'
           valid2 = valid
         })
         if (valid1 && valid2) {
-          let AllInfochangeItemList = {
-            SupplierId: this.formData.Id + '',
-            MInfoId: this.annualId,
-            InfochangeForm: this.infochangeItemList
-          }
-          annualapi.addInfoChangeItemCh(AllInfochangeItemList, this.$axios).then(res => {
-            if (res.data.code === 0) {
-              // 保存成功后,初始化数据,变成修改
-              this.initDatas()
-              if (val !== 1) {
-                this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-              }
-            } else {
+          api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
+            if (res.data.item) {
               this.$message({
                 type: 'warning',
-                message: res.data.message
+                message: '该银行账号与其他公司重复'
               })
+            } else {
+              this.addInfoChangeItemCh(val)
             }
           }).catch(err => {
             console.error(err)
@@ -2952,7 +2940,32 @@ import Viewer from 'v-viewer'
           return false
         }
       },
-
+      addInfoChangeItemCh (val) {
+        let AllInfochangeItemList = {
+          SupplierId: this.formData.Id + '',
+          MInfoId: this.annualId,
+          InfochangeForm: this.infochangeItemList
+        }
+        annualapi.addInfoChangeItemCh(AllInfochangeItemList, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            // 保存成功后,初始化数据,变成修改
+            this.initDatas()
+            if (val !== 1) {
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+            }
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       GradeChange (val) {
         if (val === '1') {
           this.formData.MgrUnit = '中油集团公司'

+ 31 - 19
src/dashoo.cn/frontend_web/src/pages/oilsupplier/infochangech/_opera/operation.vue

@@ -2523,28 +2523,14 @@
       saveinfochange (val) {
         this.$refs['formData'].validate((valid) => {
           if (valid) {
-            let AllInfochangeItemList = {
-              SupplierId: this.serviceId,
-              MInfoId: this.MInfoId,
-              InfochangeForm: this.infochangeItemList
-            }
-            // console.log('----', AllInfochangeItemList)
-            // debugger
-            api.addInfoChangeItemCh(AllInfochangeItemList, this.$axios).then(res => {
-              if (res.data.code === 0) {
-                // 保存成功后,初始化数据,变成修改
-                this.initDatas()
-                if (val !== 1) {
-                  this.$message({
-                    type: 'success',
-                    message: res.data.message
-                  })
-                }
-              } else {
+            supplierapi.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
+              if (res.data.item) {
                 this.$message({
                   type: 'warning',
-                  message: res.data.message
+                  message: '该银行账号与其他公司重复'
                 })
+              } else {
+                this.addInfoChangeItemCh(val)
               }
             }).catch(err => {
               console.error(err)
@@ -2552,6 +2538,32 @@
           }
         })
       },
+      addInfoChangeItemCh (val) {
+        let AllInfochangeItemList = {
+          SupplierId: this.serviceId,
+          MInfoId: this.MInfoId,
+          InfochangeForm: this.infochangeItemList
+        }
+        api.addInfoChangeItemCh(AllInfochangeItemList, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            // 保存成功后,初始化数据,变成修改
+            this.initDatas()
+            if (val !== 1) {
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+            }
+          } else {
+            this.$message({
+              type: 'warning',
+              message: res.data.message
+            })
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       chooseAuditorShow () {
         this.$refs['chooseAuditor'].getorgtreelist()
         this.chooseAuditorVisible = true

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

@@ -1430,19 +1430,31 @@ export default {
               message: '该统一社会信用代码与其他公司重复'
             })
           } else {
-            if (!this.formData.Id || !this.certId) {
-              if (val === 1) {
-                this.addEntityNoInfo()
-              } else {
-                this.addEntity()
-              }
-            } else {
-              if (val === 1) {
-                this.updateEntityNoInfo()
+            api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
+              // console.log(res, 'checkBack')
+              if (res.data.item) {
+                this.$message({
+                  type: 'warning',
+                  message: '该银行账号与其他公司重复'
+                })
               } else {
-                this.updateEntity()
+                if (!this.formData.Id || !this.certId) {
+                  if (val === 1) {
+                    this.addEntityNoInfo()
+                  } else {
+                    this.addEntity()
+                  }
+                } else {
+                  if (val === 1) {
+                    this.updateEntityNoInfo()
+                  } else {
+                    this.updateEntity()
+                  }
+                }
               }
-            }
+            }).catch(err => {
+              console.error(err)
+            })
           }
         }).catch(err => {
           console.error(err)

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

@@ -1608,19 +1608,31 @@ export default {
               message: '该统一社会信用代码与其他公司重复'
             })
           } else {
-            if (!this.formData.Id || !this.certId) {
-              if (val === 1) {
-                this.addEntityNoInfo()
-              } else {
-                this.addEntity()
-              }
-            } else {
-              if (val === 1) {
-                this.updateEntityNoInfo()
+            api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
+              // console.log(res, 'checkBack')
+              if (res.data.item) {
+                this.$message({
+                  type: 'warning',
+                  message: '该银行账号与其他公司重复'
+                })
               } else {
-                this.updateEntity()
+                if (!this.formData.Id || !this.certId) {
+                  if (val === 1) {
+                    this.addEntityNoInfo()
+                  } else {
+                    this.addEntity()
+                  }
+                } else {
+                  if (val === 1) {
+                    this.updateEntityNoInfo()
+                  } else {
+                    this.updateEntity()
+                  }
+                }
               }
-            }
+            }).catch(err => {
+              console.error(err)
+            })
           }
         }).catch(err => {
           console.error(err)

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

@@ -1426,19 +1426,31 @@ export default {
               message: '该统一社会信用代码与其他公司重复'
             })
           } else {
-            if (!this.formData.Id || !this.certId) {
-              if (val === 1) {
-                this.addEntityNoInfo()
-              } else {
-                this.addEntity()
-              }
-            } else {
-              if (val === 1) {
-                this.updateEntityNoInfo()
+            api.checkBack(this.formData.BankAccount, this.formData.Id, this.$axios).then(res => {
+              // console.log(res, 'checkBack')
+              if (res.data.item) {
+                this.$message({
+                  type: 'warning',
+                  message: '该银行账号与其他公司重复'
+                })
               } else {
-                this.updateEntity()
+                if (!this.formData.Id || !this.certId) {
+                  if (val === 1) {
+                    this.addEntityNoInfo()
+                  } else {
+                    this.addEntity()
+                  }
+                } else {
+                  if (val === 1) {
+                    this.updateEntityNoInfo()
+                  } else {
+                    this.updateEntity()
+                  }
+                }
               }
-            }
+            }).catch(err => {
+              console.error(err)
+            })
           }
         }).catch(err => {
           console.error(err)

+ 34 - 20
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/basisdataopera.vue

@@ -2435,27 +2435,14 @@
       saveinfochange (val) {
         this.$refs['supplierData'].validate((valid) => {
           if (valid) {
-            let AllInfochangeItemList = {
-              SupplierId: this.formData.SupplierId + '',
-              MInfoId: this.Id + '',
-              InfochangeForm: this.infochangeItemList
-            }
-            api.addInfoChangeItemCh(AllInfochangeItemList, this.$axios).then(res => {
-              if (res.data.code === 0) {
-                this.getSupplierData()
-                if (val !== 1) {
-                  this.$message({
-                    type: 'success',
-                    message: res.data.message
-                  })
-                }
+            suppapi.checkBack(this.supplierData.BankAccount, this.supplierData.Id, this.$axios).then(res => {
+              if (res.data.item) {
+                this.$message({
+                  type: 'warning',
+                  message: '该银行账号与其他公司重复'
+                })
               } else {
-                if (val !== 1) {
-                  this.$message({
-                    type: 'warning',
-                    message: res.data.message
-                  })
-                }
+                this.addInfoChangeItemCh(val)
               }
             }).catch(err => {
               console.error(err)
@@ -2463,6 +2450,33 @@
           }
         })
       },
+      addInfoChangeItemCh (val) {
+        let AllInfochangeItemList = {
+          SupplierId: this.formData.SupplierId + '',
+          MInfoId: this.Id + '',
+          InfochangeForm: this.infochangeItemList
+        }
+        api.addInfoChangeItemCh(AllInfochangeItemList, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            this.getSupplierData()
+            if (val !== 1) {
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+            }
+          } else {
+            if (val !== 1) {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       getSupplierData () {
         let params = {
           InfomainId: this.Id

+ 34 - 20
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/goodsdataopera.vue

@@ -2264,27 +2264,14 @@
       saveinfochange (val) {
         this.$refs['supplierData'].validate((valid) => {
           if (valid) {
-            let AllInfochangeItemList = {
-              SupplierId: this.formData.SupplierId + '',
-              MInfoId: this.Id + '',
-              InfochangeForm: this.infochangeItemList
-            }
-            api.addInfoChangeItemCh(AllInfochangeItemList, this.$axios).then(res => {
-              if (res.data.code === 0) {
-                this.getSupplierData()
-                if (val !== 1) {
-                  this.$message({
-                    type: 'success',
-                    message: res.data.message
-                  })
-                }
+            suppapi.checkBack(this.supplierData.BankAccount, this.supplierData.Id, this.$axios).then(res => {
+              if (res.data.item) {
+                this.$message({
+                  type: 'warning',
+                  message: '该银行账号与其他公司重复'
+                })
               } else {
-                if (val !== 1) {
-                  this.$message({
-                    type: 'warning',
-                    message: res.data.message
-                  })
-                }
+                this.addInfoChangeItemCh(val)
               }
             }).catch(err => {
               console.error(err)
@@ -2292,6 +2279,33 @@
           }
         })
       },
+      addInfoChangeItemCh (val) {
+        let AllInfochangeItemList = {
+          SupplierId: this.formData.SupplierId + '',
+          MInfoId: this.Id + '',
+          InfochangeForm: this.infochangeItemList
+        }
+        api.addInfoChangeItemCh(AllInfochangeItemList, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            this.getSupplierData()
+            if (val !== 1) {
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+            }
+          } else {
+            if (val !== 1) {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       getSupplierData () {
         let params = {
           InfomainId: this.Id

+ 34 - 20
src/dashoo.cn/frontend_web/src/pages/oilsupplier/supplierappend/_opera/techdataopera.vue

@@ -1942,27 +1942,14 @@
         }
         this.$refs['supplierData'].validate((valid) => {
           if (valid) {
-            let AllInfochangeItemList = {
-              SupplierId: this.formData.SupplierId + '',
-              MInfoId: this.Id + '',
-              InfochangeForm: this.infochangeItemList
-            }
-            api.addInfoChangeItemCh(AllInfochangeItemList, this.$axios).then(res => {
-              if (res.data.code === 0) {
-                this.getSupplierData()
-                if (val !== 1) {
-                  this.$message({
-                    type: 'success',
-                    message: res.data.message
-                  })
-                }
+            suppapi.checkBack(this.supplierData.BankAccount, this.supplierData.Id, this.$axios).then(res => {
+              if (res.data.item) {
+                this.$message({
+                  type: 'warning',
+                  message: '该银行账号与其他公司重复'
+                })
               } else {
-                if (val !== 1) {
-                  this.$message({
-                    type: 'warning',
-                    message: res.data.message
-                  })
-                }
+                this.addInfoChangeItemCh(val)
               }
             }).catch(err => {
               console.error(err)
@@ -1970,6 +1957,33 @@
           }
         })
       },
+      addInfoChangeItemCh (val) {
+        let AllInfochangeItemList = {
+          SupplierId: this.formData.SupplierId + '',
+          MInfoId: this.Id + '',
+          InfochangeForm: this.infochangeItemList
+        }
+        api.addInfoChangeItemCh(AllInfochangeItemList, this.$axios).then(res => {
+          if (res.data.code === 0) {
+            this.getSupplierData()
+            if (val !== 1) {
+              this.$message({
+                type: 'success',
+                message: res.data.message
+              })
+            }
+          } else {
+            if (val !== 1) {
+              this.$message({
+                type: 'warning',
+                message: res.data.message
+              })
+            }
+          }
+        }).catch(err => {
+          console.error(err)
+        })
+      },
       getSupplierData () {
         let params = {
           InfomainId: this.Id