diff --git a/.env.base b/.env.base
index fdb26d85..cf433822 100644
--- a/.env.base
+++ b/.env.base
@@ -4,10 +4,10 @@ NODE_ENV=development
VITE_DEV=true
# 请求路径
-VITE_BASE_URL='http://localhost:48080'
+VITE_BASE_URL='http://127.0.0.1:48080'
# 上传路径
-VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload'
+VITE_UPLOAD_URL='http://127.0.0.1:48080/admin-api/infra/file/upload'
# 接口前缀
VITE_API_BASEPATH=/dev-api
diff --git a/src/api/crm/contact/index.ts b/src/api/crm/contact/index.ts
index 6ac5a01d..e980d361 100644
--- a/src/api/crm/contact/index.ts
+++ b/src/api/crm/contact/index.ts
@@ -1,7 +1,7 @@
/*
* @Author: zyna
* @Date: 2023-11-05 13:34:41
- * @LastEditTime: 2023-11-11 16:20:19
+ * @LastEditTime: 2023-11-26 20:47:04
* @FilePath: \yudao-ui-admin-vue3\src\api\crm\contact\index.ts
* @Description:
*/
@@ -22,13 +22,15 @@ export interface ContactVO {
id: number
parentId: number
qq: number
- webchat: string
+ wechat: string
sex: number
- policyMakers: boolean
+ master: boolean
creatorName: string
updateTime?: Date
createTime?: Date
- customerName: string
+ customerName: string,
+ areaName: string,
+ ownerUserName: string
}
// 查询crm联系人列表
@@ -60,6 +62,6 @@ export const deleteContact = async (id: number) => {
export const exportContact = async (params) => {
return await request.download({ url: `/crm/contact/export-excel`, params })
}
-export const simpleAlllist = async () => {
- return await request.get({ url: `/crm/contact/simpleAlllist` })
+export const simpleAllList = async () => {
+ return await request.get({ url: `/crm/contact/simple-all-list` })
}
diff --git a/src/api/crm/customer/index.ts b/src/api/crm/customer/index.ts
index 59260cbc..30d8981a 100644
--- a/src/api/crm/customer/index.ts
+++ b/src/api/crm/customer/index.ts
@@ -62,3 +62,7 @@ export const deleteCustomer = async (id: number) => {
export const exportCustomer = async (params) => {
return await request.download({ url: `/crm/customer/export-excel`, params })
}
+//客户列表
+export const queryAllList = async () => {
+ return await request.get({ url: `/crm/customer/query-all-list` })
+}
\ No newline at end of file
diff --git a/src/api/crm/permission/index.ts b/src/api/crm/permission/index.ts
index 1292f29a..79f69451 100644
--- a/src/api/crm/permission/index.ts
+++ b/src/api/crm/permission/index.ts
@@ -6,9 +6,9 @@ export interface PermissionVO {
bizType: number | undefined // Crm 类型
bizId: number | undefined // Crm 类型数据编号
level: number | undefined // 权限级别
- deptName?: string // 部门名称 // 岗位名称数组 TODO @puhui999:数组?
+ deptName?: string // 部门名称
nickname?: string // 用户昵称
- postNames?: string // 岗位名称数组 TODO @puhui999:数组?
+ postNames?: string[] // 岗位名称数组
createTime?: Date
}
@@ -19,7 +19,7 @@ export const getPermissionList = async (params) => {
// 新增团队成员
export const createPermission = async (data: PermissionVO) => {
- return await request.post({ url: `/crm/permission/add`, data })
+ return await request.post({ url: `/crm/permission/create`, data })
}
// 修改团队成员权限级别
diff --git a/src/api/mall/promotion/coupon/couponTemplate.ts b/src/api/mall/promotion/coupon/couponTemplate.ts
index 243e22ee..50ae226c 100755
--- a/src/api/mall/promotion/coupon/couponTemplate.ts
+++ b/src/api/mall/promotion/coupon/couponTemplate.ts
@@ -73,6 +73,13 @@ export function getCouponTemplatePage(params: PageParam) {
})
}
+// 获得优惠劵模板分页
+export function getCouponTemplateList(ids: number[]) {
+ return request.get({
+ url: `/promotion/coupon-template/list?ids=${ids}`
+ })
+}
+
// 导出优惠劵模板 Excel
export function exportCouponTemplateExcel(params: PageParam) {
return request.get({
diff --git a/src/api/mp/user/index.ts b/src/api/mp/user/index.ts
index d954e9eb..b89acc7d 100644
--- a/src/api/mp/user/index.ts
+++ b/src/api/mp/user/index.ts
@@ -26,6 +26,6 @@ export const getUserPage = (query) => {
// 同步公众号粉丝
export const syncUser = (accountId) => {
return request.post({
- url: '/mp/tag/sync?accountId=' + accountId
+ url: '/mp/user/sync?accountId=' + accountId
})
}
diff --git a/src/api/system/notice/index.ts b/src/api/system/notice/index.ts
index 62bf5259..f6434697 100644
--- a/src/api/system/notice/index.ts
+++ b/src/api/system/notice/index.ts
@@ -35,3 +35,8 @@ export const updateNotice = (data: NoticeVO) => {
export const deleteNotice = (id: number) => {
return request.delete({ url: '/system/notice/delete?id=' + id })
}
+
+// 推送公告
+export const pushNotice = (id: number) => {
+ return request.post({ url: '/system/notice/push?id=' + id })
+}
diff --git a/src/components/DiyEditor/components/mobile/CouponCard/component.tsx b/src/components/DiyEditor/components/mobile/CouponCard/component.tsx
new file mode 100644
index 00000000..1542cad6
--- /dev/null
+++ b/src/components/DiyEditor/components/mobile/CouponCard/component.tsx
@@ -0,0 +1,78 @@
+import * as CouponTemplateApi from '@/api/mall/promotion/coupon/couponTemplate'
+import { CouponTemplateValidityTypeEnum, PromotionDiscountTypeEnum } from '@/utils/constants'
+import { floatToFixed2 } from '@/utils'
+import { formatDate } from '@/utils/formatTime'
+
+// 优惠值
+export const CouponDiscount = defineComponent({
+ name: 'CouponDiscount',
+ props: {
+ coupon: {
+ type: CouponTemplateApi.CouponTemplateVO
+ }
+ },
+ setup(props) {
+ const coupon = props.coupon as CouponTemplateApi.CouponTemplateVO
+ // 折扣
+ let value = coupon.discountPercent + ''
+ let suffix = ' 折'
+ // 满减
+ if (coupon.discountType === PromotionDiscountTypeEnum.PRICE.type) {
+ value = floatToFixed2(coupon.discountPrice)
+ suffix = ' 元'
+ }
+ return () => (
+
+ {value}
+ {suffix}
+
+ )
+ }
+})
+
+// 优惠描述
+export const CouponDiscountDesc = defineComponent({
+ name: 'CouponDiscountDesc',
+ props: {
+ coupon: {
+ type: CouponTemplateApi.CouponTemplateVO
+ }
+ },
+ setup(props) {
+ const coupon = props.coupon as CouponTemplateApi.CouponTemplateVO
+ // 使用条件
+ const useCondition = coupon.usePrice > 0 ? `满${floatToFixed2(coupon.usePrice)}元,` : ''
+ // 优惠描述
+ const discountDesc =
+ coupon.discountType === PromotionDiscountTypeEnum.PRICE.type
+ ? `减${floatToFixed2(coupon.discountPrice)}元`
+ : `打${coupon.discountPercent}折`
+ return () => (
+
+ {useCondition}
+ {discountDesc}
+
+ )
+ }
+})
+
+// 有效期
+export const CouponValidTerm = defineComponent({
+ name: 'CouponValidTerm',
+ props: {
+ coupon: {
+ type: CouponTemplateApi.CouponTemplateVO
+ }
+ },
+ setup(props) {
+ const coupon = props.coupon as CouponTemplateApi.CouponTemplateVO
+ const text =
+ coupon.validityType === CouponTemplateValidityTypeEnum.DATE.type
+ ? `有效期:${formatDate(coupon.validStartTime, 'YYYY-MM-DD')} 至 ${formatDate(
+ coupon.validEndTime,
+ 'YYYY-MM-DD'
+ )}`
+ : `领取后第 ${coupon.fixedStartTerm} - ${coupon.fixedEndTerm} 天内可用`
+ return () => {text}
+ }
+})
diff --git a/src/components/DiyEditor/components/mobile/CouponCard/config.ts b/src/components/DiyEditor/components/mobile/CouponCard/config.ts
new file mode 100644
index 00000000..304533d1
--- /dev/null
+++ b/src/components/DiyEditor/components/mobile/CouponCard/config.ts
@@ -0,0 +1,47 @@
+import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util'
+
+/** 商品卡片属性 */
+export interface CouponCardProperty {
+ // 列数
+ columns: number
+ // 背景图
+ bgImg: string
+ // 文字颜色
+ textColor: string
+ // 按钮样式
+ button: {
+ // 颜色
+ color: string
+ // 背景颜色
+ bgColor: string
+ }
+ // 间距
+ space: number
+ // 优惠券编号列表
+ couponIds: number[]
+ // 组件样式
+ style: ComponentStyle
+}
+
+// 定义组件
+export const component = {
+ id: 'CouponCard',
+ name: '优惠券',
+ icon: 'ep:ticket',
+ property: {
+ columns: 1,
+ bgImg: '',
+ textColor: '#E9B461',
+ button: {
+ color: '#434343',
+ bgColor: ''
+ },
+ space: 0,
+ couponIds: [],
+ style: {
+ bgType: 'color',
+ bgColor: '',
+ marginBottom: 8
+ } as ComponentStyle
+ }
+} as DiyComponent
diff --git a/src/components/DiyEditor/components/mobile/CouponCard/index.vue b/src/components/DiyEditor/components/mobile/CouponCard/index.vue
new file mode 100644
index 00000000..3e2302af
--- /dev/null
+++ b/src/components/DiyEditor/components/mobile/CouponCard/index.vue
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+
+
+
{{ coupon.name }}
+
+
+
+
+
+
+
+
{{ coupon.name }}
+
+ 立即领取
+
+
+
+
+
+
+
+
diff --git a/src/components/DiyEditor/components/mobile/CouponCard/property.vue b/src/components/DiyEditor/components/mobile/CouponCard/property.vue
new file mode 100644
index 00000000..4f32c21e
--- /dev/null
+++ b/src/components/DiyEditor/components/mobile/CouponCard/property.vue
@@ -0,0 +1,104 @@
+
+
+
+
+
+ {{ coupon.name }}
+
+ 满{{ floatToFixed2(coupon.usePrice) }}元,
+
+ 减{{ floatToFixed2(coupon.discountPrice) }}元
+
+ 打{{ coupon.discountPercent }}折
+
+
+
+
+ 添加
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/DiyEditor/components/mobile/ProductCard/config.ts b/src/components/DiyEditor/components/mobile/ProductCard/config.ts
index 49dd30d0..735b6ba0 100644
--- a/src/components/DiyEditor/components/mobile/ProductCard/config.ts
+++ b/src/components/DiyEditor/components/mobile/ProductCard/config.ts
@@ -62,7 +62,7 @@ export interface ProductCardFieldProperty {
export const component = {
id: 'ProductCard',
name: '商品卡片',
- icon: 'system-uicons:carousel',
+ icon: 'fluent:text-column-two-left-24-filled',
property: {
layoutType: 'oneColBigImg',
fields: {
diff --git a/src/components/DiyEditor/components/mobile/ProductList/config.ts b/src/components/DiyEditor/components/mobile/ProductList/config.ts
new file mode 100644
index 00000000..436de405
--- /dev/null
+++ b/src/components/DiyEditor/components/mobile/ProductList/config.ts
@@ -0,0 +1,64 @@
+import { ComponentStyle, DiyComponent } from '@/components/DiyEditor/util'
+
+/** 商品卡片属性 */
+export interface ProductListProperty {
+ // 布局类型:双列 | 三列 | 水平滑动
+ layoutType: 'twoCol' | 'threeCol' | 'horizSwiper'
+ // 商品字段
+ fields: {
+ // 商品名称
+ name: ProductListFieldProperty
+ // 商品价格
+ price: ProductListFieldProperty
+ }
+ // 角标
+ badge: {
+ // 是否显示
+ show: boolean
+ // 角标图片
+ imgUrl: string
+ }
+ // 上圆角
+ borderRadiusTop: number
+ // 下圆角
+ borderRadiusBottom: number
+ // 间距
+ space: number
+ // 商品编号列表
+ spuIds: number[]
+ // 组件样式
+ style: ComponentStyle
+}
+// 商品字段
+export interface ProductListFieldProperty {
+ // 是否显示
+ show: boolean
+ // 颜色
+ color: string
+}
+
+// 定义组件
+export const component = {
+ id: 'ProductList',
+ name: '商品栏',
+ icon: 'fluent:text-column-two-24-filled',
+ property: {
+ layoutType: 'twoCol',
+ fields: {
+ name: { show: true, color: '#000' },
+ price: { show: true, color: '#ff3000' }
+ },
+ badge: { show: false, imgUrl: '' },
+ borderRadiusTop: 8,
+ borderRadiusBottom: 8,
+ space: 8,
+ spuIds: [],
+ style: {
+ bgType: 'color',
+ bgColor: '',
+ marginLeft: 8,
+ marginRight: 8,
+ marginBottom: 8
+ } as ComponentStyle
+ }
+} as DiyComponent
diff --git a/src/components/DiyEditor/components/mobile/ProductList/index.vue b/src/components/DiyEditor/components/mobile/ProductList/index.vue
new file mode 100644
index 00000000..8a35628e
--- /dev/null
+++ b/src/components/DiyEditor/components/mobile/ProductList/index.vue
@@ -0,0 +1,131 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ spu.name }}
+
+
+
+
+ ¥{{ spu.price }}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/DiyEditor/components/mobile/ProductList/property.vue b/src/components/DiyEditor/components/mobile/ProductList/property.vue
new file mode 100644
index 00000000..872affc3
--- /dev/null
+++ b/src/components/DiyEditor/components/mobile/ProductList/property.vue
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 建议尺寸:36 * 22
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/components/DiyEditor/util.ts b/src/components/DiyEditor/util.ts
index 8f8c2c0c..a8d0e095 100644
--- a/src/components/DiyEditor/util.ts
+++ b/src/components/DiyEditor/util.ts
@@ -107,11 +107,15 @@ export const PAGE_LIBS = [
extended: true,
components: ['ImageBar', 'Carousel', 'TitleBar', 'VideoPlayer', 'Divider', 'MagicCube']
},
- { name: '商品组件', extended: true, components: ['ProductCard'] },
+ { name: '商品组件', extended: true, components: ['ProductCard', 'ProductList'] },
{
name: '会员组件',
extended: true,
- components: ['UserCard', 'OrderCard', 'WalletCard', 'CouponCard']
+ components: ['UserCard', 'UserOrder', 'UserWallet', 'UserCoupon']
},
- { name: '营销组件', extended: true, components: ['Combination', 'Seckill', 'Point', 'Coupon'] }
+ {
+ name: '营销组件',
+ extended: true,
+ components: ['CombinationCard', 'SeckillCard', 'PointCard', 'CouponCard']
+ }
] as DiyComponentLibrary[]
diff --git a/src/components/RouterSearch/index.vue b/src/components/RouterSearch/index.vue
index c12385af..2499dafe 100644
--- a/src/components/RouterSearch/index.vue
+++ b/src/components/RouterSearch/index.vue
@@ -1,5 +1,5 @@
-
+
+
+
+
+
+
+
diff --git a/src/views/crm/contact/detail/ContactDetails.vue b/src/views/crm/contact/detail/ContactDetails.vue
index 9cf586b2..de31306e 100644
--- a/src/views/crm/contact/detail/ContactDetails.vue
+++ b/src/views/crm/contact/detail/ContactDetails.vue
@@ -1,3 +1,10 @@
+
@@ -24,14 +31,17 @@
{{ contact.qq }}
- {{ contact.webchat }}
-
-
- {{ contact.address }}
+ {{ contact.wechat }}
{{ contact.nextTime ? formatDate(contact.nextTime) : '空' }}
+
+ {{ contact.areaName }}
+
+
+ {{ contact.address }}
+
@@ -46,7 +56,7 @@
- {{ gotOwnerUser(contact.ownerUserId) }}
+ {{ contact.ownerUserName }}
{{ contact.creatorName }}
@@ -66,29 +76,9 @@
import * as ContactApi from '@/api/crm/contact'
import { DICT_TYPE } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime'
-import * as UserApi from '@/api/system/user'
const { contact } = defineProps<{ contact: ContactApi.ContactVO }>()
// 展示的折叠面板
const activeNames = ref(['basicInfo', 'systemInfo'])
-const gotOwnerUser = (owerUserId: string) => {
- let ownerName = ''
- if (owerUserId !== null && owerUserId != undefined) {
- owerUserId.split(',').forEach((item: string, index: number) => {
- if (index != 0) {
- ownerName =
- ownerName + ',' + userList.value.find((user: { id: any }) => user.id == item)?.nickname
- } else {
- ownerName = userList.value.find((user: { id: any }) => user.id == item)?.nickname || ''
- }
- })
- }
- return ownerName
-}
-const userList = ref([]) // 用户列表
-/** 初始化 **/
-onMounted(async () => {
- userList.value = await UserApi.getSimpleUserList()
-})
diff --git a/src/views/crm/contact/detail/index.vue b/src/views/crm/contact/detail/index.vue
index 03bbb4e6..5ec47f92 100644
--- a/src/views/crm/contact/detail/index.vue
+++ b/src/views/crm/contact/detail/index.vue
@@ -63,33 +63,18 @@
-
+
- 活动
- 邮件
- 工商信息
-
-
- 客户
- 客户
-
-
- 团队成员
- 团队成员
-
+ 跟进记录
商机
-
- 合同
- 合同
+ 附件
+
+
+ 操作记录
+ 操作记录
-
- 回款
- 回款
-
- 回访
- 发票
diff --git a/src/views/crm/contact/index.vue b/src/views/crm/contact/index.vue
index d81b0449..8de0a19a 100644
--- a/src/views/crm/contact/index.vue
+++ b/src/views/crm/contact/index.vue
@@ -55,9 +55,9 @@
class="!w-240px"
/>
-
+
-
+
-
-
-
-
-
- {{ allContactList.find((contact) => contact.id === scope.row.parentId)?.name }}
+
+
-
+
- {{ gotOwnerUser(scope.row.ownerUserId) }}
+ {{ scope.row.ownerUserName}}
@@ -239,13 +235,12 @@ const queryParams = reactive({
name: null,
post: null,
qq: null,
- webchat: null,
+ wechat: null,
sex: null,
policyMakers: null
})
const queryFormRef = ref() // 搜索的表单
const exportLoading = ref(false) // 导出的加载中
-const userList = ref([]) // 用户列表
/** 查询列表 */
const getList = async () => {
@@ -305,35 +300,15 @@ const handleExport = async () => {
}
}
-// TODO @zyna:这个负责人的读取,放在后端好点
-const gotOwnerUser = (owerUserId: string) => {
- let ownerName = ''
- if (owerUserId !== null) {
- owerUserId.split(',').forEach((item: string, index: number) => {
- if (index != 0) {
- ownerName =
- ownerName + ',' + userList.value.find((user: { id: any }) => user.id == item)?.nickname
- } else {
- ownerName = userList.value.find((user: { id: any }) => user.id == item)?.nickname || ''
- }
- })
- }
- return ownerName
-}
-
/** 打开客户详情 */
const { push } = useRouter()
const openDetail = (id: number) => {
push({ name: 'CrmContactDetail', params: { id } })
}
-// TODO @zyna:这个上级的读取,放在后端读取,更合适;因为可能数据量比较大
-const allContactList = ref([]) //所有联系人列表
-const allCustomerList = ref([]) //客户列表
+
/** 初始化 **/
onMounted(async () => {
await getList()
- userList.value = await UserApi.getSimpleUserList()
- allContactList.value = await ContactApi.simpleAlllist()
})
diff --git a/src/views/crm/customer/detail/index.vue b/src/views/crm/customer/detail/index.vue
index 392a5d35..c88137fa 100644
--- a/src/views/crm/customer/detail/index.vue
+++ b/src/views/crm/customer/detail/index.vue
@@ -8,7 +8,7 @@
-
+
编辑
更改成交状态
@@ -16,31 +16,31 @@
-
+
创建任务
-
+
发送邮件
-
+
创建联系人
-
+
创建商机
-
+
创建合同
-
+
创建回款
-
+
添加团队成员
@@ -75,20 +75,32 @@
客户关系
- 联系人
+
+ 联系人
+
+
联系人
- 团队成员
- 团队成员
+
+ 团队成员
+
+
+
商机
- 合同
+
+ 合同
+
+
合同
- 回款
+
+ 回款
+
+
回款
回访
@@ -100,7 +112,7 @@
-
diff --git a/src/views/mall/product/comment/CommentForm.vue b/src/views/mall/product/comment/CommentForm.vue
index 284e9a61..df6756a0 100644
--- a/src/views/mall/product/comment/CommentForm.vue
+++ b/src/views/mall/product/comment/CommentForm.vue
@@ -8,14 +8,7 @@
v-loading="formLoading"
>
-
+
@@ -51,12 +44,11 @@
取 消
-
-
+
diff --git a/src/views/mall/product/spu/components/SpuTableSelect.vue b/src/views/mall/product/spu/components/SpuTableSelect.vue
index e748b76d..8028f749 100644
--- a/src/views/mall/product/spu/components/SpuTableSelect.vue
+++ b/src/views/mall/product/spu/components/SpuTableSelect.vue
@@ -1,8 +1,14 @@
-
+
diff --git a/src/views/mall/statistics/trade/index.vue b/src/views/mall/statistics/trade/index.vue
index e89f0cc3..86deaa87 100644
--- a/src/views/mall/statistics/trade/index.vue
+++ b/src/views/mall/statistics/trade/index.vue
@@ -219,6 +219,8 @@ import { TradeSummaryRespVO, TradeTrendSummaryRespVO } from '@/api/mall/statisti
import { calculateRelativeRate, fenToYuan } from '@/utils'
import download from '@/utils/download'
import { CardTitle } from '@/components/Card'
+import * as DateUtil from '@/utils/formatTime'
+import dayjs from 'dayjs'
/** 交易统计 */
defineOptions({ name: 'TradeStatistics' })
@@ -289,6 +291,13 @@ const lineChartOptions = reactive({
/** 处理交易状况查询 */
const getTradeTrendData = async () => {
trendLoading.value = true
+ // 1. 处理时间: 开始与截止在同一天的, 折线图出不来, 需要延长一天
+ const times = shortcutDateRangePicker.value.times
+ if (DateUtil.isSameDay(times[0], times[1])) {
+ // 前天
+ times[0] = DateUtil.formatDate(dayjs(times[0]).subtract(1, 'd'))
+ }
+ // 查询数据
await Promise.all([getTradeTrendSummary(), getTradeStatisticsList()])
trendLoading.value = false
}
diff --git a/src/views/system/notice/index.vue b/src/views/system/notice/index.vue
index dc776d3a..f482f91c 100644
--- a/src/views/system/notice/index.vue
+++ b/src/views/system/notice/index.vue
@@ -87,6 +87,9 @@
>
删除
+
+ 推送
+
@@ -168,6 +171,17 @@ const handleDelete = async (id: number) => {
} catch {}
}
+/** 推送按钮操作 */
+const handlePush = async (id: number) => {
+ try {
+ // 推送的二次确认
+ await message.confirm('是否推送所选中通知?')
+ // 发起推送
+ await NoticeApi.pushNotice(id)
+ message.success(t('推送成功'))
+ } catch {}
+}
+
/** 初始化 **/
onMounted(() => {
getList()