You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

153 lines
4.1 KiB

<template>
<view class="details">
<view class="search" v-show="!show">
<u-icon name="scan" color="#578af8" size="100" @click="scan"></u-icon>
</view>
<u-loading-icon size="60" color="#578af8" :show="loading"></u-loading-icon>
<!-- 设备信息 -->
<view class="main" v-show="show">
<u--form labelPosition="left" labelAlign="center" :model="detail" ref="form1" >
<u-form-item label="卡片号码" prop="detail.assetNumber" labelWidth="auto" borderBottom ref="item1" >
<u--input v-model="detail.assetNumber" border="none" placeholder=" "></u--input>
</u-form-item>
<u-form-item label="资产名称" prop="detail.name" labelWidth="auto" borderBottom ref="item1" >
<u--input v-model="detail.name" border="none" placeholder=" "></u--input>
</u-form-item>
<u-form-item label="资产型号" prop="detail.specifications" labelWidth="auto" borderBottom ref="item1" >
<u--input v-model="detail.specifications" border="none" placeholder=" "></u--input>
</u-form-item>
<u-form-item label="资产品牌" prop="detail.brand" labelWidth="auto" borderBottom ref="item1" >
<u--input v-model="detail.brand" border="none" placeholder=" "></u--input>
</u-form-item>
<u-form-item label="资产金额" prop="detail.amount" labelWidth="auto" borderBottom ref="item1" >
<u--input v-model="detail.amount" border="none" placeholder=" "></u--input>
</u-form-item>
<u-form-item label="资产归属" prop="detail.belongTo" labelWidth="auto" borderBottom ref="item1" >
<u--input v-model="detail.belongTo" border="none" placeholder=" "></u--input>
</u-form-item>
<u-form-item label="取得日期" prop="detail.getDate" labelWidth="auto" borderBottom ref="item1" >
<u--input v-model="detail.getDate" border="none" placeholder=" "></u--input>
</u-form-item>
<u-form-item label="使用部门" prop="detail.deptName" labelWidth="auto" borderBottom ref="item1" >
<u--input v-model="detail.deptName" border="none" placeholder=" "></u--input>
</u-form-item>
<u-form-item label="资产状态" prop="detail.statusName" labelWidth="auto" borderBottom ref="item1" >
<u--input v-model="detail.statusName" border="none" placeholder=" "></u--input>
</u-form-item>
</u-form-item>
</u--form>
</view>
<view class="submit" v-show="show" >
<u-button type="primary" text="查 询" @click="scan"></u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
show: false,
detail: {
detailsId: null,
statusName: null,
picUrl:''
},
useUserId: null,
nickName: '',
inspectionList: [],
done: 0,
undo: 0,
showStatus: false,
actions: [
{
name: '正常',
value: 0
},
{
name: '故障',
value: 1
}
],
loading: false
}
},
onLoad: function() {
},
onPullDownRefresh(){
// this.stopPullDownRefresh()
},
methods: {
scan() {
var that = this;
uni.scanCode({
success: function(res) {
that.getdeviceinfo(res.result)
}
})
},
async getdeviceinfo(msg) {
this.show = true;
this.loading = true;
let id = msg;
let link = '';
if(msg.indexOf("http")>-1){
link = msg.substring(msg.lastIndexOf("//")+2);
id = '0';
}
const { data:res } = await this.$http('/search', {
'assetId': id,
'remark': link
});
if(res.code) return
this.detail = res.asset;
this.detail.statusName = res.asset.status == 1 ? '故障' : '正常'
this.loading = false;
},
}
}
</script>
<style lang="scss">
.details {
background: #f6f6f6;
height: 100vh;
.search{
.u-icon{
justify-content: center;
padding-top: 40vh;
}
}
.u-loading-icon{
position: absolute;
top: 40vh;
left: 42.5vw;
}
.main {
background: #ffffff;
margin: 2.667vw;
padding: 2vw;
border-radius: 8px;
.u-form-item__body__right{
padding-left: 20vw;
}
}
.submit{
margin: 1vh 2.667vw;
}
.popup{
padding: 3vw 0;
.u-text{
justify-content: center !important;
margin-bottom: 3vw !important;
}
}
}
</style>