Compare commits

..

No commits in common. 'main' and 'dev-report' have entirely different histories.

  1. 10
      src/api/clue/sign.js
  2. 8
      src/api/home/reportSaler.js
  3. 33
      src/api/school/setting/supplier.js
  4. 13
      src/styles/index.scss
  5. 12
      src/views/Basic/Role/Comp/RoleEmployee.vue
  6. 18
      src/views/Clue/Order/Comp/AfterSales.vue
  7. 130
      src/views/Clue/Order/Comp/DialogAddProduct.vue
  8. 13
      src/views/Clue/Order/Comp/DialogDelivery.vue
  9. 13
      src/views/Clue/Order/Comp/DialogOrder.vue
  10. 46
      src/views/Clue/Order/Comp/MallOrderList.vue
  11. 13
      src/views/Clue/Order/Comp/MallSettle.vue
  12. 170
      src/views/Clue/Order/Comp/Reback.vue
  13. 13
      src/views/Clue/Order/Comp/SchoolSettle.vue
  14. 3
      src/views/Clue/Pool/index.vue
  15. 170
      src/views/Clue/Set/Comp/DialogSource.vue
  16. 4
      src/views/Home/CloseRate.vue
  17. 62
      src/views/Home/Comp/BarSalerClueReport.vue
  18. 402
      src/views/Home/Comp/DialogSalerReportDetail.vue
  19. 73
      src/views/Home/Comp/SignListCard.vue
  20. 7
      src/views/Home/Index.vue
  21. 248
      src/views/Home/SalesReport.vue
  22. 38
      src/views/MiniMall/MallSet/Comp/DialogSupplier.vue
  23. 28
      src/views/MiniMall/MallSet/Comp/SupplierSet.vue
  24. 12
      src/views/MiniMall/Product/index.vue
  25. 12
      src/views/MiniMall/Purchase/index.vue
  26. 4
      src/views/Profile/components/UserSocial.vue

@ -51,13 +51,3 @@ export const updateProduceSort = (data) => {
export const getSignProfit = (params) => { export const getSignProfit = (params) => {
return request.get({ url: '/admin-api/crm/sign/profit', params }) return request.get({ url: '/admin-api/crm/sign/profit', params })
} }
// 新增产品
export const addOrderProduct = (data) => {
return request.post({ url: '/admin-api/crm/sign-prodcut/create', data })
}
// 新增产品
export const removeOrderProduct = (id) => {
return request.delete({ url: '/admin-api/crm/sign-prodcut/delete?id=' + id })
}

@ -1,8 +0,0 @@
import request from '@/config/axios'
export const getInfo = async (data) => {
return await request.post({ url: '/admin-api/crm/sch-clue/sale/report/detail', data })
}
export const getList = async (data) => {
return await request.post({ url: '/admin-api/crm/sch-clue/sale/report', data })
}

@ -1,33 +0,0 @@
import request from '@/config/axios'
// 查询列表
export const getSupplierPage = async (params) => {
return await request.get({ url: '/admin-api/crm/erp-supplier/page', params })
}
export const getSupplierSimpleList = async (params) => {
return await request.get({ url: '/admin-api/crm/erp-supplier/simple-list', params })
}
// 查询详情
export const getSupplier = async (id) => {
return await request.get({ url: '/admin-api/crm/erp-supplier/get?id=' + id })
}
// 新增
export const createSupplier = async (data) => {
return await request.post({
url: '/admin-api/crm/erp-supplier/create',
data: data,
isSubmitForm: true
})
}
// 修改
export const updateSupplier = async (params) => {
return await request.put({ url: '/admin-api/crm/erp-supplier/update', data: params })
}
// 删除
export const deleteSupplier = async (id) => {
return await request.delete({ url: '/admin-api/crm/erp-supplier/delete?id=' + id })
}

@ -69,16 +69,3 @@
width: 100%; width: 100%;
} }
} }
.el-table {
.caret-wrapper {
width: 16px;
}
.sort-caret {
left: 2px;
}
}
.el-table--default .cell {
padding: 0 5px;
}

@ -9,18 +9,6 @@
:label="col.label" :label="col.label"
:width="col.width" :width="col.width"
/> />
<el-table-column label="状态" key="status">
<template #default="scope">
<el-switch
v-model="scope.row.status"
:active-value="0"
active-text="在职"
inactive-text="离职"
:inactive-value="1"
disabled
/>
</template>
</el-table-column>
</el-table> </el-table>
<Pagination <Pagination
v-model:limit="pageSize" v-model:limit="pageSize"

