| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- import request from '@/router/axios';
- /**
- * 投诉查询参数类型定义
- * @typedef {Object} ComplaintQueryParams
- * @property {string} [complaintNo] - 投诉单号
- * @property {string} [title] - 投诉标题
- * @property {number} [complainantType] - 投诉人类型 1-消费者 2-经销商 3-分销商
- * @property {string} [customerCode] - 客户编码
- * @property {string} [customerName] - 客户名称
- * @property {string} [contactName] - 联系人姓名
- * @property {string} [contactPhone] - 联系人电话
- * @property {string} [complaintType] - 投诉类型
- * @property {number} [status] - 投诉状态 1-待处理 2-处理中 3-已完成 4-已关闭
- * @property {number} [replyStatus] - 回复状态 0-未回复 1-已回复
- * @property {string} [submitTimeStart] - 提交时间开始
- * @property {string} [submitTimeEnd] - 提交时间结束
- * @property {number} [current] - 当前页码
- * @property {number} [size] - 每页大小
- */
- /**
- * 投诉表单数据类型定义
- * @typedef {Object} ComplaintForm
- * @property {string} [id] - 投诉ID(修改时必填)
- * @property {string} [complaintNo] - 投诉单号(系统自动生成)
- * @property {number} complainantType - 投诉人类型 1-消费者 2-经销商 3-分销商
- * @property {string|number} [customerId] - 客户ID
- * @property {string} [customerCode] - 客户编码
- * @property {string} [customerName] - 客户名称
- * @property {string} contactName - 联系人姓名
- * @property {string} contactPhone - 联系人电话
- * @property {string} title - 投诉标题
- * @property {string} content - 投诉内容
- * @property {string} complaintType - 投诉类型
- * @property {number} [visibleScope] - 可见范围
- * @property {number} [status] - 投诉状态 1-待处理 2-处理中 3-已完成 4-已关闭
- * @property {number} [replyStatus] - 回复状态 0-未回复 1-已回复
- * @property {string} [closeReason] - 关闭原因
- * @property {string} [submitTime] - 提交时间
- */
- /**
- * 投诉列表项类型定义
- * @typedef {Object} ComplaintRecord
- * @property {string} id - 投诉ID
- * @property {string} createUser - 创建用户ID
- * @property {string} createDept - 创建部门ID
- * @property {string} createTime - 创建时间
- * @property {string} updateUser - 更新用户ID
- * @property {string} updateTime - 更新时间
- * @property {number} status - 投诉状态 1-待处理 2-处理中 3-已完成 4-已关闭
- * @property {number} isDeleted - 是否删除 0-未删除 1-已删除
- * @property {string} complaintNo - 投诉单号
- * @property {number} complainantType - 投诉人类型 1-消费者 2-经销商 3-分销商
- * @property {string|number|null} customerId - 客户ID
- * @property {string|null} customerCode - 客户编码
- * @property {string|null} customerName - 客户名称
- * @property {string} contactName - 联系人姓名
- * @property {string} contactPhone - 联系人电话
- * @property {string} title - 投诉标题
- * @property {string} content - 投诉内容
- * @property {string} complaintType - 投诉类型
- * @property {number} visibleScope - 可见范围
- * @property {number} replyStatus - 回复状态 0-未回复 1-已回复
- * @property {string|null} closeReason - 关闭原因
- * @property {string} submitTime - 提交时间
- */
- /**
- * API响应类型定义
- * @template T
- * @typedef {Object} ApiResponse
- * @property {number} code - 响应码
- * @property {boolean} success - 是否成功
- * @property {T} data - 响应数据
- * @property {string} msg - 响应消息
- */
- /**
- * 分页结果类型定义
- * @template T
- * @typedef {Object} PageResult
- * @property {T[]} records - 数据记录
- * @property {number} total - 总记录数
- * @property {number} size - 每页大小
- * @property {number} current - 当前页码
- * @property {Array} orders - 排序信息
- * @property {boolean} optimizeCountSql - 是否优化count查询
- * @property {boolean} hitCount - 是否命中count缓存
- * @property {string|null} countId - count查询ID
- * @property {string|null} maxLimit - 最大限制
- * @property {boolean} searchCount - 是否查询count
- * @property {number} pages - 总页数
- */
- /**
- * 投诉分页查询
- * @param {number} current - 当前页码
- * @param {number} size - 每页大小
- * @param {ComplaintQueryParams} params - 查询参数
- * @returns {Promise<AxiosResponse<PageResult<ComplaintRecord>>>} 分页查询结果
- */
- export const getList = (current, size, params) => {
- return request({
- url: '/api/blade-factory/api/factory/complaint',
- method: 'get',
- params: {
- ...params,
- current,
- size
- }
- })
- }
- /**
- * 新增投诉
- * @param {ComplaintForm} row - 投诉表单数据
- * @returns {Promise<AxiosResponse<null>>} 操作结果
- */
- export const add = (row) => {
- return request({
- url: '/api/blade-factory/api/factory/complaint',
- method: 'post',
- data: row
- })
- }
- /**
- * 修改投诉
- * @param {ComplaintForm} row - 投诉表单数据
- * @returns {Promise<AxiosResponse<null>>} 操作结果
- */
- export const update = (row) => {
- return request({
- url: '/api/blade-factory/api/factory/complaint',
- method: 'put',
- data: row
- })
- }
- /**
- * 删除投诉
- * @param {string} ids - 投诉ID列表,多个用逗号分隔
- * @returns {Promise<ApiResponse<null>>} 操作结果
- */
- export const remove = (ids) => {
- return request({
- url: '/api/blade-factory/api/factory/complaint',
- method: 'delete',
- params: {
- ids
- }
- })
- }
- /**
- * 获取投诉详情
- * @param {string} complaintId - 投诉ID
- * @returns {Promise<ApiResponse<ComplaintRecord>>} 投诉详情
- */
- export const getDetail = (complaintId) => {
- return request({
- url: `/api/blade-factory/api/factory/complaint/${complaintId}`,
- method: 'get'
- })
- }
- /**
- * 更新投诉状态
- * @param {string} id - 投诉ID
- * @param {number} status - 新状态
- * @param {string} [closeReason] - 关闭原因(状态为已关闭时必填)
- * @returns {Promise<ApiResponse<null>>} 操作结果
- */
- export const updateStatus = (id, status, closeReason) => {
- return request({
- url: '/api/blade-factory/api/factory/complaint/status',
- method: 'put',
- data: {
- id,
- status,
- closeReason
- }
- })
- }
- /**
- * 批量更新投诉状态
- * @param {string[]} ids - 投诉ID数组
- * @param {number} status - 新状态
- * @param {string} [closeReason] - 关闭原因(状态为已关闭时必填)
- * @returns {Promise<ApiResponse<null>>} 操作结果
- */
- export const batchUpdateStatus = (ids, status, closeReason) => {
- return request({
- url: '/api/blade-factory/api/factory/complaint/batch-status',
- method: 'put',
- data: {
- ids,
- status,
- closeReason
- }
- })
- }
|