diff --git a/src/pages/ComplaintForwardingProcess/index.less b/src/pages/ComplaintForwardingProcess/index.less new file mode 100644 index 0000000..45722ac --- /dev/null +++ b/src/pages/ComplaintForwardingProcess/index.less @@ -0,0 +1,9 @@ +/* + 由于现在使用 Iframe 隔离打印方案, + 样式已直接在 index.tsx 的 iframe 注入逻辑中定义。 + 此文件目前仅保留页面基础样式(如有)。 +*/ + +.print-ignore { + /* 页面按钮展示样式 */ +} \ No newline at end of file diff --git a/src/pages/ComplaintForwardingProcess/index.tsx b/src/pages/ComplaintForwardingProcess/index.tsx index 9917ffc..7c225ac 100644 --- a/src/pages/ComplaintForwardingProcess/index.tsx +++ b/src/pages/ComplaintForwardingProcess/index.tsx @@ -1,32 +1,206 @@ -import { Button } from "antd" - +import { Button } from "antd"; +import ReactDOM from "react-dom"; +import "./index.less"; const ComplaintForwardingProcess = () => { + // 附件1 结构 + const Attachment1 = () => ( +
+
附件1:受理工单
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
投诉人联系电话
受理部门受理时间
转办部门来电类别
来电内容
转办要求
处理反馈结果(可附页) +
+ 反馈人:         时间:   年   月   日   时   分 +
+
+
+ ); - // 打印附件1 - const handlePrintAttachment1 = () => { - } + // 附件2 结构 + const Attachment2 = () => ( +
+
“12328”交通运输服务监督电话话务转办单
+
编号:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
来电人联系电话
受理部门受理时间
转办单位来电类别
来电内容
转办要求 +
+ 转办人:         时间: +
+
处理反馈结果(可附页) +
+ 反馈人:         时间: +
+
+
+ ); - // 打印附件2 - const handlePrintAttachment2 = () => { - } + // 附件3 结构 + const Attachment3 = () => ( +
+
网络舆情处置报告书
+
反馈时间:   年   月   日
+ + + + + + + + + + + + + + + + + + + + + + + + + +
反馈单位(加盖公章)
签发人
联系人手机号码
舆情概况
核实及处置情况(可另附页)
+
+ ); - // 打印附件3 - const handlePrintAttachment3 = () => { - } + // 真正的打印函数,使用 Iframe 隔离 + const handlePrintByIframe = (AttachmentComponent: React.ComponentType) => { + // 1. 创建隐藏的 iframe + const iframe = document.createElement('iframe'); + iframe.style.position = 'fixed'; + iframe.style.right = '0'; + iframe.style.bottom = '0'; + iframe.style.width = '0'; + iframe.style.height = '0'; + iframe.style.border = '0'; + document.body.appendChild(iframe); - return
- - - -
-} + const iframeDoc = iframe.contentWindow?.document; + if (!iframeDoc) return; + // 2. 注入样式和容器 + iframeDoc.open(); + iframeDoc.write(` + + + 打印预览 + + + + + + + `); + iframeDoc.close(); -export default ComplaintForwardingProcess \ No newline at end of file + // 3. 将 React 组件渲染到 iframe 中 + const printRoot = iframeDoc.getElementById('print-root'); + if (printRoot) { + ReactDOM.render(, printRoot); + } + + // 4. 调用打印 + setTimeout(() => { + iframe.contentWindow?.focus(); + iframe.contentWindow?.print(); + // 5. 打印完成后清理 + setTimeout(() => { + document.body.removeChild(iframe); + }, 1000); + }, 300); + }; + + return ( +
+
+ + + +
+ +
+ 提示:点击按钮将使用 Iframe 隔离技术打开打印预览。这能确保**只打印表格内容**,而不会包含页面上的其他元素。 +
+
+ ); +}; + +export default ComplaintForwardingProcess; diff --git a/src/pages/DigitalElectronics/index.tsx b/src/pages/DigitalElectronics/index.tsx index 61a951d..8bc9255 100644 --- a/src/pages/DigitalElectronics/index.tsx +++ b/src/pages/DigitalElectronics/index.tsx @@ -564,9 +564,18 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => { PageSize: 999999, SortStr: "BILLDETAIL_ID" }) + console.log('billDetailbillDetail', billDetail); + let billDetailReq: any = [] // 可能存在的不动产数据 let estateLeaseItems: any = [] + // 判断 票据信息里面是否有税务代码 + // 2026-01-23 朱老师点头 判断是否有不动产号 有的话 不动产信息必填 不需要一一对应 即 有不动产编号的时候 不动产选择也必须要有 + // 判断是不是全部的 不动产商品 都已经选择了不动产 + let haveAllShopSelectRealEstate = true + // 判断是否有不动产 + let haveRealEstate = false + if (billDetail && billDetail.length > 0) { // 从当前商品的详情里面取出 用的到的 不动产id let REALESTATE_IDList: Number[] = [] @@ -585,10 +594,16 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => { REALESTATE_ID: item.REALESTATE_ID,// 不动产id BILLDETAIL_DESC: item.BILLDETAIL_DESC // 备注 }) + if (item.TABLE_NAME && item.TABLE_NAME.indexOf('30405020') !== -1) { + haveRealEstate = true + if (!item.REALESTATE_ID) { + haveAllShopSelectRealEstate = false + } + } + REALESTATE_IDList.push(Number(item.REALESTATE_ID)) }) - console.log('dhaskdhaslhdasl', billDetail); // REALESTATE_ID 是,隔开的不动产id 这里去查询 记录 有多少条 const req: any = { searchParameter: { @@ -603,7 +618,6 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => { value: encryptAES(JSON.stringify(req)) } const data: any = await handleGetREALESTATEList(newReq) - console.log('dhaskdhaslhdasl', data); // 这个服务区的全部不动产的数据 都在data里面 if (data && data.length > 0) { let unitObj: any = { @@ -634,7 +648,15 @@ const DigitalElectronics: React.FC<{ currentUser: any }> = (props) => { } } - + // 判断不动产信息是否已经选择了 + // haveRealEstate true 说明票的商品明细里面有不动产 不然就是没有 + if (haveRealEstate) { + if (haveAllShopSelectRealEstate && estateLeaseItems && estateLeaseItems.length > 0) { + } else { + message.error('请选择不动产信息') + return + } + } let obj: any = { billNo: record?.BILL_NO, // 单据编号