|
@ -6,8 +6,16 @@ |
|
|
<div>{{ viewTitle }}</div> |
|
|
<div>{{ viewTitle }}</div> |
|
|
<!-- start 添加修改按钮 --> |
|
|
<!-- start 添加修改按钮 --> |
|
|
<div> |
|
|
<div> |
|
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> |
|
|
<el-button |
|
|
<el-button type="info" size="small" @click="handleReturn()">返回</el-button> |
|
|
type="primary" |
|
|
|
|
|
size="small" |
|
|
|
|
|
:disabled="submitdisabled" |
|
|
|
|
|
@click="saveOrUpdate" |
|
|
|
|
|
>保存</el-button |
|
|
|
|
|
> |
|
|
|
|
|
<el-button type="info" size="small" @click="handleReturn()" |
|
|
|
|
|
>返回</el-button |
|
|
|
|
|
> |
|
|
</div> |
|
|
</div> |
|
|
<!-- end 添加修改按钮 --> |
|
|
<!-- end 添加修改按钮 --> |
|
|
<!-- end 详情按钮 --> |
|
|
<!-- end 详情按钮 --> |
|
@ -20,22 +28,49 @@ |
|
|
<div class="wlInfo"><span>风险类别</span></div> |
|
|
<div class="wlInfo"><span>风险类别</span></div> |
|
|
<div class="item"> |
|
|
<div class="item"> |
|
|
<span class="item_text">类别名称:</span> |
|
|
<span class="item_text">类别名称:</span> |
|
|
<el-input v-model="formobj.name" placeholder="类别名称" class="item_input" clearable /> |
|
|
<el-input |
|
|
|
|
|
v-model="formobj.name" |
|
|
|
|
|
placeholder="类别名称" |
|
|
|
|
|
class="item_input" |
|
|
|
|
|
clearable |
|
|
|
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
<div class="item"> |
|
|
<div class="item"> |
|
|
<span class="item_text">类别编号:</span> |
|
|
<span class="item_text">类别编号:</span> |
|
|
<el-input v-model="formobj.code" placeholder="类别编号" class="item_input" clearable /> |
|
|
<el-input |
|
|
|
|
|
v-model="formobj.code" |
|
|
|
|
|
placeholder="类别编号" |
|
|
|
|
|
class="item_input" |
|
|
|
|
|
clearable |
|
|
|
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="item"> |
|
|
<div class="item"> |
|
|
<span class="item_text">分类说明:</span> |
|
|
<span class="item_text">分类说明:</span> |
|
|
<el-input v-model="formobj.content" placeholder="分类说明" class="item_input" clearable /> |
|
|
<el-input |
|
|
|
|
|
v-model="formobj.content" |
|
|
|
|
|
placeholder="分类说明" |
|
|
|
|
|
class="item_input" |
|
|
|
|
|
clearable |
|
|
|
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
<div class="item"> |
|
|
<div class="item"> |
|
|
<span class="item_text">层级:</span> |
|
|
<span class="item_text">层级:</span> |
|
|
<div class="info-sex"> |
|
|
<div class="info-sex"> |
|
|
<el-radio v-model="formobj.hierarchy" :disabled="hierarchys" @input="hierarchy($event)" :label="1">一级</el-radio> |
|
|
<el-radio |
|
|
<el-radio v-model="formobj.hierarchy" :disabled="hierarchys" @input="hierarchy($event)" :label="2">二级</el-radio> |
|
|
v-model="formobj.hierarchy" |
|
|
|
|
|
:disabled="hierarchys" |
|
|
|
|
|
@input="hierarchy($event)" |
|
|
|
|
|
:label="1" |
|
|
|
|
|
>一级</el-radio |
|
|
|
|
|
> |
|
|
|
|
|
<el-radio |
|
|
|
|
|
v-model="formobj.hierarchy" |
|
|
|
|
|
:disabled="hierarchys" |
|
|
|
|
|
@input="hierarchy($event)" |
|
|
|
|
|
:label="2" |
|
|
|
|
|
>二级</el-radio |
|
|
|
|
|
> |
|
|
</div> |
|
|
</div> |
|
|
<!-- <el-input v-model="formobj.hierarchy" :disabled="hierarchys" placeholder="请输入层级(1/2)" @input="hierarchy($event)" class="item_input" clearable /> --> |
|
|
<!-- <el-input v-model="formobj.hierarchy" :disabled="hierarchys" placeholder="请输入层级(1/2)" @input="hierarchy($event)" class="item_input" clearable /> --> |
|
|
</div> |
|
|
</div> |
|
@ -55,10 +90,15 @@ |
|
|
/> |
|
|
/> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</div> |
|
|
</div> |
|
|
<div class="item" style="height: 110px;"> |
|
|
<div class="item" style="height: 110px"> |
|
|
<span class="item_text">备注信息:</span> |
|
|
<span class="item_text">备注信息:</span> |
|
|
<el-input type="textarea" |
|
|
<el-input |
|
|
:autosize="{ minRows: 4, maxRows: 6 }" v-model="formobj.remarks" class="item_input" placeholder="备注信息" /> |
|
|
type="textarea" |
|
|
|
|
|
:autosize="{ minRows: 4, maxRows: 6 }" |
|
|
|
|
|
v-model="formobj.remarks" |
|
|
|
|
|
class="item_input" |
|
|
|
|
|
placeholder="备注信息" |
|
|
|
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
</el-card> |
|
|
</el-card> |
|
|
</el-form> |
|
|
</el-form> |
|
@ -68,135 +108,144 @@ |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import req from '@/api/Risk/index' |
|
|
import req from "@/api/Risk/index"; |
|
|
export default { |
|
|
export default { |
|
|
name: 'DispatchStandardsAdd', |
|
|
name: "DispatchStandardsAdd", |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
submitdisabled: false, |
|
|
submitdisabled: false, |
|
|
viewTitle: '', |
|
|
viewTitle: "", |
|
|
viewState: 1, |
|
|
viewState: 1, |
|
|
arrLists: [], |
|
|
arrLists: [], |
|
|
arrList: [], |
|
|
arrList: [], |
|
|
hierarchys: false, |
|
|
hierarchys: false, |
|
|
formobj: { |
|
|
formobj: { |
|
|
name: '', |
|
|
name: "", |
|
|
code: '', |
|
|
code: "", |
|
|
content: '', |
|
|
content: "", |
|
|
hierarchy: 1, |
|
|
hierarchy: 1, |
|
|
parentSid: '', |
|
|
parentSid: "", |
|
|
parentName: '', |
|
|
parentName: "", |
|
|
remarks: '' , |
|
|
remarks: "", |
|
|
sid:'' |
|
|
sid: "", |
|
|
}, |
|
|
}, |
|
|
rules: { |
|
|
rules: { |
|
|
name: [{ required: true, message: '风险等级名称不能为空', trigger: 'blur' }], |
|
|
name: [ |
|
|
code: [{ required: true, message: '风险等级代码不能为空', trigger: 'blur' }], |
|
|
{ required: true, message: "风险等级名称不能为空", trigger: "blur" }, |
|
|
content: [{ required: true, message: '分类说明不能为空', trigger: 'blur' }], |
|
|
], |
|
|
reportTarget: [{ required: true, message: '报送单位不能为空', trigger: 'blur' }], |
|
|
code: [ |
|
|
|
|
|
{ required: true, message: "风险等级代码不能为空", trigger: "blur" }, |
|
|
|
|
|
], |
|
|
|
|
|
content: [ |
|
|
|
|
|
{ required: true, message: "分类说明不能为空", trigger: "blur" }, |
|
|
|
|
|
], |
|
|
|
|
|
reportTarget: [ |
|
|
|
|
|
{ required: true, message: "报送单位不能为空", trigger: "blur" }, |
|
|
|
|
|
], |
|
|
}, |
|
|
}, |
|
|
} |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
created() {}, |
|
|
created() {}, |
|
|
methods: { |
|
|
methods: { |
|
|
handleReturn(isreload) { |
|
|
handleReturn(isreload) { |
|
|
if (isreload === 'true') this.$emit('reloadlist') |
|
|
if (isreload === "true") this.$emit("reloadlist"); |
|
|
this.formobj.sid = '' |
|
|
this.formobj.sid = ""; |
|
|
this.formobj.name= '', |
|
|
(this.formobj.name = ""), |
|
|
this.formobj.code= '', |
|
|
(this.formobj.code = ""), |
|
|
this.formobj.content= '', |
|
|
(this.formobj.content = ""), |
|
|
this.formobj.hierarchy= 1, |
|
|
(this.formobj.hierarchy = 1), |
|
|
this.formobj.parentSid= '' |
|
|
(this.formobj.parentSid = ""); |
|
|
this.formobj.parentName= '' |
|
|
this.formobj.parentName = ""; |
|
|
this.formobj.remarks= '' |
|
|
this.formobj.remarks = ""; |
|
|
this.viewState=1 |
|
|
this.viewState = 1; |
|
|
this.$refs['form_obj'].resetFields() |
|
|
this.$refs["form_obj"].resetFields(); |
|
|
this.$emit('doback') |
|
|
this.$emit("doback"); |
|
|
|
|
|
this.arrList = []; |
|
|
}, |
|
|
}, |
|
|
showAdd() { |
|
|
showAdd() { |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
this.$refs['form_obj'].clearValidate() |
|
|
this.$refs["form_obj"].clearValidate(); |
|
|
}) |
|
|
}); |
|
|
this.viewTitle = '【新增】风险等级' |
|
|
this.viewTitle = "【新增】风险等级"; |
|
|
this.hierarchys=false |
|
|
this.hierarchys = false; |
|
|
this.formobj.hierarchy= 1 |
|
|
this.formobj.hierarchy = 1; |
|
|
}, |
|
|
}, |
|
|
showEdit(row) { |
|
|
showEdit(row) { |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
this.$refs['form_obj'].clearValidate() |
|
|
this.$refs["form_obj"].clearValidate(); |
|
|
}) |
|
|
}); |
|
|
this.viewTitle = '【修改】风险等级' |
|
|
this.viewTitle = "【修改】风险等级"; |
|
|
const _this = this |
|
|
const _this = this; |
|
|
const vdata = row |
|
|
const vdata = row; |
|
|
_this.hierarchys=true |
|
|
_this.hierarchys = true; |
|
|
_this.formobj.id = vdata.id |
|
|
this.superior(); |
|
|
_this.formobj.sid = vdata.sid |
|
|
_this.formobj.id = vdata.id; |
|
|
_this.formobj.name = vdata.name |
|
|
_this.formobj.sid = vdata.sid; |
|
|
_this.formobj.code = vdata.code |
|
|
_this.formobj.name = vdata.name; |
|
|
_this.formobj.content = vdata.content |
|
|
_this.formobj.code = vdata.code; |
|
|
_this.formobj.hierarchy = vdata.hierarchy |
|
|
_this.formobj.content = vdata.content; |
|
|
_this.formobj.parentName = vdata.parentName |
|
|
_this.formobj.hierarchy = vdata.hierarchy; |
|
|
_this.formobj.parentSid = vdata.parentSid |
|
|
_this.formobj.parentName = vdata.parentName; |
|
|
_this.formobj.remarks = vdata.remarks |
|
|
_this.formobj.parentSid = vdata.parentSid; |
|
|
|
|
|
_this.formobj.remarks = vdata.remarks; |
|
|
if (vdata.hierarchy == 1) { |
|
|
if (vdata.hierarchy == 1) { |
|
|
_this.viewState=1 |
|
|
_this.viewState = 1; |
|
|
} else { |
|
|
} else { |
|
|
_this.viewState=2 |
|
|
_this.viewState = 2; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
saveOrUpdate() { |
|
|
saveOrUpdate() { |
|
|
req |
|
|
req |
|
|
.saveRiskType(this.formobj) |
|
|
.saveRiskType(this.formobj) |
|
|
.then(resp => { |
|
|
.then((resp) => { |
|
|
if (resp.success) { |
|
|
if (resp.success) { |
|
|
this.$message({ showClose: true, type: 'success', message: resp.msg }) |
|
|
this.$message({ |
|
|
this.handleReturn('true') |
|
|
showClose: true, |
|
|
|
|
|
type: "success", |
|
|
|
|
|
message: resp.msg, |
|
|
|
|
|
}); |
|
|
|
|
|
this.handleReturn("true"); |
|
|
} else { |
|
|
} else { |
|
|
// 根据resp.code进行异常情况处理 |
|
|
// 根据resp.code进行异常情况处理 |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.catch(() => { |
|
|
.catch(() => {}); |
|
|
}) |
|
|
|
|
|
}, |
|
|
}, |
|
|
superior() { |
|
|
superior() { |
|
|
req |
|
|
req.selectRiskTypeFirst().then((resp) => { |
|
|
.selectRiskTypeFirst() |
|
|
|
|
|
.then(resp => { |
|
|
|
|
|
if (resp.code == 200) { |
|
|
if (resp.code == 200) { |
|
|
this.arrLists=resp.data |
|
|
this.arrLists = resp.data; |
|
|
for (var i = 0; i < this.arrLists.length; i++) { |
|
|
for (var i = 0; i < this.arrLists.length; i++) { |
|
|
|
|
|
|
|
|
let item = { |
|
|
let item = { |
|
|
name: this.arrLists[i].name, |
|
|
name: this.arrLists[i].name, |
|
|
sid: this.arrLists[i].sid, |
|
|
sid: this.arrLists[i].sid, |
|
|
|
|
|
}; |
|
|
} |
|
|
this.arrList.push(item); |
|
|
this.arrList.push(item) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
hierarchy(e) { |
|
|
hierarchy(e) { |
|
|
if (e == 2) { |
|
|
if (e == 2) { |
|
|
this.viewState=2 |
|
|
this.viewState = 2; |
|
|
this.arrList=[] |
|
|
this.arrList = []; |
|
|
this.superior() |
|
|
this.superior(); |
|
|
} else { |
|
|
} else { |
|
|
this.viewState=1 |
|
|
this.viewState = 1; |
|
|
this.sid=null |
|
|
this.sid = null; |
|
|
this.parentSid=null |
|
|
this.parentSid = null; |
|
|
this.parentName=null |
|
|
this.parentName = null; |
|
|
this.arrList=[] |
|
|
this.arrList = []; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
getType(value) { |
|
|
getType(value) { |
|
|
const choose = this.arrLists.filter((item) => item.sid === value) |
|
|
const choose = this.arrLists.filter((item) => item.sid === value); |
|
|
this.formobj.parentName = choose[0].name |
|
|
this.formobj.parentName = choose[0].name; |
|
|
this.formobj.parentSid = value |
|
|
this.formobj.parentSid = value; |
|
|
console.log(this.formobj.parentSid); |
|
|
console.log(this.formobj.parentSid); |
|
|
}, |
|
|
}, |
|
|
} |
|
|
}, |
|
|
} |
|
|
}; |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
<style scoped lang="scss"> |
|
@ -236,11 +285,10 @@ export default { |
|
|
height: 30px; |
|
|
height: 30px; |
|
|
margin-left: 20px; |
|
|
margin-left: 20px; |
|
|
line-height: 30px; |
|
|
line-height: 30px; |
|
|
color: #018AD2; |
|
|
color: #018ad2; |
|
|
padding: 0px 15px; |
|
|
padding: 0px 15px; |
|
|
border: 1.5px solid #018AD2; |
|
|
border: 1.5px solid #018ad2; |
|
|
border-radius: 5px; |
|
|
border-radius: 5px; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.item_right { |
|
|
.item_right { |
|
@ -252,7 +300,7 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.item_right_list_delect { |
|
|
.item_right_list_delect { |
|
|
color: #5E94FF; |
|
|
color: #5e94ff; |
|
|
margin-left: 20px; |
|
|
margin-left: 20px; |
|
|
font-size: 16px; |
|
|
font-size: 16px; |
|
|
text-decoration: underline; |
|
|
text-decoration: underline; |
|
@ -295,6 +343,5 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |
|
|