diff --git a/Antis.Erp.Plat/.cursor/rules/project_rules.mdc b/Antis.Erp.Plat/.cursor/rules/project_rules.mdc index 07106e2..a0d8c24 100644 --- a/Antis.Erp.Plat/.cursor/rules/project_rules.mdc +++ b/Antis.Erp.Plat/.cursor/rules/project_rules.mdc @@ -144,6 +144,7 @@ Id = Guid.NewGuid().ToString() - 禁止在主页面的 template 中直接编写弹窗内容或复杂交互逻辑 - 组件文件命名使用 kebab-case,如:user-dialog.vue、edit-form.vue - 列表数据不能换行 +- **弹窗/抽屉挂 body**:所有 `el-dialog`、`el-drawer` 必须 `append-to-body`(建议同时 `modal-append-to-body`);页内多选项卡切换时应关闭未关弹窗,避免遮罩错位。详见规则 `wt-dialog-append-to-body.mdc` ### 后端特殊要求 - 使用 WhereIF 条件查询避免 SQL 注入 @@ -180,5 +181,6 @@ Id = Guid.NewGuid().ToString() 9. **数据库文档**: 所有数据库表结构、字段说明、关联关系必须记录到 `项目文档相关/docs/数据库说明.md` 10. **ID生成规范**: 所有实体ID的生成都必须使用 `YitIdHelper.NextId().ToString()`,禁止使用 `Guid.NewGuid().ToString()` 或其他ID生成方式 11.**说明文档规范**:没有要求生成新的md文件的时候,严禁生成新md文件。 +12. **弹窗/抽屉 append-to-body**:`antis-ncc-admin` 中新增或修改的 `el-dialog` / `el-drawer` 必须挂到 `body`(`append-to-body`),与壳层多页签遮罩(`tagsViewPopupScope` / `modern-shell`)对齐;禁止省略或设为 `false`(有嵌套层特殊理由须注释说明)。 ## 📋 重要变更记录 diff --git a/Antis.Erp.Plat/.cursor/rules/wt-dialog-append-to-body.mdc b/Antis.Erp.Plat/.cursor/rules/wt-dialog-append-to-body.mdc new file mode 100644 index 0000000..065124b --- /dev/null +++ b/Antis.Erp.Plat/.cursor/rules/wt-dialog-append-to-body.mdc @@ -0,0 +1,33 @@ +--- +description: el-dialog / el-drawer 必须 append-to-body,避免多页签与选项卡切换后遮罩错位 +globs: antis-ncc-admin/**/*.vue +alwaysApply: false +--- + +# 弹窗 / 抽屉:必须挂到 body + +## 强制 + +1. 新增或修改 `el-dialog`、`el-drawer` 时,**必须**写 `append-to-body`(建议同时写 `modal-append-to-body`,除非嵌套全屏预览等场景需 `:modal-append-to-body="false"`)。 +2. **禁止**省略 `append-to-body`,也禁止 `:append-to-body="false"`(除非有明确嵌套层理由并在注释中说明)。 +3. 页内有多个 `el-tabs` 选项卡且挂弹窗时:切换选项卡应关闭未关弹窗,避免遮罩盖在另一张表上(参考 `wtSkzhb/index.vue`、`wtTcsz/index.vue`)。 + +## 原因 + +壳层(`modern-shell.scss` + `tagsViewPopupScope.js`)按 `body > .v-modal` / `body > .el-dialog__wrapper` 裁切遮罩并归属多页签。弹窗留在页内时,切换页签或选项卡后遮罩易错位、残留或盖错内容。 + +## 示例 + +```vue + +``` + +下拉被裁切时,`el-select` / `el-cascader` 等加 `popper-append-to-body`。 diff --git a/Antis.Erp.Plat/AGENTS.md b/Antis.Erp.Plat/AGENTS.md index 3f9c3bb..419d29a 100644 --- a/Antis.Erp.Plat/AGENTS.md +++ b/Antis.Erp.Plat/AGENTS.md @@ -63,6 +63,7 @@ - File names should be kebab-case for new Vue components. - Empty values display as `无`; list/table cell content should not wrap unless existing page style requires it. - Use Node.js 16.20.2 for `antis-ncc-admin`; newer Node versions can fail on this project. +- **Dialog/drawer mask**: every `el-dialog` / `el-drawer` must use `append-to-body` (prefer `modal-append-to-body` too) so masks align with TagsView shell (`modern-shell.scss`, `tagsViewPopupScope.js`). On multi `el-tabs` pages, close open dialogs when switching tabs. Rule: `.cursor/rules/wt-dialog-append-to-body.mdc`. ## POS And Douyin diff --git a/Antis.Erp.Plat/antis-ncc-admin/scripts/e2e-wtHy-dual-tab-mask.js b/Antis.Erp.Plat/antis-ncc-admin/scripts/e2e-wtHy-dual-tab-mask.js new file mode 100644 index 0000000..309a677 --- /dev/null +++ b/Antis.Erp.Plat/antis-ncc-admin/scripts/e2e-wtHy-dual-tab-mask.js @@ -0,0 +1,160 @@ +/** + * E2E:两个客户档案页签 + 新建弹窗遮罩 + * 运行:node scripts/e2e-wtHy-dual-tab-mask.js + */ +const { chromium } = require('playwright') +const { execFileSync } = require('child_process') + +const BASE = process.env.ADMIN_URL || 'http://127.0.0.1:3000' +const API = process.env.API_URL || 'http://127.0.0.1:2011' + +function loginToken() { + const out = execFileSync( + 'curl', + [ + '-s', + '-X', + 'POST', + `${API}/api/oauth/Login`, + '-H', + 'Content-Type: application/x-www-form-urlencoded', + '-d', + 'account=admin&password=e10adc3949ba59abbe56e057f20f883e' + ], + { encoding: 'utf8' } + ) + const json = JSON.parse(out) + if (!json || !json.data || !json.data.token) throw new Error('login failed: ' + out.slice(0, 300)) + return json.data.token +} + +function visibleModal(page) { + return page.evaluate(() => { + const modals = Array.from(document.querySelectorAll('body > .v-modal')) + return modals + .filter(m => { + const st = getComputedStyle(m) + if (st.display === 'none' || st.visibility === 'hidden') return false + if (parseFloat(st.opacity || '1') === 0) return false + if (m.classList.contains('tags-view-popup-hidden')) return false + return true + }) + .map(m => ({ + path: m.getAttribute('data-tags-view-path'), + z: m.style.zIndex, + hiddenClass: m.classList.contains('tags-view-popup-hidden') + })) + }) +} + +function visibleDialogs(page) { + return page.evaluate(() => { + return Array.from(document.querySelectorAll('body > .el-dialog__wrapper')) + .filter(w => { + if (w.style.display === 'none') return false + if (w.classList.contains('tags-view-popup-hidden')) return false + const st = getComputedStyle(w) + return st.display !== 'none' && st.visibility !== 'hidden' + }) + .map(w => ({ + path: w.getAttribute('data-tags-view-path'), + title: (w.querySelector('.el-dialog__title') || {}).textContent || '' + })) + }) +} + +async function openWtHyTab(page, inst) { + await page.goto(`${BASE}/#/wtHy?_inst=${inst}`, { waitUntil: 'networkidle', timeout: 60000 }) + await page.waitForTimeout(800) +} + +async function clickAdd(page) { + // 工具栏「新增」 + const btn = page.locator('button:has-text("新增"), .el-button:has-text("新增")').first() + await btn.click({ timeout: 15000 }) + await page.waitForTimeout(600) +} + +async function run() { + const token = await loginToken() + const browser = await chromium.launch({ headless: true }) + const context = await browser.newContext() + const page = await context.newPage() + + // 写入与项目一致的 token 存储格式 + await page.goto(`${BASE}/#/login`, { waitUntil: 'domcontentloaded' }) + await page.evaluate(t => { + localStorage.setItem('ncc_token', `${t}|String`) + }, token) + await page.goto(`${BASE}/#/home`, { waitUntil: 'networkidle', timeout: 90000 }) + await page.waitForTimeout(1500) + + const fails = [] + const pathA = '/wtHy?_inst=e2e111' + const pathB = '/wtHy?_inst=e2e222' + + // 打开 A + await openWtHyTab(page, 'e2e111') + await clickAdd(page) + let dialogs = await visibleDialogs(page) + let modals = await visibleModal(page) + console.log('A open', { dialogs, modals, href: await page.evaluate(() => location.hash) }) + if (!dialogs.length) fails.push('A: 打开新建后应有弹窗') + if (!modals.length) fails.push('A: 打开新建后应有遮罩') + + // 打开 B(新页签实例) + await openWtHyTab(page, 'e2e222') + await page.waitForTimeout(500) + dialogs = await visibleDialogs(page) + modals = await visibleModal(page) + console.log('switch B', { dialogs, modals }) + // A 的弹窗应被隐藏;B 尚未打开新建 + if (dialogs.some(d => (d.title || '').includes('新建'))) { + fails.push('B: 不应看到 A 的新建弹窗') + } + if (modals.length) fails.push('B: 无新建时不应有可见遮罩') + + // 切回 A + await page.goto(`${BASE}/#${pathA}`, { waitUntil: 'networkidle', timeout: 60000 }) + await page.waitForTimeout(800) + dialogs = await visibleDialogs(page) + modals = await visibleModal(page) + console.log('back A', { dialogs, modals }) + if (!dialogs.some(d => (d.title || '').includes('新建') || (d.title || '').includes('客户'))) { + fails.push('回 A: 应恢复新建弹窗') + } + if (!modals.length) fails.push('回 A: 应同时有遮罩') + + // B 再打开新建,两边互不串 + await page.goto(`${BASE}/#${pathB}`, { waitUntil: 'networkidle', timeout: 60000 }) + await page.waitForTimeout(500) + await clickAdd(page) + dialogs = await visibleDialogs(page) + modals = await visibleModal(page) + console.log('B open', { dialogs, modals }) + if (!dialogs.length) fails.push('B 打开新建:应有弹窗') + if (!modals.length) fails.push('B 打开新建:应有遮罩') + + await page.goto(`${BASE}/#${pathA}`, { waitUntil: 'networkidle', timeout: 60000 }) + await page.waitForTimeout(800) + dialogs = await visibleDialogs(page) + modals = await visibleModal(page) + console.log('A again', { dialogs, modals }) + if (!modals.length) fails.push('最终回 A:应有遮罩') + if (!dialogs.length) fails.push('最终回 A:应有弹窗') + + await browser.close() + + if (fails.length) { + console.error('E2E FAIL') + fails.forEach(f => console.error(' -', f)) + process.exit(1) + } + console.log('E2E PASS: dual wtHy tabs dialog+mask sync') + process.exit(0) +} + +run().catch(err => { + console.error(err) + process.exit(1) +}) diff --git a/Antis.Erp.Plat/antis-ncc-admin/scripts/test-tags-view-popup-scope.js b/Antis.Erp.Plat/antis-ncc-admin/scripts/test-tags-view-popup-scope.js new file mode 100644 index 0000000..8adb4c7 --- /dev/null +++ b/Antis.Erp.Plat/antis-ncc-admin/scripts/test-tags-view-popup-scope.js @@ -0,0 +1,188 @@ +/** + * 双页签遮罩测试(含 Element 共用单遮罩场景) + * 运行:node scripts/test-tags-view-popup-scope.js + */ +const { JSDOM } = require('jsdom') +const path = require('path') +const fs = require('fs') +const vm = require('vm') + +const dom = new JSDOM('
', { + url: 'http://localhost:3000/', + pretendToBeVisual: true +}) +const { window } = dom +const { document } = window + +Object.defineProperty(window.HTMLElement.prototype, 'offsetWidth', { + configurable: true, + get() { + if (this.style.display === 'none') return 0 + if (this.classList.contains('tags-view-popup-hidden')) return 0 + let p = this.parentElement + while (p) { + if (p.style && p.style.display === 'none') return 0 + p = p.parentElement + } + return this.classList.contains('el-dialog__wrapper') || this.classList.contains('v-modal') ? 100 : 10 + } +}) +Object.defineProperty(window.HTMLElement.prototype, 'offsetHeight', { + configurable: true, + get() { + return this.offsetWidth ? 80 : 0 + } +}) + +const scopePath = path.resolve(__dirname, '../src/utils/tagsViewPopupScope.js') +let src = fs.readFileSync(scopePath, 'utf8') +src = src + .replace(/export const (\w+)\s*=/g, 'const $1 =') + .replace(/export function (\w+)/g, 'function $1') + +src += ` +;module.exports = { + PATH_ATTR, + Z_ATTR, + HIDDEN_CLASS, + initTagsViewPopupScope, + __tagsViewPopupScopeTestHooks +}; +` + +const mod = { exports: {} } +const context = { + module: mod, + exports: mod.exports, + require, + console, + document, + window, + HTMLElement: window.HTMLElement, + MutationObserver: window.MutationObserver, + requestAnimationFrame: cb => setTimeout(cb, 0), + setTimeout, + clearTimeout, + parseInt, + Number, + Array, + String, + Object, + Math +} +context.global = context +vm.createContext(context) +vm.runInContext(src, context) +const api = mod.exports +const HIDDEN = api.HIDDEN_CLASS +const PATH_ATTR = api.PATH_ATTR +const hooks = api.__tagsViewPopupScopeTestHooks() + +function flush() { + return new Promise(resolve => { + hooks.applyVisibility() + setTimeout(() => { + hooks.applyVisibility() + resolve() + }, 20) + }) +} + +function isHidden(el) { + return el.classList.contains(HIDDEN) +} + +function createBodyDialog(fullPath, zDialog) { + const wrap = document.createElement('div') + wrap.className = 'el-dialog__wrapper' + wrap.style.zIndex = String(zDialog) + wrap.style.display = '' + wrap.setAttribute(PATH_ATTR, fullPath) + wrap.setAttribute('data-tags-view-z', String(zDialog)) + document.body.appendChild(wrap) + return wrap +} + +function createSharedModal(zModal) { + const modal = document.createElement('div') + modal.className = 'v-modal' + modal.style.zIndex = String(zModal) + document.body.appendChild(modal) + return modal +} + +async function run() { + const pathA = '/wtHy?_inst=111' + const pathB = '/wtHy?_inst=222' + const fails = [] + + // —— 核心:Element 共用一块遮罩,A/B 各开弹窗,反复切换两边都要有遮罩 —— + hooks.onRouteChange({ fullPath: pathA }) + const dlgA = createBodyDialog(pathA, 2001) + const sharedModal = createSharedModal(2000) + await flush() + if (isHidden(dlgA) || isHidden(sharedModal)) fails.push('S0: A 打开时应有弹窗+遮罩') + + hooks.onRouteChange({ fullPath: pathB }) + await flush() + if (!isHidden(dlgA)) fails.push('S0: 切 B 后 A 弹窗应隐藏') + if (!isHidden(sharedModal)) fails.push('S0: B 无弹窗时共用遮罩应隐藏') + + // B 也打开新建(仍是同一块遮罩,z-index 抬高模拟 Element) + const dlgB = createBodyDialog(pathB, 2003) + sharedModal.style.zIndex = '2002' + sharedModal.setAttribute('data-tags-view-z', '2002') + await flush() + if (isHidden(dlgB) || isHidden(sharedModal)) fails.push('S1: B 打开新建应有弹窗+遮罩') + if (!isHidden(dlgA)) fails.push('S1: B 页时 A 弹窗应隐藏') + + // 反复切换 + for (let i = 0; i < 5; i++) { + hooks.onRouteChange({ fullPath: pathA }) + await flush() + if (isHidden(dlgA)) fails.push(`S2.${i}A: 弹窗应显示`) + if (isHidden(sharedModal)) fails.push(`S2.${i}A: 遮罩应显示`) + if (!isHidden(dlgB)) fails.push(`S2.${i}A: B 弹窗应隐藏`) + + hooks.onRouteChange({ fullPath: pathB }) + await flush() + if (isHidden(dlgB)) fails.push(`S2.${i}B: 弹窗应显示`) + if (isHidden(sharedModal)) fails.push(`S2.${i}B: 遮罩应显示`) + if (!isHidden(dlgA)) fails.push(`S2.${i}B: A 弹窗应隐藏`) + } + + // 切到无弹窗的库存查询 + hooks.onRouteChange({ fullPath: '/wtStockSummary' }) + await flush() + if (!isHidden(dlgA) || !isHidden(dlgB)) fails.push('S3: 无弹窗页签时两边弹窗都应隐藏') + if (!isHidden(sharedModal)) fails.push('S3: 无弹窗页签时遮罩应隐藏') + + // 回 A 仍应恢复 + hooks.onRouteChange({ fullPath: pathA }) + await flush() + if (isHidden(dlgA) || isHidden(sharedModal)) fails.push('S4: 回 A 应恢复弹窗+遮罩') + + // A 弹窗应在遮罩之上 + const zDlg = parseInt(dlgA.style.zIndex, 10) + const zModal = parseInt(sharedModal.style.zIndex, 10) + if (!(zDlg > zModal)) fails.push(`S5: 当前页弹窗 z(${zDlg}) 应高于遮罩 z(${zModal})`) + + // S6: 关闭弹窗后不应再显示(模拟 Element 写 display:none) + dlgA.style.display = 'none' + await flush() + if (!isHidden(dlgA)) fails.push('S6: Element 关闭后弹窗应隐藏') + if (!isHidden(sharedModal)) fails.push('S6: 关闭后遮罩应隐藏') + + if (fails.length) { + console.error('FAIL') + fails.forEach(f => console.error(' -', f)) + process.exit(1) + } + console.log('PASS shared-modal dual wtHy tabs (repeated switch + close)') + process.exit(0) +} + +run().catch(err => { + console.error(err) + process.exit(1) +}) diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/api/user.js b/Antis.Erp.Plat/antis-ncc-admin/src/api/user.js index 2bb6a53..dc0d62a 100755 --- a/Antis.Erp.Plat/antis-ncc-admin/src/api/user.js +++ b/Antis.Erp.Plat/antis-ncc-admin/src/api/user.js @@ -12,7 +12,6 @@ export function login(data) { }) } export function Pislogin(data) { - console.log("开始验证我的登录"); return request({ url: '/api/oauth/PisLogin', method: 'post', diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/components/Generator/index/RightComponents/Cascader/TreeNodeDialog.vue b/Antis.Erp.Plat/antis-ncc-admin/src/components/Generator/index/RightComponents/Cascader/TreeNodeDialog.vue index 4f08f13..39f431e 100755 --- a/Antis.Erp.Plat/antis-ncc-admin/src/components/Generator/index/RightComponents/Cascader/TreeNodeDialog.vue +++ b/Antis.Erp.Plat/antis-ncc-admin/src/components/Generator/index/RightComponents/Cascader/TreeNodeDialog.vue @@ -2,7 +2,7 @@
+ class="NCC-dialog NCC-dialog_center" append-to-body> diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/components/Generator/index/RightComponents/TreeSelect/TreeNodeDialog.vue b/Antis.Erp.Plat/antis-ncc-admin/src/components/Generator/index/RightComponents/TreeSelect/TreeNodeDialog.vue index 4f08f13..39f431e 100755 --- a/Antis.Erp.Plat/antis-ncc-admin/src/components/Generator/index/RightComponents/TreeSelect/TreeNodeDialog.vue +++ b/Antis.Erp.Plat/antis-ncc-admin/src/components/Generator/index/RightComponents/TreeSelect/TreeNodeDialog.vue @@ -2,7 +2,7 @@
+ class="NCC-dialog NCC-dialog_center" append-to-body> diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/components/WtDjztTag/index.vue b/Antis.Erp.Plat/antis-ncc-admin/src/components/WtDjztTag/index.vue index 6d8e61a..4342a71 100644 --- a/Antis.Erp.Plat/antis-ncc-admin/src/components/WtDjztTag/index.vue +++ b/Antis.Erp.Plat/antis-ncc-admin/src/components/WtDjztTag/index.vue @@ -18,6 +18,10 @@ import { isWtDjztRejected, resolveWtBillAuditRow } from '@/utils/wtDjztDisplay' +import { + getWtFpsqDjztDisplayLabel, + getWtFpsqDjztTagType +} from '@/utils/wtFpsqDjztDisplay' export default { name: 'WtDjztTag', @@ -26,6 +30,8 @@ export default { // 默认 null:未传时不得用空串覆盖 row.djzt(否则会全显示成「待审核」) djzt: { type: [String, Number], default: null }, spbz: { type: String, default: null }, + /** 发票申请等新流程状态展示 */ + variant: { type: String, default: '' }, size: { type: String, default: 'mini' }, effect: { type: String, default: 'light' } }, @@ -34,13 +40,23 @@ export default { if (this.row) return resolveWtBillAuditRow(this.row, this.djzt) return resolveWtBillAuditRow(this.djzt, this.spbz) }, + isFpsqVariant() { + return this.variant === 'fpsq' + }, label() { + if (this.isFpsqVariant) { + return getWtFpsqDjztDisplayLabel(this.auditCtx.djzt, this.auditCtx.spbz) + } return getWtDjztDisplayLabel(this.auditCtx.djzt, this.auditCtx.spbz) }, tagType() { + if (this.isFpsqVariant) { + return getWtFpsqDjztTagType(this.auditCtx.djzt, this.auditCtx.spbz) + } return getWtDjztTagType(this.auditCtx.djzt, this.auditCtx.spbz) }, rejected() { + if (this.isFpsqVariant) return false return isWtDjztRejected(this.auditCtx.djzt, this.auditCtx.spbz) } } diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/components/WtXsckdListTotalsBar/index.vue b/Antis.Erp.Plat/antis-ncc-admin/src/components/WtXsckdListTotalsBar/index.vue index c90b2b2..0b5cf00 100644 --- a/Antis.Erp.Plat/antis-ncc-admin/src/components/WtXsckdListTotalsBar/index.vue +++ b/Antis.Erp.Plat/antis-ncc-admin/src/components/WtXsckdListTotalsBar/index.vue @@ -14,6 +14,8 @@ | 收款金额 {{ skjeText }} | + 押金金额 {{ yjjeText }} + | 已退款 {{ refundedText }} | 实际收款 {{ actualSkjeText }} @@ -21,6 +23,8 @@
@@ -66,6 +70,9 @@ export default { skjeText() { return this.formatMoney(this.totals && this.totals.totalSkje) }, + yjjeText() { + return this.formatMoney(this.totals && this.totals.totalYjje) + }, refundedText() { return this.formatMoney(this.totals && this.totals.totalRefunded) }, diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/lang/en.js b/Antis.Erp.Plat/antis-ncc-admin/src/lang/en.js index 471bfc6..079db40 100755 --- a/Antis.Erp.Plat/antis-ncc-admin/src/lang/en.js +++ b/Antis.Erp.Plat/antis-ncc-admin/src/lang/en.js @@ -145,6 +145,10 @@ export default { scanTip: 'APP Scan code login', accountTip: 'Please enter the account number', passwordTip: 'Please enter your password', + rememberAccount: 'Remember account', + showPassword: 'Show password', + hidePassword: 'Hide password', + loginErrorFallback: 'Login failed. Please check your account or password.', mobile: 'Please enter mobile number', rightMobile: 'Please enter the correct mobile number', smsCode: 'Please enter the verification code', diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/lang/zh.js b/Antis.Erp.Plat/antis-ncc-admin/src/lang/zh.js index 2aff3c6..4d86d8f 100755 --- a/Antis.Erp.Plat/antis-ncc-admin/src/lang/zh.js +++ b/Antis.Erp.Plat/antis-ncc-admin/src/lang/zh.js @@ -145,6 +145,10 @@ export default { scanTip: 'APP扫码登录', accountTip: '请输入账号', passwordTip: '请输入密码', + rememberAccount: '记住账号', + showPassword: '显示密码', + hidePassword: '隐藏密码', + loginErrorFallback: '登录失败,请检查账号或密码', mobile: '请输入手机号', rightMobile: '请输入正确的手机号', smsCode: '请输入验证码', diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/main.js b/Antis.Erp.Plat/antis-ncc-admin/src/main.js index 6fd8885..0b94e1a 100755 --- a/Antis.Erp.Plat/antis-ncc-admin/src/main.js +++ b/Antis.Erp.Plat/antis-ncc-admin/src/main.js @@ -21,6 +21,7 @@ import './permission' // permission control import './utils/error-log' // error log import { message } from './utils/message'; import { bindMessageBoxStackGuard } from '@/utils/stackedDialogZIndex' +import { initTagsViewPopupScope } from '@/utils/tagsViewPopupScope' import * as filters from './filters' // global filters import { openBizPage, buildNewTabRoute } from '@/utils/open-biz-page' @@ -36,6 +37,7 @@ Vue.use(Element, { i18n: (key, value) => i18n.t(key, value) }) bindMessageBoxStackGuard(Vue) +initTagsViewPopupScope(router) // 批量引入组件 import components from './components' Vue.use(components) diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/mixins/wtXsckdListTotalsMixin.js b/Antis.Erp.Plat/antis-ncc-admin/src/mixins/wtXsckdListTotalsMixin.js index d2f7a04..ffd218d 100644 --- a/Antis.Erp.Plat/antis-ncc-admin/src/mixins/wtXsckdListTotalsMixin.js +++ b/Antis.Erp.Plat/antis-ncc-admin/src/mixins/wtXsckdListTotalsMixin.js @@ -7,6 +7,7 @@ const EMPTY_TOTALS = { totalYdje: null, totalYsje: null, totalSkje: null, + totalYjje: null, totalRefunded: null, totalActualSkje: null } @@ -70,6 +71,7 @@ export default { totalYdje: d.totalYdje != null ? d.totalYdje : d.TotalYdje, totalYsje: d.totalYsje != null ? d.totalYsje : d.TotalYsje, totalSkje: d.totalSkje != null ? d.totalSkje : d.TotalSkje, + totalYjje: d.totalYjje != null ? d.totalYjje : d.TotalYjje, totalRefunded: d.totalRefunded != null ? d.totalRefunded : d.TotalRefunded, totalActualSkje: d.totalActualSkje != null ? d.totalActualSkje : d.TotalActualSkje } diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/router/index.js b/Antis.Erp.Plat/antis-ncc-admin/src/router/index.js index ce29339..c57c9d5 100755 --- a/Antis.Erp.Plat/antis-ncc-admin/src/router/index.js +++ b/Antis.Erp.Plat/antis-ncc-admin/src/router/index.js @@ -169,7 +169,31 @@ export const constantRoutes = [{ component: Layout, hidden: true, children: [ - { path: 'index', name: 'WtCwReportIndex', component: () => import('@/views/wtCwReport/index'), meta: { title: '财务报表', noCache: true } } + { path: 'index', name: 'WtCwReportIndex', component: () => import('@/views/wtCwReport/index'), meta: { title: '损益表', noCache: true } } + ] + }, + { + path: '/extend-cw-balance-sheet', + component: Layout, + hidden: true, + children: [ + { path: 'index', name: 'WtCwBalanceSheetIndex', component: () => import('@/views/wtCwBalanceSheet/index'), meta: { title: '资产负债表', noCache: true } } + ] + }, + { + path: '/wtWtdxkhcx', + component: Layout, + hidden: true, + children: [ + { path: 'index', name: 'WtWtdxkhcxIndex', component: () => import('@/views/wtWtdxkhcx/index'), meta: { title: '委托客户查询', noCache: true } } + ] + }, + { + path: '/wtWtdxkccx', + component: Layout, + hidden: true, + children: [ + { path: 'index', name: 'WtWtdxkccxIndex', component: () => import('@/views/wtWtdxkccx/index'), meta: { title: '委托库存查询', noCache: true } } ] }, // 欢迎首页常驻静态路由,避免动态路由尚未注册时被 * 重定向到 404 diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/store/modules/user.js b/Antis.Erp.Plat/antis-ncc-admin/src/store/modules/user.js index 26135b0..819f3b6 100755 --- a/Antis.Erp.Plat/antis-ncc-admin/src/store/modules/user.js +++ b/Antis.Erp.Plat/antis-ncc-admin/src/store/modules/user.js @@ -100,9 +100,7 @@ const actions = { }, pislogin({ commit }, userInfo) { const { account, password,hospitalname } = userInfo - console.log("userInfo:"+userInfo.hospitalname); return new Promise((resolve, reject) => { - console.log("调用pislogin"); Pislogin(qs.stringify({ account: account.trim(), password: md5(password), @@ -120,7 +118,6 @@ const actions = { setToken(data.token) resolve() }).catch(error => { - console.log("catch:"+error); reject(error) }) }) diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/styles/element-ui.scss b/Antis.Erp.Plat/antis-ncc-admin/src/styles/element-ui.scss index 75f7815..0382e22 100755 --- a/Antis.Erp.Plat/antis-ncc-admin/src/styles/element-ui.scss +++ b/Antis.Erp.Plat/antis-ncc-admin/src/styles/element-ui.scss @@ -83,6 +83,37 @@ box-sizing: content-box; } +// 日期/日期范围面板:年(<< >>) 与 月(< >) 切换按钮拉开间距,降低误触 +.el-picker-panel, +.el-date-range-picker, +.el-date-picker { + .el-picker-panel__icon-btn { + min-width: 28px; + min-height: 28px; + line-height: 28px; + padding: 0 6px; + box-sizing: border-box; + } + + // 左侧:上一年 与 上一月 + .el-picker-panel__icon-btn.el-icon-d-arrow-left { + margin-right: 12px; + } + + .el-picker-panel__icon-btn.el-icon-arrow-left { + margin-left: 4px; + } + + // 右侧:下一月 与 下一年 + .el-picker-panel__icon-btn.el-icon-arrow-right { + margin-right: 4px; + } + + .el-picker-panel__icon-btn.el-icon-d-arrow-right { + margin-left: 12px; + } +} + // tabs组件出现蓝色边框问题 .el-tabs__item:focus.is-active.is-focus:not(:active) { -webkit-box-shadow: none; diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/styles/modern-shell.scss b/Antis.Erp.Plat/antis-ncc-admin/src/styles/modern-shell.scss index 5762f65..d2e3822 100644 --- a/Antis.Erp.Plat/antis-ncc-admin/src/styles/modern-shell.scss +++ b/Antis.Erp.Plat/antis-ncc-admin/src/styles/modern-shell.scss @@ -1,5 +1,24 @@ @import './variables.scss'; +// 顶栏 + 多页签区域高度、侧栏宽度(供弹窗遮罩裁切到「内容区」) +// 默认按「有 TagsView / 侧栏展开」计算:避免 :has 不生效时遮罩裁切不准 +html { + --layout-shell-header-height: #{$layoutHeaderWithTagsHeight}; + --layout-shell-sidebar-width: #{$sideBarWidth}; +} + +html:not(:has(#tags-view-container)) { + --layout-shell-header-height: #{$layoutNavbarHeight}; +} + +html:has(#app .hideSidebar) { + --layout-shell-sidebar-width: #{$sideBarCollapseWidth}; +} + +html:has(#app .openSidebar) { + --layout-shell-sidebar-width: #{$sideBarWidth}; +} + // Vben5 风格设计令牌(全局壳层) #app { --shell-bg: #f4f7fb; @@ -250,3 +269,100 @@ // 侧栏菜单 Vben5 规范:置于 theme 之后再次引入,确保覆盖主题色对菜单的干扰 @import './sidebar.scss'; + +// ========== 弹窗/抽屉打开时保持侧栏、顶栏与多页签可切换 ========== +// 根因:Element UI .v-modal / .el-dialog__wrapper 默认 z-index≈2000 且全屏, +// 而 layout .fixed-header 仅 z-index:9、侧栏仅 1001,遮罩会罩住并压暗导航。 + +// 顶栏(Navbar + TagsView)抬到常规弹窗遮罩之上,页签不再被遮罩盖住变灰 +#app .fixed-header { + z-index: 4000 !important; + background-color: #fff; +} + +// 左侧菜单抬到遮罩之上,保证可点击切换菜单(与顶栏策略一致) +#app .sidebar-container { + z-index: 4000 !important; +} + +// 遮罩仅覆盖内容区:让出顶栏 + 侧栏,内容区仍有 dim +body > .v-modal { + top: var(--layout-shell-header-height) !important; + left: var(--layout-shell-sidebar-width) !important; + right: 0 !important; + width: auto !important; + height: auto !important; + bottom: 0 !important; +} + +// 居中大弹窗:限制在「侧栏右侧 + 顶栏/页签下方」的内容区内,避免标题被页签裁切 +// 注意:wrapper 的 display 不要写 !important,否则会压过 Element 关闭时的 inline display:none,导致关不掉/关完又弹出来 +body > .el-dialog__wrapper.NCC-dialog.NCC-dialog_center:not(.el-message-box__wrapper):not(.tags-view-popup-hidden), +.el-dialog__wrapper.NCC-dialog.NCC-dialog_center:not(.el-message-box__wrapper):not(.tags-view-popup-hidden) { + top: var(--layout-shell-header-height) !important; + left: var(--layout-shell-sidebar-width) !important; + right: 0 !important; + bottom: 0 !important; + width: auto !important; + height: auto !important; + padding: 16px 16px 24px !important; + margin: 0 !important; + box-sizing: border-box !important; + align-items: center !important; + justify-content: center !important; + overflow: auto !important; +} + +body > .el-dialog__wrapper.NCC-dialog.NCC-dialog_center:not(.el-message-box__wrapper):not(.tags-view-popup-hidden) .el-dialog, +.el-dialog__wrapper.NCC-dialog.NCC-dialog_center:not(.el-message-box__wrapper):not(.tags-view-popup-hidden) .el-dialog { + margin: auto !important; + max-height: calc(100vh - var(--layout-shell-header-height) - 40px) !important; + display: flex; + flex-direction: column; +} + +body > .el-dialog__wrapper.NCC-dialog.NCC-dialog_center:not(.el-message-box__wrapper) .el-dialog__header, +.el-dialog__wrapper.NCC-dialog.NCC-dialog_center:not(.el-message-box__wrapper) .el-dialog__header, +body > .el-dialog__wrapper.NCC-dialog.NCC-dialog_center:not(.el-message-box__wrapper) .el-dialog__footer, +.el-dialog__wrapper.NCC-dialog.NCC-dialog_center:not(.el-message-box__wrapper) .el-dialog__footer { + flex-shrink: 0; +} + +body > .el-dialog__wrapper.NCC-dialog.NCC-dialog_center:not(.el-message-box__wrapper) .el-dialog__body, +.el-dialog__wrapper.NCC-dialog.NCC-dialog_center:not(.el-message-box__wrapper) .el-dialog__body { + flex: 1 1 auto; + min-height: 0; + // 覆盖 common.scss 的 70vh:高度按内容区剩余空间算,避免再顶出视口 + max-height: none !important; + overflow: auto; +} + +// 弹层 wrapper 点击穿透,仅弹窗/抽屉本体接收事件(保留遮罩点击关闭) +.el-dialog__wrapper:not(.el-message-box__wrapper) { + pointer-events: none; + + .el-dialog { + pointer-events: auto; + } +} + +.el-drawer__wrapper { + pointer-events: none; + + .el-drawer { + pointer-events: auto; + } +} + +// 非当前页签的 body 弹层:隐藏但不销毁,切回页签可恢复 +// 弹窗可用 display:none;遮罩改用透明+禁点击,避免 display:none 导致 z-index 读丢、切回后遮罩无法配对 +body > .el-dialog__wrapper.tags-view-popup-hidden, +body > .el-drawer__wrapper.tags-view-popup-hidden { + display: none !important; +} + +body > .v-modal.tags-view-popup-hidden { + opacity: 0 !important; + visibility: hidden !important; + pointer-events: none !important; +} diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/utils/douyinPrintComponent.js b/Antis.Erp.Plat/antis-ncc-admin/src/utils/douyinPrintComponent.js index 8ac9147..e9dad11 100644 --- a/Antis.Erp.Plat/antis-ncc-admin/src/utils/douyinPrintComponent.js +++ b/Antis.Erp.Plat/antis-ncc-admin/src/utils/douyinPrintComponent.js @@ -418,7 +418,8 @@ export function setDouyinPrintDeviceInfo(deviceId) { /** * 通过抖店打印组件密文打印电子面单。 - * @param {{ printData: string, sign?: string, printParams?: string, templateUrl?: string, trackNo?: string }} payload + * 标准面单密文为 contents 第一段;商品规格自定义区为第二段(有 customTemplateUrl 时)。 + * @param {{ printData: string, sign?: string, printParams?: string, templateUrl?: string, trackNo?: string, customTemplateUrl?: string, customData?: object }} payload */ export async function printWaybillViaLocalComponent(payload, options = {}) { if (!payload || !payload.printData) { @@ -438,12 +439,42 @@ export async function printWaybillViaLocalComponent(payload, options = {}) { } localStorage.setItem(PRINTER_STORAGE_KEY, printer) + // TODO(自定义区-临时关闭):打印组件拉 customTemplateUrl 失败会导致整单失败(如 127.0.0.1:443)。 + // 恢复底部商品规格自定义区时改为 true,并同步取消 WaybillController 里对应清理逻辑。 + const ENABLE_WAYBILL_CUSTOM_AREA = false + const templateURL = payload.templateUrl || 'https://sf3-ttcdn-tos.pstatp.com/obj/logistics-davinci/template/template_76.xml' const documentID = payload.trackNo || genRequestId() const taskID = genRequestId() + // 第一段:标准面单密文;商品规格自定义区为第二段(有 customTemplateUrl 时) + const contents = [ + { + templateURL, + params: payload.printParams, + encryptedData: payload.printData, + signature: payload.sign || '', + // 临时关闭自定义区时不传 addData,避免组件仍去拉商家自定义区 + addData: ENABLE_WAYBILL_CUSTOM_AREA ? (payload.customData || undefined) : undefined + } + ] + const customUrl = payload.customTemplateUrl && String(payload.customTemplateUrl).trim() + const customData = payload.customData && typeof payload.customData === 'object' ? payload.customData : null + // TODO(自定义区-临时关闭):恢复时保留下列第二段追加逻辑 + if (ENABLE_WAYBILL_CUSTOM_AREA && customUrl && customData && customUrl !== templateURL) { + contents.push({ + templateURL: customUrl, + data: customData + }) + } else if (ENABLE_WAYBILL_CUSTOM_AREA && !customUrl && customData) { + // 兼容:后端偶发未回 customTemplateUrl 时,前端仍尝试用兜底地址(同源) + console.warn('[douyinPrint] 缺少 customTemplateUrl,底部商品区可能空白') + } else if (!ENABLE_WAYBILL_CUSTOM_AREA) { + console.info('[douyinPrint] 自定义区已临时关闭,仅打印标准面单') + } + const printResp = await sendPrintAndWaitResult( socket, { @@ -456,14 +487,7 @@ export async function printWaybillViaLocalComponent(payload, options = {}) { documents: [ { documentID, - contents: [ - { - templateURL, - params: payload.printParams, - encryptedData: payload.printData, - signature: payload.sign || '' - } - ] + contents } ] } diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/utils/get-page-title.js b/Antis.Erp.Plat/antis-ncc-admin/src/utils/get-page-title.js index a25bf27..e5839b9 100755 --- a/Antis.Erp.Plat/antis-ncc-admin/src/utils/get-page-title.js +++ b/Antis.Erp.Plat/antis-ncc-admin/src/utils/get-page-title.js @@ -6,10 +6,13 @@ const title = defaultSettings.title export default function getPageTitle(key, fullName) { const realTitle = getLanguage() === 'en' ? 'NCC' : getLanguage() === 'zhtw' ? 'NCC軟件開發平臺' : title + if (fullName) { + return `${fullName} - ${realTitle}` + } const hasKey = i18n.te(`route.${key}`) if (hasKey) { const pageName = i18n.t(`route.${key}`) return `${pageName} - ${realTitle}` } - return fullName ? `${fullName} - ${realTitle}` : realTitle + return realTitle } \ No newline at end of file diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/utils/i18n.js b/Antis.Erp.Plat/antis-ncc-admin/src/utils/i18n.js index 3af8bd3..05096b2 100755 --- a/Antis.Erp.Plat/antis-ncc-admin/src/utils/i18n.js +++ b/Antis.Erp.Plat/antis-ncc-admin/src/utils/i18n.js @@ -1,12 +1,12 @@ // translate router.meta.title, be used in breadcrumb sidebar tagsview export function generateTitle(title, fullName) { + // 动态菜单名称优先使用后端 fullName,避免 zh.js 等静态 i18n 覆盖菜单管理里的改名 + if (fullName) { + return fullName + } const hasKey = this.$te('route.' + title) - if (hasKey) { - // $t :this method from vue-i18n, inject in @/lang/index.js - const translatedTitle = this.$t('route.' + title) - - return translatedTitle + return this.$t('route.' + title) } - return fullName ? fullName : title + return title } \ No newline at end of file diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/utils/request.js b/Antis.Erp.Plat/antis-ncc-admin/src/utils/request.js index 0d5fdc9..5ded3ce 100755 --- a/Antis.Erp.Plat/antis-ncc-admin/src/utils/request.js +++ b/Antis.Erp.Plat/antis-ncc-admin/src/utils/request.js @@ -13,6 +13,12 @@ const service = axios.create({ timeout: define.timeout, // request timeout }) +// 登录/单点登录失败由登录页卡片内红条展示,需跳过全局 message 以免重复提示 +function isLoginRequest(url) { + const target = url || '' + return target.indexOf('/api/oauth/Login') > -1 || target.indexOf('/api/oauth/PisLogin') > -1 +} + // request interceptor service.interceptors.request.use( config => { @@ -65,22 +71,24 @@ service.interceptors.response.use( // 特殊接口处理 if (url.indexOf('/Base/DataSource/Actions/Test') > -1 || (url.indexOf('Model') > -1 && url.indexOf('Config') > -1)) return res if (res.code !== 200) { - message({ - message: res.msg || '请求出错,请重试', - type: 'error', - duration: 1500, - onClose: () => { - if (url.indexOf('/api/oauth/Login') < 0 && url.indexOf('/api/oauth/LockScreen') < 0 && (res.code === 600 || res.code === 601 || res.code === 602)) { - // 600:登录过期,请重新登录 601: 您的帐号在其他地方已登录,被强制踢出 602: Token验证失败 - store.dispatch('user/resetToken').then(() => { - // hash 路由下登录页地址为 #/login,需判断 hash 而非 pathname, - // 否则已在登录页时仍会被强制刷新,出现闪烁/循环 - if (window.location.hash.indexOf('login') > -1) return - setTimeout(() => { location.reload() }, 100); - }) + if (!isLoginRequest(url)) { + message({ + message: res.msg || '请求出错,请重试', + type: 'error', + duration: 1500, + onClose: () => { + if (url.indexOf('/api/oauth/Login') < 0 && url.indexOf('/api/oauth/LockScreen') < 0 && (res.code === 600 || res.code === 601 || res.code === 602)) { + // 600:登录过期,请重新登录 601: 您的帐号在其他地方已登录,被强制踢出 602: Token验证失败 + store.dispatch('user/resetToken').then(() => { + // hash 路由下登录页地址为 #/login,需判断 hash 而非 pathname, + // 否则已在登录页时仍会被强制刷新,出现闪烁/循环 + if (window.location.hash.indexOf('login') > -1) return + setTimeout(() => { location.reload() }, 100); + }) + } } - } - }) + }) + } return Promise.reject(new Error(res.msg || 'Error')) } else { return res @@ -90,11 +98,13 @@ service.interceptors.response.use( if (process.env.NODE_ENV === 'development') { console.log(error) // for debug } - message({ - message: '请求出错,请重试', - type: 'error', - duration: 1500 - }) + if (!isLoginRequest(error && error.config && error.config.url)) { + message({ + message: '请求出错,请重试', + type: 'error', + duration: 1500 + }) + } return Promise.reject(error) } ) diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/utils/tagsViewPopupScope.js b/Antis.Erp.Plat/antis-ncc-admin/src/utils/tagsViewPopupScope.js new file mode 100644 index 0000000..1e4b71a --- /dev/null +++ b/Antis.Erp.Plat/antis-ncc-admin/src/utils/tagsViewPopupScope.js @@ -0,0 +1,272 @@ +/** + * 多页签(TagsView)下 body 级弹层归属。 + * + * 要点: + * 1) 弹窗 wrapper 按 data-tags-view-path 归属页签;切走只 CSS 隐藏,不关业务 visible。 + * 2) Element UI 的 .v-modal 通常是「全局共用一块」:不可按 path 永久绑死某一页签, + * 否则两个客户档案(_inst 多开)各自打开新建后,反复切换会只剩一个页有遮罩。 + * 3) 遮罩显隐只跟「当前激活页签是否有未关闭弹窗」绑定。 + */ +export const PATH_ATTR = 'data-tags-view-path' +export const Z_ATTR = 'data-tags-view-z' +export const HIDDEN_CLASS = 'tags-view-popup-hidden' + +const BODY_WRAPPER_SELECTOR = + 'body > .el-dialog__wrapper:not(.el-message-box__wrapper), body > .el-drawer__wrapper' + +const ANY_WRAPPER_SELECTOR = '.el-dialog__wrapper:not(.el-message-box__wrapper), .el-drawer__wrapper' + +let activePath = '' +let observer = null +let scheduled = false + +function readDomZIndex(el) { + if (!el || el.nodeType !== 1) return 0 + const inline = el.style && el.style.zIndex + if (inline) { + const n = parseInt(inline, 10) + if (!Number.isNaN(n) && n > 0) return n + } + const z = parseInt(window.getComputedStyle(el).zIndex, 10) + return Number.isNaN(z) ? 0 : z +} + +function readZIndex(el) { + if (!el || el.nodeType !== 1) return 0 + const stored = el.getAttribute(Z_ATTR) + if (stored) { + const n = parseInt(stored, 10) + if (!Number.isNaN(n) && n > 0) return n + } + return readDomZIndex(el) +} + +function rememberZ(el) { + if (!el || el.nodeType !== 1) return 0 + const z = readDomZIndex(el) || readZIndex(el) + if (z > 0) el.setAttribute(Z_ATTR, String(z)) + return z +} + +function isElementUiClosed(wrapper) { + return !!(wrapper && wrapper.style && wrapper.style.display === 'none') +} + +function isBodyLevelWrapper(wrapper) { + return !!(wrapper && wrapper.parentElement === document.body) +} + +function isInPageWrapperVisible(wrapper) { + if (!wrapper || wrapper.nodeType !== 1) return false + if (isElementUiClosed(wrapper)) return false + if (wrapper.classList.contains(HIDDEN_CLASS)) return false + return wrapper.offsetWidth > 0 || wrapper.offsetHeight > 0 +} + +function isScopedBodyWrapper(el) { + if (!el || el.nodeType !== 1) return false + if (!isBodyLevelWrapper(el)) return false + if (el.classList.contains('el-message-box__wrapper')) return false + return el.classList.contains('el-dialog__wrapper') || el.classList.contains('el-drawer__wrapper') +} + +function hasOpenMessageBox() { + let open = false + document.querySelectorAll('body > .el-message-box__wrapper').forEach(box => { + if (!isElementUiClosed(box)) open = true + }) + return open +} + +/** 指定页签是否有业务未关闭的 body 级弹窗(含被 CSS 隐藏的) */ +function hasOpenBodyDialog(path) { + if (!path) return false + let open = false + document.querySelectorAll(BODY_WRAPPER_SELECTOR).forEach(wrapper => { + if (wrapper.getAttribute(PATH_ATTR) !== path) return + if (isElementUiClosed(wrapper)) return + open = true + }) + return open +} + +function hasVisibleInPageDialog() { + let open = false + document.querySelectorAll(ANY_WRAPPER_SELECTOR).forEach(wrapper => { + if (isBodyLevelWrapper(wrapper)) return + if (isInPageWrapperVisible(wrapper)) open = true + }) + return open +} + +/** 当前激活页签是否需要内容区遮罩 */ +function activeTabNeedsMask() { + if (hasOpenMessageBox()) return true + if (activePath && hasOpenBodyDialog(activePath)) return true + if (hasVisibleInPageDialog()) return true + return false +} + +function tagBodyWrapper(wrapper) { + if (!isScopedBodyWrapper(wrapper)) return + if (!wrapper.hasAttribute(PATH_ATTR) && activePath) { + wrapper.setAttribute(PATH_ATTR, activePath) + } + rememberZ(wrapper) +} + +/** + * 多弹窗同时「业务打开」时,Element 共用遮罩的 z-index 往往跟最后打开的弹窗走。 + * 切回较早打开的页签时,要把当前页弹窗抬到遮罩之上,避免被罩住点不到。 + * 注意:不得超过壳层顶栏/侧栏(z-index:4000),否则会盖住页签。 + */ +function ensureActiveDialogAboveModal() { + const SHELL_Z = 4000 + const DIALOG_Z_CAP = SHELL_Z - 10 + + let maxModalZ = 0 + document.querySelectorAll('body > .v-modal').forEach(modal => { + if (modal.classList.contains(HIDDEN_CLASS)) return + maxModalZ = Math.max(maxModalZ, readZIndex(modal) || rememberZ(modal)) + }) + if (maxModalZ <= 0) return + + document.querySelectorAll(BODY_WRAPPER_SELECTOR).forEach(wrapper => { + if (wrapper.getAttribute(PATH_ATTR) !== activePath) return + if (isElementUiClosed(wrapper)) return + if (wrapper.classList.contains(HIDDEN_CLASS)) return + const wz = rememberZ(wrapper) + if (wz > 0 && wz <= maxModalZ) { + const next = Math.min(maxModalZ + 1, DIALOG_Z_CAP) + if (next > wz) { + wrapper.style.zIndex = String(next) + wrapper.setAttribute(Z_ATTR, String(next)) + } + } + }) +} + +function applyVisibility() { + document.querySelectorAll(BODY_WRAPPER_SELECTOR).forEach(tagBodyWrapper) + + // 弹窗:非当前页签隐藏;Element 已关闭(inline display:none)也必须加隐藏类 + // 避免壳层定位样式与关闭态冲突,出现「关掉又弹出来 / 关不掉」 + document.querySelectorAll(BODY_WRAPPER_SELECTOR).forEach(wrapper => { + const path = wrapper.getAttribute(PATH_ATTR) + if (!path) { + if (isElementUiClosed(wrapper)) wrapper.classList.add(HIDDEN_CLASS) + return + } + const hide = path !== activePath || isElementUiClosed(wrapper) + wrapper.classList.toggle(HIDDEN_CLASS, hide) + }) + + // 遮罩:Element 常共用一块,只跟「当前页是否有打开弹窗」绑定 + const needMask = activeTabNeedsMask() + document.querySelectorAll('body > .v-modal').forEach(modal => { + rememberZ(modal) + if (hasOpenMessageBox()) { + modal.classList.remove(HIDDEN_CLASS) + return + } + modal.classList.toggle(HIDDEN_CLASS, !needMask) + }) + + if (needMask) ensureActiveDialogAboveModal() + + syncBodyPopupLock(needMask) +} + +function syncBodyPopupLock(needMask) { + if (typeof document === 'undefined') return + const lock = !!(needMask || hasOpenMessageBox()) + if (lock) document.body.classList.add('el-popup-parent--hidden') + else document.body.classList.remove('el-popup-parent--hidden') +} + +function scheduleSync() { + if (scheduled) return + scheduled = true + const run = () => { + scheduled = false + applyVisibility() + } + if (typeof requestAnimationFrame === 'function') { + requestAnimationFrame(run) + } else { + setTimeout(run, 0) + } +} + +function onMutation(mutations) { + let touched = false + mutations.forEach(mutation => { + if (mutation.type === 'attributes') { + const el = mutation.target + // 只关心 body 直挂的弹窗/遮罩(Element 关闭时改 style.display) + if (el && el.parentElement === document.body) { + if (isScopedBodyWrapper(el) || (el.classList && el.classList.contains('v-modal'))) { + touched = true + } + } + return + } + mutation.addedNodes.forEach(node => { + if (node.nodeType !== 1) return + if (isScopedBodyWrapper(node) || (node.classList && node.classList.contains('v-modal'))) { + if (isScopedBodyWrapper(node)) tagBodyWrapper(node) + else rememberZ(node) + touched = true + } + }) + mutation.removedNodes.forEach(node => { + if (node.nodeType !== 1) return + if ((node.classList && node.classList.contains('v-modal')) || isScopedBodyWrapper(node)) { + touched = true + } + }) + }) + if (touched) scheduleSync() +} + +function onRouteChange(to) { + activePath = (to && to.fullPath) || '' + scheduleSync() +} + +/** + * @param {import('vue-router').default} router + */ +export function initTagsViewPopupScope(router) { + if (typeof document === 'undefined' || !router) return + + activePath = router.currentRoute && router.currentRoute.fullPath ? router.currentRoute.fullPath : '' + + if (!observer && typeof MutationObserver !== 'undefined') { + observer = new MutationObserver(onMutation) + observer.observe(document.body, { + childList: true, + subtree: true, + attributes: true, + attributeFilter: ['style', 'class'] + }) + } + + router.afterEach(to => { + onRouteChange(to) + }) + + scheduleSync() +} + +export function __tagsViewPopupScopeTestHooks() { + return { + onRouteChange, + applyVisibility, + tagWrapper: tagBodyWrapper, + getActivePath: () => activePath, + HIDDEN_CLASS, + PATH_ATTR, + activeTabNeedsMask + } +} diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/utils/wtFpsqApi.js b/Antis.Erp.Plat/antis-ncc-admin/src/utils/wtFpsqApi.js new file mode 100644 index 0000000..b682f49 --- /dev/null +++ b/Antis.Erp.Plat/antis-ncc-admin/src/utils/wtFpsqApi.js @@ -0,0 +1,33 @@ +import request from '@/utils/request' + +/** 提交申请 → 待财务开票 */ +export function postFpsqSubmitForAudit(id) { + return request({ + url: `/api/Extend/WtFpsq/Actions/SubmitForAudit/${id}`, + method: 'POST', + data: {} + }) +} + +/** 财务确认开出 → 已开票待确认 */ +export function postFpsqConfirmIssued(id, body) { + const payload = body || {} + return request({ + url: `/api/Extend/WtFpsq/Actions/ConfirmIssued/${id}`, + method: 'POST', + data: { + fphm: payload.fphm != null ? String(payload.fphm).trim() : '', + kprq: payload.kprq != null && payload.kprq !== '' ? payload.kprq : undefined, + remark: payload.remark != null ? String(payload.remark).trim() : undefined + } + }) +} + +/** 申请人确认完结 → 已完结 */ +export function postFpsqConfirmDone(id) { + return request({ + url: `/api/Extend/WtFpsq/Actions/ConfirmDone/${id}`, + method: 'POST', + data: {} + }) +} diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/utils/wtFpsqDjztDisplay.js b/Antis.Erp.Plat/antis-ncc-admin/src/utils/wtFpsqDjztDisplay.js new file mode 100644 index 0000000..d0ea983 --- /dev/null +++ b/Antis.Erp.Plat/antis-ncc-admin/src/utils/wtFpsqDjztDisplay.js @@ -0,0 +1,70 @@ +import { hasWtRejectSpbzMarker, isWtDjztRejected } from '@/utils/wtDjztDisplay' + +/** 发票申请新流程状态 */ +export const WT_FPSQ_STATUS = { + PENDING_FINANCE: '待财务开票', + PENDING_CONFIRM: '已开票待确认', + DONE: '已完结', + REJECTED: '已驳回' +} + +function normalizeDjzt(djzt) { + return djzt == null ? '' : String(djzt).trim() +} + +/** + * 发票申请展示状态(含旧「待审核/已审核/审核不通过」兼容) + */ +export function getWtFpsqDjztDisplayLabel(djzt, spbz) { + const z = normalizeDjzt(djzt) + if (isWtDjztRejected(z, spbz) || z === '审核不通过') return WT_FPSQ_STATUS.REJECTED + if (z === '待审核' || z === '一级已审' || z === '待二级' || z === '一级已审/待二级') { + return WT_FPSQ_STATUS.PENDING_FINANCE + } + if (z === '已审核') return WT_FPSQ_STATUS.DONE + if (!z || z === '草稿') return '草稿' + if ( + z === WT_FPSQ_STATUS.PENDING_FINANCE || + z === WT_FPSQ_STATUS.PENDING_CONFIRM || + z === WT_FPSQ_STATUS.DONE || + z === WT_FPSQ_STATUS.REJECTED + ) { + return z + } + return z +} + +export function getWtFpsqDjztTagType(djzt, spbz) { + const label = getWtFpsqDjztDisplayLabel(djzt, spbz) + if (label === WT_FPSQ_STATUS.DONE) return 'success' + if (label === '草稿') return 'info' + if (label === WT_FPSQ_STATUS.REJECTED) return 'danger' + if (label === WT_FPSQ_STATUS.PENDING_CONFIRM) return 'warning' + if (label === WT_FPSQ_STATUS.PENDING_FINANCE) return 'warning' + return 'info' +} + +/** 是否处于财务待开票(含旧待审核) */ +export function isFpsqPendingFinance(djzt) { + const z = normalizeDjzt(djzt) + return !z || z === '待审核' || z === '待财务开票' || z === '一级已审' || z === '待二级' || z === '一级已审/待二级' +} + +/** 是否已开票待申请人确认 */ +export function isFpsqPendingConfirm(djzt) { + return normalizeDjzt(djzt) === WT_FPSQ_STATUS.PENDING_CONFIRM +} + +/** 列表编辑:草稿 / 已驳回 */ +export function canFpsqEdit(djzt, spbz) { + const label = getWtFpsqDjztDisplayLabel(djzt, spbz) + return label === '草稿' || label === WT_FPSQ_STATUS.REJECTED +} + +export function canFpsqDelete(djzt, spbz) { + return canFpsqEdit(djzt, spbz) +} + +export function canFpsqSubmit(djzt, spbz) { + return canFpsqEdit(djzt, spbz) +} diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/utils/wtRejectApproval.js b/Antis.Erp.Plat/antis-ncc-admin/src/utils/wtRejectApproval.js index 302cddd..0f96ecb 100644 --- a/Antis.Erp.Plat/antis-ncc-admin/src/utils/wtRejectApproval.js +++ b/Antis.Erp.Plat/antis-ncc-admin/src/utils/wtRejectApproval.js @@ -188,6 +188,24 @@ export function postCzdReject(id, remark) { }) } +/** 门店支出单:审核通过 */ +export function postMdzcdApprove(id, remark) { + return request({ + url: `/api/Extend/WtMdzcd/Actions/Approve/${id}`, + method: 'POST', + data: { remark: remark || '' } + }) +} + +/** 门店支出单:审核不通过 */ +export function postMdzcdReject(id, remark) { + return request({ + url: `/api/Extend/WtMdzcd/Actions/Reject/${id}`, + method: 'POST', + data: { remark: remark || '' } + }) +} + /** 拆装单:反审(已审核 → 草稿) */ export function postCzdReverse(id) { return request({ diff --git a/Antis.Erp.Plat/antis-ncc-admin/src/views/MyCouponUseHistory/ExportBox.vue b/Antis.Erp.Plat/antis-ncc-admin/src/views/MyCouponUseHistory/ExportBox.vue index 4fc5c07..de69e3b 100755 --- a/Antis.Erp.Plat/antis-ncc-admin/src/views/MyCouponUseHistory/ExportBox.vue +++ b/Antis.Erp.Plat/antis-ncc-admin/src/views/MyCouponUseHistory/ExportBox.vue @@ -1,6 +1,6 @@