init
This commit is contained in:
171
src/pages/eqInspection/cols.js
Normal file
171
src/pages/eqInspection/cols.js
Normal file
@@ -0,0 +1,171 @@
|
||||
const cols = [
|
||||
{
|
||||
title: '序号',
|
||||
key: 'index',
|
||||
align: 'center',
|
||||
width: 0
|
||||
},
|
||||
{
|
||||
title: '品名(品号)',
|
||||
key: 'productName',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '品名(料号)',
|
||||
key: 'partName',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '规格',
|
||||
key: 'specification',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '密度',
|
||||
key: 'density',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '门幅',
|
||||
key: 'larghezza',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '品号',
|
||||
key: 'productCode',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '料号',
|
||||
key: 'itemCode',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '分类',
|
||||
key: 'sort',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '克重',
|
||||
key: 'grammage',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '市场报价',
|
||||
key: 'marketPrice',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '加工方式',
|
||||
key: 'processingMode',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '一阶大类',
|
||||
key: 'firstLargeClass',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '添加时间',
|
||||
key: 'createTime',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '厂商编码',
|
||||
key: 'supplierCodename',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '品质',
|
||||
key: 'quality',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '等级',
|
||||
key: 'dominant',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '颜色',
|
||||
key: 'colorCode',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '原料',
|
||||
key: 'stockProduct',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '组织',
|
||||
key: 'tissue',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '仓库数量',
|
||||
key: 'wareNum',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '厂商库存',
|
||||
key: 'factureInventory',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '材料成本价',
|
||||
key: 'costPrice',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '描述信息',
|
||||
key: 'description',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '定做时间(天)',
|
||||
key: 'sustomMadeTime',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '是否现货',
|
||||
key: 'isSpot',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '是否开票',
|
||||
key: 'isBilling',
|
||||
align: 'center',
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '备注',
|
||||
key: 'remark',
|
||||
align: 'center',
|
||||
width: 120
|
||||
}
|
||||
]
|
||||
export default cols
|
||||
165
src/pages/eqInspection/eqInspection.vue
Normal file
165
src/pages/eqInspection/eqInspection.vue
Normal file
@@ -0,0 +1,165 @@
|
||||
<template>
|
||||
<div class="eqInspection">
|
||||
<!-- navbar -->
|
||||
<van-sticky :offset-top="0">
|
||||
<van-nav-bar
|
||||
title="PDA设备巡检记录"
|
||||
left-arrow
|
||||
sticky
|
||||
class="eq-header"
|
||||
@click-left="onClickLeft"
|
||||
/>
|
||||
<!-- @click-right="onClickRight" -->
|
||||
</van-sticky>
|
||||
<van-pull-refresh class="eq-main" v-model="isLoading" @refresh="onRefresh" ref="listMain">
|
||||
<!-- 信息列表主体 -->
|
||||
<water-fall @click.native="getMore" :isOver="isOver"></water-fall>
|
||||
</van-pull-refresh>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { list, eqList } from '@/api/eqInspection'
|
||||
|
||||
export default {
|
||||
name: 'eqInspection',
|
||||
data () {
|
||||
return {
|
||||
queryList: {
|
||||
current: 1,
|
||||
endTime: '',
|
||||
equipmentId: '',
|
||||
size: 10,
|
||||
startTime: ''
|
||||
},
|
||||
isLoading: false,
|
||||
isOver: true,
|
||||
dataList: [],
|
||||
eqList: [],
|
||||
dataOption: {}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.getDataList()
|
||||
this.getEqList()
|
||||
document.querySelector('.eq-main').addEventListener('scroll', this.handleScroll, true)
|
||||
// // 给浏览器加入一个空的历史纪录
|
||||
// window.history.pushState(null, null, document.URL)
|
||||
// // 给window添加一个popstate事件,拦截返回键,执行this.onBrowserBack事件,addEventListener需要指向一个方法
|
||||
// window.addEventListener('popstate', this.onBrowserBack, false)
|
||||
},
|
||||
// destroyed () {
|
||||
// window.removeEventListener('popstate', this.onBrowserBack, false)
|
||||
// document.querySelector('.ol-main').removeEventListener('scroll', this.handleScroll, false)
|
||||
// },
|
||||
methods: {
|
||||
// 浏览器返回按钮监听
|
||||
// onBrowserBack () {
|
||||
// if (this.show || this.showItem || this.showTypeId || this.showTypeCode) {
|
||||
// this.show = false
|
||||
// this.showItem = false
|
||||
// this.showTypeId = false
|
||||
// this.showTypeCode = false
|
||||
// window.history.pushState(null, null, document.URL)
|
||||
// } else {
|
||||
// this.$router.goBack()
|
||||
// }
|
||||
// },
|
||||
// 滚动事件监听
|
||||
handleScroll () {
|
||||
let clientHeight = document.documentElement.clientHeight // 客户区大小
|
||||
let scrollHeight = document.querySelector('.eq-main').scrollHeight // 没用滚动条的情况下,元素内容的总高度
|
||||
let scrollTop = document.querySelector('.eq-main').scrollTop // 被隐藏在内容区域上方的像素数
|
||||
let headerHeight = document.querySelector('.eq-header').offsetHeight// header高度
|
||||
let listHeight = clientHeight - headerHeight // list高度
|
||||
if (scrollTop - (scrollHeight - listHeight) >= -80 && this.isFirstScroll) {
|
||||
this.isFirstScroll = false
|
||||
this.pageNum += 1
|
||||
if (this.isOver) {
|
||||
this.isOver = !this.isOver
|
||||
this.getDataList()
|
||||
setTimeout(() => {
|
||||
this.isFirstScroll = true
|
||||
}, 2000)
|
||||
}
|
||||
}
|
||||
},
|
||||
// 瀑布流点击
|
||||
getMore () {
|
||||
if (this.isOver) {
|
||||
this.queryList.current += 1
|
||||
this.getDataList()
|
||||
}
|
||||
},
|
||||
// 获取信息列表
|
||||
async getDataList () {
|
||||
const result = await list(this.queryList)
|
||||
if (result.success) {
|
||||
this.dataList = result.data.records
|
||||
this.dataOption = result.data
|
||||
if (this.dataOption.total === this.queryList.current) {
|
||||
this.isOver = false
|
||||
} else {
|
||||
this.isOver = true
|
||||
}
|
||||
this.show = false
|
||||
} else {
|
||||
this.isOver = true
|
||||
}
|
||||
},
|
||||
// 获取设备列表
|
||||
async getEqList () {
|
||||
const result = await eqList({
|
||||
current: 1,
|
||||
size: 999
|
||||
})
|
||||
console.log(result)
|
||||
},
|
||||
// 分页器
|
||||
onChange (v) {
|
||||
this.getDataList()
|
||||
},
|
||||
// 返回上一页
|
||||
onClickLeft () {
|
||||
this.$router.goBack()
|
||||
},
|
||||
// 下拉刷新
|
||||
async onRefresh () {
|
||||
this.queryList.current = 1
|
||||
await this.getDataList()
|
||||
this.$toast.success('刷新成功')
|
||||
this.isLoading = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.eqInspection {
|
||||
width: 100%;
|
||||
background: #f5f5f5;
|
||||
.eq-main {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 1.5rem;
|
||||
bottom: 0;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
.eq-header {
|
||||
background: #4271FF;
|
||||
.van-icon {
|
||||
color: #fff;
|
||||
font-size: .5rem;
|
||||
}
|
||||
.van-nav-bar__content {
|
||||
height: 1.5rem;
|
||||
line-height: 1.5rem;
|
||||
.van-nav-bar__title {
|
||||
color: #fff;
|
||||
font-size: .5rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user