| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- mui.init({
- swipeBack: false,
- })
- mui.plusReady(function() {
- var wv = plus.webview.currentWebview();
- var classImport = wv.classImport;
- var token = wv.token;
- var isdeals = wv.name;
- //交办单位
- var dwList = [];
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + 'UserAccount/GetList',
- async: false,
- data: {
- type: 2,
- token: token
- },
- dataType: 'json',
- success: function(data) {
- res = data.rows;
- if(res && res.length > -1) {
- res.forEach(function(v, i) {
- var obj = {};
- obj.value = v.F_UserId;
- obj.text = v.F_UserName;
- dwList.push(obj);
- });
- }
- }
- });
- (function($, doc) {
- $.ready(function() {
- //交办单位
- var ZTiPickers = new $.PopPicker({
- layer: 1
- });
- ZTiPickers.setData(dwList);
- var ZXs = doc.getElementById('DW');
- var ZXResults = doc.getElementById('DWResult');
- ZXs.addEventListener('tap', function(event) {
- ZTiPickers.show(function(items) {
- ZXResults.value = items[0].text;
- ZXResults.setAttribute("data-index", items[0].value);
- });
- }, false);
- })
- })(mui, document);
- //提交按钮
- $('.submit').on('tap', function() {
- var DWResult = $("#DWResult").attr('data-index');
- if(!DWResult) {
- plus.nativeUI.toast('请选择提交人');
- } else {
- var btnArray = ['取消', '确定'];
- mui.confirm('是否提交工单', '提示', btnArray, function(e) {
- if(e.index == 1) {
- mui.ajax(huayi.config.callcenter_url + 'WorkorderApp/Submission', {
- data: {
- id: isdeals,
- clid: $("#DWResult").attr('data-index'), //单位
- type:2,
- token: token
- },
- dataType: 'json', //服务器返回json格式数据
- type: 'post', //HTTP请求类型
- timeout: 10000, //超时时间设置为10秒;
- success: function(data) {
- plus.nativeUI.toast('成功');
- $("#ower_recive").val('');
- if (classImport) {
- if (classImport==2) {
- var wobj = plus.webview.getWebviewById("Work-listCJ");
- }else{
- var wobj = plus.webview.getWebviewById("Work-listClass");
- }
- }else{
- var wobj = plus.webview.getWebviewById("Work-list");
- }
- wobj.reload(true);
- },
- error: function(xhr, type, errorThrown) {
- plus.nativeUI.toast('失败');
- }
- });
- } else {
- plus.nativeUI.toast('取消申请');
- }
- })
- }
- })
- });
|