salary
qsh 5 months ago
parent 4c692c48e3
commit c1cd205267
  1. 16
      src/api/clue/sign.js
  2. 2
      src/components/Descriptions/src/Descriptions.vue
  3. 380
      src/views/Clue/Pool/Comp/DialogSuccess.vue
  4. 5
      src/views/Clue/Pool/index.vue
  5. 107
      src/views/Clue/Set/Comp/DialogExtraFee.vue
  6. 107
      src/views/Clue/Set/Comp/DialogIntention.vue
  7. 126
      src/views/Clue/Set/Comp/ExtraFeeType.vue
  8. 126
      src/views/Clue/Set/Comp/IntentionStatus.vue
  9. 8
      src/views/Clue/Set/index.vue
  10. 27
      src/views/Clue/Skill/Comp/DialogSkill.vue
  11. 43
      src/views/Clue/Skill/index.vue

@ -0,0 +1,16 @@
import request from '@/config/axios'
// 查询列表
export const getSignPage = async (params) => {
return await request.get({ url: '/admin-api/crm/sign/page', params })
}
// 查询详情
export const getSign = async (id) => {
return await request.get({ url: '/admin-api/crm/sign/get?id=' + id })
}
// 新增
export const createSign = async (data) => {
return await request.post({ url: '/admin-api/crm/sign/create', data: data })
}

@ -77,7 +77,7 @@ const toggleClick = () => {
v-if="title"
:class="[
`${prefixCls}-header`,
'h-50px flex justify-between items-center border-bottom-1 border-solid border-[var(--tags-view-border-color)] px-10px cursor-pointer dark:border-[var(--el-border-color)]'
'h-40px flex justify-between items-center border-bottom-1 border-solid border-[var(--tags-view-border-color)] px-10px cursor-pointer dark:border-[var(--el-border-color)]'
]"
@click="toggleClick"
>

