From 1001244f38cf8dff9d96877d42d27df79d0cef4d Mon Sep 17 00:00:00 2001 From: zhouxueli <2841188632@qq.com> Date: Fri, 17 Jul 2026 09:38:34 +0800 Subject: [PATCH] =?UTF-8?q?CRM=5F26-07-21#story#9039,=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=95=86=E5=9C=A8=E8=B0=83=E5=BA=A6=E7=AB=AFApp=E4=B8=8E?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E4=B8=AD=E8=83=BD=E5=8F=98=E6=9B=B4=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E4=BF=A1=E6=81=AF=E5=8F=8A=E5=AF=B9=E5=BA=94=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E7=BB=8F=E7=90=86=E5=AE=A1=E6=A0=B8=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/supplierPhone.js | 43 +++ src/router/index.js | 16 + src/utils/validate.js | 51 +++ src/views/index/supplierTimePhone.vue | 384 ++++++++++++++++++++++ src/views/index/supplierTimePhoneEdit.vue | 352 ++++++++++++++++++++ 5 files changed, 846 insertions(+) create mode 100644 src/api/supplierPhone.js create mode 100644 src/utils/validate.js create mode 100644 src/views/index/supplierTimePhone.vue create mode 100644 src/views/index/supplierTimePhoneEdit.vue diff --git a/src/api/supplierPhone.js b/src/api/supplierPhone.js new file mode 100644 index 00000000..239cf0f1 --- /dev/null +++ b/src/api/supplierPhone.js @@ -0,0 +1,43 @@ +import request from '@/utils/http' + +/** + * 查询当前服务商分时段电话列表和审批状态 + * @param {Object} params + * @param {number} params.supplierId 服务商 ID + */ +export function getSupplierPhoneList(params) { + return request({ + url: '/supplierAppV2/dispatchApp/supplierPhone/list', + method: 'GET', + params + }) +} + +/** + * 查询当前服务商电话时段变更审批状态 + * @param {Object} params + * @param {number} params.supplierId 服务商 ID + */ +export function getSupplierPhoneApprovalStatus(params) { + return request({ + url: '/supplierAppV2/dispatchApp/supplierPhone/approvalStatus', + method: 'GET', + params + }) +} + +/** + * 提交服务商电话时段变更审批 + * @param {Object} data + * @param {number} data.supplierId 服务商 ID + * @param {string} [data.modifyReason] 修改原因 + * @param {Array} data.phoneList 电话时段草稿列表 + */ +export function submitSupplierPhoneApproval(data) { + return request({ + url: '/supplierAppV2/dispatchApp/supplierPhone/submit', + method: 'POST', + contentType: 'application/json', + data + }) +} diff --git a/src/router/index.js b/src/router/index.js index 936c085b..21aca5b7 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -43,6 +43,22 @@ const routes = [ title: '信息查看', } }, + { + path: '/supplierTimePhone', + name: 'supplierTimePhone', + component: () => import('@/views/index/supplierTimePhone'), + meta:{ + title: '供应商时段电话', + } + }, + { + path: '/supplierTimePhoneEdit', + name: 'supplierTimePhoneEdit', + component: () => import('@/views/index/supplierTimePhoneEdit'), + meta:{ + title: '编辑时段电话', + } + }, { path: '/toDoList', name: 'toDoList', diff --git a/src/utils/validate.js b/src/utils/validate.js new file mode 100644 index 00000000..f38bd709 --- /dev/null +++ b/src/utils/validate.js @@ -0,0 +1,51 @@ +/** + * 校验电话号码 + * 支持:大陆手机号、大陆固话、400电话、港澳手机号 + * @param {string} phone + * @returns {boolean} + */ +export function isValidPhone(phone) { + if (!phone) return false + // 大陆手机号 + const mainlandMobile = /^1[3-9]\d{9}$/ + // 大陆固话:区号(可选) + 7~8位号码 + const mainlandLandline = /^(0\d{2,3}-?)\d{7,8}$/ + // 400电话 + const phone400 = /^400-?\d{3}-?\d{4}$/ + // 港澳手机号(8位,首位5/6/8/9) + const hkMacaoMobile = /^[5689]\d{7}$/ + // 港澳固话 + const hkMacaoLandline = /^(\d{4}-?)?\d{4}$/ + + return ( + mainlandMobile.test(phone) || + mainlandLandline.test(phone) || + phone400.test(phone) || + hkMacaoMobile.test(phone) || + hkMacaoLandline.test(phone) + ) +} + +/** + * 校验时段格式 HH:mm 及起止关系 + * @param {string} startTime + * @param {string} endTime + * @returns {{valid: boolean, message?: string}} + */ +export function validateTimeRange(startTime, endTime) { + const timeRegex = /^([0-1]\d|2[0-3]):([0-5]\d)$/ + if (!startTime || !endTime) { + return { valid: false, message: '请填写完整的起止时段' } + } + if (!timeRegex.test(startTime) || !timeRegex.test(endTime)) { + return { valid: false, message: '时段格式不正确,应为 00:00 ~ 23:59' } + } + const [startH, startM] = startTime.split(':').map(Number) + const [endH, endM] = endTime.split(':').map(Number) + const start = startH * 60 + startM + const end = endH * 60 + endM + if (start > end) { + return { valid: false, message: '开始时间不得晚于结束时间' } + } + return { valid: true } +} diff --git a/src/views/index/supplierTimePhone.vue b/src/views/index/supplierTimePhone.vue new file mode 100644 index 00000000..72ac8fdc --- /dev/null +++ b/src/views/index/supplierTimePhone.vue @@ -0,0 +1,384 @@ + + + + + diff --git a/src/views/index/supplierTimePhoneEdit.vue b/src/views/index/supplierTimePhoneEdit.vue new file mode 100644 index 00000000..78a20440 --- /dev/null +++ b/src/views/index/supplierTimePhoneEdit.vue @@ -0,0 +1,352 @@ + + + + +