Commit d88db3b3 authored by liwei's avatar liwei

增加了公共的必测选项

parent 29e43785
......@@ -14,7 +14,7 @@
</div>
<el-row :gutter="30">
<el-col v-for="(item, index) in schemas" :key="index" :span="12">
<div class="check-card">
<div class="check-card" v-if="item.describe !== '公共描述'">
<div class="check-item">
<div class="check-item-name">
{{ item.describe }}
......
......@@ -189,14 +189,30 @@ export default {
async handleConfirm() {
this.$refs.form.validate(async valid => {
if (valid) {
let form = JSON.parse(JSON.stringify(this.form))
var form = JSON.parse(JSON.stringify(this.form))
if (form.inspectionItem.indexOf('trfis') !== -1) {
const res = await this.$refs.check.getValidateVaule()
form.specifyPlan = res.record
form.useCaseNo = res.codes
}
form.inspectionItem = form.inspectionItem.join(',')
// 遍历this.model 找到describe为公共描述的对象
for (let i = 0; i < this.model.length; i++) {
if (this.model[i].describe === '公共描述') {
let commonCaseArray = this.model[i].componentProps.options
// 遍历commonCaseArray,找出里面的userCaseNo,放进form中
for (let j = 0; j < commonCaseArray.length; j++) {
if (commonCaseArray[j].useCaseNo) {
// 如果 form.userCaseNo 已经存在,则追加;否则初始化
if (!form.useCaseNo) {
form.useCaseNo = commonCaseArray[j].useCaseNo;
} else {
form.useCaseNo = form.useCaseNo + ',' + commonCaseArray[j].useCaseNo
}
}
}
}
}
add(form).then(res => {
if (res.code == 200) {
this.$router.push({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment