1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- !function(){
- var httpData=GetRequest();
- var userInfo = JSON.parse(window.localStorage.getItem(httpRequest.agentName));
- //设置网页打印的页眉页脚为空
- function PageSetup_Null() {
- var HKEY_Root,HKEY_Path,HKEY_Key;
- HKEY_Root="HKEY_CURRENT_USER";
- HKEY_Path="\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
- try {
- var Wsh = new ActiveXObject("WScript.Shell");
- HKEY_Key="header";
- Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
- HKEY_Key="footer";
- Wsh.RegWrite(HKEY_Root+HKEY_Path+HKEY_Key,"");
- window.print();
- } catch(e) {
- window.print();
- }
- }
- function bindEvent() {
- $("#printBtn").click(function() {
- var bdhtml = window.document.body.innerHTML,
- sprnstr = "<!--startprint-->",
- eprnstr = "<!--endprint-->",
- prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17);
- prnhtml=prnhtml.substring(0, prnhtml.indexOf(eprnstr));
- window.document.body.innerHTML = prnhtml;
- PageSetup_Null();
- })
- }
- new Vue({
- el:"#app",
- data:{
- accountList: {}
- },
- mounted:function(){
- this.getServiceItemsAfterStop()
- bindEvent()
- },
- methods:{
- getServiceItemsAfterStop: function() {
- var vm = this,
- loadding = layer.load(0, {shade: false}); //0代表加载的风格,支持0-2
- rehaAPI.getServiceItemsAfterStop({planId: httpData.planids}).then(function(res){
- layer.close(loadding);
- if(res.status==200){
- vm.accountList = res.data
- }else{
- layer.msg(res.msg,{icon:5});
- }
- })
- }
- },
- filters:{
- formatDate:function(value, format) {
- if(!value) return ;
- var fmt=format || "yyyy-MM-dd hh:mm";
- var date = new Date(value);
- if (/(y+)/.test(fmt)) {
- fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
- }
- let o = {
- 'M+': date.getMonth() + 1,
- 'd+': date.getDate(),
- 'h+': date.getHours(),
- 'm+': date.getMinutes(),
- 's+': date.getSeconds()
- };
- for (let k in o) {
- if (new RegExp(`(${k})`).test(fmt)) {
- let str = o[k] + '';
- fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : ('00' + str).substr(str.length));
- }
- }
- return fmt;
- },
- getImgUrl: function(value) {
- var url = httpRequest.getImgUrl(value);
- return url;
- }
- }
- })
- }();
|