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