246 lines
8.0 KiB
Vue
246 lines
8.0 KiB
Vue
<template>
|
||
<view class="content">
|
||
<view class="search card">
|
||
<u--input
|
||
class="ml-10"
|
||
prefixIcon="search"
|
||
placeholder="请输入关键字"
|
||
border="surround"
|
||
v-model="keyword"
|
||
clearable
|
||
shape="circle"
|
||
></u--input>
|
||
<view class="ml-10">
|
||
<u-button class="bth-mini ml-10" type="success" text="确定" @click="resetList"></u-button>
|
||
</view>
|
||
|
||
</view>
|
||
<u-popup :show="popupShow" @close="popupShow = false" mode="right" :customStyle="{width:'85vw'}">
|
||
<view class="card">
|
||
<u--form class="pl-10 pr-10" labelPosition="left">
|
||
<u-form-item label="隐患发现开始时间" borderBottom>
|
||
<u--text :text="DISCOVERYTIME_START || '请选择'"
|
||
@click="startDataShow = true"></u--text>
|
||
<u-datetime-picker :show="startDataShow"
|
||
mode="datetime"
|
||
:value="Number(new Date())"
|
||
@cancel="startDataShow = false"
|
||
@confirm="startDataConfirm"></u-datetime-picker>
|
||
</u-form-item>
|
||
<u-form-item label="隐患发现结束时间" borderBottom>
|
||
<u--text :text="DISCOVERYTIME_END || '请选择'"
|
||
@click="endDataShow = true"></u--text>
|
||
<u-datetime-picker :show="endDataShow"
|
||
mode="datetime"
|
||
:value="Number(new Date())"
|
||
@cancel="endDataShow = false"
|
||
@confirm="endDataConfirm"></u-datetime-picker>
|
||
</u-form-item>
|
||
<u-form-item label="发现人" borderBottom>
|
||
<u--input
|
||
inputAlign="right"
|
||
placeholder="请输入发现人"
|
||
border="none"
|
||
v-model="HIDDENFIND_NAME"
|
||
clearable
|
||
></u--input>
|
||
</u-form-item>
|
||
<u-form-item label="确认人" borderBottom>
|
||
<u--input
|
||
inputAlign="right"
|
||
placeholder="请输入确认人"
|
||
border="none"
|
||
v-model="CONFIRM_USER"
|
||
clearable
|
||
></u--input>
|
||
</u-form-item>
|
||
<u-form-item label="发现人部门" borderBottom>
|
||
<u--text :text="DEPT_NAME || '请选择'" @click="showTree('tkitree')"></u--text>
|
||
<tki-tree ref="tkitree" :range="deptRange" rangeKey="name" selectParent @confirm="confirmTree($event,'dept')"/>
|
||
</u-form-item>
|
||
<u-form-item label="隐患类型" borderBottom>
|
||
<u--text :text="HAZARD_TYPE_NAME || '请选择'" @click="showTree('tkitree1')"></u--text>
|
||
<tki-tree ref="tkitree1" :range="HazardTypeRange" rangeKey="name" selectParent children-name="nodes" @confirm="confirmTree($event,'type')"/>
|
||
</u-form-item>
|
||
</u--form>
|
||
<view class="mt-10 flex-between">
|
||
<u-button type="info" text="重置" class="bth" @click="reset"></u-button>
|
||
<u-button type="primary" text="查询" class="bth ml-10" @click="resetList"></u-button>
|
||
</view>
|
||
</view>
|
||
</u-popup>
|
||
<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.HIDDENDESCR }}</text>
|
||
<u-tag :text="item.NAME" type="warning"></u-tag>
|
||
</view>
|
||
<view class="flex-between mt-10 subtitle">
|
||
<text>
|
||
来源:
|
||
<template v-if="item.SOURCE == 1">隐患快报</template>
|
||
<template v-if="item.SOURCE == 2 || item.SOURCE == 3">清单排查</template>
|
||
<template v-if="item.SOURCE == 4">安全环保检查(监管端)</template>
|
||
<template v-if="item.SOURCE == 5">安全环保检查(企业端)</template>
|
||
<template v-if="item.SOURCE == 6">消防检查</template>
|
||
</text>
|
||
</view>
|
||
<view class="flex-between mt-10 subtitle">
|
||
<text>隐患发现人:{{ item.findUserNames }}</text>
|
||
<text>隐患发现时间:{{ item.DISCOVERYTIME }}</text>
|
||
</view>
|
||
<view class="flex-between mt-10 subtitle">
|
||
<text>隐患确认人:{{ item.CONFIRM_USER }}</text>
|
||
|
||
</view>
|
||
<view class="see_btn">
|
||
<u-button type="primary" text="查看" size="mini" class="bth-mini"
|
||
@click="fnNavigatorDetail(item.HIDDEN_ID)"></u-button>
|
||
</view>
|
||
</view>
|
||
</u-list-item>
|
||
</u-list>
|
||
<empty v-else></empty>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import {getDept, getHiddenType, getIgnoreHiddenList,getCorpinfoDeptListTree} from "../../../api";
|
||
import tkiTree from "@/components/tki-tree/tki-tree.vue"
|
||
|
||
export default {
|
||
components: {tkiTree},
|
||
data() {
|
||
return {
|
||
keyword: '',
|
||
pageSize: 10,
|
||
currentPage: 1,
|
||
totalPage: 0,
|
||
list: [],
|
||
CORPINFO_ID: '',
|
||
popupShow: false,
|
||
startDataShow: false,
|
||
endDataShow: false,
|
||
deptRange: [],
|
||
HazardTypeRange: [],
|
||
DEPT: '',
|
||
DEPT_NAME: '',
|
||
DISCOVERYTIME_START:'',
|
||
DISCOVERYTIME_END:'',
|
||
HIDDENFIND_NAME:'',
|
||
CONFIRM_USER:'',
|
||
HAZARD_TYPE:'',
|
||
HAZARD_TYPE_NAME:'',
|
||
}
|
||
},
|
||
onNavigationBarButtonTap(e) {
|
||
if (e.index === 0) {
|
||
this.popupShow = true;
|
||
}
|
||
},
|
||
onLoad(event) {
|
||
this.CORPINFO_ID = event.CORPINFO_ID;
|
||
this.resetList()
|
||
this.fnGetDept()
|
||
this.fnGetHiddenType()
|
||
},
|
||
methods: {
|
||
async fnGetDept() {
|
||
let resData = await getCorpinfoDeptListTree({'CORPINFO_ID': this.CORPINFO_ID});
|
||
this.deptRange = JSON.parse(resData.zTreeNodes)
|
||
},
|
||
async fnGetHiddenType() {
|
||
let resData = await getHiddenType();
|
||
this.HazardTypeRange = JSON.parse(resData.zTreeNodes)
|
||
},
|
||
async getData() {
|
||
this.popupShow = false
|
||
let resData = await getIgnoreHiddenList({
|
||
CORPINFO_ID: this.CORPINFO_ID,
|
||
DEPTNAME: this.DEPT,
|
||
'DISCOVERYTIME[0]': this.DISCOVERYTIME_START,
|
||
'DISCOVERYTIME[1]': this.DISCOVERYTIME_END,
|
||
HIDDENFIND_NAME: this.HIDDENFIND_NAME,
|
||
confirmUserName: this.CONFIRM_USER,
|
||
keyHiddenType: this.HAZARD_TYPE,
|
||
KEYWORDS: this.keyword,
|
||
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(HIDDEN_ID) {
|
||
uni.$u.route({
|
||
url: '/pages/general-hidden-management/ignore-hidden/detail',
|
||
params: {
|
||
HIDDEN_ID,
|
||
}
|
||
})
|
||
},
|
||
scrolltolower() {
|
||
this.currentPage++;
|
||
if (this.totalPage >= this.currentPage) this.getData();
|
||
},
|
||
showTree(ref) {
|
||
this.$refs[ref]._show()
|
||
},
|
||
confirmTree(e,type) {
|
||
if(type === 'dept') {
|
||
this.DEPT = e[0].id
|
||
this.DEPT_NAME = e[0].name
|
||
} else if(type === 'type') {
|
||
this.HAZARD_TYPE = e[0].id
|
||
this.HAZARD_TYPE_NAME = e[0].name
|
||
}
|
||
},
|
||
startDataConfirm(e){
|
||
this.DISCOVERYTIME_START = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM')
|
||
this.startDataShow = false
|
||
},
|
||
endDataConfirm(e){
|
||
this.DISCOVERYTIME_END = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM')
|
||
this.endDataShow = false
|
||
},
|
||
reset() {
|
||
this.popupShow = false
|
||
this.keyword = ''
|
||
this.DISCOVERYTIME_START = ''
|
||
this.DISCOVERYTIME_END = ''
|
||
this.HIDDENFIND_NAME = ''
|
||
this.CONFIRM_USER = ''
|
||
this.DEPT = ''
|
||
this.DEPT_NAME = ''
|
||
this.HAZARD_TYPE = ''
|
||
this.HAZARD_TYPE_NAME = ''
|
||
this.resetList()
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped lang="scss">
|
||
.search{
|
||
display: flex;
|
||
.ml-10{
|
||
margin-left: 10rpx;
|
||
}
|
||
.bth-mini{
|
||
width: 100rpx;
|
||
}
|
||
|
||
}
|
||
.see_btn{
|
||
width: 100rpx;
|
||
float: right;
|
||
}
|
||
|
||
</style>
|