提交 75a84906 authored 作者: pengxiaohui's avatar pengxiaohui

bug fixes

上级 833f9d61
...@@ -456,6 +456,7 @@ ...@@ -456,6 +456,7 @@
<script> <script>
import * as casesApi from '@/api/cases2' import * as casesApi from '@/api/cases2'
import * as categoryApi from '@/api/categories' import * as categoryApi from '@/api/categories'
import _ from 'lodash'
const defaultForm = { const defaultForm = {
name: '', name: '',
level: '', level: '',
...@@ -535,7 +536,7 @@ export default { ...@@ -535,7 +536,7 @@ export default {
drawer: false, drawer: false,
direction: 'rtl', direction: 'rtl',
show_types: ['input', 'textarea'], show_types: ['input', 'textarea'],
addForm: Object.assign({}, defaultForm), addForm: _.cloneDeep(defaultForm),
formDraftStr: '', formDraftStr: '',
pdfFileList: [], pdfFileList: [],
formLabelWidth: '100px', formLabelWidth: '100px',
...@@ -671,7 +672,7 @@ export default { ...@@ -671,7 +672,7 @@ export default {
clearTimeout(this.timer) clearTimeout(this.timer)
}, },
handleNewCreate() { handleNewCreate() {
this.addForm = Object.assign({}, defaultForm) this.addForm = _.cloneDeep(defaultForm)
this.drawer = true this.drawer = true
}, },
handleDraftCreate() { handleDraftCreate() {
...@@ -692,12 +693,16 @@ export default { ...@@ -692,12 +693,16 @@ export default {
} }
this.loading = true this.loading = true
const form = { ...this.addForm } const form = { ...this.addForm }
console.log(form)
const checkedPro = this.checkFormDetailsNull(form.production_detail) const checkedPro = this.checkFormDetailsNull(form.production_detail)
console.log(checkedPro)
const checkedFoud = this.checkFormDetailsNull(form.fund_detail) const checkedFoud = this.checkFormDetailsNull(form.fund_detail)
console.log(checkedFoud)
const checkedInvest = this.checkFormDetailsNull(form.invest_detail) const checkedInvest = this.checkFormDetailsNull(form.invest_detail)
if (!checkedPro) delete form.production_detail console.log(checkedInvest)
if (!checkedFoud) delete form.fund_detail if (checkedPro) delete form.production_detail
if (!checkedInvest) delete form.invest_detail if (checkedFoud) delete form.fund_detail
if (checkedInvest) delete form.invest_detail
// 提交表单 // 提交表单
const rLoading = this.openLoading('.table-list') const rLoading = this.openLoading('.table-list')
casesApi.createCase2(form).then(res => { casesApi.createCase2(form).then(res => {
...@@ -730,7 +735,7 @@ export default { ...@@ -730,7 +735,7 @@ export default {
} else { } else {
const keywords = list[i].keywords const keywords = list[i].keywords
for (let j = 0; j < keywords.length; j++) { for (let j = 0; j < keywords.length; j++) {
if (keywords[i].name || list[i].score !== '0') { if (keywords[i].name || keywords[i].score !== 0) {
res = false res = false
break break
} }
......
...@@ -299,9 +299,9 @@ export default { ...@@ -299,9 +299,9 @@ export default {
const checkedPro = this.checkFormDetailsNull(form.production_detail) const checkedPro = this.checkFormDetailsNull(form.production_detail)
const checkedFoud = this.checkFormDetailsNull(form.fund_detail) const checkedFoud = this.checkFormDetailsNull(form.fund_detail)
const checkedInvest = this.checkFormDetailsNull(form.invest_detail) const checkedInvest = this.checkFormDetailsNull(form.invest_detail)
if (!checkedPro) delete form.production_detail if (checkedPro) delete form.production_detail
if (!checkedFoud) delete form.fund_detail if (checkedFoud) delete form.fund_detail
if (!checkedInvest) delete form.invest_detail if (checkedInvest) delete form.invest_detail
casesApi.updateCase2(this.id, form).then(res => { casesApi.updateCase2(this.id, form).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success(res.message) this.$message.success(res.message)
...@@ -324,7 +324,7 @@ export default { ...@@ -324,7 +324,7 @@ export default {
} else { } else {
const keywords = list[i].keywords const keywords = list[i].keywords
for (let j = 0; j < keywords.length; j++) { for (let j = 0; j < keywords.length; j++) {
if (keywords[i].name || list[i].score !== '0') { if (keywords[i].name || keywords[i].score !== 0) {
res = false res = false
break break
} }
......
...@@ -344,6 +344,7 @@ ...@@ -344,6 +344,7 @@
<script> <script>
import * as characteristicsApi from '@/api/characteristics2' import * as characteristicsApi from '@/api/characteristics2'
import * as casesApi from '@/api/cases2' import * as casesApi from '@/api/cases2'
import _ from 'lodash'
const defaultForm = { const defaultForm = {
case2_id: '', case2_id: '',
options: [ options: [
...@@ -411,7 +412,7 @@ export default { ...@@ -411,7 +412,7 @@ export default {
rules: [], rules: [],
options: [], options: [],
levels: [], levels: [],
addForm: Object.assign({}, defaultForm), addForm: _.cloneDeep(defaultForm),
formDraftStr: '' formDraftStr: ''
} }
}, },
...@@ -543,7 +544,7 @@ export default { ...@@ -543,7 +544,7 @@ export default {
clearTimeout(this.timer) clearTimeout(this.timer)
}, },
handleNewCreate() { handleNewCreate() {
this.addForm = Object.assign({}, defaultForm) this.addForm = _.cloneDeep(defaultForm)
this.drawer = true this.drawer = true
}, },
handleDraftCreate() { handleDraftCreate() {
......
...@@ -94,6 +94,7 @@ ...@@ -94,6 +94,7 @@
:append-to-body="true" :append-to-body="true"
:withHeader="true" :withHeader="true"
:wrapperClosable="false" :wrapperClosable="false"
@close="cancelForm"
ref="drawer" ref="drawer"
size="50%"> size="50%">
<div class="demo-drawer__content"> <div class="demo-drawer__content">
...@@ -317,6 +318,15 @@ export default { ...@@ -317,6 +318,15 @@ export default {
cancelForm() { cancelForm() {
this.loading = false this.loading = false
this.drawer = false this.drawer = false
this.addForm = {
case2_id: '',
keywords: [
{
keyword: '',
score: 0
}
]
}
clearTimeout(this.timer) clearTimeout(this.timer)
}, },
handleFormEnsure() { handleFormEnsure() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论