Compare commits
35 Commits
32781fa067
...
salary
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72accc0ab2 | ||
|
|
d31f4b4f8b | ||
|
|
18ed17b131 | ||
|
|
46c66e19aa | ||
|
|
e3e24f4939 | ||
|
|
f2064d99ad | ||
|
|
08ada50d1a | ||
|
|
ab0c770167 | ||
|
|
e1ff8213bf | ||
|
|
8f1b89cc91 | ||
|
|
87a2fe09de | ||
|
|
a4c5143ee5 | ||
|
|
c2eac572c0 | ||
|
|
7e049dfd08 | ||
|
|
2e30a103fd | ||
|
|
ac83a22ca6 | ||
|
|
cb44360b8a | ||
|
|
ac0c15a1a2 | ||
|
|
6a414d07df | ||
|
|
a33cbab7e3 | ||
|
|
2048796798 | ||
|
|
4d45196895 | ||
|
|
fa2481ea3d | ||
|
|
31f028d8d8 | ||
|
|
ed0727fa43 | ||
|
|
906b63feee | ||
|
|
bae1f2608a | ||
|
|
6f4067d50c | ||
|
|
848830a21b | ||
|
|
f63104591b | ||
|
|
93d7f2b43d | ||
|
|
b6bd32430b | ||
|
|
43b95e3a10 | ||
|
|
16e3ac5c6d | ||
|
|
25e13bd975 |
11
.env.base
11
.env.base
@@ -1,20 +1,21 @@
|
|||||||
# 本地开发环境
|
# 本地开发环境
|
||||||
NODE_ENV=development
|
VITE_NODE_ENV=development
|
||||||
|
|
||||||
VITE_DEV=true
|
VITE_DEV=true
|
||||||
|
|
||||||
# 请求路径
|
# 请求路径
|
||||||
#VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn'
|
VITE_BASE_URL='http://118.31.23.45:48080'
|
||||||
VITE_BASE_URL='http://localhost:48080'
|
# VITE_BASE_URL='http://114.55.169.15:48080'
|
||||||
|
|
||||||
# 上传路径
|
# 上传路径
|
||||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||||
|
# VITE_UPLOAD_URL='http://114.55.169.15:48080/admin-api/system/file/upload'
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_API_BASEPATH=/dev-api
|
VITE_API_BASEPATH=/crm-api
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_API_URL=/admin-api
|
VITE_API_URL=/admin-api
|
||||||
|
|
||||||
# 打包路径
|
# 打包路径
|
||||||
VITE_BASE_PATH=/
|
VITE_BASE_PATH=/crm/
|
||||||
|
|||||||
4
.env.dev
4
.env.dev
@@ -10,13 +10,13 @@ VITE_BASE_URL='http://localhost:48080'
|
|||||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_API_BASEPATH=/dev-api
|
VITE_API_BASEPATH=/crm-api
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_API_URL=/admin-api
|
VITE_API_URL=/admin-api
|
||||||
|
|
||||||
# 打包路径
|
# 打包路径
|
||||||
VITE_BASE_PATH=/
|
VITE_BASE_PATH=/crm/
|
||||||
|
|
||||||
# 是否删除debugger
|
# 是否删除debugger
|
||||||
VITE_DROP_DEBUGGER=false
|
VITE_DROP_DEBUGGER=false
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ VITE_BASE_URL='http://118.31.23.45:48080'
|
|||||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_API_BASEPATH=/dev-api
|
VITE_API_BASEPATH=/crm-api
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_API_URL=/admin-api
|
VITE_API_URL=/admin-api
|
||||||
|
|
||||||
# 打包路径
|
# 打包路径
|
||||||
VITE_BASE_PATH=/
|
VITE_BASE_PATH=/crm/
|
||||||
|
|
||||||
# 项目本地运行端口号, 与.vscode/launch.json配合
|
# 项目本地运行端口号, 与.vscode/launch.json配合
|
||||||
VITE_PORT=80
|
VITE_PORT=80
|
||||||
|
|||||||
8
.env.pro
8
.env.pro
@@ -4,13 +4,13 @@ VITE_NODE_ENV=production
|
|||||||
VITE_DEV=false
|
VITE_DEV=false
|
||||||
|
|
||||||
# 请求路径
|
# 请求路径
|
||||||
VITE_BASE_URL='http://localhost:48080'
|
VITE_BASE_URL='/crm-api'
|
||||||
|
|
||||||
# 上传路径
|
# 上传路径
|
||||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
VITE_UPLOAD_URL='/crm-api/admin-api/system/file/upload'
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_API_BASEPATH=
|
VITE_API_BASEPATH=/crm-api
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_API_URL=/admin-api
|
VITE_API_URL=/admin-api
|
||||||
@@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=true
|
|||||||
VITE_SOURCEMAP=false
|
VITE_SOURCEMAP=false
|
||||||
|
|
||||||
# 打包路径
|
# 打包路径
|
||||||
VITE_BASE_PATH=/
|
VITE_BASE_PATH=/crm/
|
||||||
|
|
||||||
# 输出路径
|
# 输出路径
|
||||||
VITE_OUT_DIR=dist-pro
|
VITE_OUT_DIR=dist-pro
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn'
|
|||||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_API_BASEPATH=
|
VITE_API_BASEPATH=/crm-api
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_API_URL=/admin-api
|
VITE_API_URL=/admin-api
|
||||||
@@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=true
|
|||||||
VITE_SOURCEMAP=false
|
VITE_SOURCEMAP=false
|
||||||
|
|
||||||
# 打包路径
|
# 打包路径
|
||||||
VITE_BASE_PATH='http://static-vue3.yudao.iocoder.cn/'
|
VITE_BASE_PATH='/crm'
|
||||||
|
|
||||||
# 输出路径
|
# 输出路径
|
||||||
VITE_OUT_DIR=dist-stage
|
VITE_OUT_DIR=dist-stage
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ VITE_BASE_URL='http://localhost:48080'
|
|||||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_API_BASEPATH=
|
VITE_API_BASEPATH=/crm-api
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_API_URL=/admin-api
|
VITE_API_URL=/admin-api
|
||||||
@@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=true
|
|||||||
VITE_SOURCEMAP=false
|
VITE_SOURCEMAP=false
|
||||||
|
|
||||||
# 打包路径
|
# 打包路径
|
||||||
VITE_BASE_PATH=/admin-ui-vue3/
|
VITE_BASE_PATH=/crm/
|
||||||
|
|
||||||
# 输出路径
|
# 输出路径
|
||||||
VITE_OUT_DIR=dist-dev
|
VITE_OUT_DIR=dist-dev
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ VITE_BASE_URL='http://localhost:48080'
|
|||||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||||
|
|
||||||
# 接口前缀
|
# 接口前缀
|
||||||
VITE_API_BASEPATH=
|
VITE_API_BASEPATH=/crm-api
|
||||||
|
|
||||||
# 接口地址
|
# 接口地址
|
||||||
VITE_API_URL=/admin-api
|
VITE_API_URL=/admin-api
|
||||||
@@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=false
|
|||||||
VITE_SOURCEMAP=true
|
VITE_SOURCEMAP=true
|
||||||
|
|
||||||
# 打包路径
|
# 打包路径
|
||||||
VITE_BASE_PATH=/
|
VITE_BASE_PATH=/crm/
|
||||||
|
|
||||||
# 输出路径
|
# 输出路径
|
||||||
VITE_OUT_DIR=dist-test
|
VITE_OUT_DIR=dist-test
|
||||||
|
|||||||
@@ -141,7 +141,7 @@
|
|||||||
<script type="module" src="/src/main.js"></script>
|
<script type="module" src="/src/main.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window._AMapSecurityConfig = {
|
window._AMapSecurityConfig = {
|
||||||
securityJsCode: 'a2f0d14a4c5c1e387f9271b1045a781d' // 你的密钥
|
securityJsCode: 'f653df5a2c5f44ae68faaab6f6a6b8ab' // 你的密钥
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 7.7 KiB |
@@ -12,7 +12,11 @@ export const getAfterSalePage = async (params) => {
|
|||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
export const createAfterSale = async (data) => {
|
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
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 审核
|
// 审核
|
||||||
|
|||||||
@@ -10,9 +10,14 @@ export const deleteClueGainRule = (id) => {
|
|||||||
return request.delete({ url: `/admin-api/crm/sch-clue-gain-rule/delete?id=${id}` })
|
return request.delete({ url: `/admin-api/crm/sch-clue-gain-rule/delete?id=${id}` })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 线索获取规则保存
|
||||||
|
export const saveClueGainRule = (data) => {
|
||||||
|
return request.put({ url: '/admin-api/crm/sch-clue-gain-rule/batchUpdate', data })
|
||||||
|
}
|
||||||
|
|
||||||
// 线索规则
|
// 线索规则
|
||||||
export const getClueDistributeRuleList = () => {
|
export const getClueDistributeRuleByUser = (params) => {
|
||||||
return request.get({ url: '/admin-api/crm/sch-clue-gain-rule/list' })
|
return request.get({ url: '/admin-api/crm/sch-clue-distribution-rule/queryByUserId', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
// 删除
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ export const getDeliveryList = async (params) => {
|
|||||||
return await request.get({ url: '/admin-api/crm/sign-send/list', params })
|
return await request.get({ url: '/admin-api/crm/sign-send/list', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询(精简)列表
|
// 查询分页列表
|
||||||
export const getDeliveryPage = async (params) => {
|
export const getDeliveryPage = async (params) => {
|
||||||
return await request.get({ url: '/admin-api/crm/sign-send/page', params })
|
return await request.get({ url: '/admin-api/crm/sign-send/page', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
export const createDelivery = async (data) => {
|
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) => {
|
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) => {
|
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) => {
|
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) => {
|
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 })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 取消登记
|
// 取消登记
|
||||||
@@ -24,3 +24,8 @@ export const cancelDeal = async (id) => {
|
|||||||
export const signAddPay = async (data) => {
|
export const signAddPay = async (data) => {
|
||||||
return await request.post({ url: '/admin-api/crm/sign/extra-pay/save', data: data })
|
return await request.post({ url: '/admin-api/crm/sign/extra-pay/save', data: data })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询支出
|
||||||
|
export const getSignExtraPayList = async (params) => {
|
||||||
|
return await request.get({ url: '/admin-api/crm/sign/extra-pay/get', params })
|
||||||
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export const getSkillPage = (params) => {
|
|||||||
|
|
||||||
// 创建
|
// 创建
|
||||||
export const createSkill = (data) => {
|
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) => {
|
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 })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改
|
// 修改
|
||||||
|
|||||||
20
src/api/home/index.js
Normal file
20
src/api/home/index.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
import request from '@/config/axios'
|
||||||
|
// 线索情况
|
||||||
|
export const getUserClueCount = async (params) => {
|
||||||
|
return await request.get({ url: '/admin-api/crm/home/get-user-count', params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 成交率
|
||||||
|
export const getClueSignSignRate = async (params) => {
|
||||||
|
return await request.get({ url: '/admin-api/crm/home/get-sign-rate', params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 成交率
|
||||||
|
export const getClueSignSignRank = async (params) => {
|
||||||
|
return await request.get({ url: '/admin-api/crm/home/get-sign-top10', params })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 成交率
|
||||||
|
export const getClueFollowRank = async (params) => {
|
||||||
|
return await request.get({ url: '/admin-api/crm/home/get-follow-top10', params })
|
||||||
|
}
|
||||||
@@ -32,7 +32,7 @@ export interface BrandVO {
|
|||||||
|
|
||||||
// 创建商品品牌
|
// 创建商品品牌
|
||||||
export const createBrand = (data: 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) => {
|
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) => {
|
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) => {
|
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) => {
|
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) => {
|
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) => {
|
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
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改
|
// 修改
|
||||||
@@ -38,3 +42,8 @@ export const getInventoryList = async (params) => {
|
|||||||
export const getInventoryRecord = async (params) => {
|
export const getInventoryRecord = async (params) => {
|
||||||
return await request.get({ url: '/admin-api/crm/erp-inventory-record/page', params })
|
return await request.get({ url: '/admin-api/crm/erp-inventory-record/page', params })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取剩余库存
|
||||||
|
export const getRemainInventoryList = async (params) => {
|
||||||
|
return await request.get({ url: '/admin-api/crm/erp-inventory-detail/list', params })
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,6 +5,10 @@ export const getClassTypePage = async (params) => {
|
|||||||
return await request.get({ url: '/admin-api/crm/sch-class-type/page', 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) => {
|
export const getClassType = async (id) => {
|
||||||
return await request.get({ url: '/admin-api/crm/sch-class-type/get?id=' + 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) => {
|
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) => {
|
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) => {
|
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
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改
|
// 修改
|
||||||
@@ -30,10 +34,10 @@ export const deletePlace = async (id) => {
|
|||||||
return await request.delete({ url: '/admin-api/crm/sch-place/delete?id=' + id })
|
return await request.delete({ url: '/admin-api/crm/sch-place/delete?id=' + id })
|
||||||
}
|
}
|
||||||
|
|
||||||
export const updatePlaceStatus = async (id, status) => {
|
export const updatePlaceStatus = async (placeId, status) => {
|
||||||
const data = {
|
const data = {
|
||||||
id,
|
placeId,
|
||||||
status
|
status
|
||||||
}
|
}
|
||||||
return request.put({ url: '/admin-api/crm/sch-place/update-status', data: data })
|
return request.put({ url: '/admin-api/crm/sch-place/status/update', data: data })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,11 @@ export const getSchool = async (id) => {
|
|||||||
|
|
||||||
// 新增
|
// 新增
|
||||||
export const createSchool = async (data) => {
|
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
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改
|
// 修改
|
||||||
@@ -24,10 +28,10 @@ export const deleteSchool = async (id) => {
|
|||||||
return await request.delete({ url: '/admin-api/crm/sch-school/delete?id=' + id })
|
return await request.delete({ url: '/admin-api/crm/sch-school/delete?id=' + id })
|
||||||
}
|
}
|
||||||
|
|
||||||
export const updateSchoolStatus = async (id, status) => {
|
export const updateSchoolStatus = async (schoolId, status) => {
|
||||||
const data = {
|
const data = {
|
||||||
id,
|
schoolId,
|
||||||
status
|
status
|
||||||
}
|
}
|
||||||
return request.put({ url: '/admin-api/crm/sch-school/update-status', data: data })
|
return request.put({ url: '/admin-api/crm/sch-school/status/update', data: data })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ watch(
|
|||||||
(options) => {
|
(options) => {
|
||||||
if (echartRef) {
|
if (echartRef) {
|
||||||
echartRef?.setOption(options)
|
echartRef?.setOption(options)
|
||||||
|
resizeHandler()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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)
|
formModel.value = Object.assign(unref(formModel), data)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,6 +236,7 @@ export default defineComponent({
|
|||||||
vModel={formModel.value[item.field]}
|
vModel={formModel.value[item.field]}
|
||||||
{...(autoSetPlaceholder && setTextPlaceholder(item))}
|
{...(autoSetPlaceholder && setTextPlaceholder(item))}
|
||||||
{...setComponentProps(item)}
|
{...setComponentProps(item)}
|
||||||
|
filterable
|
||||||
format={item.component == 'DatePicker' ? 'YYYY-MM-DD' : null}
|
format={item.component == 'DatePicker' ? 'YYYY-MM-DD' : null}
|
||||||
value-format={item.component == 'DatePicker' ? 'YYYY-MM-DD' : null}
|
value-format={item.component == 'DatePicker' ? 'YYYY-MM-DD' : null}
|
||||||
style={baseSty + item.componentProps?.style}
|
style={baseSty + item.componentProps?.style}
|
||||||
|
|||||||
@@ -59,6 +59,11 @@ const usedSchema = ref([])
|
|||||||
|
|
||||||
const newSchema = computed(() => {
|
const newSchema = computed(() => {
|
||||||
let schema: FormSchema[] = cloneDeep(usedSchema.value)
|
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)) {
|
if (props.expand && props.expandField && !unref(visible)) {
|
||||||
const index = findIndex(schema, (v: FormSchema) => v.field === props.expandField)
|
const index = findIndex(schema, (v: FormSchema) => v.field === props.expandField)
|
||||||
if (index > -1) {
|
if (index > -1) {
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ const props = defineProps({
|
|||||||
modelValue: propTypes.oneOfType<string | string[]>([String, Array<String>]).isRequired,
|
modelValue: propTypes.oneOfType<string | string[]>([String, Array<String>]).isRequired,
|
||||||
title: propTypes.string.def('文件上传'),
|
title: propTypes.string.def('文件上传'),
|
||||||
updateUrl: propTypes.string.def(import.meta.env.VITE_UPLOAD_URL),
|
updateUrl: propTypes.string.def(import.meta.env.VITE_UPLOAD_URL),
|
||||||
fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf']), // 文件类型, 例如['png', 'jpg', 'jpeg']
|
// fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf']), // 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||||
|
fileType: propTypes.array.def([]),
|
||||||
accept: propTypes.string.def('*'),
|
accept: propTypes.string.def('*'),
|
||||||
fileSize: propTypes.number.def(5), // 大小限制(MB)
|
fileSize: propTypes.number.def(5), // 大小限制(MB)
|
||||||
limit: propTypes.number.def(5), // 数量限制
|
limit: propTypes.number.def(5), // 数量限制
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const config: {
|
|||||||
/**
|
/**
|
||||||
* api请求基础路径
|
* api请求基础路径
|
||||||
*/
|
*/
|
||||||
base_url: 'http://localhost' + import.meta.env.VITE_API_BASEPATH,
|
base_url: import.meta.env.VITE_API_BASEPATH,
|
||||||
/**
|
/**
|
||||||
* 接口成功返回状态码
|
* 接口成功返回状态码
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -5,10 +5,11 @@ import { config } from './config'
|
|||||||
const { default_headers } = config
|
const { default_headers } = config
|
||||||
|
|
||||||
const request = (option: any) => {
|
const request = (option: any) => {
|
||||||
const { url, method, params, data, headersType, responseType } = option
|
const { url, method, params, data, headersType, responseType, isSubmitForm } = option
|
||||||
return service({
|
return service({
|
||||||
url: url,
|
url: url,
|
||||||
method,
|
method,
|
||||||
|
isSubmitForm,
|
||||||
params,
|
params,
|
||||||
data,
|
data,
|
||||||
responseType: responseType,
|
responseType: responseType,
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import errorCode from './errorCode'
|
|||||||
|
|
||||||
import { resetRouter } from '@/router'
|
import { resetRouter } from '@/router'
|
||||||
import { useCache } from '@/hooks/web/useCache'
|
import { useCache } from '@/hooks/web/useCache'
|
||||||
|
import cache from '@/plugins/cache'
|
||||||
|
|
||||||
const { result_code, base_url, request_timeout } = config
|
const { result_code, base_url, request_timeout } = config
|
||||||
|
|
||||||
@@ -62,15 +63,11 @@ service.interceptors.request.use(
|
|||||||
}
|
}
|
||||||
// 设置租户
|
// 设置租户
|
||||||
const tenantId = getTenantId()
|
const tenantId = getTenantId()
|
||||||
if (tenantId) {
|
if (tenantId) (config as Recordable).headers['tenant-id'] = tenantId
|
||||||
;(config as Recordable).headers['tenant-id'] = tenantId
|
|
||||||
}
|
|
||||||
|
|
||||||
// 设置实例
|
// 设置实例
|
||||||
const appId = getAppId()
|
const appId = getAppId()
|
||||||
if (appId) {
|
if (appId) (config as Recordable).headers['instance-id'] = appId
|
||||||
;(config as Recordable).headers['instance-id'] = appId
|
|
||||||
}
|
|
||||||
|
|
||||||
const params = config.params || {}
|
const params = config.params || {}
|
||||||
const data = config.data || false
|
const data = config.data || false
|
||||||
@@ -83,27 +80,39 @@ service.interceptors.request.use(
|
|||||||
}
|
}
|
||||||
// get参数编码
|
// get参数编码
|
||||||
if (config.method?.toUpperCase() === 'GET' && params) {
|
if (config.method?.toUpperCase() === 'GET' && params) {
|
||||||
let url = config.url + '?'
|
config.params = {}
|
||||||
for (const propName of Object.keys(params)) {
|
const paramsStr = qs.stringify(params, { allowDots: true })
|
||||||
const value = params[propName]
|
if (paramsStr) {
|
||||||
if (value !== void 0 && value !== null && typeof value !== 'undefined') {
|
config.url = config.url + '?' + paramsStr
|
||||||
if (typeof value === 'object') {
|
}
|
||||||
for (const val of Object.keys(value)) {
|
}
|
||||||
const params = propName + '[' + val + ']'
|
// 是否提交表单型的接口,如果是,不要频繁调接口
|
||||||
const subPart = encodeURIComponent(params) + '='
|
if (config?.isSubmitForm) {
|
||||||
url += subPart + encodeURIComponent(value[val]) + '&'
|
const requestObj = {
|
||||||
}
|
url: config.url,
|
||||||
} else {
|
data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
|
||||||
url += `${propName}=${encodeURIComponent(value)}&`
|
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
|
return config
|
||||||
},
|
},
|
||||||
@@ -199,6 +208,20 @@ service.interceptors.response.use(
|
|||||||
console.log(msg)
|
console.log(msg)
|
||||||
} else {
|
} else {
|
||||||
ElNotification.error({ title: msg })
|
ElNotification.error({ title: msg })
|
||||||
|
if (code == 403) {
|
||||||
|
ElMessageBox.confirm(`${msg},是否重新登陆`, '提示', {
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
// 无访问权限,退出登录
|
||||||
|
const { wsCache } = useCache()
|
||||||
|
const tenantId = wsCache.get('TENANT_ID')
|
||||||
|
const appId = wsCache.get('App_ID')
|
||||||
|
resetRouter() // 重置静态路由表
|
||||||
|
wsCache.clear()
|
||||||
|
removeToken()
|
||||||
|
window.location.href = `/crm/login?tenantId=${tenantId}&appId=${appId}`
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return Promise.reject('error')
|
return Promise.reject('error')
|
||||||
} else {
|
} else {
|
||||||
@@ -245,7 +268,7 @@ const handleAuthorized = () => {
|
|||||||
isRelogin.show = false
|
isRelogin.show = false
|
||||||
// 干掉token后再走一次路由让它过router.beforeEach的校验
|
// 干掉token后再走一次路由让它过router.beforeEach的校验
|
||||||
// window.location.href = window.location.href
|
// window.location.href = window.location.href
|
||||||
window.location.href = `/login?tenantId=${tenantId}&appId=${appId}`
|
window.location.href = `/crm/login?tenantId=${tenantId}&appId=${appId}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return Promise.reject(t('sys.api.timeoutMessage'))
|
return Promise.reject(t('sys.api.timeoutMessage'))
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ export function useWatermark(appendEl: HTMLElement | null = document.body) {
|
|||||||
clear()
|
clear()
|
||||||
|
|
||||||
const can = document.createElement('canvas')
|
const can = document.createElement('canvas')
|
||||||
can.width = 300
|
can.width = 500
|
||||||
can.height = 240
|
can.height = 240
|
||||||
|
|
||||||
const cans = can.getContext('2d')
|
const cans = can.getContext('2d')
|
||||||
if (cans) {
|
if (cans) {
|
||||||
cans.rotate((-20 * Math.PI) / 120)
|
cans.rotate((-20 * Math.PI) / 120)
|
||||||
cans.font = '15px Vedana'
|
cans.font = '15px Vedana'
|
||||||
cans.fillStyle = 'rgba(0, 0, 0, 0.15)'
|
cans.fillStyle = 'rgba(0, 0, 0, 0.05)'
|
||||||
cans.textAlign = 'left'
|
cans.textAlign = 'left'
|
||||||
cans.textBaseline = 'middle'
|
cans.textBaseline = 'middle'
|
||||||
cans.fillText(str, can.width / 20, can.height)
|
cans.fillText(str, can.width / 20, can.height)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const getUnreadCount = async () => {
|
|||||||
// 跳转我的站内信
|
// 跳转我的站内信
|
||||||
const goMyList = () => {
|
const goMyList = () => {
|
||||||
push({
|
push({
|
||||||
name: 'MyNotifyMessage'
|
name: 'NotifyMessage'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,9 +34,9 @@ onMounted(() => {
|
|||||||
// 首次加载小红点
|
// 首次加载小红点
|
||||||
getUnreadCount()
|
getUnreadCount()
|
||||||
// 轮询刷新小红点
|
// 轮询刷新小红点
|
||||||
msgInterval.value = setInterval(() => {
|
// msgInterval.value = setInterval(() => {
|
||||||
getUnreadCount()
|
// getUnreadCount()
|
||||||
}, 1000 * 60 * 2)
|
// }, 1000 * 60 * 2)
|
||||||
})
|
})
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
|||||||
@@ -12,6 +12,13 @@ import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
|
|||||||
import ColorRadioPicker from './components/ColorRadioPicker.vue'
|
import ColorRadioPicker from './components/ColorRadioPicker.vue'
|
||||||
// import InterfaceDisplay from './components/InterfaceDisplay.vue'
|
// import InterfaceDisplay from './components/InterfaceDisplay.vue'
|
||||||
// import LayoutRadioPicker from './components/LayoutRadioPicker.vue'
|
// import LayoutRadioPicker from './components/LayoutRadioPicker.vue'
|
||||||
|
import { useWatermark } from '@/hooks/web/useWatermark'
|
||||||
|
|
||||||
|
const { setWatermark } = useWatermark()
|
||||||
|
|
||||||
|
nextTick(() => {
|
||||||
|
setWatermark('安徽莳松科技有限公司')
|
||||||
|
})
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
@@ -198,6 +205,7 @@ const clear = () => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
|
v-if="false"
|
||||||
:class="prefixCls"
|
:class="prefixCls"
|
||||||
class="fixed top-[45%] right-0 w-40px h-40px text-center leading-40px bg-[var(--el-color-primary)] cursor-pointer"
|
class="fixed top-[45%] right-0 w-40px h-40px text-center leading-40px bg-[var(--el-color-primary)] cursor-pointer"
|
||||||
@click="drawer = true"
|
@click="drawer = true"
|
||||||
@@ -205,7 +213,9 @@ const clear = () => {
|
|||||||
<Icon color="#fff" icon="ep:setting" />
|
<Icon color="#fff" icon="ep:setting" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ElDrawer v-model="drawer" :z-index="4000" direction="rtl" size="350px">
|
<div @click="drawer = true">主题配置</div>
|
||||||
|
|
||||||
|
<ElDrawer v-model="drawer" :z-index="4000" append-to-body direction="rtl" size="350px">
|
||||||
<template #header>
|
<template #header>
|
||||||
<span class="text-16px font-700">{{ t('setting.projectSetting') }}</span>
|
<span class="text-16px font-700">{{ t('setting.projectSetting') }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -124,7 +124,6 @@ const fixedMenuChange = (show: boolean) => {
|
|||||||
const setWater = () => {
|
const setWater = () => {
|
||||||
setWatermark(water.value)
|
setWatermark(water.value)
|
||||||
}
|
}
|
||||||
setWater()
|
|
||||||
|
|
||||||
const layout = computed(() => appStore.getLayout)
|
const layout = computed(() => appStore.getLayout)
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import { useUserStore } from '@/store/modules/user'
|
|||||||
import { useTagsViewStore } from '@/store/modules/tagsView'
|
import { useTagsViewStore } from '@/store/modules/tagsView'
|
||||||
import { getTenantId, getAppId } from '@/utils/auth'
|
import { getTenantId, getAppId } from '@/utils/auth'
|
||||||
|
|
||||||
|
import { Setting } from '@/layout/components/Setting'
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
const { wsCache } = useCache()
|
const { wsCache } = useCache()
|
||||||
@@ -58,6 +60,10 @@ const toProfile = async () => {
|
|||||||
</div>
|
</div>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<ElDropdownMenu>
|
<ElDropdownMenu>
|
||||||
|
<ElDropdownItem>
|
||||||
|
<Icon icon="ep:tools" />
|
||||||
|
<Setting />
|
||||||
|
</ElDropdownItem>
|
||||||
<ElDropdownItem>
|
<ElDropdownItem>
|
||||||
<Icon icon="ep:tools" />
|
<Icon icon="ep:tools" />
|
||||||
<div @click="toProfile">{{ t('common.profile') }}</div>
|
<div @click="toProfile">{{ t('common.profile') }}</div>
|
||||||
|
|||||||
@@ -54,9 +54,9 @@ router.beforeEach(async (to, from, next) => {
|
|||||||
const tenantId = getTenantId()
|
const tenantId = getTenantId()
|
||||||
const appId = getAppId()
|
const appId = getAppId()
|
||||||
if (tenantId && appId) {
|
if (tenantId && appId) {
|
||||||
next(`/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
next(`/crm/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||||
} else {
|
} else {
|
||||||
next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
next(`/crm/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import remainingRouter from './modules/remaining'
|
|||||||
|
|
||||||
// 创建路由实例
|
// 创建路由实例
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(), // createWebHashHistory URL带#,createWebHistory URL不带#
|
history: createWebHistory(import.meta.env.VITE_BASE_PATH), // createWebHashHistory URL带#,createWebHistory URL不带#
|
||||||
strict: true,
|
strict: true,
|
||||||
routes: remainingRouter as RouteRecordRaw[],
|
routes: remainingRouter as RouteRecordRaw[],
|
||||||
scrollBehavior: () => ({ left: 0, top: 0 })
|
scrollBehavior: () => ({ left: 0, top: 0 })
|
||||||
|
|||||||
@@ -94,8 +94,8 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'notify-message',
|
path: 'notify-message',
|
||||||
component: () => import('@/views/system/notify/my/index.vue'),
|
component: () => import('@/views/Profile/NotifyMessage.vue'),
|
||||||
name: 'MyNotifyMessage',
|
name: 'NotifyMessage',
|
||||||
meta: {
|
meta: {
|
||||||
canTo: true,
|
canTo: true,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ export const fenToYuan = (amount: string | number): number => {
|
|||||||
export const removeNullField = (obj: Object) => {
|
export const removeNullField = (obj: Object) => {
|
||||||
for (const key in obj) {
|
for (const key in obj) {
|
||||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||||
if (obj[key] == '') {
|
if (obj[key] === '') {
|
||||||
delete obj[key]
|
delete obj[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,10 @@
|
|||||||
/>
|
/>
|
||||||
<span>使用外呼</span>
|
<span>使用外呼</span>
|
||||||
</template>
|
</template>
|
||||||
<el-radio-group v-model="form.usePhoneConfig">
|
<el-radio-group
|
||||||
|
v-model="form.usePhoneConfig"
|
||||||
|
:disabled="!getConfig('usePhoneConfig').modifiable"
|
||||||
|
>
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="(item, index) in getConfig('usePhoneConfig').options"
|
v-for="(item, index) in getConfig('usePhoneConfig').options"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="files" label="附件">
|
<el-table-column prop="files" label="附件">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-link type="primary" underline :href="row.fileUrl" target="_blank">
|
<el-link type="primary" underline target="_blank" @click="handleDownload(row.files)">
|
||||||
{{ row.files }}
|
{{ row.files }}
|
||||||
</el-link>
|
</el-link>
|
||||||
</template>
|
</template>
|
||||||
@@ -195,6 +195,16 @@ function handleClickLib(index) {
|
|||||||
getResourceList()
|
getResourceList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleDownload(href) {
|
||||||
|
if (href) {
|
||||||
|
let a = document.createElement('a')
|
||||||
|
a.download = href //指定下载的文件名
|
||||||
|
a.href = href // URL对象
|
||||||
|
a.click() // 模拟点击
|
||||||
|
URL.revokeObjectURL(a.href) // 释放URL 对象
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function openResource(type, id) {
|
function openResource(type, id) {
|
||||||
resourceDialog.value.open(type, libraryList.value[libraryIndex.value], id)
|
resourceDialog.value.open(type, libraryList.value[libraryIndex.value], id)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,7 +107,14 @@ const dataScopeOptions = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
async function getRoleInfo(id) {
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 提交表单 */
|
/** 提交表单 */
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
>
|
>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="用户昵称" prop="nickname">
|
<el-form-item label="用户姓名" prop="nickname">
|
||||||
<el-input v-model="formData.nickname" placeholder="请输入用户昵称" />
|
<el-input v-model="formData.nickname" placeholder="请输入用户姓名" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -69,8 +69,8 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item v-if="formData.id === undefined" label="用户名称" prop="username">
|
<el-form-item v-if="formData.id === undefined" label="登录账号" prop="username">
|
||||||
<el-input v-model="formData.username" placeholder="请输入用户名称" />
|
<el-input v-model="formData.username" placeholder="请输入登录账号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -142,8 +142,8 @@ const formData = ref({
|
|||||||
hireDate: ''
|
hireDate: ''
|
||||||
})
|
})
|
||||||
const formRules = ref<any>({
|
const formRules = ref<any>({
|
||||||
username: [{ required: true, message: '用户名称不能为空', trigger: 'blur' }],
|
username: [{ required: true, message: '登录账号不能为空', trigger: 'blur' }],
|
||||||
nickname: [{ required: true, message: '用户昵称不能为空', trigger: 'blur' }],
|
nickname: [{ required: true, message: '用户姓名不能为空', trigger: 'blur' }],
|
||||||
password: [{ required: true, message: '用户密码不能为空', trigger: 'blur' }],
|
password: [{ required: true, message: '用户密码不能为空', trigger: 'blur' }],
|
||||||
email: [
|
email: [
|
||||||
{
|
{
|
||||||
@@ -152,13 +152,7 @@ const formRules = ref<any>({
|
|||||||
trigger: ['blur', 'change']
|
trigger: ['blur', 'change']
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
mobile: [
|
mobile: [{ required: true, message: '手机号不能为空', trigger: 'blur' }]
|
||||||
{
|
|
||||||
pattern: /^(?:(?:\+|00)86)?1(?:3[\d]|4[5-79]|5[0-35-9]|6[5-7]|7[0-8]|8[\d]|9[189])\d{8}$/,
|
|
||||||
message: '请输入正确的手机号码',
|
|
||||||
trigger: 'blur'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
})
|
})
|
||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
const deptList = ref<Tree[]>([]) // 树形结构
|
const deptList = ref<Tree[]>([]) // 树形结构
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
<el-col :span="20" :xs="24">
|
<el-col :span="20" :xs="24">
|
||||||
<!-- 搜索 -->
|
<!-- 搜索 -->
|
||||||
<el-form :model="queryParams" ref="queryFormRef" inline label-width="68px">
|
<el-form :model="queryParams" ref="queryFormRef" inline label-width="68px">
|
||||||
<el-form-item label="用户名称" prop="username">
|
<el-form-item label="登录账号" prop="username">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.username"
|
v-model="queryParams.username"
|
||||||
placeholder="请输入用户名称"
|
placeholder="请输入登录账号"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter="handleQuery"
|
@keyup.enter="handleQuery"
|
||||||
class="!w-240px"
|
class="!w-240px"
|
||||||
@@ -40,8 +40,8 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
<el-table v-loading="loading" :data="list">
|
<el-table v-loading="loading" :data="list">
|
||||||
<el-table-column label="用户编号" key="id" prop="id" />
|
<el-table-column label="用户编号" key="id" prop="id" />
|
||||||
<el-table-column label="用户名称" prop="username" />
|
<el-table-column label="登录账号" prop="username" />
|
||||||
<el-table-column label="用户昵称" prop="nickname" />
|
<el-table-column label="用户姓名" prop="nickname" />
|
||||||
<el-table-column label="部门" key="deptName" prop="deptName" />
|
<el-table-column label="部门" key="deptName" prop="deptName" />
|
||||||
<el-table-column label="手机号码" prop="mobile" width="120" />
|
<el-table-column label="手机号码" prop="mobile" width="120" />
|
||||||
<el-table-column label="状态" key="status">
|
<el-table-column label="状态" key="status">
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|||||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
if (!formRef) return
|
if (!formRef.value) return
|
||||||
const valid = await formRef.value.validate()
|
const valid = await formRef.value.validate()
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
// 提交请求
|
// 提交请求
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
|||||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||||
const submitForm = async () => {
|
const submitForm = async () => {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
if (!formRef) return
|
if (!formRef.value) return
|
||||||
const valid = await formRef.value.validate()
|
const valid = await formRef.value.validate()
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
// 提交请求
|
// 提交请求
|
||||||
|
|||||||
@@ -32,8 +32,8 @@
|
|||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
range-separator="-"
|
range-separator="-"
|
||||||
start-placeholder="登记日期"
|
start-placeholder="成交日期"
|
||||||
end-placeholder="登记日期"
|
end-placeholder="成交日期"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@@ -79,9 +79,19 @@
|
|||||||
<el-table-column prop="isReturns" label="是否退货" min-width="90px" />
|
<el-table-column prop="isReturns" label="是否退货" min-width="90px" />
|
||||||
<el-table-column prop="solution" label="解决方案" min-width="150px" />
|
<el-table-column prop="solution" label="解决方案" min-width="150px" />
|
||||||
<el-table-column prop="signUserName" label="登记人" min-width="90px" />
|
<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="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 prop="stateName" label="审核状态" fixed="right" min-width="90px" />
|
||||||
<el-table-column label="操作" width="150px" fixed="right">
|
<el-table-column label="操作" width="150px" fixed="right">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
@@ -132,6 +142,8 @@ import DialogAfterSaleAudit from './DialogAfterSaleAudit.vue'
|
|||||||
import DialogAfterSaleDetail from './DialogAfterSaleDetail.vue'
|
import DialogAfterSaleDetail from './DialogAfterSaleDetail.vue'
|
||||||
import DialogBatchAudit from './DialogBatchAudit.vue'
|
import DialogBatchAudit from './DialogBatchAudit.vue'
|
||||||
|
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
|
||||||
const afterSaleAuditDialog = ref()
|
const afterSaleAuditDialog = ref()
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
|||||||
@@ -24,15 +24,16 @@
|
|||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
range-separator="-"
|
range-separator="-"
|
||||||
start-placeholder="登记日期"
|
start-placeholder="成交日期"
|
||||||
end-placeholder="登记日期"
|
end-placeholder="成交日期"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.signProduct"
|
v-model="searchForm.productId"
|
||||||
placeholder="选择成交产品"
|
placeholder="选择成交产品"
|
||||||
filterable
|
filterable
|
||||||
|
clearable
|
||||||
@change="searchForm.specsId = undefined"
|
@change="searchForm.specsId = undefined"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@@ -48,10 +49,11 @@
|
|||||||
v-model="searchForm.specsId"
|
v-model="searchForm.specsId"
|
||||||
placeholder="选择规格"
|
placeholder="选择规格"
|
||||||
filterable
|
filterable
|
||||||
:disabled="!searchForm.signProduct"
|
clearable
|
||||||
|
:disabled="!searchForm.productId"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in specsOptions(searchForm.signProduct)"
|
v-for="item in specsOptions(searchForm.productId)"
|
||||||
:key="item.specsId"
|
:key="item.specsId"
|
||||||
:label="item.specsName"
|
:label="item.specsName"
|
||||||
:value="item.specsId"
|
:value="item.specsId"
|
||||||
@@ -65,21 +67,36 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="tableList" border>
|
<el-table v-loading="loading" :data="tableList" border>
|
||||||
<el-table-column prop="signId" label="成交单号" min-width="150px" />
|
<el-table-column prop="signId" label="成交单号" min-width="120px" />
|
||||||
<el-table-column prop="name" label="线索名称" min-width="200px" />
|
<el-table-column prop="name" label="线索名称" min-width="120px" />
|
||||||
<el-table-column prop="phone" label="联系方式" min-width="150px" />
|
<el-table-column prop="phone" label="联系方式" width="120px" />
|
||||||
<el-table-column prop="signUserName" 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="成交日期" width="120px" :formatter="dateFormatter" />
|
||||||
<el-table-column prop="" label="成交产品" min-width="150px" />
|
<el-table-column prop="productName" label="成交产品" min-width="150px" />
|
||||||
<el-table-column prop="" label="产品规格" min-width="150px" />
|
<el-table-column prop="specsName" label="产品规格" min-width="150px" />
|
||||||
<el-table-column prop="" label="发货时间" min-width="150px" />
|
<el-table-column prop="signNum" label="销售数量" width="90px" />
|
||||||
<el-table-column prop="" label="发货仓库" min-width="100px" />
|
<el-table-column
|
||||||
<el-table-column prop="" label="备注" min-width="100px" />
|
prop="createTime"
|
||||||
<el-table-column label="操作" width="150px" fixed="right">
|
label="发货时间"
|
||||||
<template #default="{ row }">
|
width="120px"
|
||||||
<el-button type="primary" style="padding: 0" text @click="handleDetail(row.id)">
|
:formatter="dateFormatter"
|
||||||
详情
|
/>
|
||||||
</el-button>
|
<el-table-column prop="batchNo" label="发货批次" min-width="120px" />
|
||||||
|
<el-table-column prop="warehouseName" label="发货仓库" min-width="120px" />
|
||||||
|
<el-table-column prop="sendNum" label="发货数量" width="90px" />
|
||||||
|
<el-table-column label="发货备注">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-popover
|
||||||
|
placement="top"
|
||||||
|
width="500px"
|
||||||
|
trigger="click"
|
||||||
|
v-if="scope.row.warehouseName && 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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -95,6 +112,9 @@
|
|||||||
<script setup name="Delivery">
|
<script setup name="Delivery">
|
||||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||||
import { getSimpleProductList } from '@/api/mall/product'
|
import { getSimpleProductList } from '@/api/mall/product'
|
||||||
|
import * as DeliveryApi from '@/api/clue/delivery'
|
||||||
|
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
// const message = useMessage() // 消息弹窗
|
// const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
const searchForm = ref({
|
const searchForm = ref({
|
||||||
@@ -102,6 +122,8 @@ const searchForm = ref({
|
|||||||
name: undefined,
|
name: undefined,
|
||||||
dealDate: [],
|
dealDate: [],
|
||||||
signUser: undefined,
|
signUser: undefined,
|
||||||
|
productId: undefined,
|
||||||
|
specsId: undefined,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 20
|
pageSize: 20
|
||||||
})
|
})
|
||||||
@@ -122,6 +144,8 @@ function handleReset() {
|
|||||||
name: undefined,
|
name: undefined,
|
||||||
dealDate: [],
|
dealDate: [],
|
||||||
signUser: undefined,
|
signUser: undefined,
|
||||||
|
productId: undefined,
|
||||||
|
specsId: undefined,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 20
|
pageSize: 20
|
||||||
}
|
}
|
||||||
@@ -131,19 +155,14 @@ const loading = ref(false)
|
|||||||
async function getList() {
|
async function getList() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
tableList.value = []
|
const data = await DeliveryApi.getDeliveryPage(searchForm.value)
|
||||||
// const data = await FeebackApi.getPaymentPage(searchForm.value)
|
tableList.value = data.list
|
||||||
// tableList.value = data.list
|
total.value = data.total
|
||||||
// total.value = data.total
|
|
||||||
} finally {
|
} finally {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleDetail(id) {
|
|
||||||
console.log(id)
|
|
||||||
}
|
|
||||||
|
|
||||||
const prodOptions = ref([])
|
const prodOptions = ref([])
|
||||||
|
|
||||||
const specsOptions = computed({
|
const specsOptions = computed({
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ const schema = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'dealDate',
|
field: 'dealDate',
|
||||||
label: '登记时间',
|
label: '成交日期',
|
||||||
|
dateFormat: 'YYYY-MM-DD',
|
||||||
span: 1
|
span: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -75,6 +76,7 @@ const schema = [
|
|||||||
{
|
{
|
||||||
field: 'applyTime',
|
field: 'applyTime',
|
||||||
label: '申请时间',
|
label: '申请时间',
|
||||||
|
dateFormat: 'YYYY-MM-DD',
|
||||||
span: 1
|
span: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ const applySchema = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'dealDate',
|
field: 'dealDate',
|
||||||
label: '登记时间',
|
label: '成交日期',
|
||||||
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
dateFormat: 'YYYY-MM-DD',
|
||||||
span: 1
|
span: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -72,7 +72,7 @@ const applySchema = [
|
|||||||
{
|
{
|
||||||
field: 'applyTime',
|
field: 'applyTime',
|
||||||
label: '申请时间',
|
label: '申请时间',
|
||||||
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
dateFormat: 'YYYY-MM-DD',
|
||||||
span: 1
|
span: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,16 +1,103 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog title="发货" v-model="show" width="600px">
|
<el-dialog title="发货" v-model="show" width="700px">
|
||||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px">
|
<el-form :model="form" ref="formRef" :rules="rules" label-width="85px">
|
||||||
<el-form-item label="发货仓库" prop="warehouseId">
|
<el-row :gutter="20">
|
||||||
<el-select v-model="form.warehouseId" placeholder="选择仓库" filterable>
|
<el-col :span="8" :offset="0">
|
||||||
<el-option
|
<el-form-item label="待发数量">
|
||||||
v-for="item in warehouseOptions"
|
<span class="font-bold">:{{ form.sendTotalNum }}</span>
|
||||||
:key="item.warehouseId"
|
</el-form-item>
|
||||||
:label="item.warehouseName"
|
</el-col>
|
||||||
:value="item.warehouseId"
|
<el-col :span="16" :offset="0">
|
||||||
/>
|
<el-form-item label="发货方式">
|
||||||
</el-select>
|
<el-radio-group v-model="form.sendType" :disabled="autoAuditPurchase == 'false'">
|
||||||
</el-form-item>
|
<el-radio :label="1">
|
||||||
|
<Tooltip
|
||||||
|
message="必须在进销存的“通用配置-常规配置”中,将 ’采购申请自动通过‘ 设置为“是”"
|
||||||
|
/>
|
||||||
|
立即采购发货
|
||||||
|
</el-radio>
|
||||||
|
<el-radio :label="2"> 使用库存发货 </el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<template v-if="form.sendType == 1">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="供应商" prop="supplier">
|
||||||
|
<el-select v-model="form.supplier" placeholder="选择供应商" filterable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in supplierOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="采购数量" prop="num">
|
||||||
|
<el-input-number
|
||||||
|
:min="form.sendTotalNum"
|
||||||
|
v-model="form.num"
|
||||||
|
:controls="false"
|
||||||
|
placeholder="请输入"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="采购单价" prop="unitPrice">
|
||||||
|
<el-input-number
|
||||||
|
:min="0"
|
||||||
|
:controls="false"
|
||||||
|
v-model="form.unitPrice"
|
||||||
|
placeholder="请输入"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12" :offset="0">
|
||||||
|
<el-form-item label="存放仓库" prop="warehouseId">
|
||||||
|
<el-select
|
||||||
|
v-model="form.warehouseId"
|
||||||
|
placeholder="请选择"
|
||||||
|
filterable
|
||||||
|
style="width: 100%"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in warehouseOptions"
|
||||||
|
:key="item.warehouseId"
|
||||||
|
:label="item.warehouseName"
|
||||||
|
:value="item.warehouseId"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<el-table :data="inventoryList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column prop="batchNo" label="入库批次号" width="150px" />
|
||||||
|
<el-table-column prop="warehouseName" label="存放仓库" width="120px" />
|
||||||
|
<el-table-column prop="price" label="采购价" width="90px" />
|
||||||
|
<el-table-column prop="num" label="剩余库存" width="90px" />
|
||||||
|
<el-table-column label="发货数量">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-input-number
|
||||||
|
v-model="row.sendNum"
|
||||||
|
size="small"
|
||||||
|
:min="1"
|
||||||
|
:max="row.num"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</template>
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
<Editor v-model:modelValue="form.remark" />
|
<Editor v-model:modelValue="form.remark" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -25,20 +112,32 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="DialogDelivery">
|
<script setup name="DialogDelivery">
|
||||||
import { getSimpleWarehouseList } from '@/api/mall/warehouse'
|
import { getSimpleWarehouseList, getRemainInventoryList } from '@/api/mall/warehouse'
|
||||||
import { createDelivery } from '@/api/clue/delivery'
|
import { createDelivery } from '@/api/clue/delivery'
|
||||||
|
import { getConfigList } from '@/api/system/set'
|
||||||
|
import { getDictOptions } from '@/utils/dict'
|
||||||
|
|
||||||
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
const warehouseOptions = ref([])
|
const warehouseOptions = ref([])
|
||||||
|
const supplierOptions = getDictOptions('erp_supplier')
|
||||||
function getOptions() {
|
function getOptions() {
|
||||||
getSimpleWarehouseList().then((data) => {
|
getSimpleWarehouseList().then((data) => {
|
||||||
warehouseOptions.value = data
|
warehouseOptions.value = data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getRemainInventory(signProductId) {
|
||||||
|
getRemainInventoryList({ signProductId }).then((data) => {
|
||||||
|
inventoryList.value = data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const show = ref(false)
|
const show = ref(false)
|
||||||
function open(id) {
|
function open(row) {
|
||||||
show.value = true
|
show.value = true
|
||||||
resetForm(id)
|
resetForm(row)
|
||||||
|
getRemainInventory(row.id)
|
||||||
}
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open
|
open
|
||||||
@@ -46,27 +145,75 @@ defineExpose({
|
|||||||
|
|
||||||
const form = ref({})
|
const form = ref({})
|
||||||
const rules = ref({
|
const rules = ref({
|
||||||
|
supplier: { required: true, message: '供应商不可为空', trigger: 'change' },
|
||||||
|
warehouseId: { required: true, message: '仓库不可为空', trigger: 'change' },
|
||||||
|
num: { required: true, message: '采购数量不可为空', trigger: 'change,blur' },
|
||||||
|
unitPrice: { required: true, message: '采购单价不可为空', trigger: 'change,blur' },
|
||||||
warehouseId: { required: true, message: '仓库不可为空', trigger: 'change' }
|
warehouseId: { required: true, message: '仓库不可为空', trigger: 'change' }
|
||||||
})
|
})
|
||||||
function resetForm(id) {
|
function resetForm(row) {
|
||||||
form.value = {
|
form.value = {
|
||||||
signId: id,
|
sendType: 2,
|
||||||
|
sendTotalNum: row.signNum,
|
||||||
|
signProductId: row.id,
|
||||||
|
productId: row.productId,
|
||||||
|
specsId: row.specsId,
|
||||||
warehouseId: undefined,
|
warehouseId: undefined,
|
||||||
|
supplier: undefined,
|
||||||
|
num: row.signNum,
|
||||||
|
unitPrice: undefined,
|
||||||
remark: undefined
|
remark: undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const emit = defineEmits(['success'])
|
const emit = defineEmits(['success'])
|
||||||
const formLoading = ref(false)
|
const formLoading = ref(false)
|
||||||
|
const formRef = ref()
|
||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
if (!formRef.value) return
|
if (!formRef.value) return
|
||||||
const valid = await formRef.value.validate()
|
|
||||||
if (!valid) return
|
if (form.value.sendType == 1) {
|
||||||
|
const valid = await formRef.value.validate()
|
||||||
|
if (!valid) return
|
||||||
|
} else {
|
||||||
|
if (!deliveryArr.value.length) {
|
||||||
|
message.info('请选择库存发货!')
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
const deliveryCount = deliveryArr.value.reduce((pre, cur) => pre + cur.sendNum, 0)
|
||||||
|
if (deliveryCount < form.value.sendTotalNum) {
|
||||||
|
message.info('所选发货库存少于待发货数量,请重新选择后再发货!')
|
||||||
|
return
|
||||||
|
} else if (deliveryCount > form.value.sendTotalNum) {
|
||||||
|
message.info('所选发货库存多于待发货数量,请重新选择后再发货!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 提交请求
|
// 提交请求
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
await createDelivery(form.value)
|
let params = {
|
||||||
|
signProductId: form.value.signProductId,
|
||||||
|
sendType: form.value.sendType,
|
||||||
|
remark: form.value.remark
|
||||||
|
}
|
||||||
|
if (params.sendType == 1) {
|
||||||
|
params.purchaseOrder = {
|
||||||
|
productId: form.value.productId,
|
||||||
|
specsId: form.value.specsId,
|
||||||
|
supplier: form.value.supplier,
|
||||||
|
num: form.value.num,
|
||||||
|
unitPrice: form.value.unitPrice,
|
||||||
|
warehouseId: form.value.warehouseId
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
params.detailList = inventoryList.value
|
||||||
|
}
|
||||||
|
|
||||||
|
await createDelivery(params)
|
||||||
message.success('发货成功!')
|
message.success('发货成功!')
|
||||||
show.value = false
|
show.value = false
|
||||||
emit('success')
|
emit('success')
|
||||||
@@ -75,8 +222,22 @@ async function onSubmit() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const inventoryList = ref([])
|
||||||
|
|
||||||
|
const deliveryArr = ref([])
|
||||||
|
function handleSelectionChange(val) {
|
||||||
|
deliveryArr.value = val
|
||||||
|
}
|
||||||
|
|
||||||
|
const autoAuditPurchase = ref('false')
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getOptions()
|
getOptions()
|
||||||
|
getConfigList({ module: 3 }).then((data) => {
|
||||||
|
// 获取所有配置项
|
||||||
|
autoAuditPurchase.value = data.find(
|
||||||
|
(it) => it.configKey == 'purchaseAuditAutoCompleteConfig'
|
||||||
|
).configValue
|
||||||
|
})
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
form.extraPay.push({
|
form.extraPay.push({
|
||||||
extraPayType: undefined,
|
extraPayType: undefined,
|
||||||
extraPayMoney: 0,
|
extraPayMoney: 0,
|
||||||
dictType: 'extra_pay_type'
|
dictType: 'extra_pay_type',
|
||||||
|
editabled: true
|
||||||
})
|
})
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
@@ -18,7 +19,13 @@
|
|||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column prop="extraPayType" label="费用类型" width="200px">
|
<el-table-column prop="extraPayType" label="费用类型" width="200px">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-select v-model="row.extraPayType" size="small" placeholder="其他费用类型" filterable>
|
<el-select
|
||||||
|
v-if="row.editabled"
|
||||||
|
v-model="row.extraPayType"
|
||||||
|
size="small"
|
||||||
|
placeholder="其他费用类型"
|
||||||
|
filterable
|
||||||
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in extraPayOptions"
|
v-for="item in extraPayOptions"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
@@ -30,12 +37,17 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="extraPayMoney" label="费用金额" width="180px">
|
<el-table-column prop="extraPayMoney" label="费用金额" width="180px">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input-number v-model="row.extraPayMoney" size="small" :controls="false" />
|
<el-input-number
|
||||||
|
v-if="row.editabled"
|
||||||
|
v-model="row.extraPayMoney"
|
||||||
|
size="small"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="remark" label="备注">
|
<el-table-column prop="remark" label="备注">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input v-model="row.remark" size="small" placeholder="备注信息" />
|
<el-input v-if="row.editabled" v-model="row.remark" size="small" placeholder="备注信息" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="60px">
|
<el-table-column label="操作" width="60px">
|
||||||
@@ -43,7 +55,7 @@
|
|||||||
<Icon
|
<Icon
|
||||||
icon="ep:remove-filled"
|
icon="ep:remove-filled"
|
||||||
class="text-red-500"
|
class="text-red-500"
|
||||||
:disabled="row.id"
|
v-if="row.editabled"
|
||||||
@click="handleRemove('extraPay', $index)"
|
@click="handleRemove('extraPay', $index)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
@@ -60,7 +72,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="DialogExtraPay">
|
<script setup name="DialogExtraPay">
|
||||||
import { signAddPay } from '@/api/clue/sign'
|
import { signAddPay, getSignExtraPayList } from '@/api/clue/sign'
|
||||||
import { getDictOptions } from '@/utils/dict'
|
import { getDictOptions } from '@/utils/dict'
|
||||||
|
|
||||||
const extraPayOptions = getDictOptions('extra_pay_type')
|
const extraPayOptions = getDictOptions('extra_pay_type')
|
||||||
@@ -70,6 +82,7 @@ const show = ref(false)
|
|||||||
function open(id) {
|
function open(id) {
|
||||||
show.value = true
|
show.value = true
|
||||||
resetForm(id)
|
resetForm(id)
|
||||||
|
getFormList()
|
||||||
}
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
open
|
open
|
||||||
@@ -83,6 +96,15 @@ function resetForm(id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getFormList() {
|
||||||
|
getSignExtraPayList({ id: form.value.signId }).then((data) => {
|
||||||
|
form.value.extraPay = data.map((it) => ({
|
||||||
|
...it,
|
||||||
|
editabled: false
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const formLoading = ref(false)
|
const formLoading = ref(false)
|
||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
@@ -99,11 +121,12 @@ async function onSubmit() {
|
|||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
const params = {
|
const params = {
|
||||||
signId: form.value.id,
|
signId: form.value.signId,
|
||||||
extraPay: form.value.extraPay.filter((it) => !it.id)
|
extraPay: form.value.extraPay.filter((it) => it.editabled)
|
||||||
}
|
}
|
||||||
await signAddPay(params)
|
await signAddPay(params)
|
||||||
message.success('添加额外支出成功!')
|
message.success('添加额外支出成功!')
|
||||||
|
getFormList()
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,7 +44,8 @@ const schema = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'dealDate',
|
field: 'dealDate',
|
||||||
label: '登记时间',
|
label: '成交日期',
|
||||||
|
dateFormat: 'YYYY-MM-DD',
|
||||||
span: 1
|
span: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -65,6 +66,7 @@ const schema = [
|
|||||||
{
|
{
|
||||||
field: 'applyTime',
|
field: 'applyTime',
|
||||||
label: '申请时间',
|
label: '申请时间',
|
||||||
|
dateFormat: 'YYYY-MM-DD',
|
||||||
span: 1
|
span: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ const applySchema = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'dealDate',
|
field: 'dealDate',
|
||||||
label: '登记时间',
|
label: '成交日期',
|
||||||
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
dateFormat: 'YYYY-MM-DD',
|
||||||
span: 1
|
span: 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,13 +6,60 @@
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="成交信息" name="orderInfo">
|
<el-tab-pane label="成交信息" name="orderInfo">
|
||||||
<Descriptions :data="orderInfo" :schema="orderSchema" :columns="2" labelWidth="130px" />
|
<Descriptions :data="orderInfo" :schema="orderSchema" :columns="2" labelWidth="130px" />
|
||||||
<el-divider direction="horizontal" content-position="left">其他费用</el-divider>
|
<template v-if="orderInfo.signProducts && orderInfo.signProducts.length">
|
||||||
|
<el-divider direction="horizontal" content-position="left">
|
||||||
|
成交产品<span v-if="prodTotalPrice">,应收:{{ prodTotalPrice }}</span>
|
||||||
|
</el-divider>
|
||||||
|
<el-table :data="orderInfo.signProducts" border stripe>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
<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 label="发货备注">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-popover
|
||||||
|
placement="top"
|
||||||
|
width="500px"
|
||||||
|
trigger="click"
|
||||||
|
v-if="scope.row.sendRemark"
|
||||||
|
>
|
||||||
|
<template #reference>
|
||||||
|
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||||
|
</template>
|
||||||
|
<div v-dompurify-html="scope.row.sendRemark"></div>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</template>
|
||||||
|
<el-divider direction="horizontal" content-position="left">
|
||||||
|
其他费用<span v-if="extraTotalPrice">,应收:{{ extraTotalPrice }}</span>
|
||||||
|
</el-divider>
|
||||||
<el-table :data="orderInfo.extraPay" border stripe>
|
<el-table :data="orderInfo.extraPay" border stripe>
|
||||||
<el-table-column type="index" width="50" />
|
<el-table-column type="index" width="50" />
|
||||||
<el-table-column prop="extraPayType" label="费用项" />
|
<el-table-column prop="extraPayType" label="费用项" />
|
||||||
<el-table-column prop="extraPayMoney" label="金额" />
|
<el-table-column prop="extraPayMoney" label="金额" />
|
||||||
<el-table-column prop="remark" label="备注" />
|
<el-table-column prop="remark" label="备注" />
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<el-divider
|
||||||
|
v-if="prodTotalPrice + extraTotalPrice"
|
||||||
|
direction="horizontal"
|
||||||
|
content-position="left"
|
||||||
|
>
|
||||||
|
合计应收:{{ prodTotalPrice + extraTotalPrice }}
|
||||||
|
</el-divider>
|
||||||
|
<div v-if="checkPermi(['clue:order:add-fee'])">
|
||||||
|
<el-divider direction="horizontal" content-position="left">
|
||||||
|
额外支出<span v-if="extraPayTotalFee">,合计:{{ extraPayTotalFee }}</span>
|
||||||
|
</el-divider>
|
||||||
|
<el-table :data="extraPayList" border stripe>
|
||||||
|
<el-table-column type="index" width="50" />
|
||||||
|
<el-table-column prop="extraPayType" label="支出项" />
|
||||||
|
<el-table-column prop="extraPayMoney" label="金额" />
|
||||||
|
<el-table-column prop="remark" label="备注" />
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="回款记录" name="returnRecord">
|
<el-tab-pane label="回款记录" name="returnRecord">
|
||||||
<el-table :data="returnRecordList" border stripe>
|
<el-table :data="returnRecordList" border stripe>
|
||||||
@@ -46,14 +93,38 @@ import { getSimpleFieldList as getOrderFieldList } from '@/api/clue/orderField'
|
|||||||
import { getPaymentPage } from '@/api/clue/payment'
|
import { getPaymentPage } from '@/api/clue/payment'
|
||||||
import { getAfterSalePage } from '@/api/clue/afterSale'
|
import { getAfterSalePage } from '@/api/clue/afterSale'
|
||||||
|
|
||||||
|
import { checkPermi } from '@/utils/permission'
|
||||||
import { formatDate } from '@/utils/formatTime'
|
import { formatDate } from '@/utils/formatTime'
|
||||||
|
|
||||||
const tabName = ref('clueInfo')
|
const tabName = ref('clueInfo')
|
||||||
const show = ref(false)
|
const show = ref(false)
|
||||||
const clueInfo = ref({})
|
const clueInfo = ref({})
|
||||||
const orderInfo = ref({})
|
const orderInfo = ref({
|
||||||
|
signProducts: [],
|
||||||
|
extraPay: []
|
||||||
|
})
|
||||||
const returnRecordList = ref([])
|
const returnRecordList = ref([])
|
||||||
const aftersaleList = ref([])
|
const aftersaleList = ref([])
|
||||||
|
const extraPayList = ref([])
|
||||||
|
|
||||||
|
const prodTotalPrice = computed(() => {
|
||||||
|
return (
|
||||||
|
orderInfo.value.signProducts?.reduce(
|
||||||
|
(pre, cur) => pre + (cur?.price || 0) * (cur?.signNum || 0),
|
||||||
|
0
|
||||||
|
) || 0
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
// 其他费用
|
||||||
|
const extraTotalPrice = computed(() => {
|
||||||
|
return orderInfo.value.extraPay.reduce((pre, cur) => pre + cur.extraPayMoney, 0)
|
||||||
|
})
|
||||||
|
|
||||||
|
// 额外支出
|
||||||
|
const extraPayTotalFee = computed(() => {
|
||||||
|
return extraPayList.value.reduce((pre, cur) => pre + cur.extraPayMoney, 0)
|
||||||
|
})
|
||||||
|
|
||||||
function open(clueId, orderId) {
|
function open(clueId, orderId) {
|
||||||
try {
|
try {
|
||||||
@@ -67,6 +138,9 @@ function open(clueId, orderId) {
|
|||||||
orderInfo.value = { ...data, ...data.diyParams }
|
orderInfo.value = { ...data, ...data.diyParams }
|
||||||
orderInfo.value.dealDate = formatDate(orderInfo.value.dealDate, 'YYYY-MM-DD HH:mm')
|
orderInfo.value.dealDate = formatDate(orderInfo.value.dealDate, 'YYYY-MM-DD HH:mm')
|
||||||
})
|
})
|
||||||
|
OrderApi.getSignExtraPayList({ id: orderId }).then((data) => {
|
||||||
|
extraPayList.value = data
|
||||||
|
})
|
||||||
getPaymentPage({ signId: orderId, pageNo: 1, pageSize: 100 }).then((data) => {
|
getPaymentPage({ signId: orderId, pageNo: 1, pageSize: 100 }).then((data) => {
|
||||||
returnRecordList.value = data.list
|
returnRecordList.value = data.list
|
||||||
})
|
})
|
||||||
@@ -83,6 +157,15 @@ const orderSchema = ref([])
|
|||||||
function getFields() {
|
function getFields() {
|
||||||
getClueFieldList().then((data) => {
|
getClueFieldList().then((data) => {
|
||||||
const arr = useCrudSchemas(data).allSchemas.detailSchema
|
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({})
|
||||||
|
}
|
||||||
clueSchema.value = [
|
clueSchema.value = [
|
||||||
...arr,
|
...arr,
|
||||||
{
|
{
|
||||||
@@ -101,6 +184,14 @@ function getFields() {
|
|||||||
|
|
||||||
getOrderFieldList().then((data) => {
|
getOrderFieldList().then((data) => {
|
||||||
const arr = useCrudSchemas(data).allSchemas.detailSchema
|
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({})
|
||||||
|
}
|
||||||
orderSchema.value = [
|
orderSchema.value = [
|
||||||
...arr,
|
...arr,
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
v-model="searchForm.signProduct"
|
v-model="searchForm.signProduct"
|
||||||
placeholder="选择成交产品"
|
placeholder="选择成交产品"
|
||||||
filterable
|
filterable
|
||||||
|
clearable
|
||||||
@change="searchForm.specsId = undefined"
|
@change="searchForm.specsId = undefined"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@@ -29,6 +30,7 @@
|
|||||||
v-model="searchForm.specsId"
|
v-model="searchForm.specsId"
|
||||||
placeholder="选择规格"
|
placeholder="选择规格"
|
||||||
filterable
|
filterable
|
||||||
|
clearable
|
||||||
:disabled="!searchForm.signProduct"
|
:disabled="!searchForm.signProduct"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
@@ -60,21 +62,39 @@
|
|||||||
v-model:tableObject="tableObject"
|
v-model:tableObject="tableObject"
|
||||||
:tableColumns="allSchemas.tableColumns"
|
:tableColumns="allSchemas.tableColumns"
|
||||||
@get-list="getTableList"
|
@get-list="getTableList"
|
||||||
|
@get-checked-columns="getCheckedColumns"
|
||||||
>
|
>
|
||||||
<el-table-column type="expand">
|
<el-table-column type="expand">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div class="p-10px flex justify-center">
|
<div class="p-10px flex justify-center">
|
||||||
<el-table :data="row.signProducts" stripe style="width: 900px">
|
<el-table :data="row.signProducts" stripe style="width: 900px">
|
||||||
<el-table-column prop="productName" label="成交产品" />
|
<el-table-column prop="productName" label="成交产品" />
|
||||||
<el-table-column prop="specsName" label="产品规格" />
|
<el-table-column prop="specsName" label="产品规格" width="100px" />
|
||||||
<el-table-column prop="signNum" label="成交数量" />
|
<el-table-column prop="signNum" label="成交数量" width="90px" />
|
||||||
<el-table-column prop="" label="发货仓库" />
|
<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
|
||||||
|
placement="top"
|
||||||
|
width="500px"
|
||||||
|
trigger="click"
|
||||||
|
v-if="scope.row.warehouseName && scope.row.sendRemark"
|
||||||
|
>
|
||||||
|
<template #reference>
|
||||||
|
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||||
|
</template>
|
||||||
|
<div v-dompurify-html="scope.row.sendRemark"></div>
|
||||||
|
</el-popover>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="100px">
|
<el-table-column label="操作" width="100px">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
class="mr-10px"
|
class="mr-10px"
|
||||||
link
|
link
|
||||||
|
:disabled="scope.row.sendState == '已发货'"
|
||||||
style="padding: 0; margin-left: 0"
|
style="padding: 0; margin-left: 0"
|
||||||
v-hasPermi="['clue:order:send']"
|
v-hasPermi="['clue:order:send']"
|
||||||
@click="handleDelivery(scope.row)"
|
@click="handleDelivery(scope.row)"
|
||||||
@@ -88,12 +108,29 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-for="item in allSchemas.tableColumns"
|
v-for="item in showColumns"
|
||||||
:key="item.field"
|
:key="item.field"
|
||||||
:prop="item.field"
|
:prop="item.field"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
min-width="120px"
|
min-width="120px"
|
||||||
/>
|
>
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-popover
|
||||||
|
placement="top"
|
||||||
|
width="500px"
|
||||||
|
trigger="click"
|
||||||
|
v-if="item.field == 'remark' && row.remark"
|
||||||
|
>
|
||||||
|
<template #reference>
|
||||||
|
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||||
|
</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">
|
<el-table-column label="操作" width="240px" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -121,7 +158,7 @@
|
|||||||
class="mr-10px"
|
class="mr-10px"
|
||||||
link
|
link
|
||||||
style="padding: 0; margin-left: 0"
|
style="padding: 0; margin-left: 0"
|
||||||
v-if="scope.row.isPayoff == false"
|
v-if="scope.row.isPayoff == '未结清'"
|
||||||
v-hasPermi="['clue:order:return']"
|
v-hasPermi="['clue:order:return']"
|
||||||
@click="feeBack(scope.row)"
|
@click="feeBack(scope.row)"
|
||||||
>
|
>
|
||||||
@@ -173,6 +210,16 @@ import DialogExtraFee from './DialogExtraPay.vue'
|
|||||||
import DialogDelivery from './DialogDelivery.vue'
|
import DialogDelivery from './DialogDelivery.vue'
|
||||||
|
|
||||||
import { removeNullField } from '@/utils'
|
import { removeNullField } from '@/utils'
|
||||||
|
import { formatDate } from '@/utils/formatTime'
|
||||||
|
|
||||||
|
const userOptions = ref([])
|
||||||
|
onMounted(() => {
|
||||||
|
getUserOption().then((data) => {
|
||||||
|
userOptions.value = data
|
||||||
|
getCurdSchemas()
|
||||||
|
})
|
||||||
|
getOptions()
|
||||||
|
})
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
@@ -202,7 +249,7 @@ const tableObject = ref({
|
|||||||
loading: false,
|
loading: false,
|
||||||
total: 1,
|
total: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
currentPage: 1
|
pageNo: 1
|
||||||
})
|
})
|
||||||
|
|
||||||
function resetQuery() {
|
function resetQuery() {
|
||||||
@@ -210,7 +257,7 @@ function resetQuery() {
|
|||||||
signProduct: undefined
|
signProduct: undefined
|
||||||
}
|
}
|
||||||
searchRef.value.reset()
|
searchRef.value.reset()
|
||||||
tableObject.value.currentPage = 1
|
tableObject.value.pageNo = 1
|
||||||
getTableList()
|
getTableList()
|
||||||
}
|
}
|
||||||
// 查询
|
// 查询
|
||||||
@@ -222,7 +269,7 @@ async function getTableList() {
|
|||||||
const params = {
|
const params = {
|
||||||
...queryParams,
|
...queryParams,
|
||||||
...searchForm.value,
|
...searchForm.value,
|
||||||
pageNo: tableObject.value.currentPage,
|
pageNo: tableObject.value.pageNo,
|
||||||
pageSize: tableObject.value.pageSize
|
pageSize: tableObject.value.pageSize
|
||||||
}
|
}
|
||||||
const data = await SignApi.getSignPage(removeNullField(params))
|
const data = await SignApi.getSignPage(removeNullField(params))
|
||||||
@@ -252,6 +299,13 @@ async function getCurdSchemas() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const showColumns = ref([])
|
||||||
|
|
||||||
|
// 初始化表格
|
||||||
|
function getCheckedColumns(list) {
|
||||||
|
showColumns.value = list && list.length ? list : allSchemas.value.tableColumns
|
||||||
|
}
|
||||||
|
|
||||||
// 详情
|
// 详情
|
||||||
function handleDetail(row) {
|
function handleDetail(row) {
|
||||||
orderDetailDialog.value.open(row.clueId, row.signId)
|
orderDetailDialog.value.open(row.clueId, row.signId)
|
||||||
@@ -297,17 +351,8 @@ function getOptions() {
|
|||||||
}
|
}
|
||||||
const deliveryDialog = ref()
|
const deliveryDialog = ref()
|
||||||
function handleDelivery(row) {
|
function handleDelivery(row) {
|
||||||
deliveryDialog.value.open(row.signId)
|
deliveryDialog.value.open(row)
|
||||||
}
|
}
|
||||||
|
|
||||||
const userOptions = ref([])
|
|
||||||
onMounted(() => {
|
|
||||||
getUserOption().then((data) => {
|
|
||||||
userOptions.value = data
|
|
||||||
getCurdSchemas()
|
|
||||||
})
|
|
||||||
getOptions()
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<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>
|
||||||
@@ -79,14 +79,33 @@
|
|||||||
v-model:tableObject="tableObject"
|
v-model:tableObject="tableObject"
|
||||||
:tableColumns="allSchemas.tableColumns"
|
:tableColumns="allSchemas.tableColumns"
|
||||||
@get-list="getTableList"
|
@get-list="getTableList"
|
||||||
|
@get-checked-columns="getCheckedColumns"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
v-for="item in allSchemas.tableColumns"
|
v-for="item in showColumns"
|
||||||
:key="item.field"
|
:key="item.field"
|
||||||
:prop="item.field"
|
:prop="item.field"
|
||||||
:label="item.label"
|
:label="item.label"
|
||||||
min-width="120px"
|
min-width="120px"
|
||||||
/>
|
>
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-popover
|
||||||
|
placement="top"
|
||||||
|
width="500px"
|
||||||
|
trigger="click"
|
||||||
|
v-if="item.form?.component == 'Editor' && row[item.field]"
|
||||||
|
>
|
||||||
|
<template #reference>
|
||||||
|
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||||
|
</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>
|
||||||
<el-table-column label="操作" width="240px" fixed="right">
|
<el-table-column label="操作" width="240px" fixed="right">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
@@ -114,12 +133,22 @@
|
|||||||
class="mr-10px"
|
class="mr-10px"
|
||||||
link
|
link
|
||||||
style="padding: 0; margin-left: 0"
|
style="padding: 0; margin-left: 0"
|
||||||
v-if="scope.row.isPayoff == false"
|
v-if="scope.row.isPayoff == '未结清'"
|
||||||
v-hasPermi="['clue:order:return']"
|
v-hasPermi="['clue:order:return']"
|
||||||
@click="feeBack(scope.row)"
|
@click="feeBack(scope.row)"
|
||||||
>
|
>
|
||||||
回款
|
回款
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
class="mr-10px"
|
||||||
|
link
|
||||||
|
style="padding: 0; margin-left: 0"
|
||||||
|
v-hasPermi="['clue:order:add-fee']"
|
||||||
|
@click="handleAddFee(scope.row)"
|
||||||
|
>
|
||||||
|
添加支出
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
class="mr-10px"
|
class="mr-10px"
|
||||||
@@ -138,6 +167,7 @@
|
|||||||
<DialogOrder ref="orderDetailDialog" />
|
<DialogOrder ref="orderDetailDialog" />
|
||||||
<DialogFeeback ref="feedbackDialog" />
|
<DialogFeeback ref="feedbackDialog" />
|
||||||
<DialogAfterSale ref="afterSaleDialog" />
|
<DialogAfterSale ref="afterSaleDialog" />
|
||||||
|
<DialogExtraFee ref="extraFeeDialog" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -146,13 +176,24 @@ import { getSimpleFieldList } from '@/api/clue/orderField'
|
|||||||
import * as SignApi from '@/api/clue/sign'
|
import * as SignApi from '@/api/clue/sign'
|
||||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||||
import { getPlaceList } from '@/api/school/place'
|
import { getPlaceList } from '@/api/school/place'
|
||||||
import { getClassTypePage } from '@/api/school/class'
|
import { getClassTypeList } from '@/api/school/class'
|
||||||
|
|
||||||
import DialogOrder from './DialogOrder.vue'
|
import DialogOrder from './DialogOrder.vue'
|
||||||
import DialogFeeback from './DialogFeeback.vue'
|
import DialogFeeback from './DialogFeeback.vue'
|
||||||
import DialogAfterSale from './DialogAfterSale.vue'
|
import DialogAfterSale from './DialogAfterSale.vue'
|
||||||
|
import DialogExtraFee from './DialogExtraPay.vue'
|
||||||
|
|
||||||
import { removeNullField } from '@/utils'
|
import { removeNullField } from '@/utils'
|
||||||
|
import { formatDate } from '@/utils/formatTime'
|
||||||
|
|
||||||
|
const userOptions = ref([])
|
||||||
|
onMounted(() => {
|
||||||
|
getUserOption().then((data) => {
|
||||||
|
userOptions.value = data
|
||||||
|
getCurdSchemas()
|
||||||
|
})
|
||||||
|
getOptions()
|
||||||
|
})
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
@@ -175,7 +216,7 @@ const tableObject = ref({
|
|||||||
loading: false,
|
loading: false,
|
||||||
total: 1,
|
total: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
currentPage: 1
|
pageNo: 1
|
||||||
})
|
})
|
||||||
|
|
||||||
const placeOptions = computed(() => {
|
const placeOptions = computed(() => {
|
||||||
@@ -190,7 +231,7 @@ function resetQuery() {
|
|||||||
signProduct: undefined
|
signProduct: undefined
|
||||||
}
|
}
|
||||||
searchRef.value.reset()
|
searchRef.value.reset()
|
||||||
tableObject.value.currentPage = 1
|
tableObject.value.pageNo = 1
|
||||||
getTableList()
|
getTableList()
|
||||||
}
|
}
|
||||||
// 查询
|
// 查询
|
||||||
@@ -202,7 +243,7 @@ async function getTableList() {
|
|||||||
const params = {
|
const params = {
|
||||||
...queryParams,
|
...queryParams,
|
||||||
...searchForm.value,
|
...searchForm.value,
|
||||||
pageNo: tableObject.value.currentPage,
|
pageNo: tableObject.value.pageNo,
|
||||||
pageSize: tableObject.value.pageSize
|
pageSize: tableObject.value.pageSize
|
||||||
}
|
}
|
||||||
const data = await SignApi.getSignPage(removeNullField(params))
|
const data = await SignApi.getSignPage(removeNullField(params))
|
||||||
@@ -232,6 +273,13 @@ async function getCurdSchemas() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const showColumns = ref([])
|
||||||
|
|
||||||
|
// 初始化表格
|
||||||
|
function getCheckedColumns(list) {
|
||||||
|
showColumns.value = list && list.length ? list : allSchemas.value.tableColumns
|
||||||
|
}
|
||||||
|
|
||||||
// 详情
|
// 详情
|
||||||
function handleDetail(row) {
|
function handleDetail(row) {
|
||||||
orderDetailDialog.value.open(row.clueId, row.signId)
|
orderDetailDialog.value.open(row.clueId, row.signId)
|
||||||
@@ -249,6 +297,11 @@ function feeBack(row) {
|
|||||||
feedbackDialog.value.open(row.signId)
|
feedbackDialog.value.open(row.signId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const extraFeeDialog = ref()
|
||||||
|
function handleAddFee(row) {
|
||||||
|
extraFeeDialog.value.open(row.signId)
|
||||||
|
}
|
||||||
|
|
||||||
// 取消登记
|
// 取消登记
|
||||||
async function cancelDeal(row) {
|
async function cancelDeal(row) {
|
||||||
try {
|
try {
|
||||||
@@ -276,26 +329,17 @@ function changePlace() {
|
|||||||
|
|
||||||
const classOptions = ref([])
|
const classOptions = ref([])
|
||||||
async function getClassTypeOptions() {
|
async function getClassTypeOptions() {
|
||||||
const data = await getClassTypePage({ placeId: searchForm.value.signPlace })
|
const data = await getClassTypeList({ placeId: searchForm.value.signPlace, status: 0 })
|
||||||
classOptions.value = data.list
|
classOptions.value = data
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOptions() {
|
function getOptions() {
|
||||||
// 驾校
|
// 驾校
|
||||||
getPlaceList().then((data) => {
|
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
||||||
schoolOptions.value = data.schoolList
|
schoolOptions.value = data.schoolList
|
||||||
allPlaceOptions.value = data.placeList
|
allPlaceOptions.value = data.placeList
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const userOptions = ref([])
|
|
||||||
onMounted(() => {
|
|
||||||
getUserOption().then((data) => {
|
|
||||||
userOptions.value = data
|
|
||||||
getCurdSchemas()
|
|
||||||
})
|
|
||||||
getOptions()
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
<style lang="scss" scoped></style>
|
||||||
|
|||||||
@@ -32,8 +32,8 @@
|
|||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
range-separator="-"
|
range-separator="-"
|
||||||
start-placeholder="登记日期"
|
start-placeholder="成交日期"
|
||||||
end-placeholder="登记日期"
|
end-placeholder="成交日期"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@@ -77,9 +77,19 @@
|
|||||||
<el-table-column prop="money" label="回款金额" min-width="90" />
|
<el-table-column prop="money" label="回款金额" min-width="90" />
|
||||||
<el-table-column prop="isPayoff" 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="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="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 prop="stateName" label="审核状态" fixed="right" min-width="90" />
|
||||||
<el-table-column label="操作" width="150px" fixed="right">
|
<el-table-column label="操作" width="150px" fixed="right">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
@@ -131,6 +141,8 @@ import DialogFeebackAudit from './DialogFeebackAudit.vue'
|
|||||||
import DialogFeebackDetail from './DialogFeebackDetail.vue'
|
import DialogFeebackDetail from './DialogFeebackDetail.vue'
|
||||||
import DialogBatchAudit from './DialogBatchAudit.vue'
|
import DialogBatchAudit from './DialogBatchAudit.vue'
|
||||||
|
|
||||||
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
|
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
const message = useMessage() // 消息弹窗
|
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">
|
<el-tab-pane label="发货列表" name="delivery" v-if="appStore.getAppInfo?.instanceType == 2">
|
||||||
<Delivery v-if="tabName == 'delivery'" />
|
<Delivery v-if="tabName == 'delivery'" />
|
||||||
</el-tab-pane>
|
</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>
|
</el-tabs>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -25,6 +28,8 @@ import MallOrderList from './Comp/MallOrderList.vue'
|
|||||||
import Reback from './Comp/Reback.vue'
|
import Reback from './Comp/Reback.vue'
|
||||||
import AfterSales from './Comp/AfterSales.vue'
|
import AfterSales from './Comp/AfterSales.vue'
|
||||||
import Delivery from './Comp/Delivery.vue'
|
import Delivery from './Comp/Delivery.vue'
|
||||||
|
import Settle from './Comp/Settle.vue'
|
||||||
|
import { checkPermi } from '@/utils/permission'
|
||||||
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
const tabName = ref('list')
|
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,13 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px" @close="destroyMap">
|
<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">
|
<el-tab-pane label="线索信息" name="info">
|
||||||
<Form ref="formRef" v-loading="formLoading" :rules="rules" isCol :schema="formSchema" />
|
<Form ref="formRef" v-loading="formLoading" :rules="rules" isCol :schema="formSchema" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="跟进信息" name="follow">
|
<el-tab-pane label="跟进信息" name="follow">
|
||||||
<el-button type="primary" @click="handleAppendFollow">新增跟进人</el-button>
|
<el-button type="primary" @click="handleAppendFollow">新增跟进人</el-button>
|
||||||
<el-table :data="followList">
|
<el-table :data="followList">
|
||||||
<el-table-column label="跟进人">
|
<el-table-column label="跟进人" width="180px">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-select
|
<el-select
|
||||||
v-model="row.userId"
|
v-model="row.userId"
|
||||||
@@ -24,13 +24,27 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="followTime" label="下次跟进时间">
|
<el-table-column prop="nextFollowTime" label="下次跟进时间" width="180px">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="row.followTime"
|
v-model="row.nextFollowTime"
|
||||||
type="date"
|
type="date"
|
||||||
placeholder="选择日期时间"
|
placeholder="选择日期时间"
|
||||||
:disabled="!row.editable"
|
:disabled="!row.editable"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="content" label="跟进内容">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-input
|
||||||
|
v-model="row.content"
|
||||||
|
type="textarea"
|
||||||
|
:autoSize="{ minRows: 2 }"
|
||||||
|
placeholder="输入跟进内容"
|
||||||
|
:disabled="!row.editable"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -47,19 +61,16 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane v-if="appStore.getAppInfo?.instanceType == 1" label="位置信息" name="map">
|
<el-tab-pane v-if="appStore.getAppInfo?.instanceType == 1" label="位置信息" name="map">
|
||||||
<div class="flex justify-between">
|
<div class="flex justify-between items-center">
|
||||||
<el-select
|
<el-autocomplete
|
||||||
v-model="areaValue"
|
v-model="areaValue"
|
||||||
filterable
|
|
||||||
clearable
|
clearable
|
||||||
remote
|
style="width: 250px"
|
||||||
style="width: 350px"
|
placeholder="输入并搜索位置"
|
||||||
reserve-keyword
|
:fetch-suggestions="remoteMethod"
|
||||||
placeholder="请输入关键词"
|
@select="currentSelect"
|
||||||
:remote-method="remoteMethod"
|
|
||||||
@change="currentSelect"
|
|
||||||
>
|
>
|
||||||
<el-option
|
<!-- <el-option
|
||||||
v-for="item in areaList"
|
v-for="item in areaList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.name"
|
:label="item.name"
|
||||||
@@ -68,36 +79,65 @@
|
|||||||
>
|
>
|
||||||
<span style="float: left">{{ item.name }}</span>
|
<span style="float: left">{{ item.name }}</span>
|
||||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.district }}</span>
|
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.district }}</span>
|
||||||
</el-option>
|
</el-option> -->
|
||||||
</el-select>
|
</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 />
|
||||||
|
</div>
|
||||||
<el-checkbox v-model="showSchool" :label="true" @change="handleShowSchool">
|
<el-checkbox v-model="showSchool" :label="true" @change="handleShowSchool">
|
||||||
展示场地
|
展示场地
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
<div id="dialogMap" class="mt-20px" style="height: 400px; width: 100%"></div>
|
<div id="dialogMap" class="mt-20px" style="height: 400px; width: 100%"></div>
|
||||||
<div class="flex items-center mt-10px mb-10px">
|
<el-collapse v-model="collaspeKey" class="box-card">
|
||||||
<div class="w-100px">线索位置:</div>
|
<el-collapse-item title="附近驾校" name="nearbySchool">
|
||||||
<el-input v-model="address" placeholder="请输入线索位置" clearable />
|
<template #header>附近驾校</template>
|
||||||
</div>
|
<div style="padding: 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"
|
||||||
|
@click="getClassType(p)"
|
||||||
|
>
|
||||||
|
<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: 6px 0 !important" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</el-collapse-item>
|
||||||
|
</el-collapse>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<template #footer>
|
<div style="position: absolute; top: 75px; right: 20px">
|
||||||
<span>
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button>
|
||||||
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button>
|
</div>
|
||||||
</span>
|
<DialogSchoolInfo ref="schoolInfoDialog" />
|
||||||
</template>
|
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="DialogClue">
|
<script setup name="DialogClue">
|
||||||
import { useAppStore } from '@/store/modules/app'
|
import { useAppStore } from '@/store/modules/app'
|
||||||
|
import { useUserStore } from '@/store/modules/user'
|
||||||
import { getPlaceList } from '@/api/school/place'
|
import { getPlaceList } from '@/api/school/place'
|
||||||
import * as ClueApi from '@/api/clue'
|
import * as ClueApi from '@/api/clue'
|
||||||
import { getDiyFieldList } from '@/api/clue/clueField'
|
import { getDiyFieldList } from '@/api/clue/clueField'
|
||||||
import { formatDate } from '@/utils/formatTime'
|
import { formatDate } from '@/utils/formatTime'
|
||||||
import AMapLoader from '@amap/amap-jsapi-loader'
|
import AMapLoader from '@amap/amap-jsapi-loader'
|
||||||
import ImgPostion from '@/assets/imgs/flag/flag_red.png'
|
|
||||||
|
import DialogSchoolInfo from './DialogSchoolInfo.vue'
|
||||||
|
|
||||||
|
import ImgPostion from '@/assets/imgs/flag/position_black.png'
|
||||||
import FlagRed from '@/assets/imgs/flag/flag_red.png'
|
import FlagRed from '@/assets/imgs/flag/flag_red.png'
|
||||||
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
|
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
|
||||||
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
|
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
|
||||||
@@ -106,7 +146,6 @@ import FlagBlue from '@/assets/imgs/flag/flag_blue.png'
|
|||||||
import FlagBlack from '@/assets/imgs/flag/flag_black.png'
|
import FlagBlack from '@/assets/imgs/flag/flag_black.png'
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { t } = useI18n() // 国际化
|
|
||||||
const appStore = useAppStore()
|
const appStore = useAppStore()
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -119,8 +158,14 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const formSchema = computed(() => {
|
const formSchema = computed(() => {
|
||||||
|
const newSchema = [...props.schema]
|
||||||
|
newSchema.forEach((it) => {
|
||||||
|
if (it.field == 'consultTime') {
|
||||||
|
it.componentProps['disabled-date'] = dateAfterToday
|
||||||
|
}
|
||||||
|
})
|
||||||
return [
|
return [
|
||||||
...props.schema,
|
...newSchema,
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
label: '诉求',
|
label: '诉求',
|
||||||
@@ -143,6 +188,10 @@ const formSchema = computed(() => {
|
|||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const dateAfterToday = (t) => {
|
||||||
|
return t.getTime() > Date.now()
|
||||||
|
}
|
||||||
|
|
||||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
const dialogTitle = ref('') // 弹窗的标题
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||||
@@ -162,7 +211,6 @@ const tabName = ref('info')
|
|||||||
const followList = ref([])
|
const followList = ref([])
|
||||||
|
|
||||||
const areaValue = ref('')
|
const areaValue = ref('')
|
||||||
const areaList = ref([])
|
|
||||||
const address = ref('')
|
const address = ref('')
|
||||||
const defaultLatLng = ref({
|
const defaultLatLng = ref({
|
||||||
lat: 31.86119,
|
lat: 31.86119,
|
||||||
@@ -184,46 +232,70 @@ const open = async (type, id) => {
|
|||||||
try {
|
try {
|
||||||
const data = await ClueApi.getClue(id)
|
const data = await ClueApi.getClue(id)
|
||||||
info.value = { ...data, ...data.diyParams }
|
info.value = { ...data, ...data.diyParams }
|
||||||
|
info.value.remark = info.value.remark || ''
|
||||||
|
defaultLatLng.value = {
|
||||||
|
lat: data.lat,
|
||||||
|
lng: data.lng
|
||||||
|
}
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
followList.value = data.followUser
|
followList.value = data.followUser
|
||||||
address.value = data.address || ''
|
address.value = data.address || ''
|
||||||
formRef.value.setValues(info.value)
|
formRef.value.setValues(info.value, false)
|
||||||
})
|
})
|
||||||
} finally {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
followList.value = []
|
followList.value = [
|
||||||
|
{
|
||||||
|
userId: useUserStore().getUser.id,
|
||||||
|
content: undefined,
|
||||||
|
nextFollowTime: formatDate(new Date()),
|
||||||
|
editable: true
|
||||||
|
}
|
||||||
|
]
|
||||||
address.value = ''
|
address.value = ''
|
||||||
defaultLatLng.value = {
|
defaultLatLng.value = {
|
||||||
lat: 31.86119,
|
lat: 31.86119,
|
||||||
lng: 117.283042
|
lng: 117.283042
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (appStore.getAppInfo?.instanceType == 1 && !dialogMap.value) {
|
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
getSchoolPlace()
|
formRef.value.setValues(info.value, true)
|
||||||
initMap(info.value)
|
|
||||||
remoteMethod(address.value)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changeTab() {
|
||||||
|
if (tabName.value == 'map') {
|
||||||
|
if (!dialogMap.value) {
|
||||||
|
nextTick(async () => {
|
||||||
|
await getSchoolPlace()
|
||||||
|
initMap(info.value)
|
||||||
|
// remoteMethod(address.value)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
destroyMap()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
|
|
||||||
function resetForm() {
|
function resetForm() {
|
||||||
info.value.address = undefined
|
info.value = {
|
||||||
info.value.lat = undefined
|
address: undefined,
|
||||||
info.value.lng = undefined
|
lat: undefined,
|
||||||
info.value.followUsers = []
|
lng: undefined,
|
||||||
info.value.diyParams = {}
|
consultTime: formatDate(new Date()),
|
||||||
|
followUsers: [],
|
||||||
|
diyParams: {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const placeList = ref([])
|
const placeList = ref([])
|
||||||
function getSchoolPlace() {
|
async function getSchoolPlace() {
|
||||||
getPlaceList().then((data) => {
|
const data = await getPlaceList({ placeStatus: 0 })
|
||||||
placeList.value = data.placeList
|
placeList.value = data.placeList
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const emit = defineEmits(['success'])
|
const emit = defineEmits(['success'])
|
||||||
@@ -233,10 +305,18 @@ async function handleSave() {
|
|||||||
if (!formRef.value) return
|
if (!formRef.value) return
|
||||||
const valid = await formRef.value.getElFormRef().validate()
|
const valid = await formRef.value.getElFormRef().validate()
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
|
if (!followList.value || followList.value.length == 0) {
|
||||||
|
message.info('请添加跟进人')
|
||||||
|
return
|
||||||
|
}
|
||||||
if (followList.value && followList.value.length && followList.value.some((it) => !it.userId)) {
|
if (followList.value && followList.value.length && followList.value.some((it) => !it.userId)) {
|
||||||
message.info('请将跟进人填写完整!')
|
message.info('请将跟进人填写完整!')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (appStore.getAppInfo?.instanceType == 1 && !address.value) {
|
||||||
|
message.info('请选择学员位置!')
|
||||||
|
return
|
||||||
|
}
|
||||||
// 提交请求
|
// 提交请求
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
@@ -254,11 +334,11 @@ async function handleSave() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (formType.value === 'create') {
|
if (formType.value === 'create') {
|
||||||
await ClueApi.createClue(params)
|
const data = await ClueApi.createClue(params)
|
||||||
message.success(t('common.createSuccess'))
|
message.success(data)
|
||||||
} else {
|
} else {
|
||||||
await ClueApi.updateClue(params)
|
const data = await ClueApi.updateClue(params)
|
||||||
message.success(t('common.updateSuccess'))
|
message.success(data)
|
||||||
}
|
}
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
// 发送操作成功的事件
|
// 发送操作成功的事件
|
||||||
@@ -271,7 +351,8 @@ async function handleSave() {
|
|||||||
function handleAppendFollow() {
|
function handleAppendFollow() {
|
||||||
followList.value.push({
|
followList.value.push({
|
||||||
userId: undefined,
|
userId: undefined,
|
||||||
followTime: formatDate(new Date()),
|
content: undefined,
|
||||||
|
nextFollowTime: formatDate(new Date()),
|
||||||
editable: true
|
editable: true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -287,7 +368,7 @@ let geoCoder = ref(null)
|
|||||||
|
|
||||||
function initMap(data) {
|
function initMap(data) {
|
||||||
AMapLoader.load({
|
AMapLoader.load({
|
||||||
key: '2ffb0e2ea90b1df0b8be48ed66e18fc8', //设置您的key
|
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key
|
||||||
version: '2.0',
|
version: '2.0',
|
||||||
plugins: ['AMap.Geocoder', 'AMap.AutoComplete']
|
plugins: ['AMap.Geocoder', 'AMap.AutoComplete']
|
||||||
}).then((AMap) => {
|
}).then((AMap) => {
|
||||||
@@ -299,15 +380,13 @@ function initMap(data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dialogMap.value = new AMap.Map('dialogMap', {
|
dialogMap.value = new AMap.Map('dialogMap', {
|
||||||
zoom: 12,
|
zoom: 14,
|
||||||
zooms: [2, 22],
|
zooms: [2, 22],
|
||||||
center: [defaultLatLng.value.lng, defaultLatLng.value.lat]
|
center: [defaultLatLng.value.lng, defaultLatLng.value.lat]
|
||||||
})
|
})
|
||||||
if (data.lng || data.lat) {
|
addmark(defaultLatLng.value.lng, defaultLatLng.value.lat, AMap)
|
||||||
addmark(data.lng, data.lat, AMap)
|
|
||||||
}
|
|
||||||
AutoComplete.value = new AMap.AutoComplete({
|
AutoComplete.value = new AMap.AutoComplete({
|
||||||
city: '全国'
|
city: '合肥'
|
||||||
})
|
})
|
||||||
geoCoder.value = new AMap.Geocoder()
|
geoCoder.value = new AMap.Geocoder()
|
||||||
dialogMap.value.on('click', (e) => {
|
dialogMap.value.on('click', (e) => {
|
||||||
@@ -321,6 +400,74 @@ function initMap(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const collaspeKey = ref('nearbySchool')
|
||||||
|
const nearbySchoolSearching = ref(false)
|
||||||
|
const nearbySchoolList = ref([])
|
||||||
|
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 regeoCode(lng, lat) {
|
function regeoCode(lng, lat) {
|
||||||
try {
|
try {
|
||||||
geoCoder.value.getAddress([lng, lat], (status, result) => {
|
geoCoder.value.getAddress([lng, lat], (status, result) => {
|
||||||
@@ -341,10 +488,12 @@ function addmark(lat, lng, AMap) {
|
|||||||
marker.value = new AMap.Marker({
|
marker.value = new AMap.Marker({
|
||||||
position: new AMap.LngLat(lat, lng),
|
position: new AMap.LngLat(lat, lng),
|
||||||
zoom: 13,
|
zoom: 13,
|
||||||
icon: ImgPostion
|
icon: ImgPostion,
|
||||||
|
offset: [-16, -32]
|
||||||
})
|
})
|
||||||
dialogMap.value.add(marker.value)
|
dialogMap.value.add(marker.value)
|
||||||
dialogMap.value.setCenter([lat, lng], '', 500)
|
dialogMap.value.setCenter([lat, lng], true)
|
||||||
|
getNearbySchool({ lat: lng, lng: lat })
|
||||||
}
|
}
|
||||||
function removeMarker() {
|
function removeMarker() {
|
||||||
dialogMap.value.remove(marker.value)
|
dialogMap.value.remove(marker.value)
|
||||||
@@ -376,6 +525,7 @@ function handleShowSchool() {
|
|||||||
extData: place,
|
extData: place,
|
||||||
clickable: true
|
clickable: true
|
||||||
})
|
})
|
||||||
|
marker.on('click', (ev) => showSchoolInfo(ev.target.getExtData()))
|
||||||
schoolMarkers.value.push(marker)
|
schoolMarkers.value.push(marker)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -383,28 +533,43 @@ function handleShowSchool() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function remoteMethod(searchValue) {
|
const schoolInfoDialog = ref()
|
||||||
if (searchValue !== '') {
|
function showSchoolInfo(val) {
|
||||||
setTimeout(() => {
|
schoolInfoDialog.value.open(val)
|
||||||
AutoComplete.value?.search(searchValue, (status, result) => {
|
}
|
||||||
if (result.tips?.length) {
|
|
||||||
areaList.value = result?.tips
|
function remoteMethod(searchValue, cb) {
|
||||||
}
|
if (searchValue) {
|
||||||
})
|
AutoComplete.value?.search(searchValue, (status, result) => {
|
||||||
}, 200)
|
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) {
|
function currentSelect(val) {
|
||||||
const area = areaList.value.find((it) => it.name == val)
|
if (val) {
|
||||||
if (area) {
|
defaultLatLng.value = {
|
||||||
addmark(area.location?.lng, area.location?.lat, aMap.value)
|
lng: val.location?.lng,
|
||||||
dialogMap.value.setCenter([area.location?.lng, area.location?.lat], '', 500)
|
lat: val.location?.lat
|
||||||
regeoCode(area.location?.lng, area.location?.lat)
|
}
|
||||||
|
addmark(val.location?.lng, val.location?.lat, aMap.value)
|
||||||
|
regeoCode(val.location?.lng, val.location?.lat)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function destroyMap() {
|
function destroyMap() {
|
||||||
|
areaValue.value = undefined
|
||||||
dialogMap.value = null
|
dialogMap.value = null
|
||||||
aMap.value = null
|
aMap.value = null
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,18 @@
|
|||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="意向状态" prop="intentionState">
|
||||||
|
<el-select v-model="form.intentionState" filterable>
|
||||||
|
<el-option
|
||||||
|
v-for="item in intentionOptions"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="24" :offset="0">
|
<el-col :span="24" :offset="0">
|
||||||
@@ -80,9 +92,12 @@
|
|||||||
<script setup name="DialogFollow">
|
<script setup name="DialogFollow">
|
||||||
import { getSkillPage } from '@/api/clue/skill'
|
import { getSkillPage } from '@/api/clue/skill'
|
||||||
import { createFollow } from '@/api/clue/followRecord'
|
import { createFollow } from '@/api/clue/followRecord'
|
||||||
|
import { getDictOptions } from '@/utils/dict'
|
||||||
|
import { formatDate } from '@/utils/formatTime'
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
const intentionOptions = getDictOptions('intention_state')
|
||||||
|
|
||||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||||
const dialogTitle = ref('') // 弹窗的标题
|
const dialogTitle = ref('') // 弹窗的标题
|
||||||
@@ -97,18 +112,19 @@ const rules = {
|
|||||||
content: { required: true, message: '跟进内容不可为空', trigger: 'blur' }
|
content: { required: true, message: '跟进内容不可为空', trigger: 'blur' }
|
||||||
}
|
}
|
||||||
|
|
||||||
const open = async (clueId) => {
|
const open = async (clueId, status) => {
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
dialogTitle.value = '新增跟进记录'
|
dialogTitle.value = '新增跟进记录'
|
||||||
resetForm(clueId)
|
resetForm(clueId, status)
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||||
function resetForm(clueId) {
|
function resetForm(clueId, status) {
|
||||||
form.value = {
|
form.value = {
|
||||||
clueId,
|
clueId,
|
||||||
operateTime: undefined,
|
operateTime: formatDate(new Date(), 'YYYY-MM-DD HH:mm'),
|
||||||
nextFollowTime: undefined,
|
nextFollowTime: undefined,
|
||||||
|
intentionState: status,
|
||||||
content: undefined
|
content: undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,6 +147,8 @@ function getSkillList() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const emit = defineEmits(['success'])
|
||||||
|
|
||||||
async function handleSave() {
|
async function handleSave() {
|
||||||
// 校验表单
|
// 校验表单
|
||||||
if (!formRef.value) return
|
if (!formRef.value) return
|
||||||
|
|||||||
23
src/views/Clue/Pool/Comp/DialogSchoolInfo.vue
Normal file
23
src/views/Clue/Pool/Comp/DialogSchoolInfo.vue
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog width="800px" :title="title" v-model="show" append-to-body>
|
||||||
|
<div v-dompurify-html="detail" class="mb-20px"></div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="DialogSchoolInfo">
|
||||||
|
const title = ref('')
|
||||||
|
const show = ref(false)
|
||||||
|
const detail = ref('')
|
||||||
|
|
||||||
|
function open(info) {
|
||||||
|
title.value = `【${info.schoolName}】详细信息`
|
||||||
|
show.value = true
|
||||||
|
detail.value = info.introduce || '该驾校暂未配置详细信息'
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<Dialog title="成交登记" v-model="show" width="820px">
|
<Dialog title="成交登记" v-model="show" width="900px">
|
||||||
<Descriptions
|
<Descriptions
|
||||||
:title="`线索信息-${info.name}`"
|
:title="`线索信息-${info.name}`"
|
||||||
:data="info"
|
:data="info"
|
||||||
@@ -10,31 +10,6 @@
|
|||||||
/>
|
/>
|
||||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px" class="mt-20px">
|
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px" class="mt-20px">
|
||||||
<el-row :gutter="20">
|
<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">
|
<template v-if="appStore.getAppInfo?.instanceType == 1">
|
||||||
<el-col :span="8" :offset="0">
|
<el-col :span="8" :offset="0">
|
||||||
@@ -79,6 +54,7 @@
|
|||||||
:disabled="!form.signPlace"
|
:disabled="!form.signPlace"
|
||||||
placeholder="选择班型"
|
placeholder="选择班型"
|
||||||
filterable
|
filterable
|
||||||
|
@change="changeClass"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in classOptions"
|
v-for="item in classOptions"
|
||||||
@@ -90,6 +66,39 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</template>
|
</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
|
<el-col
|
||||||
:span="8"
|
:span="8"
|
||||||
:offset="0"
|
:offset="0"
|
||||||
@@ -124,7 +133,9 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<!-- 进销存模式 -->
|
<!-- 进销存模式 -->
|
||||||
<el-col :span="24" :offset="0" v-if="appStore.getAppInfo?.instanceType == 2">
|
<el-col :span="24" :offset="0" v-if="appStore.getAppInfo?.instanceType == 2">
|
||||||
<el-divider direction="horizontal" content-position="left">成交产品</el-divider>
|
<el-divider direction="horizontal" content-position="left">
|
||||||
|
成交产品<span v-if="prodTotalPrice">,应收:{{ prodTotalPrice }}</span>
|
||||||
|
</el-divider>
|
||||||
<el-button
|
<el-button
|
||||||
class="mb-5px"
|
class="mb-5px"
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -161,6 +172,11 @@
|
|||||||
placeholder="选择规格"
|
placeholder="选择规格"
|
||||||
filterable
|
filterable
|
||||||
:disabled="!row.productId"
|
:disabled="!row.productId"
|
||||||
|
@change="
|
||||||
|
row.price = specsOptions(row.productId).find(
|
||||||
|
(it) => it.specsId == row.specsId
|
||||||
|
).price
|
||||||
|
"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in specsOptions(row.productId)"
|
v-for="item in specsOptions(row.productId)"
|
||||||
@@ -171,6 +187,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column prop="price" label="销售单价" width="100px" />
|
||||||
<el-table-column prop="signNum" label="成交数量" width="100px">
|
<el-table-column prop="signNum" label="成交数量" width="100px">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
@@ -199,7 +216,9 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" :offset="0" class="mb-18px">
|
<el-col :span="24" :offset="0" class="mb-18px">
|
||||||
<el-divider direction="horizontal" content-position="left">其他费用</el-divider>
|
<el-divider direction="horizontal" content-position="left">
|
||||||
|
其他费用<span v-if="extraTotalPrice">,应收:{{ extraTotalPrice }}</span>
|
||||||
|
</el-divider>
|
||||||
<el-button
|
<el-button
|
||||||
class="mb-5px"
|
class="mb-5px"
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -247,6 +266,13 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<el-divider
|
||||||
|
v-if="prodTotalPrice + extraTotalPrice"
|
||||||
|
direction="horizontal"
|
||||||
|
content-position="left"
|
||||||
|
>
|
||||||
|
合计应收:{{ prodTotalPrice + extraTotalPrice }}
|
||||||
|
</el-divider>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" :offset="0">
|
<el-col :span="24" :offset="0">
|
||||||
<el-form-item label="备注">
|
<el-form-item label="备注">
|
||||||
@@ -269,7 +295,7 @@ import * as ClueApi from '@/api/clue'
|
|||||||
import { createSign } from '@/api/clue/sign'
|
import { createSign } from '@/api/clue/sign'
|
||||||
import { getDiyFieldList } from '@/api/clue/orderField'
|
import { getDiyFieldList } from '@/api/clue/orderField'
|
||||||
import { getPlaceList } from '@/api/school/place'
|
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 { getSimpleProductList } from '@/api/mall/product'
|
||||||
// import { getSimpleWarehouseList } from '@/api/mall/warehouse'
|
// import { getSimpleWarehouseList } from '@/api/mall/warehouse'
|
||||||
import { formatDate } from '@/utils/formatTime'
|
import { formatDate } from '@/utils/formatTime'
|
||||||
@@ -302,7 +328,27 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const prodTotalPrice = computed(() => {
|
||||||
|
return form.value.signProducts.reduce(
|
||||||
|
(pre, cur) => pre + (cur?.price || 0) * (cur?.signNum || 0),
|
||||||
|
0
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
const extraTotalPrice = computed(() => {
|
||||||
|
return form.value.extraPay.reduce((pre, cur) => pre + cur.extraPayMoney, 0)
|
||||||
|
})
|
||||||
|
|
||||||
const showSchema = 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 = [
|
const arr = [
|
||||||
{
|
{
|
||||||
field: 'requirement',
|
field: 'requirement',
|
||||||
@@ -316,7 +362,7 @@ const showSchema = computed(() => {
|
|||||||
span: 2
|
span: 2
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
return [...props.schema, ...arr]
|
return [...list, ...arr]
|
||||||
})
|
})
|
||||||
|
|
||||||
const extraPayOptions = getDictOptions('other_pay_type')
|
const extraPayOptions = getDictOptions('other_pay_type')
|
||||||
@@ -340,6 +386,7 @@ function resetForm(id) {
|
|||||||
state: true,
|
state: true,
|
||||||
payAmount: 0,
|
payAmount: 0,
|
||||||
remark: undefined,
|
remark: undefined,
|
||||||
|
isCompanyReceipts: appStore.getAppInfo?.instanceType == 1,
|
||||||
extraPay: [],
|
extraPay: [],
|
||||||
signProducts: []
|
signProducts: []
|
||||||
}
|
}
|
||||||
@@ -410,14 +457,14 @@ const placeOptions = computed(() => {
|
|||||||
const classOptions = ref([])
|
const classOptions = ref([])
|
||||||
|
|
||||||
async function getClassTypeOptions() {
|
async function getClassTypeOptions() {
|
||||||
const data = await getClassTypePage({ placeId: form.value.signPlace })
|
const data = await getClassTypeList({ placeId: form.value.signPlace, status: 0 })
|
||||||
classOptions.value = data.list
|
classOptions.value = data
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOptions() {
|
function getOptions() {
|
||||||
if (appStore.getAppInfo?.instanceType == 1) {
|
if (appStore.getAppInfo?.instanceType == 1) {
|
||||||
// 驾校
|
// 驾校
|
||||||
getPlaceList().then((data) => {
|
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
||||||
schoolOptions.value = data.schoolList
|
schoolOptions.value = data.schoolList
|
||||||
allPlaceOptions.value = data.placeList
|
allPlaceOptions.value = data.placeList
|
||||||
})
|
})
|
||||||
@@ -448,6 +495,11 @@ function changePlace() {
|
|||||||
getClassTypeOptions()
|
getClassTypeOptions()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changeClass() {
|
||||||
|
form.value.payAmount =
|
||||||
|
classOptions.value.find((it) => it.typeId == form.value.signClass).guidingPrice || 0
|
||||||
|
}
|
||||||
|
|
||||||
function handleRemove(type, index) {
|
function handleRemove(type, index) {
|
||||||
form.value[type].splice(index, 1)
|
form.value[type].splice(index, 1)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
<el-tabs v-model="infoIndex" type="border-card">
|
<el-tabs v-model="infoIndex" type="border-card">
|
||||||
<el-tab-pane label="跟进记录" name="followRecord">
|
<el-tab-pane label="跟进记录" name="followRecord">
|
||||||
<el-button
|
<el-button
|
||||||
|
v-if="followList.length"
|
||||||
v-hasPermi="['clue:pool:update']"
|
v-hasPermi="['clue:pool:update']"
|
||||||
class="mb-10px"
|
class="mb-10px"
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -83,6 +84,32 @@
|
|||||||
展示场地
|
展示场地
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
<div id="dialogMap" class="mt-20px" style="height: 400px; width: 100%"></div>
|
<div id="dialogMap" class="mt-20px" style="height: 400px; width: 100%"></div>
|
||||||
|
<el-collapse v-model="collaspeKey" class="box-card">
|
||||||
|
<el-collapse-item title="附近驾校" name="nearbySchool">
|
||||||
|
<template #header>附近驾校</template>
|
||||||
|
<div style="padding: 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"
|
||||||
|
@click="getClassType(p)"
|
||||||
|
>
|
||||||
|
<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: 6px 0 !important" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</el-collapse-item>
|
||||||
|
</el-collapse>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="操作记录" name="operateRecord">
|
<el-tab-pane label="操作记录" name="operateRecord">
|
||||||
@@ -113,7 +140,8 @@
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<!-- 新建编辑跟进信息 -->
|
<!-- 新建编辑跟进信息 -->
|
||||||
<DialogFollow ref="followRef" @success="getFollowList" />
|
<DialogFollow ref="followRef" @success="followSuccess" />
|
||||||
|
<DialogSchoolInfo ref="schoolInfoDialog" />
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -124,10 +152,11 @@ import * as FollowApi from '@/api/clue/followRecord'
|
|||||||
import { getPlaceList } from '@/api/school/place'
|
import { getPlaceList } from '@/api/school/place'
|
||||||
|
|
||||||
import DialogFollow from './DialogFollow.vue'
|
import DialogFollow from './DialogFollow.vue'
|
||||||
|
import DialogSchoolInfo from './DialogSchoolInfo.vue'
|
||||||
import AMapLoader from '@amap/amap-jsapi-loader'
|
import AMapLoader from '@amap/amap-jsapi-loader'
|
||||||
import { formatDate, dateFormatter } from '@/utils/formatTime'
|
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 FlagRed from '@/assets/imgs/flag/flag_red.png'
|
||||||
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
|
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
|
||||||
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
|
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
|
||||||
@@ -150,7 +179,16 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const showSchema = computed(() => {
|
const showSchema = computed(() => {
|
||||||
const arr = [
|
const arr1 = [...props.schema]
|
||||||
|
arr1.forEach((it) => {
|
||||||
|
if (it.label.includes('日期')) {
|
||||||
|
it.dateFormat = 'YYYY-MM-DD'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
if (arr1.length % 2 != 0) {
|
||||||
|
arr1.push({})
|
||||||
|
}
|
||||||
|
const arr2 = [
|
||||||
{
|
{
|
||||||
field: 'requirement',
|
field: 'requirement',
|
||||||
label: '诉求',
|
label: '诉求',
|
||||||
@@ -163,7 +201,7 @@ const showSchema = computed(() => {
|
|||||||
isEditor: true
|
isEditor: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
return [...props.schema, ...arr]
|
return [...arr1, ...arr2]
|
||||||
})
|
})
|
||||||
|
|
||||||
const followList = ref([])
|
const followList = ref([])
|
||||||
@@ -214,8 +252,8 @@ async function open(id) {
|
|||||||
infoIndex.value = 'followRecord'
|
infoIndex.value = 'followRecord'
|
||||||
|
|
||||||
if (appStore.getAppInfo?.instanceType == 1 && !dialogMap.value) {
|
if (appStore.getAppInfo?.instanceType == 1 && !dialogMap.value) {
|
||||||
nextTick(() => {
|
nextTick(async () => {
|
||||||
getSchoolPlace()
|
await getSchoolPlace()
|
||||||
initMap(info.value)
|
initMap(info.value)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -224,11 +262,18 @@ async function open(id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const placeList = ref([])
|
function followSuccess() {
|
||||||
function getSchoolPlace() {
|
ClueApi.getClue(clueId.value).then((data) => {
|
||||||
getPlaceList().then((data) => {
|
info.value = { ...data, ...data.diyParams }
|
||||||
placeList.value = data.placeList
|
|
||||||
})
|
})
|
||||||
|
getFollowList()
|
||||||
|
emit('getList')
|
||||||
|
}
|
||||||
|
|
||||||
|
const placeList = ref([])
|
||||||
|
async function getSchoolPlace() {
|
||||||
|
const data = await getPlaceList({ placeStatus: 0 })
|
||||||
|
placeList.value = data.placeList
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultLatLng = ref({
|
const defaultLatLng = ref({
|
||||||
@@ -238,7 +283,7 @@ const defaultLatLng = ref({
|
|||||||
|
|
||||||
function initMap(data) {
|
function initMap(data) {
|
||||||
AMapLoader.load({
|
AMapLoader.load({
|
||||||
key: '2ffb0e2ea90b1df0b8be48ed66e18fc8', //设置您的key
|
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key
|
||||||
version: '2.0'
|
version: '2.0'
|
||||||
}).then((AMap) => {
|
}).then((AMap) => {
|
||||||
aMap.value = AMap
|
aMap.value = AMap
|
||||||
@@ -249,7 +294,7 @@ function initMap(data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dialogMap.value = new AMap.Map('dialogMap', {
|
dialogMap.value = new AMap.Map('dialogMap', {
|
||||||
zoom: 12,
|
zoom: 14,
|
||||||
zooms: [2, 22],
|
zooms: [2, 22],
|
||||||
center: [defaultLatLng.value.lng, defaultLatLng.value.lat]
|
center: [defaultLatLng.value.lng, defaultLatLng.value.lat]
|
||||||
})
|
})
|
||||||
@@ -285,6 +330,7 @@ function handleShowSchool() {
|
|||||||
extData: place,
|
extData: place,
|
||||||
clickable: true
|
clickable: true
|
||||||
})
|
})
|
||||||
|
marker.on('click', (ev) => showSchoolInfo(ev.target.getExtData()))
|
||||||
schoolMarkers.value.push(marker)
|
schoolMarkers.value.push(marker)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -298,11 +344,87 @@ function addmark(lat, lng, AMap) {
|
|||||||
marker.value = new AMap.Marker({
|
marker.value = new AMap.Marker({
|
||||||
position: new AMap.LngLat(lat, lng),
|
position: new AMap.LngLat(lat, lng),
|
||||||
zoom: 13,
|
zoom: 13,
|
||||||
icon: ImgPostion
|
icon: ImgPostion,
|
||||||
|
offset: [-16, -32]
|
||||||
})
|
})
|
||||||
dialogMap.value.add(marker.value)
|
dialogMap.value.add(marker.value)
|
||||||
dialogMap.value.setCenter([lat, lng], '', 500)
|
dialogMap.value.setCenter([lat, lng], '', 500)
|
||||||
|
getNearbySchool({ lat: lng, lng: lat })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const collaspeKey = ref('nearbySchool')
|
||||||
|
const nearbySchoolSearching = ref(false)
|
||||||
|
const nearbySchoolList = ref([])
|
||||||
|
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('步行数据无法确定')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const schoolInfoDialog = ref()
|
||||||
|
function showSchoolInfo(val) {
|
||||||
|
schoolInfoDialog.value.open(val)
|
||||||
|
}
|
||||||
|
|
||||||
function removeMarker() {
|
function removeMarker() {
|
||||||
dialogMap.value.remove(marker.value)
|
dialogMap.value.remove(marker.value)
|
||||||
}
|
}
|
||||||
@@ -315,7 +437,7 @@ defineExpose({
|
|||||||
|
|
||||||
const followRef = ref()
|
const followRef = ref()
|
||||||
function addFollow() {
|
function addFollow() {
|
||||||
followRef.value.open(info.value.clueId)
|
followRef.value.open(info.value.clueId, info.value.intentionState)
|
||||||
}
|
}
|
||||||
|
|
||||||
function destroyMap() {
|
function destroyMap() {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="relative">
|
<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 label="全部" name="0" />
|
||||||
<el-tab-pane name="1">
|
<el-tab-pane name="1">
|
||||||
<template #label>
|
<template #label>
|
||||||
@@ -31,6 +31,14 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="公海" name="4" />
|
<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>
|
</el-tabs>
|
||||||
<div class="absolute" style="right: 10px; top: 0">
|
<div class="absolute" style="right: 10px; top: 0">
|
||||||
<el-button plain v-hasPermi="['clue:pool:import']">导入</el-button>
|
<el-button plain v-hasPermi="['clue:pool:import']">导入</el-button>
|
||||||
@@ -39,111 +47,120 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 搜索工作栏 -->
|
<template v-if="queryType != 5">
|
||||||
<Search v-if="!loading" ref="searchRef" :schema="allSchemas.searchSchema" labelWidth="0">
|
<!-- 搜索工作栏 -->
|
||||||
<template #actionMore>
|
<Search v-if="!loading" ref="searchRef" :schema="allSchemas.searchSchema" labelWidth="0">
|
||||||
<el-button @click="getTableList" v-hasPermi="['clue:pool:search']"> 搜索 </el-button>
|
<template #actionMore>
|
||||||
<el-button @click="resetQuery" v-hasPermi="['clue:pool:reset']"> 重置 </el-button>
|
<el-button @click="getTableList" v-hasPermi="['clue:pool:search']"> 搜索 </el-button>
|
||||||
</template>
|
<el-button @click="resetQuery" v-hasPermi="['clue:pool:reset']"> 重置 </el-button>
|
||||||
</Search>
|
</template>
|
||||||
<!-- 列表 -->
|
</Search>
|
||||||
<SSTable
|
<!-- 列表 -->
|
||||||
v-if="!loading"
|
<SSTable
|
||||||
class="mt-20px"
|
v-if="!loading"
|
||||||
v-model:tableObject="tableObject"
|
class="mt-20px"
|
||||||
:tableColumns="allSchemas.tableColumns"
|
v-model:tableObject="tableObject"
|
||||||
@get-list="getTableList"
|
:tableColumns="allSchemas.tableColumns"
|
||||||
@get-checked-columns="getCheckedColumns"
|
@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 #default="{ row }">
|
<el-table-column
|
||||||
<div v-if="item.field == 'followRecord'">
|
v-for="item in showColumns"
|
||||||
<el-button
|
:key="item.field"
|
||||||
type="primary"
|
:prop="item.field"
|
||||||
text
|
:label="item.label"
|
||||||
style="padding: 0"
|
min-width="120px"
|
||||||
@click="handleFollow(row)"
|
>
|
||||||
v-hasPermi="['clue:pool:update']"
|
<template #default="{ row }">
|
||||||
>
|
<div v-if="item.field == 'followRecord'">
|
||||||
快速新增
|
<el-button
|
||||||
</el-button>
|
type="primary"
|
||||||
</div>
|
text
|
||||||
<div v-else-if="item.field == 'contact'">
|
style="padding: 0"
|
||||||
<span>{{ row[item.field] }}</span>
|
@click="handleFollow(row)"
|
||||||
<Icon class="ml-5px" icon="ep:phone" @click="makeCall(row.contact)" />
|
v-if="queryType != 4"
|
||||||
</div>
|
v-hasPermi="['clue:pool:update']"
|
||||||
<div v-else-if="item.form?.component == 'DatePicker'">
|
>
|
||||||
<span>{{ formatDate(row[item.field]) }}</span>
|
快速新增
|
||||||
</div>
|
</el-button>
|
||||||
<div v-else-if="item.field == 'remark' || item.form?.component == 'Editor'">
|
</div>
|
||||||
<p v-dompurify-html="row.remark"></p>
|
<div v-else-if="item.field == 'contact'">
|
||||||
</div>
|
<span>{{ row[item.field] }}</span>
|
||||||
<span v-else>{{ row[item.field] }}</span>
|
<Icon class="ml-5px" icon="ep:phone" @click="makeCall(row.contact)" />
|
||||||
</template>
|
</div>
|
||||||
</el-table-column>
|
<div v-else-if="item.form?.component == 'DatePicker'">
|
||||||
<el-table-column label="操作" width="200px" fixed="right">
|
<span>{{ formatDate(row[item.field]) }}</span>
|
||||||
<template #default="scope">
|
</div>
|
||||||
<el-button
|
<div v-else-if="item.field == 'remark' || item.form?.component == 'Editor'">
|
||||||
type="primary"
|
<el-popover placement="top" width="500px" trigger="click" v-if="row[item.field]">
|
||||||
link
|
<template #reference>
|
||||||
@click="handleDetail(scope.row)"
|
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||||
v-hasPermi="['clue:pool:detail']"
|
</template>
|
||||||
>
|
<div v-dompurify-html="row[item.field]"></div>
|
||||||
详情
|
</el-popover>
|
||||||
</el-button>
|
</div>
|
||||||
<template v-if="queryType != 4">
|
<span v-else>{{ row[item.field] }}</span>
|
||||||
<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>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="200px" fixed="right">
|
||||||
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
link
|
link
|
||||||
v-hasPermi="['clue:pool:gain']"
|
@click="handleDetail(scope.row)"
|
||||||
@click="handleGain(scope.row.clueId)"
|
v-hasPermi="['clue:pool:detail']"
|
||||||
>
|
>
|
||||||
获取
|
详情
|
||||||
</el-button>
|
</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>
|
||||||
</template>
|
</el-table-column>
|
||||||
</el-table-column>
|
</SSTable>
|
||||||
</SSTable>
|
</template>
|
||||||
|
|
||||||
<DialogClue
|
<DialogClue
|
||||||
v-if="!loading"
|
v-if="!loading"
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
:userOptions="userOptions"
|
:userOptions="userOptions"
|
||||||
:schema="allSchemas.formSchema"
|
:schema="allSchemas.formSchema"
|
||||||
@sucess="getTableList"
|
@success="getTableList"
|
||||||
/>
|
/>
|
||||||
<DrawerClue
|
<DrawerClue
|
||||||
v-if="!loading"
|
v-if="!loading"
|
||||||
@@ -158,11 +175,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="CluePool">
|
<script setup name="CluePool">
|
||||||
|
import { useAppStore } from '@/store/modules/app'
|
||||||
import { getSimpleFieldList } from '@/api/clue/clueField'
|
import { getSimpleFieldList } from '@/api/clue/clueField'
|
||||||
import DialogClue from './Comp/DialogClue.vue'
|
import DialogClue from './Comp/DialogClue.vue'
|
||||||
import DrawerClue from './Comp/DrawerClue.vue'
|
import DrawerClue from './Comp/DrawerClue.vue'
|
||||||
import DialogSuccess from './Comp/DialogSuccess.vue'
|
import DialogSuccess from './Comp/DialogSuccess.vue'
|
||||||
import DialogFollow from './Comp/DialogFollow.vue'
|
import DialogFollow from './Comp/DialogFollow.vue'
|
||||||
|
import ClueMap from './Comp/ClueMap.vue'
|
||||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||||
|
|
||||||
import { removeNullField } from '@/utils'
|
import { removeNullField } from '@/utils'
|
||||||
@@ -171,6 +190,7 @@ import { formatDate } from '@/utils/formatTime'
|
|||||||
import * as ClueApi from '@/api/clue'
|
import * as ClueApi from '@/api/clue'
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
const appStore = useAppStore()
|
||||||
|
|
||||||
const searchRef = ref()
|
const searchRef = ref()
|
||||||
const queryType = ref('2')
|
const queryType = ref('2')
|
||||||
@@ -207,20 +227,34 @@ const tableObject = ref({
|
|||||||
loading: false,
|
loading: false,
|
||||||
total: 1,
|
total: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
currentPage: 1
|
pageNo: 1
|
||||||
})
|
})
|
||||||
|
|
||||||
const showColumns = ref([])
|
const showColumns = ref([])
|
||||||
|
|
||||||
// 初始化表格
|
// 初始化表格
|
||||||
function getCheckedColumns(list) {
|
function getCheckedColumns(list) {
|
||||||
showColumns.value = 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() {
|
function resetQuery() {
|
||||||
searchRef.value.reset()
|
nextTick(() => {
|
||||||
tableObject.value.currentPage = 1
|
searchRef.value && searchRef.value.reset()
|
||||||
getTableList()
|
tableObject.value.pageNo = 1
|
||||||
|
getTableList()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getTableList() {
|
async function getTableList() {
|
||||||
@@ -231,7 +265,7 @@ async function getTableList() {
|
|||||||
const queryParams = await searchRef.value.getFormModel()
|
const queryParams = await searchRef.value.getFormModel()
|
||||||
const params = {
|
const params = {
|
||||||
...queryParams,
|
...queryParams,
|
||||||
pageNo: tableObject.value.currentPage,
|
pageNo: tableObject.value.pageNo,
|
||||||
pageSize: tableObject.value.pageSize,
|
pageSize: tableObject.value.pageSize,
|
||||||
queryType: queryType.value
|
queryType: queryType.value
|
||||||
}
|
}
|
||||||
@@ -268,7 +302,7 @@ function handleDetail(row) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleFollow(row) {
|
function handleFollow(row) {
|
||||||
followRef.value.open(row.clueId)
|
followRef.value.open(row.clueId, row.intentionState)
|
||||||
}
|
}
|
||||||
|
|
||||||
async function makeCall(phone) {
|
async function makeCall(phone) {
|
||||||
@@ -317,6 +351,7 @@ function handleGain(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const userOptions = ref([])
|
const userOptions = ref([])
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getUserOption().then((data) => {
|
getUserOption().then((data) => {
|
||||||
userOptions.value = data
|
userOptions.value = data
|
||||||
|
|||||||
@@ -19,9 +19,9 @@
|
|||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in resourceOptions"
|
v-for="item in resourceOptions"
|
||||||
:key="item.value"
|
:key="item.sourceId"
|
||||||
:label="item.label"
|
:label="item.sourceName"
|
||||||
:value="item.value"
|
:value="item.sourceId"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
<span>{{ row.channel }}</span>
|
<span>{{ row.channel }}</span>
|
||||||
@@ -36,21 +36,23 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" width="100px">
|
<el-table-column label="操作" width="100px">
|
||||||
<template #default="{ $index }">
|
<template #default="{ $index }">
|
||||||
<el-button type="primary" style="padding: 0px" text @click="handleRemove($index)"
|
<el-button type="primary" style="padding: 0px" text @click="handleRemove($index)">
|
||||||
>删除</el-button
|
删除
|
||||||
>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="mt-20px flex justify-center">
|
<div class="mt-20px flex justify-center">
|
||||||
<el-button type="primary" @click="handleInsert">新增规则</el-button>
|
<el-button type="primary" @click="handleInsert">新增规则</el-button>
|
||||||
<el-button type="primary" @click="onSubmit">保存</el-button>
|
<el-button :disabled="formLoading" type="primary" @click="onSubmit">保存</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="ClueSet">
|
<script setup name="ClueSet">
|
||||||
import { getClueGainRuleList, deleteClueGainRule } from '@/api/clue/clueGetSet'
|
import { getClueGainRuleList, deleteClueGainRule, saveClueGainRule } from '@/api/clue/clueGetSet'
|
||||||
|
import { getSimpleSourceList as getResourceOptions } from '@/api/clue/source'
|
||||||
|
import { listToTree } from '@/utils/tree.ts'
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
@@ -59,6 +61,12 @@ const list = ref([])
|
|||||||
const loading = ref(false)
|
const loading = ref(false)
|
||||||
const resourceOptions = ref([])
|
const resourceOptions = ref([])
|
||||||
|
|
||||||
|
function getOptions() {
|
||||||
|
getResourceOptions().then((data) => {
|
||||||
|
resourceOptions.value = listToTree(data, { id: 'sourceId', pId: 'parentId' })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
async function getList() {
|
async function getList() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
@@ -73,8 +81,20 @@ function handleInsert() {
|
|||||||
list.value.push({ source: '', url: '', edit: true, status: 0 })
|
list.value.push({ source: '', url: '', edit: true, status: 0 })
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSubmit() {
|
const formLoading = ref(false)
|
||||||
console.log('保存成功')
|
async function onSubmit() {
|
||||||
|
if (list.value.some((it) => !it.source || !it.resource || !it.channel)) {
|
||||||
|
message.info('请将表格数据填写完整!')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
formLoading.value = true
|
||||||
|
try {
|
||||||
|
await saveClueGainRule(list.value.map((it) => ({ ...it, channel: it.source })))
|
||||||
|
message.success('保存成功')
|
||||||
|
getList()
|
||||||
|
} finally {
|
||||||
|
formLoading.value = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleRemove(idx) {
|
async function handleRemove(idx) {
|
||||||
@@ -101,6 +121,7 @@ function handleChange(row) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
getOptions()
|
||||||
getList()
|
getList()
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -50,6 +50,7 @@
|
|||||||
>
|
>
|
||||||
全选
|
全选
|
||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
|
<!-- 得根据自动获得的线索做配置 -->
|
||||||
<el-checkbox-group v-model="form.resource" @change="resourceCheckedChange">
|
<el-checkbox-group v-model="form.resource" @change="resourceCheckedChange">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
v-for="(item, index) in resourceOptions"
|
v-for="(item, index) in resourceOptions"
|
||||||
@@ -63,7 +64,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="权重配置">
|
<el-form-item label="权重配置">
|
||||||
<el-input v-model="form.value" type="number" placeholder="请输入权重">
|
<el-input v-model="form.weight" type="number" placeholder="请输入权重">
|
||||||
<template #suffix> % </template>
|
<template #suffix> % </template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -78,6 +79,7 @@
|
|||||||
|
|
||||||
<script setup name="ClueSend">
|
<script setup name="ClueSend">
|
||||||
import { getUserPage } from '@/api/system/user'
|
import { getUserPage } from '@/api/system/user'
|
||||||
|
import { getClueDistributeRuleByUser } from '@/api/clue/clueGetSet'
|
||||||
|
|
||||||
// const message = useMessage() // 消息弹窗
|
// const message = useMessage() // 消息弹窗
|
||||||
// const { t } = useI18n() // 国际化
|
// const { t } = useI18n() // 国际化
|
||||||
@@ -102,7 +104,7 @@ const form = ref({
|
|||||||
isAuto: 1,
|
isAuto: 1,
|
||||||
users: [1, 2],
|
users: [1, 2],
|
||||||
resource: [3],
|
resource: [3],
|
||||||
sendTime: '00:00'
|
weight: undefined
|
||||||
})
|
})
|
||||||
const rules = ref({})
|
const rules = ref({})
|
||||||
|
|
||||||
@@ -145,7 +147,9 @@ function resourceCheckedChange(val) {
|
|||||||
|
|
||||||
function handleRowClick(row) {
|
function handleRowClick(row) {
|
||||||
currentRowId.value = row.id
|
currentRowId.value = row.id
|
||||||
form.value = { ...row }
|
getClueDistributeRuleByUser({ employeeId: row.id }).then((data) => {
|
||||||
|
form.value = data
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -18,13 +18,13 @@
|
|||||||
</el-radio>
|
</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="getConfig('deliveryAutoStartPurchaseConfig')">
|
<el-form-item v-if="getConfig('deliveryAutoStartPurchaseConfig') && props.appType == 2">
|
||||||
<template #label>
|
<template #label>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
v-if="getConfig('deliveryAutoStartPurchaseConfig').remark"
|
v-if="getConfig('deliveryAutoStartPurchaseConfig').remark"
|
||||||
:message="getConfig('deliveryAutoStartPurchaseConfig').remark"
|
:message="getConfig('deliveryAutoStartPurchaseConfig').remark"
|
||||||
/>
|
/>
|
||||||
<span>发货自动发起采购</span>
|
<span>允许负库存</span>
|
||||||
</template>
|
</template>
|
||||||
<el-radio-group v-model="form.deliveryAutoStartPurchaseConfig">
|
<el-radio-group v-model="form.deliveryAutoStartPurchaseConfig">
|
||||||
<el-radio
|
<el-radio
|
||||||
@@ -66,6 +66,13 @@ import * as ConfigApi from '@/api/system/set'
|
|||||||
|
|
||||||
const message = useMessage()
|
const message = useMessage()
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
appType: {
|
||||||
|
type: Number,
|
||||||
|
default: 1
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const form = ref({})
|
const form = ref({})
|
||||||
|
|
||||||
const configList = ref([])
|
const configList = ref([])
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<el-tab-pane label="线索来源" :name="15" v-if="checkPermi(['clue:setting:clue-resource'])">
|
<el-tab-pane label="线索来源" :name="15" v-if="checkPermi(['clue:setting:clue-resource'])">
|
||||||
<ClueSource v-if="tabIndex == 15" />
|
<ClueSource v-if="tabIndex == 15" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane
|
<!-- <el-tab-pane
|
||||||
label="线索获取规则"
|
label="线索获取规则"
|
||||||
:name="20"
|
:name="20"
|
||||||
v-if="checkPermi(['clue:setting:clue-get-rules'])"
|
v-if="checkPermi(['clue:setting:clue-get-rules'])"
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
v-if="checkPermi(['clue:setting:clue-send-rules'])"
|
v-if="checkPermi(['clue:setting:clue-send-rules'])"
|
||||||
>
|
>
|
||||||
<ClueSend v-if="tabIndex == 30" />
|
<ClueSend v-if="tabIndex == 30" />
|
||||||
</el-tab-pane>
|
</el-tab-pane> -->
|
||||||
<el-tab-pane label="意向状态" :name="35" v-if="checkPermi(['clue:setting:intention-status'])">
|
<el-tab-pane label="意向状态" :name="35" v-if="checkPermi(['clue:setting:intention-status'])">
|
||||||
<IntentionStatus v-if="tabIndex == 35" />
|
<IntentionStatus v-if="tabIndex == 35" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<OtherPayType v-if="tabIndex == 37" />
|
<OtherPayType v-if="tabIndex == 37" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="常规设置" :name="40" v-if="checkPermi(['clue:setting:general-setting'])">
|
<el-tab-pane label="常规设置" :name="40" v-if="checkPermi(['clue:setting:general-setting'])">
|
||||||
<GeneralSet v-if="tabIndex == 40" />
|
<GeneralSet v-if="tabIndex == 40" :appType="appStore.getAppInfo?.instanceType" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<!-- <el-tab-pane label="消息通知" :name="50" v-if="checkPermi(['mall:setting:prod'])">
|
<!-- <el-tab-pane label="消息通知" :name="50" v-if="checkPermi(['mall:setting:prod'])">
|
||||||
<MsgSend v-if="tabIndex == 50" />
|
<MsgSend v-if="tabIndex == 50" />
|
||||||
@@ -47,8 +47,8 @@
|
|||||||
import FieldClue from './Comp/FieldClue.vue'
|
import FieldClue from './Comp/FieldClue.vue'
|
||||||
import FieldOrder from './Comp/FieldOrder.vue'
|
import FieldOrder from './Comp/FieldOrder.vue'
|
||||||
import ClueSource from './Comp/ClueSource.vue'
|
import ClueSource from './Comp/ClueSource.vue'
|
||||||
import ClueGet from './Comp/ClueGet.vue'
|
// import ClueGet from './Comp/ClueGet.vue'
|
||||||
import ClueSend from './Comp/ClueSend.vue'
|
// import ClueSend from './Comp/ClueSend.vue'
|
||||||
// import MsgSend from './Comp/MsgSend.vue'
|
// import MsgSend from './Comp/MsgSend.vue'
|
||||||
import IntentionStatus from './Comp/IntentionStatus.vue'
|
import IntentionStatus from './Comp/IntentionStatus.vue'
|
||||||
import ExtraFeeType from './Comp/ExtraFeeType.vue'
|
import ExtraFeeType from './Comp/ExtraFeeType.vue'
|
||||||
@@ -56,6 +56,10 @@ import OtherPayType from './Comp/OtherPayType.vue'
|
|||||||
import GeneralSet from './Comp/GeneralSet.vue'
|
import GeneralSet from './Comp/GeneralSet.vue'
|
||||||
import { checkPermi } from '@/utils/permission'
|
import { checkPermi } from '@/utils/permission'
|
||||||
|
|
||||||
|
import { useAppStore } from '@/store/modules/app'
|
||||||
|
|
||||||
|
const appStore = useAppStore()
|
||||||
|
|
||||||
const tabIndex = ref(0)
|
const tabIndex = ref(0)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
<CountTo
|
<CountTo
|
||||||
class="text-20px number-font"
|
class="text-20px number-font"
|
||||||
:start-val="0"
|
:start-val="0"
|
||||||
:end-val="10"
|
:end-val="clueInfo.todayFollowingNum"
|
||||||
:duration="2600"
|
:duration="2600"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
<CountTo
|
<CountTo
|
||||||
class="text-20px number-font"
|
class="text-20px number-font"
|
||||||
:start-val="0"
|
:start-val="0"
|
||||||
:end-val="25"
|
:end-val="clueInfo.todayFollowedNum"
|
||||||
:duration="2600"
|
:duration="2600"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
<CountTo
|
<CountTo
|
||||||
class="text-20px number-font"
|
class="text-20px number-font"
|
||||||
:start-val="0"
|
:start-val="0"
|
||||||
:end-val="2"
|
:end-val="clueInfo.todaySignedNum"
|
||||||
:duration="2600"
|
:duration="2600"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
<CountTo
|
<CountTo
|
||||||
class="text-20px number-font"
|
class="text-20px number-font"
|
||||||
:start-val="0"
|
:start-val="0"
|
||||||
:end-val="235"
|
:end-val="clueInfo.outFollowNum"
|
||||||
:duration="2600"
|
:duration="2600"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
<CountTo
|
<CountTo
|
||||||
class="text-20px number-font"
|
class="text-20px number-font"
|
||||||
:start-val="0"
|
:start-val="0"
|
||||||
:end-val="0"
|
:end-val="clueInfo.unknownNum"
|
||||||
:duration="2600"
|
:duration="2600"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -67,8 +67,61 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</el-skeleton>
|
</el-skeleton>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-row class="mt-10px" :gutter="10" justify="space-between">
|
<div class="mt-10px flex">
|
||||||
<!-- <el-col :xl="6" :lg="6" :md="12" :sm="12" :xs="24" class="mb-10px">
|
<el-card shadow="never" class="flex-1">
|
||||||
|
<template #header>
|
||||||
|
<div class="flex justify-between">
|
||||||
|
<span>成交率</span>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<el-skeleton :loading="loading" animated>
|
||||||
|
<el-skeleton :loading="loading" animated>
|
||||||
|
<Echart :options="lineOptionsData" :height="280" />
|
||||||
|
</el-skeleton>
|
||||||
|
</el-skeleton>
|
||||||
|
</el-card>
|
||||||
|
<el-card shadow="never" class="ml-10px">
|
||||||
|
<template #header>
|
||||||
|
<div class="flex justify-between items-center">
|
||||||
|
<span>跟进榜Top10</span>
|
||||||
|
<el-radio-group v-model="followDate" size="small" @change="getFollowList">
|
||||||
|
<el-radio :label="1">本日</el-radio>
|
||||||
|
<el-radio :label="2">本月</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<el-skeleton :loading="loading" animated>
|
||||||
|
<ul class="follow-wrap">
|
||||||
|
<!-- <TransitionGroup name="flip"> -->
|
||||||
|
<li
|
||||||
|
class="follow-item number-font mb-18px text-14px"
|
||||||
|
v-for="(item, index) in followList"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<span class="mr-10px">NO.{{ index + 1 }}</span>
|
||||||
|
<span class="mr-10px">{{ item.username }}</span>
|
||||||
|
<span>已跟进{{ item.followNum }}条线索</span>
|
||||||
|
</li>
|
||||||
|
<!-- <br /> -->
|
||||||
|
<!-- </TransitionGroup> -->
|
||||||
|
</ul>
|
||||||
|
</el-skeleton>
|
||||||
|
</el-card>
|
||||||
|
<el-card shadow="never" class="ml-10px">
|
||||||
|
<template #header>
|
||||||
|
<div class="flex justify-between"> 本月成交榜Top10 </div>
|
||||||
|
</template>
|
||||||
|
<el-skeleton :loading="loading" animated>
|
||||||
|
<el-table :data="signList" size="small">
|
||||||
|
<el-table-column type="index" />
|
||||||
|
<el-table-column prop="username" label="姓名" width="100" />
|
||||||
|
<el-table-column prop="followNum" label="成交数量" width="70" />
|
||||||
|
<el-table-column prop="deptName" label="所属组织" />
|
||||||
|
</el-table>
|
||||||
|
</el-skeleton>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
<!-- <el-col :xl="6" :lg="6" :md="12" :sm="12" :xs="24" class="mb-10px">
|
||||||
<el-card shadow="never">
|
<el-card shadow="never">
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="flex justify-between ">
|
<div class="flex justify-between ">
|
||||||
@@ -80,65 +133,6 @@
|
|||||||
</el-skeleton>
|
</el-skeleton>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col> -->
|
</el-col> -->
|
||||||
<el-col :xl="8" :lg="8" :md="12" :sm="12" :xs="24" class="mb-10px">
|
|
||||||
<el-card shadow="never">
|
|
||||||
<template #header>
|
|
||||||
<div class="flex justify-between">
|
|
||||||
<span>成交率</span>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<el-skeleton :loading="loading" animated>
|
|
||||||
<el-skeleton :loading="loading" animated>
|
|
||||||
<Echart :options="lineOptionsData" :height="280" />
|
|
||||||
</el-skeleton>
|
|
||||||
</el-skeleton>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
<el-col :xl="8" :lg="8" :md="12" :sm="12" :xs="24" class="mb-10px">
|
|
||||||
<el-card shadow="never">
|
|
||||||
<template #header>
|
|
||||||
<div class="flex justify-between items-center">
|
|
||||||
<span>跟进榜Top10</span>
|
|
||||||
<el-radio-group v-model="followDate" size="small">
|
|
||||||
<el-radio label="day">本日</el-radio>
|
|
||||||
<el-radio label="month">本月</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
<el-skeleton :loading="loading" animated>
|
|
||||||
<ul class="follow-wrap">
|
|
||||||
<!-- <TransitionGroup name="flip"> -->
|
|
||||||
<li
|
|
||||||
class="follow-item number-font mb-18px text-14px"
|
|
||||||
v-for="(item, index) in followList"
|
|
||||||
:key="index"
|
|
||||||
>
|
|
||||||
<span class="mr-10px">NO.{{ index + 1 }}</span>
|
|
||||||
<span class="mr-10px">{{ item.name }}</span>
|
|
||||||
<span>已跟进{{ item.count }}条线索</span>
|
|
||||||
</li>
|
|
||||||
<br />
|
|
||||||
<!-- </TransitionGroup> -->
|
|
||||||
</ul>
|
|
||||||
</el-skeleton>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
<el-col :xl="8" :lg="8" :md="12" :sm="12" :xs="24" class="mb-10px">
|
|
||||||
<el-card shadow="never">
|
|
||||||
<template #header>
|
|
||||||
<div class="flex justify-between"> 本月成交榜Top10 </div>
|
|
||||||
</template>
|
|
||||||
<el-skeleton :loading="loading" animated>
|
|
||||||
<el-table :data="followList" size="small">
|
|
||||||
<el-table-column prop="sort" label="排名" width="50" />
|
|
||||||
<el-table-column prop="name" label="姓名" width="70" />
|
|
||||||
<el-table-column prop="count" label="成交数量" width="70" />
|
|
||||||
<el-table-column prop="orgName" label="所属组织" />
|
|
||||||
</el-table>
|
|
||||||
</el-skeleton>
|
|
||||||
</el-card>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts" name="Home">
|
<script setup lang="ts" name="Home">
|
||||||
@@ -146,7 +140,8 @@ import { set } from 'lodash-es'
|
|||||||
import { EChartsOption } from 'echarts'
|
import { EChartsOption } from 'echarts'
|
||||||
import { useUserStore } from '@/store/modules/user'
|
import { useUserStore } from '@/store/modules/user'
|
||||||
import avatarImg from '@/assets/imgs/avatar.gif'
|
import avatarImg from '@/assets/imgs/avatar.gif'
|
||||||
import { pieOptions, lineOptions } from './echarts-data'
|
import { lineOptions } from './echarts-data'
|
||||||
|
import * as HomeApi from '@/api/home/index'
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
@@ -154,59 +149,46 @@ const loading = ref(false)
|
|||||||
const avatar = userStore.getUser.avatar ? userStore.getUser.avatar : avatarImg
|
const avatar = userStore.getUser.avatar ? userStore.getUser.avatar : avatarImg
|
||||||
const username = userStore.getUser.nickname
|
const username = userStore.getUser.nickname
|
||||||
|
|
||||||
const followDate = ref('day')
|
const followDate = ref(1)
|
||||||
|
|
||||||
// 成交线索来源
|
// 成交线索来源
|
||||||
const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption
|
// const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption
|
||||||
const getSaleClueSource = async () => {
|
// const getSaleClueSource = async () => {
|
||||||
const data = [
|
// const data = [
|
||||||
{ value: 335, name: '宝典' },
|
// { value: 335, name: '宝典' },
|
||||||
{ value: 310, name: '一点通' },
|
// { value: 310, name: '一点通' },
|
||||||
{ value: 234, name: '抖音' },
|
// { value: 234, name: '抖音' },
|
||||||
{ value: 135, name: '小红书' },
|
// { value: 135, name: '小红书' },
|
||||||
{ value: 1548, name: '转介绍' }
|
// { value: 1548, name: '转介绍' }
|
||||||
]
|
// ]
|
||||||
set(
|
// set(
|
||||||
pieOptionsData,
|
// pieOptionsData,
|
||||||
'legend.data',
|
// 'legend.data',
|
||||||
data.map((v) => t(v.name))
|
// data.map((v) => t(v.name))
|
||||||
)
|
// )
|
||||||
pieOptionsData!.series![0].data = data.map((v) => {
|
// pieOptionsData!.series![0].data = data.map((v) => {
|
||||||
return {
|
// return {
|
||||||
name: t(v.name),
|
// name: t(v.name),
|
||||||
value: v.value
|
// value: v.value
|
||||||
}
|
// }
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 成交率
|
// 成交率
|
||||||
const lineOptionsData = reactive<EChartsOption>(lineOptions) as EChartsOption
|
const lineOptionsData = reactive<EChartsOption>(lineOptions) as EChartsOption
|
||||||
const getMonthlySaleRate = async () => {
|
const getMonthlySaleRate = async () => {
|
||||||
const data = [
|
const data = await HomeApi.getClueSignSignRate()
|
||||||
{ estimate: 100, actual: 120, name: 'analysis.january' },
|
|
||||||
{ estimate: 120, actual: 82, name: 'analysis.february' },
|
|
||||||
{ estimate: 161, actual: 91, name: 'analysis.march' },
|
|
||||||
{ estimate: 134, actual: 154, name: 'analysis.april' },
|
|
||||||
{ estimate: 105, actual: 162, name: 'analysis.may' },
|
|
||||||
{ estimate: 160, actual: 140, name: 'analysis.june' },
|
|
||||||
{ estimate: 165, actual: 145, name: 'analysis.july' },
|
|
||||||
{ estimate: 114, actual: 250, name: 'analysis.august' },
|
|
||||||
{ estimate: 163, actual: 134, name: 'analysis.september' },
|
|
||||||
{ estimate: 185, actual: 56, name: 'analysis.october' },
|
|
||||||
{ estimate: 118, actual: 99, name: 'analysis.november' },
|
|
||||||
{ estimate: 123, actual: 123, name: 'analysis.december' }
|
|
||||||
]
|
|
||||||
set(
|
set(
|
||||||
lineOptionsData,
|
lineOptionsData,
|
||||||
'xAxis.data',
|
'xAxis.data',
|
||||||
data.map((v) => t(v.name))
|
data.map((v) => t(v.month))
|
||||||
)
|
)
|
||||||
set(lineOptionsData, 'series', [
|
set(lineOptionsData, 'series', [
|
||||||
{
|
{
|
||||||
name: '个人成交率',
|
name: '个人成交率',
|
||||||
smooth: true,
|
smooth: true,
|
||||||
type: 'line',
|
type: 'line',
|
||||||
data: data.map((v) => v.estimate),
|
data: data.map((v) => v.personalRate),
|
||||||
animationDuration: 2800,
|
animationDuration: 2800,
|
||||||
animationEasing: 'cubicInOut'
|
animationEasing: 'cubicInOut'
|
||||||
},
|
},
|
||||||
@@ -215,33 +197,50 @@ const getMonthlySaleRate = async () => {
|
|||||||
smooth: true,
|
smooth: true,
|
||||||
type: 'line',
|
type: 'line',
|
||||||
itemStyle: {},
|
itemStyle: {},
|
||||||
data: data.map((v) => v.actual),
|
data: data.map((v) => v.avgRate),
|
||||||
animationDuration: 2800,
|
animationDuration: 2800,
|
||||||
animationEasing: 'quadraticOut'
|
animationEasing: 'quadraticOut'
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
const followList = ref([
|
const followList = ref<any>([])
|
||||||
{ sort: 1, name: '张三', count: 12, orgName: '销售1组' },
|
|
||||||
{ sort: 2, name: '张三', count: 11, orgName: '销售3组' },
|
const clueInfo = ref({
|
||||||
{ sort: 3, name: '张三', count: 11, orgName: '销售1组' },
|
todayFollowingNum: 0,
|
||||||
{ sort: 4, name: '张三', count: 10, orgName: '销售1组' },
|
todayFollowedNum: 0,
|
||||||
{ sort: 5, name: '张三', count: 2, orgName: '销售2组' },
|
todaySignedNum: 0,
|
||||||
{ sort: 6, name: '张三', count: 1, orgName: '销售1组' },
|
outFollowNum: 0,
|
||||||
{ sort: 2, name: '张三', count: 11, orgName: '销售3组' },
|
unknownNum: 0
|
||||||
{ sort: 3, name: '张三', count: 11, orgName: '销售1组' },
|
})
|
||||||
{ sort: 4, name: '张三', count: 10, orgName: '销售1组' },
|
|
||||||
{ sort: 5, name: '张三', count: 2, orgName: '销售2组' },
|
function getClueInfo() {
|
||||||
{ sort: 6, name: '张三', count: 1, orgName: '销售1组' }
|
HomeApi.getUserClueCount().then((data) => {
|
||||||
])
|
clueInfo.value = data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFollowList() {
|
||||||
|
HomeApi.getClueFollowRank({ type: followDate.value }).then((data) => {
|
||||||
|
followList.value = data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const signList = ref([])
|
||||||
|
function getSignList() {
|
||||||
|
HomeApi.getClueSignSignRank().then((data) => {
|
||||||
|
signList.value = data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const getAllApi = async () => {
|
const getAllApi = async () => {
|
||||||
await Promise.all([getSaleClueSource(), getMonthlySaleRate()])
|
await Promise.all([getClueInfo(), getSignList(), getMonthlySaleRate(), getFollowList()])
|
||||||
loading.value = false
|
loading.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
getAllApi()
|
onMounted(() => {
|
||||||
|
getAllApi()
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -42,25 +42,7 @@ export const lineOptions: EChartsOption = {
|
|||||||
show: false
|
show: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
series: [
|
series: []
|
||||||
{
|
|
||||||
name: '成交率',
|
|
||||||
smooth: true,
|
|
||||||
type: 'line',
|
|
||||||
data: [100, 120, 161, 134, 105, 160, 165, 114, 163, 185, 118, 123],
|
|
||||||
animationDuration: 2800,
|
|
||||||
animationEasing: 'cubicInOut'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: t('analysis.actual'),
|
|
||||||
smooth: true,
|
|
||||||
type: 'line',
|
|
||||||
itemStyle: {},
|
|
||||||
data: [120, 82, 91, 154, 162, 140, 145, 250, 134, 56, 99, 123],
|
|
||||||
animationDuration: 2800,
|
|
||||||
animationEasing: 'quadraticOut'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const pieOptions: EChartsOption = {
|
export const pieOptions: EChartsOption = {
|
||||||
|
|||||||
@@ -50,9 +50,9 @@
|
|||||||
<!-- 账号登录 -->
|
<!-- 账号登录 -->
|
||||||
<LoginForm class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" />
|
<LoginForm class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" />
|
||||||
<!-- 手机登录 -->
|
<!-- 手机登录 -->
|
||||||
<MobileForm class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" />
|
<!-- <MobileForm class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" /> -->
|
||||||
<!-- 二维码登录 -->
|
<!-- 二维码登录 -->
|
||||||
<QrCodeForm class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" />
|
<!-- <QrCodeForm class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" /> -->
|
||||||
<!-- 注册 -->
|
<!-- 注册 -->
|
||||||
<!-- <RegisterForm class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" /> -->
|
<!-- <RegisterForm class="p-20px h-auto m-auto <xl:(rounded-3xl light:bg-white)" /> -->
|
||||||
<!-- 三方登录 -->
|
<!-- 三方登录 -->
|
||||||
@@ -70,7 +70,7 @@ import { useDesign } from '@/hooks/web/useDesign'
|
|||||||
import { useAppStore } from '@/store/modules/app'
|
import { useAppStore } from '@/store/modules/app'
|
||||||
import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
|
import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
|
||||||
|
|
||||||
import { LoginForm, MobileForm, QrCodeForm } from './components'
|
import { LoginForm } from './components'
|
||||||
|
|
||||||
import soups from './components/soup.js'
|
import soups from './components/soup.js'
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@
|
|||||||
mode="pop"
|
mode="pop"
|
||||||
@success="handleLogin"
|
@success="handleLogin"
|
||||||
/>
|
/>
|
||||||
<el-col :span="24" style="padding-left: 10px; padding-right: 10px">
|
<el-col v-if="showOtherLogin" :span="24" style="padding-left: 10px; padding-right: 10px">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-row :gutter="5" justify="space-between" style="width: 100%">
|
<el-row :gutter="5" justify="space-between" style="width: 100%">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -131,6 +131,7 @@ const verify = ref()
|
|||||||
const captchaType = ref('blockPuzzle') // blockPuzzle 滑块 clickWord 点击文字
|
const captchaType = ref('blockPuzzle') // blockPuzzle 滑块 clickWord 点击文字
|
||||||
|
|
||||||
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN)
|
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN)
|
||||||
|
const showOtherLogin = false
|
||||||
|
|
||||||
const LoginRules = {
|
const LoginRules = {
|
||||||
username: [required],
|
username: [required],
|
||||||
@@ -143,8 +144,8 @@ const loginData = reactive({
|
|||||||
loginForm: {
|
loginForm: {
|
||||||
tenantId: undefined,
|
tenantId: undefined,
|
||||||
instanceId: undefined,
|
instanceId: undefined,
|
||||||
username: 'admin',
|
username: '',
|
||||||
password: 'admin123',
|
password: '',
|
||||||
captchaVerification: '',
|
captchaVerification: '',
|
||||||
rememberMe: true
|
rememberMe: true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-form inline :model="searchForm" class="-mb-15px" label-width="0">
|
<el-form inline :model="searchForm" class="-mb-15px" label-width="0">
|
||||||
|
<el-form-item>
|
||||||
|
<el-select v-model="searchForm.changeType" placeholder="变动类型" clearable filterable>
|
||||||
|
<el-option label="入库" :value="1" />
|
||||||
|
<el-option label="出库" :value="2" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="searchForm.productId"
|
v-model="searchForm.productId"
|
||||||
@@ -43,6 +49,10 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-input v-model="searchForm.batchNo" placeholder="批次号" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="handleSearch"> 搜索 </el-button>
|
<el-button @click="handleSearch"> 搜索 </el-button>
|
||||||
<el-button @click="resetQuery"> 重置 </el-button>
|
<el-button @click="resetQuery"> 重置 </el-button>
|
||||||
@@ -53,17 +63,26 @@
|
|||||||
<el-table-column type="index" width="50px" />
|
<el-table-column type="index" width="50px" />
|
||||||
<el-table-column prop="productName" label="产品名称" />
|
<el-table-column prop="productName" label="产品名称" />
|
||||||
<el-table-column prop="specsName" label="规格" />
|
<el-table-column prop="specsName" label="规格" />
|
||||||
<el-table-column label="变动类型">
|
<el-table-column label="变动类型" width="90px">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
{{ ['', '入库', '出库'][row.changeType] }}
|
{{ ['', '入库', '出库'][row.changeType] }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="num" label="数量" />
|
<el-table-column prop="num" label="变动数量" width="90px" />
|
||||||
<el-table-column prop="money" label="金额" />
|
<el-table-column prop="batchNo" label="批次号" />
|
||||||
<el-table-column prop="changeTime" label="变动时间" :formatter="dateFormatter" />
|
<el-table-column prop="changeTime" label="变动时间" :formatter="dateFormatter" />
|
||||||
<el-table-column prop="changeUserName" label="变动人员" />
|
<el-table-column prop="changeUserName" label="变动人员" />
|
||||||
<el-table-column prop="warehouseName" label="所属仓库" />
|
<el-table-column prop="warehouseName" label="所属仓库" />
|
||||||
<el-table-column prop="remark" label="备注" />
|
<el-table-column prop="remark" label="备注">
|
||||||
|
<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>
|
</el-table>
|
||||||
<Pagination
|
<Pagination
|
||||||
v-model:limit="searchForm.pageSize"
|
v-model:limit="searchForm.pageSize"
|
||||||
@@ -78,11 +97,14 @@
|
|||||||
import { dateFormatter } from '@/utils/formatTime'
|
import { dateFormatter } from '@/utils/formatTime'
|
||||||
import { getSimpleWarehouseList, getInventoryRecord } from '@/api/mall/warehouse'
|
import { getSimpleWarehouseList, getInventoryRecord } from '@/api/mall/warehouse'
|
||||||
import { getSimpleProductList } from '@/api/mall/product'
|
import { getSimpleProductList } from '@/api/mall/product'
|
||||||
|
import { removeNullField } from '@/utils'
|
||||||
|
|
||||||
const searchForm = ref({
|
const searchForm = ref({
|
||||||
pproductId: undefined,
|
pproductId: undefined,
|
||||||
specsId: undefined,
|
specsId: undefined,
|
||||||
warehouseId: undefined,
|
warehouseId: undefined,
|
||||||
|
changeType: undefined,
|
||||||
|
batchNo: undefined,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 20
|
pageSize: 20
|
||||||
})
|
})
|
||||||
@@ -102,6 +124,8 @@ function resetQuery() {
|
|||||||
productId: undefined,
|
productId: undefined,
|
||||||
specsId: undefined,
|
specsId: undefined,
|
||||||
warehouseId: undefined,
|
warehouseId: undefined,
|
||||||
|
changeType: undefined,
|
||||||
|
batchNo: undefined,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 20
|
pageSize: 20
|
||||||
}
|
}
|
||||||
@@ -133,7 +157,7 @@ function changeProd(val) {
|
|||||||
async function getList() {
|
async function getList() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const data = await getInventoryRecord(searchForm.value)
|
const data = await getInventoryRecord(removeNullField(searchForm.value))
|
||||||
tableList.value = data.list
|
tableList.value = data.list
|
||||||
total.value = data.total
|
total.value = data.total
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -387,14 +387,16 @@ function onSubmit() {
|
|||||||
const element = diyFieldList.value[i]
|
const element = diyFieldList.value[i]
|
||||||
data.diyParams[element.field] = data[element.field]
|
data.diyParams[element.field] = data[element.field]
|
||||||
}
|
}
|
||||||
const id = route.query.id
|
const id = route.query.id || form.value.productId
|
||||||
if (!id) {
|
if (!id) {
|
||||||
await ProductApi.createProduct(data)
|
const resp = await ProductApi.createProduct(data)
|
||||||
message.success(t('common.createSuccess'))
|
message.success(t('common.createSuccess'))
|
||||||
|
form.value.productId = resp
|
||||||
} else {
|
} else {
|
||||||
await ProductApi.updateProduct(data)
|
await ProductApi.updateProduct(data)
|
||||||
message.success(t('common.updateSuccess'))
|
message.success(t('common.updateSuccess'))
|
||||||
}
|
}
|
||||||
|
getDetail()
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
@@ -461,10 +463,11 @@ const formLoading = ref(false)
|
|||||||
|
|
||||||
/** 获得详情 */
|
/** 获得详情 */
|
||||||
const getDetail = async () => {
|
const getDetail = async () => {
|
||||||
if (route.query?.id) {
|
const id = route.query?.id || form.value.productId
|
||||||
|
if (id) {
|
||||||
formLoading.value = true
|
formLoading.value = true
|
||||||
try {
|
try {
|
||||||
const res = await ProductApi.getProduct(route.query.id)
|
const res = await ProductApi.getProduct(id)
|
||||||
let diyField = {}
|
let diyField = {}
|
||||||
if (res.diyParams) {
|
if (res.diyParams) {
|
||||||
diyField = isObject(res.diyParams) ? res.diyParams : JSON.parse(res.diyParams)
|
diyField = isObject(res.diyParams) ? res.diyParams : JSON.parse(res.diyParams)
|
||||||
@@ -485,8 +488,8 @@ const getDetail = async () => {
|
|||||||
productCategory: undefined,
|
productCategory: undefined,
|
||||||
productBrand: undefined,
|
productBrand: undefined,
|
||||||
productIntro: undefined,
|
productIntro: undefined,
|
||||||
mainImage: 'https://ss-cloud.ahduima.com/1001/1796426117251600384.png',
|
mainImage: '',
|
||||||
carouselImages: ['https://ss-cloud.ahduima.com/1001/1796426117251600384.png'],
|
carouselImages: [],
|
||||||
productSpecList: [],
|
productSpecList: [],
|
||||||
skuList: [],
|
skuList: [],
|
||||||
detailInfo: null,
|
detailInfo: null,
|
||||||
|
|||||||
@@ -42,7 +42,13 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12" :offset="0">
|
<el-col :span="12" :offset="0">
|
||||||
<el-form-item label="采购数量" prop="num">
|
<el-form-item label="采购数量" prop="num">
|
||||||
<el-input-number :min="1" v-model="form.num" placeholder="请输入" style="width: 100%" />
|
<el-input-number
|
||||||
|
:min="1"
|
||||||
|
v-model="form.num"
|
||||||
|
:controls="false"
|
||||||
|
placeholder="请输入"
|
||||||
|
style="width: 100%"
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -51,6 +57,7 @@
|
|||||||
<el-form-item label="采购单价" prop="unitPrice">
|
<el-form-item label="采购单价" prop="unitPrice">
|
||||||
<el-input-number
|
<el-input-number
|
||||||
:min="0"
|
:min="0"
|
||||||
|
:controls="false"
|
||||||
v-model="form.unitPrice"
|
v-model="form.unitPrice"
|
||||||
placeholder="请输入"
|
placeholder="请输入"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ const crudSchemas = reactive([
|
|||||||
label: '备注',
|
label: '备注',
|
||||||
field: 'remark',
|
field: 'remark',
|
||||||
isSearch: false,
|
isSearch: false,
|
||||||
isTable: true
|
isTable: false
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
||||||
|
|||||||
7
src/views/Profile/NotifyMessage.vue
Normal file
7
src/views/Profile/NotifyMessage.vue
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<template>
|
||||||
|
<div> 站内信 </div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="NotifyMessage"></script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped></style>
|
||||||
@@ -61,6 +61,8 @@ const bindSocial = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
const bind = (row) => {
|
const bind = (row) => {
|
||||||
|
message.info('暂未开放,敬请期待')
|
||||||
|
return
|
||||||
const redirectUri = location.origin + '/user/profile?type=' + row.type
|
const redirectUri = location.origin + '/user/profile?type=' + row.type
|
||||||
// 进行跳转
|
// 进行跳转
|
||||||
socialAuthRedirect(row.type, encodeURIComponent(redirectUri)).then((res) => {
|
socialAuthRedirect(row.type, encodeURIComponent(redirectUri)).then((res) => {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
:options="props.schoolOption"
|
:options="props.schoolOption"
|
||||||
v-model="formData.schPlace"
|
v-model="formData.schPlace"
|
||||||
filterable
|
filterable
|
||||||
:props="{ value: 'id' }"
|
:props="{ value: 'value' }"
|
||||||
show-all-levels
|
show-all-levels
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
@@ -60,14 +60,14 @@
|
|||||||
<el-tab-pane label="报价信息" name="price">
|
<el-tab-pane label="报价信息" name="price">
|
||||||
<el-button type="primary" @click="handleAddPrice" class="mb-10px">新增报价</el-button>
|
<el-button type="primary" @click="handleAddPrice" class="mb-10px">新增报价</el-button>
|
||||||
<el-table :data="formData.quotations">
|
<el-table :data="formData.quotations">
|
||||||
<el-table-column width="160px">
|
<el-table-column>
|
||||||
<template #header> <Tooltip message="市场价,给客户的报价" />指导价 </template>
|
<template #header> <Tooltip message="市场价,给客户的报价" />指导价 </template>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input v-if="row.edit" v-model="row.guidingPrice" type="number" :min="0" />
|
<el-input v-if="row.edit" v-model="row.guidingPrice" type="number" :min="0" />
|
||||||
<span v-else>{{ row.guidingPrice }}</span>
|
<span v-else>{{ row.guidingPrice }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column width="160px">
|
<!-- <el-table-column width="160px">
|
||||||
<template #header> <Tooltip message="员工底价,用于核算毛利及提成" />底价 </template>
|
<template #header> <Tooltip message="员工底价,用于核算毛利及提成" />底价 </template>
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-input v-if="row.edit" v-model="row.minPrice" type="number" :min="0" />
|
<el-input v-if="row.edit" v-model="row.minPrice" type="number" :min="0" />
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
<el-input v-if="row.edit" v-model="row.costPrice" type="number" :min="0" />
|
<el-input v-if="row.edit" v-model="row.costPrice" type="number" :min="0" />
|
||||||
<span v-else>{{ row.costPrice }}</span>
|
<span v-else>{{ row.costPrice }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column label="生效日期">
|
<el-table-column label="生效日期">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
@@ -108,7 +108,171 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="提成结算" name="comission">
|
<el-tab-pane label="公司利润" name="profitCompany">
|
||||||
|
<el-form
|
||||||
|
:model="profitCompanyForm"
|
||||||
|
ref="profitCompanyRef"
|
||||||
|
:rules="profitCompanyRules"
|
||||||
|
label-width="90px"
|
||||||
|
>
|
||||||
|
<el-form-item label="利润模式:">
|
||||||
|
<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.profitMode == 1">
|
||||||
|
<span>公司利润 = ( 成交价 </span>
|
||||||
|
<el-select
|
||||||
|
v-model="profitCompanyForm.profitRule.mark"
|
||||||
|
size="small"
|
||||||
|
placeholder="加/减"
|
||||||
|
class="ml-10px mr-10px"
|
||||||
|
style="width: 70px"
|
||||||
|
>
|
||||||
|
<el-option label="+" value="+" />
|
||||||
|
<el-option label="-" value="-" />
|
||||||
|
</el-select>
|
||||||
|
<el-input-number
|
||||||
|
v-model="profitCompanyForm.profitRule.minPrice"
|
||||||
|
size="small"
|
||||||
|
placeholder="金额"
|
||||||
|
:min="0"
|
||||||
|
style="width: 80px"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
<span class="ml-10px mr-10px"> ) 乘以 </span>
|
||||||
|
<el-input-number
|
||||||
|
v-model="profitCompanyForm.profitRule.rate"
|
||||||
|
size="small"
|
||||||
|
placeholder="比例"
|
||||||
|
:min="0"
|
||||||
|
:max="1"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="profitCompanyForm.profitMode == 2">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="profitCompanyForm.dangwei.push({ signPrice: undefined, profit: undefined })"
|
||||||
|
>添加利润档位</el-button
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="flex items-center"
|
||||||
|
v-for="(item, index) in profitCompanyForm.dangwei"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<span>成交额满</span>
|
||||||
|
<el-input-number
|
||||||
|
v-model="item.signPrice"
|
||||||
|
size="small"
|
||||||
|
placeholder="金额"
|
||||||
|
:min="0"
|
||||||
|
class="ml-10px mr-10px"
|
||||||
|
style="width: 80px"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
<span>,公司利润为</span>
|
||||||
|
<el-input-number
|
||||||
|
v-model="item.profit"
|
||||||
|
size="small"
|
||||||
|
placeholder="金额"
|
||||||
|
:min="0"
|
||||||
|
class="ml-10px"
|
||||||
|
style="width: 80px"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="员工利润" name="profitEmployee">
|
||||||
|
<el-form
|
||||||
|
:model="profitEmployeeForm"
|
||||||
|
ref="profitEmployeeRef"
|
||||||
|
:rules="profitEmployeeRules"
|
||||||
|
label-width="90px"
|
||||||
|
>
|
||||||
|
<el-form-item label="利润模式:">
|
||||||
|
<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.profitMode == 1">
|
||||||
|
<span>公司利润 = ( 成交价 </span>
|
||||||
|
<el-select
|
||||||
|
v-model="profitEmployeeForm.profitRule.mark"
|
||||||
|
size="small"
|
||||||
|
placeholder="加/减"
|
||||||
|
class="ml-10px mr-10px"
|
||||||
|
style="width: 70px"
|
||||||
|
>
|
||||||
|
<el-option label="+" :value="1" />
|
||||||
|
<el-option label="-" :value="2" />
|
||||||
|
</el-select>
|
||||||
|
<el-input-number
|
||||||
|
v-model="profitEmployeeForm.profitRule.minPrice"
|
||||||
|
size="small"
|
||||||
|
placeholder="金额"
|
||||||
|
:min="0"
|
||||||
|
style="width: 80px"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
<span class="ml-10px mr-10px"> ) 乘以 </span>
|
||||||
|
<el-input-number
|
||||||
|
v-model="profitEmployeeForm.profitRule.rate"
|
||||||
|
size="small"
|
||||||
|
placeholder="比例"
|
||||||
|
:min="0"
|
||||||
|
:max="1"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div v-else-if="profitEmployeeForm.profitMode == 2">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
size="small"
|
||||||
|
@click="
|
||||||
|
profitEmployeeForm.dangwei.push({ signPrice: undefined, profit: undefined })
|
||||||
|
"
|
||||||
|
>添加利润档位</el-button
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="flex items-center"
|
||||||
|
v-for="(item, index) in profitEmployeeForm.dangwei"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<span>成交额满</span>
|
||||||
|
<el-input-number
|
||||||
|
v-model="item.signPrice"
|
||||||
|
size="small"
|
||||||
|
placeholder="金额"
|
||||||
|
:min="0"
|
||||||
|
class="ml-10px mr-10px"
|
||||||
|
style="width: 80px"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
<span>,公司利润为</span>
|
||||||
|
<el-input-number
|
||||||
|
v-model="item.profit"
|
||||||
|
size="small"
|
||||||
|
placeholder="金额"
|
||||||
|
:min="0"
|
||||||
|
class="ml-10px"
|
||||||
|
style="width: 80px"
|
||||||
|
:controls="false"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane v-if="false" label="提成结算" name="comission">
|
||||||
<el-button v-if="!comissionShow" type="primary" @click="handleAddComission">
|
<el-button v-if="!comissionShow" type="primary" @click="handleAddComission">
|
||||||
新增提成结算规则
|
新增提成结算规则
|
||||||
</el-button>
|
</el-button>
|
||||||
@@ -286,6 +450,22 @@ const formRules = reactive({
|
|||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
const currentTab = ref('base')
|
const currentTab = ref('base')
|
||||||
|
|
||||||
|
const profitCompanyForm = ref({
|
||||||
|
profitMode: 1,
|
||||||
|
dangwei: [],
|
||||||
|
profitRule: {}
|
||||||
|
})
|
||||||
|
const profitCompanyRules = {}
|
||||||
|
const profitCompanyRef = ref()
|
||||||
|
|
||||||
|
const profitEmployeeForm = ref({
|
||||||
|
profitMode: 1,
|
||||||
|
dangwei: [],
|
||||||
|
profitRule: {}
|
||||||
|
})
|
||||||
|
const profitEmployeeRules = {}
|
||||||
|
const profitEmployeeRef = ref()
|
||||||
|
|
||||||
const opts = ref({
|
const opts = ref({
|
||||||
percentage_param1: [],
|
percentage_param1: [],
|
||||||
percentage_param2: [],
|
percentage_param2: [],
|
||||||
@@ -298,6 +478,7 @@ const open = async (type, id) => {
|
|||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
dialogTitle.value = type == 'create' ? '新增班型' : '修改班型'
|
dialogTitle.value = type == 'create' ? '新增班型' : '修改班型'
|
||||||
formType.value = type
|
formType.value = type
|
||||||
|
currentTab.value = 'base'
|
||||||
resetForm()
|
resetForm()
|
||||||
if (!opts.value.length) {
|
if (!opts.value.length) {
|
||||||
const arr = await ClassApi.getCommissionParams()
|
const arr = await ClassApi.getCommissionParams()
|
||||||
@@ -311,6 +492,37 @@ const open = async (type, id) => {
|
|||||||
try {
|
try {
|
||||||
formData.value = await ClassApi.getClassType(id)
|
formData.value = await ClassApi.getClassType(id)
|
||||||
formData.value.schPlace = [formData.value.schoolId, formData.value.placeId]
|
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 {
|
} finally {
|
||||||
formLoading.value = false
|
formLoading.value = false
|
||||||
}
|
}
|
||||||
@@ -339,17 +551,15 @@ function handleAddPrice() {
|
|||||||
formData.value.quotations.push({
|
formData.value.quotations.push({
|
||||||
edit: true,
|
edit: true,
|
||||||
guidingPrice: undefined,
|
guidingPrice: undefined,
|
||||||
minPrice: undefined,
|
// minPrice: undefined,
|
||||||
costPrice: undefined,
|
// costPrice: undefined,
|
||||||
validTime: undefined,
|
validTime: undefined,
|
||||||
quotationTime: formatDate(new Date(), 'YYYY-MM-DD')
|
quotationTime: formatDate(new Date(), 'YYYY-MM-DD')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleDeletePrice(row, index) {
|
function handleDeletePrice(row, index) {
|
||||||
if (row.edit) {
|
formData.value.quotations.splice(index, 1)
|
||||||
formData.value.quotations.splice(index, 1)
|
|
||||||
}
|
|
||||||
message.success('删除成功')
|
message.success('删除成功')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,6 +611,51 @@ async function submitForm() {
|
|||||||
delete data.schPlace
|
delete data.schPlace
|
||||||
delete data.percentages
|
delete data.percentages
|
||||||
data.percentages = { ...comissionForm.value }
|
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') {
|
if (formType.value === 'create') {
|
||||||
await ClassApi.createClassType(data)
|
await ClassApi.createClassType(data)
|
||||||
message.success(t('common.createSuccess'))
|
message.success(t('common.createSuccess'))
|
||||||
|
|||||||
@@ -2,21 +2,16 @@
|
|||||||
<div>
|
<div>
|
||||||
<el-form :model="searchForm" ref="searchRef" inline label-width="0">
|
<el-form :model="searchForm" ref="searchRef" inline label-width="0">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-input
|
<el-cascader
|
||||||
v-model="searchForm.schoolName"
|
:options="schoolOption"
|
||||||
placeholder="请输入驾校名称"
|
v-model="searchForm.schPlace"
|
||||||
clearable
|
clearable
|
||||||
style="width: 180px"
|
filterable
|
||||||
@keyup.enter="handleQuery"
|
show-all-levels
|
||||||
/>
|
style="width: 300px"
|
||||||
</el-form-item>
|
placeholder="选择驾校/场地"
|
||||||
<el-form-item>
|
:props="{ expandTrigger: 'hover', multiple: false, checkStrictly: true }"
|
||||||
<el-input
|
@change="handleQuery"
|
||||||
v-model="searchForm.placeName"
|
|
||||||
placeholder="请输入场地名称"
|
|
||||||
clearable
|
|
||||||
style="width: 180px"
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
@@ -56,7 +51,7 @@
|
|||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
@click="handleBatchDelete"
|
@click="handleBatchDelete([])"
|
||||||
v-hasPermi="['school:class:batch-delete']"
|
v-hasPermi="['school:class:batch-delete']"
|
||||||
>批量删除</el-button
|
>批量删除</el-button
|
||||||
>
|
>
|
||||||
@@ -69,85 +64,73 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-row :gutter="20">
|
<el-table
|
||||||
<el-col :span="6" :offset="0">
|
:data="tableList"
|
||||||
<div class="head-container" style="max-height: 700px; overflow-y: auto">
|
v-loading="loading"
|
||||||
<el-tree
|
border
|
||||||
ref="tree"
|
@selection-change="handleSelectionChange"
|
||||||
:data="schoolOption"
|
>
|
||||||
accordion
|
<el-table-column type="selection" width="50" />
|
||||||
node-key="id"
|
<el-table-column type="index" label="序号" width="60" />
|
||||||
highlight-current
|
<el-table-column
|
||||||
:default-expanded-keys="selectNodes.map((item) => item.id)"
|
v-for="col in columns"
|
||||||
@node-click="handleNodeClick"
|
:prop="col.props"
|
||||||
|
:key="col.props"
|
||||||
|
:label="col.label"
|
||||||
|
:width="col.width"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column label="备注" width="260">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<!-- <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">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<el-switch
|
||||||
|
v-model="row.status"
|
||||||
|
:active-value="0"
|
||||||
|
:inactive-value="1"
|
||||||
|
:disabled="!checkPermi(['school:class:update'])"
|
||||||
|
@change="handleChangeStatus(row)"
|
||||||
/>
|
/>
|
||||||
</div>
|
</template>
|
||||||
</el-col>
|
</el-table-column>
|
||||||
<el-col :span="18" :offset="0">
|
<el-table-column label="操作" width="120px">
|
||||||
<el-table
|
<template #default="{ row }">
|
||||||
:data="tableList"
|
<el-button
|
||||||
v-loading="loading"
|
type="primary"
|
||||||
border
|
style="padding: 0"
|
||||||
@selection-change="handleSelectionChange"
|
text
|
||||||
>
|
v-hasPermi="['school:class:update']"
|
||||||
<el-table-column type="selection" width="50" />
|
@click="handleOpenDialog('update', row.typeId)"
|
||||||
<el-table-column type="index" label="序号" width="60" />
|
>
|
||||||
<el-table-column
|
修改
|
||||||
v-for="col in columns"
|
</el-button>
|
||||||
:prop="col.props"
|
<el-button
|
||||||
:key="col.props"
|
type="danger"
|
||||||
:label="col.label"
|
style="padding: 0"
|
||||||
:width="col.width"
|
text
|
||||||
show-overflow-tooltip
|
v-hasPermi="['school:class:delete']"
|
||||||
/>
|
@click="handleRemove(row.typeId)"
|
||||||
<el-table-column label="备注" width="260">
|
>
|
||||||
<template #default="{ row }">
|
删除
|
||||||
<div v-dompurify-html="row.remark"></div>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="状态" width="80">
|
</el-table>
|
||||||
<template #default="{ row }">
|
<Pagination
|
||||||
<el-switch
|
v-model:limit="searchForm.pageSize"
|
||||||
v-model="row.status"
|
v-model:page="searchForm.pageNo"
|
||||||
:active-value="0"
|
:total="total"
|
||||||
:inactive-value="1"
|
@pagination="getList"
|
||||||
:disabled="!checkPermi(['school:class:update'])"
|
/>
|
||||||
@change="handleChangeStatus(row)"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" width="120px">
|
|
||||||
<template #default="{ row }">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
style="padding: 0"
|
|
||||||
text
|
|
||||||
v-hasPermi="['school:class:update']"
|
|
||||||
@click="handleOpenDialog('update', row.typeId)"
|
|
||||||
>
|
|
||||||
修改
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
style="padding: 0"
|
|
||||||
text
|
|
||||||
v-hasPermi="['school:class:delete']"
|
|
||||||
@click="handleRemove(row.typeId)"
|
|
||||||
>
|
|
||||||
删除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<!-- 分页 -->
|
|
||||||
<Pagination
|
|
||||||
v-model:limit="searchForm.pageSize"
|
|
||||||
v-model:page="searchForm.pageNo"
|
|
||||||
:total="total"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<Dialog title="批量修改" v-model="batchStatusDialogShow" width="400px">
|
<Dialog title="批量修改" v-model="batchStatusDialogShow" width="400px">
|
||||||
<el-form :model="statusForm" ref="statusRef" label-width="80px">
|
<el-form :model="statusForm" ref="statusRef" label-width="80px">
|
||||||
<el-form-item label="选择状态" prop="status">
|
<el-form-item label="选择状态" prop="status">
|
||||||
@@ -177,6 +160,7 @@ import DialogClass from './Comp/DialogClass.vue'
|
|||||||
import { checkPermi } from '@/utils/permission'
|
import { checkPermi } from '@/utils/permission'
|
||||||
|
|
||||||
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
|
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
|
||||||
|
import { removeNullField } from '@/utils'
|
||||||
|
|
||||||
const message = useMessage() // 消息弹窗
|
const message = useMessage() // 消息弹窗
|
||||||
|
|
||||||
@@ -186,8 +170,7 @@ const total = ref(0)
|
|||||||
const tableList = ref([])
|
const tableList = ref([])
|
||||||
|
|
||||||
const searchForm = ref({
|
const searchForm = ref({
|
||||||
schoolName: undefined,
|
schPlace: undefined,
|
||||||
placeName: undefined,
|
|
||||||
typeName: undefined,
|
typeName: undefined,
|
||||||
licenseType: undefined,
|
licenseType: undefined,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
@@ -195,48 +178,34 @@ const searchForm = ref({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const schoolOption = ref([])
|
const schoolOption = ref([])
|
||||||
const selectNodes = ref([])
|
// const selectNodes = ref([])
|
||||||
|
|
||||||
async function getSchoolList() {
|
async function getSchoolList() {
|
||||||
try {
|
try {
|
||||||
const data = await PlaceApi.getPlaceList()
|
const data = await PlaceApi.getPlaceList({
|
||||||
|
placeStatus: 0,
|
||||||
|
schoolStatus: 0,
|
||||||
|
isSearchSchool: true
|
||||||
|
})
|
||||||
schoolOption.value = data.schoolList.map((item) => ({
|
schoolOption.value = data.schoolList.map((item) => ({
|
||||||
id: item.schoolId,
|
value: item.schoolId,
|
||||||
label: item.schoolName,
|
label: item.schoolName,
|
||||||
level: 1,
|
|
||||||
children: data.placeList
|
children: data.placeList
|
||||||
.filter((place) => item.schoolId === place.schoolId)
|
.filter((place) => item.schoolId === place.schoolId)
|
||||||
.map((place) => ({
|
.map((place) => ({
|
||||||
id: place.placeId,
|
value: place.placeId,
|
||||||
label: place.name,
|
label: place.name
|
||||||
level: 2
|
|
||||||
}))
|
}))
|
||||||
}))
|
}))
|
||||||
} catch {}
|
} catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleNodeClick(data, node) {
|
|
||||||
if (data.level === 1) {
|
|
||||||
selectNodes.value = [{ id: data.id, name: data.label }]
|
|
||||||
searchForm.value.schoolName = data.label
|
|
||||||
} else {
|
|
||||||
selectNodes.value = [
|
|
||||||
{ id: node.parent.data.id, name: node.parent.data.label },
|
|
||||||
{ id: data.id, name: data.label }
|
|
||||||
]
|
|
||||||
searchForm.value.schoolName = node.parent.data.label
|
|
||||||
searchForm.value.placeName = data.label
|
|
||||||
}
|
|
||||||
handleQuery()
|
|
||||||
}
|
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ props: 'schoolName', label: '驾校', width: '100px' },
|
{ props: 'schoolName', label: '驾校', width: '100px' },
|
||||||
{ props: 'placeName', label: '场地' },
|
{ props: 'placeName', label: '场地' },
|
||||||
{ props: 'typeName', label: '班型名称' },
|
{ props: 'typeName', label: '班型名称' },
|
||||||
{ props: 'licenseType', label: '驾照类型', width: '100px' },
|
{ props: 'licenseType', label: '驾照类型', width: '100px' },
|
||||||
{ props: 'guidingPrice', label: '最新报价', width: '100px' },
|
{ props: 'guidingPrice', label: '最新报价', width: '100px' }
|
||||||
{ props: 'minPrice', label: '最新底价', width: '100px' }
|
|
||||||
// { props: 'remark', label: '备注', width: '100px' }
|
// { props: 'remark', label: '备注', width: '100px' }
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -248,7 +217,15 @@ function handleQuery() {
|
|||||||
async function getList() {
|
async function getList() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
try {
|
try {
|
||||||
const data = await ClassApi.getClassTypePage(searchForm.value)
|
const params = { ...searchForm.value }
|
||||||
|
if (params.schPlace && params.schPlace.length) {
|
||||||
|
params.schoolId = params.schPlace[0]
|
||||||
|
if (params.schPlace.length == 2) {
|
||||||
|
params.placeId = params.schPlace[1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
delete params.schPlace
|
||||||
|
const data = await ClassApi.getClassTypePage(removeNullField(params))
|
||||||
tableList.value = data.list
|
tableList.value = data.list
|
||||||
total.value = data.total
|
total.value = data.total
|
||||||
} finally {
|
} finally {
|
||||||
@@ -263,8 +240,7 @@ function handleOpenDialog(type, id = null) {
|
|||||||
|
|
||||||
function handleReset() {
|
function handleReset() {
|
||||||
searchForm.value = {
|
searchForm.value = {
|
||||||
schoolName: undefined,
|
schPlace: undefined,
|
||||||
placeName: undefined,
|
|
||||||
typeName: undefined,
|
typeName: undefined,
|
||||||
licenseType: undefined,
|
licenseType: undefined,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
@@ -274,7 +250,7 @@ function handleReset() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function handleBatchDelete(arr = []) {
|
async function handleBatchDelete(arr = []) {
|
||||||
if (!arr.length || !selectRows.value.length) {
|
if (!arr.length && !selectRows.value.length) {
|
||||||
message.info('请选择表格行!')
|
message.info('请选择表格行!')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -303,11 +279,17 @@ async function handleChangeStatus(row) {
|
|||||||
// 删除的二次确认
|
// 删除的二次确认
|
||||||
await message.confirm('是否确认修改状态')
|
await message.confirm('是否确认修改状态')
|
||||||
// 发起删除
|
// 发起删除
|
||||||
await ClassApi.updateClassTypeStatus(row.typeId, row.status)
|
await ClassApi.updateClassTypeStatus({
|
||||||
|
typeId: row.typeId,
|
||||||
|
status: row.status
|
||||||
|
})
|
||||||
message.success('修改成功')
|
message.success('修改成功')
|
||||||
// 刷新列表
|
// 刷新列表
|
||||||
await getList()
|
await getList()
|
||||||
} catch {}
|
} catch {
|
||||||
|
// 取消后,进行恢复按钮
|
||||||
|
row.status = row.status === 1 ? 0 : 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const batchStatusDialogShow = ref(false)
|
const batchStatusDialogShow = ref(false)
|
||||||
|
|||||||
@@ -137,7 +137,7 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="描述" name="desc">
|
<el-tab-pane label="描述" name="desc">
|
||||||
<Editor v-model:modelValue="placeForm.remark" />
|
<Editor v-model:modelValue="placeForm.introduce" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
<div class="flex items-center justify-center mt-10px">
|
<div class="flex items-center justify-center mt-10px">
|
||||||
@@ -190,8 +190,10 @@
|
|||||||
<el-table-column label="启用" width="100">
|
<el-table-column label="启用" width="100">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="scope.row.showInMap"
|
v-model="scope.row.status"
|
||||||
:disabled="checkPermi(['school:place:update'])"
|
:active-value="0"
|
||||||
|
:inactive-value="1"
|
||||||
|
:disabled="!checkPermi(['school:place:update'])"
|
||||||
@change="changePlaceStatus(scope.row)"
|
@change="changePlaceStatus(scope.row)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
@@ -266,7 +268,7 @@ const placeTab = ref('info')
|
|||||||
|
|
||||||
function initMap() {
|
function initMap() {
|
||||||
AMapLoader.load({
|
AMapLoader.load({
|
||||||
key: '2ffb0e2ea90b1df0b8be48ed66e18fc8', //设置您的key
|
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key
|
||||||
version: '2.0',
|
version: '2.0',
|
||||||
plugins: ['AMap.Geocoder']
|
plugins: ['AMap.Geocoder']
|
||||||
}).then((AMap) => {
|
}).then((AMap) => {
|
||||||
@@ -323,7 +325,10 @@ function regeoCode() {
|
|||||||
async function getPageData() {
|
async function getPageData() {
|
||||||
schoolList.value = []
|
schoolList.value = []
|
||||||
tableData.value = []
|
tableData.value = []
|
||||||
const data = await PlaceApi.getPlaceList()
|
const data = await PlaceApi.getPlaceList({
|
||||||
|
schoolStatus: 0,
|
||||||
|
isSearchSchool: true
|
||||||
|
})
|
||||||
if (data.schoolList) {
|
if (data.schoolList) {
|
||||||
schoolList.value = data.schoolList.map((item) => ({ ...item, showInMap: true }))
|
schoolList.value = data.schoolList.map((item) => ({ ...item, showInMap: true }))
|
||||||
}
|
}
|
||||||
@@ -361,7 +366,7 @@ function handleClickSchool(item) {
|
|||||||
function createMarkersInMap() {
|
function createMarkersInMap() {
|
||||||
for (let i = 0; i < tableData.value.length; i++) {
|
for (let i = 0; i < tableData.value.length; i++) {
|
||||||
const element = tableData.value[i]
|
const element = tableData.value[i]
|
||||||
if (!element.schoolShow || !element.showInMap) {
|
if (!element.schoolShow || !element.showInMap || element.status == 1) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
const markerIcon = flagMap[element.flagColor || 'red']
|
const markerIcon = flagMap[element.flagColor || 'red']
|
||||||
@@ -389,7 +394,7 @@ function handleInsertPlace(schoolId) {
|
|||||||
lng: undefined,
|
lng: undefined,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
address: undefined,
|
address: undefined,
|
||||||
remark: undefined,
|
introduce: undefined,
|
||||||
phone: undefined,
|
phone: undefined,
|
||||||
schoolId: schoolId,
|
schoolId: schoolId,
|
||||||
showInMap: true,
|
showInMap: true,
|
||||||
@@ -531,11 +536,22 @@ function closePlaceList() {
|
|||||||
fullScreenPlaceList.value = false
|
fullScreenPlaceList.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
async function changePlaceStatus() {
|
async function changePlaceStatus(row) {
|
||||||
// const resp = await updatePlace(item);
|
try {
|
||||||
// if (resp.code == 200) {
|
// 修改状态的二次确认
|
||||||
resetMarkers()
|
const text = row.status == 0 ? '启用' : '停用'
|
||||||
// }
|
await message.confirm('确认要"' + text + '""' + row.name + '"场地吗?')
|
||||||
|
// 发起修改状态
|
||||||
|
await PlaceApi.updatePlaceStatus(row.placeId, row.status)
|
||||||
|
message.success('修改成功')
|
||||||
|
// 刷新列表
|
||||||
|
// await getPageData()
|
||||||
|
tableData.value.find((item) => item.placeId == row.placeId).status = row.status
|
||||||
|
resetMarkers()
|
||||||
|
} catch {
|
||||||
|
// 取消后,进行恢复按钮
|
||||||
|
row.status = row.status == 0 ? 1 : 0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// const isRanging = ref(false)
|
// const isRanging = ref(false)
|
||||||
@@ -544,7 +560,7 @@ const placeForm = ref({
|
|||||||
lng: undefined,
|
lng: undefined,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
address: undefined,
|
address: undefined,
|
||||||
remark: undefined,
|
introduce: undefined,
|
||||||
phone: undefined,
|
phone: undefined,
|
||||||
flagColor: 'red'
|
flagColor: 'red'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -140,7 +140,8 @@ async function changeStatus(row) {
|
|||||||
const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
|
const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
|
||||||
await message.confirm('确认要"' + text + '""' + row.schoolName + '"驾校吗?')
|
await message.confirm('确认要"' + text + '""' + row.schoolName + '"驾校吗?')
|
||||||
// 发起修改状态
|
// 发起修改状态
|
||||||
await api.updateSchoolStatus(row.id, row.status)
|
await api.updateSchoolStatus(row.schoolId, row.status)
|
||||||
|
message.success('修改成功')
|
||||||
// 刷新列表
|
// 刷新列表
|
||||||
await getList()
|
await getList()
|
||||||
} catch {
|
} catch {
|
||||||
|
|||||||
@@ -40,11 +40,11 @@ export default ({ command, mode }) => {
|
|||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(new RegExp(`^/call-api`), '')
|
rewrite: (path) => path.replace(new RegExp(`^/call-api`), '')
|
||||||
},
|
},
|
||||||
['/dev-api']: {
|
['/crm-api']: {
|
||||||
target: env.VITE_BASE_URL,
|
target: env.VITE_BASE_URL,
|
||||||
ws: false,
|
ws: false,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(new RegExp(`^/dev-api`), '')
|
rewrite: (path) => path.replace(new RegExp(`^/crm-api`), '')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user