From 04ef50b1b68a329c81ecfb3f0b7fc0b23672a8be Mon Sep 17 00:00:00 2001
From: 陈鑫涛 <10125295+chen-xintao97@user.noreply.gitee.com>
Date: Wed, 25 Jun 2025 15:54:43 +0800
Subject: [PATCH] 快速报价app多个印刷参数
---
src/mobile/components/SelectInput.jsx | 21 ++++++++++++++++-----
src/mobile/quotation/detailNew.jsx | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------
src/mobile/quotation/quotationDetail.css | 6 ++++++
src/mobile/quotation/quotationDetail.less | 6 ++++++
4 files changed, 142 insertions(+), 25 deletions(-)
diff --git a/src/mobile/components/SelectInput.jsx b/src/mobile/components/SelectInput.jsx
index 6e85571..7afc0c5 100644
--- a/src/mobile/components/SelectInput.jsx
+++ b/src/mobile/components/SelectInput.jsx
@@ -43,12 +43,10 @@ const SelectInput = props => {
}, [itemDetail, itemDetail?.sName, viewRow]);
const [columns, setColumns] = useState([]);
const [coplyColumns, setCopyColumns] = useState(columns);
- const getSqlDropDownData = async searchValue => {
+ const getSqlDropDownData = async (searchValue, sSqlCondition) => {
const url = `${commonConfig.server_host}business/getSelectLimit/${sId}?sModelsId=${sModelsId}&sName=${""}`;
const body = {
- sSqlCondition: {
- sProductClassifyId: quotationData ? quotationData.sId : "",
- },
+ sSqlCondition: sSqlCondition,
sKeyUpFilterName: searchValue,
pageNum: 1,
pageSize: 20,
@@ -152,7 +150,20 @@ const SelectInput = props => {
}
} else {
if (sDropDownType === "sql") {
- getSqlDropDownData(searchValue);
+ const { sSqlCondition } = itemDetail;
+ if (sSqlCondition) {
+ const { viewRow } = props;
+ const keys = sSqlCondition.split(",").map(sSqlCondition => sSqlCondition.split(".")[1]);
+
+ // 构造 JSON 对象
+ const result = keys.reduce((acc, key) => {
+ acc[key] = viewRow[key];
+ return acc;
+ }, {});
+ getSqlDropDownData(searchValue, result);
+ } else {
+ getSqlDropDownData(searchValue);
+ }
} else if ((sDropDownType = "const")) {
if (!itemDetail.showDropDown) return;
const list = Object.entries(JSON.parse(itemDetail.showDropDown)).map(([key, value]) => ({
diff --git a/src/mobile/quotation/detailNew.jsx b/src/mobile/quotation/detailNew.jsx
index 8ca64a6..e84c680 100644
--- a/src/mobile/quotation/detailNew.jsx
+++ b/src/mobile/quotation/detailNew.jsx
@@ -1834,32 +1834,12 @@ const BoxComponent = props => {
}));
const onCostomClick = showConfig => {
- // const className = target.getAttribute("class");
- // const nodeName = target.nodeName;
- // if (className?.includes("select") && nodeName === "DIV") return;
- // if (!sBackProcessData) return;
- // const detail = sBackProcessData.find(item => item[showConfig.sName0 || showConfig.sName]);
- // let data = commonUtils.convertStrToObj(detail?.sParamConfig, []);
- // if (detail) {
- // // 确保 detail.sBackendParams 是一个数组
- // detail.sBackendParams = Array.isArray(detail.sBackendParams) ? detail.sBackendParams : [];
- // // 过滤掉 undefined 或 null 值
- // detail.sBackendParams = detail.sBackendParams.filter(param => param !== undefined && param !== null);
-
- // data.forEach((x, i) => {
- // const backendParam = detail.sBackendParams[i] || {}; // 如果是 undefined,则使用空对象
- // x.sParamDefault = x.sFieldName !== "" ? backendParam[x.sFieldName] : backendParam.label || x.sParamDefault;
- // });
- // }
props.setState(pre => ({
...pre,
backendParamsConfig: commonUtils.convertStrToObj(sBackProcessData.find(item => item[showConfig.sName0 || showConfig.sName])?.sParamConfig, []),
backendConfig: { sParentFieldsName: showConfig.sName, sBoxModel: boxModel },
}));
};
- // 如果是卡牌那么默认使用矩形
- // const currentBoxModel = "slaveUp" + props.boxModel;
- // props.onDataChange(currentBoxModel, "sName", { sName: item.sName }, item.sId, boxsList);
useEffect(() => {
if (selectedNode.sTypeKey === "kapai") {
@@ -1918,6 +1898,7 @@ const BoxComponent = props => {
印刷信息
+
{upViewProps12
? upViewProps12.viewConfigs.map(x => (
@@ -2163,6 +2144,119 @@ const BoxComponent = props => {
);
};
+// 印刷参数组件(印刷、颜色、单双面)
+const PrintParamsComponent = props => {
+ const { state, setState, boxModel } = props;
+ const { slaveConfig, slaveData, selectedNode } = state;
+ if (!slaveConfig) return;
+ const slaveRowData = slaveData.find(item => item.sTreeNodeName === selectedNode.showName && item.sBoxModel === boxModel) || {};
+ const slaveRowDataIndex = slaveData.findIndex(item => item.sId === slaveRowData.sId);
+ const { sBackProcessData = [] } = slaveRowData;
+ const printParams = sBackProcessData.filter(item => item.bPrintParams);
+
+ const printParamsConfig = slaveConfig.gdsconfigformslave
+ .filter(item => ["sPrint", "sColor", "iPrintModePo"].includes(item.sName))
+ .map(item => {
+ return {
+ ...item,
+ iColValue: 8,
+ };
+ });
+
+ const result = [];
+ for (let i = 0; i < printParams.length + 1; i++) {
+ const printParamsItem = printParams[i - 1];
+ const viewRow = { ...(i === 0 ? slaveRowData : printParamsItem), sProductClassifyId: selectedNode.sId };
+
+ const viewProps = {
+ ...props,
+ viewConfigs: printParamsConfig,
+ tableConfig: { ...slaveConfig, gdsconfigformslave: printParamsConfig },
+ iColValueView: 24,
+ viewRow,
+ tableName: `${i === 0 ? "slaveUp" : "slaveDown"}${boxModel}`,
+ onDataChange: (...args) => {
+ if (i === 0) {
+ props.onDataChange(...args);
+ return;
+ }
+
+ const iIndex = sBackProcessData.findIndex(item => item.sId === printParamsItem.sId);
+ sBackProcessData[iIndex] = { ...sBackProcessData[iIndex], ...args[2] };
+ slaveData[slaveRowDataIndex] = { ...slaveRowData, sBackProcessData };
+ setState(pre => {
+ return { ...pre, slaveData };
+ });
+ },
+ };
+
+ result.push(
+
+
+
+ {viewProps
+ ? viewProps.viewConfigs.map(x => (
+
+
+
+ ))
+ : ""}
+
+ {/*
*/}
+
+
+
+ {i !== 0 ? (
+
+ ) : (
+ ""
+ )}
+
+
+ );
+ }
+ return result;
+};
// 材料组件
const MaterialsComponent = props => {
const { state, boxModel } = props;
diff --git a/src/mobile/quotation/quotationDetail.css b/src/mobile/quotation/quotationDetail.css
index b27e484..9cddd9e 100644
--- a/src/mobile/quotation/quotationDetail.css
+++ b/src/mobile/quotation/quotationDetail.css
@@ -167,3 +167,9 @@
.processFlex .processBtn {
margin-left: 1rem;
}
+.materialsBtns {
+ display: flex;
+ flex-wrap: wrap;
+ margin-left: 1rem;
+ margin-top: 1.5rem;
+}
diff --git a/src/mobile/quotation/quotationDetail.less b/src/mobile/quotation/quotationDetail.less
index ec3591e..3adae82 100644
--- a/src/mobile/quotation/quotationDetail.less
+++ b/src/mobile/quotation/quotationDetail.less
@@ -175,4 +175,10 @@
.processBtn{
margin-left: 1rem;
}
+}
+.materialsBtns{
+ display: flex;
+ flex-wrap: wrap;
+ margin-left: 1rem;
+ margin-top: 1.5rem;
}
\ No newline at end of file
--
libgit2 0.22.2