小知识点 (1+1)

一 简单的二级联动 :


支付类型


filterable
v-model="formInline.payType"
@change="paymentMethodTwo"
placeholder="请选择">
:key="index"
:value='item.subjectCode'
:label="item.subjectName">




支付方式



filterable
:disabled="!itemData.paymentType || !payTypeListTwo.length"
v-model="itemData.paymentMethod"
placeholder="请选择">
:key="index"
:value='item.subjectCode'
:label="item.subjectName">


二 data 数据 :
itemData: {
paymentType: '',//支付类型
paymentMethod:'',//支付方式
},

三 methods js方法 :
//获取支付方式下拉框
paymentMethodTwo(type){
// 一级切换,重选二级
if (type !== 'init') {
this.itemData.paymentMethod = ''
if (this.itemData.paymentType !== 'WZFF') {
this.itemData.accountStatus = 'account_status_1'
} else {
this.itemData.accountStatus = ''
}

      if (this.itemData.accountStatus !== 'account_status_1') {
        this.itemData.typeOfPayer = ''
        this.itemData.flowInformation = ''
        this.itemData.payerInformation = ''
      }
    } else {
      if (this.itemData.paymentType !== 'WZFF') {
        this.itemData.accountStatus = 'account_status_1'
      } else {
        this.itemData.paymentMethod = ''
      }
    }
    util.request({
      method: 'get',
      interface: 'selectChildrenPay',
      data: {
        subjectCode: this.itemData.paymentType
      }
    }).then(res => {
      if (res.result.success == '1') {
        this.payTypeListTwo = res.result.result
      } else {
        this.$message.error(res.result.message)
      }
    })
  },
  //获取支付方式下拉框
  paymentTypeList(){
    util.request({
      method: 'get',
      interface: 'selectPayType',
      data: {}
    }).then(res => {
      if (res.result.success == '1') {
        this.payTypeListOne = res.result.result
      } else {
        this.$message.error(res.result.message)
      }
    })
  },

//小判断

你可能感兴趣的:(小知识点 (1+1))