Commit 0aff5a951c91923607d91529d13c1963311970e8
Merge branch 'release/customer/2025/AJT' of http://git.xlyprint.cn/qiangmj/ebc-M…
…es into release/customer/2025/AJT
Showing
3 changed files
with
569 additions
and
355 deletions
.prettierrc
0 → 100644
| 1 | +{ | |
| 2 | + "printWidth": 150, | |
| 3 | + "eslintIntegration": true, | |
| 4 | + "stylelintIntegration": true, | |
| 5 | + "tabWidth": 2, | |
| 6 | + "semi": true, | |
| 7 | + "singleQuote": false, | |
| 8 | + "quoteProps": "as-needed", | |
| 9 | + "jsxSingleQuote": false, | |
| 10 | + "bracketSpacing": true, | |
| 11 | + "arrowParens": "avoid", | |
| 12 | + "htmlWhitespaceSensitivity": "css", | |
| 13 | + "javascript.format.insertSpaceBeforeFunctionParenthesis": true, | |
| 14 | + "files.insertFinalNewline": true, | |
| 15 | + "useTabs": false, | |
| 16 | + "endOfLine": "lf", | |
| 17 | + "ignorePath": ".gnore", | |
| 18 | + "trailingComma": "es5", | |
| 19 | + "jsxBracketSameLine": false, | |
| 20 | + "bracketSameLine": false | |
| 21 | +} | |
| 0 | 22 | \ No newline at end of file | ... | ... |
src/mes/common/commonModelComponent/index.js
src/mes/costomPageFun/index.js
| ... | ... | @@ -8,15 +8,10 @@ import * as commonFunc from "@/components/Common/commonFunc"; |
| 8 | 8 | import FaceDetect from "@/components/FaceDetect"; |
| 9 | 9 | import ShowType from "@/components/Common/CommonComponent"; |
| 10 | 10 | const costomPageFun = ({ props, tableName, sFieldName, actionName }) => { |
| 11 | - const { sModelsId } = commonUtils.convertStrToObj( | |
| 12 | - localStorage.xlybusinesscurrentMesPane | |
| 13 | - ); | |
| 11 | + const { sModelsId } = commonUtils.convertStrToObj(localStorage.xlybusinesscurrentMesPane); | |
| 14 | 12 | |
| 15 | 13 | let result = false; |
| 16 | - switch ( | |
| 17 | - `${sModelsId}-${tableName}${sFieldName ? `-${sFieldName}` : "" | |
| 18 | - }-${actionName}` | |
| 19 | - ) { | |
| 14 | + switch (`${sModelsId}-${tableName}${sFieldName ? `-${sFieldName}` : ""}-${actionName}`) { | |
| 20 | 15 | case "12710101117087404588200-table0-mesTableLineAdd": |
| 21 | 16 | case "12710101117260270570210-table0-mesTableLineAdd": |
| 22 | 17 | case "12710101117087371044360-slave0-mesTableLineAdd": |
| ... | ... | @@ -131,14 +126,63 @@ const costomPageFun = ({ props, tableName, sFieldName, actionName }) => { |
| 131 | 126 | result = true; |
| 132 | 127 | handleZlxjCheck(props, sFieldName); |
| 133 | 128 | break; |
| 129 | + case "mesBtnClick-slave0-BtnRight.foremanReview": | |
| 130 | + result = true; | |
| 131 | + window.refreshTableList = ["slave1"]; | |
| 132 | + handleCjlbshCheck(props); | |
| 133 | + break; | |
| 134 | + case "mesBtnClick-slave0-BtnRight.reverseReview": | |
| 135 | + result = true; | |
| 136 | + window.refreshTableList = ["slave1"]; | |
| 137 | + handleCjlbfsCheck(props); | |
| 138 | + break; | |
| 139 | + case "mesBtnClick-slave0-BtnRight.ipqcReview": | |
| 140 | + result = true; | |
| 141 | + window.refreshTableList = ["slave1"]; | |
| 142 | + handlePgshCheck(props); | |
| 143 | + break; | |
| 144 | + case "mesBtnClick-slave0-BtnRight.ipqcReverseReview": | |
| 145 | + result = true; | |
| 146 | + window.refreshTableList = ["slave1"]; | |
| 147 | + handlePgfsCheck(props); | |
| 148 | + break; | |
| 149 | + case "mesBtnClick-slave0-BtnRight.confirmSubmit": | |
| 150 | + result = true; | |
| 151 | + window.refreshTableList = ["slave1"]; | |
| 152 | + handleConfirmSubmit(props); | |
| 153 | + break; | |
| 154 | + case "mesBtnClick-slave0-BtnRight..edit": | |
| 155 | + case "mesBtnClick-slave0-BtnRight.edit": | |
| 156 | + { | |
| 157 | + window.refreshTableList = ["slave1"]; | |
| 158 | + const { slave0Data } = props; | |
| 159 | + result = true; | |
| 160 | + const slave0DataNew = [{ ...slave0Data[0], bSubmit: 0, handleType: slave0Data[0].handleType || "update" }]; | |
| 161 | + props.onExecInstructSet({ | |
| 162 | + nextProps: { ...props, slave0Data: slave0DataNew }, | |
| 163 | + btnConfig: { | |
| 164 | + showName: "保存", | |
| 165 | + sInstruct: JSON.stringify([ | |
| 166 | + { | |
| 167 | + opr: "save", | |
| 168 | + data: [ | |
| 169 | + { | |
| 170 | + tablename: "EptCompletionSiteClearanceMaster", | |
| 171 | + srcDataset: "slave0", | |
| 172 | + }, | |
| 173 | + ], | |
| 174 | + }, | |
| 175 | + ]), | |
| 176 | + }, | |
| 177 | + }); | |
| 178 | + break; | |
| 179 | + } | |
| 180 | + | |
| 134 | 181 | default: |
| 135 | 182 | break; |
| 136 | 183 | } |
| 137 | 184 | |
| 138 | - if ( | |
| 139 | - ["mesBtnClick"].includes(actionName) && | |
| 140 | - ["BtnRight.PriorCom", "BtnRight.NextCom"].includes(sFieldName) | |
| 141 | - ) { | |
| 185 | + if (["mesBtnClick"].includes(actionName) && ["BtnRight.PriorCom", "BtnRight.NextCom"].includes(sFieldName)) { | |
| 142 | 186 | handleUpDownData({ ...props, tableName, sFieldName }); |
| 143 | 187 | return true; |
| 144 | 188 | } |
| ... | ... | @@ -149,19 +193,14 @@ const costomPageFun = ({ props, tableName, sFieldName, actionName }) => { |
| 149 | 193 | // 班组报工行车记录表格新增 |
| 150 | 194 | const mesTableLineAdd1 = (props, tableName) => { |
| 151 | 195 | // const tableName = "table0"; |
| 152 | - const { | |
| 153 | - [`${tableName}SelectedRowKeys`]: selectedRowKeys, | |
| 154 | - [`${tableName}Data`]: tableData = [] | |
| 155 | - } = props; | |
| 196 | + const { [`${tableName}SelectedRowKeys`]: selectedRowKeys, [`${tableName}Data`]: tableData = [] } = props; | |
| 156 | 197 | |
| 157 | 198 | if (commonUtils.isEmptyObject(selectedRowKeys)) { |
| 158 | 199 | message.info("请先选中一条行车记录数据!"); |
| 159 | 200 | return; |
| 160 | 201 | } |
| 161 | 202 | |
| 162 | - const rowDataIndex = tableData.findIndex( | |
| 163 | - item => item.sId === selectedRowKeys[0] | |
| 164 | - ); | |
| 203 | + const rowDataIndex = tableData.findIndex(item => item.sId === selectedRowKeys[0]); | |
| 165 | 204 | if (rowDataIndex === -1) return; |
| 166 | 205 | |
| 167 | 206 | const rowData = tableData[rowDataIndex]; |
| ... | ... | @@ -206,21 +245,17 @@ const mesTableLineAdd1 = (props, tableName) => { |
| 206 | 245 | props.onSaveState( |
| 207 | 246 | { |
| 208 | 247 | [`${tableName}Data`]: tableDataNew, |
| 209 | - [`${tableName}SelectedRowKeys`]: [rowDataCopy.sId] | |
| 248 | + [`${tableName}SelectedRowKeys`]: [rowDataCopy.sId], | |
| 210 | 249 | }, |
| 211 | 250 | nextProps => { |
| 212 | 251 | const name = tableName; |
| 213 | 252 | const { [`${name}Config`]: tableConfig = {} } = nextProps; |
| 214 | - const rowClickConfig = tableConfig.gdsconfigformslave?.find( | |
| 215 | - item => | |
| 216 | - item.sControlName && | |
| 217 | - item.sControlName.toLowerCase().includes("rowclick") | |
| 218 | - ); | |
| 253 | + const rowClickConfig = tableConfig.gdsconfigformslave?.find(item => item.sControlName && item.sControlName.toLowerCase().includes("rowclick")); | |
| 219 | 254 | if (!rowClickConfig) return; |
| 220 | 255 | |
| 221 | 256 | props.handleExecInstructSet({ |
| 222 | 257 | btnConfig: rowClickConfig, |
| 223 | - nextProps: nextProps | |
| 258 | + nextProps: nextProps, | |
| 224 | 259 | }); |
| 225 | 260 | } |
| 226 | 261 | ); |
| ... | ... | @@ -228,9 +263,7 @@ const mesTableLineAdd1 = (props, tableName) => { |
| 228 | 263 | |
| 229 | 264 | // 研发工艺参数材料表新增 |
| 230 | 265 | const mesTableLineAdd2 = (props, tableName) => { |
| 231 | - const oTab = document | |
| 232 | - .querySelector('.ant-tabs-tabpane-active[id*="研发工艺参数"]') | |
| 233 | - .querySelector(".ant-tabs-tab-active"); | |
| 266 | + const oTab = document.querySelector('.ant-tabs-tabpane-active[id*="研发工艺参数"]').querySelector(".ant-tabs-tab-active"); | |
| 234 | 267 | if (!oTab) return; |
| 235 | 268 | |
| 236 | 269 | const dataNodeKey = oTab.getAttribute("data-node-key") || ""; |
| ... | ... | @@ -242,29 +275,23 @@ const mesTableLineAdd2 = (props, tableName) => { |
| 242 | 275 | handleType: "add", |
| 243 | 276 | sParentId: props.yftable0Data?.[0]?.sId || "", |
| 244 | 277 | sRev, |
| 245 | - bSave: 0 | |
| 278 | + bSave: 0, | |
| 246 | 279 | }; |
| 247 | 280 | |
| 248 | 281 | const { [`${tableName}Data`]: tableData = [] } = props; |
| 249 | 282 | props.onSaveState({ |
| 250 | - [`${tableName}Data`]: [...tableData, newData] | |
| 283 | + [`${tableName}Data`]: [...tableData, newData], | |
| 251 | 284 | }); |
| 252 | 285 | }; |
| 253 | 286 | |
| 254 | 287 | // 班组报工行车记录表格起始时间修改 |
| 255 | 288 | const mesTableChange1 = (props, tableName) => { |
| 256 | 289 | // const tableName = "table0"; |
| 257 | - const { | |
| 258 | - [`${tableName}SelectedRowKeys`]: selectedRowKeys, | |
| 259 | - [`${tableName}Data`]: tableData = [], | |
| 260 | - rowDataOld | |
| 261 | - } = props; | |
| 290 | + const { [`${tableName}SelectedRowKeys`]: selectedRowKeys, [`${tableName}Data`]: tableData = [], rowDataOld } = props; | |
| 262 | 291 | |
| 263 | 292 | let tableDataNew = lodash.cloneDeep(tableData); |
| 264 | 293 | |
| 265 | - const rowDataIndex = tableData.findIndex( | |
| 266 | - item => item.sId === selectedRowKeys[0] | |
| 267 | - ); | |
| 294 | + const rowDataIndex = tableData.findIndex(item => item.sId === selectedRowKeys[0]); | |
| 268 | 295 | if (rowDataIndex === -1) return; |
| 269 | 296 | |
| 270 | 297 | const rowData = tableData[rowDataIndex]; |
| ... | ... | @@ -275,30 +302,23 @@ const mesTableChange1 = (props, tableName) => { |
| 275 | 302 | return; |
| 276 | 303 | } |
| 277 | 304 | |
| 278 | - let parentRowDataIndex = tableData.findIndex( | |
| 279 | - item => item.sId !== sId && item.tStartDate === tStartDate | |
| 280 | - ); | |
| 305 | + let parentRowDataIndex = tableData.findIndex(item => item.sId !== sId && item.tStartDate === tStartDate); | |
| 281 | 306 | |
| 282 | 307 | if (parentRowDataIndex === -1) { |
| 283 | - parentRowDataIndex = tableData.findIndex( | |
| 284 | - item => item.tStartDate === rowDataOld.tEndDate | |
| 285 | - ); | |
| 308 | + parentRowDataIndex = tableData.findIndex(item => item.tStartDate === rowDataOld.tEndDate); | |
| 286 | 309 | } |
| 287 | 310 | |
| 288 | 311 | if (parentRowDataIndex === -1) return; |
| 289 | 312 | |
| 290 | 313 | const parentRowData = tableData[parentRowDataIndex]; |
| 291 | - const { | |
| 292 | - tStartDate: tStartDateParent, | |
| 293 | - tEndDate: tEndDateParent | |
| 294 | - } = parentRowData; | |
| 314 | + const { tStartDate: tStartDateParent, tEndDate: tEndDateParent } = parentRowData; | |
| 295 | 315 | |
| 296 | 316 | // 检查tStartDate是否在tEndDate之前 |
| 297 | 317 | if (moment(tEndDate).isBefore(moment(tStartDate))) { |
| 298 | 318 | message.info("结束时间不能小于起始时间!", 3); |
| 299 | 319 | tableDataNew[rowDataIndex] = rowDataOld; |
| 300 | 320 | props.onSaveState({ |
| 301 | - [`${tableName}Data`]: tableDataNew | |
| 321 | + [`${tableName}Data`]: tableDataNew, | |
| 302 | 322 | }); |
| 303 | 323 | return; |
| 304 | 324 | } |
| ... | ... | @@ -308,7 +328,7 @@ const mesTableChange1 = (props, tableName) => { |
| 308 | 328 | message.info("结束不能大于父节点的结束时间!", 3); |
| 309 | 329 | tableDataNew[rowDataIndex] = rowDataOld; |
| 310 | 330 | props.onSaveState({ |
| 311 | - [`${tableName}Data`]: tableDataNew | |
| 331 | + [`${tableName}Data`]: tableDataNew, | |
| 312 | 332 | }); |
| 313 | 333 | return; |
| 314 | 334 | } |
| ... | ... | @@ -318,7 +338,7 @@ const mesTableChange1 = (props, tableName) => { |
| 318 | 338 | message.info("结束不能大于当前时间!", 3); |
| 319 | 339 | tableDataNew[rowDataIndex] = rowDataOld; |
| 320 | 340 | props.onSaveState({ |
| 321 | - [`${tableName}Data`]: tableDataNew | |
| 341 | + [`${tableName}Data`]: tableDataNew, | |
| 322 | 342 | }); |
| 323 | 343 | return; |
| 324 | 344 | } |
| ... | ... | @@ -326,14 +346,13 @@ const mesTableChange1 = (props, tableName) => { |
| 326 | 346 | // 父节点的结束时间改成当前行的起始时间 |
| 327 | 347 | tableDataNew[rowDataIndex].bUnChanged = false; |
| 328 | 348 | tableDataNew[parentRowDataIndex].tStartDate = tEndDate; |
| 329 | - tableDataNew[parentRowDataIndex].handleType = | |
| 330 | - tableDataNew[parentRowDataIndex].handleType || "update"; | |
| 349 | + tableDataNew[parentRowDataIndex].handleType = tableDataNew[parentRowDataIndex].handleType || "update"; | |
| 331 | 350 | |
| 332 | 351 | // 时间倒序排序 |
| 333 | 352 | tableDataNew.sort((a, b) => new Date(b.tEndDate) - new Date(a.tEndDate)); |
| 334 | 353 | |
| 335 | 354 | const addState = { |
| 336 | - [`${tableName}Data`]: tableDataNew | |
| 355 | + [`${tableName}Data`]: tableDataNew, | |
| 337 | 356 | }; |
| 338 | 357 | props.onSaveState(addState); |
| 339 | 358 | |
| ... | ... | @@ -353,32 +372,28 @@ const mesTableLineDel1 = async (props, tableName) => { |
| 353 | 372 | if (commonUtils.isNotEmptyArr(tableData)) { |
| 354 | 373 | const addState = { |
| 355 | 374 | [`${tableName}SelectedRowKeys`]: [tableData[0].sId], |
| 356 | - [`slave1SelectedRowKeys`]: [tableData[0].sAbnormalEventId] | |
| 375 | + [`slave1SelectedRowKeys`]: [tableData[0].sAbnormalEventId], | |
| 357 | 376 | }; |
| 358 | 377 | |
| 359 | 378 | if (tableData.some(item => item.bUnChanged)) { |
| 360 | 379 | addState[`${tableName}Data`] = tableData.map(item => ({ |
| 361 | 380 | ...item, |
| 362 | - bUnChanged: undefined | |
| 381 | + bUnChanged: undefined, | |
| 363 | 382 | })); |
| 364 | 383 | } |
| 365 | 384 | |
| 366 | 385 | props.onSaveState(addState); |
| 367 | 386 | const name = tableName; |
| 368 | 387 | const { [`${name}Config`]: tableConfig = {} } = props; |
| 369 | - const rowClickConfig = tableConfig.gdsconfigformslave?.find( | |
| 370 | - item => | |
| 371 | - item.sControlName && | |
| 372 | - item.sControlName.toLowerCase().includes("rowclick") | |
| 373 | - ); | |
| 388 | + const rowClickConfig = tableConfig.gdsconfigformslave?.find(item => item.sControlName && item.sControlName.toLowerCase().includes("rowclick")); | |
| 374 | 389 | if (!rowClickConfig) return; |
| 375 | 390 | await awaitPromiseReturn(); |
| 376 | 391 | props.handleExecInstructSet({ |
| 377 | 392 | btnConfig: rowClickConfig, |
| 378 | 393 | nextProps: { |
| 379 | 394 | ...props, |
| 380 | - [`${tableName}SelectedRowKeys`]: [tableData[0].sId] | |
| 381 | - } | |
| 395 | + [`${tableName}SelectedRowKeys`]: [tableData[0].sId], | |
| 396 | + }, | |
| 382 | 397 | }); |
| 383 | 398 | } |
| 384 | 399 | return; |
| ... | ... | @@ -386,10 +401,7 @@ const mesTableLineDel1 = async (props, tableName) => { |
| 386 | 401 | |
| 387 | 402 | // 找剩余数据中开始时间等于删除数据结束时间的那条数据 |
| 388 | 403 | const iIndex = tableData.findIndex( |
| 389 | - item => | |
| 390 | - !item.bUnChanged && | |
| 391 | - (item.sSrcHourId === sSrcHourId || item.sId === sSrcHourId) && | |
| 392 | - tEndDate === item.tStartDate | |
| 404 | + item => !item.bUnChanged && (item.sSrcHourId === sSrcHourId || item.sId === sSrcHourId) && tEndDate === item.tStartDate | |
| 393 | 405 | ); |
| 394 | 406 | if (iIndex === -1) { |
| 395 | 407 | if (tableName === "table0") { |
| ... | ... | @@ -404,7 +416,7 @@ const mesTableLineDel1 = async (props, tableName) => { |
| 404 | 416 | tableDataNew[iIndex].tStartDate = tStartDate; |
| 405 | 417 | tableDataNew[iIndex].handleType = tableDataNew[iIndex].handleType || "update"; |
| 406 | 418 | const addState = { |
| 407 | - [`${tableName}Data`]: tableDataNew | |
| 419 | + [`${tableName}Data`]: tableDataNew, | |
| 408 | 420 | }; |
| 409 | 421 | props.onSaveState(addState); |
| 410 | 422 | |
| ... | ... | @@ -424,73 +436,67 @@ const handleMesSave = props => { |
| 424 | 436 | sInstruct: JSON.stringify([ |
| 425 | 437 | { |
| 426 | 438 | opr: "newempty", |
| 427 | - newDataset: "NewReportSlave" | |
| 439 | + newDataset: "NewReportSlave", | |
| 428 | 440 | }, |
| 429 | 441 | { |
| 430 | 442 | opr: "edit", |
| 431 | 443 | desDataset: "NewReportSlave", |
| 432 | 444 | dataset: "table0@sec", |
| 433 | - sValue: | |
| 434 | - "sNewReportSlaveId:table0.sId,sSrcHourId:table0.sSrcHourId,tEndDate:table0.tEndDate" | |
| 445 | + sValue: "sNewReportSlaveId:table0.sId,sSrcHourId:table0.sSrcHourId,tEndDate:table0.tEndDate", | |
| 435 | 446 | }, |
| 436 | 447 | { |
| 437 | 448 | opr: "filter", |
| 438 | 449 | srcDataset: "table0", |
| 439 | 450 | newDataset: "OldReportSlave", |
| 440 | 451 | dataset: "NewReportSlave,table0One", |
| 441 | - condition: "'${table0One.sId}'=='${NewReportSlave.sSrcHourId}'" | |
| 452 | + condition: "'${table0One.sId}'=='${NewReportSlave.sSrcHourId}'", | |
| 442 | 453 | }, |
| 443 | 454 | { |
| 444 | 455 | opr: "newempty", |
| 445 | - newDataset: "temp0" | |
| 456 | + newDataset: "temp0", | |
| 446 | 457 | }, |
| 447 | 458 | { |
| 448 | 459 | opr: "edit", |
| 449 | 460 | desDataset: "temp0", |
| 450 | 461 | dataset: "NewReportSlave,OldReportSlave", |
| 451 | 462 | sValue: |
| 452 | - "iOperateType:${1},sNewReportSlaveId:NewReportSlave.sNewReportSlaveId,sOldReportSlaveId:OldReportSlave.sId,tNewEndDate:NewReportSlave.tEndDate" | |
| 463 | + "iOperateType:${1},sNewReportSlaveId:NewReportSlave.sNewReportSlaveId,sOldReportSlaveId:OldReportSlave.sId,tNewEndDate:NewReportSlave.tEndDate", | |
| 453 | 464 | }, |
| 454 | 465 | { |
| 455 | 466 | opr: "exesql", |
| 456 | 467 | data: [ |
| 457 | 468 | { |
| 458 | - sql: | |
| 459 | - "call Sp_mes_Operate_ProductionReport(${iOperateType},${sNewReportSlaveId},${sOldReportSlaveId},${tNewEndDate})", | |
| 460 | - srcDataset: "temp0" | |
| 461 | - } | |
| 462 | - ] | |
| 469 | + sql: "call Sp_mes_Operate_ProductionReport(${iOperateType},${sNewReportSlaveId},${sOldReportSlaveId},${tNewEndDate})", | |
| 470 | + srcDataset: "temp0", | |
| 471 | + }, | |
| 472 | + ], | |
| 463 | 473 | }, |
| 464 | 474 | { |
| 465 | 475 | opr: "save", |
| 466 | 476 | data: [ |
| 467 | 477 | { |
| 468 | 478 | tablename: "mftproductionreportslave", |
| 469 | - srcDataset: "table0" | |
| 470 | - } | |
| 471 | - ] | |
| 479 | + srcDataset: "table0", | |
| 480 | + }, | |
| 481 | + ], | |
| 472 | 482 | }, |
| 473 | 483 | { |
| 474 | 484 | opr: "refresh", |
| 475 | - dataset: "table0,table1,table4,table0NotFirstlineSelected" | |
| 476 | - } | |
| 477 | - ]) | |
| 485 | + dataset: "table0,table1,table4,table0NotFirstlineSelected", | |
| 486 | + }, | |
| 487 | + ]), | |
| 478 | 488 | }, |
| 479 | 489 | inscallback: async () => { |
| 480 | 490 | const name = "table0"; |
| 481 | 491 | const { [`${name}Config`]: tableConfig = {} } = props; |
| 482 | - const rowClickConfig = tableConfig.gdsconfigformslave?.find( | |
| 483 | - item => | |
| 484 | - item.sControlName && | |
| 485 | - item.sControlName.toLowerCase().includes("rowclick") | |
| 486 | - ); | |
| 492 | + const rowClickConfig = tableConfig.gdsconfigformslave?.find(item => item.sControlName && item.sControlName.toLowerCase().includes("rowclick")); | |
| 487 | 493 | if (!rowClickConfig) return; |
| 488 | 494 | await awaitPromiseReturn(); |
| 489 | 495 | props.handleExecInstructSet({ |
| 490 | 496 | btnConfig: rowClickConfig, |
| 491 | - nextProps: props | |
| 497 | + nextProps: props, | |
| 492 | 498 | }); |
| 493 | - } | |
| 499 | + }, | |
| 494 | 500 | }); |
| 495 | 501 | }; |
| 496 | 502 | |
| ... | ... | @@ -513,25 +519,24 @@ const handleMesSlave0Save = props => { |
| 513 | 519 | sInstruct: JSON.stringify([ |
| 514 | 520 | { |
| 515 | 521 | opr: "newempty", |
| 516 | - newDataset: "NewReportSlave" | |
| 522 | + newDataset: "NewReportSlave", | |
| 517 | 523 | }, |
| 518 | 524 | { |
| 519 | 525 | opr: "edit", |
| 520 | 526 | desDataset: "NewReportSlave", |
| 521 | 527 | dataset: "slave0@sec", |
| 522 | - sValue: | |
| 523 | - "sNewReportSlaveId:slave0.sId,sSrcHourId:slave0.sSrcHourId,tEndDate:slave0.tEndDate" | |
| 528 | + sValue: "sNewReportSlaveId:slave0.sId,sSrcHourId:slave0.sSrcHourId,tEndDate:slave0.tEndDate", | |
| 524 | 529 | }, |
| 525 | 530 | { |
| 526 | 531 | opr: "filter", |
| 527 | 532 | srcDataset: "slave0", |
| 528 | 533 | newDataset: "OldReportSlave", |
| 529 | 534 | dataset: "NewReportSlave,slave0One", |
| 530 | - condition: "'${slave0One.sId}'=='${NewReportSlave.sSrcHourId}'" | |
| 535 | + condition: "'${slave0One.sId}'=='${NewReportSlave.sSrcHourId}'", | |
| 531 | 536 | }, |
| 532 | 537 | { |
| 533 | 538 | opr: "newempty", |
| 534 | - newDataset: "temp0" | |
| 539 | + newDataset: "temp0", | |
| 535 | 540 | }, |
| 536 | 541 | |
| 537 | 542 | { |
| ... | ... | @@ -539,48 +544,43 @@ const handleMesSlave0Save = props => { |
| 539 | 544 | desDataset: "temp0", |
| 540 | 545 | dataset: "NewReportSlave,OldReportSlave", |
| 541 | 546 | sValue: |
| 542 | - "iOperateType:${1},sNewReportSlaveId:NewReportSlave.sNewReportSlaveId,sOldReportSlaveId:OldReportSlave.sId,tNewEndDate:NewReportSlave.tEndDate" | |
| 547 | + "iOperateType:${1},sNewReportSlaveId:NewReportSlave.sNewReportSlaveId,sOldReportSlaveId:OldReportSlave.sId,tNewEndDate:NewReportSlave.tEndDate", | |
| 543 | 548 | }, |
| 544 | 549 | { |
| 545 | 550 | opr: "exesql", |
| 546 | 551 | data: [ |
| 547 | 552 | { |
| 548 | - sql: | |
| 549 | - "call Sp_mes_Operate_ProductionReport(${iOperateType},${sNewReportSlaveId},${sOldReportSlaveId},${tNewEndDate})", | |
| 550 | - srcDataset: "temp0" | |
| 551 | - } | |
| 552 | - ] | |
| 553 | + sql: "call Sp_mes_Operate_ProductionReport(${iOperateType},${sNewReportSlaveId},${sOldReportSlaveId},${tNewEndDate})", | |
| 554 | + srcDataset: "temp0", | |
| 555 | + }, | |
| 556 | + ], | |
| 553 | 557 | }, |
| 554 | 558 | { |
| 555 | 559 | opr: "save", |
| 556 | 560 | data: [ |
| 557 | 561 | { |
| 558 | 562 | tablename: "mftproductionreportslave", |
| 559 | - srcDataset: "slave0" | |
| 560 | - } | |
| 561 | - ] | |
| 563 | + srcDataset: "slave0", | |
| 564 | + }, | |
| 565 | + ], | |
| 562 | 566 | }, |
| 563 | 567 | { |
| 564 | 568 | opr: "refresh", |
| 565 | - dataset: "slave0,slave0NotFirstlineSelected" | |
| 566 | - } | |
| 567 | - ]) | |
| 569 | + dataset: "slave0,slave0NotFirstlineSelected", | |
| 570 | + }, | |
| 571 | + ]), | |
| 568 | 572 | }, |
| 569 | 573 | inscallback: async nextProps => { |
| 570 | 574 | const name = "slave0"; |
| 571 | 575 | const { [`${name}Config`]: tableConfig = {} } = props; |
| 572 | - const rowClickConfig = tableConfig.gdsconfigformslave?.find( | |
| 573 | - item => | |
| 574 | - item.sControlName && | |
| 575 | - item.sControlName.toLowerCase().includes("rowclick") | |
| 576 | - ); | |
| 576 | + const rowClickConfig = tableConfig.gdsconfigformslave?.find(item => item.sControlName && item.sControlName.toLowerCase().includes("rowclick")); | |
| 577 | 577 | if (!rowClickConfig) return; |
| 578 | 578 | await awaitPromiseReturn(); |
| 579 | 579 | props.handleExecInstructSet({ |
| 580 | 580 | btnConfig: rowClickConfig, |
| 581 | - nextProps: nextProps | |
| 581 | + nextProps: nextProps, | |
| 582 | 582 | }); |
| 583 | - } | |
| 583 | + }, | |
| 584 | 584 | }); |
| 585 | 585 | }; |
| 586 | 586 | |
| ... | ... | @@ -590,7 +590,7 @@ const handleMesSave1 = (props, delRow) => { |
| 590 | 590 | const temp0Data = []; |
| 591 | 591 | temp0Data.push({ |
| 592 | 592 | sNewReportSlaveId: delRow.sId, |
| 593 | - sOldReportSlaveId: delRow.sSrcHourId | |
| 593 | + sOldReportSlaveId: delRow.sSrcHourId, | |
| 594 | 594 | }); |
| 595 | 595 | |
| 596 | 596 | props.handleExecInstructSet({ |
| ... | ... | @@ -602,11 +602,10 @@ const handleMesSave1 = (props, delRow) => { |
| 602 | 602 | opr: "exesql", |
| 603 | 603 | data: [ |
| 604 | 604 | { |
| 605 | - sql: | |
| 606 | - "call Sp_mes_Operate_ProductionReport(2,${sNewReportSlaveId},${sOldReportSlaveId},null)", | |
| 607 | - srcDataset: "temp0" | |
| 608 | - } | |
| 609 | - ] | |
| 605 | + sql: "call Sp_mes_Operate_ProductionReport(2,${sNewReportSlaveId},${sOldReportSlaveId},null)", | |
| 606 | + srcDataset: "temp0", | |
| 607 | + }, | |
| 608 | + ], | |
| 610 | 609 | }, |
| 611 | 610 | |
| 612 | 611 | // { |
| ... | ... | @@ -633,25 +632,21 @@ const handleMesSave1 = (props, delRow) => { |
| 633 | 632 | // }, |
| 634 | 633 | { |
| 635 | 634 | opr: "refresh", |
| 636 | - dataset: "table0,table1,table4,tableS1,table0FirstlineSelected" | |
| 637 | - } | |
| 638 | - ]) | |
| 635 | + dataset: "table0,table1,table4,tableS1,table0FirstlineSelected", | |
| 636 | + }, | |
| 637 | + ]), | |
| 639 | 638 | }, |
| 640 | 639 | inscallback: async nextProps => { |
| 641 | 640 | const name = "table0"; |
| 642 | 641 | const { [`${name}Config`]: tableConfig = {} } = props; |
| 643 | - const rowClickConfig = tableConfig.gdsconfigformslave?.find( | |
| 644 | - item => | |
| 645 | - item.sControlName && | |
| 646 | - item.sControlName.toLowerCase().includes("rowclick") | |
| 647 | - ); | |
| 642 | + const rowClickConfig = tableConfig.gdsconfigformslave?.find(item => item.sControlName && item.sControlName.toLowerCase().includes("rowclick")); | |
| 648 | 643 | if (!rowClickConfig) return; |
| 649 | 644 | await awaitPromiseReturn(); |
| 650 | 645 | props.handleExecInstructSet({ |
| 651 | 646 | btnConfig: rowClickConfig, |
| 652 | - nextProps: nextProps | |
| 647 | + nextProps: nextProps, | |
| 653 | 648 | }); |
| 654 | - } | |
| 649 | + }, | |
| 655 | 650 | }); |
| 656 | 651 | }; |
| 657 | 652 | |
| ... | ... | @@ -661,7 +656,7 @@ const handleMesSlave0Save1 = (props, delRow) => { |
| 661 | 656 | const temp0Data = []; |
| 662 | 657 | temp0Data.push({ |
| 663 | 658 | sNewReportSlaveId: delRow.sId, |
| 664 | - sOldReportSlaveId: delRow.sSrcHourId | |
| 659 | + sOldReportSlaveId: delRow.sSrcHourId, | |
| 665 | 660 | }); |
| 666 | 661 | |
| 667 | 662 | props.handleExecInstructSet({ |
| ... | ... | @@ -680,51 +675,40 @@ const handleMesSlave0Save1 = (props, delRow) => { |
| 680 | 675 | opr: "exesql", |
| 681 | 676 | data: [ |
| 682 | 677 | { |
| 683 | - sql: | |
| 684 | - "call Sp_mes_Operate_ProductionReport(2,${sNewReportSlaveId},${sOldReportSlaveId},null)", | |
| 685 | - srcDataset: "temp0" | |
| 686 | - } | |
| 687 | - ] | |
| 678 | + sql: "call Sp_mes_Operate_ProductionReport(2,${sNewReportSlaveId},${sOldReportSlaveId},null)", | |
| 679 | + srcDataset: "temp0", | |
| 680 | + }, | |
| 681 | + ], | |
| 688 | 682 | }, |
| 689 | 683 | { |
| 690 | 684 | opr: "refresh", |
| 691 | - dataset: "slave0,slave0FirstlineSelected" | |
| 692 | - } | |
| 693 | - ]) | |
| 685 | + dataset: "slave0,slave0FirstlineSelected", | |
| 686 | + }, | |
| 687 | + ]), | |
| 694 | 688 | }, |
| 695 | 689 | inscallback: async nextProps => { |
| 696 | 690 | const name = "slave0"; |
| 697 | 691 | const { [`${name}Config`]: tableConfig = {} } = props; |
| 698 | - const rowClickConfig = tableConfig.gdsconfigformslave?.find( | |
| 699 | - item => | |
| 700 | - item.sControlName && | |
| 701 | - item.sControlName.toLowerCase().includes("rowclick") | |
| 702 | - ); | |
| 692 | + const rowClickConfig = tableConfig.gdsconfigformslave?.find(item => item.sControlName && item.sControlName.toLowerCase().includes("rowclick")); | |
| 703 | 693 | if (!rowClickConfig) return; |
| 704 | 694 | await awaitPromiseReturn(); |
| 705 | 695 | props.handleExecInstructSet({ |
| 706 | 696 | btnConfig: rowClickConfig, |
| 707 | - nextProps: nextProps | |
| 697 | + nextProps: nextProps, | |
| 708 | 698 | }); |
| 709 | - } | |
| 699 | + }, | |
| 710 | 700 | }); |
| 711 | 701 | }; |
| 712 | 702 | |
| 713 | 703 | // 班组报工托盘计数信息按钮 |
| 714 | 704 | const mesGetBtnsConfig1 = props => { |
| 715 | - const { | |
| 716 | - table0Data = [], | |
| 717 | - table0SelectedRowKeys = [], | |
| 718 | - btnsConfig = [] | |
| 719 | - } = props; | |
| 705 | + const { table0Data = [], table0SelectedRowKeys = [], btnsConfig = [] } = props; | |
| 720 | 706 | |
| 721 | 707 | if (!table0SelectedRowKeys.length) { |
| 722 | 708 | return []; |
| 723 | 709 | } |
| 724 | 710 | |
| 725 | - const table0Row = table0Data.find( | |
| 726 | - item => item.sId === table0SelectedRowKeys[0] | |
| 727 | - ); | |
| 711 | + const table0Row = table0Data.find(item => item.sId === table0SelectedRowKeys[0]); | |
| 728 | 712 | const sSrcHourId = table0Row?.sSrcHourId; |
| 729 | 713 | |
| 730 | 714 | // 是否新纪录 |
| ... | ... | @@ -740,16 +724,9 @@ const mesGetBtnsConfig1 = props => { |
| 740 | 724 | |
| 741 | 725 | // 班组报工托盘计数信息按钮点击事件 |
| 742 | 726 | const mesTableBtnClick1 = props => { |
| 743 | - const { | |
| 744 | - sControlName, | |
| 745 | - table0Data = [], | |
| 746 | - table0SelectedRowKeys = [], | |
| 747 | - params | |
| 748 | - } = props; | |
| 727 | + const { sControlName, table0Data = [], table0SelectedRowKeys = [], params } = props; | |
| 749 | 728 | const { record } = params; |
| 750 | - const table0Row = table0Data.find( | |
| 751 | - item => item.sId === table0SelectedRowKeys[0] | |
| 752 | - ); | |
| 729 | + const table0Row = table0Data.find(item => item.sId === table0SelectedRowKeys[0]); | |
| 753 | 730 | const { sId, sSrcHourId, tStartDate, tEndDate } = table0Row; |
| 754 | 731 | |
| 755 | 732 | let table0RowNext; |
| ... | ... | @@ -757,21 +734,13 @@ const mesTableBtnClick1 = props => { |
| 757 | 734 | // 调至下段 |
| 758 | 735 | table0RowNext = table0Data.find( |
| 759 | 736 | item => |
| 760 | - !item.bUnChanged && | |
| 761 | - item.tStartDate === tEndDate && | |
| 762 | - (item.sId === sSrcHourId || | |
| 763 | - item.sSrcHourId === sSrcHourId || | |
| 764 | - item.sSrcHourId === sId) | |
| 737 | + !item.bUnChanged && item.tStartDate === tEndDate && (item.sId === sSrcHourId || item.sSrcHourId === sSrcHourId || item.sSrcHourId === sId) | |
| 765 | 738 | ); |
| 766 | 739 | } else { |
| 767 | 740 | // 调至上段 |
| 768 | 741 | table0RowNext = table0Data.find( |
| 769 | 742 | item => |
| 770 | - !item.bUnChanged && | |
| 771 | - item.tEndDate === tStartDate && | |
| 772 | - (item.sId === sSrcHourId || | |
| 773 | - item.sSrcHourId === sSrcHourId || | |
| 774 | - item.sSrcHourId === sId) | |
| 743 | + !item.bUnChanged && item.tEndDate === tStartDate && (item.sId === sSrcHourId || item.sSrcHourId === sSrcHourId || item.sSrcHourId === sId) | |
| 775 | 744 | ); |
| 776 | 745 | } |
| 777 | 746 | |
| ... | ... | @@ -779,7 +748,7 @@ const mesTableBtnClick1 = props => { |
| 779 | 748 | temp0Data.push({ |
| 780 | 749 | sNewReportSlaveId: sId, |
| 781 | 750 | sOldReportSlaveId: table0RowNext.sId, |
| 782 | - sTrayOutId: record.sId | |
| 751 | + sTrayOutId: record.sId, | |
| 783 | 752 | }); |
| 784 | 753 | |
| 785 | 754 | props.onExecInstructSet({ |
| ... | ... | @@ -793,16 +762,16 @@ const mesTableBtnClick1 = props => { |
| 793 | 762 | { |
| 794 | 763 | sql: |
| 795 | 764 | "update mftplctray A SET A.sReportTrayId= ${sOldReportSlaveId} WHERE A.sReportTrayId=${sNewReportSlaveId} and A.sTrayOutId=${sTrayOutId}", |
| 796 | - srcDataset: "temp0" | |
| 797 | - } | |
| 798 | - ] | |
| 765 | + srcDataset: "temp0", | |
| 766 | + }, | |
| 767 | + ], | |
| 799 | 768 | }, |
| 800 | 769 | { |
| 801 | 770 | opr: "refresh", |
| 802 | - dataset: "table1" | |
| 803 | - } | |
| 804 | - ]) | |
| 805 | - } | |
| 771 | + dataset: "table1", | |
| 772 | + }, | |
| 773 | + ]), | |
| 774 | + }, | |
| 806 | 775 | }); |
| 807 | 776 | }; |
| 808 | 777 | |
| ... | ... | @@ -833,7 +802,7 @@ const mesTableBtnClick2 = props => { |
| 833 | 802 | tableS5Data: [], |
| 834 | 803 | tableS8Data: [], |
| 835 | 804 | tableS9Data: [], |
| 836 | - tableS10Data: [] | |
| 805 | + tableS10Data: [], | |
| 837 | 806 | }); |
| 838 | 807 | |
| 839 | 808 | const oTabs = document.querySelectorAll(`.ant-tabs-tab-btn[id*="生产日报"]`); |
| ... | ... | @@ -850,7 +819,7 @@ const mesTableBtnClick3 = props => { |
| 850 | 819 | if (bHourlyReport) { |
| 851 | 820 | props.onExecInstructSet({ |
| 852 | 821 | nextProps: props, |
| 853 | - btnConfig: config | |
| 822 | + btnConfig: config, | |
| 854 | 823 | }); |
| 855 | 824 | return; |
| 856 | 825 | } |
| ... | ... | @@ -868,22 +837,20 @@ const mesTableBtnClick3 = props => { |
| 868 | 837 | props.onSaveState({ |
| 869 | 838 | table0SelectedRowKeys: [], |
| 870 | 839 | table4Data: [], |
| 871 | - table13Data: [] | |
| 840 | + table13Data: [], | |
| 872 | 841 | }); |
| 873 | 842 | |
| 874 | 843 | setTimeout(() => { |
| 875 | 844 | props.onTableSelectRowChange("table0", [table0Data[iIndex].sId]); |
| 876 | 845 | props.onSaveState({ |
| 877 | - refreshTableList: ["table0,table0NotFirstlineSelected"] | |
| 846 | + refreshTableList: ["table0,table0NotFirstlineSelected"], | |
| 878 | 847 | }); |
| 879 | 848 | }, 200); |
| 880 | 849 | |
| 881 | 850 | const oTabs = document.querySelectorAll(`.ant-tabs-tab-btn[id*="班组报工"]`); |
| 882 | 851 | oTabs?.[0]?.click(); |
| 883 | 852 | setTimeout(() => { |
| 884 | - const oTabs1 = document.querySelectorAll( | |
| 885 | - `.ant-tabs-tab-btn[id*="产量上报信息"]` | |
| 886 | - ); | |
| 853 | + const oTabs1 = document.querySelectorAll(`.ant-tabs-tab-btn[id*="产量上报信息"]`); | |
| 887 | 854 | oTabs1?.[0]?.click(); |
| 888 | 855 | }, 200); |
| 889 | 856 | }; |
| ... | ... | @@ -892,10 +859,7 @@ const mesTableBtnClick3 = props => { |
| 892 | 859 | const handleSlaveWypj2BtnPre = props => { |
| 893 | 860 | const listName = "slaveWypj2"; |
| 894 | 861 | const tableName = "slaveWypj3"; |
| 895 | - const { | |
| 896 | - [`${listName}Data`]: listData = [], | |
| 897 | - [`${tableName}Data`]: tableData = [] | |
| 898 | - } = props; | |
| 862 | + const { [`${listName}Data`]: listData = [], [`${tableName}Data`]: tableData = [] } = props; | |
| 899 | 863 | |
| 900 | 864 | const [rowData = {}] = listData; |
| 901 | 865 | |
| ... | ... | @@ -910,23 +874,21 @@ const handleSlaveWypj2BtnPre = props => { |
| 910 | 874 | return; |
| 911 | 875 | } |
| 912 | 876 | |
| 913 | - const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find( | |
| 914 | - item => item.sControlName === "BtnTable.View" | |
| 915 | - )?.sInstruct; | |
| 877 | + const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find(item => item.sControlName === "BtnTable.View")?.sInstruct; | |
| 916 | 878 | if (!sInstructStr) return; |
| 917 | 879 | |
| 918 | 880 | const selectedRowKeys = [tableData[iIndex - 1].sId]; |
| 919 | 881 | props.onSaveState( |
| 920 | 882 | { |
| 921 | - [`${tableName}SelectedRowKeys`]: selectedRowKeys | |
| 883 | + [`${tableName}SelectedRowKeys`]: selectedRowKeys, | |
| 922 | 884 | }, |
| 923 | 885 | nextProps => { |
| 924 | 886 | props.onExecInstructSet({ |
| 925 | 887 | nextProps: nextProps, |
| 926 | 888 | btnConfig: { |
| 927 | 889 | showName: "上一卷", |
| 928 | - sInstruct: sInstructStr | |
| 929 | - } | |
| 890 | + sInstruct: sInstructStr, | |
| 891 | + }, | |
| 930 | 892 | }); |
| 931 | 893 | } |
| 932 | 894 | ); |
| ... | ... | @@ -936,10 +898,7 @@ const handleSlaveWypj2BtnPre = props => { |
| 936 | 898 | const handleSlaveWypj2BtnNext = props => { |
| 937 | 899 | const listName = "slaveWypj2"; |
| 938 | 900 | const tableName = "slaveWypj3"; |
| 939 | - const { | |
| 940 | - [`${listName}Data`]: listData = [], | |
| 941 | - [`${tableName}Data`]: tableData = [] | |
| 942 | - } = props; | |
| 901 | + const { [`${listName}Data`]: listData = [], [`${tableName}Data`]: tableData = [] } = props; | |
| 943 | 902 | |
| 944 | 903 | const [rowData = {}] = listData; |
| 945 | 904 | |
| ... | ... | @@ -954,23 +913,21 @@ const handleSlaveWypj2BtnNext = props => { |
| 954 | 913 | return; |
| 955 | 914 | } |
| 956 | 915 | |
| 957 | - const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find( | |
| 958 | - item => item.sControlName === "BtnTable.View" | |
| 959 | - )?.sInstruct; | |
| 916 | + const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find(item => item.sControlName === "BtnTable.View")?.sInstruct; | |
| 960 | 917 | if (!sInstructStr) return; |
| 961 | 918 | |
| 962 | 919 | const selectedRowKeys = [tableData[iIndex + 1].sId]; |
| 963 | 920 | props.onSaveState( |
| 964 | 921 | { |
| 965 | - [`${tableName}SelectedRowKeys`]: selectedRowKeys | |
| 922 | + [`${tableName}SelectedRowKeys`]: selectedRowKeys, | |
| 966 | 923 | }, |
| 967 | 924 | nextProps => { |
| 968 | 925 | props.onExecInstructSet({ |
| 969 | 926 | nextProps: nextProps, |
| 970 | 927 | btnConfig: { |
| 971 | 928 | showName: "下一卷", |
| 972 | - sInstruct: sInstructStr | |
| 973 | - } | |
| 929 | + sInstruct: sInstructStr, | |
| 930 | + }, | |
| 974 | 931 | }); |
| 975 | 932 | } |
| 976 | 933 | ); |
| ... | ... | @@ -980,10 +937,7 @@ const handleSlaveWypj2BtnNext = props => { |
| 980 | 937 | const handleSalveWydm2BtnPre = props => { |
| 981 | 938 | const listName = "salveWydm2"; |
| 982 | 939 | const tableName = "salveWydm3"; |
| 983 | - const { | |
| 984 | - [`${listName}Data`]: listData = [], | |
| 985 | - [`${tableName}Data`]: tableData = [] | |
| 986 | - } = props; | |
| 940 | + const { [`${listName}Data`]: listData = [], [`${tableName}Data`]: tableData = [] } = props; | |
| 987 | 941 | |
| 988 | 942 | const [rowData = {}] = listData; |
| 989 | 943 | |
| ... | ... | @@ -998,23 +952,21 @@ const handleSalveWydm2BtnPre = props => { |
| 998 | 952 | return; |
| 999 | 953 | } |
| 1000 | 954 | |
| 1001 | - const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find( | |
| 1002 | - item => item.sControlName === "BtnReelView" | |
| 1003 | - )?.sInstruct; | |
| 955 | + const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find(item => item.sControlName === "BtnReelView")?.sInstruct; | |
| 1004 | 956 | if (!sInstructStr) return; |
| 1005 | 957 | |
| 1006 | 958 | const selectedRowKeys = [tableData[iIndex - 1].sId]; |
| 1007 | 959 | props.onSaveState( |
| 1008 | 960 | { |
| 1009 | - [`${tableName}SelectedRowKeys`]: selectedRowKeys | |
| 961 | + [`${tableName}SelectedRowKeys`]: selectedRowKeys, | |
| 1010 | 962 | }, |
| 1011 | 963 | nextProps => { |
| 1012 | 964 | props.onExecInstructSet({ |
| 1013 | 965 | nextProps: nextProps, |
| 1014 | 966 | btnConfig: { |
| 1015 | 967 | showName: "上一版", |
| 1016 | - sInstruct: sInstructStr | |
| 1017 | - } | |
| 968 | + sInstruct: sInstructStr, | |
| 969 | + }, | |
| 1018 | 970 | }); |
| 1019 | 971 | } |
| 1020 | 972 | ); |
| ... | ... | @@ -1024,10 +976,7 @@ const handleSalveWydm2BtnPre = props => { |
| 1024 | 976 | const handleSalveWydm2BtnNext = props => { |
| 1025 | 977 | const listName = "salveWydm2"; |
| 1026 | 978 | const tableName = "salveWydm3"; |
| 1027 | - const { | |
| 1028 | - [`${listName}Data`]: listData = [], | |
| 1029 | - [`${tableName}Data`]: tableData = [] | |
| 1030 | - } = props; | |
| 979 | + const { [`${listName}Data`]: listData = [], [`${tableName}Data`]: tableData = [] } = props; | |
| 1031 | 980 | |
| 1032 | 981 | const [rowData = {}] = listData; |
| 1033 | 982 | |
| ... | ... | @@ -1042,23 +991,21 @@ const handleSalveWydm2BtnNext = props => { |
| 1042 | 991 | return; |
| 1043 | 992 | } |
| 1044 | 993 | |
| 1045 | - const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find( | |
| 1046 | - item => item.sControlName === "BtnReelView" | |
| 1047 | - )?.sInstruct; | |
| 994 | + const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find(item => item.sControlName === "BtnReelView")?.sInstruct; | |
| 1048 | 995 | if (!sInstructStr) return; |
| 1049 | 996 | |
| 1050 | 997 | const selectedRowKeys = [tableData[iIndex + 1].sId]; |
| 1051 | 998 | props.onSaveState( |
| 1052 | 999 | { |
| 1053 | - [`${tableName}SelectedRowKeys`]: selectedRowKeys | |
| 1000 | + [`${tableName}SelectedRowKeys`]: selectedRowKeys, | |
| 1054 | 1001 | }, |
| 1055 | 1002 | nextProps => { |
| 1056 | 1003 | props.onExecInstructSet({ |
| 1057 | 1004 | nextProps: nextProps, |
| 1058 | 1005 | btnConfig: { |
| 1059 | 1006 | showName: "下一版", |
| 1060 | - sInstruct: sInstructStr | |
| 1061 | - } | |
| 1007 | + sInstruct: sInstructStr, | |
| 1008 | + }, | |
| 1062 | 1009 | }); |
| 1063 | 1010 | } |
| 1064 | 1011 | ); |
| ... | ... | @@ -1068,15 +1015,11 @@ const handleSalveWydm2BtnNext = props => { |
| 1068 | 1015 | const handleSlaveWyrj2BtnPre = props => { |
| 1069 | 1016 | const listName = "slaveWyrj2"; |
| 1070 | 1017 | const tableName = "slaveWyrj3"; |
| 1071 | - const { | |
| 1072 | - [`${listName}Data`]: listData = [], | |
| 1073 | - [`${tableName}Data`]: tableData = [] | |
| 1074 | - } = props; | |
| 1018 | + const { [`${listName}Data`]: listData = [], [`${tableName}Data`]: tableData = [] } = props; | |
| 1075 | 1019 | |
| 1076 | 1020 | const [rowData = {}] = listData; |
| 1077 | 1021 | |
| 1078 | 1022 | const iIndex = tableData.findIndex(item => item.sId === rowData.sId); |
| 1079 | - console.log("=====rowData", rowData, tableData); | |
| 1080 | 1023 | if (iIndex === -1) { |
| 1081 | 1024 | message.info("暂无数据!"); |
| 1082 | 1025 | return; |
| ... | ... | @@ -1087,23 +1030,21 @@ const handleSlaveWyrj2BtnPre = props => { |
| 1087 | 1030 | return; |
| 1088 | 1031 | } |
| 1089 | 1032 | |
| 1090 | - const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find( | |
| 1091 | - item => item.sControlName === "BtnReelView" | |
| 1092 | - )?.sInstruct; | |
| 1033 | + const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find(item => item.sControlName === "BtnReelView")?.sInstruct; | |
| 1093 | 1034 | if (!sInstructStr) return; |
| 1094 | 1035 | |
| 1095 | 1036 | const selectedRowKeys = [tableData[iIndex - 1].sId]; |
| 1096 | 1037 | props.onSaveState( |
| 1097 | 1038 | { |
| 1098 | - [`${tableName}SelectedRowKeys`]: selectedRowKeys | |
| 1039 | + [`${tableName}SelectedRowKeys`]: selectedRowKeys, | |
| 1099 | 1040 | }, |
| 1100 | 1041 | nextProps => { |
| 1101 | 1042 | props.onExecInstructSet({ |
| 1102 | 1043 | nextProps: nextProps, |
| 1103 | 1044 | btnConfig: { |
| 1104 | 1045 | showName: "上一版", |
| 1105 | - sInstruct: sInstructStr | |
| 1106 | - } | |
| 1046 | + sInstruct: sInstructStr, | |
| 1047 | + }, | |
| 1107 | 1048 | }); |
| 1108 | 1049 | } |
| 1109 | 1050 | ); |
| ... | ... | @@ -1113,10 +1054,7 @@ const handleSlaveWyrj2BtnPre = props => { |
| 1113 | 1054 | const handleSlaveWyrj2BtnNext = props => { |
| 1114 | 1055 | const listName = "slaveWyrj2"; |
| 1115 | 1056 | const tableName = "slaveWyrj3"; |
| 1116 | - const { | |
| 1117 | - [`${listName}Data`]: listData = [], | |
| 1118 | - [`${tableName}Data`]: tableData = [] | |
| 1119 | - } = props; | |
| 1057 | + const { [`${listName}Data`]: listData = [], [`${tableName}Data`]: tableData = [] } = props; | |
| 1120 | 1058 | |
| 1121 | 1059 | const [rowData = {}] = listData; |
| 1122 | 1060 | |
| ... | ... | @@ -1131,23 +1069,21 @@ const handleSlaveWyrj2BtnNext = props => { |
| 1131 | 1069 | return; |
| 1132 | 1070 | } |
| 1133 | 1071 | |
| 1134 | - const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find( | |
| 1135 | - item => item.sControlName === "BtnReelView" | |
| 1136 | - )?.sInstruct; | |
| 1072 | + const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find(item => item.sControlName === "BtnReelView")?.sInstruct; | |
| 1137 | 1073 | if (!sInstructStr) return; |
| 1138 | 1074 | |
| 1139 | 1075 | const selectedRowKeys = [tableData[iIndex + 1].sId]; |
| 1140 | 1076 | props.onSaveState( |
| 1141 | 1077 | { |
| 1142 | - [`${tableName}SelectedRowKeys`]: selectedRowKeys | |
| 1078 | + [`${tableName}SelectedRowKeys`]: selectedRowKeys, | |
| 1143 | 1079 | }, |
| 1144 | 1080 | nextProps => { |
| 1145 | 1081 | props.onExecInstructSet({ |
| 1146 | 1082 | nextProps: nextProps, |
| 1147 | 1083 | btnConfig: { |
| 1148 | 1084 | showName: "下一版", |
| 1149 | - sInstruct: sInstructStr | |
| 1150 | - } | |
| 1085 | + sInstruct: sInstructStr, | |
| 1086 | + }, | |
| 1151 | 1087 | }); |
| 1152 | 1088 | } |
| 1153 | 1089 | ); |
| ... | ... | @@ -1159,10 +1095,7 @@ const handleUpDownData = props => { |
| 1159 | 1095 | const listName = showTableName; |
| 1160 | 1096 | const tableName = showTableName.substr(0, showTableName.length - 1) + 3; |
| 1161 | 1097 | |
| 1162 | - const { | |
| 1163 | - [`${listName}Data`]: listData = [], | |
| 1164 | - [`${tableName}Data`]: tableData = [] | |
| 1165 | - } = props; | |
| 1098 | + const { [`${listName}Data`]: listData = [], [`${tableName}Data`]: tableData = [] } = props; | |
| 1166 | 1099 | |
| 1167 | 1100 | const [rowData = {}] = listData; |
| 1168 | 1101 | |
| ... | ... | @@ -1177,36 +1110,31 @@ const handleUpDownData = props => { |
| 1177 | 1110 | return; |
| 1178 | 1111 | } |
| 1179 | 1112 | |
| 1180 | - if ( | |
| 1181 | - ["BtnRight.NextCom"].includes(sFieldName) && | |
| 1182 | - iIndex === tableData.length - 1 | |
| 1183 | - ) { | |
| 1113 | + if (["BtnRight.NextCom"].includes(sFieldName) && iIndex === tableData.length - 1) { | |
| 1184 | 1114 | message.info("已是最后一条数据!"); |
| 1185 | 1115 | return; |
| 1186 | 1116 | } |
| 1187 | 1117 | |
| 1188 | - const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find( | |
| 1189 | - item => item.sControlName === "BtnReelView" | |
| 1190 | - )?.sInstruct; | |
| 1118 | + const sInstructStr = props[`${tableName}Config`]?.gdsconfigformslave.find(item => item.sControlName === "BtnReelView")?.sInstruct; | |
| 1191 | 1119 | if (!sInstructStr) return; |
| 1192 | 1120 | |
| 1193 | 1121 | const info = { |
| 1194 | 1122 | "BtnRight.PriorCom": { index: iIndex - 1, message: "上一版" }, |
| 1195 | - "BtnRight.NextCom": { index: iIndex + 1, message: "下一版" } | |
| 1123 | + "BtnRight.NextCom": { index: iIndex + 1, message: "下一版" }, | |
| 1196 | 1124 | }[sFieldName] || { index: iIndex, message: "当前" }; |
| 1197 | 1125 | |
| 1198 | 1126 | const selectedRowKeys = [tableData[info.index].sId]; |
| 1199 | 1127 | props.onSaveState( |
| 1200 | 1128 | { |
| 1201 | - [`${tableName}SelectedRowKeys`]: selectedRowKeys | |
| 1129 | + [`${tableName}SelectedRowKeys`]: selectedRowKeys, | |
| 1202 | 1130 | }, |
| 1203 | 1131 | nextProps => { |
| 1204 | 1132 | props.onExecInstructSet({ |
| 1205 | 1133 | nextProps: nextProps, |
| 1206 | 1134 | btnConfig: { |
| 1207 | 1135 | showName: info.message, |
| 1208 | - sInstruct: sInstructStr | |
| 1209 | - } | |
| 1136 | + sInstruct: sInstructStr, | |
| 1137 | + }, | |
| 1210 | 1138 | }); |
| 1211 | 1139 | } |
| 1212 | 1140 | ); |
| ... | ... | @@ -1220,7 +1148,7 @@ const mesTableChange2 = (props, tableName) => { |
| 1220 | 1148 | delete tableDataNew[0].tConnectDate; |
| 1221 | 1149 | |
| 1222 | 1150 | props.onSaveState({ |
| 1223 | - [`${tableName}Data`]: tableDataNew | |
| 1151 | + [`${tableName}Data`]: tableDataNew, | |
| 1224 | 1152 | }); |
| 1225 | 1153 | }; |
| 1226 | 1154 | |
| ... | ... | @@ -1257,10 +1185,7 @@ const mesTableChange3 = (props, tableName) => { |
| 1257 | 1185 | } |
| 1258 | 1186 | |
| 1259 | 1187 | const checkTime = moment(tConnectDate); |
| 1260 | - if ( | |
| 1261 | - !checkTime.isSameOrAfter(startTime) || | |
| 1262 | - !checkTime.isSameOrBefore(endTime) | |
| 1263 | - ) { | |
| 1188 | + if (!checkTime.isSameOrAfter(startTime) || !checkTime.isSameOrBefore(endTime)) { | |
| 1264 | 1189 | let msg = ""; |
| 1265 | 1190 | if (sShift === "1" || sShift === "白班") { |
| 1266 | 1191 | if (bDelayedOvertime) { |
| ... | ... | @@ -1280,33 +1205,32 @@ const mesTableChange3 = (props, tableName) => { |
| 1280 | 1205 | } |
| 1281 | 1206 | }; |
| 1282 | 1207 | |
| 1283 | - | |
| 1284 | 1208 | const handleGetRefreshStatus = props => { |
| 1285 | 1209 | const { refreshTableListCount = 0 } = props; |
| 1286 | 1210 | if (!refreshTableListCount) { |
| 1287 | - message.warning('请先等待页面初始化加载完成!'); | |
| 1211 | + message.warning("请先等待页面初始化加载完成!"); | |
| 1288 | 1212 | return true; |
| 1289 | 1213 | } else { |
| 1290 | 1214 | return false; |
| 1291 | 1215 | } |
| 1292 | -} | |
| 1216 | +}; | |
| 1293 | 1217 | // 质量巡检-巡检项目-所有巡检按钮 |
| 1294 | 1218 | const handleZlxjCheck = async (props, btnName) => { |
| 1295 | 1219 | const { table0Data = [], table1Data = [], refreshTableListCount = 0 } = props; |
| 1296 | 1220 | const { sTeamNo } = commonUtils.getAppData("userinfo"); |
| 1297 | 1221 | |
| 1298 | 1222 | if (!refreshTableListCount) { |
| 1299 | - message.warning('请先等待页面初始化加载完成!'); | |
| 1223 | + message.warning("请先等待页面初始化加载完成!"); | |
| 1300 | 1224 | return; |
| 1301 | 1225 | } |
| 1302 | 1226 | |
| 1303 | 1227 | const typeList = { |
| 1304 | - "BtnRight.ipqcCheck": '2', | |
| 1305 | - "BtnRight.qualityCheck": '3', | |
| 1306 | - "BtnRight.foremanCheck": '4', | |
| 1307 | - "BtnRight.managerCheck": '5', | |
| 1308 | - "BtnRight.otherCheck": '6' | |
| 1309 | - } | |
| 1228 | + "BtnRight.ipqcCheck": "2", | |
| 1229 | + "BtnRight.qualityCheck": "3", | |
| 1230 | + "BtnRight.foremanCheck": "4", | |
| 1231 | + "BtnRight.managerCheck": "5", | |
| 1232 | + "BtnRight.otherCheck": "6", | |
| 1233 | + }; | |
| 1310 | 1234 | |
| 1311 | 1235 | const sCurRole = typeList[btnName]; |
| 1312 | 1236 | |
| ... | ... | @@ -1314,39 +1238,37 @@ const handleZlxjCheck = async (props, btnName) => { |
| 1314 | 1238 | if (!faceResult) return; |
| 1315 | 1239 | const { name } = faceResult; |
| 1316 | 1240 | if (!name) { |
| 1317 | - message.warning('人脸信息获取失败,请重新尝试!'); | |
| 1241 | + message.warning("人脸信息获取失败,请重新尝试!"); | |
| 1318 | 1242 | return; |
| 1319 | 1243 | } |
| 1320 | 1244 | |
| 1321 | 1245 | const table0DataNew = cloneDeep(table0Data); |
| 1322 | 1246 | const table1DataNew = cloneDeep(table1Data); |
| 1323 | 1247 | table0DataNew[0].sCurRole = sCurRole; |
| 1324 | - table0DataNew[0].handleType = table0DataNew[0].handleType || 'update'; | |
| 1248 | + table0DataNew[0].handleType = table0DataNew[0].handleType || "update"; | |
| 1325 | 1249 | |
| 1326 | 1250 | table1DataNew.unshift({ |
| 1327 | 1251 | sId: commonUtils.createSid(), |
| 1328 | - handleType: 'add', | |
| 1252 | + handleType: "add", | |
| 1329 | 1253 | sSReserve1: sCurRole, |
| 1330 | 1254 | bSave: 1, |
| 1331 | 1255 | sParentId: table0Data[0].sId, |
| 1332 | - tPollingTime: moment().format('YYYY-MM-DD HH:mm:ss'), | |
| 1256 | + tPollingTime: moment().format("YYYY-MM-DD HH:mm:ss"), | |
| 1333 | 1257 | sPollingPerson: name, |
| 1334 | - sGroup: sTeamNo.substr(sTeamNo.length - 1, 1) === 'A' ? 'A' : 'B' | |
| 1258 | + sGroup: sTeamNo.substr(sTeamNo.length - 1, 1) === "A" ? "A" : "B", | |
| 1335 | 1259 | }); |
| 1336 | 1260 | |
| 1337 | 1261 | props.onSaveState({ |
| 1338 | 1262 | userfaceData: [faceResult], |
| 1339 | 1263 | tempUserName: name, |
| 1340 | 1264 | table0Data: table0DataNew, |
| 1341 | - table1Data: table1DataNew | |
| 1265 | + table1Data: table1DataNew, | |
| 1342 | 1266 | }); |
| 1343 | -} | |
| 1267 | +}; | |
| 1344 | 1268 | |
| 1345 | 1269 | let loginInfo = {}; |
| 1346 | 1270 | const sModelsId = "16034339700006038392152714521000"; |
| 1347 | -const mesSysbrands = commonUtils.convertStrToObj( | |
| 1348 | - localStorage.getItem("mesSysbrands") | |
| 1349 | -); | |
| 1271 | +const mesSysbrands = commonUtils.convertStrToObj(localStorage.getItem("mesSysbrands")); | |
| 1350 | 1272 | |
| 1351 | 1273 | const handleGetFormItem = (props, item) => { |
| 1352 | 1274 | let enabledNew = true; |
| ... | ... | @@ -1374,32 +1296,28 @@ const handleGetFormItem = (props, item) => { |
| 1374 | 1296 | onFilterDropDownData: props.onFilterDropDownData, |
| 1375 | 1297 | onSaveState: props.onSaveState, |
| 1376 | 1298 | bPassWord: item.sName === "sPassWord", |
| 1377 | - style: { backgroundColor: "#eaeaea" } | |
| 1299 | + style: { backgroundColor: "#eaeaea" }, | |
| 1378 | 1300 | }; |
| 1379 | 1301 | return ( |
| 1380 | - <Form.Item | |
| 1381 | - label={item.sName === "sUserName" ? "账号" : item.showName} | |
| 1382 | - key={item.sName} | |
| 1383 | - > | |
| 1302 | + <Form.Item label={item.sName === "sUserName" ? "账号" : item.showName} key={item.sName}> | |
| 1384 | 1303 | <ShowType {...showTypeProps} /> |
| 1385 | 1304 | </Form.Item> |
| 1386 | 1305 | ); |
| 1387 | 1306 | }; |
| 1388 | 1307 | |
| 1389 | -const getFaceResult = async (props) => { | |
| 1308 | +const getFaceResult = async props => { | |
| 1390 | 1309 | let faceResult = false; |
| 1391 | 1310 | |
| 1392 | - | |
| 1393 | - const selectMethod = commonFunc.showLocalMessage(props, 'selectMethod', '请选择验证方式'); | |
| 1394 | - const FriendlyReminder = commonFunc.showLocalMessage(props, 'FriendlyReminder', '温馨提示'); | |
| 1395 | - const accountPwd = commonFunc.showLocalMessage(props, 'account', '账号密码'); | |
| 1396 | - const faceRecognition = commonFunc.showLocalMessage(props, 'faceRecognition', '人脸识别'); | |
| 1397 | - const btnCancel = commonFunc.showLocalMessage(props, 'BtnCancel', '取消'); | |
| 1398 | - const btnSure = commonFunc.showLocalMessage(props, 'BtnSure', '确定'); | |
| 1399 | - const enterAccountPwd = commonFunc.showLocalMessage(props, 'enterAccountPwd', '请输入账号密码'); | |
| 1400 | - const nameNotEmpty = commonFunc.showLocalMessage(props, 'NameNotEmpty', '账号/姓名不能为空!'); | |
| 1401 | - const passwordNotEmpty = commonFunc.showLocalMessage(props, 'PasswordNotEmpty', '密码不能为空!'); | |
| 1402 | - const account = commonFunc.showLocalMessage(props, 'account', '账号'); | |
| 1311 | + const selectMethod = commonFunc.showLocalMessage(props, "selectMethod", "请选择验证方式"); | |
| 1312 | + const FriendlyReminder = commonFunc.showLocalMessage(props, "FriendlyReminder", "温馨提示"); | |
| 1313 | + const accountPwd = commonFunc.showLocalMessage(props, "account", "账号密码"); | |
| 1314 | + const faceRecognition = commonFunc.showLocalMessage(props, "faceRecognition", "人脸识别"); | |
| 1315 | + const btnCancel = commonFunc.showLocalMessage(props, "BtnCancel", "取消"); | |
| 1316 | + const btnSure = commonFunc.showLocalMessage(props, "BtnSure", "确定"); | |
| 1317 | + const enterAccountPwd = commonFunc.showLocalMessage(props, "enterAccountPwd", "请输入账号密码"); | |
| 1318 | + const nameNotEmpty = commonFunc.showLocalMessage(props, "NameNotEmpty", "账号/姓名不能为空!"); | |
| 1319 | + const passwordNotEmpty = commonFunc.showLocalMessage(props, "PasswordNotEmpty", "密码不能为空!"); | |
| 1320 | + const account = commonFunc.showLocalMessage(props, "account", "账号"); | |
| 1403 | 1321 | const loginType = await new Promise(resolve => { |
| 1404 | 1322 | Modal.confirm({ |
| 1405 | 1323 | title: FriendlyReminder, |
| ... | ... | @@ -1419,7 +1337,7 @@ const getFaceResult = async (props) => { |
| 1419 | 1337 | } else { |
| 1420 | 1338 | resolve(0); |
| 1421 | 1339 | } |
| 1422 | - } | |
| 1340 | + }, | |
| 1423 | 1341 | }); |
| 1424 | 1342 | }); |
| 1425 | 1343 | |
| ... | ... | @@ -1444,27 +1362,20 @@ const getFaceResult = async (props) => { |
| 1444 | 1362 | okText: btnCancel, |
| 1445 | 1363 | onOk() { |
| 1446 | 1364 | resolve(false); |
| 1447 | - } | |
| 1365 | + }, | |
| 1448 | 1366 | }); |
| 1449 | 1367 | }); |
| 1450 | 1368 | } else if (loginType === 2) { |
| 1451 | 1369 | // 账号密码登陆 |
| 1452 | 1370 | let loginConfig; |
| 1453 | - const configUrl = `${commonConfig.server_host | |
| 1454 | - }business/getModelBysId/${sModelsId}?sModelsId=${sModelsId}&sName=/commonAuto`; | |
| 1455 | - const configReturn = (await commonServices.getService("", configUrl)) | |
| 1456 | - .data; | |
| 1371 | + const configUrl = `${commonConfig.server_host}business/getModelBysId/${sModelsId}?sModelsId=${sModelsId}&sName=/commonAuto`; | |
| 1372 | + const configReturn = (await commonServices.getService("", configUrl)).data; | |
| 1457 | 1373 | if (configReturn.code === 1) { |
| 1458 | 1374 | const dataReturn = configReturn.dataset.rows; |
| 1459 | 1375 | if (commonUtils.isNotEmptyArr(dataReturn)) { |
| 1460 | 1376 | const { formData } = dataReturn[0]; |
| 1461 | 1377 | if (commonUtils.isNotEmptyArr(formData)) { |
| 1462 | - loginConfig = formData[0].gdsconfigformslave.filter( | |
| 1463 | - item => | |
| 1464 | - item.bVisible && | |
| 1465 | - item.sName && | |
| 1466 | - ["sUserName", "sPassWord"].includes(item.sName) | |
| 1467 | - ); | |
| 1378 | + loginConfig = formData[0].gdsconfigformslave.filter(item => item.bVisible && item.sName && ["sUserName", "sPassWord"].includes(item.sName)); | |
| 1468 | 1379 | } |
| 1469 | 1380 | } |
| 1470 | 1381 | } else { |
| ... | ... | @@ -1496,34 +1407,31 @@ const getFaceResult = async (props) => { |
| 1496 | 1407 | } |
| 1497 | 1408 | |
| 1498 | 1409 | const { sBrandsId, sSubsidiaryId } = mesSysbrands; |
| 1499 | - const url = `${commonConfig.server_host | |
| 1500 | - }userloginUserNo/${sBrandsId}/${sSubsidiaryId}`; | |
| 1410 | + const url = `${commonConfig.server_host}userloginUserNo/${sBrandsId}/${sSubsidiaryId}`; | |
| 1501 | 1411 | const value = { |
| 1502 | 1412 | username: loginInfo.sUserNo || loginInfo.sUserName, |
| 1503 | - password: loginInfo.sPassWord | |
| 1413 | + password: loginInfo.sPassWord, | |
| 1504 | 1414 | }; |
| 1505 | 1415 | |
| 1506 | - commonServices | |
| 1507 | - .postValueService(null, value, url) | |
| 1508 | - .then(({ data: dataReturn }) => { | |
| 1509 | - const { msg, code, dataset } = dataReturn; | |
| 1510 | - if (code !== 1) { | |
| 1511 | - message.error(msg); | |
| 1512 | - return; | |
| 1513 | - } | |
| 1514 | - | |
| 1515 | - if (commonUtils.isNotEmptyObject(msg)) { | |
| 1516 | - message.warning(msg, 6); | |
| 1517 | - } | |
| 1518 | - | |
| 1519 | - const result = dataset.rows[0]; | |
| 1520 | - resolve(result); | |
| 1521 | - }); | |
| 1416 | + commonServices.postValueService(null, value, url).then(({ data: dataReturn }) => { | |
| 1417 | + const { msg, code, dataset } = dataReturn; | |
| 1418 | + if (code !== 1) { | |
| 1419 | + message.error(msg); | |
| 1420 | + return; | |
| 1421 | + } | |
| 1422 | + | |
| 1423 | + if (commonUtils.isNotEmptyObject(msg)) { | |
| 1424 | + message.warning(msg, 6); | |
| 1425 | + } | |
| 1426 | + | |
| 1427 | + const result = dataset.rows[0]; | |
| 1428 | + resolve(result); | |
| 1429 | + }); | |
| 1522 | 1430 | } |
| 1523 | 1431 | }, |
| 1524 | 1432 | onCancel() { |
| 1525 | 1433 | resolve(false); |
| 1526 | - } | |
| 1434 | + }, | |
| 1527 | 1435 | }); |
| 1528 | 1436 | }); |
| 1529 | 1437 | } |
| ... | ... | @@ -1532,7 +1440,7 @@ const getFaceResult = async (props) => { |
| 1532 | 1440 | }; |
| 1533 | 1441 | |
| 1534 | 1442 | // 质量巡检-巡检项目-完成/修改 |
| 1535 | -const mesTableBtnClick4 = async (props) => { | |
| 1443 | +const mesTableBtnClick4 = async props => { | |
| 1536 | 1444 | const { params = {}, table0Data = [], table1Data = [], tempUserName } = props; |
| 1537 | 1445 | const { config = {}, record } = params; |
| 1538 | 1446 | const { sControlName } = config; |
| ... | ... | @@ -1556,7 +1464,7 @@ const mesTableBtnClick4 = async (props) => { |
| 1556 | 1464 | table1Data: table1Data.map(item => { |
| 1557 | 1465 | return item.sId === record.sId ? { ...item, bSave: 1 } : item; |
| 1558 | 1466 | }), |
| 1559 | - }) | |
| 1467 | + }); | |
| 1560 | 1468 | } else if (sControlName === "BtnFinish") { |
| 1561 | 1469 | const bHasX = Object.keys(record).some(key => key?.startsWith("sItem") && record[key] === "✗"); |
| 1562 | 1470 | if (bHasX && !sQualityDeg) { |
| ... | ... | @@ -1566,18 +1474,18 @@ const mesTableBtnClick4 = async (props) => { |
| 1566 | 1474 | |
| 1567 | 1475 | const iIndex = table1Data.findIndex(item => item.sId === record.sId); |
| 1568 | 1476 | table1Data[iIndex].bSave = 0; |
| 1569 | - table1Data[iIndex].handleType = table1Data[iIndex].handleType || 'update' | |
| 1477 | + table1Data[iIndex].handleType = table1Data[iIndex].handleType || "update"; | |
| 1570 | 1478 | if (table1Data[iIndex].sSReserve1 === "1") { |
| 1571 | 1479 | table1Data[iIndex].sPollingPerson = sUserName; |
| 1572 | 1480 | } |
| 1573 | 1481 | if (table1Data[iIndex].tPollingTime) { |
| 1574 | - table1Data[iIndex].tSReserve1 = moment().format('YYYY-MM-DD HH:mm:ss'); | |
| 1482 | + table1Data[iIndex].tSReserve1 = moment().format("YYYY-MM-DD HH:mm:ss"); | |
| 1575 | 1483 | } |
| 1576 | 1484 | if (!table1Data[iIndex].tPollingTime) { |
| 1577 | - table1Data[iIndex].tPollingTime = moment().format('YYYY-MM-DD HH:mm:ss'); | |
| 1485 | + table1Data[iIndex].tPollingTime = moment().format("YYYY-MM-DD HH:mm:ss"); | |
| 1578 | 1486 | } |
| 1579 | 1487 | |
| 1580 | - const addState1 = { table0Data: table0Data.map(item => ({ ...item, bSave: 0, handleType: item.handleType || 'update' })), table1Data }; | |
| 1488 | + const addState1 = { table0Data: table0Data.map(item => ({ ...item, bSave: 0, handleType: item.handleType || "update" })), table1Data }; | |
| 1581 | 1489 | |
| 1582 | 1490 | props.onSaveState({ tempUserName: undefined, ...addState1 }); |
| 1583 | 1491 | props.onExecInstructSet({ |
| ... | ... | @@ -1587,22 +1495,306 @@ const mesTableBtnClick4 = async (props) => { |
| 1587 | 1495 | sInstruct: JSON.stringify([ |
| 1588 | 1496 | { |
| 1589 | 1497 | opr: "save", |
| 1590 | - doNotRefresh: true, | |
| 1498 | + // doNotRefresh: true, | |
| 1591 | 1499 | data: [ |
| 1592 | 1500 | { |
| 1593 | 1501 | tablename: "qlyqualityinspectionmaster", |
| 1594 | - srcDataset: "table0" | |
| 1502 | + srcDataset: "table0", | |
| 1595 | 1503 | }, |
| 1596 | 1504 | { |
| 1597 | 1505 | tablename: "qlyqualityinspectionslave", |
| 1598 | - srcDataset: "table1" | |
| 1599 | - } | |
| 1600 | - ] | |
| 1601 | - } | |
| 1602 | - ]) | |
| 1603 | - } | |
| 1506 | + srcDataset: "table1", | |
| 1507 | + }, | |
| 1508 | + ], | |
| 1509 | + }, | |
| 1510 | + ]), | |
| 1511 | + }, | |
| 1512 | + }); | |
| 1513 | + } | |
| 1514 | +}; | |
| 1515 | + | |
| 1516 | +// 完工情场确认-车间领班审核 | |
| 1517 | +const handleCjlbshCheck = async props => { | |
| 1518 | + const faceResult = await getFaceResult(props); | |
| 1519 | + | |
| 1520 | + if (!faceResult) return; | |
| 1521 | + | |
| 1522 | + const { name } = faceResult; | |
| 1523 | + const { slave0Config, slave0Data = [] } = props; | |
| 1524 | + const filterConfig = slave0Config?.gdsconfigformslave?.filter(item => { | |
| 1525 | + return item.sName === "sForemanCheckMemo"; | |
| 1526 | + }); | |
| 1527 | + | |
| 1528 | + const returnData = await new Promise(resolve => { | |
| 1529 | + props.onSaveState({ | |
| 1530 | + commonRepairModalParams: { | |
| 1531 | + visible: true, | |
| 1532 | + title: "领班审核备注", | |
| 1533 | + tableName: "slave0", | |
| 1534 | + config: slave0Config, | |
| 1535 | + record: { ...slave0Data[0], bSubmit: 0 }, | |
| 1536 | + filterConfig, | |
| 1537 | + callback: rowData => { | |
| 1538 | + resolve(rowData); | |
| 1539 | + }, | |
| 1540 | + }, | |
| 1541 | + }); | |
| 1542 | + }); | |
| 1543 | + | |
| 1544 | + if (commonUtils.isEmptyObject(returnData)) return; | |
| 1545 | + | |
| 1546 | + const slave0DataNew = [ | |
| 1547 | + { | |
| 1548 | + ...returnData, | |
| 1549 | + bSubmit: 1, | |
| 1550 | + tForemanCheckDate: moment().format("YYYY-MM-DD HH:mm:ss"), | |
| 1551 | + sForemanCheckPerson: name, | |
| 1552 | + bForemanCheck: 1, | |
| 1553 | + handleType: returnData.handleType || "update", | |
| 1554 | + }, | |
| 1555 | + ]; | |
| 1556 | + | |
| 1557 | + props.onSaveState({ slave0Data: slave0DataNew }); | |
| 1558 | + props.onExecInstructSet({ | |
| 1559 | + nextProps: { ...props, slave0Data: slave0DataNew }, | |
| 1560 | + btnConfig: { | |
| 1561 | + showName: "保存", | |
| 1562 | + sInstruct: JSON.stringify([ | |
| 1563 | + { | |
| 1564 | + opr: "save", | |
| 1565 | + doNotRefresh: true, | |
| 1566 | + data: [ | |
| 1567 | + { | |
| 1568 | + tablename: "EptCompletionSiteClearanceMaster", | |
| 1569 | + srcDataset: "slave0", | |
| 1570 | + }, | |
| 1571 | + ], | |
| 1572 | + }, | |
| 1573 | + ]), | |
| 1574 | + }, | |
| 1575 | + }); | |
| 1576 | +}; | |
| 1577 | + | |
| 1578 | +// 完工情场确认-车间领班反审 | |
| 1579 | +const handleCjlbfsCheck = async props => { | |
| 1580 | + const faceResult = await getFaceResult(props); | |
| 1581 | + if (!faceResult) return; | |
| 1582 | + | |
| 1583 | + const { slave0Data = [] } = props; | |
| 1584 | + | |
| 1585 | + const slave0DataNew = [{ ...slave0Data[0], bForemanCheck: 0, bIPQCCheck: 0, handleType: slave0Data[0].handleType || "update" }]; | |
| 1586 | + | |
| 1587 | + props.onSaveState({ slave0Data: slave0DataNew }); | |
| 1588 | + props.onExecInstructSet({ | |
| 1589 | + nextProps: { ...props, slave0Data: slave0DataNew }, | |
| 1590 | + btnConfig: { | |
| 1591 | + showName: "保存", | |
| 1592 | + sInstruct: JSON.stringify([ | |
| 1593 | + { | |
| 1594 | + opr: "save", | |
| 1595 | + doNotRefresh: true, | |
| 1596 | + data: [ | |
| 1597 | + { | |
| 1598 | + tablename: "EptCompletionSiteClearanceMaster", | |
| 1599 | + srcDataset: "slave0", | |
| 1600 | + }, | |
| 1601 | + ], | |
| 1602 | + }, | |
| 1603 | + ]), | |
| 1604 | + }, | |
| 1605 | + }); | |
| 1606 | +}; | |
| 1607 | + | |
| 1608 | +// 完工情场确认-品管审核 | |
| 1609 | +const handlePgshCheck = async props => { | |
| 1610 | + const faceResult = await getFaceResult(props); | |
| 1611 | + | |
| 1612 | + if (!faceResult) return; | |
| 1613 | + | |
| 1614 | + const { name } = faceResult; | |
| 1615 | + const { slave0Config, slave0Data = [] } = props; | |
| 1616 | + const filterConfig = slave0Config?.gdsconfigformslave?.filter(item => { | |
| 1617 | + return item.sName === "sIPQCCheckMemo"; | |
| 1618 | + }); | |
| 1619 | + | |
| 1620 | + const returnData = await new Promise(resolve => { | |
| 1621 | + props.onSaveState({ | |
| 1622 | + commonRepairModalParams: { | |
| 1623 | + visible: true, | |
| 1624 | + title: "品管审核备注", | |
| 1625 | + tableName: "slave0", | |
| 1626 | + config: slave0Config, | |
| 1627 | + record: { ...slave0Data[0], bSubmit: 0 }, | |
| 1628 | + filterConfig, | |
| 1629 | + callback: rowData => { | |
| 1630 | + resolve(rowData); | |
| 1631 | + }, | |
| 1632 | + }, | |
| 1633 | + }); | |
| 1634 | + }); | |
| 1635 | + | |
| 1636 | + if (commonUtils.isEmptyObject(returnData)) return; | |
| 1637 | + | |
| 1638 | + const slave0DataNew = [ | |
| 1639 | + { | |
| 1640 | + ...returnData, | |
| 1641 | + bSubmit: 1, | |
| 1642 | + tIPQCCheckDate: moment().format("YYYY-MM-DD HH:mm:ss"), | |
| 1643 | + sIPQCCheckPerson: name, | |
| 1644 | + bIPQCCheck: 1, | |
| 1645 | + handleType: returnData.handleType || "update", | |
| 1646 | + }, | |
| 1647 | + ]; | |
| 1648 | + | |
| 1649 | + props.onSaveState({ slave0Data: slave0DataNew }); | |
| 1650 | + props.onExecInstructSet({ | |
| 1651 | + nextProps: { ...props, slave0Data: slave0DataNew }, | |
| 1652 | + btnConfig: { | |
| 1653 | + showName: "保存", | |
| 1654 | + sInstruct: JSON.stringify([ | |
| 1655 | + { | |
| 1656 | + opr: "save", | |
| 1657 | + doNotRefresh: true, | |
| 1658 | + data: [ | |
| 1659 | + { | |
| 1660 | + tablename: "EptCompletionSiteClearanceMaster", | |
| 1661 | + srcDataset: "slave0", | |
| 1662 | + }, | |
| 1663 | + ], | |
| 1664 | + }, | |
| 1665 | + ]), | |
| 1666 | + }, | |
| 1667 | + }); | |
| 1668 | +}; | |
| 1669 | + | |
| 1670 | +// 完工情场确认-品管反审 | |
| 1671 | +const handlePgfsCheck = async props => { | |
| 1672 | + const faceResult = await getFaceResult(props); | |
| 1673 | + if (!faceResult) return; | |
| 1674 | + | |
| 1675 | + const { slave0Data = [] } = props; | |
| 1676 | + | |
| 1677 | + const slave0DataNew = [{ ...slave0Data[0], bIPQCCheck: 0, handleType: slave0Data[0].handleType || "update" }]; | |
| 1678 | + | |
| 1679 | + props.onSaveState({ slave0Data: slave0DataNew }); | |
| 1680 | + props.onExecInstructSet({ | |
| 1681 | + nextProps: { ...props, slave0Data: slave0DataNew }, | |
| 1682 | + btnConfig: { | |
| 1683 | + showName: "保存", | |
| 1684 | + sInstruct: JSON.stringify([ | |
| 1685 | + { | |
| 1686 | + opr: "save", | |
| 1687 | + doNotRefresh: true, | |
| 1688 | + data: [ | |
| 1689 | + { | |
| 1690 | + tablename: "EptCompletionSiteClearanceMaster", | |
| 1691 | + srcDataset: "slave0", | |
| 1692 | + }, | |
| 1693 | + ], | |
| 1694 | + }, | |
| 1695 | + ]), | |
| 1696 | + }, | |
| 1697 | + }); | |
| 1698 | +}; | |
| 1699 | + | |
| 1700 | +// 完工清场确认-确认提交 | |
| 1701 | +const handleConfirmSubmit = async props => { | |
| 1702 | + const { slave0Data } = props; | |
| 1703 | + const slave0RowData = slave0Data[0]; | |
| 1704 | + const { tFirstCompleteTime, tFirstClearanceTime, tSecondStartTime } = slave0RowData; | |
| 1705 | + if (tFirstCompleteTime) { | |
| 1706 | + // 完工时间需小于清场时间 | |
| 1707 | + if (moment(tFirstCompleteTime).isAfter(moment(tFirstClearanceTime))) { | |
| 1708 | + message.error("完工时间需小于清场时间", 3); | |
| 1709 | + return; | |
| 1710 | + } | |
| 1711 | + } | |
| 1712 | + | |
| 1713 | + if (tSecondStartTime) { | |
| 1714 | + // 清场时间需小于第二单开单时间 | |
| 1715 | + if (moment(tFirstClearanceTime).isAfter(moment(tSecondStartTime))) { | |
| 1716 | + message.error("清场时间需小于第二单开单时间", 3); | |
| 1717 | + return; | |
| 1718 | + } | |
| 1719 | + } | |
| 1720 | + | |
| 1721 | + if (!tFirstCompleteTime || !tSecondStartTime) { | |
| 1722 | + const confirmResult = await new Promise(resolve => { | |
| 1723 | + Modal.confirm({ | |
| 1724 | + title: "温馨提示:", | |
| 1725 | + content: "工单完工时间或者第二单开工时间未填写是否继续提交?", | |
| 1726 | + closable: true, | |
| 1727 | + maskClosable: true, | |
| 1728 | + wrapClassName: "mesCommonModal", | |
| 1729 | + onOk() { | |
| 1730 | + resolve(1); | |
| 1731 | + }, | |
| 1732 | + onCancel() { | |
| 1733 | + resolve(0); | |
| 1734 | + }, | |
| 1735 | + }); | |
| 1604 | 1736 | }); |
| 1737 | + | |
| 1738 | + if (!confirmResult) return; | |
| 1605 | 1739 | } |
| 1606 | -} | |
| 1740 | + | |
| 1741 | + const { sMachineGuid, sUserName, sTeamNo, sTeamId } = commonUtils.getAppData("userinfo"); | |
| 1742 | + const addState = { | |
| 1743 | + sMachineId: sMachineGuid, | |
| 1744 | + bSave: 1, | |
| 1745 | + bSubmit: 1, | |
| 1746 | + sFormId: "17086722220003015078585693314000", | |
| 1747 | + sMakePerson: sUserName, | |
| 1748 | + sFirstTeamNo: sTeamNo, | |
| 1749 | + sSecondTeamNo: sTeamNo, | |
| 1750 | + sFirstTeamId: sTeamId, | |
| 1751 | + sSecondTeamId: sTeamId, | |
| 1752 | + sFirstClearancePerson: sUserName, | |
| 1753 | + handleType: slave0RowData.handleType || "update" | |
| 1754 | + }; | |
| 1755 | + const slave0DataNew = [{ ...slave0RowData, ...addState }]; | |
| 1756 | + | |
| 1757 | + let refreshDataset = "slave1"; | |
| 1758 | + if (addState.handleType === 'add') { | |
| 1759 | + window.rowclickAfterFunc = (nextProps) => { | |
| 1760 | + const { slave1Data } = nextProps; | |
| 1761 | + props.onSaveState({ slave1SelectedRowKeys: [slave1Data[0].sId] }); | |
| 1762 | + } | |
| 1763 | + } else { | |
| 1764 | + refreshDataset = "*"; | |
| 1765 | + } | |
| 1766 | + | |
| 1767 | + props.onExecInstructSet({ | |
| 1768 | + nextProps: { ...props, bSaveAndUpdate: true, slave0Data: slave0DataNew }, | |
| 1769 | + btnConfig: { | |
| 1770 | + showName: "保存", | |
| 1771 | + sInstruct: JSON.stringify([ | |
| 1772 | + { | |
| 1773 | + opr: "save", | |
| 1774 | + doNotRefresh: true, | |
| 1775 | + data: [ | |
| 1776 | + { | |
| 1777 | + tablename: "EptCompletionSiteClearanceMaster", | |
| 1778 | + srcDataset: "slave0", | |
| 1779 | + }, | |
| 1780 | + ].map(item => { | |
| 1781 | + if (!slave0RowData.sBillNo) { | |
| 1782 | + return { | |
| 1783 | + ...item, | |
| 1784 | + maxBillNo: "sBillNo" | |
| 1785 | + } | |
| 1786 | + } else { | |
| 1787 | + return item; | |
| 1788 | + } | |
| 1789 | + }), | |
| 1790 | + }, | |
| 1791 | + { | |
| 1792 | + opr: "refresh", | |
| 1793 | + dataset: refreshDataset | |
| 1794 | + }, | |
| 1795 | + ]), | |
| 1796 | + }, | |
| 1797 | + }); | |
| 1798 | +}; | |
| 1607 | 1799 | |
| 1608 | 1800 | export default costomPageFun; | ... | ... |