Compare commits
45 Commits
b40e28af6f
...
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 | ||
|
|
44e45349c2 | ||
|
|
013a93e668 | ||
|
|
37818cb1e6 | ||
|
|
8df1f7d25a | ||
|
|
ea7fae45e3 | ||
|
|
2017baaf03 | ||
|
|
5aab5c0f82 | ||
|
|
e3c85cbaae | ||
|
|
1c37dbc5f8 | ||
|
|
35598b4d6d |
@@ -5,15 +5,17 @@ VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL='http://118.31.23.45: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://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_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_API_BASEPATH=/dev-api
|
||||
VITE_API_BASEPATH=/crm-api
|
||||
|
||||
# 接口地址
|
||||
VITE_API_URL=/admin-api
|
||||
|
||||
# 打包路径
|
||||
VITE_BASE_PATH=/
|
||||
VITE_BASE_PATH=/crm/
|
||||
|
||||
# 是否删除debugger
|
||||
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_API_BASEPATH=/dev-api
|
||||
VITE_API_BASEPATH=/crm-api
|
||||
|
||||
# 接口地址
|
||||
VITE_API_URL=/admin-api
|
||||
|
||||
# 打包路径
|
||||
VITE_BASE_PATH=/
|
||||
VITE_BASE_PATH=/crm/
|
||||
|
||||
# 项目本地运行端口号, 与.vscode/launch.json配合
|
||||
VITE_PORT=80
|
||||
|
||||
8
.env.pro
8
.env.pro
@@ -4,13 +4,13 @@ VITE_NODE_ENV=production
|
||||
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
|
||||
@@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=true
|
||||
VITE_SOURCEMAP=false
|
||||
|
||||
# 打包路径
|
||||
VITE_BASE_PATH=/
|
||||
VITE_BASE_PATH=/crm/
|
||||
|
||||
# 输出路径
|
||||
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_API_BASEPATH=
|
||||
VITE_API_BASEPATH=/crm-api
|
||||
|
||||
# 接口地址
|
||||
VITE_API_URL=/admin-api
|
||||
@@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=true
|
||||
VITE_SOURCEMAP=false
|
||||
|
||||
# 打包路径
|
||||
VITE_BASE_PATH='http://static-vue3.yudao.iocoder.cn/'
|
||||
VITE_BASE_PATH='/crm'
|
||||
|
||||
# 输出路径
|
||||
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_API_BASEPATH=
|
||||
VITE_API_BASEPATH=/crm-api
|
||||
|
||||
# 接口地址
|
||||
VITE_API_URL=/admin-api
|
||||
@@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=true
|
||||
VITE_SOURCEMAP=false
|
||||
|
||||
# 打包路径
|
||||
VITE_BASE_PATH=/admin-ui-vue3/
|
||||
VITE_BASE_PATH=/crm/
|
||||
|
||||
# 输出路径
|
||||
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_API_BASEPATH=
|
||||
VITE_API_BASEPATH=/crm-api
|
||||
|
||||
# 接口地址
|
||||
VITE_API_URL=/admin-api
|
||||
@@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=false
|
||||
VITE_SOURCEMAP=true
|
||||
|
||||
# 打包路径
|
||||
VITE_BASE_PATH=/
|
||||
VITE_BASE_PATH=/crm/
|
||||
|
||||
# 输出路径
|
||||
VITE_OUT_DIR=dist-test
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
<script type="text/javascript">
|
||||
window._AMapSecurityConfig = {
|
||||
securityJsCode: 'a2f0d14a4c5c1e387f9271b1045a781d' // 你的密钥
|
||||
securityJsCode: 'f653df5a2c5f44ae68faaab6f6a6b8ab' // 你的密钥
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 7.7 KiB |
39
src/api/clue/afterSale.js
Normal file
39
src/api/clue/afterSale.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询(精简)列表
|
||||
export const getAfterSaleList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-after-sale/list', params })
|
||||
}
|
||||
|
||||
// 查询(精简)列表
|
||||
export const getAfterSalePage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-after-sale/page', params })
|
||||
}
|
||||
|
||||
// 新增
|
||||
export const createAfterSale = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sign-after-sale/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 审核
|
||||
export const auditAfterSale = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-after-sale/check', data })
|
||||
}
|
||||
|
||||
export const batchAuditAfterSale = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-after-sale/batch/check', data })
|
||||
}
|
||||
|
||||
// 撤销
|
||||
export const cancelApplyAfterSale = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-after-sale/revoke', params: data })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getAfterSaleDetail = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-after-sale/get', params })
|
||||
}
|
||||
@@ -10,9 +10,14 @@ export const deleteClueGainRule = (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 = () => {
|
||||
return request.get({ url: '/admin-api/crm/sch-clue-gain-rule/list' })
|
||||
export const getClueDistributeRuleByUser = (params) => {
|
||||
return request.get({ url: '/admin-api/crm/sch-clue-distribution-rule/queryByUserId', params })
|
||||
}
|
||||
|
||||
// 删除
|
||||
|
||||
21
src/api/clue/delivery.js
Normal file
21
src/api/clue/delivery.js
Normal file
@@ -0,0 +1,21 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询(精简)列表
|
||||
export const getDeliveryList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-send/list', params })
|
||||
}
|
||||
|
||||
// 查询分页列表
|
||||
export const getDeliveryPage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-send/page', params })
|
||||
}
|
||||
|
||||
// 新增
|
||||
export const createDelivery = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-send/create', data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getDeliveryDetail = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-send/get', params })
|
||||
}
|
||||
@@ -7,7 +7,11 @@ export const getFollowList = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createFollow = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/clue-follow-record/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/clue-follow-record/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
|
||||
@@ -17,7 +17,11 @@ export const getClue = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createClue = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sch-clue/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-clue/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
@@ -49,3 +53,8 @@ export const getOpearateRecord = async (params) => {
|
||||
export const getPublicClue = async (data) => {
|
||||
return await request.put({ url: '/admin-api/crm/sch-clue/public/save', data })
|
||||
}
|
||||
|
||||
// 获得线索跟进用户信息
|
||||
export const getFollowUserList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-clue/get-follow-user', params })
|
||||
}
|
||||
|
||||
39
src/api/clue/payment.js
Normal file
39
src/api/clue/payment.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import request from '@/config/axios'
|
||||
|
||||
// 查询(精简)列表
|
||||
export const getPaymentList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-pay-record/list', params })
|
||||
}
|
||||
|
||||
// 查询(精简)列表
|
||||
export const getPaymentPage = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-pay-record/page', params })
|
||||
}
|
||||
|
||||
// 新增
|
||||
export const createPayment = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sign-pay-record/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 审核
|
||||
export const auditPayment = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-pay-record/check', data })
|
||||
}
|
||||
|
||||
export const batchAuditPayment = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-pay-record/batch/check', data })
|
||||
}
|
||||
|
||||
// 撤销
|
||||
export const cancelApplyPayment = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign-pay-record/revoke', params: data })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getPaymentDetail = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sign-pay-record/get', params })
|
||||
}
|
||||
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,5 +12,20 @@ export const getSign = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createSign = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign/create', data: data })
|
||||
return await request.post({ url: '/admin-api/crm/sign/create', data: data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 取消登记
|
||||
export const cancelDeal = async (id) => {
|
||||
return await request.delete({ url: '/admin-api/crm/sign/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 新增支出
|
||||
export const signAddPay = async (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) => {
|
||||
return request.post({ url: '/admin-api/crm/skill/create', data })
|
||||
return request.post({ url: '/admin-api/crm/skill/create', data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 更新
|
||||
|
||||
@@ -17,7 +17,7 @@ export const getSource = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createSource = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/source/create', data: data })
|
||||
return await request.post({ url: '/admin-api/crm/source/create', data: data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
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) => {
|
||||
return request.post({ url: '/admin-api/crm/erp-product-brand/create', data })
|
||||
return request.post({ url: '/admin-api/crm/erp-product-brand/create', data, isSubmitForm: true })
|
||||
}
|
||||
|
||||
// 更新商品品牌
|
||||
|
||||
@@ -36,7 +36,11 @@ export interface CategoryVO {
|
||||
|
||||
// 创建商品分类
|
||||
export const createCategory = (data: CategoryVO) => {
|
||||
return request.post({ url: '/admin-api/crm/erp-product-category/create', data })
|
||||
return request.post({
|
||||
url: '/admin-api/crm/erp-product-category/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 更新商品分类
|
||||
|
||||
@@ -11,7 +11,11 @@ export const getProduct = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createProduct = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/erp-product/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/erp-product/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -2,7 +2,11 @@ import request from '@/config/axios'
|
||||
|
||||
// 创建
|
||||
export const createField = (data) => {
|
||||
return request.post({ url: '/admin-api/crm/param/create', data: { ...data, module: 3 } })
|
||||
return request.post({
|
||||
url: '/admin-api/crm/param/create',
|
||||
data: { ...data, module: 3 },
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 更新
|
||||
|
||||
@@ -42,7 +42,11 @@ export interface PropertyValueDetailVO {
|
||||
|
||||
// 创建属性项
|
||||
export const createProperty = (data: PropertyVO) => {
|
||||
return request.post({ url: '/admin-api/crm/erp-product-property/create', data })
|
||||
return request.post({
|
||||
url: '/admin-api/crm/erp-product-property/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 更新属性项
|
||||
|
||||
@@ -6,7 +6,11 @@ export const getPurchasePage = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createPurchase = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/erp-purchase/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/erp-purchase/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -6,7 +6,11 @@ export const getWarehousePage = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createWarehouse = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/erp-warehouse/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/erp-warehouse/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
@@ -38,3 +42,8 @@ export const getInventoryList = async (params) => {
|
||||
export const getInventoryRecord = async (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 })
|
||||
}
|
||||
|
||||
export const getClassTypeList = async (params) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-class-type/list', params })
|
||||
}
|
||||
|
||||
// 查询详情
|
||||
export const getClassType = async (id) => {
|
||||
return await request.get({ url: '/admin-api/crm/sch-class-type/get?id=' + id })
|
||||
@@ -12,7 +16,11 @@ export const getClassType = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createClassType = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sch-class-type/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-class-type/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
@@ -22,7 +30,7 @@ export const updateClassType = async (params) => {
|
||||
|
||||
// 删除
|
||||
export const deleteClassType = async (id) => {
|
||||
return await request.delete({ url: '/admin-api/crm/sch-class-type/delete?typeId=' + id })
|
||||
return await request.delete({ url: '/admin-api/crm/sch-class-type/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 修改状态
|
||||
|
||||
@@ -17,7 +17,11 @@ export const getPlace = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createPlace = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sch-place/create', data: data })
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-place/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
}
|
||||
|
||||
// 修改
|
||||
@@ -30,10 +34,10 @@ export const deletePlace = async (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 = {
|
||||
id,
|
||||
placeId,
|
||||
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) => {
|
||||
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 })
|
||||
}
|
||||
|
||||
export const updateSchoolStatus = async (id, status) => {
|
||||
export const updateSchoolStatus = async (schoolId, status) => {
|
||||
const data = {
|
||||
id,
|
||||
schoolId,
|
||||
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 })
|
||||
}
|
||||
|
||||
@@ -7,5 +7,10 @@ export const getConfigByConfigKey = (params) => {
|
||||
|
||||
// 保存配置项
|
||||
export const updateConfig = (data) => {
|
||||
return request.put({ url: '/admin-api/crm/config/update', data })
|
||||
return request.put({ url: '/admin-api/crm/config/batchUpdateConfigValue', data })
|
||||
}
|
||||
|
||||
// 根据模块获取配置列表
|
||||
export const getConfigList = (params) => {
|
||||
return request.get({ url: '/admin-api/crm/config/query', params })
|
||||
}
|
||||
|
||||
@@ -27,7 +27,8 @@ const props = defineProps({
|
||||
data: {
|
||||
type: Object as PropType<any>,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
defaultShow: propTypes.bool.def(true)
|
||||
})
|
||||
|
||||
const { getPrefixCls } = useDesign()
|
||||
@@ -57,7 +58,7 @@ const getBindItemValue = (item: DescriptionsSchema) => {
|
||||
}
|
||||
|
||||
// 折叠
|
||||
const show = ref(true)
|
||||
const show = ref(props.defaultShow)
|
||||
|
||||
const toggleClick = () => {
|
||||
if (props.collapse) {
|
||||
|
||||
@@ -66,6 +66,7 @@ watch(
|
||||
(options) => {
|
||||
if (echartRef) {
|
||||
echartRef?.setOption(options)
|
||||
resizeHandler()
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -51,7 +51,8 @@ export default defineComponent({
|
||||
// 表单label宽度
|
||||
labelWidth: propTypes.oneOfType([String, Number]).def('auto'),
|
||||
// 是否 loading 数据中 add by 芋艿
|
||||
vLoading: propTypes.bool.def(false)
|
||||
vLoading: propTypes.bool.def(false),
|
||||
inlineBlock: propTypes.bool.def(false)
|
||||
},
|
||||
emits: ['register'],
|
||||
setup(props, { slots, expose, emit }) {
|
||||
@@ -77,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)
|
||||
}
|
||||
|
||||
@@ -232,6 +236,7 @@ export default defineComponent({
|
||||
vModel={formModel.value[item.field]}
|
||||
{...(autoSetPlaceholder && setTextPlaceholder(item))}
|
||||
{...setComponentProps(item)}
|
||||
filterable
|
||||
format={item.component == 'DatePicker' ? 'YYYY-MM-DD' : null}
|
||||
value-format={item.component == 'DatePicker' ? 'YYYY-MM-DD' : null}
|
||||
style={baseSty + item.componentProps?.style}
|
||||
@@ -289,6 +294,7 @@ export default defineComponent({
|
||||
model={props.isCustom ? props.model : formModel}
|
||||
class={prefixCls}
|
||||
v-loading={props.vLoading}
|
||||
style={props.inlineBlock ? 'display: inline' : ''}
|
||||
>
|
||||
{{
|
||||
// 如果需要自定义,就什么都不渲染,而是提供默认插槽
|
||||
|
||||
@@ -38,6 +38,7 @@ const props = defineProps({
|
||||
// 伸缩的界限字段
|
||||
expandField: propTypes.string.def(''),
|
||||
inline: propTypes.bool.def(true),
|
||||
inlineBlock: propTypes.bool.def(false),
|
||||
model: {
|
||||
type: Object as PropType<Recordable>,
|
||||
default: () => ({})
|
||||
@@ -58,6 +59,11 @@ const usedSchema = ref([])
|
||||
|
||||
const newSchema = computed(() => {
|
||||
let schema: FormSchema[] = cloneDeep(usedSchema.value)
|
||||
schema.forEach((item: FormSchema) => {
|
||||
if (item.component == 'TreeSelect') {
|
||||
item.componentProps['check-strictly'] = true
|
||||
}
|
||||
})
|
||||
if (props.expand && props.expandField && !unref(visible)) {
|
||||
const index = findIndex(schema, (v: FormSchema) => v.field === props.expandField)
|
||||
if (index > -1) {
|
||||
@@ -154,6 +160,7 @@ initSearch()
|
||||
<!-- update by 芋艿:class="-mb-15px" 用于降低和 ContentWrap 组件的底部距离,避免空隙过大 -->
|
||||
<Form
|
||||
:inline="inline"
|
||||
:inlineBlock="inlineBlock"
|
||||
:is-col="isCol"
|
||||
:is-custom="false"
|
||||
isSearch
|
||||
|
||||
@@ -44,7 +44,8 @@ const props = defineProps({
|
||||
modelValue: propTypes.oneOfType<string | string[]>([String, Array<String>]).isRequired,
|
||||
title: propTypes.string.def('文件上传'),
|
||||
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('*'),
|
||||
fileSize: propTypes.number.def(5), // 大小限制(MB)
|
||||
limit: propTypes.number.def(5), // 数量限制
|
||||
|
||||
@@ -7,7 +7,7 @@ const config: {
|
||||
/**
|
||||
* 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 request = (option: any) => {
|
||||
const { url, method, params, data, headersType, responseType } = option
|
||||
const { url, method, params, data, headersType, responseType, isSubmitForm } = option
|
||||
return service({
|
||||
url: url,
|
||||
method,
|
||||
isSubmitForm,
|
||||
params,
|
||||
data,
|
||||
responseType: responseType,
|
||||
|
||||
@@ -21,6 +21,7 @@ import errorCode from './errorCode'
|
||||
|
||||
import { resetRouter } from '@/router'
|
||||
import { useCache } from '@/hooks/web/useCache'
|
||||
import cache from '@/plugins/cache'
|
||||
|
||||
const { result_code, base_url, request_timeout } = config
|
||||
|
||||
@@ -62,15 +63,11 @@ service.interceptors.request.use(
|
||||
}
|
||||
// 设置租户
|
||||
const tenantId = getTenantId()
|
||||
if (tenantId) {
|
||||
;(config as Recordable).headers['tenant-id'] = tenantId
|
||||
}
|
||||
if (tenantId) (config as Recordable).headers['tenant-id'] = tenantId
|
||||
|
||||
// 设置实例
|
||||
const appId = getAppId()
|
||||
if (appId) {
|
||||
;(config as Recordable).headers['instance-id'] = appId
|
||||
}
|
||||
if (appId) (config as Recordable).headers['instance-id'] = appId
|
||||
|
||||
const params = config.params || {}
|
||||
const data = config.data || false
|
||||
@@ -83,27 +80,39 @@ service.interceptors.request.use(
|
||||
}
|
||||
// get参数编码
|
||||
if (config.method?.toUpperCase() === 'GET' && params) {
|
||||
let url = config.url + '?'
|
||||
for (const propName of Object.keys(params)) {
|
||||
const value = params[propName]
|
||||
if (value !== void 0 && value !== null && typeof value !== 'undefined') {
|
||||
if (typeof value === 'object') {
|
||||
for (const val of Object.keys(value)) {
|
||||
const params = propName + '[' + val + ']'
|
||||
const subPart = encodeURIComponent(params) + '='
|
||||
url += subPart + encodeURIComponent(value[val]) + '&'
|
||||
}
|
||||
} else {
|
||||
url += `${propName}=${encodeURIComponent(value)}&`
|
||||
}
|
||||
config.params = {}
|
||||
const paramsStr = qs.stringify(params, { allowDots: true })
|
||||
if (paramsStr) {
|
||||
config.url = config.url + '?' + paramsStr
|
||||
}
|
||||
}
|
||||
// 是否提交表单型的接口,如果是,不要频繁调接口
|
||||
if (config?.isSubmitForm) {
|
||||
const requestObj = {
|
||||
url: config.url,
|
||||
data: typeof config.data === 'object' ? JSON.stringify(config.data) : config.data,
|
||||
time: new Date().getTime()
|
||||
}
|
||||
const sessionObj = cache.session.get('sessionObj')
|
||||
if (sessionObj === undefined || sessionObj === null || sessionObj === '') {
|
||||
cache.session.set('sessionObj', requestObj)
|
||||
} else {
|
||||
const s_url = sessionObj.url // 请求地址
|
||||
const s_data = sessionObj.data // 请求数据
|
||||
const s_time = sessionObj.time // 请求时间
|
||||
const interval = 1000 // 间隔时间(ms),小于此时间视为重复提交
|
||||
if (
|
||||
s_data === requestObj.data &&
|
||||
requestObj.time - s_time < interval &&
|
||||
s_url === requestObj.url
|
||||
) {
|
||||
const message = '数据正在处理,请勿重复提交'
|
||||
console.warn(`[${s_url}]: ` + message)
|
||||
return Promise.reject(new Error(message))
|
||||
} else {
|
||||
cache.session.set('sessionObj', requestObj)
|
||||
}
|
||||
}
|
||||
// 给 get 请求加上时间戳参数,避免从缓存中拿数据
|
||||
// const now = new Date().getTime()
|
||||
// params = params.substring(0, url.length - 1) + `?_t=${now}`
|
||||
url = url.slice(0, -1)
|
||||
config.params = {}
|
||||
config.url = url
|
||||
}
|
||||
return config
|
||||
},
|
||||
@@ -199,6 +208,20 @@ service.interceptors.response.use(
|
||||
console.log(msg)
|
||||
} else {
|
||||
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')
|
||||
} else {
|
||||
@@ -245,7 +268,7 @@ const handleAuthorized = () => {
|
||||
isRelogin.show = false
|
||||
// 干掉token后再走一次路由让它过router.beforeEach的校验
|
||||
// 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'))
|
||||
|
||||
@@ -15,14 +15,14 @@ export function useWatermark(appendEl: HTMLElement | null = document.body) {
|
||||
clear()
|
||||
|
||||
const can = document.createElement('canvas')
|
||||
can.width = 300
|
||||
can.width = 500
|
||||
can.height = 240
|
||||
|
||||
const cans = can.getContext('2d')
|
||||
if (cans) {
|
||||
cans.rotate((-20 * Math.PI) / 120)
|
||||
cans.font = '15px Vedana'
|
||||
cans.fillStyle = 'rgba(0, 0, 0, 0.15)'
|
||||
cans.fillStyle = 'rgba(0, 0, 0, 0.05)'
|
||||
cans.textAlign = 'left'
|
||||
cans.textBaseline = 'middle'
|
||||
cans.fillText(str, can.width / 20, can.height)
|
||||
|
||||
@@ -24,7 +24,7 @@ const getUnreadCount = async () => {
|
||||
// 跳转我的站内信
|
||||
const goMyList = () => {
|
||||
push({
|
||||
name: 'MyNotifyMessage'
|
||||
name: 'NotifyMessage'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@ onMounted(() => {
|
||||
// 首次加载小红点
|
||||
getUnreadCount()
|
||||
// 轮询刷新小红点
|
||||
msgInterval.value = setInterval(() => {
|
||||
getUnreadCount()
|
||||
}, 1000 * 60 * 2)
|
||||
// msgInterval.value = setInterval(() => {
|
||||
// getUnreadCount()
|
||||
// }, 1000 * 60 * 2)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
|
||||
@@ -12,6 +12,13 @@ import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
|
||||
import ColorRadioPicker from './components/ColorRadioPicker.vue'
|
||||
// import InterfaceDisplay from './components/InterfaceDisplay.vue'
|
||||
// import LayoutRadioPicker from './components/LayoutRadioPicker.vue'
|
||||
import { useWatermark } from '@/hooks/web/useWatermark'
|
||||
|
||||
const { setWatermark } = useWatermark()
|
||||
|
||||
nextTick(() => {
|
||||
setWatermark('安徽莳松科技有限公司')
|
||||
})
|
||||
|
||||
const { t } = useI18n()
|
||||
const appStore = useAppStore()
|
||||
@@ -198,6 +205,7 @@ const clear = () => {
|
||||
|
||||
<template>
|
||||
<div
|
||||
v-if="false"
|
||||
:class="prefixCls"
|
||||
class="fixed top-[45%] right-0 w-40px h-40px text-center leading-40px bg-[var(--el-color-primary)] cursor-pointer"
|
||||
@click="drawer = true"
|
||||
@@ -205,7 +213,9 @@ const clear = () => {
|
||||
<Icon color="#fff" icon="ep:setting" />
|
||||
</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>
|
||||
<span class="text-16px font-700">{{ t('setting.projectSetting') }}</span>
|
||||
</template>
|
||||
|
||||
@@ -124,7 +124,6 @@ const fixedMenuChange = (show: boolean) => {
|
||||
const setWater = () => {
|
||||
setWatermark(water.value)
|
||||
}
|
||||
setWater()
|
||||
|
||||
const layout = computed(() => appStore.getLayout)
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ import { useUserStore } from '@/store/modules/user'
|
||||
import { useTagsViewStore } from '@/store/modules/tagsView'
|
||||
import { getTenantId, getAppId } from '@/utils/auth'
|
||||
|
||||
import { Setting } from '@/layout/components/Setting'
|
||||
|
||||
const { t } = useI18n()
|
||||
|
||||
const { wsCache } = useCache()
|
||||
@@ -58,6 +60,10 @@ const toProfile = async () => {
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<ElDropdownMenu>
|
||||
<ElDropdownItem>
|
||||
<Icon icon="ep:tools" />
|
||||
<Setting />
|
||||
</ElDropdownItem>
|
||||
<ElDropdownItem>
|
||||
<Icon icon="ep:tools" />
|
||||
<div @click="toProfile">{{ t('common.profile') }}</div>
|
||||
|
||||
@@ -54,9 +54,9 @@ router.beforeEach(async (to, from, next) => {
|
||||
const tenantId = getTenantId()
|
||||
const appId = getAppId()
|
||||
if (tenantId && appId) {
|
||||
next(`/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
next(`/crm/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
} else {
|
||||
next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
next(`/crm/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import remainingRouter from './modules/remaining'
|
||||
|
||||
// 创建路由实例
|
||||
const router = createRouter({
|
||||
history: createWebHistory(), // createWebHashHistory URL带#,createWebHistory URL不带#
|
||||
history: createWebHistory(import.meta.env.VITE_BASE_PATH), // createWebHashHistory URL带#,createWebHistory URL不带#
|
||||
strict: true,
|
||||
routes: remainingRouter as RouteRecordRaw[],
|
||||
scrollBehavior: () => ({ left: 0, top: 0 })
|
||||
|
||||
@@ -94,8 +94,8 @@ const remainingRouter: AppRouteRecordRaw[] = [
|
||||
},
|
||||
{
|
||||
path: 'notify-message',
|
||||
component: () => import('@/views/system/notify/my/index.vue'),
|
||||
name: 'MyNotifyMessage',
|
||||
component: () => import('@/views/Profile/NotifyMessage.vue'),
|
||||
name: 'NotifyMessage',
|
||||
meta: {
|
||||
canTo: true,
|
||||
hidden: true,
|
||||
|
||||
@@ -213,7 +213,7 @@ export const fenToYuan = (amount: string | number): number => {
|
||||
export const removeNullField = (obj: Object) => {
|
||||
for (const key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
if (obj[key] == '') {
|
||||
if (obj[key] === '') {
|
||||
delete obj[key]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,42 @@
|
||||
<template>
|
||||
<el-form :model="form" ref="formRef" label-width="auto">
|
||||
<el-form-item>
|
||||
<el-form-item v-if="getConfig('usePhoneConfig')">
|
||||
<template #label>
|
||||
<Tooltip message="请联系客服开通或关闭,客服电话:15955599959" />使用外呼
|
||||
<Tooltip
|
||||
v-if="getConfig('usePhoneConfig').remark"
|
||||
:message="getConfig('usePhoneConfig').remark"
|
||||
/>
|
||||
<span>使用外呼</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.callEnable" disabled>
|
||||
<el-radio :label="1"> 使用 </el-radio>
|
||||
<el-radio :label="0"> 不使用 </el-radio>
|
||||
<el-radio-group
|
||||
v-model="form.usePhoneConfig"
|
||||
:disabled="!getConfig('usePhoneConfig').modifiable"
|
||||
>
|
||||
<el-radio
|
||||
v-for="(item, index) in getConfig('usePhoneConfig').options"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="跟进信息">
|
||||
<el-radio-group v-model="form.followType">
|
||||
<el-radio :label="1"> 展示所有 </el-radio>
|
||||
<el-radio :label="2"> 仅展示本人 </el-radio>
|
||||
<el-form-item v-if="getConfig('showFollowConfig')">
|
||||
<template #label>
|
||||
<Tooltip
|
||||
v-if="getConfig('showFollowConfig').remark"
|
||||
:message="getConfig('showFollowConfig').remark"
|
||||
/>
|
||||
<span>跟进信息</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.showFollowConfig">
|
||||
<el-radio
|
||||
v-for="(item, index) in getConfig('showFollowConfig').options"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -23,23 +47,42 @@
|
||||
</template>
|
||||
|
||||
<script setup name="BasicSettingClue">
|
||||
import * as ConfigApi from '@/api/system/set'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
const form = ref({
|
||||
followType: 1,
|
||||
callEnable: 1
|
||||
})
|
||||
const form = ref({})
|
||||
|
||||
const configList = ref([])
|
||||
|
||||
function getConfig(val) {
|
||||
return configList.value.find((it) => it.configKey == val)
|
||||
}
|
||||
|
||||
function getData() {
|
||||
form.value = {
|
||||
followType: 1,
|
||||
callEnable: 1
|
||||
}
|
||||
ConfigApi.getConfigList({ module: 100 }).then((data) => {
|
||||
configList.value = data
|
||||
// 获取所有配置项
|
||||
data.map((it) => {
|
||||
form.value[it.configKey] = it.configValue
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
message.success('保存成功')
|
||||
const params = configList.value.map((it) => ({
|
||||
configId: it.configId,
|
||||
configKey: it.configKey,
|
||||
configValue: form.value[it.configKey]
|
||||
}))
|
||||
ConfigApi.updateConfig(params).then(() => {
|
||||
message.success('保存成功')
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -1,16 +1,31 @@
|
||||
<template>
|
||||
<el-form :model="form" ref="formRef" label-width="auto">
|
||||
<el-form-item label="是否关联成交率">
|
||||
<el-radio-group v-model="form.withSuccess">
|
||||
<el-radio :label="1"> 是 </el-radio>
|
||||
<el-radio :label="0"> 否 </el-radio>
|
||||
<el-form-item v-if="getConfig('saleCommissionRelateDealConfig')">
|
||||
<template #label>
|
||||
<Tooltip
|
||||
v-if="getConfig('saleCommissionRelateDealConfig').remark"
|
||||
:message="getConfig('saleCommissionRelateDealConfig').remark"
|
||||
/>
|
||||
<span>是否关联成交率</span>
|
||||
</template>
|
||||
<el-radio-group
|
||||
v-model="form.saleCommissionRelateDealConfig"
|
||||
@change="form.saleCommissionRelateRulesConfig = []"
|
||||
>
|
||||
<el-radio
|
||||
v-for="(item, index) in getConfig('saleCommissionRelateDealConfig').options"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="关联规则" v-if="form.withSuccess">
|
||||
<el-form-item label="关联规则" v-if="form.saleCommissionRelateDealConfig == 'true'">
|
||||
<div>
|
||||
<el-button @click="form.rules.push({})">新增规则</el-button>
|
||||
<el-button @click="form.saleCommissionRelateRulesConfig.push({})">新增规则</el-button>
|
||||
<div
|
||||
v-for="(item, index) in form.rules"
|
||||
v-for="(item, index) in form.saleCommissionRelateRulesConfig"
|
||||
:key="index"
|
||||
class="mt-10px flex justify-center items-center"
|
||||
>
|
||||
@@ -48,22 +63,52 @@
|
||||
</template>
|
||||
|
||||
<script setup name="BasicSettingClue">
|
||||
import * as ConfigApi from '@/api/system/set'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
const form = ref({
|
||||
withSuccess: 1,
|
||||
rules: []
|
||||
})
|
||||
const form = ref({})
|
||||
const configList = ref([])
|
||||
|
||||
const jsonArr = ['saleCommissionRelateRulesConfig']
|
||||
|
||||
function getConfig(val) {
|
||||
return configList.value.find((it) => it.configKey == val)
|
||||
}
|
||||
|
||||
function getData() {
|
||||
form.value = {
|
||||
withSuccess: 1
|
||||
}
|
||||
ConfigApi.getConfigList({ module: 101 }).then((data) => {
|
||||
configList.value = data
|
||||
// 获取所有配置项
|
||||
data.map((it) => {
|
||||
form.value[it.configKey] = it.configValue
|
||||
if (it.configKey == 'saleCommissionRelateRulesConfig') {
|
||||
if (!form.value[it.configKey]) {
|
||||
form.value[it.configKey] = []
|
||||
} else {
|
||||
form.value[it.configKey] = JSON.parse(it.configValue)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
message.success('保存成功')
|
||||
const params = configList.value.map((it) => ({
|
||||
configId: it.configId,
|
||||
configKey: it.configKey,
|
||||
configValue: jsonArr.includes(it.configKey)
|
||||
? JSON.stringify(form.value[it.configKey])
|
||||
: form.value[it.configKey]
|
||||
}))
|
||||
ConfigApi.updateConfig(params).then(() => {
|
||||
message.success('保存成功')
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="files" label="附件">
|
||||
<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 }}
|
||||
</el-link>
|
||||
</template>
|
||||
@@ -195,6 +195,16 @@ function handleClickLib(index) {
|
||||
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) {
|
||||
resourceDialog.value.open(type, libraryList.value[libraryIndex.value], id)
|
||||
}
|
||||
|
||||
@@ -107,7 +107,14 @@ const dataScopeOptions = [
|
||||
]
|
||||
|
||||
async function getRoleInfo(id) {
|
||||
formData.value = await RoleApi.getRole(id)
|
||||
try {
|
||||
formData.value = await RoleApi.getRole(id)
|
||||
nextTick(() => {
|
||||
treeRef.value.setCheckedKeys(formData.value.dataScopeDeptIds)
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
/** 提交表单 */
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="用户昵称" prop="nickname">
|
||||
<el-input v-model="formData.nickname" placeholder="请输入用户昵称" />
|
||||
<el-form-item label="用户姓名" prop="nickname">
|
||||
<el-input v-model="formData.nickname" placeholder="请输入用户姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -69,8 +69,8 @@
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item v-if="formData.id === undefined" label="用户名称" prop="username">
|
||||
<el-input v-model="formData.username" placeholder="请输入用户名称" />
|
||||
<el-form-item v-if="formData.id === undefined" label="登录账号" prop="username">
|
||||
<el-input v-model="formData.username" placeholder="请输入登录账号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
@@ -142,8 +142,8 @@ const formData = ref({
|
||||
hireDate: ''
|
||||
})
|
||||
const formRules = ref<any>({
|
||||
username: [{ required: true, message: '用户名称不能为空', trigger: 'blur' }],
|
||||
nickname: [{ required: true, message: '用户昵称不能为空', trigger: 'blur' }],
|
||||
username: [{ required: true, message: '登录账号不能为空', trigger: 'blur' }],
|
||||
nickname: [{ required: true, message: '用户姓名不能为空', trigger: 'blur' }],
|
||||
password: [{ required: true, message: '用户密码不能为空', trigger: 'blur' }],
|
||||
email: [
|
||||
{
|
||||
@@ -152,13 +152,7 @@ const formRules = ref<any>({
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
],
|
||||
mobile: [
|
||||
{
|
||||
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'
|
||||
}
|
||||
]
|
||||
mobile: [{ required: true, message: '手机号不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
const deptList = ref<Tree[]>([]) // 树形结构
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
<el-col :span="20" :xs="24">
|
||||
<!-- 搜索 -->
|
||||
<el-form :model="queryParams" ref="queryFormRef" inline label-width="68px">
|
||||
<el-form-item label="用户名称" prop="username">
|
||||
<el-form-item label="登录账号" prop="username">
|
||||
<el-input
|
||||
v-model="queryParams.username"
|
||||
placeholder="请输入用户名称"
|
||||
placeholder="请输入登录账号"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
class="!w-240px"
|
||||
@@ -40,8 +40,8 @@
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="用户编号" key="id" prop="id" />
|
||||
<el-table-column label="用户名称" prop="username" />
|
||||
<el-table-column label="用户昵称" prop="nickname" />
|
||||
<el-table-column label="登录账号" prop="username" />
|
||||
<el-table-column label="用户姓名" prop="nickname" />
|
||||
<el-table-column label="部门" key="deptName" prop="deptName" />
|
||||
<el-table-column label="手机号码" prop="mobile" width="120" />
|
||||
<el-table-column label="状态" key="status">
|
||||
|
||||
@@ -86,7 +86,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
if (!formRef) return
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
|
||||
@@ -141,7 +141,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
if (!formRef) return
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
|
||||
248
src/views/Clue/Order/Comp/AfterSales.vue
Normal file
248
src/views/Clue/Order/Comp/AfterSales.vue
Normal file
@@ -0,0 +1,248 @@
|
||||
<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-select v-model="searchForm.state" placeholder="审核状态" clearable>
|
||||
<el-option label="待审核" :value="1" />
|
||||
<el-option label="已撤销" :value="2" />
|
||||
<el-option label="已通过" :value="3" />
|
||||
<el-option label="已驳回" :value="4" />
|
||||
</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.applyUser" 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.applyTime"
|
||||
type="daterange"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="申请日期"
|
||||
end-placeholder="申请日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch">查询</el-button>
|
||||
<el-button @click="handleReset">重置</el-button>
|
||||
<el-button @click="batchAudit">批量审核</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableList"
|
||||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" :selectable="(row) => row.state == 1" />
|
||||
<el-table-column prop="signId" label="成交单号" min-width="150px" />
|
||||
<el-table-column prop="name" label="线索名称" min-width="200px" />
|
||||
<el-table-column prop="phone" label="联系方式" min-width="150px" />
|
||||
<el-table-column prop="reason" label="售后原因" min-width="150px" />
|
||||
<el-table-column prop="refundAmount" 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="signUserName" label="登记人" min-width="90px" />
|
||||
<el-table-column
|
||||
prop="dealDate"
|
||||
label="成交日期"
|
||||
min-width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column prop="applyUserName" label="申请人" min-width="90px" />
|
||||
<el-table-column
|
||||
prop="applyTime"
|
||||
label="申请时间"
|
||||
min-width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column prop="stateName" label="审核状态" fixed="right" min-width="90px" />
|
||||
<el-table-column label="操作" width="150px" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" style="padding: 0" text @click="handleDetail(row.id)">
|
||||
详情
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
style="padding: 0"
|
||||
text
|
||||
v-if="row.state == 1 && currentUserId == row.applyUser"
|
||||
v-hasPermi="['clue:order:after-sale']"
|
||||
@click="handleCancel(row.id)"
|
||||
>
|
||||
撤销
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
style="padding: 0"
|
||||
text
|
||||
v-if="row.state == 1"
|
||||
v-hasPermi="['clue:order:after-sale-audit']"
|
||||
@click="handleAudit(row)"
|
||||
>
|
||||
审核
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<DialogAfterSaleAudit ref="afterSaleAuditDialog" @success="getList" />
|
||||
<DialogAfterSaleDetail ref="afterSaleDetailDialog" />
|
||||
<DialogBatchAudit ref="batchAuditDialog" @success="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="AfterSales">
|
||||
import * as AfterSaleApi from '@/api/clue/afterSale'
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
import DialogAfterSaleAudit from './DialogAfterSaleAudit.vue'
|
||||
import DialogAfterSaleDetail from './DialogAfterSaleDetail.vue'
|
||||
import DialogBatchAudit from './DialogBatchAudit.vue'
|
||||
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
const afterSaleAuditDialog = ref()
|
||||
|
||||
const userStore = useUserStore()
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const currentUserId = userStore.getUser.id
|
||||
|
||||
const searchForm = ref({
|
||||
signId: undefined,
|
||||
name: undefined,
|
||||
dealDate: [],
|
||||
state: undefined,
|
||||
dealUser: undefined,
|
||||
createDate: [],
|
||||
createUser: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
})
|
||||
|
||||
const userOptions = ref([])
|
||||
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
|
||||
function handleSearch() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
signId: undefined,
|
||||
name: undefined,
|
||||
state: undefined,
|
||||
dealDate: [],
|
||||
dealUser: undefined,
|
||||
createDate: [],
|
||||
createUser: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
}
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await AfterSaleApi.getAfterSalePage(searchForm.value)
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const batchIds = ref([])
|
||||
function handleSelectionChange(val) {
|
||||
batchIds.value = val.map((it) => it.id)
|
||||
}
|
||||
|
||||
const batchAuditDialog = ref()
|
||||
function batchAudit() {
|
||||
if (batchIds.value.length) {
|
||||
batchAuditDialog.value.open('aftersale', batchIds.value)
|
||||
} else {
|
||||
message.info('请选择表格中需要审核的数据')
|
||||
}
|
||||
}
|
||||
|
||||
const afterSaleDetailDialog = ref()
|
||||
function handleDetail(id) {
|
||||
afterSaleDetailDialog.value.open(id)
|
||||
}
|
||||
async function handleCancel(id) {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.confirm('是否确认撤销申请?')
|
||||
// 发起删除
|
||||
await AfterSaleApi.cancelApplyAfterSale({ id })
|
||||
message.success('撤销成功!')
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
}
|
||||
function handleAudit(row) {
|
||||
afterSaleAuditDialog.value.open(row)
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
})
|
||||
}
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
handleSearch()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
194
src/views/Clue/Order/Comp/Delivery.vue
Normal file
194
src/views/Clue/Order/Comp/Delivery.vue
Normal file
@@ -0,0 +1,194 @@
|
||||
<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-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.productId"
|
||||
placeholder="选择成交产品"
|
||||
filterable
|
||||
clearable
|
||||
@change="searchForm.specsId = 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.specsId"
|
||||
placeholder="选择规格"
|
||||
filterable
|
||||
clearable
|
||||
:disabled="!searchForm.productId"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in specsOptions(searchForm.productId)"
|
||||
:key="item.specsId"
|
||||
:label="item.specsName"
|
||||
:value="item.specsId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch">查询</el-button>
|
||||
<el-button @click="handleReset">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="tableList" border>
|
||||
<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="productName" label="成交产品" min-width="150px" />
|
||||
<el-table-column prop="specsName" label="产品规格" min-width="150px" />
|
||||
<el-table-column prop="signNum" label="销售数量" width="90px" />
|
||||
<el-table-column
|
||||
prop="createTime"
|
||||
label="发货时间"
|
||||
width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<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>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Delivery">
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { getSimpleProductList } from '@/api/mall/product'
|
||||
import * as DeliveryApi from '@/api/clue/delivery'
|
||||
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
// const message = useMessage() // 消息弹窗
|
||||
|
||||
const searchForm = ref({
|
||||
signId: undefined,
|
||||
name: undefined,
|
||||
dealDate: [],
|
||||
signUser: undefined,
|
||||
productId: undefined,
|
||||
specsId: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
})
|
||||
|
||||
const userOptions = ref([])
|
||||
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
|
||||
function handleSearch() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
signId: undefined,
|
||||
name: undefined,
|
||||
dealDate: [],
|
||||
signUser: undefined,
|
||||
productId: undefined,
|
||||
specsId: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
}
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await DeliveryApi.getDeliveryPage(searchForm.value)
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const prodOptions = ref([])
|
||||
|
||||
const specsOptions = computed({
|
||||
get() {
|
||||
return (prodId) => {
|
||||
if (prodId) {
|
||||
return prodOptions.value.find((it) => it.productId == prodId).productSpecList
|
||||
}
|
||||
return []
|
||||
}
|
||||
}
|
||||
})
|
||||
function getOptions() {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
})
|
||||
// 产品
|
||||
getSimpleProductList().then((data) => {
|
||||
prodOptions.value = data
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
handleSearch()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
122
src/views/Clue/Order/Comp/DialogAfterSale.vue
Normal file
122
src/views/Clue/Order/Comp/DialogAfterSale.vue
Normal file
@@ -0,0 +1,122 @@
|
||||
<template>
|
||||
<Dialog title="售后记录" v-model="show" width="800px">
|
||||
<el-table :data="aftersaleList" border stripe>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="reason" label="售后原因" />
|
||||
<el-table-column prop="refundAmount" label="退款金额" />
|
||||
<el-table-column prop="isReturns" label="是否退货" />
|
||||
<el-table-column prop="applyTime" label="申请日期" width="180px" />
|
||||
<el-table-column prop="stateName" label="审核状态" />
|
||||
</el-table>
|
||||
<el-divider direction="horizontal" />
|
||||
|
||||
<el-button v-show="showAdd" class="mb-10px" type="primary" @click="handleAdd">
|
||||
新增售后
|
||||
</el-button>
|
||||
<el-form v-if="!showAdd" :model="form" ref="formRef" :rules="rules" label-width="80px">
|
||||
<el-form-item label="售后原因" prop="reason">
|
||||
<el-input v-model="form.reason" placeholder="请输入售后原因" />
|
||||
</el-form-item>
|
||||
<el-form-item label="退款金额" prop="refundAmount">
|
||||
<el-input-number
|
||||
v-model="form.refundAmount"
|
||||
:min="0"
|
||||
:controls="false"
|
||||
placeholder="请输入金额"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否退货" prop="isReturns">
|
||||
<el-radio-group v-model="form.isReturns">
|
||||
<el-radio :label="true"> 退货 </el-radio>
|
||||
<el-radio :label="false"> 不退货 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="解决方案" prop="solution">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:autoSize="{ minRows: 3 }"
|
||||
v-model="form.solution"
|
||||
placeholder="请输入退款原因"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<Editor v-model:modelValue="form.remark" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :disabled="formLoading" type="primary" @click="onSubmit">保存</el-button>
|
||||
<el-button @click="showAdd = true">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogAfterSale">
|
||||
import { getAfterSalePage, createAfterSale } from '@/api/clue/afterSale'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const show = ref(false)
|
||||
const aftersaleList = ref([])
|
||||
const orderId = ref('')
|
||||
|
||||
function open(signId) {
|
||||
show.value = true
|
||||
orderId.value = signId
|
||||
try {
|
||||
getList()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
const showAdd = ref(true)
|
||||
const form = ref({})
|
||||
const rules = {
|
||||
refundAmount: { required: true, message: '回款金额不可为空', trigger: 'blur' },
|
||||
reason: { required: true, message: '售后原因不可为空', trigger: 'blur' },
|
||||
solution: { required: true, message: '解决方案不可为空', trigger: 'blur' }
|
||||
}
|
||||
|
||||
function getList() {
|
||||
getAfterSalePage({ signId: orderId.value, pageNo: 1, pageSize: 100 }).then((data) => {
|
||||
aftersaleList.value = data.list
|
||||
})
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
showAdd.value = false
|
||||
form.value = {
|
||||
signId: orderId.value,
|
||||
reason: undefined,
|
||||
solution: undefined,
|
||||
refundAmount: undefined,
|
||||
isReturns: false,
|
||||
remark: undefined
|
||||
}
|
||||
}
|
||||
|
||||
const formRef = ref()
|
||||
const formLoading = ref(false)
|
||||
async function onSubmit() {
|
||||
// 校验表单
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
await createAfterSale(form.value)
|
||||
message.success('申请成功!')
|
||||
getList()
|
||||
showAdd.value = true
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
137
src/views/Clue/Order/Comp/DialogAfterSaleAudit.vue
Normal file
137
src/views/Clue/Order/Comp/DialogAfterSaleAudit.vue
Normal file
@@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
|
||||
<Descriptions :data="orderInfo" :schema="schema" :columns="2" labelWidth="130px" />
|
||||
<el-form ref="formRef" v-loading="formLoading" :model="formData" label-width="80px">
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-radio-group v-model="formData.state">
|
||||
<el-radio :label="3"> 通过 </el-radio>
|
||||
<el-radio :label="4"> 驳回 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<Editor v-model:modelValue="formData.remark" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script name="DialogAfterSaleAudit" setup>
|
||||
import { auditAfterSale } from '@/api/clue/afterSale'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
|
||||
const schema = [
|
||||
{
|
||||
field: 'name',
|
||||
label: '线索名称',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'phone',
|
||||
label: '联系方式',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'signUserName',
|
||||
label: '登记人',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'reason',
|
||||
label: '售后原因',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'solution',
|
||||
label: '解决方案',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'refundAmount',
|
||||
label: '退款金额',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'isReturns',
|
||||
label: '是否退货',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'applyUserName',
|
||||
label: '申请人',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'applyTime',
|
||||
label: '申请时间',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
label: '备注',
|
||||
span: 2,
|
||||
isEditor: true
|
||||
}
|
||||
]
|
||||
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formData = ref({
|
||||
state: 3,
|
||||
remark: ''
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
const orderInfo = ref({})
|
||||
/** 打开弹窗 */
|
||||
const open = async (row) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = '售后审核'
|
||||
resetForm(row.id)
|
||||
// 修改时,设置数据
|
||||
orderInfo.value = { ...row }
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
await auditAfterSale(formData.value)
|
||||
message.success('审核完成!')
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = (signId) => {
|
||||
formData.value = {
|
||||
saleId: signId,
|
||||
state: 3,
|
||||
remark: ''
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
||||
137
src/views/Clue/Order/Comp/DialogAfterSaleDetail.vue
Normal file
137
src/views/Clue/Order/Comp/DialogAfterSaleDetail.vue
Normal file
@@ -0,0 +1,137 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="900px">
|
||||
<Descriptions
|
||||
title="申请详情"
|
||||
:data="orderInfo"
|
||||
:schema="applySchema"
|
||||
:columns="2"
|
||||
labelWidth="130px"
|
||||
/>
|
||||
<Descriptions
|
||||
title="审核详情"
|
||||
:data="orderInfo"
|
||||
:schema="orderInfo.state == 2 ? cancelSchema : auditSchema"
|
||||
:columns="orderInfo.state == 2 ? 2 : 3"
|
||||
labelWidth="100px"
|
||||
/>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script name="DialogAfterSaleDetail" setup>
|
||||
import { getAfterSaleDetail } from '@/api/clue/afterSale'
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
|
||||
const applySchema = [
|
||||
{
|
||||
field: 'name',
|
||||
label: '线索名称',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'phone',
|
||||
label: '联系方式',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'signUserName',
|
||||
label: '登记人',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'reason',
|
||||
label: '售后原因',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'refundAmount',
|
||||
label: '退款金额',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'isReturns',
|
||||
label: '是否退货',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'solution',
|
||||
label: '解决方案',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'applyUserName',
|
||||
label: '申请人',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'applyTime',
|
||||
label: '申请时间',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
label: '备注',
|
||||
span: 2,
|
||||
isEditor: true
|
||||
}
|
||||
]
|
||||
|
||||
const auditSchema = [
|
||||
{
|
||||
field: 'stateName',
|
||||
label: '审核状态',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'checkUser',
|
||||
label: '审核人',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'checkTime',
|
||||
label: '审核时间',
|
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'checkRemark',
|
||||
label: '备注',
|
||||
span: 3,
|
||||
isEditor: true
|
||||
}
|
||||
]
|
||||
|
||||
const cancelSchema = [
|
||||
{
|
||||
field: 'stateName',
|
||||
label: '审核状态',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'revokeTime',
|
||||
label: '撤销时间',
|
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
span: 1
|
||||
}
|
||||
]
|
||||
|
||||
const orderInfo = ref({})
|
||||
/** 打开弹窗 */
|
||||
const open = async (id) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = '售后申请详情'
|
||||
try {
|
||||
orderInfo.value = await getAfterSaleDetail({ id })
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
</script>
|
||||
87
src/views/Clue/Order/Comp/DialogBatchAudit.vue
Normal file
87
src/views/Clue/Order/Comp/DialogBatchAudit.vue
Normal file
@@ -0,0 +1,87 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="600px">
|
||||
<el-form ref="formRef" v-loading="formLoading" :model="formData" label-width="80px">
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-radio-group v-model="formData.state">
|
||||
<el-radio :label="3"> 通过 </el-radio>
|
||||
<el-radio :label="4"> 驳回 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<Editor v-model:modelValue="formData.remark" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script name="DialogAfterSaleAudit" setup>
|
||||
import { batchAuditAfterSale } from '@/api/clue/afterSale'
|
||||
import { batchAuditPayment } from '@/api/clue/payment'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formData = ref({
|
||||
state: 3,
|
||||
remark: ''
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
const formType = ref('aftersale')
|
||||
const titleMap = {
|
||||
aftersale: '批量售后审核',
|
||||
feeback: '批量回款审核'
|
||||
}
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = (type, ids) => {
|
||||
dialogVisible.value = true
|
||||
formType.value = type
|
||||
dialogTitle.value = titleMap[type] || '批量审核'
|
||||
resetForm(ids)
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
if (formType.value == 'aftersale') {
|
||||
await batchAuditAfterSale(formData.value)
|
||||
message.success('审核完成!')
|
||||
} else if (formType.value == 'feeback') {
|
||||
await batchAuditPayment(formData.value)
|
||||
message.success('审核完成!')
|
||||
} else {
|
||||
return
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = (ids) => {
|
||||
formData.value = {
|
||||
payIds: ids,
|
||||
saleIds: ids,
|
||||
state: 3,
|
||||
remark: ''
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
||||
244
src/views/Clue/Order/Comp/DialogDelivery.vue
Normal file
244
src/views/Clue/Order/Comp/DialogDelivery.vue
Normal file
@@ -0,0 +1,244 @@
|
||||
<template>
|
||||
<el-dialog title="发货" v-model="show" width="700px">
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="85px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="待发数量">
|
||||
<span class="font-bold">:{{ form.sendTotalNum }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="16" :offset="0">
|
||||
<el-form-item label="发货方式">
|
||||
<el-radio-group v-model="form.sendType" :disabled="autoAuditPurchase == 'false'">
|
||||
<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="备注">
|
||||
<Editor v-model:modelValue="form.remark" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="show = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="onSubmit">确 定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogDelivery">
|
||||
import { getSimpleWarehouseList, getRemainInventoryList } from '@/api/mall/warehouse'
|
||||
import { createDelivery } from '@/api/clue/delivery'
|
||||
import { getConfigList } from '@/api/system/set'
|
||||
import { getDictOptions } from '@/utils/dict'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const warehouseOptions = ref([])
|
||||
const supplierOptions = getDictOptions('erp_supplier')
|
||||
function getOptions() {
|
||||
getSimpleWarehouseList().then((data) => {
|
||||
warehouseOptions.value = data
|
||||
})
|
||||
}
|
||||
|
||||
function getRemainInventory(signProductId) {
|
||||
getRemainInventoryList({ signProductId }).then((data) => {
|
||||
inventoryList.value = data
|
||||
})
|
||||
}
|
||||
|
||||
const show = ref(false)
|
||||
function open(row) {
|
||||
show.value = true
|
||||
resetForm(row)
|
||||
getRemainInventory(row.id)
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
|
||||
const form = 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' }
|
||||
})
|
||||
function resetForm(row) {
|
||||
form.value = {
|
||||
sendType: 2,
|
||||
sendTotalNum: row.signNum,
|
||||
signProductId: row.id,
|
||||
productId: row.productId,
|
||||
specsId: row.specsId,
|
||||
warehouseId: undefined,
|
||||
supplier: undefined,
|
||||
num: row.signNum,
|
||||
unitPrice: undefined,
|
||||
remark: undefined
|
||||
}
|
||||
}
|
||||
|
||||
const emit = defineEmits(['success'])
|
||||
const formLoading = ref(false)
|
||||
const formRef = ref()
|
||||
async function onSubmit() {
|
||||
// 校验表单
|
||||
if (!formRef.value) 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
|
||||
try {
|
||||
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('发货成功!')
|
||||
show.value = false
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const inventoryList = ref([])
|
||||
|
||||
const deliveryArr = ref([])
|
||||
function handleSelectionChange(val) {
|
||||
deliveryArr.value = val
|
||||
}
|
||||
|
||||
const autoAuditPurchase = ref('false')
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
getConfigList({ module: 3 }).then((data) => {
|
||||
// 获取所有配置项
|
||||
autoAuditPurchase.value = data.find(
|
||||
(it) => it.configKey == 'purchaseAuditAutoCompleteConfig'
|
||||
).configValue
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
140
src/views/Clue/Order/Comp/DialogExtraPay.vue
Normal file
140
src/views/Clue/Order/Comp/DialogExtraPay.vue
Normal file
@@ -0,0 +1,140 @@
|
||||
<template>
|
||||
<el-dialog title="额外支出" v-model="show" width="800px">
|
||||
<el-button
|
||||
class="mb-5px"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="
|
||||
form.extraPay.push({
|
||||
extraPayType: undefined,
|
||||
extraPayMoney: 0,
|
||||
dictType: 'extra_pay_type',
|
||||
editabled: true
|
||||
})
|
||||
"
|
||||
>
|
||||
添加额外支出
|
||||
</el-button>
|
||||
<el-table :data="form.extraPay" border size="small">
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="extraPayType" label="费用类型" width="200px">
|
||||
<template #default="{ row }">
|
||||
<el-select
|
||||
v-if="row.editabled"
|
||||
v-model="row.extraPayType"
|
||||
size="small"
|
||||
placeholder="其他费用类型"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
v-for="item in extraPayOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="extraPayMoney" label="费用金额" width="180px">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
v-if="row.editabled"
|
||||
v-model="row.extraPayMoney"
|
||||
size="small"
|
||||
:controls="false"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="remark" label="备注">
|
||||
<template #default="{ row }">
|
||||
<el-input v-if="row.editabled" v-model="row.remark" size="small" placeholder="备注信息" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="60px">
|
||||
<template #default="{ row, $index }">
|
||||
<Icon
|
||||
icon="ep:remove-filled"
|
||||
class="text-red-500"
|
||||
v-if="row.editabled"
|
||||
@click="handleRemove('extraPay', $index)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="show = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="onSubmit">确 定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogExtraPay">
|
||||
import { signAddPay, getSignExtraPayList } from '@/api/clue/sign'
|
||||
import { getDictOptions } from '@/utils/dict'
|
||||
|
||||
const extraPayOptions = getDictOptions('extra_pay_type')
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const show = ref(false)
|
||||
function open(id) {
|
||||
show.value = true
|
||||
resetForm(id)
|
||||
getFormList()
|
||||
}
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
|
||||
const form = ref({})
|
||||
function resetForm(id) {
|
||||
form.value = {
|
||||
signId: id,
|
||||
extraPay: []
|
||||
}
|
||||
}
|
||||
|
||||
function getFormList() {
|
||||
getSignExtraPayList({ id: form.value.signId }).then((data) => {
|
||||
form.value.extraPay = data.map((it) => ({
|
||||
...it,
|
||||
editabled: false
|
||||
}))
|
||||
})
|
||||
}
|
||||
|
||||
const formLoading = ref(false)
|
||||
async function onSubmit() {
|
||||
// 校验表单
|
||||
if (form.value.extraPay.length) {
|
||||
if (form.value.extraPay.some((it) => !it.extraPayType || it.extraPayMoney == null)) {
|
||||
message.info('请想额外支出信息填写完整!')
|
||||
return
|
||||
}
|
||||
} else {
|
||||
message.info('请添加额外支出')
|
||||
return
|
||||
}
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
const params = {
|
||||
signId: form.value.signId,
|
||||
extraPay: form.value.extraPay.filter((it) => it.editabled)
|
||||
}
|
||||
await signAddPay(params)
|
||||
message.success('添加额外支出成功!')
|
||||
getFormList()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function handleRemove(type, index) {
|
||||
form.value[type].splice(index, 1)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
101
src/views/Clue/Order/Comp/DialogFeeback.vue
Normal file
101
src/views/Clue/Order/Comp/DialogFeeback.vue
Normal file
@@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<Dialog title="回款记录" v-model="show" width="800px">
|
||||
<el-table :data="feebackList" border stripe>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="money" label="回款金额" />
|
||||
<el-table-column prop="applyTime" label="申请日期" />
|
||||
<el-table-column prop="isPayoff" label="是否结清" />
|
||||
<el-table-column prop="stateName" label="审核状态" />
|
||||
</el-table>
|
||||
<el-divider direction="horizontal" />
|
||||
|
||||
<el-button v-show="showAdd" class="mb-10px" type="primary" @click="handleAdd">
|
||||
新增回款
|
||||
</el-button>
|
||||
<el-form v-if="!showAdd" :model="form" ref="formRef" :rules="rules" label-width="80px">
|
||||
<el-form-item label="回款金额" prop="money">
|
||||
<el-input-number v-model="form.money" :min="0" :controls="false" placeholder="请输入金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否结清" prop="isPayoff">
|
||||
<el-radio-group v-model="form.isPayoff">
|
||||
<el-radio :label="true"> 结清 </el-radio>
|
||||
<el-radio :label="false"> 未结清 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<Editor v-model:modelValue="form.remark" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button :disabled="formLoading" type="primary" @click="onSubmit">保存</el-button>
|
||||
<el-button @click="showAdd = true">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogFeeback">
|
||||
import { getPaymentPage, createPayment } from '@/api/clue/payment'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const show = ref(false)
|
||||
const feebackList = ref([])
|
||||
const orderId = ref('')
|
||||
|
||||
function open(signId) {
|
||||
show.value = true
|
||||
orderId.value = signId
|
||||
try {
|
||||
getList()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
const showAdd = ref(true)
|
||||
const form = ref({})
|
||||
const rules = {
|
||||
money: { required: true, message: '回款金额不可为空', trigger: 'blur' }
|
||||
}
|
||||
|
||||
function getList() {
|
||||
getPaymentPage({ signId: orderId.value, pageNo: 1, pageSize: 100 }).then((data) => {
|
||||
feebackList.value = data.list
|
||||
})
|
||||
}
|
||||
|
||||
function handleAdd() {
|
||||
showAdd.value = false
|
||||
form.value = {
|
||||
signId: orderId.value,
|
||||
money: undefined,
|
||||
isPayoff: true,
|
||||
remark: undefined
|
||||
}
|
||||
}
|
||||
|
||||
const formRef = ref()
|
||||
const formLoading = ref(false)
|
||||
async function onSubmit() {
|
||||
// 校验表单
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
await createPayment(form.value)
|
||||
message.success('申请成功!')
|
||||
getList()
|
||||
showAdd.value = true
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
127
src/views/Clue/Order/Comp/DialogFeebackAudit.vue
Normal file
127
src/views/Clue/Order/Comp/DialogFeebackAudit.vue
Normal file
@@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
|
||||
<Descriptions :data="orderInfo" :schema="schema" :columns="2" labelWidth="130px" />
|
||||
<el-form ref="formRef" v-loading="formLoading" :model="formData" label-width="80px">
|
||||
<el-form-item label="状态" prop="state">
|
||||
<el-radio-group v-model="formData.state">
|
||||
<el-radio :label="3"> 通过 </el-radio>
|
||||
<el-radio :label="4"> 驳回 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<Editor v-model:modelValue="formData.remark" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script name="DialogFeebackAudit" setup>
|
||||
import { auditPayment } from '@/api/clue/payment'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
|
||||
const schema = [
|
||||
{
|
||||
field: 'name',
|
||||
label: '线索名称',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'phone',
|
||||
label: '联系方式',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'signUserName',
|
||||
label: '登记人',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'money',
|
||||
label: '回款金额',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'isPayoff',
|
||||
label: '是否结清',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'applyUserName',
|
||||
label: '申请人',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'applyTime',
|
||||
label: '申请时间',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
label: '备注',
|
||||
span: 2,
|
||||
isEditor: true
|
||||
}
|
||||
]
|
||||
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formData = ref({
|
||||
state: 3,
|
||||
remark: ''
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
const orderInfo = ref({})
|
||||
/** 打开弹窗 */
|
||||
const open = async (row) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = '回款审核'
|
||||
resetForm(row.id)
|
||||
// 修改时,设置数据
|
||||
orderInfo.value = { ...row }
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
await auditPayment(formData.value)
|
||||
message.success('审核完成!')
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = (signId) => {
|
||||
formData.value = {
|
||||
payId: signId,
|
||||
state: 3,
|
||||
remark: ''
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
||||
127
src/views/Clue/Order/Comp/DialogFeebackDetail.vue
Normal file
127
src/views/Clue/Order/Comp/DialogFeebackDetail.vue
Normal file
@@ -0,0 +1,127 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="900px">
|
||||
<Descriptions
|
||||
title="申请详情"
|
||||
:data="orderInfo"
|
||||
:schema="applySchema"
|
||||
:columns="2"
|
||||
labelWidth="130px"
|
||||
/>
|
||||
<Descriptions
|
||||
title="审核详情"
|
||||
:data="orderInfo"
|
||||
:schema="orderInfo.state == 2 ? cancelSchema : auditSchema"
|
||||
:columns="orderInfo.state == 2 ? 2 : 3"
|
||||
labelWidth="100px"
|
||||
/>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script name="DialogFeebackDetail" setup>
|
||||
import { getPaymentDetail } from '@/api/clue/payment'
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
|
||||
const applySchema = [
|
||||
{
|
||||
field: 'name',
|
||||
label: '线索名称',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'phone',
|
||||
label: '联系方式',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'signUserName',
|
||||
label: '登记人',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'money',
|
||||
label: '回款金额',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'isPayoff',
|
||||
label: '是否结清',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'applyUserName',
|
||||
label: '申请人',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'applyTime',
|
||||
label: '申请时间',
|
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
label: '备注',
|
||||
span: 2,
|
||||
isEditor: true
|
||||
}
|
||||
]
|
||||
|
||||
const auditSchema = [
|
||||
{
|
||||
field: 'stateName',
|
||||
label: '审核状态',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'checkUser',
|
||||
label: '审核人',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'checkTime',
|
||||
label: '审核时间',
|
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'checkRemark',
|
||||
label: '备注',
|
||||
span: 3,
|
||||
isEditor: true
|
||||
}
|
||||
]
|
||||
|
||||
const cancelSchema = [
|
||||
{
|
||||
field: 'stateName',
|
||||
label: '审核状态',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
field: 'revokeTime',
|
||||
label: '撤销时间',
|
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
span: 1
|
||||
}
|
||||
]
|
||||
|
||||
const orderInfo = ref({})
|
||||
/** 打开弹窗 */
|
||||
const open = async (id) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = '回款申请详情'
|
||||
try {
|
||||
orderInfo.value = await getPaymentDetail({ id })
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
</script>
|
||||
212
src/views/Clue/Order/Comp/DialogOrder.vue
Normal file
212
src/views/Clue/Order/Comp/DialogOrder.vue
Normal file
@@ -0,0 +1,212 @@
|
||||
<template>
|
||||
<Dialog title="成交详情" v-model="show" width="800px">
|
||||
<el-tabs v-model="tabName">
|
||||
<el-tab-pane label="线索信息" name="clueInfo">
|
||||
<Descriptions :data="clueInfo" :schema="clueSchema" :columns="2" labelWidth="130px" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="成交信息" name="orderInfo">
|
||||
<Descriptions :data="orderInfo" :schema="orderSchema" :columns="2" labelWidth="130px" />
|
||||
<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-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>
|
||||
<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 label="回款记录" name="returnRecord">
|
||||
<el-table :data="returnRecordList" border stripe>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="money" label="回款金额" />
|
||||
<el-table-column prop="applyTime" label="申请日期" />
|
||||
<el-table-column prop="isPayoff" label="是否结清" />
|
||||
<el-table-column prop="stateName" label="审核状态" />
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="售后记录" name="afterSale">
|
||||
<el-table :data="aftersaleList" border stripe>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="reason" label="售后原因" />
|
||||
<el-table-column prop="refundAmount" label="退款金额" />
|
||||
<el-table-column prop="isReturns" label="是否退货" />
|
||||
<el-table-column prop="applyTime" label="申请日期" width="180px" />
|
||||
<el-table-column prop="stateName" label="审核状态" />
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="mb-15px"></div>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogOrder">
|
||||
import * as ClueApi from '@/api/clue'
|
||||
import * as OrderApi from '@/api/clue/sign'
|
||||
import { getSimpleFieldList as getClueFieldList } from '@/api/clue/clueField'
|
||||
import { getSimpleFieldList as getOrderFieldList } from '@/api/clue/orderField'
|
||||
import { getPaymentPage } from '@/api/clue/payment'
|
||||
import { getAfterSalePage } from '@/api/clue/afterSale'
|
||||
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const tabName = ref('clueInfo')
|
||||
const show = ref(false)
|
||||
const clueInfo = ref({})
|
||||
const orderInfo = ref({
|
||||
signProducts: [],
|
||||
extraPay: []
|
||||
})
|
||||
const returnRecordList = 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) {
|
||||
try {
|
||||
show.value = true
|
||||
tabName.value = 'clueInfo'
|
||||
getFields()
|
||||
ClueApi.getClue(clueId).then((data) => {
|
||||
clueInfo.value = { ...data, ...data.diyParams }
|
||||
})
|
||||
OrderApi.getSign(orderId).then((data) => {
|
||||
orderInfo.value = { ...data, ...data.diyParams }
|
||||
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) => {
|
||||
returnRecordList.value = data.list
|
||||
})
|
||||
getAfterSalePage({ signId: orderId, pageNo: 1, pageSize: 100 }).then((data) => {
|
||||
aftersaleList.value = data.list
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
const clueSchema = ref([])
|
||||
const orderSchema = ref([])
|
||||
function getFields() {
|
||||
getClueFieldList().then((data) => {
|
||||
const arr = useCrudSchemas(data).allSchemas.detailSchema
|
||||
|
||||
arr.forEach((it) => {
|
||||
if (it.label.includes('日期')) {
|
||||
it.dateFormat = 'YYYY-MM-DD'
|
||||
}
|
||||
})
|
||||
if (arr.length % 2 != 0) {
|
||||
arr.push({})
|
||||
}
|
||||
clueSchema.value = [
|
||||
...arr,
|
||||
{
|
||||
field: 'requirement',
|
||||
label: '诉求',
|
||||
span: 2
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
label: '备注',
|
||||
span: 2,
|
||||
isEditor: true
|
||||
}
|
||||
]
|
||||
})
|
||||
|
||||
getOrderFieldList().then((data) => {
|
||||
const arr = useCrudSchemas(data).allSchemas.detailSchema
|
||||
arr.forEach((it) => {
|
||||
if (it.label.includes('日期')) {
|
||||
it.dateFormat = 'YYYY-MM-DD'
|
||||
}
|
||||
})
|
||||
if (arr.length % 2 != 0) {
|
||||
arr.push({})
|
||||
}
|
||||
orderSchema.value = [
|
||||
...arr,
|
||||
{
|
||||
field: 'remark',
|
||||
label: '备注',
|
||||
span: 2,
|
||||
isEditor: true
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
358
src/views/Clue/Order/Comp/MallOrderList.vue
Normal file
358
src/views/Clue/Order/Comp/MallOrderList.vue
Normal file
@@ -0,0 +1,358 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<div>
|
||||
<el-form
|
||||
:model="searchForm"
|
||||
ref="moreSearchRef"
|
||||
inline
|
||||
label-width="0"
|
||||
style="display: inline"
|
||||
>
|
||||
<el-form-item style="margin-bottom: 10px">
|
||||
<el-select
|
||||
v-model="searchForm.signProduct"
|
||||
placeholder="选择成交产品"
|
||||
filterable
|
||||
clearable
|
||||
@change="searchForm.specsId = 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 style="margin-bottom: 10px">
|
||||
<el-select
|
||||
v-model="searchForm.specsId"
|
||||
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>
|
||||
<Search
|
||||
v-if="!loading"
|
||||
ref="searchRef"
|
||||
:schema="allSchemas.searchSchema"
|
||||
inlineBlock
|
||||
labelWidth="0"
|
||||
>
|
||||
<template #actionMore>
|
||||
<el-button @click="getTableList" v-hasPermi="['clue:order:search']"> 搜索 </el-button>
|
||||
<el-button @click="resetQuery" v-hasPermi="['clue:order:reset']"> 重置 </el-button>
|
||||
</template>
|
||||
</Search>
|
||||
</div>
|
||||
<!-- 列表 -->
|
||||
<SSTable
|
||||
v-if="!loading"
|
||||
class="mt-10px"
|
||||
v-model:tableObject="tableObject"
|
||||
:tableColumns="allSchemas.tableColumns"
|
||||
@get-list="getTableList"
|
||||
@get-checked-columns="getCheckedColumns"
|
||||
>
|
||||
<el-table-column type="expand">
|
||||
<template #default="{ row }">
|
||||
<div class="p-10px flex justify-center">
|
||||
<el-table :data="row.signProducts" stripe style="width: 900px">
|
||||
<el-table-column prop="productName" label="成交产品" />
|
||||
<el-table-column prop="specsName" label="产品规格" width="100px" />
|
||||
<el-table-column prop="signNum" label="成交数量" width="90px" />
|
||||
<el-table-column prop="remark" label="成交备注" />
|
||||
<el-table-column label="发货状态" prop="sendState" width="90px" />
|
||||
<el-table-column label="发货备注" width="100px">
|
||||
<template #default="scope">
|
||||
<el-popover
|
||||
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">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
:disabled="scope.row.sendState == '已发货'"
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:send']"
|
||||
@click="handleDelivery(scope.row)"
|
||||
>
|
||||
发货
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-for="item in showColumns"
|
||||
:key="item.field"
|
||||
:prop="item.field"
|
||||
:label="item.label"
|
||||
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">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:detail']"
|
||||
@click="handleDetail(scope.row)"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:after-sale']"
|
||||
@click="sellAfter(scope.row)"
|
||||
>
|
||||
售后
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-if="scope.row.isPayoff == '未结清'"
|
||||
v-hasPermi="['clue:order:return']"
|
||||
@click="feeBack(scope.row)"
|
||||
>
|
||||
回款
|
||||
</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
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:pool:enroll']"
|
||||
@click="cancelDeal(scope.row)"
|
||||
>
|
||||
取消登记
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</SSTable>
|
||||
|
||||
<!-- 详情 -->
|
||||
<DialogOrder ref="orderDetailDialog" />
|
||||
<DialogFeeback ref="feedbackDialog" />
|
||||
<DialogAfterSale ref="afterSaleDialog" />
|
||||
<DialogExtraFee ref="extraFeeDialog" />
|
||||
<DialogDelivery ref="deliveryDialog" @success="getTableList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="ClueOrderList">
|
||||
import { getSimpleFieldList } from '@/api/clue/orderField'
|
||||
import * as SignApi from '@/api/clue/sign'
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { getSimpleProductList } from '@/api/mall/product'
|
||||
|
||||
import DialogOrder from './DialogOrder.vue'
|
||||
import DialogFeeback from './DialogFeeback.vue'
|
||||
import DialogAfterSale from './DialogAfterSale.vue'
|
||||
import DialogExtraFee from './DialogExtraPay.vue'
|
||||
import DialogDelivery from './DialogDelivery.vue'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const userOptions = ref([])
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
getCurdSchemas()
|
||||
})
|
||||
getOptions()
|
||||
})
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const allSchemas = ref({})
|
||||
|
||||
const orderDetailDialog = ref()
|
||||
const searchRef = ref()
|
||||
const prodOptions = ref([])
|
||||
|
||||
const specsOptions = computed({
|
||||
get() {
|
||||
return (prodId) => {
|
||||
if (prodId) {
|
||||
return prodOptions.value.find((it) => it.productId == prodId).productSpecList
|
||||
}
|
||||
return []
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const searchForm = ref({
|
||||
signProduct: undefined
|
||||
})
|
||||
|
||||
const tableObject = ref({
|
||||
tableList: [],
|
||||
loading: false,
|
||||
total: 1,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
})
|
||||
|
||||
function resetQuery() {
|
||||
searchForm.value = {
|
||||
signProduct: undefined
|
||||
}
|
||||
searchRef.value.reset()
|
||||
tableObject.value.pageNo = 1
|
||||
getTableList()
|
||||
}
|
||||
// 查询
|
||||
async function getTableList() {
|
||||
// 查询
|
||||
tableObject.value.loading = true
|
||||
try {
|
||||
const queryParams = await searchRef.value.getFormModel()
|
||||
const params = {
|
||||
...queryParams,
|
||||
...searchForm.value,
|
||||
pageNo: tableObject.value.pageNo,
|
||||
pageSize: tableObject.value.pageSize
|
||||
}
|
||||
const data = await SignApi.getSignPage(removeNullField(params))
|
||||
tableObject.value.tableList = data.list.map((it) => ({ ...it, ...it.diyParams }))
|
||||
tableObject.value.total = data.total
|
||||
} finally {
|
||||
tableObject.value.loading = false
|
||||
}
|
||||
}
|
||||
|
||||
const loading = ref(true)
|
||||
async function getCurdSchemas() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await getSimpleFieldList()
|
||||
data.forEach((elem) => {
|
||||
if (elem.field == 'createUser') {
|
||||
elem.search.options = userOptions.value
|
||||
}
|
||||
})
|
||||
allSchemas.value = useCrudSchemas(data).allSchemas
|
||||
} finally {
|
||||
loading.value = false
|
||||
nextTick(() => {
|
||||
getTableList()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const showColumns = ref([])
|
||||
|
||||
// 初始化表格
|
||||
function getCheckedColumns(list) {
|
||||
showColumns.value = list && list.length ? list : allSchemas.value.tableColumns
|
||||
}
|
||||
|
||||
// 详情
|
||||
function handleDetail(row) {
|
||||
orderDetailDialog.value.open(row.clueId, row.signId)
|
||||
}
|
||||
|
||||
const feedbackDialog = ref()
|
||||
const afterSaleDialog = ref()
|
||||
// 售后
|
||||
function sellAfter(row) {
|
||||
afterSaleDialog.value.open(row.signId)
|
||||
}
|
||||
|
||||
// 回款
|
||||
function feeBack(row) {
|
||||
feedbackDialog.value.open(row.signId)
|
||||
}
|
||||
|
||||
// 取消登记
|
||||
async function cancelDeal(row) {
|
||||
try {
|
||||
// 二次确认
|
||||
await message.confirm('是否确认取消登记该线索?')
|
||||
// 发起删除
|
||||
await SignApi.cancelDeal(row.signId)
|
||||
message.success('取消登记成功!')
|
||||
// 刷新列表
|
||||
await getTableList()
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
}
|
||||
|
||||
const extraFeeDialog = ref()
|
||||
function handleAddFee(row) {
|
||||
extraFeeDialog.value.open(row.signId)
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
// 产品
|
||||
getSimpleProductList().then((data) => {
|
||||
prodOptions.value = data
|
||||
})
|
||||
}
|
||||
const deliveryDialog = ref()
|
||||
function handleDelivery(row) {
|
||||
deliveryDialog.value.open(row)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
335
src/views/Clue/Order/Comp/MallSettle.vue
Normal file
335
src/views/Clue/Order/Comp/MallSettle.vue
Normal file
@@ -0,0 +1,335 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form :model="searchForm" label-width="0" inline>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.signId" placeholder="成交单号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.name" placeholder="线索名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.phone" placeholder="联系方式" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.settlementType" placeholder="结算类型" clearable filterable>
|
||||
<el-option label="货款" value="货款" />
|
||||
<el-option label="其他支出" value="其他支出" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.signUser" placeholder="登记人" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.nickname"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-date-picker
|
||||
v-model="searchForm.dealDate"
|
||||
type="daterange"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="成交日期"
|
||||
end-placeholder="成交日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.signProduct"
|
||||
placeholder="选择成交产品"
|
||||
filterable
|
||||
clearable
|
||||
@change="searchForm.signSpecs = undefined"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in prodOptions"
|
||||
:key="item.productId"
|
||||
:label="item.productName"
|
||||
:value="item.productId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.signSpecs"
|
||||
placeholder="选择规格"
|
||||
filterable
|
||||
clearable
|
||||
:disabled="!searchForm.signProduct"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in specsOptions(searchForm.signProduct)"
|
||||
:key="item.specsId"
|
||||
:label="item.specsName"
|
||||
:value="item.specsId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="searchForm.supplier" placeholder="选择供应商" filterable clearable>
|
||||
<el-option
|
||||
v-for="item in supplierOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-radio-group v-model="searchForm.settlementState">
|
||||
<el-radio :label="1"> 已结算 </el-radio>
|
||||
<el-radio :label="0"> 待结算 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch">查询</el-button>
|
||||
<el-button @click="handleReset">重置</el-button>
|
||||
<el-button @click="batchSettle">批量结算</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableList"
|
||||
border
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="60"
|
||||
fixed="left"
|
||||
:selectable="(row) => row.settlementState == '待结算'"
|
||||
/>
|
||||
<el-table-column prop="signId" label="成交单号" min-width="120px" />
|
||||
<el-table-column prop="name" label="线索名称" min-width="120px" />
|
||||
<el-table-column prop="phone" label="联系方式" width="120px" />
|
||||
<el-table-column prop="signUserName" label="登记人" min-width="90" />
|
||||
<el-table-column prop="dealDate" label="成交日期" width="120px" :formatter="dateFormatter" />
|
||||
<el-table-column prop="signProduct" label="成交产品" min-width="150px" />
|
||||
<el-table-column prop="signSpecs" label="成交规格" min-width="150px" />
|
||||
<el-table-column prop="supplier" label="供应商" min-width="150px" />
|
||||
<el-table-column prop="settlementPrice" label="结算单价" min-width="150px" />
|
||||
<el-table-column prop="settlementNum" label="结算数量" min-width="150px" />
|
||||
<el-table-column prop="settlementMoney" label="结算金额" min-width="150px" />
|
||||
<el-table-column label="费用备注" width="90px">
|
||||
<template #default="scope">
|
||||
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.extraRemark">
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="scope.row.extraRemark"></div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="settlementDate"
|
||||
label="结算时间"
|
||||
width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column prop="settlementUserName" label="结算人" min-width="90px" />
|
||||
<el-table-column prop="settlementType" label="结算类型" width="90px" fixed="right" />
|
||||
<el-table-column prop="settlementState" label="结算状态" width="90px" fixed="right" />
|
||||
<el-table-column label="结算备注" width="90px">
|
||||
<template #default="scope">
|
||||
<el-popover placement="top" width="500px" trigger="click" v-if="scope.row.remark">
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="scope.row.remark"></div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<el-dialog title="批量结算" v-model="showDailog" width="600px">
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px">
|
||||
<el-form-item label="结算金额">
|
||||
{{ settleAmount }}
|
||||
</el-form-item>
|
||||
<el-form-item label="结算备注" prop="remark">
|
||||
<Editor v-model:modelValue="form.remark" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="showDailog = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleSaveSettle">
|
||||
确 定
|
||||
</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MallSettle">
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { getSimpleProductList } from '@/api/mall/product'
|
||||
import * as SettleApi from '@/api/clue/settle'
|
||||
|
||||
import { getDictOptions } from '@/utils/dict'
|
||||
import { removeNullField } from '@/utils/index'
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
handleSearch()
|
||||
})
|
||||
|
||||
const searchForm = ref({
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
signUser: undefined,
|
||||
dealDate: [],
|
||||
signProduct: undefined,
|
||||
signSpecs: undefined,
|
||||
signId: undefined,
|
||||
settlementState: 0,
|
||||
settlementType: undefined,
|
||||
supplier: undefined,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
})
|
||||
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
signUser: undefined,
|
||||
dealDate: [],
|
||||
signProduct: undefined,
|
||||
signSpecs: undefined,
|
||||
signId: undefined,
|
||||
settlementState: 0,
|
||||
settlementType: undefined,
|
||||
supplier: undefined,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
}
|
||||
}
|
||||
|
||||
function handleSearch() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
const totalNum = ref(0)
|
||||
const totalAmount = ref(0)
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await SettleApi.getMallSettlePage(removeNullField(searchForm.value))
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
totalNum.value = data.totalNum
|
||||
totalAmount.value = data.totalAmount
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function getSummaries(param) {
|
||||
const { columns } = param
|
||||
const sums = []
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计'
|
||||
} else if (column.property == 'settlementNum') {
|
||||
sums[index] = totalNum.value
|
||||
} else if (column.property == 'settlementMoney') {
|
||||
sums[index] = totalAmount.value
|
||||
} else {
|
||||
sums[index] = ''
|
||||
}
|
||||
})
|
||||
|
||||
return sums
|
||||
}
|
||||
|
||||
const selectList = ref([])
|
||||
function handleSelectionChange(val) {
|
||||
selectList.value = [...val]
|
||||
}
|
||||
|
||||
const showDailog = ref(false)
|
||||
const form = ref({})
|
||||
const formRef = ref()
|
||||
const formLoading = ref(false)
|
||||
const rules = {
|
||||
remark: { required: true, message: '结算备注不可为空', trigger: 'change,blur' }
|
||||
}
|
||||
|
||||
const settleAmount = ref(0)
|
||||
function batchSettle() {
|
||||
if (selectList.value.length) {
|
||||
showDailog.value = true
|
||||
form.value = {
|
||||
settlementIds: selectList.value.map((it) => it.settlementId),
|
||||
reamrk: undefined
|
||||
}
|
||||
settleAmount.value = selectList.value.reduce((pre, cur) => pre + cur.settlementMoney, 0)
|
||||
} else {
|
||||
message.info('请选择表格数据!')
|
||||
}
|
||||
}
|
||||
|
||||
async function handleSaveSettle() {
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
try {
|
||||
formLoading.value = true
|
||||
await SettleApi.batchSaveSettle(form.value)
|
||||
message.success('结算成功')
|
||||
showDailog.value = false
|
||||
getList()
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const userOptions = ref([])
|
||||
const prodOptions = ref([])
|
||||
const supplierOptions = getDictOptions('erp_supplier')
|
||||
|
||||
function getOptions() {
|
||||
// 产品
|
||||
getSimpleProductList().then((data) => {
|
||||
prodOptions.value = data
|
||||
})
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
})
|
||||
}
|
||||
|
||||
const specsOptions = computed({
|
||||
get() {
|
||||
return (prodId) => {
|
||||
if (prodId) {
|
||||
return prodOptions.value.find((it) => it.productId == prodId).productSpecList
|
||||
}
|
||||
return []
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
345
src/views/Clue/Order/Comp/OrderList.vue
Normal file
345
src/views/Clue/Order/Comp/OrderList.vue
Normal file
@@ -0,0 +1,345 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<div>
|
||||
<el-form
|
||||
:model="searchForm"
|
||||
ref="moreSearchRef"
|
||||
inline
|
||||
label-width="0"
|
||||
style="display: inline"
|
||||
>
|
||||
<el-form-item style="margin-bottom: 10px">
|
||||
<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 style="margin-bottom: 10px">
|
||||
<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 style="margin-bottom: 10px">
|
||||
<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>
|
||||
<Search
|
||||
v-if="!loading"
|
||||
ref="searchRef"
|
||||
:schema="allSchemas.searchSchema"
|
||||
inlineBlock
|
||||
labelWidth="0"
|
||||
>
|
||||
<template #actionMore>
|
||||
<el-button @click="getTableList" v-hasPermi="['clue:order:search']"> 搜索 </el-button>
|
||||
<el-button @click="resetQuery" v-hasPermi="['clue:order:reset']"> 重置 </el-button>
|
||||
</template>
|
||||
</Search>
|
||||
</div>
|
||||
<!-- 列表 -->
|
||||
<SSTable
|
||||
v-if="!loading"
|
||||
class="mt-10px"
|
||||
v-model:tableObject="tableObject"
|
||||
:tableColumns="allSchemas.tableColumns"
|
||||
@get-list="getTableList"
|
||||
@get-checked-columns="getCheckedColumns"
|
||||
>
|
||||
<el-table-column
|
||||
v-for="item in showColumns"
|
||||
:key="item.field"
|
||||
:prop="item.field"
|
||||
:label="item.label"
|
||||
min-width="120px"
|
||||
>
|
||||
<template #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">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:detail']"
|
||||
@click="handleDetail(scope.row)"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:after-sale']"
|
||||
@click="sellAfter(scope.row)"
|
||||
>
|
||||
售后
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-if="scope.row.isPayoff == '未结清'"
|
||||
v-hasPermi="['clue:order:return']"
|
||||
@click="feeBack(scope.row)"
|
||||
>
|
||||
回款
|
||||
</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
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:pool:enroll']"
|
||||
@click="cancelDeal(scope.row)"
|
||||
>
|
||||
取消登记
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</SSTable>
|
||||
|
||||
<!-- 详情 -->
|
||||
<DialogOrder ref="orderDetailDialog" />
|
||||
<DialogFeeback ref="feedbackDialog" />
|
||||
<DialogAfterSale ref="afterSaleDialog" />
|
||||
<DialogExtraFee ref="extraFeeDialog" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="ClueOrderList">
|
||||
import { getSimpleFieldList } from '@/api/clue/orderField'
|
||||
import * as SignApi from '@/api/clue/sign'
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { getClassTypeList } from '@/api/school/class'
|
||||
|
||||
import DialogOrder from './DialogOrder.vue'
|
||||
import DialogFeeback from './DialogFeeback.vue'
|
||||
import DialogAfterSale from './DialogAfterSale.vue'
|
||||
import DialogExtraFee from './DialogExtraPay.vue'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const userOptions = ref([])
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
getCurdSchemas()
|
||||
})
|
||||
getOptions()
|
||||
})
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const allSchemas = ref({})
|
||||
|
||||
const orderDetailDialog = ref()
|
||||
const searchRef = ref()
|
||||
const schoolOptions = ref([])
|
||||
const allPlaceOptions = ref([])
|
||||
|
||||
const searchForm = ref({
|
||||
signSchool: undefined,
|
||||
signPlace: undefined,
|
||||
signClass: undefined,
|
||||
signProduct: undefined
|
||||
})
|
||||
|
||||
const tableObject = ref({
|
||||
tableList: [],
|
||||
loading: false,
|
||||
total: 1,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
})
|
||||
|
||||
const placeOptions = computed(() => {
|
||||
return allPlaceOptions.value.filter((it) => it.schoolId == searchForm.value.signSchool)
|
||||
})
|
||||
|
||||
function resetQuery() {
|
||||
searchForm.value = {
|
||||
signSchool: undefined,
|
||||
signPlace: undefined,
|
||||
signClass: undefined,
|
||||
signProduct: undefined
|
||||
}
|
||||
searchRef.value.reset()
|
||||
tableObject.value.pageNo = 1
|
||||
getTableList()
|
||||
}
|
||||
// 查询
|
||||
async function getTableList() {
|
||||
// 查询
|
||||
tableObject.value.loading = true
|
||||
try {
|
||||
const queryParams = await searchRef.value.getFormModel()
|
||||
const params = {
|
||||
...queryParams,
|
||||
...searchForm.value,
|
||||
pageNo: tableObject.value.pageNo,
|
||||
pageSize: tableObject.value.pageSize
|
||||
}
|
||||
const data = await SignApi.getSignPage(removeNullField(params))
|
||||
tableObject.value.tableList = data.list.map((it) => ({ ...it, ...it.diyParams }))
|
||||
tableObject.value.total = data.total
|
||||
} finally {
|
||||
tableObject.value.loading = false
|
||||
}
|
||||
}
|
||||
|
||||
const loading = ref(true)
|
||||
async function getCurdSchemas() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await getSimpleFieldList()
|
||||
data.forEach((elem) => {
|
||||
if (elem.field == 'createUser') {
|
||||
elem.search.options = userOptions.value
|
||||
}
|
||||
})
|
||||
allSchemas.value = useCrudSchemas(data).allSchemas
|
||||
} finally {
|
||||
loading.value = false
|
||||
nextTick(() => {
|
||||
getTableList()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const showColumns = ref([])
|
||||
|
||||
// 初始化表格
|
||||
function getCheckedColumns(list) {
|
||||
showColumns.value = list && list.length ? list : allSchemas.value.tableColumns
|
||||
}
|
||||
|
||||
// 详情
|
||||
function handleDetail(row) {
|
||||
orderDetailDialog.value.open(row.clueId, row.signId)
|
||||
}
|
||||
|
||||
const feedbackDialog = ref()
|
||||
const afterSaleDialog = ref()
|
||||
// 售后
|
||||
function sellAfter(row) {
|
||||
afterSaleDialog.value.open(row.signId)
|
||||
}
|
||||
|
||||
// 回款
|
||||
function feeBack(row) {
|
||||
feedbackDialog.value.open(row.signId)
|
||||
}
|
||||
|
||||
const extraFeeDialog = ref()
|
||||
function handleAddFee(row) {
|
||||
extraFeeDialog.value.open(row.signId)
|
||||
}
|
||||
|
||||
// 取消登记
|
||||
async function cancelDeal(row) {
|
||||
try {
|
||||
// 二次确认
|
||||
await message.confirm('是否确认取消登记该线索?')
|
||||
// 发起删除
|
||||
await SignApi.cancelDeal(row.signId)
|
||||
message.success('取消登记成功!')
|
||||
// 刷新列表
|
||||
await getTableList()
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
// 驾校
|
||||
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
||||
schoolOptions.value = data.schoolList
|
||||
allPlaceOptions.value = data.placeList
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
248
src/views/Clue/Order/Comp/Reback.vue
Normal file
248
src/views/Clue/Order/Comp/Reback.vue
Normal file
@@ -0,0 +1,248 @@
|
||||
<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-select v-model="searchForm.state" placeholder="审核状态" clearable>
|
||||
<el-option label="待审核" :value="1" />
|
||||
<el-option label="已撤销" :value="2" />
|
||||
<el-option label="已通过" :value="3" />
|
||||
<el-option label="已驳回" :value="4" />
|
||||
</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.applyUser" 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.applyTime"
|
||||
type="daterange"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="申请日期"
|
||||
end-placeholder="申请日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch">查询</el-button>
|
||||
<el-button @click="handleReset">重置</el-button>
|
||||
<el-button @click="batchAudit">批量审核</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableList"
|
||||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" :selectable="(row) => row.state == 1" />
|
||||
<el-table-column prop="signId" label="成交单号" min-width="150px" />
|
||||
<el-table-column prop="name" label="线索名称" min-width="200px" />
|
||||
<el-table-column prop="phone" label="联系方式" min-width="150px" />
|
||||
<el-table-column prop="money" label="回款金额" min-width="90" />
|
||||
<el-table-column prop="isPayoff" label="是否结清" min-width="90" />
|
||||
<el-table-column prop="signUserName" label="登记人" min-width="90" />
|
||||
<el-table-column
|
||||
prop="dealDate"
|
||||
label="成交日期"
|
||||
min-width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column prop="applyUserName" label="申请人" min-width="90" />
|
||||
<el-table-column
|
||||
prop="applyTime"
|
||||
label="申请时间"
|
||||
min-width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column prop="stateName" label="审核状态" fixed="right" min-width="90" />
|
||||
<el-table-column label="操作" width="150px" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" style="padding: 0" text @click="handleDetail(row.id)">
|
||||
详情
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
style="padding: 0"
|
||||
text
|
||||
v-if="row.state == 1 && currentUserId == row.applyUser"
|
||||
v-hasPermi="['clue:order:return']"
|
||||
@click="handleCancel(row.id)"
|
||||
>
|
||||
撤销
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
style="padding: 0"
|
||||
text
|
||||
v-if="row.state == 1"
|
||||
v-hasPermi="['clue:order:return-audit']"
|
||||
@click="handleAudit(row)"
|
||||
>
|
||||
审核
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<DialogFeebackAudit ref="feebackDialog" @success="getList" />
|
||||
<DialogFeebackDetail ref="feebackDetailDialog" />
|
||||
<DialogBatchAudit ref="batchAuditDialog" @success="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Reback">
|
||||
import * as FeebackApi from '@/api/clue/payment'
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
import DialogFeebackAudit from './DialogFeebackAudit.vue'
|
||||
import DialogFeebackDetail from './DialogFeebackDetail.vue'
|
||||
import DialogBatchAudit from './DialogBatchAudit.vue'
|
||||
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const feebackDialog = ref()
|
||||
|
||||
const currentUserId = userStore.getUser.id
|
||||
|
||||
const searchForm = ref({
|
||||
signId: undefined,
|
||||
name: undefined,
|
||||
state: undefined,
|
||||
dealDate: [],
|
||||
signUser: undefined,
|
||||
applyTime: [],
|
||||
applyUser: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
})
|
||||
|
||||
const userOptions = ref([])
|
||||
|
||||
const tableList = ref([])
|
||||
const total = ref(0)
|
||||
|
||||
function handleSearch() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
signId: undefined,
|
||||
name: undefined,
|
||||
dealDate: [],
|
||||
state: undefined,
|
||||
signUser: undefined,
|
||||
applyTime: [],
|
||||
applyUser: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
}
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await FeebackApi.getPaymentPage(searchForm.value)
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const batchIds = ref([])
|
||||
function handleSelectionChange(val) {
|
||||
batchIds.value = val.map((it) => it.id)
|
||||
}
|
||||
|
||||
const batchAuditDialog = ref()
|
||||
function batchAudit() {
|
||||
if (batchIds.value.length) {
|
||||
batchAuditDialog.value.open('aftersale', batchIds.value)
|
||||
} else {
|
||||
message.info('请选择表格中需要审核的数据')
|
||||
}
|
||||
}
|
||||
|
||||
const feebackDetailDialog = ref()
|
||||
function handleDetail(id) {
|
||||
feebackDetailDialog.value.open(id)
|
||||
}
|
||||
async function handleCancel(id) {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.confirm('是否确认撤销申请?')
|
||||
// 发起删除
|
||||
await FeebackApi.cancelApplyPayment({ id })
|
||||
message.success('撤销成功!')
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
}
|
||||
function handleAudit(row) {
|
||||
feebackDialog.value.open(row)
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
handleSearch()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
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>
|
||||
@@ -1,104 +1,38 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<Search :schema="allSchemas.searchSchema" labelWidth="0">
|
||||
<template #actionMore>
|
||||
<el-button @click="getTableList" v-hasPermi="['clue:order:search']"> 搜索 </el-button>
|
||||
<el-button @click="resetQuery" v-hasPermi="['clue:order:reset']"> 重置 </el-button>
|
||||
<el-tabs v-model="tabName">
|
||||
<el-tab-pane label="成交列表" name="list">
|
||||
<template v-if="tabName == 'list'">
|
||||
<OrderList v-if="appStore.getAppInfo?.instanceType == 1" />
|
||||
<MallOrderList v-else-if="appStore.getAppInfo?.instanceType == 2" />
|
||||
</template>
|
||||
</Search>
|
||||
<!-- 列表 -->
|
||||
<SSTable
|
||||
class="mt-20px"
|
||||
v-model:tableObject="tableObject"
|
||||
:tableColumns="allSchemas.tableColumns"
|
||||
@get-list="getTableList"
|
||||
>
|
||||
<el-table-column
|
||||
v-for="item in allSchemas.tableColumns"
|
||||
:key="item.field"
|
||||
:prop="item.field"
|
||||
:label="item.label"
|
||||
min-width="120px"
|
||||
/>
|
||||
<el-table-column label="操作" width="200px" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:after-sale']"
|
||||
@click="sellAfter(scope.row)"
|
||||
>
|
||||
售后
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:after-sale-audit']"
|
||||
>
|
||||
售后审核
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:send']"
|
||||
>
|
||||
发货(进销存)
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:return']"
|
||||
@click="feeBack(scope.row)"
|
||||
>
|
||||
回款
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-hasPermi="['clue:order:return-audit']"
|
||||
>
|
||||
回款确认
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</SSTable>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="回款申请" name="commission">
|
||||
<Reback v-if="tabName == 'commission'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="售后申请" name="aftersale">
|
||||
<AfterSales v-if="tabName == 'aftersale'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="发货列表" name="delivery" v-if="appStore.getAppInfo?.instanceType == 2">
|
||||
<Delivery v-if="tabName == 'delivery'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="对外结算" name="settle" v-if="checkPermi(['clue:order:settle'])">
|
||||
<Settle v-if="tabName == 'settle'" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<script setup name="ClueOrder">
|
||||
import { allSchemas } from './order.data'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import OrderList from './Comp/OrderList.vue'
|
||||
import MallOrderList from './Comp/MallOrderList.vue'
|
||||
import Reback from './Comp/Reback.vue'
|
||||
import AfterSales from './Comp/AfterSales.vue'
|
||||
import Delivery from './Comp/Delivery.vue'
|
||||
import Settle from './Comp/Settle.vue'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
|
||||
const tableObject = ref({
|
||||
tableList: [{ name: '测试', contact: '18888888888' }],
|
||||
loading: false,
|
||||
total: 1,
|
||||
pageSize: 20,
|
||||
currentPage: 1
|
||||
})
|
||||
|
||||
function resetQuery() {
|
||||
// 方法体
|
||||
}
|
||||
// 查询
|
||||
function getTableList() {
|
||||
// 方法体
|
||||
}
|
||||
|
||||
// 售后
|
||||
function sellAfter() {
|
||||
// 方法体
|
||||
}
|
||||
const appStore = useAppStore()
|
||||
const tabName = ref('list')
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -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>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px" @close="destroyMap">
|
||||
<el-tabs v-model="tabName">
|
||||
<el-tabs v-model="tabName" @tab-change="changeTab">
|
||||
<el-tab-pane label="线索信息" name="info">
|
||||
<Form ref="formRef" v-loading="formLoading" :rules="rules" isCol :schema="formSchema" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="跟进信息" name="follow">
|
||||
<el-button type="primary" @click="handleAppendFollow">新增跟进人</el-button>
|
||||
<el-table :data="followList">
|
||||
<el-table-column label="跟进人">
|
||||
<el-table-column label="跟进人" width="180px">
|
||||
<template #default="{ row }">
|
||||
<el-select
|
||||
v-model="row.userId"
|
||||
@@ -24,13 +24,27 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="followTime" label="下次跟进时间">
|
||||
<el-table-column prop="nextFollowTime" label="下次跟进时间" width="180px">
|
||||
<template #default="{ row }">
|
||||
<el-date-picker
|
||||
v-model="row.followTime"
|
||||
v-model="row.nextFollowTime"
|
||||
type="date"
|
||||
placeholder="选择日期时间"
|
||||
: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>
|
||||
</el-table-column>
|
||||
@@ -47,19 +61,16 @@
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane v-if="appStore.getAppInfo?.instanceType == 1" label="位置信息" name="map">
|
||||
<div class="flex justify-between">
|
||||
<el-select
|
||||
<div class="flex justify-between items-center">
|
||||
<el-autocomplete
|
||||
v-model="areaValue"
|
||||
filterable
|
||||
clearable
|
||||
remote
|
||||
style="width: 350px"
|
||||
reserve-keyword
|
||||
placeholder="请输入关键词"
|
||||
:remote-method="remoteMethod"
|
||||
@change="currentSelect"
|
||||
style="width: 250px"
|
||||
placeholder="输入并搜索位置"
|
||||
:fetch-suggestions="remoteMethod"
|
||||
@select="currentSelect"
|
||||
>
|
||||
<el-option
|
||||
<!-- <el-option
|
||||
v-for="item in areaList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
@@ -68,36 +79,65 @@
|
||||
>
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.district }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-option> -->
|
||||
</el-autocomplete>
|
||||
<div class="flex-1 flex items-center ml-10px mr-10px">
|
||||
<div class="w-100px">线索位置:</div>
|
||||
<el-input v-model="address" disabled placeholder="请输入线索位置" clearable />
|
||||
</div>
|
||||
<el-checkbox v-model="showSchool" :label="true" @change="handleShowSchool">
|
||||
展示场地
|
||||
</el-checkbox>
|
||||
</div>
|
||||
<div id="dialogMap" class="mt-20px" style="height: 400px; width: 100%"></div>
|
||||
<div class="flex items-center mt-10px mb-10px">
|
||||
<div class="w-100px">线索位置:</div>
|
||||
<el-input v-model="address" placeholder="请输入线索位置" clearable />
|
||||
</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>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button>
|
||||
</span>
|
||||
</template>
|
||||
<div style="position: absolute; top: 75px; right: 20px">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button>
|
||||
</div>
|
||||
<DialogSchoolInfo ref="schoolInfoDialog" />
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogClue">
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import * as ClueApi from '@/api/clue'
|
||||
import { getDiyFieldList } from '@/api/clue/clueField'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
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 FlagYellow from '@/assets/imgs/flag/flag_yellow.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'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
const appStore = useAppStore()
|
||||
|
||||
const props = defineProps({
|
||||
@@ -119,8 +158,14 @@ const props = defineProps({
|
||||
})
|
||||
|
||||
const formSchema = computed(() => {
|
||||
const newSchema = [...props.schema]
|
||||
newSchema.forEach((it) => {
|
||||
if (it.field == 'consultTime') {
|
||||
it.componentProps['disabled-date'] = dateAfterToday
|
||||
}
|
||||
})
|
||||
return [
|
||||
...props.schema,
|
||||
...newSchema,
|
||||
{
|
||||
component: 'Input',
|
||||
label: '诉求',
|
||||
@@ -143,6 +188,10 @@ const formSchema = computed(() => {
|
||||
]
|
||||
})
|
||||
|
||||
const dateAfterToday = (t) => {
|
||||
return t.getTime() > Date.now()
|
||||
}
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
@@ -162,7 +211,6 @@ const tabName = ref('info')
|
||||
const followList = ref([])
|
||||
|
||||
const areaValue = ref('')
|
||||
const areaList = ref([])
|
||||
const address = ref('')
|
||||
const defaultLatLng = ref({
|
||||
lat: 31.86119,
|
||||
@@ -184,46 +232,70 @@ const open = async (type, id) => {
|
||||
try {
|
||||
const data = await ClueApi.getClue(id)
|
||||
info.value = { ...data, ...data.diyParams }
|
||||
info.value.remark = info.value.remark || ''
|
||||
defaultLatLng.value = {
|
||||
lat: data.lat,
|
||||
lng: data.lng
|
||||
}
|
||||
nextTick(() => {
|
||||
followList.value = data.followUser
|
||||
address.value = data.address || ''
|
||||
formRef.value.setValues(info.value)
|
||||
formRef.value.setValues(info.value, false)
|
||||
})
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
} else {
|
||||
followList.value = []
|
||||
followList.value = [
|
||||
{
|
||||
userId: useUserStore().getUser.id,
|
||||
content: undefined,
|
||||
nextFollowTime: formatDate(new Date()),
|
||||
editable: true
|
||||
}
|
||||
]
|
||||
address.value = ''
|
||||
defaultLatLng.value = {
|
||||
lat: 31.86119,
|
||||
lng: 117.283042
|
||||
}
|
||||
}
|
||||
if (appStore.getAppInfo?.instanceType == 1 && !dialogMap.value) {
|
||||
nextTick(() => {
|
||||
getSchoolPlace()
|
||||
initMap(info.value)
|
||||
remoteMethod(address.value)
|
||||
formRef.value.setValues(info.value, true)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function changeTab() {
|
||||
if (tabName.value == 'map') {
|
||||
if (!dialogMap.value) {
|
||||
nextTick(async () => {
|
||||
await getSchoolPlace()
|
||||
initMap(info.value)
|
||||
// remoteMethod(address.value)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
destroyMap()
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
function resetForm() {
|
||||
info.value.address = undefined
|
||||
info.value.lat = undefined
|
||||
info.value.lng = undefined
|
||||
info.value.followUsers = []
|
||||
info.value.diyParams = {}
|
||||
info.value = {
|
||||
address: undefined,
|
||||
lat: undefined,
|
||||
lng: undefined,
|
||||
consultTime: formatDate(new Date()),
|
||||
followUsers: [],
|
||||
diyParams: {}
|
||||
}
|
||||
}
|
||||
|
||||
const placeList = ref([])
|
||||
function getSchoolPlace() {
|
||||
getPlaceList().then((data) => {
|
||||
placeList.value = data.placeList
|
||||
})
|
||||
async function getSchoolPlace() {
|
||||
const data = await getPlaceList({ placeStatus: 0 })
|
||||
placeList.value = data.placeList
|
||||
}
|
||||
|
||||
const emit = defineEmits(['success'])
|
||||
@@ -233,10 +305,18 @@ async function handleSave() {
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.getElFormRef().validate()
|
||||
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)) {
|
||||
message.info('请将跟进人填写完整!')
|
||||
return
|
||||
}
|
||||
if (appStore.getAppInfo?.instanceType == 1 && !address.value) {
|
||||
message.info('请选择学员位置!')
|
||||
return
|
||||
}
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
@@ -254,11 +334,11 @@ async function handleSave() {
|
||||
}
|
||||
}
|
||||
if (formType.value === 'create') {
|
||||
await ClueApi.createClue(params)
|
||||
message.success(t('common.createSuccess'))
|
||||
const data = await ClueApi.createClue(params)
|
||||
message.success(data)
|
||||
} else {
|
||||
await ClueApi.updateClue(params)
|
||||
message.success(t('common.updateSuccess'))
|
||||
const data = await ClueApi.updateClue(params)
|
||||
message.success(data)
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
@@ -271,7 +351,8 @@ async function handleSave() {
|
||||
function handleAppendFollow() {
|
||||
followList.value.push({
|
||||
userId: undefined,
|
||||
followTime: formatDate(new Date()),
|
||||
content: undefined,
|
||||
nextFollowTime: formatDate(new Date()),
|
||||
editable: true
|
||||
})
|
||||
}
|
||||
@@ -287,7 +368,7 @@ let geoCoder = ref(null)
|
||||
|
||||
function initMap(data) {
|
||||
AMapLoader.load({
|
||||
key: '2ffb0e2ea90b1df0b8be48ed66e18fc8', //设置您的key
|
||||
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key
|
||||
version: '2.0',
|
||||
plugins: ['AMap.Geocoder', 'AMap.AutoComplete']
|
||||
}).then((AMap) => {
|
||||
@@ -299,15 +380,13 @@ function initMap(data) {
|
||||
}
|
||||
}
|
||||
dialogMap.value = new AMap.Map('dialogMap', {
|
||||
zoom: 12,
|
||||
zoom: 14,
|
||||
zooms: [2, 22],
|
||||
center: [defaultLatLng.value.lng, defaultLatLng.value.lat]
|
||||
})
|
||||
if (data.lng || data.lat) {
|
||||
addmark(data.lng, data.lat, AMap)
|
||||
}
|
||||
addmark(defaultLatLng.value.lng, defaultLatLng.value.lat, AMap)
|
||||
AutoComplete.value = new AMap.AutoComplete({
|
||||
city: '全国'
|
||||
city: '合肥'
|
||||
})
|
||||
geoCoder.value = new AMap.Geocoder()
|
||||
dialogMap.value.on('click', (e) => {
|
||||
@@ -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) {
|
||||
try {
|
||||
geoCoder.value.getAddress([lng, lat], (status, result) => {
|
||||
@@ -341,10 +488,12 @@ function addmark(lat, lng, AMap) {
|
||||
marker.value = new AMap.Marker({
|
||||
position: new AMap.LngLat(lat, lng),
|
||||
zoom: 13,
|
||||
icon: ImgPostion
|
||||
icon: ImgPostion,
|
||||
offset: [-16, -32]
|
||||
})
|
||||
dialogMap.value.add(marker.value)
|
||||
dialogMap.value.setCenter([lat, lng], '', 500)
|
||||
dialogMap.value.setCenter([lat, lng], true)
|
||||
getNearbySchool({ lat: lng, lng: lat })
|
||||
}
|
||||
function removeMarker() {
|
||||
dialogMap.value.remove(marker.value)
|
||||
@@ -376,6 +525,7 @@ function handleShowSchool() {
|
||||
extData: place,
|
||||
clickable: true
|
||||
})
|
||||
marker.on('click', (ev) => showSchoolInfo(ev.target.getExtData()))
|
||||
schoolMarkers.value.push(marker)
|
||||
}
|
||||
} else {
|
||||
@@ -383,28 +533,43 @@ function handleShowSchool() {
|
||||
}
|
||||
}
|
||||
|
||||
function remoteMethod(searchValue) {
|
||||
if (searchValue !== '') {
|
||||
setTimeout(() => {
|
||||
AutoComplete.value?.search(searchValue, (status, result) => {
|
||||
if (result.tips?.length) {
|
||||
areaList.value = result?.tips
|
||||
}
|
||||
})
|
||||
}, 200)
|
||||
const schoolInfoDialog = ref()
|
||||
function showSchoolInfo(val) {
|
||||
schoolInfoDialog.value.open(val)
|
||||
}
|
||||
|
||||
function remoteMethod(searchValue, cb) {
|
||||
if (searchValue) {
|
||||
AutoComplete.value?.search(searchValue, (status, result) => {
|
||||
if (result.tips?.length) {
|
||||
// areaList.value = result?.tips
|
||||
const list = result.tips.map((it) => ({
|
||||
...it,
|
||||
value: it.name
|
||||
}))
|
||||
cb(list)
|
||||
} else {
|
||||
cb([])
|
||||
}
|
||||
})
|
||||
} else {
|
||||
cb([])
|
||||
}
|
||||
}
|
||||
|
||||
function currentSelect(val) {
|
||||
const area = areaList.value.find((it) => it.name == val)
|
||||
if (area) {
|
||||
addmark(area.location?.lng, area.location?.lat, aMap.value)
|
||||
dialogMap.value.setCenter([area.location?.lng, area.location?.lat], '', 500)
|
||||
regeoCode(area.location?.lng, area.location?.lat)
|
||||
if (val) {
|
||||
defaultLatLng.value = {
|
||||
lng: val.location?.lng,
|
||||
lat: val.location?.lat
|
||||
}
|
||||
addmark(val.location?.lng, val.location?.lat, aMap.value)
|
||||
regeoCode(val.location?.lng, val.location?.lat)
|
||||
}
|
||||
}
|
||||
|
||||
function destroyMap() {
|
||||
areaValue.value = undefined
|
||||
dialogMap.value = null
|
||||
aMap.value = null
|
||||
}
|
||||
|
||||
@@ -25,6 +25,18 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</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 :gutter="20">
|
||||
<el-col :span="24" :offset="0">
|
||||
@@ -80,9 +92,12 @@
|
||||
<script setup name="DialogFollow">
|
||||
import { getSkillPage } from '@/api/clue/skill'
|
||||
import { createFollow } from '@/api/clue/followRecord'
|
||||
import { getDictOptions } from '@/utils/dict'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
const intentionOptions = getDictOptions('intention_state')
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
@@ -97,18 +112,19 @@ const rules = {
|
||||
content: { required: true, message: '跟进内容不可为空', trigger: 'blur' }
|
||||
}
|
||||
|
||||
const open = async (clueId) => {
|
||||
const open = async (clueId, status) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = '新增跟进记录'
|
||||
resetForm(clueId)
|
||||
resetForm(clueId, status)
|
||||
}
|
||||
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
function resetForm(clueId) {
|
||||
function resetForm(clueId, status) {
|
||||
form.value = {
|
||||
clueId,
|
||||
operateTime: undefined,
|
||||
operateTime: formatDate(new Date(), 'YYYY-MM-DD HH:mm'),
|
||||
nextFollowTime: undefined,
|
||||
intentionState: status,
|
||||
content: undefined
|
||||
}
|
||||
}
|
||||
@@ -131,6 +147,8 @@ function getSkillList() {
|
||||
})
|
||||
}
|
||||
|
||||
const emit = defineEmits(['success'])
|
||||
|
||||
async function handleSave() {
|
||||
// 校验表单
|
||||
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,39 +1,15 @@
|
||||
<template>
|
||||
<Dialog title="成交登记" v-model="show" width="820px">
|
||||
<Dialog title="成交登记" v-model="show" width="900px">
|
||||
<Descriptions
|
||||
title="线索信息"
|
||||
:title="`线索信息-${info.name}`"
|
||||
:data="info"
|
||||
:schema="showSchema"
|
||||
:columns="2"
|
||||
labelWidth="130px"
|
||||
:defaultShow="false"
|
||||
/>
|
||||
<el-form :model="form" ref="formRef" :rules="rules" label-width="80px" class="mt-20px">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="成交日期" prop="dealDate">
|
||||
<el-date-picker
|
||||
v-model="form.dealDate"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期时间"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="是否全款">
|
||||
<el-radio-group v-model="form.state">
|
||||
<el-radio :label="true"> 全款 </el-radio>
|
||||
<el-radio :label="false"> 非全款 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="支付金额" prop="payAmount">
|
||||
<el-input-number v-model="form.payAmount" :min="1" :step="1" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 驾校招生模式 -->
|
||||
<template v-if="appStore.getAppInfo?.instanceType == 1">
|
||||
<el-col :span="8" :offset="0">
|
||||
@@ -78,6 +54,7 @@
|
||||
:disabled="!form.signPlace"
|
||||
placeholder="选择班型"
|
||||
filterable
|
||||
@change="changeClass"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in classOptions"
|
||||
@@ -89,6 +66,39 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="成交日期" prop="dealDate">
|
||||
<el-date-picker
|
||||
v-model="form.dealDate"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期时间"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="是否全款">
|
||||
<el-radio-group v-model="form.state">
|
||||
<el-radio :label="true"> 全款 </el-radio>
|
||||
<el-radio :label="false"> 非全款 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="支付金额" prop="payAmount">
|
||||
<el-input-number v-model="form.payAmount" :min="1" :step="1" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="公司收款" prop="isCompanyReceipts">
|
||||
<el-radio-group v-model="form.isCompanyReceipts">
|
||||
<el-radio :label="true">是</el-radio>
|
||||
<el-radio :label="false">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col
|
||||
:span="8"
|
||||
:offset="0"
|
||||
@@ -123,16 +133,20 @@
|
||||
</el-col>
|
||||
<!-- 进销存模式 -->
|
||||
<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
|
||||
class="mb-5px"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="form.signProduct.push({ productId: undefined, specsId: undefined, signNum: 0 })"
|
||||
@click="
|
||||
form.signProducts.push({ productId: undefined, specsId: undefined, signNum: 0 })
|
||||
"
|
||||
>
|
||||
添加成交产品
|
||||
</el-button>
|
||||
<el-table :data="form.signProduct" border size="small">
|
||||
<el-table :data="form.signProducts" border size="small">
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="productId" label="产品">
|
||||
<template #default="{ row }">
|
||||
@@ -158,6 +172,11 @@
|
||||
placeholder="选择规格"
|
||||
filterable
|
||||
:disabled="!row.productId"
|
||||
@change="
|
||||
row.price = specsOptions(row.productId).find(
|
||||
(it) => it.specsId == row.specsId
|
||||
).price
|
||||
"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in specsOptions(row.productId)"
|
||||
@@ -168,6 +187,7 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="price" label="销售单价" width="100px" />
|
||||
<el-table-column prop="signNum" label="成交数量" width="100px">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
@@ -189,30 +209,32 @@
|
||||
<Icon
|
||||
icon="ep:remove-filled"
|
||||
class="text-red-500"
|
||||
@click="handleRemove('signProduct', $index)"
|
||||
@click="handleRemove('signProducts', $index)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0" class="mb-18px">
|
||||
<el-divider direction="horizontal" content-position="left">额外支出</el-divider>
|
||||
<el-divider direction="horizontal" content-position="left">
|
||||
其他费用<span v-if="extraTotalPrice">,应收:{{ extraTotalPrice }}</span>
|
||||
</el-divider>
|
||||
<el-button
|
||||
class="mb-5px"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="form.extraPay.push({ extraPayType: undefined, extraPayMoney: 0 })"
|
||||
>
|
||||
添加额外支出
|
||||
添加其他费用
|
||||
</el-button>
|
||||
<el-table :data="form.extraPay" border size="small">
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="extraPayType" label="额外支出类型" width="200px">
|
||||
<el-table-column prop="extraPayType" label="费用类型" width="200px">
|
||||
<template #default="{ row }">
|
||||
<el-select
|
||||
v-model="row.extraPayType"
|
||||
size="small"
|
||||
placeholder="额外支出类型"
|
||||
placeholder="其他费用类型"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
@@ -224,7 +246,7 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="extraPayMoney" label="额外支出金额" width="180px">
|
||||
<el-table-column prop="extraPayMoney" label="费用金额" width="180px">
|
||||
<template #default="{ row }">
|
||||
<el-input-number v-model="row.extraPayMoney" size="small" :controls="false" />
|
||||
</template>
|
||||
@@ -244,6 +266,13 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-divider
|
||||
v-if="prodTotalPrice + extraTotalPrice"
|
||||
direction="horizontal"
|
||||
content-position="left"
|
||||
>
|
||||
合计应收:{{ prodTotalPrice + extraTotalPrice }}
|
||||
</el-divider>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0">
|
||||
<el-form-item label="备注">
|
||||
@@ -255,7 +284,7 @@
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="show = false">取 消</el-button>
|
||||
<el-button type="primary" @click="handleSave">保 存</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</Dialog>
|
||||
@@ -266,7 +295,7 @@ import * as ClueApi from '@/api/clue'
|
||||
import { createSign } from '@/api/clue/sign'
|
||||
import { getDiyFieldList } from '@/api/clue/orderField'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import { getClassTypePage } from '@/api/school/class'
|
||||
import { getClassTypeList } from '@/api/school/class'
|
||||
import { getSimpleProductList } from '@/api/mall/product'
|
||||
// import { getSimpleWarehouseList } from '@/api/mall/warehouse'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
@@ -291,7 +320,6 @@ const info = ref({})
|
||||
const formLoading = ref(false)
|
||||
|
||||
const appStore = useAppStore()
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const props = defineProps({
|
||||
@@ -300,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(() => {
|
||||
let list = props.schema.map((it) => {
|
||||
if (it.label.includes('日期')) {
|
||||
it.dateFormat = 'YYYY-MM-DD'
|
||||
}
|
||||
return it
|
||||
})
|
||||
if (list.length % 2 != 0) {
|
||||
list.push({})
|
||||
}
|
||||
const arr = [
|
||||
{
|
||||
field: 'requirement',
|
||||
@@ -314,10 +362,10 @@ const showSchema = computed(() => {
|
||||
span: 2
|
||||
}
|
||||
]
|
||||
return [...props.schema, ...arr]
|
||||
return [...list, ...arr]
|
||||
})
|
||||
|
||||
const extraPayOptions = getDictOptions('extra_pay_type')
|
||||
const extraPayOptions = getDictOptions('other_pay_type')
|
||||
|
||||
async function open(id) {
|
||||
try {
|
||||
@@ -338,11 +386,13 @@ function resetForm(id) {
|
||||
state: true,
|
||||
payAmount: 0,
|
||||
remark: undefined,
|
||||
isCompanyReceipts: appStore.getAppInfo?.instanceType == 1,
|
||||
extraPay: [],
|
||||
signProduct: []
|
||||
signProducts: []
|
||||
}
|
||||
}
|
||||
|
||||
const emit = defineEmits(['success'])
|
||||
const formRef = ref()
|
||||
async function handleSave() {
|
||||
// 校验表单
|
||||
@@ -351,11 +401,11 @@ async function handleSave() {
|
||||
if (!valid) return
|
||||
|
||||
if (form.value.extraPay.some((it) => !it.extraPayType || it.extraPayMoney == null)) {
|
||||
message.info('请将支付类型及支出金额填写完整!')
|
||||
message.info('请将费用类型及费用金额填写完整!')
|
||||
return
|
||||
}
|
||||
|
||||
if (form.value.signProduct.some((it) => !it.schoolId || !item.specsId || !it.signNum)) {
|
||||
if (form.value.signProducts.some((it) => !it.productId || !it.specsId || !it.signNum)) {
|
||||
message.info('请将成交产品信息填写完整!')
|
||||
return
|
||||
}
|
||||
@@ -363,9 +413,19 @@ async function handleSave() {
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
await createSign(form.value)
|
||||
message.success(t('common.createSuccess'))
|
||||
dialogVisible.value = false
|
||||
const params = { ...form.value }
|
||||
params.diyParams = {}
|
||||
diyFieldList.value.map((it) => {
|
||||
params.diyParams[it.field] = undefined
|
||||
})
|
||||
for (const key in params.diyParams) {
|
||||
if (Object.hasOwnProperty.call(params, key)) {
|
||||
params.diyParams[key] = params[key]
|
||||
}
|
||||
}
|
||||
await createSign(params)
|
||||
message.success('登记成功!')
|
||||
show.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
@@ -397,14 +457,14 @@ const placeOptions = computed(() => {
|
||||
const classOptions = ref([])
|
||||
|
||||
async function getClassTypeOptions() {
|
||||
const data = await getClassTypePage({ placeId: form.value.signPlace })
|
||||
classOptions.value = data.list
|
||||
const data = await getClassTypeList({ placeId: form.value.signPlace, status: 0 })
|
||||
classOptions.value = data
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
if (appStore.getAppInfo?.instanceType == 1) {
|
||||
// 驾校
|
||||
getPlaceList().then((data) => {
|
||||
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
||||
schoolOptions.value = data.schoolList
|
||||
allPlaceOptions.value = data.placeList
|
||||
})
|
||||
@@ -435,6 +495,11 @@ function changePlace() {
|
||||
getClassTypeOptions()
|
||||
}
|
||||
|
||||
function changeClass() {
|
||||
form.value.payAmount =
|
||||
classOptions.value.find((it) => it.typeId == form.value.signClass).guidingPrice || 0
|
||||
}
|
||||
|
||||
function handleRemove(type, index) {
|
||||
form.value[type].splice(index, 1)
|
||||
}
|
||||
|
||||
@@ -31,10 +31,10 @@
|
||||
<!-- 基础信息 -->
|
||||
<el-skeleton :loading="loading" animated>
|
||||
<el-table :data="followList" size="small" border class="mt-10px">
|
||||
<el-table-column prop="name" label="跟进人" />
|
||||
<el-table-column prop="latestFollowTime" label="最新跟进时间" />
|
||||
<el-table-column prop="userName" label="跟进人" />
|
||||
<el-table-column prop="followTime" label="最新跟进时间" :formatter="dateFormatter" />
|
||||
<el-table-column prop="nextFollowTime" label="下次跟进时间" />
|
||||
<el-table-column prop="saleStatus" label="成交状态" />
|
||||
<el-table-column prop="signSate" label="成交状态" />
|
||||
</el-table>
|
||||
</el-skeleton>
|
||||
<el-divider direction="horizontal" />
|
||||
@@ -42,6 +42,7 @@
|
||||
<el-tabs v-model="infoIndex" type="border-card">
|
||||
<el-tab-pane label="跟进记录" name="followRecord">
|
||||
<el-button
|
||||
v-if="followList.length"
|
||||
v-hasPermi="['clue:pool:update']"
|
||||
class="mb-10px"
|
||||
type="primary"
|
||||
@@ -83,6 +84,32 @@
|
||||
展示场地
|
||||
</el-checkbox>
|
||||
<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>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="操作记录" name="operateRecord">
|
||||
@@ -99,7 +126,8 @@
|
||||
<span>操作人:{{ item.operateUserName }}</span>
|
||||
</div>
|
||||
<div class="pt-5px pb-5px">
|
||||
<span>{{ item.content }}</span>
|
||||
<!-- <span>{{ item.content }}</span> -->
|
||||
<span v-dompurify-html="item.content"></span>
|
||||
</div>
|
||||
<div class="flex" style="align-items: center">
|
||||
<Icon icon="ep:clock" class="mr-5px" />
|
||||
@@ -112,7 +140,8 @@
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<!-- 新建编辑跟进信息 -->
|
||||
<DialogFollow ref="followRef" @success="getFollowList" />
|
||||
<DialogFollow ref="followRef" @success="followSuccess" />
|
||||
<DialogSchoolInfo ref="schoolInfoDialog" />
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
@@ -123,10 +152,11 @@ import * as FollowApi from '@/api/clue/followRecord'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
|
||||
import DialogFollow from './DialogFollow.vue'
|
||||
import DialogSchoolInfo from './DialogSchoolInfo.vue'
|
||||
import AMapLoader from '@amap/amap-jsapi-loader'
|
||||
import { formatDate } 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 FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
|
||||
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
|
||||
@@ -149,7 +179,16 @@ const props = defineProps({
|
||||
})
|
||||
|
||||
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',
|
||||
label: '诉求',
|
||||
@@ -162,23 +201,10 @@ const showSchema = computed(() => {
|
||||
isEditor: true
|
||||
}
|
||||
]
|
||||
return [...props.schema, ...arr]
|
||||
return [...arr1, ...arr2]
|
||||
})
|
||||
|
||||
const followList = ref([
|
||||
{
|
||||
name: '李四',
|
||||
latestFollowTime: '2024-02-01',
|
||||
nextFollowTime: '2024-04-01',
|
||||
saleStatus: '未成交'
|
||||
},
|
||||
{
|
||||
name: '王二',
|
||||
latestFollowTime: '2024-03-01',
|
||||
nextFollowTime: '2024-04-11',
|
||||
saleStatus: '已成交'
|
||||
}
|
||||
])
|
||||
const followList = ref([])
|
||||
|
||||
const followRecordList = ref([])
|
||||
const operateRecordList = ref([])
|
||||
@@ -201,9 +227,16 @@ function getFollowList() {
|
||||
})
|
||||
}
|
||||
|
||||
function getFollowUsers(id) {
|
||||
ClueApi.getFollowUserList({ id }).then((data) => {
|
||||
followList.value = data
|
||||
})
|
||||
}
|
||||
|
||||
async function open(id) {
|
||||
clueId.value = id
|
||||
try {
|
||||
getFollowUsers(id)
|
||||
getFollowList()
|
||||
ClueApi.getOpearateRecord({ clueId: id }).then((data) => {
|
||||
operateRecordList.value = data.map((item) => ({
|
||||
@@ -219,8 +252,8 @@ async function open(id) {
|
||||
infoIndex.value = 'followRecord'
|
||||
|
||||
if (appStore.getAppInfo?.instanceType == 1 && !dialogMap.value) {
|
||||
nextTick(() => {
|
||||
getSchoolPlace()
|
||||
nextTick(async () => {
|
||||
await getSchoolPlace()
|
||||
initMap(info.value)
|
||||
})
|
||||
}
|
||||
@@ -229,11 +262,18 @@ async function open(id) {
|
||||
}
|
||||
}
|
||||
|
||||
const placeList = ref([])
|
||||
function getSchoolPlace() {
|
||||
getPlaceList().then((data) => {
|
||||
placeList.value = data.placeList
|
||||
function followSuccess() {
|
||||
ClueApi.getClue(clueId.value).then((data) => {
|
||||
info.value = { ...data, ...data.diyParams }
|
||||
})
|
||||
getFollowList()
|
||||
emit('getList')
|
||||
}
|
||||
|
||||
const placeList = ref([])
|
||||
async function getSchoolPlace() {
|
||||
const data = await getPlaceList({ placeStatus: 0 })
|
||||
placeList.value = data.placeList
|
||||
}
|
||||
|
||||
const defaultLatLng = ref({
|
||||
@@ -243,7 +283,7 @@ const defaultLatLng = ref({
|
||||
|
||||
function initMap(data) {
|
||||
AMapLoader.load({
|
||||
key: '2ffb0e2ea90b1df0b8be48ed66e18fc8', //设置您的key
|
||||
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key
|
||||
version: '2.0'
|
||||
}).then((AMap) => {
|
||||
aMap.value = AMap
|
||||
@@ -254,7 +294,7 @@ function initMap(data) {
|
||||
}
|
||||
}
|
||||
dialogMap.value = new AMap.Map('dialogMap', {
|
||||
zoom: 12,
|
||||
zoom: 14,
|
||||
zooms: [2, 22],
|
||||
center: [defaultLatLng.value.lng, defaultLatLng.value.lat]
|
||||
})
|
||||
@@ -290,6 +330,7 @@ function handleShowSchool() {
|
||||
extData: place,
|
||||
clickable: true
|
||||
})
|
||||
marker.on('click', (ev) => showSchoolInfo(ev.target.getExtData()))
|
||||
schoolMarkers.value.push(marker)
|
||||
}
|
||||
} else {
|
||||
@@ -303,11 +344,87 @@ function addmark(lat, lng, AMap) {
|
||||
marker.value = new AMap.Marker({
|
||||
position: new AMap.LngLat(lat, lng),
|
||||
zoom: 13,
|
||||
icon: ImgPostion
|
||||
icon: ImgPostion,
|
||||
offset: [-16, -32]
|
||||
})
|
||||
dialogMap.value.add(marker.value)
|
||||
dialogMap.value.setCenter([lat, lng], '', 500)
|
||||
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() {
|
||||
dialogMap.value.remove(marker.value)
|
||||
}
|
||||
@@ -320,7 +437,7 @@ defineExpose({
|
||||
|
||||
const followRef = ref()
|
||||
function addFollow() {
|
||||
followRef.value.open(info.value.clueId)
|
||||
followRef.value.open(info.value.clueId, info.value.intentionState)
|
||||
}
|
||||
|
||||
function destroyMap() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="relative">
|
||||
<el-tabs v-model="queryType" size="small" @tab-change="getTableList">
|
||||
<el-tabs v-model="queryType" size="small" @tab-change="quickChange">
|
||||
<el-tab-pane label="全部" name="0" />
|
||||
<el-tab-pane name="1">
|
||||
<template #label>
|
||||
@@ -31,6 +31,14 @@
|
||||
</template>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="公海" name="4" />
|
||||
<el-tab-pane
|
||||
v-if="appStore.getAppInfo?.instanceType == 1"
|
||||
label="地图总览"
|
||||
name="5"
|
||||
style="height: calc(100vh - 160px)"
|
||||
>
|
||||
<ClueMap ref="mapClue" v-if="queryType == 5" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="absolute" style="right: 10px; top: 0">
|
||||
<el-button plain v-hasPermi="['clue:pool:import']">导入</el-button>
|
||||
@@ -39,129 +47,141 @@
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 搜索工作栏 -->
|
||||
<Search v-if="!loading" ref="searchRef" :schema="allSchemas.searchSchema" labelWidth="0">
|
||||
<template #actionMore>
|
||||
<el-button @click="getTableList" v-hasPermi="['clue:pool:search']"> 搜索 </el-button>
|
||||
<el-button @click="resetQuery" v-hasPermi="['clue:pool:reset']"> 重置 </el-button>
|
||||
</template>
|
||||
</Search>
|
||||
<!-- 列表 -->
|
||||
<SSTable
|
||||
v-if="!loading"
|
||||
class="mt-20px"
|
||||
v-model:tableObject="tableObject"
|
||||
:tableColumns="allSchemas.tableColumns"
|
||||
@get-list="getTableList"
|
||||
@get-checked-columns="getCheckedColumns"
|
||||
>
|
||||
<el-table-column
|
||||
v-for="item in showColumns"
|
||||
:key="item.field"
|
||||
:prop="item.field"
|
||||
:label="item.label"
|
||||
min-width="120px"
|
||||
<template v-if="queryType != 5">
|
||||
<!-- 搜索工作栏 -->
|
||||
<Search v-if="!loading" ref="searchRef" :schema="allSchemas.searchSchema" labelWidth="0">
|
||||
<template #actionMore>
|
||||
<el-button @click="getTableList" v-hasPermi="['clue:pool:search']"> 搜索 </el-button>
|
||||
<el-button @click="resetQuery" v-hasPermi="['clue:pool:reset']"> 重置 </el-button>
|
||||
</template>
|
||||
</Search>
|
||||
<!-- 列表 -->
|
||||
<SSTable
|
||||
v-if="!loading"
|
||||
class="mt-20px"
|
||||
v-model:tableObject="tableObject"
|
||||
:tableColumns="allSchemas.tableColumns"
|
||||
@get-list="getTableList"
|
||||
@get-checked-columns="getCheckedColumns"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div v-if="item.field == 'followRecord'">
|
||||
<el-button
|
||||
type="primary"
|
||||
text
|
||||
style="padding: 0"
|
||||
@click="handleFollow(row)"
|
||||
v-hasPermi="['clue:pool:update']"
|
||||
>
|
||||
快速新增
|
||||
</el-button>
|
||||
</div>
|
||||
<div v-else-if="item.field == 'contact'">
|
||||
<span>{{ row[item.field] }}</span>
|
||||
<Icon class="ml-5px" icon="ep:phone" @click="makeCall(row.contact)" />
|
||||
</div>
|
||||
<div v-else-if="item.form?.component == 'DatePicker'">
|
||||
<span>{{ formatDate(row[item.field]) }}</span>
|
||||
</div>
|
||||
<div v-else-if="item.field == 'remark' || item.form?.component == 'Editor'">
|
||||
<p v-dompurify-html="row.remark"></p>
|
||||
</div>
|
||||
<span v-else>{{ row[item.field] }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200px" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="handleDetail(scope.row)"
|
||||
v-hasPermi="['clue:pool:detail']"
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
<template v-if="queryType != 4">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(scope.row)"
|
||||
v-hasPermi="['clue:pool:update']"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="handleSuccess(scope.row)"
|
||||
v-hasPermi="['clue:pool:enroll']"
|
||||
>
|
||||
登记
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
v-hasPermi="['clue:pool:release']"
|
||||
@click="handleRelease(scope.row.clueId)"
|
||||
>
|
||||
释放
|
||||
</el-button>
|
||||
<el-table-column
|
||||
v-for="item in showColumns"
|
||||
:key="item.field"
|
||||
:prop="item.field"
|
||||
:label="item.label"
|
||||
min-width="120px"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<div v-if="item.field == 'followRecord'">
|
||||
<el-button
|
||||
type="primary"
|
||||
text
|
||||
style="padding: 0"
|
||||
@click="handleFollow(row)"
|
||||
v-if="queryType != 4"
|
||||
v-hasPermi="['clue:pool:update']"
|
||||
>
|
||||
快速新增
|
||||
</el-button>
|
||||
</div>
|
||||
<div v-else-if="item.field == 'contact'">
|
||||
<span>{{ row[item.field] }}</span>
|
||||
<Icon class="ml-5px" icon="ep:phone" @click="makeCall(row.contact)" />
|
||||
</div>
|
||||
<div v-else-if="item.form?.component == 'DatePicker'">
|
||||
<span>{{ formatDate(row[item.field]) }}</span>
|
||||
</div>
|
||||
<div v-else-if="item.field == 'remark' || item.form?.component == 'Editor'">
|
||||
<el-popover placement="top" width="500px" trigger="click" v-if="row[item.field]">
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="row[item.field]"></div>
|
||||
</el-popover>
|
||||
</div>
|
||||
<span v-else>{{ row[item.field] }}</span>
|
||||
</template>
|
||||
<template v-else>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200px" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
v-hasPermi="['clue:pool:gain']"
|
||||
@click="handleGain(scope.row.clueId)"
|
||||
@click="handleDetail(scope.row)"
|
||||
v-hasPermi="['clue:pool:detail']"
|
||||
>
|
||||
获取
|
||||
详情
|
||||
</el-button>
|
||||
<template v-if="queryType != 4">
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(scope.row)"
|
||||
v-hasPermi="['clue:pool:update']"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
:disabled="scope.row.state == '成交'"
|
||||
@click="handleSuccess(scope.row)"
|
||||
v-hasPermi="['clue:pool:enroll']"
|
||||
>
|
||||
登记
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
:disabled="scope.row.state == '成交'"
|
||||
v-hasPermi="['clue:pool:release']"
|
||||
@click="handleRelease(scope.row.clueId)"
|
||||
>
|
||||
释放
|
||||
</el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
v-hasPermi="['clue:pool:gain']"
|
||||
@click="handleGain(scope.row.clueId)"
|
||||
>
|
||||
获取
|
||||
</el-button>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</SSTable>
|
||||
</el-table-column>
|
||||
</SSTable>
|
||||
</template>
|
||||
|
||||
<DialogClue
|
||||
v-if="!loading"
|
||||
ref="formRef"
|
||||
:userOptions="userOptions"
|
||||
:schema="allSchemas.formSchema"
|
||||
@sucess="getTableList"
|
||||
@success="getTableList"
|
||||
/>
|
||||
<DrawerClue
|
||||
v-if="!loading"
|
||||
ref="drawerRef"
|
||||
:schema="allSchemas.formSchema"
|
||||
:schema="allSchemas.detailSchema"
|
||||
@get-list="getTableList"
|
||||
@update="handleEdit"
|
||||
/>
|
||||
<DialogSuccess ref="successRef" :schema="allSchemas.formSchema" @success="getTableList" />
|
||||
<DialogSuccess ref="successRef" :schema="allSchemas.detailSchema" @success="getTableList" />
|
||||
<DialogFollow ref="followRef" @success="getTableList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="CluePool">
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { getSimpleFieldList } from '@/api/clue/clueField'
|
||||
import DialogClue from './Comp/DialogClue.vue'
|
||||
import DrawerClue from './Comp/DrawerClue.vue'
|
||||
import DialogSuccess from './Comp/DialogSuccess.vue'
|
||||
import DialogFollow from './Comp/DialogFollow.vue'
|
||||
import ClueMap from './Comp/ClueMap.vue'
|
||||
import { getSimpleUserList as getUserOption } from '@/api/system/user'
|
||||
|
||||
import { removeNullField } from '@/utils'
|
||||
@@ -170,6 +190,7 @@ import { formatDate } from '@/utils/formatTime'
|
||||
import * as ClueApi from '@/api/clue'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const appStore = useAppStore()
|
||||
|
||||
const searchRef = ref()
|
||||
const queryType = ref('2')
|
||||
@@ -187,6 +208,11 @@ async function getCurdSchemas() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await getSimpleFieldList()
|
||||
data.forEach((elem) => {
|
||||
if (elem.field == 'followUser') {
|
||||
elem.search.options = userOptions.value
|
||||
}
|
||||
})
|
||||
allSchemas.value = useCrudSchemas(data).allSchemas
|
||||
} finally {
|
||||
loading.value = false
|
||||
@@ -201,20 +227,34 @@ const tableObject = ref({
|
||||
loading: false,
|
||||
total: 1,
|
||||
pageSize: 20,
|
||||
currentPage: 1
|
||||
pageNo: 1
|
||||
})
|
||||
|
||||
const showColumns = ref([])
|
||||
|
||||
// 初始化表格
|
||||
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() {
|
||||
searchRef.value.reset()
|
||||
tableObject.value.currentPage = 1
|
||||
getTableList()
|
||||
nextTick(() => {
|
||||
searchRef.value && searchRef.value.reset()
|
||||
tableObject.value.pageNo = 1
|
||||
getTableList()
|
||||
})
|
||||
}
|
||||
|
||||
async function getTableList() {
|
||||
@@ -225,7 +265,7 @@ async function getTableList() {
|
||||
const queryParams = await searchRef.value.getFormModel()
|
||||
const params = {
|
||||
...queryParams,
|
||||
pageNo: tableObject.value.currentPage,
|
||||
pageNo: tableObject.value.pageNo,
|
||||
pageSize: tableObject.value.pageSize,
|
||||
queryType: queryType.value
|
||||
}
|
||||
@@ -262,7 +302,7 @@ function handleDetail(row) {
|
||||
}
|
||||
|
||||
function handleFollow(row) {
|
||||
followRef.value.open(row.clueId)
|
||||
followRef.value.open(row.clueId, row.intentionState)
|
||||
}
|
||||
|
||||
async function makeCall(phone) {
|
||||
@@ -311,11 +351,12 @@ function handleGain(id) {
|
||||
}
|
||||
|
||||
const userOptions = ref([])
|
||||
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
getCurdSchemas()
|
||||
})
|
||||
getCurdSchemas()
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
>
|
||||
<el-option
|
||||
v-for="item in resourceOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:key="item.sourceId"
|
||||
:label="item.sourceName"
|
||||
:value="item.sourceId"
|
||||
/>
|
||||
</el-select>
|
||||
<span>{{ row.channel }}</span>
|
||||
@@ -36,21 +36,23 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100px">
|
||||
<template #default="{ $index }">
|
||||
<el-button type="primary" style="padding: 0px" text @click="handleRemove($index)"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button type="primary" style="padding: 0px" text @click="handleRemove($index)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="mt-20px flex justify-center">
|
||||
<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>
|
||||
</template>
|
||||
|
||||
<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 { t } = useI18n() // 国际化
|
||||
@@ -59,6 +61,12 @@ const list = ref([])
|
||||
const loading = ref(false)
|
||||
const resourceOptions = ref([])
|
||||
|
||||
function getOptions() {
|
||||
getResourceOptions().then((data) => {
|
||||
resourceOptions.value = listToTree(data, { id: 'sourceId', pId: 'parentId' })
|
||||
})
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
@@ -73,8 +81,20 @@ function handleInsert() {
|
||||
list.value.push({ source: '', url: '', edit: true, status: 0 })
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
console.log('保存成功')
|
||||
const formLoading = ref(false)
|
||||
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) {
|
||||
@@ -101,6 +121,7 @@ function handleChange(row) {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
>
|
||||
全选
|
||||
</el-checkbox>
|
||||
<!-- 得根据自动获得的线索做配置 -->
|
||||
<el-checkbox-group v-model="form.resource" @change="resourceCheckedChange">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in resourceOptions"
|
||||
@@ -63,7 +64,7 @@
|
||||
</div>
|
||||
</el-form-item>
|
||||
<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>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@@ -78,6 +79,7 @@
|
||||
|
||||
<script setup name="ClueSend">
|
||||
import { getUserPage } from '@/api/system/user'
|
||||
import { getClueDistributeRuleByUser } from '@/api/clue/clueGetSet'
|
||||
|
||||
// const message = useMessage() // 消息弹窗
|
||||
// const { t } = useI18n() // 国际化
|
||||
@@ -93,7 +95,7 @@ const loading = ref(false)
|
||||
const userList = ref([])
|
||||
|
||||
function setRowClass({ row }) {
|
||||
return row.field == currentRowId.value ? 'current-row' : ''
|
||||
return row.id == currentRowId.value ? 'current-row' : ''
|
||||
}
|
||||
|
||||
const currentRowId = ref('')
|
||||
@@ -102,7 +104,7 @@ const form = ref({
|
||||
isAuto: 1,
|
||||
users: [1, 2],
|
||||
resource: [3],
|
||||
sendTime: '00:00'
|
||||
weight: undefined
|
||||
})
|
||||
const rules = ref({})
|
||||
|
||||
@@ -144,8 +146,10 @@ function resourceCheckedChange(val) {
|
||||
}
|
||||
|
||||
function handleRowClick(row) {
|
||||
currentRowId.value = row.ruleId
|
||||
form.value = { ...row }
|
||||
currentRowId.value = row.id
|
||||
getClueDistributeRuleByUser({ employeeId: row.id }).then((data) => {
|
||||
form.value = data
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
107
src/views/Clue/Set/Comp/DialogOtherPay.vue
Normal file
107
src/views/Clue/Set/Comp/DialogOtherPay.vue
Normal file
@@ -0,0 +1,107 @@
|
||||
<template>
|
||||
<Dialog :title="dialogTitle" v-model="dialogVisible" width="800px">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
v-loading="formLoading"
|
||||
:model="formData"
|
||||
:rules="formRules"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item label="费用项" prop="label">
|
||||
<el-input v-model="formData.label" placeholder="请输入费用项" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<el-input v-model="formData.sort" placeholder="请输入排序" type="number" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
type="textarea"
|
||||
v-model="formData.remark"
|
||||
placeholder="请输入备注"
|
||||
:autosize="{ minRows: 4, maxRows: 8 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button :disabled="formLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
<script name="DialogOtherPay" setup>
|
||||
import * as dictApi from '@/api/system/dict/dict.data'
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
const formType = ref('') // 表单的类型:create - 新增;update - 修改
|
||||
const formData = ref({
|
||||
label: '',
|
||||
sort: 1,
|
||||
remark: ''
|
||||
})
|
||||
const formRules = reactive({
|
||||
label: [{ required: true, message: '费用项不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const formRef = ref() // 表单 Ref
|
||||
|
||||
/** 打开弹窗 */
|
||||
const open = async (type, id) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = type == 'update' ? '修改费用项' : '新增费用项'
|
||||
formType.value = type
|
||||
resetForm()
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
formData.value = await dictApi.getDictData(id)
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
}
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
/** 提交表单 */
|
||||
const emit = defineEmits(['success']) // 定义 success 事件,用于操作成功后的回调
|
||||
const submitForm = async () => {
|
||||
// 校验表单
|
||||
if (!formRef.value) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
formLoading.value = true
|
||||
try {
|
||||
if (!formData.value.value) {
|
||||
formData.value.value = formData.value.label
|
||||
}
|
||||
if (formType.value === 'create') {
|
||||
await dictApi.createDictData(formData.value)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
await dictApi.updateDictData(formData.value)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
/** 重置表单 */
|
||||
const resetForm = () => {
|
||||
formData.value = {
|
||||
label: '',
|
||||
sort: 1,
|
||||
status: 0,
|
||||
dictType: 'other_pay_type',
|
||||
remark: ''
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
</script>
|
||||
@@ -20,7 +20,7 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="80px">
|
||||
<el-table-column label="操作" width="80px" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" text style="padding: 0" @click="remove(row.clueParamId)"
|
||||
>删除</el-button
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="80px">
|
||||
<el-table-column label="操作" width="80px" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" text style="padding: 0" @click="remove(row.clueParamId)"
|
||||
>删除</el-button
|
||||
|
||||
@@ -1,21 +1,57 @@
|
||||
<template>
|
||||
<el-form :model="form" ref="formRef" label-width="auto">
|
||||
<el-form-item label="售后申请自动通过">
|
||||
<el-radio-group v-model="form.autoAudiAfterSale">
|
||||
<el-radio :label="0"> 是 </el-radio>
|
||||
<el-radio :label="1"> 否 </el-radio>
|
||||
<el-form-item v-if="getConfig('afterSalesAuditAutoCompleteConfig')">
|
||||
<template #label>
|
||||
<Tooltip
|
||||
v-if="getConfig('afterSalesAuditAutoCompleteConfig').remark"
|
||||
:message="getConfig('afterSalesAuditAutoCompleteConfig').remark"
|
||||
/>
|
||||
<span>售后申请自动通过</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.afterSalesAuditAutoCompleteConfig">
|
||||
<el-radio
|
||||
v-for="(item, index) in getConfig('afterSalesAuditAutoCompleteConfig').options"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="发货自动发起采购">
|
||||
<el-radio-group v-model="form.autoSend">
|
||||
<el-radio :label="0"> 是 </el-radio>
|
||||
<el-radio :label="1"> 否 </el-radio>
|
||||
<el-form-item v-if="getConfig('deliveryAutoStartPurchaseConfig') && props.appType == 2">
|
||||
<template #label>
|
||||
<Tooltip
|
||||
v-if="getConfig('deliveryAutoStartPurchaseConfig').remark"
|
||||
:message="getConfig('deliveryAutoStartPurchaseConfig').remark"
|
||||
/>
|
||||
<span>允许负库存</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.deliveryAutoStartPurchaseConfig">
|
||||
<el-radio
|
||||
v-for="(item, index) in getConfig('deliveryAutoStartPurchaseConfig').options"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="回款申请自动通过">
|
||||
<el-radio-group v-model="form.autoAuditReturn">
|
||||
<el-radio :label="0"> 是 </el-radio>
|
||||
<el-radio :label="1"> 否 </el-radio>
|
||||
<el-form-item v-if="getConfig('repaymentAuditAutoCompleteConfig')">
|
||||
<template #label>
|
||||
<Tooltip
|
||||
v-if="getConfig('repaymentAuditAutoCompleteConfig').remark"
|
||||
:message="getConfig('repaymentAuditAutoCompleteConfig').remark"
|
||||
/>
|
||||
<span>回款申请自动通过</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.repaymentAuditAutoCompleteConfig">
|
||||
<el-radio
|
||||
v-for="(item, index) in getConfig('repaymentAuditAutoCompleteConfig').options"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -26,25 +62,49 @@
|
||||
</template>
|
||||
|
||||
<script setup name="GeneralClue">
|
||||
import * as ConfigApi from '@/api/system/set'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
const form = ref({
|
||||
autoAudiAfterSale: 0,
|
||||
autoSend: 0,
|
||||
autoAuditReturn: 0
|
||||
const props = defineProps({
|
||||
appType: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
})
|
||||
|
||||
const form = ref({})
|
||||
|
||||
const configList = ref([])
|
||||
|
||||
function getConfig(val) {
|
||||
return configList.value.find((it) => it.configKey == val)
|
||||
}
|
||||
|
||||
function getData() {
|
||||
form.value = {
|
||||
autoAudiAfterSale: 0,
|
||||
autoSend: 0,
|
||||
autoAuditReturn: 0
|
||||
}
|
||||
ConfigApi.getConfigList({ module: 1 }).then((data) => {
|
||||
configList.value = data
|
||||
// 获取所有配置项
|
||||
data.map((it) => {
|
||||
form.value[it.configKey] = it.configValue
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
message.success('保存成功')
|
||||
const params = configList.value.map((it) => ({
|
||||
configId: it.configId,
|
||||
configKey: it.configKey,
|
||||
configValue: form.value[it.configKey]
|
||||
}))
|
||||
ConfigApi.updateConfig(params).then(() => {
|
||||
message.success('保存成功')
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
126
src/views/Clue/Set/Comp/OtherPayType.vue
Normal file
126
src/views/Clue/Set/Comp/OtherPayType.vue
Normal file
@@ -0,0 +1,126 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="queryForm" :model="searchForm" label-width="0" inline>
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model="searchForm.name"
|
||||
placeholder="请输入名称"
|
||||
clearable
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleQuery">搜索</el-button>
|
||||
<el-button @click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" @click="openForm('create', null)">新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table v-loading="loading" :data="tableList">
|
||||
<el-table-column prop="label" label="费用项" />
|
||||
<el-table-column prop="sort" label="排序" width="100px" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
prop="createTime"
|
||||
width="180px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column label="操作">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="!scope.row.editable"
|
||||
text
|
||||
@click="openForm('update', scope.row.id)"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
:disabled="!scope.row.editable"
|
||||
text
|
||||
@click="handleDelete(scope.row.id)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<DialogOtherPay ref="otherOayDialog" @success="handleQuery" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="OtherPayType">
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import DialogOtherPay from './DialogOtherPay.vue'
|
||||
import * as dictApi from '@/api/system/dict/dict.data'
|
||||
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const searchForm = ref({
|
||||
label: '',
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
dictType: 'other_pay_type'
|
||||
})
|
||||
|
||||
const total = ref(0)
|
||||
const otherOayDialog = ref()
|
||||
const tableList = ref([])
|
||||
const loading = ref(false)
|
||||
|
||||
function handleQuery() {
|
||||
searchForm.value.pageNo = 1
|
||||
getList()
|
||||
}
|
||||
function resetQuery() {
|
||||
searchForm.value = {
|
||||
label: '',
|
||||
pageSize: 20,
|
||||
pageNo: 1,
|
||||
dictType: 'other_pay_type'
|
||||
}
|
||||
getList()
|
||||
}
|
||||
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await dictApi.getDictDataPage(searchForm.value)
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
function openForm(type, id) {
|
||||
otherOayDialog.value.open(type, id)
|
||||
}
|
||||
|
||||
async function handleDelete(id) {
|
||||
try {
|
||||
// 删除的二次确认
|
||||
await message.delConfirm()
|
||||
// 发起删除
|
||||
await dictApi.deleteDictData(id)
|
||||
message.success(t('common.delSuccess'))
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
handleQuery()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -16,8 +16,8 @@
|
||||
v-if="checkPermi(['clue:setting:clue-get-rules'])"
|
||||
>
|
||||
<ClueGet v-if="tabIndex == 20" />
|
||||
</el-tab-pane> -->
|
||||
<!-- <el-tab-pane
|
||||
</el-tab-pane>
|
||||
<el-tab-pane
|
||||
label="线索分配规则"
|
||||
:name="30"
|
||||
v-if="checkPermi(['clue:setting:clue-send-rules'])"
|
||||
@@ -30,8 +30,11 @@
|
||||
<el-tab-pane label="额外支出项" :name="36" v-if="checkPermi(['clue:setting:extra-fee'])">
|
||||
<ExtraFeeType v-if="tabIndex == 36" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="其他费用项" :name="37" v-if="checkPermi(['clue:setting:other-pay'])">
|
||||
<OtherPayType v-if="tabIndex == 37" />
|
||||
</el-tab-pane>
|
||||
<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 label="消息通知" :name="50" v-if="checkPermi(['mall:setting:prod'])">
|
||||
<MsgSend v-if="tabIndex == 50" />
|
||||
@@ -49,9 +52,14 @@ import ClueSource from './Comp/ClueSource.vue'
|
||||
// import MsgSend from './Comp/MsgSend.vue'
|
||||
import IntentionStatus from './Comp/IntentionStatus.vue'
|
||||
import ExtraFeeType from './Comp/ExtraFeeType.vue'
|
||||
import OtherPayType from './Comp/OtherPayType.vue'
|
||||
import GeneralSet from './Comp/GeneralSet.vue'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
|
||||
const appStore = useAppStore()
|
||||
|
||||
const tabIndex = ref(0)
|
||||
</script>
|
||||
|
||||
|
||||
@@ -11,9 +11,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleQuery" v-hasPermi="['clue:skill:search']">
|
||||
搜索
|
||||
</el-button>
|
||||
<el-button @click="handleQuery" v-hasPermi="['clue:skill:search']">搜索</el-button>
|
||||
<el-button @click="resetQuery" v-hasPermi="['clue:skill:reset']">重置</el-button>
|
||||
<el-button type="primary" plain @click="handleAdd" v-hasPermi="['clue:skill:add']">
|
||||
新增
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<CountTo
|
||||
class="text-20px number-font"
|
||||
:start-val="0"
|
||||
:end-val="10"
|
||||
:end-val="clueInfo.todayFollowingNum"
|
||||
:duration="2600"
|
||||
/>
|
||||
</div>
|
||||
@@ -28,7 +28,7 @@
|
||||
<CountTo
|
||||
class="text-20px number-font"
|
||||
:start-val="0"
|
||||
:end-val="25"
|
||||
:end-val="clueInfo.todayFollowedNum"
|
||||
:duration="2600"
|
||||
/>
|
||||
</div>
|
||||
@@ -38,7 +38,7 @@
|
||||
<CountTo
|
||||
class="text-20px number-font"
|
||||
:start-val="0"
|
||||
:end-val="2"
|
||||
:end-val="clueInfo.todaySignedNum"
|
||||
:duration="2600"
|
||||
/>
|
||||
</div>
|
||||
@@ -48,7 +48,7 @@
|
||||
<CountTo
|
||||
class="text-20px number-font"
|
||||
:start-val="0"
|
||||
:end-val="235"
|
||||
:end-val="clueInfo.outFollowNum"
|
||||
:duration="2600"
|
||||
/>
|
||||
</div>
|
||||
@@ -58,7 +58,7 @@
|
||||
<CountTo
|
||||
class="text-20px number-font"
|
||||
:start-val="0"
|
||||
:end-val="0"
|
||||
:end-val="clueInfo.unknownNum"
|
||||
:duration="2600"
|
||||
/>
|
||||
</div>
|
||||
@@ -67,8 +67,61 @@
|
||||
</el-row>
|
||||
</el-skeleton>
|
||||
</el-card>
|
||||
<el-row class="mt-10px" :gutter="10" justify="space-between">
|
||||
<!-- <el-col :xl="6" :lg="6" :md="12" :sm="12" :xs="24" class="mb-10px">
|
||||
<div class="mt-10px flex">
|
||||
<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">
|
||||
<template #header>
|
||||
<div class="flex justify-between ">
|
||||
@@ -80,65 +133,6 @@
|
||||
</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">
|
||||
<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>
|
||||
</template>
|
||||
<script setup lang="ts" name="Home">
|
||||
@@ -146,7 +140,8 @@ import { set } from 'lodash-es'
|
||||
import { EChartsOption } from 'echarts'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
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 userStore = useUserStore()
|
||||
@@ -154,94 +149,98 @@ const loading = ref(false)
|
||||
const avatar = userStore.getUser.avatar ? userStore.getUser.avatar : avatarImg
|
||||
const username = userStore.getUser.nickname
|
||||
|
||||
const followDate = ref('day')
|
||||
const followDate = ref(1)
|
||||
|
||||
// 成交线索来源
|
||||
const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption
|
||||
const getSaleClueSource = async () => {
|
||||
const data = [
|
||||
{ value: 335, name: '宝典' },
|
||||
{ value: 310, name: '一点通' },
|
||||
{ value: 234, name: '抖音' },
|
||||
{ value: 135, name: '小红书' },
|
||||
{ value: 1548, name: '转介绍' }
|
||||
]
|
||||
set(
|
||||
pieOptionsData,
|
||||
'legend.data',
|
||||
data.map((v) => t(v.name))
|
||||
)
|
||||
pieOptionsData!.series![0].data = data.map((v) => {
|
||||
return {
|
||||
name: t(v.name),
|
||||
value: v.value
|
||||
}
|
||||
})
|
||||
}
|
||||
// const pieOptionsData = reactive<EChartsOption>(pieOptions) as EChartsOption
|
||||
// const getSaleClueSource = async () => {
|
||||
// const data = [
|
||||
// { value: 335, name: '宝典' },
|
||||
// { value: 310, name: '一点通' },
|
||||
// { value: 234, name: '抖音' },
|
||||
// { value: 135, name: '小红书' },
|
||||
// { value: 1548, name: '转介绍' }
|
||||
// ]
|
||||
// set(
|
||||
// pieOptionsData,
|
||||
// 'legend.data',
|
||||
// data.map((v) => t(v.name))
|
||||
// )
|
||||
// pieOptionsData!.series![0].data = data.map((v) => {
|
||||
// return {
|
||||
// name: t(v.name),
|
||||
// value: v.value
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
|
||||
// 成交率
|
||||
const lineOptionsData = reactive<EChartsOption>(lineOptions) as EChartsOption
|
||||
const getMonthlySaleRate = async () => {
|
||||
const data = [
|
||||
{ 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' }
|
||||
]
|
||||
const data = await HomeApi.getClueSignSignRate()
|
||||
set(
|
||||
lineOptionsData,
|
||||
'xAxis.data',
|
||||
data.map((v) => t(v.name))
|
||||
data.map((v) => t(v.month))
|
||||
)
|
||||
set(lineOptionsData, 'series', [
|
||||
{
|
||||
name: t('analysis.estimate'),
|
||||
name: '个人成交率',
|
||||
smooth: true,
|
||||
type: 'line',
|
||||
data: data.map((v) => v.estimate),
|
||||
data: data.map((v) => v.personalRate),
|
||||
animationDuration: 2800,
|
||||
animationEasing: 'cubicInOut'
|
||||
},
|
||||
{
|
||||
name: t('analysis.actual'),
|
||||
name: '平均成交率',
|
||||
smooth: true,
|
||||
type: 'line',
|
||||
itemStyle: {},
|
||||
data: data.map((v) => v.actual),
|
||||
data: data.map((v) => v.avgRate),
|
||||
animationDuration: 2800,
|
||||
animationEasing: 'quadraticOut'
|
||||
}
|
||||
])
|
||||
}
|
||||
|
||||
const followList = ref([
|
||||
{ sort: 1, name: '张三', count: 12, orgName: '销售1组' },
|
||||
{ sort: 2, name: '张三', count: 11, orgName: '销售3组' },
|
||||
{ sort: 3, name: '张三', count: 11, orgName: '销售1组' },
|
||||
{ sort: 4, name: '张三', count: 10, orgName: '销售1组' },
|
||||
{ sort: 5, name: '张三', count: 2, orgName: '销售2组' },
|
||||
{ sort: 6, name: '张三', count: 1, orgName: '销售1组' },
|
||||
{ sort: 2, name: '张三', count: 11, orgName: '销售3组' },
|
||||
{ sort: 3, name: '张三', count: 11, orgName: '销售1组' },
|
||||
{ sort: 4, name: '张三', count: 10, orgName: '销售1组' },
|
||||
{ sort: 5, name: '张三', count: 2, orgName: '销售2组' },
|
||||
{ sort: 6, name: '张三', count: 1, orgName: '销售1组' }
|
||||
])
|
||||
const followList = ref<any>([])
|
||||
|
||||
const clueInfo = ref({
|
||||
todayFollowingNum: 0,
|
||||
todayFollowedNum: 0,
|
||||
todaySignedNum: 0,
|
||||
outFollowNum: 0,
|
||||
unknownNum: 0
|
||||
})
|
||||
|
||||
function getClueInfo() {
|
||||
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 () => {
|
||||
await Promise.all([getSaleClueSource(), getMonthlySaleRate()])
|
||||
await Promise.all([getClueInfo(), getSignList(), getMonthlySaleRate(), getFollowList()])
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
getAllApi()
|
||||
onMounted(() => {
|
||||
getAllApi()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -42,25 +42,7 @@ export const lineOptions: EChartsOption = {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
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'
|
||||
}
|
||||
]
|
||||
series: []
|
||||
}
|
||||
|
||||
export const pieOptions: EChartsOption = {
|
||||
|
||||
@@ -50,9 +50,9 @@
|
||||
<!-- 账号登录 -->
|
||||
<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)" /> -->
|
||||
<!-- 三方登录 -->
|
||||
@@ -70,7 +70,7 @@ import { useDesign } from '@/hooks/web/useDesign'
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
|
||||
|
||||
import { LoginForm, MobileForm, QrCodeForm } from './components'
|
||||
import { LoginForm } from './components'
|
||||
|
||||
import soups from './components/soup.js'
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
mode="pop"
|
||||
@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-row :gutter="5" justify="space-between" style="width: 100%">
|
||||
<el-col :span="12">
|
||||
@@ -131,6 +131,7 @@ const verify = ref()
|
||||
const captchaType = ref('blockPuzzle') // blockPuzzle 滑块 clickWord 点击文字
|
||||
|
||||
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN)
|
||||
const showOtherLogin = false
|
||||
|
||||
const LoginRules = {
|
||||
username: [required],
|
||||
@@ -143,8 +144,8 @@ const loginData = reactive({
|
||||
loginForm: {
|
||||
tenantId: undefined,
|
||||
instanceId: undefined,
|
||||
username: 'admin',
|
||||
password: 'admin123',
|
||||
username: '',
|
||||
password: '',
|
||||
captchaVerification: '',
|
||||
rememberMe: true
|
||||
}
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
<template>
|
||||
<div>
|
||||
<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-select
|
||||
v-model="searchForm.productId"
|
||||
@@ -43,6 +49,10 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input v-model="searchForm.batchNo" placeholder="批次号" clearable />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch"> 搜索 </el-button>
|
||||
<el-button @click="resetQuery"> 重置 </el-button>
|
||||
@@ -53,17 +63,26 @@
|
||||
<el-table-column type="index" width="50px" />
|
||||
<el-table-column prop="productName" label="产品名称" />
|
||||
<el-table-column prop="specsName" label="规格" />
|
||||
<el-table-column label="变动类型">
|
||||
<el-table-column label="变动类型" width="90px">
|
||||
<template #default="{ row }">
|
||||
{{ ['', '入库', '出库'][row.changeType] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="num" label="数量" />
|
||||
<el-table-column prop="money" label="金额" />
|
||||
<el-table-column prop="num" label="变动数量" width="90px" />
|
||||
<el-table-column prop="batchNo" label="批次号" />
|
||||
<el-table-column prop="changeTime" label="变动时间" :formatter="dateFormatter" />
|
||||
<el-table-column prop="changeUserName" 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>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
@@ -78,11 +97,14 @@
|
||||
import { dateFormatter } from '@/utils/formatTime'
|
||||
import { getSimpleWarehouseList, getInventoryRecord } from '@/api/mall/warehouse'
|
||||
import { getSimpleProductList } from '@/api/mall/product'
|
||||
import { removeNullField } from '@/utils'
|
||||
|
||||
const searchForm = ref({
|
||||
pproductId: undefined,
|
||||
specsId: undefined,
|
||||
warehouseId: undefined,
|
||||
changeType: undefined,
|
||||
batchNo: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
})
|
||||
@@ -102,6 +124,8 @@ function resetQuery() {
|
||||
productId: undefined,
|
||||
specsId: undefined,
|
||||
warehouseId: undefined,
|
||||
changeType: undefined,
|
||||
batchNo: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
}
|
||||
@@ -133,7 +157,7 @@ function changeProd(val) {
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await getInventoryRecord(searchForm.value)
|
||||
const data = await getInventoryRecord(removeNullField(searchForm.value))
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
|
||||
@@ -30,13 +30,27 @@
|
||||
width="180px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column label="操作">
|
||||
<el-table-column label="操作" width="150px">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" text @click="openForm('update', scope.row)">修改</el-button>
|
||||
<el-button type="primary" text @click="openForm('createChildren', scope.row)">
|
||||
<el-button
|
||||
type="primary"
|
||||
style="padding: 0px"
|
||||
text
|
||||
@click="openForm('update', scope.row)"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
style="padding: 0px"
|
||||
text
|
||||
@click="openForm('createChildren', scope.row)"
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button type="danger" text @click="handleDelete(scope.row.id)">删除</el-button>
|
||||
<el-button type="danger" style="padding: 0px" text @click="handleDelete(scope.row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="80px">
|
||||
<el-table-column label="操作" width="80px" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" text style="padding: 0" @click="remove(row.clueParamId)"
|
||||
>删除</el-button
|
||||
|
||||
@@ -1,9 +1,21 @@
|
||||
<template>
|
||||
<el-form :model="form" ref="formRef" label-width="auto">
|
||||
<el-form-item label="采购申请自动通过">
|
||||
<el-form-item v-if="getConfig('purchaseAuditAutoCompleteConfig')">
|
||||
<template #label>
|
||||
<Tooltip
|
||||
v-if="getConfig('purchaseAuditAutoCompleteConfig').remark"
|
||||
:message="getConfig('purchaseAuditAutoCompleteConfig').remark"
|
||||
/>
|
||||
<span>采购申请自动通过</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.purchaseAuditAutoCompleteConfig">
|
||||
<el-radio label="true"> 是 </el-radio>
|
||||
<el-radio label="false"> 否 </el-radio>
|
||||
<el-radio
|
||||
v-for="(item, index) in getConfig('purchaseAuditAutoCompleteConfig').options"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -17,27 +29,31 @@ import * as ConfigApi from '@/api/system/set'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
const form = ref({
|
||||
purchaseAuditAutoCompleteConfig: 'true'
|
||||
})
|
||||
const form = ref({})
|
||||
|
||||
const info = ref({})
|
||||
const configList = ref([])
|
||||
|
||||
function getConfig(val) {
|
||||
return configList.value.find((it) => it.configKey == val)
|
||||
}
|
||||
|
||||
function getData() {
|
||||
ConfigApi.getConfigByConfigKey({ configKey: 'purchaseAuditAutoCompleteConfig' }).then((data) => {
|
||||
info.value = data
|
||||
form.value = {
|
||||
purchaseAuditAutoCompleteConfig: data.configValue
|
||||
}
|
||||
ConfigApi.getConfigList({ module: 3 }).then((data) => {
|
||||
configList.value = data
|
||||
// 获取所有配置项
|
||||
data.map((it) => {
|
||||
form.value[it.configKey] = it.configValue
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
const data = {
|
||||
...info,
|
||||
purchaseAuditAutoCompleteConfig: form.value.purchaseAuditAutoCompleteConfig
|
||||
}
|
||||
ConfigApi.updateConfig(data).then(() => {
|
||||
const params = configList.value.map((it) => ({
|
||||
configId: it.configId,
|
||||
configKey: it.configKey,
|
||||
configValue: form.value[it.configKey]
|
||||
}))
|
||||
ConfigApi.updateConfig(params).then(() => {
|
||||
message.success('保存成功')
|
||||
})
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user