Commit 1128f67c authored by caimeng's avatar caimeng

弹框外面添加v-if 保证数据一定存在

parent 93d0ed80
......@@ -79,7 +79,8 @@
computed: {
...mapGetters(['searchData', 'user'])
},
mounted() {
created() {
console.log(this.item,'nash ')
if (this.item !== null) {
this.form.preCreditNo = this.item.preCreditNo
}
......
......@@ -44,12 +44,14 @@
</div>
<!--申述弹框-->
<pre-plead
:dialog-visible='visible'
:item='item'
@handleClose='visible = false'
@callback='init'
/>
<template v-if='visible'>
<pre-plead
:dialog-visible='visible'
:item='item'
@handleClose='visible = false'
@callback='init'
/>
</template>
</div>
</template>
......@@ -85,7 +87,7 @@
// 申述
handlePlead() {
this.item = this.detail
this.item.preCreditNo = this.preCreditNo;
this.item.preCreditNo = this.preCreditNo
this.visible = true
}
}
......
......@@ -28,7 +28,7 @@
type='datetimerange'
:picker-options='pickerConfig'
:default-time="['00:00:00', '23:59:59']"
value-format="yyyy-MM-dd HH:mm:ss"
value-format='yyyy-MM-dd HH:mm:ss'
range-separator='至'
start-placeholder='开始时间'
end-placeholder='结束时间'
......@@ -38,7 +38,7 @@
<el-form-item>
<el-button icon='el-icon-search' type='primary' @click='onSubmit'>搜 索</el-button>
<el-button icon='el-icon-delete' type="default" @click="onReset('form')">重置</el-button>
<el-button icon='el-icon-delete' type='default' @click="onReset('form')">重置</el-button>
</el-form-item>
</el-form>
</div>
......@@ -79,7 +79,7 @@
>
<template #default='{ row }'>
<el-button type='text' @click='handleDetail(row)'>详情</el-button>
<template v-if='row.preStatusStr === "授信拒绝"' >
<template v-if='row.preStatusStr === "授信拒绝"'>
<el-button type='text' @click='handlePlead(row)'>申述</el-button>
</template>
......@@ -97,14 +97,16 @@
@current-change='handleCurrentChange'
/>
<!-- 申述 -->
<!-- 申述 -->
<!--申述弹框-->
<pre-plead
:dialog-visible='visible'
:item='item'
@handleClose='visible = false'
@callback='fetchData'
/>
<template v-if='visible'>
<pre-plead
:dialog-visible='visible'
:item='item'
@handleClose='visible = false'
@callback='fetchData'
/>
</template>
</div>
</template>
......@@ -154,7 +156,7 @@
order: 7,
label: '申请时间',
prop: 'applyDate',
width:110,
width: 110
},
{
order: 8,
......@@ -164,7 +166,7 @@
],
list: [],
listLoading: true,
pickerConfig:this.datePickerOptions,
pickerConfig: this.datePickerOptions,
total: 1,
queryForm: {
current: 1,
......@@ -199,21 +201,22 @@
},
methods: {
// 申述弹框
handlePlead(row){
this.item = row;
this.visible = true;
handlePlead(row) {
this.item = row
console.log(row, '当前行信息')
this.visible = true
},
// 搜索
onSubmit() {
const { time } = this.queryForm;
this.queryForm.current = 1;
const { time } = this.queryForm
this.queryForm.current = 1
if (time) {
this.queryForm.startTime = time[0];
this.queryForm.endTime = time[1];
this.queryForm.startTime = time[0]
this.queryForm.endTime = time[1]
} else {
this.queryForm.startTime = "";
this.queryForm.endTime = "";
this.queryForm.startTime = ''
this.queryForm.endTime = ''
}
this.fetchData()
},
......@@ -231,10 +234,10 @@
},
async fetchData() {
this.listLoading = true
const form = this.queryForm;
const params = Object.assign({}, form);
delete params.time;
const result = await API.preCreditList({...params})
const form = this.queryForm
const params = Object.assign({}, form)
delete params.time
const result = await API.preCreditList({ ...params })
const { records, total } = result.result
this.list = records
this.total = total
......
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