Commit 499f04f98495d310cfef70da367fdda425233bc9
1 parent
5ad0fab1
1.产品提醒重新设计实现
Showing
12 changed files
with
392 additions
and
3 deletions
src/components/Common/CommonHooks/useCommonBase.js
| ... | ... | @@ -677,7 +677,15 @@ const useCommonBase = props => { |
| 677 | 677 | globalData?.currentStartWorkMachineTask, |
| 678 | 678 | currentWorkOrderInfo: globalData?.currentWorkOrderInfo |
| 679 | 679 | }; |
| 680 | - conditonValues[fieldNameFilter] = tempProps[tableName][fieldName]; | |
| 680 | + if ( | |
| 681 | + tempProps && | |
| 682 | + tempProps[tableName] !== undefined && | |
| 683 | + tempProps[tableName][fieldName] !== undefined | |
| 684 | + ) { | |
| 685 | + conditonValues[fieldNameFilter] = tempProps[tableName][fieldName]; | |
| 686 | + } else { | |
| 687 | + conditonValues[fieldNameFilter] = ''; // 不存在时给默认值 | |
| 688 | + } | |
| 681 | 689 | } else if (name === tableName && !commonUtils.isEmpty(record)) { |
| 682 | 690 | const data = record; |
| 683 | 691 | conditonValues[fieldNameFilter] = data[fieldName]; | ... | ... |
src/mes/common/routerComponent/index.js
| ... | ... | @@ -9,7 +9,7 @@ import * as commonUtils from "@/utils/utils"; |
| 9 | 9 | import CommonModelComponent from "@/mes/common/commonModelComponent"; |
| 10 | 10 | import MachineTasks from "@/mes/scheduledTasks/machineTasks"; |
| 11 | 11 | import ProcessInstructionBook from "@/mes/scheduledTasks/processInstructionBook"; |
| 12 | -import PrenatalReminderInfo from "@/mes/scheduledTasks/prenatalReminderInfo"; | |
| 12 | +import PrenatalReminderInfo from "@/mes/scheduledTasks/prenatalReminderInfo1"; | |
| 13 | 13 | import ProductionExecMain from "@/mes/productionExec/productionExecMain"; |
| 14 | 14 | import AbnormalEventReporting from "@/mes/scheduledTasks/abnormalEventReporting"; |
| 15 | 15 | import RunningStatus from "@/mes/common/RunningStatus"; | ... | ... |
src/mes/scheduledTasks/prenatalReminderInfo1/assets/1.png
0 → 100644
511 Bytes
src/mes/scheduledTasks/prenatalReminderInfo1/assets/2.png
0 → 100644
528 Bytes
src/mes/scheduledTasks/prenatalReminderInfo1/assets/3.png
0 → 100644
552 Bytes
src/mes/scheduledTasks/prenatalReminderInfo1/assets/4.png
0 → 100644
635 Bytes
src/mes/scheduledTasks/prenatalReminderInfo1/assets/5.png
0 → 100644
601 Bytes
src/mes/scheduledTasks/prenatalReminderInfo1/assets/6.png
0 → 100644
553 Bytes
src/mes/scheduledTasks/prenatalReminderInfo1/assets/7.png
0 → 100644
404 Bytes
src/mes/scheduledTasks/prenatalReminderInfo1/index.js
0 → 100644
| 1 | +import React, { useEffect } from "react"; | |
| 2 | +import * as commonUtils from "@/utils/utils"; | |
| 3 | +import useCommonBase from "@/components/Common/CommonHooks/useCommonBase"; | |
| 4 | + | |
| 5 | +import ShowType from "@/components/Common/CommonComponent"; | |
| 6 | + | |
| 7 | +import styles from "./index.less"; | |
| 8 | + | |
| 9 | +const usePrenatalReminderInfoEvent = props => { | |
| 10 | + const { formData } = props; | |
| 11 | + | |
| 12 | + useEffect( | |
| 13 | + async () => { | |
| 14 | + if (commonUtils.isNotEmptyArr(formData)) { | |
| 15 | + const result = await handleGetData(formData[0]); | |
| 16 | + const result1 = await handleGetData(formData[1], 1); | |
| 17 | + const result2 = await handleGetData(formData[2], 2); | |
| 18 | + props.onSaveState({ | |
| 19 | + ...result, | |
| 20 | + ...result1, | |
| 21 | + ...result2, | |
| 22 | + slaveConfig: formData[0], | |
| 23 | + slave1Config: formData[1], | |
| 24 | + slave2Config: formData[2], | |
| 25 | + bFinish: true | |
| 26 | + }); | |
| 27 | + } | |
| 28 | + }, | |
| 29 | + [formData] | |
| 30 | + ); | |
| 31 | + | |
| 32 | + // 获取数据集 | |
| 33 | + const handleGetData = async (config, index = "") => { | |
| 34 | + const { app } = props; | |
| 35 | + const { userinfo = {} } = app; | |
| 36 | + const globalData = commonUtils.convertStrToObj( | |
| 37 | + localStorage.xlybusinessglobalData | |
| 38 | + ); | |
| 39 | + const { sWorkshopId } = userinfo; | |
| 40 | + const { currentSelectedMachineTaskDataRow = {} } = globalData; | |
| 41 | + const { sOrderId } = currentSelectedMachineTaskDataRow; | |
| 42 | + const conditonValues = props.onGetSqlConditionValues(config); | |
| 43 | + const addState = | |
| 44 | + (await props.onGetDataSet({ | |
| 45 | + name: `slave${index}`, | |
| 46 | + configData: config, | |
| 47 | + condition: { | |
| 48 | + sSqlCondition: { | |
| 49 | + ...conditonValues, | |
| 50 | + sWorkshopId, | |
| 51 | + sOrderId | |
| 52 | + } | |
| 53 | + }, | |
| 54 | + isWait: true | |
| 55 | + })) || {}; | |
| 56 | + return addState; | |
| 57 | + }; | |
| 58 | + | |
| 59 | + return { | |
| 60 | + ...props | |
| 61 | + }; | |
| 62 | +}; | |
| 63 | + | |
| 64 | +const PrenatalReminderInfo = baseProps => { | |
| 65 | + const props = usePrenatalReminderInfoEvent(useCommonBase(baseProps)); | |
| 66 | + const { bFinish } = props; | |
| 67 | + if (!bFinish) return ""; | |
| 68 | + | |
| 69 | + const { app, slaveData, slave1Data, slave2Data, slaveConfig, slave1Config, slave2Config } = props; | |
| 70 | + | |
| 71 | + const viewRow1 = commonUtils.isNotEmptyArr(slaveData) ? slaveData[0] : {}; | |
| 72 | + const viewRow2 = commonUtils.isNotEmptyArr(slave1Data) ? slave1Data[0] : {}; | |
| 73 | + const viewRow3 = commonUtils.isNotEmptyArr(slave2Data) ? slave2Data[0] : {}; | |
| 74 | + const viewRow = { ...viewRow1, ...viewRow2, ...viewRow3 }; | |
| 75 | + const tableName = "slave"; | |
| 76 | + | |
| 77 | + const memoListFilter = | |
| 78 | + slaveConfig?.gdsconfigformslave | |
| 79 | + .filter(item => item.sControlName?.includes("_")); | |
| 80 | + console.log('memoListFilter', memoListFilter, slave2Config?.gdsconfigformslave, slaveConfig, slave1Config, slave2Config); | |
| 81 | + | |
| 82 | + const leftSize = Math.ceil(memoListFilter.length / 2); | |
| 83 | + const rightSize = memoListFilter.length - leftSize; | |
| 84 | + const leftMemoList = memoListFilter.slice(0, leftSize); | |
| 85 | + const rightMemoList = memoListFilter.slice(leftSize, memoListFilter.length); | |
| 86 | + | |
| 87 | + return ( | |
| 88 | + <div className={styles.prenatalReminderInfo}> | |
| 89 | + {[ | |
| 90 | + "技术评审汇签", | |
| 91 | + "客户投诉", | |
| 92 | + "本批生产注意事项", | |
| 93 | + "不合格报告", | |
| 94 | + "车间产前提醒" | |
| 95 | + ].map((title, index) => { | |
| 96 | + let dataValueNew = ""; | |
| 97 | + const child = { | |
| 98 | + sId: commonUtils.createSid(), | |
| 99 | + sName: `sTempMemo${index}`, | |
| 100 | + sControlName: "", | |
| 101 | + bVisible: true, | |
| 102 | + showName: title | |
| 103 | + }; | |
| 104 | + | |
| 105 | + const memoList = new Array(20) | |
| 106 | + .fill("") | |
| 107 | + .map((_, i) => viewRow[`sNoteMemo${i + 1}`]); | |
| 108 | + | |
| 109 | + const getMemoValue = (from, to) => { | |
| 110 | + const tempList = memoList | |
| 111 | + .slice(from, to) | |
| 112 | + .filter(item => item !== undefined) | |
| 113 | + .map((item, i) => `${i + 1}) ${item}`); | |
| 114 | + return tempList.join("\n"); | |
| 115 | + }; | |
| 116 | + | |
| 117 | + if (title === "客户投诉") { | |
| 118 | + dataValueNew = getMemoValue(0, 4); | |
| 119 | + } else if (title === "不合格报告") { | |
| 120 | + dataValueNew = getMemoValue(4, 8); | |
| 121 | + } else if (title === "车间产前提醒") { | |
| 122 | + dataValueNew = viewRow.sMemo; | |
| 123 | + } else if (title === "本批生产注意事项") { | |
| 124 | + dataValueNew = getMemoValue(16, 20); | |
| 125 | + } else if (title === "技术评审汇签") { | |
| 126 | + const dataValue1 = leftMemoList | |
| 127 | + .map( | |
| 128 | + ({ sName, showName }) => `${showName}:${viewRow[sName] || ""}` | |
| 129 | + ) | |
| 130 | + .join("\n"); | |
| 131 | + | |
| 132 | + const dataValue2 = rightMemoList | |
| 133 | + .map( | |
| 134 | + ({ sName, showName }) => `${showName}:${viewRow[sName] || ""}` | |
| 135 | + ) | |
| 136 | + .join("\n"); | |
| 137 | + const showTypeProps1 = { | |
| 138 | + app, | |
| 139 | + className: styles.showType, | |
| 140 | + iColValue: 24, | |
| 141 | + name: tableName, | |
| 142 | + record: viewRow, | |
| 143 | + sId: commonUtils.createSid(), | |
| 144 | + getSqlDropDownData: props.getSqlDropDownData, | |
| 145 | + getSqlCondition: props.getSqlCondition, | |
| 146 | + handleSqlDropDownNewRecord: props.handleSqlDropDownNewRecord, | |
| 147 | + getFloatNum: props.getFloatNum, | |
| 148 | + onChange: props.onDataChange, | |
| 149 | + showConfig: { ...child, costomStyle: styles.hideRightBorder }, | |
| 150 | + slaveConfig: props[`${tableName}Config`], | |
| 151 | + formItemLayout: { labelCol: { span: 0 }, wrapperCol: { span: 24 } }, | |
| 152 | + textArea: true, | |
| 153 | + enabled: false, | |
| 154 | + dataValue: dataValue1, | |
| 155 | + bTable: true, | |
| 156 | + bViewTable: true, | |
| 157 | + formRoute: props.formRoute, | |
| 158 | + getDateFormat: props.getDateFormat | |
| 159 | + }; | |
| 160 | + | |
| 161 | + const showTypeProps2 = { | |
| 162 | + app, | |
| 163 | + className: styles.showType, | |
| 164 | + iColValue: 24, | |
| 165 | + name: tableName, | |
| 166 | + record: viewRow, | |
| 167 | + sId: commonUtils.createSid(), | |
| 168 | + getSqlDropDownData: props.getSqlDropDownData, | |
| 169 | + getSqlCondition: props.getSqlCondition, | |
| 170 | + handleSqlDropDownNewRecord: props.handleSqlDropDownNewRecord, | |
| 171 | + getFloatNum: props.getFloatNum, | |
| 172 | + onChange: props.onDataChange, | |
| 173 | + showConfig: { ...child, costomStyle: styles.hideLeftBorder }, | |
| 174 | + slaveConfig: props[`${tableName}Config`], | |
| 175 | + formItemLayout: { labelCol: { span: 0 }, wrapperCol: { span: 24 } }, | |
| 176 | + textArea: true, | |
| 177 | + enabled: false, | |
| 178 | + dataValue: dataValue2, | |
| 179 | + bTable: true, | |
| 180 | + bViewTable: true, | |
| 181 | + formRoute: props.formRoute, | |
| 182 | + getDateFormat: props.getDateFormat | |
| 183 | + }; | |
| 184 | + | |
| 185 | + return ( | |
| 186 | + <div> | |
| 187 | + <div className={styles.title}>{title}</div> | |
| 188 | + <div className={styles.content1}> | |
| 189 | + <ShowType {...showTypeProps1} /> | |
| 190 | + <ShowType {...showTypeProps2} /> | |
| 191 | + </div> | |
| 192 | + </div> | |
| 193 | + ); | |
| 194 | + } | |
| 195 | + const showTypeProps = { | |
| 196 | + app, | |
| 197 | + className: styles.showType, | |
| 198 | + iColValue: 24, | |
| 199 | + name: tableName, | |
| 200 | + record: viewRow, | |
| 201 | + sId: commonUtils.createSid(), | |
| 202 | + getSqlDropDownData: props.getSqlDropDownData, | |
| 203 | + getSqlCondition: props.getSqlCondition, | |
| 204 | + handleSqlDropDownNewRecord: props.handleSqlDropDownNewRecord, | |
| 205 | + getFloatNum: props.getFloatNum, | |
| 206 | + onChange: props.onDataChange, | |
| 207 | + showConfig: child, | |
| 208 | + slaveConfig: props[`${tableName}Config`], | |
| 209 | + formItemLayout: { labelCol: { span: 0 }, wrapperCol: { span: 24 } }, | |
| 210 | + textArea: true, | |
| 211 | + enabled: false, | |
| 212 | + dataValue: dataValueNew, | |
| 213 | + bTable: true, | |
| 214 | + bViewTable: true, | |
| 215 | + formRoute: props.formRoute, | |
| 216 | + getDateFormat: props.getDateFormat | |
| 217 | + }; | |
| 218 | + | |
| 219 | + return ( | |
| 220 | + <div> | |
| 221 | + <div className={styles.title}>{title}</div> | |
| 222 | + <div className={styles.content}> | |
| 223 | + <ShowType {...showTypeProps} /> | |
| 224 | + </div> | |
| 225 | + </div> | |
| 226 | + ); | |
| 227 | + })} | |
| 228 | + </div> | |
| 229 | + ); | |
| 230 | +}; | |
| 231 | + | |
| 232 | +export default PrenatalReminderInfo; | ... | ... |
src/mes/scheduledTasks/prenatalReminderInfo1/index.less
0 → 100644
| 1 | +@import "~@/mixins.less"; | |
| 2 | + | |
| 3 | +.prenatalReminderInfo { | |
| 4 | + .size(); | |
| 5 | + // border: 1px solid red; | |
| 6 | + display: grid; | |
| 7 | + /* 创建两列,每列宽度自动分配 */ | |
| 8 | + grid-template-columns: repeat(2, 1fr); | |
| 9 | + /* 创建三行,每行最小高度为100px,自动扩展 */ | |
| 10 | + grid-template-rows: repeat(3, minmax(100px, auto)); | |
| 11 | + /* 设置行列间距均为10px */ | |
| 12 | + gap: 10px; | |
| 13 | + | |
| 14 | + | |
| 15 | + >div { | |
| 16 | + display: flex; | |
| 17 | + flex-direction: column; | |
| 18 | + padding: 0 10px 10px 10px; | |
| 19 | + background-color: #FFF; | |
| 20 | + | |
| 21 | + .title { | |
| 22 | + .size(100%, 40px); | |
| 23 | + .flex(center); | |
| 24 | + font-size: 20px; | |
| 25 | + font-weight: bold; | |
| 26 | + background-color: #FFF; | |
| 27 | + color: #1890FF; | |
| 28 | + padding-left: 25px; | |
| 29 | + } | |
| 30 | + | |
| 31 | + .content { | |
| 32 | + .size(100%, calc(100% - 40px)); | |
| 33 | + background: #F0F0F0; | |
| 34 | + | |
| 35 | + :global { | |
| 36 | + .ant-input[disabled] { | |
| 37 | + background: #F0F0F0; | |
| 38 | + } | |
| 39 | + | |
| 40 | + *:not(.ant-form-item-control-input-content) { | |
| 41 | + padding: 0 !important; | |
| 42 | + } | |
| 43 | + } | |
| 44 | + } | |
| 45 | + | |
| 46 | + .content1 { | |
| 47 | + .size(100%, calc(100% - 40px)); | |
| 48 | + background: #F0F0F0; | |
| 49 | + | |
| 50 | + .flex(); | |
| 51 | + | |
| 52 | + :global { | |
| 53 | + .ant-input[disabled] { | |
| 54 | + background: #F0F0F0; | |
| 55 | + } | |
| 56 | + | |
| 57 | + *:not(.ant-form-item-control-input-content) { | |
| 58 | + padding: 0 !important; | |
| 59 | + } | |
| 60 | + } | |
| 61 | + | |
| 62 | + } | |
| 63 | + } | |
| 64 | + | |
| 65 | + >div:first-child { | |
| 66 | + grid-column: span 2; | |
| 67 | + } | |
| 68 | + | |
| 69 | + >div:nth-child(1) .title { | |
| 70 | + background: url(./assets/1.png) no-repeat; | |
| 71 | + background-position-x: -10px; | |
| 72 | + } | |
| 73 | + | |
| 74 | + >div:nth-child(2) .title { | |
| 75 | + background: url(./assets/2.png) no-repeat; | |
| 76 | + background-position-x: -10px; | |
| 77 | + } | |
| 78 | + | |
| 79 | + >div:nth-child(3) .title { | |
| 80 | + background: url(./assets/3.png) no-repeat; | |
| 81 | + background-position-x: -10px; | |
| 82 | + } | |
| 83 | + | |
| 84 | + >div:nth-child(4) .title { | |
| 85 | + background: url(./assets/4.png) no-repeat; | |
| 86 | + background-position-x: -10px; | |
| 87 | + } | |
| 88 | + | |
| 89 | + >div:nth-child(5) .title { | |
| 90 | + background: url(./assets/5.png) no-repeat; | |
| 91 | + background-position-x: -10px; | |
| 92 | + } | |
| 93 | + | |
| 94 | + >div:nth-child(6) .title { | |
| 95 | + background: url(./assets/6.png) no-repeat; | |
| 96 | + background-position-x: -10px; | |
| 97 | + } | |
| 98 | + | |
| 99 | + >div:nth-child(7) .title { | |
| 100 | + background: url(./assets/7.png) no-repeat; | |
| 101 | + background-position-x: -10px; | |
| 102 | + } | |
| 103 | + | |
| 104 | + .showType { | |
| 105 | + .size(); | |
| 106 | + } | |
| 107 | + | |
| 108 | + :global { | |
| 109 | + .ant-form-item-label { | |
| 110 | + display: none; | |
| 111 | + } | |
| 112 | + | |
| 113 | + .input24 { | |
| 114 | + .size(); | |
| 115 | + | |
| 116 | + .ant-form-item[class*='formItemMargin'], | |
| 117 | + .ant-form-item-row, | |
| 118 | + .ant-form-item-control, | |
| 119 | + .ant-form-item-control-input, | |
| 120 | + .ant-form-item-control-input-content, | |
| 121 | + textarea { | |
| 122 | + .size(); | |
| 123 | + text-indent: 0; | |
| 124 | + color: #000; | |
| 125 | + padding: 10px; | |
| 126 | + } | |
| 127 | + | |
| 128 | + .ant-form-item { | |
| 129 | + border: 1px solid #AAA; | |
| 130 | + } | |
| 131 | + } | |
| 132 | + } | |
| 133 | +} | |
| 134 | + | |
| 135 | +.hideRightBorder { | |
| 136 | + :global { | |
| 137 | + .ant-form-item[class*="formItemMargin"] { | |
| 138 | + border-right: 0 !important; | |
| 139 | + } | |
| 140 | + } | |
| 141 | +} | |
| 142 | + | |
| 143 | +.hideLeftBorder { | |
| 144 | + :global { | |
| 145 | + .ant-form-item[class*="formItemMargin"] { | |
| 146 | + border-left: 0 !important; | |
| 147 | + } | |
| 148 | + } | |
| 149 | +} | |
| 0 | 150 | \ No newline at end of file | ... | ... |
src/utils/config.js
| ... | ... | @@ -6,7 +6,7 @@ export const webSite = { |
| 6 | 6 | // faceAddress: isDev ? '//192.168.11.22:8080/xlyFace' : '//' + location.host + '/xlyFace', |
| 7 | 7 | fileAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyReport/' : '//' + location.host + '/xlyReport/', // 接口地址 |
| 8 | 8 | faceAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyFace' : '//' + location.host + '/xlyFace', |
| 9 | - ipAddress: localStorage.ipAddress ? localStorage.ipAddress : isDev ? '//192.168.2.36:8080/xlyEntry/' : '//' + location.host + '/xlyEntry/', | |
| 9 | + ipAddress: localStorage.ipAddress ? localStorage.ipAddress : isDev ? '//192.168.2.22:9098/xlyEntry/' : '//' + location.host + '/xlyEntry/', | |
| 10 | 10 | interfaceAddress: isDev ? '//km5cjx.gnway.cc:43920/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址88 |
| 11 | 11 | // ipAddress: isDev ? '//ebc.jinjia.com:8091/xlyEntry/' : '//' + location.host + '/xlyEntry/', |
| 12 | 12 | // interfaceAddress: isDev ? '//ebc.jinjia.com:8091/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址 | ... | ... |