|
|
@@ -101,7 +101,15 @@
|
|
|
/>
|
|
|
</div>
|
|
|
<div class="table">
|
|
|
- <el-table :data="tableList" border>
|
|
|
+ <div v-if="!readonly" class="button">
|
|
|
+ <el-button type="success" size="mini" icon="ibps-icon-add" @click="onAdd">新增风险项</el-button>
|
|
|
+ <el-button type="danger" size="mini" icon="ibps-icon-remove" @click="onRemove">删除</el-button>
|
|
|
+ </div>
|
|
|
+ <el-table :data="tableList" border @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column
|
|
|
+ width="50"
|
|
|
+ type="selection"
|
|
|
+ />
|
|
|
<el-table-column
|
|
|
prop=""
|
|
|
label="序号"
|
|
|
@@ -109,11 +117,24 @@
|
|
|
width="50"
|
|
|
:index="showIndex"
|
|
|
/>
|
|
|
+ <el-table-column
|
|
|
+ prop="feng_xian_lai_yua"
|
|
|
+ label="风险来源"
|
|
|
+ width="80"
|
|
|
+ >
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <span>{{ row.feng_xian_lai_yua==='2'?'新增':'风险库' }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="yao_su_tiao_kuan_"
|
|
|
label="要素条款"
|
|
|
width="120"
|
|
|
- />
|
|
|
+ >
|
|
|
+ <template slot-scope="{row}">
|
|
|
+ <el-input v-model="row.yao_su_tiao_kuan_" type="textarea" :rows="2" size="mini" :disabled="readonly" />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
prop="gong_zuo_huan_jie"
|
|
|
label="工作环节"
|
|
|
@@ -306,6 +327,7 @@ export default {
|
|
|
data () {
|
|
|
const { userId, position, level } = this.$store.getters
|
|
|
return {
|
|
|
+ multipleSelection: [],
|
|
|
filter: [{
|
|
|
descVal: '1',
|
|
|
includeSub: true,
|
|
|
@@ -434,20 +456,21 @@ export default {
|
|
|
parent_id_: this.params.id_,
|
|
|
|
|
|
shi_bie_xiang_: item.id_,
|
|
|
- yao_su_tiao_kuan_: item.tiao_kuan_,
|
|
|
- gong_zuo_huan_jie: item.huan_jie_,
|
|
|
+ yao_su_tiao_kuan_: item.tiao_kuan_ || '',
|
|
|
+ gong_zuo_huan_jie: item.huan_jie_ || '',
|
|
|
// gong_zuo_miao_shu: item.gong_zuo_miao_shu,
|
|
|
- feng_xian_miao_sh: item.feng_xian_miao_sh,
|
|
|
+ feng_xian_miao_sh: item.feng_xian_miao_sh || '',
|
|
|
|
|
|
- xian_xing_kong_zh: item.gong_zuo_miao_shu,
|
|
|
+ xian_xing_kong_zh: item.gong_zuo_miao_shu || '',
|
|
|
ni_cai_qu_cuo_shi: '',
|
|
|
zhi_ding_ren_: '',
|
|
|
- qian_zai_yuan_yin: ''
|
|
|
+ qian_zai_yuan_yin: '',
|
|
|
+ feng_xian_lai_yua: item.feng_xian_lai_yua || '1'
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- this.tableList.forEach(item => {
|
|
|
+ this.tableList.filter(i => i.shi_bie_xiang_ !== '').forEach(item => {
|
|
|
const cunZai = data1.find(i => i.id_ === item.shi_bie_xiang_)
|
|
|
if (!cunZai) {
|
|
|
this.tableList = this.tableList.filter(ii => ii.shi_bie_xiang_ !== item.shi_bie_xiang_)
|
|
|
@@ -459,6 +482,31 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleSelectionChange (val) {
|
|
|
+ this.multipleSelection = val
|
|
|
+ },
|
|
|
+ onAdd () {
|
|
|
+ this.tableList.push({
|
|
|
+ di_dian_: this.level,
|
|
|
+ bian_zhi_ren_: this.userId,
|
|
|
+ bian_zhi_bu_men_: this.position,
|
|
|
+ bian_zhi_shi_jian: this.time,
|
|
|
+ parent_id_: this.params.id_,
|
|
|
+ shi_bie_xiang_: '',
|
|
|
+ yao_su_tiao_kuan_: '',
|
|
|
+ gong_zuo_huan_jie: '',
|
|
|
+ feng_xian_miao_sh: '',
|
|
|
+ xian_xing_kong_zh: '',
|
|
|
+ ni_cai_qu_cuo_shi: '',
|
|
|
+ zhi_ding_ren_: '',
|
|
|
+ qian_zai_yuan_yin: '',
|
|
|
+ feng_xian_lai_yua: '2'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onRemove () {
|
|
|
+ this.tableList = this.tableList.filter(item => !this.multipleSelection.includes(item))
|
|
|
+ this.form.xuan_ze_feng_xian = this.tableList.filter(item => item.shi_bie_xiang_ !== '').map(i => i.shi_bie_xiang_).join(',') || ''
|
|
|
+ },
|
|
|
async getTableData () {
|
|
|
this.loading = true
|
|
|
// console.log(this.params)
|
|
|
@@ -830,6 +878,33 @@ export default {
|
|
|
try {
|
|
|
this.check()
|
|
|
await this.getIsFinish()
|
|
|
+ // 将风险来源为新增的风险项添加至风险库
|
|
|
+ const handleArr = this.tableList.filter(item => item.shi_bie_xiang_ === '')
|
|
|
+ for (let i = 0; i < handleArr.length; i++) {
|
|
|
+ const item = handleArr[i]
|
|
|
+ const addParams = {
|
|
|
+ tableName: 't_fxkzb',
|
|
|
+ paramWhere: [{
|
|
|
+ bian_zhi_bu_men_: this.position,
|
|
|
+ tiao_kuan_: item.yao_su_tiao_kuan_,
|
|
|
+ huan_jie_: item.gong_zuo_huan_jie,
|
|
|
+ gong_zuo_miao_shu: item.xian_xing_kong_zh,
|
|
|
+ feng_xian_miao_sh: item.feng_xian_miao_sh,
|
|
|
+ di_dian_: this.level,
|
|
|
+ bian_zhi_ren_: this.userId,
|
|
|
+ bian_zhi_shi_jian: this.time,
|
|
|
+ feng_xian_lei_xin: this.leixing,
|
|
|
+ bei_zhu_: `风险评估编号${this.params.ji_hua_bian_hao_}新增风险项`
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ const { variables: { cont }} = await this.$common.request('add', addParams)
|
|
|
+ item.shi_bie_xiang_ = cont[0].id_
|
|
|
+ }
|
|
|
+ this.form.xuan_ze_feng_xian = this.tableList.map(i => i.shi_bie_xiang_).join(',') || ''
|
|
|
+ this.tableList.forEach(item => {
|
|
|
+ item.xuan_ze_feng_xian = this.form.xuan_ze_feng_xian
|
|
|
+ })
|
|
|
+
|
|
|
const curIds = this.tableList.map(item => item.shi_bie_xiang_)
|
|
|
|
|
|
// 计算需要增加项
|
|
|
@@ -935,6 +1010,10 @@ export default {
|
|
|
margin: 10px 0;
|
|
|
}
|
|
|
.table{
|
|
|
+ .button{
|
|
|
+ display: flex;
|
|
|
+ justify-self: end;
|
|
|
+ }
|
|
|
height:300px;
|
|
|
overflow: auto;
|
|
|
margin-top: 20px;
|