From 9b5464ffb6fbf55a0686ac8fcf1891996ab24bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=B7=E5=8F=B6?= <14103883+leaf-phos@user.noreply.gitee.com> Date: Fri, 24 Jan 2025 18:06:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/bst/dashboard.js | 9 + src/api/bst/project.js | 34 ++ src/components/AttachList/index.vue | 161 +++++++ src/components/FileUpload/index.vue | 28 +- src/components/ImageUpload/index.vue | 17 +- src/router/index.js | 6 + src/utils/constants.js | 8 +- src/utils/enums.js | 30 +- src/utils/index.js | 12 +- .../components/CustomerEditDialog.vue | 38 +- src/views/bst/customer/index.vue | 7 +- .../components/ProjectMaintenanceDialog.vue | 124 +++++ .../project/components/ProjectStartDialog.vue | 114 +++++ src/views/bst/project/edit/index.vue | 40 +- src/views/bst/project/index.vue | 136 +++++- src/views/bst/project/view/index.vue | 310 ++++++++++++ .../bst/task/components/TaskEditDialog.vue | 15 +- src/views/bst/task/index.vue | 35 +- src/views/dashboard/mixins/PanelGroup.vue | 455 ++++++++++++++++++ src/views/index.vue | 13 +- 20 files changed, 1509 insertions(+), 83 deletions(-) create mode 100644 src/api/bst/dashboard.js create mode 100644 src/components/AttachList/index.vue create mode 100644 src/views/bst/project/components/ProjectMaintenanceDialog.vue create mode 100644 src/views/bst/project/components/ProjectStartDialog.vue create mode 100644 src/views/bst/project/view/index.vue create mode 100644 src/views/dashboard/mixins/PanelGroup.vue diff --git a/src/api/bst/dashboard.js b/src/api/bst/dashboard.js new file mode 100644 index 0000000..69bc801 --- /dev/null +++ b/src/api/bst/dashboard.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +// 获取概览 +export function getBrief() { + return request({ + url: '/bst/dashboard/brief', + method: 'get' + }) +} \ No newline at end of file diff --git a/src/api/bst/project.js b/src/api/bst/project.js index 160b362..5b626a2 100644 --- a/src/api/bst/project.js +++ b/src/api/bst/project.js @@ -50,3 +50,37 @@ export function delProject(id) { method: 'delete' }) } + +// 完成项目 +export function completeProject(id) { + return request({ + url: '/bst/project/complete/' + id, + method: 'put' + }) +} + +// 开始开发 +export function startProject(data) { + return request({ + url: '/bst/project/start', + method: 'put', + data + }) +} + +// 验收 +export function acceptProject(id) { + return request({ + url: '/bst/project/accept/' + id, + method: 'put' + }) +} + +// 维护 +export function maintenanceProject(data) { + return request({ + url: '/bst/project/maintenance', + method: 'put', + data + }) +} diff --git a/src/components/AttachList/index.vue b/src/components/AttachList/index.vue new file mode 100644 index 0000000..d26fd27 --- /dev/null +++ b/src/components/AttachList/index.vue @@ -0,0 +1,161 @@ + + + + + \ No newline at end of file diff --git a/src/components/FileUpload/index.vue b/src/components/FileUpload/index.vue index eec60fa..8166506 100644 --- a/src/components/FileUpload/index.vue +++ b/src/components/FileUpload/index.vue @@ -28,9 +28,13 @@
  • - - {{ getFileName(file.name) }} - +
    删除
    @@ -109,8 +113,21 @@ export default { showTip() { return this.isShowTip && (this.fileType || this.fileSize); }, + // 获取真实url + realUrl() { + return (url) => { + if (url.startsWith('http')) { + return url; + } + return this.baseUrl + url; + } + } }, methods: { + // 是否是图片 + isImage(url) { + return url.endsWith('.png') || url.endsWith('.jpg') || url.endsWith('.jpeg'); + }, // 上传前校检格式和大小 handleBeforeUpload(file) { // 校检文件类型 @@ -213,4 +230,9 @@ export default { .ele-upload-list__item-content-action .el-link { margin-right: 10px; } +.file-link { + display: flex; + align-items: center; + flex-direction: row; +} diff --git a/src/components/ImageUpload/index.vue b/src/components/ImageUpload/index.vue index ea4065b..f19af4f 100644 --- a/src/components/ImageUpload/index.vue +++ b/src/components/ImageUpload/index.vue @@ -117,7 +117,7 @@ export default { this.fileList = list.map(item => { if (typeof item === "string") { if (item.indexOf(this.baseUrl) === -1) { - item = { name: this.baseUrl + item, url: this.baseUrl + item }; + item = { name: this.getRealUrl(item), url: this.getRealUrl(item) }; } else { item = { name: item, url: item }; } @@ -146,6 +146,12 @@ export default { } }, methods: { + getRealUrl(url) { + if (url.startsWith('http')) { + return url; + } + return this.baseUrl + url; + }, // 新增:鼠标进入处理 handleMouseEnter() { if (!this.isListening) { @@ -284,8 +290,13 @@ export default { }, // 预览 handlePictureCardPreview(file) { - this.dialogImageUrl = file.url; - this.dialogVisible = true; + if (file.url.match(/(docx?|xlsx?|pptx?|pdf)$/i)) { + // TODO 查看office文件 + window.open(`https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(this.getRealUrl(file.url))}`, '_blank'); + } else{ + this.dialogImageUrl = file.url; + this.dialogVisible = true; + } }, // 对象转成指定字符串分隔 listToString(list, separator) { diff --git a/src/router/index.js b/src/router/index.js index b317e1c..3bc5151 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -97,6 +97,12 @@ export const constantRoutes = [ component: Layout, hidden: true, children: [ + { + path: 'project/:id?', + component: () => import('@/views/bst/project/view/index.vue'), + name: 'ProjectView', + meta: { title: '查看项目', noCache: false } + } ] }, { diff --git a/src/utils/constants.js b/src/utils/constants.js index 86fd52e..04f446f 100644 --- a/src/utils/constants.js +++ b/src/utils/constants.js @@ -1,5 +1,5 @@ // 视图 -import { getLastDate, getLastDateTimeEnd, getLastDateTimeStart, getLastMonth, getLastMonthTimeEnd } from '@/utils/index' +import { getLastDate, getLastDateTimeEnd, getLastDateTimeStart, getLastMonth, getLastMonthTimeEnd } from '@/utils/index'; export const views = { } @@ -68,6 +68,12 @@ export const DatePickerOptions = { disabledDate(date) { return date.getTime() > Date.now(); } + }, + // 禁用过去 + DISABLE_PAST: { + disabledDate(date) { + return date.getTime() < Date.now(); + } } } diff --git a/src/utils/enums.js b/src/utils/enums.js index e8141e7..d57e4e9 100644 --- a/src/utils/enums.js +++ b/src/utils/enums.js @@ -34,4 +34,32 @@ export const CustomerIntentLevel = { HIGH: "1", // 高 MEDIUM: "2", // 中 LOW: "3" // 低 -} \ No newline at end of file +} + +// 项目状态 +export const ProjectStatus = { + WAIT_START: "WAIT_START", // 待开始 + IN_PROGRESS: "IN_PROGRESS", // 进行中 + COMPLETED: "COMPLETED", // 完成开发 + ACCEPTED: "ACCEPTED", // 已验收 + MAINTENANCE: "MAINTENANCE", // 维护中 + MAINTENANCE_OVERDUE: "MAINTENANCE_OVERDUE", // 维护到期 + DEVELOPMENT_OVERDUE: "DEVELOPMENT_OVERDUE", // 开发超期 + + // 是否可以完成 + canComplete() { + return [this.IN_PROGRESS, this.DEVELOPMENT_OVERDUE] + }, + // 是否可以开始开发 + canStart() { + return [this.WAIT_START] + }, + // 是否可以验收 + canAccept() { + return [this.COMPLETED] + }, + // 是否可以维护 + canMaintenance() { + return [this.ACCEPTED, this.MAINTENANCE_OVERDUE] + } +} diff --git a/src/utils/index.js b/src/utils/index.js index ae7e1cf..02bf208 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -1,5 +1,5 @@ -import { parseTime } from './ruoyi' -import Decimal from 'decimal.js' +import Decimal from 'decimal.js'; +import { parseTime } from './ruoyi'; /** * 表格时间格式化 @@ -523,3 +523,11 @@ export function formatFraction(numerator, denominator) { } return `${numerator}/${denominator}`; } + +// 获取真实url +export function getRealUrl(url) { + if (url.startsWith('http')) { + return url; + } + return `${process.env.VUE_APP_BASE_API}${url}`; +} \ No newline at end of file diff --git a/src/views/bst/customer/components/CustomerEditDialog.vue b/src/views/bst/customer/components/CustomerEditDialog.vue index c5b2b05..c0b7a3e 100644 --- a/src/views/bst/customer/components/CustomerEditDialog.vue +++ b/src/views/bst/customer/components/CustomerEditDialog.vue @@ -37,16 +37,30 @@ - + - + - + + + - - + + + + @@ -73,7 +87,7 @@ import UserSelect from '@/components/Business/User/UserSelect.vue'; export default { name: "CustomerEditDialog", components: { FormCol, UserSelect }, - dicts: ['customer_intent_level', 'customer_status'], + dicts: ['customer_intent_level', 'customer_status', 'customer_source', 'customer_intent'], props: { show: { type: Boolean, @@ -94,10 +108,10 @@ export default { // 表单校验 rules: { code: [ - { required: true, message: "客户编号不能为空", trigger: "blur" } + { required: true, message: "客户编号不能为空", trigger: "change" } ], name: [ - { required: true, message: "客户姓名不能为空", trigger: "blur" } + { required: true, message: "客户姓名不能为空", trigger: "change" } ], status: [ { required: true, message: "状态不能为空", trigger: "change" } @@ -106,10 +120,10 @@ export default { { required: true, message: "意向强度不能为空", trigger: "change" } ], source: [ - { required: true, message: "来源不能为空", trigger: "blur" } + { required: true, message: "来源不能为空", trigger: "change" } ], followId: [ - { required: true, message: "跟进人不能为空", trigger: "blur" } + { required: true, message: "跟进人不能为空", trigger: "change" } ] } }; @@ -149,10 +163,8 @@ export default { mobile: null, wechat: null, source: null, - intent: null, + intents: [], followId: this.userId, - lastFollowTime: null, - nextFollowTime: null, remark: null }; this.resetForm("form"); diff --git a/src/views/bst/customer/index.vue b/src/views/bst/customer/index.vue index 34079e5..ac77b25 100644 --- a/src/views/bst/customer/index.vue +++ b/src/views/bst/customer/index.vue @@ -142,6 +142,9 @@ + @@ -186,7 +189,7 @@ + + \ No newline at end of file diff --git a/src/views/bst/project/components/ProjectStartDialog.vue b/src/views/bst/project/components/ProjectStartDialog.vue new file mode 100644 index 0000000..e9e46dd --- /dev/null +++ b/src/views/bst/project/components/ProjectStartDialog.vue @@ -0,0 +1,114 @@ + + + + + \ No newline at end of file diff --git a/src/views/bst/project/edit/index.vue b/src/views/bst/project/edit/index.vue index bedb64d..b98e27d 100644 --- a/src/views/bst/project/edit/index.vue +++ b/src/views/bst/project/edit/index.vue @@ -7,9 +7,6 @@
    - - - @@ -22,8 +19,8 @@ style="width: calc(100% - 2em)" /> 元 - - + + - - - + + - - + + - - - - - - - - - + @@ -71,11 +54,11 @@ import { getProject, addProject, updateProject } from "@/api/bst/project"; import FormCol from "@/components/FormCol/index.vue"; import EditHeader from "@/components/EditHeader/index.vue"; -import UserInput from "@/components/Business/User/UserInput.vue"; -import FileUpload from "@/components/FileUpload/index.vue"; +import CustomerInput from "@/components/Business/Customer/CustomerInput.vue"; +import UserSelect from "@/components/Business/User/UserSelect.vue"; export default { name: "ProjectEdit", - components: { FormCol, EditHeader, UserInput, FileUpload }, + components: { FormCol, EditHeader, UserSelect, CustomerInput }, dicts: ['project_status'], data() { return { @@ -86,9 +69,6 @@ export default { form: {}, // 表单校验 rules: { - no: [ - { required: true, message: "项目编号不能为空", trigger: "blur" } - ], name: [ { required: true, message: "项目名称不能为空", trigger: "blur" } ], diff --git a/src/views/bst/project/index.vue b/src/views/bst/project/index.vue index f48d0fb..a650667 100644 --- a/src/views/bst/project/index.vue +++ b/src/views/bst/project/index.vue @@ -46,9 +46,8 @@ + :label="dict.value" + >{{dict.label}} @@ -124,6 +123,12 @@ @@ -149,13 +186,30 @@ :limit.sync="queryParams.pageSize" @pagination="getList" /> -
    + + + + + + + + + \ No newline at end of file diff --git a/src/views/bst/task/components/TaskEditDialog.vue b/src/views/bst/task/components/TaskEditDialog.vue index d47656c..eea59f5 100644 --- a/src/views/bst/task/components/TaskEditDialog.vue +++ b/src/views/bst/task/components/TaskEditDialog.vue @@ -17,7 +17,7 @@
    - + @@ -33,7 +33,7 @@ - + import { getTask, addTask, updateTask } from "@/api/bst/task"; import FormCol from "@/components/FormCol/index.vue"; -import UserInput from '@/components/Business/User/UserInput.vue'; import ProjectSelect from '@/components/Business/Project/ProjectSelect.vue'; import { TaskType, TaskLevel } from '@/utils/enums'; +import UserSelect from '@/components/Business/User/UserSelect.vue'; export default { name: "TaskEditDialog", - components: { FormCol, UserInput, ProjectSelect }, + components: { FormCol, ProjectSelect, UserSelect }, dicts: ['task_status', 'task_level', 'task_type'], props: { show: { @@ -72,6 +72,10 @@ export default { id: { type: [String, Number], default: null + }, + initData: { + type: Object, + default: () => ({}) } }, data() { @@ -132,7 +136,8 @@ export default { picture: null, description: null, expireTime: null, - ownerId: null + ownerId: null, + ...this.initData }; this.resetForm("form"); }, diff --git a/src/views/bst/task/index.vue b/src/views/bst/task/index.vue index fbb2555..54686e8 100644 --- a/src/views/bst/task/index.vue +++ b/src/views/bst/task/index.vue @@ -1,10 +1,10 @@