Commit c2158393 authored by mengzixuan's avatar mengzixuan

feat(标准库管理): dialog添加检验项目字段

parent 0ae604a7
...@@ -120,14 +120,14 @@ ...@@ -120,14 +120,14 @@
<collapse-item <collapse-item
v-for="(item, key) in model" v-for="(item, key) in model"
:key="key" :key="key"
:name="item.chapter" :name="item.serial_number"
> >
<span slot="title" style="width: 100%"> <span slot="title" style="width: 100%">
<div class="standard-box"> <div class="standard-box">
<div class="standard-left"> <div class="standard-left">
<div class="standard-title"> <div class="standard-title">
<div class="standard">标准要求:</div> <div class="standard">标准要求:</div>
{{ item.chapter + item.text }} {{ item.serial_number + item.requirements }}
</div> </div>
</div> </div>
<!-- <div class="standard-result"> <!-- <div class="standard-result">
...@@ -146,19 +146,19 @@ ...@@ -146,19 +146,19 @@
<th>对应输入</th> <th>对应输入</th>
<th class="investigate-result">测试结果</th> <th class="investigate-result">测试结果</th>
</tr> </tr>
<template v-for="(v, k) in item.testCaseList"> <template v-for="(v, k) in item.case_result_list">
<tr :key="k"> <tr :key="k">
<td> <td>
{{ v.testScenario }} {{ v.scenario }}
</td> </td>
<td> <td>
{{ v.testScenario }} {{ v.test_type }}
</td> </td>
<td> <td>
{{ v.usecaseNo }} {{ v.serial_number }}
</td> </td>
<td> <td>
{{ v.testScenario }} {{ v.name }}
</td> </td>
<td></td> <td></td>
<td align="center" class="investigate-result"> <td align="center" class="investigate-result">
...@@ -236,7 +236,7 @@ export default { ...@@ -236,7 +236,7 @@ export default {
/** 全部展开 */ /** 全部展开 */
openAll() { openAll() {
this.activeNames = this.model.map(i => { this.activeNames = this.model.map(i => {
return i.chapter return i.serial_number
}) })
}, },
/** 全部收起 */ /** 全部收起 */
......
...@@ -163,6 +163,20 @@ export default { ...@@ -163,6 +163,20 @@ export default {
{}, {},
() => { () => {
this.dialogManger.dialogVisible = true this.dialogManger.dialogVisible = true
const dictList = this.model.dictList
if (dictList.length > 0) {
dictList.forEach((item, index) => {
this.inspectionItemList.forEach((item2, index2) => {
if (item2.value === item.dictCode) {
item2.check = true
}
})
})
} else {
this.inspectionItemList.forEach((item, index) => {
item.check = false
})
}
}, },
() => { () => {
this.$emit('refresh') this.$emit('refresh')
...@@ -175,7 +189,8 @@ export default { ...@@ -175,7 +189,8 @@ export default {
}, },
methods: { methods: {
handleInspectionItem(item) { handleInspectionItem(item) {
console.log('字典', item) // console.log('字典', item)
item.check = !item.check
}, },
/** 获取检验项目字典数据 */ /** 获取检验项目字典数据 */
getInspectionItemDict() { getInspectionItemDict() {
...@@ -193,6 +208,9 @@ export default { ...@@ -193,6 +208,9 @@ export default {
}, },
handleClose() { handleClose() {
this.model.reset() this.model.reset()
this.inspectionItemList.forEach((item, index) => {
item.check = false
})
this.dialogManger.dialogEditId = null this.dialogManger.dialogEditId = null
this.dialogManger.dialogVisible = false this.dialogManger.dialogVisible = false
// this.$emit('close') // this.$emit('close')
...@@ -205,11 +223,17 @@ export default { ...@@ -205,11 +223,17 @@ export default {
// console.log('体系审查') // console.log('体系审查')
// } // }
// }) // })
this.model.dictList = []
this.$refs['form'].validate(valid => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
console.log('表单验证通过') this.inspectionItemList.forEach((item, index) => {
if (item.check === true) {
this.model.dictList.push({ dictCode: item.value })
}
})
this.model.save( this.model.save(
() => { () => {
this.model.dictList = []
this.$message.success('保存成功') this.$message.success('保存成功')
this.$emit('refresh') this.$emit('refresh')
this.handleClose() this.handleClose()
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
> >
<el-form-item prop="status"> <el-form-item prop="status">
<el-select <el-select
v-model="queryParams.testScenarioId" v-model="queryParams.scenario"
placeholder="请选择测试场景" placeholder="请选择测试场景"
clearable clearable
> >
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</el-form-item> </el-form-item>
<el-form-item prop="status"> <el-form-item prop="status">
<el-select <el-select
v-model="queryParams.testTypeId" v-model="queryParams.method"
placeholder="请选择测试方法" placeholder="请选择测试方法"
clearable clearable
> >
...@@ -141,6 +141,8 @@ export default { ...@@ -141,6 +141,8 @@ export default {
queryParams: { queryParams: {
offset: 0, offset: 0,
limit: 10, limit: 10,
scenario: '',
method: '',
searchKeywords: '' searchKeywords: ''
}, },
total: 0, total: 0,
...@@ -228,7 +230,11 @@ export default { ...@@ -228,7 +230,11 @@ export default {
field: this.orderBy.field, field: this.orderBy.field,
order: this.orderBy.order order: this.orderBy.order
}, },
search: this.queryParams.searchKeywords searchFields: {
name: this.queryParams.searchKeywords,
scenario: this.queryParams.scenario,
method: this.queryParams.method
}
} }
listTestCase(data).then(res => { listTestCase(data).then(res => {
this.tableData = res.data.useCases this.tableData = res.data.useCases
......
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