上传
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('保存成功')
|
||||
}
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -94,30 +94,42 @@
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(scope.row)"
|
||||
v-hasPermi="['clue:pool:update']"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="handleSuccess(scope.row)"
|
||||
v-hasPermi="['clue:pool:enroll']"
|
||||
>
|
||||
登记
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
v-hasPermi="['clue:pool:release']"
|
||||
@click="handleRelease(scope.row.clueId)"
|
||||
>
|
||||
释放
|
||||
</el-button>
|
||||
<template v-if="queryType != 4">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(scope.row)"
|
||||
v-hasPermi="['clue:pool:update']"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="handleSuccess(scope.row)"
|
||||
v-hasPermi="['clue:pool:enroll']"
|
||||
>
|
||||
登记
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
v-hasPermi="['clue:pool:release']"
|
||||
@click="handleRelease(scope.row.clueId)"
|
||||
>
|
||||
释放
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
v-hasPermi="['clue:pool:gain']"
|
||||
@click="handleGain(scope.row.clueId)"
|
||||
>
|
||||
获取
|
||||
</el-button>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</SSTable>
|
||||
@@ -136,7 +148,7 @@
|
||||
@get-list="getTableList"
|
||||
@update="handleEdit"
|
||||
/>
|
||||
<DialogSuccess ref="successRef" />
|
||||
<DialogSuccess ref="successRef" :schema="allSchemas.formSchema" />
|
||||
<DialogFollow ref="followRef" @success="getTableList" />
|
||||
</div>
|
||||
</template>
|
||||
@@ -256,7 +268,7 @@ async function makeCall(phone) {
|
||||
|
||||
// 登记
|
||||
function handleSuccess(row) {
|
||||
successRef.value.open(row)
|
||||
successRef.value.open(row.clueId)
|
||||
}
|
||||
|
||||
// 释放
|
||||
@@ -280,6 +292,21 @@ function handleRelease(id) {
|
||||
})
|
||||
}
|
||||
|
||||
function handleGain(id) {
|
||||
message.confirm('是否确认获取公海线索?').then(() => {
|
||||
try {
|
||||
ClueApi.getPublicClue({
|
||||
clueId: id,
|
||||
publicClue: false
|
||||
}).then(() => {
|
||||
message.success('获取成功')
|
||||
})
|
||||
} finally {
|
||||
getTableList()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const userOptions = ref([])
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
|
||||
Reference in New Issue
Block a user