qa-regulatory-gwj-app/pages/risk-level-control/risk-management/detail-list.vue

220 lines
6.6 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="keyword"
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>
</view>
2024-07-27 15:13:42 +08:00
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="DEPT_NAME || '请选择'" @click="showTree"></u--text>
<tki-tree ref="tkitree" :range="deptRange" rangeKey="name" selectParent @confirm="confirmTree"/>
</u-form-item>
<u-form-item label="风险点(单元)" borderBottom>
<u--text :text="RISK_UNIT_NAME || '请选择'" @click="riskUnitShow = true"></u--text>
<u-picker :show="riskUnitShow" :columns="riskPointList" keyName="RISKUNITNAME"
@cancel="riskUnitShow = false"
@confirm="pickerConfirm($event,'riskUnit')"></u-picker>
</u-form-item>
<u-form-item label="风险等级" borderBottom>
<u--text :text="LEVEL_NAME || '请选择'" @click="levelShow = true"></u--text>
<u-picker :show="levelShow" :columns="levelList" keyName="NAME"
@cancel="levelShow = false"
@confirm="pickerConfirm($event,'level')"></u-picker>
</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.PARTSNAME }}</text>
<u-tag v-if="item.LEVELID=='levelD'" text="低风险/D级"></u-tag>
<u-tag v-if="item.LEVELID=='levelB'" text="较大风险/B级" type="warning"></u-tag>
<u-tag v-if="item.LEVELID=='levelC'" text="一般风险/C级" bgColor="#eeca51" borderColor="#eeca51"></u-tag>
<u-tag v-if="item.LEVELID=='levelA'" text="重大风险/A级" type="error"></u-tag>
</view>
<view class="flex-between mt-10 subtitle">
<text>风险单元{{ item.RISKUNITNAME }}</text>
</view>
<view class="flex-between mt-10 subtitle">
<text>管控部门{{ item.DEPT_NAME }}</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"
2023-11-07 10:08:37 +08:00
@click="fnNavigatorDetail(item.RISKPOINT_ID,item.DEPARTMENT_ID)"></u-button>
</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>
2024-10-10 10:14:31 +08:00
import {
getDept,
getRiskUnitList,
getRiskUnitCustomizedList,
getCorpInfoListRetrievalDepartment,
getInspectedDepartment
} from "../../../api";
2023-11-07 10:08:37 +08:00
import tkiTree from "@/components/tki-tree/tki-tree.vue"
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, tkiTree},
2023-11-07 10:08:37 +08:00
data() {
return {
keyword: '',
pageSize: 10,
currentPage: 1,
totalPage: 0,
list: [],
CORPINFO_ID: '',
popupShow: false,
riskUnitShow: false,
levelShow: false,
deptRange: [],
riskPointList: [],
levelList: [
[
{BIANMA: 'levelA', NAME: '重大风险'},
{BIANMA: 'levelB', NAME: '较大风险'},
{BIANMA: 'levelC', NAME: '一般风险'},
{BIANMA: 'levelD', NAME: '低风险'},
]
],
DEPT: '',
DEPT_NAME: '',
RISK_UNIT_NAME: '',
LEVEL_ID: '',
LEVEL_NAME: '',
}
},
onLoad(event) {
this.CORPINFO_ID = event.CORPINFO_ID;
this.resetList()
this.fnGetDept()
this.fnGetRiskUnitList()
},
methods: {
async fnGetDept() {
let resData = await getInspectedDepartment({'CORPINFO_ID': this.CORPINFO_ID});
this.deptRange = JSON.parse(resData.zTreeNodes)
},
async fnGetRiskUnitList() {
let resData = await getRiskUnitList({CORPINFO_ID: this.CORPINFO_ID});
this.$set(this.riskPointList, 0, resData.varList)
},
async getData() {
this.popupShow = false
let resData = await getRiskUnitCustomizedList({
CORPINFO_ID: this.CORPINFO_ID,
DEPARTMENT_ID: this.DEPT,
RISKUNITNAME: this.RISK_UNIT_NAME,
LEVELID: this.LEVEL_ID,
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(RISKPOINT_ID, DEPARTMENT_ID) {
uni.$u.route({
url: '/pages/risk-level-control/risk-management/detail',
params: {
RISKPOINT_ID,
DEPARTMENT_ID,
CORPINFO_ID: this.CORPINFO_ID,
}
})
},
scrolltolower() {
this.currentPage++;
if (this.totalPage >= this.currentPage) this.getData();
},
showTree() {
this.$refs.tkitree._show()
},
confirmTree(e) {
this.DEPT = e[0].id
this.DEPT_NAME = e[0].name
},
pickerConfirm(e, type) {
if (type === 'riskUnit') {
this.RISK_UNIT_NAME = e.value[0].RISKUNITNAME
this.riskUnitShow = false;
}
if (type === 'level') {
this.LEVEL_ID = e.value[0].BIANMA
this.LEVEL_NAME = e.value[0].NAME
this.levelShow = false;
}
},
reset() {
this.popupShow = false
this.DEPT = ''
this.DEPT_NAME = ''
this.RISK_UNIT_NAME = ''
this.LEVEL_ID = ''
this.LEVEL_NAME = ''
this.keyword = ''
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 {
//width: 100rpx;
2024-07-27 15:13:42 +08:00
float: right;
}
2023-11-07 10:08:37 +08:00
</style>