Commit d2e294d52b51bed92c9dc4915779a48b8c02cc99
Merge branch 'main' of http://git.xlyprint.cn/xlyErp/xlyUmi into main
Showing
8 changed files
with
78 additions
and
34 deletions
src/components/Common/CommonBase.js
| ... | ... | @@ -763,6 +763,7 @@ export default (ChildComponent) => { |
| 763 | 763 | } |
| 764 | 764 | } |
| 765 | 765 | addState[`${name}Data`] = returnData; |
| 766 | + addState[`${name}DataOld`] = returnData; | |
| 766 | 767 | if(commonUtils.isNotEmptyObject(returnData.customConfig) && commonUtils.isJSON(returnData.customConfig) && commonUtils.isNotEmptyObject(slaveConfig)) { |
| 767 | 768 | const columnConfig = JSON.parse(returnData.customConfig); |
| 768 | 769 | const newConfig =JSON.parse(JSON.stringify(slaveConfig)); |
| ... | ... | @@ -796,6 +797,20 @@ export default (ChildComponent) => { |
| 796 | 797 | this.getServiceError(dataReturn); |
| 797 | 798 | } |
| 798 | 799 | }; |
| 800 | + handleGetDataOld = async (sId) => { | |
| 801 | + const { | |
| 802 | + token, sModelsId, formSrcRoute | |
| 803 | + } = this.state; | |
| 804 | + const dataUrl = `${commonConfig.server_host}log/getLogDetail/${sId}?sModelsId=${sModelsId}&sName=${formSrcRoute}`; | |
| 805 | + const condition = {}; | |
| 806 | + const dataReturn = (await commonServices.postValueService(token, condition, dataUrl)).data; | |
| 807 | + if(dataReturn.sCode === 1) { | |
| 808 | + let returnData = dataReturn.dataset.rows[0].dataSet; | |
| 809 | + console.log('ssreturnDatas', returnData); | |
| 810 | + | |
| 811 | + } | |
| 812 | + | |
| 813 | + } | |
| 799 | 814 | |
| 800 | 815 | /* 获取后台数据(数据集) */ |
| 801 | 816 | handleGetDataSet = async (params) => { |
| ... | ... | @@ -1048,6 +1063,7 @@ export default (ChildComponent) => { |
| 1048 | 1063 | const filterConditionNew = commonUtils.isNotEmptyObject(filterCondition) ? filterCondition.filter(item => item.bFilterType !== 'tree') : ''; |
| 1049 | 1064 | let addState = { |
| 1050 | 1065 | [`${name}Data`]: returnData, |
| 1066 | + [`${name}DataOld`]: returnData, | |
| 1051 | 1067 | [`${name}Pagination`]: returnPagination, |
| 1052 | 1068 | [`${name}FilterCondition`]: filterConditionNew, |
| 1053 | 1069 | [`${name}OrderBy`]: orderBy, |
| ... | ... | @@ -3435,6 +3451,7 @@ export default (ChildComponent) => { |
| 3435 | 3451 | getDateFormat={this.getDateFormat} |
| 3436 | 3452 | handleGetDataOne={this.handleGetDataOne} |
| 3437 | 3453 | handleGetDataSet={this.handleGetDataSet} |
| 3454 | + onGetDataOld={this.handleGetDataOld} | |
| 3438 | 3455 | handleGetTreeDataSet={this.handleGetTreeDataSet} |
| 3439 | 3456 | onSaveState={this.handleSaveState} |
| 3440 | 3457 | onChange={this.handleMasterChange} | ... | ... |
src/components/Common/CommonBillEvent.js
| ... | ... | @@ -78,6 +78,8 @@ export default (ChildComponent) => { |
| 78 | 78 | employeeConfig: employeeConfigOld, |
| 79 | 79 | slaveInfoList: slaveInfoListOld, |
| 80 | 80 | } = nextProps; |
| 81 | + const { currentPane } = app; | |
| 82 | + const bHistoryView = currentPane?.bHistoryView; | |
| 81 | 83 | if (commonUtils.isEmptyObject(slaveConfigOld) && formData.length > 0 && (sModelsId === '12710101117024321284220' || (sModelsType !== 'cashier/financialTransfer' && sModelsType !== 'cashier/financialAdjustment' && sModelsType !== 'quality/accident' && sModelsType !== 'purchase/purchaseEnquiry' && sModelsType !== 'complaint/complaint' && sModelsType !== 'print/printLabel' && sModelsType !== 'commonBill/onlyMaster' && (formRoute.indexOf('indexOee') === -1 || formRoute === '/indexOee/commonOeeBill')))) { |
| 82 | 84 | const sId = currentId || nextProps.masterData?.sId || ''; |
| 83 | 85 | /* 数据Id */ |
| ... | ... | @@ -402,6 +404,8 @@ export default (ChildComponent) => { |
| 402 | 404 | // if (sModelsType.includes('sales/salesOrder') || sModelsType === 'purchase/purchaseOrder') { |
| 403 | 405 | // this.props.onSaveState(addState1); |
| 404 | 406 | // } |
| 407 | + } else if(bHistoryView){ | |
| 408 | + this.handleGetDataOld(); | |
| 405 | 409 | } else { |
| 406 | 410 | this.handleGetData(masterConfig, slaveConfig, checkConfig); |
| 407 | 411 | if (sModelsType.includes('sales/salesOrder')) { |
| ... | ... | @@ -772,6 +776,11 @@ export default (ChildComponent) => { |
| 772 | 776 | return processData; |
| 773 | 777 | }; |
| 774 | 778 | |
| 779 | + handleGetDataOld = async () => { | |
| 780 | + const { currentId } = this.props; /* 当前页签数据 */ | |
| 781 | + this.props.onGetDataOld(currentId); | |
| 782 | + } | |
| 783 | + | |
| 775 | 784 | /** 获取主表、从表、审核表数据 */ |
| 776 | 785 | handleGetData = async (masterConfig, slaveConfig, checkConfig, bEditClick) => { |
| 777 | 786 | const { currentId, masterData = {} } = this.props; /* 当前页签数据 */ |
| ... | ... | @@ -2603,8 +2612,12 @@ export default (ChildComponent) => { |
| 2603 | 2612 | } |
| 2604 | 2613 | }); |
| 2605 | 2614 | } |
| 2615 | + const sOldData = commonUtils.getOldDataFromProps(this.props); | |
| 2616 | + console.log('组装后的原始数据', sOldData); | |
| 2617 | + const sOperationType = masterData?.handleType === 'add' ? '1' : '2' ; | |
| 2606 | 2618 | |
| 2607 | - this.handleSaveData({ data, sClientType: '1', sSysLogSrcId: masterData.sId }); | |
| 2619 | + this.handleSaveData({ data, sClientType: '1', sSysLogSrcId: masterData.sId, | |
| 2620 | + sOldData, sOperationType, sBillNo: masterData.sBillNo }); | |
| 2608 | 2621 | } |
| 2609 | 2622 | }); |
| 2610 | 2623 | }; |
| ... | ... | @@ -3115,12 +3128,16 @@ export default (ChildComponent) => { |
| 3115 | 3128 | } |
| 3116 | 3129 | } |
| 3117 | 3130 | } |
| 3131 | + const sOldData = commonUtils.getOldDataFromProps(this.props); | |
| 3132 | + console.log('删除的原始数据', sOldData); | |
| 3118 | 3133 | const value = { |
| 3119 | 3134 | sClientType: '1', |
| 3120 | 3135 | data: { |
| 3121 | 3136 | sMasterTable: masterConfig.sTbName, |
| 3122 | 3137 | sId: [masterData.sId], |
| 3123 | 3138 | }, |
| 3139 | + sOldData, | |
| 3140 | + sSysLogSrcId: masterData.sId, | |
| 3124 | 3141 | }; |
| 3125 | 3142 | const sSlaveTable = []; |
| 3126 | 3143 | if (commonUtils.isNotEmptyObject(slaveConfig)) { | ... | ... |
src/components/Common/CommonListEvent.js
| ... | ... | @@ -715,32 +715,7 @@ export default (ChildComponent) => { |
| 715 | 715 | // masterData, |
| 716 | 716 | // employeeConfig, |
| 717 | 717 | } = this.props; |
| 718 | - // oee双击查看开工任务 | |
| 719 | - // if (formRoute.indexOf('indexOee') > -1) { | |
| 720 | - // if (slaveSelectedData[0].sCompleteCheck !== 'bCompleteCheck' && commonUtils.isNotEmptyArr(slaveSelectedData)) { | |
| 721 | - // this.props.changePage(false, 'startWork', '2', false); | |
| 722 | - // this.props.onSaveState({ | |
| 723 | - // masterData: slaveSelectedData[0], | |
| 724 | - // }); | |
| 725 | - // if (commonUtils.isNotEmptyObject(record)) { | |
| 726 | - // const bFilter1 = []; | |
| 727 | - // bFilter1.push({ | |
| 728 | - // bFilterName: 'sParentId', | |
| 729 | - // bFilterCondition: '=', | |
| 730 | - // bFilterValue: record.sId, | |
| 731 | - // }); | |
| 732 | - // const employeeData = (await this.props.handleGetDataSet({ | |
| 733 | - // name: 'employee', | |
| 734 | - // configData: employeeConfig, | |
| 735 | - // condition: { bFilter: bFilter1 }, | |
| 736 | - // isWait: true, | |
| 737 | - // })); | |
| 738 | - // this.props.onSaveState({ | |
| 739 | - // ...employeeData, | |
| 740 | - // }); | |
| 741 | - // } | |
| 742 | - // } | |
| 743 | - // } else {} | |
| 718 | + | |
| 744 | 719 | |
| 745 | 720 | // 工单明细弹窗 |
| 746 | 721 | if (commonUtils.isNotEmptyObject(slaveConfig) && slaveConfig.sTbName === 'sys_workorder') { |
| ... | ... | @@ -818,7 +793,8 @@ export default (ChildComponent) => { |
| 818 | 793 | currentIndex: slaveData.findIndex(item => item.sId === record.sId), |
| 819 | 794 | sSqlConditionValues: this.handleGetSqlConditionValues(picArr[0], record), |
| 820 | 795 | sSrcModelsId: this.props.sModelsId, |
| 821 | - sFilterOrderBy: slaveOrderBy | |
| 796 | + sFilterOrderBy: slaveOrderBy, | |
| 797 | + bHistoryView : sModelsType === '/log' | |
| 822 | 798 | }, |
| 823 | 799 | }); |
| 824 | 800 | } | ... | ... |
src/components/Common/commonBusiness.js
| ... | ... | @@ -285,7 +285,7 @@ export async function saveData(param) { |
| 285 | 285 | * delTmpData 表单删除数据 |
| 286 | 286 | * bAll 不过滤增加数据还是修改数据 */ |
| 287 | 287 | export function mergeData(name, sTbName, saveTmpData, delTmpData, bAll) { |
| 288 | - if (name === 'master' && commonUtils.isNotEmptyArr(saveTmpData)) { | |
| 288 | + if (name === 'master' && commonUtils.isNotEmptyArr(saveTmpData) && sTbName?.toLowerCase()?.includes('quoquo')) { | |
| 289 | 289 | saveTmpData[0].handleType = saveTmpData[0].handleType ? saveTmpData[0].handleType : 'update'; |
| 290 | 290 | } |
| 291 | 291 | const delData = commonUtils.isEmptyArr(delTmpData) ? [] : delTmpData; | ... | ... |
src/components/IndexCenter/IndexCenter.js
| ... | ... | @@ -105,7 +105,6 @@ class IndexCenter extends Component { |
| 105 | 105 | componentWillReceiveProps(nextProps) { |
| 106 | 106 | const { dispatch } = nextProps; |
| 107 | 107 | const { modelCenter, comParameter:comParameterAll = [], dataCode, kpiData, logoImageInfo, userinfo, token } = nextProps.app; |
| 108 | - console.log('1-comParameterAll', comParameterAll); | |
| 109 | 108 | const comParameter = comParameterAll.filter(item => item.sDisplayType ? item.sDisplayType !== 'LargeScreen' : !item.sFormUrl?.includes('http')); |
| 110 | 109 | const commonThirdApp = comParameterAll.filter(item => item.sDisplayType ? item.sDisplayType === 'LargeScreen' : item.sFormUrl?.includes('http')); |
| 111 | 110 | const { modelCenter: modelCenterOld } = this.props; | ... | ... |
src/models/content.js
| ... | ... | @@ -42,6 +42,7 @@ export default { |
| 42 | 42 | sName, /* 当前列的sName */ |
| 43 | 43 | sSqlConditionValues, |
| 44 | 44 | sSrcModelsId, |
| 45 | + bHistoryView | |
| 45 | 46 | } = payload; /* 参数接收 */ |
| 46 | 47 | const token = yield select(state => state.app.token); /* 用户令牌 */ |
| 47 | 48 | /* 从接口获取数据 */ |
| ... | ... | @@ -84,6 +85,7 @@ export default { |
| 84 | 85 | sName, |
| 85 | 86 | sSqlConditionValues, |
| 86 | 87 | sSrcModelsId, |
| 88 | + bHistoryView | |
| 87 | 89 | }, |
| 88 | 90 | }, |
| 89 | 91 | }); |
| ... | ... | @@ -95,7 +97,7 @@ export default { |
| 95 | 97 | *onRouterMobile({ payload }, { put, call, select }) { |
| 96 | 98 | const { urlKey } = payload; /* 参数接收 */ |
| 97 | 99 | console.log(payload,'payload'); |
| 98 | - | |
| 100 | + | |
| 99 | 101 | if (urlKey !== undefined) { |
| 100 | 102 | const token = yield select(state => state.app.token); /* 用户令牌 */ |
| 101 | 103 | const { data } = yield call(services.getService, token, urlKey); |
| ... | ... | @@ -128,7 +130,7 @@ export default { |
| 128 | 130 | yield put({ type: 'app/throwErrorMobile', payload: data }); |
| 129 | 131 | } |
| 130 | 132 | } else { |
| 131 | - | |
| 133 | + | |
| 132 | 134 | const param = { |
| 133 | 135 | sModelsId: payload.sModelsId, |
| 134 | 136 | sId: payload.sId, | ... | ... |
src/utils/config.js
| ... | ... | @@ -9,11 +9,11 @@ const API = process.env.API; |
| 9 | 9 | const bHttps = false; |
| 10 | 10 | export const webSite = { |
| 11 | 11 | faceAddress: isDev ? '//118.178.19.35:8088/xlyFace' : '//' + location.host + '/xlyFace', |
| 12 | - ipAddress: localStorage.ipAddress ? localStorage.ipAddress : isDev ? '//km5cjx.gnway.cc:36867/xlyEntry/' : '//' + location.host + '/xlyEntry/', | |
| 12 | + ipAddress: localStorage.ipAddress ? localStorage.ipAddress : isDev ? '///118.178.19.35:8088/xlyEntry/' : '//' + location.host + '/xlyEntry/', | |
| 13 | 13 | // ipAddress: localStorage.ipAddress ? localStorage.ipAddress : isDev ? '//118.178.19.35:8088/xlyEntry/' : '//' + location.host + '/xlyEntry/', |
| 14 | 14 | // ipAddress: localStorage.ipAddress ? localStorage.ipAddress : isDev ? '//8.130.144.93:8088/xlyEntry/' : '//' + location.host + '/xlyEntry/', |
| 15 | 15 | interfaceAddress: localStorage.apiAddress ? localStorage.apiAddress : isDev ? '//118.178.19.35:8088/xlyApi/' : '//' + location.host + '/xlyApi/', // 接口地址 |
| 16 | - fileAddress: isDev ? '//118.178.19.35:8088/xlyReport/' : '//' + location.host + '/xlyReport/', // 接口地址 | |
| 16 | + fileAddress: isDev ? '//118.178.19.35:8088/xlyReport/' : '//' + location.host + '/xlyReport/', // 接口地址1 | |
| 17 | 17 | fileAddressEbc: isDev ? '//118.178.19.35:8088/xlyReport/' : '//' + location.host + '/xlyReport/', |
| 18 | 18 | }; |
| 19 | 19 | ... | ... |
src/utils/utils.js
| ... | ... | @@ -641,6 +641,39 @@ export function genSlaveNewId(arr, tableName, idName, oldName, baseObj) { |
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | |
| 644 | +/** | |
| 645 | + * 从props中提取带DataOld后缀的字段,组装成以表名为key的原始数据对象 | |
| 646 | + * @param {Object} props - 组件的props对象 | |
| 647 | + * @returns {Object} - 组装后的sOldData,格式:{ 表名: 对应的数据数组 } | |
| 648 | + */ | |
| 649 | +export function getOldDataFromProps(props) { | |
| 650 | + // 初始化返回的空对象 | |
| 651 | + const sOldData = {}; | |
| 652 | + | |
| 653 | + // 2. 遍历props的所有key | |
| 654 | + for (const key of Object.keys(props)) { | |
| 655 | + if (key.includes('DataOld')) { | |
| 656 | + // 提取去掉DataOld后的表名前缀 | |
| 657 | + const tablename = key.replace('DataOld', '').trim(); | |
| 658 | + | |
| 659 | + // 获取对应的配置对象(tablename + Config) | |
| 660 | + const tableConfig = props[tablename + 'Config']; | |
| 661 | + // 获取对应的原始数据(tablename + DataOld),默认空数组 | |
| 662 | + const tableData = props[tablename + 'DataOld'] || []; | |
| 663 | + | |
| 664 | + // 3. 校验配置对象是否有效,避免无配置时赋值 | |
| 665 | + if (isNotEmptyObject(tableConfig) && tableConfig.sTbName) { | |
| 666 | + // 以配置中的真实表名为key,存入数据 | |
| 667 | + const sTbName = tableConfig.sTbName; | |
| 668 | + sOldData[sTbName] = tableData; | |
| 669 | + } | |
| 670 | + } | |
| 671 | + } | |
| 672 | + | |
| 673 | + return sOldData; | |
| 674 | +} | |
| 675 | + | |
| 676 | + | |
| 644 | 677 | export const myContext = createContext(null); |
| 645 | 678 | |
| 646 | 679 | export function reducer(state, action) { | ... | ... |