form.js 1.9 KB

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