@ -83,18 +83,6 @@
style="width: 240px" style="width: 240px"
/> />
</el-form-item> </el-form-item>
<template v-if="appStore.getAppInfo?.instanceType == 1">
<el-form-item>
<el-select v-model="searchForm.area" placeholder="选择区域" clearable filterable>
<el-option
v-for="item in areaOptions"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</template>
<el-form-item> <el-form-item>
<el-button @click="handleSearch" v-hasPermi="['clue:order:after-sale-search']"> <el-button @click="handleSearch" v-hasPermi="['clue:order:after-sale-search']">
查询 查询
@ -201,7 +189,6 @@
<script setup name="AfterSales"> <script setup name="AfterSales">
import * as AfterSaleApi from '@/api/clue/afterSale' import * as AfterSaleApi from '@/api/clue/afterSale'
import { getSimpleUserList as getUserOption } from '@/api/system/user' import { getSimpleUserList as getUserOption } from '@/api/system/user'
import { getAreaSimpleList } from '@/api/school/setting/area'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import DialogAfterSaleAudit from './DialogAfterSaleAudit.vue' import DialogAfterSaleAudit from './DialogAfterSaleAudit.vue'
@ -305,12 +292,7 @@ function handleAudit(row) {
afterSaleAuditDialog.value.open(row) afterSaleAuditDialog.value.open(row)
} }
const areaOptions = ref([])
function getOptions() { function getOptions() {
//
getAreaSimpleList().then((data) => {
areaOptions.value = data
})
getUserOption().then((data) => { getUserOption().then((data) => {
userOptions.value = data userOptions.value = data
}) })

@ -1,130 +0,0 @@
<template>
<Dialog title="添加产品" v-model="show" width="800px">
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px">
<el-row :gutter="20">
<el-col :span="12" :offset="0">
<el-form-item label="成交产品" prop="productId">
<el-select
v-model="form.productId"
placeholder="选择成交产品"
filterable
@change="form.specsId = undefined"
>
<el-option
v-for="item in prodOptions"
:key="item.productId"
:label="item.productName"
:value="item.productId"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="产品规格" prop="specsId">
<el-select
v-model="form.specsId"
placeholder="选择规格"
filterable
:disabled="!form.productId"
>
<el-option
v-for="item in specsOptions(form.productId)"
:key="item.specsId"
:label="item.specsName"
:value="item.specsId"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="成交数量" prop="signNum">
<el-input-number v-model="form.signNum" :min="1" :controls="false" />
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="生产状态" prop="isProduced">
<el-radio-group v-model="form.isProduced">
<el-radio :label="0">待生产</el-radio>
<el-radio :label="1">已生产</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="24" :offset="0">
<el-form-item label="备注" prop="remark">
<el-input
type="textarea"
:autoSize="{ minRows: 3 }"
v-model="form.remark"
placeholder="请输入备注"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<span>
<el-button @click="show = false"> </el-button>
<el-button :disabled="formLoading" type="primary" @click="handleSave"> </el-button>
</span>
</template>
</Dialog>
</template>
<script setup name="DialogProduct">
import { addOrderProduct } from '@/api/clue/sign'
const message = useMessage() //
const specsOptions = computed({
get() {
return (prodId) => {
if (prodId) {
return prodOptions.value.find((it) => it.productId == prodId).productSpecList
}
return []
}
}
})
const show = ref(false)
const form = ref({})
const rules = {
productId: { required: true, message: '成交产品不可为空', trigger: 'change' },
specsId: { required: true, message: '产品规格不可为空', trigger: 'change' },
signNum: { required: true, message: '成交数量不可为空', trigger: 'blur' }
}
const prodOptions = ref([])
function open(signId, arr) {
prodOptions.value = arr
form.value.signId = signId
form.value.isProduced = 0
show.value = true
}
defineExpose({ open })
const emit = defineEmits(['success'])
const formRef = ref()
const formLoading = ref(false)
async function handleSave() {
//
if (!formRef.value) return
const valid = await formRef.value.validate()
if (!valid) return
//
formLoading.value = true
try {
await addOrderProduct(form.value)
message.success('新增成功!')
show.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
</script>
<style lang="scss" scoped></style>

@ -28,9 +28,9 @@
<el-select v-model="form.supplier" placeholder="选择供应商" filterable> <el-select v-model="form.supplier" placeholder="选择供应商" filterable>
<el-option <el-option
v-for="item in supplierOptions" v-for="item in supplierOptions"
:key="item.id" :key="item.value"
:label="item.supplierName" :label="item.label"
:value="item.id" :value="item.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -141,18 +141,15 @@
import { getSimpleWarehouseList, getRemainInventoryList } from '@/api/mall/warehouse' import { getSimpleWarehouseList, getRemainInventoryList } from '@/api/mall/warehouse'
import { createDelivery } from '@/api/clue/delivery' import { createDelivery } from '@/api/clue/delivery'
import { getConfigList } from '@/api/system/set' import { getConfigList } from '@/api/system/set'
import { getSupplierSimpleList } from '@/api/school/setting/supplier' import { getDictOptions } from '@/utils/dict'
import { getExtraFeeSimpleList } from '@/api/clue/extraFee' import { getExtraFeeSimpleList } from '@/api/clue/extraFee'
const message = useMessage() // const message = useMessage() //
const warehouseOptions = ref([]) const warehouseOptions = ref([])
const extraPayOptions = ref([]) const extraPayOptions = ref([])
const supplierOptions = ref([]) const supplierOptions = getDictOptions('erp_supplier')
function getOptions() { function getOptions() {
getSupplierSimpleList().then((data) => {
supplierOptions.value = data
})
getSimpleWarehouseList().then((data) => { getSimpleWarehouseList().then((data) => {
warehouseOptions.value = data warehouseOptions.value = data
}) })

@ -61,15 +61,14 @@
</el-table> </el-table>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="回款记录" name="returnRecord"> <el-tab-pane
label="回款记录"
name="returnRecord"
v-if="checkPermi(['clue:order:return-list'])"
>
<el-table :data="returnRecordList" border stripe> <el-table :data="returnRecordList" border stripe>
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column <el-table-column prop="money" label="回款金额" />
v-if="checkPermi(['clue:order:return-list'])"
prop="money"
label="回款金额"
/>
<el-table-column prop="personProfit" label="员工利润" />
<el-table-column prop="applyTime" label="申请日期" /> <el-table-column prop="applyTime" label="申请日期" />
<el-table-column prop="isPayoff" label="是否结清" /> <el-table-column prop="isPayoff" label="是否结清" />
<el-table-column prop="stateName" label="审核状态" /> <el-table-column prop="stateName" label="审核状态" />

@ -74,8 +74,8 @@
@get-checked-columns="getCheckedColumns" @get-checked-columns="getCheckedColumns"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="60" fixed="left" /> <el-table-column type="selection" width="60" />
<el-table-column type="expand" fixed="left"> <el-table-column type="expand">
<template #default="{ row }"> <template #default="{ row }">
<div class="p-10px flex justify-center"> <div class="p-10px flex justify-center">
<VueDraggable <VueDraggable
@ -91,8 +91,8 @@
stripe stripe
style="width: 80%; margin: 0 auto" style="width: 80%; margin: 0 auto"
> >
<el-table-column prop="productName" label="成交产品" width="120px" /> <el-table-column prop="productName" label="成交产品" />
<el-table-column prop="specsName" label="产品规格" width="120px" /> <el-table-column prop="specsName" label="产品规格" />
<el-table-column prop="signNum" label="成交数量" width="90px" /> <el-table-column prop="signNum" label="成交数量" width="90px" />
<el-table-column prop="remark" label="成交备注" width="100px" /> <el-table-column prop="remark" label="成交备注" width="100px" />
<el-table-column label="生产状态" width="160px"> <el-table-column label="生产状态" width="160px">
@ -147,15 +147,6 @@
> >
发货 发货
</el-button> </el-button>
<el-button
type="danger"
link
style="padding: 0; margin-left: 0"
v-hasPermi="['clue:order:remove-product']"
@click="handleRemoveProduct(scope.row)"
>
删除
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -237,16 +228,6 @@
> >
取消登记 取消登记
</el-button> </el-button>
<el-button
type="primary"
class="mr-10px"
link
style="padding: 0; margin-left: 0"
v-hasPermi="['clue:order:add-product']"
@click="handleAddProduct(scope.row)"
>
添加产品
</el-button>
</template> </template>
</el-table-column> </el-table-column>
</SSTable> </SSTable>
@ -257,7 +238,6 @@
<DialogAfterSale ref="afterSaleDialog" /> <DialogAfterSale ref="afterSaleDialog" />
<DialogExtraFee ref="extraFeeDialog" /> <DialogExtraFee ref="extraFeeDialog" />
<DialogDelivery ref="deliveryDialog" @success="getTableList" /> <DialogDelivery ref="deliveryDialog" @success="getTableList" />
<DialogAddProduct ref="addProductDialog" @success="getTableList" />
</div> </div>
</template> </template>
@ -272,7 +252,6 @@ import DialogFeeback from './DialogFeeback.vue'
import DialogAfterSale from './DialogAfterSale.vue' import DialogAfterSale from './DialogAfterSale.vue'
import DialogExtraFee from './DialogExtraPay.vue' import DialogExtraFee from './DialogExtraPay.vue'
import DialogDelivery from './DialogDelivery.vue' import DialogDelivery from './DialogDelivery.vue'
import DialogAddProduct from './DialogAddProduct.vue'
import { removeNullField } from '@/utils' import { removeNullField } from '@/utils'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
@ -425,11 +404,6 @@ function handleDelivery(row) {
deliveryDialog.value.open(row) deliveryDialog.value.open(row)
} }
const addProductDialog = ref()
function handleAddProduct(row) {
addProductDialog.value.open(row.signId, prodOptions.value)
}
const batchIds = ref([]) const batchIds = ref([])
function handleSelectionChange(val) { function handleSelectionChange(val) {
batchIds.value = val.map((it) => it.signId) batchIds.value = val.map((it) => it.signId)
@ -486,18 +460,6 @@ function handleBatchUpdateInstall() {
} }
} }
async function handleRemoveProduct(row) {
try {
//
await message.confirm(`确认要删除${row.productName}吗?`)
//
await SignApi.removeOrderProduct(row.id)
message.success('删除成功')
//
getTableList()
} catch {}
}
async function handleChangeProdoce(row) { async function handleChangeProdoce(row) {
try { try {
// //

@ -116,9 +116,9 @@
> >
<el-option <el-option
v-for="item in supplierOptions" v-for="item in supplierOptions"
:key="item.id" :key="item.value"
:label="item.supplierName" :label="item.label"
:value="item.id" :value="item.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -267,7 +267,7 @@ import { getSimpleUserList as getUserOption } from '@/api/system/user'
import { getSimpleProductList } from '@/api/mall/product' import { getSimpleProductList } from '@/api/mall/product'
import * as SettleApi from '@/api/clue/settle' import * as SettleApi from '@/api/clue/settle'
import { getSupplierSimpleList } from '@/api/school/setting/supplier' import { getDictOptions } from '@/utils/dict'
import { removeNullField } from '@/utils/index' import { removeNullField } from '@/utils/index'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
@ -419,12 +419,9 @@ async function handleSaveSettle() {
const userOptions = ref([]) const userOptions = ref([])
const prodOptions = ref([]) const prodOptions = ref([])
const supplierOptions = ref([]) const supplierOptions = getDictOptions('erp_supplier')
function getOptions() { function getOptions() {
getSupplierSimpleList().then((data) => {
supplierOptions.value = data
})
// //
getSimpleProductList().then((data) => { getSimpleProductList().then((data) => {
prodOptions.value = data prodOptions.value = data

@ -18,93 +18,22 @@
<el-option label="已驳回" :value="4" /> <el-option label="已驳回" :value="4" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<template v-if="appStore.getAppInfo?.instanceType == 1"> <el-form-item v-if="appStore.getAppInfo?.instanceType == 1">
<el-form-item> <el-select
<el-select v-model="searchForm.receiver"
v-model="searchForm.receiver" placeholder="接待人"
placeholder="接待人" clearable
clearable filterable
filterable style="width: 120px"
style="width: 120px" >
> <el-option
<el-option v-for="item in allUserOptions"
v-for="item in allUserOptions" :key="item.id"
:key="item.id" :label="item.nickname"
:label="item.nickname" :value="item.id"
:value="item.id" />
/> </el-select>
</el-select> </el-form-item>
</el-form-item>
<el-form-item>
<el-select
v-model="searchForm.signSchool"
placeholder="选择驾校"
filterable
clearable
@change="changeSchool"
>
<el-option
v-for="item in schoolOptions"
:key="item.schoolId"
:label="item.schoolName"
:value="item.schoolId"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-select
v-model="searchForm.signPlace"
placeholder="选择场地"
filterable
clearable
:disabled="!searchForm.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-form-item>
<el-select
v-model="searchForm.signClass"
:disabled="!searchForm.signPlace"
placeholder="选择班型"
filterable
clearable
>
<el-option
v-for="item in classOptions"
:key="item.typeId"
:label="item.typeName"
:value="item.typeId"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-select v-model="searchForm.licenseType" placeholder="驾照类型" filterable clearable>
<el-option
v-for="item in getDictOptions(DICT_TYPE.LINCENSE_TYPE)"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-select v-model="searchForm.area" placeholder="选择区域" clearable filterable>
<el-option
v-for="item in areaOptions"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</template>
<el-form-item v-else-if="appStore.getAppInfo?.instanceType == 2"> <el-form-item v-else-if="appStore.getAppInfo?.instanceType == 2">
<el-select <el-select
v-model="searchForm.convertPeople" v-model="searchForm.convertPeople"
@ -269,30 +198,6 @@
<div v-else>{{ row.isPayoff }}</div> <div v-else>{{ row.isPayoff }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
v-if="appStore.getAppInfo?.instanceType == 1"
prop="signSchool"
label="报名驾校"
min-width="90"
/>
<el-table-column
v-if="appStore.getAppInfo?.instanceType == 1"
prop="signPlace"
label="报名场地"
min-width="90"
/>
<el-table-column
v-if="appStore.getAppInfo?.instanceType == 1"
prop="signClass"
label="报名班型"
min-width="90"
/>
<el-table-column
v-if="appStore.getAppInfo?.instanceType == 1"
prop="licenseType"
label="驾照类型"
min-width="90"
/>
<el-table-column <el-table-column
v-if="appStore.getAppInfo?.instanceType == 1" v-if="appStore.getAppInfo?.instanceType == 1"
prop="receiverName" prop="receiverName"
@ -412,10 +317,6 @@
<script setup name="Reback"> <script setup name="Reback">
import * as FeebackApi from '@/api/clue/payment' import * as FeebackApi from '@/api/clue/payment'
import { getSimpleUserList as getUserOption, getAllUserList } from '@/api/system/user' import { getSimpleUserList as getUserOption, getAllUserList } from '@/api/system/user'
import { getPlaceList } from '@/api/school/place'
import { getClassTypeList } from '@/api/school/class'
import { getAreaSimpleList } from '@/api/school/setting/area'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { useUserStore } from '@/store/modules/user' import { useUserStore } from '@/store/modules/user'
import DialogFeebackAudit from './DialogFeebackAudit.vue' import DialogFeebackAudit from './DialogFeebackAudit.vue'
@ -451,13 +352,6 @@ const searchForm = ref({
const userOptions = ref([]) const userOptions = ref([])
const allUserOptions = ref([]) const allUserOptions = ref([])
const schoolOptions = ref([])
const allPlaceOptions = ref([])
const placeOptions = computed(() => {
return allPlaceOptions.value.filter((it) => it.schoolId == searchForm.value.signSchool)
})
const tableList = ref([]) const tableList = ref([])
const total = ref(0) const total = ref(0)
@ -479,31 +373,11 @@ function handleReset() {
applyUser: undefined, applyUser: undefined,
checkTime: [], checkTime: [],
mobile: undefined, mobile: undefined,
signSchool: undefined,
signPlace: undefined,
signClass: undefined,
area: undefined,
pageNo: 1, pageNo: 1,
pageSize: 20 pageSize: 20
} }
} }
function changeSchool() {
searchForm.value.signPlace = undefined
searchForm.value.signClass = undefined
}
function changePlace() {
searchForm.value.signClass = undefined
getClassTypeOptions()
}
const classOptions = ref([])
async function getClassTypeOptions() {
const data = await getClassTypeList({ placeId: searchForm.value.signPlace, status: 0 })
classOptions.value = data
}
const totalInfo = ref({}) const totalInfo = ref({})
const loading = ref(false) const loading = ref(false)
async function getList() { async function getList() {
@ -526,7 +400,7 @@ function handleSelectionChange(val) {
const batchAuditDialog = ref() const batchAuditDialog = ref()
function batchAudit() { function batchAudit() {
if (batchIds.value.length) { if (batchIds.value.length) {
batchAuditDialog.value.open('feeback', batchIds.value) batchAuditDialog.value.open('aftersale', batchIds.value)
} else { } else {
message.info('请选择表格中需要审核的数据') message.info('请选择表格中需要审核的数据')
} }
@ -553,17 +427,7 @@ function handleAudit(row) {
feebackDialog.value.open(row) feebackDialog.value.open(row)
} }
const areaOptions = ref([])
function getOptions() { function getOptions() {
//
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
schoolOptions.value = data.schoolList
allPlaceOptions.value = data.placeList
})
//
getAreaSimpleList().then((data) => {
areaOptions.value = data
})
getUserOption().then((data) => { getUserOption().then((data) => {
userOptions.value = data userOptions.value = data
}) })

@ -248,16 +248,6 @@
<el-form-item label="结算金额"> <el-form-item label="结算金额">
{{ settleAmount }} {{ settleAmount }}
</el-form-item> </el-form-item>
<el-form-item label="结算日期">
<el-date-picker
v-model="form.settlementDate"
type="date"
placeholder="选择日期时间"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
:clearable="false"
/>
</el-form-item>
<el-form-item label="结算备注" prop="remark"> <el-form-item label="结算备注" prop="remark">
<Editor v-model:modelValue="form.remark" /> <Editor v-model:modelValue="form.remark" />
</el-form-item> </el-form-item>
@ -280,7 +270,7 @@ import { getPlaceList } from '@/api/school/place'
import { getClassTypeList } from '@/api/school/class' import { getClassTypeList } from '@/api/school/class'
import * as SettleApi from '@/api/clue/settle' import * as SettleApi from '@/api/clue/settle'
import { dateFormatter, formatDate } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import { removeNullField } from '@/utils/index' import { removeNullField } from '@/utils/index'
const message = useMessage() // const message = useMessage() //
@ -405,7 +395,6 @@ function batchSettle() {
showDailog.value = true showDailog.value = true
form.value = { form.value = {
settlementIds: selectList.value.map((it) => it.settlementId), settlementIds: selectList.value.map((it) => it.settlementId),
settlementDate: formatDate(new Date()),
reamrk: undefined reamrk: undefined
} }
settleAmount.value = selectList.value.reduce((pre, cur) => pre + cur.settlementMoney, 0) settleAmount.value = selectList.value.reduce((pre, cur) => pre + cur.settlementMoney, 0)

@ -92,9 +92,6 @@
快速新增 快速新增
</el-button> </el-button>
</div> </div>
<div v-else-if="item.field == 'intentionStateName'">
<DictTag type="intention_state" :value="row.intentionState + ''" />
</div>
<div v-else-if="item.field == 'contact'"> <div v-else-if="item.field == 'contact'">
<span>{{ row[item.field] }}</span> <span>{{ row[item.field] }}</span>
<Icon class="ml-5px" icon="ep:phone" @click="makeCall(row.contact)" /> <Icon class="ml-5px" icon="ep:phone" @click="makeCall(row.contact)" />

@ -7,130 +7,30 @@
:rules="formRules" :rules="formRules"
label-width="80px" label-width="80px"
> >
<el-row :gutter="20"> <el-form-item v-if="formData.parentSource" label="上级来源">
<el-col v-if="formData.parentSource" :span="12" :offset="0"> <el-input v-model="formData.parentSource" disabled />
<el-form-item label="上级来源"> </el-form-item>
<el-input v-model="formData.parentSource" disabled /> <el-form-item label="来源名称" prop="sourceName">
</el-form-item> <el-input v-model="formData.sourceName" placeholder="请输入来源名称" />
</el-col> </el-form-item>
<el-col :span="12" :offset="0"> <el-form-item label="排序" prop="sort">
<el-form-item label="来源名称" prop="sourceName"> <el-input v-model="formData.sort" placeholder="请输入排序" type="number" :min="0" />
<el-input v-model="formData.sourceName" placeholder="请输入来源名称" /> </el-form-item>
</el-form-item> <el-form-item label="状态" prop="status">
</el-col> <el-radio-group v-model="formData.status">
<el-col :span="12" :offset="0"> <el-radio :label="0"> 启用 </el-radio>
<el-form-item label="排序" prop="sort"> <el-radio :label="1"> 禁用 </el-radio>
<el-input v-model="formData.sort" placeholder="请输入排序" type="number" :min="0" /> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> <el-form-item label="备注" prop="remark">
<el-col :span="12" :offset="0"> <el-input
<el-form-item label="状态" prop="status"> type="textarea"
<el-radio-group v-model="formData.status"> v-model="formData.remark"
<el-radio :label="0"> 启用 </el-radio> placeholder="请输入备注"
<el-radio :label="1"> 禁用 </el-radio> :autosize="{ minRows: 4, maxRows: 8 }"
</el-radio-group> />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="开户费用" prop="accountFee">
<el-input-number
v-model="formData.accountFee"
:controls="false"
style="width: 100%"
:min="0"
/>
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="开户日期" prop="accountStartTime">
<el-date-picker
v-model="formData.accountStartTime"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
placeholder="选择日期时间"
/>
</el-form-item>
</el-col>
<el-col :span="12" :offset="0">
<el-form-item label="到期日期" prop="accountEndTime">
<el-date-picker
v-model="formData.accountEndTime"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
placeholder="选择日期时间"
/>
</el-form-item>
</el-col>
<el-col :span="24" :offset="0">
<el-form-item label="备注" prop="remark">
<el-input
type="textarea"
v-model="formData.remark"
placeholder="请输入备注"
:autosize="{ minRows: 4, maxRows: 8 }"
/>
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<el-divider direction="horizontal" content-position="left">线索成本</el-divider>
<el-button class="mb-10px" type="primary" @click="handleAddPrice"> 添加年份 </el-button>
<el-table :data="formData.sourceCostVOS" border>
<el-table-column label="年份" width="120">
<template #default="{ row }">
<el-date-picker
v-model="row.year"
type="year"
placeholder="选择年份"
size="small"
format="YYYY"
value-format="YYYY"
style="width: 100%"
/>
</template>
</el-table-column>
<el-table-column v-for="col in 12" :key="col" :label="`${col}月`" width="100px">
<el-table-column label="充值">
<template #default="{ row }">
<el-input-number
v-model="row.monthData[col - 1].rechargeFee"
size="small"
:min="0"
:controls="false"
style="width: 100%"
/>
</template>
</el-table-column>
<el-table-column label="消耗">
<template #default="{ row }">
<el-input-number
v-model="row.monthData[col - 1].consumeFee"
size="small"
:controls="false"
:min="0"
style="width: 100%"
/>
</template>
</el-table-column>
<el-table-column label="线索数">
<template #default="{ row }">
<el-input-number
v-model="row.monthData[col - 1].clueNum"
size="small"
:controls="false"
style="width: 100%"
:min="0"
/>
</template>
</el-table-column>
</el-table-column>
</el-table>
<template #footer> <template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button> <el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
@ -149,7 +49,6 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = ref({ const formData = ref({
sourceName: '', sourceName: '',
accountFee: undefined,
sort: 1, sort: 1,
remark: '' remark: ''
}) })
@ -212,29 +111,8 @@ const resetForm = () => {
sourceName: '', sourceName: '',
status: 0, status: 0,
sort: 1, sort: 1,
remark: '', remark: ''
costModel: 0,
sourceCostVOS: []
} }
formRef.value?.resetFields() formRef.value?.resetFields()
} }
function handleAddPrice() {
const obj = {
year: undefined,
monthData: []
}
for (let i = 1; i <= 12; i++) {
obj.monthData.push({
month: i,
consumeFee: 0,
rechargeFee: 0,
clueNum: 0
})
}
if (!formData.value.sourceCostVOS) {
formData.value.sourceCostVOS = []
}
formData.value.sourceCostVOS.push(obj)
}
</script> </script>

@ -23,7 +23,7 @@
<el-table v-loading="loading" :data="tableList" border stripe> <el-table v-loading="loading" :data="tableList" border stripe>
<el-table-column type="index" width="50" fixed="left" /> <el-table-column type="index" width="50" fixed="left" />
<el-table-column prop="nickname" label="姓名" width="80" fixed="left" /> <el-table-column prop="nickname" label="姓名" width="80" />
<el-table-column <el-table-column
v-for="(item, index) in new Date().getMonth() + 1" v-for="(item, index) in new Date().getMonth() + 1"
:key="index" :key="index"
@ -102,6 +102,8 @@ function totalSort(pre, cur) {
} }
function monthSort(pre, cur, idx) { function monthSort(pre, cur, idx) {
console.log(idx)
return ( return (
Number(pre.monthClueSignRateReportList[idx].rate) - Number(pre.monthClueSignRateReportList[idx].rate) -
Number(cur.monthClueSignRateReportList[idx].rate) Number(cur.monthClueSignRateReportList[idx].rate)

@ -1,62 +0,0 @@
<template>
<Echart :options="optionsData" :width="400" :height="200" />
</template>
<script setup name="BarSalerClueReport">
import { set } from 'lodash-es'
onMounted(() => {
nextTick(() => {
getReportData()
})
})
const optionsData = ref({})
const getReportData = async () => {
// const data = await HomeApi.getClueSignSignRate()
set(optionsData, 'radiusAxis', {
type: 'category',
data: ['宝典', '一点通', '抖音', '小红书'],
z: 10
})
set(optionsData, 'series', [
{
type: 'bar',
data: [1, 2, 3, 4],
coordinateSystem: 'polar',
name: '高意向A',
stack: 'a',
emphasis: {
focus: 'series'
}
},
{
type: 'bar',
data: [2, 4, 6, 8],
coordinateSystem: 'polar',
name: '中意向B',
stack: 'a',
emphasis: {
focus: 'series'
}
},
{
type: 'bar',
data: [1, 2, 3, 4],
coordinateSystem: 'polar',
name: '低意向C',
stack: 'a',
emphasis: {
focus: 'series'
}
}
])
}
defineExpose({
getReportData
})
</script>
<style lang="scss" scoped></style>

@ -1,402 +0,0 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="1000px">
<el-form :model="searchForm" label-width="0" inline>
<el-form-item>
<el-date-picker
v-model="searchForm.consultTime"
type="daterange"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
start-placeholder="选择日期"
end-placeholder="选择日期"
:clearable="false"
/>
</el-form-item>
<el-form-item>
<el-tree-select
v-model="searchForm.sourceId"
:data="props.sourceOptions"
:props="defaultProps"
check-strictly
clearable
filterable
node-key="sourceId"
placeholder="请选择渠道"
@change="sourceChange"
/>
</el-form-item>
<el-form-item v-if="appStore.getAppInfo?.instanceType == 1">
<el-select
v-model="searchForm.licenseTypeList"
placeholder="选择驾照类型"
clearable
multiple
>
<el-option
v-for="item in props.licenseTypeOptions"
:key="item.label"
:label="item.label"
:value="item.label"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="handleSearch">查询</el-button>
<el-button @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-tabs v-model="showPane" class="pb-10px">
<el-tab-pane label="详细数据" :name="1">
<el-table v-loading="loading" :data="tableList" border stripe>
<el-table-column prop="sourceName" label="渠道名称" width="100" fixed="left" />
<el-table-column prop="newClueNumber" label="新线索数" sortable min-width="100" />
<el-table-column prop="signNumber" label="成交数" sortable min-width="100" />
<el-table-column
prop="signRate"
label="成交率"
sortable
min-width="100"
:formatter="(row) => row.signRate + '%'"
/>
<el-table-column prop="averageSignPeriod" label="成交周期" sortable min-width="100" />
<el-table-column
prop="grossProfitOfSingleSign"
label="毛利/单"
sortable
min-width="100"
/>
<el-table-column prop="payPriceOfSingleSign" label="支出/单" sortable min-width="100" />
<el-table-column prop="costOfSingleClue" label="线索成本/条" sortable min-width="100" />
<el-table-column
prop="netProfitOfSingleSign"
label="净利润/单"
sortable
min-width="100"
/>
<el-table-column label="总线索成本" prop="clueCostTotal" sortable min-width="100" />
<el-table-column label="总支出" prop="payPriceTotal" sortable min-width="100" />
<el-table-column label="总利润" prop="profitTotal" sortable min-width="100" />
</el-table>
</el-tab-pane>
<el-tab-pane label="图表展示" :name="2" lazy>
<el-row :gutter="20">
<el-col :span="24" :offset="0">
<el-checkbox-group v-model="showChannel" @change="setReportData">
<el-checkbox v-for="(item, index) in channelArr" :key="index" :label="item" />
</el-checkbox-group>
</el-col>
<el-col :span="12" :offset="0">
<el-skeleton :loading="loading" animated>
<Echart :options="echart1Option" width="100%" :height="400" />
</el-skeleton>
</el-col>
<el-col :span="12" :offset="0" v-if="appStore.getAppInfo?.instanceType == 1">
<Echart :options="echart2Option" width="100%" :height="400" />
</el-col>
<el-col :span="24" :offset="0">
<Echart :options="echart3Option" width="100%" :height="400" />
</el-col>
</el-row>
</el-tab-pane>
</el-tabs>
</Dialog>
</template>
<script setup name="DialogSalerReportDetail">
import { set } from 'lodash-es'
import * as reportApi from '@/api/home/reportSaler'
import { getIntDictOptions } from '@/utils/dict'
import { removeNullField } from '@/utils'
import { useAppStore } from '@/store/modules/app'
import { formatDate } from '@/utils/formatTime'
const appStore = useAppStore()
const props = defineProps({
licenseTypeOptions: {
type: Array,
default: () => []
},
sourceOptions: {
type: Array,
default: () => []
}
})
const defaultProps = {
children: 'children',
label: 'sourceName',
value: 'sourceId',
isLeaf: 'leaf'
}
const showChannel = ref([])
const intentionOptions = getIntDictOptions('intention_state')
const channelArr = computed(() => {
if (searchForm.value.sourceId) {
let arr =
props.sourceOptions.find((it) => it.sourceId == searchForm.value.sourceId)?.children || []
return arr.map((it) => it.sourceName)
} else {
return props.sourceOptions.map((it) => it.sourceName)
}
})
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const loading = ref(false)
const searchForm = ref({})
const showPane = ref(1)
function handleReset() {
searchForm.value = {
nickname: undefined,
consultTime: [`${year}-${month}-01`, formatDate(new Date())],
licenseTypeList: [],
sourceId: undefined
}
}
/** 打开弹窗 */
const open = async (info, queryInfo) => {
showPane.value = 1
dialogVisible.value = true
dialogTitle.value = info.nickname
searchForm.value = { ...queryInfo }
searchForm.value.userId = info.userId
sourceChange()
}
defineExpose({ open }) // open
const tableList = ref([])
async function handleSearch() {
loading.value = true
try {
const params = { ...searchForm.value }
const data = await reportApi.getInfo(removeNullField(params))
tableList.value = data.sourceDetailVOList
setReportData(data)
} finally {
loading.value = false
}
}
function sourceChange() {
handleSearch()
showChannel.value = channelArr.value
}
const echart1Option = ref({
title: {
text: '线索分布图'
},
radiusAxis: {},
angleAxis: {},
tooltip: {
show: true,
formatter: '{b0}-{a}: {c}'
},
polar: {},
legend: {
show: true,
type: 'scroll',
left: 100
}
})
const echart2Option = ref({
title: {
text: '成交分布图'
},
radiusAxis: {},
angleAxis: {},
tooltip: {
show: true,
formatter: '{b0}-{a}: {c}'
},
polar: {},
legend: {
show: true,
type: 'scroll',
left: 100
}
})
const echart3Option = ref({
title: {
text: '销售雷达图'
},
radar: {
indicator: [
{ name: '成交周期' },
{ name: '毛利/单' },
{ name: '支出/单' },
{ name: '线索成本/条' },
{ name: '净利润/单' },
{ name: '成交率' }
// { name: '线' },
// { name: '' },
// { name: '' }
]
},
legend: {
show: true,
right: '10px',
orient: 'vertical'
}
})
const setReportData = async (data) => {
// const data = await HomeApi.getClueSignSignRate()
const channelClueArr = showChannel.value.sort((pre, cur) => {
const preArr = tableList.value.find((it) => it.sourceName == pre).clueIntentionNumVOList || []
const curArr = tableList.value.find((it) => it.sourceName == cur).clueIntentionNumVOList || []
const preCount = preArr.reduce((preVal, curVal) => preVal + curVal.intentionNum, 0)
const curCount = curArr.reduce((preVal, curVal) => preVal + curVal.intentionNum, 0)
return preCount - curCount
})
const arr1 = intentionOptions.map((intention) => {
const list = []
channelClueArr.map((item) => {
const row = tableList.value.find((it) => item == it.sourceName)
if (row) {
list.push(
row.clueIntentionNumVOList.find((it) => it.intentionState == intention.value).intentionNum
)
}
})
return {
type: 'bar',
data: list,
coordinateSystem: 'polar',
name: intention.label,
stack: 'a',
emphasis: {
focus: 'series'
},
label: {
show: true,
position: 'middle'
}
}
})
const channelSignArr = showChannel.value.sort((pre, cur) => {
const preArr = tableList.value.find((it) => it.sourceName == pre).signLicenseTypeNumVOList || []
const curArr = tableList.value.find((it) => it.sourceName == cur).signLicenseTypeNumVOList || []
const preCount = preArr.reduce((preVal, curVal) => preVal + curVal.licenseTypeNum, 0)
const curCount = curArr.reduce((preVal, curVal) => preVal + curVal.licenseTypeNum, 0)
return preCount - curCount
})
const arr2 = props.licenseTypeOptions.map((cartype) => {
const list = []
channelClueArr.map((item) => {
const row = tableList.value.find((it) => item == it.sourceName)
if (row) {
list.push(
row.signLicenseTypeNumVOList.find((it) => it.licenseType == cartype.label).licenseTypeNum
)
}
})
return {
type: 'bar',
data: list,
coordinateSystem: 'polar',
name: cartype.label,
stack: 'a',
emphasis: {
focus: 'series'
},
label: {
show: true,
position: 'middle'
}
}
})
set(echart1Option.value, 'radiusAxis', {
type: 'category',
data: channelClueArr,
axisLabel: {
margin: 5,
fontSize: 10,
interval: 0
}
})
set(echart1Option.value, 'series', arr1)
set(echart2Option.value, 'radiusAxis', {
type: 'category',
data: channelSignArr,
axisLabel: {
margin: 5,
fontSize: 10,
interval: 0
}
})
set(echart2Option.value, 'series', arr2)
const { personDetail, averageDetail } = data
set(echart3Option.value, 'series', [
{
type: 'radar',
data: [
{
value: [
averageDetail.averageSignPeriod,
averageDetail.grossProfitOfSingleSign,
averageDetail.payPriceOfSingleSign,
averageDetail.costOfSingleClue,
averageDetail.netProfitOfSingleSign,
averageDetail.signRate
// averageDetail.clueCostTotal,
// averageDetail.payPriceTotal,
// averageDetail.profitTotal
],
name: '平均水平',
lineStyle: {
type: 'dashed'
},
areaStyle: {
color: 'rgba(0, 191, 255, 0.6)'
},
label: {
show: true
}
},
{
value: [
personDetail.averageSignPeriod,
personDetail.grossProfitOfSingleSign,
personDetail.payPriceOfSingleSign,
personDetail.costOfSingleClue,
personDetail.netProfitOfSingleSign,
personDetail.signRate
// personDetail.clueCostTotal,
// personDetail.payPriceTotal,
// personDetail.profitTotal
],
name: dialogTitle.value,
areaStyle: {
color: 'rgba(255, 145, 124, 0.4)'
},
label: {
show: true
}
}
]
}
])
}
</script>
<style lang="scss" scoped></style>

@ -38,42 +38,31 @@
</el-form> </el-form>
<el-table :data="tableList" border stripe show-summary :summary-method="getSummaries"> <el-table :data="tableList" border stripe show-summary :summary-method="getSummaries">
<el-table-column label="周期" prop="period" width="110px" /> <el-table-column label="周期" prop="period" width="110px" />
<el-table-column label="成交" align="center"> <el-table-column prop="signNumber" label="成交数" />
<el-table-column prop="signNumber" label="成交数" /> <el-table-column prop="signPrice" label="成交额" />
<el-table-column prop="signPrice" label="成交额" /> <el-table-column
<el-table-column prop="signPriceSequentialGrowth" label="环比" :formatter="parseRate" /> prop="signPriceSequentialGrowth"
<el-table-column label="成交额环比增长"
prop="signPriceSamePeriodCompareGrowth" :formatter="parseRate"
label="同比" />
:formatter="parseRate" <el-table-column
/> prop="signPriceSamePeriodCompareGrowth"
</el-table-column> label="成交额同比增长"
<el-table-column label="利润" align="center"> :formatter="parseRate"
<el-table-column prop="profit"> />
<template #header> <Tooltip message="公司利润" /> <span>利润</span> </template> <el-table-column prop="profit" label="利润" />
</el-table-column> <el-table-column prop="profitSequentialGrowth" label="利润环比增长" :formatter="parseRate" />
<el-table-column prop="profitSequentialGrowth" label="环比" :formatter="parseRate" /> <el-table-column
<el-table-column prop="profitSamePeriodCompareGrowth" label="同比" :formatter="parseRate" /> prop="profitSamePeriodCompareGrowth"
</el-table-column> label="利润同比增长"
:formatter="parseRate"
<el-table-column prop="notReceivedMoney"> />
<template #header> <el-table-column prop="notReceivedMoney" label="未到账金额" />
<Tooltip message="回款列表中未审核的公司利润" /> <span>未到账</span> <el-table-column prop="receivedMoney" label="已到账金额" />
</template>
</el-table-column>
<el-table-column prop="receivedMoney">
<template #header>
<Tooltip message="回款列表中已审核的公司利润" /> <span>已到账</span>
</template>
</el-table-column>
<el-table-column prop="waitSettleMoney" label="待结算金额" /> <el-table-column prop="waitSettleMoney" label="待结算金额" />
<el-table-column prop="settledMoney" label="已结算金额" /> <el-table-column prop="settledMoney" label="已结算金额" />
<el-table-column prop="refundAmount" label="已退款金额" /> <el-table-column prop="refundAmount" label="已退款金额" />
<el-table-column prop="remainMoney"> <el-table-column prop="remainMoney" label="结余" />
<template #header>
<Tooltip message="已到账金额-已结算金额-已退款金额" /> <span>结余</span>
</template>
</el-table-column>
</el-table> </el-table>
</ContentWrap> </ContentWrap>
</template> </template>
@ -140,16 +129,14 @@ function getSummaries({ columns, data }) {
if (column.property.includes('Growth')) { if (column.property.includes('Growth')) {
sums[index] = '' sums[index] = ''
} else { } else {
sums[index] = values sums[index] = values.reduce((prev, curr) => {
.reduce((prev, curr) => { const value = Number(curr)
const value = Number(curr) if (!Number.isNaN(value)) {
if (!Number.isNaN(value)) { return prev + curr
return prev + curr } else {
} else { return prev
return prev }
} }, 0)
}, 0)
.toFixed(2)
} }
} else { } else {
sums[index] = '' sums[index] = ''

@ -113,10 +113,9 @@
</template> </template>
<el-skeleton :loading="loading" animated> <el-skeleton :loading="loading" animated>
<el-table :data="signList" size="small"> <el-table :data="signList" size="small">
<el-table-column type="index" width="40" /> <el-table-column type="index" />
<el-table-column prop="username" label="姓名" width="80" /> <el-table-column prop="username" label="姓名" width="100" />
<el-table-column prop="followNum" label="成交数量" width="90" sortable /> <el-table-column prop="followNum" label="成交数量" width="70" />
<el-table-column prop="signPrice" label="成交额" min-width="90" sortable />
<el-table-column prop="deptName" label="所属组织" width="150" /> <el-table-column prop="deptName" label="所属组织" width="150" />
</el-table> </el-table>
</el-skeleton> </el-skeleton>

@ -1,248 +0,0 @@
<template>
<ContentWrap>
<el-form :model="searchForm" label-width="0" inline>
<el-form-item>
<el-date-picker
v-model="searchForm.consultTime"
type="daterange"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
start-placeholder="选择日期"
end-placeholder="选择日期"
:clearable="false"
/>
</el-form-item>
<el-form-item>
<el-input v-model="searchForm.nickname" placeholder="销售姓名" clearable />
</el-form-item>
<el-form-item>
<el-tree-select
v-model="searchForm.sourceId"
:data="sourceOptions"
:props="defaultProps"
check-strictly
clearable
filterable
node-key="sourceId"
placeholder="请选择渠道"
/>
</el-form-item>
<el-form-item v-if="appStore.getAppInfo?.instanceType == 1">
<el-select
v-model="searchForm.licenseTypeList"
placeholder="选择驾照类型"
clearable
multiple
>
<el-option
v-for="item in licenseTypeOptions"
:key="item.label"
:label="item.label"
:value="item.label"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button @click="handleSearch">查询</el-button>
<el-button @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="loading"
:data="tableList"
border
stripe
show-summary
:summary-method="getSummaries"
>
<el-table-column type="index" width="60" fixed="left" align="center" />
<el-table-column prop="nickname" label="姓名" width="80" fixed="left">
<template #default="{ row }">
<el-button type="primary" style="padding: 0" text @click="handleDetail(row)">{{
row.nickname
}}</el-button>
</template>
</el-table-column>
<el-table-column prop="newClueNumber" sortable min-width="100">
<template #header>
<Tooltip message="咨询日期在所选周期内的线索总数" />
<span>新线索数</span>
</template>
</el-table-column>
<el-table-column label="成交数" prop="signNumber" sortable min-width="100">
<template #header>
<Tooltip message="成交日期在所选周期内的成交数" />
<span>成交数</span>
</template>
</el-table-column>
<el-table-column
label="成交率"
prop="signRate"
sortable
min-width="100"
:formatter="(row) => row.signRate + '%'"
/>
<el-table-column label="跟进数/日" prop="dayFollowNumber" sortable min-width="100" />
<el-table-column label="成交数/日" prop="daySignNumber" sortable min-width="100" />
<el-table-column label="平均成交周期" prop="averageSignPeriod" sortable min-width="100">
<template #header>
<Tooltip message="平均每条成交的线索,从咨询开始到成交所需要的天数" />
<span>平均成交周期</span>
</template>
</el-table-column>
<el-table-column prop="grossProfitOfSingleSign" sortable min-width="100">
<template #header>
<Tooltip
message="平均每笔成交订单的公司利润【按照登记,不按审核到账】=总公司利润/总成交数"
/>
<span>毛利/</span>
</template>
</el-table-column>
<el-table-column prop="payPriceOfSingleSign" sortable min-width="100">
<template #header>
<Tooltip
message="平均每笔成交订单的额外支出(返费等)【按照登记,不按审核到账】=总支出/总成交数"
/>
<span>支出/</span>
</template>
</el-table-column>
<el-table-column prop="costOfSingleClue" sortable min-width="100">
<template #header>
<Tooltip message="平均每条线索的成本=总线索成本/新线索条数" />
<span>线索成本/</span>
</template>
</el-table-column>
<el-table-column prop="netProfitOfSingleSign" sortable min-width="100">
<template #header>
<Tooltip message="=(总公司利润-总支出-总线索成本)/总成交数" />
<span>净利润/</span>
</template>
</el-table-column>
<el-table-column label="总线索成本" prop="clueCostTotal" sortable min-width="100" />
<el-table-column label="总支出" prop="payPriceTotal" sortable min-width="100" />
<el-table-column label="总利润" prop="profitTotal" sortable min-width="100" />
<el-table-column prop="efficiency" sortable min-width="100">
<template #header>
<Tooltip message="=总利润/(总成本+总支出)" />
<span>能效</span>
</template>
</el-table-column>
<el-table-column label="撞单数" prop="repeatClueNum" sortable min-width="100" />
<el-table-column label="撞单成交数" prop="repeatClueSignNum" sortable min-width="100" />
</el-table>
<DialogSalerReportDetail
:licenseTypeOptions="licenseTypeOptions"
:source-options="sourceOptions"
ref="SalerDetailDialog"
/>
</ContentWrap>
</template>
<script setup name="SalesReport">
import DialogSalerReportDetail from './Comp/DialogSalerReportDetail.vue'
import * as reportApi from '@/api/home/reportSaler'
import { getSimpleSourceList as getResourceOptions } from '@/api/clue/source'
import { removeNullField } from '@/utils'
import { formatDate } from '@/utils/formatTime'
import { handleTree } from '@/utils/tree'
import { getIntDictOptions } from '@/utils/dict'
import { useAppStore } from '@/store/modules/app'
const appStore = useAppStore()
onMounted(() => {
getOptions()
handleReset()
handleSearch()
})
const defaultProps = {
children: 'children',
label: 'sourceName',
value: 'sourceId',
isLeaf: 'leaf'
}
const sourceOptions = ref([])
const licenseTypeOptions = ref([])
const searchForm = ref({})
function handleReset() {
const year = new Date().getFullYear()
const month = new Date().getMonth() + 1
searchForm.value = {
nickname: undefined,
consultTime: [`${year}-${month}-01`, formatDate(new Date())],
licenseTypeList: [],
sourceId: undefined
}
}
const loading = ref(false)
const tableList = ref([])
const avgData = ref({})
async function handleSearch() {
loading.value = true
try {
const data = await reportApi.getList(removeNullField(searchForm.value))
tableList.value = data.personDataVOList
avgData.value = data.averageDataVO
} finally {
loading.value = false
}
}
function getSummaries({ columns, data }) {
const sums = []
columns.forEach((column, index) => {
if (index == 0) {
sums[index] = '统计'
return
}
const doubleSumsColumns = [
'newClueNumber',
'signNumber',
'clueCostTotal',
'payPriceTotal',
'profitTotal'
]
if (column.property in avgData.value) {
sums[index] = `均值: ${avgData.value[column.property]}`
} else if (doubleSumsColumns.includes(column.property)) {
const values = data.map((item) => Number(item[column.property]))
let sum = values.reduce((prev, curr) => prev + curr, 0)
let avg = sum / values.length
if (['newClueNumber', 'signNumber'].includes(column.property)) {
avg = Math.floor(avg)
} else {
sum = sum.toFixed(2)
avg = avg.toFixed(2)
}
sums[index] = h('div', {}, [h('div', {}, `合计:${sum}`), h('div', {}, `均值:${avg}`)])
} else {
sums[index] = ''
}
})
return sums
}
const SalerDetailDialog = ref()
function handleDetail(info) {
SalerDetailDialog.value.open(info, searchForm.value)
}
function getOptions() {
getResourceOptions().then((data) => {
sourceOptions.value = handleTree(data, 'sourceId')
})
licenseTypeOptions.value = getIntDictOptions('license_type')
}
</script>
<style lang="scss" scoped></style>

@ -1,5 +1,5 @@
<template> <template>
<Dialog :title="dialogTitle" v-model="dialogVisible" width="500px"> <Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
<el-form <el-form
ref="formRef" ref="formRef"
v-loading="formLoading" v-loading="formLoading"
@ -7,17 +7,11 @@
:rules="formRules" :rules="formRules"
label-width="80px" label-width="80px"
> >
<el-form-item label="名称" prop="supplierName"> <el-form-item label="名称" prop="label">
<el-input v-model="formData.supplierName" placeholder="请输入供应商名称" /> <el-input v-model="formData.label" placeholder="请输入供应商名称" />
</el-form-item> </el-form-item>
<el-form-item label="微信群" prop="wechatGroup"> <el-form-item label="排序" prop="sort">
<el-input v-model="formData.wechatGroup" placeholder="请输入微信群" /> <el-input v-model="formData.sort" placeholder="请输入排序" type="number" :min="0" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="formData.status">
<el-radio :label="0"> 启用 </el-radio>
<el-radio :label="1"> 禁用 </el-radio>
</el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input <el-input
@ -35,7 +29,7 @@
</Dialog> </Dialog>
</template> </template>
<script name="DialogSupplier" setup> <script name="DialogSupplier" setup>
import * as SupplierApi from '@/api/school/setting/supplier' import * as dictApi from '@/api/system/dict/dict.data'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
@ -44,12 +38,12 @@ const dialogTitle = ref('') // 弹窗的标题
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = ref({ const formData = ref({
supplierName: '', label: '',
wechatGroup: 1, sort: 1,
remark: '' remark: ''
}) })
const formRules = reactive({ const formRules = reactive({
supplierName: [{ required: true, message: '名称不能为空', trigger: 'blur' }] label: [{ required: true, message: '名称不能为空', trigger: 'blur' }]
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
@ -63,7 +57,7 @@ const open = async (type, id) => {
if (id) { if (id) {
formLoading.value = true formLoading.value = true
try { try {
formData.value = await SupplierApi.getSupplier(id) formData.value = await dictApi.getDictData(id)
} finally { } finally {
formLoading.value = false formLoading.value = false
} }
@ -81,11 +75,14 @@ const submitForm = async () => {
// //
formLoading.value = true formLoading.value = true
try { try {
if (!formData.value.value) {
formData.value.value = formData.value.label
}
if (formType.value === 'create') { if (formType.value === 'create') {
await SupplierApi.createSupplier(formData.value) await dictApi.createDictData(formData.value)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {
await SupplierApi.updateSupplier(formData.value) await dictApi.updateDictData(formData.value)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
dialogVisible.value = false dialogVisible.value = false
@ -99,9 +96,10 @@ const submitForm = async () => {
/** 重置表单 */ /** 重置表单 */
const resetForm = () => { const resetForm = () => {
formData.value = { formData.value = {
supplierName: '', label: '',
wechatGroup: '', sort: 1,
status: 0, status: 0,
dictType: 'erp_supplier',
remark: '' remark: ''
} }
formRef.value?.resetFields() formRef.value?.resetFields()

@ -3,7 +3,7 @@
<el-form ref="queryForm" :model="searchForm" label-width="0" inline> <el-form ref="queryForm" :model="searchForm" label-width="0" inline>
<el-form-item> <el-form-item>
<el-input <el-input
v-model="searchForm.supplierName" v-model="searchForm.name"
placeholder="请输入名称" placeholder="请输入名称"
clearable clearable
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
@ -16,13 +16,8 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table v-loading="loading" :data="tableList"> <el-table v-loading="loading" :data="tableList">
<el-table-column prop="supplierName" label="供应商名称" /> <el-table-column prop="label" label="供应商名称" />
<el-table-column prop="wechatGroup" label="微信群名称" /> <el-table-column prop="sort" label="排序" width="100px" />
<el-table-column label="状态" min-width="150" prop="status">
<template #default="scope">
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" /> <el-table-column prop="remark" label="备注" />
<el-table-column <el-table-column
label="创建时间" label="创建时间"
@ -51,16 +46,16 @@
<script setup name="SupplierSet"> <script setup name="SupplierSet">
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import DialogSupplier from './DialogSupplier.vue' import DialogSupplier from './DialogSupplier.vue'
import * as SupplierApi from '@/api/school/setting/supplier' import * as dictApi from '@/api/system/dict/dict.data'
import { DICT_TYPE } from '@/utils/dict'
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const searchForm = ref({ const searchForm = ref({
supplierName: '', label: '',
pageSize: 20, pageSize: 20,
pageNo: 1 pageNo: 1,
dictType: 'erp_supplier'
}) })
const total = ref(0) const total = ref(0)
@ -74,9 +69,10 @@ function handleQuery() {
} }
function resetQuery() { function resetQuery() {
searchForm.value = { searchForm.value = {
supplierName: '', label: '',
pageSize: 20, pageSize: 20,
pageNo: 1 pageNo: 1,
dictType: 'erp_supplier'
} }
getList() getList()
} }
@ -84,7 +80,7 @@ function resetQuery() {
async function getList() { async function getList() {
loading.value = true loading.value = true
try { try {
const data = await SupplierApi.getSupplierPage(searchForm.value) const data = await dictApi.getDictDataPage(searchForm.value)
tableList.value = data.list tableList.value = data.list
total.value = data.total total.value = data.total
} finally { } finally {
@ -101,7 +97,7 @@ async function handleDelete(id) {
// //
await message.delConfirm() await message.delConfirm()
// //
await SupplierApi.deleteSupplier(id) await dictApi.deleteDictData(id)
message.success(t('common.delSuccess')) message.success(t('common.delSuccess'))
// //
await getList() await getList()

@ -49,7 +49,7 @@
<!-- 列表 --> <!-- 列表 -->
<el-table v-loading="loading" class="mt-20px" :data="tableList" border> <el-table v-loading="loading" class="mt-20px" :data="tableList" border>
<el-table-column type="expand" width="30" fixed="left"> <el-table-column type="expand" width="30">
<template #default="{ row }"> <template #default="{ row }">
<div class="pl-100px pr-100px"> <div class="pl-100px pr-100px">
<el-table :data="row.productSpecList"> <el-table :data="row.productSpecList">
@ -71,16 +71,16 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column key="productId" label="产品编码" prop="productId" /> <el-table-column key="productId" label="产品编码" prop="productId" />
<el-table-column show-overflow-tooltip label="产品名称" min-width="100" prop="productName" /> <el-table-column show-overflow-tooltip label="产品名称" min-width="200" prop="productName" />
<el-table-column label="分类" width="90" prop="productCategoryName" /> <el-table-column label="分类" min-width="90" prop="productCategoryName" />
<el-table-column label="品牌" width="90" prop="productBrandName" /> <el-table-column label="品牌" min-width="90" prop="productBrandName" />
<el-table-column label="商品图" min-width="80"> <el-table-column label="商品图" min-width="80">
<template #default="{ row }"> <template #default="{ row }">
<el-image :src="row.mainImage" @click="imagePreview(row.mainImage)" class="w-30px h-30px" /> <el-image :src="row.mainImage" @click="imagePreview(row.mainImage)" class="w-30px h-30px" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="简介" min-width="200" prop="productIntro" /> <el-table-column label="简介" min-width="70" prop="productIntro" />
<el-table-column :formatter="dateFormatter" label="创建时间" prop="createTime" width="120" /> <el-table-column :formatter="dateFormatter" label="创建时间" prop="createTime" width="180" />
<el-table-column v-for="item in diyFieldList" :key="item.clueParamId" :label="item.label"> <el-table-column v-for="item in diyFieldList" :key="item.clueParamId" :label="item.label">
<template #default="{ row }"> <template #default="{ row }">
<div v-if="item.component == 'DatePicker'"> <div v-if="item.component == 'DatePicker'">

@ -37,9 +37,9 @@
<el-select v-model="queryParams.supplier" placeholder="供应商" clearable filterable> <el-select v-model="queryParams.supplier" placeholder="供应商" clearable filterable>
<el-option <el-option
v-for="item in opts.supplier" v-for="item in opts.supplier"
:key="item.id" :key="item.value"
:label="item.supplierName" :label="item.label"
:value="item.id" :value="item.value"
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -135,7 +135,7 @@ import { allSchemas } from './index.data.js'
import DialogAdd from './Comp/DialogAdd.vue' import DialogAdd from './Comp/DialogAdd.vue'
import DialogAudit from './Comp/DialogAudit.vue' import DialogAudit from './Comp/DialogAudit.vue'
import * as PurchaseApi from '@/api/mall/purchase' import * as PurchaseApi from '@/api/mall/purchase'
import { getSupplierSimpleList } from '@/api/school/setting/supplier' import { getDictOptions } from '@/utils/dict'
const creatPurchase = ref() const creatPurchase = ref()
const auditPurchase = ref() const auditPurchase = ref()
@ -164,9 +164,7 @@ function getOptions() {
ProductApi.getSimpleProductList().then((data) => { ProductApi.getSimpleProductList().then((data) => {
opts.value.product = data opts.value.product = data
}) })
getSupplierSimpleList().then((data) => { opts.value.supplier = getDictOptions('erp_supplier')
opts.value.supplier = data
})
} }
function changeProd(val) { function changeProd(val) {

@ -61,8 +61,8 @@ const bindSocial = () => {
}) })
} }
const bind = (row) => { const bind = (row) => {
// message.info('') message.info('暂未开放,敬请期待')
// return return
const redirectUri = location.origin + '/user/profile?type=' + row.type const redirectUri = location.origin + '/user/profile?type=' + row.type
// //
socialAuthRedirect(row.type, encodeURIComponent(redirectUri)).then((res) => { socialAuthRedirect(row.type, encodeURIComponent(redirectUri)).then((res) => {

Loading…
Cancel
Save