|
@@ -10,12 +10,12 @@
|
|
|
<img v-on:click.stop="showList()" class="btn_img" src="../../assets/image/add.png">
|
|
|
<div class="btn_list" v-show="popupVisible">
|
|
|
<div v-if="power.indexOf('registered_assets') > -1" v-on:click="register()"><img src="../../assets/image/register.png">登记资产</div>
|
|
|
- <div v-on:click="exportExcel()"><img src="../../assets/image/export.png">导出报表</div>
|
|
|
+ <div v-if="tagId != -2 && tagId != -3" v-on:click="exportExcel()"><img src="../../assets/image/export.png">导出报表</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="searchkey">
|
|
|
<div class="searchkey_word">
|
|
|
- <a v-for="(item,index) in labels" :id="item.id" v-bind:class="{'active':item.id==tagId}" v-on:click="chooseTag(item.id,1)">{{item.name}}</a>
|
|
|
+ <a v-for="(item,index) in labels" :id="'tag' + item.id" v-bind:class="{'active':item.id==tagId}" v-on:click="chooseTag(item.id,1)">{{item.name}}</a>
|
|
|
</div>
|
|
|
<div class="searchkey_btn">
|
|
|
<img v-on:click="showFilter()" src="../../assets/image/pull_down.png">
|
|
@@ -28,11 +28,11 @@
|
|
|
</ul>
|
|
|
</section>
|
|
|
<div class="body">
|
|
|
- <div class="noList" v-if="list.length==0">
|
|
|
+ <!-- <div class="noList" v-if="list.length==0">
|
|
|
<img src="../../assets/image/noList.png">
|
|
|
- </div>
|
|
|
- <ul v-else v-infinite-scroll="loadMore" infinite-scroll-disabled="loading" infinite-scroll-distance="10">
|
|
|
- <li v-for="item in list" v-on:click="jumpTo(item.id)">
|
|
|
+ </div> v-else -->
|
|
|
+ <ul v-infinite-scroll="loadMore" infinite-scroll-disabled="loading" infinite-scroll-distance="10" :class="tagId==-2||tagId==-3?'isFrame':''">
|
|
|
+ <li v-if="tagId != -2 && tagId != -3" v-for="item in list" v-on:click="jumpTo(item.id)">
|
|
|
<div class="item_img">
|
|
|
<img v-if="item.pic != null" v-lazy="item.pic">
|
|
|
<img v-else src="../../assets/image/noPic.png">
|
|
@@ -41,6 +41,57 @@
|
|
|
<div class="text item_int">{{item.modelNumber}}</div>
|
|
|
<div class="text item_num">{{item.goodsNos.length}}{{item.unit}}</div>
|
|
|
</li>
|
|
|
+ <li v-if="tagId == -2" v-for="item in list" class="one_frame" v-on:click="jumpToFrame(item.id)">
|
|
|
+ <div class="frame_title">
|
|
|
+ <span>{{item.name}}</span>
|
|
|
+ <span>
|
|
|
+ <mt-button v-if="item.doorStatus==0" size="small" type="primary" v-on:click.native.stop="openDoor(item.id)">开门</mt-button>
|
|
|
+ <span v-else style="color:red">已开门</span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="frame_number">{{item.modelNumber}}</div>
|
|
|
+ <div class="frame_label">
|
|
|
+ <span><span>机架ID:</span>{{item.rackId}}</span>
|
|
|
+ <span><span>温度:</span>{{item.temp}}</span>
|
|
|
+ <span><span>湿度:</span>{{item.hum}}</span>
|
|
|
+ </div>
|
|
|
+ <div class="frame_detail"> 查看详情 > </div>
|
|
|
+ </li>
|
|
|
+ <li v-if="tagId == -3" v-for="item in list" class="one_device">
|
|
|
+ <mt-cell-swipe :id="'dev' + item.id" v-if="item.goodsId == null" title=""
|
|
|
+ :right="[{ content: '上架', style: { background: '#2680EB', color: '#fff' }, handler: () => chooseDevice(item.id) }]">
|
|
|
+ <div style="width: 100%;">
|
|
|
+ <div class="new_title">
|
|
|
+ <span>{{item.deviceName}}</span>
|
|
|
+ <span>{{item.modelNo}}</span>
|
|
|
+ <span>{{item.currentState==0?'禁止':'运行'}}</span>
|
|
|
+ </div>
|
|
|
+ <div class="new_label">
|
|
|
+ <span><span>标签ID:</span>{{item.labelId}}</span>
|
|
|
+ <span><span>模块ID:</span>{{item.modelId}}</span>
|
|
|
+ <span><span>U位号:</span>{{item.ubitNum}}</span>
|
|
|
+ <!-- <span><span>机架ID:</span>{{item.rackId}}</span> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </mt-cell-swipe>
|
|
|
+ <mt-cell-swipe :id="'dev' + item.id" v-else title=""
|
|
|
+ :right="[{ content: '下架', style: { background: 'red', color: '#fff' }, handler: () => handle(item.id) }]">
|
|
|
+ <div style="width: 100%;">
|
|
|
+ <div class="new_title">
|
|
|
+ <span>{{item.deviceName}}</span>
|
|
|
+ <span>{{item.modelNo}}</span>
|
|
|
+ <span>{{item.currentState==0?'禁止':'运行'}}</span>
|
|
|
+ </div>
|
|
|
+ <div class="new_label">
|
|
|
+ <span><span>标签ID:</span>{{item.labelId}}</span>
|
|
|
+ <span><span>模块ID:</span>{{item.modelId}}</span>
|
|
|
+ <span><span>U位号:</span>{{item.ubitNum}}</span>
|
|
|
+ <span><span>机架ID:</span>{{item.rackId}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </mt-cell-swipe>
|
|
|
+ </li>
|
|
|
+
|
|
|
<div class="order" v-if="haveMore">
|
|
|
<span class="line"></span>
|
|
|
<span class="txt">没有更多了</span>
|
|
@@ -53,7 +104,7 @@
|
|
|
|
|
|
<script>
|
|
|
import util from '../../common/js/util'
|
|
|
-
|
|
|
+ import { MessageBox } from 'mint-ui';
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -73,16 +124,23 @@
|
|
|
// 资产列表
|
|
|
getList() {
|
|
|
this.$indicator.open();
|
|
|
+ var tagId = this.tagId==-1?"":this.tagId;
|
|
|
+ if(tagId == -2) {
|
|
|
+ tagId = -1
|
|
|
+ } else if(tagId == -3) {
|
|
|
+ tagId = -2
|
|
|
+ }
|
|
|
this.http.post(this.port.assets.list, {
|
|
|
'keyName': this.keyWord,
|
|
|
- 'tagId': this.tagId==-1?"":this.tagId,
|
|
|
- 'pageNum': this.pageNum
|
|
|
+ 'tagId': tagId,
|
|
|
+ 'pageNum': 1
|
|
|
} ,
|
|
|
res => {
|
|
|
this.$indicator.close();
|
|
|
if (res.code == "ok") {
|
|
|
this.list = res.data.list;
|
|
|
this.pages = res.data.pages==0?1:res.data.pages;
|
|
|
+ document.querySelector("#tag"+this.tagId).scrollIntoView(true);
|
|
|
} else {
|
|
|
this.$toast({
|
|
|
message: res.msg,
|
|
@@ -103,9 +161,15 @@
|
|
|
this.haveMore = true;
|
|
|
} else if(this.pageNum < this.pages) {
|
|
|
this.$indicator.open();
|
|
|
+ var tagId = this.tagId==-1?"":this.tagId;
|
|
|
+ if(tagId == -2) {
|
|
|
+ tagId = -1
|
|
|
+ } else if(tagId == -3) {
|
|
|
+ tagId = -2
|
|
|
+ }
|
|
|
this.http.post(this.port.assets.list, {
|
|
|
'keyName': this.keyWord,
|
|
|
- 'tagId': this.tagId==-1?"":this.tagId,
|
|
|
+ 'tagId': tagId,
|
|
|
'pageNum': ++this.pageNum
|
|
|
} ,
|
|
|
res => {
|
|
@@ -139,7 +203,7 @@
|
|
|
res => {
|
|
|
if (res.code == "ok") {
|
|
|
this.getList();
|
|
|
- var array = [{"id":-1 , "name": "全部"}];
|
|
|
+ var array = [{"id":-1 , "name": "全部"},{"id":-2,"name":"机架"},{"id":-3,"name":"机架设备"}];
|
|
|
for(var i in res.data) {
|
|
|
array.push(res.data[i]);
|
|
|
}
|
|
@@ -191,7 +255,8 @@
|
|
|
chooseTag(id,type) {
|
|
|
$("#"+id).addClass("active").siblings("a").removeClass("active");
|
|
|
$("#btn"+id).addClass("active").siblings().removeClass("active");
|
|
|
- location.href = "#" + id;
|
|
|
+ // location.href = "#" + id;
|
|
|
+ document.querySelector("#tag"+id).scrollIntoView(true);
|
|
|
sessionStorage.assetsTab = id;
|
|
|
$("._sorting-medical").removeClass("fixed-top");
|
|
|
$(".searchkey_btn img").removeClass("rotate")
|
|
@@ -199,20 +264,176 @@
|
|
|
$(this).removeClass("current");
|
|
|
$("._sorting-address").removeClass("fixed-top");
|
|
|
$('._navbar').attr('style','position: fixed;top:0;');
|
|
|
- this.pageNum = 1;
|
|
|
this.pages = 1;
|
|
|
this.tagId = id;
|
|
|
this.getList();
|
|
|
},
|
|
|
|
|
|
+ // 开关门
|
|
|
+ openDoor(id) {
|
|
|
+ MessageBox.confirm('', {
|
|
|
+ message: '是否打开机柜?',
|
|
|
+ title: '',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消'
|
|
|
+ }).then(action => {
|
|
|
+ if (action == 'confirm') { //确认的回调
|
|
|
+ this.http.post(this.port.assets.openDoor, {
|
|
|
+ 'goodsId': id,
|
|
|
+ 'doorStatus': 1
|
|
|
+ } ,
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$toast({
|
|
|
+ message: "开门成功",
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ this.pageNum = 1;
|
|
|
+ this.getLabels();
|
|
|
+ } else {
|
|
|
+ this.$toast({
|
|
|
+ message: res.msg,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, error => {
|
|
|
+ this.$toast({
|
|
|
+ message: error,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 上架
|
|
|
+ chooseDevice(id) {
|
|
|
+ var _this = this;
|
|
|
+ this.http.post(this.port.assets.rackList, {
|
|
|
+ 'tagId': -1
|
|
|
+ } ,
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ var list = res.data;
|
|
|
+ var data = [];
|
|
|
+ for(var i in list) {
|
|
|
+ data.push({
|
|
|
+ 'id': list[i].id,
|
|
|
+ 'name': list[i].name
|
|
|
+ })
|
|
|
+ }
|
|
|
+ var pickerDiv = document.getElementById("dev"+id);
|
|
|
+ var pickerView = new PickerView({
|
|
|
+ bindElem: pickerDiv,
|
|
|
+ data: data,
|
|
|
+ title: "机架列表",
|
|
|
+ leftText: "取消",
|
|
|
+ rightText: "确定",
|
|
|
+ rightFn: function(selectArr) {
|
|
|
+ _this.setDevice(id,selectArr[0].id,selectArr[0].name);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$toast({
|
|
|
+ message: res.msg,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, error => {
|
|
|
+ this.$toast({
|
|
|
+ message: error,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ setDevice(id,goodsId,name) {
|
|
|
+ MessageBox.confirm('', {
|
|
|
+ message: '是否上架至 "'+ name +'" 设备?',
|
|
|
+ title: '',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消'
|
|
|
+ }).then(action => {
|
|
|
+ if (action == 'confirm') { //确认的回调
|
|
|
+ this.http.post(this.port.assets.upMold, {
|
|
|
+ 'id': id,
|
|
|
+ 'goodsId': goodsId
|
|
|
+ } ,
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$toast({
|
|
|
+ message: "上架成功",
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.$toast({
|
|
|
+ message: res.msg,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, error => {
|
|
|
+ this.$toast({
|
|
|
+ message: error,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 下架设备
|
|
|
+ handle(id) {
|
|
|
+ MessageBox.confirm('', {
|
|
|
+ message: '是否下架该设备?',
|
|
|
+ title: '',
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消'
|
|
|
+ }).then(action => {
|
|
|
+ if (action == 'confirm') { //确认的回调
|
|
|
+ this.http.post(this.port.assets.upMold, {
|
|
|
+ 'id': id
|
|
|
+ } ,
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$toast({
|
|
|
+ message: "下架成功",
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.$toast({
|
|
|
+ message: res.msg,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, error => {
|
|
|
+ this.$toast({
|
|
|
+ message: error,
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 路由跳转
|
|
|
jumpTo(id) {
|
|
|
this.$router.push("/detail/" + id);
|
|
|
},
|
|
|
+
|
|
|
+ jumpToFrame(id) {
|
|
|
+ this.$router.push("/detailFrame/" + id);
|
|
|
+ },
|
|
|
|
|
|
register() {
|
|
|
this.$router.push("/assetsRegister");
|
|
|
},
|
|
|
|
|
|
+ // 导出
|
|
|
exportExcel() {
|
|
|
this.$indicator.open();
|
|
|
this.http.downloadFile(this.port.assets.listExcel, {
|
|
@@ -584,5 +805,156 @@
|
|
|
font-size: 0.13rem;
|
|
|
vertical-align: middle;
|
|
|
}
|
|
|
+
|
|
|
+ .body > ul.isFrame {
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .body > ul.isFrame > li {
|
|
|
+ border-radius: 0;
|
|
|
+ margin: 0;
|
|
|
+ width: 100%;
|
|
|
+ padding: 0;
|
|
|
+ display: block;
|
|
|
+ margin-bottom: 0.08rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ .new_title {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .new_label {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .new_title > span {
|
|
|
+ padding: 0.12rem 0;
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: bottom;
|
|
|
+ }
|
|
|
+
|
|
|
+ .new_title > span:nth-child(1) {
|
|
|
+ max-width: 40%;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ color: #333;
|
|
|
+ font-size: 0.15rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ .new_title > span:nth-child(2) {
|
|
|
+ max-width: 40%;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
+
|
|
|
+ .new_title > span:nth-child(3) {
|
|
|
+ float: right;
|
|
|
+ color: #2680EB;
|
|
|
+ }
|
|
|
+
|
|
|
+ .new_label > span {
|
|
|
+ display: inline-block;
|
|
|
+ padding: 0 0 0.05rem 0;
|
|
|
+ width: 49%;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
+
|
|
|
+ .new_label > span > span {
|
|
|
+ color: #555;
|
|
|
+ font-size: 0.13rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ .body > ul.isFrame > li.one_frame {
|
|
|
+ padding: 0 0.08rem;
|
|
|
+ box-sizing:border-box;
|
|
|
+ }
|
|
|
+
|
|
|
+ .frame_title > span {
|
|
|
+ padding: 0.12rem 0 0 0;
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: bottom;
|
|
|
+ }
|
|
|
+
|
|
|
+ .frame_title > span:nth-child(1) {
|
|
|
+ display: inline-block;
|
|
|
+ width: 70%;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ color: #333;
|
|
|
+ font-size: 0.15rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ .frame_title > span:nth-child(2) {
|
|
|
+ float: right;
|
|
|
+ color: #2680EB;
|
|
|
+ padding: 0.1rem 0 0 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .frame_number {
|
|
|
+ padding: 0.05rem 0;
|
|
|
+ color: #999;
|
|
|
+ }
|
|
|
+
|
|
|
+ .frame_label {
|
|
|
+ padding: 0 0 0.05rem 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .frame_label > span {
|
|
|
+ display: inline-block;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ color: #888;
|
|
|
+ }
|
|
|
+
|
|
|
+ .frame_label > span:nth-child(1) {
|
|
|
+ width: 40%;
|
|
|
+ float: left;
|
|
|
+ }
|
|
|
+
|
|
|
+ .frame_label > span:nth-child(2) {
|
|
|
+ width: 30%;
|
|
|
+ float: left;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+
|
|
|
+ .frame_label > span:nth-child(3) {
|
|
|
+ width: 30%;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+
|
|
|
+ .frame_label > span > span {
|
|
|
+ color: #555;
|
|
|
+ font-size: 0.13rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ .frame_detail {
|
|
|
+ text-align: right;
|
|
|
+ padding: 0 0.01rem 0.05rem;
|
|
|
+ color: #2680EB;
|
|
|
+ font-size: 0.13rem;
|
|
|
+ }
|
|
|
/* 列表页 END */
|
|
|
+</style>
|
|
|
+<style>
|
|
|
+ .isFrame .mint-cell-swipe-button {
|
|
|
+ line-height: 0.87rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ .frame_title > span:nth-child(2) .mint-button--small {
|
|
|
+ height: 0.25rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ .one_device .mint-cell-title {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ .one_device .mint-cell-value {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
</style>
|