form.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. ;
  2. var operationPage = new Vue({
  3. el: "#operationPage",
  4. data: {
  5. loginLoading: false,
  6. userId: 0,
  7. addForm: {
  8. mobile: '',
  9. linkName: '',
  10. userId: '',
  11. clubId: '',
  12. configFlag: 2
  13. },
  14. rule: {
  15. name: '^[a-zA-Z\\u4e00-\\u9fa5]{2,}$',
  16. phone: '^\\d{6,12}$'
  17. }
  18. },
  19. computed: {
  20. },
  21. methods: {
  22. addConfirmFn:function(data){//添加运营人员
  23. var _self = this;
  24. var pass = verifyForm();
  25. if (_self.loginLoading) { return false; }
  26. if (!pass) {return false;}
  27. _self.loginLoading = true;
  28. UserApi.AddOperationUse(_self.addForm,function (response) {
  29. console.log(response);
  30. if(response.code == 0 ){ //删除成功
  31. CAIMEI.dialog('添加成功',true,function () {
  32. window.location.href='/user/operation/list.html';
  33. _self.loginLoading = false;
  34. });
  35. }else{
  36. console.log('222222222222222');
  37. CAIMEI.Alert(response.msg,'确定',false);
  38. _self.loginLoading = false;
  39. }
  40. })
  41. },
  42. blurHandle: function(event) { // 失去焦点校验
  43. var el = event.currentTarget;
  44. verifyHandle(el);
  45. }
  46. },
  47. mounted: function () {
  48. if(globalUserData){
  49. this.addForm.userId = globalUserData.userId;
  50. this.addForm.clubId = globalUserData.clubId;
  51. }
  52. $('.navLayout').find('.navList').removeClass("on").find('.con').hide().find('a').removeClass("on");
  53. $('.navLayout').find('.navList').eq(1).addClass("on").find('.con').show().find('a').eq(1).addClass("on");
  54. }
  55. });