Compare commits
14 Commits
salary
...
e33abc8f66
| Author | SHA1 | Date | |
|---|---|---|---|
| e33abc8f66 | |||
| b40e28af6f | |||
| 5ab62d2a05 | |||
| 11fb0576ac | |||
| ab30f1307f | |||
| 92e5a032b5 | |||
| dd6ae89728 | |||
| b407d0a04d | |||
| 82e7731583 | |||
| 9d006fe6a5 | |||
| f4231a13e5 | |||
| 2c2ffcd104 | |||
| 028883975d | |||
| acc59c3a9e |
11
.env.base
11
.env.base
@@ -1,21 +1,20 @@
|
||||
# 本地开发环境
|
||||
VITE_NODE_ENV=development
|
||||
NODE_ENV=development
|
||||
|
||||
VITE_DEV=true
|
||||
|
||||
# 请求路径
|
||||
VITE_BASE_URL='http://118.31.23.45:48080'
|
||||
# VITE_BASE_URL='http://114.55.169.15:48080'
|
||||
#VITE_BASE_URL='http://api-dashboard.yudao.iocoder.cn'
|
||||
VITE_BASE_URL='http://localhost: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=/crm-api
|
||||
VITE_API_BASEPATH=/dev-api
|
||||
|
||||
# 接口地址
|
||||
VITE_API_URL=/admin-api
|
||||
|
||||
# 打包路径
|
||||
VITE_BASE_PATH=/crm/
|
||||
VITE_BASE_PATH=/
|
||||
|
||||
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=/crm-api
|
||||
VITE_API_BASEPATH=/dev-api
|
||||
|
||||
# 接口地址
|
||||
VITE_API_URL=/admin-api
|
||||
|
||||
# 打包路径
|
||||
VITE_BASE_PATH=/crm/
|
||||
VITE_BASE_PATH=/
|
||||
|
||||
# 是否删除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=/crm-api
|
||||
VITE_API_BASEPATH=/dev-api
|
||||
|
||||
# 接口地址
|
||||
VITE_API_URL=/admin-api
|
||||
|
||||
# 打包路径
|
||||
VITE_BASE_PATH=/crm/
|
||||
VITE_BASE_PATH=/
|
||||
|
||||
# 项目本地运行端口号, 与.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='/crm-api'
|
||||
VITE_BASE_URL='http://localhost:48080'
|
||||
|
||||
# 上传路径
|
||||
VITE_UPLOAD_URL='/crm-api/admin-api/system/file/upload'
|
||||
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
|
||||
|
||||
# 接口前缀
|
||||
VITE_API_BASEPATH=/crm-api
|
||||
VITE_API_BASEPATH=
|
||||
|
||||
# 接口地址
|
||||
VITE_API_URL=/admin-api
|
||||
@@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=true
|
||||
VITE_SOURCEMAP=false
|
||||
|
||||
# 打包路径
|
||||
VITE_BASE_PATH=/crm/
|
||||
VITE_BASE_PATH=/
|
||||
|
||||
# 输出路径
|
||||
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=/crm-api
|
||||
VITE_API_BASEPATH=
|
||||
|
||||
# 接口地址
|
||||
VITE_API_URL=/admin-api
|
||||
@@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=true
|
||||
VITE_SOURCEMAP=false
|
||||
|
||||
# 打包路径
|
||||
VITE_BASE_PATH='/crm'
|
||||
VITE_BASE_PATH='http://static-vue3.yudao.iocoder.cn/'
|
||||
|
||||
# 输出路径
|
||||
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=/crm-api
|
||||
VITE_API_BASEPATH=
|
||||
|
||||
# 接口地址
|
||||
VITE_API_URL=/admin-api
|
||||
@@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=true
|
||||
VITE_SOURCEMAP=false
|
||||
|
||||
# 打包路径
|
||||
VITE_BASE_PATH=/crm/
|
||||
VITE_BASE_PATH=/admin-ui-vue3/
|
||||
|
||||
# 输出路径
|
||||
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=/crm-api
|
||||
VITE_API_BASEPATH=
|
||||
|
||||
# 接口地址
|
||||
VITE_API_URL=/admin-api
|
||||
@@ -25,7 +25,7 @@ VITE_DROP_CONSOLE=false
|
||||
VITE_SOURCEMAP=true
|
||||
|
||||
# 打包路径
|
||||
VITE_BASE_PATH=/crm/
|
||||
VITE_BASE_PATH=/
|
||||
|
||||
# 输出路径
|
||||
VITE_OUT_DIR=dist-test
|
||||
|
||||
@@ -141,7 +141,7 @@
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
<script type="text/javascript">
|
||||
window._AMapSecurityConfig = {
|
||||
securityJsCode: 'f653df5a2c5f44ae68faaab6f6a6b8ab' // 你的密钥
|
||||
securityJsCode: 'a2f0d14a4c5c1e387f9271b1045a781d' // 你的密钥
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 4.2 KiB |
@@ -12,11 +12,7 @@ export const getAfterSalePage = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createAfterSale = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sign-after-sale/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
return await request.post({ url: '/admin-api/crm/sign-after-sale/create', data })
|
||||
}
|
||||
|
||||
// 审核
|
||||
|
||||
@@ -10,14 +10,9 @@ 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 getClueDistributeRuleByUser = (params) => {
|
||||
return request.get({ url: '/admin-api/crm/sch-clue-distribution-rule/queryByUserId', params })
|
||||
export const getClueDistributeRuleList = () => {
|
||||
return request.get({ url: '/admin-api/crm/sch-clue-gain-rule/list' })
|
||||
}
|
||||
|
||||
// 删除
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
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,11 +7,7 @@ export const getFollowList = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createFollow = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/clue-follow-record/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
return await request.post({ url: '/admin-api/crm/clue-follow-record/create', data: data })
|
||||
}
|
||||
|
||||
// 删除
|
||||
|
||||
@@ -17,11 +17,7 @@ export const getClue = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createClue = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-clue/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
return await request.post({ url: '/admin-api/crm/sch-clue/create', data: data })
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -12,11 +12,7 @@ export const getPaymentPage = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createPayment = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sign-pay-record/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
return await request.post({ url: '/admin-api/crm/sign-pay-record/create', data })
|
||||
}
|
||||
|
||||
// 审核
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
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,20 +12,10 @@ export const getSign = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createSign = async (data) => {
|
||||
return await request.post({ url: '/admin-api/crm/sign/create', data: data, isSubmitForm: true })
|
||||
return await request.post({ url: '/admin-api/crm/sign/create', data: data })
|
||||
}
|
||||
|
||||
// 取消登记
|
||||
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, isSubmitForm: true })
|
||||
return request.post({ url: '/admin-api/crm/skill/create', data })
|
||||
}
|
||||
|
||||
// 更新
|
||||
|
||||
@@ -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, isSubmitForm: true })
|
||||
return await request.post({ url: '/admin-api/crm/source/create', data: data })
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
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, isSubmitForm: true })
|
||||
return request.post({ url: '/admin-api/crm/erp-product-brand/create', data })
|
||||
}
|
||||
|
||||
// 更新商品品牌
|
||||
|
||||
@@ -36,11 +36,7 @@ export interface CategoryVO {
|
||||
|
||||
// 创建商品分类
|
||||
export const createCategory = (data: CategoryVO) => {
|
||||
return request.post({
|
||||
url: '/admin-api/crm/erp-product-category/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
return request.post({ url: '/admin-api/crm/erp-product-category/create', data })
|
||||
}
|
||||
|
||||
// 更新商品分类
|
||||
|
||||
@@ -11,11 +11,7 @@ export const getProduct = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createProduct = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/erp-product/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
return await request.post({ url: '/admin-api/crm/erp-product/create', data: data })
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -2,11 +2,7 @@ import request from '@/config/axios'
|
||||
|
||||
// 创建
|
||||
export const createField = (data) => {
|
||||
return request.post({
|
||||
url: '/admin-api/crm/param/create',
|
||||
data: { ...data, module: 3 },
|
||||
isSubmitForm: true
|
||||
})
|
||||
return request.post({ url: '/admin-api/crm/param/create', data: { ...data, module: 3 } })
|
||||
}
|
||||
|
||||
// 更新
|
||||
|
||||
@@ -42,11 +42,7 @@ export interface PropertyValueDetailVO {
|
||||
|
||||
// 创建属性项
|
||||
export const createProperty = (data: PropertyVO) => {
|
||||
return request.post({
|
||||
url: '/admin-api/crm/erp-product-property/create',
|
||||
data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
return request.post({ url: '/admin-api/crm/erp-product-property/create', data })
|
||||
}
|
||||
|
||||
// 更新属性项
|
||||
|
||||
@@ -6,11 +6,7 @@ export const getPurchasePage = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createPurchase = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/erp-purchase/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
return await request.post({ url: '/admin-api/crm/erp-purchase/create', data: data })
|
||||
}
|
||||
|
||||
// 修改
|
||||
|
||||
@@ -6,11 +6,7 @@ export const getWarehousePage = async (params) => {
|
||||
|
||||
// 新增
|
||||
export const createWarehouse = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/erp-warehouse/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
return await request.post({ url: '/admin-api/crm/erp-warehouse/create', data: data })
|
||||
}
|
||||
|
||||
// 修改
|
||||
@@ -42,8 +38,3 @@ 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,10 +5,6 @@ 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 })
|
||||
@@ -16,11 +12,7 @@ export const getClassType = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createClassType = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-class-type/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
return await request.post({ url: '/admin-api/crm/sch-class-type/create', data: data })
|
||||
}
|
||||
|
||||
// 修改
|
||||
@@ -30,7 +22,7 @@ export const updateClassType = async (params) => {
|
||||
|
||||
// 删除
|
||||
export const deleteClassType = async (id) => {
|
||||
return await request.delete({ url: '/admin-api/crm/sch-class-type/delete?id=' + id })
|
||||
return await request.delete({ url: '/admin-api/crm/sch-class-type/delete?typeId=' + id })
|
||||
}
|
||||
|
||||
// 修改状态
|
||||
|
||||
@@ -17,11 +17,7 @@ export const getPlace = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createPlace = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-place/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
return await request.post({ url: '/admin-api/crm/sch-place/create', data: data })
|
||||
}
|
||||
|
||||
// 修改
|
||||
@@ -34,10 +30,10 @@ export const deletePlace = async (id) => {
|
||||
return await request.delete({ url: '/admin-api/crm/sch-place/delete?id=' + id })
|
||||
}
|
||||
|
||||
export const updatePlaceStatus = async (placeId, status) => {
|
||||
export const updatePlaceStatus = async (id, status) => {
|
||||
const data = {
|
||||
placeId,
|
||||
id,
|
||||
status
|
||||
}
|
||||
return request.put({ url: '/admin-api/crm/sch-place/status/update', data: data })
|
||||
return request.put({ url: '/admin-api/crm/sch-place/update-status', data: data })
|
||||
}
|
||||
|
||||
@@ -11,11 +11,7 @@ export const getSchool = async (id) => {
|
||||
|
||||
// 新增
|
||||
export const createSchool = async (data) => {
|
||||
return await request.post({
|
||||
url: '/admin-api/crm/sch-school/create',
|
||||
data: data,
|
||||
isSubmitForm: true
|
||||
})
|
||||
return await request.post({ url: '/admin-api/crm/sch-school/create', data: data })
|
||||
}
|
||||
|
||||
// 修改
|
||||
@@ -28,10 +24,10 @@ export const deleteSchool = async (id) => {
|
||||
return await request.delete({ url: '/admin-api/crm/sch-school/delete?id=' + id })
|
||||
}
|
||||
|
||||
export const updateSchoolStatus = async (schoolId, status) => {
|
||||
export const updateSchoolStatus = async (id, status) => {
|
||||
const data = {
|
||||
schoolId,
|
||||
id,
|
||||
status
|
||||
}
|
||||
return request.put({ url: '/admin-api/crm/sch-school/status/update', data: data })
|
||||
return request.put({ url: '/admin-api/crm/sch-school/update-status', data: data })
|
||||
}
|
||||
|
||||
@@ -66,7 +66,6 @@ watch(
|
||||
(options) => {
|
||||
if (echartRef) {
|
||||
echartRef?.setOption(options)
|
||||
resizeHandler()
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
@@ -78,10 +78,7 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
// 对表单赋值
|
||||
const setValues = (data: Recordable = {}, isReset: Boolean = false) => {
|
||||
if (isReset) {
|
||||
formModel.value = initModel(unref(getProps).schema, unref(formModel))
|
||||
}
|
||||
const setValues = (data: Recordable = {}) => {
|
||||
formModel.value = Object.assign(unref(formModel), data)
|
||||
}
|
||||
|
||||
@@ -236,7 +233,6 @@ 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}
|
||||
|
||||
@@ -59,11 +59,6 @@ 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) {
|
||||
|
||||
@@ -44,8 +44,7 @@ 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([]),
|
||||
fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf']), // 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||
accept: propTypes.string.def('*'),
|
||||
fileSize: propTypes.number.def(5), // 大小限制(MB)
|
||||
limit: propTypes.number.def(5), // 数量限制
|
||||
|
||||
@@ -7,7 +7,7 @@ const config: {
|
||||
/**
|
||||
* api请求基础路径
|
||||
*/
|
||||
base_url: import.meta.env.VITE_API_BASEPATH,
|
||||
base_url: 'http://localhost' + import.meta.env.VITE_API_BASEPATH,
|
||||
/**
|
||||
* 接口成功返回状态码
|
||||
*/
|
||||
|
||||
@@ -5,11 +5,10 @@ import { config } from './config'
|
||||
const { default_headers } = config
|
||||
|
||||
const request = (option: any) => {
|
||||
const { url, method, params, data, headersType, responseType, isSubmitForm } = option
|
||||
const { url, method, params, data, headersType, responseType } = option
|
||||
return service({
|
||||
url: url,
|
||||
method,
|
||||
isSubmitForm,
|
||||
params,
|
||||
data,
|
||||
responseType: responseType,
|
||||
|
||||
@@ -21,7 +21,6 @@ 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
|
||||
|
||||
@@ -63,11 +62,15 @@ 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
|
||||
@@ -80,39 +83,27 @@ service.interceptors.request.use(
|
||||
}
|
||||
// get参数编码
|
||||
if (config.method?.toUpperCase() === 'GET' && params) {
|
||||
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)
|
||||
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)}&`
|
||||
}
|
||||
}
|
||||
}
|
||||
// 给 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
|
||||
},
|
||||
@@ -208,20 +199,6 @@ 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 {
|
||||
@@ -268,7 +245,7 @@ const handleAuthorized = () => {
|
||||
isRelogin.show = false
|
||||
// 干掉token后再走一次路由让它过router.beforeEach的校验
|
||||
// window.location.href = window.location.href
|
||||
window.location.href = `/crm/login?tenantId=${tenantId}&appId=${appId}`
|
||||
window.location.href = `/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 = 500
|
||||
can.width = 300
|
||||
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.05)'
|
||||
cans.fillStyle = 'rgba(0, 0, 0, 0.15)'
|
||||
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: 'NotifyMessage'
|
||||
name: 'MyNotifyMessage'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@ onMounted(() => {
|
||||
// 首次加载小红点
|
||||
getUnreadCount()
|
||||
// 轮询刷新小红点
|
||||
// msgInterval.value = setInterval(() => {
|
||||
// getUnreadCount()
|
||||
// }, 1000 * 60 * 2)
|
||||
msgInterval.value = setInterval(() => {
|
||||
getUnreadCount()
|
||||
}, 1000 * 60 * 2)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
|
||||
@@ -12,13 +12,6 @@ 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()
|
||||
@@ -205,7 +198,6 @@ 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"
|
||||
@@ -213,9 +205,7 @@ const clear = () => {
|
||||
<Icon color="#fff" icon="ep:setting" />
|
||||
</div>
|
||||
|
||||
<div @click="drawer = true">主题配置</div>
|
||||
|
||||
<ElDrawer v-model="drawer" :z-index="4000" append-to-body direction="rtl" size="350px">
|
||||
<ElDrawer v-model="drawer" :z-index="4000" direction="rtl" size="350px">
|
||||
<template #header>
|
||||
<span class="text-16px font-700">{{ t('setting.projectSetting') }}</span>
|
||||
</template>
|
||||
|
||||
@@ -124,6 +124,7 @@ const fixedMenuChange = (show: boolean) => {
|
||||
const setWater = () => {
|
||||
setWatermark(water.value)
|
||||
}
|
||||
setWater()
|
||||
|
||||
const layout = computed(() => appStore.getLayout)
|
||||
|
||||
|
||||
@@ -8,8 +8,6 @@ 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()
|
||||
@@ -60,10 +58,6 @@ 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(`/crm/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
next(`/login?tenantId=${tenantId}&appId=${appId}&redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
} else {
|
||||
next(`/crm/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import remainingRouter from './modules/remaining'
|
||||
|
||||
// 创建路由实例
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.VITE_BASE_PATH), // createWebHashHistory URL带#,createWebHistory URL不带#
|
||||
history: createWebHistory(), // 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/Profile/NotifyMessage.vue'),
|
||||
name: 'NotifyMessage',
|
||||
component: () => import('@/views/system/notify/my/index.vue'),
|
||||
name: 'MyNotifyMessage',
|
||||
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]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,7 @@
|
||||
/>
|
||||
<span>使用外呼</span>
|
||||
</template>
|
||||
<el-radio-group
|
||||
v-model="form.usePhoneConfig"
|
||||
:disabled="!getConfig('usePhoneConfig').modifiable"
|
||||
>
|
||||
<el-radio-group v-model="form.usePhoneConfig">
|
||||
<el-radio
|
||||
v-for="(item, index) in getConfig('usePhoneConfig').options"
|
||||
:key="index"
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="files" label="附件">
|
||||
<template #default="{ row }">
|
||||
<el-link type="primary" underline target="_blank" @click="handleDownload(row.files)">
|
||||
<el-link type="primary" underline :href="row.fileUrl" target="_blank">
|
||||
{{ row.files }}
|
||||
</el-link>
|
||||
</template>
|
||||
@@ -195,16 +195,6 @@ 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,14 +107,7 @@ const dataScopeOptions = [
|
||||
]
|
||||
|
||||
async function getRoleInfo(id) {
|
||||
try {
|
||||
formData.value = await RoleApi.getRole(id)
|
||||
nextTick(() => {
|
||||
treeRef.value.setCheckedKeys(formData.value.dataScopeDeptIds)
|
||||
})
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
formData.value = await RoleApi.getRole(id)
|
||||
}
|
||||
|
||||
/** 提交表单 */
|
||||
|
||||
@@ -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,7 +152,13 @@ const formRules = ref<any>({
|
||||
trigger: ['blur', 'change']
|
||||
}
|
||||
],
|
||||
mobile: [{ required: true, message: '手机号不能为空', trigger: 'blur' }]
|
||||
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'
|
||||
}
|
||||
]
|
||||
})
|
||||
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.value) return
|
||||
if (!formRef) 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.value) return
|
||||
if (!formRef) return
|
||||
const valid = await formRef.value.validate()
|
||||
if (!valid) return
|
||||
// 提交请求
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="成交日期"
|
||||
end-placeholder="成交日期"
|
||||
start-placeholder="登记日期"
|
||||
end-placeholder="登记日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -79,19 +79,9 @@
|
||||
<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="dealDate" label="登记时间" min-width="150px" />
|
||||
<el-table-column prop="applyUserName" label="申请人" min-width="90px" />
|
||||
<el-table-column
|
||||
prop="applyTime"
|
||||
label="申请时间"
|
||||
min-width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column prop="applyTime" label="申请时间" min-width="150px" />
|
||||
<el-table-column prop="stateName" label="审核状态" fixed="right" min-width="90px" />
|
||||
<el-table-column label="操作" width="150px" fixed="right">
|
||||
<template #default="{ row }">
|
||||
@@ -142,8 +132,6 @@ 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()
|
||||
|
||||
@@ -1,194 +0,0 @@
|
||||
<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>
|
||||
|
||||
@@ -44,8 +44,7 @@ const schema = [
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
label: '登记时间',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
@@ -76,7 +75,6 @@ const schema = [
|
||||
{
|
||||
field: 'applyTime',
|
||||
label: '申请时间',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
|
||||
@@ -40,8 +40,8 @@ const applySchema = [
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
label: '登记时间',
|
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
@@ -72,7 +72,7 @@ const applySchema = [
|
||||
{
|
||||
field: 'applyTime',
|
||||
label: '申请时间',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,244 +0,0 @@
|
||||
<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>
|
||||
@@ -1,140 +0,0 @@
|
||||
<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>
|
||||
@@ -44,8 +44,7 @@ const schema = [
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
label: '登记时间',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
@@ -66,7 +65,6 @@ const schema = [
|
||||
{
|
||||
field: 'applyTime',
|
||||
label: '申请时间',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
|
||||
@@ -40,8 +40,8 @@ const applySchema = [
|
||||
},
|
||||
{
|
||||
field: 'dealDate',
|
||||
label: '成交日期',
|
||||
dateFormat: 'YYYY-MM-DD',
|
||||
label: '登记时间',
|
||||
dateFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
span: 1
|
||||
},
|
||||
{
|
||||
|
||||
@@ -6,60 +6,13 @@
|
||||
</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-divider direction="horizontal" content-position="left">额外支出</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="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>
|
||||
@@ -93,38 +46,14 @@ 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 orderInfo = ref({})
|
||||
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 {
|
||||
@@ -138,9 +67,6 @@ function open(clueId, orderId) {
|
||||
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
|
||||
})
|
||||
@@ -157,15 +83,6 @@ 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,
|
||||
{
|
||||
@@ -184,14 +101,6 @@ function getFields() {
|
||||
|
||||
getOrderFieldList().then((data) => {
|
||||
const arr = useCrudSchemas(data).allSchemas.detailSchema
|
||||
arr.forEach((it) => {
|
||||
if (it.label.includes('日期')) {
|
||||
it.dateFormat = 'YYYY-MM-DD'
|
||||
}
|
||||
})
|
||||
if (arr.length % 2 != 0) {
|
||||
arr.push({})
|
||||
}
|
||||
orderSchema.value = [
|
||||
...arr,
|
||||
{
|
||||
|
||||
@@ -1,358 +0,0 @@
|
||||
<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>
|
||||
@@ -1,335 +0,0 @@
|
||||
<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>
|
||||
@@ -9,55 +9,89 @@
|
||||
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>
|
||||
<template v-if="appStore.getAppInfo?.instanceType == 1">
|
||||
<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>
|
||||
</template>
|
||||
<template v-else-if="appStore.getAppInfo?.instanceType == 2">
|
||||
<el-form-item>
|
||||
<el-select
|
||||
v-model="searchForm.signProduct"
|
||||
placeholder="选择成交产品"
|
||||
filterable
|
||||
@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
|
||||
: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>
|
||||
</template>
|
||||
</el-form>
|
||||
<Search
|
||||
v-if="!loading"
|
||||
@@ -79,33 +113,14 @@
|
||||
v-model:tableObject="tableObject"
|
||||
:tableColumns="allSchemas.tableColumns"
|
||||
@get-list="getTableList"
|
||||
@get-checked-columns="getCheckedColumns"
|
||||
>
|
||||
<el-table-column
|
||||
v-for="item in showColumns"
|
||||
v-for="item in allSchemas.tableColumns"
|
||||
: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
|
||||
@@ -132,22 +147,22 @@
|
||||
type="primary"
|
||||
class="mr-10px"
|
||||
link
|
||||
v-if="appStore.getAppInfo?.instanceType == 2"
|
||||
style="padding: 0; margin-left: 0"
|
||||
v-if="scope.row.isPayoff == '未结清'"
|
||||
v-hasPermi="['clue:order:return']"
|
||||
@click="feeBack(scope.row)"
|
||||
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:add-fee']"
|
||||
@click="handleAddFee(scope.row)"
|
||||
v-if="scope.row.isPayoff == false"
|
||||
v-hasPermi="['clue:order:return']"
|
||||
@click="feeBack(scope.row)"
|
||||
>
|
||||
添加支出
|
||||
回款
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@@ -167,7 +182,6 @@
|
||||
<DialogOrder ref="orderDetailDialog" />
|
||||
<DialogFeeback ref="feedbackDialog" />
|
||||
<DialogAfterSale ref="afterSaleDialog" />
|
||||
<DialogExtraFee ref="extraFeeDialog" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -176,25 +190,17 @@ 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 { getClassTypePage } from '@/api/school/class'
|
||||
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 { removeNullField } from '@/utils'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
|
||||
const userOptions = ref([])
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
getCurdSchemas()
|
||||
})
|
||||
getOptions()
|
||||
})
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
|
||||
const appStore = useAppStore()
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const allSchemas = ref({})
|
||||
@@ -203,6 +209,18 @@ const orderDetailDialog = ref()
|
||||
const searchRef = ref()
|
||||
const schoolOptions = ref([])
|
||||
const allPlaceOptions = 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({
|
||||
signSchool: undefined,
|
||||
@@ -216,7 +234,7 @@ const tableObject = ref({
|
||||
loading: false,
|
||||
total: 1,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
currentPage: 1
|
||||
})
|
||||
|
||||
const placeOptions = computed(() => {
|
||||
@@ -231,7 +249,7 @@ function resetQuery() {
|
||||
signProduct: undefined
|
||||
}
|
||||
searchRef.value.reset()
|
||||
tableObject.value.pageNo = 1
|
||||
tableObject.value.currentPage = 1
|
||||
getTableList()
|
||||
}
|
||||
// 查询
|
||||
@@ -243,7 +261,7 @@ async function getTableList() {
|
||||
const params = {
|
||||
...queryParams,
|
||||
...searchForm.value,
|
||||
pageNo: tableObject.value.pageNo,
|
||||
pageNo: tableObject.value.currentPage,
|
||||
pageSize: tableObject.value.pageSize
|
||||
}
|
||||
const data = await SignApi.getSignPage(removeNullField(params))
|
||||
@@ -273,13 +291,6 @@ async function getCurdSchemas() {
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
@@ -297,11 +308,6 @@ function feeBack(row) {
|
||||
feedbackDialog.value.open(row.signId)
|
||||
}
|
||||
|
||||
const extraFeeDialog = ref()
|
||||
function handleAddFee(row) {
|
||||
extraFeeDialog.value.open(row.signId)
|
||||
}
|
||||
|
||||
// 取消登记
|
||||
async function cancelDeal(row) {
|
||||
try {
|
||||
@@ -329,17 +335,33 @@ function changePlace() {
|
||||
|
||||
const classOptions = ref([])
|
||||
async function getClassTypeOptions() {
|
||||
const data = await getClassTypeList({ placeId: searchForm.value.signPlace, status: 0 })
|
||||
classOptions.value = data
|
||||
const data = await getClassTypePage({ placeId: searchForm.value.signPlace })
|
||||
classOptions.value = data.list
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
// 驾校
|
||||
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
||||
schoolOptions.value = data.schoolList
|
||||
allPlaceOptions.value = data.placeList
|
||||
})
|
||||
if (appStore.getAppInfo?.instanceType == 1) {
|
||||
// 驾校
|
||||
getPlaceList().then((data) => {
|
||||
schoolOptions.value = data.schoolList
|
||||
allPlaceOptions.value = data.placeList
|
||||
})
|
||||
} else {
|
||||
// 产品
|
||||
getSimpleProductList().then((data) => {
|
||||
prodOptions.value = data
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const userOptions = ref([])
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
getCurdSchemas()
|
||||
})
|
||||
getOptions()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -32,8 +32,8 @@
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="成交日期"
|
||||
end-placeholder="成交日期"
|
||||
start-placeholder="登记日期"
|
||||
end-placeholder="登记日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -77,19 +77,9 @@
|
||||
<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="dealDate" label="登记时间" min-width="150px" />
|
||||
<el-table-column prop="applyUserName" label="申请人" min-width="90" />
|
||||
<el-table-column
|
||||
prop="applyTime"
|
||||
label="申请时间"
|
||||
min-width="120px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column prop="applyTime" label="申请时间" min-width="150px" />
|
||||
<el-table-column prop="stateName" label="审核状态" fixed="right" min-width="90" />
|
||||
<el-table-column label="操作" width="150px" fixed="right">
|
||||
<template #default="{ row }">
|
||||
@@ -141,8 +131,6 @@ 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() // 消息弹窗
|
||||
|
||||
|
||||
@@ -1,353 +0,0 @@
|
||||
<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>
|
||||
@@ -1,16 +0,0 @@
|
||||
<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,10 +1,7 @@
|
||||
<template>
|
||||
<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>
|
||||
<OrderList v-if="tabName == 'list'" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="回款申请" name="commission">
|
||||
<Reback v-if="tabName == 'commission'" />
|
||||
@@ -13,10 +10,7 @@
|
||||
<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'" />
|
||||
<OrderList v-if="tabName == 'delivery'" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
@@ -24,12 +18,8 @@
|
||||
<script setup name="ClueOrder">
|
||||
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 appStore = useAppStore()
|
||||
const tabName = ref('list')
|
||||
|
||||
98
src/views/Clue/Order/order.data.js
Normal file
98
src/views/Clue/Order/order.data.js
Normal file
@@ -0,0 +1,98 @@
|
||||
// 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)
|
||||
@@ -1,269 +0,0 @@
|
||||
<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" @tab-change="changeTab">
|
||||
<el-tabs v-model="tabName">
|
||||
<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="跟进人" width="180px">
|
||||
<el-table-column label="跟进人">
|
||||
<template #default="{ row }">
|
||||
<el-select
|
||||
v-model="row.userId"
|
||||
@@ -24,27 +24,13 @@
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="nextFollowTime" label="下次跟进时间" width="180px">
|
||||
<el-table-column prop="followTime" label="下次跟进时间">
|
||||
<template #default="{ row }">
|
||||
<el-date-picker
|
||||
v-model="row.nextFollowTime"
|
||||
v-model="row.followTime"
|
||||
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>
|
||||
@@ -61,16 +47,19 @@
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane v-if="appStore.getAppInfo?.instanceType == 1" label="位置信息" name="map">
|
||||
<div class="flex justify-between items-center">
|
||||
<el-autocomplete
|
||||
<div class="flex justify-between">
|
||||
<el-select
|
||||
v-model="areaValue"
|
||||
filterable
|
||||
clearable
|
||||
style="width: 250px"
|
||||
placeholder="输入并搜索位置"
|
||||
:fetch-suggestions="remoteMethod"
|
||||
@select="currentSelect"
|
||||
remote
|
||||
style="width: 350px"
|
||||
reserve-keyword
|
||||
placeholder="请输入关键词"
|
||||
:remote-method="remoteMethod"
|
||||
@change="currentSelect"
|
||||
>
|
||||
<!-- <el-option
|
||||
<el-option
|
||||
v-for="item in areaList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
@@ -79,65 +68,36 @@
|
||||
>
|
||||
<span style="float: left">{{ item.name }}</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.district }}</span>
|
||||
</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-option>
|
||||
</el-select>
|
||||
<el-checkbox v-model="showSchool" :label="true" @change="handleShowSchool">
|
||||
展示场地
|
||||
</el-checkbox>
|
||||
</div>
|
||||
<div id="dialogMap" class="mt-20px" style="height: 400px; width: 100%"></div>
|
||||
<el-collapse v-model="collaspeKey" class="box-card">
|
||||
<el-collapse-item title="附近驾校" name="nearbySchool">
|
||||
<template #header>附近驾校</template>
|
||||
<div style="padding: 10px">
|
||||
<div v-if="nearbySchoolSearching">正在搜索中...</div>
|
||||
<template v-else>
|
||||
<div v-for="p in nearbySchoolList" :key="p.index">
|
||||
<div
|
||||
class="hover-pointer"
|
||||
style="font-size: 14px; color: blue"
|
||||
@click="getClassType(p)"
|
||||
>
|
||||
<i v-if="p.recommend" class="el-icon-star-off"></i>
|
||||
驾校: {{ p.deptName }}-{{ p.name }}
|
||||
</div>
|
||||
<div class="mt5">地址:{{ p.address }}</div>
|
||||
<div class="mt5">
|
||||
直线距离: {{ p.distance }} 公里;
|
||||
<span class="ml0">步行距离:{{ p.walkdistance }}</span>
|
||||
</div>
|
||||
<el-divider style="margin: 6px 0 !important" />
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
<div class="flex items-center mt-10px mb-10px">
|
||||
<div class="w-100px">线索位置:</div>
|
||||
<el-input v-model="address" placeholder="请输入线索位置" clearable />
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div style="position: absolute; top: 75px; right: 20px">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button>
|
||||
</div>
|
||||
<DialogSchoolInfo ref="schoolInfoDialog" />
|
||||
<template #footer>
|
||||
<span>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button :disabled="formLoading" type="primary" @click="handleSave">保 存</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</Dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogClue">
|
||||
import { useAppStore } from '@/store/modules/app'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { getPlaceList } from '@/api/school/place'
|
||||
import * as ClueApi from '@/api/clue'
|
||||
import { getDiyFieldList } from '@/api/clue/clueField'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
import AMapLoader from '@amap/amap-jsapi-loader'
|
||||
|
||||
import DialogSchoolInfo from './DialogSchoolInfo.vue'
|
||||
|
||||
import ImgPostion from '@/assets/imgs/flag/position_black.png'
|
||||
import ImgPostion from '@/assets/imgs/flag/flag_red.png'
|
||||
import FlagRed from '@/assets/imgs/flag/flag_red.png'
|
||||
import FlagYellow from '@/assets/imgs/flag/flag_yellow.png'
|
||||
import FlagPurple from '@/assets/imgs/flag/flag_purple.png'
|
||||
@@ -146,6 +106,7 @@ 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({
|
||||
@@ -158,14 +119,8 @@ const props = defineProps({
|
||||
})
|
||||
|
||||
const formSchema = computed(() => {
|
||||
const newSchema = [...props.schema]
|
||||
newSchema.forEach((it) => {
|
||||
if (it.field == 'consultTime') {
|
||||
it.componentProps['disabled-date'] = dateAfterToday
|
||||
}
|
||||
})
|
||||
return [
|
||||
...newSchema,
|
||||
...props.schema,
|
||||
{
|
||||
component: 'Input',
|
||||
label: '诉求',
|
||||
@@ -188,10 +143,6 @@ const formSchema = computed(() => {
|
||||
]
|
||||
})
|
||||
|
||||
const dateAfterToday = (t) => {
|
||||
return t.getTime() > Date.now()
|
||||
}
|
||||
|
||||
const dialogVisible = ref(false) // 弹窗的是否展示
|
||||
const dialogTitle = ref('') // 弹窗的标题
|
||||
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
@@ -211,6 +162,7 @@ const tabName = ref('info')
|
||||
const followList = ref([])
|
||||
|
||||
const areaValue = ref('')
|
||||
const areaList = ref([])
|
||||
const address = ref('')
|
||||
const defaultLatLng = ref({
|
||||
lat: 31.86119,
|
||||
@@ -232,70 +184,46 @@ 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, false)
|
||||
formRef.value.setValues(info.value)
|
||||
})
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
} else {
|
||||
followList.value = [
|
||||
{
|
||||
userId: useUserStore().getUser.id,
|
||||
content: undefined,
|
||||
nextFollowTime: formatDate(new Date()),
|
||||
editable: true
|
||||
}
|
||||
]
|
||||
followList.value = []
|
||||
address.value = ''
|
||||
defaultLatLng.value = {
|
||||
lat: 31.86119,
|
||||
lng: 117.283042
|
||||
}
|
||||
nextTick(() => {
|
||||
formRef.value.setValues(info.value, true)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function changeTab() {
|
||||
if (tabName.value == 'map') {
|
||||
if (!dialogMap.value) {
|
||||
nextTick(async () => {
|
||||
await getSchoolPlace()
|
||||
initMap(info.value)
|
||||
// remoteMethod(address.value)
|
||||
})
|
||||
}
|
||||
} else {
|
||||
destroyMap()
|
||||
if (appStore.getAppInfo?.instanceType == 1 && !dialogMap.value) {
|
||||
nextTick(() => {
|
||||
getSchoolPlace()
|
||||
initMap(info.value)
|
||||
remoteMethod(address.value)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
|
||||
function resetForm() {
|
||||
info.value = {
|
||||
address: undefined,
|
||||
lat: undefined,
|
||||
lng: undefined,
|
||||
consultTime: formatDate(new Date()),
|
||||
followUsers: [],
|
||||
diyParams: {}
|
||||
}
|
||||
info.value.address = undefined
|
||||
info.value.lat = undefined
|
||||
info.value.lng = undefined
|
||||
info.value.followUsers = []
|
||||
info.value.diyParams = {}
|
||||
}
|
||||
|
||||
const placeList = ref([])
|
||||
async function getSchoolPlace() {
|
||||
const data = await getPlaceList({ placeStatus: 0 })
|
||||
placeList.value = data.placeList
|
||||
function getSchoolPlace() {
|
||||
getPlaceList().then((data) => {
|
||||
placeList.value = data.placeList
|
||||
})
|
||||
}
|
||||
|
||||
const emit = defineEmits(['success'])
|
||||
@@ -305,18 +233,10 @@ 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 {
|
||||
@@ -334,11 +254,11 @@ async function handleSave() {
|
||||
}
|
||||
}
|
||||
if (formType.value === 'create') {
|
||||
const data = await ClueApi.createClue(params)
|
||||
message.success(data)
|
||||
await ClueApi.createClue(params)
|
||||
message.success(t('common.createSuccess'))
|
||||
} else {
|
||||
const data = await ClueApi.updateClue(params)
|
||||
message.success(data)
|
||||
await ClueApi.updateClue(params)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
dialogVisible.value = false
|
||||
// 发送操作成功的事件
|
||||
@@ -351,8 +271,7 @@ async function handleSave() {
|
||||
function handleAppendFollow() {
|
||||
followList.value.push({
|
||||
userId: undefined,
|
||||
content: undefined,
|
||||
nextFollowTime: formatDate(new Date()),
|
||||
followTime: formatDate(new Date()),
|
||||
editable: true
|
||||
})
|
||||
}
|
||||
@@ -368,7 +287,7 @@ let geoCoder = ref(null)
|
||||
|
||||
function initMap(data) {
|
||||
AMapLoader.load({
|
||||
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key
|
||||
key: '2ffb0e2ea90b1df0b8be48ed66e18fc8', //设置您的key
|
||||
version: '2.0',
|
||||
plugins: ['AMap.Geocoder', 'AMap.AutoComplete']
|
||||
}).then((AMap) => {
|
||||
@@ -380,13 +299,15 @@ function initMap(data) {
|
||||
}
|
||||
}
|
||||
dialogMap.value = new AMap.Map('dialogMap', {
|
||||
zoom: 14,
|
||||
zoom: 12,
|
||||
zooms: [2, 22],
|
||||
center: [defaultLatLng.value.lng, defaultLatLng.value.lat]
|
||||
})
|
||||
addmark(defaultLatLng.value.lng, defaultLatLng.value.lat, AMap)
|
||||
if (data.lng || data.lat) {
|
||||
addmark(data.lng, data.lat, AMap)
|
||||
}
|
||||
AutoComplete.value = new AMap.AutoComplete({
|
||||
city: '合肥'
|
||||
city: '全国'
|
||||
})
|
||||
geoCoder.value = new AMap.Geocoder()
|
||||
dialogMap.value.on('click', (e) => {
|
||||
@@ -400,74 +321,6 @@ 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) => {
|
||||
@@ -488,12 +341,10 @@ function addmark(lat, lng, AMap) {
|
||||
marker.value = new AMap.Marker({
|
||||
position: new AMap.LngLat(lat, lng),
|
||||
zoom: 13,
|
||||
icon: ImgPostion,
|
||||
offset: [-16, -32]
|
||||
icon: ImgPostion
|
||||
})
|
||||
dialogMap.value.add(marker.value)
|
||||
dialogMap.value.setCenter([lat, lng], true)
|
||||
getNearbySchool({ lat: lng, lng: lat })
|
||||
dialogMap.value.setCenter([lat, lng], '', 500)
|
||||
}
|
||||
function removeMarker() {
|
||||
dialogMap.value.remove(marker.value)
|
||||
@@ -525,7 +376,6 @@ function handleShowSchool() {
|
||||
extData: place,
|
||||
clickable: true
|
||||
})
|
||||
marker.on('click', (ev) => showSchoolInfo(ev.target.getExtData()))
|
||||
schoolMarkers.value.push(marker)
|
||||
}
|
||||
} else {
|
||||
@@ -533,43 +383,28 @@ function handleShowSchool() {
|
||||
}
|
||||
}
|
||||
|
||||
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 remoteMethod(searchValue) {
|
||||
if (searchValue !== '') {
|
||||
setTimeout(() => {
|
||||
AutoComplete.value?.search(searchValue, (status, result) => {
|
||||
if (result.tips?.length) {
|
||||
areaList.value = result?.tips
|
||||
}
|
||||
})
|
||||
}, 200)
|
||||
}
|
||||
}
|
||||
|
||||
function currentSelect(val) {
|
||||
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)
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
function destroyMap() {
|
||||
areaValue.value = undefined
|
||||
dialogMap.value = null
|
||||
aMap.value = null
|
||||
}
|
||||
|
||||
@@ -25,18 +25,6 @@
|
||||
/>
|
||||
</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">
|
||||
@@ -92,12 +80,9 @@
|
||||
<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('') // 弹窗的标题
|
||||
@@ -112,19 +97,18 @@ const rules = {
|
||||
content: { required: true, message: '跟进内容不可为空', trigger: 'blur' }
|
||||
}
|
||||
|
||||
const open = async (clueId, status) => {
|
||||
const open = async (clueId) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = '新增跟进记录'
|
||||
resetForm(clueId, status)
|
||||
resetForm(clueId)
|
||||
}
|
||||
|
||||
defineExpose({ open }) // 提供 open 方法,用于打开弹窗
|
||||
function resetForm(clueId, status) {
|
||||
function resetForm(clueId) {
|
||||
form.value = {
|
||||
clueId,
|
||||
operateTime: formatDate(new Date(), 'YYYY-MM-DD HH:mm'),
|
||||
operateTime: undefined,
|
||||
nextFollowTime: undefined,
|
||||
intentionState: status,
|
||||
content: undefined
|
||||
}
|
||||
}
|
||||
@@ -147,8 +131,6 @@ function getSkillList() {
|
||||
})
|
||||
}
|
||||
|
||||
const emit = defineEmits(['success'])
|
||||
|
||||
async function handleSave() {
|
||||
// 校验表单
|
||||
if (!formRef.value) return
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<template>
|
||||
<el-dialog width="800px" :title="title" v-model="show" append-to-body>
|
||||
<div v-dompurify-html="detail" class="mb-20px"></div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup name="DialogSchoolInfo">
|
||||
const title = ref('')
|
||||
const show = ref(false)
|
||||
const detail = ref('')
|
||||
|
||||
function open(info) {
|
||||
title.value = `【${info.schoolName}】详细信息`
|
||||
show.value = true
|
||||
detail.value = info.introduce || '该驾校暂未配置详细信息'
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<Dialog title="成交登记" v-model="show" width="900px">
|
||||
<Dialog title="成交登记" v-model="show" width="820px">
|
||||
<Descriptions
|
||||
:title="`线索信息-${info.name}`"
|
||||
:data="info"
|
||||
@@ -10,6 +10,31 @@
|
||||
/>
|
||||
<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">
|
||||
@@ -54,7 +79,6 @@
|
||||
:disabled="!form.signPlace"
|
||||
placeholder="选择班型"
|
||||
filterable
|
||||
@change="changeClass"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in classOptions"
|
||||
@@ -66,39 +90,6 @@
|
||||
</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"
|
||||
@@ -133,9 +124,7 @@
|
||||
</el-col>
|
||||
<!-- 进销存模式 -->
|
||||
<el-col :span="24" :offset="0" v-if="appStore.getAppInfo?.instanceType == 2">
|
||||
<el-divider direction="horizontal" content-position="left">
|
||||
成交产品<span v-if="prodTotalPrice">,应收:{{ prodTotalPrice }}</span>
|
||||
</el-divider>
|
||||
<el-divider direction="horizontal" content-position="left">成交产品</el-divider>
|
||||
<el-button
|
||||
class="mb-5px"
|
||||
type="primary"
|
||||
@@ -172,11 +161,6 @@
|
||||
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)"
|
||||
@@ -187,7 +171,6 @@
|
||||
</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
|
||||
@@ -216,25 +199,23 @@
|
||||
</el-table>
|
||||
</el-col>
|
||||
<el-col :span="24" :offset="0" class="mb-18px">
|
||||
<el-divider direction="horizontal" content-position="left">
|
||||
其他费用<span v-if="extraTotalPrice">,应收:{{ extraTotalPrice }}</span>
|
||||
</el-divider>
|
||||
<el-divider direction="horizontal" content-position="left">额外支出</el-divider>
|
||||
<el-button
|
||||
class="mb-5px"
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="form.extraPay.push({ extraPayType: undefined, extraPayMoney: 0 })"
|
||||
>
|
||||
添加其他费用
|
||||
添加额外支出
|
||||
</el-button>
|
||||
<el-table :data="form.extraPay" border size="small">
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column prop="extraPayType" label="费用类型" width="200px">
|
||||
<el-table-column prop="extraPayType" label="额外支出类型" width="200px">
|
||||
<template #default="{ row }">
|
||||
<el-select
|
||||
v-model="row.extraPayType"
|
||||
size="small"
|
||||
placeholder="其他费用类型"
|
||||
placeholder="额外支出类型"
|
||||
filterable
|
||||
>
|
||||
<el-option
|
||||
@@ -246,7 +227,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>
|
||||
@@ -266,13 +247,6 @@
|
||||
</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="备注">
|
||||
@@ -295,7 +269,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 { getClassTypeList } from '@/api/school/class'
|
||||
import { getClassTypePage } from '@/api/school/class'
|
||||
import { getSimpleProductList } from '@/api/mall/product'
|
||||
// import { getSimpleWarehouseList } from '@/api/mall/warehouse'
|
||||
import { formatDate } from '@/utils/formatTime'
|
||||
@@ -320,6 +294,7 @@ const info = ref({})
|
||||
const formLoading = ref(false)
|
||||
|
||||
const appStore = useAppStore()
|
||||
const { t } = useI18n() // 国际化
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
const props = defineProps({
|
||||
@@ -328,27 +303,7 @@ 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',
|
||||
@@ -362,10 +317,10 @@ const showSchema = computed(() => {
|
||||
span: 2
|
||||
}
|
||||
]
|
||||
return [...list, ...arr]
|
||||
return [...props.schema, ...arr]
|
||||
})
|
||||
|
||||
const extraPayOptions = getDictOptions('other_pay_type')
|
||||
const extraPayOptions = getDictOptions('extra_pay_type')
|
||||
|
||||
async function open(id) {
|
||||
try {
|
||||
@@ -386,13 +341,11 @@ function resetForm(id) {
|
||||
state: true,
|
||||
payAmount: 0,
|
||||
remark: undefined,
|
||||
isCompanyReceipts: appStore.getAppInfo?.instanceType == 1,
|
||||
extraPay: [],
|
||||
signProducts: []
|
||||
}
|
||||
}
|
||||
|
||||
const emit = defineEmits(['success'])
|
||||
const formRef = ref()
|
||||
async function handleSave() {
|
||||
// 校验表单
|
||||
@@ -401,11 +354,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.signProducts.some((it) => !it.productId || !it.specsId || !it.signNum)) {
|
||||
if (form.value.signProducts.some((it) => !it.productId || !item.specsId || !it.signNum)) {
|
||||
message.info('请将成交产品信息填写完整!')
|
||||
return
|
||||
}
|
||||
@@ -424,7 +377,7 @@ async function handleSave() {
|
||||
}
|
||||
}
|
||||
await createSign(params)
|
||||
message.success('登记成功!')
|
||||
message.success(t('common.createSuccess'))
|
||||
show.value = false
|
||||
// 发送操作成功的事件
|
||||
emit('success')
|
||||
@@ -457,14 +410,14 @@ const placeOptions = computed(() => {
|
||||
const classOptions = ref([])
|
||||
|
||||
async function getClassTypeOptions() {
|
||||
const data = await getClassTypeList({ placeId: form.value.signPlace, status: 0 })
|
||||
classOptions.value = data
|
||||
const data = await getClassTypePage({ placeId: form.value.signPlace })
|
||||
classOptions.value = data.list
|
||||
}
|
||||
|
||||
function getOptions() {
|
||||
if (appStore.getAppInfo?.instanceType == 1) {
|
||||
// 驾校
|
||||
getPlaceList({ placeStatus: 0, schoolStatus: 0, isSearchSchool: true }).then((data) => {
|
||||
getPlaceList().then((data) => {
|
||||
schoolOptions.value = data.schoolList
|
||||
allPlaceOptions.value = data.placeList
|
||||
})
|
||||
@@ -495,11 +448,6 @@ 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)
|
||||
}
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
<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"
|
||||
@@ -84,32 +83,6 @@
|
||||
展示场地
|
||||
</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">
|
||||
@@ -140,8 +113,7 @@
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<!-- 新建编辑跟进信息 -->
|
||||
<DialogFollow ref="followRef" @success="followSuccess" />
|
||||
<DialogSchoolInfo ref="schoolInfoDialog" />
|
||||
<DialogFollow ref="followRef" @success="getFollowList" />
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
@@ -152,11 +124,10 @@ 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, dateFormatter } from '@/utils/formatTime'
|
||||
|
||||
import ImgPostion from '@/assets/imgs/flag/position_black.png'
|
||||
import ImgPostion from '@/assets/imgs/flag/position_blue.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'
|
||||
@@ -179,16 +150,7 @@ const props = defineProps({
|
||||
})
|
||||
|
||||
const showSchema = computed(() => {
|
||||
const arr1 = [...props.schema]
|
||||
arr1.forEach((it) => {
|
||||
if (it.label.includes('日期')) {
|
||||
it.dateFormat = 'YYYY-MM-DD'
|
||||
}
|
||||
})
|
||||
if (arr1.length % 2 != 0) {
|
||||
arr1.push({})
|
||||
}
|
||||
const arr2 = [
|
||||
const arr = [
|
||||
{
|
||||
field: 'requirement',
|
||||
label: '诉求',
|
||||
@@ -201,7 +163,7 @@ const showSchema = computed(() => {
|
||||
isEditor: true
|
||||
}
|
||||
]
|
||||
return [...arr1, ...arr2]
|
||||
return [...props.schema, ...arr]
|
||||
})
|
||||
|
||||
const followList = ref([])
|
||||
@@ -252,8 +214,8 @@ async function open(id) {
|
||||
infoIndex.value = 'followRecord'
|
||||
|
||||
if (appStore.getAppInfo?.instanceType == 1 && !dialogMap.value) {
|
||||
nextTick(async () => {
|
||||
await getSchoolPlace()
|
||||
nextTick(() => {
|
||||
getSchoolPlace()
|
||||
initMap(info.value)
|
||||
})
|
||||
}
|
||||
@@ -262,18 +224,11 @@ async function open(id) {
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
function getSchoolPlace() {
|
||||
getPlaceList().then((data) => {
|
||||
placeList.value = data.placeList
|
||||
})
|
||||
}
|
||||
|
||||
const defaultLatLng = ref({
|
||||
@@ -283,7 +238,7 @@ const defaultLatLng = ref({
|
||||
|
||||
function initMap(data) {
|
||||
AMapLoader.load({
|
||||
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key
|
||||
key: '2ffb0e2ea90b1df0b8be48ed66e18fc8', //设置您的key
|
||||
version: '2.0'
|
||||
}).then((AMap) => {
|
||||
aMap.value = AMap
|
||||
@@ -294,7 +249,7 @@ function initMap(data) {
|
||||
}
|
||||
}
|
||||
dialogMap.value = new AMap.Map('dialogMap', {
|
||||
zoom: 14,
|
||||
zoom: 12,
|
||||
zooms: [2, 22],
|
||||
center: [defaultLatLng.value.lng, defaultLatLng.value.lat]
|
||||
})
|
||||
@@ -330,7 +285,6 @@ function handleShowSchool() {
|
||||
extData: place,
|
||||
clickable: true
|
||||
})
|
||||
marker.on('click', (ev) => showSchoolInfo(ev.target.getExtData()))
|
||||
schoolMarkers.value.push(marker)
|
||||
}
|
||||
} else {
|
||||
@@ -344,87 +298,11 @@ function addmark(lat, lng, AMap) {
|
||||
marker.value = new AMap.Marker({
|
||||
position: new AMap.LngLat(lat, lng),
|
||||
zoom: 13,
|
||||
icon: ImgPostion,
|
||||
offset: [-16, -32]
|
||||
icon: ImgPostion
|
||||
})
|
||||
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)
|
||||
}
|
||||
@@ -437,7 +315,7 @@ defineExpose({
|
||||
|
||||
const followRef = ref()
|
||||
function addFollow() {
|
||||
followRef.value.open(info.value.clueId, info.value.intentionState)
|
||||
followRef.value.open(info.value.clueId)
|
||||
}
|
||||
|
||||
function destroyMap() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="relative">
|
||||
<el-tabs v-model="queryType" size="small" @tab-change="quickChange">
|
||||
<el-tabs v-model="queryType" size="small" @tab-change="getTableList">
|
||||
<el-tab-pane label="全部" name="0" />
|
||||
<el-tab-pane name="1">
|
||||
<template #label>
|
||||
@@ -31,14 +31,6 @@
|
||||
</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>
|
||||
@@ -47,120 +39,111 @@
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<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"
|
||||
<!-- 搜索工作栏 -->
|
||||
<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"
|
||||
>
|
||||
<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>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200px" fixed="right">
|
||||
<template #default="scope">
|
||||
<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="handleDetail(scope.row)"
|
||||
v-hasPermi="['clue:pool:detail']"
|
||||
@click="handleEdit(scope.row)"
|
||||
v-hasPermi="['clue:pool:update']"
|
||||
>
|
||||
详情
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
:disabled="scope.row.state"
|
||||
@click="handleSuccess(scope.row)"
|
||||
v-hasPermi="['clue:pool:enroll']"
|
||||
>
|
||||
登记
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
v-hasPermi="['clue:pool:release']"
|
||||
@click="handleRelease(scope.row.clueId)"
|
||||
>
|
||||
释放
|
||||
</el-button>
|
||||
<template 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>
|
||||
</el-table-column>
|
||||
</SSTable>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-button
|
||||
type="primary"
|
||||
link
|
||||
v-hasPermi="['clue:pool:gain']"
|
||||
@click="handleGain(scope.row.clueId)"
|
||||
>
|
||||
获取
|
||||
</el-button>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</SSTable>
|
||||
|
||||
<DialogClue
|
||||
v-if="!loading"
|
||||
ref="formRef"
|
||||
:userOptions="userOptions"
|
||||
:schema="allSchemas.formSchema"
|
||||
@success="getTableList"
|
||||
@sucess="getTableList"
|
||||
/>
|
||||
<DrawerClue
|
||||
v-if="!loading"
|
||||
@@ -175,13 +158,11 @@
|
||||
</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'
|
||||
@@ -190,7 +171,6 @@ import { formatDate } from '@/utils/formatTime'
|
||||
import * as ClueApi from '@/api/clue'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const appStore = useAppStore()
|
||||
|
||||
const searchRef = ref()
|
||||
const queryType = ref('2')
|
||||
@@ -227,34 +207,20 @@ const tableObject = ref({
|
||||
loading: false,
|
||||
total: 1,
|
||||
pageSize: 20,
|
||||
pageNo: 1
|
||||
currentPage: 1
|
||||
})
|
||||
|
||||
const showColumns = ref([])
|
||||
|
||||
// 初始化表格
|
||||
function getCheckedColumns(list) {
|
||||
showColumns.value = list && list.length ? list : allSchemas.value.tableColumns
|
||||
}
|
||||
|
||||
const mapClue = ref()
|
||||
function quickChange(name) {
|
||||
try {
|
||||
if (name != '5') {
|
||||
resetQuery()
|
||||
mapClue.value && mapClue.value.destroyMap()
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
showColumns.value = list
|
||||
}
|
||||
|
||||
function resetQuery() {
|
||||
nextTick(() => {
|
||||
searchRef.value && searchRef.value.reset()
|
||||
tableObject.value.pageNo = 1
|
||||
getTableList()
|
||||
})
|
||||
searchRef.value.reset()
|
||||
tableObject.value.currentPage = 1
|
||||
getTableList()
|
||||
}
|
||||
|
||||
async function getTableList() {
|
||||
@@ -265,7 +231,7 @@ async function getTableList() {
|
||||
const queryParams = await searchRef.value.getFormModel()
|
||||
const params = {
|
||||
...queryParams,
|
||||
pageNo: tableObject.value.pageNo,
|
||||
pageNo: tableObject.value.currentPage,
|
||||
pageSize: tableObject.value.pageSize,
|
||||
queryType: queryType.value
|
||||
}
|
||||
@@ -302,7 +268,7 @@ function handleDetail(row) {
|
||||
}
|
||||
|
||||
function handleFollow(row) {
|
||||
followRef.value.open(row.clueId, row.intentionState)
|
||||
followRef.value.open(row.clueId)
|
||||
}
|
||||
|
||||
async function makeCall(phone) {
|
||||
@@ -351,7 +317,6 @@ function handleGain(id) {
|
||||
}
|
||||
|
||||
const userOptions = ref([])
|
||||
|
||||
onMounted(() => {
|
||||
getUserOption().then((data) => {
|
||||
userOptions.value = data
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
>
|
||||
<el-option
|
||||
v-for="item in resourceOptions"
|
||||
:key="item.sourceId"
|
||||
:label="item.sourceName"
|
||||
:value="item.sourceId"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<span>{{ row.channel }}</span>
|
||||
@@ -36,23 +36,21 @@
|
||||
</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 :disabled="formLoading" type="primary" @click="onSubmit">保存</el-button>
|
||||
<el-button type="primary" @click="onSubmit">保存</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="ClueSet">
|
||||
import { getClueGainRuleList, deleteClueGainRule, saveClueGainRule } from '@/api/clue/clueGetSet'
|
||||
import { getSimpleSourceList as getResourceOptions } from '@/api/clue/source'
|
||||
import { listToTree } from '@/utils/tree.ts'
|
||||
import { getClueGainRuleList, deleteClueGainRule } from '@/api/clue/clueGetSet'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
const { t } = useI18n() // 国际化
|
||||
@@ -61,12 +59,6 @@ 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 {
|
||||
@@ -81,20 +73,8 @@ function handleInsert() {
|
||||
list.value.push({ source: '', url: '', edit: true, status: 0 })
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
function onSubmit() {
|
||||
console.log('保存成功')
|
||||
}
|
||||
|
||||
async function handleRemove(idx) {
|
||||
@@ -121,7 +101,6 @@ function handleChange(row) {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getOptions()
|
||||
getList()
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
>
|
||||
全选
|
||||
</el-checkbox>
|
||||
<!-- 得根据自动获得的线索做配置 -->
|
||||
<el-checkbox-group v-model="form.resource" @change="resourceCheckedChange">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in resourceOptions"
|
||||
@@ -64,7 +63,7 @@
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="权重配置">
|
||||
<el-input v-model="form.weight" type="number" placeholder="请输入权重">
|
||||
<el-input v-model="form.value" type="number" placeholder="请输入权重">
|
||||
<template #suffix> % </template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
@@ -79,7 +78,6 @@
|
||||
|
||||
<script setup name="ClueSend">
|
||||
import { getUserPage } from '@/api/system/user'
|
||||
import { getClueDistributeRuleByUser } from '@/api/clue/clueGetSet'
|
||||
|
||||
// const message = useMessage() // 消息弹窗
|
||||
// const { t } = useI18n() // 国际化
|
||||
@@ -104,7 +102,7 @@ const form = ref({
|
||||
isAuto: 1,
|
||||
users: [1, 2],
|
||||
resource: [3],
|
||||
weight: undefined
|
||||
sendTime: '00:00'
|
||||
})
|
||||
const rules = ref({})
|
||||
|
||||
@@ -147,9 +145,7 @@ function resourceCheckedChange(val) {
|
||||
|
||||
function handleRowClick(row) {
|
||||
currentRowId.value = row.id
|
||||
getClueDistributeRuleByUser({ employeeId: row.id }).then((data) => {
|
||||
form.value = data
|
||||
})
|
||||
form.value = { ...row }
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
<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" fixed="right">
|
||||
<el-table-column label="操作" width="80px">
|
||||
<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" fixed="right">
|
||||
<el-table-column label="操作" width="80px">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" text style="padding: 0" @click="remove(row.clueParamId)"
|
||||
>删除</el-button
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="getConfig('deliveryAutoStartPurchaseConfig') && props.appType == 2">
|
||||
<el-form-item v-if="getConfig('deliveryAutoStartPurchaseConfig')">
|
||||
<template #label>
|
||||
<Tooltip
|
||||
v-if="getConfig('deliveryAutoStartPurchaseConfig').remark"
|
||||
:message="getConfig('deliveryAutoStartPurchaseConfig').remark"
|
||||
/>
|
||||
<span>允许负库存</span>
|
||||
<span>发货自动发起采购</span>
|
||||
</template>
|
||||
<el-radio-group v-model="form.deliveryAutoStartPurchaseConfig">
|
||||
<el-radio
|
||||
@@ -66,13 +66,6 @@ import * as ConfigApi from '@/api/system/set'
|
||||
|
||||
const message = useMessage()
|
||||
|
||||
const props = defineProps({
|
||||
appType: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
})
|
||||
|
||||
const form = ref({})
|
||||
|
||||
const configList = ref([])
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
<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>
|
||||
@@ -10,7 +10,7 @@
|
||||
<el-tab-pane label="线索来源" :name="15" v-if="checkPermi(['clue:setting:clue-resource'])">
|
||||
<ClueSource v-if="tabIndex == 15" />
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane
|
||||
<el-tab-pane
|
||||
label="线索获取规则"
|
||||
:name="20"
|
||||
v-if="checkPermi(['clue:setting:clue-get-rules'])"
|
||||
@@ -23,18 +23,15 @@
|
||||
v-if="checkPermi(['clue:setting:clue-send-rules'])"
|
||||
>
|
||||
<ClueSend v-if="tabIndex == 30" />
|
||||
</el-tab-pane> -->
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="意向状态" :name="35" v-if="checkPermi(['clue:setting:intention-status'])">
|
||||
<IntentionStatus v-if="tabIndex == 35" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="额外支出项" :name="36" v-if="checkPermi(['clue:setting:extra-fee'])">
|
||||
<ExtraFeeType v-if="tabIndex == 36" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="其他费用项" :name="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" :appType="appStore.getAppInfo?.instanceType" />
|
||||
<GeneralSet v-if="tabIndex == 40" />
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane label="消息通知" :name="50" v-if="checkPermi(['mall:setting:prod'])">
|
||||
<MsgSend v-if="tabIndex == 50" />
|
||||
@@ -47,19 +44,14 @@
|
||||
import FieldClue from './Comp/FieldClue.vue'
|
||||
import FieldOrder from './Comp/FieldOrder.vue'
|
||||
import ClueSource from './Comp/ClueSource.vue'
|
||||
// import ClueGet from './Comp/ClueGet.vue'
|
||||
// import ClueSend from './Comp/ClueSend.vue'
|
||||
import ClueGet from './Comp/ClueGet.vue'
|
||||
import ClueSend from './Comp/ClueSend.vue'
|
||||
// import MsgSend from './Comp/MsgSend.vue'
|
||||
import IntentionStatus from './Comp/IntentionStatus.vue'
|
||||
import ExtraFeeType from './Comp/ExtraFeeType.vue'
|
||||
import 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>
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<CountTo
|
||||
class="text-20px number-font"
|
||||
:start-val="0"
|
||||
:end-val="clueInfo.todayFollowingNum"
|
||||
:end-val="10"
|
||||
:duration="2600"
|
||||
/>
|
||||
</div>
|
||||
@@ -28,7 +28,7 @@
|
||||
<CountTo
|
||||
class="text-20px number-font"
|
||||
:start-val="0"
|
||||
:end-val="clueInfo.todayFollowedNum"
|
||||
:end-val="25"
|
||||
:duration="2600"
|
||||
/>
|
||||
</div>
|
||||
@@ -38,7 +38,7 @@
|
||||
<CountTo
|
||||
class="text-20px number-font"
|
||||
:start-val="0"
|
||||
:end-val="clueInfo.todaySignedNum"
|
||||
:end-val="2"
|
||||
:duration="2600"
|
||||
/>
|
||||
</div>
|
||||
@@ -48,7 +48,7 @@
|
||||
<CountTo
|
||||
class="text-20px number-font"
|
||||
:start-val="0"
|
||||
:end-val="clueInfo.outFollowNum"
|
||||
:end-val="235"
|
||||
:duration="2600"
|
||||
/>
|
||||
</div>
|
||||
@@ -58,7 +58,7 @@
|
||||
<CountTo
|
||||
class="text-20px number-font"
|
||||
:start-val="0"
|
||||
:end-val="clueInfo.unknownNum"
|
||||
:end-val="0"
|
||||
:duration="2600"
|
||||
/>
|
||||
</div>
|
||||
@@ -67,61 +67,8 @@
|
||||
</el-row>
|
||||
</el-skeleton>
|
||||
</el-card>
|
||||
<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-row class="mt-10px" :gutter="10" justify="space-between">
|
||||
<!-- <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 ">
|
||||
@@ -133,6 +80,65 @@
|
||||
</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">
|
||||
@@ -140,8 +146,7 @@ import { set } from 'lodash-es'
|
||||
import { EChartsOption } from 'echarts'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import avatarImg from '@/assets/imgs/avatar.gif'
|
||||
import { lineOptions } from './echarts-data'
|
||||
import * as HomeApi from '@/api/home/index'
|
||||
import { pieOptions, lineOptions } from './echarts-data'
|
||||
|
||||
const { t } = useI18n()
|
||||
const userStore = useUserStore()
|
||||
@@ -149,46 +154,59 @@ const loading = ref(false)
|
||||
const avatar = userStore.getUser.avatar ? userStore.getUser.avatar : avatarImg
|
||||
const username = userStore.getUser.nickname
|
||||
|
||||
const followDate = ref(1)
|
||||
const followDate = ref('day')
|
||||
|
||||
// 成交线索来源
|
||||
// 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 = await HomeApi.getClueSignSignRate()
|
||||
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' }
|
||||
]
|
||||
set(
|
||||
lineOptionsData,
|
||||
'xAxis.data',
|
||||
data.map((v) => t(v.month))
|
||||
data.map((v) => t(v.name))
|
||||
)
|
||||
set(lineOptionsData, 'series', [
|
||||
{
|
||||
name: '个人成交率',
|
||||
smooth: true,
|
||||
type: 'line',
|
||||
data: data.map((v) => v.personalRate),
|
||||
data: data.map((v) => v.estimate),
|
||||
animationDuration: 2800,
|
||||
animationEasing: 'cubicInOut'
|
||||
},
|
||||
@@ -197,50 +215,33 @@ const getMonthlySaleRate = async () => {
|
||||
smooth: true,
|
||||
type: 'line',
|
||||
itemStyle: {},
|
||||
data: data.map((v) => v.avgRate),
|
||||
data: data.map((v) => v.actual),
|
||||
animationDuration: 2800,
|
||||
animationEasing: 'quadraticOut'
|
||||
}
|
||||
])
|
||||
}
|
||||
|
||||
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 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 getAllApi = async () => {
|
||||
await Promise.all([getClueInfo(), getSignList(), getMonthlySaleRate(), getFollowList()])
|
||||
await Promise.all([getSaleClueSource(), getMonthlySaleRate()])
|
||||
loading.value = false
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getAllApi()
|
||||
})
|
||||
getAllApi()
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -42,7 +42,25 @@ export const lineOptions: EChartsOption = {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
series: []
|
||||
series: [
|
||||
{
|
||||
name: '成交率',
|
||||
smooth: true,
|
||||
type: 'line',
|
||||
data: [100, 120, 161, 134, 105, 160, 165, 114, 163, 185, 118, 123],
|
||||
animationDuration: 2800,
|
||||
animationEasing: 'cubicInOut'
|
||||
},
|
||||
{
|
||||
name: t('analysis.actual'),
|
||||
smooth: true,
|
||||
type: 'line',
|
||||
itemStyle: {},
|
||||
data: [120, 82, 91, 154, 162, 140, 145, 250, 134, 56, 99, 123],
|
||||
animationDuration: 2800,
|
||||
animationEasing: 'quadraticOut'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export const pieOptions: EChartsOption = {
|
||||
|
||||
@@ -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 } from './components'
|
||||
import { LoginForm, MobileForm, QrCodeForm } from './components'
|
||||
|
||||
import soups from './components/soup.js'
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
mode="pop"
|
||||
@success="handleLogin"
|
||||
/>
|
||||
<el-col v-if="showOtherLogin" :span="24" style="padding-left: 10px; padding-right: 10px">
|
||||
<el-col :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,7 +131,6 @@ const verify = ref()
|
||||
const captchaType = ref('blockPuzzle') // blockPuzzle 滑块 clickWord 点击文字
|
||||
|
||||
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN)
|
||||
const showOtherLogin = false
|
||||
|
||||
const LoginRules = {
|
||||
username: [required],
|
||||
@@ -144,8 +143,8 @@ const loginData = reactive({
|
||||
loginForm: {
|
||||
tenantId: undefined,
|
||||
instanceId: undefined,
|
||||
username: '',
|
||||
password: '',
|
||||
username: 'admin',
|
||||
password: 'admin123',
|
||||
captchaVerification: '',
|
||||
rememberMe: true
|
||||
}
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
<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"
|
||||
@@ -49,10 +43,6 @@
|
||||
/>
|
||||
</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>
|
||||
@@ -63,26 +53,17 @@
|
||||
<el-table-column type="index" width="50px" />
|
||||
<el-table-column prop="productName" label="产品名称" />
|
||||
<el-table-column prop="specsName" label="规格" />
|
||||
<el-table-column label="变动类型" width="90px">
|
||||
<el-table-column label="变动类型">
|
||||
<template #default="{ row }">
|
||||
{{ ['', '入库', '出库'][row.changeType] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="num" label="变动数量" width="90px" />
|
||||
<el-table-column prop="batchNo" label="批次号" />
|
||||
<el-table-column prop="num" label="数量" />
|
||||
<el-table-column prop="money" 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="备注">
|
||||
<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-column prop="remark" label="备注" />
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
@@ -97,14 +78,11 @@
|
||||
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
|
||||
})
|
||||
@@ -124,8 +102,6 @@ function resetQuery() {
|
||||
productId: undefined,
|
||||
specsId: undefined,
|
||||
warehouseId: undefined,
|
||||
changeType: undefined,
|
||||
batchNo: undefined,
|
||||
pageNo: 1,
|
||||
pageSize: 20
|
||||
}
|
||||
@@ -157,7 +133,7 @@ function changeProd(val) {
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const data = await getInventoryRecord(removeNullField(searchForm.value))
|
||||
const data = await getInventoryRecord(searchForm.value)
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
|
||||
@@ -30,27 +30,13 @@
|
||||
width="180px"
|
||||
:formatter="dateFormatter"
|
||||
/>
|
||||
<el-table-column label="操作" width="150px">
|
||||
<el-table-column label="操作">
|
||||
<template #default="scope">
|
||||
<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 type="primary" text @click="openForm('update', scope.row)">修改</el-button>
|
||||
<el-button type="primary" text @click="openForm('createChildren', scope.row)">
|
||||
新增
|
||||
</el-button>
|
||||
<el-button type="danger" style="padding: 0px" text @click="handleDelete(scope.row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button type="danger" 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" fixed="right">
|
||||
<el-table-column label="操作" width="80px">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" text style="padding: 0" @click="remove(row.clueParamId)"
|
||||
>删除</el-button
|
||||
|
||||
@@ -387,16 +387,14 @@ function onSubmit() {
|
||||
const element = diyFieldList.value[i]
|
||||
data.diyParams[element.field] = data[element.field]
|
||||
}
|
||||
const id = route.query.id || form.value.productId
|
||||
const id = route.query.id
|
||||
if (!id) {
|
||||
const resp = await ProductApi.createProduct(data)
|
||||
await ProductApi.createProduct(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
form.value.productId = resp
|
||||
} else {
|
||||
await ProductApi.updateProduct(data)
|
||||
message.success(t('common.updateSuccess'))
|
||||
}
|
||||
getDetail()
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
@@ -463,11 +461,10 @@ const formLoading = ref(false)
|
||||
|
||||
/** 获得详情 */
|
||||
const getDetail = async () => {
|
||||
const id = route.query?.id || form.value.productId
|
||||
if (id) {
|
||||
if (route.query?.id) {
|
||||
formLoading.value = true
|
||||
try {
|
||||
const res = await ProductApi.getProduct(id)
|
||||
const res = await ProductApi.getProduct(route.query.id)
|
||||
let diyField = {}
|
||||
if (res.diyParams) {
|
||||
diyField = isObject(res.diyParams) ? res.diyParams : JSON.parse(res.diyParams)
|
||||
@@ -488,8 +485,8 @@ const getDetail = async () => {
|
||||
productCategory: undefined,
|
||||
productBrand: undefined,
|
||||
productIntro: undefined,
|
||||
mainImage: '',
|
||||
carouselImages: [],
|
||||
mainImage: 'https://ss-cloud.ahduima.com/1001/1796426117251600384.png',
|
||||
carouselImages: ['https://ss-cloud.ahduima.com/1001/1796426117251600384.png'],
|
||||
productSpecList: [],
|
||||
skuList: [],
|
||||
detailInfo: null,
|
||||
|
||||
@@ -42,13 +42,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12" :offset="0">
|
||||
<el-form-item label="采购数量" prop="num">
|
||||
<el-input-number
|
||||
:min="1"
|
||||
v-model="form.num"
|
||||
:controls="false"
|
||||
placeholder="请输入"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<el-input-number :min="1" v-model="form.num" placeholder="请输入" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -57,7 +51,6 @@
|
||||
<el-form-item label="采购单价" prop="unitPrice">
|
||||
<el-input-number
|
||||
:min="0"
|
||||
:controls="false"
|
||||
v-model="form.unitPrice"
|
||||
placeholder="请输入"
|
||||
style="width: 100%"
|
||||
|
||||
@@ -125,7 +125,7 @@ const crudSchemas = reactive([
|
||||
label: '备注',
|
||||
field: 'remark',
|
||||
isSearch: false,
|
||||
isTable: false
|
||||
isTable: true
|
||||
}
|
||||
])
|
||||
export const { allSchemas } = useCrudSchemas(crudSchemas)
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
<template>
|
||||
<div> 站内信 </div>
|
||||
</template>
|
||||
|
||||
<script setup name="NotifyMessage"></script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
@@ -61,8 +61,6 @@ const bindSocial = () => {
|
||||
})
|
||||
}
|
||||
const bind = (row) => {
|
||||
message.info('暂未开放,敬请期待')
|
||||
return
|
||||
const redirectUri = location.origin + '/user/profile?type=' + row.type
|
||||
// 进行跳转
|
||||
socialAuthRedirect(row.type, encodeURIComponent(redirectUri)).then((res) => {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
:options="props.schoolOption"
|
||||
v-model="formData.schPlace"
|
||||
filterable
|
||||
:props="{ value: 'value' }"
|
||||
:props="{ value: 'id' }"
|
||||
show-all-levels
|
||||
style="width: 100%"
|
||||
/>
|
||||
@@ -60,14 +60,14 @@
|
||||
<el-tab-pane label="报价信息" name="price">
|
||||
<el-button type="primary" @click="handleAddPrice" class="mb-10px">新增报价</el-button>
|
||||
<el-table :data="formData.quotations">
|
||||
<el-table-column>
|
||||
<el-table-column width="160px">
|
||||
<template #header> <Tooltip message="市场价,给客户的报价" />指导价 </template>
|
||||
<template #default="{ row }">
|
||||
<el-input v-if="row.edit" v-model="row.guidingPrice" type="number" :min="0" />
|
||||
<span v-else>{{ row.guidingPrice }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column width="160px">
|
||||
<el-table-column width="160px">
|
||||
<template #header> <Tooltip message="员工底价,用于核算毛利及提成" />底价 </template>
|
||||
<template #default="{ row }">
|
||||
<el-input v-if="row.edit" v-model="row.minPrice" type="number" :min="0" />
|
||||
@@ -80,7 +80,7 @@
|
||||
<el-input v-if="row.edit" v-model="row.costPrice" type="number" :min="0" />
|
||||
<span v-else>{{ row.costPrice }}</span>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table-column>
|
||||
<el-table-column label="生效日期">
|
||||
<template #default="{ row }">
|
||||
<el-date-picker
|
||||
@@ -108,171 +108,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="公司利润" name="profitCompany">
|
||||
<el-form
|
||||
:model="profitCompanyForm"
|
||||
ref="profitCompanyRef"
|
||||
:rules="profitCompanyRules"
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="利润模式:">
|
||||
<el-radio-group v-model="profitCompanyForm.profitMode">
|
||||
<el-radio :label="1">比例模式</el-radio>
|
||||
<el-radio :label="2">固定模式</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="计算规则:">
|
||||
<div class="flex items-center" v-if="profitCompanyForm.profitMode == 1">
|
||||
<span>公司利润 = ( 成交价 </span>
|
||||
<el-select
|
||||
v-model="profitCompanyForm.profitRule.mark"
|
||||
size="small"
|
||||
placeholder="加/减"
|
||||
class="ml-10px mr-10px"
|
||||
style="width: 70px"
|
||||
>
|
||||
<el-option label="+" value="+" />
|
||||
<el-option label="-" value="-" />
|
||||
</el-select>
|
||||
<el-input-number
|
||||
v-model="profitCompanyForm.profitRule.minPrice"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
style="width: 80px"
|
||||
:controls="false"
|
||||
/>
|
||||
<span class="ml-10px mr-10px"> ) 乘以 </span>
|
||||
<el-input-number
|
||||
v-model="profitCompanyForm.profitRule.rate"
|
||||
size="small"
|
||||
placeholder="比例"
|
||||
:min="0"
|
||||
:max="1"
|
||||
:controls="false"
|
||||
/>
|
||||
</div>
|
||||
<div v-else-if="profitCompanyForm.profitMode == 2">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="profitCompanyForm.dangwei.push({ signPrice: undefined, profit: undefined })"
|
||||
>添加利润档位</el-button
|
||||
>
|
||||
<div
|
||||
class="flex items-center"
|
||||
v-for="(item, index) in profitCompanyForm.dangwei"
|
||||
:key="index"
|
||||
>
|
||||
<span>成交额满</span>
|
||||
<el-input-number
|
||||
v-model="item.signPrice"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
class="ml-10px mr-10px"
|
||||
style="width: 80px"
|
||||
:controls="false"
|
||||
/>
|
||||
<span>,公司利润为</span>
|
||||
<el-input-number
|
||||
v-model="item.profit"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
class="ml-10px"
|
||||
style="width: 80px"
|
||||
:controls="false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="员工利润" name="profitEmployee">
|
||||
<el-form
|
||||
:model="profitEmployeeForm"
|
||||
ref="profitEmployeeRef"
|
||||
:rules="profitEmployeeRules"
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="利润模式:">
|
||||
<el-radio-group v-model="profitEmployeeForm.profitMode">
|
||||
<el-radio :label="1">比例模式</el-radio>
|
||||
<el-radio :label="2">固定模式</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="计算规则:">
|
||||
<div class="flex items-center" v-if="profitEmployeeForm.profitMode == 1">
|
||||
<span>公司利润 = ( 成交价 </span>
|
||||
<el-select
|
||||
v-model="profitEmployeeForm.profitRule.mark"
|
||||
size="small"
|
||||
placeholder="加/减"
|
||||
class="ml-10px mr-10px"
|
||||
style="width: 70px"
|
||||
>
|
||||
<el-option label="+" :value="1" />
|
||||
<el-option label="-" :value="2" />
|
||||
</el-select>
|
||||
<el-input-number
|
||||
v-model="profitEmployeeForm.profitRule.minPrice"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
style="width: 80px"
|
||||
:controls="false"
|
||||
/>
|
||||
<span class="ml-10px mr-10px"> ) 乘以 </span>
|
||||
<el-input-number
|
||||
v-model="profitEmployeeForm.profitRule.rate"
|
||||
size="small"
|
||||
placeholder="比例"
|
||||
:min="0"
|
||||
:max="1"
|
||||
:controls="false"
|
||||
/>
|
||||
</div>
|
||||
<div v-else-if="profitEmployeeForm.profitMode == 2">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
@click="
|
||||
profitEmployeeForm.dangwei.push({ signPrice: undefined, profit: undefined })
|
||||
"
|
||||
>添加利润档位</el-button
|
||||
>
|
||||
<div
|
||||
class="flex items-center"
|
||||
v-for="(item, index) in profitEmployeeForm.dangwei"
|
||||
:key="index"
|
||||
>
|
||||
<span>成交额满</span>
|
||||
<el-input-number
|
||||
v-model="item.signPrice"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
class="ml-10px mr-10px"
|
||||
style="width: 80px"
|
||||
:controls="false"
|
||||
/>
|
||||
<span>,公司利润为</span>
|
||||
<el-input-number
|
||||
v-model="item.profit"
|
||||
size="small"
|
||||
placeholder="金额"
|
||||
:min="0"
|
||||
class="ml-10px"
|
||||
style="width: 80px"
|
||||
:controls="false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane v-if="false" label="提成结算" name="comission">
|
||||
<el-tab-pane label="提成结算" name="comission">
|
||||
<el-button v-if="!comissionShow" type="primary" @click="handleAddComission">
|
||||
新增提成结算规则
|
||||
</el-button>
|
||||
@@ -450,22 +286,6 @@ const formRules = reactive({
|
||||
const formRef = ref() // 表单 Ref
|
||||
const currentTab = ref('base')
|
||||
|
||||
const profitCompanyForm = ref({
|
||||
profitMode: 1,
|
||||
dangwei: [],
|
||||
profitRule: {}
|
||||
})
|
||||
const profitCompanyRules = {}
|
||||
const profitCompanyRef = ref()
|
||||
|
||||
const profitEmployeeForm = ref({
|
||||
profitMode: 1,
|
||||
dangwei: [],
|
||||
profitRule: {}
|
||||
})
|
||||
const profitEmployeeRules = {}
|
||||
const profitEmployeeRef = ref()
|
||||
|
||||
const opts = ref({
|
||||
percentage_param1: [],
|
||||
percentage_param2: [],
|
||||
@@ -478,7 +298,6 @@ const open = async (type, id) => {
|
||||
dialogVisible.value = true
|
||||
dialogTitle.value = type == 'create' ? '新增班型' : '修改班型'
|
||||
formType.value = type
|
||||
currentTab.value = 'base'
|
||||
resetForm()
|
||||
if (!opts.value.length) {
|
||||
const arr = await ClassApi.getCommissionParams()
|
||||
@@ -492,37 +311,6 @@ const open = async (type, id) => {
|
||||
try {
|
||||
formData.value = await ClassApi.getClassType(id)
|
||||
formData.value.schPlace = [formData.value.schoolId, formData.value.placeId]
|
||||
if (!formData.value.companyProfitVO) {
|
||||
profitCompanyForm.value = {
|
||||
profitMode: 1,
|
||||
dangwei: [],
|
||||
profitRule: {}
|
||||
}
|
||||
} else if (formData.value.companyProfitVO.profitMode == 1) {
|
||||
profitCompanyForm.value = { ...formData.value.companyProfitVO, dangwei: [] }
|
||||
} else {
|
||||
profitCompanyForm.value = {
|
||||
...formData.value.companyProfitVO,
|
||||
dangwei: formData.value.companyProfitVO.profitRule
|
||||
}
|
||||
profitCompanyForm.value.profitRule = {}
|
||||
}
|
||||
|
||||
if (!formData.value.personProfitVO) {
|
||||
profitEmployeeForm.value = {
|
||||
profitMode: 1,
|
||||
dangwei: [],
|
||||
profitRule: {}
|
||||
}
|
||||
} else if (formData.value.personProfitVO.profitMode == 1) {
|
||||
profitEmployeeForm.value = { ...formData.value.personProfitVO, dangwei: [] }
|
||||
} else {
|
||||
profitEmployeeForm.value = {
|
||||
...formData.value.personProfitVO,
|
||||
dangwei: formData.value.personProfitVO.profitRule
|
||||
}
|
||||
profitEmployeeForm.value.profitRule = {}
|
||||
}
|
||||
} finally {
|
||||
formLoading.value = false
|
||||
}
|
||||
@@ -551,15 +339,17 @@ function handleAddPrice() {
|
||||
formData.value.quotations.push({
|
||||
edit: true,
|
||||
guidingPrice: undefined,
|
||||
// minPrice: undefined,
|
||||
// costPrice: undefined,
|
||||
minPrice: undefined,
|
||||
costPrice: undefined,
|
||||
validTime: undefined,
|
||||
quotationTime: formatDate(new Date(), 'YYYY-MM-DD')
|
||||
})
|
||||
}
|
||||
|
||||
function handleDeletePrice(row, index) {
|
||||
formData.value.quotations.splice(index, 1)
|
||||
if (row.edit) {
|
||||
formData.value.quotations.splice(index, 1)
|
||||
}
|
||||
message.success('删除成功')
|
||||
}
|
||||
|
||||
@@ -611,51 +401,6 @@ async function submitForm() {
|
||||
delete data.schPlace
|
||||
delete data.percentages
|
||||
data.percentages = { ...comissionForm.value }
|
||||
data.companyProfitVO = { ...profitCompanyForm.value }
|
||||
data.personProfitVO = { ...profitEmployeeForm.value }
|
||||
if (data.companyProfitVO.profitMode == 1) {
|
||||
data.companyProfitVO.profitRule.minPrice = data.companyProfitVO.profitRule.minPrice || 0
|
||||
if (!data.companyProfitVO.profitRule.mark || !data.companyProfitVO.profitRule.rate) {
|
||||
message.info('请将公司利润计算规则填写完整!')
|
||||
return
|
||||
}
|
||||
} else {
|
||||
data.companyProfitVO.profitRule = data.companyProfitVO?.dangwei || []
|
||||
delete data.companyProfitVO.dangwei
|
||||
if (data.companyProfitVO.profitRule.length == 0) {
|
||||
message.info('请添加公司利润计算规则!')
|
||||
return
|
||||
} else if (
|
||||
data.companyProfitVO.profitRule.some(
|
||||
(it) => it.signPrice == undefined || it.profit == undefined
|
||||
)
|
||||
) {
|
||||
message.info('请将公司利润计算规则填写完整!')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if (data.personProfitVO.profitMode == 1) {
|
||||
data.personProfitVO.profitRule.minPrice = data.personProfitVO.profitRule.minPrice || 0
|
||||
if (!data.personProfitVO.profitRule.mark || !data.personProfitVO.profitRule.rate) {
|
||||
message.info('请将员工利润计算规则填写完整!')
|
||||
return
|
||||
}
|
||||
} else {
|
||||
data.personProfitVO.profitRule = data.personProfitVO?.dangwei || []
|
||||
delete data.personProfitVO.dangwei
|
||||
if (data.personProfitVO.profitRule.length == 0) {
|
||||
message.info('请添加员工利润计算规则!')
|
||||
return
|
||||
} else if (
|
||||
data.personProfitVO.profitRule.some(
|
||||
(it) => it.signPrice == undefined || it.profit == undefined
|
||||
)
|
||||
) {
|
||||
message.info('请将员工利润计算规则填写完整!')
|
||||
return
|
||||
}
|
||||
}
|
||||
if (formType.value === 'create') {
|
||||
await ClassApi.createClassType(data)
|
||||
message.success(t('common.createSuccess'))
|
||||
|
||||
@@ -2,16 +2,21 @@
|
||||
<div>
|
||||
<el-form :model="searchForm" ref="searchRef" inline label-width="0">
|
||||
<el-form-item>
|
||||
<el-cascader
|
||||
:options="schoolOption"
|
||||
v-model="searchForm.schPlace"
|
||||
<el-input
|
||||
v-model="searchForm.schoolName"
|
||||
placeholder="请输入驾校名称"
|
||||
clearable
|
||||
filterable
|
||||
show-all-levels
|
||||
style="width: 300px"
|
||||
placeholder="选择驾校/场地"
|
||||
:props="{ expandTrigger: 'hover', multiple: false, checkStrictly: true }"
|
||||
@change="handleQuery"
|
||||
style="width: 180px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input
|
||||
v-model="searchForm.placeName"
|
||||
placeholder="请输入场地名称"
|
||||
clearable
|
||||
style="width: 180px"
|
||||
@keyup.enter="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
@@ -51,7 +56,7 @@
|
||||
>
|
||||
<el-button
|
||||
type="danger"
|
||||
@click="handleBatchDelete([])"
|
||||
@click="handleBatchDelete"
|
||||
v-hasPermi="['school:class:batch-delete']"
|
||||
>批量删除</el-button
|
||||
>
|
||||
@@ -64,73 +69,85 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table
|
||||
:data="tableList"
|
||||
v-loading="loading"
|
||||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="50" />
|
||||
<el-table-column type="index" label="序号" width="60" />
|
||||
<el-table-column
|
||||
v-for="col in columns"
|
||||
:prop="col.props"
|
||||
:key="col.props"
|
||||
:label="col.label"
|
||||
:width="col.width"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="备注" width="260">
|
||||
<template #default="{ row }">
|
||||
<!-- <div v-dompurify-html="row.remark"></div> -->
|
||||
<el-popover placement="top" width="500px" trigger="click">
|
||||
<template #reference>
|
||||
<el-button type="primary" style="padding: 0" text>点击查看</el-button>
|
||||
</template>
|
||||
<div v-dompurify-html="row.remark"></div>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="80">
|
||||
<template #default="{ row }">
|
||||
<el-switch
|
||||
v-model="row.status"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
:disabled="!checkPermi(['school:class:update'])"
|
||||
@change="handleChangeStatus(row)"
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6" :offset="0">
|
||||
<div class="head-container" style="max-height: 700px; overflow-y: auto">
|
||||
<el-tree
|
||||
ref="tree"
|
||||
:data="schoolOption"
|
||||
accordion
|
||||
node-key="id"
|
||||
highlight-current
|
||||
:default-expanded-keys="selectNodes.map((item) => item.id)"
|
||||
@node-click="handleNodeClick"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120px">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
type="primary"
|
||||
style="padding: 0"
|
||||
text
|
||||
v-hasPermi="['school:class:update']"
|
||||
@click="handleOpenDialog('update', row.typeId)"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
style="padding: 0"
|
||||
text
|
||||
v-hasPermi="['school:class:delete']"
|
||||
@click="handleRemove(row.typeId)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="18" :offset="0">
|
||||
<el-table
|
||||
:data="tableList"
|
||||
v-loading="loading"
|
||||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="50" />
|
||||
<el-table-column type="index" label="序号" width="60" />
|
||||
<el-table-column
|
||||
v-for="col in columns"
|
||||
:prop="col.props"
|
||||
:key="col.props"
|
||||
:label="col.label"
|
||||
:width="col.width"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="备注" width="260">
|
||||
<template #default="{ row }">
|
||||
<div v-dompurify-html="row.remark"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="80">
|
||||
<template #default="{ row }">
|
||||
<el-switch
|
||||
v-model="row.status"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
:disabled="!checkPermi(['school:class:update'])"
|
||||
@change="handleChangeStatus(row)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120px">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
type="primary"
|
||||
style="padding: 0"
|
||||
text
|
||||
v-hasPermi="['school:class:update']"
|
||||
@click="handleOpenDialog('update', row.typeId)"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
type="danger"
|
||||
style="padding: 0"
|
||||
text
|
||||
v-hasPermi="['school:class:delete']"
|
||||
@click="handleRemove(row.typeId)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNo"
|
||||
:total="total"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<Dialog title="批量修改" v-model="batchStatusDialogShow" width="400px">
|
||||
<el-form :model="statusForm" ref="statusRef" label-width="80px">
|
||||
<el-form-item label="选择状态" prop="status">
|
||||
@@ -160,7 +177,6 @@ import DialogClass from './Comp/DialogClass.vue'
|
||||
import { checkPermi } from '@/utils/permission'
|
||||
|
||||
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
|
||||
import { removeNullField } from '@/utils'
|
||||
|
||||
const message = useMessage() // 消息弹窗
|
||||
|
||||
@@ -170,7 +186,8 @@ const total = ref(0)
|
||||
const tableList = ref([])
|
||||
|
||||
const searchForm = ref({
|
||||
schPlace: undefined,
|
||||
schoolName: undefined,
|
||||
placeName: undefined,
|
||||
typeName: undefined,
|
||||
licenseType: undefined,
|
||||
pageNo: 1,
|
||||
@@ -178,34 +195,48 @@ const searchForm = ref({
|
||||
})
|
||||
|
||||
const schoolOption = ref([])
|
||||
// const selectNodes = ref([])
|
||||
const selectNodes = ref([])
|
||||
|
||||
async function getSchoolList() {
|
||||
try {
|
||||
const data = await PlaceApi.getPlaceList({
|
||||
placeStatus: 0,
|
||||
schoolStatus: 0,
|
||||
isSearchSchool: true
|
||||
})
|
||||
const data = await PlaceApi.getPlaceList()
|
||||
schoolOption.value = data.schoolList.map((item) => ({
|
||||
value: item.schoolId,
|
||||
id: item.schoolId,
|
||||
label: item.schoolName,
|
||||
level: 1,
|
||||
children: data.placeList
|
||||
.filter((place) => item.schoolId === place.schoolId)
|
||||
.map((place) => ({
|
||||
value: place.placeId,
|
||||
label: place.name
|
||||
id: place.placeId,
|
||||
label: place.name,
|
||||
level: 2
|
||||
}))
|
||||
}))
|
||||
} catch {}
|
||||
}
|
||||
|
||||
function handleNodeClick(data, node) {
|
||||
if (data.level === 1) {
|
||||
selectNodes.value = [{ id: data.id, name: data.label }]
|
||||
searchForm.value.schoolName = data.label
|
||||
} else {
|
||||
selectNodes.value = [
|
||||
{ id: node.parent.data.id, name: node.parent.data.label },
|
||||
{ id: data.id, name: data.label }
|
||||
]
|
||||
searchForm.value.schoolName = node.parent.data.label
|
||||
searchForm.value.placeName = data.label
|
||||
}
|
||||
handleQuery()
|
||||
}
|
||||
|
||||
const columns = [
|
||||
{ props: 'schoolName', label: '驾校', width: '100px' },
|
||||
{ props: 'placeName', label: '场地' },
|
||||
{ props: 'typeName', label: '班型名称' },
|
||||
{ props: 'licenseType', label: '驾照类型', width: '100px' },
|
||||
{ props: 'guidingPrice', label: '最新报价', width: '100px' }
|
||||
{ props: 'guidingPrice', label: '最新报价', width: '100px' },
|
||||
{ props: 'minPrice', label: '最新底价', width: '100px' }
|
||||
// { props: 'remark', label: '备注', width: '100px' }
|
||||
]
|
||||
|
||||
@@ -217,15 +248,7 @@ function handleQuery() {
|
||||
async function getList() {
|
||||
loading.value = true
|
||||
try {
|
||||
const params = { ...searchForm.value }
|
||||
if (params.schPlace && params.schPlace.length) {
|
||||
params.schoolId = params.schPlace[0]
|
||||
if (params.schPlace.length == 2) {
|
||||
params.placeId = params.schPlace[1]
|
||||
}
|
||||
}
|
||||
delete params.schPlace
|
||||
const data = await ClassApi.getClassTypePage(removeNullField(params))
|
||||
const data = await ClassApi.getClassTypePage(searchForm.value)
|
||||
tableList.value = data.list
|
||||
total.value = data.total
|
||||
} finally {
|
||||
@@ -240,7 +263,8 @@ function handleOpenDialog(type, id = null) {
|
||||
|
||||
function handleReset() {
|
||||
searchForm.value = {
|
||||
schPlace: undefined,
|
||||
schoolName: undefined,
|
||||
placeName: undefined,
|
||||
typeName: undefined,
|
||||
licenseType: undefined,
|
||||
pageNo: 1,
|
||||
@@ -250,7 +274,7 @@ function handleReset() {
|
||||
}
|
||||
|
||||
async function handleBatchDelete(arr = []) {
|
||||
if (!arr.length && !selectRows.value.length) {
|
||||
if (!arr.length || !selectRows.value.length) {
|
||||
message.info('请选择表格行!')
|
||||
return
|
||||
}
|
||||
@@ -279,17 +303,11 @@ async function handleChangeStatus(row) {
|
||||
// 删除的二次确认
|
||||
await message.confirm('是否确认修改状态')
|
||||
// 发起删除
|
||||
await ClassApi.updateClassTypeStatus({
|
||||
typeId: row.typeId,
|
||||
status: row.status
|
||||
})
|
||||
await ClassApi.updateClassTypeStatus(row.typeId, row.status)
|
||||
message.success('修改成功')
|
||||
// 刷新列表
|
||||
await getList()
|
||||
} catch {
|
||||
// 取消后,进行恢复按钮
|
||||
row.status = row.status === 1 ? 0 : 1
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
|
||||
const batchStatusDialogShow = ref(false)
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="描述" name="desc">
|
||||
<Editor v-model:modelValue="placeForm.introduce" />
|
||||
<Editor v-model:modelValue="placeForm.remark" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="flex items-center justify-center mt-10px">
|
||||
@@ -190,10 +190,8 @@
|
||||
<el-table-column label="启用" width="100">
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
:disabled="!checkPermi(['school:place:update'])"
|
||||
v-model="scope.row.showInMap"
|
||||
:disabled="checkPermi(['school:place:update'])"
|
||||
@change="changePlaceStatus(scope.row)"
|
||||
/>
|
||||
</template>
|
||||
@@ -268,7 +266,7 @@ const placeTab = ref('info')
|
||||
|
||||
function initMap() {
|
||||
AMapLoader.load({
|
||||
key: '713d839ff505943b0f18e6df45f3b0dc', //设置您的key
|
||||
key: '2ffb0e2ea90b1df0b8be48ed66e18fc8', //设置您的key
|
||||
version: '2.0',
|
||||
plugins: ['AMap.Geocoder']
|
||||
}).then((AMap) => {
|
||||
@@ -325,10 +323,7 @@ function regeoCode() {
|
||||
async function getPageData() {
|
||||
schoolList.value = []
|
||||
tableData.value = []
|
||||
const data = await PlaceApi.getPlaceList({
|
||||
schoolStatus: 0,
|
||||
isSearchSchool: true
|
||||
})
|
||||
const data = await PlaceApi.getPlaceList()
|
||||
if (data.schoolList) {
|
||||
schoolList.value = data.schoolList.map((item) => ({ ...item, showInMap: true }))
|
||||
}
|
||||
@@ -366,7 +361,7 @@ function handleClickSchool(item) {
|
||||
function createMarkersInMap() {
|
||||
for (let i = 0; i < tableData.value.length; i++) {
|
||||
const element = tableData.value[i]
|
||||
if (!element.schoolShow || !element.showInMap || element.status == 1) {
|
||||
if (!element.schoolShow || !element.showInMap) {
|
||||
continue
|
||||
}
|
||||
const markerIcon = flagMap[element.flagColor || 'red']
|
||||
@@ -394,7 +389,7 @@ function handleInsertPlace(schoolId) {
|
||||
lng: undefined,
|
||||
name: undefined,
|
||||
address: undefined,
|
||||
introduce: undefined,
|
||||
remark: undefined,
|
||||
phone: undefined,
|
||||
schoolId: schoolId,
|
||||
showInMap: true,
|
||||
@@ -536,22 +531,11 @@ function closePlaceList() {
|
||||
fullScreenPlaceList.value = false
|
||||
}
|
||||
|
||||
async function changePlaceStatus(row) {
|
||||
try {
|
||||
// 修改状态的二次确认
|
||||
const text = row.status == 0 ? '启用' : '停用'
|
||||
await message.confirm('确认要"' + text + '""' + row.name + '"场地吗?')
|
||||
// 发起修改状态
|
||||
await PlaceApi.updatePlaceStatus(row.placeId, row.status)
|
||||
message.success('修改成功')
|
||||
// 刷新列表
|
||||
// await getPageData()
|
||||
tableData.value.find((item) => item.placeId == row.placeId).status = row.status
|
||||
resetMarkers()
|
||||
} catch {
|
||||
// 取消后,进行恢复按钮
|
||||
row.status = row.status == 0 ? 1 : 0
|
||||
}
|
||||
async function changePlaceStatus() {
|
||||
// const resp = await updatePlace(item);
|
||||
// if (resp.code == 200) {
|
||||
resetMarkers()
|
||||
// }
|
||||
}
|
||||
|
||||
// const isRanging = ref(false)
|
||||
@@ -560,7 +544,7 @@ const placeForm = ref({
|
||||
lng: undefined,
|
||||
name: undefined,
|
||||
address: undefined,
|
||||
introduce: undefined,
|
||||
remark: undefined,
|
||||
phone: undefined,
|
||||
flagColor: 'red'
|
||||
})
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user