pages-index-equipmentStop-equipmentStopDetailAdd-equipmentStopDetailAdd.f1fa9179.js 9.4 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-index-equipmentStop-equipmentStopDetailAdd-equipmentStopDetailAdd"],{4480:function(t,e,a){"use strict";a("b680"),a("e25e"),a("ac1f"),a("5319"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i={data:function(){return{already_time:" ",last_time:" ",today_now:"2019-10-17",dataValue:{}}},onBackPress:function(){return uni.redirectTo({url:"/pages/index/equipmentStop/equipmentStop"}),!0},onLoad:function(t){var e=this,a=e.get_today_now(),i=uni.getStorageSync("g_username"),s=uni.getStorageSync("g_employeId");e.dataValue.g_username=i,e.g_username=i,e.g_employeId=s,e.today_now=a,console.log(t);var n=t.name,o=uni.getStorageSync("g_pastureId"),c="/authdata/GetDataByName",l={name:"findAssetMain",parammaps:{eqCode:n,pastureId:o}};e.ajax(c,l,"POST",e.get_list_data)},methods:{get_list_data:function(t){var e=this;if(console.log("列表数据:",JSON.stringify(t)),null==t.data.list)uni.showToast({title:"暂无数据",icon:"none"});else{var a=t.data.list.length-1;this.dataValue=t.data.list[a];var i=t.data.list[a].enabledTime,s=t.data.list[a].blockTime;console.log("启用时间",i),console.log("停用时间",s);var n=e.get_today_now2(),o=new Date(n.replace(/-/g,"/")).getTime(),c=new Date(i.replace(/-/g,"/")).getTime(),l=new Date(s.replace(/-/g,"/")).getTime(),d=parseInt(o-c)/1e3/60/60,r=parseInt(l-c)/1e3/60/60;console.log("现在时间",n),console.log("已工作时长",d),console.log("上次使用时长",r),r=r.toFixed(2),d=d.toFixed(2),e.already_time=d,e.last_time=r}},formSubmit:function(t){var e=this,a=uni.getStorageSync("g_employeId"),i=uni.getStorageSync("g_pastureId");e.dataValue.employeId=a;var s=e.get_today_now();e.dataValue.inputDatetime=s;var n=e.dataValue.changeStatue;console.log("页面原来的状态:"+n);var o="/authdata/GetDataByName",c={name:"updateEQStartStop",parammaps:{SSPstatue:"启用",id:e.dataValue.eqId,sttId:e.dataValue.sttId,employeId:a,pastureId:i}},l={name:"updateEQStartStop",parammaps:{SSPstatue:"停用",id:e.dataValue.eqId,sttId:e.dataValue.sttId,employeId:a,pastureId:i}};"启用"==n?e.ajax(o,l,"POST",e.get_add_status):e.ajax(o,c,"POST",e.get_add_status),console.log("需要发送的数据:"+JSON.stringify(e.dataValue))},formCancel:function(t){uni.redirectTo({url:"/pages/index/equipmentStop/equipmentStop"})},get_add_status:function(t){if(console.log("保存状态:",t),"ok"==t.msg)uni.showToast({title:"保存成功",duration:500,icon:"none",success:function(t){setTimeout((function(){uni.navigateTo({url:"/pages/index/equipmentStop/equipmentStop"})}),1e3)}});else{var e=t.data;uni.showModal({title:"保存失败",content:e,showCancel:!1,success:function(t){t.confirm&&console.log("用户点击确定")}})}}}};e.default=i},5602:function(t,e,a){"use strict";a.r(e);var i=a("4480"),s=a.n(i);for(var n in i)"default"!==n&&function(t){a.d(e,t,(function(){return i[t]}))}(n);e["default"]=s.a},"5e83":function(t,e,a){"use strict";var i=a("8bcf"),s=a.n(i);s.a},6522:function(t,e,a){var i=a("24fb");e=i(!1),e.push([t.i,".show-bx[data-v-502d734c]{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;padding:%?30?%;-webkit-flex-wrap:wrap;flex-wrap:wrap;width:100%;height:auto;box-sizing:border-box}.item-title[data-v-502d734c]{width:100%;height:%?70?%;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;border-bottom:%?1?% solid #d3d3d3;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between}.item-title uni-text[data-v-502d734c]{font-size:%?32?%;color:#333}.show-item[data-v-502d734c]{width:100%;height:%?70?%;line-height:3}.sh-hd[data-v-502d734c]{font-size:%?28?%;color:#333;margin-right:%?10?%;width:%?200?%;display:inline-block}.sh-bd[data-v-502d734c]{font-size:%?28?%;color:#333}.btn-bx[data-v-502d734c]{width:100%;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-webkit-flex-direction:row;flex-direction:row;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;margin-top:%?40?%}.btn-sub[data-v-502d734c]{width:%?290?%;height:%?86?%;border-radius:%?10?%;background:#169bd5;font-size:%?32?%;color:#fff;margin-right:%?40?%}.btn-res[data-v-502d734c]{width:%?290?%;height:%?86?%;border-radius:%?10?%;background:#f60;font-size:%?32?%;color:#fff}",""]),t.exports=e},"8bcf":function(t,e,a){var i=a("6522");"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var s=a("4f06").default;s("6b05b96a",i,!0,{sourceMap:!1,shadowMode:!1})},b4f2:function(t,e,a){"use strict";a.r(e);var i=a("dcef"),s=a("5602");for(var n in s)"default"!==n&&function(t){a.d(e,t,(function(){return s[t]}))}(n);a("5e83");var o,c=a("f0c5"),l=Object(c["a"])(s["default"],i["b"],i["c"],!1,null,"502d734c",null,!1,i["a"],o);e["default"]=l.exports},dcef:function(t,e,a){"use strict";var i;a.d(e,"b",(function(){return s})),a.d(e,"c",(function(){return n})),a.d(e,"a",(function(){return i}));var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("v-uni-view",{staticClass:"page"},[a("v-uni-view",{staticClass:"grace-list-items",staticStyle:{background:"#fff","margin-bottom":"16upx"}},[a("v-uni-view",{staticClass:"grace-title grace-border-b",staticStyle:{margin:"0 20upx"}},[a("v-uni-text",{staticClass:"grace-icons icon-comments icon grace-blue"}),a("v-uni-text",{staticClass:"title grace-black"},[t._v("设备信息")])],1),a("v-uni-view",{staticClass:"grace-nowrap g-title-bx-row",staticStyle:{padding:"0 20upx"}},[a("v-uni-text",{staticClass:" grace-black9 g-card-w"},[t._v("设备编号:")]),a("v-uni-text",{staticClass:" grace-black5 grace-bold"},[t._v(t._s(t.dataValue.eqCode))])],1),a("v-uni-view",{staticClass:"grace-nowrap g-title-bx-row",staticStyle:{padding:"0 20upx"}},[a("v-uni-text",{staticClass:" grace-black9 g-card-w"},[t._v("设备名称:")]),a("v-uni-text",{staticClass:" grace-black5 grace-bold"},[t._v(t._s(t.dataValue.eqName))])],1),a("v-uni-view",{staticClass:"grace-nowrap g-title-bx-row",staticStyle:{padding:"0 20upx"}},[a("v-uni-text",{staticClass:" grace-black9 g-card-w"},[t._v("资产编号:")]),a("v-uni-text",{staticClass:" grace-black5 grace-bold"},[t._v(t._s(t.dataValue.assetNumber))])],1)],1),a("v-uni-view",{staticClass:"g-line"}),a("v-uni-view",{staticClass:"grace-title grace-border-b",staticStyle:{margin:"0 20upx"}},[a("v-uni-text",{staticClass:"grace-icons icon-article icon grace-blue"}),a("v-uni-text",{staticClass:"title grace-black"},[t._v("任务详情")])],1),a("v-uni-view",{staticClass:"show-bx"},[a("v-uni-view",{staticClass:"show-item grace-border-b"},[a("v-uni-text",{staticClass:"sh-hd"},[t._v("牧场:")]),a("v-uni-text",{staticClass:"sh-bd"},[t._v(t._s(t.dataValue.pastureName))])],1),a("v-uni-view",{staticClass:"show-item grace-border-b"},[a("v-uni-text",{staticClass:"sh-hd"},[t._v("部门:")]),a("v-uni-text",{staticClass:"sh-bd"},[t._v(t._s(t.dataValue.deptName))])],1),a("v-uni-view",{staticClass:"show-item grace-border-b"},[a("v-uni-text",{staticClass:"sh-hd"},[t._v("规格:")]),a("v-uni-text",{staticClass:"sh-bd"},[t._v(t._s(t.dataValue.specification))])],1),a("v-uni-view",{staticClass:"show-item grace-border-b"},[a("v-uni-text",{staticClass:"sh-hd"},[t._v("品牌:")]),a("v-uni-text",{staticClass:"sh-bd"},[t._v(t._s(t.dataValue.brandName))])],1),a("v-uni-view",{staticClass:"show-item grace-border-b"},[a("v-uni-text",{staticClass:"sh-hd"},[t._v("启停状态:")]),a("v-uni-text",{staticClass:"sh-bd"},[t._v(t._s(t.dataValue.changeStatue))])],1),a("v-uni-view",{staticClass:"show-item grace-border-b"},[a("v-uni-text",{staticClass:"sh-hd"},[t._v("启用人:")]),a("v-uni-text",{staticClass:"sh-bd"},[t._v(t._s(t.dataValue.enabledPerson))])],1),a("v-uni-view",{staticClass:"show-item grace-border-b"},[a("v-uni-text",{staticClass:"sh-hd"},[t._v("启用时间:")]),a("v-uni-text",{staticClass:"sh-bd"},[t._v(t._s(t.dataValue.enabledTime))])],1),"停用"==t.dataValue.changeStatue?a("v-uni-view",{staticClass:"show-item grace-border-b"},[a("v-uni-text",{staticClass:"sh-hd"},[t._v("停用人:")]),a("v-uni-text",{staticClass:"sh-bd"},[t._v(t._s(t.dataValue.blockPerson))])],1):t._e(),"停用"==t.dataValue.changeStatue?a("v-uni-view",{staticClass:"show-item grace-border-b"},[a("v-uni-text",{staticClass:"sh-hd"},[t._v("停用时间:")]),a("v-uni-text",{staticClass:"sh-bd"},[t._v(t._s(t.dataValue.blockTime))])],1):t._e(),"停用"==t.dataValue.changeStatue?a("v-uni-view",{staticClass:"show-item grace-border-b"},[a("v-uni-text",{staticClass:"sh-hd"},[t._v("上次使用时长:")]),a("v-uni-text",{staticClass:"sh-bd"},[t._v(t._s(void 0==t.last_time?" ":t.last_time+"小时"))])],1):t._e(),"启用"==t.dataValue.changeStatue?a("v-uni-view",{staticClass:"show-item grace-border-b"},[a("v-uni-text",{staticClass:"sh-hd"},[t._v("已工作时长:")]),a("v-uni-text",{staticClass:"sh-bd"},[t._v(t._s(void 0==t.already_time?" ":t.already_time+"小时"))])],1):t._e(),a("v-uni-form",{on:{submit:function(e){arguments[0]=e=t.$handleEvent(e),t.formSubmit.apply(void 0,arguments)}}},[a("v-uni-view",{staticClass:"btn-bx"},[a("v-uni-button",{staticClass:"btn-sub",attrs:{formType:"submit"}},[t._v(t._s("启用"==t.dataValue.changeStatue?"停用":"启用"))]),a("v-uni-button",{staticClass:"btn-res",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.formCancel.apply(void 0,arguments)}}},[t._v("取消")])],1)],1)],1)],1)},n=[]}}]);