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

bug fixes

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