浏览代码

提成设置调整

qymljy 1 年之前
父节点
当前提交
43555a1a36
共有 2 个文件被更改,包括 58 次插入104 次删除
  1. 39 52
      src/Form/marketing2/agent/add.vue
  2. 19 52
      src/Form/marketing2/agent/edit.vue

+ 39 - 52
src/Form/marketing2/agent/add.vue

@@ -170,7 +170,7 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item v-if="isBankCardno" label="卡号:" prop="bankcardno">
+            <el-form-item v-if="isBank" label="卡号:" prop="bankcardno">
               <el-input v-model="form.bankcardno" placeholder="请输入银行卡号"></el-input>
             </el-form-item>
             <el-form-item v-else label="卡号:" >
@@ -178,7 +178,7 @@
             </el-form-item>
           </el-col>
           <el-col :span="12">
-            <el-form-item v-if="isBankName" label="开户人:" prop="bankname">
+            <el-form-item v-if="isBank" label="开户人:" prop="bankname">
               <el-input v-model="form.bankname" placeholder="请输入开户人"></el-input>
             </el-form-item>
             <el-form-item v-else label="开户人:" >
@@ -206,8 +206,6 @@ export default {
     return {
       radio:-1,
       isBank:false,
-      isBankCardno:false,
-      isBankName:false,
       title:'选择上级合作伙伴',
       rules: {
         enterprisename: [
@@ -289,43 +287,6 @@ export default {
       loading:'loading'
     })
   },
-  watch:{
-    'form.bank':function (val){
-      if (!val){
-        if (!this.form.bankcardno){
-          if (!this.form.bankname){
-
-          }else {
-            this.isBank = true
-            this.isBankCardno = true
-            this.isBankName = true
-          }
-        }else {
-          this.isBank = true
-          this.isBankCardno = true
-          this.isBankName = true
-        }
-      }else {
-        this.isBank = true
-        this.isBankCardno = true
-        this.isBankName = true
-      }
-    },
-    'form.bankcardno':function (val){
-      if (!val){
-        this.isBank = true
-        this.isBankCardno = true
-        this.isBankName = true
-      }
-    },
-    'form.bankname':function (val){
-      if (!val){
-        this.isBank = true
-        this.isBankCardno = true
-        this.isBankName = true
-      }
-    }
-  },
   methods:{
     onShow () {
       this.dialogVisible = true
@@ -382,17 +343,43 @@ export default {
     onSubmit () {
       this.$refs['form'].validate(async (valid) => {
         if (!valid) return false
-        const res = await this.$api.requested({
-          "classname": "webmanage.sale.agents.agents",
-          "method": "insertormodify_agent",
-          "content": this.form
-        })
-        this.tool.showMessage(res,()=>{
-          this.$emit('onSuccess')
-          // this.$refs['form'].resetFields();
-          this.dialogVisible = false
-          this.onClose()
-        })
+        if (this.form.bankcardno || this.form.bank || this.form.bankname){
+          if (this.form.bankcardno && this.form.bank && this.form.bankname){
+            this.isBank = false
+            const res = await this.$api.requested({
+              "classname": "webmanage.sale.agents.agents",
+              "method": "insertormodify_agent",
+              "content": this.form
+            })
+            this.tool.showMessage(res,()=>{
+              this.$emit('onSuccess')
+              // this.$refs['form'].resetFields();
+              this.dialogVisible = false
+              this.onClose()
+            })
+          }else {
+            this.isBank = true
+            this.$alert('请完善银行卡', '提示', {
+              showClose:false,
+              confirmButtonText: '确定',
+              callback: action => {
+              }
+            });
+          }
+        }else {
+          this.isBank = false
+          const res = await this.$api.requested({
+            "classname": "webmanage.sale.agents.agents",
+            "method": "insertormodify_agent",
+            "content": this.form
+          })
+          this.tool.showMessage(res,()=>{
+            this.$emit('onSuccess')
+            // this.$refs['form'].resetFields();
+            this.dialogVisible = false
+            this.onClose()
+          })
+        }
       })
     },
     radioChange (val) {

+ 19 - 52
src/Form/marketing2/agent/edit.vue

@@ -171,24 +171,6 @@
                 <el-input v-model.number="form.freefreightamount" placeholder="请输入免运费额度"></el-input>
               </el-form-item>
             </el-col>
-            <el-col :span="24">
-              <p class="normal-title normal-margin">银行卡信息</p>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="银行名称:">
-                <el-input v-model="form.bank" placeholder="请输入银行名称"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="卡号:">
-                <el-input v-model="form.bankcardno" placeholder="请输入银行卡号"></el-input>
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item label="开户人:">
-                <el-input v-model="form.bankname" placeholder="请输入开户人"></el-input>
-              </el-form-item>
-            </el-col>
           </el-form>
         </el-row>
       </div>
@@ -226,6 +208,15 @@ export default {
         // erpagentnum: [
         //   { required: true, message: '请输入erp经销商编号', trigger: 'change' },
         // ],
+        bank: [
+          { required: true, message: '请输入银行名称', trigger: 'blur' },
+        ],
+        bankcardno: [
+          { required: true, message: '请输入银行卡号', trigger: 'blur' },
+        ],
+        bankname: [
+          { required: true, message: '请输入开户人', trigger: 'blur' },
+        ],
       },
       fill:true,
       cooperationstatus:[
@@ -244,7 +235,6 @@ export default {
         "parentid": "",
         "agentnum": "",
         "signdate": "",
-        "grade": "",
         "sys_enterpriseid": '',
         "sa_saleareaids": [
 
@@ -382,39 +372,16 @@ export default {
     onSubmit () {
       this.$refs['form'].validate(async (valid) => {
         if (!valid) return false
-        let isBank = false
-        if (this.form.bankname != '' || this.form.bankname != undefined){
-          if ((this.form.bank == '' || this.form.bankcardno == '') || this.form.bankcardno == undefined || this.form.bank == undefined ){
-            isBank = true
-          }
-        }else if (this.form.bank != '' || this.form.bank != undefined){
-          if (this.form.bankname == '' || this.form.bankname == undefined || this.form.bankcardno == '' || this.form.bankcardno == undefined){
-            isBank = true
-          }
-        }else if (this.form.bankcardno != '' || this.form.bankcardno != undefined){
-          if (this.form.bankname == '' || this.form.bankname == undefined || this.form.bank == '' || this.form.bank == undefined){
-            isBank = true
-          }
-        }
-        if (isBank){
-          this.$alert('请完善银行卡', '提示', {
-            showClose:false,
-            confirmButtonText: '确定',
-            callback: action => {
-            }
-          });
-        }else {
-          const res = await this.$api.requested({
-            "classname": "webmanage.sale.agents.agents",
-            "method": "insertormodify_agent",
-            "content": this.form
-          })
-          this.tool.showMessage(res,()=>{
-            this.$emit('onSuccess')
-            // this.$refs['form'].resetFields();
-            this.dialogVisible = false
-          })
-        }
+        const res = await this.$api.requested({
+          "classname": "webmanage.sale.agents.agents",
+          "method": "insertormodify_agent",
+          "content": this.form
+        })
+        this.tool.showMessage(res,()=>{
+          this.$emit('onSuccess')
+          // this.$refs['form'].resetFields();
+          this.dialogVisible = false
+        })
       })
     },
     onChange () {