@ -1,31 +1,250 @@
<template>
<Dialog title="成交登记" v-model="show" width="800px">
<Descriptions :data="info" :schema="showSchema" :columns="2" />
<Dialog title="成交登记" v-model="show" width="820px">
<Descriptions
title="线索信息"
:data="info"
:schema="showSchema"
:columns="2"
labelWidth="130px"
/>
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px" class="mt-20px">
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="成交日期">
<el-col :span="8" :offset="0">
<el-form-item label="成交日期" prop="dealDate">
<el-date-picker
v-model="form.date"
v-model="form.dealDate"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
placeholder="选择日期时间"
style="width: 100%"
/>
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-col :span="8" :offset="0">
<el-form-item label="是否全款">
<el-radio-group v-model="form.isFull">
<el-radio :label="1"> 全款 </el-radio>
<el-radio :label="2"> 非全款 </el-radio>
<el-radio-group v-model="form.state">
<el-radio :label="true"> 全款 </el-radio>
<el-radio :label="false"> 非全款 </el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="支付金额">
<el-input-number v-model="form.pay" :min="1" :step="1" style="width: 100%" />
<el-col :span="8" :offset="0">
<el-form-item label="支付金额" prop="payAmount">
<el-input-number v-model="form.payAmount" :min="1" :step="1" style="width: 100%" />
</el-form-item>
</el-col>
<!-- 驾校招生模式 -->
<template v-if="appStore.getAppInfo?.instanceType == 1">
<el-col :span="8" :offset="0">
<el-form-item label="成交驾校" prop="signSchool">
<el-select
v-model="form.signSchool"
placeholder="选择驾校"
filterable
@change="changeSchool"
>
<el-option
v-for="item in schoolOptions"
:key="item.schoolId"
:label="item.schoolName"
:value="item.schoolId"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" :offset="0">
<el-form-item label="成交场地" prop="signPlace">
<el-select
v-model="form.signPlace"
placeholder="选择场地"
filterable
:disabled="!form.signSchool"
@change="changePlace"
>
<el-option
v-for="item in placeOptions"
:key="item.placeId"
:label="item.name"
:value="item.placeId"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8" :offset="0">
<el-form-item label="成交班型" prop="signClass">
<el-select
v-model="form.signClass"
:disabled="!form.signPlace"
placeholder="选择班型"
filterable
>
<el-option
v-for="item in classOptions"
:key="item.typeId"
:label="item.typeName"
:value="item.typeId"
/>
</el-select>
</el-form-item>
</el-col>
</template>
<el-col
:span="8"
:offset="0"
v-for="fieldItem in diyFieldList"
:key="fieldItem.clueParamId"
>
<el-form-item :label="fieldItem.label" :prop="fieldItem.field">
<component :is="componentMap[fieldItem.component]" v-model="form[fieldItem.field]">
<template v-if="fieldItem.component == 'Select'">
<el-option
v-for="item in fieldItem.options"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</template>
<template v-else-if="fieldItem.component == 'Radio'">
<el-radio v-for="item in fieldItem.options" :key="item.id" :label="item.id">
{{ item.name }}
</el-radio>
</template>
<template v-else-if="fieldItem.component == 'Checkbox'">
<el-checkbox
v-for="item in fieldItem.options"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</template>
</component>
</el-form-item>
</el-col>
<!-- 进销存模式 -->
<el-col :span="24" :offset="0" v-if="appStore.getAppInfo?.instanceType == 2">
<el-divider direction="horizontal" content-position="left">成交产品</el-divider>
<el-button
class="mb-5px"
type="primary"
size="small"
@click="form.signProduct.push({ productId: undefined, specsId: undefined, signNum: 0 })"
>
添加成交产品
</el-button>
<el-table :data="form.signProduct" border size="small">
<el-table-column type="index" width="50" />
<el-table-column prop="productId" label="产品">
<template #default="{ row }">
<el-select
v-model="row.productId"
placeholder="选择成交产品"
filterable
@change="row.specsId = undefined"
>
<el-option
v-for="item in prodOptions"
:key="item.productId"
:label="item.productName"
:value="item.productId"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="specsId" label="规格">
<template #default="{ row }">
<el-select
v-model="row.specsId"
placeholder="选择规格"
filterable
:disabled="!row.productId"
>
<el-option
v-for="item in specsOptions(row.productId)"
:key="item.specsId"
:label="item.specsName"
:value="item.specsId"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="signNum" label="成交数量" width="100px">
<template #default="{ row }">
<el-input-number
v-model="row.signNum"
:min="1"
size="small"
:controls="false"
style="width: 100%"
/>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注">
<template #default="{ row }">
<el-input v-model="row.remark" size="small" placeholder="备注信息" />
</template>
</el-table-column>
<el-table-column label="操作" width="60px">
<template #default="{ $index }">
<Icon
icon="ep:remove-filled"
class="text-red-500"
@click="handleRemove('signProduct', $index)"
/>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="24" :offset="0" class="mb-18px">
<el-divider direction="horizontal" content-position="left">额外支出</el-divider>
<el-button
class="mb-5px"
type="primary"
size="small"
@click="form.extraPay.push({ extraPayType: undefined, extraPayMoney: 0 })"
>
添加额外支出
</el-button>
<el-table :data="form.extraPay" border size="small">
<el-table-column type="index" width="50" />
<el-table-column prop="extraPayType" label="额外支出类型" width="200px">
<template #default="{ row }">
<el-select
v-model="row.extraPayType"
size="small"
placeholder="额外支出类型"
filterable
>
<el-option
v-for="item in extraPayOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="extraPayMoney" label="额外支出金额" width="180px">
<template #default="{ row }">
<el-input-number v-model="row.extraPayMoney" size="small" :controls="false" />
</template>
</el-table-column>
<el-table-column prop="remark" label="备注">
<template #default="{ row }">
<el-input v-model="row.remark" size="small" placeholder="备注信息" />
</template>
</el-table-column>
<el-table-column label="操作" width="60px">
<template #default="{ $index }">
<Icon
icon="ep:remove-filled"
class="text-red-500"
@click="handleRemove('extraPay', $index)"
/>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="24" :offset="0">
<el-form-item label="备注">
<Editor v-model:modelValue="form.remark" />
@ -44,12 +263,36 @@
<script setup name="DialogSuccess">
import * as ClueApi from '@/api/clue'
import { createSign } from '@/api/clue/sign'
import { getDiyFieldList } from '@/api/clue/orderField'
import { getPlaceList } from '@/api/school/place'
import { getClassTypePage } from '@/api/school/class'
import { getSimpleProductList } from '@/api/mall/product'
// import { getSimpleWarehouseList } from '@/api/mall/warehouse'
import { formatDate } from '@/utils/formatTime'
import { getDictOptions } from '@/utils/dict'
import { componentMap } from '@/components/Form/src/componentMap'
import { useAppStore } from '@/store/modules/app'
const show = ref(false)
const form = ref({})
const rules = ref({})
const rules = ref({
dealDate: { required: true, message: '成交日期不可为空', trigger: 'change' },
payAmount: { required: true, message: '支付金额不可为空', trigger: 'change,blur' }
})
const schoolRules = {
signSchool: { required: true, message: '成交驾校不可为空', trigger: 'change' },
signPlace: { required: true, message: '成交场地不可为空', trigger: 'change' },
signClass: { required: true, message: '成交班型不可为空', trigger: 'change' }
}
const info = ref({})
const formLoading = ref(false)
const appStore = useAppStore()
const { t } = useI18n() //
const message = useMessage() //
const props = defineProps({
schema: {
@ -74,6 +317,8 @@ const showSchema = computed(() => {
return [...props.schema, ...arr]
})
const extraPayOptions = getDictOptions('extra_pay_type')
async function open(id) {
try {
resetForm(id)
@ -91,14 +336,115 @@ function resetForm(id) {
clueId: id,
dealDate: formatDate(new Date()),
state: true,
payPrice: 0,
remark: undefined
payAmount: 0,
remark: undefined,
extraPay: [],
signProduct: []
}
}
const formRef = ref()
async function handleSave() {
//
if (!formRef.value) return
const valid = await formRef.value.validate()
if (!valid) return
if (form.value.extraPay.some((it) => !it.extraPayType || it.extraPayMoney == null)) {
message.info('请将支付类型及支出金额填写完整!')
return
}
if (form.value.signProduct.some((it) => !it.schoolId || !item.specsId || !it.signNum)) {
message.info('请将成交产品信息填写完整!')
return
}
//
formLoading.value = true
try {
await createSign(form.value)
message.success(t('common.createSuccess'))
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
const schoolOptions = ref([])
const allPlaceOptions = ref([])
const prodOptions = ref([])
// const warehouseOptions = ref([])
const specsOptions = computed({
get() {
return (prodId) => {
if (prodId) {
return prodOptions.value.find((it) => it.productId == prodId).productSpecList
}
return []
}
}
})
const diyFieldList = ref([])
const placeOptions = computed(() => {
return allPlaceOptions.value.filter((it) => it.schoolId == form.value.signSchool)
})
const classOptions = ref([])
async function getClassTypeOptions() {
const data = await getClassTypePage({ placeId: form.value.signPlace })
classOptions.value = data.list
}
function getOptions() {
if (appStore.getAppInfo?.instanceType == 1) {
//
getPlaceList().then((data) => {
schoolOptions.value = data.schoolList
allPlaceOptions.value = data.placeList
})
} else {
//
getSimpleProductList().then((data) => {
prodOptions.value = data
})
//
// getSimpleWarehouseList().then((data) => {
// warehouseOptions.value = data
// })
}
//
getDiyFieldList().then((data) => {
diyFieldList.value = data
})
}
function changeSchool() {
form.value.signPlace = undefined
form.value.signClass = undefined
}
function handleSave() {
console.log('保存成功')
function changePlace() {
form.value.signClass = undefined
getClassTypeOptions()
}
function handleRemove(type, index) {
form.value[type].splice(index, 1)
}
onMounted(() => {
if (appStore.getAppInfo?.instanceType == 1) {
rules.value = { ...rules.value, ...schoolRules }
}
getOptions()
})
</script>
<style lang="scss" scoped></style>

@ -81,6 +81,9 @@
<div v-else-if="item.form?.component == 'DatePicker'">
<span>{{ formatDate(row[item.field]) }}</span>
</div>
<div v-else-if="item.field == 'remark' || item.form?.component == 'Editor'">
<p v-dompurify-html="row.remark"></p>
</div>
<span v-else>{{ row[item.field] }}</span>
</template>
</el-table-column>
@ -148,7 +151,7 @@
@get-list="getTableList"
@update="handleEdit"
/>
<DialogSuccess ref="successRef" :schema="allSchemas.formSchema" />
<DialogSuccess ref="successRef" :schema="allSchemas.formSchema" @success="getTableList" />
<DialogFollow ref="followRef" @success="getTableList" />
</div>
</template>

@ -0,0 +1,107 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
<el-form
ref="formRef"
v-loading="formLoading"
:model="formData"
:rules="formRules"
label-width="80px"
>
<el-form-item label="支出项" prop="label">
<el-input v-model="formData.label" placeholder="请输入支出项" />
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="formData.sort" placeholder="请输入排序" type="number" :min="0" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
type="textarea"
v-model="formData.remark"
placeholder="请输入备注"
:autosize="{ minRows: 4, maxRows: 8 }"
/>
</el-form-item>
</el-form>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script name="DialogExtraFee" setup>
import * as dictApi from '@/api/system/dict/dict.data'
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
label: '',
sort: 1,
remark: ''
})
const formRules = reactive({
label: [{ required: true, message: '支出项不能为空', trigger: 'blur' }]
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (type, id) => {
dialogVisible.value = true
dialogTitle.value = type == 'update' ? '修改支出项' : '新增支出项'
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await dictApi.getDictData(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
if (!formRef.value) return
const valid = await formRef.value.validate()
if (!valid) return
//
formLoading.value = true
try {
if (!formData.value.value) {
formData.value.value = formData.value.label
}
if (formType.value === 'create') {
await dictApi.createDictData(formData.value)
message.success(t('common.createSuccess'))
} else {
await dictApi.updateDictData(formData.value)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
label: '',
sort: 1,
status: 0,
dictType: 'extra_pay_type',
remark: ''
}
formRef.value?.resetFields()
}
</script>

@ -0,0 +1,107 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
<el-form
ref="formRef"
v-loading="formLoading"
:model="formData"
:rules="formRules"
label-width="80px"
>
<el-form-item label="意向状态" prop="label">
<el-input v-model="formData.label" placeholder="请输入意向状态" />
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="formData.sort" placeholder="请输入排序" type="number" :min="0" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input
type="textarea"
v-model="formData.remark"
placeholder="请输入备注"
:autosize="{ minRows: 4, maxRows: 8 }"
/>
</el-form-item>
</el-form>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script name="DialogIntention" setup>
import * as dictApi from '@/api/system/dict/dict.data'
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
label: '',
sort: 1,
remark: ''
})
const formRules = reactive({
label: [{ required: true, message: '意向状态不能为空', trigger: 'blur' }]
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (type, id) => {
dialogVisible.value = true
dialogTitle.value = type == 'update' ? '修改意向状态' : '新增意向状态'
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await dictApi.getDictData(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
if (!formRef.value) return
const valid = await formRef.value.validate()
if (!valid) return
//
formLoading.value = true
try {
if (!formData.value.value) {
formData.value.value = formData.value.label
}
if (formType.value === 'create') {
await dictApi.createDictData(formData.value)
message.success(t('common.createSuccess'))
} else {
await dictApi.updateDictData(formData.value)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
label: '',
sort: 1,
status: 0,
dictType: 'intention_state',
remark: ''
}
formRef.value?.resetFields()
}
</script>

@ -0,0 +1,126 @@
<template>
<div>
<el-form ref="queryForm" :model="searchForm" label-width="0" inline>
<el-form-item>
<el-input
v-model="searchForm.name"
placeholder="请输入名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery">搜索</el-button>
<el-button @click="resetQuery">重置</el-button>
<el-button type="primary" @click="openForm('create', null)">新增</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="tableList">
<el-table-column prop="label" label="支出项" />
<el-table-column prop="sort" label="排序" width="100px" />
<el-table-column prop="remark" label="备注" />
<el-table-column
label="创建时间"
prop="createTime"
width="180px"
:formatter="dateFormatter"
/>
<el-table-column label="操作">
<template #default="scope">
<el-button
type="primary"
:disabled="!scope.row.editable"
text
@click="openForm('update', scope.row.id)"
>
修改
</el-button>
<el-button
type="danger"
:disabled="!scope.row.editable"
text
@click="handleDelete(scope.row.id)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<Pagination
v-model:limit="searchForm.pageSize"
v-model:page="searchForm.pageNo"
:total="total"
@pagination="getList"
/>
<DialogExtraFee ref="intentionDialog" @success="handleQuery" />
</div>
</template>
<script setup name="ExtraFeeType">
import { dateFormatter } from '@/utils/formatTime'
import DialogExtraFee from './DialogExtraFee.vue'
import * as dictApi from '@/api/system/dict/dict.data'
const { t } = useI18n() //
const message = useMessage() //
const searchForm = ref({
label: '',
pageSize: 20,
pageNo: 1,
dictType: 'extra_pay_type'
})
const total = ref(0)
const intentionDialog = ref()
const tableList = ref([])
const loading = ref(false)
function handleQuery() {
searchForm.value.pageNo = 1
getList()
}
function resetQuery() {
searchForm.value = {
label: '',
pageSize: 20,
pageNo: 1,
dictType: 'extra_pay_type'
}
getList()
}
async function getList() {
loading.value = true
try {
const data = await dictApi.getDictDataPage(searchForm.value)
tableList.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
function openForm(type, id) {
intentionDialog.value.open(type, id)
}
async function handleDelete(id) {
try {
//
await message.delConfirm()
//
await dictApi.deleteDictData(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
onMounted(() => {
handleQuery()
})
</script>
<style lang="scss" scoped></style>

@ -0,0 +1,126 @@
<template>
<div>
<el-form ref="queryForm" :model="searchForm" label-width="0" inline>
<el-form-item>
<el-input
v-model="searchForm.name"
placeholder="请输入名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery">搜索</el-button>
<el-button @click="resetQuery">重置</el-button>
<el-button type="primary" @click="openForm('create', null)">新增</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="tableList">
<el-table-column prop="label" label="意向状态" />
<el-table-column prop="sort" label="排序" width="100px" />
<el-table-column prop="remark" label="备注" />
<el-table-column
label="创建时间"
prop="createTime"
width="180px"
:formatter="dateFormatter"
/>
<el-table-column label="操作">
<template #default="scope">
<el-button
type="primary"
:disabled="!scope.row.editable"
text
@click="openForm('update', scope.row.id)"
>
修改
</el-button>
<el-button
type="danger"
:disabled="!scope.row.editable"
text
@click="handleDelete(scope.row.id)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<Pagination
v-model:limit="searchForm.pageSize"
v-model:page="searchForm.pageNo"
:total="total"
@pagination="getList"
/>
<DialogIntention ref="intentionDialog" @success="handleQuery" />
</div>
</template>
<script setup name="IntentionStatus">
import { dateFormatter } from '@/utils/formatTime'
import DialogIntention from './DialogIntention.vue'
import * as dictApi from '@/api/system/dict/dict.data'
const { t } = useI18n() //
const message = useMessage() //
const searchForm = ref({
label: '',
pageSize: 20,
pageNo: 1,
dictType: 'intention_state'
})
const total = ref(0)
const intentionDialog = ref()
const tableList = ref([])
const loading = ref(false)
function handleQuery() {
searchForm.value.pageNo = 1
getList()
}
function resetQuery() {
searchForm.value = {
label: '',
pageSize: 20,
pageNo: 1,
dictType: 'intention_state'
}
getList()
}
async function getList() {
loading.value = true
try {
const data = await dictApi.getDictDataPage(searchForm.value)
tableList.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
function openForm(type, id) {
intentionDialog.value.open(type, id)
}
async function handleDelete(id) {
try {
//
await message.delConfirm()
//
await dictApi.deleteDictData(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
onMounted(() => {
handleQuery()
})
</script>
<style lang="scss" scoped></style>

@ -24,6 +24,12 @@
>
<ClueSend v-if="tabIndex == 30" />
</el-tab-pane> -->
<el-tab-pane label="意向状态" :name="35" v-if="checkPermi(['clue:setting:intention-status'])">
<IntentionStatus v-if="tabIndex == 35" />
</el-tab-pane>
<el-tab-pane label="额外支出项" :name="36" v-if="checkPermi(['clue:setting:extra-fee'])">
<ExtraFeeType v-if="tabIndex == 36" />
</el-tab-pane>
<el-tab-pane label="常规设置" :name="40" v-if="checkPermi(['clue:setting:general-setting'])">
<GeneralSet v-if="tabIndex == 40" />
</el-tab-pane>
@ -41,6 +47,8 @@ import ClueSource from './Comp/ClueSource.vue'
// import ClueGet from './Comp/ClueGet.vue'
// import ClueSend from './Comp/ClueSend.vue'
// import MsgSend from './Comp/MsgSend.vue'
import IntentionStatus from './Comp/IntentionStatus.vue'
import ExtraFeeType from './Comp/ExtraFeeType.vue'
import GeneralSet from './Comp/GeneralSet.vue'
import { checkPermi } from '@/utils/permission'

@ -10,11 +10,11 @@
<el-form-item label="问题" prop="question">
<el-input v-model="formData.question" placeholder="请输入问题" />
</el-form-item>
<el-form-item label="关键词" prop="keyword">
<el-input v-model="formData.keyword" placeholder="请输入关键词" />
<el-form-item label="关键词" prop="skillKey">
<el-input v-model="formData.skillKey" placeholder="请输入关键词,,以“,”分割" />
</el-form-item>
<el-form-item label="答案" prop="answer">
<Editor v-model:modelValue="formData.answer" />
<el-form-item label="答案" prop="content">
<Editor v-model:modelValue="formData.content" />
</el-form-item>
</el-form>
<template #footer>
@ -24,6 +24,8 @@
</Dialog>
</template>
<script name="DialogSkill" setup>
import * as SkillApi from '@/api/clue/skill'
const { t } = useI18n() //
const message = useMessage() //
@ -33,12 +35,12 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
const formType = ref('') // create - update -
const formData = ref({
question: '',
keyword: [],
answer: ''
skillKey: '',
content: ''
})
const formRules = reactive({
question: [{ required: true, message: '问题不能为空', trigger: 'blur' }],
answer: [{ required: true, message: '答案不能为空', trigger: 'blur,change' }]
content: [{ required: true, message: '答案不能为空', trigger: 'blur,change' }]
})
const formRef = ref() // Ref
@ -52,7 +54,7 @@ const open = async (type, id) => {
if (id) {
formLoading.value = true
try {
// formData.value = await UserApi.getUser(id)
formData.value = await SkillApi.getSkill(id)
} finally {
formLoading.value = false
}
@ -70,12 +72,11 @@ const submitForm = async () => {
//
formLoading.value = true
try {
// const data = formData.value as unknown as UserApi.UserVO
if (formType.value === 'create') {
// await UserApi.createUser(data)
await SkillApi.createSkill(formData.value)
message.success(t('common.createSuccess'))
} else {
// await UserApi.updateUser(data)
await SkillApi.updateSkill(formData.value)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
@ -90,8 +91,8 @@ const submitForm = async () => {
const resetForm = () => {
formData.value = {
question: '',
keyword: [],
answer: ''
skillKey: '',
content: ''
}
formRef.value?.resetFields()
}

@ -20,16 +20,16 @@
</el-button>
</el-form-item>
</el-form>
<el-table :data="tableList">
<el-table-column type="index" width="55" align="center" />
<el-table-column label="问题" align="center" prop="question" />
<el-table-column label="答案" align="center" prop="content">
<el-table v-loading="loading" :data="tableList">
<el-table-column type="index" width="55" />
<el-table-column label="问题" prop="question" />
<el-table-column label="答案" prop="content">
<template #default="scope">
<p v-dompurify-html="scope.row.content"></p>
</template>
</el-table-column>
<el-table-column label="关键词" align="center" prop="skillKey" />
<el-table-column label="操作" align="center">
<el-table-column label="关键词" prop="skillKey" />
<el-table-column label="操作">
<template #default="scope">
<el-button
type="primary"
@ -52,7 +52,7 @@
</el-table>
<Pagination
v-model:limit="searchForm.pageSize"
v-model:page="searchForm.pageNum"
v-model:page="searchForm.pageNo"
:total="total"
@pagination="handleQuery"
/>
@ -61,16 +61,19 @@
</template>
<script setup name="ClueSkill">
import * as SkillApi from '@/api/clue/skill'
import DialogSkill from './Comp/DialogSkill.vue'
const skillDialog = ref()
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(false)
const searchForm = ref({
question: '',
pageSize: 20,
pageNum: 1
pageNo: 1
})
const total = ref(0)
@ -81,18 +84,25 @@ function resetQuery() {
searchForm.value = {
question: '',
pageSize: 20,
pageNum: 1
pageNo: 1
}
getList()
}
function handleQuery() {
searchForm.value.pageNum = 1
searchForm.value.pageNo = 1
getList()
}
function getList() {
tableList.value = [{ question: '测试' }]
async function getList() {
loading.value = true
try {
const data = await SkillApi.getSkillPage(searchForm.value)
tableList.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
function handleAdd() {
@ -100,21 +110,24 @@ function handleAdd() {
}
function handleUpdate(row) {
skillDialog.value.open('update', row)
skillDialog.value.open('update', row.id)
}
async function handleDelete(row) {
try {
console.log(row)
//
await message.delConfirm()
//
// await UserApi.deleteUser(row.id)
await SkillApi.deleteSkill(row.skillId)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
onMounted(() => {
handleQuery()
})
</script>
<style lang="scss" scoped></style>

Loading…
Cancel
Save