From 5a149d626ae8bc3fa4bddbb53f8caf40f51f6da6 Mon Sep 17 00:00:00 2001 From: zs <zhousong@weben-smart.com> Date: 周三, 04 6月 2025 17:42:13 +0800 Subject: [PATCH] Merge branch 'master' of http://222.71.245.114:9086/r/HIA24016N_PipeLineDemo --- PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs | 596 +++++ PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Controllers/WorkPlanDrawer.tsx | 175 - HIAWms/hiawms_web/src/utils/myformUtils.ts | 102 + PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/MapperProfiles/WorkPlanAutoMapperProfile.cs | 48 PipeLineLems/pipelinelems_web/src/utils/myHighQueryUtils.ts | 113 + HIAWms/hiawms_web/src/widgets/WmsStoreInfo/Views/Pages/WmsPlace/WmsPlace.tsx | 8 Weben_CMS专用代码生成器/Code/Templete/AppService/IAppService模板.txt | 4 PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkTaskController.cs | 3 HIAWms/hiawms_web/src/widgets/HIAWms/Views/Pages/WmsMaterialType/WmsMaterialType.tsx | 8 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanExportModel.cs | 78 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/WorkTaskExportModel.cs | 78 PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMSPluginEntry.cs | 1 PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/CallMaterialOrderRecord/CallMaterialOrderRecord.tsx | 8 PipeLineLems/pipelinelems_web/src/components/DyFormForHighQuery/DyFormForHighQuery.module.scss | 38 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/WorkTask/WorkTask.cs | 61 CommonDLL/公共前端组件/src/components/DyFormForHighQuery/DyFormForHighQuery.module.scss | 38 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Extensions/CMSPluginEfCoreExtensions.WorkTask.cs | 1 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/20250521014306_Update2.Designer.cs | 12 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/CMSPluginDbContextModelSnapshot.cs | 10 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkPlanAppService.cs | 38 PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs | 58 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/PipeAccessoryAssembly.tsx | 657 ++++-- PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/WorkTask/Config.ts | 65 Weben_CMS专用代码生成器/Code/Generate/AppService/AppService_Generate.cs | 26 HIAWms/hiawms_web/src/utils/myHighQueryUtils.ts | 113 + HIAWms/hiawms_web/src/widgets/HIAWms/Views/Pages/WmsMaterial/WmsMaterial.tsx | 8 Weben_CMS专用代码生成器/Code/Templete/Web/Views/Pages/EntityNameClass/EntityNameClass模板.txt | 102 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Extensions/CMSPluginEfCoreExtensions.WorkPlan.cs | 1 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/IWorkTaskAppService.cs | 4 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/SendFlangeCodeInput.cs | 27 HIAWms/hiawms_web/components.d.ts | 4 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssembly.ts | 33 HIAWms/hiawms_web/src/widgets/WmsStoreInfo/Views/Pages/WmsStore/WmsStore.tsx | 8 HIAWms/hiawms_web/src/widgets/WmsContainer/Views/Pages/WmsContainer/WmsContainer.tsx | 8 PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/WorkPlan.tsx | 106 PipeLineLems/pipelinelems_web/src/components/BaseQueryDrawer/BaseQueryDrawer.tsx | 4 PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/WorkTask/WorkTask.tsx | 106 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkTaskAppService.cs | 789 +++---- PipeLineLems/pipelinelems_web/src/components/DyFormForHighQuery/DyFormForHighQueryOptions.js | 16 CommonDLL/公共前端组件/src/components/DyFormForHighQuery/DyFormForHighQueryOptions.js | 16 HIAWms/hiawms_web/src/components/BaseQueryDrawer/BaseQueryDrawer.tsx | 4 HIAWms/hiawms_web/src/widgets/WmsTask/Views/Pages/WmsTask/WmsTask.tsx | 8 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssembly.ts | 94 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/WorkTaskCreateOrUpdateDtoBase.cs | 65 HIAWms/hiawms_web/src/widgets/WmsInOutStockRecord/Views/Pages/WmsInOutStockRecord/WmsInOutStockRecord.tsx | 8 HIAWms/hiawms_web/src/widgets/WmsStoreInfo/Views/Pages/WmsArea/WmsArea.tsx | 8 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/GetWorkTaskInput.cs | 130 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanInput.cs | 5 PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskQueryDrawer.tsx | 169 PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskDrawer.tsx | 91 HIAWms/hiawms_web/src/components/DyFormForHighQuery/DyFormForHighQueryOptions.js | 16 PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Views/Pages/CallMaterialOrder/CallMaterialOrder.tsx | 117 CommonDLL/公共前端组件/src/utils/myHighQueryUtils.ts | 113 + PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssembly.ts | 15 HIAWms/hiawms_web/src/widgets/WmsInOutStockOrder/Views/Pages/WmsInOutStockOrder/WmsInOutStockOrder.tsx | 8 HIAWms/hiawms_web/src/widgets/WmsInOutStockOrderDetail/Views/Pages/WmsInOutStockOrderDetail/WmsInOutStockOrderDetail.tsx | 8 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/WorkPlan/WorkPlan.cs | 65 PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/Config.ts | 37 HIAWms/hiawms_web/src/components/DyFormForHighQuery/DyFormForHighQuery.module.scss | 38 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanDto.cs | 65 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanCreateOrUpdateDtoBase.cs | 65 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/GetWorkPlanInput.cs | 130 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/MapperProfiles/WorkTaskAutoMapperProfile.cs | 43 HIAWms/hiawms_web/src/widgets/WmsMaterialStock/Views/Pages/WmsMaterialStock/WmsMaterialStock.tsx | 8 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/WorkTaskDto.cs | 65 Weben_CMS专用代码生成器/Code/MainForm.cs | 2 管子线LMESDemo.cmsproj | 0 HIAWms/hiawms_web/src/widgets/WmsMaterialStock/Views/Pages/WmsMaterialStockDetail/WmsMaterialStockDetail.tsx | 8 PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/20250521014306_Update2.cs | 52 CommonDLL/公共前端组件/src/components/BaseQueryDrawer/BaseQueryDrawer.tsx | 4 PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/Config.ts | 213 ++ Weben_CMS专用代码生成器/Code/Templete/Application/MapperProfiles/AutoMapperProfile模板.txt | 6 PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Controllers/WorkPlanQueryDrawer.tsx | 366 +-- Weben_CMS专用代码生成器/Code/MainForm.Designer.cs | 1 Weben_CMS专用代码生成器/Code/Templete/AppService/AppService模板.txt | 27 Weben_CMS专用代码生成器/Code/Templete/Controller模板.txt | 3 PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Resources/Templates/WorkTask导出模板.xlsx | 0 PipeLineLems/pipelinelems_web/vite.lib.config.ts | 3 PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs | 108 + 79 files changed, 3,523 insertions(+), 2,216 deletions(-) diff --git "a/CommonDLL/\345\205\254\345\205\261\345\211\215\347\253\257\347\273\204\344\273\266/src/components/BaseQueryDrawer/BaseQueryDrawer.tsx" "b/CommonDLL/\345\205\254\345\205\261\345\211\215\347\253\257\347\273\204\344\273\266/src/components/BaseQueryDrawer/BaseQueryDrawer.tsx" index 9d144bb..9c82177 100644 --- "a/CommonDLL/\345\205\254\345\205\261\345\211\215\347\253\257\347\273\204\344\273\266/src/components/BaseQueryDrawer/BaseQueryDrawer.tsx" +++ "b/CommonDLL/\345\205\254\345\205\261\345\211\215\347\253\257\347\273\204\344\273\266/src/components/BaseQueryDrawer/BaseQueryDrawer.tsx" @@ -6,7 +6,7 @@ [key: string]: any }>({ // @ts-ignore - name: 'BaseDrawer', + name: 'BaseQueryDrawer', props: { // 閬僵鏄惁鍙偣鍑� clickable: { @@ -49,6 +49,8 @@ > <el-drawer // modal-class={props.clickable ? styles.modal : ''} + //灏嗘娊灞夊己鍒舵寕杞藉埌 body 鍏冪礌涓婏紝纭繚鏍峰紡闅旂鍜屾粴鍔ㄨ涓烘甯革紝涓嶅彈宓屽椤甸潰鐨勫奖鍝� + append-to-body="true" class={{ [styles.informationDrawer]: true, // [styles.informationDrawerPosition]: props.clickable, diff --git "a/CommonDLL/\345\205\254\345\205\261\345\211\215\347\253\257\347\273\204\344\273\266/src/components/DyFormForHighQuery/DyFormForHighQuery.module.scss" "b/CommonDLL/\345\205\254\345\205\261\345\211\215\347\253\257\347\273\204\344\273\266/src/components/DyFormForHighQuery/DyFormForHighQuery.module.scss" index 0fff059..0281c01 100644 --- "a/CommonDLL/\345\205\254\345\205\261\345\211\215\347\253\257\347\273\204\344\273\266/src/components/DyFormForHighQuery/DyFormForHighQuery.module.scss" +++ "b/CommonDLL/\345\205\254\345\205\261\345\211\215\347\253\257\347\273\204\344\273\266/src/components/DyFormForHighQuery/DyFormForHighQuery.module.scss" @@ -1,15 +1,4 @@ .formStyle { - .formItem { - // 绉婚櫎鍥哄畾瀹藉害闄愬埗 - width: auto !important; - margin-right: 0 !important; - } - - .formControl { - flex: 1; // 璁╂帶浠跺崰鎹墿浣欑┖闂� - min-width: 0; // 鍏佽鎺т欢鏀剁缉 - } - .formItemLabel { display: inline-flex; justify-content: flex-end; @@ -25,17 +14,30 @@ margin-left: 10px; } } - :global(.cs-select) { width: 100%; } - - // 绉婚櫎鍥哄畾瀹藉害璁剧疆 :global(.cs-form--inline .cs-form-item) { - width: auto !important; + width: 46%; } - :global(.cs-form--inline .cs-form-item:nth-last-of-type(2n)) { - margin-right: 0 !important; + margin-right: 0; } -} \ No newline at end of file + :global(.cs-date-editor) { + width: 100%; + } +} +.optionLabel { + display: flex; + justify-content: space-between; + align-items: center; +} +.formitemPropsLabel { + display: flex; + justify-content: flex-start; + align-items: center; +} + +.itemDistance { + margin-bottom: 20px !important; +} diff --git "a/CommonDLL/\345\205\254\345\205\261\345\211\215\347\253\257\347\273\204\344\273\266/src/components/DyFormForHighQuery/DyFormForHighQueryOptions.js" "b/CommonDLL/\345\205\254\345\205\261\345\211\215\347\253\257\347\273\204\344\273\266/src/components/DyFormForHighQuery/DyFormForHighQueryOptions.js" index e70f08b..5c8ca3d 100644 --- "a/CommonDLL/\345\205\254\345\205\261\345\211\215\347\253\257\347\273\204\344\273\266/src/components/DyFormForHighQuery/DyFormForHighQueryOptions.js" +++ "b/CommonDLL/\345\205\254\345\205\261\345\211\215\347\253\257\347\273\204\344\273\266/src/components/DyFormForHighQuery/DyFormForHighQueryOptions.js" @@ -2,8 +2,14 @@ export const FILTER_MODE_OPTIONS_STRING = [ { label: '妯$硦鏌ヨ', value: 1 }, { label: '绮惧噯鏌ヨ', value: 2 }, - ]; - // 鏁板瓧绫绘煡璇� + { label: '涓嶇瓑浜�', value: 7 }, +]; +// 瀛楃涓茬被鏌ヨ(鍏抽敭瀛楁煡璇笓鐢�) +export const FILTER_MODE_OPTIONS_STRING_KEY = [ + { label: '妯$硦鏌ヨ', value: 1 }, + { label: '绮惧噯鏌ヨ', value: 2 }, +]; +// 鏁板瓧绫绘煡璇� export const FILTER_MODE_OPTIONS_NUM = [ { label: '绮惧噯鏌ヨ', value: 2 }, { label: '澶т簬绛変簬', value: 3 }, @@ -11,9 +17,9 @@ { label: '澶т簬', value: 5 }, { label: '灏忎簬', value: 6 }, { label: '涓嶇瓑浜�', value: 7 }, - ]; - // bool鏌ヨ +]; +// bool鏌ヨ export const FILTER_MODE_OPTIONS_BOOL = [ { label: '绮惧噯鏌ヨ', value: 2 }, { label: '涓嶇瓑浜�', value: 7 }, - ]; +]; diff --git "a/CommonDLL/\345\205\254\345\205\261\345\211\215\347\253\257\347\273\204\344\273\266/src/utils/myHighQueryUtils.ts" "b/CommonDLL/\345\205\254\345\205\261\345\211\215\347\253\257\347\273\204\344\273\266/src/utils/myHighQueryUtils.ts" new file mode 100644 index 0000000..52e90cc --- /dev/null +++ "b/CommonDLL/\345\205\254\345\205\261\345\211\215\347\253\257\347\273\204\344\273\266/src/utils/myHighQueryUtils.ts" @@ -0,0 +1,113 @@ + +//楂樼骇鏌ヨ宸ュ叿鏂囦欢 + + /** + * 淇濆瓨褰撳墠楂樼骇鏌ヨ鏁版嵁锛屽悎骞惰繃婊ゅ悗鐨勬暟鎹苟鏇存柊鍝嶅簲寮忔煡璇㈠璞� + * @param {Object} filteredData - 杩囨护鍚庣殑鏌ヨ鏁版嵁瀵硅薄锛屽寘鍚敤鎴疯緭鍏ョ殑鏌ヨ鏉′欢 + * @param {Ref<Object>} _curHighQueryData - Vue鍝嶅簲寮忓璞★紝瀛樺偍褰撳墠瀹屾暣鐨勬煡璇㈡潯浠� + * @param {Ref<Object>} queryForm - Vue鍝嶅簲寮忓璞★紝瀛樺偍琛ㄥ崟杈撳叆鐨勬煡璇㈡潯浠� + * @param {Ref<string>} _searchFormInputAttrs - Vue鍝嶅簲寮忓瓧绗︿覆锛屽瓨鍌ㄦ煡璇㈣〃鍗曠殑杈撳叆灞炴�ч厤缃� + * @returns {void} + * @example + * commonSaveCurHighQueryData( + * { name: 'John', age: 30 }, + * ref({}), + * ref({ searchVal: '', searchVal_FilterMode: 'contains' }), + * ref('name,age,email') + * ); + */ +export const commonSaveCurHighQueryData = (filteredData, _curHighQueryData, queryForm, _searchFormInputAttrs) => { + _curHighQueryData.value = { ..._curHighQueryData.value, ...filteredData }; + setValueForCurHighQueryData(_curHighQueryData, queryForm, _searchFormInputAttrs); +} + +/** + * 涓哄搷搴斿紡鏌ヨ鏁版嵁瀵硅薄璁剧疆鍩虹鏌ヨ鍊� + * @param {Ref<Object>} _curHighQueryData - Vue鍝嶅簲寮忓璞★紝瀛樺偍褰撳墠瀹屾暣鐨勬煡璇㈡潯浠� + * @param {Ref<Object>} queryForm - Vue鍝嶅簲寮忓璞★紝瀛樺偍琛ㄥ崟杈撳叆鐨勬煡璇㈡潯浠� + * @param {Ref<string>} _searchFormInputAttrs - Vue鍝嶅簲寮忓瓧绗︿覆锛屽瓨鍌ㄦ煡璇㈣〃鍗曠殑杈撳叆灞炴�ч厤缃� + * @returns {void} + * @example + * setValueForCurHighQueryData( + * ref({}), + * ref({ searchVal: 'test', searchVal_FilterMode: 'equals' }), + * ref('name,age') + * ); + * // _curHighQueryData.value 灏嗗寘鍚� searchVal, searchVal_FilterMode 鍜� str_searchFormInputAttrs + */ +export const setValueForCurHighQueryData = (_curHighQueryData, queryForm, _searchFormInputAttrs) => { + _curHighQueryData.value.searchVal = queryForm.value.searchVal; + _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode; + _curHighQueryData.value.str_searchFormInputAttrs = _searchFormInputAttrs.value; +} + +/** + * 鍒濆鍖栨煡璇㈣〃鍗曪紝璁剧疆榛樿鍊� + * @param {Ref<Object>} queryForm - Vue鍝嶅簲寮忓璞★紝瀛樺偍琛ㄥ崟杈撳叆鐨勬煡璇㈡潯浠� + * @param {Ref<string>} _searchFormInputAttrs - Vue鍝嶅簲寮忓瓧绗︿覆锛屽瓨鍌ㄦ煡璇㈣〃鍗曠殑杈撳叆灞炴�ч厤缃� + * @param {Array<Object>} arr - 杩囨护妯″紡閫夐」鏁扮粍锛屾瘡涓�夐」鍖呭惈value鍜宭abel灞炴�� + * @returns {void} + * @example + * initQueryForm( + * ref({}), + * ref('name,age'), + * [{ value: 'contains', label: '鍖呭惈' }, { value: 'equals', label: '绛変簬' }] + * ); + * // queryForm.value 灏嗚鍒濆鍖栦负 { searchVal: '', searchVal_FilterMode: 'contains', str_searchFormInputAttrs: 'name,age' } + */ +export const initQueryForm = (queryForm, _searchFormInputAttrs, arr) => { + queryForm.value.searchVal = ''; + queryForm.value.searchVal_FilterMode = arr[0]?.value || ''; + queryForm.value.str_searchFormInputAttrs = _searchFormInputAttrs.value; +} + +/** + * 鑾峰彇楂樼骇鏌ヨ寮瑰嚭妗嗙殑鏌ヨ鍊硷紝杩囨护鏃犳晥鏁版嵁骞剁粍鍚堝畬鏁存煡璇㈡潯浠� + * @param {Object} extraParams - 棰濆鐨勬煡璇㈠弬鏁板璞★紝鍙兘鍖呭惈鐗规畩鏌ヨ鏉′欢 + * @param {Ref<Object>} queryForm - Vue鍝嶅簲寮忓璞★紝瀛樺偍琛ㄥ崟杈撳叆鐨勬煡璇㈡潯浠� + * @param {Ref<string>} _searchFormInputAttrs - Vue鍝嶅簲寮忓瓧绗︿覆锛屽瓨鍌ㄦ煡璇㈣〃鍗曠殑杈撳叆灞炴�ч厤缃� + * @returns {Object} 缁勫悎鍚庣殑鏈夋晥鏌ヨ鏁版嵁瀵硅薄 + * @example + * const queryData = commonGetHighQueryForm( + * { status: 'active', category: 'books' }, + * ref({ searchVal: 'javascript', searchVal_FilterMode: 'contains' }), + * ref('title,author') + * ); + * // 杩斿洖 { status: 'active', category: 'books', searchVal: 'javascript', searchVal_FilterMode: 'contains', str_searchFormInputAttrs: 'title,author' } + */ +export const commonGetHighQueryForm = (extraParams, queryForm, _searchFormInputAttrs) => { + // 杩囨护鎺� undefined 鐨勫�� + let filteredData = Object.assign( + {}, + ...Object.entries(extraParams).map(([key, value]) => + value !== undefined ? { [key]: value } : {} + ) + ); + // 缁勫悎妯$硦鏌ヨ + filteredData.searchVal = queryForm.value.searchVal; + filteredData.searchVal_FilterMode = queryForm.value.searchVal_FilterMode; + filteredData.str_searchFormInputAttrs = _searchFormInputAttrs.value; + return filteredData; +} + +/** + * 鏂扮増鐨勬煡璇㈠脊鍑烘鍏抽棴鏂规硶锛岃幏鍙栬繃婊ゆ暟鎹苟淇濆瓨鍒板搷搴斿紡瀵硅薄 + * @param {Object} extraParams - 棰濆鐨勬煡璇㈠弬鏁板璞★紝鍙兘鍖呭惈鐗规畩鏌ヨ鏉′欢 + * @param {Ref<Object>} queryForm - Vue鍝嶅簲寮忓璞★紝瀛樺偍琛ㄥ崟杈撳叆鐨勬煡璇㈡潯浠� + * @param {Ref<string>} _searchFormInputAttrs - Vue鍝嶅簲寮忓瓧绗︿覆锛屽瓨鍌ㄦ煡璇㈣〃鍗曠殑杈撳叆灞炴�ч厤缃� + * @param {Ref<Object>} _curHighQueryData - Vue鍝嶅簲寮忓璞★紝瀛樺偍褰撳墠瀹屾暣鐨勬煡璇㈡潯浠� + * @returns {Object} 缁勫悎鍚庣殑鏈夋晥鏌ヨ鏁版嵁瀵硅薄 + * @example + * const queryData = GetFilteredData( + * { type: 'article' }, + * ref({ searchVal: 'news', searchVal_FilterMode: 'startsWith' }), + * ref('title,content'), + * ref({}) + * ); + * // 杩斿洖鏈夋晥鏌ヨ鏁版嵁骞舵洿鏂� _curHighQueryData + */ +export const GetFilteredData = (extraParams, queryForm, _searchFormInputAttrs, _curHighQueryData) => { + let filteredData = commonGetHighQueryForm(extraParams, queryForm, _searchFormInputAttrs); + commonSaveCurHighQueryData(filteredData, _curHighQueryData, queryForm, _searchFormInputAttrs); + return filteredData; +} \ No newline at end of file diff --git a/HIAWms/hiawms_web/components.d.ts b/HIAWms/hiawms_web/components.d.ts index 135cdd6..14b542d 100644 --- a/HIAWms/hiawms_web/components.d.ts +++ b/HIAWms/hiawms_web/components.d.ts @@ -29,14 +29,11 @@ ElDropdown: typeof import('element-plus/es')['ElDropdown'] ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] - ElEmpty: typeof import('element-plus/es')['ElEmpty'] ElForm: typeof import('element-plus/es')['ElForm'] ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElIcon: typeof import('element-plus/es')['ElIcon'] ElInput: typeof import('element-plus/es')['ElInput'] ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] - ElMenu: typeof import('element-plus/es')['ElMenu'] - ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElOption: typeof import('element-plus/es')['ElOption'] ElPagination: typeof import('element-plus/es')['ElPagination'] ElPopover: typeof import('element-plus/es')['ElPopover'] @@ -44,7 +41,6 @@ ElSelect: typeof import('element-plus/es')['ElSelect'] ElTabPane: typeof import('element-plus/es')['ElTabPane'] ElTabs: typeof import('element-plus/es')['ElTabs'] - ElTag: typeof import('element-plus/es')['ElTag'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElUpload: typeof import('element-plus/es')['ElUpload'] Menu: typeof import('./src/components/Menu/index.vue')['default'] diff --git a/HIAWms/hiawms_web/src/components/BaseQueryDrawer/BaseQueryDrawer.tsx b/HIAWms/hiawms_web/src/components/BaseQueryDrawer/BaseQueryDrawer.tsx index 9d144bb..9c82177 100644 --- a/HIAWms/hiawms_web/src/components/BaseQueryDrawer/BaseQueryDrawer.tsx +++ b/HIAWms/hiawms_web/src/components/BaseQueryDrawer/BaseQueryDrawer.tsx @@ -6,7 +6,7 @@ [key: string]: any }>({ // @ts-ignore - name: 'BaseDrawer', + name: 'BaseQueryDrawer', props: { // 閬僵鏄惁鍙偣鍑� clickable: { @@ -49,6 +49,8 @@ > <el-drawer // modal-class={props.clickable ? styles.modal : ''} + //灏嗘娊灞夊己鍒舵寕杞藉埌 body 鍏冪礌涓婏紝纭繚鏍峰紡闅旂鍜屾粴鍔ㄨ涓烘甯革紝涓嶅彈宓屽椤甸潰鐨勫奖鍝� + append-to-body="true" class={{ [styles.informationDrawer]: true, // [styles.informationDrawerPosition]: props.clickable, diff --git a/HIAWms/hiawms_web/src/components/DyFormForHighQuery/DyFormForHighQuery.module.scss b/HIAWms/hiawms_web/src/components/DyFormForHighQuery/DyFormForHighQuery.module.scss index 0fff059..0281c01 100644 --- a/HIAWms/hiawms_web/src/components/DyFormForHighQuery/DyFormForHighQuery.module.scss +++ b/HIAWms/hiawms_web/src/components/DyFormForHighQuery/DyFormForHighQuery.module.scss @@ -1,15 +1,4 @@ .formStyle { - .formItem { - // 绉婚櫎鍥哄畾瀹藉害闄愬埗 - width: auto !important; - margin-right: 0 !important; - } - - .formControl { - flex: 1; // 璁╂帶浠跺崰鎹墿浣欑┖闂� - min-width: 0; // 鍏佽鎺т欢鏀剁缉 - } - .formItemLabel { display: inline-flex; justify-content: flex-end; @@ -25,17 +14,30 @@ margin-left: 10px; } } - :global(.cs-select) { width: 100%; } - - // 绉婚櫎鍥哄畾瀹藉害璁剧疆 :global(.cs-form--inline .cs-form-item) { - width: auto !important; + width: 46%; } - :global(.cs-form--inline .cs-form-item:nth-last-of-type(2n)) { - margin-right: 0 !important; + margin-right: 0; } -} \ No newline at end of file + :global(.cs-date-editor) { + width: 100%; + } +} +.optionLabel { + display: flex; + justify-content: space-between; + align-items: center; +} +.formitemPropsLabel { + display: flex; + justify-content: flex-start; + align-items: center; +} + +.itemDistance { + margin-bottom: 20px !important; +} diff --git a/HIAWms/hiawms_web/src/components/DyFormForHighQuery/DyFormForHighQueryOptions.js b/HIAWms/hiawms_web/src/components/DyFormForHighQuery/DyFormForHighQueryOptions.js index e70f08b..5c8ca3d 100644 --- a/HIAWms/hiawms_web/src/components/DyFormForHighQuery/DyFormForHighQueryOptions.js +++ b/HIAWms/hiawms_web/src/components/DyFormForHighQuery/DyFormForHighQueryOptions.js @@ -2,8 +2,14 @@ export const FILTER_MODE_OPTIONS_STRING = [ { label: '妯$硦鏌ヨ', value: 1 }, { label: '绮惧噯鏌ヨ', value: 2 }, - ]; - // 鏁板瓧绫绘煡璇� + { label: '涓嶇瓑浜�', value: 7 }, +]; +// 瀛楃涓茬被鏌ヨ(鍏抽敭瀛楁煡璇笓鐢�) +export const FILTER_MODE_OPTIONS_STRING_KEY = [ + { label: '妯$硦鏌ヨ', value: 1 }, + { label: '绮惧噯鏌ヨ', value: 2 }, +]; +// 鏁板瓧绫绘煡璇� export const FILTER_MODE_OPTIONS_NUM = [ { label: '绮惧噯鏌ヨ', value: 2 }, { label: '澶т簬绛変簬', value: 3 }, @@ -11,9 +17,9 @@ { label: '澶т簬', value: 5 }, { label: '灏忎簬', value: 6 }, { label: '涓嶇瓑浜�', value: 7 }, - ]; - // bool鏌ヨ +]; +// bool鏌ヨ export const FILTER_MODE_OPTIONS_BOOL = [ { label: '绮惧噯鏌ヨ', value: 2 }, { label: '涓嶇瓑浜�', value: 7 }, - ]; +]; diff --git a/HIAWms/hiawms_web/src/utils/myHighQueryUtils.ts b/HIAWms/hiawms_web/src/utils/myHighQueryUtils.ts new file mode 100644 index 0000000..52e90cc --- /dev/null +++ b/HIAWms/hiawms_web/src/utils/myHighQueryUtils.ts @@ -0,0 +1,113 @@ + +//楂樼骇鏌ヨ宸ュ叿鏂囦欢 + + /** + * 淇濆瓨褰撳墠楂樼骇鏌ヨ鏁版嵁锛屽悎骞惰繃婊ゅ悗鐨勬暟鎹苟鏇存柊鍝嶅簲寮忔煡璇㈠璞� + * @param {Object} filteredData - 杩囨护鍚庣殑鏌ヨ鏁版嵁瀵硅薄锛屽寘鍚敤鎴疯緭鍏ョ殑鏌ヨ鏉′欢 + * @param {Ref<Object>} _curHighQueryData - Vue鍝嶅簲寮忓璞★紝瀛樺偍褰撳墠瀹屾暣鐨勬煡璇㈡潯浠� + * @param {Ref<Object>} queryForm - Vue鍝嶅簲寮忓璞★紝瀛樺偍琛ㄥ崟杈撳叆鐨勬煡璇㈡潯浠� + * @param {Ref<string>} _searchFormInputAttrs - Vue鍝嶅簲寮忓瓧绗︿覆锛屽瓨鍌ㄦ煡璇㈣〃鍗曠殑杈撳叆灞炴�ч厤缃� + * @returns {void} + * @example + * commonSaveCurHighQueryData( + * { name: 'John', age: 30 }, + * ref({}), + * ref({ searchVal: '', searchVal_FilterMode: 'contains' }), + * ref('name,age,email') + * ); + */ +export const commonSaveCurHighQueryData = (filteredData, _curHighQueryData, queryForm, _searchFormInputAttrs) => { + _curHighQueryData.value = { ..._curHighQueryData.value, ...filteredData }; + setValueForCurHighQueryData(_curHighQueryData, queryForm, _searchFormInputAttrs); +} + +/** + * 涓哄搷搴斿紡鏌ヨ鏁版嵁瀵硅薄璁剧疆鍩虹鏌ヨ鍊� + * @param {Ref<Object>} _curHighQueryData - Vue鍝嶅簲寮忓璞★紝瀛樺偍褰撳墠瀹屾暣鐨勬煡璇㈡潯浠� + * @param {Ref<Object>} queryForm - Vue鍝嶅簲寮忓璞★紝瀛樺偍琛ㄥ崟杈撳叆鐨勬煡璇㈡潯浠� + * @param {Ref<string>} _searchFormInputAttrs - Vue鍝嶅簲寮忓瓧绗︿覆锛屽瓨鍌ㄦ煡璇㈣〃鍗曠殑杈撳叆灞炴�ч厤缃� + * @returns {void} + * @example + * setValueForCurHighQueryData( + * ref({}), + * ref({ searchVal: 'test', searchVal_FilterMode: 'equals' }), + * ref('name,age') + * ); + * // _curHighQueryData.value 灏嗗寘鍚� searchVal, searchVal_FilterMode 鍜� str_searchFormInputAttrs + */ +export const setValueForCurHighQueryData = (_curHighQueryData, queryForm, _searchFormInputAttrs) => { + _curHighQueryData.value.searchVal = queryForm.value.searchVal; + _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode; + _curHighQueryData.value.str_searchFormInputAttrs = _searchFormInputAttrs.value; +} + +/** + * 鍒濆鍖栨煡璇㈣〃鍗曪紝璁剧疆榛樿鍊� + * @param {Ref<Object>} queryForm - Vue鍝嶅簲寮忓璞★紝瀛樺偍琛ㄥ崟杈撳叆鐨勬煡璇㈡潯浠� + * @param {Ref<string>} _searchFormInputAttrs - Vue鍝嶅簲寮忓瓧绗︿覆锛屽瓨鍌ㄦ煡璇㈣〃鍗曠殑杈撳叆灞炴�ч厤缃� + * @param {Array<Object>} arr - 杩囨护妯″紡閫夐」鏁扮粍锛屾瘡涓�夐」鍖呭惈value鍜宭abel灞炴�� + * @returns {void} + * @example + * initQueryForm( + * ref({}), + * ref('name,age'), + * [{ value: 'contains', label: '鍖呭惈' }, { value: 'equals', label: '绛変簬' }] + * ); + * // queryForm.value 灏嗚鍒濆鍖栦负 { searchVal: '', searchVal_FilterMode: 'contains', str_searchFormInputAttrs: 'name,age' } + */ +export const initQueryForm = (queryForm, _searchFormInputAttrs, arr) => { + queryForm.value.searchVal = ''; + queryForm.value.searchVal_FilterMode = arr[0]?.value || ''; + queryForm.value.str_searchFormInputAttrs = _searchFormInputAttrs.value; +} + +/** + * 鑾峰彇楂樼骇鏌ヨ寮瑰嚭妗嗙殑鏌ヨ鍊硷紝杩囨护鏃犳晥鏁版嵁骞剁粍鍚堝畬鏁存煡璇㈡潯浠� + * @param {Object} extraParams - 棰濆鐨勬煡璇㈠弬鏁板璞★紝鍙兘鍖呭惈鐗规畩鏌ヨ鏉′欢 + * @param {Ref<Object>} queryForm - Vue鍝嶅簲寮忓璞★紝瀛樺偍琛ㄥ崟杈撳叆鐨勬煡璇㈡潯浠� + * @param {Ref<string>} _searchFormInputAttrs - Vue鍝嶅簲寮忓瓧绗︿覆锛屽瓨鍌ㄦ煡璇㈣〃鍗曠殑杈撳叆灞炴�ч厤缃� + * @returns {Object} 缁勫悎鍚庣殑鏈夋晥鏌ヨ鏁版嵁瀵硅薄 + * @example + * const queryData = commonGetHighQueryForm( + * { status: 'active', category: 'books' }, + * ref({ searchVal: 'javascript', searchVal_FilterMode: 'contains' }), + * ref('title,author') + * ); + * // 杩斿洖 { status: 'active', category: 'books', searchVal: 'javascript', searchVal_FilterMode: 'contains', str_searchFormInputAttrs: 'title,author' } + */ +export const commonGetHighQueryForm = (extraParams, queryForm, _searchFormInputAttrs) => { + // 杩囨护鎺� undefined 鐨勫�� + let filteredData = Object.assign( + {}, + ...Object.entries(extraParams).map(([key, value]) => + value !== undefined ? { [key]: value } : {} + ) + ); + // 缁勫悎妯$硦鏌ヨ + filteredData.searchVal = queryForm.value.searchVal; + filteredData.searchVal_FilterMode = queryForm.value.searchVal_FilterMode; + filteredData.str_searchFormInputAttrs = _searchFormInputAttrs.value; + return filteredData; +} + +/** + * 鏂扮増鐨勬煡璇㈠脊鍑烘鍏抽棴鏂规硶锛岃幏鍙栬繃婊ゆ暟鎹苟淇濆瓨鍒板搷搴斿紡瀵硅薄 + * @param {Object} extraParams - 棰濆鐨勬煡璇㈠弬鏁板璞★紝鍙兘鍖呭惈鐗规畩鏌ヨ鏉′欢 + * @param {Ref<Object>} queryForm - Vue鍝嶅簲寮忓璞★紝瀛樺偍琛ㄥ崟杈撳叆鐨勬煡璇㈡潯浠� + * @param {Ref<string>} _searchFormInputAttrs - Vue鍝嶅簲寮忓瓧绗︿覆锛屽瓨鍌ㄦ煡璇㈣〃鍗曠殑杈撳叆灞炴�ч厤缃� + * @param {Ref<Object>} _curHighQueryData - Vue鍝嶅簲寮忓璞★紝瀛樺偍褰撳墠瀹屾暣鐨勬煡璇㈡潯浠� + * @returns {Object} 缁勫悎鍚庣殑鏈夋晥鏌ヨ鏁版嵁瀵硅薄 + * @example + * const queryData = GetFilteredData( + * { type: 'article' }, + * ref({ searchVal: 'news', searchVal_FilterMode: 'startsWith' }), + * ref('title,content'), + * ref({}) + * ); + * // 杩斿洖鏈夋晥鏌ヨ鏁版嵁骞舵洿鏂� _curHighQueryData + */ +export const GetFilteredData = (extraParams, queryForm, _searchFormInputAttrs, _curHighQueryData) => { + let filteredData = commonGetHighQueryForm(extraParams, queryForm, _searchFormInputAttrs); + commonSaveCurHighQueryData(filteredData, _curHighQueryData, queryForm, _searchFormInputAttrs); + return filteredData; +} \ No newline at end of file diff --git a/HIAWms/hiawms_web/src/utils/myformUtils.ts b/HIAWms/hiawms_web/src/utils/myformUtils.ts new file mode 100644 index 0000000..4dbd92d --- /dev/null +++ b/HIAWms/hiawms_web/src/utils/myformUtils.ts @@ -0,0 +1,102 @@ + +//琛ㄥ崟宸ュ叿鏂囦欢 +/** + * 閫氱敤楂樼骇鏌ヨ琛ㄥ崟鏁版嵁鏀堕泦鍑芥暟 + * @param {Array} formItems - 琛ㄥ崟閰嶇疆椤规暟缁� + * @param {Object} formData - 琛ㄥ崟鏁版嵁瀵硅薄 + * @returns {Object} - 鏀堕泦鐨勮〃鍗曟暟鎹� + */ +export const collectFormDataForHighQuery = (formItems, formData) => { + const data = {}; + + // 閬嶅巻琛ㄥ崟閰嶇疆鏀堕泦鏁版嵁 + formItems.forEach(item => { + // 鏀堕泦鍩虹瀛楁 + data[item.prop] = formData.value[item.prop] || ''; + + // 鏀堕泦杩囨护妯″紡瀛楁 + if (item.highSelectAttrs && item.highSelectAttrs.prop) { + const filterModeProp = item.highSelectAttrs.prop; + data[filterModeProp] = formData.value[filterModeProp] || ''; + } + }); + + return data; + } + + /** + * 閲嶇疆楂樼骇鏌ヨ鐨勮繃婊ゆā寮� + * @param formItems - 琛ㄥ崟閰嶇疆椤规暟缁� + * @param formData - 琛ㄥ崟鏁版嵁瀵硅薄 + */ + export const onResetForHighSelect = (formItems, formData) => { + // 閬嶅巻鎵�鏈夎〃鍗曞瓧娈� + formItems.forEach(item => { + // 妫�鏌ュ瓧娈垫槸鍚︽湁楂樼骇鏌ヨ鐨勮繃婊ゆā寮忛厤缃� + if (item.highSelectAttrs && item.highSelectAttrs.prop) { + const filterModeProp = item.highSelectAttrs.prop; + const options = item.highSelectAttrs.options || []; + + // 濡傛灉瀛樺湪閫夐」锛屽垯璁剧疆涓虹涓�涓�夐」鐨勫�� + if (options.length > 0) { + // 鍋囪閫夐」鏍煎紡涓� { value, label } 鎴栫被浼肩粨鏋� + const firstValue = options[0].value !== undefined ? options[0].value : options[0]; + formData.value[filterModeProp] = firstValue; + } + } + }); +} + +/** + * 閲嶇疆楂樼骇鏌ヨ + * @param formItems - 琛ㄥ崟閰嶇疆椤规暟缁� + * @param formData - 琛ㄥ崟鏁版嵁瀵硅薄 + */ +export const onResetForHighQuery = (formItems, formData) => { + // 1. 娓呯┖鎵�鏈夊熀纭�瀛楁锛堜笉鍖呭惈杩囨护妯″紡瀛楁锛� + const baseFields = formItems.reduce((acc, item) => { + acc[item.prop] = ''; + return acc; + }, {}); + + // 2. 搴旂敤鍩虹瀛楁鍒濆鍊� + formData.value = { ...baseFields }; +} + + +/** + * 浠庤〃鍗曟暟鎹腑鎻愬彇鏈夋晥灞炴�э紙鎺掗櫎鏃犳晥瀛楁锛�,鎻愪氦淇濆瓨琛ㄥ崟鏁版嵁鏃剁敤 + * @param formData 琛ㄥ崟鏁版嵁瀵硅薄 + * @param excludeFields 闇�瑕佹帓闄ょ殑瀛楁鍒楄〃锛堥粯璁や负 ['id']锛� + * @returns 澶勭悊鍚庣殑鏈夋晥鏁版嵁瀵硅薄 + */ +export const extractFormDataForOnConfirm = (formData) => { + //鍔ㄦ�佽幏鍙� formData 鐨勬墍鏈夊睘鎬у�硷紙鎺掗櫎鏃犳晥灞炴�э紝濡� id锛� + const data = Object.entries(formData.value).reduce((acc, [key, value]) => { + // 杩囨护鎺変笉闇�瑕佹彁浜ょ殑灞炴�э紙濡� id锛屽彲鏍规嵁瀹為檯闇�姹傝皟鏁达級 + if (key !== 'id') { + acc[key] = value + } + return acc + }, {} as Record<string, any>) + return data; + }; + + /** + * 浠庡搷搴旀暟鎹腑鎻愬彇鏈夋晥瀛楁骞惰祴鍊肩粰琛ㄥ崟鏁版嵁,鎵撳紑琛ㄥ崟鏁版嵁鏃剁敤 + * @param res 鍝嶅簲鏁版嵁 + * @param formData 琛ㄥ崟鏁版嵁寮曠敤 + * @param options 閰嶇疆閫夐」 + * @returns 澶勭悊鍚庣殑琛ㄥ崟鏁版嵁 + */ +export function extractAndAssignFormData(res,formData) { + // 鎻愬彇鏈夋晥瀛楁锛堟帓闄や笉闇�瑕佺殑灞炴�э紝濡備复鏃跺瓧娈点�侀潪琛ㄥ崟瀛楁锛� + const { id, ...validFormData } = res; // 淇濈暀 id 鍙牴鎹渶姹傝皟鏁� + + // 鐩存帴璧嬪�硷紙鑷姩杩囨护鏃犳晥灞炴�э級 + formData.value = { + ...validFormData, // 鑷姩缁ф壙鎵�鏈夋湁鏁堝瓧娈� + // 濡傞渶棰濆澶勭悊鐗瑰畾瀛楁锛堝鏃ユ湡鏍煎紡鍖栵級锛屽彲鍦ㄦ琛ュ厖 + // plannedStartTime: formatDate(res.plannedStartTime), + }; + } \ No newline at end of file diff --git a/HIAWms/hiawms_web/src/widgets/HIAWms/Views/Pages/WmsMaterial/WmsMaterial.tsx b/HIAWms/hiawms_web/src/widgets/HIAWms/Views/Pages/WmsMaterial/WmsMaterial.tsx index 4ed5702..af9a6ca 100644 --- a/HIAWms/hiawms_web/src/widgets/HIAWms/Views/Pages/WmsMaterial/WmsMaterial.tsx +++ b/HIAWms/hiawms_web/src/widgets/HIAWms/Views/Pages/WmsMaterial/WmsMaterial.tsx @@ -23,7 +23,7 @@ ElFormItem, } from 'element-plus' import { injectModel } from '@/libs/Provider/Provider' -import { FILTER_MODE_OPTIONS_STRING } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' +import { FILTER_MODE_OPTIONS_STRING_KEY } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' import WmsMaterialQueryDrawer from '../Dialog/WmsMaterialQueryDrawer/WmsMaterialQueryDrawer' interface RenderTableType { @@ -123,7 +123,7 @@ onMounted(() => { fetchEnumData() queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode _curHighQueryData.value.str_searchFormInputAttrs = @@ -149,7 +149,7 @@ const resetQuery = () => { queryForm.value.searchVal = '' queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' queryForm.value.str_searchFormInputAttrs = _searchFormInputAttrs.value } //鏂扮増鐨勫鍑烘柟娉� @@ -375,7 +375,7 @@ placeholder="璇烽�夋嫨" class={styles.formItem} > - {FILTER_MODE_OPTIONS_STRING.map((option) => ( + {FILTER_MODE_OPTIONS_STRING_KEY.map((option) => ( <ElOption key={option.value} label={option.label} diff --git a/HIAWms/hiawms_web/src/widgets/HIAWms/Views/Pages/WmsMaterialType/WmsMaterialType.tsx b/HIAWms/hiawms_web/src/widgets/HIAWms/Views/Pages/WmsMaterialType/WmsMaterialType.tsx index 900bc2e..e78955a 100644 --- a/HIAWms/hiawms_web/src/widgets/HIAWms/Views/Pages/WmsMaterialType/WmsMaterialType.tsx +++ b/HIAWms/hiawms_web/src/widgets/HIAWms/Views/Pages/WmsMaterialType/WmsMaterialType.tsx @@ -25,7 +25,7 @@ import { injectModel } from '@/libs/Provider/Provider' // 寮曞叆鍏叡閫夐」閰嶇疆 import { - FILTER_MODE_OPTIONS_STRING + FILTER_MODE_OPTIONS_STRING_KEY } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions'; interface RenderTableType { @@ -101,7 +101,7 @@ // 缁勪欢鎸傝浇鏃惰幏鍙栨灇涓炬暟鎹� onMounted(() => { fetchEnumData() - queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING[0]?.value || ''; + queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || ''; _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode; _curHighQueryData.value.str_searchFormInputAttrs = _searchFormInputAttrs.value; }) @@ -122,7 +122,7 @@ // 鏂扮増鐨勬煡璇㈤噸缃� const resetQuery = () => { queryForm.value.searchVal = '' - queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING[0]?.value || ''; + queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || ''; queryForm.value.str_searchFormInputAttrs=_searchFormInputAttrs.value; } //鏂扮増鐨勫鍑烘柟娉� @@ -337,7 +337,7 @@ placeholder="璇烽�夋嫨" class={styles.formItem} > - {FILTER_MODE_OPTIONS_STRING.map((option) => ( + {FILTER_MODE_OPTIONS_STRING_KEY.map((option) => ( <ElOption key={option.value} label={option.label} diff --git a/HIAWms/hiawms_web/src/widgets/WmsContainer/Views/Pages/WmsContainer/WmsContainer.tsx b/HIAWms/hiawms_web/src/widgets/WmsContainer/Views/Pages/WmsContainer/WmsContainer.tsx index 4abdbe0..165b6b1 100644 --- a/HIAWms/hiawms_web/src/widgets/WmsContainer/Views/Pages/WmsContainer/WmsContainer.tsx +++ b/HIAWms/hiawms_web/src/widgets/WmsContainer/Views/Pages/WmsContainer/WmsContainer.tsx @@ -22,7 +22,7 @@ } from 'element-plus' import { injectModel } from '@/libs/Provider/Provider' // 寮曞叆鍏叡閫夐」閰嶇疆 -import { FILTER_MODE_OPTIONS_STRING } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' +import { FILTER_MODE_OPTIONS_STRING_KEY } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' interface RenderTableType { url?: string @@ -113,7 +113,7 @@ onMounted(() => { fetchEnumData() queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode _curHighQueryData.value.str_searchFormInputAttrs = @@ -139,7 +139,7 @@ const resetQuery = () => { queryForm.value.searchVal = '' queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' queryForm.value.str_searchFormInputAttrs = _searchFormInputAttrs.value } //鏂扮増鐨勫鍑烘柟娉� @@ -365,7 +365,7 @@ placeholder="璇烽�夋嫨" class={styles.formItem} > - {FILTER_MODE_OPTIONS_STRING.map((option) => ( + {FILTER_MODE_OPTIONS_STRING_KEY.map((option) => ( <ElOption key={option.value} label={option.label} diff --git a/HIAWms/hiawms_web/src/widgets/WmsInOutStockOrder/Views/Pages/WmsInOutStockOrder/WmsInOutStockOrder.tsx b/HIAWms/hiawms_web/src/widgets/WmsInOutStockOrder/Views/Pages/WmsInOutStockOrder/WmsInOutStockOrder.tsx index b94bb0c..6958beb 100644 --- a/HIAWms/hiawms_web/src/widgets/WmsInOutStockOrder/Views/Pages/WmsInOutStockOrder/WmsInOutStockOrder.tsx +++ b/HIAWms/hiawms_web/src/widgets/WmsInOutStockOrder/Views/Pages/WmsInOutStockOrder/WmsInOutStockOrder.tsx @@ -27,7 +27,7 @@ } from 'element-plus' import { injectModel } from '@/libs/Provider/Provider' // 寮曞叆鍏叡閫夐」閰嶇疆 -import { FILTER_MODE_OPTIONS_STRING } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' +import { FILTER_MODE_OPTIONS_STRING_KEY } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' interface RenderTableType { url?: string @@ -138,7 +138,7 @@ onMounted(() => { fetchEnumData() queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode _curHighQueryData.value.str_searchFormInputAttrs = @@ -164,7 +164,7 @@ const resetQuery = () => { queryForm.value.searchVal = '' queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' queryForm.value.str_searchFormInputAttrs = _searchFormInputAttrs.value } //鏂扮増鐨勫鍑烘柟娉� @@ -398,7 +398,7 @@ placeholder="璇烽�夋嫨" class={styles.formItem} > - {FILTER_MODE_OPTIONS_STRING.map((option) => ( + {FILTER_MODE_OPTIONS_STRING_KEY.map((option) => ( <ElOption key={option.value} label={option.label} diff --git a/HIAWms/hiawms_web/src/widgets/WmsInOutStockOrderDetail/Views/Pages/WmsInOutStockOrderDetail/WmsInOutStockOrderDetail.tsx b/HIAWms/hiawms_web/src/widgets/WmsInOutStockOrderDetail/Views/Pages/WmsInOutStockOrderDetail/WmsInOutStockOrderDetail.tsx index 54db9ac..003b4ac 100644 --- a/HIAWms/hiawms_web/src/widgets/WmsInOutStockOrderDetail/Views/Pages/WmsInOutStockOrderDetail/WmsInOutStockOrderDetail.tsx +++ b/HIAWms/hiawms_web/src/widgets/WmsInOutStockOrderDetail/Views/Pages/WmsInOutStockOrderDetail/WmsInOutStockOrderDetail.tsx @@ -22,7 +22,7 @@ } from 'element-plus' import { injectModel } from '@/libs/Provider/Provider' // 寮曞叆鍏叡閫夐」閰嶇疆 -import { FILTER_MODE_OPTIONS_STRING } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' +import { FILTER_MODE_OPTIONS_STRING_KEY } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' interface RenderTableType { url?: string @@ -116,7 +116,7 @@ onMounted(() => { fetchEnumData() queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode _curHighQueryData.value.str_searchFormInputAttrs = @@ -142,7 +142,7 @@ const resetQuery = () => { queryForm.value.searchVal = '' queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' queryForm.value.str_searchFormInputAttrs = _searchFormInputAttrs.value } //鏂扮増鐨勫鍑烘柟娉� @@ -369,7 +369,7 @@ placeholder="璇烽�夋嫨" class={styles.formItem} > - {FILTER_MODE_OPTIONS_STRING.map((option) => ( + {FILTER_MODE_OPTIONS_STRING_KEY.map((option) => ( <ElOption key={option.value} label={option.label} diff --git a/HIAWms/hiawms_web/src/widgets/WmsInOutStockRecord/Views/Pages/WmsInOutStockRecord/WmsInOutStockRecord.tsx b/HIAWms/hiawms_web/src/widgets/WmsInOutStockRecord/Views/Pages/WmsInOutStockRecord/WmsInOutStockRecord.tsx index d0fdb69..84af8f7 100644 --- a/HIAWms/hiawms_web/src/widgets/WmsInOutStockRecord/Views/Pages/WmsInOutStockRecord/WmsInOutStockRecord.tsx +++ b/HIAWms/hiawms_web/src/widgets/WmsInOutStockRecord/Views/Pages/WmsInOutStockRecord/WmsInOutStockRecord.tsx @@ -22,7 +22,7 @@ } from 'element-plus' import { injectModel } from '@/libs/Provider/Provider' // 寮曞叆鍏叡閫夐」閰嶇疆 -import { FILTER_MODE_OPTIONS_STRING } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' +import { FILTER_MODE_OPTIONS_STRING_KEY } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' interface RenderTableType { url?: string @@ -119,7 +119,7 @@ onMounted(() => { fetchEnumData() queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode _curHighQueryData.value.str_searchFormInputAttrs = @@ -145,7 +145,7 @@ const resetQuery = () => { queryForm.value.searchVal = '' queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' queryForm.value.str_searchFormInputAttrs = _searchFormInputAttrs.value } //鏂扮増鐨勫鍑烘柟娉� @@ -339,7 +339,7 @@ placeholder="璇烽�夋嫨" class={styles.formItem} > - {FILTER_MODE_OPTIONS_STRING.map((option) => ( + {FILTER_MODE_OPTIONS_STRING_KEY.map((option) => ( <ElOption key={option.value} label={option.label} diff --git a/HIAWms/hiawms_web/src/widgets/WmsMaterialStock/Views/Pages/WmsMaterialStock/WmsMaterialStock.tsx b/HIAWms/hiawms_web/src/widgets/WmsMaterialStock/Views/Pages/WmsMaterialStock/WmsMaterialStock.tsx index 44e5a78..686cd06 100644 --- a/HIAWms/hiawms_web/src/widgets/WmsMaterialStock/Views/Pages/WmsMaterialStock/WmsMaterialStock.tsx +++ b/HIAWms/hiawms_web/src/widgets/WmsMaterialStock/Views/Pages/WmsMaterialStock/WmsMaterialStock.tsx @@ -22,7 +22,7 @@ } from 'element-plus' import { injectModel } from '@/libs/Provider/Provider' // 寮曞叆鍏叡閫夐」閰嶇疆 -import { FILTER_MODE_OPTIONS_STRING } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' +import { FILTER_MODE_OPTIONS_STRING_KEY } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' interface RenderTableType { url?: string @@ -149,7 +149,7 @@ onMounted(() => { fetchEnumData() queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode _curHighQueryData.value.str_searchFormInputAttrs = @@ -175,7 +175,7 @@ const resetQuery = () => { queryForm.value.searchVal = '' queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' queryForm.value.str_searchFormInputAttrs = _searchFormInputAttrs.value } //鏂扮増鐨勫鍑烘柟娉� @@ -412,7 +412,7 @@ placeholder="璇烽�夋嫨" class={styles.formItem} > - {FILTER_MODE_OPTIONS_STRING.map((option) => ( + {FILTER_MODE_OPTIONS_STRING_KEY.map((option) => ( <ElOption key={option.value} label={option.label} diff --git a/HIAWms/hiawms_web/src/widgets/WmsMaterialStock/Views/Pages/WmsMaterialStockDetail/WmsMaterialStockDetail.tsx b/HIAWms/hiawms_web/src/widgets/WmsMaterialStock/Views/Pages/WmsMaterialStockDetail/WmsMaterialStockDetail.tsx index 16ba4de..135caf0 100644 --- a/HIAWms/hiawms_web/src/widgets/WmsMaterialStock/Views/Pages/WmsMaterialStockDetail/WmsMaterialStockDetail.tsx +++ b/HIAWms/hiawms_web/src/widgets/WmsMaterialStock/Views/Pages/WmsMaterialStockDetail/WmsMaterialStockDetail.tsx @@ -21,7 +21,7 @@ } from 'element-plus' import { injectModel } from '@/libs/Provider/Provider' // 寮曞叆鍏叡閫夐」閰嶇疆 -import { FILTER_MODE_OPTIONS_STRING } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' +import { FILTER_MODE_OPTIONS_STRING_KEY } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' interface RenderTableType { url?: string @@ -149,7 +149,7 @@ onMounted(() => { fetchEnumData() queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode _curHighQueryData.value.str_searchFormInputAttrs = @@ -175,7 +175,7 @@ const resetQuery = () => { queryForm.value.searchVal = '' queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' queryForm.value.str_searchFormInputAttrs = _searchFormInputAttrs.value } //鏂扮増鐨勫鍑烘柟娉� @@ -379,7 +379,7 @@ placeholder="璇烽�夋嫨" class={styles.formItem} > - {FILTER_MODE_OPTIONS_STRING.map((option) => ( + {FILTER_MODE_OPTIONS_STRING_KEY.map((option) => ( <ElOption key={option.value} label={option.label} diff --git a/HIAWms/hiawms_web/src/widgets/WmsStoreInfo/Views/Pages/WmsArea/WmsArea.tsx b/HIAWms/hiawms_web/src/widgets/WmsStoreInfo/Views/Pages/WmsArea/WmsArea.tsx index 3765110..5506b5c 100644 --- a/HIAWms/hiawms_web/src/widgets/WmsStoreInfo/Views/Pages/WmsArea/WmsArea.tsx +++ b/HIAWms/hiawms_web/src/widgets/WmsStoreInfo/Views/Pages/WmsArea/WmsArea.tsx @@ -15,7 +15,7 @@ getStoreDataList, } from '@/widgets/HIAWms/Models/Service/WmsMaterialDrawer' // 寮曞叆鍏叡閫夐」閰嶇疆 -import { FILTER_MODE_OPTIONS_STRING } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' +import { FILTER_MODE_OPTIONS_STRING_KEY } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' import WmsAreaQueryDrawer from '../Dialog/WmsAreaQueryDrawer/WmsAreaQueryDrawer' interface RenderTableType { @@ -107,7 +107,7 @@ onMounted(() => { fetchEnumData() queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode _curHighQueryData.value.str_searchFormInputAttrs = @@ -133,7 +133,7 @@ const resetQuery = () => { queryForm.value.searchVal = '' queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' queryForm.value.str_searchFormInputAttrs = _searchFormInputAttrs.value } //鏂扮増鐨勫鍑烘柟娉� @@ -306,7 +306,7 @@ placeholder="璇烽�夋嫨" class={styles.formItem} > - {FILTER_MODE_OPTIONS_STRING.map((option) => ( + {FILTER_MODE_OPTIONS_STRING_KEY.map((option) => ( <ElOption key={option.value} label={option.label} diff --git a/HIAWms/hiawms_web/src/widgets/WmsStoreInfo/Views/Pages/WmsPlace/WmsPlace.tsx b/HIAWms/hiawms_web/src/widgets/WmsStoreInfo/Views/Pages/WmsPlace/WmsPlace.tsx index 733d1d8..fd6739d 100644 --- a/HIAWms/hiawms_web/src/widgets/WmsStoreInfo/Views/Pages/WmsPlace/WmsPlace.tsx +++ b/HIAWms/hiawms_web/src/widgets/WmsStoreInfo/Views/Pages/WmsPlace/WmsPlace.tsx @@ -16,7 +16,7 @@ getAisleDataList, } from '@/widgets/HIAWms/Models/Service/WmsMaterialDrawer' // 寮曞叆鍏叡閫夐」閰嶇疆 -import { FILTER_MODE_OPTIONS_STRING } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' +import { FILTER_MODE_OPTIONS_STRING_KEY } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' import WmsPlaceQueryDrawer from '../Dialog/WmsPlaceQueryDrawer/WmsPlaceQueryDrawer' interface RenderTableType { @@ -121,7 +121,7 @@ onMounted(() => { fetchEnumData() queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode _curHighQueryData.value.str_searchFormInputAttrs = @@ -147,7 +147,7 @@ const resetQuery = () => { queryForm.value.searchVal = '' queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' queryForm.value.str_searchFormInputAttrs = _searchFormInputAttrs.value } //鏂扮増鐨勫鍑烘柟娉� @@ -332,7 +332,7 @@ placeholder="璇烽�夋嫨" class={styles.formItem} > - {FILTER_MODE_OPTIONS_STRING.map((option) => ( + {FILTER_MODE_OPTIONS_STRING_KEY.map((option) => ( <ElOption key={option.value} label={option.label} diff --git a/HIAWms/hiawms_web/src/widgets/WmsStoreInfo/Views/Pages/WmsStore/WmsStore.tsx b/HIAWms/hiawms_web/src/widgets/WmsStoreInfo/Views/Pages/WmsStore/WmsStore.tsx index cbda8f9..bd30bdd 100644 --- a/HIAWms/hiawms_web/src/widgets/WmsStoreInfo/Views/Pages/WmsStore/WmsStore.tsx +++ b/HIAWms/hiawms_web/src/widgets/WmsStoreInfo/Views/Pages/WmsStore/WmsStore.tsx @@ -11,7 +11,7 @@ import { vPermission } from '@/libs/Permission/Permission' import { ElForm, ElFormItem, ElInput, ElOption, ElSelect } from 'element-plus' import { getWmsEnumData } from '@/widgets/HIAWms/Models/Service/WmsMaterialDrawer' -import { FILTER_MODE_OPTIONS_STRING } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' +import { FILTER_MODE_OPTIONS_STRING_KEY } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' import WmsStoreQueryDrawer from '../Dialog/WmsStoreQueryDrawer/WmsStoreQueryDrawer' interface RenderTableType { @@ -86,7 +86,7 @@ onMounted(() => { fetchEnumData() queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode _curHighQueryData.value.str_searchFormInputAttrs = @@ -112,7 +112,7 @@ const resetQuery = () => { queryForm.value.searchVal = '' queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' queryForm.value.str_searchFormInputAttrs = _searchFormInputAttrs.value } //鏂扮増鐨勫鍑烘柟娉� @@ -286,7 +286,7 @@ placeholder="璇烽�夋嫨" class={styles.formItem} > - {FILTER_MODE_OPTIONS_STRING.map((option) => ( + {FILTER_MODE_OPTIONS_STRING_KEY.map((option) => ( <ElOption key={option.value} label={option.label} diff --git a/HIAWms/hiawms_web/src/widgets/WmsTask/Views/Pages/WmsTask/WmsTask.tsx b/HIAWms/hiawms_web/src/widgets/WmsTask/Views/Pages/WmsTask/WmsTask.tsx index be3f592..7ce7e00 100644 --- a/HIAWms/hiawms_web/src/widgets/WmsTask/Views/Pages/WmsTask/WmsTask.tsx +++ b/HIAWms/hiawms_web/src/widgets/WmsTask/Views/Pages/WmsTask/WmsTask.tsx @@ -22,7 +22,7 @@ ElFormItem, } from 'element-plus' import { injectModel } from '@/libs/Provider/Provider' -import { FILTER_MODE_OPTIONS_STRING } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' +import { FILTER_MODE_OPTIONS_STRING_KEY } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions' interface RenderTableType { url?: string @@ -139,7 +139,7 @@ onMounted(() => { fetchEnumData() queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode _curHighQueryData.value.str_searchFormInputAttrs = @@ -165,7 +165,7 @@ const resetQuery = () => { queryForm.value.searchVal = '' queryForm.value.searchVal_FilterMode = - FILTER_MODE_OPTIONS_STRING[0]?.value || '' + FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || '' queryForm.value.str_searchFormInputAttrs = _searchFormInputAttrs.value } //鏂扮増鐨勫鍑烘柟娉� @@ -367,7 +367,7 @@ placeholder="璇烽�夋嫨" class={styles.formItem} > - {FILTER_MODE_OPTIONS_STRING.map((option) => ( + {FILTER_MODE_OPTIONS_STRING_KEY.map((option) => ( <ElOption key={option.value} label={option.label} diff --git a/PipeLineLems/pipelinelems_web/src/components/BaseQueryDrawer/BaseQueryDrawer.tsx b/PipeLineLems/pipelinelems_web/src/components/BaseQueryDrawer/BaseQueryDrawer.tsx index 9d144bb..9c82177 100644 --- a/PipeLineLems/pipelinelems_web/src/components/BaseQueryDrawer/BaseQueryDrawer.tsx +++ b/PipeLineLems/pipelinelems_web/src/components/BaseQueryDrawer/BaseQueryDrawer.tsx @@ -6,7 +6,7 @@ [key: string]: any }>({ // @ts-ignore - name: 'BaseDrawer', + name: 'BaseQueryDrawer', props: { // 閬僵鏄惁鍙偣鍑� clickable: { @@ -49,6 +49,8 @@ > <el-drawer // modal-class={props.clickable ? styles.modal : ''} + //灏嗘娊灞夊己鍒舵寕杞藉埌 body 鍏冪礌涓婏紝纭繚鏍峰紡闅旂鍜屾粴鍔ㄨ涓烘甯革紝涓嶅彈宓屽椤甸潰鐨勫奖鍝� + append-to-body="true" class={{ [styles.informationDrawer]: true, // [styles.informationDrawerPosition]: props.clickable, diff --git a/PipeLineLems/pipelinelems_web/src/components/DyFormForHighQuery/DyFormForHighQuery.module.scss b/PipeLineLems/pipelinelems_web/src/components/DyFormForHighQuery/DyFormForHighQuery.module.scss index 0fff059..0281c01 100644 --- a/PipeLineLems/pipelinelems_web/src/components/DyFormForHighQuery/DyFormForHighQuery.module.scss +++ b/PipeLineLems/pipelinelems_web/src/components/DyFormForHighQuery/DyFormForHighQuery.module.scss @@ -1,15 +1,4 @@ .formStyle { - .formItem { - // 绉婚櫎鍥哄畾瀹藉害闄愬埗 - width: auto !important; - margin-right: 0 !important; - } - - .formControl { - flex: 1; // 璁╂帶浠跺崰鎹墿浣欑┖闂� - min-width: 0; // 鍏佽鎺т欢鏀剁缉 - } - .formItemLabel { display: inline-flex; justify-content: flex-end; @@ -25,17 +14,30 @@ margin-left: 10px; } } - :global(.cs-select) { width: 100%; } - - // 绉婚櫎鍥哄畾瀹藉害璁剧疆 :global(.cs-form--inline .cs-form-item) { - width: auto !important; + width: 46%; } - :global(.cs-form--inline .cs-form-item:nth-last-of-type(2n)) { - margin-right: 0 !important; + margin-right: 0; } -} \ No newline at end of file + :global(.cs-date-editor) { + width: 100%; + } +} +.optionLabel { + display: flex; + justify-content: space-between; + align-items: center; +} +.formitemPropsLabel { + display: flex; + justify-content: flex-start; + align-items: center; +} + +.itemDistance { + margin-bottom: 20px !important; +} diff --git a/PipeLineLems/pipelinelems_web/src/components/DyFormForHighQuery/DyFormForHighQueryOptions.js b/PipeLineLems/pipelinelems_web/src/components/DyFormForHighQuery/DyFormForHighQueryOptions.js index e70f08b..5c8ca3d 100644 --- a/PipeLineLems/pipelinelems_web/src/components/DyFormForHighQuery/DyFormForHighQueryOptions.js +++ b/PipeLineLems/pipelinelems_web/src/components/DyFormForHighQuery/DyFormForHighQueryOptions.js @@ -2,8 +2,14 @@ export const FILTER_MODE_OPTIONS_STRING = [ { label: '妯$硦鏌ヨ', value: 1 }, { label: '绮惧噯鏌ヨ', value: 2 }, - ]; - // 鏁板瓧绫绘煡璇� + { label: '涓嶇瓑浜�', value: 7 }, +]; +// 瀛楃涓茬被鏌ヨ(鍏抽敭瀛楁煡璇笓鐢�) +export const FILTER_MODE_OPTIONS_STRING_KEY = [ + { label: '妯$硦鏌ヨ', value: 1 }, + { label: '绮惧噯鏌ヨ', value: 2 }, +]; +// 鏁板瓧绫绘煡璇� export const FILTER_MODE_OPTIONS_NUM = [ { label: '绮惧噯鏌ヨ', value: 2 }, { label: '澶т簬绛変簬', value: 3 }, @@ -11,9 +17,9 @@ { label: '澶т簬', value: 5 }, { label: '灏忎簬', value: 6 }, { label: '涓嶇瓑浜�', value: 7 }, - ]; - // bool鏌ヨ +]; +// bool鏌ヨ export const FILTER_MODE_OPTIONS_BOOL = [ { label: '绮惧噯鏌ヨ', value: 2 }, { label: '涓嶇瓑浜�', value: 7 }, - ]; +]; diff --git a/PipeLineLems/pipelinelems_web/src/utils/myHighQueryUtils.ts b/PipeLineLems/pipelinelems_web/src/utils/myHighQueryUtils.ts new file mode 100644 index 0000000..52e90cc --- /dev/null +++ b/PipeLineLems/pipelinelems_web/src/utils/myHighQueryUtils.ts @@ -0,0 +1,113 @@ + +//楂樼骇鏌ヨ宸ュ叿鏂囦欢 + + /** + * 淇濆瓨褰撳墠楂樼骇鏌ヨ鏁版嵁锛屽悎骞惰繃婊ゅ悗鐨勬暟鎹苟鏇存柊鍝嶅簲寮忔煡璇㈠璞� + * @param {Object} filteredData - 杩囨护鍚庣殑鏌ヨ鏁版嵁瀵硅薄锛屽寘鍚敤鎴疯緭鍏ョ殑鏌ヨ鏉′欢 + * @param {Ref<Object>} _curHighQueryData - Vue鍝嶅簲寮忓璞★紝瀛樺偍褰撳墠瀹屾暣鐨勬煡璇㈡潯浠� + * @param {Ref<Object>} queryForm - Vue鍝嶅簲寮忓璞★紝瀛樺偍琛ㄥ崟杈撳叆鐨勬煡璇㈡潯浠� + * @param {Ref<string>} _searchFormInputAttrs - Vue鍝嶅簲寮忓瓧绗︿覆锛屽瓨鍌ㄦ煡璇㈣〃鍗曠殑杈撳叆灞炴�ч厤缃� + * @returns {void} + * @example + * commonSaveCurHighQueryData( + * { name: 'John', age: 30 }, + * ref({}), + * ref({ searchVal: '', searchVal_FilterMode: 'contains' }), + * ref('name,age,email') + * ); + */ +export const commonSaveCurHighQueryData = (filteredData, _curHighQueryData, queryForm, _searchFormInputAttrs) => { + _curHighQueryData.value = { ..._curHighQueryData.value, ...filteredData }; + setValueForCurHighQueryData(_curHighQueryData, queryForm, _searchFormInputAttrs); +} + +/** + * 涓哄搷搴斿紡鏌ヨ鏁版嵁瀵硅薄璁剧疆鍩虹鏌ヨ鍊� + * @param {Ref<Object>} _curHighQueryData - Vue鍝嶅簲寮忓璞★紝瀛樺偍褰撳墠瀹屾暣鐨勬煡璇㈡潯浠� + * @param {Ref<Object>} queryForm - Vue鍝嶅簲寮忓璞★紝瀛樺偍琛ㄥ崟杈撳叆鐨勬煡璇㈡潯浠� + * @param {Ref<string>} _searchFormInputAttrs - Vue鍝嶅簲寮忓瓧绗︿覆锛屽瓨鍌ㄦ煡璇㈣〃鍗曠殑杈撳叆灞炴�ч厤缃� + * @returns {void} + * @example + * setValueForCurHighQueryData( + * ref({}), + * ref({ searchVal: 'test', searchVal_FilterMode: 'equals' }), + * ref('name,age') + * ); + * // _curHighQueryData.value 灏嗗寘鍚� searchVal, searchVal_FilterMode 鍜� str_searchFormInputAttrs + */ +export const setValueForCurHighQueryData = (_curHighQueryData, queryForm, _searchFormInputAttrs) => { + _curHighQueryData.value.searchVal = queryForm.value.searchVal; + _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode; + _curHighQueryData.value.str_searchFormInputAttrs = _searchFormInputAttrs.value; +} + +/** + * 鍒濆鍖栨煡璇㈣〃鍗曪紝璁剧疆榛樿鍊� + * @param {Ref<Object>} queryForm - Vue鍝嶅簲寮忓璞★紝瀛樺偍琛ㄥ崟杈撳叆鐨勬煡璇㈡潯浠� + * @param {Ref<string>} _searchFormInputAttrs - Vue鍝嶅簲寮忓瓧绗︿覆锛屽瓨鍌ㄦ煡璇㈣〃鍗曠殑杈撳叆灞炴�ч厤缃� + * @param {Array<Object>} arr - 杩囨护妯″紡閫夐」鏁扮粍锛屾瘡涓�夐」鍖呭惈value鍜宭abel灞炴�� + * @returns {void} + * @example + * initQueryForm( + * ref({}), + * ref('name,age'), + * [{ value: 'contains', label: '鍖呭惈' }, { value: 'equals', label: '绛変簬' }] + * ); + * // queryForm.value 灏嗚鍒濆鍖栦负 { searchVal: '', searchVal_FilterMode: 'contains', str_searchFormInputAttrs: 'name,age' } + */ +export const initQueryForm = (queryForm, _searchFormInputAttrs, arr) => { + queryForm.value.searchVal = ''; + queryForm.value.searchVal_FilterMode = arr[0]?.value || ''; + queryForm.value.str_searchFormInputAttrs = _searchFormInputAttrs.value; +} + +/** + * 鑾峰彇楂樼骇鏌ヨ寮瑰嚭妗嗙殑鏌ヨ鍊硷紝杩囨护鏃犳晥鏁版嵁骞剁粍鍚堝畬鏁存煡璇㈡潯浠� + * @param {Object} extraParams - 棰濆鐨勬煡璇㈠弬鏁板璞★紝鍙兘鍖呭惈鐗规畩鏌ヨ鏉′欢 + * @param {Ref<Object>} queryForm - Vue鍝嶅簲寮忓璞★紝瀛樺偍琛ㄥ崟杈撳叆鐨勬煡璇㈡潯浠� + * @param {Ref<string>} _searchFormInputAttrs - Vue鍝嶅簲寮忓瓧绗︿覆锛屽瓨鍌ㄦ煡璇㈣〃鍗曠殑杈撳叆灞炴�ч厤缃� + * @returns {Object} 缁勫悎鍚庣殑鏈夋晥鏌ヨ鏁版嵁瀵硅薄 + * @example + * const queryData = commonGetHighQueryForm( + * { status: 'active', category: 'books' }, + * ref({ searchVal: 'javascript', searchVal_FilterMode: 'contains' }), + * ref('title,author') + * ); + * // 杩斿洖 { status: 'active', category: 'books', searchVal: 'javascript', searchVal_FilterMode: 'contains', str_searchFormInputAttrs: 'title,author' } + */ +export const commonGetHighQueryForm = (extraParams, queryForm, _searchFormInputAttrs) => { + // 杩囨护鎺� undefined 鐨勫�� + let filteredData = Object.assign( + {}, + ...Object.entries(extraParams).map(([key, value]) => + value !== undefined ? { [key]: value } : {} + ) + ); + // 缁勫悎妯$硦鏌ヨ + filteredData.searchVal = queryForm.value.searchVal; + filteredData.searchVal_FilterMode = queryForm.value.searchVal_FilterMode; + filteredData.str_searchFormInputAttrs = _searchFormInputAttrs.value; + return filteredData; +} + +/** + * 鏂扮増鐨勬煡璇㈠脊鍑烘鍏抽棴鏂规硶锛岃幏鍙栬繃婊ゆ暟鎹苟淇濆瓨鍒板搷搴斿紡瀵硅薄 + * @param {Object} extraParams - 棰濆鐨勬煡璇㈠弬鏁板璞★紝鍙兘鍖呭惈鐗规畩鏌ヨ鏉′欢 + * @param {Ref<Object>} queryForm - Vue鍝嶅簲寮忓璞★紝瀛樺偍琛ㄥ崟杈撳叆鐨勬煡璇㈡潯浠� + * @param {Ref<string>} _searchFormInputAttrs - Vue鍝嶅簲寮忓瓧绗︿覆锛屽瓨鍌ㄦ煡璇㈣〃鍗曠殑杈撳叆灞炴�ч厤缃� + * @param {Ref<Object>} _curHighQueryData - Vue鍝嶅簲寮忓璞★紝瀛樺偍褰撳墠瀹屾暣鐨勬煡璇㈡潯浠� + * @returns {Object} 缁勫悎鍚庣殑鏈夋晥鏌ヨ鏁版嵁瀵硅薄 + * @example + * const queryData = GetFilteredData( + * { type: 'article' }, + * ref({ searchVal: 'news', searchVal_FilterMode: 'startsWith' }), + * ref('title,content'), + * ref({}) + * ); + * // 杩斿洖鏈夋晥鏌ヨ鏁版嵁骞舵洿鏂� _curHighQueryData + */ +export const GetFilteredData = (extraParams, queryForm, _searchFormInputAttrs, _curHighQueryData) => { + let filteredData = commonGetHighQueryForm(extraParams, queryForm, _searchFormInputAttrs); + commonSaveCurHighQueryData(filteredData, _curHighQueryData, queryForm, _searchFormInputAttrs); + return filteredData; +} \ No newline at end of file diff --git a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Views/Pages/CallMaterialOrder/CallMaterialOrder.tsx b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Views/Pages/CallMaterialOrder/CallMaterialOrder.tsx index acc6a18..19dfc6c 100644 --- a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Views/Pages/CallMaterialOrder/CallMaterialOrder.tsx +++ b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrder/Views/Pages/CallMaterialOrder/CallMaterialOrder.tsx @@ -14,6 +14,12 @@ import { getWmsEnumData } from '@/widgets/CallMaterialOrder/Models/Service/CallMaterialOrderDrawer' +// 寮曞叆鍏叡閫夐」閰嶇疆 +import { + FILTER_MODE_OPTIONS_STRING_KEY +} from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions'; +// 寮曞叆鍏叡楂樼骇鏌ヨ宸ュ叿鏂囦欢 +import { commonSaveCurHighQueryData,setValueForCurHighQueryData,commonGetHighQueryForm,initQueryForm,GetFilteredData } from '@/utils/myHighQueryUtils'; import { ElInput, ElSelect, @@ -66,11 +72,7 @@ //瀹氫箟楂樼骇鏌ヨ寮曠敤 const callMaterialOrderQueryDrawerRef=ref(null); - // 鏂板鐨勬煡璇㈡潯浠� - const queryForm = ref({ - searchVal: '', - str_searchFormInputAttrs:[] - }) + //瀹氫箟鏁翠綋妯$硦鏌ヨ鐨勫垪鏁扮粍(娉ㄦ剰锛氬繀椤诲ぇ灏忓啓璺熷悗绔殑瀹炰綋绫诲睘鎬у悕涓�鑷达紝鍚﹀垯浼氬鑷村尮閰嶄笉瀵圭殑闂) const _searchFormInputAttrs = ref([ 'DataIdentifier','MaterialMode','WmsRetResult','WmsTaskNo','CreatorName','LastModifierName','Remark' @@ -98,62 +100,40 @@ console.error('鑾峰彇鏋氫妇鏁版嵁澶辫触:', error) } } - - // 缁勪欢鎸傝浇鏃惰幏鍙栨灇涓炬暟鎹� - onMounted(() => { - fetchEnumData() - }) - - // 瀹氫箟鍝嶅簲寮忔煡璇㈡暟鎹� - const _curHighQueryData = ref({ searchVal: '',str_searchFormInputAttrs:[] }); - // 鏂扮増鐨勬煡璇㈡柟娉曪紙涓婚〉闈腑鐨勬寜閽�愭煡璇€�戯級 - const handleQueryForMain = async () => { - _curHighQueryData.value.searchVal = queryForm.value.searchVal; - _curHighQueryData.value.str_searchFormInputAttrs = _searchFormInputAttrs.value; - tableRef.value.getList(_curHighQueryData.value) - } - // 鏂扮増鐨勬煡璇㈡柟娉曪紙楂樼骇鏌ヨ涓殑鎸夐挳銆愭煡璇€�戯級 - const handleQuery = async (extraParams = {}) => { - let filteredData = commonGetHighQueryForm(extraParams); - commonSaveCurHighQueryData(filteredData); - tableRef.value.getList(filteredData) - } - // 鏂扮増鐨勬煡璇㈤噸缃� - const resetQuery = () => { - queryForm.value.searchVal = '' - queryForm.value.str_searchFormInputAttrs=_searchFormInputAttrs.value; - } - //鏂扮増鐨勫鍑烘柟娉� - const handleExport=()=>{ - onExport(_curHighQueryData.value); - } - // 鏂扮増鐨勬煡璇㈠脊鍑烘鍏抽棴鏂规硶 - const closeQuery = (extraParams={}) => { - let filteredData = commonGetHighQueryForm(extraParams); - console.log("closeQuery鏂规硶"); - console.log(filteredData); - commonSaveCurHighQueryData(filteredData); - } - //淇濆瓨鏌ヨ鍊� - const commonSaveCurHighQueryData=(filteredData={})=>{ - _curHighQueryData.value = { ..._curHighQueryData.value, ...filteredData }; - _curHighQueryData.value.searchVal = queryForm.value.searchVal - _curHighQueryData.value.str_searchFormInputAttrs =_searchFormInputAttrs.value; - } - //鑾峰彇楂樼骇鏌ヨ寮瑰嚭妗嗙殑鏌ヨ鍊� - const commonGetHighQueryForm=(extraParams={})=>{ - // 杩囨护鎺� undefined 鐨勫�� - let filteredData = Object.assign( - {}, - ...Object.entries(extraParams).map(([key, value]) => - value !== undefined ? { [key]: value } : {} - ) - ) - //缁勫悎妯$硦鏌ヨ - filteredData.searchVal = queryForm.value.searchVal - filteredData.str_searchFormInputAttrs =_searchFormInputAttrs.value; - return filteredData; - } + // 缁勪欢鎸傝浇鏃惰幏鍙栨灇涓炬暟鎹� + onMounted(() => { + fetchEnumData() + resetQuery(); + }) + /*******************************************************[楂樼骇鏌ヨ]寮�濮�********************************************************************************* */ + // 鏂板鐨勬煡璇㈡潯浠� + const queryForm = ref({ searchVal: '',str_searchFormInputAttrs:[],searchVal_FilterMode:'' }); + // 瀹氫箟鍝嶅簲寮忔煡璇㈡暟鎹� + const _curHighQueryData = ref({ searchVal: '',str_searchFormInputAttrs:[],searchVal_FilterMode:'' }); + // 鏂扮増鐨勬煡璇㈡柟娉曪紙涓婚〉闈腑鐨勬寜閽�愭煡璇€�戯級 + const handleQueryForMain = async () => { + setValueForCurHighQueryData(_curHighQueryData,queryForm,_searchFormInputAttrs); + tableRef.value.getList(_curHighQueryData.value) + } + // 鏂扮増鐨勬煡璇㈡柟娉曪紙楂樼骇鏌ヨ涓殑鎸夐挳銆愭煡璇€�戯級 + const handleQuery = async (extraParams = {}) => { + let filteredData = GetFilteredData(extraParams,queryForm,_searchFormInputAttrs,_curHighQueryData); + tableRef.value.getList(filteredData) + } + // 鏂扮増鐨勬煡璇㈤噸缃� + const resetQuery = () => { + initQueryForm(queryForm,_searchFormInputAttrs,FILTER_MODE_OPTIONS_STRING_KEY); + setValueForCurHighQueryData(_curHighQueryData,queryForm,_searchFormInputAttrs); + } + //鏂扮増鐨勫鍑烘柟娉� + const handleExport=()=>{ + onExport(_curHighQueryData.value); + } + // 鏂扮増鐨勬煡璇㈠脊鍑烘鍏抽棴鏂规硶 + const closeQuery = (extraParams={}) => { + GetFilteredData(extraParams,queryForm,_searchFormInputAttrs,_curHighQueryData); + } + /*******************************************************[楂樼骇鏌ヨ]缁撴潫********************************************************************************* */ /** @@ -335,6 +315,21 @@ /> </el-tooltip> </ElFormItem> + <ElFormItem label="" style="width:100px;"> + <ElSelect + v-model={queryForm.value.searchVal_FilterMode} + placeholder="璇烽�夋嫨" + class={styles.formItem} + > + {FILTER_MODE_OPTIONS_STRING_KEY.map((option) => ( + <ElOption + key={option.value} + label={option.label} + value={option.value} + /> + ))} + </ElSelect> + </ElFormItem> <IconButton type="primary" icon="search" onClick={handleQueryForMain}> 鏌ヨ </IconButton> diff --git a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/CallMaterialOrderRecord/CallMaterialOrderRecord.tsx b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/CallMaterialOrderRecord/CallMaterialOrderRecord.tsx index 0957ae4..42e4ad1 100644 --- a/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/CallMaterialOrderRecord/CallMaterialOrderRecord.tsx +++ b/PipeLineLems/pipelinelems_web/src/widgets/CallMaterialOrderRecord/Views/Pages/CallMaterialOrderRecord/CallMaterialOrderRecord.tsx @@ -25,7 +25,7 @@ import { injectModel } from '@/libs/Provider/Provider' // 寮曞叆鍏叡閫夐」閰嶇疆 import { - FILTER_MODE_OPTIONS_STRING + FILTER_MODE_OPTIONS_STRING_KEY } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions'; interface RenderTableType { @@ -108,7 +108,7 @@ // 缁勪欢鎸傝浇鏃惰幏鍙栨灇涓炬暟鎹� onMounted(() => { fetchEnumData() - queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING[0]?.value || ''; + queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || ''; _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode; _curHighQueryData.value.str_searchFormInputAttrs = _searchFormInputAttrs.value; }) @@ -129,7 +129,7 @@ // 鏂扮増鐨勬煡璇㈤噸缃� const resetQuery = () => { queryForm.value.searchVal = '' - queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING[0]?.value || ''; + queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING_KEY[0]?.value || ''; queryForm.value.str_searchFormInputAttrs=_searchFormInputAttrs.value; } //鏂扮増鐨勫鍑烘柟娉� @@ -337,7 +337,7 @@ placeholder="璇烽�夋嫨" class={styles.formItem} > - {FILTER_MODE_OPTIONS_STRING.map((option) => ( + {FILTER_MODE_OPTIONS_STRING_KEY.map((option) => ( <ElOption key={option.value} label={option.label} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssembly.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssembly.ts index 1c9df89..0b661fd 100644 --- a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssembly.ts +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Controllers/PipeAccessoryAssembly.ts @@ -1,6 +1,6 @@ import { ref, onMounted, reactive, Ref, nextTick, computed } from 'vue' import { injectModel } from '@/libs/Provider/Provider' -import { WmsMaterialContainer } from '../Models/PipeAccessoryAssembly' +import { PipeAccessoryAssembly } from '../Models/PipeAccessoryAssembly' import { ElMessage } from 'element-plus' import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' import { useFile } from './File' @@ -9,8 +9,8 @@ row: any index: number } -export const useWmsMaterialContainer = (props: any, ctx?: any) => { - const wmsMaterialContainer = injectModel<WmsMaterialContainer>('wmsMaterialContainer') +export const usePipeAccessoryAssembly = (props: any, ctx?: any) => { + const PipeAccessoryAssembly = injectModel<PipeAccessoryAssembly>('PipeAccessoryAssembly') const { exportFile } = useFile() /** * 澶撮儴閰嶇疆 @@ -19,7 +19,7 @@ /** * 鍔ㄦ�佸垪閰嶇疆 */ - const wmsMaterialContainerColumns = ref<Record<string, any>>([]) + const PipeAccessoryAssemblyColumns = ref<Record<string, any>>([]) /** * 鎼滅储鍊� */ @@ -118,7 +118,7 @@ // { // label: '鍒涘缓鍓湰', // fn: async ({ row }: CurrentType) => { - // await wmsMaterialContainer.cloneData([row.id]) + // await PipeAccessoryAssembly.cloneData([row.id]) // ElMessage.success('鍒涘缓鍓湰鎴愬姛') // tableRef.value?.getList() // }, @@ -133,7 +133,7 @@ `鏄惁鍒犻櫎${names.length ? names.join(',') : c.row.materialId}` ).then(async () => { const ids = selection.value.map((item: { id: string }) => item.id) - await wmsMaterialContainer.deleteWmsMaterialContainers(ids.length ? ids : [c.row.id]) + await PipeAccessoryAssembly.deletePipeAccessoryAssemblys(ids.length ? ids : [c.row.id]) ElMessage.success('鍒犻櫎鎴愬姛') tableRef.value.getList() }) @@ -142,11 +142,77 @@ }, ] + + //涓嬪彂娉曞叞鍐茬爜 + const onSendFlangeCode = () => { + const names = selection.value.map((item: { dataIdentifier: string }) => item.dataIdentifier) + if(names.length==0){ + ElMessage.warning('璇烽�夋嫨涓�鏉¤褰�'); + return; + } + if(names.length>1){ + ElMessage.warning('璇峰彧鑳介�夋嫨涓�鏉¤褰�'); + return; + } + ConfirmBox( + `鏄惁瑕佷笅鍙戞硶鍏板啿鐮�${names.length ? names.join(',') : ''}` + ).then(async () => { + // 鑾峰彇閫変腑鐨勭涓�鏉¤褰� + const selectedItem = selection.value[0]; + + // 鏋勫缓鍙傛暟瀵硅薄 + const param = { + Son_TaskCode: selectedItem.son_TaskCode || '', // 瀛愪换鍔$紪鍙� + TaskCode: selectedItem.taskCode || '', // 浠诲姟缂栧彿 + PipeSpecCode: selectedItem.pipeSpecCode || '',// 绠℃缂栫爜 + }; + + var ret= await PipeAccessoryAssembly.sendFlangeCode(param) + if(ret.code=="200"){ + ElMessage.success('涓嬪彂鎴愬姛') + tableRef.value.getList() + }else{ + ElMessage.error('涓嬪彂澶辫触:'+ret.message) + } + }) + } + //娉曞叞鍐茬爜瀹屽伐 + const onFinishSendFlangeCode = () => { + const names = selection.value.map((item: { dataIdentifier: string }) => item.dataIdentifier) + if(names.length==0){ + ElMessage.warning('璇烽�夋嫨涓�鏉¤褰�'); + return; + } + if(names.length>1){ + ElMessage.warning('璇峰彧鑳介�夋嫨涓�鏉¤褰�'); + return; + } + ConfirmBox( + `鏄惁瑕佸畬宸ユ硶鍏板啿鐮�${names.length ? names.join(',') : ''}` + ).then(async () => { + // 鑾峰彇閫変腑鐨勭涓�鏉¤褰� + const selectedItem = selection.value[0]; + + // 鏋勫缓鍙傛暟瀵硅薄 + const param = { + processName: selectedItem.processName || '', // 浠诲姟缂栧彿 + PipeSpecCode: selectedItem.pipeSpecCode || '',// 绠℃缂栫爜 + }; + + var ret= await PipeAccessoryAssembly.finishSendFlangeCode(param) + if(ret.code=="200"){ + ElMessage.success('瀹屽伐娉曞叞鍐茬爜鎴愬姛') + tableRef.value.getList() + }else{ + ElMessage.error('瀹屽伐娉曞叞鍐茬爜澶辫触:'+ret.message) + } + }) + } const onCheck = (records: any) => { selection.value = records } - const onAddWmsMaterialContainer = () => { + const onAddPipeAccessoryAssembly = () => { const params = tableRef.value?.getPaginationParams() current.value = null dialogConfig.visible = true @@ -164,7 +230,7 @@ dialogConfigForQuery.title = '楂樼骇鏌ヨ' } - const onConfirmWmsMaterialContainer = async () => { + const onConfirmPipeAccessoryAssembly = async () => { dialogConfig.visible = false if (dialogConfig.isAdd) { tableRef.value?.scrollToRow({ @@ -187,7 +253,7 @@ */ const onExport = (data={}) => { //const params = tableRef.value?.getParams() - exportFile('/api/v1/HIAWms/wmsMaterialContainer/export', data, 'wmsMaterialContainer') + exportFile('/api/v1/HIAWms/PipeAccessoryAssembly/export', data, 'PipeAccessoryAssembly') } /** @@ -257,7 +323,7 @@ current, search, sort, - wmsMaterialContainerColumns, + PipeAccessoryAssemblyColumns, paginationParams, headers, onBeforeUpload, @@ -267,9 +333,11 @@ onSearch, onExport, onRowClick, - onConfirmWmsMaterialContainer, + onConfirmPipeAccessoryAssembly, onCheck, - onAddWmsMaterialContainer, - onAdvancedQuery + onAddPipeAccessoryAssembly, + onAdvancedQuery, + onSendFlangeCode, + onFinishSendFlangeCode } } diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssembly.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssembly.ts index 9bcfa04..5391d9d 100644 --- a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssembly.ts +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/PipeAccessoryAssembly.ts @@ -1,11 +1,13 @@ import { Base } from '@/libs/Base/Base' import { - deleteWmsMaterialContainers, - addWmsMaterialContainer, + // deletePipeAccessoryAssemblys, + // addPipeAccessoryAssembly, + sendFlangeCode, + finishSendFlangeCode, cloneData, } from './Service/PipeAccessoryAssembly' -export class WmsMaterialContainer extends Base<{ [key: string]: any }> { +export class PipeAccessoryAssembly extends Base<{ [key: string]: any }> { constructor() { super({ data: [], @@ -17,17 +19,32 @@ * @param id * @returns */ - async deleteWmsMaterialContainers(ids: string[]) { - return deleteWmsMaterialContainers(ids) + async deletePipeAccessoryAssemblys(ids: string[]) { + // return deletePipeAccessoryAssemblys(ids) } - + /** + * 涓嬪彂娉曞叞鍐茬爜 + * @param id + * @returns + */ + async sendFlangeCode(data: Record<string, any>) { + return sendFlangeCode(data) + } + /** + * 瀹屽伐娉曞叞鍐茬爜 + * @param id + * @returns + */ + async finishSendFlangeCode(data: Record<string, any>) { + return finishSendFlangeCode(data) + } /** * 娣诲姞鏁版嵁 * @param data * @returns */ - addWmsMaterialContainer(data: Record<string, any>) { - return addWmsMaterialContainer(data) + addPipeAccessoryAssembly(data: Record<string, any>) { + //return addPipeAccessoryAssembly(data) } /** diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssembly.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssembly.ts index 92614a8..146b40d 100644 --- a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssembly.ts +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssembly.ts @@ -76,4 +76,19 @@ */ export const finishProduction = (data: any) => { return request.post('/api/v1/PipeLineLems/WorkPlanPublic/finishProduction', data) +} + +/** + * 涓嬪彂娉曞叞鍐茬爜 + * @returns + */ +export const sendFlangeCode = (data: any) => { + return request.post('/api/v1/PipeLineLems/WorkPlanPublic/sendFlangeCode', data) +} +/** + * 瀹屽伐娉曞叞鍐茬爜 + * @returns + */ +export const finishSendFlangeCode = (data: any) => { + return request.post('/api/v1/PipeLineLems/WorkPlanPublic/SendFlangeCode_FinishProduction', data) } \ No newline at end of file diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/Config.ts b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/Config.ts index 5e6ddfc..c52afc0 100644 --- a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/Config.ts +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/Config.ts @@ -5,23 +5,218 @@ title: '搴忓彿', }, { - field: 'containerNo', - title: '鎵樼洏缂栧彿', + field: 'son_TaskCode', + title: '瀛愪换鍔$紪鐮�', + width:160, }, { - field: 'materialId', - title: '鐗╂枡ID', + field: 'taskCode', + title: '浠诲姟缂栫爜', + width:160, }, { - field: 'sort', - title: '', + field: 'pipeSpecCode', + title: '绠℃缂栫爜', + width:160, +}, +{ + field: 'pipeSectionName', + title: '绠℃鍚嶇О', + width:160, +}, +{ + field: 'pipeSpecMode', + title: '绠℃鍨嬪彿', + width:160, +}, +{ + field: 'processName', + title: '宸ュ簭鍚嶇О', + width:160, +}, +{ + field: 'shipNumber', + title: '鑸瑰彿', + width:160, +}, +{ + field: 'projectNumber', + title: '椤圭洰鍙�', + width:160, +}, +{ + field: 'workPlanStatusDesc', + title: '璁″垝鐘舵��', + width:160, +}, +{ + field: 'callMaterialStatusDesc', + title: '鍙枡鐘舵��', + width:160, +}, +{ + field: 'processRouteNumber', + title: '宸ヨ壓娴佸悜缂栧彿', + width:160, +}, +{ + field: 'dataIdentifier', + title: '鍘熸枡鏍囪瘑', + width:160, +}, +{ + field: 'materialMode', + title: '鍘熸枡鍨嬪彿', + width:160, +}, +{ + field: 'length', + title: '闀垮害(mm)', + width:160, +}, +{ + field: 'markingContent', + title: '鎵撶爜鍐呭', + width:160, +}, +{ + field: 'markingPosition', + title: '鎵撶爜浣嶇疆', + width:160, +}, +{ + field: 'cuttingPosition', + title: '鍒囧壊浣嶇疆', + width:160, +}, +{ + field: 'quantity', + title: '绠℃鏁伴噺', + width:160, +}, +{ + field: 'flangeThickness', + title: '娉曞叞鍘氬害(mm)', + width:160, +}, +{ + field: 'flangeInnerDiameter', + title: '娉曞叞鐩村緞(mm)', + width:160, +}, +{ + field: 'weldingHeatInput', + title: '娉曞叞鍏О鍘嬪姏', + width:160, +}, +{ + field: 'pipeAllowableStress', + title: '娉曞叞鍐茬爜鍐呭', + width:160, +}, +{ + field: 'pipeDiameter', + title: '濂楃闀垮害(mm)', + width:160, +}, +{ + field: 'pipeWallThickness', + title: '濂楃鐩村緞(mm)', + width:160, +}, +{ + field: 'factoryCode', + title: '宸ュ巶浠g爜', + width:160, +}, +{ + field: 'productCode', + title: '浜у搧浠g爜', + width:160, +}, +{ + field: 'workstationCode', + title: '宸ヤ綅浠g爜', + width:160, +}, +{ + field: 'equipmentCode', + title: '璁惧浠g爜', + width:160, +}, +{ + field: 'prodLineCode', + title: '浜х嚎缂栫爜', + width:160, +}, +{ + field: 'pipeFittingCode', + title: '绠′欢缂栫爜', + width:160, +}, +{ + field: 'preSerialNumber', + title: '椤哄簭鍙�', + width:160, +}, +{ + field: 'outerDiameter', + title: '澶栧緞(mm)', + width:160, +}, +{ + field: 'thickness', + title: '澹佸帤(mm)', + width:160, +}, +{ + field: 'material', + title: '鏉愯川', + width:160, +}, +{ + field: 'plannedStartTime', + title: '璁″垝寮�濮嬫椂闂�', + width:180, +}, +{ + field: 'plannedEndTime', + title: '璁″垝瀹屾垚鏃堕棿', + width:180, +}, +{ + field: 'teamInfo', + title: '鐝粍淇℃伅', + width:160, +}, +{ + field: 'timestamp', + title: '鏃堕棿鎴�', + width:160, }, { field: 'creationTime', - title: '鏄惁绂佺敤', + title: '鍒涘缓鏃堕棿', + width:180, }, { - field: 'deletionTime', - title: '', + field: 'lastModificationTime', + title: '淇敼鏃堕棿', + width:180, +}, +{ + field: 'creatorName', + title: '鍒涘缓浜�', + width:160, +}, +{ + field: 'lastModifierName', + title: '淇敼浜�', + width:160, +}, +{ + field: 'remark', + title: '澶囨敞', + width:160, }, ] diff --git a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/PipeAccessoryAssembly.tsx b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/PipeAccessoryAssembly.tsx index 91441ff..595e58c 100644 --- a/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/PipeAccessoryAssembly.tsx +++ b/PipeLineLems/pipelinelems_web/src/widgets/PipeAccessoryAssembly/Views/Pages/PipeAccessoryAssembly/PipeAccessoryAssembly.tsx @@ -1,8 +1,13 @@ import { defineComponent, onMounted, ref } from 'vue' import type { Ref } from 'vue' import styles from './PipeAccessoryAssembly.module.scss' +import { usePipeAccessoryAssembly } from '../../../Controllers/PipeAccessoryAssembly' import pipeImage from '@/images/pipe-assembly-drawing-example.png' -import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' +import { ConfirmBox } from '@/components/ConfirmBox/ConfirmBox' +import { columns } from './Config' +import TdButton from '@/components/TdButton/TdButton' +import BaseTable from '@/components/Table/Table' +import dayjs from 'dayjs' import { ElInput, ElForm, @@ -19,31 +24,67 @@ instock, findSingleWorkPlanByFilter, startProduction, - finishProduction + finishProduction, } from '@/widgets/PipeAccessoryAssembly/Models/Service/PipeAccessoryAssembly' import { Message } from '@element-plus/icons-vue/dist/types' +interface RenderTableType { + url?: string + dataSource: Ref<any[]> + isDrag?: boolean + isChecked?: boolean + isHidePagination?: boolean + params?: Record<string, any> + autoHeight?: boolean +} + export default defineComponent({ name: 'PipeAccessoryAssembly', - setup() { - // 鏌ヨ琛ㄥ崟鏁版嵁 -const queryForm = ref({ - pipeSpecCode: '', - processRouteNumber: '', - taskCode: '', - length: '', - projectNumber: '', - shipNumber: '', - material: '', - outerDiameter: '', - thickness: '', - plannedStartTime: '', - plannedEndTime: '', - workstationCode: '', - processName: '', - equipmentCode: '' -}) + setup(props, ctx) { + const { + dataSource, + contextMenu, + dialogConfig, + dialogConfigForQuery, + tableRef, + current, + search, + sort, + headers, + onError, + onSearch, + onRowClick, + // onConfirmWorkTask, + onCheck, + // onAddWorkTask, + onAdvancedQuery, + onExport, + openDetail, + onSuccess, + onBeforeUpload, + onSendFlangeCode, + onFinishSendFlangeCode + } = usePipeAccessoryAssembly(props, ctx) + // 鏌ヨ琛ㄥ崟鏁版嵁 + const queryForm = ref({ + pipeSpecCode: '', + processRouteNumber: '', + taskCode: '', + length: '', + projectNumber: '', + shipNumber: '', + material: '', + outerDiameter: '', + thickness: '', + plannedStartTime: '', + plannedEndTime: '', + workstationCode: '', + processName: '', + equipmentCode: '', + }) + + // 鏁版嵁婧� const modelOptions = ref<Array<{ value: string; label: string }>>([]) const placeNoOptions = ref<Array<{ value: string; label: string }>>([]) @@ -94,30 +135,33 @@ label: item.placeNoDesc, })) } - const handleChange =async (value) => { - console.log('杈撳叆鍐呭纭:', value); // 澶卞幓鐒︾偣鎴栧洖杞︽椂瑙﹀彂 - if(value==''){ - initQueryForm(); - return; + const handleChange = async (value) => { + console.log('杈撳叆鍐呭纭:', value) // 澶卞幓鐒︾偣鎴栧洖杞︽椂瑙﹀彂 + if (value == '') { + initQueryForm() + + return } // 鍦ㄦ澶勬坊鍔犱笟鍔¢�昏緫锛堝鏍¢獙銆佹彁浜ょ瓑锛� - const param={ - pipeSpecCode:value, - pipeSpecCode_FilterMode:2,//绮惧噯鏌ヨ - processName:'瑁呴厤宸ュ簭', - processName_FilterMode:2,//绮惧噯鏌ヨ + const param = { + pipeSpecCode: value, + pipeSpecCode_FilterMode: 2, //绮惧噯鏌ヨ + processName: '瑁呴厤宸ュ簭', + processName_FilterMode: 2, //绮惧噯鏌ヨ } - const workPlan = await findSingleWorkPlanByFilter(param); - console.log('杩斿洖:'+workPlan); - if(workPlan==''){ - ElMessage.error('娌℃湁鎵惧埌鏁版嵁'); - initQueryForm(); - }else{ - queryForm.value=workPlan; + const workPlan = await findSingleWorkPlanByFilter(param) + console.log('杩斿洖:' + workPlan) + if (workPlan == '') { + ElMessage.error('娌℃湁鎵惧埌鏁版嵁') + initQueryForm() + } else { + queryForm.value = workPlan + refreshProcessRoute(); } - }; - const initQueryForm=()=>{ - queryForm.value ={ pipeSpecCode: '', + } + const initQueryForm = () => { + queryForm.value = { + pipeSpecCode: '', processRouteNumber: '', taskCode: '', length: '', @@ -130,69 +174,226 @@ plannedEndTime: '', workstationCode: '', processName: '', - equipmentCode: ''} - } + equipmentCode: '', + } + dataSource.value=[] //娓呯┖琛ㄦ牸鏁版嵁 + } +//鎮ㄧ殑涓氬姟閫昏緫 +const paramForProcessRoute= { + processName: '娉曞叞鍐茬爜宸ュ簭', + ProcessName_FilterMode:2,//绮惧噯鏌ヨ + pipeSpecCode: 'XXX',//榛樿鍏堢粰涓笉瀛樺湪鐨勬暟鎹� + pipeSpecCode_FilterMode:2,//绮惧噯鏌ヨ +} + +let routeUrl=ref(""); + // 鍒锋柊宸ヨ壓淇℃伅 + const refreshProcessRoute = () => { + console.log('鎵ц 鍒锋柊宸ヨ壓淇℃伅') + if (queryForm.value.pipeSpecCode == '') { + ElMessage.error('璇疯緭鍏ョ娈电紪鐮�') + return + } + routeUrl.value="/api/v1/PipeLineLems/workTask/page"; + paramForProcessRoute.pipeSpecCode = queryForm.value.pipeSpecCode + tableRef.value.getList(paramForProcessRoute) + } + // 涓嬪彂娉曞叞鍐茬爜 + const sendFlangeCode = () => { + console.log('鎵ц 涓嬪彂娉曞叞鍐茬爜') + if (queryForm.value.pipeSpecCode == '') { + ElMessage.error('璇疯緭鍏ョ娈电紪鐮�') + return + } + onSendFlangeCode(); + } + // 瀹屽伐娉曞叞鍐茬爜 + const finishSendFlangeCode = () => { + console.log('鎵ц 瀹屽伐娉曞叞鍐茬爜') + if (queryForm.value.pipeSpecCode == '') { + ElMessage.error('璇疯緭鍏ョ娈电紪鐮�') + return + } + onFinishSendFlangeCode(); + } // 寮�宸ヤ簨浠跺鐞� const startWork = () => { - console.log('鎵ц寮�宸ユ搷浣�'); - if(queryForm.value.pipeSpecCode==''){ - ElMessage.error('璇疯緭鍏ョ娈电紪鐮�'); + console.log('鎵ц寮�宸ユ搷浣�') + if (queryForm.value.pipeSpecCode == '') { + ElMessage.error('璇疯緭鍏ョ娈电紪鐮�') return } - ConfirmBox( - `纭畾瑕佸皢绠℃缂栫爜${queryForm.value.pipeSpecCode}寮�宸ュ悧` - ).then(async () => { - //鎮ㄧ殑涓氬姟閫昏緫 - const param={ - taskCode:queryForm.value.taskCode, - }; - const ret = await startProduction(param); - console.log('杩斿洖:'+ret); - if(ret.code="200"){ - ElMessage.success('寮�宸ユ垚鍔�'); - }else{ - ElMessage.error('寮�宸ュけ璐�:'+ret.message); - } - }) - } + ConfirmBox(`纭畾瑕佸皢绠℃缂栫爜${queryForm.value.pipeSpecCode}寮�宸ュ悧`).then( + async () => { + //鎮ㄧ殑涓氬姟閫昏緫 + const param = { + taskCode: queryForm.value.taskCode, + } + const ret = await startProduction(param) + console.log('杩斿洖:' + ret) + if ((ret.code = '200')) { + ElMessage.success('寮�宸ユ垚鍔�') + } else { + ElMessage.error('寮�宸ュけ璐�:' + ret.message) + } + } + ) + } // 瀹屽伐浜嬩欢澶勭悊 const finishWork = () => { - console.log('鎵ц寮�宸ユ搷浣�'); - if(queryForm.value.pipeSpecCode==''){ - ElMessage.error('璇疯緭鍏ョ娈电紪鐮�'); + console.log('鎵ц寮�宸ユ搷浣�') + if (queryForm.value.pipeSpecCode == '') { + ElMessage.error('璇疯緭鍏ョ娈电紪鐮�') return } - ConfirmBox( - `纭畾瑕佸皢绠℃缂栫爜${queryForm.value.pipeSpecCode}瀹屽伐鍚梎 - ).then(async () => { - //鎮ㄧ殑涓氬姟閫昏緫 - const param={ - pipeSpecCode:queryForm.value.pipeSpecCode, - processName:queryForm.value.processName, - }; - const ret = await finishProduction(param); - console.log('杩斿洖:'+ret); - if(ret.code="200"){ - ElMessage.success('瀹屽伐鎴愬姛'); - }else{ - ElMessage.error('瀹屽伐澶辫触:'+ret.message); - } - }) + ConfirmBox(`纭畾瑕佸皢绠℃缂栫爜${queryForm.value.pipeSpecCode}瀹屽伐鍚梎).then( + async () => { + //鎮ㄧ殑涓氬姟閫昏緫 + const param = { + pipeSpecCode: queryForm.value.pipeSpecCode, + processName: queryForm.value.processName, + } + const ret = await finishProduction(param) + console.log('杩斿洖:' + ret) + if ((ret.code = '200')) { + ElMessage.success('瀹屽伐鎴愬姛') + } else { + ElMessage.error('瀹屽伐澶辫触:' + ret.message) + } + } + ) } - const tableData = ref([ - { sequence: 1, flangeA: 'RF-200-1.6MPa', flangeB: 'WN-200-1.6MPa' }, - { sequence: 2, flangeA: 'WN-250-2.5MPa', flangeB: 'SO-250-2.5MPa' }, - { sequence: 3, flangeA: 'PL-300-1.0MPa', flangeB: 'RF-300-1.0MPa' }, - { sequence: 4, flangeA: 'SO-150-2.0MPa', flangeB: 'WN-150-2.0MPa' }, - { sequence: 5, flangeA: 'RF-400-1.6MPa', flangeB: 'PL-400-1.6MPa' }, - { sequence: 6, flangeA: 'WN-200-4.0MPa', flangeB: 'SO-200-4.0MPa' }, - { sequence: 7, flangeA: 'SO-300-1.6MPa', flangeB: 'RF-300-1.6MPa' }, - { sequence: 8, flangeA: 'PL-250-1.0MPa', flangeB: 'WN-250-1.0MPa' }, - { sequence: 9, flangeA: 'RF-150-2.5MPa', flangeB: 'SO-150-2.5MPa' }, - { sequence: 10, flangeA: 'WN-400-2.0MPa', flangeB: 'PL-400-2.0MPa' } - ]); + /** + * @returns 琛ㄦ牸 + */ + const RenderBaseTable = (props: RenderTableType) => { + const { + url, + dataSource, + isDrag, + isChecked, + isHidePagination, + params, + autoHeight, + maxHeight, + } = props + + return ( + <div + class={{ + [styles.workTaskList]: true, + }} + > + <BaseTable + ref={tableRef} + url={url} + sortUrlTpl="/api/v1/PipeLineLems/workTask/{id}/adjustsort/{sort}" + v-model:dataSource={dataSource.value} + columns={columns} + contextMenu={contextMenu} + params={params} + isDrag={isDrag} + isChecked={isChecked} + autoHeight={autoHeight} + maxHeight={maxHeight} + onCheck={onCheck} + onRowClick={onRowClick} + isHidePagination={isHidePagination} + pageSize={20} + v-slots={{ + plannedStartTime: ({ row }: any) => { + return ( + <div> + {row.plannedStartTime != null + ? dayjs(row.plannedStartTime).format( + 'YYYY-MM-DD HH:mm:ss' + ) + : '-'} + </div> + ) + }, + plannedEndTime: ({ row }: any) => { + return ( + <div> + {row.plannedEndTime != null + ? dayjs(row.plannedEndTime).format('YYYY-MM-DD HH:mm:ss') + : '-'} + </div> + ) + }, + creationTime: ({ row }: any) => { + return ( + <div> + {row.creationTime != null + ? dayjs(row.creationTime).format('YYYY-MM-DD HH:mm:ss') + : '-'} + </div> + ) + }, + lastModificationTime: ({ row }: any) => { + return ( + <div> + {row.lastModificationTime != null + ? dayjs(row.lastModificationTime).format( + 'YYYY-MM-DD HH:mm:ss' + ) + : '-'} + </div> + ) + }, + isDeleted: ({ row }: any) => { + return ( + <div> + {row.isDeleted != null + ? row.isDeleted + ? '鏄�' + : '鍚�' + : '-'} + </div> + ) + }, + deletionTime: ({ row }: any) => { + return ( + <div> + {row.deletionTime != null + ? dayjs(row.deletionTime).format('YYYY-MM-DD HH:mm:ss') + : '-'} + </div> + ) + }, + isDisabled: ({ row }: any) => { + return ( + <div> + {row.isDisabled != null + ? row.isDisabled + ? '鏄�' + : '鍚�' + : '-'} + </div> + ) + }, + name: ({ row }: any) => { + return row?.name ? ( + <TdButton + onClick={() => openDetail(row)} + text={<span style="color:#5a84ff">璇︽儏</span>} + icon="scale" + tip={row?.name} + hover + > + {row?.name} + </TdButton> + ) : ( + '-' + ) + }, + }} + ></BaseTable> + </div> + ) + } return () => { return ( @@ -200,134 +401,137 @@ class={styles.PipeAccessoryAssemblyContent} style="overflow-y: auto !important; height: 100%;" > - <ElFormItem label="绠℃缂栫爜 "> - <ElInput - v-model={queryForm.value.pipeSpecCode} - clearable - class={styles.formInput} - onInput={handleChange} - /> - </ElFormItem> + <ElFormItem label="绠℃缂栫爜 "> + <ElInput + v-model={queryForm.value.pipeSpecCode} + clearable + class={styles.formInput} + onInput={handleChange} + /> + </ElFormItem> <div class={styles.actionButtons}> - <ElButton type="warning" onClick={startWork}>寮�宸�</ElButton> - <ElButton type="warning" onClick={finishWork}>瀹屽伐</ElButton> + <ElButton type="warning" onClick={startWork}> + 寮�宸� + </ElButton> + <ElButton type="warning" onClick={finishWork}> + 瀹屽伐 + </ElButton> {/* <ElButton type="warning">鏆傚仠</ElButton> <ElButton type="warning">鑷姩</ElButton> <ElButton type="warning">璐ㄦ</ElButton> */} </div> <h2 class={styles.blockTitle}>褰撳墠浠诲姟</h2> - <ElForm label-position="left" > - - <ElFormItem label="鐗╂枡娴佸悜 "> - <ElInput - v-model={queryForm.value.processRouteNumber} - disabled - clearable - class={styles.formInput} - /> - </ElFormItem> - <ElFormItem label="浠诲姟缂栧彿 "> - <ElInput - v-model={queryForm.value.taskCode} - disabled - clearable - class={styles.formInput} - /> - </ElFormItem> - <ElFormItem label="绠℃闀垮害 "> - <ElInput - v-model={queryForm.value.length} - disabled - clearable - class={styles.formInput} - /> - </ElFormItem> - <ElFormItem label="椤圭洰 鍙�"> - <ElInput - v-model={queryForm.value.projectNumber} - disabled - clearable - class={styles.formInput} - /> - </ElFormItem> - <ElFormItem label="鑸� 鍙�"> - <ElInput - v-model={queryForm.value.shipNumber} - disabled - clearable - class={styles.formInput} - /> - </ElFormItem> - <ElFormItem label="鏉� 璐�"> - <ElInput - v-model={queryForm.value.material} - disabled - clearable - class={styles.formInput} - /> - </ElFormItem> - <ElFormItem label="澶� 寰�"> - <ElInput - v-model={queryForm.value.outerDiameter} - disabled - clearable - class={styles.formInput} - /> - </ElFormItem> - <ElFormItem label="澹� 鍘�"> - <ElInput - v-model={queryForm.value.thickness} - disabled - clearable - class={styles.formInput} - /> - </ElFormItem> - <ElFormItem label="璁″垝寮�濮嬫椂闂�"> - <ElInput - v-model={queryForm.value.plannedStartTime} - disabled - clearable - class={styles.formInput} - /> - </ElFormItem> - <ElFormItem label="璁″垝瀹屾垚鏃堕棿"> - <ElInput - v-model={queryForm.value.plannedEndTime} - disabled - clearable - class={styles.formInput} - /> - </ElFormItem> - </ElForm> + <ElForm label-position="left"> + <ElFormItem label="鐗╂枡娴佸悜 "> + <ElInput + v-model={queryForm.value.processRouteNumber} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="浠诲姟缂栧彿 "> + <ElInput + v-model={queryForm.value.taskCode} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="绠℃闀垮害 "> + <ElInput + v-model={queryForm.value.length} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="椤圭洰 鍙�"> + <ElInput + v-model={queryForm.value.projectNumber} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="鑸� 鍙�"> + <ElInput + v-model={queryForm.value.shipNumber} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="鏉� 璐�"> + <ElInput + v-model={queryForm.value.material} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="澶� 寰�"> + <ElInput + v-model={queryForm.value.outerDiameter} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="澹� 鍘�"> + <ElInput + v-model={queryForm.value.thickness} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="璁″垝寮�濮嬫椂闂�"> + <ElInput + v-model={queryForm.value.plannedStartTime} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="璁″垝瀹屾垚鏃堕棿"> + <ElInput + v-model={queryForm.value.plannedEndTime} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + </ElForm> - <h2 class={styles.blockTitle}>褰撳墠宸ヤ綅/璁惧淇℃伅</h2> - <ElForm label-position="left" > - <ElFormItem label="宸ヤ綅浠g爜 "> - <ElInput - v-model={queryForm.value.workstationCode} - disabled - clearable - class={styles.formInput} - /> - </ElFormItem> - <ElFormItem label="宸ュ簭鍚嶇О "> - <ElInput - v-model={queryForm.value.processName} - disabled - clearable - class={styles.formInput} - /> - </ElFormItem> - <ElFormItem label="璁惧浠g爜 "> - <ElInput - v-model={queryForm.value.equipmentCode} - disabled - clearable - class={styles.formInput} - /> - </ElFormItem> - {/* <ElFormItem label="璁惧鐘舵��"> + <h2 class={styles.blockTitle}>褰撳墠宸ヤ綅/璁惧淇℃伅</h2> + <ElForm label-position="left"> + <ElFormItem label="宸ヤ綅浠g爜 "> + <ElInput + v-model={queryForm.value.workstationCode} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="宸ュ簭鍚嶇О "> + <ElInput + v-model={queryForm.value.processName} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + <ElFormItem label="璁惧浠g爜 "> + <ElInput + v-model={queryForm.value.equipmentCode} + disabled + clearable + class={styles.formInput} + /> + </ElFormItem> + {/* <ElFormItem label="璁惧鐘舵��"> <ElInput v-model={queryForm.value.materialBatch} disabled @@ -335,7 +539,7 @@ class={styles.formInput} /> </ElFormItem> */} - {/* <ElFormItem label="鎿嶄綔浜�"> + {/* <ElFormItem label="鎿嶄綔浜�"> <ElInput v-model={queryForm.value.materialBatch} disabled @@ -343,16 +547,39 @@ class={styles.formInput} /> </ElFormItem> */} - </ElForm> + </ElForm> {/* <div class="info-block"> <h2 class="block-title">宸ヨ壓淇℃伅</h2> - <el-table stripe v-model:dataSource={tableData}> + <el-table stripe :data={tableData}> <el-table-column prop="sequence" label="搴�"></el-table-column> <el-table-column prop="flangeA" label="娉曞叞A"></el-table-column> <el-table-column prop="flangeB" label="娉曞叞B"></el-table-column> </el-table> </div> */} + <div class="info-block"> + <h2 class="block-title">宸ヨ壓淇℃伅</h2> + <div class={styles.actionButtons} style="margin-bottom:5px;"> + <ElButton type="warning" onClick={refreshProcessRoute}> + 鍒锋柊 + </ElButton> + <ElButton type="warning" onClick={sendFlangeCode}> + 涓嬪彂娉曞叞鍐茬爜 + </ElButton> + <ElButton type="warning" onClick={finishSendFlangeCode}> + 瀹屽伐娉曞叞鍐茬爜 + </ElButton> + </div> + <RenderBaseTable + url={routeUrl.value} + dataSource={dataSource} + isChecked={true} + isDrag={true} + autoHeight={false} + maxHeight="500px" + params={paramForProcessRoute} + /> + </div> <h2 class="block-title">鍥剧焊</h2> <img src={pipeImage} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Controllers/WorkPlanDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Controllers/WorkPlanDrawer.tsx index 04e4add..6f55d90 100644 --- a/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Controllers/WorkPlanDrawer.tsx +++ b/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Controllers/WorkPlanDrawer.tsx @@ -18,7 +18,8 @@ import { BOOLEAN_OPTIONS_AddEdit } from '@/utils/commonOptionConstants'; - +// 寮曞叆鍏叡琛ㄥ崟宸ュ叿鏂囦欢 +import { extractFormDataForOnConfirm,extractAndAssignFormData } from '@/utils/myformUtils'; export const useWorkPlanDrawer = (props: any, ctx?: any) => { const workPlanDrawer = injectModel<WorkPlanDrawer>('workPlanDrawer') /** @@ -89,6 +90,48 @@ rules: [{required: true, message: '浠诲姟缂栫爜涓嶈兘涓虹┖', trigger: 'blur' }], }, { + label: '绠℃缂栫爜', + prop: 'pipeSpecCode', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ娈电紪鐮�', + }, + { + label: '绠℃鍚嶇О', + prop: 'pipeSectionName', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ娈靛悕绉�', + }, + { + label: '绠℃鍨嬪彿', + prop: 'pipeSpecMode', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ娈靛瀷鍙�', + }, + { + label: '宸ュ簭鍚嶇О', + prop: 'processName', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ュ伐搴忓悕绉�', + }, + { + label: '鑸瑰彿', + prop: 'shipNumber', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ヨ埞鍙�', + }, + { + label: '椤圭洰鍙�', + prop: 'projectNumber', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ラ」鐩彿', + }, + { label: '璁″垝鐘舵��', prop: 'workPlanStatus', el: 'select', @@ -107,6 +150,13 @@ //disabled: disabled, placeholder: '璇疯緭鍏ュ彨鏂欑姸鎬�', rules: [{required: true, message: '鍙枡鐘舵�佷笉鑳戒负绌�', trigger: 'blur' }], + }, + { + label: '宸ヨ壓娴佸悜缂栧彿', + prop: 'processRouteNumber', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ュ伐鑹烘祦鍚戠紪鍙�', }, { label: '鍘熸枡鏍囪瘑', @@ -315,27 +365,6 @@ placeholder: '璇疯緭鍏ヤ骇绾跨紪鐮�', }, { - label: '鑸瑰彿', - prop: 'shipNumber', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ヨ埞鍙�', - }, - { - label: '椤圭洰鍙�', - prop: 'projectNumber', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ラ」鐩彿', - }, - { - label: '宸ュ簭鍚嶇О', - prop: 'processName', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ュ伐搴忓悕绉�', - }, - { label: '绠′欢缂栫爜', prop: 'pipeFittingCode', el: 'input', @@ -348,20 +377,6 @@ el: 'input', //disabled: disabled, placeholder: '璇疯緭鍏ラ『搴忓彿', - }, - { - label: '绠℃缂栫爜', - prop: 'pipeSpecCode', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ョ娈电紪鐮�', - }, - { - label: '绠℃鍚嶇О', - prop: 'pipeSectionName', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ョ娈靛悕绉�', }, { label: '澶栧緞(mm)', @@ -403,13 +418,6 @@ el: 'input', //disabled: disabled, placeholder: '璇疯緭鍏ユ潗璐�', - }, - { - label: '宸ヨ壓娴佸悜缂栧彿', - prop: 'processRouteNumber', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ュ伐鑹烘祦鍚戠紪鍙�', }, { label: '璁″垝寮�濮嬫椂闂�', @@ -494,45 +502,7 @@ */ const onConfirm = async () => { await formRef.value?.validate() - const data = { - taskCode: formData.value.taskCode, -workPlanStatus: formData.value.workPlanStatus, -callMaterialStatus: formData.value.callMaterialStatus, -dataIdentifier: formData.value.dataIdentifier, -materialMode: formData.value.materialMode, -length: formData.value.length, -markingContent: formData.value.markingContent, -markingPosition: formData.value.markingPosition, -cuttingPosition: formData.value.cuttingPosition, -quantity: formData.value.quantity, -flangeThickness: formData.value.flangeThickness, -flangeInnerDiameter: formData.value.flangeInnerDiameter, -weldingHeatInput: formData.value.weldingHeatInput, -pipeAllowableStress: formData.value.pipeAllowableStress, -pipeDiameter: formData.value.pipeDiameter, -pipeWallThickness: formData.value.pipeWallThickness, -factoryCode: formData.value.factoryCode, -productCode: formData.value.productCode, -workstationCode: formData.value.workstationCode, -equipmentCode: formData.value.equipmentCode, -prodLineCode: formData.value.prodLineCode, -shipNumber: formData.value.shipNumber, -projectNumber: formData.value.projectNumber, -processName: formData.value.processName, -pipeFittingCode: formData.value.pipeFittingCode, -preSerialNumber: formData.value.preSerialNumber, -pipeSpecCode: formData.value.pipeSpecCode, -pipeSectionName: formData.value.pipeSectionName, -outerDiameter: formData.value.outerDiameter, -thickness: formData.value.thickness, -material: formData.value.material, -processRouteNumber: formData.value.processRouteNumber, -plannedStartTime: formData.value.plannedStartTime, -plannedEndTime: formData.value.plannedEndTime, -teamInfo: formData.value.teamInfo, -timestamp: formData.value.timestamp, -remark: formData.value.remark, - } + const data=extractFormDataForOnConfirm(formData); if (!current.value) { await workPlanDrawer.addWorkPlan(data) } else { @@ -581,46 +551,7 @@ if (current.value) { const res = await workPlanDrawer.getWorkPlanDetail(current.value) - formData.value = { - taskCode: res.taskCode, -workPlanStatus: res.workPlanStatus, -callMaterialStatus: res.callMaterialStatus, -dataIdentifier: res.dataIdentifier, -materialMode: res.materialMode, -length: res.length, -markingContent: res.markingContent, -markingPosition: res.markingPosition, -cuttingPosition: res.cuttingPosition, -quantity: res.quantity, -flangeThickness: res.flangeThickness, -flangeInnerDiameter: res.flangeInnerDiameter, -weldingHeatInput: res.weldingHeatInput, -pipeAllowableStress: res.pipeAllowableStress, -pipeDiameter: res.pipeDiameter, -pipeWallThickness: res.pipeWallThickness, -factoryCode: res.factoryCode, -productCode: res.productCode, -workstationCode: res.workstationCode, -equipmentCode: res.equipmentCode, -prodLineCode: res.prodLineCode, -shipNumber: res.shipNumber, -projectNumber: res.projectNumber, -processName: res.processName, -pipeFittingCode: res.pipeFittingCode, -preSerialNumber: res.preSerialNumber, -pipeSpecCode: res.pipeSpecCode, -pipeSectionName: res.pipeSectionName, -outerDiameter: res.outerDiameter, -thickness: res.thickness, -material: res.material, -processRouteNumber: res.processRouteNumber, -plannedStartTime: res.plannedStartTime, -plannedEndTime: res.plannedEndTime, -teamInfo: res.teamInfo, -timestamp: res.timestamp, -remark: res.remark, - id: res.id, - } + extractAndAssignFormData(res,formData); disabled.value = true updateCheckData() } else { diff --git a/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Controllers/WorkPlanQueryDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Controllers/WorkPlanQueryDrawer.tsx index 5ba5020..0b8f33a 100644 --- a/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Controllers/WorkPlanQueryDrawer.tsx +++ b/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Controllers/WorkPlanQueryDrawer.tsx @@ -20,6 +20,8 @@ FILTER_MODE_OPTIONS_NUM, FILTER_MODE_OPTIONS_BOOL } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions'; +// 寮曞叆鍏叡琛ㄥ崟宸ュ叿鏂囦欢 +import { collectFormDataForHighQuery,onResetForHighSelect,onResetForHighQuery } from '@/utils/myformUtils'; import { BOOLEAN_OPTIONS } from '@/utils/commonOptionConstants'; @@ -101,6 +103,84 @@ } }, { + label: '绠℃缂栫爜', + prop: 'pipeSpecCode', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ娈电紪鐮�', + highSelectAttrs:{ + prop: 'pipeSpecCode_FilterMode', + el: 'select', + placeholder: '璇烽�夋嫨', + options:FILTER_MODE_OPTIONS_STRING + } + }, + { + label: '绠℃鍚嶇О', + prop: 'pipeSectionName', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ娈靛悕绉�', + highSelectAttrs:{ + prop: 'pipeSectionName_FilterMode', + el: 'select', + placeholder: '璇烽�夋嫨', + options:FILTER_MODE_OPTIONS_STRING + } + }, + { + label: '绠℃鍨嬪彿', + prop: 'pipeSpecMode', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ娈靛瀷鍙�', + highSelectAttrs:{ + prop: 'pipeSpecMode_FilterMode', + el: 'select', + placeholder: '璇烽�夋嫨', + options:FILTER_MODE_OPTIONS_STRING + } + }, + { + label: '宸ュ簭鍚嶇О', + prop: 'processName', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ュ伐搴忓悕绉�', + highSelectAttrs:{ + prop: 'processName_FilterMode', + el: 'select', + placeholder: '璇烽�夋嫨', + options:FILTER_MODE_OPTIONS_STRING + } + }, + { + label: '鑸瑰彿', + prop: 'shipNumber', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ヨ埞鍙�', + highSelectAttrs:{ + prop: 'shipNumber_FilterMode', + el: 'select', + placeholder: '璇烽�夋嫨', + options:FILTER_MODE_OPTIONS_STRING + } + }, + { + label: '椤圭洰鍙�', + prop: 'projectNumber', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ラ」鐩彿', + highSelectAttrs:{ + prop: 'projectNumber_FilterMode', + el: 'select', + placeholder: '璇烽�夋嫨', + options:FILTER_MODE_OPTIONS_STRING + } + }, + { label: '璁″垝鐘舵��', prop: 'workPlanStatus', el: 'select', @@ -128,6 +208,19 @@ el: 'select', placeholder: '璇烽�夋嫨', options:FILTER_MODE_OPTIONS_BOOL + } + }, + { + label: '宸ヨ壓娴佸悜缂栧彿', + prop: 'processRouteNumber', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ュ伐鑹烘祦鍚戠紪鍙�', + highSelectAttrs:{ + prop: 'processRouteNumber_FilterMode', + el: 'select', + placeholder: '璇烽�夋嫨', + options:FILTER_MODE_OPTIONS_STRING } }, { @@ -437,45 +530,6 @@ } }, { - label: '鑸瑰彿', - prop: 'shipNumber', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ヨ埞鍙�', - highSelectAttrs:{ - prop: 'shipNumber_FilterMode', - el: 'select', - placeholder: '璇烽�夋嫨', - options:FILTER_MODE_OPTIONS_STRING - } - }, - { - label: '椤圭洰鍙�', - prop: 'projectNumber', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ラ」鐩彿', - highSelectAttrs:{ - prop: 'projectNumber_FilterMode', - el: 'select', - placeholder: '璇烽�夋嫨', - options:FILTER_MODE_OPTIONS_STRING - } - }, - { - label: '宸ュ簭鍚嶇О', - prop: 'processName', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ュ伐搴忓悕绉�', - highSelectAttrs:{ - prop: 'processName_FilterMode', - el: 'select', - placeholder: '璇烽�夋嫨', - options:FILTER_MODE_OPTIONS_STRING - } - }, - { label: '绠′欢缂栫爜', prop: 'pipeFittingCode', el: 'input', @@ -496,32 +550,6 @@ placeholder: '璇疯緭鍏ラ『搴忓彿', highSelectAttrs:{ prop: 'preSerialNumber_FilterMode', - el: 'select', - placeholder: '璇烽�夋嫨', - options:FILTER_MODE_OPTIONS_STRING - } - }, - { - label: '绠℃缂栫爜', - prop: 'pipeSpecCode', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ョ娈电紪鐮�', - highSelectAttrs:{ - prop: 'pipeSpecCode_FilterMode', - el: 'select', - placeholder: '璇烽�夋嫨', - options:FILTER_MODE_OPTIONS_STRING - } - }, - { - label: '绠℃鍚嶇О', - prop: 'pipeSectionName', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ョ娈靛悕绉�', - highSelectAttrs:{ - prop: 'pipeSectionName_FilterMode', el: 'select', placeholder: '璇烽�夋嫨', options:FILTER_MODE_OPTIONS_STRING @@ -579,19 +607,6 @@ placeholder: '璇疯緭鍏ユ潗璐�', highSelectAttrs:{ prop: 'material_FilterMode', - el: 'select', - placeholder: '璇烽�夋嫨', - options:FILTER_MODE_OPTIONS_STRING - } - }, - { - label: '宸ヨ壓娴佸悜缂栧彿', - prop: 'processRouteNumber', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ュ伐鑹烘祦鍚戠紪鍙�', - highSelectAttrs:{ - prop: 'processRouteNumber_FilterMode', el: 'select', placeholder: '璇烽�夋嫨', options:FILTER_MODE_OPTIONS_STRING @@ -733,93 +748,11 @@ const check = isEqual(initiateData.value, data) return check } - const commonGetFormData=()=>{ - const data = { - taskCode: formData.value.taskCode || '', -taskCode_FilterMode: formData.value.taskCode_FilterMode || '', -workPlanStatus: formData.value.workPlanStatus || '', -workPlanStatus_FilterMode: formData.value.workPlanStatus_FilterMode || '', -callMaterialStatus: formData.value.callMaterialStatus || '', -callMaterialStatus_FilterMode: formData.value.callMaterialStatus_FilterMode || '', -dataIdentifier: formData.value.dataIdentifier || '', -dataIdentifier_FilterMode: formData.value.dataIdentifier_FilterMode || '', -materialMode: formData.value.materialMode || '', -materialMode_FilterMode: formData.value.materialMode_FilterMode || '', -length: formData.value.length || '', -length_FilterMode: formData.value.length_FilterMode || '', -markingContent: formData.value.markingContent || '', -markingContent_FilterMode: formData.value.markingContent_FilterMode || '', -markingPosition: formData.value.markingPosition || '', -markingPosition_FilterMode: formData.value.markingPosition_FilterMode || '', -cuttingPosition: formData.value.cuttingPosition || '', -cuttingPosition_FilterMode: formData.value.cuttingPosition_FilterMode || '', -quantity: formData.value.quantity || '', -quantity_FilterMode: formData.value.quantity_FilterMode || '', -flangeThickness: formData.value.flangeThickness || '', -flangeThickness_FilterMode: formData.value.flangeThickness_FilterMode || '', -flangeInnerDiameter: formData.value.flangeInnerDiameter || '', -flangeInnerDiameter_FilterMode: formData.value.flangeInnerDiameter_FilterMode || '', -weldingHeatInput: formData.value.weldingHeatInput || '', -weldingHeatInput_FilterMode: formData.value.weldingHeatInput_FilterMode || '', -pipeAllowableStress: formData.value.pipeAllowableStress || '', -pipeAllowableStress_FilterMode: formData.value.pipeAllowableStress_FilterMode || '', -pipeDiameter: formData.value.pipeDiameter || '', -pipeDiameter_FilterMode: formData.value.pipeDiameter_FilterMode || '', -pipeWallThickness: formData.value.pipeWallThickness || '', -pipeWallThickness_FilterMode: formData.value.pipeWallThickness_FilterMode || '', -factoryCode: formData.value.factoryCode || '', -factoryCode_FilterMode: formData.value.factoryCode_FilterMode || '', -productCode: formData.value.productCode || '', -productCode_FilterMode: formData.value.productCode_FilterMode || '', -workstationCode: formData.value.workstationCode || '', -workstationCode_FilterMode: formData.value.workstationCode_FilterMode || '', -equipmentCode: formData.value.equipmentCode || '', -equipmentCode_FilterMode: formData.value.equipmentCode_FilterMode || '', -prodLineCode: formData.value.prodLineCode || '', -prodLineCode_FilterMode: formData.value.prodLineCode_FilterMode || '', -shipNumber: formData.value.shipNumber || '', -shipNumber_FilterMode: formData.value.shipNumber_FilterMode || '', -projectNumber: formData.value.projectNumber || '', -projectNumber_FilterMode: formData.value.projectNumber_FilterMode || '', -processName: formData.value.processName || '', -processName_FilterMode: formData.value.processName_FilterMode || '', -pipeFittingCode: formData.value.pipeFittingCode || '', -pipeFittingCode_FilterMode: formData.value.pipeFittingCode_FilterMode || '', -preSerialNumber: formData.value.preSerialNumber || '', -preSerialNumber_FilterMode: formData.value.preSerialNumber_FilterMode || '', -pipeSpecCode: formData.value.pipeSpecCode || '', -pipeSpecCode_FilterMode: formData.value.pipeSpecCode_FilterMode || '', -pipeSectionName: formData.value.pipeSectionName || '', -pipeSectionName_FilterMode: formData.value.pipeSectionName_FilterMode || '', -outerDiameter: formData.value.outerDiameter || '', -outerDiameter_FilterMode: formData.value.outerDiameter_FilterMode || '', -thickness: formData.value.thickness || '', -thickness_FilterMode: formData.value.thickness_FilterMode || '', -material: formData.value.material || '', -material_FilterMode: formData.value.material_FilterMode || '', -processRouteNumber: formData.value.processRouteNumber || '', -processRouteNumber_FilterMode: formData.value.processRouteNumber_FilterMode || '', -plannedStartTime: formData.value.plannedStartTime || '', -plannedEndTime: formData.value.plannedEndTime || '', -teamInfo: formData.value.teamInfo || '', -teamInfo_FilterMode: formData.value.teamInfo_FilterMode || '', -timestamp: formData.value.timestamp || '', -timestamp_FilterMode: formData.value.timestamp_FilterMode || '', -creationTime: formData.value.creationTime || '', -lastModificationTime: formData.value.lastModificationTime || '', -creatorName: formData.value.creatorName || '', -creatorName_FilterMode: formData.value.creatorName_FilterMode || '', -lastModifierName: formData.value.lastModifierName || '', -lastModifierName_FilterMode: formData.value.lastModifierName_FilterMode || '', -remark: formData.value.remark || '', -remark_FilterMode: formData.value.remark_FilterMode || '', - } - return data; - } + const onClose = (done: () => void) => { if (visible.value) { visible.value = false - const data =commonGetFormData(); + const data =collectFormDataForHighQuery(formItems,formData); ctx.emit('close', data) } } @@ -827,101 +760,22 @@ * 纭鏌ヨ */ const onConfirmQuery = async () => { - const data =commonGetFormData(); + const data =collectFormDataForHighQuery(formItems,formData); ctx.emit('confirmQuery', data) } - /** - * 閲嶇疆鍏叡select鏌ヨ - */ - const onResetForHighSelect = async () => { - formData.value.taskCode_FilterMode = 1 -formData.value.workPlanStatus_FilterMode = 2 -formData.value.callMaterialStatus_FilterMode = 2 -formData.value.dataIdentifier_FilterMode = 1 -formData.value.materialMode_FilterMode = 1 -formData.value.length_FilterMode = 2 -formData.value.markingContent_FilterMode = 1 -formData.value.markingPosition_FilterMode = 2 -formData.value.cuttingPosition_FilterMode = 2 -formData.value.quantity_FilterMode = 2 -formData.value.flangeThickness_FilterMode = 2 -formData.value.flangeInnerDiameter_FilterMode = 2 -formData.value.weldingHeatInput_FilterMode = 1 -formData.value.pipeAllowableStress_FilterMode = 1 -formData.value.pipeDiameter_FilterMode = 2 -formData.value.pipeWallThickness_FilterMode = 2 -formData.value.factoryCode_FilterMode = 1 -formData.value.productCode_FilterMode = 1 -formData.value.workstationCode_FilterMode = 1 -formData.value.equipmentCode_FilterMode = 1 -formData.value.prodLineCode_FilterMode = 1 -formData.value.shipNumber_FilterMode = 1 -formData.value.projectNumber_FilterMode = 1 -formData.value.processName_FilterMode = 1 -formData.value.pipeFittingCode_FilterMode = 1 -formData.value.preSerialNumber_FilterMode = 1 -formData.value.pipeSpecCode_FilterMode = 1 -formData.value.pipeSectionName_FilterMode = 1 -formData.value.outerDiameter_FilterMode = 2 -formData.value.thickness_FilterMode = 2 -formData.value.material_FilterMode = 1 -formData.value.processRouteNumber_FilterMode = 1 -formData.value.teamInfo_FilterMode = 1 -formData.value.timestamp_FilterMode = 1 -formData.value.creatorName_FilterMode = 1 -formData.value.lastModifierName_FilterMode = 1 -formData.value.remark_FilterMode = 1 - } - /** - * 閲嶇疆鏌ヨ - */ - const onReset = async () => { - formData.value = {} - onResetForHighSelect();//閲嶇疆鍏叡select鏌ヨ - formData.value.taskCode = '' -formData.value.workPlanStatus = '' -formData.value.callMaterialStatus = '' -formData.value.dataIdentifier = '' -formData.value.materialMode = '' -formData.value.length = '' -formData.value.markingContent = '' -formData.value.markingPosition = '' -formData.value.cuttingPosition = '' -formData.value.quantity = '' -formData.value.flangeThickness = '' -formData.value.flangeInnerDiameter = '' -formData.value.weldingHeatInput = '' -formData.value.pipeAllowableStress = '' -formData.value.pipeDiameter = '' -formData.value.pipeWallThickness = '' -formData.value.factoryCode = '' -formData.value.productCode = '' -formData.value.workstationCode = '' -formData.value.equipmentCode = '' -formData.value.prodLineCode = '' -formData.value.shipNumber = '' -formData.value.projectNumber = '' -formData.value.processName = '' -formData.value.pipeFittingCode = '' -formData.value.preSerialNumber = '' -formData.value.pipeSpecCode = '' -formData.value.pipeSectionName = '' -formData.value.outerDiameter = '' -formData.value.thickness = '' -formData.value.material = '' -formData.value.processRouteNumber = '' -formData.value.plannedStartTime = '' -formData.value.plannedEndTime = '' -formData.value.teamInfo = '' -formData.value.timestamp = '' -formData.value.creationTime = '' -formData.value.lastModificationTime = '' -formData.value.creatorName = '' -formData.value.lastModifierName = '' -formData.value.remark = '' - //鍚戠埗缁勪欢鍙戦�佽嚜瀹氫箟浜嬩欢 - ctx.emit('restQuery'); - } + /** + * 閲嶇疆鏌ヨ - 浼樺寲鐗� + */ + const onReset = async () => { + // 1. 娓呯┖鎵�鏈夊熀纭�瀛楁锛堜笉鍖呭惈杩囨护妯″紡瀛楁锛�,搴旂敤鍩虹瀛楁鍒濆鍊� + onResetForHighQuery(formItems,formData); + + // 2. 浣跨敤鍘熸湁鏂规硶閲嶇疆杩囨护妯″紡瀛楁 + onResetForHighSelect(formItems,formData); + + // 3. 鍚戠埗缁勪欢鍙戦�佽嚜瀹氫箟浜嬩欢 + ctx.emit('restQuery'); + } const updateCheckData = () => { initiateData.value = { @@ -954,7 +808,7 @@ } commonQueryEnumForFrom() - onResetForHighSelect();//閲嶇疆鍏叡select鏌ヨ + onResetForHighSelect(formItems,formData);//閲嶇疆鍏叡select鏌ヨ /** * 寮圭獥鎵撳紑鑾峰彇璇︽儏 */ diff --git a/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/Config.ts b/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/Config.ts index de41e2e..7b6a5e0 100644 --- a/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/Config.ts +++ b/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/Config.ts @@ -20,8 +20,23 @@ width:160, }, { + field: 'pipeSpecMode', + title: '绠℃鍨嬪彿', + width:160, +}, +{ field: 'processName', title: '宸ュ簭鍚嶇О', + width:160, +}, +{ + field: 'shipNumber', + title: '鑸瑰彿', + width:160, +}, +{ + field: 'projectNumber', + title: '椤圭洰鍙�', width:160, }, { @@ -32,6 +47,11 @@ { field: 'callMaterialStatusDesc', title: '鍙枡鐘舵��', + width:160, +}, +{ + field: 'processRouteNumber', + title: '宸ヨ壓娴佸悜缂栧彿', width:160, }, { @@ -125,17 +145,6 @@ width:160, }, { - field: 'shipNumber', - title: '鑸瑰彿', - width:160, -}, -{ - field: 'projectNumber', - title: '椤圭洰鍙�', - width:160, -}, - -{ field: 'pipeFittingCode', title: '绠′欢缂栫爜', width:160, @@ -145,7 +154,6 @@ title: '椤哄簭鍙�', width:160, }, - { field: 'outerDiameter', title: '澶栧緞(mm)', @@ -159,11 +167,6 @@ { field: 'material', title: '鏉愯川', - width:160, -}, -{ - field: 'processRouteNumber', - title: '宸ヨ壓娴佸悜缂栧彿', width:160, }, { diff --git a/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/WorkPlan.tsx b/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/WorkPlan.tsx index befd88d..c371b80 100644 --- a/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/WorkPlan.tsx +++ b/PipeLineLems/pipelinelems_web/src/widgets/WorkPlan/Views/Pages/WorkPlan/WorkPlan.tsx @@ -25,8 +25,10 @@ import { injectModel } from '@/libs/Provider/Provider' // 寮曞叆鍏叡閫夐」閰嶇疆 import { - FILTER_MODE_OPTIONS_STRING + FILTER_MODE_OPTIONS_STRING_KEY } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions'; +// 寮曞叆鍏叡楂樼骇鏌ヨ宸ュ叿鏂囦欢 +import { commonSaveCurHighQueryData,setValueForCurHighQueryData,commonGetHighQueryForm,initQueryForm,GetFilteredData } from '@/utils/myHighQueryUtils'; interface RenderTableType { url?: string @@ -69,17 +71,12 @@ //瀹氫箟楂樼骇鏌ヨ寮曠敤 const workPlanQueryDrawerRef=ref(null); - // 鏂板鐨勬煡璇㈡潯浠� - const queryForm = ref({ - searchVal: '', - str_searchFormInputAttrs:[], - searchVal_FilterMode:'' - }) + //瀹氫箟鏁翠綋妯$硦鏌ヨ鐨勫垪鏁扮粍(娉ㄦ剰锛氬繀椤诲ぇ灏忓啓璺熷悗绔殑瀹炰綋绫诲睘鎬у悕涓�鑷达紝鍚﹀垯浼氬鑷村尮閰嶄笉瀵圭殑闂) const _searchFormInputAttrs = ref([ - 'TaskCode','DataIdentifier','MaterialMode','MarkingContent','WeldingHeatInput','PipeAllowableStress','FactoryCode','ProductCode','WorkstationCode','EquipmentCode','ProdLineCode','ShipNumber','ProjectNumber','ProcessName','PipeFittingCode','PreSerialNumber','PipeSpecCode','PipeSectionName','Material','ProcessRouteNumber','TeamInfo','Timestamp','CreatorName','LastModifierName','Remark' + 'TaskCode','PipeSpecCode','PipeSectionName','PipeSpecMode','ProcessName','ShipNumber','ProjectNumber','ProcessRouteNumber','DataIdentifier','MaterialMode','MarkingContent','WeldingHeatInput','PipeAllowableStress','FactoryCode','ProductCode','WorkstationCode','EquipmentCode','ProdLineCode','PipeFittingCode','PreSerialNumber','Material','TeamInfo','Timestamp','CreatorName','LastModifierName','Remark' ]); - const searchFormInputAttrs_Placeholder = ref('璇疯緭鍏ヤ换鍔$紪鐮�/鍘熸枡鏍囪瘑/鍘熸枡鍨嬪彿/鎵撶爜鍐呭/娉曞叞鍏О鍘嬪姏/娉曞叞鍐茬爜鍐呭/宸ュ巶浠g爜/浜у搧浠g爜/宸ヤ綅浠g爜/璁惧浠g爜/浜х嚎缂栫爜/鑸瑰彿/椤圭洰鍙�/宸ュ簭鍚嶇О/绠′欢缂栫爜/椤哄簭鍙�/绠℃缂栫爜/绠℃鍚嶇О/鏉愯川/宸ヨ壓娴佸悜缂栧彿/鐝粍淇℃伅/鏃堕棿鎴�/鍒涘缓浜�/淇敼浜�/澶囨敞'); + const searchFormInputAttrs_Placeholder = ref('璇疯緭鍏ヤ换鍔$紪鐮�/绠℃缂栫爜/绠℃鍚嶇О/绠℃鍨嬪彿/宸ュ簭鍚嶇О/鑸瑰彿/椤圭洰鍙�/宸ヨ壓娴佸悜缂栧彿/鍘熸枡鏍囪瘑/鍘熸枡鍨嬪彿/鎵撶爜鍐呭/娉曞叞鍏О鍘嬪姏/娉曞叞鍐茬爜鍐呭/宸ュ巶浠g爜/浜у搧浠g爜/宸ヤ綅浠g爜/璁惧浠g爜/浜х嚎缂栫爜/绠′欢缂栫爜/椤哄簭鍙�/鏉愯川/鐝粍淇℃伅/鏃堕棿鎴�/鍒涘缓浜�/淇敼浜�/澶囨敞'); // 鍔ㄦ�佹灇涓鹃�夐」 @@ -111,69 +108,40 @@ } } - // 瀹氫箟鍝嶅簲寮忔煡璇㈡暟鎹� - const _curHighQueryData = ref({ searchVal: '',str_searchFormInputAttrs:[],searchVal_FilterMode:'' }); + /*******************************************************[楂樼骇鏌ヨ]寮�濮�********************************************************************************* */ // 缁勪欢鎸傝浇鏃惰幏鍙栨灇涓炬暟鎹� onMounted(() => { fetchEnumData() - queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING[0]?.value || ''; - _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode; - _curHighQueryData.value.str_searchFormInputAttrs = _searchFormInputAttrs.value; + resetQuery(); }) - - // 鏂扮増鐨勬煡璇㈡柟娉曪紙涓婚〉闈腑鐨勬寜閽�愭煡璇€�戯級 - const handleQueryForMain = async () => { - _curHighQueryData.value.searchVal = queryForm.value.searchVal; - _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode; - _curHighQueryData.value.str_searchFormInputAttrs = _searchFormInputAttrs.value; - tableRef.value.getList(_curHighQueryData.value) - } - // 鏂扮増鐨勬煡璇㈡柟娉曪紙楂樼骇鏌ヨ涓殑鎸夐挳銆愭煡璇€�戯級 - const handleQuery = async (extraParams = {}) => { - let filteredData = commonGetHighQueryForm(extraParams); - commonSaveCurHighQueryData(filteredData); - tableRef.value.getList(filteredData) - } - // 鏂扮増鐨勬煡璇㈤噸缃� - const resetQuery = () => { - queryForm.value.searchVal = '' - queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING[0]?.value || ''; - queryForm.value.str_searchFormInputAttrs=_searchFormInputAttrs.value; - } - //鏂扮増鐨勫鍑烘柟娉� - const handleExport=()=>{ - onExport(_curHighQueryData.value); - } - // 鏂扮増鐨勬煡璇㈠脊鍑烘鍏抽棴鏂规硶 - const closeQuery = (extraParams={}) => { - let filteredData = commonGetHighQueryForm(extraParams); - console.log("closeQuery鏂规硶"); - console.log(filteredData); - commonSaveCurHighQueryData(filteredData); - } - //淇濆瓨鏌ヨ鍊� - const commonSaveCurHighQueryData=(filteredData={})=>{ - _curHighQueryData.value = { ..._curHighQueryData.value, ...filteredData }; - _curHighQueryData.value.searchVal = queryForm.value.searchVal - _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode - _curHighQueryData.value.str_searchFormInputAttrs =_searchFormInputAttrs.value; - } - //鑾峰彇楂樼骇鏌ヨ寮瑰嚭妗嗙殑鏌ヨ鍊� - const commonGetHighQueryForm=(extraParams={})=>{ - // 杩囨护鎺� undefined 鐨勫�� - let filteredData = Object.assign( - {}, - ...Object.entries(extraParams).map(([key, value]) => - value !== undefined ? { [key]: value } : {} - ) - ) - //缁勫悎妯$硦鏌ヨ - filteredData.searchVal = queryForm.value.searchVal - filteredData.searchVal_FilterMode = queryForm.value.searchVal_FilterMode - filteredData.str_searchFormInputAttrs =_searchFormInputAttrs.value; - return filteredData; - } - + // 鏂板鐨勬煡璇㈡潯浠� + const queryForm = ref({ searchVal: '',str_searchFormInputAttrs:[],searchVal_FilterMode:'' }); + // 瀹氫箟鍝嶅簲寮忔煡璇㈡暟鎹� + const _curHighQueryData = ref({ searchVal: '',str_searchFormInputAttrs:[],searchVal_FilterMode:'' }); + // 鏂扮増鐨勬煡璇㈡柟娉曪紙涓婚〉闈腑鐨勬寜閽�愭煡璇€�戯級 + const handleQueryForMain = async () => { + setValueForCurHighQueryData(_curHighQueryData,queryForm,_searchFormInputAttrs); + tableRef.value.getList(_curHighQueryData.value) + } + // 鏂扮増鐨勬煡璇㈡柟娉曪紙楂樼骇鏌ヨ涓殑鎸夐挳銆愭煡璇€�戯級 + const handleQuery = async (extraParams = {}) => { + let filteredData = GetFilteredData(extraParams,queryForm,_searchFormInputAttrs,_curHighQueryData); + tableRef.value.getList(filteredData) + } + // 鏂扮増鐨勬煡璇㈤噸缃� + const resetQuery = () => { + initQueryForm(queryForm,_searchFormInputAttrs,FILTER_MODE_OPTIONS_STRING_KEY); + setValueForCurHighQueryData(_curHighQueryData,queryForm,_searchFormInputAttrs); + } + //鏂扮増鐨勫鍑烘柟娉� + const handleExport=()=>{ + onExport(_curHighQueryData.value); + } + // 鏂扮増鐨勬煡璇㈠脊鍑烘鍏抽棴鏂规硶 + const closeQuery = (extraParams={}) => { + GetFilteredData(extraParams,queryForm,_searchFormInputAttrs,_curHighQueryData); + } + /*******************************************************[楂樼骇鏌ヨ]缁撴潫********************************************************************************* */ /** * @returns 琛ㄦ牸 @@ -370,7 +338,7 @@ placeholder="璇烽�夋嫨" class={styles.formItem} > - {FILTER_MODE_OPTIONS_STRING.map((option) => ( + {FILTER_MODE_OPTIONS_STRING_KEY.map((option) => ( <ElOption key={option.value} label={option.label} diff --git a/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskDrawer.tsx index 23527b4..f4b02ad 100644 --- a/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskDrawer.tsx +++ b/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskDrawer.tsx @@ -98,6 +98,48 @@ rules: [{required: true, message: '浠诲姟缂栫爜涓嶈兘涓虹┖', trigger: 'blur' }], }, { + label: '绠℃缂栫爜', + prop: 'pipeSpecCode', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ娈电紪鐮�', + }, + { + label: '绠℃鍚嶇О', + prop: 'pipeSectionName', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ娈靛悕绉�', + }, + { + label: '绠℃鍨嬪彿', + prop: 'pipeSpecMode', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ娈靛瀷鍙�', + }, + { + label: '宸ュ簭鍚嶇О', + prop: 'processName', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ュ伐搴忓悕绉�', + }, + { + label: '鑸瑰彿', + prop: 'shipNumber', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ヨ埞鍙�', + }, + { + label: '椤圭洰鍙�', + prop: 'projectNumber', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ラ」鐩彿', + }, + { label: '璁″垝鐘舵��', prop: 'workPlanStatus', el: 'select', @@ -116,6 +158,13 @@ //disabled: disabled, placeholder: '璇疯緭鍏ュ彨鏂欑姸鎬�', rules: [{required: true, message: '鍙枡鐘舵�佷笉鑳戒负绌�', trigger: 'blur' }], + }, + { + label: '宸ヨ壓娴佸悜缂栧彿', + prop: 'processRouteNumber', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ュ伐鑹烘祦鍚戠紪鍙�', }, { label: '鍘熸枡鏍囪瘑', @@ -324,27 +373,6 @@ placeholder: '璇疯緭鍏ヤ骇绾跨紪鐮�', }, { - label: '鑸瑰彿', - prop: 'shipNumber', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ヨ埞鍙�', - }, - { - label: '椤圭洰鍙�', - prop: 'projectNumber', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ラ」鐩彿', - }, - { - label: '宸ュ簭鍚嶇О', - prop: 'processName', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ュ伐搴忓悕绉�', - }, - { label: '绠′欢缂栫爜', prop: 'pipeFittingCode', el: 'input', @@ -357,20 +385,6 @@ el: 'input', //disabled: disabled, placeholder: '璇疯緭鍏ラ『搴忓彿', - }, - { - label: '绠℃缂栫爜', - prop: 'pipeSpecCode', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ョ娈电紪鐮�', - }, - { - label: '绠℃鍚嶇О', - prop: 'pipeSectionName', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ョ娈靛悕绉�', }, { label: '澶栧緞(mm)', @@ -412,13 +426,6 @@ el: 'input', //disabled: disabled, placeholder: '璇疯緭鍏ユ潗璐�', - }, - { - label: '宸ヨ壓娴佸悜缂栧彿', - prop: 'processRouteNumber', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ュ伐鑹烘祦鍚戠紪鍙�', }, { label: '璁″垝寮�濮嬫椂闂�', diff --git a/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskQueryDrawer.tsx b/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskQueryDrawer.tsx index beddd1a..3470564 100644 --- a/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskQueryDrawer.tsx +++ b/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Controllers/WorkTaskQueryDrawer.tsx @@ -116,6 +116,84 @@ } }, { + label: '绠℃缂栫爜', + prop: 'pipeSpecCode', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ娈电紪鐮�', + highSelectAttrs:{ + prop: 'pipeSpecCode_FilterMode', + el: 'select', + placeholder: '璇烽�夋嫨', + options:FILTER_MODE_OPTIONS_STRING + } + }, + { + label: '绠℃鍚嶇О', + prop: 'pipeSectionName', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ娈靛悕绉�', + highSelectAttrs:{ + prop: 'pipeSectionName_FilterMode', + el: 'select', + placeholder: '璇烽�夋嫨', + options:FILTER_MODE_OPTIONS_STRING + } + }, + { + label: '绠℃鍨嬪彿', + prop: 'pipeSpecMode', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ョ娈靛瀷鍙�', + highSelectAttrs:{ + prop: 'pipeSpecMode_FilterMode', + el: 'select', + placeholder: '璇烽�夋嫨', + options:FILTER_MODE_OPTIONS_STRING + } + }, + { + label: '宸ュ簭鍚嶇О', + prop: 'processName', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ュ伐搴忓悕绉�', + highSelectAttrs:{ + prop: 'processName_FilterMode', + el: 'select', + placeholder: '璇烽�夋嫨', + options:FILTER_MODE_OPTIONS_STRING + } + }, + { + label: '鑸瑰彿', + prop: 'shipNumber', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ヨ埞鍙�', + highSelectAttrs:{ + prop: 'shipNumber_FilterMode', + el: 'select', + placeholder: '璇烽�夋嫨', + options:FILTER_MODE_OPTIONS_STRING + } + }, + { + label: '椤圭洰鍙�', + prop: 'projectNumber', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ラ」鐩彿', + highSelectAttrs:{ + prop: 'projectNumber_FilterMode', + el: 'select', + placeholder: '璇烽�夋嫨', + options:FILTER_MODE_OPTIONS_STRING + } + }, + { label: '璁″垝鐘舵��', prop: 'workPlanStatus', el: 'select', @@ -143,6 +221,19 @@ el: 'select', placeholder: '璇烽�夋嫨', options:FILTER_MODE_OPTIONS_BOOL + } + }, + { + label: '宸ヨ壓娴佸悜缂栧彿', + prop: 'processRouteNumber', + el: 'input', + //disabled: disabled, + placeholder: '璇疯緭鍏ュ伐鑹烘祦鍚戠紪鍙�', + highSelectAttrs:{ + prop: 'processRouteNumber_FilterMode', + el: 'select', + placeholder: '璇烽�夋嫨', + options:FILTER_MODE_OPTIONS_STRING } }, { @@ -452,45 +543,6 @@ } }, { - label: '鑸瑰彿', - prop: 'shipNumber', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ヨ埞鍙�', - highSelectAttrs:{ - prop: 'shipNumber_FilterMode', - el: 'select', - placeholder: '璇烽�夋嫨', - options:FILTER_MODE_OPTIONS_STRING - } - }, - { - label: '椤圭洰鍙�', - prop: 'projectNumber', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ラ」鐩彿', - highSelectAttrs:{ - prop: 'projectNumber_FilterMode', - el: 'select', - placeholder: '璇烽�夋嫨', - options:FILTER_MODE_OPTIONS_STRING - } - }, - { - label: '宸ュ簭鍚嶇О', - prop: 'processName', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ュ伐搴忓悕绉�', - highSelectAttrs:{ - prop: 'processName_FilterMode', - el: 'select', - placeholder: '璇烽�夋嫨', - options:FILTER_MODE_OPTIONS_STRING - } - }, - { label: '绠′欢缂栫爜', prop: 'pipeFittingCode', el: 'input', @@ -511,32 +563,6 @@ placeholder: '璇疯緭鍏ラ『搴忓彿', highSelectAttrs:{ prop: 'preSerialNumber_FilterMode', - el: 'select', - placeholder: '璇烽�夋嫨', - options:FILTER_MODE_OPTIONS_STRING - } - }, - { - label: '绠℃缂栫爜', - prop: 'pipeSpecCode', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ョ娈电紪鐮�', - highSelectAttrs:{ - prop: 'pipeSpecCode_FilterMode', - el: 'select', - placeholder: '璇烽�夋嫨', - options:FILTER_MODE_OPTIONS_STRING - } - }, - { - label: '绠℃鍚嶇О', - prop: 'pipeSectionName', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ョ娈靛悕绉�', - highSelectAttrs:{ - prop: 'pipeSectionName_FilterMode', el: 'select', placeholder: '璇烽�夋嫨', options:FILTER_MODE_OPTIONS_STRING @@ -594,19 +620,6 @@ placeholder: '璇疯緭鍏ユ潗璐�', highSelectAttrs:{ prop: 'material_FilterMode', - el: 'select', - placeholder: '璇烽�夋嫨', - options:FILTER_MODE_OPTIONS_STRING - } - }, - { - label: '宸ヨ壓娴佸悜缂栧彿', - prop: 'processRouteNumber', - el: 'input', - //disabled: disabled, - placeholder: '璇疯緭鍏ュ伐鑹烘祦鍚戠紪鍙�', - highSelectAttrs:{ - prop: 'processRouteNumber_FilterMode', el: 'select', placeholder: '璇烽�夋嫨', options:FILTER_MODE_OPTIONS_STRING diff --git a/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/WorkTask/Config.ts b/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/WorkTask/Config.ts index 30f5152..c52afc0 100644 --- a/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/WorkTask/Config.ts +++ b/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/WorkTask/Config.ts @@ -15,6 +15,36 @@ width:160, }, { + field: 'pipeSpecCode', + title: '绠℃缂栫爜', + width:160, +}, +{ + field: 'pipeSectionName', + title: '绠℃鍚嶇О', + width:160, +}, +{ + field: 'pipeSpecMode', + title: '绠℃鍨嬪彿', + width:160, +}, +{ + field: 'processName', + title: '宸ュ簭鍚嶇О', + width:160, +}, +{ + field: 'shipNumber', + title: '鑸瑰彿', + width:160, +}, +{ + field: 'projectNumber', + title: '椤圭洰鍙�', + width:160, +}, +{ field: 'workPlanStatusDesc', title: '璁″垝鐘舵��', width:160, @@ -22,6 +52,11 @@ { field: 'callMaterialStatusDesc', title: '鍙枡鐘舵��', + width:160, +}, +{ + field: 'processRouteNumber', + title: '宸ヨ壓娴佸悜缂栧彿', width:160, }, { @@ -115,21 +150,6 @@ width:160, }, { - field: 'shipNumber', - title: '鑸瑰彿', - width:160, -}, -{ - field: 'projectNumber', - title: '椤圭洰鍙�', - width:160, -}, -{ - field: 'processName', - title: '宸ュ簭鍚嶇О', - width:160, -}, -{ field: 'pipeFittingCode', title: '绠′欢缂栫爜', width:160, @@ -137,16 +157,6 @@ { field: 'preSerialNumber', title: '椤哄簭鍙�', - width:160, -}, -{ - field: 'pipeSpecCode', - title: '绠℃缂栫爜', - width:160, -}, -{ - field: 'pipeSectionName', - title: '绠℃鍚嶇О', width:160, }, { @@ -162,11 +172,6 @@ { field: 'material', title: '鏉愯川', - width:160, -}, -{ - field: 'processRouteNumber', - title: '宸ヨ壓娴佸悜缂栧彿', width:160, }, { diff --git a/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/WorkTask/WorkTask.tsx b/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/WorkTask/WorkTask.tsx index 8045a4e..61dc33e 100644 --- a/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/WorkTask/WorkTask.tsx +++ b/PipeLineLems/pipelinelems_web/src/widgets/WorkTask/Views/Pages/WorkTask/WorkTask.tsx @@ -25,8 +25,10 @@ import { injectModel } from '@/libs/Provider/Provider' // 寮曞叆鍏叡閫夐」閰嶇疆 import { - FILTER_MODE_OPTIONS_STRING + FILTER_MODE_OPTIONS_STRING_KEY } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions'; +// 寮曞叆鍏叡楂樼骇鏌ヨ宸ュ叿鏂囦欢 +import { commonSaveCurHighQueryData,setValueForCurHighQueryData,commonGetHighQueryForm,initQueryForm,GetFilteredData } from '@/utils/myHighQueryUtils'; interface RenderTableType { url?: string @@ -69,17 +71,12 @@ //瀹氫箟楂樼骇鏌ヨ寮曠敤 const workTaskQueryDrawerRef=ref(null); - // 鏂板鐨勬煡璇㈡潯浠� - const queryForm = ref({ - searchVal: '', - str_searchFormInputAttrs:[], - searchVal_FilterMode:'' - }) + //瀹氫箟鏁翠綋妯$硦鏌ヨ鐨勫垪鏁扮粍(娉ㄦ剰锛氬繀椤诲ぇ灏忓啓璺熷悗绔殑瀹炰綋绫诲睘鎬у悕涓�鑷达紝鍚﹀垯浼氬鑷村尮閰嶄笉瀵圭殑闂) const _searchFormInputAttrs = ref([ - 'Son_TaskCode','TaskCode','DataIdentifier','MaterialMode','MarkingContent','WeldingHeatInput','PipeAllowableStress','FactoryCode','ProductCode','WorkstationCode','EquipmentCode','ProdLineCode','ShipNumber','ProjectNumber','ProcessName','PipeFittingCode','PreSerialNumber','PipeSpecCode','PipeSectionName','Material','ProcessRouteNumber','TeamInfo','Timestamp','CreatorName','LastModifierName','Remark' + 'Son_TaskCode','TaskCode','PipeSpecCode','PipeSectionName','PipeSpecMode','ProcessName','ShipNumber','ProjectNumber','ProcessRouteNumber','DataIdentifier','MaterialMode','MarkingContent','WeldingHeatInput','PipeAllowableStress','FactoryCode','ProductCode','WorkstationCode','EquipmentCode','ProdLineCode','PipeFittingCode','PreSerialNumber','Material','TeamInfo','Timestamp','CreatorName','LastModifierName','Remark' ]); - const searchFormInputAttrs_Placeholder = ref('璇疯緭鍏ュ瓙浠诲姟缂栫爜/浠诲姟缂栫爜/鍘熸枡鏍囪瘑/鍘熸枡鍨嬪彿/鎵撶爜鍐呭/娉曞叞鍏О鍘嬪姏/娉曞叞鍐茬爜鍐呭/宸ュ巶浠g爜/浜у搧浠g爜/宸ヤ綅浠g爜/璁惧浠g爜/浜х嚎缂栫爜/鑸瑰彿/椤圭洰鍙�/宸ュ簭鍚嶇О/绠′欢缂栫爜/椤哄簭鍙�/绠℃缂栫爜/绠℃鍚嶇О/鏉愯川/宸ヨ壓娴佸悜缂栧彿/鐝粍淇℃伅/鏃堕棿鎴�/鍒涘缓浜�/淇敼浜�/澶囨敞'); + const searchFormInputAttrs_Placeholder = ref('璇疯緭鍏ュ瓙浠诲姟缂栫爜/浠诲姟缂栫爜/绠℃缂栫爜/绠℃鍚嶇О/绠℃鍨嬪彿/宸ュ簭鍚嶇О/鑸瑰彿/椤圭洰鍙�/宸ヨ壓娴佸悜缂栧彿/鍘熸枡鏍囪瘑/鍘熸枡鍨嬪彿/鎵撶爜鍐呭/娉曞叞鍏О鍘嬪姏/娉曞叞鍐茬爜鍐呭/宸ュ巶浠g爜/浜у搧浠g爜/宸ヤ綅浠g爜/璁惧浠g爜/浜х嚎缂栫爜/绠′欢缂栫爜/椤哄簭鍙�/鏉愯川/鐝粍淇℃伅/鏃堕棿鎴�/鍒涘缓浜�/淇敼浜�/澶囨敞'); // 鍔ㄦ�佹灇涓鹃�夐」 @@ -111,69 +108,40 @@ } } - // 瀹氫箟鍝嶅簲寮忔煡璇㈡暟鎹� - const _curHighQueryData = ref({ searchVal: '',str_searchFormInputAttrs:[],searchVal_FilterMode:'' }); + /*******************************************************[楂樼骇鏌ヨ]寮�濮�********************************************************************************* */ // 缁勪欢鎸傝浇鏃惰幏鍙栨灇涓炬暟鎹� onMounted(() => { fetchEnumData() - queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING[0]?.value || ''; - _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode; - _curHighQueryData.value.str_searchFormInputAttrs = _searchFormInputAttrs.value; + resetQuery(); }) - - // 鏂扮増鐨勬煡璇㈡柟娉曪紙涓婚〉闈腑鐨勬寜閽�愭煡璇€�戯級 - const handleQueryForMain = async () => { - _curHighQueryData.value.searchVal = queryForm.value.searchVal; - _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode; - _curHighQueryData.value.str_searchFormInputAttrs = _searchFormInputAttrs.value; - tableRef.value.getList(_curHighQueryData.value) - } - // 鏂扮増鐨勬煡璇㈡柟娉曪紙楂樼骇鏌ヨ涓殑鎸夐挳銆愭煡璇€�戯級 - const handleQuery = async (extraParams = {}) => { - let filteredData = commonGetHighQueryForm(extraParams); - commonSaveCurHighQueryData(filteredData); - tableRef.value.getList(filteredData) - } - // 鏂扮増鐨勬煡璇㈤噸缃� - const resetQuery = () => { - queryForm.value.searchVal = '' - queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING[0]?.value || ''; - queryForm.value.str_searchFormInputAttrs=_searchFormInputAttrs.value; - } - //鏂扮増鐨勫鍑烘柟娉� - const handleExport=()=>{ - onExport(_curHighQueryData.value); - } - // 鏂扮増鐨勬煡璇㈠脊鍑烘鍏抽棴鏂规硶 - const closeQuery = (extraParams={}) => { - let filteredData = commonGetHighQueryForm(extraParams); - console.log("closeQuery鏂规硶"); - console.log(filteredData); - commonSaveCurHighQueryData(filteredData); - } - //淇濆瓨鏌ヨ鍊� - const commonSaveCurHighQueryData=(filteredData={})=>{ - _curHighQueryData.value = { ..._curHighQueryData.value, ...filteredData }; - _curHighQueryData.value.searchVal = queryForm.value.searchVal - _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode - _curHighQueryData.value.str_searchFormInputAttrs =_searchFormInputAttrs.value; - } - //鑾峰彇楂樼骇鏌ヨ寮瑰嚭妗嗙殑鏌ヨ鍊� - const commonGetHighQueryForm=(extraParams={})=>{ - // 杩囨护鎺� undefined 鐨勫�� - let filteredData = Object.assign( - {}, - ...Object.entries(extraParams).map(([key, value]) => - value !== undefined ? { [key]: value } : {} - ) - ) - //缁勫悎妯$硦鏌ヨ - filteredData.searchVal = queryForm.value.searchVal - filteredData.searchVal_FilterMode = queryForm.value.searchVal_FilterMode - filteredData.str_searchFormInputAttrs =_searchFormInputAttrs.value; - return filteredData; - } - + // 鏂板鐨勬煡璇㈡潯浠� + const queryForm = ref({ searchVal: '',str_searchFormInputAttrs:[],searchVal_FilterMode:'' }); + // 瀹氫箟鍝嶅簲寮忔煡璇㈡暟鎹� + const _curHighQueryData = ref({ searchVal: '',str_searchFormInputAttrs:[],searchVal_FilterMode:'' }); + // 鏂扮増鐨勬煡璇㈡柟娉曪紙涓婚〉闈腑鐨勬寜閽�愭煡璇€�戯級 + const handleQueryForMain = async () => { + setValueForCurHighQueryData(_curHighQueryData,queryForm,_searchFormInputAttrs); + tableRef.value.getList(_curHighQueryData.value) + } + // 鏂扮増鐨勬煡璇㈡柟娉曪紙楂樼骇鏌ヨ涓殑鎸夐挳銆愭煡璇€�戯級 + const handleQuery = async (extraParams = {}) => { + let filteredData = GetFilteredData(extraParams,queryForm,_searchFormInputAttrs,_curHighQueryData); + tableRef.value.getList(filteredData) + } + // 鏂扮増鐨勬煡璇㈤噸缃� + const resetQuery = () => { + initQueryForm(queryForm,_searchFormInputAttrs,FILTER_MODE_OPTIONS_STRING_KEY); + setValueForCurHighQueryData(_curHighQueryData,queryForm,_searchFormInputAttrs); + } + //鏂扮増鐨勫鍑烘柟娉� + const handleExport=()=>{ + onExport(_curHighQueryData.value); + } + // 鏂扮増鐨勬煡璇㈠脊鍑烘鍏抽棴鏂规硶 + const closeQuery = (extraParams={}) => { + GetFilteredData(extraParams,queryForm,_searchFormInputAttrs,_curHighQueryData); + } + /*******************************************************[楂樼骇鏌ヨ]缁撴潫********************************************************************************* */ /** * @returns 琛ㄦ牸 @@ -370,7 +338,7 @@ placeholder="璇烽�夋嫨" class={styles.formItem} > - {FILTER_MODE_OPTIONS_STRING.map((option) => ( + {FILTER_MODE_OPTIONS_STRING_KEY.map((option) => ( <ElOption key={option.value} label={option.label} diff --git a/PipeLineLems/pipelinelems_web/vite.lib.config.ts b/PipeLineLems/pipelinelems_web/vite.lib.config.ts index 78633a2..146df54 100644 --- a/PipeLineLems/pipelinelems_web/vite.lib.config.ts +++ b/PipeLineLems/pipelinelems_web/vite.lib.config.ts @@ -69,7 +69,8 @@ const library: any = getWidgetNames.map((name) => { return { - outDir: 'dist', + //outDir: 'dist', + outDir: 'D:/Program Files/CMS Editor/host/wwwroot/widgets',//鍙戝竷鍒版寚瀹氱洰褰曚腑 target: 'ES2022', mode: 'development', rollupOptions: { diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/GetWorkPlanInput.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/GetWorkPlanInput.cs index 55d440c..12db4f7 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/GetWorkPlanInput.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/GetWorkPlanInput.cs @@ -55,6 +55,66 @@ public SearchFilterModeEnum TaskCode_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; /// <summary> + /// 绠℃缂栫爜 + /// </summary> + public string PipeSpecCode { get; set; } + + /// <summary> + /// 绠℃缂栫爜-鏌ヨ鍏崇郴杩愮畻绗� + /// </summary> + public SearchFilterModeEnum PipeSpecCode_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; + + /// <summary> + /// 绠℃鍚嶇О + /// </summary> + public string PipeSectionName { get; set; } + + /// <summary> + /// 绠℃鍚嶇О-鏌ヨ鍏崇郴杩愮畻绗� + /// </summary> + public SearchFilterModeEnum PipeSectionName_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; + + /// <summary> + /// 绠℃鍨嬪彿 + /// </summary> + public string PipeSpecMode { get; set; } + + /// <summary> + /// 绠℃鍨嬪彿-鏌ヨ鍏崇郴杩愮畻绗� + /// </summary> + public SearchFilterModeEnum PipeSpecMode_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; + + /// <summary> + /// 宸ュ簭鍚嶇О + /// </summary> + public string ProcessName { get; set; } + + /// <summary> + /// 宸ュ簭鍚嶇О-鏌ヨ鍏崇郴杩愮畻绗� + /// </summary> + public SearchFilterModeEnum ProcessName_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; + + /// <summary> + /// 鑸瑰彿 + /// </summary> + public string ShipNumber { get; set; } + + /// <summary> + /// 鑸瑰彿-鏌ヨ鍏崇郴杩愮畻绗� + /// </summary> + public SearchFilterModeEnum ShipNumber_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; + + /// <summary> + /// 椤圭洰鍙� + /// </summary> + public string ProjectNumber { get; set; } + + /// <summary> + /// 椤圭洰鍙�-鏌ヨ鍏崇郴杩愮畻绗� + /// </summary> + public SearchFilterModeEnum ProjectNumber_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; + + /// <summary> /// 璁″垝鐘舵�� /// </summary> public WorkPlanStatusEnum? WorkPlanStatus { get; set; } @@ -73,6 +133,16 @@ /// 鍙枡鐘舵��-鏌ヨ鍏崇郴杩愮畻绗� /// </summary> public SearchFilterModeEnum CallMaterialStatus_FilterMode { get; set; }= SearchFilterModeEnum.绮惧噯鏌ヨ; + + /// <summary> + /// 宸ヨ壓娴佸悜缂栧彿 + /// </summary> + public string ProcessRouteNumber { get; set; } + + /// <summary> + /// 宸ヨ壓娴佸悜缂栧彿-鏌ヨ鍏崇郴杩愮畻绗� + /// </summary> + public SearchFilterModeEnum ProcessRouteNumber_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; /// <summary> /// 鍘熸枡鏍囪瘑 @@ -255,36 +325,6 @@ public SearchFilterModeEnum ProdLineCode_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; /// <summary> - /// 鑸瑰彿 - /// </summary> - public string ShipNumber { get; set; } - - /// <summary> - /// 鑸瑰彿-鏌ヨ鍏崇郴杩愮畻绗� - /// </summary> - public SearchFilterModeEnum ShipNumber_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; - - /// <summary> - /// 椤圭洰鍙� - /// </summary> - public string ProjectNumber { get; set; } - - /// <summary> - /// 椤圭洰鍙�-鏌ヨ鍏崇郴杩愮畻绗� - /// </summary> - public SearchFilterModeEnum ProjectNumber_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; - - /// <summary> - /// 宸ュ簭鍚嶇О - /// </summary> - public string ProcessName { get; set; } - - /// <summary> - /// 宸ュ簭鍚嶇О-鏌ヨ鍏崇郴杩愮畻绗� - /// </summary> - public SearchFilterModeEnum ProcessName_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; - - /// <summary> /// 绠′欢缂栫爜 /// </summary> public string PipeFittingCode { get; set; } @@ -303,26 +343,6 @@ /// 椤哄簭鍙�-鏌ヨ鍏崇郴杩愮畻绗� /// </summary> public SearchFilterModeEnum PreSerialNumber_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; - - /// <summary> - /// 绠℃缂栫爜 - /// </summary> - public string PipeSpecCode { get; set; } - - /// <summary> - /// 绠℃缂栫爜-鏌ヨ鍏崇郴杩愮畻绗� - /// </summary> - public SearchFilterModeEnum PipeSpecCode_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; - - /// <summary> - /// 绠℃鍚嶇О - /// </summary> - public string PipeSectionName { get; set; } - - /// <summary> - /// 绠℃鍚嶇О-鏌ヨ鍏崇郴杩愮畻绗� - /// </summary> - public SearchFilterModeEnum PipeSectionName_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; /// <summary> /// 澶栧緞(mm) @@ -353,16 +373,6 @@ /// 鏉愯川-鏌ヨ鍏崇郴杩愮畻绗� /// </summary> public SearchFilterModeEnum Material_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; - - /// <summary> - /// 宸ヨ壓娴佸悜缂栧彿 - /// </summary> - public string ProcessRouteNumber { get; set; } - - /// <summary> - /// 宸ヨ壓娴佸悜缂栧彿-鏌ヨ鍏崇郴杩愮畻绗� - /// </summary> - public SearchFilterModeEnum ProcessRouteNumber_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; /// <summary> /// 璁″垝寮�濮嬫椂闂� diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/SendFlangeCodeInput.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/SendFlangeCodeInput.cs new file mode 100644 index 0000000..c8c633d --- /dev/null +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/SendFlangeCodeInput.cs @@ -0,0 +1,27 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan +{ + /// <summary> + /// 涓嬪彂娉曞叞鍐茬爜 杈撳叆鍙傛暟妯″瀷 + /// </summary> + [Serializable] + public class SendFlangeCodeInput + { + + /// <summary> + /// 瀛愪换鍔$紪鍙� + /// </summary> + public string Son_TaskCode { get; set; } + + /// <summary> + /// 浠诲姟缂栧彿 + /// </summary> + public string TaskCode { get; set; } + + } +} \ No newline at end of file diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanCreateOrUpdateDtoBase.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanCreateOrUpdateDtoBase.cs index dfadd18..650cd7e 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanCreateOrUpdateDtoBase.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanCreateOrUpdateDtoBase.cs @@ -15,6 +15,36 @@ public string TaskCode { get; set; } /// <summary> + /// 绠℃缂栫爜 + /// </summary> + public string? PipeSpecCode { get; set; } + + /// <summary> + /// 绠℃鍚嶇О + /// </summary> + public string? PipeSectionName { get; set; } + + /// <summary> + /// 绠℃鍨嬪彿 + /// </summary> + public string? PipeSpecMode { get; set; } + + /// <summary> + /// 宸ュ簭鍚嶇О + /// </summary> + public string? ProcessName { get; set; } + + /// <summary> + /// 鑸瑰彿 + /// </summary> + public string? ShipNumber { get; set; } + + /// <summary> + /// 椤圭洰鍙� + /// </summary> + public string? ProjectNumber { get; set; } + + /// <summary> /// 璁″垝鐘舵�� /// </summary> public WorkPlanStatusEnum WorkPlanStatus { get; set; } @@ -23,6 +53,11 @@ /// 鍙枡鐘舵�� /// </summary> public CallMaterialStatusEnum CallMaterialStatus { get; set; } + + /// <summary> + /// 宸ヨ壓娴佸悜缂栧彿 + /// </summary> + public string? ProcessRouteNumber { get; set; } /// <summary> /// 鍘熸枡鏍囪瘑 @@ -115,21 +150,6 @@ public string? ProdLineCode { get; set; } /// <summary> - /// 鑸瑰彿 - /// </summary> - public string? ShipNumber { get; set; } - - /// <summary> - /// 椤圭洰鍙� - /// </summary> - public string? ProjectNumber { get; set; } - - /// <summary> - /// 宸ュ簭鍚嶇О - /// </summary> - public string? ProcessName { get; set; } - - /// <summary> /// 绠′欢缂栫爜 /// </summary> public string? PipeFittingCode { get; set; } @@ -138,16 +158,6 @@ /// 椤哄簭鍙� /// </summary> public string? PreSerialNumber { get; set; } - - /// <summary> - /// 绠℃缂栫爜 - /// </summary> - public string? PipeSpecCode { get; set; } - - /// <summary> - /// 绠℃鍚嶇О - /// </summary> - public string? PipeSectionName { get; set; } /// <summary> /// 澶栧緞(mm) @@ -163,11 +173,6 @@ /// 鏉愯川 /// </summary> public string? Material { get; set; } - - /// <summary> - /// 宸ヨ壓娴佸悜缂栧彿 - /// </summary> - public string? ProcessRouteNumber { get; set; } /// <summary> /// 璁″垝寮�濮嬫椂闂� diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanDto.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanDto.cs index 5e9d63e..00573e9 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanDto.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanDto.cs @@ -18,6 +18,36 @@ public string TaskCode { get; set; } /// <summary> + /// 绠℃缂栫爜 + /// </summary> + public string? PipeSpecCode { get; set; } + + /// <summary> + /// 绠℃鍚嶇О + /// </summary> + public string? PipeSectionName { get; set; } + + /// <summary> + /// 绠℃鍨嬪彿 + /// </summary> + public string? PipeSpecMode { get; set; } + + /// <summary> + /// 宸ュ簭鍚嶇О + /// </summary> + public string? ProcessName { get; set; } + + /// <summary> + /// 鑸瑰彿 + /// </summary> + public string? ShipNumber { get; set; } + + /// <summary> + /// 椤圭洰鍙� + /// </summary> + public string? ProjectNumber { get; set; } + + /// <summary> /// 璁″垝鐘舵�� /// </summary> public WorkPlanStatusEnum WorkPlanStatus { get; set; } @@ -47,6 +77,11 @@ return GetEnumDescriptionUtil.GetEnumDescription(CallMaterialStatus); } } + /// <summary> + /// 宸ヨ壓娴佸悜缂栧彿 + /// </summary> + public string? ProcessRouteNumber { get; set; } + /// <summary> /// 鍘熸枡鏍囪瘑 /// </summary> @@ -138,21 +173,6 @@ public string? ProdLineCode { get; set; } /// <summary> - /// 鑸瑰彿 - /// </summary> - public string? ShipNumber { get; set; } - - /// <summary> - /// 椤圭洰鍙� - /// </summary> - public string? ProjectNumber { get; set; } - - /// <summary> - /// 宸ュ簭鍚嶇О - /// </summary> - public string? ProcessName { get; set; } - - /// <summary> /// 绠′欢缂栫爜 /// </summary> public string? PipeFittingCode { get; set; } @@ -161,16 +181,6 @@ /// 椤哄簭鍙� /// </summary> public string? PreSerialNumber { get; set; } - - /// <summary> - /// 绠℃缂栫爜 - /// </summary> - public string? PipeSpecCode { get; set; } - - /// <summary> - /// 绠℃鍚嶇О - /// </summary> - public string? PipeSectionName { get; set; } /// <summary> /// 澶栧緞(mm) @@ -186,11 +196,6 @@ /// 鏉愯川 /// </summary> public string? Material { get; set; } - - /// <summary> - /// 宸ヨ壓娴佸悜缂栧彿 - /// </summary> - public string? ProcessRouteNumber { get; set; } /// <summary> /// 璁″垝寮�濮嬫椂闂� diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanExportModel.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanExportModel.cs index 1e829f4..3262483 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanExportModel.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanExportModel.cs @@ -17,6 +17,42 @@ public string TaskCode { get; set; } /// <summary> + /// 绠℃缂栫爜 + /// </summary> + [ExcelColumn(Name = "绠℃缂栫爜", Width = 25)] + public string PipeSpecCode { get; set; } + + /// <summary> + /// 绠℃鍚嶇О + /// </summary> + [ExcelColumn(Name = "绠℃鍚嶇О", Width = 25)] + public string PipeSectionName { get; set; } + + /// <summary> + /// 绠℃鍨嬪彿 + /// </summary> + [ExcelColumn(Name = "绠℃鍨嬪彿", Width = 25)] + public string PipeSpecMode { get; set; } + + /// <summary> + /// 宸ュ簭鍚嶇О + /// </summary> + [ExcelColumn(Name = "宸ュ簭鍚嶇О", Width = 25)] + public string ProcessName { get; set; } + + /// <summary> + /// 鑸瑰彿 + /// </summary> + [ExcelColumn(Name = "鑸瑰彿", Width = 25)] + public string ShipNumber { get; set; } + + /// <summary> + /// 椤圭洰鍙� + /// </summary> + [ExcelColumn(Name = "椤圭洰鍙�", Width = 25)] + public string ProjectNumber { get; set; } + + /// <summary> /// 璁″垝鐘舵�� /// </summary> [ExcelColumn(Name = "璁″垝鐘舵��", Width = 25)] @@ -27,6 +63,12 @@ /// </summary> [ExcelColumn(Name = "鍙枡鐘舵��", Width = 25)] public CallMaterialStatusEnum CallMaterialStatus { get; set; } + + /// <summary> + /// 宸ヨ壓娴佸悜缂栧彿 + /// </summary> + [ExcelColumn(Name = "宸ヨ壓娴佸悜缂栧彿", Width = 25)] + public string ProcessRouteNumber { get; set; } /// <summary> /// 鍘熸枡鏍囪瘑 @@ -137,24 +179,6 @@ public string ProdLineCode { get; set; } /// <summary> - /// 鑸瑰彿 - /// </summary> - [ExcelColumn(Name = "鑸瑰彿", Width = 25)] - public string ShipNumber { get; set; } - - /// <summary> - /// 椤圭洰鍙� - /// </summary> - [ExcelColumn(Name = "椤圭洰鍙�", Width = 25)] - public string ProjectNumber { get; set; } - - /// <summary> - /// 宸ュ簭鍚嶇О - /// </summary> - [ExcelColumn(Name = "宸ュ簭鍚嶇О", Width = 25)] - public string ProcessName { get; set; } - - /// <summary> /// 绠′欢缂栫爜 /// </summary> [ExcelColumn(Name = "绠′欢缂栫爜", Width = 25)] @@ -165,18 +189,6 @@ /// </summary> [ExcelColumn(Name = "椤哄簭鍙�", Width = 25)] public string PreSerialNumber { get; set; } - - /// <summary> - /// 绠℃缂栫爜 - /// </summary> - [ExcelColumn(Name = "绠℃缂栫爜", Width = 25)] - public string PipeSpecCode { get; set; } - - /// <summary> - /// 绠℃鍚嶇О - /// </summary> - [ExcelColumn(Name = "绠℃鍚嶇О", Width = 25)] - public string PipeSectionName { get; set; } /// <summary> /// 澶栧緞(mm) @@ -195,12 +207,6 @@ /// </summary> [ExcelColumn(Name = "鏉愯川", Width = 25)] public string Material { get; set; } - - /// <summary> - /// 宸ヨ壓娴佸悜缂栧彿 - /// </summary> - [ExcelColumn(Name = "宸ヨ壓娴佸悜缂栧彿", Width = 25)] - public string ProcessRouteNumber { get; set; } /// <summary> /// 璁″垝寮�濮嬫椂闂� diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanInput.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanInput.cs index dfe7280..334a0e4 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanInput.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkPlan/WorkPlanInput.cs @@ -84,6 +84,11 @@ public string PipeSectionName { get; set; } /// <summary> + /// 绠℃鍨嬪彿 + /// </summary> + public string? PipeSpecMode { get; set; } + + /// <summary> /// 澶栧緞 /// </summary> public string OuterDiameter { get; set; } diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/GetWorkTaskInput.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/GetWorkTaskInput.cs index e0248d3..b502565 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/GetWorkTaskInput.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/GetWorkTaskInput.cs @@ -65,6 +65,66 @@ public SearchFilterModeEnum TaskCode_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; /// <summary> + /// 绠℃缂栫爜 + /// </summary> + public string PipeSpecCode { get; set; } + + /// <summary> + /// 绠℃缂栫爜-鏌ヨ鍏崇郴杩愮畻绗� + /// </summary> + public SearchFilterModeEnum PipeSpecCode_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; + + /// <summary> + /// 绠℃鍚嶇О + /// </summary> + public string PipeSectionName { get; set; } + + /// <summary> + /// 绠℃鍚嶇О-鏌ヨ鍏崇郴杩愮畻绗� + /// </summary> + public SearchFilterModeEnum PipeSectionName_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; + + /// <summary> + /// 绠℃鍨嬪彿 + /// </summary> + public string PipeSpecMode { get; set; } + + /// <summary> + /// 绠℃鍨嬪彿-鏌ヨ鍏崇郴杩愮畻绗� + /// </summary> + public SearchFilterModeEnum PipeSpecMode_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; + + /// <summary> + /// 宸ュ簭鍚嶇О + /// </summary> + public string ProcessName { get; set; } + + /// <summary> + /// 宸ュ簭鍚嶇О-鏌ヨ鍏崇郴杩愮畻绗� + /// </summary> + public SearchFilterModeEnum ProcessName_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; + + /// <summary> + /// 鑸瑰彿 + /// </summary> + public string ShipNumber { get; set; } + + /// <summary> + /// 鑸瑰彿-鏌ヨ鍏崇郴杩愮畻绗� + /// </summary> + public SearchFilterModeEnum ShipNumber_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; + + /// <summary> + /// 椤圭洰鍙� + /// </summary> + public string ProjectNumber { get; set; } + + /// <summary> + /// 椤圭洰鍙�-鏌ヨ鍏崇郴杩愮畻绗� + /// </summary> + public SearchFilterModeEnum ProjectNumber_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; + + /// <summary> /// 璁″垝鐘舵�� /// </summary> public WorkPlanStatusEnum? WorkPlanStatus { get; set; } @@ -83,6 +143,16 @@ /// 鍙枡鐘舵��-鏌ヨ鍏崇郴杩愮畻绗� /// </summary> public SearchFilterModeEnum CallMaterialStatus_FilterMode { get; set; }= SearchFilterModeEnum.绮惧噯鏌ヨ; + + /// <summary> + /// 宸ヨ壓娴佸悜缂栧彿 + /// </summary> + public string ProcessRouteNumber { get; set; } + + /// <summary> + /// 宸ヨ壓娴佸悜缂栧彿-鏌ヨ鍏崇郴杩愮畻绗� + /// </summary> + public SearchFilterModeEnum ProcessRouteNumber_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; /// <summary> /// 鍘熸枡鏍囪瘑 @@ -265,36 +335,6 @@ public SearchFilterModeEnum ProdLineCode_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; /// <summary> - /// 鑸瑰彿 - /// </summary> - public string ShipNumber { get; set; } - - /// <summary> - /// 鑸瑰彿-鏌ヨ鍏崇郴杩愮畻绗� - /// </summary> - public SearchFilterModeEnum ShipNumber_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; - - /// <summary> - /// 椤圭洰鍙� - /// </summary> - public string ProjectNumber { get; set; } - - /// <summary> - /// 椤圭洰鍙�-鏌ヨ鍏崇郴杩愮畻绗� - /// </summary> - public SearchFilterModeEnum ProjectNumber_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; - - /// <summary> - /// 宸ュ簭鍚嶇О - /// </summary> - public string ProcessName { get; set; } - - /// <summary> - /// 宸ュ簭鍚嶇О-鏌ヨ鍏崇郴杩愮畻绗� - /// </summary> - public SearchFilterModeEnum ProcessName_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; - - /// <summary> /// 绠′欢缂栫爜 /// </summary> public string PipeFittingCode { get; set; } @@ -313,26 +353,6 @@ /// 椤哄簭鍙�-鏌ヨ鍏崇郴杩愮畻绗� /// </summary> public SearchFilterModeEnum PreSerialNumber_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; - - /// <summary> - /// 绠℃缂栫爜 - /// </summary> - public string PipeSpecCode { get; set; } - - /// <summary> - /// 绠℃缂栫爜-鏌ヨ鍏崇郴杩愮畻绗� - /// </summary> - public SearchFilterModeEnum PipeSpecCode_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; - - /// <summary> - /// 绠℃鍚嶇О - /// </summary> - public string PipeSectionName { get; set; } - - /// <summary> - /// 绠℃鍚嶇О-鏌ヨ鍏崇郴杩愮畻绗� - /// </summary> - public SearchFilterModeEnum PipeSectionName_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; /// <summary> /// 澶栧緞(mm) @@ -363,16 +383,6 @@ /// 鏉愯川-鏌ヨ鍏崇郴杩愮畻绗� /// </summary> public SearchFilterModeEnum Material_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; - - /// <summary> - /// 宸ヨ壓娴佸悜缂栧彿 - /// </summary> - public string ProcessRouteNumber { get; set; } - - /// <summary> - /// 宸ヨ壓娴佸悜缂栧彿-鏌ヨ鍏崇郴杩愮畻绗� - /// </summary> - public SearchFilterModeEnum ProcessRouteNumber_FilterMode { get; set; }= SearchFilterModeEnum.妯$硦鏌ヨ; /// <summary> /// 璁″垝寮�濮嬫椂闂� diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/WorkTaskCreateOrUpdateDtoBase.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/WorkTaskCreateOrUpdateDtoBase.cs index 37dfe52..bee5cc9 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/WorkTaskCreateOrUpdateDtoBase.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/WorkTaskCreateOrUpdateDtoBase.cs @@ -20,6 +20,36 @@ public string TaskCode { get; set; } /// <summary> + /// 绠℃缂栫爜 + /// </summary> + public string? PipeSpecCode { get; set; } + + /// <summary> + /// 绠℃鍚嶇О + /// </summary> + public string? PipeSectionName { get; set; } + + /// <summary> + /// 绠℃鍨嬪彿 + /// </summary> + public string? PipeSpecMode { get; set; } + + /// <summary> + /// 宸ュ簭鍚嶇О + /// </summary> + public string? ProcessName { get; set; } + + /// <summary> + /// 鑸瑰彿 + /// </summary> + public string? ShipNumber { get; set; } + + /// <summary> + /// 椤圭洰鍙� + /// </summary> + public string? ProjectNumber { get; set; } + + /// <summary> /// 璁″垝鐘舵�� /// </summary> public WorkPlanStatusEnum WorkPlanStatus { get; set; } @@ -28,6 +58,11 @@ /// 鍙枡鐘舵�� /// </summary> public CallMaterialStatusEnum CallMaterialStatus { get; set; } + + /// <summary> + /// 宸ヨ壓娴佸悜缂栧彿 + /// </summary> + public string? ProcessRouteNumber { get; set; } /// <summary> /// 鍘熸枡鏍囪瘑 @@ -120,21 +155,6 @@ public string? ProdLineCode { get; set; } /// <summary> - /// 鑸瑰彿 - /// </summary> - public string? ShipNumber { get; set; } - - /// <summary> - /// 椤圭洰鍙� - /// </summary> - public string? ProjectNumber { get; set; } - - /// <summary> - /// 宸ュ簭鍚嶇О - /// </summary> - public string? ProcessName { get; set; } - - /// <summary> /// 绠′欢缂栫爜 /// </summary> public string? PipeFittingCode { get; set; } @@ -143,16 +163,6 @@ /// 椤哄簭鍙� /// </summary> public string? PreSerialNumber { get; set; } - - /// <summary> - /// 绠℃缂栫爜 - /// </summary> - public string? PipeSpecCode { get; set; } - - /// <summary> - /// 绠℃鍚嶇О - /// </summary> - public string? PipeSectionName { get; set; } /// <summary> /// 澶栧緞(mm) @@ -168,11 +178,6 @@ /// 鏉愯川 /// </summary> public string? Material { get; set; } - - /// <summary> - /// 宸ヨ壓娴佸悜缂栧彿 - /// </summary> - public string? ProcessRouteNumber { get; set; } /// <summary> /// 璁″垝寮�濮嬫椂闂� diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/WorkTaskDto.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/WorkTaskDto.cs index 19ffc2a..86dc574 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/WorkTaskDto.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/WorkTaskDto.cs @@ -23,6 +23,36 @@ public string TaskCode { get; set; } /// <summary> + /// 绠℃缂栫爜 + /// </summary> + public string? PipeSpecCode { get; set; } + + /// <summary> + /// 绠℃鍚嶇О + /// </summary> + public string? PipeSectionName { get; set; } + + /// <summary> + /// 绠℃鍨嬪彿 + /// </summary> + public string? PipeSpecMode { get; set; } + + /// <summary> + /// 宸ュ簭鍚嶇О + /// </summary> + public string? ProcessName { get; set; } + + /// <summary> + /// 鑸瑰彿 + /// </summary> + public string? ShipNumber { get; set; } + + /// <summary> + /// 椤圭洰鍙� + /// </summary> + public string? ProjectNumber { get; set; } + + /// <summary> /// 璁″垝鐘舵�� /// </summary> public WorkPlanStatusEnum WorkPlanStatus { get; set; } @@ -52,6 +82,11 @@ return GetEnumDescriptionUtil.GetEnumDescription(CallMaterialStatus); } } + /// <summary> + /// 宸ヨ壓娴佸悜缂栧彿 + /// </summary> + public string? ProcessRouteNumber { get; set; } + /// <summary> /// 鍘熸枡鏍囪瘑 /// </summary> @@ -143,21 +178,6 @@ public string? ProdLineCode { get; set; } /// <summary> - /// 鑸瑰彿 - /// </summary> - public string? ShipNumber { get; set; } - - /// <summary> - /// 椤圭洰鍙� - /// </summary> - public string? ProjectNumber { get; set; } - - /// <summary> - /// 宸ュ簭鍚嶇О - /// </summary> - public string? ProcessName { get; set; } - - /// <summary> /// 绠′欢缂栫爜 /// </summary> public string? PipeFittingCode { get; set; } @@ -166,16 +186,6 @@ /// 椤哄簭鍙� /// </summary> public string? PreSerialNumber { get; set; } - - /// <summary> - /// 绠℃缂栫爜 - /// </summary> - public string? PipeSpecCode { get; set; } - - /// <summary> - /// 绠℃鍚嶇О - /// </summary> - public string? PipeSectionName { get; set; } /// <summary> /// 澶栧緞(mm) @@ -191,11 +201,6 @@ /// 鏉愯川 /// </summary> public string? Material { get; set; } - - /// <summary> - /// 宸ヨ壓娴佸悜缂栧彿 - /// </summary> - public string? ProcessRouteNumber { get; set; } /// <summary> /// 璁″垝寮�濮嬫椂闂� diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/WorkTaskExportModel.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/WorkTaskExportModel.cs index 6a6785a..6c6aa28 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/WorkTaskExportModel.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Dtos/WorkTask/WorkTaskExportModel.cs @@ -23,6 +23,42 @@ public string TaskCode { get; set; } /// <summary> + /// 绠℃缂栫爜 + /// </summary> + [ExcelColumn(Name = "绠℃缂栫爜", Width = 25)] + public string PipeSpecCode { get; set; } + + /// <summary> + /// 绠℃鍚嶇О + /// </summary> + [ExcelColumn(Name = "绠℃鍚嶇О", Width = 25)] + public string PipeSectionName { get; set; } + + /// <summary> + /// 绠℃鍨嬪彿 + /// </summary> + [ExcelColumn(Name = "绠℃鍨嬪彿", Width = 25)] + public string PipeSpecMode { get; set; } + + /// <summary> + /// 宸ュ簭鍚嶇О + /// </summary> + [ExcelColumn(Name = "宸ュ簭鍚嶇О", Width = 25)] + public string ProcessName { get; set; } + + /// <summary> + /// 鑸瑰彿 + /// </summary> + [ExcelColumn(Name = "鑸瑰彿", Width = 25)] + public string ShipNumber { get; set; } + + /// <summary> + /// 椤圭洰鍙� + /// </summary> + [ExcelColumn(Name = "椤圭洰鍙�", Width = 25)] + public string ProjectNumber { get; set; } + + /// <summary> /// 璁″垝鐘舵�� /// </summary> [ExcelColumn(Name = "璁″垝鐘舵��", Width = 25)] @@ -33,6 +69,12 @@ /// </summary> [ExcelColumn(Name = "鍙枡鐘舵��", Width = 25)] public CallMaterialStatusEnum CallMaterialStatus { get; set; } + + /// <summary> + /// 宸ヨ壓娴佸悜缂栧彿 + /// </summary> + [ExcelColumn(Name = "宸ヨ壓娴佸悜缂栧彿", Width = 25)] + public string ProcessRouteNumber { get; set; } /// <summary> /// 鍘熸枡鏍囪瘑 @@ -143,24 +185,6 @@ public string ProdLineCode { get; set; } /// <summary> - /// 鑸瑰彿 - /// </summary> - [ExcelColumn(Name = "鑸瑰彿", Width = 25)] - public string ShipNumber { get; set; } - - /// <summary> - /// 椤圭洰鍙� - /// </summary> - [ExcelColumn(Name = "椤圭洰鍙�", Width = 25)] - public string ProjectNumber { get; set; } - - /// <summary> - /// 宸ュ簭鍚嶇О - /// </summary> - [ExcelColumn(Name = "宸ュ簭鍚嶇О", Width = 25)] - public string ProcessName { get; set; } - - /// <summary> /// 绠′欢缂栫爜 /// </summary> [ExcelColumn(Name = "绠′欢缂栫爜", Width = 25)] @@ -171,18 +195,6 @@ /// </summary> [ExcelColumn(Name = "椤哄簭鍙�", Width = 25)] public string PreSerialNumber { get; set; } - - /// <summary> - /// 绠℃缂栫爜 - /// </summary> - [ExcelColumn(Name = "绠℃缂栫爜", Width = 25)] - public string PipeSpecCode { get; set; } - - /// <summary> - /// 绠℃鍚嶇О - /// </summary> - [ExcelColumn(Name = "绠℃鍚嶇О", Width = 25)] - public string PipeSectionName { get; set; } /// <summary> /// 澶栧緞(mm) @@ -201,12 +213,6 @@ /// </summary> [ExcelColumn(Name = "鏉愯川", Width = 25)] public string Material { get; set; } - - /// <summary> - /// 宸ヨ壓娴佸悜缂栧彿 - /// </summary> - [ExcelColumn(Name = "宸ヨ壓娴佸悜缂栧彿", Width = 25)] - public string ProcessRouteNumber { get; set; } /// <summary> /// 璁″垝寮�濮嬫椂闂� diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/IWorkTaskAppService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/IWorkTaskAppService.cs index cd9ea3d..76764a9 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/IWorkTaskAppService.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application.Contracts/Services/IWorkTaskAppService.cs @@ -1,8 +1,8 @@ using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkTask; -using Volo.Abp.Application.Services; +using CMS.Plugin.PipeLineLems.Domain.WorkTask; using CmsQueryExtensions.Entitys; using System.Linq.Expressions; -using CMS.Plugin.PipeLineLems.Domain.WorkTask; +using Volo.Abp.Application.Services; namespace CMS.Plugin.PipeLineLems.Application.Contracts.Services; diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs index f681023..de0504a 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/SharedService.cs @@ -13,13 +13,16 @@ using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrder; using CMS.Plugin.PipeLineLems.Domain.CallMaterialOrderRecord; using CMS.Plugin.PipeLineLems.Domain.WorkPlan; +using CMS.Plugin.PipeLineLems.Domain.WorkTask; using CMS.Plugin.ProcessManagement.Abstractions; using CMS.Plugin.ProductManagement.Abstractions; using CMS.Plugin.TraceManagement.Abstractions; using CMS.Plugin.TraceManagement.Abstractions.Models.Traces; +using CMS.Unit.RuntimeValue.Models; using CmsQueryExtensions; using CmsQueryExtensions.Entitys; using CmsQueryExtensions.Extension; +using Humanizer; using KissUtil.Extensions; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json; @@ -34,6 +37,8 @@ /// </summary> public class SharedService : CMSPluginAppService { + + /// <summary> /// 鍒嗘嫞鍔熻兘 @@ -563,6 +568,7 @@ var callMaterialOrderRepository = _serviceProvider.GetRequiredService<ICallMaterialOrderRepository>(); var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>(); + var workTaskRepository = _serviceProvider.GetRequiredService<IWorkTaskRepository>(); var callMaterialOrderRecordRepository = _serviceProvider.GetRequiredService<ICallMaterialOrderRecordRepository>(); var orderManager = _serviceProvider.GetRequiredService<IOrderManager>(); @@ -633,6 +639,15 @@ } await workPlanRepository.UpdateManyAsync(workPlanList); + //鏇存柊浣滀笟浠诲姟琛� + var workTaskList = await workTaskRepository.GetListByFilterAsync(x => x.DataIdentifier == callMaterialOrder.DataIdentifier); + foreach (var item in workTaskList) + { + item.CallMaterialStatus = Domain.Shared.Enums.CallMaterialStatusEnum.鍙枡瀹屾垚; + item.LastModifierName = "SuperAdmin"; + } + await workTaskRepository.UpdateManyAsync(workTaskList); + //鏂板鍙枡璁板綍琛� var callMaterialOrderRecord = new CallMaterialOrderRecord() { @@ -691,6 +706,7 @@ VariableService _variableService = _serviceProvider.GetRequiredService<VariableService>(); var callMaterialOrderRepository = _serviceProvider.GetRequiredService<ICallMaterialOrderRepository>(); var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>(); + var workTaskRepository = _serviceProvider.GetRequiredService<IWorkTaskRepository>(); var callMaterialOrderRecordRepository = _serviceProvider.GetRequiredService<ICallMaterialOrderRecordRepository>(); var orderManager = _serviceProvider.GetRequiredService<IOrderManager>(); var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); @@ -701,6 +717,11 @@ if (workPlan == null) { throw new UserFriendlyException($"鎵句笉鍒颁綔涓氳鍒�"); + } + var workTask = await workTaskRepository.GetSingleByFilterAsync(x => x.TaskCode == input.TaskCode && x.ProcessName == workPlan.ProcessName); + if (workTask == null) + { + throw new UserFriendlyException($"鎵句笉鍒颁綔涓氫换鍔�"); } if (workPlan.ProcessName == "瑁呴厤宸ュ簭") { @@ -740,6 +761,7 @@ // workPlan.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.宸插畬鎴�; //} workPlan.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.鐢熶骇涓�; + workTask.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.鐢熶骇涓�; await workPlanRepository.UpdateAsync(workPlan); @@ -796,7 +818,7 @@ /// <summary> - /// 瑁呴厤宸ュ簭瀹屽伐 + /// 瑁呴厤/鐒婃帴宸ュ簭瀹屽伐 /// </summary> /// <param name="_serviceProvider"></param> /// <param name="input"></param> @@ -816,62 +838,7 @@ } - VariableService _variableService = _serviceProvider.GetRequiredService<VariableService>(); - var _workSectionManager = _serviceProvider.GetRequiredService<IWorkSectionManager>(); - var _workStationManager = _serviceProvider.GetRequiredService<IWorkStationManager>(); - var traceProvider = _serviceProvider.GetRequiredService<ITraceProvider>(); - var materialProvider = _serviceProvider.GetRequiredService<IMaterialProvider>(); - var workPlanAppService = _serviceProvider.GetRequiredService<IWorkPlanAppService>(); - var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>(); - var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); - string processName = ""; - //鐗╂枡鍙傛暟鍒楄〃 - var firstWorkPlan = await workPlanAppService.GetSingleByFilterAsync(x => x.PipeSpecCode == input.PipeSpecCode && x.ProcessName == input.ProcessName); - if (firstWorkPlan == null) - { - throw new UserFriendlyException($"鎵句笉鍒颁綔涓氳鍒�"); - } - if (firstWorkPlan.ProcessName == "瑁呴厤宸ュ簭") - { - processName = "瑁呴厤"; - } - else if (firstWorkPlan.ProcessName == "鐒婃帴宸ュ簭") - { - processName = "鐒婃帴"; - } - - await CompleteHandleOutStoreFinish(_serviceProvider, processName, true); - - //鏍规嵁宸ュ簭鍚嶈幏鍙栧伐搴忓璞� - var workSection = await _workSectionManager.GetByNameAsync($"{processName}宸ュ簭"); - var workStation = await _workStationManager.GetByNameAsync($"{processName}宸ヤ綅"); - //鍐欏叆杩芥函鎶ヨ〃 - var finishTime = DateTime.Now; - TraceModel traceModel = new TraceModel() - { - SerialNumber = input.PipeSpecCode, - WorkSectionId = workSection.Id, - WorkSectionName = workSection.Name, - WorkStationName = workStation.Name, - - FinishTime = finishTime, - IsQualified = true, - UnqualifiedReason = "", - ProductModel = "", - ProductName = "", - - }; - traceModel.Params = new List<TraceParamModel>(); - foreach (var item in workSection.ProcessParameters) - { - var value = "ssss"; - traceModel.Params.Add(new TraceParamModel() - { - Key = item.Key, - Value = value.SafeString() - }); - } #region 浜嬪姟 @@ -883,7 +850,72 @@ { #region 鏁版嵁澶勭悊 + VariableService _variableService = _serviceProvider.GetRequiredService<VariableService>(); + var _workSectionManager = _serviceProvider.GetRequiredService<IWorkSectionManager>(); + var _workStationManager = _serviceProvider.GetRequiredService<IWorkStationManager>(); + var traceProvider = _serviceProvider.GetRequiredService<ITraceProvider>(); + var materialProvider = _serviceProvider.GetRequiredService<IMaterialProvider>(); + var workPlanAppService = _serviceProvider.GetRequiredService<IWorkPlanAppService>(); + var workTaskAppService = _serviceProvider.GetRequiredService<IWorkTaskAppService>(); + var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>(); + var workTaskRepository = _serviceProvider.GetRequiredService<IWorkTaskRepository>(); + var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); + string processName = ""; + var firstWorkTask = await workTaskAppService.GetSingleByFilterAsync(x => x.PipeSpecCode == input.PipeSpecCode && x.ProcessName == input.ProcessName); + if (firstWorkTask == null) + { + throw new UserFriendlyException($"鎵句笉鍒颁綔涓氳鍒�"); + } + //鐗╂枡鍙傛暟鍒楄〃 + var firstWorkPlan = await workPlanAppService.GetSingleByFilterAsync(x => x.PipeSpecCode == input.PipeSpecCode && x.ProcessName == input.ProcessName); + if (firstWorkPlan == null) + { + throw new UserFriendlyException($"鎵句笉鍒颁綔涓氳鍒�"); + } + if (firstWorkPlan.ProcessName == "瑁呴厤宸ュ簭") + { + processName = "瑁呴厤"; + } + else if (firstWorkPlan.ProcessName == "鐒婃帴宸ュ簭") + { + processName = "鐒婃帴"; + } + + await CompleteHandleOutStoreFinish(_serviceProvider, processName, true); + + //鏍规嵁宸ュ簭鍚嶈幏鍙栧伐搴忓璞� + var workSection = await _workSectionManager.GetByNameAsync($"{processName}宸ュ簭"); + var workStation = await _workStationManager.GetByNameAsync($"{processName}宸ヤ綅"); + //鍐欏叆杩芥函鎶ヨ〃 + var finishTime = DateTime.Now; + TraceModel traceModel = new TraceModel() + { + SerialNumber = input.PipeSpecCode, + WorkSectionId = workSection.Id, + WorkSectionName = workSection.Name, + WorkStationName = workStation.Name, + + FinishTime = finishTime, + IsQualified = true, + UnqualifiedReason = "", + ProductModel = "", + ProductName = "", + + }; + traceModel.Params = new List<TraceParamModel>(); + foreach (var item in workSection.ProcessParameters) + { + var value = "ssss"; + traceModel.Params.Add(new TraceParamModel() + { + Key = item.Key, + Value = value.SafeString() + }); + } + + firstWorkTask.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.宸插畬鎴�; + await workTaskRepository.UpdateAsync(firstWorkTask); firstWorkPlan.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.宸插畬鎴�; await workPlanRepository.UpdateAsync(firstWorkPlan); @@ -967,21 +999,20 @@ string _value = ""; //閲囬泦鍙傛暟 + ReadWriteResult<IVariableValue?>? _getValue = null; if (item.Name == $"{processName}鍘嬪姏") { - var _getValue = await _variableService.ReadValueAsync($"{processName}鍘嬪姏"); - _value = _getValue.Content.Value.SafeString().ToString(); + _getValue = await _variableService.ReadValueAsync($"{processName}鍘嬪姏"); } if (item.Name == $"{processName}浣嶇疆") { - var _getValue = await _variableService.ReadValueAsync($"{processName}浣嶇疆"); - _value = _getValue.Content.Value.SafeString().ToString(); + _getValue = await _variableService.ReadValueAsync($"{processName}浣嶇疆"); } if (item.Name == $"{processName}閫熷害") { - var _getValue = await _variableService.ReadValueAsync($"{processName}閫熷害"); - _value = _getValue.Content.Value.SafeString().ToString(); + _getValue = await _variableService.ReadValueAsync($"{processName}閫熷害"); } + _value = _getValue?.Content?.Value?.SafeString().ToString(); if (item.Name == $"{processName}闂撮殭") { @@ -1004,21 +1035,436 @@ string _value = ""; //閲囬泦鍙傛暟 + ReadWriteResult<IVariableValue?>? _getValue = null; if (item.Name == $"{processName}鍘嬪姏") { - var _getValue = await _variableService.ReadValueAsync($"{processName}鍘嬪姏"); - _value = _getValue.Content.Value.SafeString().ToString(); - } + _getValue = await _variableService.ReadValueAsync($"{processName}鍘嬪姏"); if (item.Name == $"{processName}浣嶇疆") { - var _getValue = await _variableService.ReadValueAsync($"{processName}浣嶇疆"); - _value = _getValue.Content.Value.SafeString().ToString(); + _getValue = await _variableService.ReadValueAsync($"{processName}浣嶇疆"); } if (item.Name == $"{processName}閫熷害") { - var _getValue = await _variableService.ReadValueAsync($"{processName}閫熷害"); - _value = _getValue.Content.Value.SafeString().ToString(); + _getValue = await _variableService.ReadValueAsync($"{processName}閫熷害"); } + _value = _getValue?.Content?.Value?.SafeString().ToString(); + if (item.Name == $"{processName}闂撮殭") + { + _value = "15mm"; + } + if (item.Name == $"{processName}浜�") + { + _value = myCurrentUser.UserAccount; + } + //item.Key + TraceParamModel traceParamModel = new TraceParamModel() + { + Key = item.Key, + Value = _value + }; + traceModel.Params.Add(traceParamModel); + }; + + traceModel.MaterialParams = _MaterialParams; + + await traceProvider.CreateTraceAsync(traceModel); + + + + #endregion + + await uow.CompleteAsync(); + + var response = new MesOrderResponse + { + Code = "200", + Data = "", + Message = "澶勭悊鎴愬姛", + Time = DateTime.UtcNow + }; + return response; + } + catch (Exception) + { + await uow.RollbackAsync(); + throw; + } + finally + { + + } + + + + #endregion + + } + + #region 娉曞叞鍐茬爜 + + + /// <summary> + ///涓嬪彂娉曞叞鍐茬爜 寮�宸� + /// </summary> + /// <param name="input"></param> + /// <param name="_serviceProvider"></param> + /// <param name="myCurrentUser"></param> + /// <returns></returns> + /// <exception cref="UserFriendlyException"></exception> + public async Task<MesOrderResponse> SendFlangeCode_StartProduction(SendFlangeCodeInput input, IServiceProvider _serviceProvider, MyCurrentUser myCurrentUser) + { + if (string.IsNullOrEmpty(input.TaskCode.ToString())) + { + throw new UserFriendlyException("浠诲姟缂栫爜涓嶈兘涓虹┖"); + } + + string processName = "娉曞叞鍐茬爜"; + + VariableService _variableService = _serviceProvider.GetRequiredService<VariableService>(); + var callMaterialOrderRepository = _serviceProvider.GetRequiredService<ICallMaterialOrderRepository>(); + var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>(); + var workTaskRepository = _serviceProvider.GetRequiredService<IWorkTaskRepository>(); + var callMaterialOrderRecordRepository = _serviceProvider.GetRequiredService<ICallMaterialOrderRecordRepository>(); + var orderManager = _serviceProvider.GetRequiredService<IOrderManager>(); + var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); + + var workTaskAppService = _serviceProvider.GetRequiredService<IWorkTaskAppService>(); + + + // 鏌ユ壘鏁版嵁 + var workTask = await workTaskRepository.GetSingleByFilterAsync(x => x.Son_TaskCode == input.Son_TaskCode); + if (workTask == null) + { + throw new UserFriendlyException($"娌℃湁鎵惧埌瀛愪换鍔$紪鍙穥input.Son_TaskCode}鐨勪换鍔℃暟鎹�"); + } + if (workTask.WorkPlanStatus != Domain.Shared.Enums.WorkPlanStatusEnum.鏈敓浜�) + { + throw new UserFriendlyException($"瀛愪换鍔$紪鍙穥input.Son_TaskCode}鐨勪换鍔$姸鎬佷笉鏄�'{Domain.Shared.Enums.WorkPlanStatusEnum.鏈敓浜�.ToString()}'"); + } + var workPlan = await workPlanRepository.GetSingleByFilterAsync(x => x.TaskCode == input.TaskCode); + if (workPlan == null) + { + throw new UserFriendlyException($"鎵句笉鍒颁綔涓氳鍒�"); + } + + + // 楠岃瘉鐘舵�� + if (workPlan.WorkPlanStatus != Domain.Shared.Enums.WorkPlanStatusEnum.鏆傚仠涓� && workPlan.WorkPlanStatus != Domain.Shared.Enums.WorkPlanStatusEnum.鏈敓浜�) + { + //鏆傛椂娉ㄩ噴 + //throw new UserFriendlyException($"浠诲姟缂栫爜 '{input.TaskCode}' 鐨勫綍鐘舵�佷负 '{workPlan.WorkPlanStatus}'锛屼笉鍏佽寮�宸�"); + } + + var callMaterialOrder = await callMaterialOrderAppService.GetSingleByFilterAsync(x => x.DataIdentifier == workPlan.DataIdentifier); + #region 浜嬪姟 + + using var scope = _serviceProvider.CreateScope(); + var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); + using var uow = unitOfWorkManager.Begin(requiresNew: true); + + try + { + #region 鏁版嵁澶勭悊 + + //1銆佹洿鏂颁綔涓氳鍒掕〃涓� 鐢熶骇涓� + //2銆佺粰PLC鍙戝伐鑹哄弬鏁版寚浠�,骞跺啓鍏� plc涓� 浜у搧id + //if (workPlan.ProcessName == "瑁呴厤宸ュ簭") + //{ + // workPlan.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.鐢熶骇涓�; + //} + //else if (workPlan.ProcessName == "鐒婃帴宸ュ簭") + //{ + // workPlan.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.宸插畬鎴�; + //} + workPlan.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.鐢熶骇涓�; + workTask.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.鐢熶骇涓�; + + await workPlanRepository.UpdateAsync(workPlan); + + await workTaskRepository.UpdateAsync(workTask); + + Dictionary<string, object?> keyValuePairs = new Dictionary<string, object?> + { + { $"{processName}_ProductID", workPlan.PipeSpecCode }, + { $"{processName}绠℃缂栫爜", workPlan.PipeSpecCode }, + { $"{processName}绠℃鍚嶇О", workPlan.PipeSectionName }, + { $"{processName}鍘熸枡绠℃壒娆�", callMaterialOrder.MaterialBatch }, + { $"{processName}鍘熸枡绠″瀷鍙�", callMaterialOrder.MaterialMode }, + { $"{processName}鍘熸枡绠℃爣璇�", callMaterialOrder.DataIdentifier }, + { $"{processName}椤圭洰鍙�", workPlan.ProjectNumber }, + { $"{processName}鑸瑰彿", workPlan.ShipNumber }, + + //閲囬泦鏁版嵁妯℃嫙鍐欏叆 + { $"{processName}鍘嬪姏", "10.0 MPa" }, + { $"{processName}閫熷害", "18mm/s"}, + + { $"{processName}鍐呭", workTask.PipeAllowableStress}, + + { $"{processName}浜�", myCurrentUser.UserAccount}, + { $"{processName}闂撮殭","15mm"}, + { $"{processName}浣嶇疆", "10,23,24"}, + }; + _variableService.WriteValueAsync(keyValuePairs); + + + #endregion + + await uow.CompleteAsync(); + + // 杩斿洖缁撴灉 + var response = new MesOrderResponse + { + Code = "200", + Message = "澶勭悊鎴愬姛", + Time = DateTime.UtcNow + }; + return response; + } + catch (Exception) + { + await uow.RollbackAsync(); + throw; + } + finally + { + + } + + + + #endregion + } + + + /// <summary> + /// 涓嬪彂娉曞叞鍐茬爜 瀹屽伐 + /// </summary> + /// <param name="_serviceProvider"></param> + /// <param name="input"></param> + /// <param name="myCurrentUser"></param> + /// <returns></returns> + public async Task<MesOrderResponse> SendFlangeCode_CompleteAssemblyProcess(IServiceProvider _serviceProvider, CompleteAssemblyProcessInput input, MyCurrentUser myCurrentUser) + { + //1銆佽褰曞垎鎷h褰曡〃 + //2銆佹洿鏂颁綔涓氳鍒掕〃鐨勭姸鎬� =宸插垎鎷� + //3銆佸啓鍏� 鍒嗘嫞鍙橀噺 + //4銆佸啓鍏ヨ拷婧姤琛� + //5銆佺墿鏂欑粍鐩� + + if (string.IsNullOrEmpty(input.PipeSpecCode)) + { + throw new UserFriendlyException($"绠℃缂栫爜涓嶈兘涓虹┖"); + } + + + + + #region 浜嬪姟 + + using var scope = _serviceProvider.CreateScope(); + var unitOfWorkManager = scope.ServiceProvider.GetRequiredService<IUnitOfWorkManager>(); + using var uow = unitOfWorkManager.Begin(requiresNew: true); + + try + { + #region 鏁版嵁澶勭悊 + + VariableService _variableService = _serviceProvider.GetRequiredService<VariableService>(); + var _workSectionManager = _serviceProvider.GetRequiredService<IWorkSectionManager>(); + var _workStationManager = _serviceProvider.GetRequiredService<IWorkStationManager>(); + var traceProvider = _serviceProvider.GetRequiredService<ITraceProvider>(); + var materialProvider = _serviceProvider.GetRequiredService<IMaterialProvider>(); + var workPlanAppService = _serviceProvider.GetRequiredService<IWorkPlanAppService>(); + var workTaskAppService = _serviceProvider.GetRequiredService<IWorkTaskAppService>(); + var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>(); + var workTaskRepository = _serviceProvider.GetRequiredService<IWorkTaskRepository>(); + var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); + + string processName = "娉曞叞鍐茬爜"; + var firstWorkTask = await workTaskAppService.GetSingleByFilterAsync(x => x.PipeSpecCode == input.PipeSpecCode && x.ProcessName == (input.ProcessName)); + if (firstWorkTask == null) + { + throw new UserFriendlyException($"鎵句笉鍒颁綔涓氳鍒�"); + } + //鐗╂枡鍙傛暟鍒楄〃 + var firstWorkPlan = await workPlanAppService.GetSingleByFilterAsync(x => x.PipeSpecCode == input.PipeSpecCode && x.ProcessName == "瑁呴厤宸ュ簭"); + if (firstWorkPlan == null) + { + throw new UserFriendlyException($"鎵句笉鍒颁綔涓氳鍒�"); + } + + await CompleteHandleOutStoreFinish(_serviceProvider, processName, true); + + //鏍规嵁宸ュ簭鍚嶈幏鍙栧伐搴忓璞� + var workSection = await _workSectionManager.GetByNameAsync($"{processName}宸ュ簭"); + var workStation = await _workStationManager.GetByNameAsync($"{processName}宸ヤ綅"); + //鍐欏叆杩芥函鎶ヨ〃 + var finishTime = DateTime.Now; + TraceModel traceModel = new TraceModel() + { + SerialNumber = input.PipeSpecCode, + WorkSectionId = workSection.Id, + WorkSectionName = workSection.Name, + WorkStationName = workStation.Name, + + FinishTime = finishTime, + IsQualified = true, + UnqualifiedReason = "", + ProductModel = "", + ProductName = "", + + }; + traceModel.Params = new List<TraceParamModel>(); + foreach (var item in workSection.ProcessParameters) + { + var value = "ssss"; + traceModel.Params.Add(new TraceParamModel() + { + Key = item.Key, + Value = value.SafeString() + }); + } + + firstWorkTask.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.宸插畬鎴�; + await workTaskRepository.UpdateAsync(firstWorkTask); + + //杩欎釜鍦版柟涓嶆敼鏁版嵁 + //firstWorkPlan.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.宸插畬鎴�; + //await workPlanRepository.UpdateAsync(firstWorkPlan); + + var callMaterialOrder = await callMaterialOrderAppService.GetSingleByFilterAsync(x => x.DataIdentifier == firstWorkPlan.DataIdentifier); + + var rawPipe_DataIdentifier = await materialProvider.FindByNameAsync("鍘熸枡绠℃爣璇�"); + var rawPipe_MaterialMode = await materialProvider.FindByNameAsync("鍘熸枡绠″瀷鍙�"); + var rawPipe_Batch = await materialProvider.FindByNameAsync("鍘熸枡绠℃壒娆�"); + var rawPipe_ProjectNumber = await materialProvider.FindByNameAsync("椤圭洰鍙�"); + var rawPipe_ShipNumber = await materialProvider.FindByNameAsync("鑸瑰彿"); + List<TraceMaterialModel> _MaterialParams = new List<TraceMaterialModel>(); + foreach (var item in workSection.MaterialParameters) + { + if (item.Name == "鍘熸枡绠″瀷鍙�") + { + _MaterialParams.Add(new TraceMaterialModel() + { + Key = item.Key, + Quantity = 1, + MaterialId = rawPipe_MaterialMode.MaterialId, + MaterialDetailId = rawPipe_MaterialMode.MaterialDetails.First().Id, + Value = firstWorkPlan.MaterialMode + + }); + } + if (item.Name == "鍘熸枡绠℃爣璇�") + { + _MaterialParams.Add(new TraceMaterialModel() + { + Key = item.Key, + Quantity = 1, + MaterialId = rawPipe_DataIdentifier.MaterialId, + MaterialDetailId = rawPipe_DataIdentifier.MaterialDetails.First().Id, + Value = firstWorkPlan.DataIdentifier, + + }); + } + if (item.Name == "鍘熸枡绠℃壒娆�") + { + _MaterialParams.Add(new TraceMaterialModel() + { + Key = item.Key, + Quantity = 1, + MaterialId = rawPipe_Batch.MaterialId, + MaterialDetailId = rawPipe_Batch.MaterialDetails.First().Id, + Value = callMaterialOrder.MaterialBatch,//鎵规鏆傛椂鍐欐 + + }); + } + if (item.Name == "椤圭洰鍙�") + { + _MaterialParams.Add(new TraceMaterialModel() + { + Key = item.Key, + Quantity = 1, + MaterialId = rawPipe_ProjectNumber.MaterialId, + MaterialDetailId = rawPipe_ProjectNumber.MaterialDetails.First().Id, + Value = firstWorkPlan.ProjectNumber, + + }); + } + if (item.Name == "鑸瑰彿") + { + _MaterialParams.Add(new TraceMaterialModel() + { + Key = item.Key, + Quantity = 1, + MaterialId = rawPipe_ShipNumber.MaterialId, + MaterialDetailId = rawPipe_ShipNumber.MaterialDetails.First().Id, + Value = firstWorkPlan.ShipNumber, + + }); + } + }; + + //閰嶇疆杩囩▼鍙傛暟(閲囬泦鍙傛暟銆侀厤鏂瑰弬鏁�) + traceModel.Params = new List<TraceParamModel>(); + foreach (var item in workSection.ProcessParameters) + { + string _value = ""; + + //閲囬泦鍙傛暟 + ReadWriteResult<IVariableValue?>? _getValue = null; + if (item.Name == $"{processName}鍘嬪姏") + { + _getValue = await _variableService.ReadValueAsync($"{processName}鍘嬪姏"); + } + if (item.Name == $"{processName}浣嶇疆") + { + _getValue = await _variableService.ReadValueAsync($"{processName}浣嶇疆"); + } + if (item.Name == $"{processName}閫熷害") + { + _getValue = await _variableService.ReadValueAsync($"{processName}閫熷害"); + } + _value = _getValue?.Content?.Value?.SafeString().ToString(); + + if (item.Name == $"{processName}闂撮殭") + { + _value = "15mm"; + } + if (item.Name == $"{processName}浜�") + { + _value = myCurrentUser.UserAccount; + } + //item.Key + TraceParamModel traceParamModel = new TraceParamModel() + { + Key = item.Key, + Value = _value + }; + traceModel.Params.Add(traceParamModel); + }; + foreach (var item in workSection.FormulaParameters) + { + string _value = ""; + + //閲囬泦鍙傛暟 + ReadWriteResult<IVariableValue?>? _getValue = null; + if (item.Name == $"{processName}鍘嬪姏") + { + _getValue = await _variableService.ReadValueAsync($"{processName}鍘嬪姏"); + } + if (item.Name == $"{processName}浣嶇疆") + { + _getValue = await _variableService.ReadValueAsync($"{processName}浣嶇疆"); + } + if (item.Name == $"{processName}閫熷害") + { + _getValue = await _variableService.ReadValueAsync($"{processName}閫熷害"); + } + if (item.Name == $"{processName}鍐呭") + { + _getValue = await _variableService.ReadValueAsync($"{processName}鍐呭"); + } + _value = _getValue?.Content?.Value?.SafeString().ToString(); if (item.Name == $"{processName}闂撮殭") { @@ -1041,6 +1487,12 @@ await traceProvider.CreateTraceAsync(traceModel); + + + #endregion + + await uow.CompleteAsync(); + var response = new MesOrderResponse { Code = "200", @@ -1049,10 +1501,6 @@ Time = DateTime.UtcNow }; return response; - - #endregion - - await uow.CompleteAsync(); } catch (Exception) { @@ -1070,6 +1518,8 @@ } + #endregion + /// <summary> /// 鍏叡澶勭悊 鍝嶅簲鍑虹珯瀹屾垚淇″彿 diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkPlanAppService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkPlanAppService.cs index 01ffc44..6ef527d 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkPlanAppService.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkPlanAppService.cs @@ -151,42 +151,10 @@ updateObj.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); input.MapExtraPropertiesTo(updateObj, MappingPropertyDefinitionChecks.None); - updateObj.TaskCode = input.TaskCode; - updateObj.WorkPlanStatus = input.WorkPlanStatus; - updateObj.CallMaterialStatus = input.CallMaterialStatus; - updateObj.DataIdentifier = input.DataIdentifier; - updateObj.MaterialMode = input.MaterialMode; - updateObj.Length = input.Length; - updateObj.MarkingContent = input.MarkingContent; - updateObj.MarkingPosition = input.MarkingPosition; - updateObj.CuttingPosition = input.CuttingPosition; - updateObj.Quantity = input.Quantity; - updateObj.FlangeThickness = input.FlangeThickness; - updateObj.FlangeInnerDiameter = input.FlangeInnerDiameter; - updateObj.WeldingHeatInput = input.WeldingHeatInput; - updateObj.PipeAllowableStress = input.PipeAllowableStress; - updateObj.PipeDiameter = input.PipeDiameter; - updateObj.PipeWallThickness = input.PipeWallThickness; - updateObj.FactoryCode = input.FactoryCode; - updateObj.ProductCode = input.ProductCode; - updateObj.WorkstationCode = input.WorkstationCode; - updateObj.EquipmentCode = input.EquipmentCode; + // 鎵归噺璧嬪�兼墍鏈夊彲鏄犲皠瀛楁锛堥�氳繃鍖垮悕瀵硅薄锛� + updateObj = ObjectMapper.Map(input, updateObj); // 绛夋晥浜庢墜鍔ㄨ祴鍊兼墍鏈夊尮閰嶅瓧娈� - updateObj.ProcessName = input.ProcessName; - updateObj.PipeFittingCode = input.PipeFittingCode; - updateObj.PreSerialNumber = input.PreSerialNumber; - updateObj.PipeSpecCode = input.PipeSpecCode; - updateObj.PipeSectionName = input.PipeSectionName; - updateObj.OuterDiameter = input.OuterDiameter; - updateObj.Thickness = input.Thickness; - updateObj.Material = input.Material; - updateObj.ProcessRouteNumber = input.ProcessRouteNumber; - updateObj.PlannedStartTime = input.PlannedStartTime; - updateObj.PlannedEndTime = input.PlannedEndTime; - updateObj.TeamInfo = input.TeamInfo; - updateObj.Timestamp = input.Timestamp; - updateObj.Remark = input.Remark; - + updateObj.LastModifierName = input.LastModifierName;//淇敼浜� await _workPlanRepository.UpdateAsync(updateObj); diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkTaskAppService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkTaskAppService.cs index 934ce7c..e85aacb 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkTaskAppService.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/Implements/WorkTaskAppService.cs @@ -1,129 +1,128 @@ -using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkTask; -using CMS.Plugin.PipeLineLems.Application.Contracts.Services; -using CMS.Plugin.PipeLineLems.Domain.Shared; -using CmsQueryExtensions; -using CMS.Plugin.PipeLineLems.Domain.WorkTask; -using CmsQueryExtensions.Extension; -using System.Linq.Expressions; -using Volo.Abp; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Data; -using Volo.Abp.ObjectExtending; -using Volo.Abp.ObjectMapping; -using CmsQueryExtensions.Entitys; - -namespace CMS.Plugin.PipeLineLems.Application.Implements; - +using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkTask; +using CMS.Plugin.PipeLineLems.Application.Contracts.Services; +using CMS.Plugin.PipeLineLems.Domain.Shared; +using CMS.Plugin.PipeLineLems.Domain.WorkTask; +using CmsQueryExtensions; +using CmsQueryExtensions.Entitys; +using CmsQueryExtensions.Extension; +using System.Linq.Expressions; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Data; +using Volo.Abp.ObjectExtending; + +namespace CMS.Plugin.PipeLineLems.Application.Implements; + /// <summary> /// 浣滀笟浠诲姟琛ㄥ簲鐢ㄦ湇鍔� /// </summary> -public class WorkTaskAppService : CMSPluginAppService, IWorkTaskAppService -{ - private readonly IWorkTaskRepository _workTaskRepository; - +public class WorkTaskAppService : CMSPluginAppService, IWorkTaskAppService +{ + private readonly IWorkTaskRepository _workTaskRepository; + /// <summary> /// Initializes a new instance of the <see cref="WorkTaskAppService"/> class. /// </summary> /// <param name="WorkTaskRepository">The task job repository.</param> - public WorkTaskAppService(IWorkTaskRepository workTaskRepository) - { - _workTaskRepository = workTaskRepository; - } - + public WorkTaskAppService(IWorkTaskRepository workTaskRepository) + { + _workTaskRepository = workTaskRepository; + } + /// <summary> /// 鑾峰彇鎸囧畾浣滀笟浠诲姟琛� /// </summary> /// <param name="id"></param> /// <returns></returns> - public virtual async Task<WorkTaskDto> GetAsync(Guid id) - { - return ObjectMapper.Map<WorkTask, WorkTaskDto>(await _workTaskRepository.GetAsync(id)); - } - + public virtual async Task<WorkTaskDto> GetAsync(Guid id) + { + return ObjectMapper.Map<WorkTask, WorkTaskDto>(await _workTaskRepository.GetAsync(id)); + } + /// <summary> /// 鍒嗛〉鑾峰彇浣滀笟浠诲姟琛� /// </summary> /// <param name="input"></param> /// <returns></returns> - public virtual async Task<PagedResultDto<WorkTaskDto>> GetListAsync(GetWorkTaskInput input) - { - Check.NotNull(input, nameof(input)); - - if (input.Sorting.IsNullOrWhiteSpace()) - { - input.Sorting = nameof(WorkTask.Sort); - } - + public virtual async Task<PagedResultDto<WorkTaskDto>> GetListAsync(GetWorkTaskInput input) + { + Check.NotNull(input, nameof(input)); + + if (input.Sorting.IsNullOrWhiteSpace()) + { + input.Sorting = nameof(WorkTask.Sort); + } + #region 鍔ㄦ�佹瀯閫犳煡璇㈡潯浠� - + //鍔ㄦ�佹瀯閫犳煡璇㈡潯浠� - var whereConditions = DynamicGetQueryParams(input); - - #endregion - - var count = await _workTaskRepository.GetCountAsync(whereConditions); - var list = await _workTaskRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount); - - return new PagedResultDto<WorkTaskDto>(count, ObjectMapper.Map<List<WorkTask>, List<WorkTaskDto>>(list)); - } - + var whereConditions = DynamicGetQueryParams(input); + + #endregion + + var count = await _workTaskRepository.GetCountAsync(whereConditions); + var list = await _workTaskRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount); + + return new PagedResultDto<WorkTaskDto>(count, ObjectMapper.Map<List<WorkTask>, List<WorkTaskDto>>(list)); + } + /// <summary> /// 鍔ㄦ�佹瀯閫犳煡璇㈡潯浠� /// </summary> /// <param name="input">杈撳叆鍙傛暟</param> /// <returns></returns> - private FunReturnResultModel<Expression<Func<WorkTask, bool>>> DynamicGetQueryParams(GetWorkTaskInput input) - { + private FunReturnResultModel<Expression<Func<WorkTask, bool>>> DynamicGetQueryParams(GetWorkTaskInput input) + { //鍔ㄦ�佹瀯閫犳煡璇㈡潯浠� - var whereConditions = WhereConditionsExtensions.GetWhereConditions<WorkTask, GetWorkTaskInput>(input); - if (!whereConditions.IsSuccess) - { - throw new Exception("鍔ㄦ�佹瀯閫犳煡璇㈡潯浠跺け璐�:" + whereConditions.ErrMsg); - } - + var whereConditions = WhereConditionsExtensions.GetWhereConditions<WorkTask, GetWorkTaskInput>(input); + if (!whereConditions.IsSuccess) + { + throw new Exception("鍔ㄦ�佹瀯閫犳煡璇㈡潯浠跺け璐�:" + whereConditions.ErrMsg); + } + //涔熷彲鍐嶆鑷畾涔夋瀯寤烘煡璇㈡潯浠� - Expression<Func<WorkTask, bool>> extendExpression = a => a.IsDeleted == false; + Expression<Func<WorkTask, bool>> extendExpression = a => a.IsDeleted == false; // 浣跨敤 System.Linq.PredicateBuilder 鐨� And - var pres = (System.Linq.Expressions.Expression<Func<WorkTask, bool>>)(whereConditions.data); - whereConditions.data = System.Linq.PredicateBuilder.And(pres, extendExpression); - - return whereConditions; - } - + var pres = (System.Linq.Expressions.Expression<Func<WorkTask, bool>>)(whereConditions.data); + whereConditions.data = System.Linq.PredicateBuilder.And(pres, extendExpression); + + return whereConditions; + } + /// <summary> /// 鏂板缓浣滀笟浠诲姟琛� /// </summary> /// <param name="input"></param> /// <returns></returns> /// <exception cref="UserFriendlyException"></exception> - public virtual async Task<WorkTaskDto> CreateAsync(WorkTaskCreateDto input) - { - await CheckCreateOrUpdateDtoAsync(input); - - var exist = await _workTaskRepository.NameExistAsync(input.Son_TaskCode); - if (exist) - { - throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.Son_TaskCode]); - } - - var maxSort = await _workTaskRepository.GetMaxSortAsync(); - var sort = input.Sort ?? maxSort; - - var insertObj = ObjectMapper.Map<WorkTaskCreateDto, WorkTask>(input); - insertObj.Sort = sort; - input.MapExtraPropertiesTo(insertObj, MappingPropertyDefinitionChecks.None); - + public virtual async Task<WorkTaskDto> CreateAsync(WorkTaskCreateDto input) + { + await CheckCreateOrUpdateDtoAsync(input); + + var exist = await _workTaskRepository.NameExistAsync(input.Son_TaskCode); + if (exist) + { + throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.Son_TaskCode]); + } + + var maxSort = await _workTaskRepository.GetMaxSortAsync(); + var sort = input.Sort ?? maxSort; + + var insertObj = ObjectMapper.Map<WorkTaskCreateDto, WorkTask>(input); + insertObj.Sort = sort; + input.MapExtraPropertiesTo(insertObj, MappingPropertyDefinitionChecks.None); + insertObj.CreatorName = input.CreatorName;//鍒涘缓浜� - await _workTaskRepository.InsertAsync(insertObj); - + await _workTaskRepository.InsertAsync(insertObj); + //if (input.Sort.HasValue && insertObj.Sort != maxSort) //{ // await AdjustSortAsync(insertObj.Id, insertObj.Sort); //} - - return ObjectMapper.Map<WorkTask, WorkTaskDto>(insertObj); - } - + + return ObjectMapper.Map<WorkTask, WorkTaskDto>(insertObj); + } + /// <summary> /// 鏇存柊浣滀笟浠诲姟琛� /// </summary> @@ -131,74 +130,37 @@ /// <param name="input"></param> /// <returns></returns> /// <exception cref="UserFriendlyException"></exception> - public virtual async Task<WorkTaskDto> UpdateAsync(Guid id, WorkTaskUpdateDto input) - { - await CheckCreateOrUpdateDtoAsync(input); - - var updateObj = await _workTaskRepository.GetAsync(id); - var exist = await _workTaskRepository.NameExistAsync(input.Son_TaskCode, updateObj.Id); - if (exist) - { - throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.Son_TaskCode]); - } - - updateObj.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); - input.MapExtraPropertiesTo(updateObj, MappingPropertyDefinitionChecks.None); - - updateObj.Son_TaskCode = input.Son_TaskCode; - updateObj.TaskCode = input.TaskCode; - updateObj.WorkPlanStatus = input.WorkPlanStatus; - updateObj.CallMaterialStatus = input.CallMaterialStatus; - updateObj.DataIdentifier = input.DataIdentifier; - updateObj.MaterialMode = input.MaterialMode; - updateObj.Length = input.Length; - updateObj.MarkingContent = input.MarkingContent; - updateObj.MarkingPosition = input.MarkingPosition; - updateObj.CuttingPosition = input.CuttingPosition; - updateObj.Quantity = input.Quantity; - updateObj.FlangeThickness = input.FlangeThickness; - updateObj.FlangeInnerDiameter = input.FlangeInnerDiameter; - updateObj.WeldingHeatInput = input.WeldingHeatInput; - updateObj.PipeAllowableStress = input.PipeAllowableStress; - updateObj.PipeDiameter = input.PipeDiameter; - updateObj.PipeWallThickness = input.PipeWallThickness; - updateObj.FactoryCode = input.FactoryCode; - updateObj.ProductCode = input.ProductCode; - updateObj.WorkstationCode = input.WorkstationCode; - updateObj.EquipmentCode = input.EquipmentCode; - updateObj.ProdLineCode = input.ProdLineCode; - updateObj.ShipNumber = input.ShipNumber; - updateObj.ProjectNumber = input.ProjectNumber; - updateObj.ProcessName = input.ProcessName; - updateObj.PipeFittingCode = input.PipeFittingCode; - updateObj.PreSerialNumber = input.PreSerialNumber; - updateObj.PipeSpecCode = input.PipeSpecCode; - updateObj.PipeSectionName = input.PipeSectionName; - updateObj.OuterDiameter = input.OuterDiameter; - updateObj.Thickness = input.Thickness; - updateObj.Material = input.Material; - updateObj.ProcessRouteNumber = input.ProcessRouteNumber; - updateObj.PlannedStartTime = input.PlannedStartTime; - updateObj.PlannedEndTime = input.PlannedEndTime; - updateObj.TeamInfo = input.TeamInfo; - updateObj.Timestamp = input.Timestamp; - updateObj.Remark = input.Remark; - - + public virtual async Task<WorkTaskDto> UpdateAsync(Guid id, WorkTaskUpdateDto input) + { + await CheckCreateOrUpdateDtoAsync(input); + + var updateObj = await _workTaskRepository.GetAsync(id); + var exist = await _workTaskRepository.NameExistAsync(input.Son_TaskCode, updateObj.Id); + if (exist) + { + throw new UserFriendlyException(L[CMSPluginDomainErrorCodes.NameAlreadyExists, input.Son_TaskCode]); + } + + updateObj.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); + input.MapExtraPropertiesTo(updateObj, MappingPropertyDefinitionChecks.None); + + // 鎵归噺璧嬪�兼墍鏈夊彲鏄犲皠瀛楁锛堥�氳繃鍖垮悕瀵硅薄锛� + updateObj = ObjectMapper.Map(input, updateObj); // 绛夋晥浜庢墜鍔ㄨ祴鍊兼墍鏈夊尮閰嶅瓧娈� + updateObj.LastModifierName = input.LastModifierName;//淇敼浜� - - await _workTaskRepository.UpdateAsync(updateObj); - - return ObjectMapper.Map<WorkTask, WorkTaskDto>(updateObj); - } - + + await _workTaskRepository.UpdateAsync(updateObj); + + return ObjectMapper.Map<WorkTask, WorkTaskDto>(updateObj); + } + /// <summary> /// 鍏嬮殕浣滀笟浠诲姟琛� /// </summary> /// <param name="ids"></param> /// <returns></returns> - public async Task<List<WorkTaskDto>> CloneAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser) - { + public async Task<List<WorkTaskDto>> CloneAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser) + { //var workTasks = new List<WorkTask>(); //if (ids != null) //{ @@ -218,317 +180,234 @@ // name += WorkTaskConsts.CloneTag; // continue; // } - + // notExist = true; // } - + // //WorkTask = await _workTaskRepository.InsertAsync(WorkTask.Clone(GuidGenerator.Create(), name, sort++)); // workTasks.Add(WorkTask); // } // } //} - + //return ObjectMapper.Map<List<WorkTask>, List<WorkTaskDto>>(workTasks); - return new List<WorkTaskDto>(); - } - + return new List<WorkTaskDto>(); + } + /// <summary> /// 鍒犻櫎鍗曚釜浣滀笟浠诲姟琛� /// </summary> /// <param name="id"></param> /// <returns></returns> - public virtual Task DeleteAsync(Guid id) - { - return _workTaskRepository.DeleteAsync(id); - } - + public virtual Task DeleteAsync(Guid id) + { + return _workTaskRepository.DeleteAsync(id); + } + /// <summary> /// 鍒犻櫎澶氫釜浣滀笟浠诲姟琛� /// </summary> /// <param name="ids"></param> /// <returns></returns> - public async Task DeleteManyAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser) - { - foreach (var id in ids) - { - await DeleteAsync(id); - } - } - - /// <summary> + public async Task DeleteManyAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser) + { + foreach (var id in ids) + { + await DeleteAsync(id); + } + } + + /// <summary> /// 鐗╃悊鍒犻櫎浣滀笟浠诲姟琛� /// </summary> /// <param name="id">涓婚敭ID</param> /// <param name="cancellationToken"></param> /// <returns></returns> - public virtual async Task DeletePermanentlyAsync(Guid id, MyCurrentUser myCurrentUser, CancellationToken cancellationToken = default) - { - _workTaskRepository.DeletePermanentlyAsync(id); - } - + public virtual async Task DeletePermanentlyAsync(Guid id, MyCurrentUser myCurrentUser, CancellationToken cancellationToken = default) + { + _workTaskRepository.DeletePermanentlyAsync(id); + } + /// <summary> /// 鎵归噺鐗╃悊鍒犻櫎浣滀笟浠诲姟琛紙鐩存帴鍒犻櫎锛屼笉杞垹闄わ級 /// </summary> /// <param name="ids">瑕佸垹闄ょ殑涓婚敭ID鍒楄〃</param> /// <param name="cancellationToken"></param> /// <returns></returns> - public virtual async Task BatchDeletePermanentlyAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser, CancellationToken cancellationToken = default) - { - _workTaskRepository.BatchDeletePermanentlyAsync(ids); - } - + public virtual async Task BatchDeletePermanentlyAsync(IEnumerable<Guid> ids, MyCurrentUser myCurrentUser, CancellationToken cancellationToken = default) + { + _workTaskRepository.BatchDeletePermanentlyAsync(ids); + } + /// <summary> /// 璋冩暣鎺掑簭浣滀笟浠诲姟琛� /// </summary> /// <param name="id"></param> /// <param name="sort"></param> /// <returns></returns> - public virtual async Task AdjustSortAsync(Guid id, int sort) - { - //var list = await _workTaskRepository.GetListAsync(null, nameof(WorkTask.Sort)); - //if (list != null && list.Any()) - //{ - // var initSort = 1; - // list.ForEach(x => x.AdjustSort(initSort++)); - // var entity = list.FirstOrDefault(x => x.Id == id); - // if (entity != null) - // { - // if (sort == 1) - // { - // list.Where(x => x.Id != id).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); - // } - // else if (entity.Sort > sort) - // { - // list.Where(x => x.Id != id && x.Sort >= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); - // list.Where(x => x.Id != id && x.Sort < sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); - // } - // else if (entity.Sort < sort) - // { - // list.Where(x => x.Id != id && x.Sort > sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); - // list.Where(x => x.Id != id && x.Sort <= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); - // } - - // entity.AdjustSort(sort); - // } - //} - - //await _workTaskRepository.UpdateManyAsync(list); - } - + public virtual async Task AdjustSortAsync(Guid id, int sort) + { + var list = await _workTaskRepository.GetListAsync(null, nameof(WorkTask.Sort)); + if (list != null && list.Any()) + { + var initSort = 1; + list.ForEach(x => x.AdjustSort(initSort++)); + var entity = list.FirstOrDefault(x => x.Id == id); + if (entity != null) + { + if (sort == 1) + { + list.Where(x => x.Id != id).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); + } + else if (entity.Sort > sort) + { + list.Where(x => x.Id != id && x.Sort >= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); + list.Where(x => x.Id != id && x.Sort < sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); + } + else if (entity.Sort < sort) + { + list.Where(x => x.Id != id && x.Sort > sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort + 1)); + list.Where(x => x.Id != id && x.Sort <= sort).ToList()?.ForEach(x => x.AdjustSort(x.Sort - 1)); + } + + entity.AdjustSort(sort); + } + } + + await _workTaskRepository.UpdateManyAsync(list); + } + /// <summary> /// 瀵煎叆浣滀笟浠诲姟琛� /// </summary> /// <param name="input"></param> /// <returns></returns> /// <exception cref="UserFriendlyException"></exception> - public async Task ImportAsync(WorkTasksImportModel input, MyCurrentUser myCurrentUser) - { - Check.NotNull(input, nameof(input)); - - var workTaskCreateDtos = new List<(int RowIndex, WorkTaskCreateDto Item)>(); - var workTaskUpdateDtos = new List<(int RowIndex, Guid Id, WorkTaskUpdateDto Item)>(); - var importItems = input.WorkTasks; - - if (importItems != null && importItems.Any()) - { + public async Task ImportAsync(WorkTasksImportModel input, MyCurrentUser myCurrentUser) + { + Check.NotNull(input, nameof(input)); + + var workTaskCreateDtos = new List<(int RowIndex, WorkTaskCreateDto Item)>(); + var workTaskUpdateDtos = new List<(int RowIndex, Guid Id, WorkTask Item)>(); + var importItems = input.WorkTasks; + + if (importItems != null && importItems.Any()) + { #region 瀵煎叆鏍¢獙 - + // 鍒ゆ柇鍚嶇О鏄惁閲嶅锛屽苟杈撳嚭绗嚑琛岄噸澶� - var duplicateWorkTasks = importItems.GroupBy(x => x.Son_TaskCode).Where(x => x.Count() > 1).ToList(); - if (duplicateWorkTasks?.Any() == true) - { - var duplicateWorkTaskMsgs = duplicateWorkTasks.Select(x => $"绗� {string.Join(",", x.Select(x => x.RowIndex))} 琛岋細{x.Key} 鍚嶇О閲嶅"); - var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝 {string.Join(",", duplicateWorkTaskMsgs)}锛岀粓姝㈠鍏�"; - throw new UserFriendlyException(errorMsg); - } - - #endregion - - foreach (var impItem in importItems) - { - if (impItem.Son_TaskCode.IsNullOrWhiteSpace()) - { - continue; - } - - if (impItem.Son_TaskCode.IsNullOrWhiteSpace()) - { - var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝绗瑊impItem.RowIndex}琛岋細WorkTask鍚嶇О涓嶈兘涓虹┖"; - throw new UserFriendlyException(errorMsg); - } - - var oldWorkTask = await _workTaskRepository.FindByNameAsync(impItem.Son_TaskCode); - if (oldWorkTask != null) - { - var workTaskUpdateDto = new WorkTaskUpdateDto - { - Son_TaskCode = impItem.Son_TaskCode, - TaskCode = impItem.TaskCode, - WorkPlanStatus = impItem.WorkPlanStatus, - CallMaterialStatus = impItem.CallMaterialStatus, - DataIdentifier = impItem.DataIdentifier, - MaterialMode = impItem.MaterialMode, - Length = impItem.Length, - MarkingContent = impItem.MarkingContent, - MarkingPosition = impItem.MarkingPosition, - CuttingPosition = impItem.CuttingPosition, - Quantity = impItem.Quantity, - FlangeThickness = impItem.FlangeThickness, - FlangeInnerDiameter = impItem.FlangeInnerDiameter, - WeldingHeatInput = impItem.WeldingHeatInput, - PipeAllowableStress = impItem.PipeAllowableStress, - PipeDiameter = impItem.PipeDiameter, - PipeWallThickness = impItem.PipeWallThickness, - FactoryCode = impItem.FactoryCode, - ProductCode = impItem.ProductCode, - WorkstationCode = impItem.WorkstationCode, - EquipmentCode = impItem.EquipmentCode, - ProdLineCode = impItem.ProdLineCode, - ShipNumber = impItem.ShipNumber, - ProjectNumber = impItem.ProjectNumber, - ProcessName = impItem.ProcessName, - PipeFittingCode = impItem.PipeFittingCode, - PreSerialNumber = impItem.PreSerialNumber, - PipeSpecCode = impItem.PipeSpecCode, - PipeSectionName = impItem.PipeSectionName, - OuterDiameter = impItem.OuterDiameter, - Thickness = impItem.Thickness, - Material = impItem.Material, - ProcessRouteNumber = impItem.ProcessRouteNumber, - PlannedStartTime = impItem.PlannedStartTime, - PlannedEndTime = impItem.PlannedEndTime, - TeamInfo = impItem.TeamInfo, - Timestamp = impItem.Timestamp, - Remark = impItem.Remark, - - }; - - workTaskUpdateDtos.Add((impItem.RowIndex, oldWorkTask.Id, workTaskUpdateDto)); - } - else - { - var workTaskCreateDto = new WorkTaskCreateDto - { - Son_TaskCode = impItem.Son_TaskCode, - TaskCode = impItem.TaskCode, - WorkPlanStatus = impItem.WorkPlanStatus, - CallMaterialStatus = impItem.CallMaterialStatus, - DataIdentifier = impItem.DataIdentifier, - MaterialMode = impItem.MaterialMode, - Length = impItem.Length, - MarkingContent = impItem.MarkingContent, - MarkingPosition = impItem.MarkingPosition, - CuttingPosition = impItem.CuttingPosition, - Quantity = impItem.Quantity, - FlangeThickness = impItem.FlangeThickness, - FlangeInnerDiameter = impItem.FlangeInnerDiameter, - WeldingHeatInput = impItem.WeldingHeatInput, - PipeAllowableStress = impItem.PipeAllowableStress, - PipeDiameter = impItem.PipeDiameter, - PipeWallThickness = impItem.PipeWallThickness, - FactoryCode = impItem.FactoryCode, - ProductCode = impItem.ProductCode, - WorkstationCode = impItem.WorkstationCode, - EquipmentCode = impItem.EquipmentCode, - ProdLineCode = impItem.ProdLineCode, - ShipNumber = impItem.ShipNumber, - ProjectNumber = impItem.ProjectNumber, - ProcessName = impItem.ProcessName, - PipeFittingCode = impItem.PipeFittingCode, - PreSerialNumber = impItem.PreSerialNumber, - PipeSpecCode = impItem.PipeSpecCode, - PipeSectionName = impItem.PipeSectionName, - OuterDiameter = impItem.OuterDiameter, - Thickness = impItem.Thickness, - Material = impItem.Material, - ProcessRouteNumber = impItem.ProcessRouteNumber, - PlannedStartTime = impItem.PlannedStartTime, - PlannedEndTime = impItem.PlannedEndTime, - TeamInfo = impItem.TeamInfo, - Timestamp = impItem.Timestamp, - Remark = impItem.Remark, - - }; - - workTaskCreateDtos.Add((impItem.RowIndex, workTaskCreateDto)); - } - } - } - + var duplicateWorkTasks = importItems.GroupBy(x => x.Son_TaskCode).Where(x => x.Count() > 1).ToList(); + if (duplicateWorkTasks?.Any() == true) + { + var duplicateWorkTaskMsgs = duplicateWorkTasks.Select(x => $"绗� {string.Join(",", x.Select(x => x.RowIndex))} 琛岋細{x.Key} 鍚嶇О閲嶅"); + var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝 {string.Join(",", duplicateWorkTaskMsgs)}锛岀粓姝㈠鍏�"; + throw new UserFriendlyException(errorMsg); + } + + #endregion + + foreach (var impItem in importItems) + { + if (impItem.Son_TaskCode.IsNullOrWhiteSpace()) + { + continue; + } + + if (impItem.Son_TaskCode.IsNullOrWhiteSpace()) + { + var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝绗瑊impItem.RowIndex}琛岋細WorkTask鍚嶇О涓嶈兘涓虹┖"; + throw new UserFriendlyException(errorMsg); + } + + var oldWorkTask = await _workTaskRepository.FindByNameAsync(impItem.Son_TaskCode); + if (oldWorkTask != null) + { + oldWorkTask = ObjectMapper.Map(impItem, oldWorkTask); // 绛夋晥浜庢墜鍔ㄨ祴鍊兼墍鏈夊尮閰嶅瓧娈� + workTaskUpdateDtos.Add((impItem.RowIndex, oldWorkTask.Id, oldWorkTask)); + } + else + { + var workTaskCreateDto = new WorkTaskCreateDto { }; + workTaskCreateDto = ObjectMapper.Map(impItem, workTaskCreateDto); // 绛夋晥浜庢墜鍔ㄨ祴鍊兼墍鏈夊尮閰嶅瓧娈� + workTaskCreateDtos.Add((impItem.RowIndex, workTaskCreateDto)); + } + } + } + // 鏂板 - foreach (var workTaskDto in workTaskCreateDtos) - { - try - { + foreach (var workTaskDto in workTaskCreateDtos) + { + try + { workTaskDto.Item.CreatorName = myCurrentUser.UserAccount;//鍒涘缓浜� - await CreateAsync(workTaskDto.Item); - } - catch (Exception e) - { - var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝绗瑊workTaskDto.RowIndex}琛岋細{e.Message}锛岀粓姝㈠鍏�"; - throw new UserFriendlyException(errorMsg); - } - } - + await CreateAsync(workTaskDto.Item); + } + catch (Exception e) + { + var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝绗瑊workTaskDto.RowIndex}琛岋細{e.Message}锛岀粓姝㈠鍏�"; + throw new UserFriendlyException(errorMsg); + } + } + // 鏇存柊 - foreach (var workTaskDto in workTaskUpdateDtos) - { - try - { + foreach (var workTaskDto in workTaskUpdateDtos) + { + try + { workTaskDto.Item.LastModifierName = myCurrentUser.UserAccount;//淇敼浜� - await UpdateAsync(workTaskDto.Id, workTaskDto.Item); - } - catch (Exception e) - { - var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝绗瑊workTaskDto.RowIndex}琛岋細{e.Message}锛岀粓姝㈠鍏�"; - throw new UserFriendlyException(errorMsg); - } - } - } - + await _workTaskRepository.UpdateAsync(workTaskDto.Item); + } + catch (Exception e) + { + var errorMsg = $"瀵煎叆澶辫触锛侀厤缃紝绗瑊workTaskDto.RowIndex}琛岋細{e.Message}锛岀粓姝㈠鍏�"; + throw new UserFriendlyException(errorMsg); + } + } + } + /// <summary> /// 瀵煎嚭浣滀笟浠诲姟琛� /// </summary> /// <param name="input"></param> /// <returns></returns> - public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWorkTaskInput input) - { - Check.NotNull(input, nameof(input)); - - if (input.Sorting.IsNullOrWhiteSpace()) - { - input.Sorting = nameof(WorkTask.Sort); - } - + public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWorkTaskInput input) + { + Check.NotNull(input, nameof(input)); + + if (input.Sorting.IsNullOrWhiteSpace()) + { + input.Sorting = nameof(WorkTask.Sort); + } + #region 鍔ㄦ�佹瀯閫犳煡璇㈡潯浠� - + //鍔ㄦ�佹瀯閫犳煡璇㈡潯浠� - var whereConditions = DynamicGetQueryParams(input); - - #endregion - - - var list = await _workTaskRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount, includeDetails: true); - var result = ObjectMapper.Map<List<WorkTask>, List<WorkTaskDto>>(list); - - var sheets = new Dictionary<string, object> - { - ["閰嶇疆"] = ExportHelper.ConvertListToExportData(result), - }; - - var fileName = "浣滀笟浠诲姟"; - return (sheets, fileName); - } - + var whereConditions = DynamicGetQueryParams(input); + + #endregion + + + var list = await _workTaskRepository.GetListAsync(whereConditions, input.Sorting, input.MaxResultCount, input.SkipCount, includeDetails: true); + var result = ObjectMapper.Map<List<WorkTask>, List<WorkTaskDto>>(list); + + var sheets = new Dictionary<string, object> + { + ["閰嶇疆"] = ExportHelper.ConvertListToExportData(result), + }; + + var fileName = "浣滀笟浠诲姟"; + return (sheets, fileName); + } + /// <summary> /// 鏍¢獙浣滀笟浠诲姟琛紝褰撴柊寤烘垨鏇存柊鏃� /// </summary> /// <param name="input"></param> /// <returns></returns> - protected Task CheckCreateOrUpdateDtoAsync(WorkTaskCreateOrUpdateDtoBase input) - { - Check.NotNull(input, nameof(input)); - Check.NotNullOrWhiteSpace(input.Son_TaskCode, "瀛愪换鍔$紪鐮�", 256); + protected Task CheckCreateOrUpdateDtoAsync(WorkTaskCreateOrUpdateDtoBase input) + { + Check.NotNull(input, nameof(input)); + Check.NotNullOrWhiteSpace(input.Son_TaskCode, "瀛愪换鍔$紪鐮�", 256); Check.NotNullOrWhiteSpace(input.TaskCode, "浠诲姟缂栫爜", 256); Check.NotNull(input.WorkPlanStatus, "璁″垝鐘舵��"); Check.NotNull(input.CallMaterialStatus, "鍙枡鐘舵��"); @@ -542,21 +421,21 @@ Check.NotNull(input.PipeWallThickness, "濂楃鐩村緞(mm)"); Check.NotNull(input.OuterDiameter, "澶栧緞(mm)"); Check.NotNull(input.Thickness, "澹佸帤(mm)"); - - return Task.CompletedTask; - } - - /// <summary> + + return Task.CompletedTask; + } + + /// <summary> /// 鏍规嵁鏉′欢鑾峰彇浣滀笟浠诲姟琛ㄥ垪琛� /// </summary> /// <param name="whereConditions"></param> /// <param name="cancellationToken"></param> /// <returns></returns> - public async Task<List<WorkTask>> GetListByFilterAsync(Expression<Func<WorkTask, bool>> whereConditions, CancellationToken cancellationToken = default) - { - return await _workTaskRepository.GetListByFilterAsync(whereConditions); - } - + public async Task<List<WorkTask>> GetListByFilterAsync(Expression<Func<WorkTask, bool>> whereConditions, CancellationToken cancellationToken = default) + { + return await _workTaskRepository.GetListByFilterAsync(whereConditions); + } + /// <summary> /// 鏍规嵁鏉′欢鑾峰彇鍗曚釜浣滀笟浠诲姟琛� /// </summary> @@ -565,59 +444,59 @@ /// <param name="cancellationToken"></param> /// <returns></returns> /// <exception cref="UserFriendlyException"></exception> - public async Task<WorkTask> GetSingleByFilterAsync(Expression<Func<WorkTask, bool>> whereConditions, bool is鈥婱ultipleThrowException = false, CancellationToken cancellationToken = default) - { - return await _workTaskRepository.GetSingleByFilterAsync(whereConditions, is鈥婱ultipleThrowException); - } - - /// <summary> + public async Task<WorkTask> GetSingleByFilterAsync(Expression<Func<WorkTask, bool>> whereConditions, bool is鈥婱ultipleThrowException = false, CancellationToken cancellationToken = default) + { + return await _workTaskRepository.GetSingleByFilterAsync(whereConditions, is鈥婱ultipleThrowException); + } + + /// <summary> /// 鏍规嵁鏉′欢鑾峰彇浣滀笟浠诲姟琛ㄥ垪琛� /// </summary> /// <param name="input"></param> /// <returns></returns> - public virtual async Task<List<WorkTaskDto>> FindListByFilterAsync(GetWorkTaskInput input, CancellationToken cancellationToken = default) - { - Check.NotNull(input, nameof(input)); - - if (input.Sorting.IsNullOrWhiteSpace()) - { - input.Sorting = nameof(WorkTask.Sort); - } - + public virtual async Task<List<WorkTaskDto>> FindListByFilterAsync(GetWorkTaskInput input, CancellationToken cancellationToken = default) + { + Check.NotNull(input, nameof(input)); + + if (input.Sorting.IsNullOrWhiteSpace()) + { + input.Sorting = nameof(WorkTask.Sort); + } + #region 鍔ㄦ�佹瀯閫犳煡璇㈡潯浠� - + //鍔ㄦ�佹瀯閫犳煡璇㈡潯浠� - var whereConditions = DynamicGetQueryParams(input); - - #endregion - - var list = await _workTaskRepository.GetListByFilterAsync(whereConditions?.data); - - return new List<WorkTaskDto>(ObjectMapper.Map<List<WorkTask>, List<WorkTaskDto>>(list)); - } + var whereConditions = DynamicGetQueryParams(input); + + #endregion + + var list = await _workTaskRepository.GetListByFilterAsync(whereConditions?.data); + + return new List<WorkTaskDto>(ObjectMapper.Map<List<WorkTask>, List<WorkTaskDto>>(list)); + } /// <summary> /// 鏍规嵁鏉′欢鑾峰彇鍗曚釜浣滀笟浠诲姟琛� /// </summary> /// <param name="input"></param> /// <returns></returns> - public virtual async Task<WorkTaskDto> FindSingleByFilterAsync(GetWorkTaskInput input, CancellationToken cancellationToken = default) - { - Check.NotNull(input, nameof(input)); - - if (input.Sorting.IsNullOrWhiteSpace()) - { - input.Sorting = nameof(WorkTask.Sort); - } - + public virtual async Task<WorkTaskDto> FindSingleByFilterAsync(GetWorkTaskInput input, CancellationToken cancellationToken = default) + { + Check.NotNull(input, nameof(input)); + + if (input.Sorting.IsNullOrWhiteSpace()) + { + input.Sorting = nameof(WorkTask.Sort); + } + #region 鍔ㄦ�佹瀯閫犳煡璇㈡潯浠� - + //鍔ㄦ�佹瀯閫犳煡璇㈡潯浠� - var whereConditions = DynamicGetQueryParams(input); - - #endregion - - var dataObj = await _workTaskRepository.GetSingleByFilterAsync(whereConditions?.data); - - return (ObjectMapper.Map<WorkTask, WorkTaskDto>(dataObj)); - } -} + var whereConditions = DynamicGetQueryParams(input); + + #endregion + + var dataObj = await _workTaskRepository.GetSingleByFilterAsync(whereConditions?.data); + + return (ObjectMapper.Map<WorkTask, WorkTaskDto>(dataObj)); + } +} diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/MapperProfiles/WorkPlanAutoMapperProfile.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/MapperProfiles/WorkPlanAutoMapperProfile.cs index 1d1cea0..04db4ff 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/MapperProfiles/WorkPlanAutoMapperProfile.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/MapperProfiles/WorkPlanAutoMapperProfile.cs @@ -1,26 +1,40 @@ -using AutoMapper; -using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan; -using CMS.Plugin.PipeLineLems.Domain.WorkPlan; -using Volo.Abp.ObjectExtending; - -namespace CMS.Plugin.PipeLineLems.Application.MapperProfiles; - +using AutoMapper; +using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan; +using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkTask; +using CMS.Plugin.PipeLineLems.Domain.WorkPlan; +using CMS.Plugin.PipeLineLems.Domain.WorkTask; +using Volo.Abp.ObjectExtending; +using static CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan.WorkPlansImportModel; +using static CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkTask.WorkTasksImportModel; + +namespace CMS.Plugin.PipeLineLems.Application.MapperProfiles; + /// <summary> /// 浣滀笟璁″垝琛ˋutoMapper閰嶇疆 /// </summary> /// <seealso cref="AutoMapper.Profile" /> -public class WorkPlanAutoMapperProfile : Profile -{ +public class WorkPlanAutoMapperProfile : Profile +{ /// <summary> /// Initializes a new instance of the <see cref="WorkPlanAutoMapperProfile"/> class. /// </summary> - public WorkPlanAutoMapperProfile() - { + public WorkPlanAutoMapperProfile() + { /* You can configure your AutoMapper mapping configuration here. * Alternatively, you can split your mapping configurations - * into multiple profile classes for a better organization. */ - CreateMap<WorkPlan, WorkPlanDto>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); - CreateMap<WorkPlanCreateDto, WorkPlan>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); - CreateMap<GetWorkPlanInput, WorkPlan>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); - } -} + * into multiple profile classes for a better organization. */ + CreateMap<WorkPlan, WorkPlanDto>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); + CreateMap<WorkPlanCreateDto, WorkPlan>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); + CreateMap<WorkPlanUpdateDto, WorkPlan>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); + CreateMap<GetWorkPlanInput, WorkPlan>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); + + CreateMap<WorkPlanImportModel, WorkPlanCreateDto>(MemberList.None); + CreateMap<WorkPlanImportModel, WorkPlanUpdateDto>(MemberList.None); + + CreateMap<WorkPlanCreateDto, WorkTaskCreateDto>(MemberList.None); + + CreateMap<WorkPlanImportModel, WorkPlanCreateDto>(MemberList.None); + CreateMap<WorkPlanImportModel, WorkPlanUpdateDto>(MemberList.None); + CreateMap<WorkPlanImportModel, WorkPlan>(MemberList.None); + } +} diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/MapperProfiles/WorkTaskAutoMapperProfile.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/MapperProfiles/WorkTaskAutoMapperProfile.cs index 5fd3bb2..404ee5a 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/MapperProfiles/WorkTaskAutoMapperProfile.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Application/MapperProfiles/WorkTaskAutoMapperProfile.cs @@ -1,29 +1,32 @@ -using AutoMapper; -using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkPlan; -using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkTask; -using CMS.Plugin.PipeLineLems.Domain.WorkTask; -using Volo.Abp.ObjectExtending; - -namespace CMS.Plugin.PipeLineLems.Application.MapperProfiles; - +using AutoMapper; +using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkTask; +using CMS.Plugin.PipeLineLems.Domain.WorkTask; +using Volo.Abp.ObjectExtending; +using static CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkTask.WorkTasksImportModel; + +namespace CMS.Plugin.PipeLineLems.Application.MapperProfiles; + /// <summary> /// 浣滀笟浠诲姟琛ˋutoMapper閰嶇疆 /// </summary> /// <seealso cref="AutoMapper.Profile" /> -public class WorkTaskAutoMapperProfile : Profile -{ +public class WorkTaskAutoMapperProfile : Profile +{ /// <summary> /// Initializes a new instance of the <see cref="WorkTaskAutoMapperProfile"/> class. /// </summary> - public WorkTaskAutoMapperProfile() - { + public WorkTaskAutoMapperProfile() + { /* You can configure your AutoMapper mapping configuration here. * Alternatively, you can split your mapping configurations - * into multiple profile classes for a better organization. */ - CreateMap<WorkTask, WorkTaskDto>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); - CreateMap<WorkTaskCreateDto, WorkTask>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); - CreateMap<GetWorkTaskInput, WorkTask>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); - - CreateMap<WorkPlanCreateDto, WorkTaskCreateDto>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); - } -} + * into multiple profile classes for a better organization. */ + CreateMap<WorkTask, WorkTaskDto>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); + CreateMap<WorkTaskCreateDto, WorkTask>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); + CreateMap<GetWorkTaskInput, WorkTask>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); + CreateMap<WorkTaskUpdateDto, WorkTask>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); + + CreateMap<WorkTaskImportModel, WorkTaskCreateDto>(MemberList.None); + CreateMap<WorkTaskImportModel, WorkTaskUpdateDto>(MemberList.None); + CreateMap<WorkTaskImportModel, WorkTask>(MemberList.None); + } +} diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/WorkPlan/WorkPlan.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/WorkPlan/WorkPlan.cs index 6a12be7..a42e676 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/WorkPlan/WorkPlan.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/WorkPlan/WorkPlan.cs @@ -17,6 +17,36 @@ public string TaskCode { get; set; } /// <summary> + /// 绠℃缂栫爜 + /// </summary> + public string PipeSpecCode { get; set; } + + /// <summary> + /// 绠℃鍚嶇О + /// </summary> + public string PipeSectionName { get; set; } + + /// <summary> + /// 绠℃鍨嬪彿 + /// </summary> + public string PipeSpecMode { get; set; } + + /// <summary> + /// 宸ュ簭鍚嶇О + /// </summary> + public string ProcessName { get; set; } + + /// <summary> + /// 鑸瑰彿 + /// </summary> + public string ShipNumber { get; set; } + + /// <summary> + /// 椤圭洰鍙� + /// </summary> + public string ProjectNumber { get; set; } + + /// <summary> /// 璁″垝鐘舵�� /// </summary> public WorkPlanStatusEnum WorkPlanStatus { get; set; } @@ -25,6 +55,11 @@ /// 鍙枡鐘舵�� /// </summary> public CallMaterialStatusEnum CallMaterialStatus { get; set; } + + /// <summary> + /// 宸ヨ壓娴佸悜缂栧彿 + /// </summary> + public string ProcessRouteNumber { get; set; } #region 鍘熸枡绠′俊鎭� @@ -149,20 +184,9 @@ /// </summary> public string ProdLineCode { get; set; } - /// <summary> - /// 鑸瑰彿 - /// </summary> - public string ShipNumber { get; set; } + - /// <summary> - /// 椤圭洰鍙� - /// </summary> - public string ProjectNumber { get; set; } - - /// <summary> - /// 宸ュ簭鍚嶇О - /// </summary> - public string ProcessName { get; set; } + /// <summary> /// 绠′欢缂栫爜 @@ -176,15 +200,7 @@ - /// <summary> - /// 绠℃缂栫爜 - /// </summary> - public string PipeSpecCode { get; set; } - - /// <summary> - /// 绠℃鍚嶇О - /// </summary> - public string PipeSectionName { get; set; } + /// <summary> /// 澶栧緞(mm) @@ -217,10 +233,7 @@ - /// <summary> - /// 宸ヨ壓娴佸悜缂栧彿 - /// </summary> - public string ProcessRouteNumber { get; set; } + /// <summary> /// 璁″垝寮�濮嬫椂闂� diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/WorkTask/WorkTask.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/WorkTask/WorkTask.cs index 68a7843..36b0485 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/WorkTask/WorkTask.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.Domain/WorkTask/WorkTask.cs @@ -24,6 +24,36 @@ public string TaskCode { get; set; } /// <summary> + /// 绠℃缂栫爜 + /// </summary> + public string PipeSpecCode { get; set; } + + /// <summary> + /// 绠℃鍚嶇О + /// </summary> + public string PipeSectionName { get; set; } + + /// <summary> + /// 绠℃鍨嬪彿 + /// </summary> + public string PipeSpecMode { get; set; } + + /// <summary> + /// 宸ュ簭鍚嶇О + /// </summary> + public string ProcessName { get; set; } + + /// <summary> + /// 鑸瑰彿 + /// </summary> + public string ShipNumber { get; set; } + + /// <summary> + /// 椤圭洰鍙� + /// </summary> + public string ProjectNumber { get; set; } + + /// <summary> /// 璁″垝鐘舵�� /// </summary> public WorkPlanStatusEnum WorkPlanStatus { get; set; } @@ -32,6 +62,11 @@ /// 鍙枡鐘舵�� /// </summary> public CallMaterialStatusEnum CallMaterialStatus { get; set; } + + /// <summary> + /// 宸ヨ壓娴佸悜缂栧彿 + /// </summary> + public string ProcessRouteNumber { get; set; } #region 鍘熸枡绠′俊鎭� @@ -156,20 +191,9 @@ /// </summary> public string ProdLineCode { get; set; } - /// <summary> - /// 鑸瑰彿 - /// </summary> - public string ShipNumber { get; set; } - /// <summary> - /// 椤圭洰鍙� - /// </summary> - public string ProjectNumber { get; set; } - /// <summary> - /// 宸ュ簭鍚嶇О - /// </summary> - public string ProcessName { get; set; } + /// <summary> /// 绠′欢缂栫爜 @@ -183,15 +207,7 @@ - /// <summary> - /// 绠℃缂栫爜 - /// </summary> - public string PipeSpecCode { get; set; } - /// <summary> - /// 绠℃鍚嶇О - /// </summary> - public string PipeSectionName { get; set; } /// <summary> /// 澶栧緞(mm) @@ -224,10 +240,7 @@ - /// <summary> - /// 宸ヨ壓娴佸悜缂栧彿 - /// </summary> - public string ProcessRouteNumber { get; set; } + /// <summary> /// 璁″垝寮�濮嬫椂闂� diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Extensions/CMSPluginEfCoreExtensions.WorkPlan.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Extensions/CMSPluginEfCoreExtensions.WorkPlan.cs index acac07c..968e8fd 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Extensions/CMSPluginEfCoreExtensions.WorkPlan.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Extensions/CMSPluginEfCoreExtensions.WorkPlan.cs @@ -73,6 +73,7 @@ b.Property(x => x.PreSerialNumber).HasMaxLength(256).HasComment("椤哄簭鍙�"); b.Property(x => x.PipeSpecCode).HasMaxLength(256).HasComment("绠℃缂栫爜"); b.Property(x => x.PipeSectionName).HasMaxLength(256).HasComment("绠℃鍚嶇О"); + b.Property(x => x.PipeSpecMode).HasMaxLength(256).HasComment("绠℃鍨嬪彿"); b.Property(x => x.OuterDiameter).HasColumnType("decimal(18,2)").HasComment("澶栧緞(mm)"); b.Property(x => x.Thickness).HasColumnType("decimal(18,2)").HasComment("澹佸帤(mm)"); b.Property(x => x.Material).HasMaxLength(256).HasComment("鏉愯川"); diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Extensions/CMSPluginEfCoreExtensions.WorkTask.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Extensions/CMSPluginEfCoreExtensions.WorkTask.cs index 91324a2..1c0f06e 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Extensions/CMSPluginEfCoreExtensions.WorkTask.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.EntityFrameworkCore/Extensions/CMSPluginEfCoreExtensions.WorkTask.cs @@ -75,6 +75,7 @@ b.Property(x => x.PreSerialNumber).HasMaxLength(256).HasComment("椤哄簭鍙�"); b.Property(x => x.PipeSpecCode).HasMaxLength(256).HasComment("绠℃缂栫爜"); b.Property(x => x.PipeSectionName).HasMaxLength(256).HasComment("绠℃鍚嶇О"); + b.Property(x => x.PipeSpecMode).HasMaxLength(256).HasComment("绠℃鍨嬪彿"); b.Property(x => x.OuterDiameter).HasColumnType("decimal(18,2)").HasComment("澶栧緞(mm)"); b.Property(x => x.Thickness).HasColumnType("decimal(18,2)").HasComment("澹佸帤(mm)"); b.Property(x => x.Material).HasMaxLength(256).HasComment("鏉愯川"); diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/20250520032108_Update2.Designer.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/20250521014306_Update2.Designer.cs similarity index 98% rename from PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/20250520032108_Update2.Designer.cs rename to PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/20250521014306_Update2.Designer.cs index b415230..55343b8 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/20250520032108_Update2.Designer.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/20250521014306_Update2.Designer.cs @@ -12,7 +12,7 @@ namespace CMS.Plugin.PipeLineLems.MySQL.Migrations { [DbContext(typeof(CMSPluginDbContext))] - [Migration("20250520032108_Update2")] + [Migration("20250521014306_Update2")] partial class Update2 { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -562,6 +562,11 @@ .HasColumnType("varchar(256)") .HasComment("绠℃缂栫爜"); + b.Property<string>("PipeSpecMode") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasComment("绠℃鍨嬪彿"); + b.Property<decimal>("PipeWallThickness") .HasColumnType("decimal(18,2)") .HasComment("濂楃鐩村緞(mm)"); @@ -855,6 +860,11 @@ .HasColumnType("varchar(256)") .HasComment("绠℃缂栫爜"); + b.Property<string>("PipeSpecMode") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasComment("绠℃鍨嬪彿"); + b.Property<decimal>("PipeWallThickness") .HasColumnType("decimal(18,2)") .HasComment("濂楃鐩村緞(mm)"); diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/20250520032108_Update2.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/20250521014306_Update2.cs similarity index 98% rename from PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/20250520032108_Update2.cs rename to PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/20250521014306_Update2.cs index 991b6d5..fac38b0 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/20250520032108_Update2.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/20250521014306_Update2.cs @@ -152,8 +152,22 @@ Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"), TaskCode = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false, comment: "浠诲姟缂栫爜") .Annotation("MySql:CharSet", "utf8mb4"), + PipeSpecCode = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "绠℃缂栫爜") + .Annotation("MySql:CharSet", "utf8mb4"), + PipeSectionName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "绠℃鍚嶇О") + .Annotation("MySql:CharSet", "utf8mb4"), + PipeSpecMode = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "绠℃鍨嬪彿") + .Annotation("MySql:CharSet", "utf8mb4"), + ProcessName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "宸ュ簭鍚嶇О") + .Annotation("MySql:CharSet", "utf8mb4"), + ShipNumber = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "鑸瑰彿") + .Annotation("MySql:CharSet", "utf8mb4"), + ProjectNumber = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "椤圭洰鍙�") + .Annotation("MySql:CharSet", "utf8mb4"), WorkPlanStatus = table.Column<int>(type: "int", nullable: false, comment: "璁″垝鐘舵��"), CallMaterialStatus = table.Column<int>(type: "int", nullable: false, comment: "鍙枡鐘舵��"), + ProcessRouteNumber = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "宸ヨ壓娴佸悜缂栧彿") + .Annotation("MySql:CharSet", "utf8mb4"), DataIdentifier = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "鍘熸枡鏍囪瘑") .Annotation("MySql:CharSet", "utf8mb4"), MaterialMode = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "鍘熸枡鍨嬪彿") @@ -182,25 +196,13 @@ .Annotation("MySql:CharSet", "utf8mb4"), ProdLineCode = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "浜х嚎缂栫爜") .Annotation("MySql:CharSet", "utf8mb4"), - ShipNumber = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "鑸瑰彿") - .Annotation("MySql:CharSet", "utf8mb4"), - ProjectNumber = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "椤圭洰鍙�") - .Annotation("MySql:CharSet", "utf8mb4"), - ProcessName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "宸ュ簭鍚嶇О") - .Annotation("MySql:CharSet", "utf8mb4"), PipeFittingCode = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "绠′欢缂栫爜") .Annotation("MySql:CharSet", "utf8mb4"), PreSerialNumber = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "椤哄簭鍙�") .Annotation("MySql:CharSet", "utf8mb4"), - PipeSpecCode = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "绠℃缂栫爜") - .Annotation("MySql:CharSet", "utf8mb4"), - PipeSectionName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "绠℃鍚嶇О") - .Annotation("MySql:CharSet", "utf8mb4"), OuterDiameter = table.Column<decimal>(type: "decimal(18,2)", nullable: false, comment: "澶栧緞(mm)"), Thickness = table.Column<decimal>(type: "decimal(18,2)", nullable: false, comment: "澹佸帤(mm)"), Material = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "鏉愯川") - .Annotation("MySql:CharSet", "utf8mb4"), - ProcessRouteNumber = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "宸ヨ壓娴佸悜缂栧彿") .Annotation("MySql:CharSet", "utf8mb4"), PlannedStartTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "璁″垝寮�濮嬫椂闂�"), PlannedEndTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "璁″垝瀹屾垚鏃堕棿"), @@ -254,8 +256,22 @@ .Annotation("MySql:CharSet", "utf8mb4"), TaskCode = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: false, comment: "浠诲姟缂栫爜") .Annotation("MySql:CharSet", "utf8mb4"), + PipeSpecCode = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "绠℃缂栫爜") + .Annotation("MySql:CharSet", "utf8mb4"), + PipeSectionName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "绠℃鍚嶇О") + .Annotation("MySql:CharSet", "utf8mb4"), + PipeSpecMode = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "绠℃鍨嬪彿") + .Annotation("MySql:CharSet", "utf8mb4"), + ProcessName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "宸ュ簭鍚嶇О") + .Annotation("MySql:CharSet", "utf8mb4"), + ShipNumber = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "鑸瑰彿") + .Annotation("MySql:CharSet", "utf8mb4"), + ProjectNumber = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "椤圭洰鍙�") + .Annotation("MySql:CharSet", "utf8mb4"), WorkPlanStatus = table.Column<int>(type: "int", nullable: false, comment: "璁″垝鐘舵��"), CallMaterialStatus = table.Column<int>(type: "int", nullable: false, comment: "鍙枡鐘舵��"), + ProcessRouteNumber = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "宸ヨ壓娴佸悜缂栧彿") + .Annotation("MySql:CharSet", "utf8mb4"), DataIdentifier = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "鍘熸枡鏍囪瘑") .Annotation("MySql:CharSet", "utf8mb4"), MaterialMode = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "鍘熸枡鍨嬪彿") @@ -284,25 +300,13 @@ .Annotation("MySql:CharSet", "utf8mb4"), ProdLineCode = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "浜х嚎缂栫爜") .Annotation("MySql:CharSet", "utf8mb4"), - ShipNumber = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "鑸瑰彿") - .Annotation("MySql:CharSet", "utf8mb4"), - ProjectNumber = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "椤圭洰鍙�") - .Annotation("MySql:CharSet", "utf8mb4"), - ProcessName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "宸ュ簭鍚嶇О") - .Annotation("MySql:CharSet", "utf8mb4"), PipeFittingCode = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "绠′欢缂栫爜") .Annotation("MySql:CharSet", "utf8mb4"), PreSerialNumber = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "椤哄簭鍙�") .Annotation("MySql:CharSet", "utf8mb4"), - PipeSpecCode = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "绠℃缂栫爜") - .Annotation("MySql:CharSet", "utf8mb4"), - PipeSectionName = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "绠℃鍚嶇О") - .Annotation("MySql:CharSet", "utf8mb4"), OuterDiameter = table.Column<decimal>(type: "decimal(18,2)", nullable: false, comment: "澶栧緞(mm)"), Thickness = table.Column<decimal>(type: "decimal(18,2)", nullable: false, comment: "澹佸帤(mm)"), Material = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "鏉愯川") - .Annotation("MySql:CharSet", "utf8mb4"), - ProcessRouteNumber = table.Column<string>(type: "varchar(256)", maxLength: 256, nullable: true, comment: "宸ヨ壓娴佸悜缂栧彿") .Annotation("MySql:CharSet", "utf8mb4"), PlannedStartTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "璁″垝寮�濮嬫椂闂�"), PlannedEndTime = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "璁″垝瀹屾垚鏃堕棿"), diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/CMSPluginDbContextModelSnapshot.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/CMSPluginDbContextModelSnapshot.cs index 6135f3c..9f155a6 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/CMSPluginDbContextModelSnapshot.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems.MySQL/Migrations/CMSPluginDbContextModelSnapshot.cs @@ -560,6 +560,11 @@ .HasColumnType("varchar(256)") .HasComment("绠℃缂栫爜"); + b.Property<string>("PipeSpecMode") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasComment("绠℃鍨嬪彿"); + b.Property<decimal>("PipeWallThickness") .HasColumnType("decimal(18,2)") .HasComment("濂楃鐩村緞(mm)"); @@ -853,6 +858,11 @@ .HasColumnType("varchar(256)") .HasComment("绠℃缂栫爜"); + b.Property<string>("PipeSpecMode") + .HasMaxLength(256) + .HasColumnType("varchar(256)") + .HasComment("绠℃鍨嬪彿"); + b.Property<decimal>("PipeWallThickness") .HasColumnType("decimal(18,2)") .HasComment("濂楃鐩村緞(mm)"); diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMSPluginEntry.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMSPluginEntry.cs index f9efcec..4af0a1d 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMSPluginEntry.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/CMSPluginEntry.cs @@ -50,6 +50,7 @@ context.Services.AddSingleton<IProjectService, PipeLineLemsProjectService>(); context.Services.AddScoped<IMesAppService, MesAppService>(); context.Services.AddScoped<IWorkPlanAppService, WorkPlanAppService>(); + context.Services.AddScoped<IWorkTaskAppService, WorkTaskAppService>(); //context.Services.AddScoped<ILMesOperateAppService, LMesOperateAppService>(); //context.Services.AddScoped<IWmsTaskRepository, EfCoreWmsTaskRepository>(); //context.Services.AddScoped<IWmsMaterialRepository, EfCoreWmsMaterialRepository>(); diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs index 57151fc..33a15cf 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkPlanPublicController.cs @@ -113,6 +113,64 @@ } /// <summary> + /// 涓嬪彂娉曞叞鍐茬爜 + /// </summary> + /// <param name="input">鏍囪瘑绗�.</param> + /// <returns></returns> + [Authorize] + [HttpPost] + [Route("SendFlangeCode")] + public virtual async Task<MesOrderResponse> SendFlangeCode([FromBody] SendFlangeCodeInput input) + { + try + { + MyCurrentUser myCurrentUser = new MyCurrentUser() + { + UserAccount = _currentUser.UserAccount, + UserId = _currentUser.UserId + }; + return await sharedService.SendFlangeCode_StartProduction(input, _serviceProvider, myCurrentUser); + } + catch (Exception ex) + { + return new MesOrderResponse() + { + Code = "400", + Message = ex.Message + }; + } + } + + /// <summary> + /// 娉曞叞鍐茬爜瀹屽伐 + /// </summary> + /// <param name="input"></param> + /// <returns></returns> + [Authorize] + [HttpPost] + [Route("SendFlangeCode_FinishProduction")] + public virtual async Task<MesOrderResponse> SendFlangeCode_FinishProduction([FromBody] CompleteAssemblyProcessInput input) + { + try + { + MyCurrentUser myCurrentUser = new MyCurrentUser() + { + UserAccount = _currentUser.UserAccount, + UserId = _currentUser.UserId + }; + return await sharedService.SendFlangeCode_CompleteAssemblyProcess(_serviceProvider, input, myCurrentUser); + } + catch (Exception ex) + { + return new MesOrderResponse() + { + Code = "400", + Message = ex.Message + }; + } + } + + /// <summary> /// 寮�宸� /// </summary> /// <param name="input"></param> diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkTaskController.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkTaskController.cs index b8da5f6..b65d03a 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkTaskController.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Controller/WorkTaskController.cs @@ -1,8 +1,8 @@ -using Ao.Lang; using CMS.Extensions.Abp.AspNetCore.Mvc.Filters; using CMS.Framework.AspNetCore.Users; using CMS.Plugin.PipeLineLems.Application.Contracts.Dtos.WorkTask; using CMS.Plugin.PipeLineLems.Application.Contracts.Services; +using CmsQueryExtensions.Entitys; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -10,7 +10,6 @@ using System.Reflection; using Volo.Abp; using Volo.Abp.Application.Dtos; -using CmsQueryExtensions.Entitys; namespace CMS.Plugin.PipeLineLems.Controller { diff --git a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs index a15f5b9..9e1ae40 100644 --- a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs +++ b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/ProjectService/PipeLineLemsProjectService.cs @@ -24,6 +24,7 @@ using NPOI.SS.Formula.Functions; using CMS.Plugin.PipeLineLems.Application.Implements; using CmsQueryExtensions.Entitys; +using CMS.Plugin.PipeLineLems.Domain.WorkTask; namespace CMS.Plugin.PipeLineLems.ProjectService { @@ -35,7 +36,6 @@ private IServiceProvider _serviceProvider; private readonly ILogger<PipeLineLemsProjectService> _logger; private readonly IVariableDataCache _variableDataCache; - /// <summary> /// 鍙橀噺鏈嶅姟 @@ -95,6 +95,7 @@ { "瑁呴厤瀹屽伐淇″彿", "瑁呴厤瀹屽伐淇″彿(鎻忚堪)" }, { "鐒婃帴瀹屽伐淇″彿", "鐒婃帴瀹屽伐淇″彿(鎻忚堪)" }, + { "娉曞叞鍐茬爜瀹屽伐淇″彿", "娉曞叞鍐茬爜瀹屽伐淇″彿(鎻忚堪)" }, }; // 鍒涘缓閫氶亾鐩戝惉 @@ -298,6 +299,24 @@ }); } } + + if (changed.Name == "娉曞叞鍐茬爜瀹屽伐淇″彿") + { + if (changed.New?.Value.SafeString().ToBool() == true) + { + _ = Task.Run(async () => + { + await HanlderFor娉曞叞鍐茬爜瀹屽伐淇″彿Async(); + }); + } + else + { + _ = Task.Run(async () => + { + await HanlderFor瀹屽伐淇″彿WhenFalseAsync("娉曞叞鍐茬爜"); + }); + } + } } } @@ -465,7 +484,9 @@ { var workPlanAppService = _serviceProvider.GetRequiredService<IWorkPlanAppService>(); + var workTaskAppService = _serviceProvider.GetRequiredService<IWorkTaskAppService>(); var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>(); + var workTaskRepository = _serviceProvider.GetRequiredService<IWorkTaskRepository>(); var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); using var scope = _serviceProvider.CreateScope(); @@ -492,6 +513,10 @@ if (callMaterialOrder == null) return;//缁撴潫 + //鏍规嵁鍘熸枡鏍囪瘑瀵绘壘 浣滀笟璁″垝 + var workTaskList = await workTaskAppService.GetListByFilterAsync(x => x.DataIdentifier == callMaterialOrder.DataIdentifier); + if (workTaskList?.Count == 0) return;//缁撴潫 + //鏇存柊涓虹敓浜т腑 //鏍规嵁鍘熸枡鏍囪瘑瀵绘壘 浣滀笟璁″垝 var workPlanList = await workPlanAppService.GetListByFilterAsync(x => x.DataIdentifier == callMaterialOrder.DataIdentifier); @@ -507,6 +532,13 @@ }; var ret = _variableService.WriteValueAsync(keyValuePairs_productID); + //鏇存柊 浠诲姟 涓虹敓浜т腑 + var new_workTaskList = workTaskList.Where(x => x.ProcessRouteNumber == "鍒囧壊").ToList(); + foreach (var item in new_workTaskList) + { + item.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.鐢熶骇涓�; + } + await workTaskRepository.UpdateManyAsync(new_workTaskList); //鏇存柊涓虹敓浜т腑 var new_workPlanList = workPlanList.Where(x => x.ProcessRouteNumber == "鍒囧壊").ToList(); @@ -737,7 +769,9 @@ { var workPlanAppService = _serviceProvider.GetRequiredService<IWorkPlanAppService>(); + var workTaskAppService = _serviceProvider.GetRequiredService<IWorkTaskAppService>(); var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>(); + var workTaskRepository = _serviceProvider.GetRequiredService<IWorkTaskRepository>(); var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); using var scope = _serviceProvider.CreateScope(); @@ -763,7 +797,26 @@ callMaterialOrder = await callMaterialOrderAppService.GetSingleByFilterAsync(x => x.WmsTaskNo == myTaskNo); if (callMaterialOrder == null) return;//缁撴潫 + //鏍规嵁鍘熸枡鏍囪瘑瀵绘壘 浣滀笟璁″垝 + var workTaskList = await workTaskAppService.GetListByFilterAsync(x => x.DataIdentifier == callMaterialOrder.DataIdentifier); + if (workTaskList?.Count == 0) return;//缁撴潫 + var new_workTaskList = workTaskList.Where(x => x.ProcessName == "鍒囧壊宸ュ簭").ToList(); + //鏇存柊涓虹敓浜т腑 + foreach (var item in new_workTaskList) + { + item.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.鐢熶骇涓�; + item.Remark = "鏇存柊鐢熶骇涓�"; + } + await workTaskRepository.UpdateManyAsync(new_workTaskList); + + var new_workTaskList_printCode = workTaskList.Where(x => x.ProcessName == "鎵撶爜宸ュ簭").ToList(); + foreach (var item in new_workTaskList_printCode) + { + item.WorkPlanStatus = Domain.Shared.Enums.WorkPlanStatusEnum.宸插畬鎴�; + item.Remark = "鏇存柊宸插畬鎴�"; + } + await workTaskRepository.UpdateManyAsync(new_workTaskList_printCode); //鏍规嵁鍘熸枡鏍囪瘑瀵绘壘 浣滀笟璁″垝 var workPlanList = await workPlanAppService.GetListByFilterAsync(x => x.DataIdentifier == callMaterialOrder.DataIdentifier); @@ -778,6 +831,8 @@ { "CMS鍙嶉璇锋眰鐢熸垚鍒囧壊浜у搧鐮佷俊鍙风粨鏋�", true}, }; var ret = _variableService.WriteValueAsync(keyValuePairs_productID); + + var new_workPlanList = workPlanList.Where(x => x.ProcessRouteNumber == "瑁呴厤").ToList(); //鏇存柊涓虹敓浜т腑 @@ -855,12 +910,12 @@ { UserAccount = userName.Content.Value.SafeString().ToString() }; - sharedService.CompleteAssemblyProcess(_serviceProvider, new Application.Contracts.Dtos.WorkPlan.CompleteAssemblyProcessInput() { PipeSpecCode = myPipeSpecCode, ProcessName="瑁呴厤宸ュ簭" }, myCurrentUser); + await sharedService.CompleteAssemblyProcess(_serviceProvider, new Application.Contracts.Dtos.WorkPlan.CompleteAssemblyProcessInput() { PipeSpecCode = myPipeSpecCode, ProcessName = "瑁呴厤宸ュ簭" }, myCurrentUser); } - catch (Exception) + catch (Exception ex) { - + _logger.LogException(ex, LogLevel.Error); } } } @@ -897,12 +952,53 @@ { UserAccount = userName.Content.Value.SafeString().ToString() }; - sharedService.CompleteAssemblyProcess(_serviceProvider, new Application.Contracts.Dtos.WorkPlan.CompleteAssemblyProcessInput() { PipeSpecCode = myPipeSpecCode, ProcessName = "鐒婃帴宸ュ簭" }, myCurrentUser); + await sharedService.CompleteAssemblyProcess(_serviceProvider, new Application.Contracts.Dtos.WorkPlan.CompleteAssemblyProcessInput() { PipeSpecCode = myPipeSpecCode, ProcessName = "鐒婃帴宸ュ簭" }, myCurrentUser); } - catch (Exception) + catch (Exception ex) { + _logger.LogException(ex, LogLevel.Error); + } + } + } + /// <summary> + /// 娉曞叞鍐茬爜瀹屽伐淇″彿=true鏃� + /// </summary> + /// <returns></returns> + private async Task HanlderFor娉曞叞鍐茬爜瀹屽伐淇″彿Async() + { + + var txt = "娉曞叞鍐茬爜"; + var workPlanAppService = _serviceProvider.GetRequiredService<IWorkPlanAppService>(); + var workPlanRepository = _serviceProvider.GetRequiredService<IWorkPlanRepository>(); + var callMaterialOrderAppService = _serviceProvider.GetRequiredService<ICallMaterialOrderAppService>(); + + var pipeSpecCode = await _variableService.ReadValueAsync($"{txt}绠℃缂栫爜"); + + if (string.IsNullOrEmpty(pipeSpecCode?.Content?.Value.SafeString().ToString())) + { + + } + else + { + var myPipeSpecCode = pipeSpecCode.Content.Value.SafeString().ToString(); + CallMaterialOrder callMaterialOrder = null; + try + { + var sharedService = _serviceProvider.GetRequiredService<SharedService>(); + var userName = await _variableService.ReadValueAsync($"{txt}浜�"); + MyCurrentUser myCurrentUser = new MyCurrentUser() + { + UserAccount = userName.Content.Value.SafeString().ToString() + }; + await sharedService.SendFlangeCode_CompleteAssemblyProcess(_serviceProvider, new Application.Contracts.Dtos.WorkPlan.CompleteAssemblyProcessInput() + { PipeSpecCode = myPipeSpecCode, ProcessName = $"{txt}宸ュ簭" }, myCurrentUser); + + } + catch (Exception ex) + { + _logger.LogException(ex, LogLevel.Error); } } } diff --git "a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Resources/Templates/WorkTask\345\257\274\345\207\272\346\250\241\346\235\277.xlsx" "b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Resources/Templates/WorkTask\345\257\274\345\207\272\346\250\241\346\235\277.xlsx" index 6a54540..a51d53a 100644 --- "a/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Resources/Templates/WorkTask\345\257\274\345\207\272\346\250\241\346\235\277.xlsx" +++ "b/PipeLineLems/server/src/CMS.Plugin.PipeLineLems/Resources/Templates/WorkTask\345\257\274\345\207\272\346\250\241\346\235\277.xlsx" Binary files differ diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Generate/AppService/AppService_Generate.cs" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Generate/AppService/AppService_Generate.cs" index aed1c6d..b7b6d7b 100644 --- "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Generate/AppService/AppService_Generate.cs" +++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Generate/AppService/AppService_Generate.cs" @@ -22,11 +22,13 @@ string attrString = ""; List<ColumnModel> newColumnNameList = ListHelper.RemoveAttrForUpdateMode(param.ColumnNameList); - for (int i = 0; i < newColumnNameList.Count; ++i) - { - attrString += StructStrHelper.GenerateAttributeForUpdateModel(newColumnNameList[i], param); - } - str = str.Replace("$UpdateAttributes$", attrString); + + //浼樺寲锛岃繖涓湴鏂逛笉鐢ㄤ簡 + //for (int i = 0; i < newColumnNameList.Count; ++i) + //{ + // attrString += StructStrHelper.GenerateAttributeForUpdateModel(newColumnNameList[i], param); + //} + //str = str.Replace("$UpdateAttributes$", attrString); attrString = ""; for (int i = 0; i < newColumnNameList.Count; ++i) @@ -42,13 +44,13 @@ } str = str.Replace("$UpdateAttributesForCheckCreateOrUpdateDtoAsync$", attrString); - - attrString = ""; - for (int i = 0; i < newColumnNameList.Count; ++i) - { - attrString += StructStrHelper.GenerateAttribute_AppService_ImportAsync(newColumnNameList[i], param); - } - str = str.Replace("$AppService_ImportAsync$", attrString); + //浼樺寲锛岃繖浠g爜涓嶇敤浜� + //attrString = ""; + //for (int i = 0; i < newColumnNameList.Count; ++i) + //{ + // attrString += StructStrHelper.GenerateAttribute_AppService_ImportAsync(newColumnNameList[i], param); + //} + //str = str.Replace("$AppService_ImportAsync$", attrString); return str; } diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.Designer.cs" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.Designer.cs" index 442d677..de87009 100644 --- "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.Designer.cs" +++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.Designer.cs" @@ -570,6 +570,7 @@ this.ck_IsDeletefile.AutoSize = true; this.ck_IsDeletefile.Checked = true; this.ck_IsDeletefile.CheckState = System.Windows.Forms.CheckState.Checked; + this.ck_IsDeletefile.ForeColor = System.Drawing.Color.Red; this.ck_IsDeletefile.Location = new System.Drawing.Point(561, 724); this.ck_IsDeletefile.Name = "ck_IsDeletefile"; this.ck_IsDeletefile.Size = new System.Drawing.Size(192, 16); diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.cs" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.cs" index de76ad1..05d18bf 100644 --- "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.cs" +++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/MainForm.cs" @@ -36,7 +36,7 @@ this.tb_ChinaComment.Text = "鐗╂枡鍩虹淇℃伅琛�";//涓枃娉ㄩ噴 this.tb_MenuName.Text = "鐗╂枡淇℃伅";//涓枃娉ㄩ噴 this.tb_PageMenuInstanceName.Text = "wmsMaterial"; - this.tb_CreatePerson.Text = "shaocx";//鍒涘缓浜� + this.tb_CreatePerson.Text = "";//鍒涘缓浜� this.tb_EntityName.Text = "WmsMaterial";//瀹炰綋绫诲悕 this.tb_LikeQueryAttrs.Text = "'MaterialCode', 'MaterialName', 'Remark'"; diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/AppService/AppService\346\250\241\346\235\277.txt" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/AppService/AppService\346\250\241\346\235\277.txt" index 03b02e3..789e804 100644 --- "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/AppService/AppService\346\250\241\346\235\277.txt" +++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/AppService/AppService\346\250\241\346\235\277.txt" @@ -1,16 +1,15 @@ 锘縰sing CMS.Plugin.$NameSpacePath$.Application.Contracts.Dtos.$EntityName$; using CMS.Plugin.$NameSpacePath$.Application.Contracts.Services; using CMS.Plugin.$NameSpacePath$.Domain.Shared; -using CmsQueryExtensions; using CMS.Plugin.$NameSpacePath$.Domain.$EntityName$; +using CmsQueryExtensions; +using CmsQueryExtensions.Entitys; using CmsQueryExtensions.Extension; using System.Linq.Expressions; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Data; using Volo.Abp.ObjectExtending; -using Volo.Abp.ObjectMapping; -using CmsQueryExtensions.Entitys; namespace CMS.Plugin.$NameSpacePath$.Application.Implements; @@ -145,7 +144,8 @@ updateObj.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); input.MapExtraPropertiesTo(updateObj, MappingPropertyDefinitionChecks.None); - $UpdateAttributes$ + // 鎵归噺璧嬪�兼墍鏈夊彲鏄犲皠瀛楁锛堥�氳繃鍖垮悕瀵硅薄锛� + updateObj = ObjectMapper.Map(input, updateObj); // 绛夋晥浜庢墜鍔ㄨ祴鍊兼墍鏈夊尮閰嶅瓧娈� updateObj.LastModifierName = input.LastModifierName;//淇敼浜� @@ -288,7 +288,7 @@ Check.NotNull(input, nameof(input)); var $EntityInstanceName$CreateDtos = new List<(int RowIndex, $EntityName$CreateDto Item)>(); - var $EntityInstanceName$UpdateDtos = new List<(int RowIndex, Guid Id, $EntityName$UpdateDto Item)>(); + var $EntityInstanceName$UpdateDtos = new List<(int RowIndex, Guid Id, $EntityName$ Item)>(); var importItems = input.$EntityName$s; if (importItems != null && importItems.Any()) @@ -322,20 +322,13 @@ var old$EntityName$ = await _$EntityInstanceName$Repository.FindByNameAsync(impItem.$ValidateRepeatName$); if (old$EntityName$ != null) { - var $EntityInstanceName$UpdateDto = new $EntityName$UpdateDto - { - $AppService_ImportAsync$ - }; - - $EntityInstanceName$UpdateDtos.Add((impItem.RowIndex, old$EntityName$.Id, $EntityInstanceName$UpdateDto)); + old$EntityName$ = ObjectMapper.Map(impItem, old$EntityName$); // 绛夋晥浜庢墜鍔ㄨ祴鍊兼墍鏈夊尮閰嶅瓧娈� + $EntityInstanceName$UpdateDtos.Add((impItem.RowIndex, old$EntityName$.Id, old$EntityName$)); } else { - var $EntityInstanceName$CreateDto = new $EntityName$CreateDto - { - $AppService_ImportAsync$ - }; - + var $EntityInstanceName$CreateDto = new $EntityName$CreateDto { }; + $EntityInstanceName$CreateDto = ObjectMapper.Map(impItem, $EntityInstanceName$CreateDto); // 绛夋晥浜庢墜鍔ㄨ祴鍊兼墍鏈夊尮閰嶅瓧娈� $EntityInstanceName$CreateDtos.Add((impItem.RowIndex, $EntityInstanceName$CreateDto)); } } @@ -362,7 +355,7 @@ try { $EntityInstanceName$Dto.Item.LastModifierName = myCurrentUser.UserAccount;//淇敼浜� - await UpdateAsync($EntityInstanceName$Dto.Id, $EntityInstanceName$Dto.Item); + await _$EntityInstanceName$Repository.UpdateAsync($EntityInstanceName$Dto.Item); } catch (Exception e) { diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/AppService/IAppService\346\250\241\346\235\277.txt" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/AppService/IAppService\346\250\241\346\235\277.txt" index 972c752..29229e8 100644 --- "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/AppService/IAppService\346\250\241\346\235\277.txt" +++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/AppService/IAppService\346\250\241\346\235\277.txt" @@ -1,8 +1,8 @@ 锘縰sing CMS.Plugin.$NameSpacePath$.Application.Contracts.Dtos.$EntityName$; -using Volo.Abp.Application.Services; +using CMS.Plugin.$NameSpacePath$.Domain.$EntityName$; using CmsQueryExtensions.Entitys; using System.Linq.Expressions; -using CMS.Plugin.$NameSpacePath$.Domain.$EntityName$; +using Volo.Abp.Application.Services; namespace CMS.Plugin.$NameSpacePath$.Application.Contracts.Services; diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/Application/MapperProfiles/AutoMapperProfile\346\250\241\346\235\277.txt" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/Application/MapperProfiles/AutoMapperProfile\346\250\241\346\235\277.txt" index 861bae2..6270c59 100644 --- "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/Application/MapperProfiles/AutoMapperProfile\346\250\241\346\235\277.txt" +++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/Application/MapperProfiles/AutoMapperProfile\346\250\241\346\235\277.txt" @@ -2,6 +2,7 @@ using CMS.Plugin.$NameSpacePath$.Application.Contracts.Dtos.$EntityName$; using CMS.Plugin.$NameSpacePath$.Domain.$EntityName$; using Volo.Abp.ObjectExtending; +using static CMS.Plugin.$NameSpacePath$.Application.Contracts.Dtos.$EntityName$.$EntityName$sImportModel; namespace CMS.Plugin.$NameSpacePath$.Application.MapperProfiles; @@ -22,5 +23,10 @@ CreateMap<$EntityName$, $EntityName$Dto>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); CreateMap<$EntityName$CreateDto, $EntityName$>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); CreateMap<Get$EntityName$Input, $EntityName$>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); + CreateMap<$EntityName$UpdateDto, $EntityName$>(MemberList.None).MapExtraProperties(MappingPropertyDefinitionChecks.None); + + CreateMap<$EntityName$ImportModel, $EntityName$CreateDto>(MemberList.None); + CreateMap<$EntityName$ImportModel, $EntityName$UpdateDto>(MemberList.None); + CreateMap<$EntityName$ImportModel, $EntityName$>(MemberList.None); } } diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/Controller\346\250\241\346\235\277.txt" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/Controller\346\250\241\346\235\277.txt" index 86e5ec5..4e3f2f1 100644 --- "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/Controller\346\250\241\346\235\277.txt" +++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/Controller\346\250\241\346\235\277.txt" @@ -1,8 +1,8 @@ -using Ao.Lang; using CMS.Extensions.Abp.AspNetCore.Mvc.Filters; using CMS.Framework.AspNetCore.Users; using CMS.Plugin.$NameSpacePath$.Application.Contracts.Dtos.$EntityName$; using CMS.Plugin.$NameSpacePath$.Application.Contracts.Services; +using CmsQueryExtensions.Entitys; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; @@ -10,7 +10,6 @@ using System.Reflection; using Volo.Abp; using Volo.Abp.Application.Dtos; -using CmsQueryExtensions.Entitys; namespace CMS.Plugin.$NameSpacePath$.Controller { diff --git "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/Web/Views/Pages/EntityNameClass/EntityNameClass\346\250\241\346\235\277.txt" "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/Web/Views/Pages/EntityNameClass/EntityNameClass\346\250\241\346\235\277.txt" index 4e53d26..83af498 100644 --- "a/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/Web/Views/Pages/EntityNameClass/EntityNameClass\346\250\241\346\235\277.txt" +++ "b/Weben_CMS\344\270\223\347\224\250\344\273\243\347\240\201\347\224\237\346\210\220\345\231\250/Code/Templete/Web/Views/Pages/EntityNameClass/EntityNameClass\346\250\241\346\235\277.txt" @@ -25,8 +25,10 @@ import { injectModel } from '@/libs/Provider/Provider' // 引入公共选项配置 import { - FILTER_MODE_OPTIONS_STRING + FILTER_MODE_OPTIONS_STRING_KEY } from '@/components/DyFormForHighQuery/DyFormForHighQueryOptions'; +// 引入公共高级查询工具文件 +import { commonSaveCurHighQueryData,setValueForCurHighQueryData,commonGetHighQueryForm,initQueryForm,GetFilteredData } from '@/utils/myHighQueryUtils'; interface RenderTableType { url?: string @@ -69,12 +71,7 @@ //定义高级查询引用 const $PageMenuInstanceName$QueryDrawerRef=ref(null); - // 新增的查询条件 - const queryForm = ref({ - searchVal: '', - str_searchFormInputAttrs:[], - searchVal_FilterMode:'' - }) + //定义整体模糊查询的列数组(注意:必须大小写跟后端的实体类属性名一致,否则会导致匹配不对的问题) const _searchFormInputAttrs = ref([ $LikeQueryAttrs$ @@ -96,69 +93,40 @@ } } - // 定义响应式查询数据 - const _curHighQueryData = ref({ searchVal: '',str_searchFormInputAttrs:[],searchVal_FilterMode:'' }); + /*******************************************************[高级查询]开始********************************************************************************* */ // 组件挂载时获取枚举数据 onMounted(() => { fetchEnumData() - queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING[0]?.value || ''; - _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode; - _curHighQueryData.value.str_searchFormInputAttrs = _searchFormInputAttrs.value; + resetQuery(); }) - - // 新版的查询方法(主页面中的按钮【查询】) - const handleQueryForMain = async () => { - _curHighQueryData.value.searchVal = queryForm.value.searchVal; - _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode; - _curHighQueryData.value.str_searchFormInputAttrs = _searchFormInputAttrs.value; - tableRef.value.getList(_curHighQueryData.value) - } - // 新版的查询方法(高级查询中的按钮【查询】) - const handleQuery = async (extraParams = {}) => { - let filteredData = commonGetHighQueryForm(extraParams); - commonSaveCurHighQueryData(filteredData); - tableRef.value.getList(filteredData) - } - // 新版的查询重置 - const resetQuery = () => { - queryForm.value.searchVal = '' - queryForm.value.searchVal_FilterMode = FILTER_MODE_OPTIONS_STRING[0]?.value || ''; - queryForm.value.str_searchFormInputAttrs=_searchFormInputAttrs.value; - } - //新版的导出方法 - const handleExport=()=>{ - onExport(_curHighQueryData.value); - } - // 新版的查询弹出框关闭方法 - const closeQuery = (extraParams={}) => { - let filteredData = commonGetHighQueryForm(extraParams); - console.log("closeQuery方法"); - console.log(filteredData); - commonSaveCurHighQueryData(filteredData); - } - //保存查询值 - const commonSaveCurHighQueryData=(filteredData={})=>{ - _curHighQueryData.value = { ..._curHighQueryData.value, ...filteredData }; - _curHighQueryData.value.searchVal = queryForm.value.searchVal - _curHighQueryData.value.searchVal_FilterMode = queryForm.value.searchVal_FilterMode - _curHighQueryData.value.str_searchFormInputAttrs =_searchFormInputAttrs.value; - } - //获取高级查询弹出框的查询值 - const commonGetHighQueryForm=(extraParams={})=>{ - // 过滤掉 undefined 的值 - let filteredData = Object.assign( - {}, - ...Object.entries(extraParams).map(([key, value]) => - value !== undefined ? { [key]: value } : {} - ) - ) - //组合模糊查询 - filteredData.searchVal = queryForm.value.searchVal - filteredData.searchVal_FilterMode = queryForm.value.searchVal_FilterMode - filteredData.str_searchFormInputAttrs =_searchFormInputAttrs.value; - return filteredData; - } - + // 新增的查询条件 + const queryForm = ref({ searchVal: '',str_searchFormInputAttrs:[],searchVal_FilterMode:'' }); + // 定义响应式查询数据 + const _curHighQueryData = ref({ searchVal: '',str_searchFormInputAttrs:[],searchVal_FilterMode:'' }); + // 新版的查询方法(主页面中的按钮【查询】) + const handleQueryForMain = async () => { + setValueForCurHighQueryData(_curHighQueryData,queryForm,_searchFormInputAttrs); + tableRef.value.getList(_curHighQueryData.value) + } + // 新版的查询方法(高级查询中的按钮【查询】) + const handleQuery = async (extraParams = {}) => { + let filteredData = GetFilteredData(extraParams,queryForm,_searchFormInputAttrs,_curHighQueryData); + tableRef.value.getList(filteredData) + } + // 新版的查询重置 + const resetQuery = () => { + initQueryForm(queryForm,_searchFormInputAttrs,FILTER_MODE_OPTIONS_STRING_KEY); + setValueForCurHighQueryData(_curHighQueryData,queryForm,_searchFormInputAttrs); + } + //新版的导出方法 + const handleExport=()=>{ + onExport(_curHighQueryData.value); + } + // 新版的查询弹出框关闭方法 + const closeQuery = (extraParams={}) => { + GetFilteredData(extraParams,queryForm,_searchFormInputAttrs,_curHighQueryData); + } + /*******************************************************[高级查询]结束********************************************************************************* */ /** * @returns 表格 @@ -297,7 +265,7 @@ placeholder="请选择" class={styles.formItem} > - {FILTER_MODE_OPTIONS_STRING.map((option) => ( + {FILTER_MODE_OPTIONS_STRING_KEY.map((option) => ( <ElOption key={option.value} label={option.label} diff --git "a/\347\256\241\345\255\220\347\272\277LMESDemo.cmsproj" "b/\347\256\241\345\255\220\347\272\277LMESDemo.cmsproj" index 335cc93..b7874f3 100644 --- "a/\347\256\241\345\255\220\347\272\277LMESDemo.cmsproj" +++ "b/\347\256\241\345\255\220\347\272\277LMESDemo.cmsproj" Binary files differ -- Gitblit v1.9.3