Compare commits
9 Commits
8f1b89cc91
...
salary
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72accc0ab2 | ||
|
|
d31f4b4f8b | ||
|
|
18ed17b131 | ||
|
|
46c66e19aa | ||
|
|
e3e24f4939 | ||
|
|
f2064d99ad | ||
|
|
08ada50d1a | ||
|
|
ab0c770167 | ||
|
|
e1ff8213bf |
@@ -12,7 +12,11 @@ export const getAfterSalePage = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createAfterSale = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-after-sale/create', data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sign-after-sale/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 审核
|
||||
|
||||
@@ -12,7 +12,7 @@ export const getDeliveryPage = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createDelivery = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-send/create', data })
|
||||
return await request.post({ url: '/admin-api/crm/sign-send/create', data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
|
||||
@@ -7,7 +7,11 @@ export const getFollowList = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createFollow = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/clue-follow-record/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/clue-follow-record/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
|
||||
@@ -17,7 +17,11 @@ export const getClue = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createClue = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sch-clue/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-clue/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -12,7 +12,11 @@ export const getPaymentPage = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createPayment = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-pay-record/create', data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sign-pay-record/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 审核
|
||||
|
||||
26
src/api/clue/settle.js
Normal file
26
src/api/clue/settle.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询招生结算列表
|
||||
export const getSchoolSettlePage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-settlement/sch/page', params })
|
||||
}
|
||||
|
||||
// 查询招生结算详情
|
||||
export const getSchoolSettleDetail = async (id) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-settlement/sch/get?id=' + id })
|
||||
}
|
||||
|
||||
// 查询进销存结算列表
|
||||
export const getMallSettlePage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-settlement/erp/page', params })
|
||||
}
|
||||
|
||||
// 查询进销存结算详情
|
||||
export const getMallSettleDetail = async (id) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-settlement/erp/get?id=' + id })
|
||||
}
|
||||
|
||||
// 批量结算
|
||||
export const batchSaveSettle = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-settlement/batch/save', data })
|
||||
}
|
||||
@@ -12,7 +12,7 @@ export const getSign = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createSign = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign/create', data: data })
|
||||
return await request.post({ url: '/admin-api/crm/sign/create', data: data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 取消登记
|
||||
|
||||
@@ -7,7 +7,7 @@ export const getSkillPage = (params) => {
|
||||
|
||||
// 创建
|
||||
export const createSkill = (data) => {
|
||||
return request.post({ url: '/admin-api/crm/skill/create', data })
|
||||
return request.post({ url: '/admin-api/crm/skill/create', data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 更新
|
||||
|
||||
@@ -17,7 +17,7 @@ export const getSource = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createSource = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/source/create', data: data })
|
||||
return await request.post({ url: '/admin-api/crm/source/create', data: data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface BrandVO {
|
||||
|
||||
// 创建商品品牌
|
||||
export const createBrand = (data: BrandVO) => {
|
||||
return request.post({ url: '/admin-api/crm/erp-product-brand/create', data })
|
||||
return request.post({ url: '/admin-api/crm/erp-product-brand/create', data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 更新商品品牌
|
||||
|
||||
@@ -36,7 +36,11 @@ export interface CategoryVO {
|
||||
|
||||
// 创建商品分类
|
||||
export const createCategory = (data: CategoryVO) => {
|
||||
return request.post({ url: '/admin-api/crm/erp-product-category/create', data })
|
||||
return request.post({
|
||||
url: '/admin-api/crm/erp-product-category/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 更新商品分类
|
||||
|
||||
@@ -11,7 +11,11 @@ export const getProduct = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createProduct = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/erp-product/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/erp-product/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -2,7 +2,11 @@ import request from '@/config/axios'
|
||||
|
||||
// 创建
|
||||
export const createField = (data) => {
|
||||
return request.post({ url: '/admin-api/crm/param/create', data: { ...data, module: 3 } })
|
||||
return request.post({
|
||||
url: '/admin-api/crm/param/create',
|
||||
data: { ...data, module: 3 },
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 更新
|
||||
|
||||
@@ -42,7 +42,11 @@ export interface PropertyValueDetailVO {
|
||||
|
||||
// 创建属性项
|
||||
export const createProperty = (data: PropertyVO) => {
|
||||
return request.post({ url: '/admin-api/crm/erp-product-property/create', data })
|
||||
return request.post({
|
||||
url: '/admin-api/crm/erp-product-property/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 更新属性项
|
||||
|
||||
@@ -6,7 +6,11 @@ export const getPurchasePage = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createPurchase = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/erp-purchase/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/erp-purchase/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -6,7 +6,11 @@ export const getWarehousePage = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createWarehouse = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/erp-warehouse/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/erp-warehouse/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -5,6 +5,10 @@ export const getClassTypePage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-class-type/page', params })
|
||||
}
|
||||
|
||||
export const getClassTypeList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-class-type/list', params })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getClassType = async (id) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-class-type/get?id=' + id })
|
||||
@@ -12,7 +16,11 @@ export const getClassType = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createClassType = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sch-class-type/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-class-type/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
@@ -22,7 +30,7 @@ export const updateClassType = async (params) => {
|
||||
|
||||
// 删除
|
||||
export const deleteClassType = async (id) => {
|
||||
return await request.delete({ url: '/admin-api/crm/sch-class-type/delete?typeId=' + id })
|
||||
return await request.delete({ url: '/admin-api/crm/sch-class-type/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 修改状态
|
||||
|
||||
@@ -17,7 +17,11 @@ export const getPlace = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createPlace = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sch-place/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-place/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -11,7 +11,11 @@ export const getSchool = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createSchool = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sch-school/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-school/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -78,7 +78,10 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
// 对表单赋值
|
||||
const setValues = (data: Recordable = {}) => {
|
||||
const setValues = (data: Recordable = {}, isReset: Boolean = false) => {
|
||||
if (isReset) {
|
||||
formModel.value = initModel(unref(getProps).schema, unref(formModel))
|
||||
}
|
||||
formModel.value = Object.assign(unref(formModel), data)
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,11 @@ const usedSchema = ref([])
|
||||
|
||||
const newSchema = computed(() => {
|
||||
let schema: FormSchema[] = cloneDeep(usedSchema.value)
|
||||
schema.forEach((item: FormSchema) => {
|
||||
if (item.component == 'TreeSelect') {
|
||||
item.componentProps['check-strictly'] = true
|
||||
}
|
||||
})
|
||||
if (props.expand && props.expandField && !unref(visible)) {
|
||||
const index = findIndex(schema, (v: FormSchema) => v.field === props.expandField)
|
||||
if (index > -1) {
|
||||
|
||||
@@ -5,10 +5,11 @@ import { config } from './config'
|
||||
const { default_headers } = config
|
||||
|
||||
const request = (option: any) => {
|
||||
const { url, method, params, data, headersType, responseType } = option
|
||||
const { url, method, params, data, headersType, responseType, isSubmitForm } = option
|
||||
return service({
|
||||
url: url,
|
||||
method,
|
||||
isSubmitForm,
|
||||
params,
|
||||
data,
|
||||
responseType: responseType,
|
||||
|
||||
@@ -21,6 +21,7 @@ import errorCode from './errorCode'
|
||||
|
||||
import { resetRouter } from '@/router'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { result_code, base_url, request_timeout } = config
|
||||
|
||||
@@ -62,15 +63,11 @@ service.interceptors.request.use(
|
||||
}
|
||||
// 设置租户
|
||||
const tenantId = getTenantId()
|
||||
if (tenantId) {
|
||||
;(config as Recordable).headers['tenant-id'] = tenantId
|
||||
}
|
||||
if (tenantId) (config as Recordable).headers['tenant-id'] = tenantId
|
||||
|
||||
// 设置实例
|
||||
const appId = getAppId()
|
||||
if (appId) {
|
||||
;(config as Recordable).headers['instance-id'] = appId
|
||||
}
|
||||
if (appId) (config as Recordable).headers['instance-id'] = appId
|
||||
|
||||
const params = config.params || {}
|
||||
const data = config.data || false
|
||||
@@ -83,27 +80,39 @@ service.interceptors.request.use(
|
||||
}
|
||||
// get参数编码
|
||||
if (config.method?.toUpperCase() === 'GET' && params) {
|
||||
let url = config.url + '?'
|
||||
for (const propName of Object.keys(params)) {
|
||||
const value = params[propName]
|
||||
if (value !== void 0 && value !== null && typeof value !== 'undefined') {
|
||||
if (typeof value === 'object') {
|
||||
for (const val of Object.keys(value)) {
|
||||
const params = propName + '[' + val + ']'
|
||||
const subPart = encodeURIComponent(params) + '='
|
||||
url += subPart + encodeURIComponent(value[val]) + '&'
|
||||
}
|
||||
} else {
|
||||
url += `${propName}=${encodeURIComponent(value)}&`
|
||||
}
|
||||
config.params = {}
|
||||
const paramsStr = qs.stringify(params, { allowDots: true })
|
||||
if (paramsStr) {
|
||||
config.url = config.url + '?' + paramsStr
|
||||
}
|
||||
}
|
||||
// 是否提交表单型的接口,如果是,不要频繁调接口
|
||||
if (config?.isSubmitForm) {
|
||||
const requestObj = {
|
||||
url: config.url,
|
||||
data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
|
||||
time: new Date().getTime()
|
||||
}
|
||||
const sessionObj = cache.session.get('sessionObj')
|
||||
if (sessionObj === undefined || sessionObj === null || sessionObj === '') {
|
||||
cache.session.set('sessionObj', requestObj)
|
||||
} else {
|
||||
const s_url = sessionObj.url // 请求地址
|
||||
const s_data = sessionObj.data // 请求数据
|
||||
const s_time = sessionObj.time // 请求时间
|
||||
const interval = 1000 // 间隔时间(ms),小于此时间视为重复提交
|
||||
if (
|
||||
s_data === requestObj.data &&
|
||||
requestObj.time - s_time < interval &&
|
||||
s_url === requestObj.url
|
||||
) {
|
||||
const message = '数据正在处理,请勿重复提交'
|
||||
console.warn(`[${s_url}]: ` + message)
|
||||
return Promise.reject(new Error(message))
|
||||
} else {
|
||||
cache.session.set('sessionObj', requestObj)
|
||||
}
|
||||
}
|
||||
// 给 get 请求加上时间戳参数,避免从缓存中拿数据
|
||||
// const now = new Date().getTime()
|
||||
// params = params.substring(0, url.length - 1) + `?_t=${now}`
|
||||
url = url.slice(0, -1)
|
||||
config.params = {}
|
||||
config.url = url
|
||||
}
|
||||
return config
|
||||
},
|
||||
|
||||
@@ -16,7 +16,9 @@ import { useWatermark } from '@/hooks/web/useWatermark'
|
||||
|
||||
const { setWatermark } = useWatermark()
|
||||
|
||||
setWatermark('安徽莳松科技有限公司')
|
||||
nextTick(() => {
|
||||
setWatermark('安徽莳松科技有限公司')
|
||||
})
|
||||
|
||||
const { t } = useI18n()
|
||||
const appStore = useAppStore()
|
||||
|
||||
@@ -213,7 +213,7 @@ export const fenToYuan = (amount: string | number): number => {
|
||||
export const removeNullField = (obj: Object) => {
|
||||
for (const key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
if (obj[key] == '') {
|
||||
if (obj[key] === '') {
|
||||
delete obj[key]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,14 @@ const dataScopeOptions = [
|
||||
]
|
||||
|
||||
async function getRoleInfo(id) {
|
||||
formData.value = await RoleApi.getRole(id)
|
||||
try {
|
||||
formData.value = await RoleApi.getRole(id)
|
||||
nextTick(() => {
|
||||
treeRef.value.setCheckedKeys(formData.value.dataScopeDeptIds)
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
/** 提交表单 */
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="登记日期"
|
||||
end-placeholder="登记日期"
|
||||
start-placeholder="成交日期"
|
||||
end-placeholder="成交日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -79,9 +79,19 @@
|
||||
<el-table-column prop="isReturns" label="是否退货" min-width="90px" />
|
||||
<el-table-column prop="solution" label="解决方案" min-width="150px" />
|
||||
<el-table-column prop="signUserName" label="登记人" min-width="90px" />
|
||||
<el-table-column prop="dealDate" label="登记时间" min-width="150px" />
|
||||
<el-table-column
|
||||
prop="dealDate"
|
||||
label="成交日期"
|
||||
min-width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column prop="applyUserName" label="申请人" min-width="90px" />
|
||||
<el-table-column prop="applyTime" label="申请时间" min-width="150px" />
|
||||
<el-table-column
|
||||
prop="applyTime"
|
||||
label="申请时间"
|
||||
min-width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column prop="stateName" label="审核状态" fixed="right" min-width="90px" />
|
||||
<el-table-column label="操作" width="150px" fixed="right">
|
||||
<template #default="{ row }">
|
||||
@@ -132,6 +142,8 @@ import DialogAfterSaleAudit from './DialogAfterSaleAudit.vue'
|
||||
import DialogAfterSaleDetail from './DialogAfterSaleDetail.vue'
|
||||
import DialogBatchAudit from './DialogBatchAudit.vue'
|
||||
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
const afterSaleAuditDialog = ref()
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="登记日期"
|
||||
end-placeholder="登记日期"
|
||||
start-placeholder="成交日期"
|
||||
end-placeholder="成交日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -71,7 +71,7 @@
|
||||
<el-table-column prop="name" label="线索名称" min-width="120px" />
|
||||
<el-table-column prop="phone" label="联系方式" width="120px" />
|
||||
<el-table-column prop="signUserName" label="登记人" min-width="90" />
|
||||
<el-table-column prop="dealDate" label="登记时间" width="120px" :formatter="dateFormatter" />
|
||||
<el-table-column prop="dealDate" label="成交日期" width="120px" :formatter="dateFormatter" />
|
||||
<el-table-column prop="productName" label="成交产品" min-width="150px" />
|
||||
<el-table-column prop="specsName" label="产品规格" min-width="150px" />
|
||||
<el-table-column prop="signNum" label="销售数量" width="90px" />
|
||||
|
||||
@@ -44,7 +44,8 @@ const schema = [
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '登记时间',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
@@ -75,6 +76,7 @@ const schema = [
|
||||
{
|
||||
field: 'applyTime',
|
||||
label: '申请时间',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
|
||||
@@ -40,8 +40,8 @@ const applySchema = [
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '登记时间',
|
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
@@ -72,7 +72,7 @@ const applySchema = [
|
||||
{
|
||||
field: 'applyTime',
|
||||
label: '申请时间',
|
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
|
||||
@@ -44,7 +44,8 @@ const schema = [
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '登记时间',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
@@ -65,6 +66,7 @@ const schema = [
|
||||
{
|
||||
field: 'applyTime',
|
||||
label: '申请时间',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
|
||||
@@ -40,8 +40,8 @@ const applySchema = [
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '登记时间',
|
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
|
||||
@@ -108,9 +108,11 @@ const aftersaleList = ref([])
|
||||
const extraPayList = ref([])
|
||||
|
||||
const prodTotalPrice = computed(() => {
|
||||
return orderInfo.value.signProducts.reduce(
|
||||
(pre, cur) => pre + (cur?.price || 0) * (cur?.signNum || 0),
|
||||
0
|
||||
return (
|
||||
orderInfo.value.signProducts?.reduce(
|
||||
(pre, cur) => pre + (cur?.price || 0) * (cur?.signNum || 0),
|
||||
0
|
||||
) || 0
|
||||
)
|
||||
})
|
||||
|
||||
@@ -155,6 +157,12 @@ const orderSchema = ref([])
|
||||
function getFields() {
|
||||
getClueFieldList().then((data) => {
|
||||
const arr = useCrudSchemas(data).allSchemas.detailSchema
|
||||
|
||||
arr.forEach((it) => {
|
||||
if (it.label.includes('日期')) {
|
||||
it.dateFormat = 'YYYY-MM-DD'
|
||||
}
|
||||
})
|
||||
if (arr.length % 2 != 0) {
|
||||
arr.push({})
|
||||
}
|
||||
@@ -176,6 +184,11 @@ function getFields() {
|
||||
|
||||
getOrderFieldList().then((data) => {
|
||||
const arr = useCrudSchemas(data).allSchemas.detailSchema
|
||||
arr.forEach((it) => {
|
||||
if (it.label.includes('日期')) {
|
||||
it.dateFormat = 'YYYY-MM-DD'
|
||||
}
|
||||
})
|
||||
if (arr.length % 2 != 0) {
|
||||
arr.push({})
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
v-model="searchForm.signProduct"
|
||||
placeholder="选择成交产品"
|
||||
filterable
|
||||
clearable
|
||||
@change="searchForm.specsId = undefined"
|
||||
>
|
||||
<el-option
|
||||
@@ -29,6 +30,7 @@
|
||||
v-model="searchForm.specsId"
|
||||
placeholder="选择规格"
|
||||
filterable
|
||||
clearable
|
||||
:disabled="!searchForm.signProduct"
|
||||
>
|
||||
<el-option
|
||||
@@ -67,9 +69,10 @@
|
||||
<div class="p-10px flex justify-center">
|
||||
<el-table :data="row.signProducts" stripe style="width: 900px">
|
||||
<el-table-column prop="productName" label="成交产品" />
|
||||
<el-table-column prop="specsName" label="产品规格" />
|
||||
<el-table-column prop="signNum" label="成交数量" width="100px" />
|
||||
<el-table-column label="发货状态" prop="sendState" width="100px" />
|
||||
<el-table-column prop="specsName" label="产品规格" width="100px" />
|
||||
<el-table-column prop="signNum" label="成交数量" width="90px" />
|
||||
<el-table-column prop="remark" label="成交备注" />
|
||||
<el-table-column label="发货状态" prop="sendState" width="90px" />
|
||||
<el-table-column label="发货备注" width="100px">
|
||||
<template #default="scope">
|
||||
<el-popover
|
||||
@@ -123,6 +126,9 @@
|
||||
</template>
|
||||
<div v-dompurify-html="row.remark"></div>
|
||||
</el-popover>
|
||||
<span v-else-if="item.form?.component == 'DatePicker'">
|
||||
{{ formatDate(row[item.field]) }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="240px" fixed="right">
|
||||
@@ -204,6 +210,16 @@ import DialogExtraFee from './DialogExtraPay.vue'
|
||||
import DialogDelivery from './DialogDelivery.vue'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const userOptions = ref([])
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
getCurdSchemas()
|
||||
})
|
||||
getOptions()
|
||||
})
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
@@ -337,15 +353,6 @@ const deliveryDialog = ref()
|
||||
function handleDelivery(row) {
|
||||
deliveryDialog.value.open(row)
|
||||
}
|
||||
|
||||
const userOptions = ref([])
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
getCurdSchemas()
|
||||
})
|
||||
getOptions()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
335
src/views/Clue/Order/Comp/MallSettle.vue
Normal file
335
src/views/Clue/Order/Comp/MallSettle.vue
Normal file
@@ -0,0 +1,335 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="searchForm" label-width="0" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.signId" placeholder="成交单号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.name" placeholder="线索名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.phone" placeholder="联系方式" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.settlementType" placeholder="结算类型" clearable filterable>
|
||||
<el-option label="货款" value="货款" />
|
||||
<el-option label="其他支出" value="其他支出" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.signUser" placeholder="登记人" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-date-picker
|
||||
v-model="searchForm.dealDate"
|
||||
type="daterange"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="成交日期"
|
||||
end-placeholder="成交日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.signProduct"
|
||||
placeholder="选择成交产品"
|
||||
filterable
|
||||
clearable
|
||||
@change="searchForm.signSpecs = undefined"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in prodOptions"
|
||||
:key="item.productId"
|
||||
:label="item.productName"
|
||||
:value="item.productId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.signSpecs"
|
||||
placeholder="选择规格"
|
||||
filterable
|
||||
clearable
|
||||
:disabled="!searchForm.signProduct"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in specsOptions(searchForm.signProduct)"
|
||||
:key="item.specsId"
|
||||
:label="item.specsName"
|
||||
:value="item.specsId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.supplier" placeholder="选择供应商" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in supplierOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="searchForm.settlementState">
|
||||
<el-radio :label="1"> 已结算 </el-radio>
|
||||
<el-radio :label="0"> 待结算 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch">查询</el-button>
|
||||
<el-button @click="handleReset">重置</el-button>
|
||||
<el-button @click="batchSettle">批量结算</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableList"
|
||||
border
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="60"
|
||||
fixed="left"
|
||||
:selectable="(row) => row.settlementState == '待结算'"
|
||||
/>
|
||||
<el-table-column prop="signId" label="成交单号" min-width="120px" />
|
||||
<el-table-column prop="name" label="线索名称" min-width="120px" />
|
||||
<el-table-column prop="phone" label="联系方式" width="120px" />
|
||||
<el-table-column prop="signUserName" label="登记人" min-width="90" />
|
||||
<el-table-column prop="dealDate" label="成交日期" width="120px" :formatter="dateFormatter" />
|
||||
<el-table-column prop="signProduct" label="成交产品" min-width="150px" />
|
||||
<el-table-column prop="signSpecs" label="成交规格" min-width="150px" />
|
||||
<el-table-column prop="supplier" label="供应商" min-width="150px" />
|
||||
<el-table-column prop="settlementPrice" label="结算单价" min-width="150px" />
|
||||
<el-table-column prop="settlementNum" label="结算数量" min-width="150px" />
|
||||
<el-table-column prop="settlementMoney" label="结算金额" min-width="150px" />
|
||||
<el-table-column label="费用备注" width="90px">
|
||||
<template #default="scope">
|
||||
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.extraRemark">
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="scope.row.extraRemark"></div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="settlementDate"
|
||||
label="结算时间"
|
||||
width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column prop="settlementUserName" label="结算人" min-width="90px" />
|
||||
<el-table-column prop="settlementType" label="结算类型" width="90px" fixed="right" />
|
||||
<el-table-column prop="settlementState" label="结算状态" width="90px" fixed="right" />
|
||||
<el-table-column label="结算备注" width="90px">
|
||||
<template #default="scope">
|
||||
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.remark">
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="scope.row.remark"></div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<el-dialog title="批量结算" v-model="showDailog" width="600px">
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px">
|
||||
<el-form-item label="结算金额">
|
||||
{{ settleAmount }}
|
||||
</el-form-item>
|
||||
<el-form-item label="结算备注" prop="remark">
|
||||
<Editor v-model:modelValue="form.remark" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="showDailog = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleSaveSettle">
|
||||
确 定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MallSettle">
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { getSimpleProductList } from '@/api/mall/product'
|
||||
import * as SettleApi from '@/api/clue/settle'
|
||||
|
||||
import { getDictOptions } from '@/utils/dict'
|
||||
import { removeNullField } from '@/utils/index'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
handleSearch()
|
||||
})
|
||||
|
||||
const searchForm = ref({
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
signUser: undefined,
|
||||
dealDate: [],
|
||||
signProduct: undefined,
|
||||
signSpecs: undefined,
|
||||
signId: undefined,
|
||||
settlementState: 0,
|
||||
settlementType: undefined,
|
||||
supplier: undefined,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
})
|
||||
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
signUser: undefined,
|
||||
dealDate: [],
|
||||
signProduct: undefined,
|
||||
signSpecs: undefined,
|
||||
signId: undefined,
|
||||
settlementState: 0,
|
||||
settlementType: undefined,
|
||||
supplier: undefined,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
const totalNum = ref(0)
|
||||
const totalAmount = ref(0)
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await SettleApi.getMallSettlePage(removeNullField(searchForm.value))
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
totalNum.value = data.totalNum
|
||||
totalAmount.value = data.totalAmount
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function getSummaries(param) {
|
||||
const { columns } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计'
|
||||
} else if (column.property == 'settlementNum') {
|
||||
sums[index] = totalNum.value
|
||||
} else if (column.property == 'settlementMoney') {
|
||||
sums[index] = totalAmount.value
|
||||
} else {
|
||||
sums[index] = ''
|
||||
}
|
||||
})
|
||||
|
||||
return sums
|
||||
}
|
||||
|
||||
const selectList = ref([])
|
||||
function handleSelectionChange(val) {
|
||||
selectList.value = [...val]
|
||||
}
|
||||
|
||||
const showDailog = ref(false)
|
||||
const form = ref({})
|
||||
const formRef = ref()
|
||||
const formLoading = ref(false)
|
||||
const rules = {
|
||||
remark: { required: true, message: '结算备注不可为空', trigger: 'change,blur' }
|
||||
}
|
||||
|
||||
const settleAmount = ref(0)
|
||||
function batchSettle() {
|
||||
if (selectList.value.length) {
|
||||
showDailog.value = true
|
||||
form.value = {
|
||||
settlementIds: selectList.value.map((it) => it.settlementId),
|
||||
reamrk: undefined
|
||||
}
|
||||
settleAmount.value = selectList.value.reduce((pre, cur) => pre + cur.settlementMoney, 0)
|
||||
} else {
|
||||
message.info('请选择表格数据!')
|
||||
}
|
||||
}
|
||||
|
||||
async function handleSaveSettle() {
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
try {
|
||||
formLoading.value = true
|
||||
await SettleApi.batchSaveSettle(form.value)
|
||||
message.success('结算成功')
|
||||
showDailog.value = false
|
||||
getList()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const userOptions = ref([])
|
||||
const prodOptions = ref([])
|
||||
const supplierOptions = getDictOptions('erp_supplier')
|
||||
|
||||
function getOptions() {
|
||||
// 产品
|
||||
getSimpleProductList().then((data) => {
|
||||
prodOptions.value = data
|
||||
})
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
})
|
||||
}
|
||||
|
||||
const specsOptions = computed({
|
||||
get() {
|
||||
return (prodId) => {
|
||||
if (prodId) {
|
||||
return prodOptions.value.find((it) => it.productId == prodId).productSpecList
|
||||
}
|
||||
return []
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -100,6 +100,9 @@
|
||||
</template>
|
||||
<div v-dompurify-html="row.remark"></div>
|
||||
</el-popover>
|
||||
<span v-else-if="item.form?.component == 'DatePicker'">
|
||||
{{ formatDate(row[item.field]) }}
|
||||
</span>
|
||||
<span v-else>{{ row[item.field] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -173,7 +176,7 @@ import { getSimpleFieldList } from '@/api/clue/orderField'
|
||||
import * as SignApi from '@/api/clue/sign'
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { getClassTypePage } from '@/api/school/class'
|
||||
import { getClassTypeList } from '@/api/school/class'
|
||||
|
||||
import DialogOrder from './DialogOrder.vue'
|
||||
import DialogFeeback from './DialogFeeback.vue'
|
||||
@@ -181,6 +184,16 @@ import DialogAfterSale from './DialogAfterSale.vue'
|
||||
import DialogExtraFee from './DialogExtraPay.vue'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const userOptions = ref([])
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
getCurdSchemas()
|
||||
})
|
||||
getOptions()
|
||||
})
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
@@ -316,26 +329,17 @@ function changePlace() {
|
||||
|
||||
const classOptions = ref([])
|
||||
async function getClassTypeOptions() {
|
||||
const data = await getClassTypePage({ placeId: searchForm.value.signPlace })
|
||||
classOptions.value = data.list
|
||||
const data = await getClassTypeList({ placeId: searchForm.value.signPlace, status: 0 })
|
||||
classOptions.value = data
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
// 驾校
|
||||
getPlaceList().then((data) => {
|
||||
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
||||
schoolOptions.value = data.schoolList
|
||||
allPlaceOptions.value = data.placeList
|
||||
})
|
||||
}
|
||||
|
||||
const userOptions = ref([])
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
getCurdSchemas()
|
||||
})
|
||||
getOptions()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="登记日期"
|
||||
end-placeholder="登记日期"
|
||||
start-placeholder="成交日期"
|
||||
end-placeholder="成交日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -77,9 +77,19 @@
|
||||
<el-table-column prop="money" label="回款金额" min-width="90" />
|
||||
<el-table-column prop="isPayoff" label="是否结清" min-width="90" />
|
||||
<el-table-column prop="signUserName" label="登记人" min-width="90" />
|
||||
<el-table-column prop="dealDate" label="登记时间" min-width="150px" />
|
||||
<el-table-column
|
||||
prop="dealDate"
|
||||
label="成交日期"
|
||||
min-width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column prop="applyUserName" label="申请人" min-width="90" />
|
||||
<el-table-column prop="applyTime" label="申请时间" min-width="150px" />
|
||||
<el-table-column
|
||||
prop="applyTime"
|
||||
label="申请时间"
|
||||
min-width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column prop="stateName" label="审核状态" fixed="right" min-width="90" />
|
||||
<el-table-column label="操作" width="150px" fixed="right">
|
||||
<template #default="{ row }">
|
||||
@@ -131,6 +141,8 @@ import DialogFeebackAudit from './DialogFeebackAudit.vue'
|
||||
import DialogFeebackDetail from './DialogFeebackDetail.vue'
|
||||
import DialogBatchAudit from './DialogBatchAudit.vue'
|
||||
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
|
||||
353
src/views/Clue/Order/Comp/SchoolSettle.vue
Normal file
353
src/views/Clue/Order/Comp/SchoolSettle.vue
Normal file
@@ -0,0 +1,353 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="searchForm" label-width="0" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.signId" placeholder="成交单号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.name" placeholder="线索名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.phone" placeholder="联系方式" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.settlementType" placeholder="结算类型" clearable filterable>
|
||||
<el-option label="报名费" value="报名费" />
|
||||
<el-option label="其他支出" value="其他支出" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.signUser" placeholder="登记人" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-date-picker
|
||||
v-model="searchForm.dealDate"
|
||||
type="daterange"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="成交日期"
|
||||
end-placeholder="成交日期"
|
||||
/>
|
||||
</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-radio-group v-model="searchForm.settlementState">
|
||||
<el-radio :label="1"> 已结算 </el-radio>
|
||||
<el-radio :label="0"> 待结算 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch">查询</el-button>
|
||||
<el-button @click="handleReset">重置</el-button>
|
||||
<el-button @click="batchSettle">批量结算</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableList"
|
||||
border
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="60"
|
||||
fixed="left"
|
||||
:selectable="(row) => row.settlementState == '待结算'"
|
||||
/>
|
||||
<el-table-column prop="signId" label="成交单号" min-width="120px" />
|
||||
<el-table-column prop="name" label="线索名称" min-width="120px" />
|
||||
<el-table-column prop="phone" label="联系方式" width="120px" />
|
||||
<el-table-column prop="signUserName" label="登记人" min-width="90" />
|
||||
<el-table-column prop="dealDate" label="成交日期" width="120px" :formatter="dateFormatter" />
|
||||
<el-table-column prop="signSchool" label="成交驾校" min-width="150px" />
|
||||
<el-table-column prop="signPlace" label="成交场地" min-width="150px" />
|
||||
<el-table-column prop="signClass" label="成交班型" min-width="150px" />
|
||||
<el-table-column prop="settlementPrice" label="结算单价" min-width="150px" />
|
||||
<el-table-column prop="settlementNum" label="结算数量" min-width="150px" />
|
||||
<el-table-column prop="settlementMoney" label="结算金额" min-width="150px" />
|
||||
<el-table-column label="费用备注" width="90px">
|
||||
<template #default="scope">
|
||||
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.extraRemark">
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="scope.row.extraRemark"></div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="settlementDate"
|
||||
label="结算时间"
|
||||
width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column prop="settlementUserName" label="结算人" min-width="90px" />
|
||||
<el-table-column prop="settlementType" label="结算类型" width="90px" fixed="right" />
|
||||
<el-table-column prop="settlementState" label="结算状态" width="90px" fixed="right" />
|
||||
<el-table-column label="结算备注" width="90px">
|
||||
<template #default="scope">
|
||||
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.remark">
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="scope.row.remark"></div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<el-dialog title="批量结算" v-model="showDailog" width="600px">
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px">
|
||||
<el-form-item label="结算金额">
|
||||
{{ settleAmount }}
|
||||
</el-form-item>
|
||||
<el-form-item label="结算备注" prop="remark">
|
||||
<Editor v-model:modelValue="form.remark" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="showDailog = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleSaveSettle">
|
||||
确 定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="SchoolSettle">
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { getClassTypeList } from '@/api/school/class'
|
||||
import * as SettleApi from '@/api/clue/settle'
|
||||
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { removeNullField } from '@/utils/index'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
handleSearch()
|
||||
})
|
||||
|
||||
const searchForm = ref({
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
signUser: undefined,
|
||||
dealDate: [],
|
||||
signSchool: undefined,
|
||||
signPlace: undefined,
|
||||
signClass: undefined,
|
||||
signId: undefined,
|
||||
settlementType: undefined,
|
||||
settlementState: 0,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
})
|
||||
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
signUser: undefined,
|
||||
dealDate: [],
|
||||
signSchool: undefined,
|
||||
signPlace: undefined,
|
||||
signClass: undefined,
|
||||
signId: undefined,
|
||||
settlementType: undefined,
|
||||
settlementState: 0,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
|
||||
const totalNum = ref(0)
|
||||
const totalAmount = ref(0)
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await SettleApi.getSchoolSettlePage(removeNullField(searchForm.value))
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
totalNum.value = data.totalNum
|
||||
totalAmount.value = data.totalAmount
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function getSummaries(param) {
|
||||
const { columns } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计'
|
||||
} else if (column.property == 'settlementNum') {
|
||||
sums[index] = totalNum.value
|
||||
} else if (column.property == 'settlementMoney') {
|
||||
sums[index] = totalAmount.value
|
||||
} else {
|
||||
sums[index] = ''
|
||||
}
|
||||
})
|
||||
|
||||
return sums
|
||||
}
|
||||
|
||||
const selectList = ref([])
|
||||
function handleSelectionChange(val) {
|
||||
selectList.value = [...val]
|
||||
}
|
||||
|
||||
const showDailog = ref(false)
|
||||
const form = ref({})
|
||||
const formRef = ref()
|
||||
const formLoading = ref(false)
|
||||
const rules = {
|
||||
remark: { required: true, message: '结算备注不可为空', trigger: 'change,blur' }
|
||||
}
|
||||
|
||||
const settleAmount = ref(0)
|
||||
function batchSettle() {
|
||||
if (selectList.value.length) {
|
||||
showDailog.value = true
|
||||
form.value = {
|
||||
settlementIds: selectList.value.map((it) => it.settlementId),
|
||||
reamrk: undefined
|
||||
}
|
||||
settleAmount.value = selectList.value.reduce((pre, cur) => pre + cur.settlementMoney, 0)
|
||||
} else {
|
||||
message.info('请选择表格数据!')
|
||||
}
|
||||
}
|
||||
|
||||
async function handleSaveSettle() {
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
try {
|
||||
formLoading.value = true
|
||||
await SettleApi.batchSaveSettle(form.value)
|
||||
message.success('结算成功')
|
||||
showDailog.value = false
|
||||
getList()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const schoolOptions = ref([])
|
||||
const allPlaceOptions = ref([])
|
||||
const userOptions = ref([])
|
||||
|
||||
function getOptions() {
|
||||
// 驾校
|
||||
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
||||
schoolOptions.value = data.schoolList
|
||||
allPlaceOptions.value = data.placeList
|
||||
})
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
})
|
||||
}
|
||||
|
||||
const placeOptions = computed(() => {
|
||||
return allPlaceOptions.value.filter((it) => it.schoolId == searchForm.value.signSchool)
|
||||
})
|
||||
|
||||
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
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
16
src/views/Clue/Order/Comp/Settle.vue
Normal file
16
src/views/Clue/Order/Comp/Settle.vue
Normal file
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<div>
|
||||
<SchoolSettle v-if="appStore.getAppInfo?.instanceType == 1" />
|
||||
<MallSettle v-else />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Settle">
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import SchoolSettle from './SchoolSettle.vue'
|
||||
import MallSettle from './MallSettle.vue'
|
||||
|
||||
const appStore = useAppStore()
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -15,6 +15,9 @@
|
||||
<el-tab-pane label="发货列表" name="delivery" v-if="appStore.getAppInfo?.instanceType == 2">
|
||||
<Delivery v-if="tabName == 'delivery'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="对外结算" name="settle" v-if="checkPermi(['clue:order:settle'])">
|
||||
<Settle v-if="tabName == 'settle'" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
@@ -25,6 +28,8 @@ import MallOrderList from './Comp/MallOrderList.vue'
|
||||
import Reback from './Comp/Reback.vue'
|
||||
import AfterSales from './Comp/AfterSales.vue'
|
||||
import Delivery from './Comp/Delivery.vue'
|
||||
import Settle from './Comp/Settle.vue'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
|
||||
const appStore = useAppStore()
|
||||
const tabName = ref('list')
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
// import { CrudSchema } from '@/hooks/web/useCrudSchemas'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
// import * as MailAccountApi from '@/api/system/mail/account'
|
||||
|
||||
// const userList = await MailAccountApi.getSimpleMailAccountList()
|
||||
const userList = []
|
||||
|
||||
const crudSchemas = reactive([
|
||||
{
|
||||
label: '订单号',
|
||||
field: 'orderNo',
|
||||
isSearch: true,
|
||||
isTable: true
|
||||
},
|
||||
{
|
||||
label: '线索名称',
|
||||
field: 'name',
|
||||
isSearch: true,
|
||||
isTable: true
|
||||
},
|
||||
{
|
||||
label: '联系方式',
|
||||
field: 'contact',
|
||||
isSearch: true,
|
||||
isTable: true
|
||||
},
|
||||
{
|
||||
label: '线索来源',
|
||||
field: 'resource',
|
||||
isSearch: true,
|
||||
isTable: true,
|
||||
search: {
|
||||
component: 'Select',
|
||||
api: () => userList,
|
||||
componentProps: {
|
||||
optionsAlias: {
|
||||
labelField: 'name',
|
||||
valueField: 'id'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '跟进人员',
|
||||
field: 'userId',
|
||||
isSearch: true,
|
||||
isTable: true,
|
||||
search: {
|
||||
component: 'Select',
|
||||
api: () => userList,
|
||||
componentProps: {
|
||||
optionsAlias: {
|
||||
labelField: 'name',
|
||||
valueField: 'id'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '成交时间',
|
||||
field: 'createTime',
|
||||
isSearch: true,
|
||||
isTable: true,
|
||||
table: {
|
||||
fixed: 'left'
|
||||
},
|
||||
formatter: dateFormatter,
|
||||
detail: {
|
||||
dateFormat: 'YYYY-MM-DD'
|
||||
},
|
||||
search: {
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
type: 'daterange',
|
||||
format: 'YYYY-MM-DD',
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
startPlaceholder: '创建时间',
|
||||
endPlaceholder: '创建时间'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '是否全款',
|
||||
field: 'isFull',
|
||||
isSearch: true,
|
||||
isTable: true,
|
||||
search: {
|
||||
component: 'Radio',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '全款', value: 1 },
|
||||
{ label: '非全款', value: 0 }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
])
|
||||
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
||||
269
src/views/Clue/Pool/Comp/ClueMap.vue
Normal file
269
src/views/Clue/Pool/Comp/ClueMap.vue
Normal file
@@ -0,0 +1,269 @@
|
||||
<template>
|
||||
<div class="relative w-full h-full">
|
||||
<div id="mapClue" style="height: 100%"></div>
|
||||
<el-autocomplete
|
||||
v-model="areaValue"
|
||||
clearable
|
||||
style="position: absolute; top: 20px; left: 20px; width: 400px"
|
||||
placeholder="输入并搜索位置"
|
||||
:fetch-suggestions="remoteMethod"
|
||||
@select="currentSelect"
|
||||
/>
|
||||
<el-collapse v-model="collaspeKey" class="box-card">
|
||||
<el-collapse-item name="nearbySchool">
|
||||
<template #title>
|
||||
<span class="ml-10px font-bold" style="font-size: 16px">附近驾校</span>
|
||||
</template>
|
||||
<div style="padding: 0 10px">
|
||||
<div v-if="nearbySchoolSearching">正在搜索中...</div>
|
||||
<template v-else>
|
||||
<div v-for="p in nearbySchoolList" :key="p.index">
|
||||
<div class="hover-pointer" style="font-size: 14px; color: blue">
|
||||
<i v-if="p.recommend" class="el-icon-star-off"></i>
|
||||
驾校: {{ p.deptName }}-{{ p.name }}
|
||||
</div>
|
||||
<div class="mt5">地址:{{ p.address }}</div>
|
||||
<div class="mt5">
|
||||
直线距离: {{ p.distance }} 公里;
|
||||
<span class="ml0">步行距离:{{ p.walkdistance }}</span>
|
||||
</div>
|
||||
<el-divider style="margin: 3px 0 !important" />
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
<DialogSchoolInfo ref="placeInfoDialog" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="ClueMap">
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
|
||||
import ImgPostion from '@/assets/imgs/flag/position_black.png'
|
||||
import FlagRed from '@/assets/imgs/flag/flag_red.png'
|
||||
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
|
||||
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
|
||||
import FlagGreen from '@/assets/imgs/flag/flag_green.png'
|
||||
import FlagBlue from '@/assets/imgs/flag/flag_blue.png'
|
||||
import FlagBlack from '@/assets/imgs/flag/flag_black.png'
|
||||
import AMapLoader from '@amap/amap-jsapi-loader'
|
||||
|
||||
import DialogSchoolInfo from './DialogSchoolInfo.vue'
|
||||
|
||||
// 地图相关
|
||||
const clueMap = ref(null)
|
||||
const aMap = ref(null)
|
||||
const areaValue = ref('')
|
||||
|
||||
const flagMap = {
|
||||
red: FlagRed,
|
||||
yellow: FlagYellow,
|
||||
purple: FlagPurple,
|
||||
green: FlagGreen,
|
||||
blue: FlagBlue,
|
||||
black: FlagBlack
|
||||
}
|
||||
|
||||
const defaultLatLng = ref({
|
||||
lat: 31.86119,
|
||||
lng: 117.283042
|
||||
})
|
||||
|
||||
let AutoComplete = ref(null)
|
||||
function initMap() {
|
||||
AMapLoader.load({
|
||||
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key
|
||||
version: '2.0',
|
||||
plugins: ['AMap.AutoComplete']
|
||||
}).then((AMap) => {
|
||||
aMap.value = AMap
|
||||
AutoComplete.value = new AMap.AutoComplete({
|
||||
city: '合肥'
|
||||
})
|
||||
clueMap.value = new AMap.Map('mapClue', {
|
||||
zoom: 14,
|
||||
zooms: [2, 22],
|
||||
center: [defaultLatLng.value.lng, defaultLatLng.value.lat]
|
||||
})
|
||||
getPageData()
|
||||
})
|
||||
}
|
||||
|
||||
const placeList = ref([])
|
||||
|
||||
async function getPageData() {
|
||||
placeList.value = []
|
||||
const data = await getPlaceList({
|
||||
placeStatus: 0
|
||||
})
|
||||
if (data.placeList) {
|
||||
placeList.value = data.placeList
|
||||
createMarkersInMap()
|
||||
getNearbySchool(defaultLatLng.value)
|
||||
}
|
||||
}
|
||||
|
||||
// 生成markers
|
||||
function createMarkersInMap() {
|
||||
for (let i = 0; i < placeList.value.length; i++) {
|
||||
const element = placeList.value[i]
|
||||
const markerIcon = flagMap[element.flagColor || 'red']
|
||||
const tmpMarker = new aMap.value.Marker({
|
||||
map: clueMap.value,
|
||||
position: [element.lng, element.lat],
|
||||
icon: markerIcon,
|
||||
label: {
|
||||
content: element.name,
|
||||
direction: 'right'
|
||||
},
|
||||
extData: element
|
||||
})
|
||||
tmpMarker.on('click', handleClickMarker)
|
||||
}
|
||||
}
|
||||
|
||||
const placeInfoDialog = ref()
|
||||
function handleClickMarker(ev) {
|
||||
placeInfoDialog.value.open(ev.target.getExtData())
|
||||
}
|
||||
|
||||
function remoteMethod(searchValue, cb) {
|
||||
if (searchValue) {
|
||||
AutoComplete.value?.search(searchValue, (status, result) => {
|
||||
if (result.tips?.length) {
|
||||
// areaList.value = result?.tips
|
||||
const list = result.tips.map((it) => ({
|
||||
...it,
|
||||
value: it.name
|
||||
}))
|
||||
cb(list)
|
||||
} else {
|
||||
cb([])
|
||||
}
|
||||
})
|
||||
} else {
|
||||
cb([])
|
||||
}
|
||||
}
|
||||
|
||||
function currentSelect(val) {
|
||||
if (val) {
|
||||
defaultLatLng.value = {
|
||||
lng: val.location?.lng,
|
||||
lat: val.location?.lat
|
||||
}
|
||||
addmark(val.location?.lng, val.location?.lat, aMap.value)
|
||||
}
|
||||
}
|
||||
|
||||
const marker = ref(null)
|
||||
function addmark(lat, lng, AMap) {
|
||||
marker.value && removeMarker()
|
||||
marker.value = new AMap.Marker({
|
||||
position: new AMap.LngLat(lat, lng),
|
||||
zoom: 14,
|
||||
icon: ImgPostion,
|
||||
offset: [-16, -32]
|
||||
})
|
||||
clueMap.value.add(marker.value)
|
||||
clueMap.value.setCenter([lat, lng], true)
|
||||
getNearbySchool({ lat: lng, lng: lat })
|
||||
}
|
||||
|
||||
const nearbySchoolList = ref([])
|
||||
const nearbySchoolSearching = ref(false)
|
||||
const collaspeKey = ref('nearbySchool')
|
||||
|
||||
function getNearbySchool(info) {
|
||||
if (info.lng && info.lat) {
|
||||
nearbySchoolList.value = []
|
||||
nearbySchoolSearching.value = true
|
||||
// 推荐的场地
|
||||
let places1 = []
|
||||
// 普通的场地
|
||||
let places2 = []
|
||||
|
||||
const p2 = [info.lng, info.lat]
|
||||
for (let i = 0; i < placeList.value.length; i++) {
|
||||
const element = placeList.value[i]
|
||||
const p1 = [element.lng, element.lat]
|
||||
// 计算直线距离
|
||||
element.distance = (aMap.value.GeometryUtil.distance(p1, p2) / 1000).toFixed(2)
|
||||
element.recommend ? places1.push(element) : places2.push(element)
|
||||
}
|
||||
// 按直线距离排序
|
||||
// 排序
|
||||
if (places1.length > 1) {
|
||||
places1 = places1.sort((a, b) => a.distance - b.distance)
|
||||
}
|
||||
// 排序
|
||||
if (places2.length > 1) {
|
||||
places2 = places2.sort((a, b) => a.distance - b.distance)
|
||||
}
|
||||
// 取普通场地和推荐场地,组合, 取四个
|
||||
nearbySchoolList.value = []
|
||||
for (let i = 0; i < 4; i++) {
|
||||
places1.length > i && nearbySchoolList.value.push(places1[i])
|
||||
places2.length > i && nearbySchoolList.value.push(places2[i])
|
||||
if (nearbySchoolList.value.length === 4) {
|
||||
break
|
||||
}
|
||||
}
|
||||
// 计算步行距离
|
||||
nearbySchoolList.value.map(async (item) => {
|
||||
const p1 = [item.lng, item.lat]
|
||||
const resp = await getWalkingDistance(p1, p2)
|
||||
item.walkdistance = resp
|
||||
})
|
||||
nearbySchoolSearching.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 获取两点之间的步行距离
|
||||
async function getWalkingDistance(start, end) {
|
||||
return new Promise((resolve) => {
|
||||
aMap.value.plugin('AMap.Walking', () => {
|
||||
const walking = new aMap.value.Walking()
|
||||
let num = 0
|
||||
walking.search(start, end, (status, result) => {
|
||||
if (status === 'complete') {
|
||||
result.routes.forEach((item) => {
|
||||
num += item.distance
|
||||
})
|
||||
resolve(num > 1000 ? `${(num / 1000).toFixed(2)} 公里` : `${num} 米`)
|
||||
} else {
|
||||
resolve('步行数据无法确定')
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function removeMarker() {
|
||||
clueMap.value.remove(marker.value)
|
||||
}
|
||||
|
||||
function destroyMap() {
|
||||
areaValue.value = undefined
|
||||
clueMap.value = null
|
||||
aMap.value = null
|
||||
}
|
||||
|
||||
defineExpose({ destroyMap })
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
initMap()
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.box-card {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 10px;
|
||||
width: 40%;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px" @close="destroyMap">
|
||||
<el-tabs v-model="tabName">
|
||||
<el-tabs v-model="tabName" @tab-change="changeTab">
|
||||
<el-tab-pane label="线索信息" name="info">
|
||||
<Form ref="formRef" v-loading="formLoading" :rules="rules" isCol :schema="formSchema" />
|
||||
</el-tab-pane>
|
||||
@@ -41,6 +41,8 @@
|
||||
<template #default="{ row }">
|
||||
<el-input
|
||||
v-model="row.content"
|
||||
type="textarea"
|
||||
:autoSize="{ minRows: 2 }"
|
||||
placeholder="输入跟进内容"
|
||||
:disabled="!row.editable"
|
||||
/>
|
||||
@@ -60,18 +62,15 @@
|
||||
</el-tab-pane>
|
||||
<el-tab-pane v-if="appStore.getAppInfo?.instanceType == 1" label="位置信息" name="map">
|
||||
<div class="flex justify-between items-center">
|
||||
<el-select
|
||||
<el-autocomplete
|
||||
v-model="areaValue"
|
||||
filterable
|
||||
clearable
|
||||
remote
|
||||
style="width: 250px"
|
||||
reserve-keyword
|
||||
placeholder="输入并搜索位置"
|
||||
:remote-method="remoteMethod"
|
||||
@change="currentSelect"
|
||||
:fetch-suggestions="remoteMethod"
|
||||
@select="currentSelect"
|
||||
>
|
||||
<el-option
|
||||
<!-- <el-option
|
||||
v-for="item in areaList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
@@ -80,8 +79,8 @@
|
||||
>
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.district }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-option> -->
|
||||
</el-autocomplete>
|
||||
<div class="flex-1 flex items-center ml-10px mr-10px">
|
||||
<div class="w-100px">线索位置:</div>
|
||||
<el-input v-model="address" disabled placeholder="请输入线索位置" clearable />
|
||||
@@ -119,18 +118,17 @@
|
||||
</el-collapse>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div style="position: absolute; top: 75px; right: 20px">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button>
|
||||
</div>
|
||||
<DialogSchoolInfo ref="schoolInfoDialog" />
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogClue">
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import * as ClueApi from '@/api/clue'
|
||||
import { getDiyFieldList } from '@/api/clue/clueField'
|
||||
@@ -139,7 +137,7 @@ import AMapLoader from '@amap/amap-jsapi-loader'
|
||||
|
||||
import DialogSchoolInfo from './DialogSchoolInfo.vue'
|
||||
|
||||
import ImgPostion from '@/assets/imgs/flag/position_blue.png'
|
||||
import ImgPostion from '@/assets/imgs/flag/position_black.png'
|
||||
import FlagRed from '@/assets/imgs/flag/flag_red.png'
|
||||
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
|
||||
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
|
||||
@@ -148,7 +146,6 @@ import FlagBlue from '@/assets/imgs/flag/flag_blue.png'
|
||||
import FlagBlack from '@/assets/imgs/flag/flag_black.png'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
const appStore = useAppStore()
|
||||
|
||||
const props = defineProps({
|
||||
@@ -161,8 +158,14 @@ const props = defineProps({
|
||||
})
|
||||
|
||||
const formSchema = computed(() => {
|
||||
const newSchema = [...props.schema]
|
||||
newSchema.forEach((it) => {
|
||||
if (it.field == 'consultTime') {
|
||||
it.componentProps['disabled-date'] = dateAfterToday
|
||||
}
|
||||
})
|
||||
return [
|
||||
...props.schema,
|
||||
...newSchema,
|
||||
{
|
||||
component: 'Input',
|
||||
label: '诉求',
|
||||
@@ -185,6 +188,10 @@ const formSchema = computed(() => {
|
||||
]
|
||||
})
|
||||
|
||||
const dateAfterToday = (t) => {
|
||||
return t.getTime() > Date.now()
|
||||
}
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
@@ -204,7 +211,6 @@ const tabName = ref('info')
|
||||
const followList = ref([])
|
||||
|
||||
const areaValue = ref('')
|
||||
const areaList = ref([])
|
||||
const address = ref('')
|
||||
const defaultLatLng = ref({
|
||||
lat: 31.86119,
|
||||
@@ -226,45 +232,70 @@ const open = async (type, id) => {
|
||||
try {
|
||||
const data = await ClueApi.getClue(id)
|
||||
info.value = { ...data, ...data.diyParams }
|
||||
info.value.remark = info.value.remark || ''
|
||||
defaultLatLng.value = {
|
||||
lat: data.lat,
|
||||
lng: data.lng
|
||||
}
|
||||
nextTick(() => {
|
||||
followList.value = data.followUser
|
||||
address.value = data.address || ''
|
||||
formRef.value.setValues(info.value)
|
||||
formRef.value.setValues(info.value, false)
|
||||
})
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
} else {
|
||||
followList.value = []
|
||||
followList.value = [
|
||||
{
|
||||
userId: useUserStore().getUser.id,
|
||||
content: undefined,
|
||||
nextFollowTime: formatDate(new Date()),
|
||||
editable: true
|
||||
}
|
||||
]
|
||||
address.value = ''
|
||||
defaultLatLng.value = {
|
||||
lat: 31.86119,
|
||||
lng: 117.283042
|
||||
}
|
||||
}
|
||||
if (appStore.getAppInfo?.instanceType == 1 && !dialogMap.value) {
|
||||
nextTick(async () => {
|
||||
await getSchoolPlace()
|
||||
initMap(info.value)
|
||||
remoteMethod(address.value)
|
||||
nextTick(() => {
|
||||
formRef.value.setValues(info.value, true)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function changeTab() {
|
||||
if (tabName.value == 'map') {
|
||||
if (!dialogMap.value) {
|
||||
nextTick(async () => {
|
||||
await getSchoolPlace()
|
||||
initMap(info.value)
|
||||
// remoteMethod(address.value)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
destroyMap()
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
function resetForm() {
|
||||
info.value.address = undefined
|
||||
info.value.lat = undefined
|
||||
info.value.lng = undefined
|
||||
info.value.followUsers = []
|
||||
info.value.diyParams = {}
|
||||
info.value = {
|
||||
address: undefined,
|
||||
lat: undefined,
|
||||
lng: undefined,
|
||||
consultTime: formatDate(new Date()),
|
||||
followUsers: [],
|
||||
diyParams: {}
|
||||
}
|
||||
}
|
||||
|
||||
const placeList = ref([])
|
||||
async function getSchoolPlace() {
|
||||
const data = await getPlaceList()
|
||||
placeList.value = data.placeList.filter((it) => it.status == 0 && it.schoolStatus == 0)
|
||||
const data = await getPlaceList({ placeStatus: 0 })
|
||||
placeList.value = data.placeList
|
||||
}
|
||||
|
||||
const emit = defineEmits(['success'])
|
||||
@@ -274,7 +305,7 @@ async function handleSave() {
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.getElFormRef().validate()
|
||||
if (!valid) return
|
||||
if (!followList.value && followList.value.length == 0) {
|
||||
if (!followList.value || followList.value.length == 0) {
|
||||
message.info('请添加跟进人')
|
||||
return
|
||||
}
|
||||
@@ -303,11 +334,11 @@ async function handleSave() {
|
||||
}
|
||||
}
|
||||
if (formType.value === 'create') {
|
||||
await ClueApi.createClue(params)
|
||||
message.success(t('common.createSuccess'))
|
||||
const data = await ClueApi.createClue(params)
|
||||
message.success(data)
|
||||
} else {
|
||||
await ClueApi.updateClue(params)
|
||||
message.success(t('common.updateSuccess'))
|
||||
const data = await ClueApi.updateClue(params)
|
||||
message.success(data)
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
@@ -353,11 +384,9 @@ function initMap(data) {
|
||||
zooms: [2, 22],
|
||||
center: [defaultLatLng.value.lng, defaultLatLng.value.lat]
|
||||
})
|
||||
if (data.lng || data.lat) {
|
||||
addmark(data.lng, data.lat, AMap)
|
||||
}
|
||||
addmark(defaultLatLng.value.lng, defaultLatLng.value.lat, AMap)
|
||||
AutoComplete.value = new AMap.AutoComplete({
|
||||
city: '全国'
|
||||
city: '合肥'
|
||||
})
|
||||
geoCoder.value = new AMap.Geocoder()
|
||||
dialogMap.value.on('click', (e) => {
|
||||
@@ -459,10 +488,11 @@ function addmark(lat, lng, AMap) {
|
||||
marker.value = new AMap.Marker({
|
||||
position: new AMap.LngLat(lat, lng),
|
||||
zoom: 13,
|
||||
icon: ImgPostion
|
||||
icon: ImgPostion,
|
||||
offset: [-16, -32]
|
||||
})
|
||||
dialogMap.value.add(marker.value)
|
||||
dialogMap.value.setCenter([lat, lng], '', 500)
|
||||
dialogMap.value.setCenter([lat, lng], true)
|
||||
getNearbySchool({ lat: lng, lng: lat })
|
||||
}
|
||||
function removeMarker() {
|
||||
@@ -508,28 +538,33 @@ function showSchoolInfo(val) {
|
||||
schoolInfoDialog.value.open(val)
|
||||
}
|
||||
|
||||
function remoteMethod(searchValue) {
|
||||
if (searchValue !== '') {
|
||||
setTimeout(() => {
|
||||
AutoComplete.value?.search(searchValue, (status, result) => {
|
||||
if (result.tips?.length) {
|
||||
areaList.value = result?.tips
|
||||
}
|
||||
})
|
||||
}, 200)
|
||||
function remoteMethod(searchValue, cb) {
|
||||
if (searchValue) {
|
||||
AutoComplete.value?.search(searchValue, (status, result) => {
|
||||
if (result.tips?.length) {
|
||||
// areaList.value = result?.tips
|
||||
const list = result.tips.map((it) => ({
|
||||
...it,
|
||||
value: it.name
|
||||
}))
|
||||
cb(list)
|
||||
} else {
|
||||
cb([])
|
||||
}
|
||||
})
|
||||
} else {
|
||||
cb([])
|
||||
}
|
||||
}
|
||||
|
||||
function currentSelect(val) {
|
||||
const area = areaList.value.find((it) => it.name == val)
|
||||
if (area) {
|
||||
if (val) {
|
||||
defaultLatLng.value = {
|
||||
lng: area.location?.lng,
|
||||
lat: area.location?.lat
|
||||
lng: val.location?.lng,
|
||||
lat: val.location?.lat
|
||||
}
|
||||
addmark(area.location?.lng, area.location?.lat, aMap.value)
|
||||
dialogMap.value.setCenter([area.location?.lng, area.location?.lat], '', 500)
|
||||
regeoCode(area.location?.lng, area.location?.lat)
|
||||
addmark(val.location?.lng, val.location?.lat, aMap.value)
|
||||
regeoCode(val.location?.lng, val.location?.lat)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,31 +10,6 @@
|
||||
/>
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px" class="mt-20px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="成交日期" prop="dealDate">
|
||||
<el-date-picker
|
||||
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="8" :offset="0">
|
||||
<el-form-item label="是否全款">
|
||||
<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="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">
|
||||
@@ -79,6 +54,7 @@
|
||||
:disabled="!form.signPlace"
|
||||
placeholder="选择班型"
|
||||
filterable
|
||||
@change="changeClass"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in classOptions"
|
||||
@@ -90,6 +66,39 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="成交日期" prop="dealDate">
|
||||
<el-date-picker
|
||||
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="8" :offset="0">
|
||||
<el-form-item label="是否全款">
|
||||
<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="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>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="公司收款" prop="isCompanyReceipts">
|
||||
<el-radio-group v-model="form.isCompanyReceipts">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="8"
|
||||
:offset="0"
|
||||
@@ -286,7 +295,7 @@ 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 { getClassTypeList } from '@/api/school/class'
|
||||
import { getSimpleProductList } from '@/api/mall/product'
|
||||
// import { getSimpleWarehouseList } from '@/api/mall/warehouse'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
@@ -331,6 +340,15 @@ const extraTotalPrice = computed(() => {
|
||||
})
|
||||
|
||||
const showSchema = computed(() => {
|
||||
let list = props.schema.map((it) => {
|
||||
if (it.label.includes('日期')) {
|
||||
it.dateFormat = 'YYYY-MM-DD'
|
||||
}
|
||||
return it
|
||||
})
|
||||
if (list.length % 2 != 0) {
|
||||
list.push({})
|
||||
}
|
||||
const arr = [
|
||||
{
|
||||
field: 'requirement',
|
||||
@@ -344,7 +362,7 @@ const showSchema = computed(() => {
|
||||
span: 2
|
||||
}
|
||||
]
|
||||
return [...props.schema, ...arr]
|
||||
return [...list, ...arr]
|
||||
})
|
||||
|
||||
const extraPayOptions = getDictOptions('other_pay_type')
|
||||
@@ -368,6 +386,7 @@ function resetForm(id) {
|
||||
state: true,
|
||||
payAmount: 0,
|
||||
remark: undefined,
|
||||
isCompanyReceipts: appStore.getAppInfo?.instanceType == 1,
|
||||
extraPay: [],
|
||||
signProducts: []
|
||||
}
|
||||
@@ -438,14 +457,14 @@ const placeOptions = computed(() => {
|
||||
const classOptions = ref([])
|
||||
|
||||
async function getClassTypeOptions() {
|
||||
const data = await getClassTypePage({ placeId: form.value.signPlace })
|
||||
classOptions.value = data.list
|
||||
const data = await getClassTypeList({ placeId: form.value.signPlace, status: 0 })
|
||||
classOptions.value = data
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
if (appStore.getAppInfo?.instanceType == 1) {
|
||||
// 驾校
|
||||
getPlaceList().then((data) => {
|
||||
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
||||
schoolOptions.value = data.schoolList
|
||||
allPlaceOptions.value = data.placeList
|
||||
})
|
||||
@@ -476,6 +495,11 @@ function changePlace() {
|
||||
getClassTypeOptions()
|
||||
}
|
||||
|
||||
function changeClass() {
|
||||
form.value.payAmount =
|
||||
classOptions.value.find((it) => it.typeId == form.value.signClass).guidingPrice || 0
|
||||
}
|
||||
|
||||
function handleRemove(type, index) {
|
||||
form.value[type].splice(index, 1)
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ import DialogSchoolInfo from './DialogSchoolInfo.vue'
|
||||
import AMapLoader from '@amap/amap-jsapi-loader'
|
||||
import { formatDate, dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
import ImgPostion from '@/assets/imgs/flag/position_blue.png'
|
||||
import ImgPostion from '@/assets/imgs/flag/position_black.png'
|
||||
import FlagRed from '@/assets/imgs/flag/flag_red.png'
|
||||
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
|
||||
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
|
||||
@@ -180,6 +180,11 @@ const props = defineProps({
|
||||
|
||||
const showSchema = computed(() => {
|
||||
const arr1 = [...props.schema]
|
||||
arr1.forEach((it) => {
|
||||
if (it.label.includes('日期')) {
|
||||
it.dateFormat = 'YYYY-MM-DD'
|
||||
}
|
||||
})
|
||||
if (arr1.length % 2 != 0) {
|
||||
arr1.push({})
|
||||
}
|
||||
@@ -267,8 +272,8 @@ function followSuccess() {
|
||||
|
||||
const placeList = ref([])
|
||||
async function getSchoolPlace() {
|
||||
const data = await getPlaceList()
|
||||
placeList.value = data.placeList.filter((it) => it.status == 0 && it.schoolStatus == 0)
|
||||
const data = await getPlaceList({ placeStatus: 0 })
|
||||
placeList.value = data.placeList
|
||||
}
|
||||
|
||||
const defaultLatLng = ref({
|
||||
@@ -339,7 +344,8 @@ function addmark(lat, lng, AMap) {
|
||||
marker.value = new AMap.Marker({
|
||||
position: new AMap.LngLat(lat, lng),
|
||||
zoom: 13,
|
||||
icon: ImgPostion
|
||||
icon: ImgPostion,
|
||||
offset: [-16, -32]
|
||||
})
|
||||
dialogMap.value.add(marker.value)
|
||||
dialogMap.value.setCenter([lat, lng], '', 500)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="relative">
|
||||
<el-tabs v-model="queryType" size="small" @tab-change="getTableList">
|
||||
<el-tabs v-model="queryType" size="small" @tab-change="quickChange">
|
||||
<el-tab-pane label="全部" name="0" />
|
||||
<el-tab-pane name="1">
|
||||
<template #label>
|
||||
@@ -31,6 +31,14 @@
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="公海" name="4" />
|
||||
<el-tab-pane
|
||||
v-if="appStore.getAppInfo?.instanceType == 1"
|
||||
label="地图总览"
|
||||
name="5"
|
||||
style="height: calc(100vh - 160px)"
|
||||
>
|
||||
<ClueMap ref="mapClue" v-if="queryType == 5" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="absolute" style="right: 10px; top: 0">
|
||||
<el-button plain v-hasPermi="['clue:pool:import']">导入</el-button>
|
||||
@@ -39,117 +47,120 @@
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<Search v-if="!loading" ref="searchRef" :schema="allSchemas.searchSchema" labelWidth="0">
|
||||
<template #actionMore>
|
||||
<el-button @click="getTableList" v-hasPermi="['clue:pool:search']"> 搜索 </el-button>
|
||||
<el-button @click="resetQuery" v-hasPermi="['clue:pool:reset']"> 重置 </el-button>
|
||||
</template>
|
||||
</Search>
|
||||
<!-- 列表 -->
|
||||
<SSTable
|
||||
v-if="!loading"
|
||||
class="mt-20px"
|
||||
v-model:tableObject="tableObject"
|
||||
:tableColumns="allSchemas.tableColumns"
|
||||
@get-list="getTableList"
|
||||
@get-checked-columns="getCheckedColumns"
|
||||
>
|
||||
<el-table-column
|
||||
v-for="item in showColumns"
|
||||
:key="item.field"
|
||||
:prop="item.field"
|
||||
:label="item.label"
|
||||
min-width="120px"
|
||||
<template v-if="queryType != 5">
|
||||
<!-- 搜索工作栏 -->
|
||||
<Search v-if="!loading" ref="searchRef" :schema="allSchemas.searchSchema" labelWidth="0">
|
||||
<template #actionMore>
|
||||
<el-button @click="getTableList" v-hasPermi="['clue:pool:search']"> 搜索 </el-button>
|
||||
<el-button @click="resetQuery" v-hasPermi="['clue:pool:reset']"> 重置 </el-button>
|
||||
</template>
|
||||
</Search>
|
||||
<!-- 列表 -->
|
||||
<SSTable
|
||||
v-if="!loading"
|
||||
class="mt-20px"
|
||||
v-model:tableObject="tableObject"
|
||||
:tableColumns="allSchemas.tableColumns"
|
||||
@get-list="getTableList"
|
||||
@get-checked-columns="getCheckedColumns"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div v-if="item.field == 'followRecord'">
|
||||
<el-button
|
||||
type="primary"
|
||||
text
|
||||
style="padding: 0"
|
||||
@click="handleFollow(row)"
|
||||
v-if="queryType != 4"
|
||||
v-hasPermi="['clue:pool:update']"
|
||||
>
|
||||
快速新增
|
||||
</el-button>
|
||||
</div>
|
||||
<div v-else-if="item.field == 'contact'">
|
||||
<span>{{ row[item.field] }}</span>
|
||||
<Icon class="ml-5px" icon="ep:phone" @click="makeCall(row.contact)" />
|
||||
</div>
|
||||
<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'">
|
||||
<el-popover placement="top" width="500px" trigger="click" v-if="row[item.field]">
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="row[item.field]"></div>
|
||||
</el-popover>
|
||||
</div>
|
||||
<span v-else>{{ row[item.field] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200px" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="handleDetail(scope.row)"
|
||||
v-hasPermi="['clue:pool:detail']"
|
||||
>
|
||||
详情
|
||||
</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
|
||||
:disabled="scope.row.state == '成交'"
|
||||
@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>
|
||||
<el-table-column
|
||||
v-for="item in showColumns"
|
||||
:key="item.field"
|
||||
:prop="item.field"
|
||||
:label="item.label"
|
||||
min-width="120px"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div v-if="item.field == 'followRecord'">
|
||||
<el-button
|
||||
type="primary"
|
||||
text
|
||||
style="padding: 0"
|
||||
@click="handleFollow(row)"
|
||||
v-if="queryType != 4"
|
||||
v-hasPermi="['clue:pool:update']"
|
||||
>
|
||||
快速新增
|
||||
</el-button>
|
||||
</div>
|
||||
<div v-else-if="item.field == 'contact'">
|
||||
<span>{{ row[item.field] }}</span>
|
||||
<Icon class="ml-5px" icon="ep:phone" @click="makeCall(row.contact)" />
|
||||
</div>
|
||||
<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'">
|
||||
<el-popover placement="top" width="500px" trigger="click" v-if="row[item.field]">
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="row[item.field]"></div>
|
||||
</el-popover>
|
||||
</div>
|
||||
<span v-else>{{ row[item.field] }}</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200px" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
v-hasPermi="['clue:pool:gain']"
|
||||
@click="handleGain(scope.row.clueId)"
|
||||
@click="handleDetail(scope.row)"
|
||||
v-hasPermi="['clue:pool:detail']"
|
||||
>
|
||||
获取
|
||||
详情
|
||||
</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
|
||||
:disabled="scope.row.state == '成交'"
|
||||
@click="handleSuccess(scope.row)"
|
||||
v-hasPermi="['clue:pool:enroll']"
|
||||
>
|
||||
登记
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
:disabled="scope.row.state == '成交'"
|
||||
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>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</SSTable>
|
||||
</el-table-column>
|
||||
</SSTable>
|
||||
</template>
|
||||
|
||||
<DialogClue
|
||||
v-if="!loading"
|
||||
ref="formRef"
|
||||
:userOptions="userOptions"
|
||||
:schema="allSchemas.formSchema"
|
||||
@sucess="getTableList"
|
||||
@success="getTableList"
|
||||
/>
|
||||
<DrawerClue
|
||||
v-if="!loading"
|
||||
@@ -164,11 +175,13 @@
|
||||
</template>
|
||||
|
||||
<script setup name="CluePool">
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { getSimpleFieldList } from '@/api/clue/clueField'
|
||||
import DialogClue from './Comp/DialogClue.vue'
|
||||
import DrawerClue from './Comp/DrawerClue.vue'
|
||||
import DialogSuccess from './Comp/DialogSuccess.vue'
|
||||
import DialogFollow from './Comp/DialogFollow.vue'
|
||||
import ClueMap from './Comp/ClueMap.vue'
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
@@ -177,6 +190,7 @@ import { formatDate } from '@/utils/formatTime'
|
||||
import * as ClueApi from '@/api/clue'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const appStore = useAppStore()
|
||||
|
||||
const searchRef = ref()
|
||||
const queryType = ref('2')
|
||||
@@ -223,10 +237,24 @@ function getCheckedColumns(list) {
|
||||
showColumns.value = list && list.length ? list : allSchemas.value.tableColumns
|
||||
}
|
||||
|
||||
const mapClue = ref()
|
||||
function quickChange(name) {
|
||||
try {
|
||||
if (name != '5') {
|
||||
resetQuery()
|
||||
mapClue.value && mapClue.value.destroyMap()
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
function resetQuery() {
|
||||
searchRef.value.reset()
|
||||
tableObject.value.pageNo = 1
|
||||
getTableList()
|
||||
nextTick(() => {
|
||||
searchRef.value && searchRef.value.reset()
|
||||
tableObject.value.pageNo = 1
|
||||
getTableList()
|
||||
})
|
||||
}
|
||||
|
||||
async function getTableList() {
|
||||
@@ -323,6 +351,7 @@ function handleGain(id) {
|
||||
}
|
||||
|
||||
const userOptions = ref([])
|
||||
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
<span class="mr-10px">{{ item.username }}</span>
|
||||
<span>已跟进{{ item.followNum }}条线索</span>
|
||||
</li>
|
||||
<br />
|
||||
<!-- <br /> -->
|
||||
<!-- </TransitionGroup> -->
|
||||
</ul>
|
||||
</el-skeleton>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
:options="props.schoolOption"
|
||||
v-model="formData.schPlace"
|
||||
filterable
|
||||
:props="{ value: 'id' }"
|
||||
:props="{ value: 'value' }"
|
||||
show-all-levels
|
||||
style="width: 100%"
|
||||
/>
|
||||
@@ -116,26 +116,26 @@
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="利润模式:">
|
||||
<el-radio-group v-model="profitCompanyForm.profitType">
|
||||
<el-radio-group v-model="profitCompanyForm.profitMode">
|
||||
<el-radio :label="1">比例模式</el-radio>
|
||||
<el-radio :label="2">固定模式</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="计算规则:">
|
||||
<div class="flex items-center" v-if="profitCompanyForm.profitType == 1">
|
||||
<div class="flex items-center" v-if="profitCompanyForm.profitMode == 1">
|
||||
<span>公司利润 = ( 成交价 </span>
|
||||
<el-select
|
||||
v-model="profitCompanyForm.isPlus"
|
||||
v-model="profitCompanyForm.profitRule.mark"
|
||||
size="small"
|
||||
placeholder="加/减"
|
||||
class="ml-10px mr-10px"
|
||||
style="width: 70px"
|
||||
>
|
||||
<el-option label="+" :value="1" />
|
||||
<el-option label="-" :value="2" />
|
||||
<el-option label="+" value="+" />
|
||||
<el-option label="-" value="-" />
|
||||
</el-select>
|
||||
<el-input-number
|
||||
v-model="profitCompanyForm.bianliang"
|
||||
v-model="profitCompanyForm.profitRule.minPrice"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
@@ -144,7 +144,7 @@
|
||||
/>
|
||||
<span class="ml-10px mr-10px"> ) 乘以 </span>
|
||||
<el-input-number
|
||||
v-model="profitCompanyForm.bili"
|
||||
v-model="profitCompanyForm.profitRule.rate"
|
||||
size="small"
|
||||
placeholder="比例"
|
||||
:min="0"
|
||||
@@ -152,11 +152,11 @@
|
||||
:controls="false"
|
||||
/>
|
||||
</div>
|
||||
<div v-else-if="profitCompanyForm.profitType == 2">
|
||||
<div v-else-if="profitCompanyForm.profitMode == 2">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="profitCompanyForm.dangwei.push({ dangweizhi: undefined, lirun: undefined })"
|
||||
@click="profitCompanyForm.dangwei.push({ signPrice: undefined, profit: undefined })"
|
||||
>添加利润档位</el-button
|
||||
>
|
||||
<div
|
||||
@@ -166,7 +166,7 @@
|
||||
>
|
||||
<span>成交额满</span>
|
||||
<el-input-number
|
||||
v-model="item.dangweizhi"
|
||||
v-model="item.signPrice"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
@@ -176,7 +176,7 @@
|
||||
/>
|
||||
<span>,公司利润为</span>
|
||||
<el-input-number
|
||||
v-model="item.lirun"
|
||||
v-model="item.profit"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
@@ -197,16 +197,16 @@
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="利润模式:">
|
||||
<el-radio-group v-model="profitEmployeeForm.profitType">
|
||||
<el-radio-group v-model="profitEmployeeForm.profitMode">
|
||||
<el-radio :label="1">比例模式</el-radio>
|
||||
<el-radio :label="2">固定模式</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="计算规则:">
|
||||
<div class="flex items-center" v-if="profitEmployeeForm.profitType == 1">
|
||||
<div class="flex items-center" v-if="profitEmployeeForm.profitMode == 1">
|
||||
<span>公司利润 = ( 成交价 </span>
|
||||
<el-select
|
||||
v-model="profitEmployeeForm.isPlus"
|
||||
v-model="profitEmployeeForm.profitRule.mark"
|
||||
size="small"
|
||||
placeholder="加/减"
|
||||
class="ml-10px mr-10px"
|
||||
@@ -216,7 +216,7 @@
|
||||
<el-option label="-" :value="2" />
|
||||
</el-select>
|
||||
<el-input-number
|
||||
v-model="profitEmployeeForm.bianliang"
|
||||
v-model="profitEmployeeForm.profitRule.minPrice"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
@@ -225,7 +225,7 @@
|
||||
/>
|
||||
<span class="ml-10px mr-10px"> ) 乘以 </span>
|
||||
<el-input-number
|
||||
v-model="profitEmployeeForm.bili"
|
||||
v-model="profitEmployeeForm.profitRule.rate"
|
||||
size="small"
|
||||
placeholder="比例"
|
||||
:min="0"
|
||||
@@ -233,12 +233,12 @@
|
||||
:controls="false"
|
||||
/>
|
||||
</div>
|
||||
<div v-else-if="profitEmployeeForm.profitType == 2">
|
||||
<div v-else-if="profitEmployeeForm.profitMode == 2">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="
|
||||
profitEmployeeForm.dangwei.push({ dangweizhi: undefined, lirun: undefined })
|
||||
profitEmployeeForm.dangwei.push({ signPrice: undefined, profit: undefined })
|
||||
"
|
||||
>添加利润档位</el-button
|
||||
>
|
||||
@@ -249,7 +249,7 @@
|
||||
>
|
||||
<span>成交额满</span>
|
||||
<el-input-number
|
||||
v-model="item.dangweizhi"
|
||||
v-model="item.signPrice"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
@@ -259,7 +259,7 @@
|
||||
/>
|
||||
<span>,公司利润为</span>
|
||||
<el-input-number
|
||||
v-model="item.lirun"
|
||||
v-model="item.profit"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
@@ -451,15 +451,17 @@ const formRef = ref() // 表单 Ref
|
||||
const currentTab = ref('base')
|
||||
|
||||
const profitCompanyForm = ref({
|
||||
profitType: 1,
|
||||
dangwei: []
|
||||
profitMode: 1,
|
||||
dangwei: [],
|
||||
profitRule: {}
|
||||
})
|
||||
const profitCompanyRules = {}
|
||||
const profitCompanyRef = ref()
|
||||
|
||||
const profitEmployeeForm = ref({
|
||||
profitType: 1,
|
||||
dangwei: []
|
||||
profitMode: 1,
|
||||
dangwei: [],
|
||||
profitRule: {}
|
||||
})
|
||||
const profitEmployeeRules = {}
|
||||
const profitEmployeeRef = ref()
|
||||
@@ -476,6 +478,7 @@ const open = async (type, id) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = type == 'create' ? '新增班型' : '修改班型'
|
||||
formType.value = type
|
||||
currentTab.value = 'base'
|
||||
resetForm()
|
||||
if (!opts.value.length) {
|
||||
const arr = await ClassApi.getCommissionParams()
|
||||
@@ -489,6 +492,37 @@ const open = async (type, id) => {
|
||||
try {
|
||||
formData.value = await ClassApi.getClassType(id)
|
||||
formData.value.schPlace = [formData.value.schoolId, formData.value.placeId]
|
||||
if (!formData.value.companyProfitVO) {
|
||||
profitCompanyForm.value = {
|
||||
profitMode: 1,
|
||||
dangwei: [],
|
||||
profitRule: {}
|
||||
}
|
||||
} else if (formData.value.companyProfitVO.profitMode == 1) {
|
||||
profitCompanyForm.value = { ...formData.value.companyProfitVO, dangwei: [] }
|
||||
} else {
|
||||
profitCompanyForm.value = {
|
||||
...formData.value.companyProfitVO,
|
||||
dangwei: formData.value.companyProfitVO.profitRule
|
||||
}
|
||||
profitCompanyForm.value.profitRule = {}
|
||||
}
|
||||
|
||||
if (!formData.value.personProfitVO) {
|
||||
profitEmployeeForm.value = {
|
||||
profitMode: 1,
|
||||
dangwei: [],
|
||||
profitRule: {}
|
||||
}
|
||||
} else if (formData.value.personProfitVO.profitMode == 1) {
|
||||
profitEmployeeForm.value = { ...formData.value.personProfitVO, dangwei: [] }
|
||||
} else {
|
||||
profitEmployeeForm.value = {
|
||||
...formData.value.personProfitVO,
|
||||
dangwei: formData.value.personProfitVO.profitRule
|
||||
}
|
||||
profitEmployeeForm.value.profitRule = {}
|
||||
}
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
@@ -525,9 +559,7 @@ function handleAddPrice() {
|
||||
}
|
||||
|
||||
function handleDeletePrice(row, index) {
|
||||
if (row.edit) {
|
||||
formData.value.quotations.splice(index, 1)
|
||||
}
|
||||
formData.value.quotations.splice(index, 1)
|
||||
message.success('删除成功')
|
||||
}
|
||||
|
||||
@@ -579,6 +611,51 @@ async function submitForm() {
|
||||
delete data.schPlace
|
||||
delete data.percentages
|
||||
data.percentages = { ...comissionForm.value }
|
||||
data.companyProfitVO = { ...profitCompanyForm.value }
|
||||
data.personProfitVO = { ...profitEmployeeForm.value }
|
||||
if (data.companyProfitVO.profitMode == 1) {
|
||||
data.companyProfitVO.profitRule.minPrice = data.companyProfitVO.profitRule.minPrice || 0
|
||||
if (!data.companyProfitVO.profitRule.mark || !data.companyProfitVO.profitRule.rate) {
|
||||
message.info('请将公司利润计算规则填写完整!')
|
||||
return
|
||||
}
|
||||
} else {
|
||||
data.companyProfitVO.profitRule = data.companyProfitVO?.dangwei || []
|
||||
delete data.companyProfitVO.dangwei
|
||||
if (data.companyProfitVO.profitRule.length == 0) {
|
||||
message.info('请添加公司利润计算规则!')
|
||||
return
|
||||
} else if (
|
||||
data.companyProfitVO.profitRule.some(
|
||||
(it) => it.signPrice == undefined || it.profit == undefined
|
||||
)
|
||||
) {
|
||||
message.info('请将公司利润计算规则填写完整!')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if (data.personProfitVO.profitMode == 1) {
|
||||
data.personProfitVO.profitRule.minPrice = data.personProfitVO.profitRule.minPrice || 0
|
||||
if (!data.personProfitVO.profitRule.mark || !data.personProfitVO.profitRule.rate) {
|
||||
message.info('请将员工利润计算规则填写完整!')
|
||||
return
|
||||
}
|
||||
} else {
|
||||
data.personProfitVO.profitRule = data.personProfitVO?.dangwei || []
|
||||
delete data.personProfitVO.dangwei
|
||||
if (data.personProfitVO.profitRule.length == 0) {
|
||||
message.info('请添加员工利润计算规则!')
|
||||
return
|
||||
} else if (
|
||||
data.personProfitVO.profitRule.some(
|
||||
(it) => it.signPrice == undefined || it.profit == undefined
|
||||
)
|
||||
) {
|
||||
message.info('请将员工利润计算规则填写完整!')
|
||||
return
|
||||
}
|
||||
}
|
||||
if (formType.value === 'create') {
|
||||
await ClassApi.createClassType(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
>
|
||||
<el-button
|
||||
type="danger"
|
||||
@click="handleBatchDelete"
|
||||
@click="handleBatchDelete([])"
|
||||
v-hasPermi="['school:class:batch-delete']"
|
||||
>批量删除</el-button
|
||||
>
|
||||
@@ -82,7 +82,13 @@
|
||||
/>
|
||||
<el-table-column label="备注" width="260">
|
||||
<template #default="{ row }">
|
||||
<div v-dompurify-html="row.remark"></div>
|
||||
<!-- <div v-dompurify-html="row.remark"></div> -->
|
||||
<el-popover placement="top" width="500px" trigger="click">
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="row.remark"></div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="80">
|
||||
@@ -154,6 +160,7 @@ import DialogClass from './Comp/DialogClass.vue'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
|
||||
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
|
||||
import { removeNullField } from '@/utils'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
@@ -175,7 +182,11 @@ const schoolOption = ref([])
|
||||
|
||||
async function getSchoolList() {
|
||||
try {
|
||||
const data = await PlaceApi.getPlaceList()
|
||||
const data = await PlaceApi.getPlaceList({
|
||||
placeStatus: 0,
|
||||
schoolStatus: 0,
|
||||
isSearchSchool: true
|
||||
})
|
||||
schoolOption.value = data.schoolList.map((item) => ({
|
||||
value: item.schoolId,
|
||||
label: item.schoolName,
|
||||
@@ -194,8 +205,7 @@ const columns = [
|
||||
{ props: 'placeName', label: '场地' },
|
||||
{ props: 'typeName', label: '班型名称' },
|
||||
{ props: 'licenseType', label: '驾照类型', width: '100px' },
|
||||
{ props: 'guidingPrice', label: '最新报价', width: '100px' },
|
||||
{ props: 'minPrice', label: '最新底价', width: '100px' }
|
||||
{ props: 'guidingPrice', label: '最新报价', width: '100px' }
|
||||
// { props: 'remark', label: '备注', width: '100px' }
|
||||
]
|
||||
|
||||
@@ -215,7 +225,7 @@ async function getList() {
|
||||
}
|
||||
}
|
||||
delete params.schPlace
|
||||
const data = await ClassApi.getClassTypePage(params)
|
||||
const data = await ClassApi.getClassTypePage(removeNullField(params))
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
@@ -240,7 +250,7 @@ function handleReset() {
|
||||
}
|
||||
|
||||
async function handleBatchDelete(arr = []) {
|
||||
if (!arr.length || !selectRows.value.length) {
|
||||
if (!arr.length && !selectRows.value.length) {
|
||||
message.info('请选择表格行!')
|
||||
return
|
||||
}
|
||||
|
||||
@@ -325,7 +325,10 @@ function regeoCode() {
|
||||
async function getPageData() {
|
||||
schoolList.value = []
|
||||
tableData.value = []
|
||||
const data = await PlaceApi.getPlaceList()
|
||||
const data = await PlaceApi.getPlaceList({
|
||||
schoolStatus: 0,
|
||||
isSearchSchool: true
|
||||
})
|
||||
if (data.schoolList) {
|
||||
schoolList.value = data.schoolList.map((item) => ({ ...item, showInMap: true }))
|
||||
}
|
||||
@@ -363,7 +366,7 @@ function handleClickSchool(item) {
|
||||
function createMarkersInMap() {
|
||||
for (let i = 0; i < tableData.value.length; i++) {
|
||||
const element = tableData.value[i]
|
||||
if (!element.schoolShow || !element.showInMap) {
|
||||
if (!element.schoolShow || !element.showInMap || element.status == 1) {
|
||||
continue
|
||||
}
|
||||
const markerIcon = flagMap[element.flagColor || 'red']
|
||||
@@ -542,7 +545,8 @@ async function changePlaceStatus(row) {
|
||||
await PlaceApi.updatePlaceStatus(row.placeId, row.status)
|
||||
message.success('修改成功')
|
||||
// 刷新列表
|
||||
// await getList()
|
||||
// await getPageData()
|
||||
tableData.value.find((item) => item.placeId == row.placeId).status = row.status
|
||||
resetMarkers()
|
||||
} catch {
|
||||
// 取消后,进行恢复按钮
|
||||
|
||||
Reference in New Issue
Block a user