| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- mui.init({
- beforeback: function() {
- var list = plus.webview.currentWebview().opener();
- //refresh是A页面自定义事件
- mui.fire(list, 'refresh');
- //返回true,继续页面关闭逻辑
- return true;
- }
- });
- //初始化单页的区域滚动
- mui('.mui-scroll-wrapper').scroll();
- mui.plusReady(function() {
-
- // 产品代码
- var Product = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'Department/GetDeptList',
- async: false,
- data: {
- flag: "CPDM",
- token:localStorage.getItem("token")
- },
- dataType: 'json',
- success: function(res) {
- if(res.state.toLowerCase() === "success") {
- res = res.data;
- if(res && res.length > 0) {
- res.forEach(function(v, i) {
- var obj = {};
- obj.id = v.id;
- obj.text = v.text;
- obj.children = v.children;
- Product.push(obj);
- });
- }
- }
- }
- });
- (function($, doc) {
- $.init();
- $.ready(function() {
- //产品代码
- var userPicker2 = new $.PopPicker({layer: 3});
- userPicker2.setData(Product);
- var showUserPickerButton2 = doc.getElementById('showUserPickerProduct');
- var F_Product = doc.getElementById('F_ProductType');
- showUserPickerButton2.addEventListener('tap', function(event) {
- userPicker2.show(function(items) {
- if (items[2].text==undefined) {
- if (items[1].text==undefined) {
- F_Product.value = items[0].text;
- F_Product.setAttribute("data-index", items[0].id);
- } else {
- F_Product.value = items[1].text;
- F_Product.setAttribute("data-index", items[1].id);
- }
- }else {
- F_Product.value =items[2].text;
- F_Product.setAttribute("data-index", items[2].id);
- }
- });
- }, false);
- })
- })(mui, document);
- })
- $('#xgPassword').on('tap', function() {
-
- // alert($('.F_UserName').val());
- // alert($('.password').val());
- // alert($("#F_ProductType").attr("data-index"));
- // alert($(".F_Mobile").val());
- if($('#F_CusName').val() == '') {
- mui.alert('请输入用户名!')
- } else if($('.password').val() == '') {
- mui.alert('请输入密码!')
- } else if($("#F_ProductType").val() == '') {
- mui.alert('请选择部门!')
- } else {
- $.ajax({
- type: "post",
- dataType: 'json',
- url: huayi.config.callcenter_url + '/UserAccount/AddUsers',
- async: true,
- data: {
- username: $('.F_UserName').val(), //用户名
- password: $('.password').val(), //密码
- deptid:$("#F_ProductType").attr("data-index"), //部门
- roleid: 53,
- mobile:$(".F_Mobile").val(),
- token: localStorage.getItem("token")
- },
- success: function(data) {
- if(data.state == "success") {
-
- mui.alert( '账号'+data.data.F_UserCode+'--密码'+data.data.F_Password,'添加成功', function() {
- var wobj = plus.webview.getWebviewById("Setting_manage");
- wobj.reload(true);
- });
-
- } else {
- mui.toast(data.message);
- }
- }
- });
- }
- })
|