From 068330797e4797a923ca07bf2b34df00bde7e00f Mon Sep 17 00:00:00 2001 From: Default User Date: Tue, 27 Jan 2026 11:51:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E8=B7=9F=E8=BF=9B=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=8C=85=E6=8B=AC?= =?UTF-8?q?=E8=B7=9F=E8=BF=9B=E6=8C=89=E9=92=AE=E3=80=81=E8=B7=9F=E8=BF=9B?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=A8=A1=E6=80=81=E6=A1=86=E5=92=8C=E5=90=8E?= =?UTF-8?q?=E7=AB=AFAPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Reject.js | 31 +++++++++- SupplierReview.html | 140 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 170 insertions(+), 1 deletion(-) diff --git a/Reject.js b/Reject.js index 469476a..7ad07fe 100644 --- a/Reject.js +++ b/Reject.js @@ -1811,7 +1811,7 @@ app.get('/api/suppliers', async (req, res) => { // 查询供应商列表,按创建时间倒序排序,确保最新创建的在前面 const [suppliers] = await connection.query( - `SELECT userId, phoneNumber, province, city, district, detailedaddress, company, collaborationid, cooperation, businesslicenseurl, proofurl, brandurl, partnerstatus, reasonforfailure, reject_reason, terminate_reason, audit_time, created_at, liaison + `SELECT userId, phoneNumber, province, city, district, detailedaddress, company, collaborationid, cooperation, businesslicenseurl, proofurl, brandurl, partnerstatus, reasonforfailure, reject_reason, terminate_reason, audit_time, created_at, liaison, seller_followup FROM users${whereClause} ORDER BY created_at DESC LIMIT ? OFFSET ?`, params @@ -1832,6 +1832,35 @@ app.get('/api/suppliers', async (req, res) => { } }); +// 供应商跟进信息API - /api/suppliers/:id/followup +console.log('正在注册供应商跟进信息API路由: /api/suppliers/:id/followup'); +app.post('/api/suppliers/:id/followup', async (req, res) => { + console.log('收到供应商跟进信息更新请求:', req.params.id); + try { + const connection = await pool.getConnection(); + const supplierId = req.params.id; + const { content } = req.body; + + if (!content) { + connection.release(); + return sendResponse(res, false, null, '跟进信息不能为空'); + } + + // 更新供应商跟进信息 + await connection.query( + 'UPDATE users SET seller_followup = ? WHERE userId = ?', + [content, supplierId] + ); + + connection.release(); + sendResponse(res, true, null, '跟进信息保存成功'); + } catch (error) { + console.error('更新供应商跟进信息失败:', error.message); + console.error('错误详情:', error); + sendResponse(res, false, null, '更新供应商跟进信息失败'); + } +}); + // 管理员统计 - 获取货源创建统计数据 app.get('/api/admin/stats/supplies', async (req, res) => { try { diff --git a/SupplierReview.html b/SupplierReview.html index 57d4d95..78e76fb 100644 --- a/SupplierReview.html +++ b/SupplierReview.html @@ -1038,6 +1038,23 @@ + + +