<template>
|
<view class="content">
|
<view id="divide" style="width: 100%;height: 0rpx;background-color: #e5e5e5;"></view>
|
<view :style="{
|
height: calcContentHeight + 'px',
|
overflowY: 'auto'
|
}">
|
<view class="list" v-for="(item,index) in showList" :key="index" v-if="showList.length>0">
|
<uni-card style="margin: 10px;">
|
<view class="card-detail">
|
<template v-for="(field, index) in CommonUtils.emptyValueFilter(item, HFieldList)">
|
<view v-if="field.ColmType == 'DateTime'" class="detail">
|
<text>{{field.ColmCols}}:</text>{{dayjs(item[field.ColmCols]).format("YYYY-MM-DD HH:mm:ss")}}
|
</view>
|
<view v-else class="detail">
|
<text>{{field.ColmCols}}:</text>{{item[field.ColmCols]}}
|
</view>
|
</template>
|
</view>
|
</uni-card>
|
</view>
|
<view class="over" v-if="showList.length == 0">暂无数据</view>
|
</view>
|
<view class="pagination-zone" id="pagination-zone">
|
<uni-pagination show-icon :page-size="size" :total="dataLength" :current="page"
|
@change="onPaginationChangeHandler"></uni-pagination>
|
</view>
|
<BarCodePopupVue ref="barcodePopup"></BarCodePopupVue>
|
</view>
|
</template>
|
|
<script>
|
import {
|
getUserInfo
|
} from "@/utils/auth.js";
|
import BarCodePopupVue from "@/components/BarCodePopup/BarCodePopup.vue";
|
import {
|
CommonUtils
|
} from "../../../utils/common";
|
import dayjs from "dayjs";
|
export default {
|
data() {
|
return {
|
dayjs,
|
CommonUtils,
|
userInfo: getUserInfo(),
|
serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API',
|
tabs: 0,
|
urls: '/Sc_HEquipStateDistribution/Get_EquipICMOTechParamList_Json',
|
MvarReportTitle: '设备工艺',
|
hform: {
|
HInterID: 0,
|
HICMOInterID: 0,
|
HICMOEntryID: 0,
|
HBillNo: '',
|
HSourceBillNo: '',
|
user: uni.getStorageSync('HUserName'),
|
HStockOrgID: uni.getStorageSync('OrganizationID'),
|
operationType: "4",
|
sWhere: "",
|
},
|
sWhere: '',
|
listData: [],
|
showList: [],
|
HFieldList: [], // 字段列表
|
showDetail: -1,
|
operations: -1,
|
|
page: 1,
|
size: 20,
|
dataLength: 0,
|
divideBottom: 0,
|
paginationTop: 0,
|
showmore: false,
|
}
|
},
|
computed: {
|
calcContentHeight: {
|
get() {
|
return this.paginationTop - this.divideBottom
|
}
|
}
|
},
|
onShow() {
|
//用户模块权限判断
|
// this.changeTab(0)
|
console.log(this.userInfo, uni.getStorageSync('HUserName'))
|
},
|
components: {
|
BarCodePopupVue
|
},
|
onReady() {
|
this.getCalcHeight()
|
},
|
methods: {
|
changeShowMore() {
|
this.showmore = !this.showmore
|
this.$nextTick(() => {
|
// 重新计算内容视口高度
|
this.getCalcHeight()
|
})
|
},
|
getCalcHeight() {
|
let query = uni.createSelectorQuery().in(this)
|
query
|
.select("#divide")
|
.boundingClientRect()
|
.select("#pagination-zone")
|
.boundingClientRect()
|
.exec(res => {
|
this.divideBottom = Math.ceil(res[0].bottom)
|
this.paginationTop = Math.floor(res[1].top)
|
})
|
},
|
async qrCodeDisplay(item) {
|
this.$refs.barcodePopup.setCodeInfo(item.HBillNo)
|
await this.$nextTick()
|
this.$refs.barcodePopup.open()
|
},
|
onPaginationChangeHandler({
|
current
|
}) {
|
this.page = current
|
this.showList = this.getPage(current, this.size, this.listData)
|
},
|
getPage(page, size, list) {
|
let sindex = (parseInt(page) - 1) * size
|
let eindex = parseInt(page) * size
|
let newList = list.slice(sindex, eindex)
|
return newList
|
},
|
changeTab(e) {
|
this.tabs = e
|
this.page = 1
|
this.showList = []
|
|
// if (this.tabs == 0) {
|
// this.urls = '/Sc_HEquipStateDistribution/Get_EquipICMOTechParamList_Json'
|
// }
|
// if (this.tabs == 1) {
|
// this.urls = '/WEBSController/GetKf_ICStockBillQueryList_User_Json'
|
// }
|
this.search()
|
},
|
async getList() {
|
try {
|
let res = await CommonUtils.doRequest2Async({
|
url: this.urls,
|
data: this.hform
|
})
|
|
let {
|
count,
|
data,
|
Message,
|
list
|
} = res.data
|
|
if (count == 1) {
|
if (data == null) {
|
data = []
|
}
|
this.listData = data
|
console.log('data: ', data);
|
this.showList = this.getPage(this.page, this.size, data)
|
this.dataLength = data.length
|
this.HFieldList = CommonUtils.fieldListFilterRole({
|
FieldList: list,
|
ExcludeKeys: []
|
}).data
|
|
console.log('showList: ', this.showList);
|
} else {
|
CommonUtils.showTips({
|
title: "温馨提示",
|
message: `获取设备履历失败: ${Message}`
|
})
|
}
|
} catch (err) {
|
CommonUtils.showTips({
|
title: "温馨提示",
|
message: `获取设备履历失败: ${err}`
|
})
|
}
|
|
},
|
search() {
|
this.hform.sWhere = ''
|
this.listData = []
|
this.page = 1
|
this.showList = []
|
|
this.hform.sWhere = {
|
HEquipID: this.hform.HInterID,
|
HICMOInterID: this.hform.HICMOInterID,
|
HICMOEntryID: this.hform.HICMOEntryID,
|
}
|
|
this.getList()
|
},
|
},
|
onLoad(e) {
|
let {
|
operationType,
|
HEquipID,
|
HICMOInterID,
|
HICMOEntryID
|
} = e
|
if (operationType == 4) {
|
this.hform.HInterID = HEquipID
|
this.hform.HICMOInterID = HICMOInterID
|
this.hform.HICMOEntryID = HICMOEntryID
|
}
|
this.changeTab(0)
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@import "@/pages/MJGL/style/MJListStyle.scss"
|
</style>
|