From 9fe35e2394ea32269957328342bba12442986df5 Mon Sep 17 00:00:00 2001 From: YYC <1833023622@qq.com> Date: 星期二, 16 五月 2023 16:30:07 +0800 Subject: [PATCH] 工单管理 --- igds-app/js/admin/security-patrol.js | 13 igds-app/js/admin/depot-list.js | 1 igds-app/device-temp.html | 48 -- igds-app/js/admin/work-apply.js | 249 ++++++++++++++ igds-app/js/admin/work-record.js | 86 +++++ igds-app/device-manager.html | 10 igds-app/js/admin/device-temp.js | 116 ++++++ igds-app/js/admin/inout-out-handle-list.js | 1 igds-app/inout-in-handle-list.html | 2 igds-app/js/admin/inout-in-handle-list.js | 98 ++-- igds-app/work-apply.html | 195 ----------- igds-app/work-audit.html | 20 igds-app/js/admin/es-read-meter.js | 2 igds-app/js/admin/work-audit.js | 137 ++++++++ igds-app/work-record.html | 22 igds-app/js/admin/es-real-electric.js | 2 16 files changed, 692 insertions(+), 310 deletions(-) diff --git a/igds-app/device-manager.html b/igds-app/device-manager.html index 3b234fc..2c1ff72 100644 --- a/igds-app/device-manager.html +++ b/igds-app/device-manager.html @@ -65,11 +65,19 @@ mui(".mui-content").on("tap", ".mui-scroll ul li a", function() { var id = this.getAttribute("id"); if (id) { + var titleName = '-浠撳簱鍒楄〃'; + if (id == 'verb') { + titleName = '閫氶鎿嶄綔' + titleName; + } else if (id == 'n2') { + titleName = '姘旇皟鎿嶄綔' + titleName; + } else if (id == 'temp') { + titleName = '娓╂帶鎿嶄綔' + titleName; + } mui.openWindow({ url: "depot-list.html", id: "depot-list", extras: { - titleName: "绮儏绠$悊-浠撳簱鍒楄〃", + titleName: titleName, tag: id } }) diff --git a/igds-app/device-temp.html b/igds-app/device-temp.html index c6b6298..2319560 100644 --- a/igds-app/device-temp.html +++ b/igds-app/device-temp.html @@ -101,7 +101,7 @@ <div class="group"> <div class="l"><b>寮�鍏�</b></div> <div class="r"> - <div class="mui-switch mui-switch-mini"> + <div class="mui-switch mui-switch-mini" id="vibrationSwitch"> <div class="mui-switch-handle"></div> </div> </div> @@ -109,11 +109,12 @@ <div class="group sel-box"> <div class="l"><b>妯″紡:</b></div> <div class="r"> - <select class="sel"> + <select class="sel" id="targetModel"> <option value="">璇烽�夋嫨</option> - <option value="0">妯″紡1</option> - <option value="1">妯″紡2</option> - <option value="2">妯″紡3</option> + <option value="HEATING">鍒剁儹</option> + <option value="01-REFRIGERATION">鍒跺喎</option> + <option value="02-AERATION">閫氶</option> + <option value="DEHU">闄ゆ箍</option> </select> <i class="mui-icon mui-icon-arrowright"></i> </div> @@ -137,44 +138,13 @@ </body> <script src="./js/mui.min.js"></script> <script src="./js/jquery.js"></script> + <script src="./js/admin/device-temp.js"></script> <script type="text/javascript" charset="utf-8"> mui.init(); - - var slider = mui(".mui-slider"); - slider.slider({ - interval: 3000 - }); - - mui('.mui-scroll-wrapper').scroll({ - indicators: false, //鏄惁鏄剧ず婊氬姩鏉� - deceleration: 0.0006, //闃诲凹绯绘暟,绯绘暟瓒婂皬婊戝姩瓒婄伒鏁� - bounce: false, //鏄惁鍚敤鍥炲脊 - deceleration: 0.0005 //flick 鍑忛�熺郴鏁帮紝绯绘暟瓒婂ぇ锛屾粴鍔ㄩ�熷害瓒婃參锛屾粴鍔ㄨ窛绂昏秺灏忥紝榛樿鍊�0.0006 - }); - $('#range').on('input propertychange', function() { //瀹炴椂浜嬩欢锛堣幏鍙栨瘡涓彉鍖栫殑鍊硷級 - var val = $('#range').val(); - $('.subbar').css({ - width: ((val-9) / 16) * 100 + '%' - }) + mui.plusReady(function(){ + init(); }) - //绌鸿皟鎿嶄綔 - mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .con", function() { - $('.m-pop').css('display', 'flex'); - }); - mui(".m-pop").on("tap", ".inner .confirm", function() { - var id = this.getAttribute("id"); - - closePop(); - }); - //鍏抽棴寮圭獥 - function closePop() { - $(".m-pop").css('display', 'none'); - } - $('.pop-bg,.m-pop .close').click(function(e) { - e.stopPropagation(); - $('.m-pop').fadeOut(); - }); </script> </html> \ No newline at end of file diff --git a/igds-app/inout-in-handle-list.html b/igds-app/inout-in-handle-list.html index fa75943..e5e82fd 100644 --- a/igds-app/inout-in-handle-list.html +++ b/igds-app/inout-in-handle-list.html @@ -29,7 +29,7 @@ <div class="inpbox"> <input type="search" id="plateNum" class="mui-input-clear" placeholder="璇疯緭鍏ヨ溅鐗屼俊鎭绱�" value=""> </div> - <div class="s-btn"><img src="images/icons/g-i22.png" alt="">璇诲崱</div> + <div class="s-btn"><img src="images/icons/g-i22.png" alt="" onclick="readCard()">璇诲崱</div> <button type="button" class="mui-btn">鏌ヨ</button> </div> </form> diff --git a/igds-app/js/admin/depot-list.js b/igds-app/js/admin/depot-list.js index 7f68d15..4fdc9fa 100644 --- a/igds-app/js/admin/depot-list.js +++ b/igds-app/js/admin/depot-list.js @@ -41,6 +41,7 @@ success: function(result) { if (result.code == "0000") { depotList = result.data; + // console.log(JSON.stringify(depotList)) renderDepotList(); } else { mui.alert(result.msg, '鎻愮ず', ["纭畾"], function() {}, "div"); diff --git a/igds-app/js/admin/device-temp.js b/igds-app/js/admin/device-temp.js new file mode 100644 index 0000000..def7a1c --- /dev/null +++ b/igds-app/js/admin/device-temp.js @@ -0,0 +1,116 @@ +var targetStatus; +var targetModel; +var targetTemp; +var data = { + "interfaceId": "5403", + "outId": "10403", + "reqDateTime": new Date(), + "tokenAuth": "", + "data": { + "deptId": "", + "depotId": "", + "type": "", + "passCode": "", + "serId": "", + "targetStatus": "", + "targetModel": "", + "targetTemp": "", + "name": "" + } +}; +function init() { + + var user = JSON.parse(localStorage.getItem('user')); + var selectDeptId = JSON.parse(localStorage.getItem('selectDeptId')); + url = user.url + "/api-phone/v35/gateway"; + data.tokenAuth = user.tokenAuth; + data.deptId = user.deptId; + //鏀瑰彉寮�鍏崇殑榛樿鍊� + // document.getElementById("vibrationSwitch").classList.add('mui-active'); + //璁剧疆寮�鍏崇殑榛樿鍊� + data.data.targetStatus = 'CLOSE' + //鑾峰彇浠庝笂涓�涓〉闈紶閫掔殑鏁版嵁 + var self = plus.webview.currentWebview(); + data.data.depotId = self.depotId + // depotType = self.depotType + // depotName = self.depotName +} + +//鐩戝惉寮�鍏崇姸鎬� +document.getElementById("vibrationSwitch").addEventListener("toggle", function(event) { + if (event.detail.isActive) { + targetStatus = 'OPEN'; + data.data.targetStatus = targetStatus; + console.log("浣犲惎鍔ㄤ簡寮�鍏�"); + } else { + targetStatus = 'CLOSE'; + data.data.targetStatus = targetStatus; + console.log("浣犲叧闂簡寮�鍏�"); + } +}) + +//娓╂帶绠$悊 +function setTemp(){ + mui.ajax(url, { + type: "POST", + dataType: "json", + crossDomain: true, + contentType: "application/json;charset=utf-8", + data: JSON.stringify(data), + success: function(result) { + if (result.code == "0000") { + mui.toast(result.msg); + } else { + mui.toast(result.msg); + console.log(JSON.stringify(result)) + } + }, + error: function() { + mui.alert("绯荤粺绻佸繖,璇烽噸璇曪紒", "鎻愮ず", ["纭畾"], function() {}, "div") + } + }) +} + +var slider = mui(".mui-slider"); +slider.slider({ + interval: 3000 +}); + +$('#range').on('input propertychange', function() { //瀹炴椂浜嬩欢锛堣幏鍙栨瘡涓彉鍖栫殑鍊硷級 + var val = $('#range').val(); + $('.subbar').css({ + width: ((val - 9) / 16) * 100 + '%' + }) +}) + +//绌鸿皟鎿嶄綔 +mui(".mui-scroll-wrapper").on("tap", ".m-tf ul li .con", function() { + $('.m-pop').css('display', 'flex'); + +}); +mui(".m-pop").on("tap", ".inner .confirm", function() { + var id = this.getAttribute("id"); + targetModel = document.getElementById("targetModel").value; + targetTemp = document.getElementById("range").value; + data.data.targetModel = targetModel; + data.data.targetTemp = targetTemp + console.log(JSON.stringify(data.data)) + // setTemp(); + closePop(); +}); +//鍏抽棴寮圭獥 +function closePop() { + $(".m-pop").css('display', 'none'); +} +$('.pop-bg,.m-pop .close').click(function(e) { + e.stopPropagation(); + $('.m-pop').fadeOut(); +}); + + +mui('.mui-scroll-wrapper').scroll({ + indicators: false, //鏄惁鏄剧ず婊氬姩鏉� + deceleration: 0.0006, //闃诲凹绯绘暟,绯绘暟瓒婂皬婊戝姩瓒婄伒鏁� + bounce: false, //鏄惁鍚敤鍥炲脊 + deceleration: 0.0005 //flick 鍑忛�熺郴鏁帮紝绯绘暟瓒婂ぇ锛屾粴鍔ㄩ�熷害瓒婃參锛屾粴鍔ㄨ窛绂昏秺灏忥紝榛樿鍊�0.0006 +}); \ No newline at end of file diff --git a/igds-app/js/admin/es-read-meter.js b/igds-app/js/admin/es-read-meter.js index ad44464..5f78e17 100644 --- a/igds-app/js/admin/es-read-meter.js +++ b/igds-app/js/admin/es-read-meter.js @@ -104,7 +104,7 @@ html += '<div class="m-ck-cont"><div style="text-align: center;font-size: 20px;color:#dd524d;">鏆傛棤杩滅▼鎶勮〃淇℃伅</div></div>'; } - // $("#recordList").html(html); + $("#recordList").html(html); } mui('.mui-scroll-wrapper').scroll({ diff --git a/igds-app/js/admin/es-real-electric.js b/igds-app/js/admin/es-real-electric.js index 561c668..3c0f427 100644 --- a/igds-app/js/admin/es-real-electric.js +++ b/igds-app/js/admin/es-real-electric.js @@ -76,7 +76,7 @@ html += '<li><div class="con myfancy" style="text-align: center;font-size: 20px;color:#dd524d">鏆傛棤瀹炴椂閰嶇數淇℃伅</div></li>'; } - $("#recordList").html(html); + // $("#recordList").html(html); } var slider = mui(".mui-slider"); slider.slider({ diff --git a/igds-app/js/admin/inout-in-handle-list.js b/igds-app/js/admin/inout-in-handle-list.js index ffbe204..3f3b2c0 100644 --- a/igds-app/js/admin/inout-in-handle-list.js +++ b/igds-app/js/admin/inout-in-handle-list.js @@ -65,55 +65,55 @@ } }) - inHandleData = [{ - "id": "44", - "plateNum": "97", - "deHandle": "ut", - "depotId": "16", - "depotName": "闈掑紶鍒楀仛鎬�", - "foodVariety": "magna pariatur laboris sunt dolor", - "foodVarietyName": "鎻愭竻闄�", - "foodLevel": "fugiat", - "foodLevelName": "搴斿彂鐑洓姘戞槸濮�", - "storeKeeperName": "" - }, - { - "id": "62", - "plateNum": "71", - "deHandle": "dolore ut non", - "depotId": "79", - "depotName": "澧炶薄瀹氱珛鏍�", - "foodVariety": "Lorem est", - "foodVarietyName": "甯傛潯缇ゆ眰琚洟涓�", - "foodLevel": "ex labore", - "foodLevelName": "鎸佸湪鍐欑О鎯呭苟", - "storeKeeperName": "2" - }, - { - "id": "96", - "plateNum": "61", - "deHandle": "nulla magna ut proident cillum", - "depotId": "42", - "depotName": "鏉″叏浠�", - "foodVariety": "aliquip", - "foodVarietyName": "杩炲紑闃跺姩闄呭共", - "foodLevel": "in id sunt", - "foodLevelName": "娌$疆瀹氫娇鏂�", - "storeKeeperName": "3" - }, - { - "id": "61", - "plateNum": "17", - "deHandle": "commodo", - "depotId": "80", - "depotName": "灞曡蹇伀鍏ㄩ", - "foodVariety": "voluptate eu Lorem", - "foodVarietyName": "浠栬竟娲炬柉閲嶇", - "foodLevel": "dolor", - "foodLevelName": "瑁呯涓�", - "storeKeeperName": "4" - } - ] + // inHandleData = [{ + // "id": "44", + // "plateNum": "97", + // "deHandle": "ut", + // "depotId": "16", + // "depotName": "闈掑紶鍒楀仛鎬�", + // "foodVariety": "magna pariatur laboris sunt dolor", + // "foodVarietyName": "鎻愭竻闄�", + // "foodLevel": "fugiat", + // "foodLevelName": "搴斿彂鐑洓姘戞槸濮�", + // "storeKeeperName": "" + // }, + // { + // "id": "62", + // "plateNum": "71", + // "deHandle": "dolore ut non", + // "depotId": "79", + // "depotName": "澧炶薄瀹氱珛鏍�", + // "foodVariety": "Lorem est", + // "foodVarietyName": "甯傛潯缇ゆ眰琚洟涓�", + // "foodLevel": "ex labore", + // "foodLevelName": "鎸佸湪鍐欑О鎯呭苟", + // "storeKeeperName": "2" + // }, + // { + // "id": "96", + // "plateNum": "61", + // "deHandle": "nulla magna ut proident cillum", + // "depotId": "42", + // "depotName": "鏉″叏浠�", + // "foodVariety": "aliquip", + // "foodVarietyName": "杩炲紑闃跺姩闄呭共", + // "foodLevel": "in id sunt", + // "foodLevelName": "娌$疆瀹氫娇鏂�", + // "storeKeeperName": "3" + // }, + // { + // "id": "61", + // "plateNum": "17", + // "deHandle": "commodo", + // "depotId": "80", + // "depotName": "灞曡蹇伀鍏ㄩ", + // "foodVariety": "voluptate eu Lorem", + // "foodVarietyName": "浠栬竟娲炬柉閲嶇", + // "foodLevel": "dolor", + // "foodLevelName": "瑁呯涓�", + // "storeKeeperName": "4" + // } + // ] } //娓叉煋椤甸潰 diff --git a/igds-app/js/admin/inout-out-handle-list.js b/igds-app/js/admin/inout-out-handle-list.js index 696200d..7d0eb95 100644 --- a/igds-app/js/admin/inout-out-handle-list.js +++ b/igds-app/js/admin/inout-out-handle-list.js @@ -61,7 +61,6 @@ mui.alert("绯荤粺绻佸繖,璇烽噸璇曪紒", "鎻愮ず", ["纭畾"], function() {}, "div") } }) - outHandleData = [] // outHandleData = [{ // "id": "44", // "plateNum": "97", diff --git a/igds-app/js/admin/security-patrol.js b/igds-app/js/admin/security-patrol.js index bf2dc53..8c84ff7 100644 --- a/igds-app/js/admin/security-patrol.js +++ b/igds-app/js/admin/security-patrol.js @@ -1,5 +1,11 @@ var url = null; var uploadUrl = null; +var PatrolList = null; +var ImgFile = null; +var dateTime; +var longitude = null; //鐧惧害鍦板浘(BD-09)缁忓害 +var latitude = null; //鐧惧害鍦板浘(BD-09)绾害 +//鐢靛瓙宸℃洿璁板綍 var data = { "interfaceId": "5601", "outId": "10601", @@ -10,13 +16,6 @@ "dataTime": "", } }; -var PatrolList = null; -var ImgFile = null; -var dateTime; -var longitude = null; //鐧惧害鍦板浘(BD-09)缁忓害 -var latitude = null; //鐧惧害鍦板浘(BD-09)绾害 -//鐢靛瓙宸℃洿璁板綍 - //鐢靛瓙宸℃洿鎵撳崱 var data1 = { "interfaceId": "5602", diff --git a/igds-app/js/admin/work-apply.js b/igds-app/js/admin/work-apply.js new file mode 100644 index 0000000..6c93a9f --- /dev/null +++ b/igds-app/js/admin/work-apply.js @@ -0,0 +1,249 @@ +var url = null; +//宸ュ崟鐢宠 +var data = { + "interfaceId": "5701", + "outId": "10701", + "reqDateTime": new Date(), + "tokenAuth": "", + "data": { + "depotId": "", + "type": "", + "startTime": "", + "endTime": "", + } +}; +//鑾峰彇搴撳尯鍒楄〃 +var data = { + "interfaceId": "5002", + "outId": "10002", + "reqDateTime": new Date(), + "tokenAuth": "", + "data": { + } +}; + + +function init() { + var user = JSON.parse(localStorage.getItem('user')); + var selectDeptId = JSON.parse(localStorage.getItem('selectDeptId')); + url = user.url + "/api-phone/v35/gateway"; + data.tokenAuth = user.tokenAuth; + // data.data.deptId = selectDeptId; +} + +function chooseDate() { + var dtpicker = new mui.DtPicker({ + type: "date", //璁剧疆鏃ュ巻鍒濆瑙嗗浘妯″紡 + // beginDate: new Date(2015, 04, 25), //璁剧疆寮�濮嬫棩鏈� + // endDate: new Date(2016, 04, 25), //璁剧疆缁撴潫鏃ユ湡 + + }) + dtpicker.show(function(e) { + var date_el = document.getElementById("date1-val") + date_el.innerText = e.value + data.data.startTime = e.value; + jQuery(date_el).prev().hide() + }) +} + +function chooseDate1() { + var dtpicker = new mui.DtPicker({ + type: "date", //璁剧疆鏃ュ巻鍒濆瑙嗗浘妯″紡 + // beginDate: new Date(2015, 04, 25), //璁剧疆寮�濮嬫棩鏈� + // endDate: new Date(2016, 04, 25), //璁剧疆缁撴潫鏃ユ湡 + + }) + dtpicker.show(function(e) { + var date_el = document.getElementById("date2-val") + date_el.innerText = e.value + data.data.endTime = e.value + jQuery(date_el).prev().hide() + }) +} + +//宸ュ崟鐢宠 +function workApply() { + //鍙戦�佽姹傝繘琛屽伐鍗曠敵璇� + mui.ajax(url, { + type: "POST", + dataType: "json", + crossDomain: true, + contentType: "application/json;charset=utf-8", + data: JSON.stringify(data), + success: function(result) { + if (result.code == "0000") { + console.log(JSON.stringify(result)) + } else { + mui.alert(result.msg, '鎻愮ず', ["纭畾"], function() {}, "div"); + } + }, + error: function() { + mui.alert('绯荤粺绻佸繖,璇烽噸鏂扮櫥褰曞皾璇曪紒', '鎻愮ず', ["纭畾"], function() {}, "div"); + } + }) +} + +//鎻愪氦 +mui(".mui-scroll").on("tap", ".wp form .submit", function() { + console.log("111") + workApply(); +}) + +mui('.mui-scroll-wrapper').scroll({ + indicators: false, //鏄惁鏄剧ず婊氬姩鏉� + deceleration: 0.0006, //闃诲凹绯绘暟,绯绘暟瓒婂皬婊戝姩瓒婄伒鏁� + bounce: false, //鏄惁鍚敤鍥炲脊 + deceleration: 0.0005 //flick 鍑忛�熺郴鏁帮紝绯绘暟瓒婂ぇ锛屾粴鍔ㄩ�熷害瓒婃參锛屾粴鍔ㄨ窛绂昏秺灏忥紝榛樿鍊�0.0006 +}); +(function($, doc) { + $.init(); + $.ready(function() { + /** + * 鑾峰彇瀵硅薄灞炴�х殑鍊� + * 涓昏鐢ㄤ簬杩囨护涓夌骇鑱斿姩涓紝鍙兘鍑虹幇鐨勬渶浣庣骇鐨勬暟鎹笉瀛樺湪鐨勬儏鍐碉紝瀹為檯寮�鍙戜腑闇�瑕佹敞鎰忚繖涓�鐐癸紱 + * @param {Object} obj 瀵硅薄 + * @param {String} param 灞炴�у悕 + */ + var _getParam = function(obj, param) { + return obj[param] || ''; + }; + //鏅�氱ず渚� + var userPicker = new $.PopPicker(); + userPicker.setData([{ + value: 'ywj', + text: '钁d簨闀� 鍙舵枃娲�' + }, { + value: 'aaa', + text: '鎬荤粡鐞� 鑹続A' + }, { + value: 'lj', + text: '缃楄緫' + }, { + value: 'ymt', + text: '浜戝ぉ鏄�' + }, { + value: 'shq', + text: '鍙插己' + }, { + value: 'zhbh', + text: '绔犲寳娴�' + }, { + value: 'zhy', + text: '搴勯' + }, { + value: 'gyf', + text: '鍏充竴甯�' + }, { + value: 'zhz', + text: '鏅哄瓙' + }, { + value: 'gezh', + text: '姝岃��' + }]); + var showUserPickerButton = doc.getElementById('ywlx'); + var userResult = doc.getElementById('ywlx-val'); + showUserPickerButton.addEventListener('tap', function(event) { + userPicker.show(function(items) { + // userResult.innerText = JSON.stringify(items[0]); + userResult.innerText = items[0].text; + // userResult.previousSibling.style.display="none" + jQuery(userResult).prev().hide() + //杩斿洖 false 鍙互闃绘閫夋嫨妗嗙殑鍏抽棴 + //return false; + }); + }, false); + //----------------------------------------- + //鎵�灞炲垎搴�: + var picker1 = new $.PopPicker(); + picker1.setData([{ + value: 'ywj', + text: '钁d簨闀� 鍙舵枃娲�' + }, { + value: 'aaa', + text: '鎬荤粡鐞� 鑹続A' + }, { + value: 'lj', + text: '缃楄緫' + }, { + value: 'ymt', + text: '浜戝ぉ鏄�' + }, { + value: 'shq', + text: '鍙插己' + }, { + value: 'zhbh', + text: '绔犲寳娴�' + }, { + value: 'zhy', + text: '搴勯' + }, { + value: 'gyf', + text: '鍏充竴甯�' + }, { + value: 'zhz', + text: '鏅哄瓙' + }, { + value: 'gezh', + text: '姝岃��' + }]); + var showPicker1Button = doc.getElementById('ssfk'); + var picker1Result = doc.getElementById('ssfk-val'); + showPicker1Button.addEventListener('tap', function(event) { + picker1.show(function(items) { + // userResult.innerText = JSON.stringify(items[0]); + picker1Result.innerText = items[0].text; + // userResult.previousSibling.style.display="none" + jQuery(picker1Result).prev().hide() + //杩斿洖 false 鍙互闃绘閫夋嫨妗嗙殑鍏抽棴 + //return false; + }); + }, false); + //----------------------------------------- + //鍏宠仈浠撳簱: + var picker2 = new $.PopPicker(); + picker2.setData([{ + value: 'ywj', + text: '钁d簨闀� 鍙舵枃娲�' + }, { + value: 'aaa', + text: '鎬荤粡鐞� 鑹続A' + }, { + value: 'lj', + text: '缃楄緫' + }, { + value: 'ymt', + text: '浜戝ぉ鏄�' + }, { + value: 'shq', + text: '鍙插己' + }, { + value: 'zhbh', + text: '绔犲寳娴�' + }, { + value: 'zhy', + text: '搴勯' + }, { + value: 'gyf', + text: '鍏充竴甯�' + }, { + value: 'zhz', + text: '鏅哄瓙' + }, { + value: 'gezh', + text: '姝岃��' + }]); + var showPicker2Button = doc.getElementById('glck'); + var picker2Result = doc.getElementById('glck-val'); + showPicker2Button.addEventListener('tap', function(event) { + picker2.show(function(items) { + // userResult.innerText = JSON.stringify(items[0]); + picker2Result.innerText = items[0].text; + // userResult.previousSibling.style.display="none" + jQuery(picker2Result).prev().hide() + //杩斿洖 false 鍙互闃绘閫夋嫨妗嗙殑鍏抽棴 + //return false; + }); + }, false); + + }); +})(mui, document); \ No newline at end of file diff --git a/igds-app/js/admin/work-audit.js b/igds-app/js/admin/work-audit.js new file mode 100644 index 0000000..186708c --- /dev/null +++ b/igds-app/js/admin/work-audit.js @@ -0,0 +1,137 @@ +var url = null; +var auditList = null; +var workAuditData = null; +//宸ュ崟瀹℃牳鍒楄〃 +var data = { + "interfaceId": "5703", + "outId": "10703", + "reqDateTime": new Date(), + "tokenAuth": "", + "data": { + "deptId": "", + } +}; +//宸ュ崟瀹℃牳 +var data1 = { + "interfaceId": "5704", + "outId": "10704", + "reqDateTime": new Date(), + "tokenAuth": "", + "data": { + "id": "", + "status": "" + } +}; + +function init() { + var user = JSON.parse(localStorage.getItem('user')); + var selectDeptId = JSON.parse(localStorage.getItem('selectDeptId')); + url = user.url + "/api-phone/v35/gateway"; + data.tokenAuth = user.tokenAuth; + data1.tokenAuth = user.tokenAuth; + data.data.deptId = selectDeptId; + + getAuditList(); +} + +//鑾峰彇宸ュ崟瀹℃牳鍒楄〃 +function getAuditList() { + mui.ajax(url, { + type: "POST", + dataType: "json", + crossDomain: true, + contentType: "application/json;charset=utf-8", + data: JSON.stringify(data), + success: function(result) { + if (result.code == "0000") { + auditList = result.data; + // console.log(JSON.stringify(auditList)) + renderAuditList(); + } else { + renderAuditList(); + mui.alert(result.msg, '鎻愮ず', ["纭畾"], function() {}, "div"); + + } + }, + error: function() { + renderAuditList(); + mui.alert('绯荤粺绻佸繖,璇烽噸鏂扮櫥褰曞皾璇曪紒', '鎻愮ず', ["纭畾"], function() {}, "div"); + + } + }) +} + +function renderAuditList() { + var html = ''; + if (auditList && auditList.length > 0) { + $.each(auditList, function(index, item) { + html += '<li><div class="con"><div class="top"><div class="left">'; + html += '<div class="line"><div class="t">鐢宠浜�: </div><div class="v">' + item.applyUserName + '</div></div>'; + html += '<div class="line"><div class="t">鎵�灞炲垎搴�:</div><div class="v">' + (item.deptName == null ? "" : item.deptName) + '</div></div></div>'; + html += '<div class="right"><div class="icon" info="' + item.info + '"><img src="images/icons/g-i26.png" alt=""></div></div></div>'; + html += '<div class="box"><ul class="gd-list"><li><a href="" class="con" style="background-image: url(images/icons/a-bg12.png);">'; + html += '<div class="tit">涓氬姟绫诲瀷:</div><div class="name">' + item.type + '</div></a></li>'; + html += '<li><a href="" class="con" style="background-image: url(images/icons/a-bg13.png);">'; + html += '<div class="tit">鍏宠仈浠撳簱:</div><div class="name">' + (item.depotName == null ? "--" : item.depotName) + '</div></a></li></ul>'; + html += '<div class="time">鏈夋晥鏈�: ' + item.startTime + '鑷�' + item.endTime + ' </div>'; + html += '<div class="btns" id="'+ item.id +'"><a href="" class="btn refuse">鎷掔粷</a><a href="" class="btn adopt">閫氳繃</a></div>'; + html += '</div></div></div></li>'; + }) + } else { + html += '<li><div class="con"><div style="text-align: center;font-size: 20px;color:#dd524d;padding: 18px;">鏆傛棤宸ュ崟瀹℃牳淇℃伅</div></div></li>'; + } + $("#handleList").html(html); +} + +//宸ュ崟瀹℃牳 +function workAudit() { + mui.ajax(url, { + type: "POST", + dataType: "json", + crossDomain: true, + contentType: "application/json;charset=utf-8", + data: JSON.stringify(data1), + success: function(result) { + if (result.code == "0000") { + workAuditData = result.data; + // console.log(JSON.stringify(auditList)) + } else { + mui.alert(result.msg, '鎻愮ず', ["纭畾"], function() {}, "div"); + } + }, + error: function() { + mui.alert('绯荤粺绻佸繖,璇烽噸鏂扮櫥褰曞皾璇曪紒', '鎻愮ず', ["纭畾"], function() {}, "div"); + } + }) +} + +//鎷掔粷 +mui(".mui-scroll").on("tap",".wp ul li .refuse",function(){ + var id = this.getAttribute("id"); + data1.data.id = id + data1.data.status = '10' + workAudit(); + console.log("鎷掔粷") +}) + +//閫氳繃 +mui(".mui-scroll").on("tap",".wp ul li .adopt",function(){ + var id = this.getAttribute("id"); + data1.data.id = id + data1.data.status = '20' + workAudit(); + console.log("閫氳繃") +}) +//鏌ョ湅鐢宠鍐呭 +mui(".mui-scroll").on("tap",".wp ul li .icon",function(){ + var info = this.getAttribute("info") + mui.alert(info, '宸ュ崟鍐呭', ["纭畾"], function() {}, "div"); + console.log("鐢宠鍐呭") +}) + +mui('.mui-scroll-wrapper').scroll({ + indicators: false, //鏄惁鏄剧ず婊氬姩鏉� + deceleration: 0.0006, //闃诲凹绯绘暟,绯绘暟瓒婂皬婊戝姩瓒婄伒鏁� + bounce: false, //鏄惁鍚敤鍥炲脊 + deceleration: 0.0005 //flick 鍑忛�熺郴鏁帮紝绯绘暟瓒婂ぇ锛屾粴鍔ㄩ�熷害瓒婃參锛屾粴鍔ㄨ窛绂昏秺灏忥紝榛樿鍊�0.0006 +}); \ No newline at end of file diff --git a/igds-app/js/admin/work-record.js b/igds-app/js/admin/work-record.js new file mode 100644 index 0000000..de11e4c --- /dev/null +++ b/igds-app/js/admin/work-record.js @@ -0,0 +1,86 @@ +var url = null; +var recordList = null; +//鐢宠璁板綍 +var data = { + "interfaceId": "5702", + "outId": "10702", + "reqDateTime": new Date(), + "tokenAuth": "", + "data": { + "userName": "", + } +}; + +function init() { + var user = JSON.parse(localStorage.getItem('user')); + url = user.url + "/api-phone/v35/gateway"; + data.tokenAuth = user.tokenAuth; + data.data.userName = user.userName; + getRecordList(); +} + +//鑾峰彇鐢宠璁板綍鍒楄〃 +function getRecordList() { + mui.ajax(url, { + type: "POST", + dataType: "json", + crossDomain: true, + contentType: "application/json;charset=utf-8", + data: JSON.stringify(data), + success: function(result) { + if (result.code == "0000") { + recordList = result.data; + // console.log(JSON.stringify(recordList)) + renderRecordList(); + } else { + renderRecordList(); + mui.alert(result.msg, '鎻愮ず', ["纭畾"], function() {}, "div"); + } + }, + error: function() { + renderRecordList(); + mui.alert('绯荤粺绻佸繖,璇烽噸鏂扮櫥褰曞皾璇曪紒', '鎻愮ず', ["纭畾"], function() {}, "div"); + } + }) +} + +function renderRecordList() { + var html = ''; + if (recordList && recordList.length > 0) { + $.each(recordList, function(index, item) { + html += '<li><div class="con" info = "' + item.info + '"><span class="status">'; + //宸插鏍� + if (item.status == '10') { + html += '<img src="images/icons/g-i29.png" alt=""></span>' + } else if (item.status == '20') { // 寰呭鏍� + html += '<img src="images/icons/g-i28.png" alt=""></span>' + } + html += '<div class="title">鎵�灞炲垎搴�:<b>' + item.deptName + '</b></div><div class="box"><ul class="gd-list">'; + html += '<li><a href="" class="con"style="background-image: url(images/icons/a-bg12.png);">'; + html += '<div class="tit">涓氬姟绫诲瀷:</div><div class="name">' + item.type + '</div></a></li>'; + html += '<li><a href="" class="con"style="background-image: url(images/icons/a-bg13.png);">'; + html += '<div class="tit">鍏宠仈浠撳簱:</div><div class="name">' + (item.depotName == null ? "--" : item.depotName) + '</div></a></li></ul>'; + html += '<div class="time"><p>鏈夋晥寮�濮嬫椂闂�: <span>' + item.startTime + '</span></p><p>鏈夋晥缁撴潫鏃堕棿: <span>' + + item.endTime + '</span></p></div>'; + }) + } else { + html += + '<li><div class="con"><div style="text-align: center;font-size: 20px;color:#dd524d;padding-top: 18px;">鏆傛棤鐢宠璁板綍淇℃伅</div></div></li>'; + } + $("#handleList").html(html); + +} + +//鏌ョ湅淇℃伅 +mui(".mui-scroll").on("tap",".wp ul li .con",function(){ + var info = this.getAttribute("info"); + mui.alert(info, '宸ュ崟鍐呭', ["纭畾"], function() {}, "div"); + console.log("鏌ョ湅淇℃伅") +}) + +mui('.mui-scroll-wrapper').scroll({ + indicators: false, //鏄惁鏄剧ず婊氬姩鏉� + deceleration: 0.0006, //闃诲凹绯绘暟,绯绘暟瓒婂皬婊戝姩瓒婄伒鏁� + bounce: false, //鏄惁鍚敤鍥炲脊 + deceleration: 0.0005 //flick 鍑忛�熺郴鏁帮紝绯绘暟瓒婂ぇ锛屾粴鍔ㄩ�熷害瓒婃參锛屾粴鍔ㄨ窛绂昏秺灏忥紝榛樿鍊�0.0006 +}); \ No newline at end of file diff --git a/igds-app/work-apply.html b/igds-app/work-apply.html index 8923cb4..89c4aab 100644 --- a/igds-app/work-apply.html +++ b/igds-app/work-apply.html @@ -74,7 +74,8 @@ </div> </div> - <input type="submit" value="鎻愪氦" class="submit" /> + <!-- <input type="submit" value="鎻愪氦" class="submit"/> --> + <div type="submit" class="submit">鎻愪氦</div> </div> </form> @@ -86,197 +87,15 @@ <script src="./js/mui.min.js"></script> <script src="./js/mui.poppicker.js"></script> <script src="./js/mui.picker.min.js"></script> + <script src="./js/admin/work-apply.js"></script> <script src="./js/jquery.js"></script> <script type="text/javascript" charset="utf-8"> mui.init(); - mui('.mui-scroll-wrapper').scroll({ - indicators: false, //鏄惁鏄剧ず婊氬姩鏉� - deceleration: 0.0006, //闃诲凹绯绘暟,绯绘暟瓒婂皬婊戝姩瓒婄伒鏁� - bounce: false, //鏄惁鍚敤鍥炲脊 - deceleration: 0.0005 //flick 鍑忛�熺郴鏁帮紝绯绘暟瓒婂ぇ锛屾粴鍔ㄩ�熷害瓒婃參锛屾粴鍔ㄨ窛绂昏秺灏忥紝榛樿鍊�0.0006 - }); - - function chooseDate() { - var dtpicker = new mui.DtPicker({ - type: "date", //璁剧疆鏃ュ巻鍒濆瑙嗗浘妯″紡 - // beginDate: new Date(2015, 04, 25), //璁剧疆寮�濮嬫棩鏈� - // endDate: new Date(2016, 04, 25), //璁剧疆缁撴潫鏃ユ湡 - - }) - dtpicker.show(function(e) { - var date_el = document.getElementById("date1-val") - date_el.innerText = e.value - jQuery(date_el).prev().hide() - }) - } - - function chooseDate1() { - var dtpicker = new mui.DtPicker({ - type: "date", //璁剧疆鏃ュ巻鍒濆瑙嗗浘妯″紡 - // beginDate: new Date(2015, 04, 25), //璁剧疆寮�濮嬫棩鏈� - // endDate: new Date(2016, 04, 25), //璁剧疆缁撴潫鏃ユ湡 - - }) - dtpicker.show(function(e) { - var date_el = document.getElementById("date2-val") - date_el.innerText = e.value - jQuery(date_el).prev().hide() - }) - } - - (function($, doc) { - $.init(); - $.ready(function() { - /** - * 鑾峰彇瀵硅薄灞炴�х殑鍊� - * 涓昏鐢ㄤ簬杩囨护涓夌骇鑱斿姩涓紝鍙兘鍑虹幇鐨勬渶浣庣骇鐨勬暟鎹笉瀛樺湪鐨勬儏鍐碉紝瀹為檯寮�鍙戜腑闇�瑕佹敞鎰忚繖涓�鐐癸紱 - * @param {Object} obj 瀵硅薄 - * @param {String} param 灞炴�у悕 - */ - var _getParam = function(obj, param) { - return obj[param] || ''; - }; - //鏅�氱ず渚� - var userPicker = new $.PopPicker(); - userPicker.setData([{ - value: 'ywj', - text: '钁d簨闀� 鍙舵枃娲�' - }, { - value: 'aaa', - text: '鎬荤粡鐞� 鑹続A' - }, { - value: 'lj', - text: '缃楄緫' - }, { - value: 'ymt', - text: '浜戝ぉ鏄�' - }, { - value: 'shq', - text: '鍙插己' - }, { - value: 'zhbh', - text: '绔犲寳娴�' - }, { - value: 'zhy', - text: '搴勯' - }, { - value: 'gyf', - text: '鍏充竴甯�' - }, { - value: 'zhz', - text: '鏅哄瓙' - }, { - value: 'gezh', - text: '姝岃��' - }]); - var showUserPickerButton = doc.getElementById('ywlx'); - var userResult = doc.getElementById('ywlx-val'); - showUserPickerButton.addEventListener('tap', function(event) { - userPicker.show(function(items) { - // userResult.innerText = JSON.stringify(items[0]); - userResult.innerText = items[0].text; - // userResult.previousSibling.style.display="none" - jQuery(userResult).prev().hide() - //杩斿洖 false 鍙互闃绘閫夋嫨妗嗙殑鍏抽棴 - //return false; - }); - }, false); - //----------------------------------------- - //鎵�灞炲垎搴�: - var picker1 = new $.PopPicker(); - picker1.setData([{ - value: 'ywj', - text: '钁d簨闀� 鍙舵枃娲�' - }, { - value: 'aaa', - text: '鎬荤粡鐞� 鑹続A' - }, { - value: 'lj', - text: '缃楄緫' - }, { - value: 'ymt', - text: '浜戝ぉ鏄�' - }, { - value: 'shq', - text: '鍙插己' - }, { - value: 'zhbh', - text: '绔犲寳娴�' - }, { - value: 'zhy', - text: '搴勯' - }, { - value: 'gyf', - text: '鍏充竴甯�' - }, { - value: 'zhz', - text: '鏅哄瓙' - }, { - value: 'gezh', - text: '姝岃��' - }]); - var showPicker1Button = doc.getElementById('ssfk'); - var picker1Result = doc.getElementById('ssfk-val'); - showPicker1Button.addEventListener('tap', function(event) { - picker1.show(function(items) { - // userResult.innerText = JSON.stringify(items[0]); - picker1Result.innerText = items[0].text; - // userResult.previousSibling.style.display="none" - jQuery(picker1Result).prev().hide() - //杩斿洖 false 鍙互闃绘閫夋嫨妗嗙殑鍏抽棴 - //return false; - }); - }, false); - //----------------------------------------- - //鍏宠仈浠撳簱: - var picker2 = new $.PopPicker(); - picker2.setData([{ - value: 'ywj', - text: '钁d簨闀� 鍙舵枃娲�' - }, { - value: 'aaa', - text: '鎬荤粡鐞� 鑹続A' - }, { - value: 'lj', - text: '缃楄緫' - }, { - value: 'ymt', - text: '浜戝ぉ鏄�' - }, { - value: 'shq', - text: '鍙插己' - }, { - value: 'zhbh', - text: '绔犲寳娴�' - }, { - value: 'zhy', - text: '搴勯' - }, { - value: 'gyf', - text: '鍏充竴甯�' - }, { - value: 'zhz', - text: '鏅哄瓙' - }, { - value: 'gezh', - text: '姝岃��' - }]); - var showPicker2Button = doc.getElementById('glck'); - var picker2Result = doc.getElementById('glck-val'); - showPicker2Button.addEventListener('tap', function(event) { - picker2.show(function(items) { - // userResult.innerText = JSON.stringify(items[0]); - picker2Result.innerText = items[0].text; - // userResult.previousSibling.style.display="none" - jQuery(picker2Result).prev().hide() - //杩斿洖 false 鍙互闃绘閫夋嫨妗嗙殑鍏抽棴 - //return false; - }); - }, false); - - }); - })(mui, document); + mui.plusReady(function(){ + init(); + }) + </script> </html> diff --git a/igds-app/work-audit.html b/igds-app/work-audit.html index 919005f..ad6bca6 100644 --- a/igds-app/work-audit.html +++ b/igds-app/work-audit.html @@ -22,7 +22,7 @@ <div class="mui-scroll-wrapper g-src_box"> <div class="mui-scroll"> <div class="wp"> - <ul class="ul-gdsh"> + <ul class="ul-gdsh" id="handleList"> <li> <div class="con"> <div class="top"> @@ -37,7 +37,7 @@ </div> </div> <div class="right"> - <div class="icon"> + <div class="icon" info = "11111"> <img src="images/icons/g-i26.png" alt=""> </div> </div> @@ -81,7 +81,7 @@ </div> </div> <div class="right"> - <div class="icon"> + <div class="icon" info = "11111"> <img src="images/icons/g-i26.png" alt=""> </div> </div> @@ -125,7 +125,7 @@ </div> </div> <div class="right"> - <div class="icon"> + <div class="icon" info = "11111"> <img src="images/icons/g-i26.png" alt=""> </div> </div> @@ -163,14 +163,14 @@ </div> </body> <script src="js/mui.min.js"></script> + <script src="js/admin/work-audit.js"></script> + <script src="js/jquery.js"></script> <script type="text/javascript" charset="utf-8"> mui.init(); - mui('.mui-scroll-wrapper').scroll({ - indicators: false, //鏄惁鏄剧ず婊氬姩鏉� - deceleration: 0.0006, //闃诲凹绯绘暟,绯绘暟瓒婂皬婊戝姩瓒婄伒鏁� - bounce: false, //鏄惁鍚敤鍥炲脊 - deceleration: 0.0005 //flick 鍑忛�熺郴鏁帮紝绯绘暟瓒婂ぇ锛屾粴鍔ㄩ�熷害瓒婃參锛屾粴鍔ㄨ窛绂昏秺灏忥紝榛樿鍊�0.0006 - }); + mui.plusReady(function(){ + init(); + }) + </script> </html> \ No newline at end of file diff --git a/igds-app/work-record.html b/igds-app/work-record.html index 592190e..61eeca1 100644 --- a/igds-app/work-record.html +++ b/igds-app/work-record.html @@ -21,9 +21,9 @@ <div class="mui-scroll-wrapper g-src_box"> <div class="mui-scroll"> <div class="wp"> - <ul class="ul-sqjl"> + <ul class="ul-sqjl" id="handleList"> <li> - <div class="con"> + <div class="con" info="111"> <span class="status"> <img src="images/icons/g-i28.png" alt=""> </span> @@ -53,7 +53,7 @@ </div> </li> <li> - <div class="con"> + <div class="con" info="111" > <span class="status"> <img src="images/icons/g-i28.png" alt=""> </span> @@ -83,7 +83,7 @@ </div> </li> <li> - <div class="con"> + <div class="con" info="111"> <span class="status"> <img src="images/icons/g-i29.png" alt=""> </span> @@ -112,7 +112,6 @@ </div> </div> </li> - </ul> </div> @@ -121,14 +120,13 @@ </div> </body> <script src="js/mui.min.js"></script> + <script src="js/jquery.js"></script> + <script src="js/admin/work-record.js"></script> <script type="text/javascript" charset="utf-8"> mui.init(); - mui('.mui-scroll-wrapper').scroll({ - indicators: false, //鏄惁鏄剧ず婊氬姩鏉� - deceleration: 0.0006, //闃诲凹绯绘暟,绯绘暟瓒婂皬婊戝姩瓒婄伒鏁� - bounce: false, //鏄惁鍚敤鍥炲脊 - deceleration: 0.0005 //flick 鍑忛�熺郴鏁帮紝绯绘暟瓒婂ぇ锛屾粴鍔ㄩ�熷害瓒婃參锛屾粴鍔ㄨ窛绂昏秺灏忥紝榛樿鍊�0.0006 - }); + mui.plusReady(function() { + init(); + }) </script> -</html> +</html> \ No newline at end of file -- Gitblit v1.9.3