|
|
@@ -115,6 +115,7 @@
|
|
|
v-for="(e, i) in form.xuan_ze_feng_xian_mc"
|
|
|
style="border-color: #fff"
|
|
|
:index="'tag' + i"
|
|
|
+ :key="i"
|
|
|
>
|
|
|
{{ e }}
|
|
|
</el-tag>
|
|
|
@@ -1418,7 +1419,7 @@ export default {
|
|
|
this.$message.success('导入风险项成功!')
|
|
|
}
|
|
|
} catch (error) {
|
|
|
- this.$message.warning(error?.message || '导入失败!')
|
|
|
+ this.$message.error(error?.message || '导入失败!')
|
|
|
}
|
|
|
},
|
|
|
/* 读取文件 将文件转换为二进制 */
|
|
|
@@ -1449,6 +1450,7 @@ export default {
|
|
|
const importData = JSON.parse(JSON.stringify(this.tableList)) || []
|
|
|
const userList = this.$store.getters.userList || []
|
|
|
let flag = true
|
|
|
+ let message = []
|
|
|
importData.forEach((item, index) => {
|
|
|
const i = xlsxData.find(
|
|
|
(i) =>
|
|
|
@@ -1458,20 +1460,20 @@ export default {
|
|
|
|
|
|
if (i.yan_zhong_cheng_d) {
|
|
|
if (!this.yan_zhong_cheng_d_List.includes(i.yan_zhong_cheng_d)) {
|
|
|
- this.$message.error('严重程度请填写1-5数字!')
|
|
|
+ message.push('严重程度请填写1-5数字!')
|
|
|
flag = false
|
|
|
}
|
|
|
}
|
|
|
if (i.fa_sheng_pin_du_) {
|
|
|
if (!this.fa_sheng_pin_du_List.includes(i.fa_sheng_pin_du_)) {
|
|
|
- this.$message.error('发生频度请填写1-5数字!')
|
|
|
+ message.push('发生频度请填写1-5数字!')
|
|
|
flag = false
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (i.feng_xian_ying_du) {
|
|
|
if (!this.riskResponse.includes(i.feng_xian_ying_du)) {
|
|
|
- this.$message.error('风险应对请填写风险降低或风险接受或风险回避!')
|
|
|
+ message.push('风险应对请填写风险降低或风险接受或风险回避!')
|
|
|
flag = false
|
|
|
}
|
|
|
}
|
|
|
@@ -1491,6 +1493,10 @@ export default {
|
|
|
)
|
|
|
this.culRate(item)
|
|
|
})
|
|
|
+
|
|
|
+ if (!flag) {
|
|
|
+ this.$message.error(`${Array.from(new Set(message)).join(',')} `)
|
|
|
+ }
|
|
|
return flag ? importData : flag
|
|
|
},
|
|
|
getKey(list, data, inKey, outKey) {
|
|
|
@@ -1501,8 +1507,13 @@ export default {
|
|
|
const keyList = []
|
|
|
dataList.forEach((n) => {
|
|
|
const item = list.find((item) => item[inKey] === n.trim())
|
|
|
- keyList.push(item[outKey] || '')
|
|
|
+ if (item) {
|
|
|
+ keyList.push(item[outKey])
|
|
|
+ } else {
|
|
|
+ throw new Error(`无法查询到措施制定人${n}请检查是否有误!`)
|
|
|
+ }
|
|
|
})
|
|
|
+
|
|
|
return keyList.join(',')
|
|
|
}
|
|
|
}
|