Browse Source

如果存在多个客户可以选择

test
mk 1 year ago
parent
commit
8ee5e6ee7c
  1. 31
      src/views/login/index.vue

31
src/views/login/index.vue

@ -15,6 +15,14 @@
<van-checkbox v-model="autoLogin" shape="square">下次自动登录</van-checkbox>
<span class="text-blue">忘记密码?</span>
</div>
<van-dialog v-model="showCustomer" title="" show-cancel-button :before-close="handelCustomerSave">
<p class="required">选择客户</p>
<van-radio-group v-model="customerId">
<van-radio :name="item.customerId" v-for="(item, index) in CustomerList" :key="item.customerId"
:value="item.customerId">{{ item.customerName
}}</van-radio>
</van-radio-group>
</van-dialog>
</div>
</template>
<script>
@ -29,6 +37,8 @@ export default {
autoLogin: false,
pubKey: null,//
customerId: null,//id
showCustomer:null,
CustomerList:[],
};
},
created() {
@ -51,11 +61,30 @@ export default {
}
let { data, code, msg } = await getCustomerlist(parms)
if (code === 0) {
this.customerId = data[0].customerId
if(data.length > 1){
this.showCustomer = true;
this.CustomerList = data;
}else{
this.customerId = data[0].customerId;
}
} else {
console.log(msg);
}
},
handelCustomerSave(action,done){
if (action === "confirm") {
console.log(this.customerId);
if (!this.customerId) {
this.$tips.warning('请选择客户')
return done(false)
}
done()
}
else {
done(true);
}
},
async handelCLickLogin() {
let parms = {
app: 'gov',

Loading…
Cancel
Save