| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- 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 wv = plus.webview.currentWebview();
- var nameid = wv.nameid;
- var name = wv.name;
- mui.ajax(huayi.config.callcenter_url + '/UserAccount/GetUser', {
- data: {
- usercode:name,
- userid:nameid,
- token: localStorage.getItem("token"),
- },
- dataType: 'json', //服务器返回json格式数据
- async: false,
- type: 'get', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- headers: {
- 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
- },
- success: function(data) {
- var RoleCode = data.data;
- $("#UserId").val(RoleCode.F_UserId) //用户id
- $(".F_UserName").val(RoleCode.F_UserName); //员工姓名
- $(".F_SeatGroup").val(RoleCode.depname); //部门
- $(".rolname").val(RoleCode.F_UserCode); //员工工号
- $(".password").val(RoleCode.F_Password); //密码
- $(".F_Mobile").val(RoleCode.F_Mobile); //手机号
-
-
- },
- error: function(xhr, type, errorThrown) {
- //异常处理;
- }
- });
- // 产品代码
- 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.value = 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) {
- F_Product.value = items[0].textt + "-" + items[1].text + "-" + items[2].text;
- F_Product.setAttribute("data-index", items[2].value);
- if (items[2].text="undefined") {
- F_Product.value = items[0].text + "-" + items[1].text;
- F_Product.setAttribute("data-index", items[1].value);
- }else if (items[1].text="undefined") {
- F_Product.value = items[0].text;
- F_Product.setAttribute("data-index", items[0].value);
- }else {
-
- }
-
-
- });
- }, false);
- })
- })(mui, document);
- })
- $('#xgPassword').on('tap', function() {
- $.ajax({
- type: "post",
- dataType: 'json',
- url: huayi.config.callcenter_url + '/UserAccount/EditUsers',
- async: true,
- data: {
- userid:$("#UserId").val(),
- username: $('.F_UserName').val(), //用户名
- usercode: $('.rolname').val(), //账号
- Password: $('.password').val(), //密码
- token: localStorage.getItem("token")
- },
- success: function(data) {
- if(data.state == "success") {
- mui.toast('修改成功!');
- setTimeout(function () {
- window.location.href="../login.html"
- },1500)
- } else {
- mui.toast(data.message);
- }
- }
- });
- })
|