This commit is contained in:
qsh
2024-06-14 15:55:48 +08:00
parent d22a380612
commit 4c692c48e3
18 changed files with 507 additions and 180 deletions

View File

@@ -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('保存成功')
}

View File

@@ -19,8 +19,12 @@
<el-tag type="success">{{ info.intentionState }}</el-tag>
</div>
<div>
<el-button type="primary" plain @click="handleUpdate">修改</el-button>
<el-button type="danger" plain @click="handleRemove">删除</el-button>
<el-button type="primary" v-hasPermi="['clue:pool:update']" plain @click="handleUpdate">
修改
</el-button>
<el-button type="danger" v-hasPermi="['clue:pool:delete']" plain @click="handleRemove">
删除
</el-button>
</div>
</div>
</el-skeleton>
@@ -37,7 +41,13 @@
<!-- 详细信息 -->
<el-tabs v-model="infoIndex" type="border-card">
<el-tab-pane label="跟进记录" name="followRecord">
<el-button class="mb-10px" type="primary" @click="addFollow">添加跟进记录</el-button>
<el-button
v-hasPermi="['clue:pool:update']"
class="mb-10px"
type="primary"
@click="addFollow"
>添加跟进记录</el-button
>
<el-timeline>
<el-timeline-item
v-for="item in followRecordList"
@@ -148,7 +158,8 @@ const showSchema = computed(() => {
{
field: 'remark',
label: '备注',
span: 2
span: 2,
isEditor: true
}
]
return [...props.schema, ...arr]