上传
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<Dialog title="成交登记" v-model="show" width="800px">
|
||||
<Descriptions :data="info" :schema="schema" :columns="2" />
|
||||
<Descriptions :data="info" :schema="showSchema" :columns="2" />
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px" class="mt-20px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" :offset="0">
|
||||
@@ -42,48 +42,60 @@
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script setup name="DialogSuccess">
|
||||
import * as ClueApi from '@/api/clue'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const show = ref(false)
|
||||
const form = ref({})
|
||||
const rules = ref({})
|
||||
const info = ref({})
|
||||
|
||||
const schema = ref([
|
||||
{
|
||||
field: 'name',
|
||||
label: '线索名称'
|
||||
},
|
||||
{
|
||||
field: 'specsName',
|
||||
label: '联系方式'
|
||||
},
|
||||
{
|
||||
field: 'supplier',
|
||||
label: '意向状态'
|
||||
},
|
||||
{
|
||||
field: 'supplier',
|
||||
label: '创建时间'
|
||||
},
|
||||
{
|
||||
field: 'purchaseCount',
|
||||
label: '诉求',
|
||||
span: 2
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
label: '备注',
|
||||
isEditor: true,
|
||||
span: 2
|
||||
const props = defineProps({
|
||||
schema: {
|
||||
type: Array
|
||||
}
|
||||
])
|
||||
})
|
||||
|
||||
function open(val) {
|
||||
show.value = true
|
||||
info.value = { ...val }
|
||||
const showSchema = computed(() => {
|
||||
const arr = [
|
||||
{
|
||||
field: 'requirement',
|
||||
label: '诉求',
|
||||
span: 2
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
label: '备注',
|
||||
isEditor: true,
|
||||
span: 2
|
||||
}
|
||||
]
|
||||
return [...props.schema, ...arr]
|
||||
})
|
||||
|
||||
async function open(id) {
|
||||
try {
|
||||
resetForm(id)
|
||||
const data = await ClueApi.getClue(id)
|
||||
info.value = { ...data, ...data.diyParams }
|
||||
show.value = true
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
function resetForm(id) {
|
||||
form.value = {
|
||||
clueId: id,
|
||||
dealDate: formatDate(new Date()),
|
||||
state: true,
|
||||
payPrice: 0,
|
||||
remark: undefined
|
||||
}
|
||||
}
|
||||
|
||||
function handleSave() {
|
||||
console.log('保存成功')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user