Commit 9d98a45c authored by krysent's avatar krysent

标签打印

parent 97fa0889
...@@ -38,9 +38,14 @@ export default [ ...@@ -38,9 +38,14 @@ export default [
name: "入库管理", name: "入库管理",
component: "./insertstore/Instore", component: "./insertstore/Instore",
}, },
{
path: "/wms/otherOutstore",
name: "其他出库单",
component: "./outsetstore/Otheroutstore",
},
{ {
path: "/wms/outstore", path: "/wms/outstore",
name: "出库管理", name: "生产叫料单",
component: "./outsetstore/Outstore", component: "./outsetstore/Outstore",
}, },
{ {
......
import React, { useEffect, useRef, useReducer, useState } from "react"; import React, { useEffect, useRef, useReducer, useState } from "react";
import { Button, Tooltip, Row, Divider, Drawer } from "antd"; import {
Button,
Tooltip,
Row,
Divider,
Drawer,
Modal,
Space,
message,
} from "antd";
import AutoTable from "@/components/AutoTable"; import AutoTable from "@/components/AutoTable";
import getPrem from "@/utils/getPrem"; //权限判断fn import getPrem from "@/utils/getPrem"; //权限判断fn
import { useRequest } from "umi"; import { useRequest } from "umi";
import defaultFields from "./fields"; import defaultFields from "./fields";
import { doFetch } from "@/utils/doFetch"; import { doFetch } from "@/utils/doFetch";
import InitForm from "@/components/InitForm"; import InitForm from "@/components/InitForm";
import Details from "@/components/Details"; import { start } from "@/utils/printHandle.js";
import { stationDetail } from "@/utils/detailTotalCard"; import { ExclamationCircleFilled } from "@ant-design/icons";
import Coltext from "@/components/Coltext"; const { confirm } = Modal;
const Station = (props) => { const Station = (props) => {
let actionRef = useRef(), let actionRef = useRef(),
...@@ -102,6 +111,7 @@ const Station = (props) => { ...@@ -102,6 +111,7 @@ const Station = (props) => {
const [drawer, setDrawer] = useState({ const [drawer, setDrawer] = useState({
visible: false, visible: false,
}); });
const [selectIds, setselectIds] = useState([]);
let saveData = (values, fn) => { let saveData = (values, fn) => {
let newfields = JSON.parse(JSON.stringify(values)); let newfields = JSON.parse(JSON.stringify(values));
...@@ -114,6 +124,22 @@ const Station = (props) => { ...@@ -114,6 +124,22 @@ const Station = (props) => {
}); });
}; };
const showConfirm = () => {
confirm({
title: `当前已选择 ${selectIds?.length} 条标签数据,是否全部打印?`,
icon: <ExclamationCircleFilled />,
width: 500,
onOk() {
start("/ngic-workmanship/wmsMaterieLabel/queryByIds", {
ids: selectIds,
});
},
onCancel() {
console.log("Cancel");
},
});
};
const OptionsBtn = () => { const OptionsBtn = () => {
return ( return (
<> <>
...@@ -129,7 +155,12 @@ const Station = (props) => { ...@@ -129,7 +155,12 @@ const Station = (props) => {
<Button <Button
type="primary" type="primary"
onClick={() => { onClick={() => {
setDrawer((v) => ({ ...v, visible: true, title: " 子卷补码" })); if (selectIds.length == 0) {
message.destroy();
message.warning("请选择数据!", 2);
return;
}
showConfirm();
}} }}
> >
子卷补码 子卷补码
...@@ -138,6 +169,14 @@ const Station = (props) => { ...@@ -138,6 +169,14 @@ const Station = (props) => {
); );
}; };
const rowSelection = {
onChange: (selectedRowKeys, selectedRows) => {
console.log(selectedRowKeys, selectedRows);
setselectIds(selectedRowKeys);
},
preserveSelectedRowKeys:true
};
return ( return (
<div> <div>
<AutoTable <AutoTable
...@@ -147,6 +186,10 @@ const Station = (props) => { ...@@ -147,6 +186,10 @@ const Station = (props) => {
path="/ngic-workmanship/wmsMaterieLabel/page" path="/ngic-workmanship/wmsMaterieLabel/page"
actionRef={actionRef} actionRef={actionRef}
onRef={(node) => (ChildRef = node)} onRef={(node) => (ChildRef = node)}
rowSelection={{
type: "checkbox",
...rowSelection,
}}
></AutoTable> ></AutoTable>
<Drawer <Drawer
title={drawer?.title} title={drawer?.title}
...@@ -185,7 +228,6 @@ const Station = (props) => { ...@@ -185,7 +228,6 @@ const Station = (props) => {
保存并打印 保存并打印
</Button> </Button>
</Drawer> </Drawer>
</div> </div>
); );
}; };
......
...@@ -264,7 +264,7 @@ const Materiel = (props) => { ...@@ -264,7 +264,7 @@ const Materiel = (props) => {
title: "默认库区", title: "默认库区",
dataIndex: "storeAreaName", dataIndex: "storeAreaName",
key: "storeAreaName", key: "storeAreaName",
search:false search: false,
}, },
{ {
...@@ -289,7 +289,7 @@ const Materiel = (props) => { ...@@ -289,7 +289,7 @@ const Materiel = (props) => {
return [ return [
getPrem("sysDepartment_save", action, "修改", () => { getPrem("sysDepartment_save", action, "修改", () => {
doFetch({ doFetch({
url: "/ngic-workmanship/pmMaterie/queryById", url: "/ngic-workmanship/pmMaterie/queryDetailById",
params: { id: record.id }, params: { id: record.id },
}).then((res) => { }).then((res) => {
if (res.code == "0000") { if (res.code == "0000") {
...@@ -366,6 +366,38 @@ const Materiel = (props) => { ...@@ -366,6 +366,38 @@ const Materiel = (props) => {
formRef formRef
.validateFields() .validateFields()
.then((firstValues) => { .then((firstValues) => {
formRefs
.validateFields()
.then((secondFields) => {
let secondFieldsKeys = Object.keys(secondFields);
let materieCharList = defaultSpecificFileds.map((it) => {
if (secondFieldsKeys.indexOf(it.fieldsKey) != -1) {
it.fieldRealValue = secondFields[it.fieldsKey];
}
const el = {
fieldType: it.fieldType,
fieldTypeName: it.fieldTypeName,
fieldCondName: it.fieldCondName,
fieldCondKey: it.fieldCondKey,
optCondName: it.optCondName,
optCondKey: it.optCondKey,
fieldId: it.fieldId,
fieldName: it.fieldName,
fieldChar: it.fieldChar,
fieldCharName: it.fieldCharName,
fieldCharValue: it.fieldCharValue,
fieldRealValue: it.fieldRealValue,
valueList: it.valueList,
};
return el;
});
let materieProductUnitList =
firstValues?.materieProductUnitList?.map((it) => {
return {
productionUnit: it.productionUnit,
conversionRate: it.conversionRate,
};
});
for (let i in firstValues) { for (let i in firstValues) {
if (firstValues[i] === undefined) { if (firstValues[i] === undefined) {
firstValues[i] = null; firstValues[i] = null;
...@@ -373,13 +405,16 @@ const Materiel = (props) => { ...@@ -373,13 +405,16 @@ const Materiel = (props) => {
} }
params = { params = {
...firstValues, ...firstValues,
materieCharList,
...difrid, ...difrid,
materieProductUnitList,
}; };
console.log(params);
url = "/ngic-workmanship/pmMaterie/save"; url = "/ngic-workmanship/pmMaterie/save";
run({ url, params }); run({ url, params });
}) })
.catch((error) => {}); .catch((error) => {});
})
.catch((error) => {});
} else { } else {
url = "/ngic-workmanship/pmMaterie/saveMaterieBom"; url = "/ngic-workmanship/pmMaterie/saveMaterieBom";
let firstValues = formRef?.getFieldsValue(); let firstValues = formRef?.getFieldsValue();
...@@ -524,6 +559,7 @@ const Materiel = (props) => { ...@@ -524,6 +559,7 @@ const Materiel = (props) => {
/> />
</div> </div>
</AutoTable> </AutoTable>
<Drawer <Drawer
title={iftype.title} title={iftype.title}
visible={vs} visible={vs}
...@@ -544,6 +580,17 @@ const Materiel = (props) => { ...@@ -544,6 +580,17 @@ const Materiel = (props) => {
return null; return null;
}} }}
></InitForm> ></InitForm>
<div style={{ fontSize: 16, fontWeight: "bold", marginBottom: 15 }}>
特定属性
</div>
<InitForm
formRef={formRefs}
fields={specificFileds}
onChange={(changedValues, allValues) => {}}
actions={() => {
return null;
}}
></InitForm>
</> </>
} }
<Button <Button
......
...@@ -145,14 +145,14 @@ function Instore(props) { ...@@ -145,14 +145,14 @@ function Instore(props) {
key: "length", key: "length",
search: false, search: false,
}, },
{ // {
title: "库存信息", // title: "库存信息",
dataIndex: "option", // dataIndex: "option",
key: "option", // key: "option",
valueType: "option", // valueType: "option",
width: 100, // width: 100,
render: (text, row, _, action) => extraAction(text, row, _, action), // render: (text, row, _, action) => extraAction(text, row, _, action),
}, // },
]; ];
return ( return (
......
...@@ -52,78 +52,79 @@ const Storesearch = (props) => { ...@@ -52,78 +52,79 @@ const Storesearch = (props) => {
"dataIndex": "productionUnitName", "dataIndex": "productionUnitName",
"key": "productionUnitName", "key": "productionUnitName",
"search": false "search": false
}, {
"title": "库存信息",
"valueType": "option",
"width": 88,
"search": false,
"render": (dom, record) => {
return <a
onClick={() => {
Modal.info({
title: "库存信息",
width: 1200,
okText: "知道了",
content: (
<div>
<AutoTable
withCard={false}
columns={[
{
"title": "仓库编号",
"dataIndex": "storeCode",
"key": "storeCode",
},
{
"title": "仓库名称",
"dataIndex": "storeName",
"key": "storeName"
},
{
"title": "库位名称",
"dataIndex": "storePositionName",
"key": "storePositionName"
},
{
"title": "批次号/SN号",
"dataIndex": "materieControlNo",
"key": "materieControlNo"
},
{
"title": "供应商编号",
"dataIndex": "supplierNo",
"key": "supplierNo"
},
{
"title": "供应商名称",
"dataIndex": "supplierName",
"key": "supplierName"
}, },
{ // {
"title": "库存数量", // "title": "库存信息",
"dataIndex": "stroeNum", // "valueType": "option",
"key": "stroeNum", // "width": 88,
search:false // "search": false,
}, // "render": (dom, record) => {
]} // return <a
path="/ngic-workmanship/wmsMaterieStore/queryPositionList" // onClick={() => {
extraparams={{ // Modal.info({
level: select.level ?? 0, // title: "库存信息",
key: select.selectedKeys ?? "", // width: 1200,
materieId: record.materieId // okText: "知道了",
}} // content: (
> // <div>
// <AutoTable
</AutoTable> // withCard={false}
</div> // columns={[
) // {
}) // "title": "仓库编号",
}} // "dataIndex": "storeCode",
> // "key": "storeCode",
查看 // },
</a> // {
} // "title": "仓库名称",
} // "dataIndex": "storeName",
// "key": "storeName"
// },
// {
// "title": "库位名称",
// "dataIndex": "storePositionName",
// "key": "storePositionName"
// },
// {
// "title": "批次号/SN号",
// "dataIndex": "materieControlNo",
// "key": "materieControlNo"
// },
// {
// "title": "供应商编号",
// "dataIndex": "supplierNo",
// "key": "supplierNo"
// },
// {
// "title": "供应商名称",
// "dataIndex": "supplierName",
// "key": "supplierName"
// },
// {
// "title": "库存数量",
// "dataIndex": "stroeNum",
// "key": "stroeNum",
// search:false
// },
// ]}
// path="/ngic-workmanship/wmsMaterieStore/queryPositionList"
// extraparams={{
// level: select.level ?? 0,
// key: select.selectedKeys ?? "",
// materieId: record.materieId
// }}
// >
// </AutoTable>
// </div>
// )
// })
// }}
// >
// 查看
// </a>
// }
// }
] ]
const tableprops = { const tableprops = {
......
This diff is collapsed.
This diff is collapsed.
.sitelayout {
min-height: calc(100vh - 98px) !important;
.sitelayoutbackground {
background: #fff;
}
}
.title{
margin: 0px;
}
\ No newline at end of file
import { doFetch } from "@/utils/doFetch";
import React, {
useState,
useImperativeHandle,
forwardRef,
useRef,
} from "react";
import { useEffect } from "react";
import { ScrollBoard } from "@jiaminghi/data-view-react";
import { useWindowSize } from "@/utils/windowsize";
const pageStyle = `
@media all {
.page-break {
display: none;
}
}
@media print {
html, body {
height: initial !important;
overflow: initial !important;
position:relative;
-webkit-print-color-adjust: exact;
word-break: break-all;
}
}
@media print {
.page-break {
margin-top:0;
display: block;
page-break-before: auto;
}
}
@media print {
.page-noprint {
display: none !important;
}
}
@page {
size: auto;
margin: 0px;
}
`;
let columns = [
{
title: "物料编码 - 名称",
dataIndex: "materieName",
key: "materieName",
search: false,
render: (dom, row) => {
return (row.materieCode ?? "") + " - " + (row.materieName ?? "");
},
},
{
title: "出库数量",
dataIndex: "outstroeNum",
key: "outstroeNum",
search: false,
},
{
title: "库存单位",
dataIndex: "productionUnitName",
key: "productionUnitName",
search: false,
width: 60,
},
];
function PrintDom({ totalPath, val, totalParams, totalCard }, ref) {
let printRef = useRef();
const [data, setdata] = useState({});
useImperativeHandle(ref, () => ({
dom: printRef,
}));
useEffect(() => {
if (val == "detail") {
doFetch({ url: totalPath, params: totalParams }).then((res) => {
setdata(res?.data?.data);
});
} else {
}
}, [val]);
let datas = data?.materialList
? data?.materialList.map((it) => {
return columns.map((item) => {
if (item.render) {
return item.render(it, it);
} else {
return it[item.dataIndex];
}
});
})
: [];
return (
<>
<style type="text/css" media="print">
{pageStyle}
</style>
{val == "detail" && (
<div
ref={printRef}
style={{
width: "100%",
minHeight: "100%",
overflow: "inherit",
position: "relative",
}}
>
<div
style={{
display: "flex",
justifyContent: "space-between",
alignItems: "center",
padding: "0 2%",
paddingBottom: 12,
}}
>
<h1
style={{
width: "100%",
fontSize: 40,
marginTop: "-6px",
}}
>
出库工单
</h1>
<img
style={{
width: 300,
height: "auto",
}}
src={data?.qrCodeUrl}
alt=""
/>
</div>
<div
style={{
display: "flex",
flexWrap: "wrap",
paddingLeft: "2%",
marginTop: 24,
}}
>
{totalCard &&
totalCard[0].itemData
.filter((it) => !(it.noshow === true))
.map((it) => {
return (
<div
style={{
width: it.noshow ?? "32%",
backgroundColor: "#f9f9f9",
marginRight: "1%",
marginBottom: 10,
padding: "4px",
fontSize: 20,
overflow: "hidden",
}}
>
<b>{it.title}: </b>
<span>{data[it.key] || "-"}</span>
</div>
);
})}
</div>
<div
style={{
padding: "4px 2%",
position: "relative",
width: "100%",
overflow: "hidden",
}}
id="large"
>
<div
style={{
marginBottom: 18,
}}
>
<b>{totalCard && totalCard[1].cardTitle}</b>
</div>
<ScrollBoard
config={{
header: columns.map((it) => it.title),
data: datas,
rowNum: datas.length,
hoverPause: false,
}}
/>
</div>
</div>
)}
</>
);
}
export default forwardRef(PrintDom);
...@@ -186,11 +186,11 @@ function Outstore(props) { ...@@ -186,11 +186,11 @@ function Outstore(props) {
}, },
valueType: "select", valueType: "select",
}, },
{ // {
title: "相关单号", // title: "相关单号",
dataIndex: "businessNo", // dataIndex: "businessNo",
key: "businessNo", // key: "businessNo",
}, // },
{ {
title: "备注", title: "备注",
dataIndex: "remark", dataIndex: "remark",
...@@ -227,71 +227,6 @@ function Outstore(props) { ...@@ -227,71 +227,6 @@ function Outstore(props) {
}, },
], ],
}, },
{
title: "操作",
valueType: "option",
width: 240,
render: (text, record, _, action) => {
return [
getPrem(
"equipmentCustomer_save",
action,
"下架采集",
async () => {
let extra = defaultFields.dooutside(
record.id,
record.storeId
);
setdrawprops((s) => ({
...s,
visible: true,
//查看详情 props
val: "detail",
title: `下架采集`,
...extra,
totalPath:
"/ngic-workmanship/wmsMaterieOutstore/getOutStoreInfoById",
totalParams: { id: record.id },
extra: null,
}));
setInitialState((s) => {
return {
...s,
submits: {},
};
});
}
),
getPrem("equipmentCustomer_deleteById", action, "关单", null, {
title: "确认关单?",
onConfirm: () => {
doFetch({
url: "/ngic-workmanship/wmsMaterieOutstore/close",
params: { id: record.id },
}).then((res) => {
if (res.code == "0000") {
reload();
}
});
},
}),
record.status == 0 &&
getPrem("equipmentCustomer_deleteById", action, "删除", null, {
title: "确认删除?",
onConfirm: () => {
doFetch({
url: "/ngic-workmanship/wmsMaterieOutstore/deleteById",
params: { id: record.id },
}).then((res) => {
if (res.code == "0000") {
reload();
}
});
},
}),
];
},
},
]; ];
} else { } else {
return [ return [
...@@ -363,11 +298,11 @@ function Outstore(props) { ...@@ -363,11 +298,11 @@ function Outstore(props) {
}, },
valueType: "select", valueType: "select",
}, },
{ // {
title: "相关单号", // title: "相关单号",
dataIndex: "businessNo", // dataIndex: "businessNo",
key: "businessNo", // key: "businessNo",
}, // },
{ {
title: "备注", title: "备注",
dataIndex: "remark", dataIndex: "remark",
...@@ -419,42 +354,7 @@ function Outstore(props) { ...@@ -419,42 +354,7 @@ function Outstore(props) {
const tableprops = { const tableprops = {
...props, ...props,
pageextra:
activeTabKey == "1" ? (
<Dropdown
placement="bottomRight"
overlay={
<Menu
onClick={(e) => {
setdrawprops((s) => ({
...s,
visible: true,
title: "新增" + itemz[e.key],
fields: defaultFields[e.key],
outstoreType: keytoval[e.key],
val: "add", //类型
extra: null,
}));
}}
items={items}
/>
}
>
<Button type="primary">新增</Button>
</Dropdown>
) : (
"none"
),
tabList: [
{
tab: "未完成",
key: "1",
},
{
tab: "已完成",
key: "2",
},
],
activeTabKey, activeTabKey,
onTabChange, onTabChange,
columns, columns,
......
...@@ -72,6 +72,7 @@ let columns = [ ...@@ -72,6 +72,7 @@ let columns = [
]; ];
function PrintDom({ totalPath, val, totalParams, totalCard }, ref) { function PrintDom({ totalPath, val, totalParams, totalCard }, ref) {
console.log(totalCard);
let printRef = useRef(); let printRef = useRef();
const [data, setdata] = useState({}); const [data, setdata] = useState({});
useImperativeHandle(ref, () => ({ useImperativeHandle(ref, () => ({
...@@ -81,7 +82,9 @@ function PrintDom({ totalPath, val, totalParams, totalCard }, ref) { ...@@ -81,7 +82,9 @@ function PrintDom({ totalPath, val, totalParams, totalCard }, ref) {
useEffect(() => { useEffect(() => {
if (val == "detail") { if (val == "detail") {
doFetch({ url: totalPath, params: totalParams }).then((res) => { doFetch({ url: totalPath, params: totalParams }).then((res) => {
if (res.code == "0000") {
setdata(res?.data?.data); setdata(res?.data?.data);
}
}); });
} else { } else {
} }
......
...@@ -476,6 +476,9 @@ const Materiel = (props) => { ...@@ -476,6 +476,9 @@ const Materiel = (props) => {
for (let i in defaultFields) { for (let i in defaultFields) {
defaultFields[i].value = null; defaultFields[i].value = null;
defaultFields[i].disabled = false; defaultFields[i].disabled = false;
if (i == 'status') {
defaultFields[i].value = 1;
}
if ( if (
i == "serialNumberRuleId" || i == "serialNumberRuleId" ||
i == "labelTemplateId" || i == "labelTemplateId" ||
......
...@@ -37,7 +37,7 @@ import { ...@@ -37,7 +37,7 @@ import {
} from "@/services/system"; } from "@/services/system";
import { doFetch } from "@/utils/doFetch"; import { doFetch } from "@/utils/doFetch";
import { ProDescriptions } from "@ant-design/pro-components"; import { ProDescriptions } from "@ant-design/pro-components";
import { start } from "@/utils/printHandle.js";
const { Search } = Input; const { Search } = Input;
...@@ -614,13 +614,7 @@ const Login = () => { ...@@ -614,13 +614,7 @@ const Login = () => {
</Link> */} </Link> */}
</div> </div>
</LoginForm> </LoginForm>
<Button
onClick={() => {
start();
}}
>
start
</Button>
</div> </div>
<Footer></Footer> <Footer></Footer>
</div> </div>
......
...@@ -731,31 +731,31 @@ const materielDetail = [ ...@@ -731,31 +731,31 @@ const materielDetail = [
}, },
], ],
}, },
{ // {
cardTitle: "单位转换设置", // cardTitle: "单位转换设置",
itemData: [ // itemData: [
{ // {
key: "materieProductUnitList", // key: "materieProductUnitList",
type: "table", // type: "table",
col: { span: 24 }, // col: { span: 24 },
columns: [ // columns: [
{ // {
title: "辅助单位", // title: "辅助单位",
dataIndex: "productionUnitName", // dataIndex: "productionUnitName",
key: "productionUnitName", // key: "productionUnitName",
search: false, // search: false,
}, // },
{ // {
title: "转换比", // title: "转换比",
dataIndex: "conversionRate", // dataIndex: "conversionRate",
key: "conversionRate", // key: "conversionRate",
search: false, // search: false,
width: 200 // width: 200
}, // },
], // ],
}, // },
], // ],
}, // },
]; ];
const shiftgroupDetail = [ const shiftgroupDetail = [
//班组信息详情 //班组信息详情
......
import src from "../../public/ewm.png"; import src from "../../public/ewm.png";
export const str = `<table
border="1"
width="100%"
height="100%"
style="border-collapse: collapse; border: solid 1px"
bordercolor="#000000"
cellpadding="0"
>
<tr>
<td colspan="8">卷料名称:剪切后硅钢片</td>
</tr>
<tr>
<td colspan="8">卷料编码:PDC010100093</td>
</tr>
<tr>
<td colspan="4">牌号:070片</td>
<td colspan="4">母卷编号:20SQC</td>
</tr>
<tr>
<td colspan="4">厂家:江苏南高</td>
<td colspan="4">母卷重量:100KG</td>
</tr>
<tr>
<td colspan="8">单边卷料厚度:200mm</td>
</tr>
<tr>
<td colspan="2" rowspan="3">
<img src=${src} style="width:50px"/>
</td>
<td colspan="3">铁损:0.68w/kg</td>
<td colspan="3">批次:20230412</td>
</tr>
<tr>
<td colspan="3">宽度:188mm</td>
<td colspan="3">片厚:0.2mm</td>
</tr>
<tr>
<td colspan="3">重量:631KG</td>
<td colspan="3">米数:2292M</td>
</tr>
<tr>
<td colspan="8">条码:1BR157846039401296</td>
</tr>
</table>`;
export function str(data) {
// return `<table
// border="1"
// width="100%"
// height="100%"
// style="border-collapse: collapse; border: solid 1px;z-index:99999999"
// bordercolor="#000000"
// cellpadding="0"
// >
// <tr>
// <td colSpan="7">卷料名称:${data?.materieName ?? "--"}</td>
// <td colSpan="1">3</td>
// </td>
// </tr>
// <tr>
// <td colspan="8">卷料编码:${data?.materieCode ?? "--"}</td>
// </tr>
// <tr>
// <td colspan="8">牌号:${data?.shopSign ?? "--"}片</td>
// </tr>
// <tr>
// <td colspan="8">单边卷料厚度:${data?.unilateralThickness ?? "--"}</td>
// </tr>
// <tr>
// <td colspan="4">铁损:${data?.ironLoss ?? "--"}w/kg</td>
// <td colspan="4">批次:${data?.materieControlNo ?? "--"}</td>
// </tr>
// <tr>
// <td colspan="4">宽度:${data?.width ?? "--"}mm</td>
// <td colspan="4">片厚:${data?.sheetThickness ?? "--"}mm</td>
// </tr>
// <tr>
// <td colspan="4">重量:${data?.weight ?? "--"}KG</td>
// <td colspan="4">米数:${data?.length ?? "--"}M</td>
// </tr>
// <tr>
// <td colspan="8">条码:${data?.materieControlNo ?? "--"}</td>
// </tr>
// </table>`;
return ` <div style="display:flex; width:100% ;height:100%; flex-direction: column;justify-self: space-between;">
<div style="display:flex; flex-direction: row;flex:4;">
<div style="display:flex;flex-direction: column;flex:2">
<div style="flex:1">卷料名称:${data?.materieName ?? "--"}</div>
<div style="flex:1">卷料编码:${data?.materieCode ?? "--"}</div>
<div style="flex:1">牌号:${data?.shopSign ?? "--"}</div>
<div style="flex:1">单边卷料厚度:${data?.unilateralThickness ?? "--"}mm</div>
</div>
<div style="flex:1">
<img src=${data?.qrCodeUrl} style="width:90px"/>
</div>
</div>
<div style="display:flex; flex-direction: row;flex:1;">
<div style="flex:2">铁损:${data?.ironLoss ?? "--"}w/kg</div>
<div style="flex:3">批次:${data?.materieControlNo ?? "--"}</div>
</div>
<div style="display:flex; flex-direction: row;flex:1;">
<div style="flex:2">宽度:${data?.width ?? "--"}mm</div>
<div style="flex:3">片厚:${data?.sheetThickness ?? "--"}mm</div>
</div>
<div style="display:flex; flex-direction: row;flex:1;">
<div style="flex:2">重量:${data?.weight ?? "--"}KG</div>
<div style="flex:3">米数:${data?.length ?? "--"}M</div>
</div>
<div style="display:flex; flex-direction: row;flex:1;">
<div style="flex:1">条码:${data?.materieControlNo ?? "--"}</div>
</div>
</div>`;
}
import { str } from '@/utils/mymodelhtml.js' import { str } from "@/utils/mymodelhtml.js";
export function start() { import { doFetch } from "./doFetch";
export async function start(url, params) {
if (!getLodop) { if (!getLodop) {
alert("系统检测当前环境未安装相关插件,请先安装C-Lodop插件!"); alert("系统检测当前环境未安装相关插件,请先安装C-Lodop插件!");
return; return;
} }
const res = await doFetch({ url, params });
const data = JSON.parse(JSON.stringify(res?.data?.dataList));
console.log(data);
for (let i = 0; i < data.length; i++) {
const template = str(data[i]);
console.log(template);
let LODOP = getLodop(); let LODOP = getLodop();
LODOP.PRINT_INIT("task1"); LODOP.PRINT_INIT("task1");
LODOP.ADD_PRINT_HTM(0,0,"100%","100%",str); LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", template);
LODOP.SET_PRINT_PAGESIZE(0, 800, 600, ""); LODOP.SET_PRINT_PAGESIZE(0, 800, 600, "");
LODOP.PREVIEW(); // LODOP.PREVIEW();
// LODOP.PRINT(); LODOP.PRINT();
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment