| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- <template>
- <div class="paper-table">
- <el-table
- ref="elTable"
- :data="tableList"
- border
- stripe
- highlight-current-row
- header-row-class-name="exam-table-header"
- style="width: 100%"
- class="exam-table"
- >
- <el-table-column label="序号" type="index" width="80" />
- <el-table-column prop="bian_zhi_ren_" label="评估人" width="100">
- <template slot-scope="{row}">
- <ibps-user-selector
- type="user"
- :value="row.bian_zhi_ren_"
- readonly-text="text"
- :disabled="true"
- :multiple="false"
- />
- </template>
- </el-table-column>
- <el-table-column prop="bian_zhi_bu_men_" label="部门" width="140">
- <template slot-scope="{row}">
- <ibps-user-selector
- type="position"
- :value="row.bian_zhi_bu_men_"
- readonly-text="text"
- :disabled="true"
- :multiple="false"
- />
- </template>
- </el-table-column>
- <el-table-column prop="feng_xian_shu_" label="风险数" width="80" />
- <el-table-column prop="feng_xian_c_" label="风险等级分布情况" />
- <el-table-column prop="shi_fou_guo_shen_" label="识别状态" width="140">
- <template slot-scope="{row}">
- <el-tag :type="row.shi_fou_guo_shen_==='已完成'?'success':'danger'">{{ row.shi_fou_guo_shen_ }}</el-tag>
- </template>
- </el-table-column>
- <el-table-column prop="" label="操作" width="200">
- <template slot-scope="{row}">
- <el-button type="primary" size="mini" :disabled="row.shi_fou_guo_shen_!=='已完成' || (params&¶ms.shi_fou_guo_shen_==='已完成')" @click="goBack(row)">退回</el-button>
- <el-button type="primary" size="mini" @click="goDetail(row)">详情</el-button>
- </template>
- </el-table-column>
- </el-table>
- <RiskDetail ref="RiskDetailRef" />
- </div>
- </template>
- <script>
- import ibpsUserSelector from '@/business/platform/org/selector'
- import RiskDetail from './riskDetail.vue'
- export default {
- components: {
- ibpsUserSelector,
- RiskDetail
- },
- props: {
- params: {
- type: Object,
- default: () => {}
- },
- peopleIds: {
- type: String,
- default: ''
- }
- },
- data () {
- return {
- tableList: [],
- detail: []
- }
- },
- watch: {
- peopleIds: {
- handler (val) {
- this.getPeopleList()
- }
- // immediate: true
- }
- },
- mounted () {
- this.getPeopleList()
- },
- methods: {
- // 获取人员部门
- getPersonPosition (id) {
- const userList = this.$store.getters.userList
- const bianzhiUserid = userList.find(i => i.userId === id)
- if (bianzhiUserid) {
- return bianzhiUserid.positionId
- }
- },
- getPersonStatus (id) {
- const tempList = this.detail.filter(i => i.bian_zhi_ren_ === id)
- if (tempList.length) {
- return tempList.every(i => i.shi_fou_guo_shen_ === '已完成') ? '已完成' : '未完成'
- } else {
- return '未完成'
- }
- },
- getRiskCount (id) {
- const tempList = this.detail.filter(i => i.bian_zhi_ren_ === id)
- if (tempList.length) return tempList.length
- },
- getRiskCategory (id) {
- const tempList = this.detail.filter(i => i.bian_zhi_ren_ === id)
- if (tempList.length) {
- const myMap = new Map()
- tempList.forEach(item => {
- const category = item.feng_xian_deng_ji
- if (!myMap.has(category)) {
- myMap.set(category, 0)
- }
- myMap.set(category, myMap.get(category) + 1)
- })
- return `低风险:${myMap.get('低风险') || 0};中风险:${myMap.get('中风险') || 0};高风险:${myMap.get('高风险') || 0};`
- }
- },
- async getPeopleList () {
- // console.log('zi', data)
- // this.tableList = data
- if (this.peopleIds) {
- const sql = `select * from t_fxsbpgb2 where parent_id_='${this.params.id_}'`
- const { variables: { data }} = await this.$common.request('sql', sql)
- this.detail = data
- // console.log(data)
- const people = this.peopleIds.split(',')
- if (people.length > 0) {
- this.tableList = people.map(item => {
- return {
- bian_zhi_ren_: item,
- bian_zhi_bu_men_: this.getPersonPosition(item),
- shi_fou_guo_shen_: this.getPersonStatus(item),
- feng_xian_shu_: this.getRiskCount(item),
- feng_xian_c_: this.getRiskCategory(item)
- }
- })
- }
- }
- },
- goDetail (row) {
- this.$refs.RiskDetailRef.open(this.params, row)
- },
- goBack (row) {
- this.$confirm('退回操作后评估人可再次修改识别项,是否继续?', '提示', {
- confirmButtonText: '继续',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(async () => {
- const params = {
- tableName: 't_fxsbpgb2',
- updList: [{
- where: {
- bian_zhi_ren_: row.bian_zhi_ren_,
- parent_id_: this.params.id_
- },
- param: {
- shi_fou_guo_shen_: '编制中'
- }
- }]
- }
- console.log(params)
- await this.$common.request('update', params)
- console.log('退回成功')
- this.$message({
- type: 'success',
- message: '退回成功!'
- })
- this.$emit('goBack')
- }).catch(() => {
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- </style>
|