qa-regulatory-gwj-app/pages/general-hidden-management/general-hidden/detail-list.vue

267 lines
8.6 KiB
Vue
Raw 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="hiddendescr"
2023-11-07 10:08:37 +08:00
clearable
shape="circle"
></u--input>
2024-10-10 10:14:31 +08:00
<view class="bth-mini ml-10">
<u-button type="success" text="确定" @click="resetList"></u-button>
2024-07-27 15:13:42 +08:00
</view>
2023-11-07 10:08:37 +08:00
</view>
<u-popup :show="popupShow" @close="popupShow = false" mode="right" :customStyle="{width:'85vw'}">
<view class="card">
2024-10-10 10:14:31 +08:00
<view class="pl-10 pr-10">
<u--form labelPosition="left">
<u-form-item label="隐患发现开始时间" borderBottom>
<u--text :text="startData || '请选择'"
2024-10-10 10:14:31 +08:00
@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="endData || '请选择'"
2024-10-10 10:14:31 +08:00
@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="creatorName"
2024-10-10 10:14:31 +08:00
clearable
></u--input>
</u-form-item>
<u-form-item label="确认人" borderBottom>
<u--input
inputAlign="right"
placeholder="请输入确认人"
border="none"
v-model="keyConfirmUser"
2024-10-10 10:14:31 +08:00
clearable
></u--input>
</u-form-item>
<u-form-item label="隐患状态" borderBottom>
<u--text :text="stateName || '请选择'" @click="hiddenStatusShow = true"></u--text>
2024-10-10 10:14:31 +08:00
<u-picker :show="hiddenStatusShow" :columns="hiddenStatusList" keyName="NAME"
@cancel="hiddenStatusShow = false"
@confirm="pickerConfirm($event,'hiddenStatus')"></u-picker>
</u-form-item>
<u-form-item label="隐患级别" borderBottom>
<u--text :text="hiddenlevelName || '请选择'" @click="showTree"></u--text>
2024-10-10 10:14:31 +08:00
<tki-tree ref="tkitree" :range="hiddenLevelList" rangeKey="name" selectParent children-name="nodes"
@confirm="confirmTree"/>
</u-form-item>
</u--form>
</view>
2023-11-07 10:08:37 +08:00
<view class="mt-10 flex-between">
2024-10-10 10:14:31 +08:00
<view class="flex1">
<u-button type="info" text="重置" @click="reset"></u-button>
</view>
<view class="ml-10 flex1">
<u-button type="primary" text="查询" @click="resetList"></u-button>
</view>
2023-11-07 10:08:37 +08:00
</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.hiddenDescription }}</text>
<u-tag :text="item.hiddenLevelName" type="warning"></u-tag>
2023-11-07 10:08:37 +08:00
</view>
<view class="flex-between mt-10 subtitle">
<text>
来源
<template v-if="item.hiddenSource === 1"></template>
<template v-if="item.hiddenSource === 2 || item.hiddenSource === 3"></template>
<template v-if="item.hiddenSource === 4">()</template>
<template v-if="item.hiddenSource === 5">()</template>
<template v-if="item.hiddenSource === 6"></template>
2023-11-07 10:08:37 +08:00
</text>
</view>
<view class="flex-between mt-10 subtitle">
<text>隐患发现人{{ item.hiddenDiscoverer }}</text>
<text>隐患发现时间{{ item.hiddenDiscoveryTime }}</text>
2023-11-07 10:08:37 +08:00
</view>
<view class="flex-between mt-10 subtitle">
<text>隐患确认人{{ item.confirmPerson }}</text>
2024-07-27 15:13:42 +08:00
</view>
<view class="see_btn">
2024-10-10 10:14:31 +08:00
<u-button type="primary" text="查看" size="mini"
@click="fnNavigatorDetail(item.hiddenId)"></u-button>
2023-11-07 10:08:37 +08:00
</view>
</view>
</u-list-item>
</u-list>
<empty v-else></empty>
2024-10-10 10:14:31 +08:00
<fab-button type="search" @click="popupShow = true"/>
2023-11-07 10:08:37 +08:00
</view>
</template>
<script>
import {getDept, getGeneralHiddenList, getHiddenLevel} from "@/api";
2024-10-10 10:14:31 +08:00
import FabButton from "@/components/fab_button/index.vue";
2023-11-07 10:08:37 +08:00
export default {
2024-10-10 10:14:31 +08:00
components: {FabButton},
2023-11-07 10:08:37 +08:00
data() {
return {
hiddendescr: '',
limit: 10,
curPage: 1,
2023-11-07 10:08:37 +08:00
totalPage: 0,
list: [{}],
companyId: '',
2023-11-07 10:08:37 +08:00
popupShow: false,
startDataShow: false,
endDataShow: false,
deptRange: [],
startData: '',
endData: '',
creatorName: '',
keyConfirmUser: '',
hiddenlevelName: '',
hiddenlevel: '',
2023-11-07 10:08:37 +08:00
hiddenLevelList: [
{id: 'hiddenLevel1004', name: '轻微隐患'},
{id: 'hiddenLevel1002', name: '一般隐患'},
],
stateName: '',
state: '',
2023-11-07 10:08:37 +08:00
hiddenStatusShow: false,
hiddenStatusList: [
[
{NAME: '待确认', ID: 1},
{NAME: '已确认', ID: 2},
{NAME: '待处置审核', ID: 3},
{NAME: '已处置', ID: 4},
{NAME: '待延期审核', ID: 5},
{NAME: '延期中', ID: 6},
{NAME: '待验收', ID: 7},
{NAME: '验收打回', ID: 8},
{NAME: '已验收', ID: 9}
]
],
}
},
onLoad(event) {
this.companyId = event.companyId;
2023-11-07 10:08:37 +08:00
this.resetList()
this.fnGetDept()
},
methods: {
async fnGetDept() {
let resData = await getDept({'DEPARTMENT_ID': '0'});
this.deptRange = JSON.parse(resData.zTreeNodes)
},
async getData() {
this.popupShow = false
let { page } = await getGeneralHiddenList({
companyId: this.companyId,
dates: this.startData != null && this.startData !== '' && this.endData != null && this.endData !== '' ? [this.startData, this.endData] : null,
creatorName: this.creatorName,
keyConfirmUser: this.keyConfirmUser,
state: this.state,
hiddenlevel: this.hiddenlevel,
hiddendescr: this.hiddendescr,
limit: this.limit,
curPage: this.curPage,
hiddenVueType: "regulatory"
2023-11-07 10:08:37 +08:00
});
this.list = [ ...this.list, ...page.list ];
this.totalPage = page.totalPage;
2023-11-07 10:08:37 +08:00
},
resetList() {
this.limit = 10
this.curPage = 1
2023-11-07 10:08:37 +08:00
this.list = []
this.getData()
},
fnNavigatorDetail(hiddenId) {
2023-11-07 10:08:37 +08:00
uni.$u.route({
url: '/pages/general-hidden-management/general-hidden/detail',
params: {
hiddenId,
2023-11-07 10:08:37 +08:00
}
})
},
scrolltolower() {
this.curPage++;
if (this.totalPage >= this.curPage) this.getData();
2023-11-07 10:08:37 +08:00
},
startDataConfirm(e) {
this.startData = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM')
2023-11-07 10:08:37 +08:00
this.startDataShow = false
},
endDataConfirm(e) {
this.endData = uni.$u.timeFormat(e.value, 'yyyy-mm-dd hh:MM')
2023-11-07 10:08:37 +08:00
this.endDataShow = false
},
pickerConfirm(e, type) {
if (type === 'hiddenStatus') {
this.state = e.value[0].ID
this.stateName = e.value[0].NAME
2023-11-07 10:08:37 +08:00
this.hiddenStatusShow = false;
}
},
showTree() {
this.$refs.tkitree._show()
},
confirmTree(e) {
this.hiddenlevel = e[0].id
this.hiddenlevelName = e[0].name
2023-11-07 10:08:37 +08:00
},
reset() {
this.popupShow = false
this.hiddendescr = ''
this.startData = ''
this.endData = ''
this.creatorName = ''
this.keyConfirmUser = ''
this.state = ''
this.stateName = ''
this.hiddenlevel = ''
this.hiddenlevelName = ''
2023-11-07 10:08:37 +08:00
this.resetList()
}
}
}
</script>
2024-07-27 15:13:42 +08:00
<style scoped lang="scss">
2024-10-10 10:14:31 +08:00
.search {
2024-07-27 15:13:42 +08:00
display: flex;
2024-10-10 10:14:31 +08:00
.ml-10 {
2024-07-27 15:13:42 +08:00
margin-left: 10rpx;
}
2024-10-10 10:14:31 +08:00
.bth-mini {
2024-07-27 15:13:42 +08:00
width: 100rpx;
}
}
2024-10-10 10:14:31 +08:00
.see_btn {
2024-07-27 15:13:42 +08:00
width: 100rpx;
float: right;
}
2023-11-07 10:08:37 +08:00
</style>