qa-regulatory-gwj-app/pages/key-project-management/safety-environmental-inspec.../detail-list.vue

117 lines
3.2 KiB
Vue
Raw Permalink Normal View History

2023-11-07 10:08:37 +08:00
<template>
<view class="content">
<view class="search card">
<u--input
prefixIcon="search"
placeholder="请输入关键字"
border="surround"
v-model="KEYWORDS"
clearable
shape="circle"
></u--input>
<u-button class="bth-mini ml-10" type="success" text="确定" @click="resetList"></u-button>
</view>
<u-list @scrolltolower="scrolltolower" v-if="list.length > 0">
<u-list-item v-for="(item, index) in list" :key="index">
<view>
<view class="flex-between main-title">
<text>{{ item.INSPECTION_PLACE }}</text>
</view>
<view class="flex-between mt-10 subtitle">
<text>
检查状态{{ state[item.INSPECTION_STATUS] }}
</text>
<text>
检查类型{{ item.INSPECTION_TYPE_NAME }}
</text>
</view>
<view class="flex-between mt-10 subtitle">
<text class="u-line-1">检查人{{ item.INSPECTION_USERS }}</text>
</view>
<view class="flex-between mt-10 subtitle">
<text>被检查人{{item.PERSON_NAME}}</text>
</view>
<view class="flex-between mt-10 subtitle">
<text>检查时间{{item.INSPECTION_TIME_START}}-{{item.INSPECTION_TIME_END}}</text>
</view>
<view class="flex-between mt-10 subtitle">
<text>检查隐患数{{item.HIDDEN_COUNT}}</text>
<u-button type="primary" text="查看" size="mini" class="bth-mini" @click="fnNavigatorDetail(item.KEYPROJECTCHECK_ID,'view')"></u-button>
</view>
</view>
</u-list-item>
</u-list>
<empty v-else></empty>
</view>
</template>
<script>
import {getKeyProjectsCheckList} from "../../../api";
export default {
data() {
return {
KEYWORDS: '',
OUTSOURCED_ID: '',
pageSize: 10,
currentPage: 1,
totalPage: 0,
list: [],
state:{
'-1':'检查人驳回',
'0':'待被检查人确认',
'1':'被检查人已确认',
'2':'已归档',
}
}
},
onNavigationBarButtonTap(e) {
if (e.index === 0) {
this.fnNavigatorDetail('', 'add');
}
},
onLoad(e) {
this.OUTSOURCED_ID = e.OUTSOURCED_ID
},
onShow(){
this.resetList()
},
methods:{
async getData(){
let resData = await getKeyProjectsCheckList({
KEYWORDS: this.KEYWORDS,
OUTSOURCED_ID: this.OUTSOURCED_ID,
showCount: this.pageSize,
currentPage: this.currentPage,
});
this.list = [...this.list,...resData.varList];
this.totalPage = resData.page.totalPage;
},
resetList() {
this.pageSize= 10
this.currentPage= 1
this.list = []
this.getData()
},
fnNavigatorDetail(KEYPROJECTCHECK_ID, type) {
uni.$u.route({
url: '/pages/key-project-management/safety-environmental-inspection/detail',
params: {
KEYPROJECTCHECK_ID,
type,
OUTSOURCED_ID:this.OUTSOURCED_ID
}
})
},
scrolltolower() {
this.currentPage++;
if(this.totalPage >= this.currentPage) this.getData();
},
}
}
</script>
<style scoped>
</style>