diff --git a/tax-guidance/App.vue b/tax-guidance/App.vue index a814140..7de6f6c 100644 --- a/tax-guidance/App.vue +++ b/tax-guidance/App.vue @@ -1,26 +1,60 @@ \ No newline at end of file + diff --git a/tax-guidance/api/company.js b/tax-guidance/api/company.js new file mode 100644 index 0000000..75fe620 --- /dev/null +++ b/tax-guidance/api/company.js @@ -0,0 +1,61 @@ +const COMPANY_BASE = 'https://api-dsb.dingtax.cn/dsb/tax-appoint/api/dx/third' + +const isCompanyOk = (body) => { + if (!body || typeof body !== 'object') return false + if (body.respCode !== undefined && Number(body.respCode) !== 0) return false + const code = body.code + if (code === undefined || code === null || code === '') return true + return code === 0 || code === '0' || code === 200 || code === '200' +} + +const companyPost = (path, payload) => { + const token = uni.getStorageSync('token') || '' + const header = { + 'Content-Type': 'application/json', + } + if (token) { + header.token = token + header.Authorization = `Bearer ${token}` + } + return new Promise((resolve, reject) => { + uni.request({ + url: `${COMPANY_BASE}${path}`, + method: 'POST', + data: payload, + header, + timeout: 20000, + success: (res) => { + let body = res.data + if (typeof body === 'string') { + try { + body = JSON.parse(body) + } catch (error) { + reject(error) + return + } + } + if (Number(res.statusCode) !== 200 || !isCompanyOk(body)) { + reject(body || res) + return + } + resolve(body) + }, + fail: (err) => reject(err), + }) + }) +} + +export const searchCompanyPage = (params = {}) => { + return companyPost('/company/info/page', { + zjhm: params.zjhm, + pageNum: params.pageNum || 1, + pageSize: params.pageSize || 50, + }) +} + +export const getCompanyRisk = (params = {}) => { + return companyPost('/company/risk/info', { + zjhm: params.zjhm, + djxh: params.djxh, + }) +} diff --git a/tax-guidance/api/print.js b/tax-guidance/api/print.js index d8cf5ad..e3ed8b8 100644 --- a/tax-guidance/api/print.js +++ b/tax-guidance/api/print.js @@ -20,13 +20,12 @@ export const printTicket = (params = {}) => { }) } -// 保存打印小票模板(POST + body,签名参数与其他 POST 接口一致) +// 保存打印小票模板 export const savePrintTemplate = (params = {}) => { - const body = JSON.parse(JSON.stringify(params)) return request({ tag: 'pad.print', path: '/template', - method: 'POST', - body + method: 'PUT', + body: params }) } diff --git a/tax-guidance/api/smz.js b/tax-guidance/api/smz.js new file mode 100644 index 0000000..d664f97 --- /dev/null +++ b/tax-guidance/api/smz.js @@ -0,0 +1,53 @@ +import request from '@/utils/request.js' +import { appLog, flushLogs } from '@/utils/appLog.js' + +const maskPhoneForLog = (phone) => { + const text = String(phone || '').trim() + if (!text) return '' + if (text.length < 7) return `${text.slice(0, 1)}***` + return `${text.slice(0, 3)}****${text.slice(-4)}` +} + +// 实名制采集保存(pad.ticket -> POST /save-cjxx) +export const saveSmzcjxx = (params = {}) => { + const body = { + rxsfzBdxh: params.rxsfzBdxh, + sjhm: params.sjhm, + } + if (params.dzyx) body.dzyx = params.dzyx + if (params.lxdh) body.lxdh = params.lxdh + + appLog( + 'info', + '[smz] saveSmzcjxx 请求', + `rxsfzBdxh=${body.rxsfzBdxh || ''}`, + `sjhm=${maskPhoneForLog(body.sjhm)}`, + `hasDzyx=${Boolean(body.dzyx)}`, + `hasLxdh=${Boolean(body.lxdh)}` + ) + flushLogs() + + return request({ + tag: 'pad.ticket', + path: '/save-cjxx', + method: 'POST', + body + }) + .then((result) => { + appLog( + 'info', + '[smz] saveSmzcjxx 返回', + `success=${result?.success}`, + `code=${result?.code}`, + `mess=${result?.mess || result?.msg || ''}`, + result + ) + flushLogs() + return result + }) + .catch((error) => { + appLog('error', '[smz] saveSmzcjxx 请求失败', error) + flushLogs() + throw error + }) +} diff --git a/tax-guidance/api/ticket.js b/tax-guidance/api/ticket.js index 051c6f7..d8ecd3a 100644 --- a/tax-guidance/api/ticket.js +++ b/tax-guidance/api/ticket.js @@ -11,12 +11,13 @@ export const takeTicket = (params = {}) => { } // 实名核验记录查询 -export const searchTicketVerify = (params = {}) => { +export const searchTicketVerify = (params = {}, requestOptions = {}) => { return request({ tag: 'pad.ticket', path: '/verify/search', method: 'POST', - body: params + body: params, + ...requestOptions }) } diff --git a/tax-guidance/components/QueueTicketDetail/QueueTicketDetail.vue b/tax-guidance/components/QueueTicketDetail/QueueTicketDetail.vue index deb0ff4..8ca87e1 100644 --- a/tax-guidance/components/QueueTicketDetail/QueueTicketDetail.vue +++ b/tax-guidance/components/QueueTicketDetail/QueueTicketDetail.vue @@ -220,7 +220,7 @@ const handleClose = () => { background: white; border-radius: 20rpx; width: 100%; - max-height: 75vh; + max-height: calc(75 * var(--pad-vh)); display: flex; flex-direction: column; box-shadow: 0 20rpx 60rpx rgba(0, 0, 0, 0.25); @@ -271,7 +271,7 @@ const handleClose = () => { .ticket-modal-body { flex: 1; padding: 0 24rpx 24rpx; - max-height: calc(75vh - 120rpx); + max-height: calc(75 * var(--pad-vh) - 120rpx); } /* 信息卡片 */ @@ -514,11 +514,11 @@ const handleClose = () => { } .ticket-modal-content { - max-height: 80vh; + max-height: calc(80 * var(--pad-vh)); } .ticket-modal-body { - max-height: calc(80vh - 120rpx); + max-height: calc(80 * var(--pad-vh) - 120rpx); } .info-row { diff --git a/tax-guidance/components/TakeTicketPopup/TakeTicketPopup.vue b/tax-guidance/components/TakeTicketPopup/TakeTicketPopup.vue index f93bd67..922b874 100644 --- a/tax-guidance/components/TakeTicketPopup/TakeTicketPopup.vue +++ b/tax-guidance/components/TakeTicketPopup/TakeTicketPopup.vue @@ -1,49 +1,81 @@